Changeset 1201 for XIOS/dev/dev_olga/src/node/domain.cpp
- Timestamp:
- 07/07/17 18:17:49 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_olga/src/node/domain.cpp
r1173 r1201 2463 2463 } 2464 2464 2465 i_index.resize(nbIndGlob); 2466 j_index.resize(nbIndGlob); 2467 2465 2468 globalLocalIndexMap_.rehash(std::ceil(nbIndGlob/globalLocalIndexMap_.max_load_factor())); 2466 i_index.resize(nbIndGlob);2467 j_index.resize(nbIndGlob);2468 2469 nbIndGlob = 0; 2469 2470 for (i = 0; i < nbReceived; ++i) … … 2473 2474 { 2474 2475 index = tmp(ind); 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 } 2476 i_index(nbIndGlob) = index % ni_glo; 2477 j_index(nbIndGlob) = index / ni_glo; 2478 globalLocalIndexMap_[index] = nbIndGlob; 2479 ++nbIndGlob; 2482 2480 } 2483 2481 } 2484 2485 i_index.resizeAndPreserve(nbIndGlob);2486 j_index.resizeAndPreserve(nbIndGlob);2487 2482 } 2488 2483 … … 2635 2630 void CDomain::recvMask(std::map<int, CBufferIn*>& rankBuffers) 2636 2631 { 2637 int nbReceived = rankBuffers.size(), i, ind, index , lInd;2632 int nbReceived = rankBuffers.size(), i, ind, index; 2638 2633 if (nbReceived != recvClientRanks_.size()) 2639 ERROR("void CDomain::recv Mask(std::map<int, CBufferIn*>& rankBuffers)",2634 ERROR("void CDomain::recvArea(std::map<int, CBufferIn*>& rankBuffers)", 2640 2635 << "The number of sending clients is not correct." 2641 2636 << "Expected number: " << recvClientRanks_.size() << " but received " << nbReceived); … … 2655 2650 } 2656 2651 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();2662 2652 mask_1d.resize(nbMaskInd); 2663 2653 nbMaskInd = 0; 2664 2654 for (i = 0; i < nbReceived; ++i) 2665 2655 { 2666 CArray<int,1>& tmpInd = indGlob_[recvClientRanks_[i]];2667 2656 CArray<bool,1>& tmp = recvMaskValue[i]; 2668 2657 for (ind = 0; ind < tmp.numElements(); ++ind) 2669 2658 { 2670 lInd = globalLocalIndexMap_[size_t(tmpInd(ind))];2671 mask_1d(lInd) = tmp(ind);2659 mask_1d(nbMaskInd) = tmp(ind); 2660 ++nbMaskInd; 2672 2661 } 2673 2662 } … … 2728 2717 2729 2718 if (nbLonInd != globalLocalIndexMap_.size()) 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(); 2719 info (0) << "Something wrong with longitude index "<< std::endl; 2720 2734 2721 lonvalue.resize(nbLonInd); 2735 2722 if (hasBounds) … … 2812 2799 2813 2800 if (nbLatInd != globalLocalIndexMap_.size()) 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(); 2801 info (0) << "Something wrong with latitude index "<< std::endl; 2802 2818 2803 latvalue.resize(nbLatInd); 2819 2804 if (hasBounds) … … 2885 2870 } 2886 2871 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 2887 2881 if (hasArea) 2888 2882 { 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();2900 2883 areavalue.resize(nbAreaInd); 2901 2884 nbAreaInd = 0; … … 3005 2988 { 3006 2989 lInd = globalLocalIndexMap_[size_t(tmpInd(ind))]; 3007 dataIIndex(lInd) = (-1 == dataIIndex(lInd)) ? tmpI(ind) : dataIIndex(lInd); // Only fill in dataIndex if there is no data3008 dataJIndex(lInd) = (-1 == dataJIndex(lInd)) ? tmpJ(ind) : dataJIndex(lInd);2990 dataIIndex(lInd) = tmpI(ind); 2991 dataJIndex(lInd) = tmpJ(ind); 3009 2992 } 3010 2993 }
Note: See TracChangeset
for help on using the changeset viewer.