Changeset 657 for XIOS/trunk/src/node/domain.cpp
- Timestamp:
- 07/28/15 13:37:07 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/node/domain.cpp
- Property svn:executable set to *
r635 r657 17 17 #include "client_server_mapping_distributed.hpp" 18 18 #include "zoom_domain.hpp" 19 #include "interpolate_from_file_domain.hpp" 19 20 20 21 namespace xios { … … 25 26 : CObjectTemplate<CDomain>(), CDomainAttributes() 26 27 , isChecked(false), relFiles(), isClientChecked(false), nbConnectedClients_(), indSrv_(), connectedServerRank_() 27 , hasBounds(false), hasArea(false), isDistributed_(false) 28 , global_zoom_ibegin(0), global_zoom_ni(0), global_zoom_jbegin(0), global_zoom_nj(0) 28 , hasBounds(false), hasArea(false), isDistributed_(false), nGlobDomain_(), isUnstructed_(false) 29 , global_zoom_ni(0), global_zoom_ibegin(0), global_zoom_nj(0), global_zoom_jbegin(0), maskInter_() 30 , isClientAfterTransformationChecked(false) 29 31 { /* Ne rien faire de plus */ } 30 32 … … 32 34 : CObjectTemplate<CDomain>(id), CDomainAttributes() 33 35 , isChecked(false), relFiles(), isClientChecked(false), nbConnectedClients_(), indSrv_(), connectedServerRank_() 34 , hasBounds(false), hasArea(false), isDistributed_(false) 35 , global_zoom_ibegin(0), global_zoom_ni(0), global_zoom_jbegin(0), global_zoom_nj(0) 36 , hasBounds(false), hasArea(false), isDistributed_(false), nGlobDomain_(), isUnstructed_(false) 37 , global_zoom_ni(0), global_zoom_ibegin(0), global_zoom_nj(0), global_zoom_jbegin(0), maskInter_() 38 , isClientAfterTransformationChecked(false) 36 39 { /* Ne rien faire de plus */ } 37 40 … … 59 62 60 63 //---------------------------------------------------------------- 61 62 bool CDomain::hasZoom(void) const63 {64 return ((this->zoom_ni.getValue() != this->ni_glo.getValue()) &&65 (this->zoom_nj.getValue() != this->nj_glo.getValue()));66 }67 68 //----------------------------------------------------------------69 70 64 bool CDomain::isEmpty(void) const 71 65 { … … 75 69 76 70 //---------------------------------------------------------------- 77 78 71 bool CDomain::IsWritten(const StdString & filename) const 79 72 { … … 82 75 83 76 //---------------------------------------------------------------- 84 85 77 bool CDomain::isDistributed(void) const 86 78 { … … 89 81 90 82 //---------------------------------------------------------------- 91 92 83 void CDomain::addRelFile(const StdString & filename) 93 84 { … … 113 104 << " check the \'ni_glo\' value !") 114 105 } 115 nj_glo=ni_glo ; 116 ni_glo=1 ; 117 if (!ni.isEmpty()) nj=ni ; 118 if (!ibegin.isEmpty()) jbegin=ibegin ; 119 if (!iend.isEmpty()) jend=iend ; 120 if (!i_index.isEmpty()) 121 { 122 j_index.resize(1,nj) ; 123 for(int i=0;i<ni;i++) j_index(0,i)=i_index(i,0) ; 124 i_index.resize(1,nj) ; 125 for(int j=0;j<nj;j++) i_index(0,j)=0 ; 126 } 127 128 if (!mask.isEmpty()) 129 { 130 CArray<int,2> mask_tmp(nj,1) ; 131 mask_tmp = mask ; 132 mask.resize(1,nj) ; 133 for(int j=0;j<nj;j++) mask(0,j)=mask_tmp(j,0) ; 134 } 106 isUnstructed_ = true; 107 nj_glo = 1; 108 nj = 1; 109 jbegin = 0; 110 if (ni.isEmpty()) ni = i_index.numElements(); 111 j_index.resize(ni); 112 for(int i=0;i<ni;++i) j_index(i)=0; 113 114 // nj_glo=ni_glo ; 115 // ni_glo=1 ; 116 // if (!ni.isEmpty()) nj=ni ; 117 // if (!ibegin.isEmpty()) jbegin=ibegin ; 118 // if (!iend.isEmpty()) jend=iend ; 119 // if (!i_index.isEmpty()) 120 // { 121 // j_index.resize(1,nj) ; 122 // for(int i=0;i<ni;i++) j_index(0,i)=i_index(i,0) ; 123 // i_index.resize(1,nj) ; 124 // for(int j=0;j<nj;j++) i_index(0,j)=0 ; 125 // } 126 // 127 // if (!mask.isEmpty()) 128 // { 129 // CArray<int,2> mask_tmp(nj,1); 130 // mask_tmp = mask ; 131 // mask.resize(1,nj) ; 132 // for(int j=0;j<nj;j++) mask(0,j)=mask_tmp(j,0) ; 133 // } 135 134 136 135 if (!area.isEmpty()) 137 136 area.transposeSelf(1, 0); 138 137 139 ni=1 ;140 ibegin=0 ;141 iend=0 ;138 // ni=1 ; 139 // ibegin=0 ; 140 // iend=0 ; 142 141 143 142 } … … 151 150 } 152 151 153 isDistributed_ = !ibegin.isEmpty() || ! iend.isEmpty() || !ni.isEmpty() || !jbegin.isEmpty() || !jend.isEmpty() || !nj.isEmpty();152 isDistributed_ = !ibegin.isEmpty() || !ni.isEmpty() || !jbegin.isEmpty() || !nj.isEmpty(); 154 153 155 154 checkLocalIDomain(); 156 155 checkLocalJDomain(); 157 156 158 ibegin_client = ibegin; iend_client = iend; ni_client = ni;159 jbegin_client = jbegin; jend_client = jend; nj_client = nj;157 ibegin_client = ibegin; ni_client = ni; iend_client = ibegin + ni - 1; 158 jbegin_client = jbegin; nj_client = nj; jend_client = jbegin + nj - 1; 160 159 161 160 if (i_index.isEmpty()) 162 161 { 163 i_index.resize(ni ,nj);164 for (int j = 0; j < nj; j++)165 for (int i = 0; i < ni; i++) i_index(i,j) = i;162 i_index.resize(ni*nj); 163 for (int j = 0; j < nj; ++j) 164 for (int i = 0; i < ni; ++i) i_index(i+j*ni) = i+ibegin; 166 165 } 167 166 168 167 if (j_index.isEmpty()) 169 168 { 170 j_index.resize(ni,nj); 171 for (int j = 0; j < nj; j++) 172 for (int i = 0; i < ni; i++) j_index(i,j) = j; 173 } 169 j_index.resize(ni*nj); 170 for (int j = 0; j < nj; ++j) 171 for (int i = 0; i < ni; ++i) j_index(i+j*ni) = j+jbegin; 172 } 173 computeNGlobDomain(); 174 174 } 175 175 … … 178 178 void CDomain::checkLocalIDomain(void) 179 179 { 180 if (!ni.isEmpty() && !ibegin.isEmpty() && iend.isEmpty()) 181 iend.setValue(ibegin.getValue() + ni.getValue() - 1); 182 else if (!ni.isEmpty() && !iend.isEmpty() && ibegin.isEmpty()) 183 ibegin.setValue(iend.getValue() - ni.getValue() + 1); 184 else if (!ibegin.isEmpty() && !iend.isEmpty() && ni.isEmpty()) 185 ni.setValue(iend.getValue() - ibegin.getValue() + 1); 186 else if (!ibegin.isEmpty() && !iend.isEmpty() && !ni.isEmpty()) 187 { 188 if (iend.getValue() != ibegin.getValue() + ni.getValue() - 1) 189 ERROR("CDomain::checkLocalIDomain(void)", 190 << "[ Id = " << this->getId() << " ] " 191 << "The local domain is wrongly defined," 192 << " iend is different from (ibegin + ni - 1)"); 193 } 194 else if (ibegin.isEmpty() && iend.isEmpty() && ni.isEmpty()) 180 if (ibegin.isEmpty() && ni.isEmpty()) 195 181 { 196 182 ibegin = 0; 197 iend = ni_glo - 1;198 183 ni = ni_glo; 199 184 } 200 else 185 else if (!i_index.isEmpty()) 186 { 187 ibegin = i_index(0); 188 } 189 190 if (ni.getValue() < 0 || ibegin.getValue() < 0 || 191 (ibegin.getValue() + ni.getValue()) > ni_glo.getValue()) 201 192 { 202 193 ERROR("CDomain::checkLocalIDomain(void)", 203 194 << "[ Id = " << this->getId() << " ] " 204 195 << "The local domain is wrongly defined," 205 << " defining just one attribute among 'ibegin', 'iend' or 'ni' is invalid"); 206 } 207 208 if (ni.getValue() < 0 || ibegin.getValue() > iend.getValue() || 209 ibegin.getValue() < 0 || iend.getValue() > (ni_glo.getValue() - 1)) 210 { 211 ERROR("CDomain::checkLocalIDomain(void)", 212 << "[ Id = " << this->getId() << " ] " 213 << "The local domain is wrongly defined," 214 << " check the attributes 'ni_glo', 'ni', 'ibegin' and 'iend'"); 215 } 216 } 217 218 //---------------------------------------------------------------- 219 196 << " check the attributes 'ni_glo', 'ni' and 'ibegin'"); 197 } 198 } 199 200 //---------------------------------------------------------------- 220 201 void CDomain::checkLocalJDomain(void) 221 202 { 222 if (!nj.isEmpty() && !jbegin.isEmpty() && jend.isEmpty()) 223 jend.setValue(jbegin.getValue() + nj.getValue() - 1); 224 else if (!nj.isEmpty() && !jend.isEmpty() && jbegin.isEmpty()) 225 jbegin.setValue(jend.getValue() - nj.getValue() + 1); 226 else if (!jbegin.isEmpty() && !jend.isEmpty() && nj.isEmpty()) 227 nj.setValue(jend.getValue() - jbegin.getValue() + 1); 228 else if (!jbegin.isEmpty() && !jend.isEmpty() && !nj.isEmpty()) 229 { 230 if (jend.getValue() != jbegin.getValue() + nj.getValue() - 1) 231 ERROR("CDomain::checkLocalJDomain(void)", 232 << "[ Id = " << this->getId() << " ] " 233 << "The local domain is wrongly defined," 234 << " jend is different from (jbegin + nj - 1)"); 235 } 236 else if (jbegin.isEmpty() && jend.isEmpty() && nj.isEmpty()) 237 { 238 jbegin = 0; 239 jend = nj_glo - 1; 240 nj = nj_glo; 241 } 242 else 203 if (jbegin.isEmpty() && nj.isEmpty()) 204 { 205 jbegin = 0; 206 nj = nj_glo; 207 } 208 else if (!j_index.isEmpty()) 209 { 210 jbegin = j_index(0); 211 } 212 213 if (nj.getValue() < 0 || jbegin.getValue() < 0 || 214 (jbegin.getValue() + nj.getValue()) > nj_glo.getValue()) 243 215 { 244 216 ERROR("CDomain::checkLocalJDomain(void)", 245 217 << "[ Id = " << this->getId() << " ] " 246 218 << "The local domain is wrongly defined," 247 << " defining just one attribute among 'jbegin', 'jend' or 'nj' is invalid"); 248 } 249 250 if (nj.getValue() < 0 || jbegin.getValue() > jend.getValue() || 251 jbegin.getValue() < 0 || jend.getValue() > (nj_glo.getValue() - 1)) 252 { 253 ERROR("CDomain::checkLocalJDomain(void)", 254 << "[ Id = " << this->getId() << " ] " 255 << "The local domain is wrongly defined," 256 << " check the attributes 'nj_glo', 'nj', 'jbegin' and 'jend'"); 257 } 258 } 259 260 //---------------------------------------------------------------- 261 219 << " check the attributes 'nj_glo', 'nj' and 'jbegin'"); 220 } 221 } 222 223 //---------------------------------------------------------------- 262 224 void CDomain::checkMask(void) 263 225 { … … 266 228 int ibegin_mask = 0, 267 229 jbegin_mask = 0, 268 iend_mask = iend.getValue() - ibegin.getValue(), 269 jend_mask = jend.getValue() - jbegin.getValue(); 270 271 if (!zoom_ibegin.isEmpty()) 272 { 273 int zoom_iend = zoom_ibegin.getValue() + zoom_ni.getValue() - 1; 274 int zoom_jend = zoom_jbegin.getValue() + zoom_nj.getValue() - 1; 275 276 ibegin_mask = max (ibegin.getValue(), zoom_ibegin.getValue()); 277 jbegin_mask = max (jbegin.getValue(), zoom_jbegin.getValue()); 278 iend_mask = min (iend.getValue(), zoom_iend); 279 jend_mask = min (jend.getValue(), zoom_jend); 280 281 ibegin_mask -= ibegin.getValue(); 282 jbegin_mask -= jbegin.getValue(); 283 iend_mask -= ibegin.getValue(); 284 jend_mask -= jbegin.getValue(); 285 } 286 230 iend_mask = ibegin.getValue() + ni.getValue() - 1, 231 jend_mask = jbegin.getValue() + nj.getValue() - 1; 232 233 if (!mask_1D.isEmpty() && !mask_2D.isEmpty()) 234 ERROR("CDomain::checkMask(void)", 235 <<"Only one mask is used but both mask_1D and mask_2D are defined! "<<endl 236 <<"Define only one mask: mask_1D or mask_2D "); 237 238 if (!mask_1D.isEmpty() && mask_2D.isEmpty()) 239 { 240 if (mask_1D.numElements() != i_index.numElements()) 241 ERROR("CDomain::checkMask(void)", 242 <<"the mask_1D has not the same size than the local domain"<<endl 243 <<"Local size is "<<i_index.numElements()<<endl 244 <<"Mask size is "<<mask_1D.numElements()); 245 } 246 247 if (mask_1D.isEmpty() && !mask_2D.isEmpty()) 248 { 249 if ((mask_2D.extent(0) != ni) || 250 (mask_2D.extent(1) != nj)) 251 ERROR("CDomain::checkMask(void)", 252 <<"the mask has not the same size than the local domain"<<endl 253 <<"Local size is "<<ni<<"x"<<nj<<endl 254 <<"Mask size is "<<mask.extent(0)<<"x"<<mask.extent(1)); 255 } 256 257 if (!mask_1D.isEmpty()) 258 { 259 maskInter_.resize(mask_1D.numElements()); 260 maskInter_ = mask_1D; 261 } 262 else if (!mask_2D.isEmpty()) 263 { 264 maskInter_.resize(mask_2D.extent(0) * mask_2D.extent(0)); 265 for (int j = 0; j < nj; ++j) 266 for (int i = 0; i < ni; ++i) maskInter_(i+j*ni) = mask_2D(i,j); 267 } 268 else 269 { 270 maskInter_.resize(i_index.numElements()); 271 for (int i = 0; i < i_index.numElements(); ++i) maskInter_(i) = true; 272 } 273 274 if (!mask.isEmpty()) 275 { 276 maskInter_.resize(mask.extent(0) * mask.extent(1)); 277 for (int j = 0; j < nj; ++j) 278 for (int i = 0; i < ni; ++i) maskInter_(i+j*ni) = mask(i,j); 279 } 280 else 281 { 282 maskInter_.resize(ni*nj); 283 for (int i = 0; i < maskInter_.numElements(); ++i) maskInter_(i) = true; 284 } 287 285 288 286 if (!mask.isEmpty()) … … 294 292 <<"Local size is "<<ni<<"x"<<nj<<endl 295 293 <<"Mask size is "<<mask.extent(0)<<"x"<<mask.extent(1)); 296 for (int i = 0; i < ni; i++)297 {298 for (int j = 0; j < nj; j++)299 {300 if (i < ibegin_mask && i > iend_mask &&301 j < jbegin_mask && j > jend_mask )302 mask(i,j) = false;303 }304 }294 // for (int i = 0; i < ni; i++) 295 // { 296 // for (int j = 0; j < nj; j++) 297 // { 298 // if (i < ibegin_mask && i > iend_mask && 299 // j < jbegin_mask && j > jend_mask ) 300 // mask(i,j) = false; 301 // } 302 // } 305 303 } 306 304 else // (!mask.hasValue()) … … 520 518 void CDomain::checkZoom(void) 521 519 { 522 // Résolution et vérification des données globales de zoom.523 if (!this->zoom_ni.isEmpty() || !this->zoom_nj.isEmpty() ||524 !this->zoom_ibegin.isEmpty() || !this->zoom_jbegin.isEmpty())525 {526 if (this->zoom_ni.isEmpty() || this->zoom_nj.isEmpty() ||527 this->zoom_ibegin.isEmpty() || this->zoom_jbegin.isEmpty())528 {529 ERROR("CDomain::checkZoom(void)",530 <<"if one of zoom attributes is defined then all zoom attributes must be defined") ;531 }532 else533 {534 int zoom_iend = zoom_ibegin + zoom_ni - 1;535 int zoom_jend = zoom_jbegin + zoom_nj - 1;536 537 if (zoom_ibegin < 0 || zoom_jbegin < 0 || zoom_iend > (ni_glo-1) || zoom_jend > (nj_glo-1))538 ERROR("CDomain::checkZoom(void)",539 << "Zoom is wrongly defined,"540 << " Check the values : zoom_ni, zoom_nj, zoom_ibegin, zoom_jbegin") ;541 }542 }543 else544 {545 zoom_ni = ni_glo;546 zoom_nj = nj_glo;547 zoom_ibegin = 0;548 zoom_jbegin = 0;549 }550 551 520 // compute client zoom indices 552 521 // compute client zoom indices … … 594 563 } 595 564 565 // void CDomain::checkAttributesOnClientBeforeTransformation() 566 // { 567 // if (this->isClientBeforeTransformationChecked) return; 568 // CContext* context=CContext::getCurrent(); 569 // 570 // this->checkDomain(); 571 // this->checkBounds(); 572 // this->checkArea(); 573 // 574 // if (context->hasClient) 575 // { 576 // this->checkDomainData(); 577 // this->checkCompression(); 578 // } 579 // 580 // this->isClientBeforeTransformationChecked = true; 581 // } 582 583 void CDomain::checkAttributesOnClientAfterTransformation() 584 { 585 CContext* context=CContext::getCurrent() ; 586 587 this->checkZoom(); 588 if (this->isClientAfterTransformationChecked) return; 589 if (context->hasClient) 590 { 591 this->checkMask(); 592 this->computeConnectedServer(); 593 this->completeLonLatClient(); 594 } 595 596 this->isClientAfterTransformationChecked = true; 597 } 598 596 599 //---------------------------------------------------------------- 597 600 // Divide function checkAttributes into 2 seperate ones … … 625 628 { 626 629 if (!this->isClientChecked) checkAttributesOnClient(); 630 if (!this->isClientAfterTransformationChecked) checkAttributesOnClientAfterTransformation(); 627 631 CContext* context=CContext::getCurrent() ; 628 632 … … 631 635 if (context->hasClient) 632 636 { 633 this->computeConnectedServer();634 this->completeLonLatClient();637 // this->computeConnectedServer(); 638 // this->completeLonLatClient(); 635 639 636 640 sendServerAttribut() ; … … 676 680 void CDomain::sendServerAttribut(void) 677 681 { 678 std::vector<int> nGlobDomain(2); 679 nGlobDomain[0] = ni_glo.getValue(); 680 nGlobDomain[1] = nj_glo.getValue(); 681 CServerDistributionDescription serverDescription(nGlobDomain); 682 CServerDistributionDescription serverDescription(nGlobDomain_); 682 683 683 684 CContext* context = CContext::getCurrent(); … … 685 686 int nbServer = client->serverSize; 686 687 687 serverDescription.computeServerDistribution(nbServer); 688 if (isUnstructed_) serverDescription.computeServerDistribution(nbServer,0); 689 else serverDescription.computeServerDistribution(nbServer,1); 690 688 691 std::vector<std::vector<int> > serverIndexBegin = serverDescription.getServerIndexBegin(); 689 692 std::vector<std::vector<int> > serverDimensionSizes = serverDescription.getServerDimensionSizes(); … … 718 721 } 719 722 723 void CDomain::computeNGlobDomain() 724 { 725 nGlobDomain_.resize(2); 726 nGlobDomain_[0] = ni_glo.getValue(); 727 nGlobDomain_[1] = nj_glo.getValue(); 728 } 729 720 730 void CDomain::computeConnectedServer(void) 721 731 { 722 ibegin_client=ibegin ; iend_client=iend ; ni_client=ni;723 jbegin_client=jbegin ; jend_client=jend ; nj_client=nj;732 ibegin_client=ibegin; ni_client=ni; iend_client=ibegin_client + ni_client - 1; 733 jbegin_client=jbegin; nj_client=nj; jend_client=jbegin_client + nj_client - 1; 724 734 725 735 CContext* context=CContext::getCurrent() ; … … 728 738 bool doComputeGlobalIndexServer = true; 729 739 730 int i,j,i_ind,j_ind 740 int i,j,i_ind,j_ind, nbIndex; 731 741 int zoom_iend=global_zoom_ibegin+global_zoom_ni-1 ; 732 742 int zoom_jend=global_zoom_jbegin+global_zoom_nj-1 ; … … 734 744 // Precompute number of index 735 745 int globalIndexCountZoom = 0; 736 for(j=0;j<nj;j++)737 for(i=0;i<ni;i++)738 739 i_ind=ibegin+i_index(i,j);740 j_ind=jbegin+j_index(i,j);741 742 743 744 745 746 746 nbIndex = i_index.numElements(); 747 for (i = 0; i < nbIndex; ++i) 748 { 749 i_ind=i_index(i); 750 j_ind=j_index(i); 751 752 if (i_ind >= global_zoom_ibegin && i_ind <= zoom_iend && j_ind >= global_zoom_jbegin && j_ind <= zoom_jend) 753 { 754 ++globalIndexCountZoom; 755 } 756 } 747 757 748 758 // Fill in index 749 759 CArray<size_t,1> globalIndexDomainZoom(globalIndexCountZoom); 750 CArray<size_t,1> globalIndexDomain(ni*nj); 760 CArray<size_t,1> localIndexDomainZoom(globalIndexCountZoom); 761 CArray<size_t,1> globalIndexDomain(nbIndex); 751 762 size_t globalIndex; 752 763 int globalIndexCount = 0; 753 764 globalIndexCountZoom = 0; 754 765 755 for(j=0;j<nj;j++) 756 for(i=0;i<ni;i++) 757 { 758 i_ind=ibegin+i_index(i,j) ; 759 j_ind=jbegin+j_index(i,j) ; 760 761 globalIndex = i_ind + j_ind * ni_glo; 762 globalIndexDomain(globalIndexCount) = globalIndex; 763 ++globalIndexCount; 764 if (i_ind >= global_zoom_ibegin && i_ind <= zoom_iend && j_ind >= global_zoom_jbegin && j_ind <= zoom_jend) 765 { 766 globalIndexDomainZoom(globalIndexCountZoom) = globalIndex; 767 ++globalIndexCountZoom; 768 } 769 } 770 771 std::vector<int> nGlobDomain(2); 772 nGlobDomain[0] = ni_glo.getValue(); 773 nGlobDomain[1] = nj_glo.getValue(); 766 for (i = 0; i < nbIndex; ++i) 767 { 768 i_ind=i_index(i); 769 j_ind=j_index(i); 770 globalIndex = i_ind + j_ind * ni_glo; 771 globalIndexDomain(globalIndexCount) = globalIndex; 772 ++globalIndexCount; 773 if (i_ind >= global_zoom_ibegin && i_ind <= zoom_iend && j_ind >= global_zoom_jbegin && j_ind <= zoom_jend) 774 { 775 globalIndexDomainZoom(globalIndexCountZoom) = globalIndex; 776 localIndexDomainZoom(globalIndexCountZoom) = i; 777 ++globalIndexCountZoom; 778 } 779 } 780 774 781 size_t globalSizeIndex = 1, indexBegin, indexEnd; 775 782 int range, clientSize = client->clientSize; 776 for (int i = 0; i < nGlobDomain .size(); ++i) globalSizeIndex *= nGlobDomain[i];783 for (int i = 0; i < nGlobDomain_.size(); ++i) globalSizeIndex *= nGlobDomain_[i]; 777 784 indexBegin = 0; 778 785 for (int i = 0; i < clientSize; ++i) … … 785 792 indexEnd = indexBegin + range - 1; 786 793 787 CServerDistributionDescription serverDescription(nGlobDomain); 788 serverDescription.computeServerGlobalIndexInRange(nbServer, std::make_pair<size_t,size_t>(indexBegin, indexEnd)); 794 CServerDistributionDescription serverDescription(nGlobDomain_); 795 if (isUnstructed_) serverDescription.computeServerGlobalIndexInRange(nbServer, std::make_pair<size_t,size_t>(indexBegin, indexEnd), 0); 796 else serverDescription.computeServerGlobalIndexInRange(nbServer, std::make_pair<size_t,size_t>(indexBegin, indexEnd), 1); 797 789 798 CClientServerMapping* clientServerMap = new CClientServerMappingDistributed(serverDescription.getGlobalIndexRange(), 790 799 client->intraComm); … … 805 814 if (iteVec != std::find(itbVec, iteVec, globalIndexDomainZoom(i))) 806 815 { 807 indSrv_[rank].push_back( globalIndexDomainZoom(i));816 indSrv_[rank].push_back(localIndexDomainZoom(i)); 808 817 } 809 818 } … … 824 833 825 834 delete clientServerMap; 835 } 836 837 const std::map<int, vector<size_t> >& CDomain::getIndexServer() const 838 { 839 return indSrv_; 826 840 } 827 841 … … 871 885 CArray<double,1>& lon = list_lon.back(); 872 886 CArray<double,1>& lat = list_lat.back(); 873 887 const std::vector<size_t>& temp = it->second; 874 888 for (n = 0; n < nbData; ++n) 875 889 { 876 890 idx = static_cast<int>(it->second[n]); 877 i = idx % ni_glo; 878 j = idx / ni_glo; 879 ind = (i - zoom_ibegin_client) + (j - zoom_jbegin_client) * zoom_ni_client; 891 i = i_index(idx); 892 j = j_index(idx); 893 ind = n; 894 // ind = (i - zoom_ibegin_client) + (j - zoom_jbegin_client) * zoom_ni_client; 880 895 881 896 lon(n) = lonvalue(ind); … … 894 909 } 895 910 896 indi(n) = i begin + i_index(i - ibegin, j - jbegin);897 indj(n) = j begin + j_index(i - ibegin, j - jbegin);911 indi(n) = i; 912 indj(n) = j; 898 913 899 914 if (hasArea) … … 1192 1207 StdString zoomDomainDefRoot("zoom_domain_definition"); 1193 1208 StdString zoom("zoom_domain"); 1209 StdString interpFromFileDomainDefRoot("interpolate_from_file_domain_definition"); 1210 StdString interpFromFile("interpolate_from_file_domain"); 1194 1211 do 1195 1212 { … … 1199 1216 transformationMap_.push_back(std::make_pair(TRANS_ZOOM_DOMAIN,tmp)); 1200 1217 } 1218 else if (node.getElementName() == interpFromFile) 1219 { 1220 CInterpolateFromFileDomain* tmp = (CInterpolateFromFileDomainGroup::get(interpFromFileDomainDefRoot))->createChild(); 1221 tmp->parse(node); 1222 transformationMap_.push_back(std::make_pair(TRANS_INTERPOLATE_DOMAIN_FROM_FILE,tmp)); 1223 } 1201 1224 } while (node.goToNextElement()) ; 1202 1225 node.goToParentElement();
Note: See TracChangeset
for help on using the changeset viewer.