Changeset 818
- Timestamp:
- 01/26/16 18:19:14 (7 years ago)
- Location:
- XIOS/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/inputs/REMAP/iodef.xml
r786 r818 10 10 <field id="dst_field" operation="instant" field_ref="src_field" domain_ref="dst_domain"/> 11 11 <field id="tmp_field" operation="instant" domain_ref="src_domain_regular_tmp"/> 12 <field id="tmp_field_1" operation="instant" grid_ref="src_grid_curvilinear" />13 <field id="tmp_field_2" operation="instant" domain_ref="domain_src_unstructured" />12 <!-- <field id="tmp_field_1" operation="instant" grid_ref="src_grid_curvilinear" />--> 13 <!-- <field id="tmp_field_2" operation="instant" domain_ref="domain_src_unstructured" />--> 14 14 <field id="dst_field_regular" operation="instant" field_ref="tmp_field" domain_ref="dst_domain_regular" read_access="true"/> 15 <field id="dst_field_regular_pole" operation="instant" field_ref="src_field" domain_ref="dst_domain_regular_pole"/>15 <!-- <field id="dst_field_regular_pole" operation="instant" field_ref="src_field" domain_ref="dst_domain_regular_pole"/>--> 16 16 </field_definition> 17 17 … … 19 19 <file_definition type="one_file" par_access="collective" output_freq="1ts" output_level="10" enabled=".TRUE."> 20 20 <file id="output" name="output"> 21 <!-- <field field_ref="src_field" name="field" />-->21 <field field_ref="src_field" name="field" /> 22 22 </file> 23 23 <file id="output_dst" name="output_dst" type="one_file"> 24 <!-- <field field_ref="dst_field" name="field" />-->24 <field field_ref="dst_field" name="field" /> 25 25 </file> 26 26 <file id="out_dst_regular_pole" name="out_dst_regular_pole" type="one_file"> 27 <field field_ref="dst_field_regular_pole" name="field" />27 <!-- <field field_ref="dst_field_regular_pole" name="field" />--> 28 28 </file> 29 29 <file id="output_dst_regular" name="output_dst_regular" type="one_file"> 30 <!-- <field field_ref="dst_field_regular" name="field" />-->30 <field field_ref="dst_field_regular" name="field" /> 31 31 </file> 32 32 <file id="output_dst_curvilinear" name="output_dst_curvilinear" type="one_file"> … … 34 34 </file> 35 35 <file id="output_dst_unstructured" name="output_dst_unstructured" type="one_file"> 36 <field field_ref="tmp_field_2" operation="instant"/>36 <!-- <field field_ref="tmp_field_2" operation="instant"/>--> 37 37 </file> 38 38 … … 45 45 46 46 <file id="output_src_curvilinear" name="output_src_curvilinear" mode="read" type="one_file"> 47 <field id="src_field_curvilinear" name="field_A" grid_ref="src_grid_curvilinear" operation="instant"/>47 <!-- <field id="src_field_curvilinear" name="field_A" grid_ref="src_grid_curvilinear" operation="instant"/>--> 48 48 </file> 49 49 <file id="output_unstructured" name="output_unstructured" mode="read" type="one_file"> 50 <field id="field_src_unstructred" name="field" domain_ref="domain_src_unstructured" operation="instant"/>50 <!-- <field id="field_src_unstructred" name="field" domain_ref="domain_src_unstructured" operation="instant"/>--> 51 51 </file> 52 52 </file_definition> … … 62 62 <domain_definition> 63 63 <domain id="src_domain" /> 64 <domain id="dst_domain" domain_src="src_domain">64 <domain id="dst_domain"> 65 65 <interpolate_domain/> 66 66 </domain> 67 <domain id="dst_domain_regular_pole" domain_src="src_domain"ni_glo="180" nj_glo="90" type="rectilinear">67 <domain id="dst_domain_regular_pole" ni_glo="180" nj_glo="90" type="rectilinear"> 68 68 <generate_rectilinear_domain id="domain_regular_pole"/> 69 69 <interpolate_domain/> 70 70 </domain> 71 <domain id="dst_domain_regular" domain_src="src_domain_regular_tmp"ni_glo="90" nj_glo="45" type="rectilinear">71 <domain id="dst_domain_regular" ni_glo="90" nj_glo="45" type="rectilinear"> 72 72 <generate_rectilinear_domain /> 73 73 <interpolate_domain/> -
XIOS/trunk/inputs/Unstruct/iodef.xml
r718 r818 9 9 </field_definition> 10 10 11 <file_definition type=" multiple_file" par_access="collective" output_freq="6h" output_level="10" enabled=".TRUE.">11 <file_definition type="one_file" par_access="collective" output_freq="6h" output_level="10" enabled=".TRUE."> 12 12 <file id="output" name="output"> 13 13 <field field_ref="field_A_srf" name="field_A_srf" /> -
XIOS/trunk/src/distribution_client.cpp
r817 r818 19 19 , isDataDistributed_(true), axisNum_(0), domainNum_(0), nIndexDomain_(), nIndexAxis_() 20 20 , globalDataSendToServer_(), localDataIndexSendToServer_(), localDataIndex_(), localMaskIndex_() 21 , infoIndex_() 21 22 { 22 23 } … … 30 31 , isDataDistributed_(true), axisNum_(0), domainNum_(0), nIndexDomain_(), nIndexAxis_() 31 32 , globalDataSendToServer_(), localDataIndexSendToServer_(), localDataIndex_(), localMaskIndex_() 33 , infoIndex_() 32 34 { 33 35 readDistributionInfo(grid); … … 176 178 // Data_*_index of each dimension 177 179 dataIndex_.resize(this->dims_); 180 infoIndex_.resize(this->dims_); 178 181 179 182 // A trick to determine position of each domain in domainList … … 201 204 dataIndex_.at(indexMap_[idx]+1).resize(domList[domIndex]->data_j_index.numElements()); 202 205 dataIndex_.at(indexMap_[idx]+1) = domList[domIndex]->data_j_index; 206 infoIndex_.at(indexMap_[idx]+1).resize(domList[domIndex]->j_index.numElements()); 207 infoIndex_.at(indexMap_[idx]+1) = domList[domIndex]->j_index; 203 208 204 209 // On the i axis … … 213 218 dataIndex_.at(indexMap_[idx]).resize(domList[domIndex]->data_i_index.numElements()); 214 219 dataIndex_.at(indexMap_[idx]) = domList[domIndex]->data_i_index; 220 infoIndex_.at(indexMap_[idx]).resize(domList[domIndex]->i_index.numElements()); 221 infoIndex_.at(indexMap_[idx]) = domList[domIndex]->i_index; 215 222 216 223 dataNIndex_.at(idx) = domList[domIndex]->data_i_index.numElements(); … … 233 240 dataIndex_.at(indexMap_[idx]).resize(axisList[axisIndex]->data_index.numElements()); 234 241 dataIndex_.at(indexMap_[idx]) = axisList[axisIndex]->data_index; 242 infoIndex_.at(indexMap_[idx]).resize(axisList[axisIndex]->index.numElements()); 243 infoIndex_.at(indexMap_[idx]) = axisList[axisIndex]->index; 235 244 dataNIndex_.at(idx) = axisList[axisIndex]->data_index.numElements(); 236 245 dataDims_.at(idx) = 1; … … 326 335 size_t ssize = 1, idx = 0; 327 336 for (int i = 0; i < this->dims_; ++i) 328 337 ssize *= nLocal_[i]; 329 338 330 339 this->globalIndex_.resize(ssize); 331 std::vector<int> idxLoop(this-> dims_,0);332 int innnerLoopSize = nLocal_[0];340 std::vector<int> idxLoop(this->numElement_,0); 341 int innnerLoopSize = infoIndex_[0].numElements(); 333 342 while (idx < ssize) 334 343 { 335 for (int i = 0; i < this-> dims_; ++i)336 { 337 if (idxLoop[i] == nLocal_[i])344 for (int i = 0; i < this->numElement_; ++i) 345 { 346 if (idxLoop[i] == infoIndex_[indexMap_[i]].numElements()) 338 347 { 339 348 idxLoop[i] = 0; … … 344 353 for (int i = 0; i < innnerLoopSize; ++i) 345 354 { 346 size_t globalIndex = i dxLoop[0] + nBeginGlobal_[0];355 size_t globalIndex = infoIndex_[0](idxLoop[0]); 347 356 size_t mulDim = 1; 348 for (int k = 1; k < this->dims_; ++k) 349 { 350 mulDim *= nGlob_[k-1]; 351 globalIndex += (idxLoop[k] + nBeginGlobal_[k])*mulDim; 352 } 357 for (int idxElement = 0; idxElement < this->numElement_; ++idxElement) 358 { 359 if (axisDomainOrder_(idxElement)) 360 { 361 int jb = (0 == idxElement) ? 1 : 0; 362 for (int j = jb; j <= 1; ++j) 363 { 364 mulDim *= nGlob_[indexMap_[idxElement]+j-1]; 365 globalIndex += (infoIndex_[indexMap_[idxElement]+j](idxLoop[idxElement]))*mulDim; 366 } 367 } 368 else 369 { 370 if (0 != idxElement) 371 { 372 mulDim *= nGlob_[indexMap_[idxElement]-1]; 373 globalIndex += (infoIndex_[indexMap_[idxElement]](idxLoop[idxElement]))*mulDim; 374 } 375 } 376 } 377 353 378 this->globalIndex_(idx) = globalIndex; 354 379 ++idxLoop[0]; … … 356 381 } 357 382 } 383 358 384 } 359 385 … … 429 455 } 430 456 431 int maskIndex = currentIndex[0];432 for (int j = 0; j < this->dims_; ++j)433 434 457 // Inner most index 435 458 idxDomain = idxAxis = 0; … … 451 474 } 452 475 453 if (gridMask_(gridMaskIndex)) //(gridMask_(currentIndex[0], currentIndex[1], currentIndex[2]))476 if (gridMask_(gridMaskIndex)) 454 477 { 455 478 ++indexLocalDataOnClientCount; 456 479 bool isIndexOnServer = true; 457 for (int j = 0; j < this->dims_; ++j) 458 isIndexOnServer = isIndexOnServer && ((currentIndex[j]+nBeginGlobal_[j]) <= nZoomEnd_[j]) 459 && (nZoomBegin_[j] <= (currentIndex[j]+nBeginGlobal_[j])); 480 481 for (int idxElement = 0; idxElement < this->numElement_; ++idxElement) 482 { 483 int actualIdx = 0; 484 if (axisDomainOrder_(idxElement)) 485 { 486 actualIdx = currentIndex[indexMap_[idxElement]]+currentIndex[indexMap_[idxElement]+1]*nLocal_[indexMap_[idxElement]]; 487 isIndexOnServer = isIndexOnServer && ((infoIndex_[indexMap_[idxElement]](actualIdx)) <= nZoomEnd_[indexMap_[idxElement]]) 488 && (nZoomBegin_[indexMap_[idxElement]] <= (infoIndex_[indexMap_[idxElement]](actualIdx))) 489 && ((infoIndex_[indexMap_[idxElement]+1](actualIdx)) <= nZoomEnd_[indexMap_[idxElement]+1]) 490 && (nZoomBegin_[indexMap_[idxElement]+1] <= (infoIndex_[indexMap_[idxElement]+1](actualIdx))); 491 } 492 else 493 { 494 isIndexOnServer = isIndexOnServer && ((infoIndex_[indexMap_[idxElement]](currentIndex[indexMap_[idxElement]])) <= nZoomEnd_[indexMap_[idxElement]]) 495 && (nZoomBegin_[indexMap_[idxElement]] <= (infoIndex_[indexMap_[idxElement]](currentIndex[indexMap_[idxElement]]))); 496 } 497 } 460 498 if (isIndexOnServer) ++indexSend2ServerCount; 461 499 } … … 571 609 { 572 610 localDataIndex_[indexLocalDataOnClientCount] = countLocalData; 573 574 611 bool isIndexOnServer = true; 575 for (int j = 0; j < this->dims_; ++j) 576 isIndexOnServer = isIndexOnServer && 577 ((currentIndex[j]+nBeginGlobal_[j]) <= nZoomEnd_[j]) && 578 (nZoomBegin_[j] <= (currentIndex[j]+nBeginGlobal_[j])); 612 for (int idxElement = 0; idxElement < this->numElement_; ++idxElement) 613 { 614 int actualIdx = 0; 615 if (axisDomainOrder_(idxElement)) 616 { 617 actualIdx = currentIndex[indexMap_[idxElement]]+currentIndex[indexMap_[idxElement]+1]*nLocal_[indexMap_[idxElement]]; 618 isIndexOnServer = isIndexOnServer && ((infoIndex_[indexMap_[idxElement]](actualIdx)) <= nZoomEnd_[indexMap_[idxElement]]) 619 && (nZoomBegin_[indexMap_[idxElement]] <= (infoIndex_[indexMap_[idxElement]](actualIdx))) 620 && ((infoIndex_[indexMap_[idxElement]+1](actualIdx)) <= nZoomEnd_[indexMap_[idxElement]+1]) 621 && (nZoomBegin_[indexMap_[idxElement]+1] <= (infoIndex_[indexMap_[idxElement]+1](actualIdx))); 622 } 623 else 624 { 625 isIndexOnServer = isIndexOnServer && ((infoIndex_[indexMap_[idxElement]](currentIndex[indexMap_[idxElement]])) <= nZoomEnd_[indexMap_[idxElement]]) 626 && (nZoomBegin_[indexMap_[idxElement]] <= (infoIndex_[indexMap_[idxElement]](currentIndex[indexMap_[idxElement]]))); 627 } 628 } 629 579 630 if (isIndexOnServer) 580 631 { 581 size_t globalIndex = currentIndex[0] + nBeginGlobal_[0]; 632 int actualIdx = (axisDomainOrder_(0)) ? currentIndex[0]+currentIndex[1]*nLocal_[0] 633 : currentIndex[0]; 634 size_t globalIndex = infoIndex_[0](actualIdx); //idxLoop[0] + nBeginGlobal_[0]; 582 635 size_t mulDim = 1; 583 for (int k = 1; k < this->dims_; ++k)636 for (int idxElement = 0; idxElement < this->numElement_; ++idxElement) 584 637 { 585 mulDim *= nGlob_[k-1]; 586 globalIndex += (currentIndex[k] + nBeginGlobal_[k])*mulDim; 638 if (axisDomainOrder_(idxElement)) 639 { 640 actualIdx = currentIndex[indexMap_[idxElement]]+currentIndex[indexMap_[idxElement]+1]*nLocal_[indexMap_[idxElement]]; 641 int jb = (0 == idxElement) ? 1 : 0; 642 for (int j = jb; j <= 1; ++j) 643 { 644 mulDim *= nGlob_[indexMap_[idxElement]+j-1]; 645 globalIndex += (infoIndex_[indexMap_[idxElement]+j](actualIdx))*mulDim; 646 } 647 } 648 else 649 { 650 if (0 != idxElement) 651 { 652 mulDim *= nGlob_[indexMap_[idxElement]-1]; 653 globalIndex += (infoIndex_[indexMap_[idxElement]](currentIndex[indexMap_[idxElement]]))*mulDim; 654 } 655 } 587 656 } 588 657 globalDataSendToServer_[indexSend2ServerCount] = globalIndex; -
XIOS/trunk/src/distribution_client.hpp
r676 r818 97 97 std::vector<int> dataBegin_; //!< Data begin (data_ibegin, data_jbegin, etc) 98 98 std::vector<CArray<int,1> > dataIndex_; //!< Data index 99 std::vector<CArray<int,1> > infoIndex_; //!< i_index, j_index 99 100 100 101 std::vector<CArray<bool,1> > domainMasks_; //!< Domain mask
Note: See TracChangeset
for help on using the changeset viewer.