Changeset 1875 for XIOS/dev/dev_ym/XIOS_COUPLING/src/node/axis.cpp
- Timestamp:
- 05/12/20 11:52:13 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_ym/XIOS_COUPLING/src/node/axis.cpp
r1872 r1875 575 575 } 576 576 577 void CAxis::sendAxisToCouplerOut(CContextClient* client, const std::vector<int>& globalDim, int orderPositionInGrid, const string& fieldId, int posInGrid) 578 { 579 if (sendAxisToFileServer_done_.count(client)!=0) return ; 580 else sendAxisToFileServer_done_.insert(client) ; 581 582 string axisId="_axis["+std::to_string(posInGrid)+"]_of_"+fieldId ; 583 584 if (!axis_ref.isEmpty()) 585 { 586 auto axis_ref_tmp=axis_ref.getValue() ; 587 axis_ref.reset() ; // remove the reference, find an other way to do that more cleanly 588 this->sendAllAttributesToServer(client, axisId) ; 589 axis_ref = axis_ref_tmp ; 590 } 591 else this->sendAllAttributesToServer(client, axisId) ; 592 593 this->sendAttributes(client, globalDim, orderPositionInGrid, CServerDistributionDescription::BAND_DISTRIBUTION, axisId) ; 594 } 595 596 void CAxis::makeAliasForCoupling(const string& fieldId, int posInGrid) 597 { 598 const string axisId = "_axis["+std::to_string(posInGrid)+"]_of_"+fieldId ; 599 this->createAlias(axisId) ; 600 } 601 577 602 /*! 578 603 Send attributes from one client to other clients … … 581 606 */ 582 607 void CAxis::sendAttributes(CContextClient* client, const std::vector<int>& globalDim, int orderPositionInGrid, 583 CServerDistributionDescription::ServerDistributionType distType )584 TRY 585 { 586 sendDistributionAttribute(client, globalDim, orderPositionInGrid, distType );608 CServerDistributionDescription::ServerDistributionType distType, const string& axisId) 609 TRY 610 { 611 sendDistributionAttribute(client, globalDim, orderPositionInGrid, distType, axisId); 587 612 588 613 // if (index.numElements() == n_glo.getValue()) … … 590 615 || (index.numElements() != n_glo)) 591 616 { 592 sendDistributedAttributes(client );617 sendDistributedAttributes(client, axisId); 593 618 } 594 619 else 595 620 { 596 sendNonDistributedAttributes(client );621 sendNonDistributedAttributes(client, axisId); 597 622 } 598 623 } … … 889 914 */ 890 915 void CAxis::sendDistributionAttribute(CContextClient* client, const std::vector<int>& globalDim, int orderPositionInGrid, 891 CServerDistributionDescription::ServerDistributionType distType) 892 TRY 893 { 916 CServerDistributionDescription::ServerDistributionType distType, const string& axisId) 917 TRY 918 { 919 string serverAxisId = axisId.empty() ? this->getId() : axisId ; 894 920 int nbServer = client->serverSize; 895 921 … … 914 940 msgs.push_back(CMessage()); 915 941 CMessage& msg = msgs.back(); 916 msg << this->getId();942 msg << serverAxisId; 917 943 msg << ni << begin; 918 944 msg << isCompressible_; … … 962 988 In the future, if new attributes are added, they should also be processed in this function 963 989 */ 964 void CAxis::sendNonDistributedAttributes(CContextClient* client) 965 TRY 966 { 990 void CAxis::sendNonDistributedAttributes(CContextClient* client, const string& axisId) 991 TRY 992 { 993 string serverAxisId = axisId.empty() ? this->getId() : axisId ; 994 967 995 CEventClient event(getType(), EVENT_ID_NON_DISTRIBUTED_ATTRIBUTES); 968 996 size_t nbIndex = index.numElements(); … … 996 1024 msgs.push_back(CMessage()); 997 1025 CMessage& msg = msgs.back(); 998 msg << this->getId();1026 msg << serverAxisId; 999 1027 msg << index.getValue() << dataIndex << mask.getValue(); 1000 1028 msg << hasValue; … … 1087 1115 In future, if new attributes are added, they should also be processed in this function 1088 1116 */ 1089 void CAxis::sendDistributedAttributes(CContextClient* client) 1090 TRY 1091 { 1117 void CAxis::sendDistributedAttributes(CContextClient* client, const string& axisId) 1118 TRY 1119 { 1120 string serverAxisId = axisId.empty() ? this->getId() : axisId ; 1121 1092 1122 int ind, idx; 1093 1123 int nbServer = client->serverSize; … … 1166 1196 1167 1197 listData.push_back(CMessage()); 1168 listData.back() << this->getId()1198 listData.back() << serverAxisId 1169 1199 << list_indi.back() << list_dataInd.back(); 1170 1200 … … 1431 1461 CATCH_DUMP_ATTR 1432 1462 1433 /*!1434 \brief Check if a axis is completed1435 Before make any axis processing, we must be sure that all axis informations have1436 been sent, for exemple when reading a grid in a file or when grid elements are sent by an1437 other context (coupling). So all direct reference of the axis (axis_ref) must be also completed1438 \return true if axis and axis reference are completed1439 */1440 bool CAxis::checkIfCompleted(void)1441 {1442 if (hasDirectAxisReference()) if (!getDirectAxisReference()->checkIfCompleted()) return false;1443 return isCompleted_ ;1444 }1445 1446 /*!1447 \brief Set a axis as completed1448 When all information about a axis have been received, the axis is tagged as completed and is1449 suitable for processing1450 */1451 void CAxis::setCompleted(void)1452 {1453 if (hasDirectAxisReference()) getDirectAxisReference()->setCompleted() ;1454 isCompleted_=true ;1455 }1456 1457 /*!1458 \brief Set a axis as uncompleted1459 When informations about a axis are expected from a grid reading from file or coupling, the axis is1460 tagged as uncompleted and is not suitable for processing1461 */1462 void CAxis::setUncompleted(void)1463 {1464 if (hasDirectAxisReference()) getDirectAxisReference()->setUncompleted() ;1465 isCompleted_=false ;1466 }1467 1468 1469 1470 1463 /*! 1471 1464 * Go through the hierarchy to find the axis from which the transformations must be inherited
Note: See TracChangeset
for help on using the changeset viewer.