Changeset 657 for XIOS/trunk/src/server_distribution_description.cpp
- Timestamp:
- 07/28/15 13:37:07 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/server_distribution_description.cpp
r653 r657 3 3 \author Ha NGUYEN 4 4 \since 04 Jan 2015 5 \date 09 Mars20155 \date 24 Jul 2015 6 6 7 7 \brief Description of index distribution on server(s). … … 9 9 10 10 #include "server_distribution_description.hpp" 11 #include "exception.hpp" 11 12 12 13 namespace xios … … 27 28 */ 28 29 void CServerDistributionDescription::computeServerDistribution(int nServer, 30 int positionDimensionDistributed, 29 31 bool doComputeGlobalIndex, 30 32 ServerDistributionType serType) … … 32 34 switch (serType) { 33 35 case BAND_DISTRIBUTION: 34 computeBandDistribution(nServer );36 computeBandDistribution(nServer, positionDimensionDistributed); 35 37 break; 36 38 default: … … 95 97 */ 96 98 void 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) 99 102 { 100 103 switch (distributionType) { 101 104 case BAND_DISTRIBUTION: 102 computeBandDistribution(nServer );105 computeBandDistribution(nServer, positionDimensionDistributed); 103 106 break; 104 107 default: … … 161 164 \param [in] nServer number of server 162 165 */ 163 void CServerDistributionDescription::computeBandDistribution(int nServer )166 void CServerDistributionDescription::computeBandDistribution(int nServer, int positionDimensionDistributed) 164 167 { 165 168 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 166 175 indexBegin_.resize(nServer); 167 176 dimensionSizes_.resize(nServer); … … 178 187 std::vector<int> njRangeEnd(nServer,0); 179 188 180 i f (1<dim) nGlobTemp = nGlobal_[1];181 else nGlobTemp = nGlobal_[0];189 int positionDistributed = (1<dim) ? positionDimensionDistributed : 0; 190 nGlobTemp = nGlobal_[positionDistributed]; 182 191 183 192 for (int i = 0; i < nServer; ++i) … … 194 203 for (int j = 0; j < dim; ++j) 195 204 { 196 if ( 1!= j)205 if (positionDistributed != j) 197 206 { 198 207 if (1 == dim)
Note: See TracChangeset
for help on using the changeset viewer.