Changeset 2397 for XIOS3/trunk/src/node
- Timestamp:
- 08/31/22 17:23:56 (22 months ago)
- Location:
- XIOS3/trunk/src/node
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS3/trunk/src/node/axis.cpp
r2389 r2397 982 982 } 983 983 984 void CAxis::distributeToServer(CContextClient* client, std::map<int, CArray<size_t,1>>& globalIndexOut, std::map<int, CArray<size_t,1>>& globalIndexIn,984 void CAxis::distributeToServer(CContextClient* client, bool inOut, std::map<int, CArray<size_t,1>>& globalIndexOut, std::map<int, CArray<size_t,1>>& globalIndexIn, 985 985 shared_ptr<CScattererConnector> &scattererConnector, const string& axisId) 986 986 { … … 1042 1042 // phase 3 : compute connector to receive from server 1043 1043 //////////// 1044 if (inOut) 1044 1045 { 1045 1046 auto scatteredElement = make_shared<CDistributedElement>(n_glo, globalIndexIn) ; … … 1128 1129 // gathererConnector_ -> computeConnector() ; 1129 1130 } 1130 else if (phasis==3) 1131 else if (phasis==3) // only for server -> client 1131 1132 { 1132 1133 elementTo_ = make_shared<CDistributedElement>(event) ; … … 1145 1146 serverFromClientConnector_ = make_shared<CGathererConnector>(elementFrom_->getView(CElementView::FULL), localElement_->getView(CElementView::WORKFLOW)) ; 1146 1147 serverFromClientConnector_->computeConnector() ; 1147 1148 serverToClientConnector_ = make_shared<CScattererConnector>(localElement_->getView(CElementView::WORKFLOW), elementTo_->getView(CElementView::FULL), 1148 elementFrom_.reset() ; 1149 1150 if (elementTo_) 1151 { 1152 serverToClientConnector_ = make_shared<CScattererConnector>(localElement_->getView(CElementView::WORKFLOW), elementTo_->getView(CElementView::FULL), 1149 1153 context->getIntraComm(), client->getRemoteSize()) ; 1150 serverToClientConnector_->computeConnector() ; 1154 serverToClientConnector_->computeConnector() ; 1155 elementTo_.reset() ; 1156 } 1151 1157 } 1152 1158 CATCH_DUMP_ATTR -
XIOS3/trunk/src/node/axis.hpp
r2389 r2397 253 253 public: 254 254 void computeRemoteElement(CContextClient* client, EDistributionType) ; 255 void distributeToServer(CContextClient* client, std::map<int, CArray<size_t,1>>& globalIndexOut, std::map<int, CArray<size_t,1>>& globalIndexIn,255 void distributeToServer(CContextClient* client, bool inOut, std::map<int, CArray<size_t,1>>& globalIndexOut, std::map<int, CArray<size_t,1>>& globalIndexIn, 256 256 shared_ptr<CScattererConnector>& scattererConnector, const string& axisId="") ; 257 257 -
XIOS3/trunk/src/node/context.cpp
r2343 r2397 1012 1012 for(auto file : this->enabledReadModeFiles) file->setContextClient(client) ; 1013 1013 1014 1015 // workflow startpoint => data from server on client side 1016 // important : sendFieldToInputFileServer must be done prior sendFieldToFileServer because for the first case the grid remoteConnectorIn 1017 // and grid remoteConnectorOut will be computed, and in the second case only the remoteConnectorOut. 1018 if (serviceType_==CServicesManager::CLIENT) 1019 { 1020 for(auto field : fileInField) 1021 { 1022 field->sendFieldToInputFileServer() ; 1023 field->connectToServerInput(garbageCollector) ; // connect the field to server filter 1024 fileInFields_.push_back(field) ; 1025 } 1026 } 1027 1014 1028 // workflow endpoint => sent to IO/SERVER 1015 1029 if (serviceType_==CServicesManager::CLIENT || serviceType_==CServicesManager::GATHERER) … … 1076 1090 { 1077 1091 field->connectToCouplerOut(garbageCollector) ; // for now the same kind of filter that for file server 1078 }1079 1080 // workflow startpoint => data from server on client side1081 if (serviceType_==CServicesManager::CLIENT)1082 {1083 for(auto field : fileInField)1084 {1085 field->sendFieldToInputFileServer() ;1086 field->connectToServerInput(garbageCollector) ; // connect the field to server filter1087 fileInFields_.push_back(field) ;1088 }1089 1092 } 1090 1093 -
XIOS3/trunk/src/node/domain.cpp
r2395 r2397 2113 2113 2114 2114 2115 void CDomain::distributeToServer(CContextClient* client, map<int, CArray<size_t,1>>& globalIndexOut, std::map<int, CArray<size_t,1>>& globalIndexIn,2115 void CDomain::distributeToServer(CContextClient* client, bool inOut, map<int, CArray<size_t,1>>& globalIndexOut, std::map<int, CArray<size_t,1>>& globalIndexIn, 2116 2116 shared_ptr<CScattererConnector> &scattererConnector, const string& domainId) 2117 2117 TRY … … 2175 2175 // phase 3 : compute connector to receive from server 2176 2176 //////////// 2177 if (inOut) 2177 2178 { 2178 2179 auto scatteredElement = make_shared<CDistributedElement>(ni_glo*nj_glo, globalIndexIn) ; … … 2278 2279 serverFromClientConnector_ = make_shared<CGathererConnector>(elementFrom_->getView(CElementView::FULL), localElement_->getView(CElementView::WORKFLOW)) ; 2279 2280 serverFromClientConnector_->computeConnector() ; 2281 elementFrom_.reset() ; 2280 2282 2281 serverToClientConnector_ = make_shared<CScattererConnector>(localElement_->getView(CElementView::WORKFLOW), elementTo_->getView(CElementView::FULL), 2283 if (elementTo_) 2284 { 2285 serverToClientConnector_ = make_shared<CScattererConnector>(localElement_->getView(CElementView::WORKFLOW), elementTo_->getView(CElementView::FULL), 2282 2286 context->getIntraComm(), client->getRemoteSize()) ; 2283 serverToClientConnector_->computeConnector() ; 2287 serverToClientConnector_->computeConnector() ; 2288 elementTo_.reset() ; 2289 } 2290 2284 2291 } 2285 2292 CATCH_DUMP_ATTR -
XIOS3/trunk/src/node/domain.hpp
r2389 r2397 309 309 public: 310 310 void computeRemoteElement(CContextClient* client, EDistributionType) ; 311 void distributeToServer(CContextClient* client, std::map<int, CArray<size_t,1>>& globalIndexOut, std::map<int, CArray<size_t,1>>& globalIndexIn,311 void distributeToServer(CContextClient* client, bool inOut, std::map<int, CArray<size_t,1>>& globalIndexOut, std::map<int, CArray<size_t,1>>& globalIndexIn, 312 312 shared_ptr<CScattererConnector> &scattererConnector, const string& domainId="") ; 313 313 -
XIOS3/trunk/src/node/field.cpp
r2326 r2397 1466 1466 getRelFile()->sendFileToFileServer(client); 1467 1467 sentGrid_ = grid_-> duplicateSentGrid() ; 1468 sentGrid_->sendGridToFileServer(client );1468 sentGrid_->sendGridToFileServer(client, false); 1469 1469 name = getFieldOutputName() ; 1470 1470 this->sendAllAttributesToServer(client); … … 1477 1477 getRelFile()->sendFileToFileServer(client); 1478 1478 sentGrid_ = grid_-> duplicateSentGrid() ; 1479 sentGrid_->sendGridToFileServer(client );1479 sentGrid_->sendGridToFileServer(client, true); 1480 1480 read_access=true ; // not the best solution, but on server side, the field must be a starting point of the workflow 1481 1481 // must be replace by a better solution when implementing filters for reading and send to client -
XIOS3/trunk/src/node/grid.cpp
r2351 r2397 1448 1448 1449 1449 1450 void CGrid::sendGridToFileServer(CContextClient* client )1450 void CGrid::sendGridToFileServer(CContextClient* client, bool inOut) 1451 1451 { 1452 1452 if (sendGridToFileServer_done_.count(client)!=0) return ; … … 1457 1457 gridPtr->sendCreateChild(this->getId(),client); 1458 1458 this->sendAllAttributesToServer(client); 1459 distributeGridToServer(client ) ;1459 distributeGridToServer(client, inOut) ; 1460 1460 } 1461 1461 … … 1466 1466 else sendGridToCouplerOut_done_.insert(client) ; 1467 1467 this->sendAllAttributesToServer(client, getCouplingAlias(fieldId)); 1468 distributeGridToServer(client, f ieldId) ;1469 } 1470 1471 1472 void CGrid::distributeGridToServer(CContextClient* client, const string& fieldId)1468 distributeGridToServer(client, false, fieldId) ; 1469 } 1470 1471 1472 void CGrid::distributeGridToServer(CContextClient* client, bool inOut, const string& fieldId) 1473 1473 { 1474 1474 CContext* context = CContext::getCurrent(); … … 1520 1520 // CGridClientServerRemoteConnector : workflowView is added to avoid spurious optimisation with only the fullview 1521 1521 auto gridRemoteConnector = make_shared<CGridClientServerRemoteConnector>(localViews, workflowView, remoteViews, context->getIntraComm(), client->getRemoteSize()) ; 1522 gridRemoteConnector->computeConnector (true) ;1522 gridRemoteConnector->computeConnectorOut() ; 1523 1523 1524 auto gridRemoteConnectorIn = make_shared<CGridClientServerRemoteConnector>(localViews, workflowView, remoteViews, context->getIntraComm(), client->getRemoteSize()) ; 1525 gridRemoteConnectorIn->computeConnector(false) ; 1526 1527 1524 shared_ptr<CGridClientServerRemoteConnector> gridRemoteConnectorIn ; 1525 if (inOut) 1526 { 1527 gridRemoteConnectorIn = make_shared<CGridClientServerRemoteConnector>(localViews, workflowView, remoteViews, context->getIntraComm(), client->getRemoteSize()) ; 1528 gridRemoteConnectorIn->computeConnectorIn() ; 1529 } 1530 else gridRemoteConnectorIn = gridRemoteConnector ; 1531 1532 1528 1533 vector<shared_ptr<CScattererConnector>> scattererConnectors ; 1529 1534 shared_ptr<CScattererConnector> scattererConnector; … … 1533 1538 { 1534 1539 CDomain* domain = (CDomain*) elements[i].ptr ; 1535 if (isCoupling) domain->distributeToServer(client, gridRemoteConnector->getDistributedGlobalIndex(i), gridRemoteConnectorIn->getDistributedGlobalIndex(i),1540 if (isCoupling) domain->distributeToServer(client, inOut, gridRemoteConnector->getDistributedGlobalIndex(i), gridRemoteConnectorIn->getDistributedGlobalIndex(i), 1536 1541 scattererConnector, domain->getCouplingAlias(fieldId,i)) ; 1537 1542 else 1538 1543 { 1539 1544 sendAddDomain(domain->getId(),client) ; 1540 domain->distributeToServer(client, gridRemoteConnector->getDistributedGlobalIndex(i), gridRemoteConnectorIn->getDistributedGlobalIndex(i), scattererConnector) ;1545 domain->distributeToServer(client, inOut, gridRemoteConnector->getDistributedGlobalIndex(i), gridRemoteConnectorIn->getDistributedGlobalIndex(i), scattererConnector) ; 1541 1546 } 1542 1547 scattererConnectors.push_back(scattererConnector) ; … … 1545 1550 { 1546 1551 CAxis* axis = (CAxis*) elements[i].ptr ; 1547 if (isCoupling) axis->distributeToServer(client, gridRemoteConnector->getDistributedGlobalIndex(i), gridRemoteConnectorIn->getDistributedGlobalIndex(i),1552 if (isCoupling) axis->distributeToServer(client, inOut, gridRemoteConnector->getDistributedGlobalIndex(i), gridRemoteConnectorIn->getDistributedGlobalIndex(i), 1548 1553 scattererConnector, axis->getCouplingAlias(fieldId,i)) ; 1549 1554 else 1550 1555 { 1551 1556 sendAddAxis(axis->getId(),client) ; 1552 axis->distributeToServer(client, gridRemoteConnector->getDistributedGlobalIndex(i), gridRemoteConnectorIn->getDistributedGlobalIndex(i), scattererConnector) ;1557 axis->distributeToServer(client, inOut, gridRemoteConnector->getDistributedGlobalIndex(i), gridRemoteConnectorIn->getDistributedGlobalIndex(i), scattererConnector) ; 1553 1558 } 1554 1559 scattererConnectors.push_back(scattererConnector) ; … … 1557 1562 { 1558 1563 CScalar* scalar = (CScalar*) elements[i].ptr ; 1559 if (isCoupling) scalar->distributeToServer(client, gridRemoteConnector->getDistributedGlobalIndex(i), gridRemoteConnectorIn->getDistributedGlobalIndex(i),1564 if (isCoupling) scalar->distributeToServer(client, inOut, gridRemoteConnector->getDistributedGlobalIndex(i), gridRemoteConnectorIn->getDistributedGlobalIndex(i), 1560 1565 scattererConnector, scalar->getCouplingAlias(fieldId,i)) ; 1561 1566 else 1562 1567 { 1563 1568 sendAddScalar(scalar->getId(),client) ; 1564 scalar->distributeToServer(client, gridRemoteConnector->getDistributedGlobalIndex(i), gridRemoteConnectorIn->getDistributedGlobalIndex(i), scattererConnector) ;1569 scalar->distributeToServer(client, inOut, gridRemoteConnector->getDistributedGlobalIndex(i), gridRemoteConnectorIn->getDistributedGlobalIndex(i), scattererConnector) ; 1565 1570 } 1566 1571 scattererConnectors.push_back(scattererConnector) ; … … 1588 1593 { 1589 1594 clientToServerConnectors.push_back(element.domain->getClientToServerConnector(client)) ; 1590 clientFromServerConnectors.push_back(element.domain->getClientFromServerConnector(client)) ;1595 if (inOut) clientFromServerConnectors.push_back(element.domain->getClientFromServerConnector(client)) ; 1591 1596 } 1592 1597 else if (element.type==TYPE_AXIS) 1593 1598 { 1594 1599 clientToServerConnectors.push_back(element.axis->getClientToServerConnector(client)) ; 1595 clientFromServerConnectors.push_back(element.axis->getClientFromServerConnector(client)) ;1600 if (inOut) clientFromServerConnectors.push_back(element.axis->getClientFromServerConnector(client)) ; 1596 1601 1597 1602 } … … 1599 1604 { 1600 1605 clientToServerConnectors.push_back(element.scalar->getClientToServerConnector(client)) ; 1601 clientFromServerConnectors.push_back(element.scalar->getClientFromServerConnector(client)) ;1606 if (inOut) clientFromServerConnectors.push_back(element.scalar->getClientFromServerConnector(client)) ; 1602 1607 } 1603 1608 } … … 1605 1610 // compute the grid clientToServerConnector to send flux from client to servers 1606 1611 clientToServerConnector_[client] = make_shared<CGridScattererConnector>(clientToServerConnectors) ; 1607 clientFromServerConnector_[client] = make_shared<CGridGathererConnector>(clientFromServerConnectors) ;1612 if (inOut) clientFromServerConnector_[client] = make_shared<CGridGathererConnector>(clientFromServerConnectors) ; 1608 1613 1609 1614 } -
XIOS3/trunk/src/node/grid.hpp
r2326 r2397 172 172 173 173 public: 174 void sendGridToFileServer(CContextClient* client ) ;174 void sendGridToFileServer(CContextClient* client, bool inOut) ; 175 175 private: 176 176 std::set<CContextClient*> sendGridToFileServer_done_ ; … … 351 351 352 352 public: //? 353 void distributeGridToServer(CContextClient* client, const string& fieldId="");353 void distributeGridToServer(CContextClient* client, bool inOut, const string& fieldId=""); 354 354 355 355 -
XIOS3/trunk/src/node/scalar.cpp
r2343 r2397 420 420 } 421 421 422 void CScalar::distributeToServer(CContextClient* client, std::map<int, CArray<size_t,1>>& globalIndexOut, std::map<int, CArray<size_t,1>>& globalIndexIn,422 void CScalar::distributeToServer(CContextClient* client, bool inOut, std::map<int, CArray<size_t,1>>& globalIndexOut, std::map<int, CArray<size_t,1>>& globalIndexIn, 423 423 shared_ptr<CScattererConnector> &scattererConnector, const string& scalarId) 424 424 { … … 480 480 // phase 3 : compute connector to receive from server 481 481 //////////// 482 if (inOut) 482 483 { 483 484 auto scatteredElement = make_shared<CDistributedElement>(1, globalIndexIn) ; … … 567 568 serverFromClientConnector_ = make_shared<CGathererConnector>(elementFrom_->getView(CElementView::FULL), localElement_->getView(CElementView::WORKFLOW)) ; 568 569 serverFromClientConnector_->computeConnector() ; 570 elementFrom_.reset() ; 569 571 570 serverToClientConnector_ = make_shared<CScattererConnector>(localElement_->getView(CElementView::WORKFLOW), elementTo_->getView(CElementView::FULL), 572 if (elementTo_) 573 { 574 serverToClientConnector_ = make_shared<CScattererConnector>(localElement_->getView(CElementView::WORKFLOW), elementTo_->getView(CElementView::FULL), 571 575 context->getIntraComm(), client->getRemoteSize()) ; 572 serverToClientConnector_->computeConnector() ; 576 serverToClientConnector_->computeConnector() ; 577 elementTo_.reset() ; 578 } 573 579 } 574 580 CATCH_DUMP_ATTR -
XIOS3/trunk/src/node/scalar.hpp
r2326 r2397 202 202 public: 203 203 void computeRemoteElement(CContextClient* client, EDistributionType) ; 204 void distributeToServer(CContextClient* client, std::map<int, CArray<size_t,1>>& globalIndexOut, std::map<int, CArray<size_t,1>>& globalIndexIn,204 void distributeToServer(CContextClient* client, bool inOut, std::map<int, CArray<size_t,1>>& globalIndexOut, std::map<int, CArray<size_t,1>>& globalIndexIn, 205 205 shared_ptr<CScattererConnector> &scattererConnector, const string& scalarId="") ; 206 206
Note: See TracChangeset
for help on using the changeset viewer.