Changeset 624 for XIOS/trunk/src/client_server_mapping_distributed.cpp
- Timestamp:
- 06/22/15 13:36:37 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/client_server_mapping_distributed.cpp
r623 r624 35 35 Compute mapping global index of server which client sends to. 36 36 \param [in] globalIndexOnClient global index client has 37 \param [in] localIndexOnClient local index on client38 37 */ 39 38 void CClientServerMappingDistributed::computeServerIndexMapping(const CArray<size_t,1>& globalIndexOnClient) … … 61 60 int indexClient = std::distance(itbClientHash, itClientHash)-1; 62 61 63 if (clientRank_ == indexClient)64 {65 (indexGlobalOnServer_[globalIndexToServerMapping_[globalIndexClient]]).push_back(globalIndexClient);66 ++nbIndexAlreadyOnClient;67 }68 else69 62 { 70 63 client2ClientIndexGlobal[indexClient].push_back(globalIndexClient); … … 88 81 89 82 int nbDemandingClient = recvBuff[clientRank_], nbIndexServerReceived = 0; 83 90 84 // Receiving demand as well as the responds from other clients 91 85 // The demand message contains global index; meanwhile the responds have server index information 92 86 // Buffer to receive demand from other clients, it can be allocated or not depending whether it has demand(s) 93 87 unsigned long* recvBuffIndexGlobal = 0; 94 int maxNbIndexDemandedFromOthers = (nbIndexAlreadyOnClient >= globalIndexToServerMapping_.size()) 95 ? 0 : (globalIndexToServerMapping_.size() - nbIndexAlreadyOnClient); 96 if (!isDataDistributed_) maxNbIndexDemandedFromOthers = nbDemandingClient * globalIndexToServerMapping_.size(); // Not very optimal but it's general 88 // int maxNbIndexDemandedFromOthers = (nbIndexAlreadyOnClient >= globalIndexToServerMapping_.size()) 89 // ? 0 : (globalIndexToServerMapping_.size() - nbIndexAlreadyOnClient); 90 int maxNbIndexDemandedFromOthers = (globalIndexToServerMapping_.size() > nbIndexSendToOthers) 91 ? globalIndexToServerMapping_.size() : nbIndexSendToOthers; 92 93 if (!isDataDistributed_) maxNbIndexDemandedFromOthers = nbDemandingClient * nbIndexSendToOthers; //globalIndexToServerMapping_.size(); // Not very optimal but it's general 97 94 98 95 if (0 != maxNbIndexDemandedFromOthers) … … 102 99 int* recvBuffIndexServer = 0; 103 100 int nbIndexReceivedFromOthers = nbIndexSendToOthers; 104 // int nbIndexReceivedFromOthers = globalIndexToServerMapping_.size() - nbIndexAlreadyOnClient;105 101 if (0 != nbIndexReceivedFromOthers) 106 102 recvBuffIndexServer = new int[nbIndexReceivedFromOthers]; … … 237 233 { 238 234 int indexClient = std::distance(itbClientHash, itClientHash)-1; 239 if (clientRank_ == indexClient)240 {241 globalIndexToServerMapping_.insert(std::make_pair<size_t,int>(it->first, it->second));242 }243 else244 235 { 245 236 sendBuff[indexClient] = 1;
Note: See TracChangeset
for help on using the changeset viewer.