From 8fe367ecf2cbda79960a68a052fdb84916427c0e Mon Sep 17 00:00:00 2001 From: tradke Date: Wed, 13 Sep 2000 13:49:13 +0000 Subject: Importing latest stuff from development repository git-svn-id: http://svn.cactuscode.org/arrangements/CactusExternal/FlexIO/trunk@2 21a6bef8-4479-4f54-8f8d-0db94a2919ef --- src/MPIO.hh | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/MPIO.hh (limited to 'src/MPIO.hh') 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 -- cgit v1.2.3