Ignore:
Timestamp:
07/28/16 10:56:52 (8 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/domain.cpp

    r899 r906  
    532532       if (bounds_lon_end.isEmpty()) bounds_lon_end=180.-1e-8 ; 
    533533     } 
    534       
     534 
    535535     for(j=0;j<nj;++j) 
    536536       for(i=0;i<ni;++i) 
     
    921921     size_t zoom_jend=global_zoom_jbegin+global_zoom_nj-1 ; 
    922922 
    923       
     923 
    924924     size_t dn=data_i_index.numElements() ; 
    925925     int i,j ; 
    926926     size_t k,ind ; 
    927       
     927 
    928928     for(k=0;k<dn;k++) 
    929929     { 
     
    936936       { 
    937937          i=(data_i_index(k)+data_ibegin)%ni ; 
    938           j=(data_i_index(k)+data_ibegin)/ni ;           
     938          j=(data_i_index(k)+data_ibegin)/ni ; 
    939939       } 
    940940 
     
    947947     } 
    948948   } 
    949         
    950           
    951       
    952  
    953       
    954  
    955     
     949 
     950 
     951 
     952 
     953 
     954 
     955 
    956956   void CDomain::checkEligibilityForCompressedOutput(void) 
    957957   { 
     
    13581358    CContextClient* client=context->client ; 
    13591359    int nbServer=client->serverSize; 
     1360    int rank = client->clientRank; 
    13601361    bool doComputeGlobalIndexServer = true; 
    13611362 
     
    14451446    for (int i = 0; i < nGlobDomain_.size(); ++i) globalSizeIndex *= nGlobDomain_[i]; 
    14461447    indexBegin = 0; 
    1447     for (int i = 0; i < clientSize; ++i) 
    1448     { 
    1449       range = globalSizeIndex / clientSize; 
    1450       if (i < (globalSizeIndex%clientSize)) ++range; 
    1451       if (i == client->clientRank) break; 
    1452       indexBegin += range; 
    1453     } 
    1454     indexEnd = indexBegin + range - 1; 
     1448    if (globalSizeIndex <= clientSize) 
     1449    { 
     1450      indexBegin = rank%globalSizeIndex; 
     1451      indexEnd = indexBegin; 
     1452    } 
     1453    else 
     1454    { 
     1455      for (int i = 0; i < clientSize; ++i) 
     1456      { 
     1457        range = globalSizeIndex / clientSize; 
     1458        if (i < (globalSizeIndex%clientSize)) ++range; 
     1459        if (i == client->clientRank) break; 
     1460        indexBegin += range; 
     1461      } 
     1462      indexEnd = indexBegin + range - 1; 
     1463    } 
    14551464 
    14561465    CServerDistributionDescription serverDescription(nGlobDomain_, nbServer); 
Note: See TracChangeset for help on using the changeset viewer.