Ignore:
Timestamp:
07/28/15 13:37:07 (9 years ago)
Author:
mhnguyen
Message:

Making changes in domain to make sure unstructed grid work with new method of index distribution

+) Change the way define i_index and j_index of a domain
+) Remove some redundant attributes of domain
+) Adjust the way to calculate index distribution on server side

Test
+) Make some minor change to test_unstruct_complete to work with new XIOS
+) On Curie
+) All test pass and correct

File:
1 edited

Legend:

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

    r653 r657  
    33   \author Ha NGUYEN 
    44   \since 04 Jan 2015 
    5    \date 09 Mars 2015 
     5   \date 24 Jul 2015 
    66 
    77   \brief Description of index distribution on server(s). 
     
    99 
    1010#include "server_distribution_description.hpp" 
     11#include "exception.hpp" 
    1112 
    1213namespace xios 
     
    2728*/ 
    2829void CServerDistributionDescription::computeServerDistribution(int nServer, 
     30                                                               int positionDimensionDistributed, 
    2931                                                               bool doComputeGlobalIndex, 
    3032                                                               ServerDistributionType serType) 
     
    3234  switch (serType) { 
    3335    case BAND_DISTRIBUTION: 
    34       computeBandDistribution(nServer); 
     36      computeBandDistribution(nServer, positionDimensionDistributed); 
    3537      break; 
    3638    default: 
     
    9597*/ 
    9698void CServerDistributionDescription::computeServerGlobalIndexInRange(int nServer, 
    97                                         const std::pair<size_t, size_t>& indexBeginEnd, 
    98                                         ServerDistributionType distributionType) 
     99                                                                     const std::pair<size_t, size_t>& indexBeginEnd, 
     100                                                                     int positionDimensionDistributed, 
     101                                                                     ServerDistributionType distributionType) 
    99102{ 
    100103  switch (distributionType) { 
    101104    case BAND_DISTRIBUTION: 
    102       computeBandDistribution(nServer); 
     105      computeBandDistribution(nServer, positionDimensionDistributed); 
    103106      break; 
    104107    default: 
     
    161164  \param [in] nServer number of server 
    162165*/ 
    163 void CServerDistributionDescription::computeBandDistribution(int nServer) 
     166void CServerDistributionDescription::computeBandDistribution(int nServer, int positionDimensionDistributed) 
    164167{ 
    165168  int dim = nGlobal_.size(); 
     169  if (positionDimensionDistributed > dim) 
     170    ERROR("CServerDistributionDescription::computeBandDistribution(int nServer, int positionDimensionDistributed)", 
     171          << "Position of distributed dimension is invalid" << std::endl 
     172          << "Position of distributed dimension is " << positionDimensionDistributed 
     173          << "Dimension " << dim) 
     174 
    166175  indexBegin_.resize(nServer); 
    167176  dimensionSizes_.resize(nServer); 
     
    178187  std::vector<int> njRangeEnd(nServer,0); 
    179188 
    180   if (1<dim) nGlobTemp = nGlobal_[1]; 
    181   else nGlobTemp = nGlobal_[0]; 
     189  int positionDistributed = (1<dim) ? positionDimensionDistributed : 0; 
     190  nGlobTemp = nGlobal_[positionDistributed]; 
    182191 
    183192  for (int i = 0; i < nServer; ++i) 
     
    194203    for (int j = 0; j < dim; ++j) 
    195204    { 
    196       if (1 != j) 
     205      if (positionDistributed != j) 
    197206      { 
    198207        if (1 == dim) 
Note: See TracChangeset for help on using the changeset viewer.