Changeset 663 for XIOS/trunk


Ignore:
Timestamp:
08/24/15 14:53:13 (9 years ago)
Author:
mhnguyen
Message:

Correcting minor bugs on processing domain transformation

+) Correct domain index calculation in domain transformation
+) Offset index of weight file to make test_remap work correctly

Test
+) On Curie
+) Test_remap pass and result is correct

Location:
XIOS/trunk/src
Files:
4 edited

Legend:

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

    r660 r663  
    463463    idx += innerLoopSize; 
    464464  } 
    465  
    466465 
    467466  // Now allocate these arrays 
     
    617616                                        const int& dataDim, const int& ni, int& j) 
    618617{ 
    619 //  int tempI = dataIIndex + dataIBegin, 
    620 //      tempJ = (1 == dataDim) ? -1 
    621 //                             : (dataJIndex + dataJBegin); 
    622 //  int i = (dataDim == 1) ? (tempI - 1) % ni 
    623 //                     : (tempI - 1) ; 
    624 //  j = (dataDim == 1) ? (tempI - 1) / ni 
    625 //                     : (tempJ - 1) ; 
    626  
    627618  int tempI = dataIIndex + dataIBegin, 
    628619      tempJ = (dataJIndex + dataJBegin); 
  • XIOS/trunk/src/node/domain.cpp

    r660 r663  
    167167      } 
    168168      computeNGlobDomain(); 
     169 
     170      if (0 == global_zoom_ni) global_zoom_ni = ni_glo; 
     171      if (0 == global_zoom_nj) global_zoom_nj = nj_glo; 
    169172   } 
    170173 
     
    558561      // compute client zoom indices 
    559562      // compute client zoom indices 
    560       if (0 == global_zoom_ni) global_zoom_ni = ni_glo; 
    561       if (0 == global_zoom_nj) global_zoom_nj = nj_glo; 
     563//      if (0 == global_zoom_ni) global_zoom_ni = ni_glo; 
     564//      if (0 == global_zoom_nj) global_zoom_nj = nj_glo; 
    562565 
    563566      int global_zoom_iend=global_zoom_ibegin+global_zoom_ni-1 ; 
  • XIOS/trunk/src/transformation/domain_algorithm_interpolate_from_file.cpp

    r660 r663  
    241241  int clientRank = client->clientRank; 
    242242  int clientSize = client->clientSize; 
    243    
     243 
    244244  nc_open(filename.c_str(),NC_NOWRITE, &ncid) ; 
    245245  nc_inq_dimid(ncid,"n_weight",&weightDimId) ; 
     
    260260    start= mod * (div+1) + (clientRank-mod) * div ; 
    261261  } 
    262    
    263    
    264262 
    265263  double* weight=new double[nbWeight] ; 
     
    268266  nc_get_vara_double(ncid, weightId, &start, &nbWeight, weight) ; 
    269267 
    270   long* srcIndex=new long[nbWeight] ;  
     268  long* srcIndex=new long[nbWeight] ; 
    271269  int srcIndexId ; 
    272270  nc_inq_varid (ncid, "src_idx", &srcIndexId) ; 
    273271  nc_get_vara_long(ncid, srcIndexId, &start, &nbWeight, srcIndex) ; 
    274272 
    275   long* dstIndex=new long[nbWeight] ;  
     273  long* dstIndex=new long[nbWeight] ; 
    276274  int dstIndexId ; 
    277275  nc_inq_varid (ncid, "dst_idx", &dstIndexId) ; 
    278276  nc_get_vara_long(ncid, dstIndexId, &start, &nbWeight, dstIndex) ; 
    279          
     277 
    280278  for(size_t ind=0; ind<nbWeight;++ind) 
    281     interpMapValue[dstIndex[ind]].push_back(make_pair(srcIndex[ind],weight[ind])); 
    282 } 
    283  
    284 } 
     279    interpMapValue[dstIndex[ind]-1].push_back(make_pair(srcIndex[ind]-1,weight[ind])); 
     280} 
     281 
     282} 
  • XIOS/trunk/src/transformation/domain_algorithm_transformation.cpp

    r657 r663  
    7373    ++idx; 
    7474  } 
    75   int iIndex = domainDestGlobalIndex % domainDestGlobalDim[1]; 
     75  int iIndex = domainDestGlobalIndex % domainDestGlobalDim[0]; 
    7676  int jIndex = domainDestGlobalIndex / domainDestGlobalDim[0]; 
    7777 
     
    188188                                                       int& iIndex, int& jIndex) 
    189189{ 
    190    iIndex = index % njGlob; 
     190   iIndex = index % niGlob; 
    191191   jIndex = index / niGlob; 
    192192} 
Note: See TracChangeset for help on using the changeset viewer.