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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.