- Timestamp:
- 11/26/14 15:12:12 (10 years ago)
- Location:
- XIOS/trunk/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/buffer_client.cpp
r512 r518 19 19 interComm=interComm_ ; 20 20 serverRank=serverRank_ ; 21 bufferSize=bufferSizeByServer /2; //2 ;21 bufferSize=bufferSizeByServer; //2 ; 22 22 buffer[0]=new char[bufferSize] ; // transform it with MPI_ALLOC_MEM later 23 23 buffer[1]=new char[bufferSize] ; -
XIOS/trunk/src/buffer_server.cpp
r509 r518 9 9 CServerBuffer::CServerBuffer(StdSize buffSize) 10 10 { 11 bufferSizeByClient= buffSize * CXios::bufferServerFactorSize; //::bufferSize*CXios::bufferServerFactorSize ;11 bufferSizeByClient= buffSize * 2 * CXios::bufferServerFactorSize; //::bufferSize*CXios::bufferServerFactorSize ; 12 12 size=bufferSizeByClient ; 13 13 first=0 ; -
XIOS/trunk/src/node/domain.cpp
r509 r518 750 750 CContextClient* client=context->client ; 751 751 // send lon lat for each connected server 752 CEventClient event(getType(),EVENT_ID_LON_LAT) ; 753 754 list<shared_ptr<CMessage> > list_msg ; 752 753 CEventClient eventLon(getType(),EVENT_ID_LON) ; 754 CEventClient eventLat(getType(),EVENT_ID_LAT) ; 755 756 list<shared_ptr<CMessage> > list_msgLon ; 757 list<shared_ptr<CMessage> > list_msgLat ; 755 758 list< CArray<int,1>* > list_indi,list_indj ; 756 759 list< CArray<double,1>* >list_lon,list_lat ; … … 794 797 if (hasBounds) list_boundslat.push_back(new CArray<double,2>(boundslat.copy())) ; 795 798 796 list_msg.push_back(shared_ptr<CMessage>(new CMessage)) ; 797 798 *list_msg.back()<<this->getId()<<(int)type ; // enum ne fonctionne pour les message => ToFix 799 *list_msg.back()<<isCurvilinear ; 800 *list_msg.back()<<*list_indi.back()<<*list_indj.back()<<*list_lon.back()<<*list_lat.back() ; 801 if (hasBounds) *list_msg.back()<<*list_boundslon.back()<<*list_boundslat.back(); 802 event.push(connectedServer[ns],nbSenders[ns],*list_msg.back()) ; 799 list_msgLon.push_back(shared_ptr<CMessage>(new CMessage)) ; 800 list_msgLat.push_back(shared_ptr<CMessage>(new CMessage)) ; 801 802 *list_msgLon.back()<<this->getId()<<(int)type ; // enum ne fonctionne pour les message => ToFix 803 *list_msgLat.back()<<this->getId()<<(int)type ; 804 *list_msgLon.back()<<isCurvilinear ; 805 *list_msgLat.back()<<isCurvilinear ; 806 *list_msgLon.back()<<*list_indi.back()<<*list_indj.back()<<*list_lon.back() ; 807 *list_msgLat.back()<<*list_indi.back()<<*list_indj.back()<<*list_lat.back() ; 808 809 if (hasBounds) 810 { 811 *list_msgLon.back()<<*list_boundslon.back(); 812 *list_msgLat.back()<<*list_boundslat.back(); 813 } 814 eventLon.push(connectedServer[ns],nbSenders[ns],*list_msgLon.back()) ; 815 eventLat.push(connectedServer[ns],nbSenders[ns],*list_msgLat.back()) ; 803 816 } 804 817 805 client->sendEvent(event) ; 818 client->sendEvent(eventLon) ; 819 client->sendEvent(eventLat) ; 806 820 807 821 … … 828 842 return true ; 829 843 break ; 830 case EVENT_ID_LON_LAT : 831 recvLonLat(event) ; 844 case EVENT_ID_LON : 845 recvLon(event) ; 846 return true ; 847 break ; 848 case EVENT_ID_LAT : 849 recvLat(event) ; 832 850 return true ; 833 851 break ; … … 882 900 } 883 901 884 void CDomain::recvLon Lat(CEventServer& event)902 void CDomain::recvLon(CEventServer& event) 885 903 { 886 904 list<CEventServer::SSubEvent>::iterator it ; … … 890 908 string domainId ; 891 909 *buffer>>domainId ; 892 get(domainId)->recvLon Lat(*buffer) ;910 get(domainId)->recvLon(*buffer) ; 893 911 } 894 912 } 895 913 896 void CDomain::recvLon Lat(CBufferIn& buffer)914 void CDomain::recvLon(CBufferIn& buffer) 897 915 { 898 916 CArray<int,1> indi ; 899 917 CArray<int,1> indj ; 900 918 CArray<double,1> lon ; 901 CArray<double,1> lat ;902 919 CArray<double,2> boundslon ; 903 CArray<double,2> boundslat ;904 920 905 921 int type_int ; 906 buffer>>type_int>>isCurvilinear>>indi>>indj>>lon >>lat;907 if (hasBounds) buffer>>boundslon >>boundslat;922 buffer>>type_int>>isCurvilinear>>indi>>indj>>lon ; 923 if (hasBounds) buffer>>boundslon ; 908 924 type.setValue((type_attr::t_enum)type_int) ; // probleme des type enum avec les buffers : ToFix 909 925 … … 914 930 ind_srv=(i-(zoom_ibegin_srv-1))+(j-(zoom_jbegin_srv-1))*zoom_ni_srv ; 915 931 lonvalue_srv(ind_srv)=lon(ind) ; 916 latvalue_srv(ind_srv)=lat(ind) ;917 932 if (hasBounds) 918 933 { … … 920 935 { 921 936 bounds_lon_srv(nv,ind_srv)=boundslon(nv,ind) ; 937 } 938 } 939 } 940 } 941 942 void CDomain::recvLat(CEventServer& event) 943 { 944 list<CEventServer::SSubEvent>::iterator it ; 945 for (it=event.subEvents.begin();it!=event.subEvents.end();++it) 946 { 947 CBufferIn* buffer=it->buffer; 948 string domainId ; 949 *buffer>>domainId ; 950 get(domainId)->recvLat(*buffer) ; 951 } 952 } 953 954 void CDomain::recvLat(CBufferIn& buffer) 955 { 956 CArray<int,1> indi ; 957 CArray<int,1> indj ; 958 CArray<double,1> lat ; 959 CArray<double,2> boundslat ; 960 961 int type_int ; 962 buffer>>type_int>>isCurvilinear>>indi>>indj>>lat ; 963 if (hasBounds) buffer>>boundslat ; 964 type.setValue((type_attr::t_enum)type_int) ; // probleme des type enum avec les buffers : ToFix 965 966 int i,j,ind_srv ; 967 for(int ind=0;ind<indi.numElements();ind++) 968 { 969 i=indi(ind) ; j=indj(ind) ; 970 ind_srv=(i-(zoom_ibegin_srv-1))+(j-(zoom_jbegin_srv-1))*zoom_ni_srv ; 971 latvalue_srv(ind_srv)=lat(ind) ; 972 if (hasBounds) 973 { 974 for(int nv=0;nv<nvertex;nv++) 975 { 922 976 bounds_lat_srv(nv,ind_srv)=boundslat(nv,ind) ; 923 977 } … … 925 979 } 926 980 } 981 // void CDomain::recvLonLat(CEventServer& event) 982 // { 983 // list<CEventServer::SSubEvent>::iterator it ; 984 // for (it=event.subEvents.begin();it!=event.subEvents.end();++it) 985 // { 986 // CBufferIn* buffer=it->buffer; 987 // string domainId ; 988 // *buffer>>domainId ; 989 // get(domainId)->recvLonLat(*buffer) ; 990 // } 991 // } 992 // 993 // void CDomain::recvLonLat(CBufferIn& buffer) 994 // { 995 // CArray<int,1> indi ; 996 // CArray<int,1> indj ; 997 // CArray<double,1> lon ; 998 // CArray<double,1> lat ; 999 // CArray<double,2> boundslon ; 1000 // CArray<double,2> boundslat ; 1001 // 1002 // int type_int ; 1003 // buffer>>type_int>>isCurvilinear>>indi>>indj>>lon>>lat ; 1004 // if (hasBounds) buffer>>boundslon>>boundslat ; 1005 // type.setValue((type_attr::t_enum)type_int) ; // probleme des type enum avec les buffers : ToFix 1006 // 1007 // int i,j,ind_srv ; 1008 // for(int ind=0;ind<indi.numElements();ind++) 1009 // { 1010 // i=indi(ind) ; j=indj(ind) ; 1011 // ind_srv=(i-(zoom_ibegin_srv-1))+(j-(zoom_jbegin_srv-1))*zoom_ni_srv ; 1012 // lonvalue_srv(ind_srv)=lon(ind) ; 1013 // latvalue_srv(ind_srv)=lat(ind) ; 1014 // if (hasBounds) 1015 // { 1016 // for(int nv=0;nv<nvertex;nv++) 1017 // { 1018 // bounds_lon_srv(nv,ind_srv)=boundslon(nv,ind) ; 1019 // bounds_lat_srv(nv,ind_srv)=boundslat(nv,ind) ; 1020 // } 1021 // } 1022 // } 1023 // } 927 1024 //---------------------------------------------------------------- 928 1025 -
XIOS/trunk/src/node/domain.hpp
r509 r518 37 37 enum EEventId 38 38 { 39 EVENT_ID_SERVER_ATTRIBUT, EVENT_ID_L ON_LAT39 EVENT_ID_SERVER_ATTRIBUT, EVENT_ID_LAT, EVENT_ID_LON 40 40 } ; 41 41 … … 126 126 void computeConnectedServer(void) ; 127 127 static bool dispatchEvent(CEventServer& event) ; 128 static void recvLonLat(CEventServer& event) ; 128 static void recvLat(CEventServer& event) ; 129 static void recvLon(CEventServer& event) ; 129 130 static void recvServerAttribut(CEventServer& event) ; 130 void recvLonLat(CBufferIn& buffer) ; 131 void recvLat(CBufferIn& buffer) ; 132 void recvLon(CBufferIn& buffer) ; 131 133 void recvServerAttribut(CBufferIn& buffer) ; 132 134 -
XIOS/trunk/src/node/field.cpp
r510 r518 969 969 for (; it != itE; ++it) 970 970 { 971 std::cout << "Variable Fields " << (*it)->getId() << std::endl;972 971 this->sendAddVariable((*it)->getId()); 973 972 (*it)->sendAllAttributesToServer(); -
XIOS/trunk/src/node/file.cpp
r517 r518 717 717 for (; it != itE; ++it) 718 718 { 719 std::cout << "Variable Files " << (*it)->getId() << std::endl;720 719 this->sendAddVariable((*it)->getId()); 721 720 (*it)->sendAllAttributesToServer(); … … 840 839 fieldPtr = this->enabledFields[i]; 841 840 if (fieldPtr->name.isEmpty()) fieldPtr->name.setValue(fieldPtr->getBaseFieldReference()->getId()); 842 std::cout << "Enabled Fields " << i << " " << CField::get(fieldPtr)->getId() << std::endl;843 841 this->sendAddField(fieldPtr->getId()); 844 842 fieldPtr->sendAllAttributesToServer(); -
XIOS/trunk/src/node/grid.cpp
r511 r518 171 171 std::map<int, int>::const_iterator it = domConnectedServerSide_.begin(), 172 172 itE = domConnectedServerSide_.end(); 173 std::vector<int> nData = domain->nbDataSrv; 174 std::vector<int>::const_iterator itData = nData.begin(); 173 175 StdSize retVal = StdSize(0.0); 174 for (; it != itE; ++it )176 for (; it != itE; ++it, ++itData) 175 177 { 176 retVal = it->second;178 retVal = (it->second < *itData) ? *itData : it->second; 177 179 if (this->withAxis) retVal *= this->axis->size.getValue(); 178 180 retVal *= sizeof(double); 179 retVal *= 1.2 * CXios::bufferServerFactorSize; // Secure factor181 retVal *= 2.5 * CXios::bufferServerFactorSize; // Secure factor, myterious number 180 182 ret.insert(make_pair(it->first, retVal)); 181 183 }
Note: See TracChangeset
for help on using the changeset viewer.