Ignore:
Timestamp:
05/15/17 15:00:24 (3 years ago)
Author:
oabramkina
Message:

Two-level server: merging new grid functionalities and changes in the communication protocol (e.g. non-blocking context finalize, registries, oasis).

Tests on curie: test_client, test_complete, nemo (test_xios2_cmip6.exe).

To do: non-structured grid, check reading, possible bug in client/server initialization (?).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_olga/src/node/file.cpp

    r1129 r1130  
    866866   { 
    867867      sendAddItem(id, EVENT_ID_ADD_FIELD); 
    868     // CContext* context = CContext::getCurrent(); 
    869  
    870     // if (! context->hasServer ) 
    871     // { 
    872     //    CContextClient* client = context->client; 
    873  
    874     //    CEventClient event(this->getType(),EVENT_ID_ADD_FIELD); 
    875     //    if (client->isServerLeader()) 
    876     //    { 
    877     //      CMessage msg; 
    878     //      msg << this->getId(); 
    879     //      msg << id; 
    880     //      const std::list<int>& ranks = client->getRanksServerLeader(); 
    881     //      for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank) 
    882     //        event.push(*itRank,1,msg); 
    883     //      client->sendEvent(event); 
    884     //    } 
    885     //    else client->sendEvent(event); 
    886     // } 
    887  
    888868   } 
    889869 
     
    891871   { 
    892872      sendAddItem(id, EVENT_ID_ADD_FIELD, client); 
    893     // CContext* context = CContext::getCurrent(); 
    894  
    895     // if (! context->hasServer ) 
    896     // { 
    897     //    CContextClient* client = context->client; 
    898  
    899     //    CEventClient event(this->getType(),EVENT_ID_ADD_FIELD); 
    900     //    if (client->isServerLeader()) 
    901     //    { 
    902     //      CMessage msg; 
    903     //      msg << this->getId(); 
    904     //      msg << id; 
    905     //      const std::list<int>& ranks = client->getRanksServerLeader(); 
    906     //      for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank) 
    907     //        event.push(*itRank,1,msg); 
    908     //      client->sendEvent(event); 
    909     //    } 
    910     //    else client->sendEvent(event); 
    911     // } 
    912  
    913873   } 
    914874 
     
    920880   { 
    921881      sendAddItem(id, (int)EVENT_ID_ADD_FIELD_GROUP); 
    922     // CContext* context = CContext::getCurrent(); 
    923     // if (! context->hasServer ) 
    924     // { 
    925     //    CContextClient* client = context->client; 
    926  
    927     //    CEventClient event(this->getType(),EVENT_ID_ADD_FIELD_GROUP); 
    928     //    if (client->isServerLeader()) 
    929     //    { 
    930     //      CMessage msg; 
    931     //      msg << this->getId(); 
    932     //      msg << id; 
    933     //      const std::list<int>& ranks = client->getRanksServerLeader(); 
    934     //      for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank) 
    935     //        event.push(*itRank,1,msg); 
    936     //      client->sendEvent(event); 
    937     //    } 
    938     //    else client->sendEvent(event); 
    939     // } 
    940  
    941882   } 
    942883 
     
    1030971   { 
    1031972      sendAddItem(id, (int)EVENT_ID_ADD_VARIABLE_GROUP); 
    1032     // CContext* context = CContext::getCurrent(); 
    1033     // if (! context->hasServer ) 
    1034     // { 
    1035     //    CContextClient* client = context->client; 
    1036  
    1037     //    CEventClient event(this->getType(),EVENT_ID_ADD_VARIABLE_GROUP); 
    1038     //    if (client->isServerLeader()) 
    1039     //    { 
    1040     //      CMessage msg; 
    1041     //      msg << this->getId(); 
    1042     //      msg << id; 
    1043     //      const std::list<int>& ranks = client->getRanksServerLeader(); 
    1044     //      for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank) 
    1045     //        event.push(*itRank,1,msg); 
    1046     //      client->sendEvent(event); 
    1047     //    } 
    1048     //    else client->sendEvent(event); 
    1049     // } 
    1050  
    1051973   } 
    1052974 
     
    1059981   { 
    1060982      sendAddItem(id, (int)EVENT_ID_ADD_VARIABLE); 
    1061     // CContext* context = CContext::getCurrent(); 
    1062  
    1063     // if (! context->hasServer ) 
    1064     // { 
    1065     //    CContextClient* client = context->client; 
    1066  
    1067     //    CEventClient event(this->getType(),EVENT_ID_ADD_VARIABLE); 
    1068     //    if (client->isServerLeader()) 
    1069     //    { 
    1070     //      CMessage msg; 
    1071     //      msg << this->getId(); 
    1072     //      msg << id; 
    1073     //      const std::list<int>& ranks = client->getRanksServerLeader(); 
    1074     //      for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank) 
    1075     //        event.push(*itRank,1,msg); 
    1076     //      client->sendEvent(event); 
    1077     //    } 
    1078     //    else client->sendEvent(event); 
    1079     // } 
    1080  
    1081983   } 
    1082984 
    1083985   void CFile::sendAddVariable(const string& id, CContextClient* client) 
    1084986   { 
    1085       sendAddItem(id, (int)EVENT_ID_ADD_VARIABLE); 
    1086     // CContext* context = CContext::getCurrent(); 
    1087  
    1088     // if (! context->hasServer ) 
    1089     // { 
    1090     //    CContextClient* client = context->client; 
    1091  
    1092     //    CEventClient event(this->getType(),EVENT_ID_ADD_VARIABLE); 
    1093     //    if (client->isServerLeader()) 
    1094     //    { 
    1095     //      CMessage msg; 
    1096     //      msg << this->getId(); 
    1097     //      msg << id; 
    1098     //      const std::list<int>& ranks = client->getRanksServerLeader(); 
    1099     //      for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank) 
    1100     //        event.push(*itRank,1,msg); 
    1101     //      client->sendEvent(event); 
    1102     //    } 
    1103     //    else client->sendEvent(event); 
    1104     // } 
    1105  
     987      sendAddItem(id, (int)EVENT_ID_ADD_VARIABLE, client); 
    1106988   } 
    1107989 
     
    11531035      addVariableGroup(id); 
    11541036   } 
    1155  
    1156    /*! 
    1157      \brief Sending all active (enabled) fields from client to server. 
    1158    Each field is identified uniquely by its string identity. Not only should we 
    1159    send the id to server but also we need to send ids of reference domain and reference axis. 
    1160    With these two id, it's easier to make reference to grid where all data should be written. 
    1161    Remark: This function must be called AFTER all active (enabled) files have been created on the server side 
    1162    */ 
    1163 //   void CFile::sendEnabledFields() 
    1164 //   { 
    1165 //     size_t size = this->enabledFields.size(); 
    1166 //     for (size_t i = 0; i < size; ++i) 
    1167 //     { 
    1168 //       CField* field = this->enabledFields[i]; 
    1169 //       this->sendAddField(field->getId()); 
    1170 //       field->sendAllAttributesToServer(); 
    1171 //       field->sendAddAllVariables(); 
    1172 //     } 
    1173 //   } 
    11741037 
    11751038   /*! 
Note: See TracChangeset for help on using the changeset viewer.