Changeset 655
- Timestamp:
- 07/24/15 16:40:07 (9 years ago)
- Location:
- XIOS/trunk/src
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/client.cpp
r597 r655 17 17 MPI_Comm CClient::intraComm ; 18 18 MPI_Comm CClient::interComm ; 19 std::list<MPI_Comm> CClient::contextInterComms; 19 20 int CClient::serverLeader ; 20 21 bool CClient::is_MPI_Initialized ; … … 128 129 { 129 130 if (!is_MPI_Initialized) oasis_init(codeId) ; 130 oasis_get_localcomm(intraComm) ; 131 } 132 else MPI_Comm_dup(localComm,&intraComm) ; 131 oasis_get_localcomm(localComm) ; 132 } 133 MPI_Comm_dup(localComm,&intraComm) ; 134 133 135 CTimer::get("XIOS").resume() ; 134 136 CTimer::get("XIOS init").resume() ; … … 191 193 192 194 context->initClient(contextComm,contextInterComm) ; 195 196 contextInterComms.push_back(contextInterComm); 197 MPI_Comm_free(&inter); 193 198 } 194 199 else … … 206 211 // Finally, we should return current context to context client 207 212 CContext::setCurrent(id); 208 // context->initServer(contextComm,contextInterComm) ; 213 214 contextInterComms.push_back(contextInterComm); 209 215 } 210 216 } … … 223 229 } 224 230 225 CTimer::get("XIOS finalize").suspend() ; 226 CTimer::get("XIOS").suspend() ; 231 for (std::list<MPI_Comm>::iterator it = contextInterComms.begin(); it != contextInterComms.end(); it++) 232 MPI_Comm_free(&(*it)); 233 MPI_Comm_free(&interComm); 234 MPI_Comm_free(&intraComm); 235 236 CTimer::get("XIOS finalize").suspend() ; 237 CTimer::get("XIOS").suspend() ; 227 238 228 239 if (!is_MPI_Initialized) -
XIOS/trunk/src/client.hpp
r591 r655 16 16 static MPI_Comm intraComm; 17 17 static MPI_Comm interComm; 18 static std::list<MPI_Comm> contextInterComms; 18 19 static int serverLeader; 19 20 static bool is_MPI_Initialized ; -
XIOS/trunk/src/node/context.cpp
r645 r655 248 248 { 249 249 MPI_Comm_dup(intraComm, &intraCommServer); 250 comms.push_back(intraCommServer); 250 251 MPI_Comm_dup(interComm, &interCommServer); 252 comms.push_back(interCommServer); 251 253 } 252 254 server = new CContextServer(this,intraCommServer,interCommServer); … … 303 305 { 304 306 MPI_Comm_dup(intraComm, &intraCommClient); 307 comms.push_back(intraCommClient); 305 308 MPI_Comm_dup(interComm, &interCommClient); 309 comms.push_back(interCommClient); 306 310 } 307 311 client = new CContextClient(this,intraCommClient,interCommClient, cxtClient); … … 338 342 closeAllFile(); 339 343 } 344 345 for (std::list<MPI_Comm>::iterator it = comms.begin(); it != comms.end(); ++it) 346 MPI_Comm_free(&(*it)); 347 comms.clear(); 340 348 } 341 349 } -
XIOS/trunk/src/node/context.hpp
r645 r655 219 219 StdString idServer_; 220 220 CGarbageCollector garbageCollector; 221 221 std::list<MPI_Comm> comms; //!< Communicators allocated internally 222 222 223 223 public: // Some function maybe removed in the near future -
XIOS/trunk/src/server.cpp
r597 r655 18 18 MPI_Comm CServer::intraComm ; 19 19 list<MPI_Comm> CServer::interComm ; 20 std::list<MPI_Comm> CServer::contextInterComms; 20 21 bool CServer::isRoot ; 21 22 int CServer::rank = INVALID_RANK; … … 110 111 111 112 CTimer::get("XIOS").resume() ; 112 oasis_get_localcomm(intraComm) ; 113 MPI_Comm localComm; 114 oasis_get_localcomm(localComm); 115 MPI_Comm_dup(localComm, &intraComm); 116 113 117 MPI_Comm_rank(intraComm,&rank) ; 114 118 MPI_Comm_size(intraComm,&size) ; … … 144 148 { 145 149 CTimer::get("XIOS").suspend() ; 146 150 147 151 delete eventScheduler ; 148 152 153 for (std::list<MPI_Comm>::iterator it = contextInterComms.begin(); it != contextInterComms.end(); it++) 154 MPI_Comm_free(&(*it)); 155 for (std::list<MPI_Comm>::iterator it = interComm.begin(); it != interComm.end(); it++) 156 MPI_Comm_free(&(*it)); 157 MPI_Comm_free(&intraComm); 158 149 159 if (!is_MPI_Initialized) 150 160 { … … 198 208 MPI_Recv(&msg,1,MPI_INT,0,0,*it,&status) ; 199 209 info(20)<<" CServer : Receive client finalize"<<endl ; 210 MPI_Comm_free(&(*it)); 200 211 interComm.erase(it) ; 201 212 break ; … … 361 372 362 373 363 void CServer::registerContext(void* buff,int count, int leaderRank) 364 { 365 374 void CServer::registerContext(void* buff, int count, int leaderRank) 375 { 366 376 string contextId; 367 CBufferIn buffer(buff,count) ; 368 369 buffer>>contextId ; 370 MPI_Comm contextIntercomm ; 371 MPI_Intercomm_create(intraComm,0,CXios::globalComm,leaderRank,10+leaderRank,&contextIntercomm) ; 372 373 info(20)<<"CServer : Register new Context : "<<contextId<<endl ; 374 MPI_Comm inter ; 375 MPI_Intercomm_merge(contextIntercomm,1,&inter) ; 376 MPI_Barrier(inter) ; 377 CBufferIn buffer(buff, count); 378 buffer >> contextId; 379 380 info(20)<<"CServer : Register new Context : "<<contextId<<endl; 381 377 382 if (contextList.find(contextId)!=contextList.end()) 378 383 ERROR("void CServer::registerContext(void* buff,int count, int leaderRank)", 379 <<"Context has already been registred") ; 380 381 CContext* context=CContext::create(contextId) ; 382 contextList[contextId]=context ; 383 context->initServer(intraComm,contextIntercomm) ; 384 384 << "Context has already been registred"); 385 386 MPI_Comm contextIntercomm; 387 MPI_Intercomm_create(intraComm,0,CXios::globalComm,leaderRank,10+leaderRank,&contextIntercomm); 388 389 MPI_Comm inter; 390 MPI_Intercomm_merge(contextIntercomm,1,&inter); 391 MPI_Barrier(inter); 392 393 CContext* context=CContext::create(contextId); 394 contextList[contextId]=context; 395 context->initServer(intraComm,contextIntercomm); 396 397 contextInterComms.push_back(contextIntercomm); 398 MPI_Comm_free(&inter); 385 399 } 386 400 -
XIOS/trunk/src/server.hpp
r591 r655 25 25 static MPI_Comm intraComm; 26 26 static list<MPI_Comm> interComm; 27 static std::list<MPI_Comm> contextInterComms; 27 28 static CEventScheduler* eventScheduler; 28 29 -
XIOS/trunk/src/test/test_client.f90
r654 r655 133 133 DEALLOCATE(lon, lat, field_A, lonvalue) 134 134 135 CALL MPI_COMM_FREE(comm, ierr) 136 135 137 CALL xios_finalize() 136 138 -
XIOS/trunk/src/test/test_complete.f90
r654 r655 264 264 !!! Fin de XIOS 265 265 266 CALL MPI_COMM_FREE(comm, ierr) 267 266 268 CALL xios_finalize() 267 269 -
XIOS/trunk/src/test/test_cs.f90
r654 r655 145 145 DEALLOCATE(mask) 146 146 147 CALL MPI_COMM_FREE(comm, ierr) 148 147 149 CALL xios_finalize() 148 150 -
XIOS/trunk/src/test/test_new_features.f90
r654 r655 178 178 DEALLOCATE(mask) 179 179 180 CALL MPI_COMM_FREE(comm, ierr) 181 180 182 CALL xios_finalize() 181 183 -
XIOS/trunk/src/test/test_unstruct_complete.f90
r654 r655 238 238 DEALLOCATE(data_i_index) 239 239 240 CALL xios_finalize() 240 CALL MPI_COMM_FREE(comm, ierr) 241 242 CALL xios_finalize() 241 243 242 244 END PROGRAM test_unstruct_complete -
XIOS/trunk/src/test/test_xios_interface.f90
r654 r655 345 345 !!! Fin de XIOS 346 346 347 CALL MPI_COMM_FREE(comm, ierr) 348 347 349 CALL xios_finalize() 348 350
Note: See TracChangeset
for help on using the changeset viewer.