Changeset 1784
- Timestamp:
- 12/12/19 18:15:14 (4 years ago)
- Location:
- XIOS/dev/dev_ym/XIOS_COUPLING/src
- Files:
-
- 34 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_ym/XIOS_COUPLING/src/config/coupler_in_attribute.conf
r1782 r1784 1 1 DECLARE_ATTRIBUTE(StdString, context) 2 DECLARE_ATTRIBUTE(bool, enabled) -
XIOS/dev/dev_ym/XIOS_COUPLING/src/config/coupler_out_attribute.conf
r1782 r1784 1 1 DECLARE_ATTRIBUTE(StdString, context) 2 DECLARE_ATTRIBUTE(bool, enabled) -
XIOS/dev/dev_ym/XIOS_COUPLING/src/context_client.hpp
r1761 r1784 65 65 void setBufferSize(const std::map<int,StdSize>& mapSize, const std::map<int,StdSize>& maxEventSize); 66 66 67 int getRemoteSize(void) {return serverSize;} 68 int getServerSize(void) {return serverSize;} 69 67 70 public: 68 71 CContext* context; //!< Context for client -
XIOS/dev/dev_ym/XIOS_COUPLING/src/filter/spatial_transform_filter.cpp
r1645 r1784 187 187 CTimer::get("CSpatialTransformFilterEngine::apply").resume(); 188 188 189 CContext Client* client = CContext::getCurrent()->client;189 CContext* context = CContext::getCurrent(); 190 190 int rank; 191 MPI_Comm_rank (c lient->intraComm, &rank);191 MPI_Comm_rank (context->intraComm_, &rank); 192 192 193 193 // Get default value for output data … … 246 246 } 247 247 sendRecvRequest.push_back(MPI_Request()); 248 MPI_Isend(sendBuff[idxSendBuff], countSize, MPI_DOUBLE, destRank, 12, c lient->intraComm, &sendRecvRequest.back());248 MPI_Isend(sendBuff[idxSendBuff], countSize, MPI_DOUBLE, destRank, 12, context->intraComm_, &sendRecvRequest.back()); 249 249 } 250 250 else … … 279 279 int countSize = itRecv->second.size(); 280 280 sendRecvRequest.push_back(MPI_Request()); 281 MPI_Irecv(recvBuff + currentBuff, countSize, MPI_DOUBLE, srcRank, 12, c lient->intraComm, &sendRecvRequest.back());281 MPI_Irecv(recvBuff + currentBuff, countSize, MPI_DOUBLE, srcRank, 12, context->intraComm_, &sendRecvRequest.back()); 282 282 currentBuff += countSize; 283 283 } -
XIOS/dev/dev_ym/XIOS_COUPLING/src/group_template.hpp
r1542 r1784 72 72 void addChildGroup(V* childGroup) ; 73 73 static bool dispatchEvent(CEventServer& event) ; 74 void sendCreateChild(const string& id="") ;75 74 void sendCreateChild(const string& id, CContextClient* client) ; 76 void sendCreateChildGroup(const string& id ="") ;75 void sendCreateChildGroup(const string& id, CContextClient* client) ; 77 76 static void recvCreateChild(CEventServer& event) ; 78 77 void recvCreateChild(CBufferIn& buffer) ; -
XIOS/dev/dev_ym/XIOS_COUPLING/src/group_template_impl.hpp
r1542 r1784 368 368 return CGroupFactory::AddGroup<V>(this->getShared(), childGroup->getShared()) ; 369 369 } 370 371 372 template <class U, class V, class W>373 void CGroupTemplate<U, V, W>::sendCreateChild(const string& id)374 {375 CContext* context=CContext::getCurrent() ;376 377 if (context->hasClient)378 // if (!context->hasServer )379 {380 // Use correct context client to send message381 // CContextClient* contextClientTmp = (0 != context->clientPrimServer) ? context->clientPrimServer : context->client;382 int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1;383 for (int i = 0; i < nbSrvPools; ++i)384 {385 CContextClient* contextClientTmp = (context->hasServer) ? context->clientPrimServer[i] : context->client;386 387 CEventClient event(this->getType(),EVENT_ID_CREATE_CHILD) ;388 if (contextClientTmp->isServerLeader())389 {390 CMessage msg ;391 msg<<this->getId() ;392 msg<<id ;393 const std::list<int>& ranks = contextClientTmp->getRanksServerLeader();394 for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)395 event.push(*itRank,1,msg) ;396 contextClientTmp->sendEvent(event) ;397 }398 else contextClientTmp->sendEvent(event) ;399 }400 }401 402 }403 370 404 371 template <class U, class V, class W> … … 420 387 } 421 388 422 423 template <class U, class V, class W> 424 void CGroupTemplate<U, V, W>::sendCreateChildGroup(const string& id) 425 { 426 CContext* context=CContext::getCurrent() ; 427 if (context->hasClient) 428 { 429 // Use correct context client to send message 430 // int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1; 431 int nbSrvPools = (context->hasServer) ? (context->hasClient ? context->clientPrimServer.size() : 1) : 1; 432 for (int i = 0; i < nbSrvPools; ++i) 433 { 434 CContextClient* contextClientTmp = (context->hasServer) ? context->clientPrimServer[i] : context->client; 435 CEventClient event(this->getType(),EVENT_ID_CREATE_CHILD_GROUP) ; 436 if (contextClientTmp->isServerLeader()) 437 { 438 CMessage msg ; 439 msg<<this->getId() ; 440 msg<<id ; 441 const std::list<int>& ranks = contextClientTmp->getRanksServerLeader(); 442 for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank) 443 event.push(*itRank,1,msg) ; 444 contextClientTmp->sendEvent(event) ; 445 } 446 else contextClientTmp->sendEvent(event) ; 447 } 448 } 449 } 450 389 template <class U, class V, class W> 390 void CGroupTemplate<U, V, W>::sendCreateChildGroup(const string& id, CContextClient* client) 391 { 392 CEventClient event(this->getType(),EVENT_ID_CREATE_CHILD_GROUP) ; 393 if (client->isServerLeader()) 394 { 395 CMessage msg ; 396 msg<<this->getId() ; 397 msg<<id ; 398 const std::list<int>& ranks = client->getRanksServerLeader(); 399 for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank) 400 event.push(*itRank,1,msg) ; 401 client->sendEvent(event) ; 402 } 403 else client->sendEvent(event) ; 404 } 405 406 451 407 template <class U, class V, class W> 452 408 void CGroupTemplate<U, V, W>::recvCreateChild(CEventServer& event) -
XIOS/dev/dev_ym/XIOS_COUPLING/src/node/axis.cpp
r1761 r1784 600 600 CContext* context = CContext::getCurrent(); 601 601 602 int nbSrvPools = (context->hasServer) ? (context->hasClient ? context->clientPrimServer.size() : 1) : 1; 603 604 connectedServerRank_.clear(); 605 nbSenders.clear(); 606 607 for (int p = 0; p < nbSrvPools; ++p) 608 { 609 CContextClient* client = (0 != context->clientPrimServer.size()) ? context->clientPrimServer[p] : context->client; 602 set<int> listNbServer ; 603 604 for (auto client : clients) 605 { 610 606 int nbServer = client->serverSize; 611 607 int range, clientSize = client->clientSize; 612 608 int rank = client->clientRank; 613 609 614 if (connectedServerRank_.find(nbServer) == connectedServerRank_.end()) 615 { 610 if (listNbServer.find(nbServer)==listNbServer.end()) 611 { 612 listNbServer.insert(nbServer) ; 613 614 if (connectedServerRank_.find(nbServer) != connectedServerRank_.end()) 615 { 616 nbSenders.erase(nbServer); 617 connectedServerRank_.erase(nbServer); 618 } 619 616 620 size_t ni = this->n.getValue(); 617 621 size_t ibegin = this->begin.getValue(); -
XIOS/dev/dev_ym/XIOS_COUPLING/src/node/context.cpp
r1766 r1784 24 24 #include "cxios.hpp" 25 25 #include "client.hpp" 26 #include "coupler_in.hpp" 27 #include "coupler_out.hpp" 26 28 27 29 namespace xios { … … 353 355 { 354 356 intraComm_=intraComm ; 357 MPI_Comm_rank(intraComm_, &intraCommRank_) ; 358 MPI_Comm_size(intraComm_, &intraCommSize_) ; 359 355 360 serviceType_ = CServicesManager::CLIENT ; 356 361 if (serviceType_==CServicesManager::CLIENT) … … 385 390 hasServer=true; 386 391 intraComm_=intraComm ; 392 MPI_Comm_rank(intraComm_, &intraCommRank_) ; 393 MPI_Comm_size(intraComm_, &intraCommSize_) ; 394 387 395 serviceType_=serviceType ; 388 396 … … 544 552 } 545 553 554 for (auto it=couplerClient_.begin(); it!=couplerClient_.end(); ++it) 555 { 556 if (!finalized) it->second->checkBuffers(); 557 } 558 559 for (auto it=couplerServer_.begin(); it!=couplerServer_.end(); ++it) 560 { 561 if (!finalized) it->second->eventLoop(enableEventsProcessing); 562 } 563 546 564 if (server!=nullptr) if (!finalized) finished &= server->eventLoop(enableEventsProcessing); 547 565 … … 549 567 } 550 568 551 569 void CContext::addCouplingChanel(const std::string& context, bool out) 570 { 571 vector<string> vectStr=splitRegex(context,"::") ; 572 string poolId=vectStr[0] ; 573 string serviceId=poolId ; 574 string contextId=vectStr[1] ; 575 576 int contextLeader ; 577 int type = CServicesManager::CLIENT ; 578 string contextName=CXios::getContextsManager()->getServerContextName(poolId, serviceId, 0, type, contextId) ; 579 580 if (couplerClient_.find(contextName)==couplerClient_.end()) 581 { 582 bool ok=CXios::getContextsManager()->getContextLeader(contextName, contextLeader, getIntraComm()) ; 583 584 MPI_Comm interComm, interCommClient, interCommServer ; 585 MPI_Comm intraCommClient, intraCommServer ; 586 587 if (ok) MPI_Intercomm_create(getIntraComm(), 0, CXios::getXiosComm(), contextLeader, 0, &interComm) ; 588 589 MPI_Comm_dup(intraComm_, &intraCommClient) ; 590 MPI_Comm_dup(intraComm_, &intraCommServer) ; 591 if (out) 592 { 593 MPI_Comm_dup(interComm, &interCommClient) ; 594 MPI_Comm_dup(interComm, &interCommServer) ; 595 CContextClient* client = new CContextClient(this, intraCommClient, interCommClient); 596 CContextServer* server = new CContextServer(this, intraCommServer, interCommServer); 597 } 598 else 599 { 600 MPI_Comm_dup(interComm, &interCommServer) ; 601 MPI_Comm_dup(interComm, &interCommClient) ; 602 CContextServer* server = new CContextServer(this, intraCommServer, interCommServer); 603 CContextClient* client = new CContextClient(this, intraCommClient, interCommClient); 604 } 605 MPI_Comm_free(&interComm) ; 606 607 608 // for now, we don't now which beffer size must be used for client coupler 609 // It will be evaluated later. Fix a constant size for now... 610 // set to 10Mb for development 611 map<int,size_t> bufferSize, maxEventSize ; 612 for(int i=0;i<client->getRemoteSize();i++) 613 { 614 bufferSize[i]=10000000 ; 615 maxEventSize[i]=10000000 ; 616 } 617 618 client->setBufferSize(bufferSize, maxEventSize); 619 620 couplerClient_[contextName] = client ; 621 couplerServer_[contextName] = server ; 622 } 623 } 552 624 553 625 void CContext::globalEventLoop(void) … … 649 721 postProcessing(); 650 722 723 // Distribute files between secondary servers according to the data size 724 distributeFiles(); 725 651 726 // Check grid and calculate its distribution 652 727 checkGridEnabledFields(); 653 654 // Distribute files between secondary servers according to the data size655 distributeFiles();656 728 657 729 setClientServerBuffer(client, (hasClient && !hasServer)); … … 659 731 setClientServerBuffer(clientPrimServer[i], true); 660 732 733 661 734 if (hasClient) 662 { 663 // Send all attributes of current context to server 664 this->sendAllAttributesToServer(); 665 666 // Send all attributes of current calendar 667 CCalendarWrapper::get(CCalendarWrapper::GetDefName())->sendAllAttributesToServer(); 735 { 736 if (hasServer) 737 { 738 for (auto it=clientPrimServer.begin(); it!=clientPrimServer.end();++it) 739 { 740 this->sendAllAttributesToServer(*it); // Send all attributes of current context to server 741 CCalendarWrapper::get(CCalendarWrapper::GetDefName())->sendAllAttributesToServer(*it); // Send all attributes of current calendar 742 } 743 } 744 else 745 { 746 this->sendAllAttributesToServer(client); // Send all attributes of current context to server 747 CCalendarWrapper::get(CCalendarWrapper::GetDefName())->sendAllAttributesToServer(client); // Send all attributes of current calendar 748 } 749 668 750 669 751 // We have enough information to send to server … … 779 861 { 780 862 buildFilterGraphOfFieldsWithReadAccess(); 781 postProcessFilterGraph(); 863 postProcessFilterGraph(); // For coupling in, modify this later 782 864 } 783 865 … … 849 931 enabledFiles[i]->checkGridOfEnabledFields(); 850 932 } 933 934 size = enabledCouplerOut.size(); 935 for (int i = 0; i < size; ++i) 936 { 937 enabledCouplerOut[i]->checkGridOfEnabledFields(); 938 } 851 939 } 852 940 CATCH_DUMP_ATTR … … 872 960 \param [in] sendToServer Flag to indicate whether calculated information will be sent 873 961 */ 874 void CContext::solveOnlyRefOfEnabledFields( bool sendToServer)962 void CContext::solveOnlyRefOfEnabledFields(void) 875 963 TRY 876 964 { … … 878 966 for (int i = 0; i < size; ++i) 879 967 { 880 this->enabledFiles[i]->solveOnlyRefOfEnabledFields( sendToServer);968 this->enabledFiles[i]->solveOnlyRefOfEnabledFields(); 881 969 } 882 970 … … 884 972 { 885 973 this->enabledFiles[i]->generateNewTransformationGridDest(); 974 } 975 976 size = this->enabledCouplerOut.size(); 977 for (int i = 0; i < size; ++i) 978 { 979 this->enabledCouplerOut[i]->solveOnlyRefOfEnabledFields(); 980 } 981 982 for (int i = 0; i < size; ++i) 983 { 984 this->enabledCouplerOut[i]->generateNewTransformationGridDest(); 886 985 } 887 986 } … … 894 993 \param [in] sendToServer Flag to indicate whether calculated information will be sent 895 994 */ 896 void CContext::solveAllRefOfEnabledFieldsAndTransform( bool sendToServer)995 void CContext::solveAllRefOfEnabledFieldsAndTransform(void) 897 996 TRY 898 997 { … … 900 999 for (int i = 0; i < size; ++i) 901 1000 { 902 this->enabledFiles[i]->solveAllRefOfEnabledFieldsAndTransform(sendToServer); 903 } 1001 this->enabledFiles[i]->solveAllRefOfEnabledFieldsAndTransform(); 1002 } 1003 1004 size = this->enabledCouplerOut.size(); 1005 for (int i = 0; i < size; ++i) 1006 { 1007 this->enabledCouplerOut[i]->solveAllRefOfEnabledFieldsAndTransform(); 1008 } 1009 904 1010 } 905 1011 CATCH_DUMP_ATTR … … 912 1018 { 913 1019 this->enabledFiles[i]->buildFilterGraphOfEnabledFields(garbageCollector); 1020 } 1021 1022 size = this->enabledCouplerOut.size(); 1023 for (int i = 0; i < size; ++i) 1024 { 1025 this->enabledCouplerOut[i]->buildFilterGraphOfEnabledFields(garbageCollector); 914 1026 } 915 1027 } … … 1002 1114 // Résolution des héritages par référence au niveau des fichiers. 1003 1115 const vector<CFile*> allFiles=CFile::getAll(); 1116 const vector<CCouplerIn*> allCouplerIn=CCouplerIn::getAll(); 1117 const vector<CCouplerOut*> allCouplerOut=CCouplerOut::getAll(); 1004 1118 const vector<CGrid*> allGrids= CGrid::getAll(); 1005 1119 … … 1009 1123 for (unsigned int i = 0; i < allFiles.size(); i++) 1010 1124 allFiles[i]->solveFieldRefInheritance(apply); 1125 1126 for (unsigned int i = 0; i < allCouplerIn.size(); i++) 1127 allCouplerIn[i]->solveFieldRefInheritance(apply); 1128 1129 for (unsigned int i = 0; i < allCouplerOut.size(); i++) 1130 allCouplerOut[i]->solveFieldRefInheritance(apply); 1011 1131 } 1012 1132 … … 1071 1191 CATCH_DUMP_ATTR 1072 1192 1193 void CContext::findEnabledCouplerIn(void) 1194 TRY 1195 { 1196 const std::vector<CCouplerIn*> allCouplerIn = CCouplerIn::getAll(); 1197 bool enabled ; 1198 for (size_t i = 0; i < allCouplerIn.size(); i++) 1199 { 1200 if (allCouplerIn[i]->enabled.isEmpty()) enabled=true ; 1201 else enabled=allCouplerIn[i]->enabled ; 1202 if (enabled) enabledCouplerIn.push_back(allCouplerIn[i]) ; 1203 } 1204 } 1205 CATCH_DUMP_ATTR 1206 1207 void CContext::findEnabledCouplerOut(void) 1208 TRY 1209 { 1210 const std::vector<CCouplerOut*> allCouplerOut = CCouplerOut::getAll(); 1211 bool enabled ; 1212 for (size_t i = 0; i < allCouplerOut.size(); i++) 1213 { 1214 if (allCouplerOut[i]->enabled.isEmpty()) enabled=true ; 1215 else enabled=allCouplerOut[i]->enabled ; 1216 if (enabled) enabledCouplerOut.push_back(allCouplerOut[i]) ; 1217 } 1218 } 1219 CATCH_DUMP_ATTR 1220 1221 1222 1223 1073 1224 void CContext::distributeFiles(void) 1074 1225 TRY … … 1669 1820 findEnabledWriteModeFiles(); 1670 1821 findEnabledReadModeFiles(); 1822 findEnabledCouplerIn(); 1823 findEnabledCouplerOut(); 1824 1825 createCouplerInterCommunicator() ; 1671 1826 1672 1827 // For now, only read files with client and only one level server … … 1689 1844 1690 1845 // Only search and rebuild all reference objects of enable fields, don't transform 1691 this->solveOnlyRefOfEnabledFields( false);1846 this->solveOnlyRefOfEnabledFields(); 1692 1847 1693 1848 // Search and rebuild all reference object of enabled fields, and transform 1694 this->solveAllRefOfEnabledFieldsAndTransform( false);1849 this->solveAllRefOfEnabledFieldsAndTransform(); 1695 1850 1696 1851 // Find all fields with read access from the public API … … 1700 1855 1701 1856 isPostProcessed = true; 1857 } 1858 CATCH_DUMP_ATTR 1859 1860 void CContext::createCouplerInterCommunicator(void) 1861 TRY 1862 { 1863 // juste for test now, in future need an scheduler to avoid dead-lock 1864 for(auto it=enabledCouplerOut.begin();it!=enabledCouplerOut.end();++it) 1865 { 1866 (*it)->createInterCommunicator() ; 1867 } 1868 1869 for(auto it=enabledCouplerIn.begin();it!=enabledCouplerIn.end();++it) 1870 { 1871 (*it)->createInterCommunicator() ; 1872 } 1702 1873 } 1703 1874 CATCH_DUMP_ATTR … … 1953 2124 TRY 1954 2125 { 1955 std::set<StdString> gridIds; 2126 std::set<pair<StdString,CContextClient*>> gridIds; 2127 1956 2128 int sizeFile = activeFiles.size(); 1957 2129 CFile* filePtr(NULL); … … 1966 2138 { 1967 2139 if (0 != enabledFields[numField]->getRelGrid()) 1968 gridIds.insert( CGrid::get(enabledFields[numField]->getRelGrid())->getId());2140 gridIds.insert(make_pair(CGrid::get(enabledFields[numField]->getRelGrid())->getId(),enabledFields[numField]->getContextClient())); 1969 2141 } 1970 2142 } … … 1973 2145 StdString gridDefRoot("grid_definition"); 1974 2146 CGridGroup* gridPtr = CGridGroup::get(gridDefRoot); 1975 std::set<StdString>::const_iterator it, itE = gridIds.end(); 1976 for (it = gridIds.begin(); it != itE; ++it) 1977 { 1978 gridPtr->sendCreateChild(*it); 1979 CGrid::get(*it)->sendAllAttributesToServer(); 1980 CGrid::get(*it)->sendAllDomains(); 1981 CGrid::get(*it)->sendAllAxis(); 1982 CGrid::get(*it)->sendAllScalars(); 2147 for (auto it = gridIds.begin(); it != gridIds.end(); ++it) 2148 { 2149 gridPtr->sendCreateChild(it->first,it->second); 2150 CGrid::get(it->first)->sendAllAttributesToServer(it->second); 2151 CGrid::get(it->first)->sendAllDomains(it->second); 2152 CGrid::get(it->first)->sendAllAxis(it->second); 2153 CGrid::get(it->first)->sendAllScalars(it->second); 1983 2154 } 1984 2155 } … … 1989 2160 TRY 1990 2161 { 1991 std::set< StdString> domainIds, axisIds, scalarIds;2162 std::set<pair<StdString,CContextClient*>> domainIds, axisIds, scalarIds; 1992 2163 1993 2164 // Find all reference domain and axis of all active fields … … 1999 2170 for (int j = 0; j < numEnabledFields; ++j) 2000 2171 { 2172 CContextClient* contextClient=enabledFields[j]->getContextClient() ; 2001 2173 const std::vector<StdString>& prDomAxisScalarId = enabledFields[j]->getRefDomainAxisIds(); 2002 if ("" != prDomAxisScalarId[0]) domainIds.insert( prDomAxisScalarId[0]);2003 if ("" != prDomAxisScalarId[1]) axisIds.insert( prDomAxisScalarId[1]);2004 if ("" != prDomAxisScalarId[2]) scalarIds.insert( prDomAxisScalarId[2]);2174 if ("" != prDomAxisScalarId[0]) domainIds.insert(make_pair(prDomAxisScalarId[0],contextClient)); 2175 if ("" != prDomAxisScalarId[1]) axisIds.insert(make_pair(prDomAxisScalarId[1],contextClient)); 2176 if ("" != prDomAxisScalarId[2]) scalarIds.insert(make_pair(prDomAxisScalarId[2],contextClient)); 2005 2177 } 2006 2178 } … … 2012 2184 StdString scalarDefRoot("scalar_definition"); 2013 2185 CScalarGroup* scalarPtr = CScalarGroup::get(scalarDefRoot); 2014 itE = scalarIds.end();2015 for ( itScalar = scalarIds.begin(); itScalar != itE; ++itScalar)2016 { 2017 if (!itScalar-> empty())2186 2187 for (auto itScalar = scalarIds.begin(); itScalar != scalarIds.end(); ++itScalar) 2188 { 2189 if (!itScalar->first.empty()) 2018 2190 { 2019 scalarPtr->sendCreateChild( *itScalar);2020 CScalar::get( *itScalar)->sendAllAttributesToServer();2191 scalarPtr->sendCreateChild(itScalar->first,itScalar->second); 2192 CScalar::get(itScalar->first)->sendAllAttributesToServer(itScalar->second); 2021 2193 } 2022 2194 } … … 2024 2196 StdString axiDefRoot("axis_definition"); 2025 2197 CAxisGroup* axisPtr = CAxisGroup::get(axiDefRoot); 2026 itE = axisIds.end();2027 for ( itAxis = axisIds.begin(); itAxis != itE; ++itAxis)2028 { 2029 if (!itAxis-> empty())2198 2199 for (auto itAxis = axisIds.begin(); itAxis != axisIds.end(); ++itAxis) 2200 { 2201 if (!itAxis->first.empty()) 2030 2202 { 2031 axisPtr->sendCreateChild( *itAxis);2032 CAxis::get( *itAxis)->sendAllAttributesToServer();2203 axisPtr->sendCreateChild(itAxis->first, itAxis->second); 2204 CAxis::get(itAxis->first)->sendAllAttributesToServer(itAxis->second); 2033 2205 } 2034 2206 } … … 2037 2209 StdString domDefRoot("domain_definition"); 2038 2210 CDomainGroup* domPtr = CDomainGroup::get(domDefRoot); 2039 itE = domainIds.end();2040 for ( itDom = domainIds.begin(); itDom != itE; ++itDom)2041 { 2042 if (!itDom-> empty()) {2043 domPtr->sendCreateChild( *itDom);2044 CDomain::get( *itDom)->sendAllAttributesToServer();2211 2212 for (auto itDom = domainIds.begin(); itDom != domainIds.end(); ++itDom) 2213 { 2214 if (!itDom->first.empty()) { 2215 domPtr->sendCreateChild(itDom->first, itDom->second); 2216 CDomain::get(itDom->first)->sendAllAttributesToServer(itDom->second); 2045 2217 } 2046 2218 } -
XIOS/dev/dev_ym/XIOS_COUPLING/src/node/context.hpp
r1766 r1784 26 26 class CContext; 27 27 class CFile; 28 class CCouplerIn ; 29 class CCouplerOut ; 28 30 ///-------------------------------------------------------------- 29 31 … … 120 122 void solveAllInheritance(bool apply=true); 121 123 void findEnabledFiles(void); 124 void findEnabledCouplerIn(void); 125 void findEnabledCouplerOut(void); 126 void createCouplerInterCommunicator(void) ; 122 127 void findEnabledWriteModeFiles(void); 123 128 void findEnabledReadModeFiles(void); … … 128 133 void checkAxisDomainsGridsEligibilityForCompressedOutput(); 129 134 void prepareTimeseries(void); 130 void solveOnlyRefOfEnabledFields( bool sendToServer);135 void solveOnlyRefOfEnabledFields(void); 131 136 void buildFilterGraphOfEnabledFields(); 132 137 void postProcessFilterGraph(); … … 140 145 void postProcessingGlobalAttributes(); 141 146 142 void solveAllRefOfEnabledFieldsAndTransform( bool sendToServer);147 void solveAllRefOfEnabledFieldsAndTransform(void); 143 148 void checkGridEnabledFields(); 144 149 void checkGridEnabledFieldsInFiles(const std::vector<CFile*>& activeFiles); … … 243 248 bool setProcessingEvent(void) {isProcessingEvent_=true ;} 244 249 bool unsetProcessingEvent(void) {isProcessingEvent_=false ;} 250 MPI_Comm getIntraComm(void) { return intraComm_ ;} 251 252 void addCouplingChanel(const std::string& contextId, bool out) ; 245 253 246 254 public : … … 255 263 std::vector<CFile*> enabledWriteModeFiles; 256 264 265 std::vector<CCouplerIn*> enabledCouplerIn; 266 std::vector<CCouplerOut*> enabledCouplerOut; 267 268 257 269 // List of all enabled fields whose instant data is accessible from the public API 258 270 // but which are not part of a file … … 272 284 std::vector<CContextServer*> serverPrimServer; 273 285 std::vector<CContextClient*> clientPrimServer; 286 std::map<std::string, CContextClient*> couplerClient_ ; 287 std::map<std::string, CContextServer*> couplerServer_ ; 288 289 274 290 std::vector<std::string> primServerId_; 275 291 … … 279 295 280 296 MPI_Comm intraComm_ ; //! context intra communicator 281 297 int intraCommRank_ ; //! context intra communicator rank 298 int intraCommSize_ ; //! context intra communicator size 299 282 300 private: 283 301 bool isPostProcessed; -
XIOS/dev/dev_ym/XIOS_COUPLING/src/node/coupler_in.cpp
r1782 r1784 51 51 CATCH_DUMP_ATTR 52 52 53 53 void CCouplerIn::createInterCommunicator(void) 54 TRY 55 { 56 if (context.isEmpty()) 57 { 58 ERROR("void CCouplerOut::createInterCommunicator(void)", 59 "The attribute <context> must be defined to specify the target coupling context"); 60 } 61 CContext* contextPtr = CContext::getCurrent(); 62 contextPtr->addCouplingChanel(context, false) ; 63 } 64 CATCH_DUMP_ATTR 65 66 54 67 /*! 55 68 \brief Parse xml file and write information into coupler_in object … … 86 99 CATCH 87 100 101 void CCouplerIn::solveDescInheritance(bool apply, const CAttributeMap * const parent) 102 TRY 103 { 104 SuperClassAttribute::setAttributes(parent,apply); 105 this->getVirtualFieldGroup()->solveDescInheritance(apply, NULL); 106 } 107 CATCH_DUMP_ATTR 88 108 109 void CCouplerIn::solveFieldRefInheritance(bool apply) 110 TRY 111 { 112 // Rsolution des hritages par rfrence de chacun des champs contenus dans le fichier. 113 std::vector<CField*> allF = this->getAllFields(); 114 for (unsigned int i = 0; i < allF.size(); i++) 115 allF[i]->solveRefInheritance(apply); 116 } 117 CATCH_DUMP_ATTR 89 118 /*! 90 119 \brief Get virtual variable group -
XIOS/dev/dev_ym/XIOS_COUPLING/src/node/coupler_in.hpp
r1782 r1784 11 11 #include "context_client.hpp" 12 12 #include "mpi.hpp" 13 #include "string_tools.hpp" 13 14 14 15 namespace xios … … 92 93 93 94 public: 95 virtual void solveDescInheritance(bool apply, const CAttributeMap* const parent = 0); 96 void solveFieldRefInheritance(bool apply); 97 void createInterCommunicator(void) ; 94 98 95 99 private : -
XIOS/dev/dev_ym/XIOS_COUPLING/src/node/coupler_out.cpp
r1782 r1784 6 6 #include "context.hpp" 7 7 #include "xios_spl.hpp" 8 #include "string_tools.hpp" 9 #include "contexts_manager.hpp" 10 #include "services_manager.hpp" 11 8 12 9 13 namespace xios … … 102 106 CATCH 103 107 104 108 void CCouplerOut::solveDescInheritance(bool apply, const CAttributeMap * const parent) 109 TRY 110 { 111 SuperClassAttribute::setAttributes(parent,apply); 112 this->getVirtualFieldGroup()->solveDescInheritance(apply, NULL); 113 } 114 CATCH_DUMP_ATTR 115 116 void CCouplerOut::solveFieldRefInheritance(bool apply) 117 TRY 118 { 119 // Rsolution des hritages par rfrence de chacun des champs contenus dans le fichier. 120 std::vector<CField*> allF = this->getAllFields(); 121 for (unsigned int i = 0; i < allF.size(); i++) 122 allF[i]->solveRefInheritance(apply); 123 } 124 CATCH_DUMP_ATTR 125 126 void CCouplerOut::createInterCommunicator(void) 127 TRY 128 { 129 if (context.isEmpty()) 130 { 131 ERROR("void CCouplerOut::createInterCommunicator(void)", 132 "The attribute <context> must be defined to specify the target coupling context"); 133 } 134 CContext* contextPtr = CContext::getCurrent(); 135 contextPtr->addCouplingChanel(context, true) ; 136 } 137 CATCH_DUMP_ATTR 138 139 140 void CCouplerOut::solveOnlyRefOfEnabledFields(void) 141 TRY 142 { 143 int size = this->enabledFields.size(); 144 for (int i = 0; i < size; ++i) 145 { 146 this->enabledFields[i]->solveOnlyReferenceEnabledField(); 147 } 148 } 149 CATCH_DUMP_ATTR 150 151 void CCouplerOut::generateNewTransformationGridDest(void) 152 TRY 153 { 154 int size = this->enabledFields.size(); 155 for (int i = 0; i < size; ++i) 156 { 157 this->enabledFields[i]->generateNewTransformationGridDest(); 158 } 159 } 160 CATCH_DUMP_ATTR 161 162 void CCouplerOut::solveAllRefOfEnabledFieldsAndTransform(void) 163 TRY 164 { 165 int size = this->enabledFields.size(); 166 for (int i = 0; i < size; ++i) 167 { 168 this->enabledFields[i]->solveAllEnabledFieldsAndTransform(); 169 } 170 } 171 CATCH_DUMP_ATTR 172 173 /*! 174 * Constructs the filter graph for each active field. 175 * 176 * \param gc the garbage collector to use when building the filter graph 177 */ 178 void CCouplerOut::buildFilterGraphOfEnabledFields(CGarbageCollector& gc) 179 TRY 180 { 181 int size = this->enabledFields.size(); 182 for (int i = 0; i < size; ++i) 183 { 184 this->enabledFields[i]->buildFilterGraph(gc, true); 185 } 186 } 187 CATCH_DUMP_ATTR 188 189 void CCouplerOut::checkGridOfEnabledFields(void) 190 TRY 191 { 192 int size = this->enabledFields.size(); 193 for (int i = 0; i < size; ++i) 194 { 195 this->enabledFields[i]->checkGridOfEnabledFields(); 196 } 197 } 198 CATCH_DUMP_ATTR 105 199 106 200 //---------------------------------------------------------------- -
XIOS/dev/dev_ym/XIOS_COUPLING/src/node/coupler_out.hpp
r1782 r1784 88 88 89 89 public: 90 virtual void solveDescInheritance(bool apply, const CAttributeMap* const parent = 0); 91 void solveFieldRefInheritance(bool apply); 92 void createInterCommunicator(void) ; 93 void solveOnlyRefOfEnabledFields(void); 94 void generateNewTransformationGridDest(void); 95 void solveAllRefOfEnabledFieldsAndTransform() ; 96 void buildFilterGraphOfEnabledFields(CGarbageCollector& gc); 97 void checkGridOfEnabledFields(void) ; 90 98 91 99 private : -
XIOS/dev/dev_ym/XIOS_COUPLING/src/node/domain.cpp
r1761 r1784 302 302 // For now the assumption is that secondary server pools consist of the same number of procs. 303 303 // CHANGE the line below if the assumption changes. 304 CContextClient* client = (0 != context->clientPrimServer.size()) ? context->clientPrimServer[0] : context->client; 305 int rankClient = c lient->clientRank;304 305 int rankClient = context->intraCommRank_; 306 306 int rankOnDomain = rankClient%nbLocalDomain; 307 307 … … 680 680 // For now the assumption is that secondary server pools consist of the same number of procs. 681 681 // CHANGE the line below if the assumption changes. 682 CContextClient* client = (0 != context->clientPrimServer.size()) ? context->clientPrimServer[0] : context->client;682 int clientSize = context->intraCommSize_ ; 683 683 lon_g.resize(ni_glo) ; 684 684 lat_g.resize(nj_glo) ; 685 685 686 686 687 int* ibegin_g = new int[client ->clientSize] ;688 int* jbegin_g = new int[client ->clientSize] ;689 int* ni_g = new int[client ->clientSize] ;690 int* nj_g = new int[client ->clientSize] ;687 int* ibegin_g = new int[clientSize] ; 688 int* jbegin_g = new int[clientSize] ; 689 int* ni_g = new int[clientSize] ; 690 int* nj_g = new int[clientSize] ; 691 691 int v ; 692 692 v=ibegin ; 693 MPI_Allgather(&v,1,MPI_INT,ibegin_g,1,MPI_INT,c lient->intraComm) ;693 MPI_Allgather(&v,1,MPI_INT,ibegin_g,1,MPI_INT,context->intraComm_) ; 694 694 v=jbegin ; 695 MPI_Allgather(&v,1,MPI_INT,jbegin_g,1,MPI_INT,c lient->intraComm) ;695 MPI_Allgather(&v,1,MPI_INT,jbegin_g,1,MPI_INT,context->intraComm_) ; 696 696 v=ni ; 697 MPI_Allgather(&v,1,MPI_INT,ni_g,1,MPI_INT,c lient->intraComm) ;697 MPI_Allgather(&v,1,MPI_INT,ni_g,1,MPI_INT,context->intraComm_) ; 698 698 v=nj ; 699 MPI_Allgather(&v,1,MPI_INT,nj_g,1,MPI_INT,c lient->intraComm) ;700 701 MPI_Allgatherv(lon.dataFirst(),ni,MPI_DOUBLE,lon_g.dataFirst(),ni_g, ibegin_g,MPI_DOUBLE,c lient->intraComm) ;702 MPI_Allgatherv(lat.dataFirst(),nj,MPI_DOUBLE,lat_g.dataFirst(),nj_g, jbegin_g,MPI_DOUBLE,c lient->intraComm) ;699 MPI_Allgather(&v,1,MPI_INT,nj_g,1,MPI_INT,context->intraComm_) ; 700 701 MPI_Allgatherv(lon.dataFirst(),ni,MPI_DOUBLE,lon_g.dataFirst(),ni_g, ibegin_g,MPI_DOUBLE,context->intraComm_) ; 702 MPI_Allgatherv(lat.dataFirst(),nj,MPI_DOUBLE,lat_g.dataFirst(),nj_g, jbegin_g,MPI_DOUBLE,context->intraComm_) ; 703 703 704 704 delete[] ibegin_g ; … … 1831 1831 { 1832 1832 CContext* context=CContext::getCurrent() ; 1833 1834 // This line should be changed soon. 1835 int nbSrvPools = (context->hasServer) ? (context->hasClient ? context->clientPrimServer.size() : 0) : 1; 1836 1837 nbSenders.clear(); 1838 connectedServerRank_.clear(); 1839 1840 for (int p = 0; p < nbSrvPools; ++p) 1833 set<int> listNbServer ; 1834 1835 for (auto client : clients) 1841 1836 { 1842 CContextClient* client = (0 != context->clientPrimServer.size()) ? context->clientPrimServer[p] : context->client; 1837 1843 1838 int nbServer = client->serverSize; 1844 1839 int nbClient = client->clientSize; 1845 1840 int rank = client->clientRank; 1846 1841 bool doComputeGlobalIndexServer = true; 1847 1848 if (connectedServerRank_.find(nbServer) == connectedServerRank_.end()) 1849 { 1842 1843 if (listNbServer.find(nbServer)==listNbServer.end()) 1844 { 1845 listNbServer.insert(nbServer) ; 1846 1847 if (connectedServerRank_.find(nbServer) != connectedServerRank_.end()) 1848 { 1849 nbSenders.erase(nbServer); 1850 connectedServerRank_.erase(nbServer); 1851 } 1850 1852 1851 1853 if (indSrv_.find(nbServer) == indSrv_.end()) -
XIOS/dev/dev_ym/XIOS_COUPLING/src/node/field.cpp
r1764 r1784 976 976 CATCH_DUMP_ATTR 977 977 978 void CField::solveOnlyReferenceEnabledField( bool doSending2Server)978 void CField::solveOnlyReferenceEnabledField(void) 979 979 TRY 980 980 { … … 987 987 { 988 988 solveRefInheritance(true); 989 if (hasDirectFieldReference()) getDirectFieldReference()->solveOnlyReferenceEnabledField( false);989 if (hasDirectFieldReference()) getDirectFieldReference()->solveOnlyReferenceEnabledField(); 990 990 } 991 991 … … 1009 1009 { 1010 1010 CContext* context = CContext::getCurrent(); 1011 solveOnlyReferenceEnabledField( doSending2Server);1011 solveOnlyReferenceEnabledField(); 1012 1012 1013 1013 if (!areAllReferenceSolved) -
XIOS/dev/dev_ym/XIOS_COUPLING/src/node/field.hpp
r1637 r1784 122 122 void solveCheckMaskIndex(bool doSendingIndex); 123 123 void solveAllReferenceEnabledField(bool doSending2Server); 124 void solveOnlyReferenceEnabledField( bool doSending2Server);124 void solveOnlyReferenceEnabledField(void); 125 125 void generateNewTransformationGridDest(); 126 126 void updateRef(CGrid* grid); -
XIOS/dev/dev_ym/XIOS_COUPLING/src/node/file.cpp
r1761 r1784 834 834 \param [in] sendToServer: Send all info to server (true) or only a part of it (false) 835 835 */ 836 void CFile::solveOnlyRefOfEnabledFields( bool sendToServer)836 void CFile::solveOnlyRefOfEnabledFields(void) 837 837 TRY 838 838 { … … 840 840 for (int i = 0; i < size; ++i) 841 841 { 842 this->enabledFields[i]->solveOnlyReferenceEnabledField( sendToServer);842 this->enabledFields[i]->solveOnlyReferenceEnabledField(); 843 843 } 844 844 } … … 953 953 \param [in] sendToServer: Send all info to server (true) or only a part of it (false) 954 954 */ 955 void CFile::solveAllRefOfEnabledFieldsAndTransform( bool sendToServer)955 void CFile::solveAllRefOfEnabledFieldsAndTransform(void) 956 956 TRY 957 957 { -
XIOS/dev/dev_ym/XIOS_COUPLING/src/node/file.hpp
r1639 r1784 108 108 void solveFieldRefInheritance(bool apply); 109 109 void processEnabledFile(void); 110 void solveOnlyRefOfEnabledFields( bool sendToServer);110 void solveOnlyRefOfEnabledFields(void); 111 111 void generateNewTransformationGridDest(); 112 112 … … 117 117 void doPostTimestepOperationsForEnabledReadModeFields(); 118 118 119 void solveAllRefOfEnabledFieldsAndTransform( bool sendToServer);119 void solveAllRefOfEnabledFieldsAndTransform(void); 120 120 void checkGridOfEnabledFields(); 121 121 void sendGridOfEnabledFields(); -
XIOS/dev/dev_ym/XIOS_COUPLING/src/node/grid.cpp
r1761 r1784 331 331 { 332 332 CContext* context = CContext::getCurrent(); 333 int nbSrvPools = (context->hasServer) ? (context->hasClient ? context->clientPrimServer.size() : 0) : 1; 334 nbSrvPools = 1; 335 for (int p = 0; p < nbSrvPools; ++p) 336 { 337 if (context->hasClient && this->isChecked && doSendingIndex && !isIndexSent) 338 { 339 if (isScalarGrid()) 340 sendIndexScalarGrid(); 341 else 342 sendIndex(); 343 this->isIndexSent = true; 344 } 345 346 // Not sure about this 347 //if (!(this->hasTransform() && !this->isTransformed())) 348 // this->isChecked = true; 349 //return; 333 if (context->hasClient && this->isChecked && doSendingIndex && !isIndexSent) 334 { 335 if (isScalarGrid()) sendIndexScalarGrid(); 336 else sendIndex(); 337 this->isIndexSent = true; 350 338 } 351 339 352 340 if (this->isChecked) return; 353 341 this->checkAttributesAfterTransformation(); … … 364 352 } 365 353 CATCH_DUMP_ATTR 354 355 366 356 bool CGrid::hasMask() const 367 357 TRY … … 763 753 { 764 754 CContext* context = CContext::getCurrent(); 765 int nbSrvPools = (context->clientPrimServer.size() == 0) ? 1 : context->clientPrimServer.size(); 766 connectedServerRank_.clear(); 767 connectedDataSize_.clear(); 768 globalIndexOnServer_.clear(); 769 nbSenders.clear(); 770 771 for (int p = 0; p < nbSrvPools; ++p) 755 756 set<int> listReceiverSize ; 757 for (auto it=clients.begin(); it!=clients.end(); ++it) 772 758 { 773 CContextClient* client = (context->clientPrimServer.size() == 0) ? context->client : context->clientPrimServer[p]; 759 760 CContextClient* client = *it ; 761 774 762 int receiverSize = client->serverSize; 775 // connectedServerRank_[client].clear(); 776 777 if (connectedServerRank_.find(receiverSize) == connectedServerRank_.end()) 763 764 if (listReceiverSize.find(receiverSize)==listReceiverSize.end()) 778 765 { 779 if (!doGridHaveDataDistributed(client)) 766 listReceiverSize.insert(receiverSize) ; 767 if (connectedServerRank_.find(receiverSize) != connectedServerRank_.end()) 768 { 769 // delete corresponding map in case of recompute, probably because a grid could has been modifiedd 770 // by a transformation 771 connectedServerRank_.erase(receiverSize); 772 connectedDataSize_.erase(receiverSize); 773 globalIndexOnServer_.erase(receiverSize); 774 nbSenders.erase(receiverSize); 775 } 776 777 if (!doGridHaveDataDistributed(client)) 780 778 { 781 779 if (client->isServerLeader()) … … 1307 1305 CATCH 1308 1306 1309 /*1310 void CGrid::outputField(int rank, const CArray<double, 1>& stored, double* field)1311 {1312 const CArray<size_t,1>& out_i = outIndexFromClient[rank];1313 StdSize numElements = stored.numElements();1314 for (StdSize n = 0; n < numElements; ++n)1315 {1316 field[out_i(n)] = stored(n);1317 }1318 }1319 1320 void CGrid::inputField(int rank, const double* const field, CArray<double,1>& stored)1321 {1322 const CArray<size_t,1>& out_i = outIndexFromClient[rank];1323 StdSize numElements = stored.numElements();1324 for (StdSize n = 0; n < numElements; ++n)1325 {1326 stored(n) = field[out_i(n)];1327 }1328 }1329 1330 void CGrid::outputCompressedField(int rank, const CArray<double,1>& stored, double* field)1331 {1332 const CArray<size_t,1>& out_i = compressedOutIndexFromClient[rank];1333 StdSize numElements = stored.numElements();1334 for (StdSize n = 0; n < numElements; ++n)1335 {1336 field[out_i(n)] = stored(n);1337 }1338 }1339 */1340 1307 //---------------------------------------------------------------- 1341 1308 … … 1420 1387 TRY 1421 1388 { 1422 CContext* context = CContext::getCurrent(); 1423 int nbSrvPools = (context->clientPrimServer.size()==0) ? 1 : context->clientPrimServer.size();1424 connectedServerRank_.clear();1425 connectedDataSize_.clear();1426 nbSenders.clear();1427 1428 for (int p = 0; p < nbSrvPools; ++p)1429 {1430 CContextClient* client = (context->clientPrimServer.size()==0) ? context->client : context->clientPrimServer[p]; 1389 1390 CContext* context = CContext::getCurrent(); 1391 1392 set<int> listReceiverSize ; 1393 for (auto it=clients.begin(); it!=clients.end(); ++it) 1394 { 1395 1396 CContextClient* client = *it ; 1397 1431 1398 int receiverSize = client->serverSize; 1432 1433 // connectedServerRank_[client].clear(); 1434 1435 if (connectedServerRank_.find(receiverSize)==connectedServerRank_.end()) 1436 { 1399 1400 if (listReceiverSize.find(receiverSize)==listReceiverSize.end()) 1401 { 1402 listReceiverSize.insert(receiverSize) ; 1403 if (connectedServerRank_.find(receiverSize) != connectedServerRank_.end()) 1404 { 1405 // delete corresponding map in case of recompute, probably because a grid could has been modifiedd 1406 // by a transformation 1407 connectedServerRank_.erase(receiverSize); 1408 connectedDataSize_.erase(receiverSize); 1409 globalIndexOnServer_.erase(receiverSize); 1410 nbSenders.erase(receiverSize); 1411 } 1412 1437 1413 if (client->isServerLeader()) 1438 1414 { … … 1680 1656 connectedServerRankRead_ = ranks; 1681 1657 1682 // ym something is bad here, I comment some line, to be checked in future1683 // int nbSrvPools = (context->hasServer) ? (context->hasClient ? context->clientPrimServer.size() : 1) : 1;1684 int nbSrvPools = 1;1685 1658 nbReadSenders.clear(); 1686 for (int p = 0; p < nbSrvPools; ++p) 1687 { 1688 // CContextServer* server = (!context->hasClient) ? context->server : context->serverPrimServer[p]; 1689 CContextServer* server = context->server ; 1690 CContextClient* client = context->client; //(!context->hasClient) ? context->client : context->clientPrimServer[p]; 1659 CContextServer* server = context->server ; 1660 CContextClient* client = context->client; 1691 1661 1692 int idx = 0, numElement = axis_domain_order.numElements(); 1693 int ssize = numElement; 1694 std::vector<int> indexMap(numElement); 1695 for (int i = 0; i < numElement; ++i) 1696 { 1697 indexMap[i] = idx; 1698 if (2 == axis_domain_order(i)) 1699 { 1700 ++ssize; 1701 idx += 2; 1702 } 1703 else 1704 ++idx; 1705 } 1706 1707 for (int n = 0; n < ranks.size(); n++) 1708 { 1709 int rank = ranks[n]; 1710 CBufferIn& buffer = *buffers[n]; 1711 1712 buffer >> isDataDistributed_ >> isCompressible_; 1713 size_t dataSize = 0; 1714 1715 if (0 == serverDistribution_) 1716 { 1717 int axisId = 0, domainId = 0, scalarId = 0, globalSize = 1; 1718 std::vector<CDomain*> domainList = getDomains(); 1719 std::vector<CAxis*> axisList = getAxis(); 1720 std::vector<int> nBegin(ssize), nSize(ssize), nGlob(ssize), nBeginGlobal(ssize), nGlobElement(numElement); 1721 std::vector<CArray<int,1> > globalIndex(numElement); 1722 for (int i = 0; i < numElement; ++i) 1723 { 1724 nGlobElement[i] = globalSize; 1725 if (2 == axis_domain_order(i)) //domain 1726 { 1727 nBegin[indexMap[i]] = domainList[domainId]->ibegin; 1728 nSize[indexMap[i]] = domainList[domainId]->ni; 1729 nBeginGlobal[indexMap[i]] = 0; 1730 nGlob[indexMap[i]] = domainList[domainId]->ni_glo; 1731 1732 nBegin[indexMap[i] + 1] = domainList[domainId]->jbegin; 1733 nSize[indexMap[i] + 1] = domainList[domainId]->nj; 1734 nBeginGlobal[indexMap[i] + 1] = 0; 1735 nGlob[indexMap[i] + 1] = domainList[domainId]->nj_glo; 1736 1737 { 1738 int count = 0; 1739 globalIndex[i].resize(nSize[indexMap[i]]*nSize[indexMap[i]+1]); 1740 for (int jdx = 0; jdx < nSize[indexMap[i]+1]; ++jdx) 1741 for (int idx = 0; idx < nSize[indexMap[i]]; ++idx) 1742 { 1743 globalIndex[i](count) = (nBegin[indexMap[i]] + idx) + (nBegin[indexMap[i]+1] + jdx) * nGlob[indexMap[i]]; 1744 ++count; 1745 } 1746 } 1747 1748 ++domainId; 1749 } 1750 else if (1 == axis_domain_order(i)) // axis 1751 { 1752 nBegin[indexMap[i]] = axisList[axisId]->begin; 1753 nSize[indexMap[i]] = axisList[axisId]->n; 1754 nBeginGlobal[indexMap[i]] = 0; 1755 nGlob[indexMap[i]] = axisList[axisId]->n_glo; 1756 globalIndex[i].resize(nSize[indexMap[i]]); 1757 for (int idx = 0; idx < nSize[indexMap[i]]; ++idx) 1758 globalIndex[i](idx) = nBegin[indexMap[i]] + idx; 1759 1760 ++axisId; 1761 } 1762 else // scalar 1763 { 1764 nBegin[indexMap[i]] = 0; 1765 nSize[indexMap[i]] = 1; 1766 nBeginGlobal[indexMap[i]] = 0; 1767 nGlob[indexMap[i]] = 1; 1768 globalIndex[i].resize(1); 1769 globalIndex[i](0) = 0; 1770 ++scalarId; 1771 } 1772 } 1773 dataSize = 1; 1774 1775 for (int i = 0; i < nSize.size(); ++i) 1776 dataSize *= nSize[i]; 1777 serverDistribution_ = new CDistributionServer(server->intraCommRank, 1778 globalIndex, axis_domain_order, 1779 nBegin, nSize, nBeginGlobal, nGlob); 1780 } 1781 1782 CArray<size_t,1> outIndex; 1783 buffer >> outIndex; 1784 outGlobalIndexFromClient.insert(std::make_pair(rank, outIndex)); 1785 connectedDataSizeRead_[rank] = outIndex.numElements(); 1786 1787 if (doGridHaveDataDistributed(client)) 1788 {} 1789 else 1790 { 1791 // THE PROBLEM HERE IS THAT DATA CAN BE NONDISTRIBUTED ON CLIENT AND DISTRIBUTED ON SERVER 1792 // BELOW IS THE TEMPORARY FIX only for a single type of element (domain, asix, scalar) 1793 dataSize = serverDistribution_->getGridSize(); 1794 } 1795 writtenDataSize_ += dataSize; 1796 } 1797 1798 1799 // Compute mask of the current grid 1662 int idx = 0, numElement = axis_domain_order.numElements(); 1663 int ssize = numElement; 1664 std::vector<int> indexMap(numElement); 1665 for (int i = 0; i < numElement; ++i) 1666 { 1667 indexMap[i] = idx; 1668 if (2 == axis_domain_order(i)) 1669 { 1670 ++ssize; 1671 idx += 2; 1672 } 1673 else 1674 ++idx; 1675 } 1676 1677 for (int n = 0; n < ranks.size(); n++) 1678 { 1679 int rank = ranks[n]; 1680 CBufferIn& buffer = *buffers[n]; 1681 1682 buffer >> isDataDistributed_ >> isCompressible_; 1683 size_t dataSize = 0; 1684 1685 if (0 == serverDistribution_) 1800 1686 { 1801 1687 int axisId = 0, domainId = 0, scalarId = 0, globalSize = 1; 1802 1688 std::vector<CDomain*> domainList = getDomains(); 1803 1689 std::vector<CAxis*> axisList = getAxis(); 1804 int dimSize = 2 * domainList.size() + axisList.size();1805 std::vector< int> nBegin(dimSize), nSize(dimSize), nGlob(dimSize), nBeginGlobal(dimSize);1690 std::vector<int> nBegin(ssize), nSize(ssize), nGlob(ssize), nBeginGlobal(ssize), nGlobElement(numElement); 1691 std::vector<CArray<int,1> > globalIndex(numElement); 1806 1692 for (int i = 0; i < numElement; ++i) 1807 { 1693 { 1694 nGlobElement[i] = globalSize; 1808 1695 if (2 == axis_domain_order(i)) //domain 1809 1696 { 1810 1697 nBegin[indexMap[i]] = domainList[domainId]->ibegin; 1811 1698 nSize[indexMap[i]] = domainList[domainId]->ni; 1812 nBeginGlobal[indexMap[i]] = 0; 1699 nBeginGlobal[indexMap[i]] = 0; 1813 1700 nGlob[indexMap[i]] = domainList[domainId]->ni_glo; 1814 1701 1815 1702 nBegin[indexMap[i] + 1] = domainList[domainId]->jbegin; 1816 1703 nSize[indexMap[i] + 1] = domainList[domainId]->nj; 1817 nBeginGlobal[indexMap[i] + 1] = 0; 1704 nBeginGlobal[indexMap[i] + 1] = 0; 1818 1705 nGlob[indexMap[i] + 1] = domainList[domainId]->nj_glo; 1706 1707 { 1708 int count = 0; 1709 globalIndex[i].resize(nSize[indexMap[i]]*nSize[indexMap[i]+1]); 1710 for (int jdx = 0; jdx < nSize[indexMap[i]+1]; ++jdx) 1711 for (int idx = 0; idx < nSize[indexMap[i]]; ++idx) 1712 { 1713 globalIndex[i](count) = (nBegin[indexMap[i]] + idx) + (nBegin[indexMap[i]+1] + jdx) * nGlob[indexMap[i]]; 1714 ++count; 1715 } 1716 } 1819 1717 1820 1718 ++domainId; … … 1824 1722 nBegin[indexMap[i]] = axisList[axisId]->begin; 1825 1723 nSize[indexMap[i]] = axisList[axisId]->n; 1826 nBeginGlobal[indexMap[i]] = 0; 1827 nGlob[indexMap[i]] = axisList[axisId]->n_glo; 1724 nBeginGlobal[indexMap[i]] = 0; 1725 nGlob[indexMap[i]] = axisList[axisId]->n_glo; 1726 globalIndex[i].resize(nSize[indexMap[i]]); 1727 for (int idx = 0; idx < nSize[indexMap[i]]; ++idx) 1728 globalIndex[i](idx) = nBegin[indexMap[i]] + idx; 1729 1828 1730 ++axisId; 1829 1731 } 1830 1732 else // scalar 1831 { 1733 { 1734 nBegin[indexMap[i]] = 0; 1735 nSize[indexMap[i]] = 1; 1736 nBeginGlobal[indexMap[i]] = 0; 1737 nGlob[indexMap[i]] = 1; 1738 globalIndex[i].resize(1); 1739 globalIndex[i](0) = 0; 1740 ++scalarId; 1832 1741 } 1833 1742 } 1834 1835 if (nSize.empty()) // Scalar grid 1836 { 1837 nBegin.push_back(0); 1838 nSize.push_back(1); 1839 nBeginGlobal.push_back(0); 1840 nGlob.push_back(1); 1841 } 1842 } 1843 1844 if (isScalarGrid()) return; 1845 1846 nbReadSenders[client] = CClientServerMappingDistributed::computeConnectedClients(context->client->serverSize, context->client->clientSize, context->client->intraComm, ranks); 1847 } 1743 dataSize = 1; 1744 1745 for (int i = 0; i < nSize.size(); ++i) 1746 dataSize *= nSize[i]; 1747 serverDistribution_ = new CDistributionServer(server->intraCommRank, 1748 globalIndex, axis_domain_order, 1749 nBegin, nSize, nBeginGlobal, nGlob); 1750 } 1751 1752 CArray<size_t,1> outIndex; 1753 buffer >> outIndex; 1754 outGlobalIndexFromClient.insert(std::make_pair(rank, outIndex)); 1755 connectedDataSizeRead_[rank] = outIndex.numElements(); 1756 1757 if (doGridHaveDataDistributed(client)) 1758 {} 1759 else 1760 { 1761 // THE PROBLEM HERE IS THAT DATA CAN BE NONDISTRIBUTED ON CLIENT AND DISTRIBUTED ON SERVER 1762 // BELOW IS THE TEMPORARY FIX only for a single type of element (domain, asix, scalar) 1763 dataSize = serverDistribution_->getGridSize(); 1764 } 1765 writtenDataSize_ += dataSize; 1766 } 1767 1768 1769 // Compute mask of the current grid 1770 { 1771 int axisId = 0, domainId = 0, scalarId = 0, globalSize = 1; 1772 std::vector<CDomain*> domainList = getDomains(); 1773 std::vector<CAxis*> axisList = getAxis(); 1774 int dimSize = 2 * domainList.size() + axisList.size(); 1775 std::vector<int> nBegin(dimSize), nSize(dimSize), nGlob(dimSize), nBeginGlobal(dimSize); 1776 for (int i = 0; i < numElement; ++i) 1777 { 1778 if (2 == axis_domain_order(i)) //domain 1779 { 1780 nBegin[indexMap[i]] = domainList[domainId]->ibegin; 1781 nSize[indexMap[i]] = domainList[domainId]->ni; 1782 nBeginGlobal[indexMap[i]] = 0; 1783 nGlob[indexMap[i]] = domainList[domainId]->ni_glo; 1784 1785 nBegin[indexMap[i] + 1] = domainList[domainId]->jbegin; 1786 nSize[indexMap[i] + 1] = domainList[domainId]->nj; 1787 nBeginGlobal[indexMap[i] + 1] = 0; 1788 nGlob[indexMap[i] + 1] = domainList[domainId]->nj_glo; 1789 ++domainId; 1790 } 1791 else if (1 == axis_domain_order(i)) // axis 1792 { 1793 nBegin[indexMap[i]] = axisList[axisId]->begin; 1794 nSize[indexMap[i]] = axisList[axisId]->n; 1795 nBeginGlobal[indexMap[i]] = 0; 1796 nGlob[indexMap[i]] = axisList[axisId]->n_glo; 1797 ++axisId; 1798 } 1799 else // scalar 1800 { 1801 } 1802 } 1803 1804 if (nSize.empty()) // Scalar grid 1805 { 1806 nBegin.push_back(0); 1807 nSize.push_back(1); 1808 nBeginGlobal.push_back(0); 1809 nGlob.push_back(1); 1810 } 1811 } 1812 1813 if (isScalarGrid()) return; 1814 1815 nbReadSenders[client] = CClientServerMappingDistributed::computeConnectedClients(context->client->serverSize, context->client->clientSize, context->client->intraComm, ranks); 1816 1848 1817 } 1849 1818 CATCH_DUMP_ATTR … … 2122 2091 \param[in] id String identity of domain that will be created on server 2123 2092 */ 2124 void CGrid::sendAddDomain(const string& id )2125 TRY 2126 { 2127 sendAddItem(id, (int)EVENT_ID_ADD_DOMAIN );2093 void CGrid::sendAddDomain(const string& id, CContextClient* contextClient) 2094 TRY 2095 { 2096 sendAddItem(id, (int)EVENT_ID_ADD_DOMAIN, contextClient); 2128 2097 } 2129 2098 CATCH_DUMP_ATTR … … 2133 2102 \param[in] id String identity of axis that will be created on server 2134 2103 */ 2135 void CGrid::sendAddAxis(const string& id )2136 TRY 2137 { 2138 sendAddItem(id, (int)EVENT_ID_ADD_AXIS );2104 void CGrid::sendAddAxis(const string& id, CContextClient* contextClient) 2105 TRY 2106 { 2107 sendAddItem(id, (int)EVENT_ID_ADD_AXIS, contextClient); 2139 2108 } 2140 2109 CATCH_DUMP_ATTR … … 2144 2113 \param[in] id String identity of scalar that will be created on server 2145 2114 */ 2146 void CGrid::sendAddScalar(const string& id )2147 TRY 2148 { 2149 sendAddItem(id, (int)EVENT_ID_ADD_SCALAR );2115 void CGrid::sendAddScalar(const string& id, CContextClient* contextClient) 2116 TRY 2117 { 2118 sendAddItem(id, (int)EVENT_ID_ADD_SCALAR, contextClient); 2150 2119 } 2151 2120 CATCH_DUMP_ATTR … … 2654 2623 Send all attributes of domains from client to server 2655 2624 */ 2656 void CGrid::sendAllDomains( )2625 void CGrid::sendAllDomains(CContextClient* contextClient) 2657 2626 TRY 2658 2627 { … … 2661 2630 for (int i = 0; i < dSize; ++i) 2662 2631 { 2663 sendAddDomain(domList[i]->getId() );2664 domList[i]->sendAllAttributesToServer( );2632 sendAddDomain(domList[i]->getId(),contextClient); 2633 domList[i]->sendAllAttributesToServer(contextClient); 2665 2634 } 2666 2635 } … … 2670 2639 Send all attributes of axis from client to server 2671 2640 */ 2672 void CGrid::sendAllAxis( )2641 void CGrid::sendAllAxis(CContextClient* contextClient) 2673 2642 TRY 2674 2643 { … … 2678 2647 for (int i = 0; i < aSize; ++i) 2679 2648 { 2680 sendAddAxis(aList[i]->getId() );2681 aList[i]->sendAllAttributesToServer( );2649 sendAddAxis(aList[i]->getId(),contextClient); 2650 aList[i]->sendAllAttributesToServer(contextClient); 2682 2651 } 2683 2652 } … … 2687 2656 Send all attributes of scalars from client to server 2688 2657 */ 2689 void CGrid::sendAllScalars( )2658 void CGrid::sendAllScalars(CContextClient* contextClient) 2690 2659 TRY 2691 2660 { … … 2695 2664 for (int i = 0; i < sSize; ++i) 2696 2665 { 2697 sendAddScalar(sList[i]->getId() );2698 sList[i]->sendAllAttributesToServer( );2666 sendAddScalar(sList[i]->getId(),contextClient); 2667 sList[i]->sendAllAttributesToServer(contextClient); 2699 2668 } 2700 2669 } -
XIOS/dev/dev_ym/XIOS_COUPLING/src/node/grid.hpp
r1637 r1784 144 144 CAxis* addAxis(const std::string& id=StdString()); 145 145 CScalar* addScalar(const std::string& id=StdString()); 146 void sendAddDomain(const std::string& id ="");147 void sendAddAxis(const std::string& id ="");148 void sendAddScalar(const std::string& id ="");149 void sendAllDomains( );150 void sendAllAxis( );151 void sendAllScalars( );146 void sendAddDomain(const std::string& id,CContextClient* contextClient); 147 void sendAddAxis(const std::string& id,CContextClient* contextClient); 148 void sendAddScalar(const std::string& id,CContextClient* contextClient); 149 void sendAllDomains(CContextClient* contextClient); 150 void sendAllAxis(CContextClient* contextClient); 151 void sendAllScalars(CContextClient* contextClient); 152 152 153 153 static void recvAddDomain(CEventServer& event); … … 219 219 map<int, CArray<int, 1> > storeIndex_fromSrv; // Support, for now, reading with level-1 server 220 220 221 map<int, CArray<size_t, 1> > outIndexFromClient; // Deprecated222 223 221 map<int, CArray<size_t, 1> > compressedOutIndexFromClient; 224 222 … … 365 363 366 364 367 /** List order of axis and domain in a grid, if there is a domain, it will take value 1 (true), axis 0 (false)*/365 /** List order of axis and domain in a grid, if there is a domain, it will take value 2, axis 1, scalar 0 */ 368 366 std::vector<int> order_; 369 367 -
XIOS/dev/dev_ym/XIOS_COUPLING/src/node/variable.cpp
r1158 r1784 94 94 * 95 95 */ 96 void CVariable::sendValue() 97 { 98 CContext* context=CContext::getCurrent() ; 99 100 if (context->hasClient) 101 { 102 // Use correct context client to send message 103 // int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1; 104 int nbSrvPools = (context->hasServer) ? (context->hasClient ? context->clientPrimServer.size() : 0) : 1; 105 for (int i = 0; i < nbSrvPools; ++i) 106 { 107 // CContextClient* contextClientTmp = (0 != context->clientPrimServer) ? context->clientPrimServer 108 CContextClient* contextClientTmp = (context->hasServer) ? context->clientPrimServer[i] 109 : context->client; 110 111 CEventClient event(this->getType(),EVENT_ID_VARIABLE_VALUE) ; 112 if (contextClientTmp->isServerLeader()) 113 { 114 CMessage msg ; 115 msg<<this->getId() ; 116 msg<<content ; 117 const std::list<int>& ranks = contextClientTmp->getRanksServerLeader(); 118 for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank) 119 event.push(*itRank,1,msg); 120 contextClientTmp->sendEvent(event) ; 121 } 122 else contextClientTmp->sendEvent(event) ; 123 } 124 } 125 } 126 127 void CVariable::sendValue(CContextClient* client, bool clientPrim /*= false*/) 96 97 void CVariable::sendValue(CContextClient* client) 128 98 { 129 99 CEventClient event(this->getType(),EVENT_ID_VARIABLE_VALUE) ; -
XIOS/dev/dev_ym/XIOS_COUPLING/src/node/variable.hpp
r1158 r1784 79 79 80 80 //! Sending a request to set up variable data 81 void sendValue(); 82 void sendValue(CContextClient* client, bool clientPrim = false); 81 void sendValue(CContextClient* client); 83 82 84 83 static void recvValue(CEventServer& event) ; -
XIOS/dev/dev_ym/XIOS_COUPLING/src/object_template.hpp
r1542 r1784 56 56 static void ClearAllAttributes(void); 57 57 std::map<int, size_t> getMinimumBufferSizeForAttributes(CContextClient* client); 58 void sendAttributToServer(const string& id);59 58 void sendAttributToServer(const string& id, CContextClient* client); 60 void sendAttributToServer(CAttribute& attr) ;61 59 void sendAttributToServer(CAttribute& attr, CContextClient* client) ; 62 void sendAllAttributesToServer();63 60 void sendAllAttributesToServer(CContextClient* client); 64 void sendAddItem(const string& id, int itemType);65 61 void sendAddItem(const string& id, int itemType, CContextClient* client); 66 62 static void recvAttributFromClient(CEventServer& event) ; -
XIOS/dev/dev_ym/XIOS_COUPLING/src/object_template_impl.hpp
r1761 r1784 215 215 } 216 216 217 218 template<typename T>219 void CObjectTemplate<T>::sendAllAttributesToServer()220 {221 CAttributeMap& attrMap = *this;222 CAttributeMap::const_iterator it = attrMap.begin(), itE = attrMap.end();223 for (; it != itE; ++it)224 {225 if (it->second->doSend() && !(it->second)->isEmpty()) sendAttributToServer(*(it->second));226 }227 }228 229 217 template<typename T> 230 218 void CObjectTemplate<T>::sendAllAttributesToServer(CContextClient* client) … … 239 227 240 228 template <class T> 241 void CObjectTemplate<T>::sendAttributToServer(const string& id)242 {243 CAttributeMap & attrMap = *this;244 CAttribute* attr=attrMap[id];245 sendAttributToServer(*attr);246 }247 248 template <class T>249 229 void CObjectTemplate<T>::sendAttributToServer(const string& id, CContextClient* client) 250 230 { … … 253 233 sendAttributToServer(*attr, client); 254 234 } 255 256 template <class T>257 void CObjectTemplate<T>::sendAttributToServer(CAttribute& attr)258 {259 // Use correct context client to send message260 CContext* context=CContext::getCurrent();261 if (context->hasClient)262 {263 // int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1;264 int nbSrvPools = (context->hasServer) ? (context->hasClient ? context->clientPrimServer.size() : 0) : 1;265 for (int i = 0; i < nbSrvPools; ++i)266 {267 CContextClient* contextClientTmp = (context->hasServer) ? context->clientPrimServer[i] : context->client;268 CEventClient event(getType(),EVENT_ID_SEND_ATTRIBUTE);269 if (contextClientTmp->isServerLeader())270 {271 CMessage msg;272 if (context->hasServer) msg<<this->getIdServer(i);273 else msg<<this->getIdServer();274 275 msg << attr.getName();276 msg << attr;277 const std::list<int>& ranks = contextClientTmp->getRanksServerLeader();278 for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)279 event.push(*itRank,1,msg);280 contextClientTmp->sendEvent(event);281 }282 else contextClientTmp->sendEvent(event);283 }284 }285 }286 235 287 236 template <class T> … … 309 258 \param [in] itemType type of added item 310 259 */ 311 template<class T>312 void CObjectTemplate<T>::sendAddItem(const StdString& id, int itemType)313 {314 CContext* context = CContext::getCurrent();315 typedef typename T::EEventId ItemType;316 if (context->hasClient)317 {318 // Use correct context client to send message319 // int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1;320 int nbSrvPools = (context->hasServer) ? (context->hasClient ? context->clientPrimServer.size() : 0) : 1;321 for (int i = 0; i < nbSrvPools; ++i)322 {323 CContextClient* contextClientTmp = (context->hasServer) ? context->clientPrimServer[i] : context->client;324 CEventClient event(this->getType(),ItemType(itemType));325 if (contextClientTmp->isServerLeader())326 {327 CMessage msg;328 msg << this->getId();329 msg << id;330 const std::list<int>& ranks = contextClientTmp->getRanksServerLeader();331 for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)332 event.push(*itRank,1,msg);333 contextClientTmp->sendEvent(event);334 }335 else contextClientTmp->sendEvent(event);336 }337 }338 }339 260 340 261 template<class T> -
XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm_interpolate.cpp
r1639 r1784 72 72 CTimer::get("CAxisAlgorithmInterpolate::computeIndexSourceMapping_").resume() ; 73 73 CContext* context = CContext::getCurrent(); 74 CContextClient* client=context->client; 75 int nbClient = client->clientSize; 74 int nbClient = context->intraCommSize_; 76 75 CArray<bool,1>& axisMask = axisSrc_->mask; 77 76 int srcSize = axisSrc_->n_glo.getValue(); … … 227 226 { 228 227 CContext* context = CContext::getCurrent(); 229 CContextClient* client=context->client; 230 int nbClient = client->clientSize; 228 int nbClient = context->intraCommSize_; 231 229 232 230 int srcSize = axisSrc_->n_glo.getValue(); … … 272 270 273 271 int* recvCount=new int[nbClient]; 274 MPI_Allgather(&numValue,1,MPI_INT,recvCount,1,MPI_INT,c lient->intraComm);272 MPI_Allgather(&numValue,1,MPI_INT,recvCount,1,MPI_INT,context->intraComm_); 275 273 276 274 int* displ=new int[nbClient]; … … 279 277 280 278 // Each client have enough global info of axis 281 MPI_Allgatherv(sendIndexBuff,numValue,MPI_INT,recvIndexBuff,recvCount,displ,MPI_INT,c lient->intraComm);282 MPI_Allgatherv(sendValueBuff,numValue,MPI_DOUBLE,&(recvBuff[0]),recvCount,displ,MPI_DOUBLE,c lient->intraComm);279 MPI_Allgatherv(sendIndexBuff,numValue,MPI_INT,recvIndexBuff,recvCount,displ,MPI_INT,context->intraComm_); 280 MPI_Allgatherv(sendValueBuff,numValue,MPI_DOUBLE,&(recvBuff[0]),recvCount,displ,MPI_DOUBLE,context->intraComm_); 283 281 284 282 for (int idx = 0; idx < srcSize; ++idx) -
XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm_inverse.cpp
r1639 r1784 98 98 { 99 99 CContext* context = CContext::getCurrent(); 100 CContextClient* client=context->client; 101 int clientRank = client->clientRank; 102 int nbClient = client->clientSize; 100 int clientRank = context->intraCommRank_; 101 int nbClient = context->intraCommSize_; 103 102 104 103 int niSrc = axisSrc_->n.getValue(); … … 131 130 } 132 131 133 CClientClientDHTInt dhtIndexProcRank(globalIndex2ProcRank, c lient->intraComm);132 CClientClientDHTInt dhtIndexProcRank(globalIndex2ProcRank, context->intraComm_); 134 133 dhtIndexProcRank.computeIndexInfoMapping(globalSrcIndex); 135 134 CClientClientDHTInt::Index2VectorInfoTypeMap& computedGlobalIndexOnProc = dhtIndexProcRank.getInfoIndexMap(); … … 161 160 sendRankSizeMap[itIndex->first] = sendSize; 162 161 } 163 MPI_Allgather(&connectedClient,1,MPI_INT,recvCount,1,MPI_INT,c lient->intraComm);162 MPI_Allgather(&connectedClient,1,MPI_INT,recvCount,1,MPI_INT,context->intraComm_); 164 163 165 164 displ[0]=0 ; … … 168 167 int* recvRankBuff=new int[recvSize]; 169 168 int* recvSizeBuff=new int[recvSize]; 170 MPI_Allgatherv(sendRankBuff,connectedClient,MPI_INT,recvRankBuff,recvCount,displ,MPI_INT,c lient->intraComm);171 MPI_Allgatherv(sendSizeBuff,connectedClient,MPI_INT,recvSizeBuff,recvCount,displ,MPI_INT,c lient->intraComm);169 MPI_Allgatherv(sendRankBuff,connectedClient,MPI_INT,recvRankBuff,recvCount,displ,MPI_INT,context->intraComm_); 170 MPI_Allgatherv(sendSizeBuff,connectedClient,MPI_INT,recvSizeBuff,recvCount,displ,MPI_INT,context->intraComm_); 172 171 for (int i = 0; i < nbClient; ++i) 173 172 { … … 193 192 194 193 requests.push_back(MPI_Request()); 195 MPI_Irecv(recvGlobalIndexSrc[recvRank], recvSize, MPI_UNSIGNED_LONG, recvRank, 46, c lient->intraComm, &requests.back());194 MPI_Irecv(recvGlobalIndexSrc[recvRank], recvSize, MPI_UNSIGNED_LONG, recvRank, 46, context->intraComm_, &requests.back()); 196 195 } 197 196 … … 215 214 // Send global index source and mask 216 215 requests.push_back(MPI_Request()); 217 MPI_Isend(sendGlobalIndexSrc[sendRank], sendSize, MPI_UNSIGNED_LONG, sendRank, 46, c lient->intraComm, &requests.back());216 MPI_Isend(sendGlobalIndexSrc[sendRank], sendSize, MPI_UNSIGNED_LONG, sendRank, 46, context->intraComm_, &requests.back()); 218 217 } 219 218 … … 232 231 233 232 requests.push_back(MPI_Request()); 234 MPI_Irecv(recvValueFromSrc[recvRank], recvSize, MPI_DOUBLE, recvRank, 48, c lient->intraComm, &requests.back());233 MPI_Irecv(recvValueFromSrc[recvRank], recvSize, MPI_DOUBLE, recvRank, 48, context->intraComm_, &requests.back()); 235 234 } 236 235 … … 250 249 // Okie, now inform the destination which source index are masked 251 250 requests.push_back(MPI_Request()); 252 MPI_Isend(sendValueToDest[recvRank], recvSize, MPI_DOUBLE, recvRank, 48, c lient->intraComm, &requests.back());251 MPI_Isend(sendValueToDest[recvRank], recvSize, MPI_DOUBLE, recvRank, 48, context->intraComm_, &requests.back()); 253 252 } 254 253 status.resize(requests.size()); -
XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm_transformation.cpp
r1622 r1784 76 76 { 77 77 CContext* context = CContext::getCurrent(); 78 CContextClient* client=context->client; 79 int clientRank = client->clientRank; 80 int clientSize = client->clientSize; 78 int clientRank = context->intraCommRank_; 79 int clientSize = context->intraCommSize_; 81 80 82 81 size_t globalIndex; … … 127 126 } 128 127 129 CClientClientDHTInt dhtIndexProcRank(globalIndex2ProcRank, c lient->intraComm);128 CClientClientDHTInt dhtIndexProcRank(globalIndex2ProcRank, context->intraComm_); 130 129 dhtIndexProcRank.computeIndexInfoMapping(globalAxisIndex); 131 130 -
XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm_expand.cpp
r1622 r1784 94 94 { 95 95 CContext* context = CContext::getCurrent(); 96 CContextClient* client=context->client; 97 96 98 97 int type = 1; // For edge 99 98 CMesh mesh; … … 103 102 switch (domainSource->type) { 104 103 case CDomain::type_attr::unstructured: 105 mesh.getGlobalNghbFaces(type, c lient->intraComm, domainSource->i_index, bounds_lon_src, bounds_lat_src, neighborsSrc);104 mesh.getGlobalNghbFaces(type, context->intraComm_, domainSource->i_index, bounds_lon_src, bounds_lat_src, neighborsSrc); 106 105 updateUnstructuredDomainAttributes(domainDestination, domainSource, neighborsSrc); 107 106 break; … … 123 122 { 124 123 CContext* context = CContext::getCurrent(); 125 CContextClient* client=context->client;126 124 127 125 int type = 1; // For edge … … 132 130 switch (domainSource->type) { 133 131 case CDomain::type_attr::unstructured: 134 mesh.getGlobalNghbFaces(type, c lient->intraComm, domainSource->i_index, bounds_lon_src, bounds_lat_src, neighborsSrc);132 mesh.getGlobalNghbFaces(type, context->intraComm_, domainSource->i_index, bounds_lon_src, bounds_lat_src, neighborsSrc); 135 133 updateUnstructuredDomainAttributes(domainDestination, domainSource, neighborsSrc); 136 134 break; … … 158 156 int iindexSrc, jindexSrc, globIndexSrc; 159 157 CContext* context = CContext::getCurrent(); 160 CContextClient* client=context->client;161 158 162 159 // First of all, "copy" all attributes of domain source to domain destination … … 341 338 } 342 339 343 CClientClientDHTDouble dhtData(localData,c lient->intraComm);340 CClientClientDHTDouble dhtData(localData,context->intraComm_); 344 341 dhtData.computeIndexInfoMapping(globalIndexSrcOnDstDomain); 345 342 CClientClientDHTDouble::Index2VectorInfoTypeMap& neighborData = dhtData.getInfoIndexMap(); … … 482 479 483 480 CContext* context = CContext::getCurrent(); 484 CContextClient* client=context->client;485 481 486 482 // First of all, "copy" all attributes of domain source to domain destination … … 606 602 } 607 603 608 CClientClientDHTDouble dhtData(localData, client->intraComm);604 CClientClientDHTDouble dhtData(localData, context->intraComm_); 609 605 CArray<size_t,1> neighborInd(nbNeighbor); 610 606 for (int idx = 0; idx < nbNeighbor; ++idx) -
XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm_generate_rectilinear.cpp
r1639 r1784 48 48 { 49 49 CContext* context = CContext::getCurrent(); 50 CContextClient* client = context->client; 51 50 int clientSize = context->intraCommSize_ ; 51 int clientRank = context->intraCommRank_ ; 52 52 53 std::vector<CDomain*> domListSrcP = gridSrc->getDomains(); 53 54 std::vector<CAxis*> axisListSrcP = gridSrc->getAxis(); … … 56 57 { 57 58 // First, find (roundly) distribution of associated axis (if any) 58 if (axisListSrcP.empty()) nbDomainDistributedPart_ = client ->clientSize;59 if (axisListSrcP.empty()) nbDomainDistributedPart_ = clientSize; 59 60 else 60 61 { … … 69 70 HashXIOS<int> hashFunc; 70 71 StdSize hashValue = hashFunc.hashVec(globalAxisIndex); 71 std::vector<StdSize> recvBuff(client ->clientSize);72 std::vector<StdSize> recvBuff(clientSize); 72 73 MPI_Gather(&hashValue, 1, MPI_UNSIGNED_LONG, 73 74 &recvBuff[0], 1, MPI_UNSIGNED_LONG, 74 75 0, 75 c lient->intraComm);76 if (0 == client ->clientRank)76 context->intraComm_); 77 if (0 == clientRank) 77 78 { 78 79 std::set<StdSize> setTmp; … … 88 89 89 90 MPI_Bcast(&nbLocalAxis[0], nbAxis, MPI_INT, 90 0, c lient->intraComm);91 0, context->intraComm_); 91 92 } 92 93 93 94 int nbAxisDistributedPart = 1; 94 95 for (int j = 0; j < nbAxis; ++j) nbAxisDistributedPart *= nbLocalAxis[j]; 95 nbDomainDistributedPart_ = client ->clientSize/nbAxisDistributedPart;96 nbDomainDistributedPart_ = clientSize/nbAxisDistributedPart; 96 97 } 97 98 } … … 118 119 119 120 CContext* context = CContext::getCurrent(); 120 CContextClient* client = context->client; 121 int modPart = (client->clientSize) % nbPartition; 121 int modPart = (context->intraCommSize_) % nbPartition; 122 122 if (0 != modPart) 123 123 ERROR("CDomainAlgorithmGenerateRectilinear::computeDistributionGridDestination(CGrid* gridDest)", 124 124 << "The grid " <<gridDest->getId() << " is not well-distributed. There is an incompatibility between distribution of axis and domain."); 125 nbDomainDistributedPart_ = c lient->clientSize/nbPartition;125 nbDomainDistributedPart_ = context->intraCommSize_/nbPartition; 126 126 127 127 } -
XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm_interpolate.cpp
r1639 r1784 109 109 110 110 CContext* context = CContext::getCurrent(); 111 CContextClient* client=context->client; 112 int clientRank = client->clientRank; 111 int clientRank = context->intraCommRank_; 113 112 int i, j, k, idx; 114 113 std::vector<double> srcPole(3,0), dstPole(3,0); … … 300 299 301 300 // Calculate weight index 302 Mapper mapper(c lient->intraComm);301 Mapper mapper(context->intraComm_); 303 302 mapper.setVerbosity(PROGRESS) ; 304 303 … … 432 431 { 433 432 CContext* context = CContext::getCurrent(); 434 CContextClient* client=context->client; 435 433 436 434 MPI_Comm poleComme(MPI_COMM_NULL); 437 MPI_Comm_split(c lient->intraComm, interMapValuePole.empty() ? MPI_UNDEFINED : 1, 0, &poleComme);435 MPI_Comm_split(context->intraComm_, interMapValuePole.empty() ? MPI_UNDEFINED : 1, 0, &poleComme); 438 436 if (MPI_COMM_NULL != poleComme) 439 437 { … … 534 532 { 535 533 CContext* context = CContext::getCurrent(); 536 CContextClient* client=context->client; 537 int clientRank = client->clientRank; 534 int clientRank = context->intraCommRank_; 538 535 539 536 this->transformationMapping_.resize(1); … … 800 797 { 801 798 CContext* context = CContext::getCurrent(); 802 CContextClient* client=context->client; 803 799 804 800 size_t n_src = domainSrc_->ni_glo * domainSrc_->nj_glo; 805 801 size_t n_dst = domainDest_->ni_glo * domainDest_->nj_glo; … … 835 831 } 836 832 837 MPI_Allreduce(&localNbWeight, &globalNbWeight, 1, MPI_LONG, MPI_SUM, c lient->intraComm);838 MPI_Scan(&localNbWeight, &startIndex, 1, MPI_LONG, MPI_SUM, c lient->intraComm);833 MPI_Allreduce(&localNbWeight, &globalNbWeight, 1, MPI_LONG, MPI_SUM, context->intraComm_); 834 MPI_Scan(&localNbWeight, &startIndex, 1, MPI_LONG, MPI_SUM, context->intraComm_); 839 835 840 836 if (0 == globalNbWeight) … … 850 846 std::vector<StdSize> count(1, localNbWeight); 851 847 852 WriteNetCdf netCdfWriter(filename, c lient->intraComm);848 WriteNetCdf netCdfWriter(filename, context->intraComm_); 853 849 854 850 // Define some dimensions … … 895 891 896 892 CContext* context = CContext::getCurrent(); 897 CContextClient* client=context->client; 898 int clientRank = client->clientRank; 899 int clientSize = client->clientSize; 893 int clientRank = context->intraCommRank_; 894 int clientSize = context->intraCommSize_; 900 895 901 896 -
XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm_transformation.cpp
r1622 r1784 39 39 { 40 40 CContext* context = CContext::getCurrent(); 41 CContextClient* client=context->client; 42 int clientRank = client->clientRank; 43 int clientSize = client->clientSize; 41 int clientRank = context->intraCommRank_; 42 int clientSize = context->intraCommSize_; 44 43 45 44 int niGlob = domainSrc_->ni_glo.getValue(); … … 62 61 } 63 62 64 CClientClientDHTInt dhtIndexProcRank(globalIndex2ProcRank, c lient->intraComm);63 CClientClientDHTInt dhtIndexProcRank(globalIndex2ProcRank, context->intraComm_); 65 64 dhtIndexProcRank.computeIndexInfoMapping(globalDomainIndex); 66 65 globalDomainIndexOnProc = dhtIndexProcRank.getInfoIndexMap(); -
XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/generic_algorithm_transformation.cpp
r1639 r1784 124 124 { 125 125 CContext* context = CContext::getCurrent(); 126 CContextClient* client = context->client; 127 126 128 127 computePositionElements(gridSrc, gridDst); 129 128 std::vector<CScalar*> scalarListSrcP = gridSrc->getScalars(); … … 136 135 { 137 136 distributed=domainListSrcP[elementPositionInGridSrc2DomainPosition_[elementPositionInGrid]]->isDistributed() ; 138 MPI_Allreduce(&distributed,&distributed_glo, 1, MPI_INT, MPI_LOR, c lient->intraComm) ;137 MPI_Allreduce(&distributed,&distributed_glo, 1, MPI_INT, MPI_LOR, context->intraComm_) ; 139 138 140 139 } … … 142 141 { 143 142 distributed=axisListSrcP[elementPositionInGridSrc2AxisPosition_[elementPositionInGrid]]->isDistributed() ; 144 MPI_Allreduce(&distributed,&distributed_glo, 1, MPI_INT, MPI_LOR, c lient->intraComm) ;143 MPI_Allreduce(&distributed,&distributed_glo, 1, MPI_INT, MPI_LOR, context->intraComm_) ; 145 144 } 146 145 else //it's a scalar … … 170 169 { 171 170 CContext* context = CContext::getCurrent(); 172 CContextClient* client = context->client; 173 int nbClient = client->clientSize; 171 int nbClient = context->intraCommSize_; 174 172 175 173 typedef std::unordered_map<int, std::vector<std::pair<int,double> > > SrcToDstMap; … … 238 236 int sendValue = (computeGlobalIndexOnProc) ? 1 : 0; 239 237 int recvValue = 0; 240 MPI_Allreduce(&sendValue, &recvValue, 1, MPI_INT, MPI_SUM, c lient->intraComm);238 MPI_Allreduce(&sendValue, &recvValue, 1, MPI_INT, MPI_SUM, context->intraComm_); 241 239 computeGlobalIndexOnProc = (0 < recvValue); 242 240 … … 475 473 476 474 CContext* context = CContext::getCurrent(); 477 CContextClient* client=context->client; 478 int clientRank = client->clientRank; 475 int clientRank = context->intraCommRank_; 479 476 480 477 std::vector<CDomain*> domainListSrcP = gridSrc->getDomains(); … … 667 664 { 668 665 CContext* context = CContext::getCurrent(); 669 CContextClient* client=context->client; 670 int clientRank = client->clientRank; 671 int clientSize = client->clientSize; 666 int clientRank = context->intraCommRank_; 667 int clientSize = context->intraCommSize_; 672 668 673 669 globalScalarIndexOnProc.rehash(std::ceil(clientSize/globalScalarIndexOnProc.max_load_factor())); … … 693 689 { 694 690 CContext* context = CContext::getCurrent(); 695 CContextClient* client=context->client; 696 int clientRank = client->clientRank; 697 int clientSize = client->clientSize; 691 int clientRank = context->intraCommRank_; 692 int clientSize = context->intraCommSize_; 698 693 699 694 size_t globalIndex; … … 710 705 } 711 706 712 CClientClientDHTInt dhtIndexProcRank(globalIndex2ProcRank, c lient->intraComm);707 CClientClientDHTInt dhtIndexProcRank(globalIndex2ProcRank, context->intraComm_); 713 708 CArray<size_t,1> globalAxisIndex(axisDst->index.numElements()); 714 709 for (int idx = 0; idx < globalAxisIndex.numElements(); ++idx) … … 764 759 { 765 760 CContext* context = CContext::getCurrent(); 766 CContextClient* client=context->client; 767 int clientRank = client->clientRank; 768 int clientSize = client->clientSize; 761 int clientRank = context->intraCommRank_; 762 int clientSize = context->intraCommSize_; 769 763 770 764 int niGlobSrc = domainSrc->ni_glo.getValue(); … … 820 814 } 821 815 822 CClientClientDHTInt dhtIndexProcRank(globalIndex2ProcRank, c lient->intraComm);816 CClientClientDHTInt dhtIndexProcRank(globalIndex2ProcRank, context->intraComm_); 823 817 dhtIndexProcRank.computeIndexInfoMapping(globalDomainIndex); 824 818 … … 862 856 863 857 CContext* context = CContext::getCurrent(); 864 CContextClient* client = context->client; 865 int nbClient = client->clientSize; 858 int nbClient = context->intraCommSize_; 866 859 867 860 computePositionElements(gridDst, gridSrc); -
XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/grid_transformation.cpp
r1639 r1784 365 365 366 366 CContext* context = CContext::getCurrent(); 367 CContextClient* client = context->client;368 367 369 368 ListAlgoType::const_iterator itb = listAlgos_.begin(), … … 419 418 CTimer::get("computeTransformationMappingConvert").resume(); 420 419 nbLocalIndexOnGridDest_.push_back(nbLocalIndexOnGridDest) ; 421 int clientRank=c lient->clientRank;420 int clientRank=context->intraCommRank_ ; 422 421 { 423 422 SendingIndexGridSourceMap tmp; … … 475 474 { 476 475 CContext* context = CContext::getCurrent(); 477 CContextClient* client = context->client; 478 int nbClient = client->clientSize; 479 int clientRank = client->clientRank; 476 int nbClient = context->intraCommSize_; 477 int clientRank = context->intraCommRank_; 480 478 481 479 // Recalculate the distribution of grid destination 482 CDistributionClient distributionClientDest(client ->clientRank, tmpGridDestination_);480 CDistributionClient distributionClientDest(clientRank, tmpGridDestination_); 483 481 CDistributionClient::GlobalLocalDataMap& globalLocalIndexGridDestSendToServer = distributionClientDest.getGlobalLocalDataSendToServer(); 484 482 … … 514 512 sendRankSizeMap[itIndex->first] = sendSize; 515 513 } 516 MPI_Allgather(&connectedClient,1,MPI_INT,recvCount,1,MPI_INT, client->intraComm);514 MPI_Allgather(&connectedClient,1,MPI_INT,recvCount,1,MPI_INT, context->intraComm_); 517 515 518 516 displ[0]=0 ; … … 521 519 int* recvRankBuff=new int[recvSize]; 522 520 int* recvSizeBuff=new int[recvSize]; 523 MPI_Allgatherv(sendRankBuff,connectedClient,MPI_INT,recvRankBuff,recvCount,displ,MPI_INT,c lient->intraComm);524 MPI_Allgatherv(sendSizeBuff,connectedClient,MPI_INT,recvSizeBuff,recvCount,displ,MPI_INT,c lient->intraComm);521 MPI_Allgatherv(sendRankBuff,connectedClient,MPI_INT,recvRankBuff,recvCount,displ,MPI_INT,context->intraComm_); 522 MPI_Allgatherv(sendSizeBuff,connectedClient,MPI_INT,recvSizeBuff,recvCount,displ,MPI_INT,context->intraComm_); 525 523 for (int i = 0; i < nbClient; ++i) 526 524 { … … 546 544 547 545 requests.push_back(MPI_Request()); 548 MPI_Irecv(recvGlobalIndexSrc[recvRank], recvSize, MPI_UNSIGNED_LONG, recvRank, 46, c lient->intraComm, &requests.back());546 MPI_Irecv(recvGlobalIndexSrc[recvRank], recvSize, MPI_UNSIGNED_LONG, recvRank, 46, context->intraComm_, &requests.back()); 549 547 requests.push_back(MPI_Request()); 550 MPI_Irecv(recvMaskDst[recvRank], recvSize, MPI_UNSIGNED_CHAR, recvRank, 47, c lient->intraComm, &requests.back());548 MPI_Irecv(recvMaskDst[recvRank], recvSize, MPI_UNSIGNED_CHAR, recvRank, 47, context->intraComm_, &requests.back()); 551 549 } 552 550 … … 584 582 // Send global index source and mask 585 583 requests.push_back(MPI_Request()); 586 MPI_Isend(sendGlobalIndexSrc[sendRank], sendSize, MPI_UNSIGNED_LONG, sendRank, 46, c lient->intraComm, &requests.back());584 MPI_Isend(sendGlobalIndexSrc[sendRank], sendSize, MPI_UNSIGNED_LONG, sendRank, 46, context->intraComm_, &requests.back()); 587 585 requests.push_back(MPI_Request()); 588 MPI_Isend(sendMaskDst[sendRank], sendSize, MPI_UNSIGNED_CHAR, sendRank, 47, c lient->intraComm, &requests.back());586 MPI_Isend(sendMaskDst[sendRank], sendSize, MPI_UNSIGNED_CHAR, sendRank, 47, context->intraComm_, &requests.back()); 589 587 } 590 588 … … 602 600 603 601 requests.push_back(MPI_Request()); 604 MPI_Irecv(sendMaskDst[recvRank], recvSize, MPI_UNSIGNED_CHAR, recvRank, 48, c lient->intraComm, &requests.back());602 MPI_Irecv(sendMaskDst[recvRank], recvSize, MPI_UNSIGNED_CHAR, recvRank, 48, context->intraComm_, &requests.back()); 605 603 } 606 604 607 605 // Ok, now we fill in local index of grid source (we even count for masked index) 608 CDistributionClient distributionClientSrc(client ->clientRank, gridSource_);606 CDistributionClient distributionClientSrc(clientRank, gridSource_); 609 607 CDistributionClient::GlobalLocalDataMap& globalLocalIndexGridSrcSendToServer = distributionClientSrc.getGlobalLocalDataSendToServer(); 610 608 localIndexToSendFromGridSource_.push_back(SendingIndexGridSourceMap()); … … 639 637 // Okie, now inform the destination which source index are masked 640 638 requests.push_back(MPI_Request()); 641 MPI_Isend(recvMaskDst[recvRank], recvSize, MPI_UNSIGNED_CHAR, recvRank, 48, c lient->intraComm, &requests.back());639 MPI_Isend(recvMaskDst[recvRank], recvSize, MPI_UNSIGNED_CHAR, recvRank, 48, context->intraComm_, &requests.back()); 642 640 } 643 641 status.resize(requests.size()); -
XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/scalar_algorithm_transformation.cpp
r1622 r1784 60 60 { 61 61 CContext* context = CContext::getCurrent(); 62 CContextClient* client=context->client; 63 int clientRank = client->clientRank; 64 int clientSize = client->clientSize; 62 int clientRank = context->intraCommRank_; 63 int clientSize = context->intraCommSize_; 65 64 66 65 if (2 == elementSourceType) // Source is a domain … … 84 83 } 85 84 86 CClientClientDHTInt dhtIndexProcRank(globalIndex2ProcRank, c lient->intraComm);85 CClientClientDHTInt dhtIndexProcRank(globalIndex2ProcRank, context->intraComm_); 87 86 dhtIndexProcRank.computeIndexInfoMapping(globalIndexElementSource); 88 87 globalIndexElementSourceOnProc = dhtIndexProcRank.getInfoIndexMap(); … … 106 105 } 107 106 108 CClientClientDHTInt dhtIndexProcRank(globalIndex2ProcRank, c lient->intraComm);107 CClientClientDHTInt dhtIndexProcRank(globalIndex2ProcRank, context->intraComm_); 109 108 dhtIndexProcRank.computeIndexInfoMapping(globalIndexElementSource); 110 109 globalIndexElementSourceOnProc = dhtIndexProcRank.getInfoIndexMap(); … … 117 116 globalIndex2ProcRank[globalIndex][0] = clientRank; 118 117 119 CClientClientDHTInt dhtIndexProcRank(globalIndex2ProcRank, c lient->intraComm);118 CClientClientDHTInt dhtIndexProcRank(globalIndex2ProcRank, context->intraComm_); 120 119 dhtIndexProcRank.computeIndexInfoMapping(globalIndexElementSource); 121 120 globalIndexElementSourceOnProc = dhtIndexProcRank.getInfoIndexMap();
Note: See TracChangeset
for help on using the changeset viewer.