Skip to content
Snippets Groups Projects
Commit 8acb1a2c authored by Anna Wellmann's avatar Anna Wellmann
Browse files

Reformat communicator

parent a2d0cc73
No related branches found
No related tags found
1 merge request!104Add Communication Hiding to GPU version
...@@ -30,53 +30,53 @@ namespace gpu ...@@ -30,53 +30,53 @@ namespace gpu
class VIRTUALFLUIDS_GPU_EXPORT Communicator class VIRTUALFLUIDS_GPU_EXPORT Communicator
{ {
public: public:
static Communicator* getInstanz(); static Communicator* getInstanz();
static Communicator* getInstanz(const int numberOfProcs); static Communicator* getInstanz(const int numberOfProcs);
void exchngBottomToTop(float* sbuf, float* rbuf, int count); void exchngBottomToTop(float* sbuf, float* rbuf, int count);
void exchngTopToBottom(float* sbuf, float* rbuf, int count); void exchngTopToBottom(float* sbuf, float* rbuf, int count);
void waitAll(); void waitAll();
void distributeGeometry(unsigned int* dataRoot, unsigned int* dataNode, int dataSizePerNode); void distributeGeometry(unsigned int* dataRoot, unsigned int* dataNode, int dataSizePerNode);
int getPID() const; int getPID() const;
int getNummberOfProcess() const; int getNummberOfProcess() const;
int getNeighbourTop(); int getNeighbourTop();
int getNeighbourBottom(); int getNeighbourBottom();
void exchngData(float* sbuf_t, float* rbuf_t, float* sbuf_b, float* rbuf_b, int count); void exchngData(float* sbuf_t, float* rbuf_t, float* sbuf_b, float* rbuf_b, int count);
void exchngDataNB(float* sbuf_t, int count_st, float* rbuf_t, int count_rt, float* sbuf_b, int count_sb, float* rbuf_b, int count_rb); void exchngDataNB(float* sbuf_t, int count_st, float* rbuf_t, int count_rt, float* sbuf_b, int count_sb, float* rbuf_b, int count_rb);
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
void exchngDataGPU(real* sbuf, int count_s, real* rbuf, int count_r, int nb_rank); void exchngDataGPU(real* sbuf, int count_s, real* rbuf, int count_r, int nb_rank);
void sendRecvGPU(real* sbuf, int count_s, real* rbuf, int count_r, int nb_rank); void sendRecvGPU(real* sbuf, int count_s, real* rbuf, int count_r, int nb_rank);
void nbRecvDataGPU( real* rbuf, int count_r, int nb_rank ); void nbRecvDataGPU( real* rbuf, int count_r, int nb_rank );
void nbSendDataGPU( real* sbuf, int count_s, int nb_rank ); void nbSendDataGPU( real* sbuf, int count_s, int nb_rank );
void waitallGPU(); void waitallGPU();
void sendDataGPU( real* sbuf, int count_s, int nb_rank ); void sendDataGPU( real* sbuf, int count_s, int nb_rank );
void waitGPU(int id); void waitGPU(int id);
void resetRequest(); void resetRequest();
void barrierGPU(); void barrierGPU();
void barrier(); void barrier();
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
void exchngDataGeo(int* sbuf_t, int* rbuf_t, int* sbuf_b, int* rbuf_b, int count); void exchngDataGeo(int* sbuf_t, int* rbuf_t, int* sbuf_b, int* rbuf_b, int count);
MPI_Comm getCommunicator(); MPI_Comm getCommunicator();
void startTimer(); void startTimer();
void stopTimer(); void stopTimer();
double getTime(); double getTime();
int mapCudaDevice(const int &rank, const int &size, const std::vector<unsigned int> &devices, const int &maxdev); int mapCudaDevice(const int &rank, const int &size, const std::vector<unsigned int> &devices, const int &maxdev);
protected: protected:
private: private:
static Communicator* instanz; static Communicator* instanz;
int numprocs, PID; int numprocs, PID;
int nbrbottom, nbrtop; int nbrbottom, nbrtop;
MPI_Comm comm1d, commGPU; MPI_Comm comm1d, commGPU;
MPI_Status status[4]; MPI_Status status[4];
MPI_Request request[4]; MPI_Request request[4];
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
std::vector<MPI_Request> requestGPU; std::vector<MPI_Request> requestGPU;
int rcount; int rcount;
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
double starttime; double starttime;
double endtime; double endtime;
Communicator(); Communicator();
Communicator(const int numberOfProcs); Communicator(const int numberOfProcs);
Communicator(const Communicator&); Communicator(const Communicator&);
}; };
} // namespace GPU } // namespace GPU
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment