Changeset 992 for XIOS/dev/dev_olga/src/server.cpp
- Timestamp:
- 11/16/16 18:00:52 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_olga/src/server.cpp
r983 r992 18 18 { 19 19 MPI_Comm CServer::intraComm ; 20 list<MPI_Comm> CServer::interCommLeft ; 21 list<MPI_Comm> CServer::interCommRight ; 20 22 list<MPI_Comm> CServer::interComm ; 21 23 std::list<MPI_Comm> CServer::contextInterComms; … … 103 105 104 106 MPI_Intercomm_create(intraComm, 0, CXios::globalComm, clientLeader, 0, &newComm) ; 107 interCommLeft.push_back(newComm) ; 105 108 interComm.push_back(newComm) ; 106 109 } … … 125 128 <<" intraCommRank :"<<intraCommRank<<" clientLeader "<< clientLeader<<endl ; 126 129 MPI_Intercomm_create(intraComm, 0, CXios::globalComm, clientLeader, 0, &newComm) ; 130 interCommLeft.push_back(newComm) ; 127 131 interComm.push_back(newComm) ; 128 132 } … … 134 138 } 135 139 136 CClient::initializeClientOnServer(rank, intraComm, srvSndLeader); 140 CClient::initializeClientOnServer(rank, intraComm, srvSndLeader); 141 interCommRight.push_back(CClient::getInterComm()); 142 interComm.push_back(CClient::getInterComm()); 143 137 144 } 138 145 … … 144 151 if (it->first == hashServer1) 145 152 { 146 // no changes needed here to create one context per process of the secondary server pool147 153 clientLeader=it->second ; 148 154 int intraCommSize, intraCommRank ; … … 153 159 154 160 MPI_Intercomm_create(intraComm, 0, CXios::globalComm, clientLeader, 0, &newComm) ; 161 interCommLeft.push_back(newComm) ; 155 162 interComm.push_back(newComm) ; 156 163 … … 207 214 void CServer::finalize(void) 208 215 { 209 if (CXios::serverLevel == 1)210 {211 CClient::finalize();212 }213 216 214 217 CTimer::get("XIOS").suspend() ; … … 219 222 MPI_Comm_free(&(*it)); 220 223 221 for (std::list<MPI_Comm>::iterator it = interComm.begin(); it != interComm.end(); it++) 224 // for (std::list<MPI_Comm>::iterator it = interComm.begin(); it != interComm.end(); it++) 225 // MPI_Comm_free(&(*it)); 226 227 for (std::list<MPI_Comm>::iterator it = interCommLeft.begin(); it != interCommLeft.end(); it++) 228 MPI_Comm_free(&(*it)); 229 230 for (std::list<MPI_Comm>::iterator it = interCommRight.begin(); it != interCommRight.end(); it++) 222 231 MPI_Comm_free(&(*it)); 223 232 … … 263 272 void CServer::listenFinalize(void) 264 273 { 265 list<MPI_Comm>::iterator it ;274 list<MPI_Comm>::iterator it, itr; 266 275 int msg ; 267 276 int flag ; 268 277 269 for(it=interComm .begin();it!=interComm.end();it++)278 for(it=interCommLeft.begin();it!=interCommLeft.end();it++) 270 279 { 271 280 MPI_Status status ; … … 275 284 if (flag==true) 276 285 { 277 MPI_Recv(&msg,1,MPI_INT,0,0,*it,&status) ; 278 info(20)<<" CServer : Receive client finalize"<<endl ; 286 MPI_Recv(&msg,1,MPI_INT,0,0,*it,&status) ; 287 info(20)<<" CServer : Receive client finalize"<<endl ; 288 289 // If primary server, send finalize to secondary server pool(s) 290 for(itr=interCommRight.begin(); itr!=interCommRight.end(); itr++) 291 { 292 MPI_Send(&msg,1,MPI_INT,0,0,*itr) ; 293 294 // MPI_Comm_free(&(*itr)); 295 // interCommRight.erase(itr) ; 296 } 297 279 298 MPI_Comm_free(&(*it)); 280 interComm.erase(it) ; 299 // interComm.erase(it) ; 300 interCommLeft.erase(it) ; 281 301 break ; 282 302 } 283 303 } 284 304 285 if (interComm.empty()) 305 if (interCommLeft.empty()) 306 // if (interComm.empty()) 286 307 { 287 308 int i,size ;
Note: See TracChangeset
for help on using the changeset viewer.