Changeset 1148 for XIOS/dev/dev_olga/src/client.cpp
- Timestamp:
- 05/31/17 10:36:33 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_olga/src/client.cpp
r1130 r1148 18 18 MPI_Comm CClient::interComm ; 19 19 std::list<MPI_Comm> CClient::contextInterComms; 20 vector <int>CClient::serverLeader;20 int CClient::serverLeader; 21 21 bool CClient::is_MPI_Initialized ; 22 int CClient::rank = INVALID_RANK;22 int CClient::rank_ = INVALID_RANK; 23 23 StdOFStream CClient::m_infoStream; 24 24 StdOFStream CClient::m_errorStream; … … 66 66 67 67 MPI_Comm_size(CXios::globalComm,&size) ; 68 MPI_Comm_rank(CXios::globalComm,&rank );68 MPI_Comm_rank(CXios::globalComm,&rank_); 69 69 70 70 hashAll=new unsigned long[size] ; … … 99 99 100 100 myColor=colors[hashClient] ; 101 MPI_Comm_split(CXios::globalComm,myColor,rank ,&intraComm) ;101 MPI_Comm_split(CXios::globalComm,myColor,rank_,&intraComm) ; 102 102 103 103 if (CXios::usingServer) 104 104 { 105 105 int clientLeader=leaders[hashClient] ; 106 serverLeader .push_back(leaders[hashServer]);106 serverLeader=leaders[hashServer] ; 107 107 int intraCommSize, intraCommRank ; 108 108 MPI_Comm_size(intraComm,&intraCommSize) ; 109 109 MPI_Comm_rank(intraComm,&intraCommRank) ; 110 info(50)<<"intercommCreate::client "<<rank<<" intraCommSize : "<<intraCommSize 111 <<" intraCommRank :"<<intraCommRank<<" clientLeader "<< serverLeader.back()<<endl ; 112 MPI_Intercomm_create(intraComm, 0, CXios::globalComm, serverLeader.back(), 0, &interComm) ; 110 info(50)<<"intercommCreate::client "<<rank_<<" intraCommSize : "<<intraCommSize 111 <<" intraCommRank :"<<intraCommRank<<" clientLeader "<< serverLeader<<endl ; 112 MPI_Intercomm_create(intraComm, 0, CXios::globalComm, serverLeader, 0, &interComm) ; 113 rank_ = intraCommRank; 113 114 } 114 115 else … … 149 150 { 150 151 MPI_Status status ; 151 MPI_Comm_rank(intraComm,&rank ) ;152 MPI_Comm_rank(intraComm,&rank_) ; 152 153 153 154 oasis_get_intercomm(interComm,CXios::xiosCodeId) ; 154 if (rank ==0) MPI_Recv(&serverLeader,1, MPI_INT, 0, 0, interComm, &status) ;155 if (rank_==0) MPI_Recv(&serverLeader,1, MPI_INT, 0, 0, interComm, &status) ; 155 156 MPI_Bcast(&serverLeader,1,MPI_INT,0,intraComm) ; 156 157 … … 216 217 buffer<<msg ; 217 218 218 for (int i = 0; i < serverLeader.size(); ++i) 219 { 220 MPI_Send(buff, buffer.count(), MPI_CHAR, serverLeader[i], 1, CXios::globalComm) ; 221 MPI_Intercomm_create(contextComm, 0, CXios::globalComm, serverLeader[i], 10+globalRank, &contextInterComm) ; 222 info(10)<<"Register new Context : "<<id<<endl ; 223 MPI_Comm inter ; 224 MPI_Intercomm_merge(contextInterComm,0,&inter) ; 225 MPI_Barrier(inter) ; 226 227 context->initClient(contextComm,contextInterComm) ; 228 229 contextInterComms.push_back(contextInterComm); 230 MPI_Comm_free(&inter); 231 } 219 MPI_Send(buff, buffer.count(), MPI_CHAR, serverLeader, 1, CXios::globalComm) ; 220 MPI_Intercomm_create(contextComm, 0, CXios::globalComm, serverLeader, 10+globalRank, &contextInterComm) ; 221 info(10)<<"Register new Context : "<<id<<endl ; 222 MPI_Comm inter ; 223 MPI_Intercomm_merge(contextInterComm,0,&inter) ; 224 MPI_Barrier(inter) ; 225 226 context->initClient(contextComm,contextInterComm) ; 227 228 contextInterComms.push_back(contextInterComm); 229 MPI_Comm_free(&inter); 232 230 delete [] buff ; 233 231 … … 276 274 } 277 275 278 276 /*! 277 * Return rank in model intraComm 278 */ 279 279 int CClient::getRank() 280 280 { 281 return rank ;281 return rank_; 282 282 } 283 283
Note: See TracChangeset
for help on using the changeset viewer.