Ignore:
Timestamp:
07/28/16 10:56:52 (5 years ago)
Author:
mhnguyen
Message:

Fixing bug: Ticket 98

+) Correct the way to distribute index of domain (axis) in case there are more
clients than number of index

Test
+) On Curie
+) Small grid (2x2x1) and 6 clients - 1 server: Pass

File:
1 edited

Legend:

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

    r895 r906  
    400400    int nbServer = client->serverSize; 
    401401    int range, clientSize = client->clientSize; 
     402    int rank = client->clientRank; 
    402403 
    403404    size_t ni = this->n.getValue(); 
     
    453454      for (int i = 0; i < nGlobAxis.size(); ++i) globalSizeIndex *= nGlobAxis[i]; 
    454455      indexBegin = 0; 
    455       for (int i = 0; i < clientSize; ++i) 
    456       { 
    457         range = globalSizeIndex / clientSize; 
    458         if (i < (globalSizeIndex%clientSize)) ++range; 
    459         if (i == client->clientRank) break; 
    460         indexBegin += range; 
    461       } 
    462       indexEnd = indexBegin + range - 1; 
     456      if (globalSizeIndex <= clientSize) 
     457      { 
     458        indexBegin = rank%globalSizeIndex; 
     459        indexEnd = indexBegin; 
     460      } 
     461      else 
     462      { 
     463        for (int i = 0; i < clientSize; ++i) 
     464        { 
     465          range = globalSizeIndex / clientSize; 
     466          if (i < (globalSizeIndex%clientSize)) ++range; 
     467          if (i == client->clientRank) break; 
     468          indexBegin += range; 
     469        } 
     470        indexEnd = indexBegin + range - 1; 
     471      } 
    463472 
    464473      CServerDistributionDescription serverDescription(nGlobAxis, nbServer); 
Note: See TracChangeset for help on using the changeset viewer.