Changeset 1642 for XIOS/dev/branch_openmp/src/context_client.cpp
- Timestamp:
- 01/23/19 10:31:44 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/branch_openmp/src/context_client.cpp
r1545 r1642 12 12 #include "cxios.hpp" 13 13 #include "server.hpp" 14 using namespace ep_lib;15 14 16 15 namespace xios … … 22 21 \cxtSer [in] cxtSer Pointer to context of server side. (It is only used in case of attached mode). 23 22 */ 24 CContextClient::CContextClient(CContext* parent, MPI_Comm intraComm_,MPI_Comm interComm_, CContext* cxtSer)23 CContextClient::CContextClient(CContext* parent, ep_lib::MPI_Comm intraComm_, ep_lib::MPI_Comm interComm_, CContext* cxtSer) 25 24 : mapBufferSize_(), parentServer(cxtSer), maxBufferedEvents(4) 26 25 { … … 28 27 intraComm = intraComm_; 29 28 interComm = interComm_; 30 MPI_Comm_rank(intraComm, &clientRank);31 MPI_Comm_size(intraComm, &clientSize);29 ep_lib::MPI_Comm_rank(intraComm, &clientRank); 30 ep_lib::MPI_Comm_size(intraComm, &clientSize); 32 31 33 32 int flag; 34 MPI_Comm_test_inter(interComm, &flag);35 if (flag) MPI_Comm_remote_size(interComm, &serverSize);36 else MPI_Comm_size(interComm, &serverSize);33 ep_lib::MPI_Comm_test_inter(interComm, &flag); 34 if (flag) ep_lib::MPI_Comm_remote_size(interComm, &serverSize); 35 else ep_lib::MPI_Comm_size(interComm, &serverSize); 37 36 38 37 computeLeader(clientRank, clientSize, serverSize, ranksServerLeader, ranksServerNotLeader); … … 96 95 { 97 96 list<int> ranks = event.getRanks(); 98 97 info(100)<<"Event "<<timeLine<<" of context "<<context->getId()<<endl ; 99 98 if (CXios::checkEventSync) 100 99 { … … 102 101 typeId_in=event.getTypeId() ; 103 102 classId_in=event.getClassId() ; 104 MPI_Allreduce(&timeLine,&timeLine_out, 1, MPI_LONG_LONG_INT, MPI_SUM, intraComm) ; 105 MPI_Allreduce(&typeId_in,&typeId, 1, MPI_INT, MPI_SUM, intraComm) ; 106 MPI_Allreduce(&classId_in,&classId, 1, MPI_INT, MPI_SUM, intraComm) ; 103 // MPI_Allreduce(&timeLine,&timeLine_out, 1, MPI_UINT64_T, MPI_SUM, intraComm) ; // MPI_UINT64_T standardized by MPI 3 104 ep_lib::MPI_Allreduce(&timeLine,&timeLine_out, 1, EP_LONG_LONG_INT, EP_SUM, intraComm) ; 105 ep_lib::MPI_Allreduce(&typeId_in,&typeId, 1, EP_INT, EP_SUM, intraComm) ; 106 ep_lib::MPI_Allreduce(&classId_in,&classId, 1, EP_INT, EP_SUM, intraComm) ; 107 107 if (typeId/clientSize!=event.getTypeId() || classId/clientSize!=event.getClassId() || timeLine_out/clientSize!=timeLine) 108 108 { … … 124 124 { 125 125 event.send(timeLine, sizes, buffList); 126 info(100)<<"Event "<<timeLine<<" of context "<<context->getId()<<" sent"<<endl ; 126 127 127 128 checkBuffers(ranks); … … 142 143 info(100)<<"DEBUG : temporaly event created : timeline "<<timeLine<<endl ; 143 144 event.send(timeLine, tmpBufferedEvent.sizes, tmpBufferedEvent.buffers); 145 info(100)<<"Event "<<timeLine<<" of context "<<context->getId()<<" sent"<<endl ; 144 146 } 145 147 } … … 341 343 if (ratio < minBufferSizeEventSizeRatio) minBufferSizeEventSizeRatio = ratio; 342 344 } 343 MPI_Allreduce(&minBufferSizeEventSizeRatio, &minBufferSizeEventSizeRatio, 1, MPI_DOUBLE, MPI_MIN, intraComm); 345 #ifdef _usingMPI 346 ep_lib::MPI_Allreduce(MPI_IN_PLACE, &minBufferSizeEventSizeRatio, 1, EP_DOUBLE, EP_MIN, intraComm); 347 #elif _usingEP 348 ep_lib::MPI_Allreduce(&minBufferSizeEventSizeRatio, &minBufferSizeEventSizeRatio, 1, EP_DOUBLE, EP_MIN, intraComm); 349 #endif 344 350 345 351 if (minBufferSizeEventSizeRatio < 1.0) … … 425 431 for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank) 426 432 { 427 #pragma omp critical (_output)428 433 info(100)<<"DEBUG : Sent context Finalize event to rank "<<*itRank<<endl ; 429 434 event.push(*itRank, 1, msg); … … 451 456 for (itMap = itbMap; itMap != iteMap; ++itMap) 452 457 { 453 #pragma omp critical (_output)454 458 report(10) << " Memory report : Context <" << context->getId() << "> : client side : memory used for buffer of each connection to server" << endl 455 459 << " +) To server with rank " << itMap->first << " : " << itMap->second << " bytes " << endl; 456 460 totalBuf += itMap->second; 457 461 } 458 #pragma omp critical (_output)459 462 report(0) << " Memory report : Context <" << context->getId() << "> : client side : total memory used for buffer " << totalBuf << " bytes" << endl; 460 463
Note: See TracChangeset
for help on using the changeset viewer.