Ignore:
Timestamp:
06/22/15 13:36:37 (9 years ago)
Author:
mhnguyen
Message:

Final tests of zoom and inverse on axis

+) Modify test_client and test_complete to work with new grid definition
+) Correct some bugs causing memory leak
+) Clean abundant code
+) Add more comments to new files

Test
+) On Curie
+) test_client and test_complete pass with correct results

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/client_server_mapping_distributed.cpp

    r623 r624  
    3535   Compute mapping global index of server which client sends to. 
    3636   \param [in] globalIndexOnClient global index client has 
    37    \param [in] localIndexOnClient local index on client 
    3837*/ 
    3938void CClientServerMappingDistributed::computeServerIndexMapping(const CArray<size_t,1>& globalIndexOnClient) 
     
    6160      int indexClient = std::distance(itbClientHash, itClientHash)-1; 
    6261 
    63       if (clientRank_ == indexClient) 
    64       { 
    65         (indexGlobalOnServer_[globalIndexToServerMapping_[globalIndexClient]]).push_back(globalIndexClient); 
    66         ++nbIndexAlreadyOnClient; 
    67       } 
    68       else 
    6962      { 
    7063        client2ClientIndexGlobal[indexClient].push_back(globalIndexClient); 
     
    8881 
    8982  int nbDemandingClient = recvBuff[clientRank_], nbIndexServerReceived = 0; 
     83 
    9084  // Receiving demand as well as the responds from other clients 
    9185  // The demand message contains global index; meanwhile the responds have server index information 
    9286  // Buffer to receive demand from other clients, it can be allocated or not depending whether it has demand(s) 
    9387  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 
    9794 
    9895  if (0 != maxNbIndexDemandedFromOthers) 
     
    10299  int* recvBuffIndexServer = 0; 
    103100  int nbIndexReceivedFromOthers = nbIndexSendToOthers; 
    104 //  int nbIndexReceivedFromOthers = globalIndexToServerMapping_.size() - nbIndexAlreadyOnClient; 
    105101  if (0 != nbIndexReceivedFromOthers) 
    106102    recvBuffIndexServer = new int[nbIndexReceivedFromOthers]; 
     
    237233    { 
    238234      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       else 
    244235      { 
    245236        sendBuff[indexClient] = 1; 
Note: See TracChangeset for help on using the changeset viewer.