Changeset 1173
- Timestamp:
- 06/19/17 16:00:48 (7 years ago)
- Location:
- XIOS/dev/dev_olga
- Files:
-
- 2 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_olga/inputs/COMPLETE/context_surface.xml
r562 r1173 32 32 </file> 33 33 34 <file type="one_file" id="output_surface_1d" name="output_surface_1d" output_freq="1d" >35 <field field_ref="field_A_srf" >34 <file type="one_file" id="output_surface_1d" name="output_surface_1d" output_freq="1d" enabled="TRUE"> 35 <field field_ref="field_A_srf" indexed_output="TRUE"> 36 36 <variable id="my_attribute1" type="string">surf_att</variable> 37 37 <variable id="my_attribute2" type="int">10</variable> -
XIOS/dev/dev_olga/src/node/domain.cpp
r1158 r1173 2463 2463 } 2464 2464 2465 globalLocalIndexMap_.rehash(std::ceil(nbIndGlob/globalLocalIndexMap_.max_load_factor())); 2465 2466 i_index.resize(nbIndGlob); 2466 j_index.resize(nbIndGlob); 2467 2468 globalLocalIndexMap_.rehash(std::ceil(nbIndGlob/globalLocalIndexMap_.max_load_factor())); 2467 j_index.resize(nbIndGlob); 2469 2468 nbIndGlob = 0; 2470 2469 for (i = 0; i < nbReceived; ++i) … … 2474 2473 { 2475 2474 index = tmp(ind); 2476 i_index(nbIndGlob) = index % ni_glo; 2477 j_index(nbIndGlob) = index / ni_glo; 2478 globalLocalIndexMap_[index] = nbIndGlob; 2479 ++nbIndGlob; 2475 if (0 == globalLocalIndexMap_.count(index)) 2476 { 2477 i_index(nbIndGlob) = index % ni_glo; 2478 j_index(nbIndGlob) = index / ni_glo; 2479 globalLocalIndexMap_[index] = nbIndGlob; 2480 ++nbIndGlob; 2481 } 2480 2482 } 2481 2483 } 2484 2485 i_index.resizeAndPreserve(nbIndGlob); 2486 j_index.resizeAndPreserve(nbIndGlob); 2482 2487 } 2483 2488 … … 2630 2635 void CDomain::recvMask(std::map<int, CBufferIn*>& rankBuffers) 2631 2636 { 2632 int nbReceived = rankBuffers.size(), i, ind, index ;2637 int nbReceived = rankBuffers.size(), i, ind, index, lInd; 2633 2638 if (nbReceived != recvClientRanks_.size()) 2634 ERROR("void CDomain::recv Area(std::map<int, CBufferIn*>& rankBuffers)",2639 ERROR("void CDomain::recvMask(std::map<int, CBufferIn*>& rankBuffers)", 2635 2640 << "The number of sending clients is not correct." 2636 2641 << "Expected number: " << recvClientRanks_.size() << " but received " << nbReceived); … … 2650 2655 } 2651 2656 2657 if (nbMaskInd != globalLocalIndexMap_.size()) 2658 info (0) << "If the domain " << this->getDomainOutputName() <<" does not have overlapped region between processes." 2659 << "Something shouble be wrong with mask index "<< std::endl; 2660 2661 nbMaskInd = globalLocalIndexMap_.size(); 2652 2662 mask_1d.resize(nbMaskInd); 2653 nbMaskInd = 0;2663 2654 2664 for (i = 0; i < nbReceived; ++i) 2655 2665 { 2666 CArray<int,1>& tmpInd = indGlob_[recvClientRanks_[i]]; 2656 2667 CArray<bool,1>& tmp = recvMaskValue[i]; 2657 2668 for (ind = 0; ind < tmp.numElements(); ++ind) 2658 2669 { 2659 mask_1d(nbMaskInd) = tmp(ind);2660 ++nbMaskInd;2670 lInd = globalLocalIndexMap_[size_t(tmpInd(ind))]; 2671 mask_1d(lInd) = tmp(ind); 2661 2672 } 2662 2673 } … … 2717 2728 2718 2729 if (nbLonInd != globalLocalIndexMap_.size()) 2719 info (0) << "Something wrong with longitude index "<< std::endl; 2720 2730 info (0) << "If the domain " << this->getDomainOutputName() <<" does not have overlapped region between processes." 2731 << "Something shouble be wrong with longitude index "<< std::endl; 2732 2733 nbLonInd = globalLocalIndexMap_.size(); 2721 2734 lonvalue.resize(nbLonInd); 2722 2735 if (hasBounds) … … 2799 2812 2800 2813 if (nbLatInd != globalLocalIndexMap_.size()) 2801 info (0) << "Something wrong with latitude index "<< std::endl; 2802 2814 info (0) << "If the domain " << this->getDomainOutputName() <<" does not have overlapped region between processes." 2815 << "Something shouble be wrong with latitude index "<< std::endl; 2816 2817 nbLatInd = globalLocalIndexMap_.size(); 2803 2818 latvalue.resize(nbLatInd); 2804 2819 if (hasBounds) … … 2870 2885 } 2871 2886 2872 int nbAreaInd = 0;2873 for (i = 0; i < nbReceived; ++i)2874 {2875 nbAreaInd += recvAreaValue[i].numElements();2876 }2877 2878 if (nbAreaInd != globalLocalIndexMap_.size())2879 info (0) << "Something wrong with latitude index "<< std::endl;2880 2881 2887 if (hasArea) 2882 2888 { 2889 int nbAreaInd = 0; 2890 for (i = 0; i < nbReceived; ++i) 2891 { 2892 nbAreaInd += recvAreaValue[i].numElements(); 2893 } 2894 2895 if (nbAreaInd != globalLocalIndexMap_.size()) 2896 info (0) << "If the domain " << this->getDomainOutputName() <<" does not have overlapped region between processes." 2897 << "Something shouble be wrong with area index "<< std::endl; 2898 2899 nbAreaInd = globalLocalIndexMap_.size(); 2883 2900 areavalue.resize(nbAreaInd); 2884 2901 nbAreaInd = 0; … … 2988 3005 { 2989 3006 lInd = globalLocalIndexMap_[size_t(tmpInd(ind))]; 2990 dataIIndex(lInd) = tmpI(ind);2991 dataJIndex(lInd) = tmpJ(ind);3007 dataIIndex(lInd) = (-1 == dataIIndex(lInd)) ? tmpI(ind) : dataIIndex(lInd); // Only fill in dataIndex if there is no data 3008 dataJIndex(lInd) = (-1 == dataJIndex(lInd)) ? tmpJ(ind) : dataJIndex(lInd); 2992 3009 } 2993 3010 } -
XIOS/dev/dev_olga/src/transformation/domain_algorithm_interpolate.cpp
r1158 r1173 388 388 } 389 389 390 if (writeToFile_ && !readFromFile_) 391 writeRemapInfo(interpMapValue);392 exchangeRemapInfo(interpMapValue);390 if (writeToFile_ && !readFromFile_) writeRemapInfo(interpMapValue); 391 // exchangeRemapInfo(interpMapValue); 392 convertRemapInfo(interpMapValue) ; 393 393 394 394 delete [] globalSrc; … … 494 494 } 495 495 496 void CDomainAlgorithmInterpolate::convertRemapInfo(std::map<int,std::vector<std::pair<int,double> > >& interpMapValue) 497 { 498 CContext* context = CContext::getCurrent(); 499 CContextClient* client=context->client; 500 int clientRank = client->clientRank; 501 502 this->transformationMapping_.resize(1); 503 this->transformationWeight_.resize(1); 504 505 TransformationIndexMap& transMap = this->transformationMapping_[0]; 506 TransformationWeightMap& transWeight = this->transformationWeight_[0]; 507 508 std::map<int,std::vector<std::pair<int,double> > >::const_iterator itb = interpMapValue.begin(), it, 509 ite = interpMapValue.end(); 510 511 for (it = itb; it != ite; ++it) 512 { 513 const std::vector<std::pair<int,double> >& tmp = it->second; 514 for (int i = 0; i < tmp.size(); ++i) 515 { 516 transMap[it->first].push_back(tmp[i].first); 517 transWeight[it->first].push_back(tmp[i].second); 518 } 519 } 520 } 496 521 497 522 /*! -
XIOS/dev/dev_olga/src/transformation/domain_algorithm_interpolate.hpp
r1158 r1173 44 44 void writeRemapInfo(std::map<int,std::vector<std::pair<int,double> > >&); 45 45 void exchangeRemapInfo(std::map<int,std::vector<std::pair<int,double> > >& interpMapValue); 46 void convertRemapInfo(std::map<int,std::vector<std::pair<int,double> > >& interpMapValue); 46 47 47 48 private: -
XIOS/dev/dev_olga/src/transformation/generic_algorithm_transformation.cpp
r1158 r1173 45 45 { 46 46 dataOut(localIndex[idx].first) += *(dataInput + idx) * localIndex[idx].second; 47 } 48 } 49 50 // for (int idx = 0; idx < nbLocalIndex; ++idx) 51 // { 52 // if (!flagInitial[localIndex[idx].first]) 53 // dataOut(localIndex[idx].first) = defaultValue; 54 // } 47 flagInitial[localIndex[idx].first] = true; // Reset flag to indicate not all data source are nan 48 } 49 } 50 51 for (int idx = 0; idx < nbLocalIndex; ++idx) 52 { 53 if (!flagInitial[localIndex[idx].first]) 54 dataOut(localIndex[idx].first) = defaultValue; 55 } 55 56 } 56 57 else
Note: See TracChangeset
for help on using the changeset viewer.