Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F120300443
io.c
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, Jul 3, 09:47
Size
1011 B
Mime Type
text/x-c
Expires
Sat, Jul 5, 09:47 (2 d)
Engine
blob
Format
Raw Data
Handle
27169299
Attached To
rPNBODY pNbody
io.c
View Options
#include <Python.h>
#include <numpy/arrayobject.h>
#include "structmember.h"
#include <mpi.h>
#include "allvars.h"
#include "proto.h"
#include "ptreelib.h"
/*! This catches I/O errors occuring for my_fwrite(). In this case we
* better stop.
*/
size_t my_fwrite(Tree *self,void *ptr, size_t size, size_t nmemb, FILE * stream)
{
size_t nwritten;
if((nwritten = fwrite(ptr, size, nmemb, stream)) != nmemb)
{
printf("I/O error (fwrite) on task=%d has occured: %s\n", self->ThisTask, strerror(errno));
fflush(stdout);
endrun(self,777);
}
return nwritten;
}
/*! This catches I/O errors occuring for fread(). In this case we
* better stop.
*/
size_t my_fread(Tree *self,void *ptr, size_t size, size_t nmemb, FILE * stream)
{
size_t nread;
if((nread = fread(ptr, size, nmemb, stream)) != nmemb)
{
printf("I/O error (fread) on task=%d has occured: %s\n", self->ThisTask, strerror(errno));
fflush(stdout);
endrun(self,778);
}
return nread;
}
Event Timeline
Log In to Comment