Changeset 551 for XIOS/trunk/src/node/domain.cpp
- Timestamp:
- 02/11/15 16:23:02 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/node/domain.cpp
r540 r551 109 109 } 110 110 ni=1 ; 111 ibegin= 1;112 iend= 1;111 ibegin=0 ; 112 iend=0 ; 113 113 114 114 } … … 169 169 170 170 if (ni.getValue() < 0 || ibegin.getValue() > iend.getValue() || 171 ibegin.getValue() < 1 || iend.getValue() > ni_glo.getValue())171 ibegin.getValue() < 0 || iend.getValue() > (ni_glo.getValue()-1)) 172 172 { 173 173 … … 207 207 208 208 if (nj.getValue() < 0 || jbegin.getValue() > jend.getValue() || 209 jbegin.getValue() < 1 || jend.getValue() > nj_glo.getValue())209 jbegin.getValue() < 0 || jend.getValue() > (nj_glo.getValue()-1)) 210 210 ERROR("CDomain::checkAttributes(void)", 211 211 << "Domain is wrong defined," … … 488 488 int zoom_jend = zoom_jbegin + zoom_nj - 1; 489 489 490 if (zoom_ibegin < 1 || zoom_jbegin < 1 || zoom_iend > ni_glo || zoom_jend > nj_glo)490 if (zoom_ibegin < 0 || zoom_jbegin < 0 || zoom_iend > (ni_glo-1) || zoom_jend > (nj_glo-1)) 491 491 ERROR("CDomain::checkZoom(void)", 492 492 << "Zoom is wrong defined," … … 498 498 zoom_ni = ni_glo; 499 499 zoom_nj = nj_glo; 500 zoom_ibegin = 1;501 zoom_jbegin = 1;500 zoom_ibegin = 0; 501 zoom_jbegin = 0; 502 502 } 503 503 … … 613 613 { 614 614 int ni_srv=ni_glo.getValue() ; 615 int ibegin_srv= 1;615 int ibegin_srv=0 ; 616 616 int iend_srv=ni_glo.getValue() ; 617 617 … … 625 625 int serverRank=client->getServerLeader() ; 626 626 627 jend_srv=0 ; 627 // jend_srv=0 ; 628 jend_srv= -1 ; 628 629 for(int i=0;i<=serverRank;i++) 629 630 { … … 664 665 int ns=nj_glo%nbServer ; 665 666 int pos=ns*(blockSize+1) ; 667 // int pos=ns*(blockSize) ; 666 668 int serverNum ; 667 669 … … 674 676 for(i=0;i<ni;i++) 675 677 { 676 i_ind=ibegin+i_index(i,j) -1;677 j_ind=jbegin+j_index(i,j) -1;678 i_ind=ibegin+i_index(i,j) ; 679 j_ind=jbegin+j_index(i,j) ; 678 680 679 681 if (j_ind<pos) serverNum=j_ind/(blockSize+1) ; … … 681 683 IsConnected[serverNum]=true ; 682 684 683 if (i_ind >= zoom_ibegin -1 && i_ind <= zoom_iend-1 && j_ind >= zoom_jbegin-1 && j_ind <= zoom_jend-1)685 if (i_ind >= zoom_ibegin && i_ind <= zoom_iend && j_ind >= zoom_jbegin && j_ind <= zoom_jend) 684 686 { 685 687 mapConnectedServer(i,j)=serverNum ; … … 709 711 ns=indServer[mapConnectedServer(i,j)] ; 710 712 mapConnectedServer(i,j)= ns ; 711 i_indSrv[ns].push_back(i+ibegin -1) ;712 j_indSrv[ns].push_back(j+jbegin -1) ;713 i_indSrv[ns].push_back(i+ibegin) ; 714 j_indSrv[ns].push_back(j+jbegin) ; 713 715 } 714 716 } … … 743 745 } 744 746 747 748 // void CDomain::sendLonLat(void) 749 // { 750 // int ns,n,i,j,ind,nv ; 751 // CContext* context = CContext::getCurrent() ; 752 // CContextClient* client=context->client ; 753 // // send lon lat for each connected server 754 // 755 // CEventClient eventLon(getType(),EVENT_ID_LON) ; 756 // CEventClient eventLat(getType(),EVENT_ID_LAT) ; 757 // 758 // list<shared_ptr<CMessage> > list_msgLon ; 759 // list<shared_ptr<CMessage> > list_msgLat ; 760 // list< CArray<int,1>* > list_indi,list_indj ; 761 // list< CArray<double,1>* >list_lon,list_lat ; 762 // list< CArray<double,2>* >list_boundslon,list_boundslat ; 763 // 764 // for(int ns=0;ns<connectedServer.size();ns++) 765 // { 766 // int nbData = nbDataSrv[ns] ; 767 // CArray<int,1> indi(nbData) ; 768 // CArray<int,1> indj(nbData) ; 769 // CArray<double,1> lon(nbData) ; 770 // CArray<double,1> lat(nbData) ; 771 // CArray<double,2> boundslon(nvertex,nbData) ; 772 // CArray<double,2> boundslat(nvertex,nbData) ; 773 // 774 // for(n=0;n<nbData;n++) 775 // { 776 // i=i_indSrv[ns][n] ; 777 // j=j_indSrv[ns][n] ; 778 // ind=(i-(zoom_ibegin_client-1))+(j-(zoom_jbegin_client-1))*zoom_ni_client ; 779 // 780 // lon(n)=lonvalue(ind) ; 781 // lat(n)=latvalue(ind) ; 782 // if (hasBounds) 783 // { 784 // for(nv=0;nv<nvertex;nv++) 785 // { 786 // boundslon(nv,n)=bounds_lon(nv,ind); 787 // boundslat(nv,n)=bounds_lat(nv,ind); 788 // } 789 // } 790 // indi(n)=ibegin+i_index(i-ibegin+1,j-jbegin+1)-1 ; 791 // indj(n)=jbegin+j_index(i-ibegin+1,j-jbegin+1)-1 ; 792 // } 793 // 794 // list_indi.push_back(new CArray<int,1>(indi.copy())) ; 795 // list_indj.push_back(new CArray<int,1>(indj.copy())) ; 796 // list_lon.push_back(new CArray<double,1>(lon.copy())) ; 797 // list_lat.push_back(new CArray<double,1>(lat.copy())) ; 798 // if (hasBounds) list_boundslon.push_back(new CArray<double,2>(boundslon.copy())) ; 799 // if (hasBounds) list_boundslat.push_back(new CArray<double,2>(boundslat.copy())) ; 800 // 801 // list_msgLon.push_back(shared_ptr<CMessage>(new CMessage)) ; 802 // list_msgLat.push_back(shared_ptr<CMessage>(new CMessage)) ; 803 // 804 // *list_msgLon.back()<<this->getId()<<(int)type ; // enum ne fonctionne pour les message => ToFix 805 // *list_msgLat.back()<<this->getId()<<(int)type ; 806 // *list_msgLon.back()<<isCurvilinear ; 807 // *list_msgLat.back()<<isCurvilinear ; 808 // *list_msgLon.back()<<*list_indi.back()<<*list_indj.back()<<*list_lon.back() ; 809 // *list_msgLat.back()<<*list_indi.back()<<*list_indj.back()<<*list_lat.back() ; 810 // 811 // if (hasBounds) 812 // { 813 // *list_msgLon.back()<<*list_boundslon.back(); 814 // *list_msgLat.back()<<*list_boundslat.back(); 815 // } 816 // eventLon.push(connectedServer[ns],nbSenders[ns],*list_msgLon.back()) ; 817 // eventLat.push(connectedServer[ns],nbSenders[ns],*list_msgLat.back()) ; 818 // } 819 // 820 // client->sendEvent(eventLon) ; 821 // client->sendEvent(eventLat) ; 822 // 823 // 824 // for(list<CArray<int,1>* >::iterator it=list_indi.begin();it!=list_indi.end();it++) delete *it; 825 // for(list<CArray<int,1>* >::iterator it=list_indj.begin();it!=list_indj.end();it++) delete *it; 826 // for(list<CArray<double,1>* >::iterator it=list_lon.begin();it!=list_lon.end();it++) delete *it; 827 // for(list<CArray<double,1>* >::iterator it=list_lat.begin();it!=list_lat.end();it++) delete *it; 828 // if (hasBounds) for(list<CArray<double,2>* >::iterator it=list_boundslon.begin();it!=list_boundslon.end();it++) delete *it; 829 // if (hasBounds) for(list<CArray<double,2>* >::iterator it=list_boundslat.begin();it!=list_boundslat.end();it++) delete *it; 830 // 831 // } 745 832 746 833 void CDomain::sendLonLat(void) … … 774 861 i=i_indSrv[ns][n] ; 775 862 j=j_indSrv[ns][n] ; 776 ind=(i-(zoom_ibegin_client-1))+(j-(zoom_jbegin_client-1))*zoom_ni_client ; 863 // ind=(i-(zoom_ibegin_client))+(j-(zoom_jbegin_client-1))*zoom_ni_client ; 864 ind=(i-(zoom_ibegin_client))+(j-(zoom_jbegin_client))*zoom_ni_client ; 777 865 778 866 lon(n)=lonvalue(ind) ; … … 786 874 } 787 875 } 788 indi(n)=ibegin+i_index(i-ibegin+1,j-jbegin+1)-1 ; 789 indj(n)=jbegin+j_index(i-ibegin+1,j-jbegin+1)-1 ; 876 indi(n)=ibegin+i_index(i-ibegin,j-jbegin) ; 877 indj(n)=jbegin+j_index(i-ibegin,j-jbegin) ; 878 // indi(n)=ibegin+i_index(i-ibegin+1,j-jbegin+1)-1 ; 879 // indj(n)=jbegin+j_index(i-ibegin+1,j-jbegin+1)-1 ; 790 880 } 791 881 … … 828 918 829 919 } 830 831 920 832 921 bool CDomain::dispatchEvent(CEventServer& event) … … 884 973 if (zoom_ni_srv<=0 || zoom_nj_srv<=0) 885 974 { 886 zoom_ibegin_srv= 1; zoom_iend_srv=0 ; zoom_ni_srv=0 ;887 zoom_jbegin_srv= 1; zoom_jend_srv=0 ; zoom_nj_srv=0 ;975 zoom_ibegin_srv=0 ; zoom_iend_srv=0 ; zoom_ni_srv=0 ; 976 zoom_jbegin_srv=0 ; zoom_jend_srv=0 ; zoom_nj_srv=0 ; 888 977 } 889 978 lonvalue_srv.resize(zoom_ni_srv*zoom_nj_srv) ; … … 928 1017 { 929 1018 i=indi(ind) ; j=indj(ind) ; 930 ind_srv=(i-(zoom_ibegin_srv -1))+(j-(zoom_jbegin_srv-1))*zoom_ni_srv ;1019 ind_srv=(i-(zoom_ibegin_srv))+(j-(zoom_jbegin_srv))*zoom_ni_srv ; 931 1020 lonvalue_srv(ind_srv)=lon(ind) ; 932 1021 if (hasBounds) … … 968 1057 { 969 1058 i=indi(ind) ; j=indj(ind) ; 970 ind_srv=(i-(zoom_ibegin_srv -1))+(j-(zoom_jbegin_srv-1))*zoom_ni_srv ;1059 ind_srv=(i-(zoom_ibegin_srv))+(j-(zoom_jbegin_srv))*zoom_ni_srv ; 971 1060 latvalue_srv(ind_srv)=lat(ind) ; 972 1061 if (hasBounds)
Note: See TracChangeset
for help on using the changeset viewer.