diff options
author | tradke <tradke@21a6bef8-4479-4f54-8f8d-0db94a2919ef> | 2000-09-13 13:49:13 +0000 |
---|---|---|
committer | tradke <tradke@21a6bef8-4479-4f54-8f8d-0db94a2919ef> | 2000-09-13 13:49:13 +0000 |
commit | 8fe367ecf2cbda79960a68a052fdb84916427c0e (patch) | |
tree | 45c017765ab7f0eb6caf97540fc76ffd3bffba59 /src/MPIO.hh | |
parent | c490022d592551af7c29bc960cbbc09daf45972d (diff) |
Importing latest stuff from development repository
git-svn-id: http://svn.cactuscode.org/arrangements/CactusExternal/FlexIO/trunk@2 21a6bef8-4479-4f54-8f8d-0db94a2919ef
Diffstat (limited to 'src/MPIO.hh')
-rw-r--r-- | src/MPIO.hh | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/MPIO.hh b/src/MPIO.hh new file mode 100644 index 0000000..67bfebd --- /dev/null +++ b/src/MPIO.hh @@ -0,0 +1,39 @@ +#ifndef __MPIO_HH_ +#define __MPIO_HH_ + +#include "IEEEIO.hh" +#include "MPIutils.hh" +#include "Timer.hh" + +class MPIO { +typedef float *floatP; +typedef MPI_Request *MPI_RequestP; + + MPIcomm &comm; + int *alldims,*allorigins; + int globaldims[3]; // for all procs + int localorigin[3],localdims[3]; // local dims are full extent + bound & ghost + int root, myid; + IEEEIO *file; // only on master + MPI_Request *sendreq; // is it proper to have a pointer here? + MPI_RequestP recvreq[2]; // double-buffered + floatP slicebuffer[3]; // double-buffered + a scratch space + + +protected: + void sendSlice(int z, float *data, MPI_Request *req); + int requestSlice(int z, float *slicebuffer, MPI_Request *req); + void waitForSlice(int z, float *slicebuffer, float *destbuffer, MPI_Request *req); + void asyncWrite(float *data); +public: + MPIO(IEEEIO *io,MPIcomm &c); + ~MPIO(); + inline int isRoot() { return ((myid==root)?1:0);} + void setLocalDims(int rank,int *origin,int *dims); + virtual int write(float *data){ + asyncWrite(data); + return 1; + } +}; + +#endif |