Changeset 1761 for XIOS/dev/dev_ym/XIOS_SERVICES/src/context_client.cpp
- Timestamp:
- 10/18/19 15:40:35 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_ym/XIOS_SERVICES/src/context_client.cpp
r1757 r1761 24 24 : mapBufferSize_(), parentServer(cxtSer), maxBufferedEvents(4) 25 25 { 26 pureOneSided=CXios::getin<bool>("pure_one_sided",false); // pure one sided communication (for test)27 if (isAttachedModeEnabled()) pureOneSided=false ; // no one sided in attach mode28 26 29 27 context = parent; … … 35 33 int flag; 36 34 MPI_Comm_test_inter(interComm, &flag); 35 if (flag) isAttached_=false ; 36 else isAttached_=true ; 37 38 pureOneSided=CXios::getin<bool>("pure_one_sided",false); // pure one sided communication (for test) 39 if (isAttachedModeEnabled()) pureOneSided=false ; // no one sided in attach mode 40 41 42 37 43 if (flag) MPI_Comm_remote_size(interComm, &serverSize); 38 44 else MPI_Comm_size(interComm, &serverSize); … … 151 157 152 158 checkBuffers(ranks); 153 154 if (isAttachedModeEnabled()) // couldBuffer is always true in attached mode155 {156 waitEvent(ranks);157 CContext::setCurrent(context->getId());158 }159 } 160 159 } 160 161 if (isAttachedModeEnabled()) // couldBuffer is always true in attached mode 162 { 163 waitEvent(ranks); 164 CContext::setCurrent(context->getId()); 165 } 166 161 167 timeLine++; 162 168 } … … 168 174 */ 169 175 void CContextClient::waitEvent(list<int>& ranks) 176 { 177 while (checkBuffers(ranks)) 178 { 179 CXios::getDaemonsManager()->eventLoop() ; 180 } 181 182 MPI_Request req ; 183 MPI_Status status ; 184 185 MPI_Ibarrier(intraComm,&req) ; 186 int flag=false ; 187 188 do 189 { 190 CXios::getDaemonsManager()->eventLoop() ; 191 MPI_Test(&req,&flag,&status) ; 192 } while (!flag) ; 193 194 195 } 196 197 198 void CContextClient::waitEvent_old(list<int>& ranks) 170 199 { 171 200 parentServer->server->setPendingEvent(); … … 227 256 for (itBuffer = bufferList.begin(); itBuffer != bufferList.end(); itBuffer++) (*itBuffer)->unlockBuffer(); 228 257 checkBuffers(); 229 if (CServer::serverLevel == 0) context->server->listen(); 230 else if (CServer::serverLevel == 1) 258 259 context->server->listen(); 260 261 if (context->serverPrimServer.size()>0) 231 262 { 232 context->server->listen();233 263 for (int i = 0; i < context->serverPrimServer.size(); ++i) context->serverPrimServer[i]->listen(); 234 264 CServer::contextEventLoop(false) ; // avoid dead-lock at finalize... 235 265 } 236 237 else if (CServer::serverLevel == 2) context->server->listen();238 266 239 267 } … … 320 348 } 321 349 } 322 }323 350 */ 351 } 352 324 353 325 354 /*! … … 402 431 { 403 432 return !ranksServerLeader.empty(); 404 }405 406 /*!407 * Check if the attached mode is used.408 *409 * \return true if and only if attached mode is used410 */411 bool CContextClient::isAttachedModeEnabled() const412 {413 return (parentServer != 0);414 433 } 415 434
Note: See TracChangeset
for help on using the changeset viewer.