Changeset 1794 for XIOS


Ignore:
Timestamp:
12/16/19 19:22:59 (4 years ago)
Author:
ymipsl
Message:
  • add some comment about grid map/array/indexes
  • Add some "_" to suffix data members of the class

YM

Location:
XIOS/dev/dev_ym/XIOS_COUPLING/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/client_server_mapping.cpp

    r1639 r1794  
    2727  \param [in] nClient number of clients 
    2828  \param [in] clientIntraComm MPI communication of clients 
    29   \param [in] connectedServerRank Rank of servers connected to one client 
     29  \param [in] connectedServerRank Rank of servers connected to the current client 
    3030*/ 
    3131std::map<int,int> CClientServerMapping::computeConnectedClients(int nbServer, int nbClient, 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/filter/source_filter.cpp

    r1637 r1794  
    3434    packet->status = CDataPacket::NO_ERROR; 
    3535 
    36     packet->data.resize(grid->storeIndex_client.numElements());     
     36    packet->data.resize(grid->storeIndex_client_.numElements());     
    3737     
    3838    if (compression) 
     
    8080    packet->status = CDataPacket::NO_ERROR; 
    8181     
    82     if (data.size() != grid->storeIndex_fromSrv.size()) 
     82    if (data.size() != grid->storeIndex_fromSrv_.size()) 
    8383      ERROR("CSourceFilter::streamDataFromServer(CDate date, const std::map<int, CArray<double, 1> >& data)", 
    8484            << "Incoherent data received from servers," 
    85             << " expected " << grid->storeIndex_fromSrv.size() << " chunks but " << data.size() << " were given."); 
     85            << " expected " << grid->storeIndex_fromSrv_.size() << " chunks but " << data.size() << " were given."); 
    8686 
    87     packet->data.resize(grid->storeIndex_client.numElements()); 
     87    packet->data.resize(grid->storeIndex_client_.numElements()); 
    8888    std::map<int, CArray<double, 1> >::const_iterator it, itEnd = data.end(); 
    8989    for (it = data.begin(); it != itEnd; it++) 
    9090    {       
    91       CArray<int,1>& index = grid->storeIndex_fromSrv[it->first]; 
     91      CArray<int,1>& index = grid->storeIndex_fromSrv_[it->first]; 
    9292      for (int n = 0; n < index.numElements(); n++) 
    9393        packet->data(index(n)) = it->second(n); 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/filter/spatial_transform_filter.cpp

    r1784 r1794  
    174174        gridTransformation->computeAll(dataAuxInputs, packet->timestamp); 
    175175      } 
    176       packet->data.resize(gridTransformation->getGridDestination()->storeIndex_client.numElements()); 
     176      packet->data.resize(gridTransformation->getGridDestination()->storeIndex_client_.numElements()); 
    177177      if (0 != packet->data.numElements()) 
    178178        (packet->data)(0) = defaultValue; 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/node/field.cpp

    r1784 r1794  
    162162       if (client->isServerLeader()) 
    163163       { 
    164           for (it = grid->storeIndex_toSrv[client].begin(); it != grid->storeIndex_toSrv[client].end(); it++) 
     164          for (it = grid->storeIndex_toSrv_[client].begin(); it != grid->storeIndex_toSrv_[client].end(); it++) 
    165165          { 
    166166            int rank = it->first; 
     
    182182    else 
    183183    { 
    184       for (it = grid->storeIndex_toSrv[client].begin(); it != grid->storeIndex_toSrv[client].end(); it++) 
     184      for (it = grid->storeIndex_toSrv_[client].begin(); it != grid->storeIndex_toSrv_[client].end(); it++) 
    185185      { 
    186186        int rank = it->first; 
     
    194194 
    195195        list_msg.back() << getId() << data_tmp; 
    196         event.push(rank, grid->nbSenders[receiverSize][rank], list_msg.back()); 
     196        event.push(rank, grid->nbSenders_[receiverSize][rank], list_msg.back()); 
    197197      } 
    198198      client->sendEvent(event); 
     
    231231    if (0 == recvDataSrv.numElements()) 
    232232    {             
    233       CArray<int,1>& storeClient = grid->storeIndex_client; 
     233      CArray<int,1>& storeClient = grid->storeIndex_client_; 
    234234 
    235235      // Gather all data from different clients       
     
    248248    if (opeDate <= currDate) 
    249249    { 
    250       for (map<int, CArray<size_t, 1> >::iterator it = grid->outLocalIndexStoreOnClient.begin(); it != grid->outLocalIndexStoreOnClient.end(); ++it) 
     250      for (map<int, CArray<size_t, 1> >::iterator it = grid->outLocalIndexStoreOnClient_.begin(); it != grid->outLocalIndexStoreOnClient_.end(); ++it) 
    251251      { 
    252252        CArray<double,1> tmp; 
     
    445445    else 
    446446    { 
    447       for (map<int, CArray<size_t, 1> >::iterator it = grid->outLocalIndexStoreOnClient.begin();  
    448                                                   it != grid->outLocalIndexStoreOnClient.end(); ++it) 
     447      for (map<int, CArray<size_t, 1> >::iterator it = grid->outLocalIndexStoreOnClient_.begin();  
     448                                                  it != grid->outLocalIndexStoreOnClient_.end(); ++it) 
    449449      { 
    450450        CArray<size_t,1>& indexTmp = it->second; 
     
    472472        } 
    473473 
    474         event.push(it->first, grid->nbReadSenders[client][it->first], msg); 
     474        event.push(it->first, grid->nbReadSenders_[client][it->first], msg); 
    475475      } 
    476476      client->sendEvent(event); 
     
    498498        if (0 == recvDataSrv.numElements()) 
    499499        {             
    500           CArray<int,1>& storeClient = grid->storeIndex_client;           
     500          CArray<int,1>& storeClient = grid->storeIndex_client_;           
    501501          recvDataSrv.resize(storeClient.numElements());           
    502502        } 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/node/grid.cpp

    r1787 r1794  
    695695     int nbStoreGridMask = clientDistribution_->getLocalMaskIndexOnClient().size(); 
    696696     // nbStoreGridMask = nbStoreIndex if grid mask is defined, and 0 otherwise 
    697      storeIndex_client.resize(nbStoreIndex); 
    698      storeMask_client.resize(nbStoreGridMask); 
    699      for (int idx = 0; idx < nbStoreIndex; ++idx) storeIndex_client(idx) = (clientDistribution_->getLocalDataIndexOnClient())[idx]; 
    700      for (int idx = 0; idx < nbStoreGridMask; ++idx) storeMask_client(idx) = (clientDistribution_->getLocalMaskIndexOnClient())[idx]; 
     697     storeIndex_client_.resize(nbStoreIndex); 
     698     storeMask_client_.resize(nbStoreGridMask); 
     699     for (int idx = 0; idx < nbStoreIndex; ++idx) storeIndex_client_(idx) = (clientDistribution_->getLocalDataIndexOnClient())[idx]; 
     700     for (int idx = 0; idx < nbStoreGridMask; ++idx) storeMask_client_(idx) = (clientDistribution_->getLocalMaskIndexOnClient())[idx]; 
    701701 
    702702     if (0 == serverDistribution_) isDataDistributed_= clientDistribution_->isDataDistributed(); 
    703703     else 
    704704     { 
    705         // Mapping global index received from clients to the storeIndex_client 
     705        // Mapping global index received from clients to the storeIndex_client_ 
    706706        CDistributionClient::GlobalLocalDataMap& globalDataIndex = clientDistribution_->getGlobalDataIndexOnClient(); 
    707707        CDistributionClient::GlobalLocalDataMap::const_iterator itGloe = globalDataIndex.end(); 
    708         map<int, CArray<size_t, 1> >::iterator itb = outGlobalIndexFromClient.begin(), 
    709                                                ite = outGlobalIndexFromClient.end(), it; 
     708        map<int, CArray<size_t, 1> >::iterator itb = outGlobalIndexFromClient_.begin(), 
     709                                               ite = outGlobalIndexFromClient_.end(), it; 
    710710 
    711711        for (it = itb; it != ite; ++it) 
    712712        { 
    713713          int rank = it->first; 
    714           CArray<size_t,1>& globalIndex = outGlobalIndexFromClient[rank]; 
    715           outLocalIndexStoreOnClient.insert(make_pair(rank, CArray<size_t,1>(globalIndex.numElements()))); 
    716           CArray<size_t,1>& localIndex = outLocalIndexStoreOnClient[rank]; 
     714          CArray<size_t,1>& globalIndex = outGlobalIndexFromClient_[rank]; 
     715          outLocalIndexStoreOnClient_.insert(make_pair(rank, CArray<size_t,1>(globalIndex.numElements()))); 
     716          CArray<size_t,1>& localIndex = outLocalIndexStoreOnClient_[rank]; 
    717717          size_t nbIndex = 0; 
    718718 
     
    772772            connectedDataSize_.erase(receiverSize); 
    773773            globalIndexOnServer_.erase(receiverSize); 
    774             nbSenders.erase(receiverSize); 
     774            nbSenders_.erase(receiverSize); 
    775775         } 
    776776 
     
    872872         } 
    873873 
    874          nbSenders[receiverSize] = clientServerMap_->computeConnectedClients(receiverSize, client->clientSize, client->intraComm, connectedServerRank_[receiverSize]); 
     874         nbSenders_[receiverSize] = clientServerMap_->computeConnectedClients(receiverSize, client->clientSize, client->intraComm, connectedServerRank_[receiverSize]); 
    875875       } 
    876876     } 
     
    911911       if (serverDistribution_!=0) serverDistribution_->partialClear() ; 
    912912       if (clientDistribution_!=0) clientDistribution_->partialClear() ; 
    913        outGlobalIndexFromClient.clear() ; 
     913       outGlobalIndexFromClient_.clear() ; 
    914914     } 
    915915   } 
     
    13101310   TRY 
    13111311   { 
    1312       const StdSize size = storeIndex_client.numElements(); 
     1312      const StdSize size = storeIndex_client_.numElements(); 
    13131313 
    13141314      stored.resize(size); 
    1315       for(StdSize i = 0; i < size; i++) stored(i) = data[storeIndex_client(i)]; 
     1315      for(StdSize i = 0; i < size; i++) stored(i) = data[storeIndex_client_(i)]; 
    13161316   } 
    13171317   CATCH 
     
    13201320   TRY 
    13211321   { 
    1322       const StdSize size = storeIndex_client.numElements(); 
    1323  
    1324       for(StdSize i = 0; i < size; i++) data[storeIndex_client(i)] = stored(i); 
     1322      const StdSize size = storeIndex_client_.numElements(); 
     1323 
     1324      for(StdSize i = 0; i < size; i++) data[storeIndex_client_(i)] = stored(i); 
    13251325   } 
    13261326   CATCH 
     
    13281328   void CGrid::maskField_arr(const double* const data, CArray<double, 1>& stored) const 
    13291329   { 
    1330       const StdSize size = storeIndex_client.numElements(); 
     1330      const StdSize size = storeIndex_client_.numElements(); 
    13311331      stored.resize(size); 
    13321332      const double nanValue = std::numeric_limits<double>::quiet_NaN(); 
    13331333 
    1334       if (storeMask_client.numElements() != 0) 
    1335         for(StdSize i = 0; i < size; i++) stored(i) = (storeMask_client(i)) ? data[storeIndex_client(i)] : nanValue; 
     1334      if (storeMask_client_.numElements() != 0) 
     1335        for(StdSize i = 0; i < size; i++) stored(i) = (storeMask_client_(i)) ? data[storeIndex_client_(i)] : nanValue; 
    13361336      else 
    1337         for(StdSize i = 0; i < size; i++) stored(i) = data[storeIndex_client(i)]; 
     1337        for(StdSize i = 0; i < size; i++) stored(i) = data[storeIndex_client_(i)]; 
    13381338   } 
    13391339 
     
    13561356      clientDistribution_ = new CDistributionClient(rank, this); 
    13571357 
    1358       storeIndex_client.resize(1); 
    1359       storeIndex_client(0) = 0;       
     1358      storeIndex_client_.resize(1); 
     1359      storeIndex_client_(0) = 0;       
    13601360 
    13611361      if (0 != serverDistribution_) 
    13621362      { 
    1363         map<int, CArray<size_t, 1> >::iterator itb = outGlobalIndexFromClient.begin(), 
    1364                                                ite = outGlobalIndexFromClient.end(), it; 
     1363        map<int, CArray<size_t, 1> >::iterator itb = outGlobalIndexFromClient_.begin(), 
     1364                                               ite = outGlobalIndexFromClient_.end(), it; 
    13651365        for (it = itb; it != ite; ++it) 
    13661366        { 
    13671367          int rank = it->first; 
    1368           CArray<size_t,1>& globalIndex = outGlobalIndexFromClient[rank]; 
    1369           outLocalIndexStoreOnClient.insert(make_pair(rank, CArray<size_t,1>(globalIndex.numElements()))); 
    1370           CArray<size_t,1>& localIndex = outLocalIndexStoreOnClient[rank]; 
     1368          CArray<size_t,1>& globalIndex = outGlobalIndexFromClient_[rank]; 
     1369          outLocalIndexStoreOnClient_.insert(make_pair(rank, CArray<size_t,1>(globalIndex.numElements()))); 
     1370          CArray<size_t,1>& localIndex = outLocalIndexStoreOnClient_[rank]; 
    13711371          if (1 != globalIndex.numElements()) 
    13721372            ERROR("void CGrid::computeClientIndexScalarGrid()", 
     
    14061406          connectedDataSize_.erase(receiverSize); 
    14071407          globalIndexOnServer_.erase(receiverSize); 
    1408           nbSenders.erase(receiverSize); 
     1408          nbSenders_.erase(receiverSize); 
    14091409        } 
    14101410 
     
    14181418            connectedServerRank_[receiverSize].push_back(rank); 
    14191419            connectedDataSize_[receiverSize][rank] = nb; 
    1420             nbSenders[receiverSize][rank] = nb; 
     1420            nbSenders_[receiverSize][rank] = nb; 
    14211421          } 
    14221422        } 
     
    14301430            connectedServerRank_[receiverSize].push_back(rank); 
    14311431            connectedDataSize_[receiverSize][rank] = nb; 
    1432             nbSenders[receiverSize][rank] = nb; 
     1432            nbSenders_[receiverSize][rank] = nb; 
    14331433          } 
    14341434        } 
     
    14431443  { 
    14441444    CContext* context = CContext::getCurrent(); 
    1445     storeIndex_toSrv.clear(); 
     1445    storeIndex_toSrv_.clear(); 
    14461446    std::list<CContextClient*>::iterator it; 
    14471447 
     
    14621462          int rank = *itRank; 
    14631463          int nb = 1; 
    1464           storeIndex_toSrv[client].insert(std::make_pair(rank, CArray<int,1>(nb))); 
     1464          storeIndex_toSrv_[client].insert(std::make_pair(rank, CArray<int,1>(nb))); 
    14651465          listOutIndex.push_back(CArray<size_t,1>(nb)); 
    14661466 
    1467           CArray<int, 1>& outLocalIndexToServer = storeIndex_toSrv[client][rank]; 
     1467          CArray<int, 1>& outLocalIndexToServer = storeIndex_toSrv_[client][rank]; 
    14681468          CArray<size_t, 1>& outGlobalIndexOnServer = listOutIndex.back(); 
    14691469 
     
    14751475 
    14761476          if (context->hasClient && !context->hasServer) 
    1477             storeIndex_fromSrv.insert(std::make_pair(rank, CArray<int,1>(outLocalIndexToServer))); 
     1477            storeIndex_fromSrv_.insert(std::make_pair(rank, CArray<int,1>(outLocalIndexToServer))); 
    14781478 
    14791479          listMsg.push_back(CMessage()); 
     
    14981498 
    14991499          if (context->hasClient && !context->hasServer) 
    1500             storeIndex_fromSrv.insert(std::make_pair(rank, CArray<int,1>(outLocalIndexToServer))); 
     1500            storeIndex_fromSrv_.insert(std::make_pair(rank, CArray<int,1>(outLocalIndexToServer))); 
    15011501        } 
    15021502        client->sendEvent(event); 
     
    15101510  { 
    15111511    CContext* context = CContext::getCurrent(); 
    1512     storeIndex_toSrv.clear(); 
     1512    storeIndex_toSrv_.clear(); 
    15131513    std::list<CContextClient*>::iterator it; 
    15141514 
     
    15431543          for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank) 
    15441544          { 
    1545             storeIndex_toSrv[client].insert(std::make_pair(*itRank, CArray<int,1>(outLocalIndexToServer))); 
     1545            storeIndex_toSrv_[client].insert(std::make_pair(*itRank, CArray<int,1>(outLocalIndexToServer))); 
    15461546            if (context->hasClient && !context->hasServer) 
    1547               storeIndex_fromSrv.insert(std::make_pair(*itRank, CArray<int,1>(outLocalIndexToServer))); 
     1547              storeIndex_fromSrv_.insert(std::make_pair(*itRank, CArray<int,1>(outLocalIndexToServer))); 
    15481548             
    15491549            listOutIndex.push_back(CArray<size_t,1>(outGlobalIndexOnServer)); 
     
    15681568           for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank) 
    15691569           { 
    1570              storeIndex_fromSrv.insert(std::make_pair(*itRank, CArray<int,1>(outLocalIndexToServer))); 
     1570             storeIndex_fromSrv_.insert(std::make_pair(*itRank, CArray<int,1>(outLocalIndexToServer))); 
    15711571           } 
    15721572           client->sendEvent(event); 
     
    16041604            nb = globalIndexTmp[rank].size(); 
    16051605 
    1606           storeIndex_toSrv[client].insert(make_pair(rank, CArray<int,1>(nb))); 
     1606          storeIndex_toSrv_[client].insert(make_pair(rank, CArray<int,1>(nb))); 
    16071607          listOutIndex.push_back(CArray<size_t,1>(nb)); 
    16081608 
    1609           CArray<int, 1>& outLocalIndexToServer = storeIndex_toSrv[client][rank]; 
     1609          CArray<int, 1>& outLocalIndexToServer = storeIndex_toSrv_[client][rank]; 
    16101610          CArray<size_t, 1>& outGlobalIndexOnServer = listOutIndex.back(); 
    16111611 
     
    16161616          } 
    16171617 
    1618           storeIndex_fromSrv.insert(make_pair(rank, CArray<int,1>(outLocalIndexToServer))); 
     1618          storeIndex_fromSrv_.insert(make_pair(rank, CArray<int,1>(outLocalIndexToServer))); 
    16191619          listMsg.push_back(CMessage()); 
    16201620          listMsg.back() << getId() << isDataDistributed_ << isCompressible_ << listOutIndex.back(); 
    16211621 
    1622           event.push(rank, nbSenders[receiverSize][rank], listMsg.back()); 
     1622          event.push(rank, nbSenders_[receiverSize][rank], listMsg.back()); 
    16231623        } 
    16241624 
     
    16541654    connectedServerRankRead_ = ranks; 
    16551655 
    1656     nbReadSenders.clear(); 
     1656    nbReadSenders_.clear(); 
    16571657    CContextServer* server = context->server  ; 
    16581658    CContextClient* client = context->client;    
     
    17501750      CArray<size_t,1> outIndex; 
    17511751      buffer >> outIndex; 
    1752       outGlobalIndexFromClient.insert(std::make_pair(rank, outIndex)); 
     1752      outGlobalIndexFromClient_.insert(std::make_pair(rank, outIndex)); 
    17531753      connectedDataSizeRead_[rank] = outIndex.numElements(); 
    17541754 
     
    18111811    if (isScalarGrid()) return; 
    18121812 
    1813     nbReadSenders[client] = CClientServerMappingDistributed::computeConnectedClients(context->client->serverSize, context->client->clientSize, context->client->intraComm, ranks); 
     1813    nbReadSenders_[client] = CClientServerMappingDistributed::computeConnectedClients(context->client->serverSize, context->client->clientSize, context->client->intraComm, ranks); 
    18141814 
    18151815  } 
     
    19751975  TRY 
    19761976  { 
     1977    // This function is now useless because it will return false only if server and client size are equal to 1 
     1978    // to be seriously check in future  
     1979 
    19771980    if (isScalarGrid()) return false; 
    19781981    else if (0 != client) 
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/node/grid.hpp

    r1784 r1794  
    205205         bool hasTransform(); 
    206206         size_t getGlobalWrittenSize(void) ; 
    207       public: 
    208          CArray<int, 1> storeIndex_client; 
    209          CArray<bool, 1> storeMask_client; 
    210  
    211 /** Map containing indexes that will be sent in sendIndex(). */ 
    212          std::map<CContextClient*, map<int, CArray<int, 1> > > storeIndex_toSrv; 
    213  
    214 /** Map storing the number of senders. Key = size of receiver's intracomm */ 
    215          std::map<int, std::map<int,int> > nbSenders; 
    216  
    217          std::map<CContextClient*, std::map<int,int> > nbReadSenders; 
    218  
    219          map<int, CArray<int, 1> > storeIndex_fromSrv; // Support, for now, reading with level-1 server 
    220  
    221          map<int, CArray<size_t, 1> > compressedOutIndexFromClient; 
    222  
    223 /** Map storing received indexes. Key = sender rank, value = index array. */ 
    224          map<int, CArray<size_t, 1> > outGlobalIndexFromClient; 
    225  
    226 // Manh Ha's comment: " A client receives global index from other clients (via recvIndex) 
    227 // then does mapping these index into local index of STORE_CLIENTINDEX 
    228 // In this way, store_clientIndex can be used as an input of a source filter 
    229 // Maybe we need a flag to determine whether a client wants to write. TODO " 
    230  
    231 /** Map storing received data. Key = sender rank, value = data array. 
    232  *  The map is created in CGrid::computeClientIndex and filled upon receiving data in CField::recvUpdateData() */ 
    233          map<int, CArray<size_t, 1> > outLocalIndexStoreOnClient;  
    234  
    235 /** Indexes calculated based on server-like distribution. 
    236  *  They are used for writing/reading data and only calculated for server level that does the writing/reading. 
    237  *  Along with localIndexToWriteOnClient, these indexes are used to correctly place incoming data. */ 
    238          CArray<size_t,1> localIndexToWriteOnServer; 
    239  
    240 /** Indexes calculated based on client-like distribution. 
    241  *  They are used for writing/reading data and only calculated for server level that does the writing/reading. 
    242  *  Along with localIndexToWriteOnServer, these indexes are used to correctly place incoming data. */ 
    243          CArray<size_t,1> localIndexToWriteOnClient; 
    244  
    245          CArray<size_t,1> indexFromClients; 
    246207 
    247208         bool hasMask(void) const; 
     
    303264        void computeConnectedClientsScalarGrid();  
    304265 
     266 
     267      public: 
     268/** Array containing the local index of the grid 
     269 *  storeIndex_client[local_workflow_grid_index] -> local_model_grid_index.  
     270 *  Used to store field from model into the worklow, or to return field into models.   
     271 *  The size of the array is the number of local index of the workflow grid */         
     272         CArray<int, 1> storeIndex_client_; 
     273 
     274/** Array containing the grid mask masked defined by the mask_nd grid attribute.         
     275  * The corresponding masked field value provided by the model will be replaced by a NaN value 
     276  * in the workflow.  */ 
     277         CArray<bool, 1> storeMask_client_; 
     278 
     279/** Map containing the indexes on client side that will be sent to each connected server. 
     280  * storeIndex_toSrv[&contextClient] -> map concerning the contextClient for which the data will be sent (client side) 
     281  * storeIndex_toSrv[&contextClient][rank] -> array of indexes that will be sent to each "rank" of the connected servers  
     282  * storeIndex_toSrv[&contextClient][rank](index_of_buffer_sent_to_server) -> local index of the field of the workflow  
     283  * grid that will be sent to server */ 
     284         std::map<CContextClient*, map<int, CArray<int, 1> > > storeIndex_toSrv_; 
     285 
     286 
     287/** Map containing the indexes on client side that will be received from each connected server. 
     288  * This map is used to agreggate field data received from server (for reading) into a single array, which will be an entry 
     289  * point of the worklow on client side. 
     290  * storeIndex_toSrv[rank] -> array of indexes that will be received from each "rank" of the connected servers  
     291  * storeIndex_toSrv[rank](index_of_buffer_received_from_server) -> local index of the field in the "workflow grid" 
     292  * that has been received from server */ 
     293         std::map<int, CArray<int, 1> > storeIndex_fromSrv_; // Support, for now, reading with level-1 server 
     294 
     295 
     296/** Maps storing the number of participating clients for data sent a specific server for a given contextClient, identified 
     297  * by the servers communicator size. In future must be direcly identified by context. 
     298  * nbSender_[context_server_size] -> map the number of client sender by connected rank of servers 
     299  * nbSender_[context_server_size] [rank_server] -> the number of client participating to a send message for a server of rank "rank_server"  
     300  * Usefull to indicate in a message the number of participant needed by the transfer protocol */ 
     301         std::map<int, std::map<int,int> > nbSenders_; 
     302 
     303 
     304/** Maps storing the number of participating servers for data sent a specific client for a given contextClient. 
     305  * Symetric of nbSenders_, but for server side which want to send data to client. 
     306  * nbReadSender_[context_client_size] -> map the number of server sender by connected rank of clients 
     307  * nbReadSender_[context_client_size] [rank_client] -> the number of serverq participating to a send message for a client of rank "rank_client"  
     308  * Usefull to indicate in a message the number of participant needed by the transfer protocol */ 
     309         std::map<CContextClient*, std::map<int,int> > nbReadSenders_; 
     310 
     311 
     312// Manh Ha's comment: " A client receives global index from other clients (via recvIndex) 
     313// then does mapping these index into local index of STORE_CLIENTINDEX 
     314// In this way, store_clientIndex can be used as an input of a source filter 
     315// Maybe we need a flag to determine whether a client wants to write. TODO " 
     316 
     317/** Map storing received data on server side. This map is the equivalent of storeIndex_client, but for data not received from model 
     318  * instead that for client. This map is used to concatenate data received from several clients into a single array on server side 
     319  * which match the local workflow grid. 
     320  * outLocalIndexStoreOnClient_[client_rank] -> Array of index from client of rank "client_rank" 
     321  * outLocalIndexStoreOnClient_[client_rank](index of buffer from client) -> local index of the workflow grid 
     322  * The map is created in CGrid::computeClientIndex and filled upon receiving data in CField::recvUpdateData(). 
     323  * Symetrically it is also used to send data from a server to sevral client for reading case. */ 
     324         map<int, CArray<size_t, 1> > outLocalIndexStoreOnClient_;  
     325 
     326 
     327/** Indexes calculated based on server-like distribution. 
     328 *  They are used for writing/reading data and only calculated for server level that does the writing/reading. 
     329 *  Along with localIndexToWriteOnClient, these indexes are used to correctly place incoming data. */ 
     330         CArray<size_t,1> localIndexToWriteOnServer; 
     331 
     332/** Indexes calculated based on client-like distribution. 
     333  * They are used for writing/reading data and only calculated for server level that does the writing/reading. 
     334  * Along with localIndexToWriteOnServer, these indexes are used to correctly place incoming data. */ 
     335         CArray<size_t,1> localIndexToWriteOnClient; 
     336 
     337         CArray<size_t,1> indexFromClients; 
     338 
     339 
    305340      private: 
    306341 
     
    308343        std::list<CContextClient*> clients; 
    309344        std::set<CContextClient*> clientsSet; 
     345 
     346/** Map storing received indexes. Key = sender rank, value = index array. */ 
     347         map<int, CArray<size_t, 1> > outGlobalIndexFromClient_; 
    310348 
    311349        bool isChecked; 
Note: See TracChangeset for help on using the changeset viewer.