Changeset 2022 for XIOS/dev/dev_ym/XIOS_COUPLING
- Timestamp:
- 01/22/21 18:46:08 (3 years ago)
- Location:
- XIOS/dev/dev_ym/XIOS_COUPLING/src
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_ym/XIOS_COUPLING/src/context_server.cpp
r1875 r2022 52 52 CXios::getContextsManager()->getContextInfo(context->getId(), contextInfo, intraComm) ; 53 53 54 if (contextInfo.serviceType != CServicesManager::CLIENT) // we must have an event scheduler => to be retrieve from the associated services55 {54 // if (contextInfo.serviceType != CServicesManager::CLIENT) // we must have an event scheduler => to be retrieve from the associated services 55 // { 56 56 if (!isAttachedModeEnabled()) eventScheduler_=CXios::getPoolRessource()->getService(contextInfo.serviceId,contextInfo.partitionId)->getEventScheduler() ; 57 }57 // } 58 58 59 59 … … 323 323 else if (!eventScheduler_ || eventScheduler_->queryEvent(currentTimeLine,hashId) ) 324 324 { 325 MPI_Barrier(intraComm) ; 325 326 // When using attached mode, synchronise the processes to avoid that differents event be scheduled by differents processes 326 327 // The best way to properly solve this problem will be to use the event scheduler also in attached mode … … 332 333 isProcessingEvent_=true ; 333 334 CTimer::get("Process events").resume(); 335 info(100)<<"Received Event "<<currentTimeLine<<" of class "<<event->classId<<" of type "<<event->type<<endl ; 334 336 dispatchEvent(*event); 335 337 CTimer::get("Process events").suspend(); -
XIOS/dev/dev_ym/XIOS_COUPLING/src/event_scheduler.cpp
r1760 r2022 76 76 { 77 77 registerEvent(timeLine, contextHashId, level) ; 78 checkEvent() ; 78 79 } 79 80 … … 94 95 bool CEventScheduler::queryEvent(const size_t timeLine, const size_t contextHashId) 95 96 { 96 97 checkEvent() ; 97 98 if (! eventStack.empty() && eventStack.front().first==timeLine && eventStack.front().second==contextHashId) 98 99 { -
XIOS/dev/dev_ym/XIOS_COUPLING/src/filter/client_from_client_source_filter.cpp
r1973 r2022 34 34 CDataPacketPtr packet(new CDataPacket); 35 35 packet->date = date; 36 packet->status = CDataPacket::NO_ERROR; 37 for (auto& subEvent : event.subEvents) (*subEvent.buffer) >> packet->timestamp ; // better management of time lien later... 36 38 packet->timestamp = date; 37 packet->status = CDataPacket::NO_ERROR; 38 39 39 40 grid_->getClientFromClientConnector()->transfer(event,packet->data) ; 40 41 onOutputReady(packet); … … 47 48 if (wasDataAlreadyReceived_) isDataLate = lastDateReceived_ + offset_ + freqOp_ <= currentDate ; 48 49 else isDataLate = CContext::getCurrent()->getCalendar()->getInitDate()+ offset_ <= currentDate ; 50 return isDataLate ; 49 51 } 50 52 -
XIOS/dev/dev_ym/XIOS_COUPLING/src/filter/client_to_server_store_filter.cpp
r1984 r2022 15 15 { 16 16 if (!field) 17 ERROR("C FileWriterFilter::CFileWriterFilter(CField* field)",17 ERROR("CClientToServerStoreFilter::CClientToServerStoreFilter(CGarbageCollector& gc, CField* field, CContextClient* client)", 18 18 "The field cannot be null."); 19 19 } -
XIOS/dev/dev_ym/XIOS_COUPLING/src/node/axis.cpp
r1984 r2022 452 452 } 453 453 454 string CAxis::getCouplingAlias(const string& fieldId, int posInGrid) 455 { 456 return "_axis["+std::to_string(posInGrid)+"]_of_"+fieldId ; 457 } 458 454 459 void CAxis::makeAliasForCoupling(const string& fieldId, int posInGrid) 455 460 { 456 const string axisId = "_axis["+std::to_string(posInGrid)+"]_of_"+fieldId;461 const string axisId = getCouplingAlias(fieldId,posInGrid) ; 457 462 this->createAlias(axisId) ; 458 463 } -
XIOS/dev/dev_ym/XIOS_COUPLING/src/node/axis.hpp
r2007 r2022 175 175 public: 176 176 void makeAliasForCoupling(const string& fieldId, int posInGrid) ; 177 177 string getCouplingAlias(const string& fieldId, int posInGrid) ; 178 178 179 179 private: -
XIOS/dev/dev_ym/XIOS_COUPLING/src/node/context.cpp
r2002 r2022 26 26 #include "coupler_in.hpp" 27 27 #include "coupler_out.hpp" 28 29 namespace xios { 28 #include "servers_ressource.hpp" 29 #include "pool_ressource.hpp" 30 #include "services.hpp" 31 #include "contexts_manager.hpp" 32 #include <chrono> 33 #include <random> 34 35 namespace xios 36 { 30 37 31 38 std::shared_ptr<CContextGroup> CContext::root; … … 67 74 //---------------------------------------------------------------- 68 75 76 void CContext::initEventScheduler(void) 77 { 78 SRegisterContextInfo contextInfo ; 79 CXios::getContextsManager()->getContextInfo(this->getId(), contextInfo, getIntraComm()) ; 80 81 eventScheduler_=CXios::getPoolRessource()->getService(contextInfo.serviceId,contextInfo.partitionId)->getEventScheduler() ; 82 83 // generate unique hash for server 84 auto time=chrono::system_clock::now().time_since_epoch().count() ; 85 std::default_random_engine rd(time); // not reproducible from a run to another 86 std::uniform_int_distribution<size_t> dist; 87 hashId_=dist(rd) ; 88 MPI_Bcast(&hashId_,1,MPI_SIZE_T,0,getIntraComm()) ; // Bcast to all server of the context 89 } 69 90 /*! 70 91 \brief Get context group (context root) … … 497 518 else 498 519 initServer(intraComm, serviceType) ; 520 initEventScheduler() ; 499 521 } 500 522 CATCH_DUMP_ATTR … … 699 721 { 700 722 bool finished=true; 701 702 if (client!=nullptr && !finalized) client->checkBuffers(); 723 bool out; 724 size_t timeLine=timeLine_ ; 725 if (serviceType_==CServicesManager::CLIENT) 726 { 727 timeLine_++ ; 728 eventScheduler_->registerEvent(timeLine, hashId_) ; 729 } 730 731 do 732 { 733 if (client!=nullptr && !finalized) client->checkBuffers(); 703 734 704 for (int i = 0; i < clientPrimServer.size(); ++i)705 {706 if (!finalized) clientPrimServer[i]->checkBuffers();707 if (!finalized) finished &= serverPrimServer[i]->eventLoop(enableEventsProcessing);708 }709 710 for (auto couplerOut : couplerOutClient_)711 if (!finalized) couplerOut.second->checkBuffers();735 for (int i = 0; i < clientPrimServer.size(); ++i) 736 { 737 if (!finalized) clientPrimServer[i]->checkBuffers(); 738 if (!finalized) finished &= serverPrimServer[i]->eventLoop(enableEventsProcessing); 739 } 740 741 for (auto couplerOut : couplerOutClient_) 742 if (!finalized) couplerOut.second->checkBuffers(); 712 743 713 for (auto couplerIn : couplerInClient_)714 if (!finalized) couplerIn.second->checkBuffers();744 for (auto couplerIn : couplerInClient_) 745 if (!finalized) couplerIn.second->checkBuffers(); 715 746 716 for (auto couplerOut : couplerOutServer_)717 if (!finalized) couplerOut.second->eventLoop(enableEventsProcessing);718 719 for (auto couplerIn : couplerInServer_)720 if (!finalized) couplerIn.second->eventLoop(enableEventsProcessing);747 for (auto couplerOut : couplerOutServer_) 748 if (!finalized) couplerOut.second->eventLoop(enableEventsProcessing); 749 750 for (auto couplerIn : couplerInServer_) 751 if (!finalized) couplerIn.second->eventLoop(enableEventsProcessing); 721 752 722 if (server!=nullptr) if (!finalized) finished &= server->eventLoop(enableEventsProcessing);753 if (server!=nullptr) if (!finalized) finished &= server->eventLoop(enableEventsProcessing); 723 754 755 if (serviceType_==CServicesManager::CLIENT) out = eventScheduler_->queryEvent(timeLine,hashId_) ; 756 else out=true ; 757 } while(!out) ; 724 758 return finalized && finished ; 725 759 } … … 990 1024 991 1025 bool workflowGraphIsCompleted ; 992 1026 993 1027 bool first=true ; 1028 994 1029 do 995 1030 { … … 999 1034 workflowGraphIsCompleted &= endWorkflowField->buildWorkflowGraph(garbageCollector) ; 1000 1035 } 1001 1036 1002 1037 for(auto couplerIn : enabledCouplerIn) couplerIn->assignContext() ; 1003 1038 for(auto field : couplerInField) field->makeGridAliasForCoupling(); … … 1013 1048 } 1014 1049 if (first) setClientServerBuffer(couplerOutField, true) ; // set buffer context --> to check 1015 1050 1016 1051 bool couplersReady ; 1017 1052 do … … 1024 1059 couplersReady &= ready ; 1025 1060 } 1026 if (!couplersReady) this->eventLoop() ; 1061 this->eventLoop() ; 1062 1027 1063 } while (!couplersReady) ; 1028 1064 1029 1065 first=false ; 1030 1066 this->eventLoop() ; 1067 1031 1068 } while (!workflowGraphIsCompleted) ; 1069 1032 1070 1033 1071 for( auto field : couplerInField) couplerInFields_.push_back(field) ; … … 1160 1198 ok = true ; 1161 1199 for(auto& couplerOutClient : couplerOutClient_) ok &= isCouplerInCloseDefinition(couplerOutClient.second) ; 1162 this->eventLoop() ; 1200 this->eventLoop() ; 1163 1201 } while (!ok) ; 1164 1202 -
XIOS/dev/dev_ym/XIOS_COUPLING/src/node/context.hpp
r2002 r2022 14 14 #include "services_manager.hpp" 15 15 #include "server_context.hpp" 16 17 18 namespace xios { 16 #include "event_scheduler.hpp" 17 18 19 namespace xios 20 { 19 21 class CContextClient; 20 22 class CContextServer; … … 339 341 340 342 private: 343 CEventScheduler* eventScheduler_ ; //! The local event scheduler for context 344 size_t hashId_ ; //! the local hashId for scheduler 345 size_t timeLine_=0 ; 346 void initEventScheduler(void) ; 347 341 348 bool isPostProcessed; 342 349 bool allProcessed; -
XIOS/dev/dev_ym/XIOS_COUPLING/src/node/domain.cpp
r1984 r2022 1781 1781 1782 1782 1783 string CDomain::getCouplingAlias(const string& fieldId, int posInGrid) 1784 { 1785 return "_domain["+std::to_string(posInGrid)+"]_of_"+fieldId ; 1786 } 1783 1787 1784 1788 /* to be removed later when coupling will be reimplemented, just to not forget */ … … 1788 1792 else sendDomainToFileServer_done_.insert(client) ; 1789 1793 1790 const string domainId = "_domain["+std::to_string(posInGrid)+"]_of_"+fieldId;1794 const string domainId = getCouplingAlias(fieldId, posInGrid) ; 1791 1795 1792 1796 if (!domain_ref.isEmpty()) … … 1805 1809 void CDomain::makeAliasForCoupling(const string& fieldId, int posInGrid) 1806 1810 { 1807 const string domainId = "_domain["+std::to_string(posInGrid)+"]_of_"+fieldId;1811 const string domainId = getCouplingAlias(fieldId, posInGrid); 1808 1812 this->createAlias(domainId) ; 1809 1813 } -
XIOS/dev/dev_ym/XIOS_COUPLING/src/node/domain.hpp
r1984 r2022 240 240 public: 241 241 void makeAliasForCoupling(const string& fieldId, int posInGrid) ; 242 242 string getCouplingAlias(const string& fieldId, int posInGrid) ; 243 243 private: 244 244 -
XIOS/dev/dev_ym/XIOS_COUPLING/src/node/field.cpp
r2018 r2022 586 586 { 587 587 grid->solveElementsRefInheritance() ; 588 589 // new590 591 588 std::pair<std::shared_ptr<CFilter>, std::shared_ptr<CFilter> > filters = grid->buildTransformationGraph(gc, false, gridSrc, detectMissingValues, defaultValue, newGrid) ; 592 589 lastFilter->connectOutput(filters.first, 0); 593 590 lastFilter = filters.second; 594 591 gridSrc = newGrid ; 595 596 // end new 597 /* 598 grid->completeGrid(gridSrc); // grid generation, to be checked 599 grid->checkElementsAttributes() ; 600 grid->prepareTransformGrid(gridSrc) ; // prepare the grid tranformation 601 for(auto fieldId : grid->getAuxInputTransformGrid()) // try to build workflow graph for auxillary field tranformation 602 if (!CField::get(fieldId)->buildWorkflowGraph(gc)) return false ; 603 gridSrc=grid ; 604 */ 605 } 606 607 /* 608 std::shared_ptr<COutputPin> lastFilter ; 609 if (filterExpr) lastFilter=filterExpr ; 610 else lastFilter = inputFilter ; 611 612 gridSrc=getDirectFieldReference()->getGrid() ; 613 for(auto grid : gridPath) 614 { 615 grid->makeTransformGrid() ; // make the grid transformation 616 if (grid->hasTransform()) 617 { 618 std::pair<std::shared_ptr<CFilter>, std::shared_ptr<CFilter> > filters = CSpatialTransformFilter::buildFilterGraph(gc, gridSrc, grid, detectMissingValues, defaultValue); 619 lastFilter->connectOutput(filters.first, 0); 620 lastFilter = filters.second; 621 gridSrc=grid ; 622 } 623 } 624 */ 592 } 593 625 594 grid_=newGrid ; 626 595 grid_ref=grid_->getId() ; // for server … … 665 634 grid_ = newGrid ; 666 635 grid_ref=grid_->getId() ; // for server 667 // grid_->completeGrid(); // grid generation, to be checked => later668 636 grid_->checkElementsAttributes() ; 669 637 instantDataFilter=inputFilter ; … … 1284 1252 if (sendFieldToCouplerOut_done_) return ; 1285 1253 else sendFieldToCouplerOut_done_=true ; 1286 grid_->sendGridToCouplerOut(client, this->getId()); 1254 sentGrid_ = grid_-> duplicateSentGrid() ; 1255 sentGrid_->sendGridToCouplerOut(client, this->getId()); 1287 1256 this->sendGridCompleted(); 1288 1257 … … 1330 1299 CATCH_DUMP_ATTR 1331 1300 1301 bool CField::isGridCompleted(void) 1302 TRY 1303 { 1304 bool isFullCompleted ; 1305 MPI_Allreduce(&isGridCompleted_,&isFullCompleted,1,MPI_C_BOOL, MPI_LAND, CContext::getCurrent()->getIntraComm() ) ; 1306 if ( (isGridCompleted_==false && isFullCompleted==true) ) ERROR("bool CField::isGridCompleted(void)",<< "incoherecy in MPI_AllReduce") ; 1307 return isFullCompleted ; 1308 } 1309 CATCH_DUMP_ATTR 1332 1310 1333 1311 void CField::sendAddAllVariables(CContextClient* client) -
XIOS/dev/dev_ym/XIOS_COUPLING/src/node/field.hpp
r2011 r2022 236 236 bool isGridCompleted_ = true ; 237 237 public: 238 bool isGridCompleted() { return isGridCompleted_ ;}238 bool isGridCompleted() ; 239 239 void setGridCompleted(void) { isGridCompleted_= true; } 240 240 void unsetGridCompleted(void) { isGridCompleted_ = false ;} -
XIOS/dev/dev_ym/XIOS_COUPLING/src/node/grid.cpp
r2016 r2022 1207 1207 gridPtr->sendCreateChild(this->getId(),client); 1208 1208 this->sendAllAttributesToServer(client); 1209 distributeGridToFileServer(client) ; 1210 } 1211 1212 1213 void CGrid::distributeGridToFileServer(CContextClient* client) 1209 distributeGridToServer(client) ; 1210 } 1211 1212 1213 void CGrid::sendGridToCouplerOut(CContextClient* client, const string& fieldId) 1214 { 1215 if (sendGridToCouplerOut_done_.count(client)!=0) return ; 1216 else sendGridToCouplerOut_done_.insert(client) ; 1217 this->sendAllAttributesToServer(client, getCouplingAlias(fieldId)); 1218 distributeGridToServer(client,fieldId) ; 1219 } 1220 1221 1222 void CGrid::distributeGridToServer(CContextClient* client, const string& fieldId) 1214 1223 { 1215 1224 CContext* context = CContext::getCurrent(); 1225 bool isCoupling = !fieldId.empty() ; 1216 1226 // simple Distribution for now 1217 1227 // distribute over the fisrt element except if it is a scalar … … 1261 1271 if (elements[i].type==TYPE_DOMAIN) 1262 1272 { 1263 CDomain* domain = (CDomain*) elements[i].ptr ; 1264 sendAddDomain(domain->getId(),client) ; 1265 domain->distributeToServer(client, gridRemoteConnector.getDistributedGlobalIndex(i), scattererConnector) ; 1266 scattererConnectors.push_back(scattererConnector) ; 1273 CDomain* domain = (CDomain*) elements[i].ptr ; 1274 if (isCoupling) domain->distributeToServer(client, gridRemoteConnector.getDistributedGlobalIndex(i), scattererConnector, domain->getCouplingAlias(fieldId,i)) ; 1275 else 1276 { 1277 sendAddDomain(domain->getId(),client) ; 1278 domain->distributeToServer(client, gridRemoteConnector.getDistributedGlobalIndex(i), scattererConnector) ; 1279 } 1280 scattererConnectors.push_back(scattererConnector) ; 1267 1281 } 1268 1282 else if (elements[i].type==TYPE_AXIS) 1269 1283 { 1270 1284 CAxis* axis = (CAxis*) elements[i].ptr ; 1271 sendAddAxis(axis->getId(),client) ; 1272 axis->distributeToServer(client, gridRemoteConnector.getDistributedGlobalIndex(i), scattererConnector) ; 1285 if (isCoupling) axis->distributeToServer(client, gridRemoteConnector.getDistributedGlobalIndex(i), scattererConnector, axis->getCouplingAlias(fieldId,i)) ; 1286 else 1287 { 1288 sendAddAxis(axis->getId(),client) ; 1289 axis->distributeToServer(client, gridRemoteConnector.getDistributedGlobalIndex(i), scattererConnector) ; 1290 } 1273 1291 scattererConnectors.push_back(scattererConnector) ; 1274 1292 } … … 1276 1294 { 1277 1295 CScalar* scalar = (CScalar*) elements[i].ptr ; 1278 sendAddScalar(scalar->getId(),client) ; 1279 scalar->distributeToServer(client, gridRemoteConnector.getDistributedGlobalIndex(i), scattererConnector) ; 1296 if (isCoupling) scalar->distributeToServer(client, gridRemoteConnector.getDistributedGlobalIndex(i), scattererConnector, scalar->getCouplingAlias(fieldId,i)) ; 1297 else 1298 { 1299 sendAddScalar(scalar->getId(),client) ; 1300 scalar->distributeToServer(client, gridRemoteConnector.getDistributedGlobalIndex(i), scattererConnector) ; 1301 } 1280 1302 scattererConnectors.push_back(scattererConnector) ; 1281 1303 } … … 1291 1313 CEventClient event(getType(), EVENT_ID_SEND_MASK); 1292 1314 CMessage message ; 1293 message<<getId() ; 1315 if (isCoupling) message<<getCouplingAlias(fieldId) ; 1316 else message<<getId() ; 1294 1317 gridScattererConnector.transfer(maskOut, client, event, message) ; 1295 1318 for(auto& it : scattererConnectors) delete it ; … … 1321 1344 clientFromServerConnector_[client] = new CGridGathererConnector(clientFromServerConnectors) ; 1322 1345 1323 1324 } 1346 } 1347 1325 1348 1326 1349 void CGrid::recvMask(CEventServer& event) … … 1373 1396 } 1374 1397 1375 1376 void CGrid::sendGridToCouplerOut(CContextClient* client, const string& fieldId) 1377 { 1378 /* if (sendGridToCouplerOut_done_.count(client)!=0) return ; 1379 else sendGridToCouplerOut_done_.insert(client) ; 1380 1381 CContext* context = CContext::getCurrent(); 1382 // simple Distribution for now 1383 // distribute over the fisrt element except if it is a scalar 1398 string CGrid::getCouplingAlias(const string& fieldId) 1399 { 1400 return "_grid_of_"+fieldId; 1401 } 1402 1403 void CGrid::makeAliasForCoupling(const string& fieldId) 1404 { 1405 string gridId=getCouplingAlias(fieldId) ; 1406 createAlias(gridId) ; 1407 1384 1408 auto& elements = getElements() ; 1385 int posDistributed = 0 ;1386 for(auto& element : elements)1387 {1388 if (element.type==TYPE_DOMAIN) break ;1389 else if (element.type==TYPE_AXIS) break ;1390 else if (element.type==TYPE_SCALAR) posDistributed++ ;1391 }1392 1393 vector<CLocalView*> localViews ;1394 vector<CDistributedView*> remoteViews ;1395 1396 1409 for(int i=0 ; i<elements.size() ; i++) 1397 1410 { 1398 if (elements[i].type==TYPE_DOMAIN) 1399 { 1400 CDomain* domain = (CDomain*) elements[i].ptr ; 1401 domain->computeRemoteElement(client, posDistributed==i ? EDistributionType::BANDS : EDistributionType::NONE) ; 1402 remoteViews.push_back(domain->getRemoteElement(client)->getView(CElementView::FULL)) ; 1403 localViews.push_back(domain->getLocalView(CElementView::FULL)) ; 1404 } 1405 else if (elements[i].type==TYPE_AXIS) 1406 { 1407 CAxis* axis = (CAxis*) elements[i].ptr ; 1408 axis->computeRemoteElement(client, posDistributed==i ? EDistributionType::BANDS : EDistributionType::NONE) ; 1409 remoteViews.push_back(axis->getRemoteElement(client)->getView(CElementView::FULL)) ; 1410 localViews.push_back(axis->getLocalView(CElementView::FULL)) ; 1411 } 1412 else if (elements[i].type==TYPE_SCALAR) 1413 { 1414 CScalar* scalar = (CScalar*) elements[i].ptr ; 1415 scalar->computeRemoteElement(client, posDistributed==i ? EDistributionType::BANDS : EDistributionType::NONE) ; 1416 remoteViews.push_back(scalar->getRemoteElement(client)->getView(CElementView::FULL)) ; 1417 localViews.push_back(scalar->getLocalView(CElementView::FULL)) ; 1418 } 1419 } 1420 CGridRemoteConnector gridRemoteConnector(localViews, remoteViews, context->getIntraComm(), client->getRemoteSize()) ; 1421 gridRemoteConnector.computeConnector() ; 1422 1423 vector<CScattererConnector*> clientToClientConnectors ; 1424 for(int i=0 ; i<elements.size() ; i++) 1425 { 1426 if (elements[i].type==TYPE_DOMAIN) 1427 { 1428 CDomain* domain = (CDomain*) elements[i].ptr ; 1429 sendAddDomain(domain->getId(),client) ; 1430 domain->distributeToServer(client, gridRemoteConnector.getDistributedGlobalIndex(i)) ; 1431 clientToClientConnectors.push_back(domain->getClientToServerConnector(client)) ; 1432 } 1433 else if (elements[i].type==TYPE_AXIS) 1434 { 1435 CAxis* axis = (CAxis*) elements[i].ptr ; 1436 sendAddAxis(axis->getId(),client) ; 1437 axis->distributeToServer(client, gridRemoteConnector.getDistributedGlobalIndex(i)) ; 1438 clientToClientConnectors.push_back(axis->getClientToServerConnector(client)) ; 1439 } 1440 else if (elements[i].type==TYPE_SCALAR) 1441 { 1442 CScalar* scalar = (CScalar*) elements[i].ptr ; 1443 sendAddScalar(scalar->getId(),client) ; 1444 scalar->distributeToServer(client, gridRemoteConnector.getDistributedGlobalIndex(i)) ; 1445 clientToClientConnectors.push_back(scalar->getClientToServerConnector(client)) ; 1446 } 1447 } 1448 1449 // compute the grid clientToServerConnector to send flux from client to servers 1450 clientToClientConnector_[client] = new CGridScattererConnector(clientToClientConnectors) ;*/ 1451 } 1452 1453 void CGrid::makeAliasForCoupling(const string& fieldId) 1454 { 1455 string gridId="_grid_of_"+fieldId ; 1456 createAlias(gridId) ; 1457 1458 const auto& domVect = getDomains() ; 1459 for (int pos=0; pos<domVect.size();pos++) domVect[pos]->makeAliasForCoupling(fieldId, pos); 1460 1461 const auto& axisVect=getAxis() ; 1462 for (int pos=0; pos<axisVect.size();pos++) axisVect[pos]->makeAliasForCoupling(fieldId, pos); 1463 1464 const auto& scalVect=getScalars() ; 1465 for (int pos=0; pos<scalVect.size();pos++) scalVect[pos]->makeAliasForCoupling(fieldId, pos); 1411 if (elements[i].type==TYPE_DOMAIN) elements[i].domain->makeAliasForCoupling(fieldId, i); 1412 else if (elements[i].type==TYPE_AXIS) elements[i].axis->makeAliasForCoupling(fieldId, i); 1413 else if (elements[i].type==TYPE_SCALAR) elements[i].scalar->makeAliasForCoupling(fieldId, i); 1414 } 1466 1415 } 1467 1416 -
XIOS/dev/dev_ym/XIOS_COUPLING/src/node/grid.hpp
r2011 r2022 174 174 public: 175 175 void makeAliasForCoupling(const string& fieldId) ; 176 string getCouplingAlias(const string& fieldId) ; 176 177 177 178 public: … … 341 342 342 343 public: //? 343 void distributeGridTo FileServer(CContextClient* client);344 void distributeGridToServer(CContextClient* client, const string& fieldId=""); 344 345 345 346 -
XIOS/dev/dev_ym/XIOS_COUPLING/src/node/scalar.cpp
r1984 r2022 197 197 else sendScalarToCouplerOut_done_.insert(client) ; 198 198 199 string scalarId ="_scalar["+std::to_string(posInGrid)+"]_of_"+fieldId;199 string scalarId = getCouplingAlias(fieldId, posInGrid) ; 200 200 201 201 this->sendAllAttributesToServer(client, scalarId); 202 202 } 203 203 204 string CScalar::getCouplingAlias(const string& fieldId, int posInGrid) 205 { 206 return "_scalar["+std::to_string(posInGrid)+"]_of_"+fieldId ; 207 } 208 204 209 void CScalar::makeAliasForCoupling(const string& fieldId, int posInGrid) 205 210 { 206 const string scalarId = "_scalar["+std::to_string(posInGrid)+"]_of_"+fieldId;211 const string scalarId = getCouplingAlias(fieldId, posInGrid) ; 207 212 this->createAlias(scalarId) ; 208 213 } -
XIOS/dev/dev_ym/XIOS_COUPLING/src/node/scalar.hpp
r1984 r2022 94 94 public: 95 95 void makeAliasForCoupling(const string& fieldId, int posInGrid) ; 96 string getCouplingAlias(const string& fieldId, int posInGrid) ; 96 97 97 98 ////////////////////////////////
Note: See TracChangeset
for help on using the changeset viewer.