Changeset 594
- Timestamp:
- 05/26/15 16:13:45 (9 years ago)
- Location:
- XIOS/trunk/src/node
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/node/axis.cpp
r591 r594 17 17 : CObjectTemplate<CAxis>() 18 18 , CAxisAttributes(), isChecked(false), relFiles(), baseRefObject(), areClientAttributesChecked_(false) 19 , isDistributed_(false) 19 20 { /* Ne rien faire de plus */ } 20 21 … … 22 23 : CObjectTemplate<CAxis>(id) 23 24 , CAxisAttributes(), isChecked(false), relFiles(), baseRefObject(), areClientAttributesChecked_(false) 25 , isDistributed_(false) 24 26 { /* Ne rien faire de plus */ } 25 27 … … 37 39 { 38 40 return (this->relFiles.find(filename) != this->relFiles.end()); 41 } 42 43 bool CAxis::isDistributed(void) const 44 { 45 return isDistributed_; 39 46 } 40 47 … … 58 65 << "Attribute <size> of the axis [ id = '" << getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] must be specified"); 59 66 StdSize size = this->size.getValue(); 67 68 isDistributed_ = !this->ibegin.isEmpty() || !this->ni.isEmpty(); 60 69 61 70 if (!this->ibegin.isEmpty()) -
XIOS/trunk/src/node/axis.hpp
r591 r594 59 59 /// Test /// 60 60 bool IsWritten(const StdString & filename) const; 61 bool isDistributed(void) const; 61 62 62 63 /// Mutateur /// … … 96 97 bool areClientAttributesChecked_; 97 98 std::set<StdString> relFiles; 99 bool isDistributed_; 98 100 99 101 DECLARE_REF_FUNC(Axis,axis) -
XIOS/trunk/src/node/distribution_client.cpp
r584 r594 183 183 idx = 0; 184 184 185 isDataDistributed_ = false; 185 186 // Update all the vectors above 186 187 while (idx < numElement_) … … 217 218 dataNIndex_.at(idx) = domList[domIndex]->data_n_index.getValue(); 218 219 dataDims_.at(idx) = domList[domIndex]->data_dim.getValue(); 220 221 isDataDistributed_ |= domList[domIndex]->isDistributed(); 222 219 223 ++domIndex; 220 224 } … … 233 237 dataNIndex_.at(idx) = axisList[axisIndex]->data_index.numElements(); 234 238 dataDims_.at(idx) = 1; 239 240 isDataDistributed_ |= axisList[axisIndex]->isDistributed(); 241 235 242 ++axisIndex; 236 243 } … … 239 246 readDomainIndex(domList); 240 247 readAxisIndex(axisList); 241 242 // Grid has only one axis and it is not distributed243 bool isDataNotDistributed = true;244 for (int i = 0; i < this->dims_; ++i)245 isDataNotDistributed &= (nLocal_[i] == nGlob_[i]);246 isDataDistributed_ = !isDataNotDistributed;247 248 } 248 249 -
XIOS/trunk/src/node/domain.cpp
r591 r594 24 24 : CObjectTemplate<CDomain>(), CDomainAttributes() 25 25 , isChecked(false), relFiles(), isClientChecked(false), nbConnectedClients_(), indSrv_(), connectedServerRank_() 26 , isDistributed_(false) 26 27 { /* Ne rien faire de plus */ } 27 28 … … 29 30 : CObjectTemplate<CDomain>(id), CDomainAttributes() 30 31 , isChecked(false), relFiles(), isClientChecked(false), nbConnectedClients_(), indSrv_(), connectedServerRank_() 32 , isDistributed_(false) 31 33 { /* Ne rien faire de plus */ } 32 34 … … 63 65 { 64 66 return (this->relFiles.find(filename) != this->relFiles.end()); 67 } 68 69 //---------------------------------------------------------------- 70 71 bool CDomain::isDistributed(void) const 72 { 73 return isDistributed_; 65 74 } 66 75 … … 123 132 << " check the \'ni_glo\' et \'nj_glo\' values !") 124 133 } 125 checkLocalIDomain() ; 126 checkLocalJDomain() ; 127 128 if (i_index.isEmpty()) 129 { 130 i_index.resize(ni,nj) ; 131 for(int j=0;j<nj;j++) 132 for(int i=0;i<ni;i++) i_index(i,j)=i ; 133 } 134 135 if (j_index.isEmpty()) 136 { 137 j_index.resize(ni,nj) ; 138 for(int j=0;j<nj;j++) 139 for(int i=0;i<ni;i++) j_index(i,j)=j ; 140 } 141 134 135 isDistributed_ = !ibegin.isEmpty() || !iend.isEmpty() || !ni.isEmpty() || !jbegin.isEmpty() || !jend.isEmpty() || !nj.isEmpty(); 136 137 checkLocalIDomain(); 138 checkLocalJDomain(); 139 140 ibegin_client = ibegin; iend_client = iend; ni_client = ni; 141 jbegin_client = jbegin; jend_client = jend; nj_client = nj; 142 143 if (i_index.isEmpty()) 144 { 145 i_index.resize(ni,nj); 146 for (int j = 0; j < nj; j++) 147 for (int i = 0; i < ni; i++) i_index(i,j) = i; 148 } 149 150 if (j_index.isEmpty()) 151 { 152 j_index.resize(ni,nj); 153 for (int j = 0; j < nj; j++) 154 for (int i = 0; i < ni; i++) j_index(i,j) = j; 155 } 142 156 } 143 157 … … 147 161 { 148 162 if (!ni.isEmpty() && !ibegin.isEmpty() && iend.isEmpty()) 149 iend.setValue(ibegin.getValue() + ni.getValue() - 1) ; 150 151 else if (!ni.isEmpty() && !iend.isEmpty() && ibegin.isEmpty()) 152 ibegin.setValue( - ni.getValue() + iend.getValue() + 1) ; 153 163 iend.setValue(ibegin.getValue() + ni.getValue() - 1); 164 else if (!ni.isEmpty() && !iend.isEmpty() && ibegin.isEmpty()) 165 ibegin.setValue(iend.getValue() - ni.getValue() + 1); 154 166 else if (!ibegin.isEmpty() && !iend.isEmpty() && ni.isEmpty()) 155 ni.setValue(iend.getValue() - ibegin.getValue() + 1) ; 156 157 else if (!ibegin.isEmpty() && !iend.isEmpty() && !ni.isEmpty() ) 158 { 159 if (iend.getValue() != ibegin.getValue() + ni.getValue() - 1) 160 ERROR("CDomain::checkAttributes(void)", 161 << "The domain si wrong defined," 162 << " iend is different of (ibegin + ni - 1) !") ; 167 ni.setValue(iend.getValue() - ibegin.getValue() + 1); 168 else if (!ibegin.isEmpty() && !iend.isEmpty() && !ni.isEmpty()) 169 { 170 if (iend.getValue() != ibegin.getValue() + ni.getValue() - 1) 171 ERROR("CDomain::checkLocalIDomain(void)", 172 << "[ Id = " << this->getId() << " ] " 173 << "The local domain is wrongly defined," 174 << " iend is different from (ibegin + ni - 1)"); 175 } 176 else if (ibegin.isEmpty() && iend.isEmpty() && ni.isEmpty()) 177 { 178 ibegin = 0; 179 iend = ni_glo - 1; 180 ni = ni_glo; 163 181 } 164 182 else 165 183 { 166 ERROR("CDomain::checkAttributes(void)",167 << "The domain is wrong defined,"168 << " 2 value from \'iend\', \'ibegin\', \'ni\' must be defined !") ;169 }170 184 ERROR("CDomain::checkLocalIDomain(void)", 185 << "[ Id = " << this->getId() << " ] " 186 << "The local domain is wrongly defined," 187 << " defining just one attribute among 'ibegin', 'iend' or 'ni' is invalid"); 188 } 171 189 172 190 if (ni.getValue() < 0 || ibegin.getValue() > iend.getValue() || 173 ibegin.getValue() < 0 || iend.getValue() > (ni_glo.getValue()-1)) 174 { 175 176 ERROR("CDomain::checkAttributes(void)", 177 << "[ Id = " << this->getId() << " ] " 178 << "Local domain is wrong defined," 179 << " Check the value : ni, ni_glo, ibegin, iend") ; 180 } 191 ibegin.getValue() < 0 || iend.getValue() > (ni_glo.getValue() - 1)) 192 { 193 ERROR("CDomain::checkLocalIDomain(void)", 194 << "[ Id = " << this->getId() << " ] " 195 << "The local domain is wrongly defined," 196 << " check the attributes 'ni_glo', 'ni', 'ibegin' and 'iend'"); 197 } 181 198 } 182 199 … … 186 203 { 187 204 if (!nj.isEmpty() && !jbegin.isEmpty() && jend.isEmpty()) 188 jend.setValue(jbegin.getValue() + nj.getValue() - 1) ; 189 205 jend.setValue(jbegin.getValue() + nj.getValue() - 1); 190 206 else if (!nj.isEmpty() && !jend.isEmpty() && jbegin.isEmpty()) 191 jbegin.setValue( - nj.getValue() + jend.getValue() + 1) ; 192 207 jbegin.setValue(jend.getValue() - nj.getValue() + 1); 193 208 else if (!jbegin.isEmpty() && !jend.isEmpty() && nj.isEmpty()) 194 nj.setValue(jend.getValue() - jbegin.getValue() + 1) ; 195 196 else if (!jbegin.isEmpty() && !jend.isEmpty() && !nj.isEmpty() ) 197 { 198 if (jend.getValue() != jbegin.getValue() + nj.getValue() - 1) 199 ERROR("CDomain::checkAttributes(void)", 200 << "The domain is wrong defined," 201 << " iend is different of (jbegin + nj - 1) !") ; 209 nj.setValue(jend.getValue() - jbegin.getValue() + 1); 210 else if (!jbegin.isEmpty() && !jend.isEmpty() && !nj.isEmpty()) 211 { 212 if (jend.getValue() != jbegin.getValue() + nj.getValue() - 1) 213 ERROR("CDomain::checkLocalJDomain(void)", 214 << "[ Id = " << this->getId() << " ] " 215 << "The local domain is wrongly defined," 216 << " jend is different from (jbegin + nj - 1)"); 217 } 218 else if (jbegin.isEmpty() && jend.isEmpty() && nj.isEmpty()) 219 { 220 jbegin = 0; 221 jend = nj_glo - 1; 222 nj = nj_glo; 202 223 } 203 224 else 204 225 { 205 ERROR("CDomain::checkAttributes(void)", 206 << "The domain is wrong defined," 207 << " 2 values from jend, jbegin, nj must be defined !") ; 226 ERROR("CDomain::checkLocalJDomain(void)", 227 << "[ Id = " << this->getId() << " ] " 228 << "The local domain is wrongly defined," 229 << " defining just one attribute among 'jbegin', 'jend' or 'nj' is invalid"); 208 230 } 209 231 210 232 if (nj.getValue() < 0 || jbegin.getValue() > jend.getValue() || 211 jbegin.getValue() < 0 || jend.getValue() > (nj_glo.getValue() -1))212 ERROR("CDomain::checkAttributes(void)",213 << "Domain is wrong defined,"214 << " Check the values : nj, nj_glo, jbegin, jend") ;215 216 ibegin_client=ibegin ; iend_client=iend ; ni_client=ni;217 jbegin_client=jbegin ; jend_client=jend ; nj_client=nj ;233 jbegin.getValue() < 0 || jend.getValue() > (nj_glo.getValue() - 1)) 234 { 235 ERROR("CDomain::checkLocalJDomain(void)", 236 << "[ Id = " << this->getId() << " ] " 237 << "The local domain is wrongly defined," 238 << " check the attributes 'nj_glo', 'nj', 'jbegin' and 'jend'"); 239 } 218 240 } 219 241 … … 497 519 if (zoom_ibegin < 0 || zoom_jbegin < 0 || zoom_iend > (ni_glo-1) || zoom_jend > (nj_glo-1)) 498 520 ERROR("CDomain::checkZoom(void)", 499 << "Zoom is wrong defined,"521 << "Zoom is wrongly defined," 500 522 << " Check the values : zoom_ni, zoom_nj, zoom_ibegin, zoom_jbegin") ; 501 523 } -
XIOS/trunk/src/node/domain.hpp
r591 r594 89 89 bool hasZoom(void) const; 90 90 bool isEmpty(void) const; 91 bool isDistributed(void) const; 91 92 92 93 … … 157 158 std::map<int, vector<size_t> > indSrv_; // Global index of each client sent to server 158 159 std::vector<int> connectedServerRank_; 160 bool isDistributed_; 159 161 160 162 DECLARE_REF_FUNC(Domain,domain)
Note: See TracChangeset
for help on using the changeset viewer.