Changeset 1545 for XIOS/dev/branch_openmp/src/transformation
- Timestamp:
- 06/18/18 20:32:55 (6 years ago)
- Location:
- XIOS/dev/branch_openmp/src/transformation
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/branch_openmp/src/transformation/Functions/reduction.hpp
r1460 r1545 23 23 { 24 24 public: 25 //static std::map<StdString,EReductionType> ReductionOperations;26 25 static std::map<StdString,EReductionType> *ReductionOperations_ptr; 27 26 #pragma omp threadprivate(ReductionOperations_ptr) -
XIOS/dev/branch_openmp/src/transformation/axis_algorithm_extract_domain.cpp
r1460 r1545 13 13 #include "grid.hpp" 14 14 #include "grid_transformation_factory_impl.hpp" 15 //#include "reduction.hpp"16 15 17 16 namespace xios { -
XIOS/dev/branch_openmp/src/transformation/axis_algorithm_inverse.cpp
r1328 r1545 109 109 } 110 110 111 typedef boost::unordered_map<size_t, std::vector<double> > GlobalIndexMapFromSrcToDest;111 typedef std::unordered_map<size_t, std::vector<double> > GlobalIndexMapFromSrcToDest; 112 112 GlobalIndexMapFromSrcToDest globalIndexMapFromSrcToDest; 113 113 TransformationIndexMap& transMap = this->transformationMapping_[0]; … … 127 127 dhtIndexProcRank.computeIndexInfoMapping(globalSrcIndex); 128 128 CClientClientDHTInt::Index2VectorInfoTypeMap& computedGlobalIndexOnProc = dhtIndexProcRank.getInfoIndexMap(); 129 boost::unordered_map<int, std::vector<size_t> > globalSrcIndexSendToProc;129 std::unordered_map<int, std::vector<size_t> > globalSrcIndexSendToProc; 130 130 for (int idx = 0; idx < localIndex; ++idx) 131 131 { … … 138 138 } 139 139 140 boost::unordered_map<int, std::vector<size_t> >::const_iterator itbIndex = globalSrcIndexSendToProc.begin(), itIndex,140 std::unordered_map<int, std::vector<size_t> >::const_iterator itbIndex = globalSrcIndexSendToProc.begin(), itIndex, 141 141 iteIndex = globalSrcIndexSendToProc.end(); 142 142 std::map<int,int> sendRankSizeMap,recvRankSizeMap; … … 176 176 std::vector<MPI_Request> requests; 177 177 std::vector<MPI_Status> status; 178 boost::unordered_map<int, unsigned long* > recvGlobalIndexSrc;179 boost::unordered_map<int, double* > sendValueToDest;178 std::unordered_map<int, unsigned long* > recvGlobalIndexSrc; 179 std::unordered_map<int, double* > sendValueToDest; 180 180 for (std::map<int,int>::const_iterator itRecv = recvRankSizeMap.begin(); itRecv != recvRankSizeMap.end(); ++itRecv) 181 181 { … … 189 189 } 190 190 191 boost::unordered_map<int, unsigned long* > sendGlobalIndexSrc;192 boost::unordered_map<int, double* > recvValueFromSrc;191 std::unordered_map<int, unsigned long* > sendGlobalIndexSrc; 192 std::unordered_map<int, double* > recvValueFromSrc; 193 193 for (itIndex = itbIndex; itIndex != iteIndex; ++itIndex) 194 194 { … … 272 272 delete [] recvSizeBuff; 273 273 274 boost::unordered_map<int, double* >::const_iterator itChar;274 std::unordered_map<int, double* >::const_iterator itChar; 275 275 for (itChar = sendValueToDest.begin(); itChar != sendValueToDest.end(); ++itChar) 276 276 delete [] itChar->second; 277 277 for (itChar = recvValueFromSrc.begin(); itChar != recvValueFromSrc.end(); ++itChar) 278 278 delete [] itChar->second; 279 boost::unordered_map<int, unsigned long* >::const_iterator itLong;279 std::unordered_map<int, unsigned long* >::const_iterator itLong; 280 280 for (itLong = sendGlobalIndexSrc.begin(); itLong != sendGlobalIndexSrc.end(); ++itLong) 281 281 delete [] itLong->second; -
XIOS/dev/branch_openmp/src/transformation/axis_algorithm_reduce_axis.cpp
r1460 r1545 12 12 #include "grid.hpp" 13 13 #include "grid_transformation_factory_impl.hpp" 14 //#include "reduction.hpp"15 14 16 15 namespace xios { … … 72 71 CReductionAlgorithm::initReductionOperation(); 73 72 } 74 //reduction_ = CReductionAlgorithm::createOperation(CReductionAlgorithm::ReductionOperations[op]); 73 75 74 reduction_ = CReductionAlgorithm::createOperation(CReductionAlgorithm::ReductionOperations_ptr->at(op)); 76 75 } -
XIOS/dev/branch_openmp/src/transformation/axis_algorithm_reduce_domain.cpp
r1460 r1545 13 13 #include "grid.hpp" 14 14 #include "grid_transformation_factory_impl.hpp" 15 //#include "reduction.hpp" 15 16 16 17 17 namespace xios { … … 74 74 CReductionAlgorithm::initReductionOperation(); 75 75 } 76 //reduction_ = CReductionAlgorithm::createOperation(CReductionAlgorithm::ReductionOperations[op]);77 76 reduction_ = CReductionAlgorithm::createOperation(CReductionAlgorithm::ReductionOperations_ptr->at(op)); 78 77 local = algo->local ; -
XIOS/dev/branch_openmp/src/transformation/domain_algorithm_interpolate.cpp
r1540 r1545 8 8 */ 9 9 #include "domain_algorithm_interpolate.hpp" 10 #include < boost/unordered_map.hpp>10 #include <unordered_map> 11 11 #include "context.hpp" 12 12 #include "context_client.hpp" … … 406 406 CContext* context = CContext::getCurrent(); 407 407 CContextClient* client=context->client; 408 //int mykey;409 //ep_lib::MPI_Comm_rank(client->intraComm, &mykey);410 408 411 409 ep_lib::MPI_Comm poleComme = MPI_COMM_NULL; 412 410 ep_lib::MPI_Comm_split(client->intraComm, interMapValuePole.empty() ? 0 : 1, 0, &poleComme); 413 //ep_lib::MPI_Comm_split(client->intraComm, interMapValuePole.empty() ? 0 : 1, mykey, &poleComme);414 //if (!poleComme.is_null())415 411 if (poleComme!=MPI_COMM_NULL) 416 412 { … … 540 536 TransformationWeightMap& transWeight = this->transformationWeight_[0]; 541 537 542 boost::unordered_map<size_t,int> globalIndexOfDomainDest;538 std::unordered_map<size_t,int> globalIndexOfDomainDest; 543 539 int ni = domainDest_->ni.getValue(); 544 540 int nj = domainDest_->nj.getValue(); … … 816 812 WriteNetCdf *netCdfWriter; 817 813 818 // #pragma omp barrier 819 // #pragma omp master 814 820 815 MPI_Barrier_local(client->intraComm); 821 816 if(my_rank_loc==0) … … 843 838 } 844 839 845 // #pragma omp barrier 840 846 841 MPI_Barrier_local(client->intraComm); 847 842 … … 863 858 MPI_Barrier_local(client->intraComm); 864 859 865 // #pragma omp barrier 866 cout<<"end write weight info"<< endl; 860 867 861 } 868 862 … … 953 947 renormalizationFactor=1 ; 954 948 } 955 949 956 950 if (firstPass) 957 951 { … … 969 963 else 970 964 { 971 dataOut(localIndex[idx].first) += *(dataInput + idx) * localIndex[idx].second; 965 dataOut(localIndex[idx].first) += *(dataInput + idx) * localIndex[idx].second; 966 allMissing(localIndex[idx].first) = allMissing(localIndex[idx].first) && false; // Reset flag to indicate not all data source are nan 972 967 } 973 968 } … … 999 994 if (renormalizationFactor.numElements()>0) dataOut/=renormalizationFactor ; // In some case, process doesn't received any data for interpolation (mask) 1000 995 // so renormalizationFactor is not initialized 1001 } 1002 } 1003 } 1004 1005 } 996 } 997 } 998 } 999 1000 } -
XIOS/dev/branch_openmp/src/transformation/generic_algorithm_transformation.cpp
r1482 r1545 51 51 } 52 52 } 53 53 54 } 54 55 else … … 164 165 int nbClient = client->clientSize; 165 166 166 typedef boost::unordered_map<int, std::vector<std::pair<int,double> > > SrcToDstMap;167 typedef std::unordered_map<int, std::vector<std::pair<int,double> > > SrcToDstMap; 167 168 int idx; 168 169 … … 286 287 if (idx != elementPositionInGrid) 287 288 { 288 boost::unordered_map<int,std::vector<size_t> >::iterator itb = globalElementIndexOnProc_[idx].begin(), it,289 std::unordered_map<int,std::vector<size_t> >::iterator itb = globalElementIndexOnProc_[idx].begin(), it, 289 290 ite = globalElementIndexOnProc_[idx].end(); 290 291 for (it = itb; it != ite; ++it) it->second.resize(1); … … 300 301 if (idx != elementPositionInGrid) 301 302 { 302 boost::unordered_map<int,std::vector<size_t> >::iterator itb = globalElementIndexOnProc_[idx].begin(), it,303 std::unordered_map<int,std::vector<size_t> >::iterator itb = globalElementIndexOnProc_[idx].begin(), it, 303 304 ite = globalElementIndexOnProc_[idx].end(); 304 305 for (it = itb; it != ite; ++it) procOfNonTransformedElements_.insert(it->first); … … 358 359 set<int> tmpSet ; 359 360 procList.swap(tmpSet) ; 360 boost::unordered_map<int,std::vector<size_t> >::iterator itb = globalElementIndexOnProc_[idx].begin(), it,361 std::unordered_map<int,std::vector<size_t> >::iterator itb = globalElementIndexOnProc_[idx].begin(), it, 361 362 ite = globalElementIndexOnProc_[idx].end(); 362 363 for (it = itb; it != ite; ++it) … … 394 395 395 396 // Build mapping between global source element index and global destination element index. 396 boost::unordered_map<int,std::vector<size_t> >().swap(globalElementIndexOnProc_[elementPositionInGrid]);397 std::unordered_map<int,std::vector<size_t> >().swap(globalElementIndexOnProc_[elementPositionInGrid]); 397 398 std::set<int> tmpCounter; 398 399 itTransWeight = itbTransWeight; … … 425 426 if (idx != elementPositionInGrid) 426 427 { 427 boost::unordered_map<int,std::vector<size_t> >::iterator itb = globalElementIndexOnProc_[idx].begin(), it,428 std::unordered_map<int,std::vector<size_t> >::iterator itb = globalElementIndexOnProc_[idx].begin(), it, 428 429 ite = globalElementIndexOnProc_[idx].end(); 429 430 for (it = itb; it != ite; ++it) it->second[0] = transPos(idxTrans); … … 455 456 void CGenericAlgorithmTransformation::computeGlobalGridIndexMapping(int elementPositionInGrid, 456 457 const std::vector<int>& srcRank, 457 boost::unordered_map<int, std::vector<std::pair<int,double> > >& src2DstMap,458 std::unordered_map<int, std::vector<std::pair<int,double> > >& src2DstMap, 458 459 CGrid* gridSrc, 459 460 CGrid* gridDst, 460 std::vector< boost::unordered_map<int,std::vector<size_t> > >& globalElementIndexOnProc,461 std::vector<std::unordered_map<int,std::vector<size_t> > >& globalElementIndexOnProc, 461 462 SourceDestinationIndexMap& globaIndexWeightFromSrcToDst) 462 463 { … … 614 615 615 616 SourceDestinationIndexMap::iterator rankIt,rankIte ; 616 boost::unordered_map<size_t, std::vector<std::pair<size_t,double> > >::iterator globalSrcIndexIt, globalSrcIndexIte ;617 std::unordered_map<size_t, std::vector<std::pair<size_t,double> > >::iterator globalSrcIndexIt, globalSrcIndexIte ; 617 618 std::vector<std::pair<size_t,double> >::iterator vectIt,vectIte ; 618 619 … … 652 653 CScalar* scalarSrc, 653 654 CArray<size_t,1>& destGlobalIndexPositionInGrid, 654 boost::unordered_map<int,std::vector<size_t> >& globalScalarIndexOnProc)655 std::unordered_map<int,std::vector<size_t> >& globalScalarIndexOnProc) 655 656 { 656 657 CContext* context = CContext::getCurrent(); … … 676 677 CAxis* axisSrc, 677 678 CArray<size_t,1>& destGlobalIndexPositionInGrid, 678 boost::unordered_map<int,std::vector<size_t> >& globalAxisIndexOnProc)679 std::unordered_map<int,std::vector<size_t> >& globalAxisIndexOnProc) 679 680 { 680 681 CContext* context = CContext::getCurrent(); … … 745 746 CDomain* domainSrc, 746 747 CArray<size_t,1>& destGlobalIndexPositionInGrid, 747 boost::unordered_map<int,std::vector<size_t> >& globalDomainIndexOnProc)748 std::unordered_map<int,std::vector<size_t> >& globalDomainIndexOnProc) 748 749 { 749 750 CContext* context = CContext::getCurrent(); -
XIOS/dev/branch_openmp/src/transformation/generic_algorithm_transformation.hpp
r1460 r1545 38 38 public: 39 39 // Mapping between global index map of DESTINATION and its local index with pair of global index of SOURCE and weights 40 typedef boost::unordered_map<int, boost::unordered_map<size_t, std::vector<std::pair<size_t,double> > > > SourceDestinationIndexMap;40 typedef std::unordered_map<int, std::unordered_map<size_t, std::vector<std::pair<size_t,double> > > > SourceDestinationIndexMap; 41 41 42 42 protected: 43 typedef boost::unordered_map<size_t,int> GlobalLocalMap;43 typedef std::unordered_map<size_t,int> GlobalLocalMap; 44 44 protected: 45 typedef boost::unordered_map<int, std::vector<int> > TransformationIndexMap;46 typedef boost::unordered_map<int, std::vector<double> > TransformationWeightMap;47 typedef boost::unordered_map<int, std::vector<int> > TransformationPositionMap;45 typedef std::unordered_map<int, std::vector<int> > TransformationIndexMap; 46 typedef std::unordered_map<int, std::vector<double> > TransformationWeightMap; 47 typedef std::unordered_map<int, std::vector<int> > TransformationPositionMap; 48 48 49 49 public: … … 108 108 void computeGlobalGridIndexMapping(int elementPositionInGrid, 109 109 const std::vector<int>& srcRank, 110 boost::unordered_map<int, std::vector<std::pair<int,double> > >& src2DstMap,110 std::unordered_map<int, std::vector<std::pair<int,double> > >& src2DstMap, 111 111 CGrid* gridDst, 112 112 CGrid* gridSrc, 113 std::vector< boost::unordered_map<int,std::vector<size_t> > >& globalElementIndexOnProc,113 std::vector<std::unordered_map<int,std::vector<size_t> > >& globalElementIndexOnProc, 114 114 SourceDestinationIndexMap& globaIndexWeightFromSrcToDst); 115 115 … … 117 117 CDomain* domainSrc, 118 118 CArray<size_t,1>& destGlobalIndexPositionInGrid, 119 boost::unordered_map<int,std::vector<size_t> >& globalDomainIndexOnProc);119 std::unordered_map<int,std::vector<size_t> >& globalDomainIndexOnProc); 120 120 121 121 void computeExchangeAxisIndex(CAxis* axisDst, 122 122 CAxis* axisSrc, 123 123 CArray<size_t,1>& destGlobalIndexPositionInGrid, 124 boost::unordered_map<int,std::vector<size_t> >& globalAxisIndexOnProc);124 std::unordered_map<int,std::vector<size_t> >& globalAxisIndexOnProc); 125 125 126 126 void computeExchangeScalarIndex(CScalar* scalarDst, 127 127 CScalar* scalarSrc, 128 128 CArray<size_t,1>& destGlobalIndexPositionInGrid, 129 boost::unordered_map<int,std::vector<size_t> >& globalScalarIndexOnProc);129 std::unordered_map<int,std::vector<size_t> >& globalScalarIndexOnProc); 130 130 131 131 void computePositionElements(CGrid* dst, CGrid* src); … … 151 151 std::set<StdSize> indexElementSrc_; 152 152 153 std::vector< boost::unordered_map<int,std::vector<size_t> > > globalElementIndexOnProc_;153 std::vector<std::unordered_map<int,std::vector<size_t> > > globalElementIndexOnProc_; 154 154 155 155 std::vector<int> procContainSrcElementIdx_; // List of processes containing source index of transformed elements -
XIOS/dev/branch_openmp/src/transformation/grid_transformation.cpp
r1460 r1545 15 15 #include "mpi_tag.hpp" 16 16 #include "grid.hpp" 17 #include < boost/unordered_map.hpp>17 #include <unordered_map> 18 18 #include "timer.hpp" 19 19 … … 479 479 SourceDestinationIndexMap::const_iterator itbIndex = globaIndexWeightFromSrcToDst.begin(), 480 480 iteIndex = globaIndexWeightFromSrcToDst.end(), itIndex; 481 typedef boost::unordered_map<size_t, std::vector<std::pair<size_t,double> > > SendIndexMap;481 typedef std::unordered_map<size_t, std::vector<std::pair<size_t,double> > > SendIndexMap; 482 482 std::map<int,int> sendRankSizeMap,recvRankSizeMap; 483 483 int connectedClient = globaIndexWeightFromSrcToDst.size(); … … 522 522 std::vector<ep_lib::MPI_Request> requests(recvRankSizeMap.size()*2 + globaIndexWeightFromSrcToDst.size()*2); 523 523 std::vector<ep_lib::MPI_Status> status; 524 boost::unordered_map<int, unsigned char* > recvMaskDst;525 boost::unordered_map<int, unsigned long* > recvGlobalIndexSrc;524 std::unordered_map<int, unsigned char* > recvMaskDst; 525 std::unordered_map<int, unsigned long* > recvGlobalIndexSrc; 526 526 int requests_position = 0; 527 527 for (std::map<int,int>::const_iterator itRecv = recvRankSizeMap.begin(); itRecv != recvRankSizeMap.end(); ++itRecv) … … 536 536 } 537 537 538 boost::unordered_map<int, CArray<size_t,1> > globalIndexDst;539 boost::unordered_map<int, CArray<double,1> > weightDst;540 boost::unordered_map<int, unsigned char* > sendMaskDst;541 boost::unordered_map<int, unsigned long* > sendGlobalIndexSrc;538 std::unordered_map<int, CArray<size_t,1> > globalIndexDst; 539 std::unordered_map<int, CArray<double,1> > weightDst; 540 std::unordered_map<int, unsigned char* > sendMaskDst; 541 std::unordered_map<int, unsigned long* > sendGlobalIndexSrc; 542 542 for (itIndex = itbIndex; itIndex != iteIndex; ++itIndex) 543 543 { … … 666 666 delete [] recvSizeBuff; 667 667 668 boost::unordered_map<int, unsigned char* >::const_iterator itChar;668 std::unordered_map<int, unsigned char* >::const_iterator itChar; 669 669 for (itChar = sendMaskDst.begin(); itChar != sendMaskDst.end(); ++itChar) 670 670 delete [] itChar->second; 671 671 for (itChar = recvMaskDst.begin(); itChar != recvMaskDst.end(); ++itChar) 672 672 delete [] itChar->second; 673 boost::unordered_map<int, unsigned long* >::const_iterator itLong;673 std::unordered_map<int, unsigned long* >::const_iterator itLong; 674 674 for (itLong = sendGlobalIndexSrc.begin(); itLong != sendGlobalIndexSrc.end(); ++itLong) 675 675 delete [] itLong->second; -
XIOS/dev/branch_openmp/src/transformation/scalar_algorithm_extract_axis.cpp
r1460 r1545 14 14 #include "grid_transformation_factory_impl.hpp" 15 15 16 //#include "reduction.hpp" 16 17 17 18 18 namespace xios { -
XIOS/dev/branch_openmp/src/transformation/scalar_algorithm_reduce_axis.cpp
r1460 r1545 13 13 #include "grid.hpp" 14 14 #include "grid_transformation_factory_impl.hpp" 15 //#include "reduction.hpp" 15 16 16 17 17 -
XIOS/dev/branch_openmp/src/transformation/scalar_algorithm_reduce_domain.cpp
r1460 r1545 14 14 #include "grid_transformation_factory_impl.hpp" 15 15 16 //#include "reduction.hpp"17 16 18 17 namespace xios { … … 75 74 CReductionAlgorithm::initReductionOperation(); 76 75 } 77 78 //if (CReductionAlgorithm::ReductionOperations.end() == CReductionAlgorithm::ReductionOperations.find(op))79 76 if (CReductionAlgorithm::ReductionOperations_ptr->end() == CReductionAlgorithm::ReductionOperations_ptr->find(op)) 80 77 ERROR("CScalarAlgorithmReduceDomain::CScalarAlgorithmReduceDomain(CDomain* domainDestination, CDomain* domainSource, CReduceDomainToScalar* algo)", … … 83 80 << "Scalar destination " << scalarDestination->getId()); 84 81 85 //reduction_ = CReductionAlgorithm::createOperation(CReductionAlgorithm::ReductionOperations[op]);86 82 reduction_ = CReductionAlgorithm::createOperation(CReductionAlgorithm::ReductionOperations_ptr->at(op)); 87 83 local = algo->local ; -
XIOS/dev/branch_openmp/src/transformation/scalar_algorithm_reduce_scalar.cpp
r1460 r1545 9 9 #include "grid.hpp" 10 10 #include "grid_transformation_factory_impl.hpp" 11 //#include "reduction.hpp" 11 12 12 13 13 … … 76 76 } 77 77 78 //if (CReductionAlgorithm::ReductionOperations.end() == CReductionAlgorithm::ReductionOperations.find(op))79 78 if (CReductionAlgorithm::ReductionOperations_ptr->end() == CReductionAlgorithm::ReductionOperations_ptr->find(op)) 80 79 ERROR("CScalarAlgorithmReduceScalar::CScalarAlgorithmReduceScalar(CScalar* scalarDestination, CScalar* scalarSource, CReduceScalarToScalar* algo)", … … 82 81 << "Scalar source " <<scalarSource->getId() << std::endl 83 82 << "Scalar destination " << scalarDestination->getId()); 84 85 //reduction_ = CReductionAlgorithm::createOperation(CReductionAlgorithm::ReductionOperations[op]); 83 86 84 reduction_ = CReductionAlgorithm::createOperation(CReductionAlgorithm::ReductionOperations_ptr->at(op)); 87 85 }
Note: See TracChangeset
for help on using the changeset viewer.