Ignore:
Timestamp:
04/01/15 17:52:58 (9 years ago)
Author:
mhnguyen
Message:

Modifying some functions to make sure zoom working even with grid not distributed

+) Change some code in sendIndex to make sure non-distributed grid work with zoom

Test
+) On Curie
+) test_client: passed and results are same like on the branchs
+) test_complete: there is a difference of output because of zoom index offset

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/node/grid.cpp

    r584 r585  
    336336     // Finally, compute index mapping between client(s) and server(s) 
    337337     clientServerMap_ = new CClientServerMappingDistributed(serverDistributionDescription_->getGlobalIndexRange(), 
    338                                                             client->intraComm); 
     338                                                            client->intraComm, 
     339                                                            clientDistribution_->isDataDistributed()); 
    339340 
    340341     clientServerMap_->computeServerIndexMapping(clientDistribution_->getGlobalIndex()); 
     
    501502    if (!doGridHaveDataDistributed()) 
    502503    { 
    503 //      if (0 == client->clientRank) 
    504 //      { 
    505 //       for (int ns = 0; itGlobal != iteMap; ++itGlobal, ++itLocal, ++ns) 
    506 //        { 
    507 //          rank = itGlobal->first; 
    508 //          int nb = (itGlobal->second).size(); 
    509 // 
    510 //          CArray<size_t, 1> outGlobalIndexOnServer(nb); 
    511 //          CArray<int, 1> outLocalIndexToServer(nb); 
    512 //          for (int k = 0; k < nb; ++k) 
    513 //          { 
    514 //            outGlobalIndexOnServer(k) = itGlobal->second.at(k); 
    515 //            outLocalIndexToServer(k)  = itLocal->second.at(k); 
    516 //          } 
    517 // 
    518 //          storeIndex_toSrv.insert( pair<int,CArray<int,1>* >(rank,new CArray<int,1>(outLocalIndexToServer) )); 
    519 //          listOutIndex.push_back(new CArray<size_t,1>(outGlobalIndexOnServer)); 
    520 // 
    521 //          list_msg.push_back(shared_ptr<CMessage>(new CMessage)); 
    522 //          *list_msg.back()<<getId()<<*listOutIndex.back(); 
    523 //          event.push(rank, 1, *list_msg.back()); 
    524 //        } 
    525 //        client->sendEvent(event); 
    526 //      } else client->sendEvent(event); 
     504      if (0 == client->clientRank) 
     505      { 
     506        for (rank = 0; rank < client->serverSize; ++rank) 
     507        { 
     508          int nb = 0; 
     509          if (globalIndexTmp.end() != globalIndexTmp.find(rank)) 
     510            nb = globalIndexTmp[rank].size(); 
     511 
     512          CArray<size_t, 1> outGlobalIndexOnServer(nb); 
     513          CArray<int, 1> outLocalIndexToServer(nb); 
     514          for (int k = 0; k < nb; ++k) 
     515          { 
     516            outGlobalIndexOnServer(k) = globalIndexTmp[rank].at(k); 
     517            outLocalIndexToServer(k)  = localIndexTmp[rank].at(k); 
     518          } 
     519 
     520          storeIndex_toSrv.insert( pair<int,CArray<int,1>* >(rank,new CArray<int,1>(outLocalIndexToServer) )); 
     521          listOutIndex.push_back(new CArray<size_t,1>(outGlobalIndexOnServer)); 
     522 
     523          list_msg.push_back(shared_ptr<CMessage>(new CMessage)); 
     524          *list_msg.back()<<getId()<<*listOutIndex.back(); 
     525 
     526          event.push(rank, 1, *list_msg.back()); 
     527        } 
     528        client->sendEvent(event); 
     529      } 
     530      else 
     531        client->sendEvent(event); 
    527532    } 
    528533    else 
Note: See TracChangeset for help on using the changeset viewer.