修订版 | 6143ac1f55dcf3417239369f9f30e8e856643553 (tree) |
---|---|
时间 | 2013-07-10 19:30:05 |
作者 | Mikiya Fujii <mikiya.fujii@gmai...> |
Commiter | Mikiya Fujii |
Rappers of MPI-send and recv are added. #31588
git-svn-id: https://svn.sourceforge.jp/svnroot/molds/branches/mpi-cis@1375 1136aad2-a195-0410-b898-f5ea1d11b9d8
@@ -27,8 +27,10 @@ public: | ||
27 | 27 | static void DeleteInstance(); |
28 | 28 | static MpiProcess* GetInstance(); |
29 | 29 | boost::mpi::communicator* GetCommunicator() const{ return this->communicator;} |
30 | - int GetRank(){return this->communicator->rank();} | |
31 | - int GetSize(){return this->communicator->size();} | |
30 | + int GetRank() const{return this->communicator->rank();} | |
31 | + int GetSize() const{return this->communicator->size();} | |
32 | + template<typename T> void Send(int dest, int tag, const T* values, int n) const{this->communicator->send(dest, tag, values, n);} | |
33 | + template<typename T> void Recv(int source, int tag, T* values, int n) const{this->communicator->recv(source, tag, values, n);} | |
32 | 34 | private: |
33 | 35 | static MpiProcess* mpiProcess; |
34 | 36 | MpiProcess(); |
@@ -1251,7 +1251,7 @@ void ZindoS::CalcCISProperties(){ | ||
1251 | 1251 | if(k%mpiSize == 0){continue;} |
1252 | 1252 | int source = k%mpiSize; |
1253 | 1253 | int tag = k; |
1254 | - world->recv(source, tag, &this->electronicTransitionDipoleMoments[k][0][0], numTransported); | |
1254 | + MolDS_mpi::MpiProcess::GetInstance()->Recv(source, tag, &this->electronicTransitionDipoleMoments[k][0][0], numTransported); | |
1255 | 1255 | } |
1256 | 1256 | } |
1257 | 1257 | else{ |
@@ -1260,7 +1260,7 @@ void ZindoS::CalcCISProperties(){ | ||
1260 | 1260 | if(k%mpiSize != mpiRank){continue;} |
1261 | 1261 | int dest = 0; |
1262 | 1262 | int tag = k; |
1263 | - world->send(dest, tag, &this->electronicTransitionDipoleMoments[k][0][0], numTransported); | |
1263 | + MolDS_mpi::MpiProcess::GetInstance()->Send(dest, tag, &this->electronicTransitionDipoleMoments[k][0][0], numTransported); | |
1264 | 1264 | } |
1265 | 1265 | } |
1266 | 1266 |
@@ -2403,7 +2403,7 @@ void ZindoS::CalcCISMatrix(double** matrixCIS) const{ | ||
2403 | 2403 | if(k%mpiSize == 0){continue;} |
2404 | 2404 | int source = k%mpiSize; |
2405 | 2405 | int tag = k; |
2406 | - world->recv(source, tag, matrixCIS[k], this->matrixCISdimension); | |
2406 | + MolDS_mpi::MpiProcess::GetInstance()->Recv(source, tag, matrixCIS[k], this->matrixCISdimension); | |
2407 | 2407 | } |
2408 | 2408 | } |
2409 | 2409 | else{ |
@@ -2412,7 +2412,7 @@ void ZindoS::CalcCISMatrix(double** matrixCIS) const{ | ||
2412 | 2412 | if(k%mpiSize != mpiRank){continue;} |
2413 | 2413 | int dest = 0; |
2414 | 2414 | int tag = k; |
2415 | - world->send(dest, tag, matrixCIS[k], this->matrixCISdimension); | |
2415 | + MolDS_mpi::MpiProcess::GetInstance()->Send(dest, tag, matrixCIS[k], this->matrixCISdimension); | |
2416 | 2416 | } |
2417 | 2417 | } |
2418 | 2418 |