Ignore:
Timestamp:
03/10/15 10:49:13 (9 years ago)
Author:
mhnguyen
Message:

Correct some bugs on discovering server index and do some code cleanings

+) Add some checking functions to make sure mpi_isend and mpi_irecv work correctly
+) Add comments to code
+) Remove some redundant code and comments

Test
+) On Curie
+) The new functions are tested in test_new_features.f90. Test_client and test_complete work like before
+) Test cases:

  • 3 dimension grid with: 1 domain, 1 axis
  • 3 dimension grid with: 3 axis
  • Attached and connected

+) All pass and results are correct

TODO:
+) Fix zoom bug with grid composed of only one axis

File:
1 edited

Legend:

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

    r568 r569  
    33   \author Ha NGUYEN 
    44   \since 04 Jan 2015 
    5    \date 09 Feb 2015 
     5   \date 09 Mars 2015 
    66 
    77   \brief Description of index distribution on server(s). 
     
    1515  : nGlobal_(globalDimensionSize), indexBegin_(), dimensionSizes_(), globalIndex_(), vecGlobalIndex_() 
    1616{ 
    17  
    1817} 
    1918 
    2019CServerDistributionDescription::~CServerDistributionDescription() 
    2120{ 
    22 //  if (0 != globalIndex_) delete globalIndex_; 
    2321  if (!vecGlobalIndex_.empty()) 
    2422    for (int i = 0; i < vecGlobalIndex_.size(); ++i) delete vecGlobalIndex_[i]; 
     
    9290} 
    9391 
     92/*! 
     93  Compute global index assigned to a server with a range.E.g: if a grid has 100 points and 
     94  there are 2 servers, the first one takes index from 0 to 49, the second has index from 50 to 99 
     95  \param [in] nServer number of server 
     96  \param [in] indexBeginEnd begining and ending index of range 
     97  \param [in] serType type of server distribution. For now, we can distribute server by band or plan 
     98*/ 
    9499void CServerDistributionDescription::computeServerGlobalIndexInRange(int nServer, 
    95100                                        const std::pair<size_t, size_t>& indexBeginEnd, 
     
    117122    size_t ssize = 1, idx = 0; 
    118123    for (int j = 0; j < dim; ++j) ssize *= dimensionSizes_[idxServer][j]; 
    119     vecGlobalIndex_[idxServer] = new CArray<size_t,1>(ssize); 
    120124 
    121125    std::vector<int> idxLoop(dim,0); 
    122  
    123126    int innerLoopSize = dimensionSizes_[idxServer][0]; 
    124127 
     
    243246} 
    244247 
     248/*! 
     249  Get global index calculated by computeServerGlobalIndexInRange 
     250*/ 
    245251const boost::unordered_map<size_t,int>& CServerDistributionDescription::getGlobalIndexRange() const 
    246252{ 
Note: See TracChangeset for help on using the changeset viewer.