Ignore:
Timestamp:
01/26/16 18:18:58 (8 years ago)
Author:
mhnguyen
Message:

Fixing the bug in ticket 72

+) The distributed axis on client side send info to correct corresponding server
+) Improve serverdistributiondescription class to make it more flexible
+) Create new test_basic_2D only for test cases of 2-d grid

Test
+) On Curie
+) All tests pass

File:
1 edited

Legend:

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

    r813 r815  
    465465          lon_g.resize(ni_glo) ; 
    466466          lat_g.resize(nj_glo) ; 
    467            
    468            
     467 
     468 
    469469          int* ibegin_g = new int[client->clientSize] ; 
    470470          int* jbegin_g = new int[client->clientSize] ; 
     
    480480          v=nj ; 
    481481          MPI_Allgather(&v,1,MPI_INT,nj_g,1,MPI_INT,client->intraComm) ; 
    482            
     482 
    483483          MPI_Allgatherv(lon.dataFirst(),ni,MPI_DOUBLE,lon_g.dataFirst(),ni_g, ibegin_g,MPI_DOUBLE,client->intraComm) ; 
    484484          MPI_Allgatherv(lat.dataFirst(),nj,MPI_DOUBLE,lat_g.dataFirst(),nj_g, jbegin_g,MPI_DOUBLE,client->intraComm) ; 
    485     
     485 
    486486      delete[] ibegin_g ; 
    487487      delete[] jbegin_g ; 
     
    494494   { 
    495495     int i,j,k; 
    496       
     496 
    497497     const int nvertexValue = 4; 
    498498     boundsLon.resize(nvertexValue,ni*nj); 
     
    510510       bounds_lon_end= (lon(0) +360 + lon(ni_glo-1))/2 ; 
    511511     } 
    512         
     512 
    513513     for(j=0;j<nj;++j) 
    514514       for(i=0;i<ni;++i) 
     
    520520                                                                        : (lon(ibegin + i + 1)+lon(ibegin + i))/2; 
    521521       } 
    522      
     522 
    523523 
    524524    boundsLat.resize(nvertexValue,nj*ni); 
     
    546546      } 
    547547    } 
    548      
     548 
    549549    double latStepEnd = lat(nj_glo-1)-lat(nj_glo-2); 
    550550    if (isSouthPole) bounds_lat_end=lat(nj_glo-1); 
     
    563563        if ( -90 + bounds_lat_end <= 0.1*std::abs(latStepEnd)) bounds_lat_end=-90 ; 
    564564      } 
    565     }       
    566        
     565    } 
     566 
    567567    for(j=0;j<nj;++j) 
    568568      for(i=0;i<ni;++i) 
     
    12221222  void CDomain::sendServerAttribut(void) 
    12231223  { 
    1224     CServerDistributionDescription serverDescription(nGlobDomain_); 
    1225  
    12261224    CContext* context = CContext::getCurrent(); 
    12271225    CContextClient* client = context->client; 
    12281226    int nbServer = client->serverSize; 
    12291227 
    1230     if (isUnstructed_) serverDescription.computeServerDistribution(nbServer,0); 
    1231     else serverDescription.computeServerDistribution(nbServer,1); 
     1228    CServerDistributionDescription serverDescription(nGlobDomain_, nbServer); 
     1229    if (isUnstructed_) serverDescription.computeServerDistribution(false, 0); 
     1230    else serverDescription.computeServerDistribution(false, 1); 
    12321231 
    12331232    std::vector<std::vector<int> > serverIndexBegin = serverDescription.getServerIndexBegin(); 
     
    13721371    indexEnd = indexBegin + range - 1; 
    13731372 
    1374     CServerDistributionDescription serverDescription(nGlobDomain_); 
    1375     if (isUnstructed_) serverDescription.computeServerGlobalIndexInRange(nbServer, std::make_pair<size_t,size_t>(indexBegin, indexEnd), 0); 
    1376     else serverDescription.computeServerGlobalIndexInRange(nbServer, std::make_pair<size_t,size_t>(indexBegin, indexEnd), 1); 
     1373    CServerDistributionDescription serverDescription(nGlobDomain_, nbServer); 
     1374    if (isUnstructed_) serverDescription.computeServerGlobalIndexInRange(std::make_pair<size_t,size_t>(indexBegin, indexEnd), 0); 
     1375    else serverDescription.computeServerGlobalIndexInRange(std::make_pair<size_t,size_t>(indexBegin, indexEnd), 1); 
    13771376 
    13781377    CClientServerMapping* clientServerMap = new CClientServerMappingDistributed(serverDescription.getGlobalIndexRange(), 
Note: See TracChangeset for help on using the changeset viewer.