Changeset 1345
- Timestamp:
- 11/24/17 15:13:47 (7 years ago)
- Location:
- XIOS/dev/XIOS_DEV_CMIP6/src/node
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/XIOS_DEV_CMIP6/src/node/axis.cpp
r1337 r1345 26 26 , transformationMap_(), hasValue(false), hasLabel(false) 27 27 , computedWrittenIndex_(false) 28 , clients() 28 29 { 29 30 } … … 37 38 , transformationMap_(), hasValue(false), hasLabel(false) 38 39 , computedWrittenIndex_(false) 40 , clients() 39 41 { 40 42 } … … 839 841 CServerDistributionDescription::ServerDistributionType distType) 840 842 { 841 CContext* context = CContext::getCurrent(); 842 843 int nbSrvPools = (context->hasServer) ? (context->hasClient ? context->clientPrimServer.size() : 0) : 1; 844 for (int i = 0; i < nbSrvPools; ++i) 845 { 846 CContextClient* contextClientTmp = (context->hasServer) ? context->clientPrimServer[i] 847 : context->client; 848 int nbServer = contextClientTmp->serverSize; 843 std::set<CContextClient*>::iterator it; 844 for (it=clients.begin(); it!=clients.end(); ++it) 845 { 846 CContextClient* client = *it; 847 int nbServer = client->serverSize; 849 848 850 849 CServerDistributionDescription serverDescription(globalDim, nbServer); … … 855 854 856 855 CEventClient event(getType(),EVENT_ID_DISTRIBUTION_ATTRIBUTE); 857 if (c ontextClientTmp->isServerLeader())856 if (client->isServerLeader()) 858 857 { 859 858 std::list<CMessage> msgs; 860 859 861 const std::list<int>& ranks = c ontextClientTmp->getRanksServerLeader();860 const std::list<int>& ranks = client->getRanksServerLeader(); 862 861 for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank) 863 862 { … … 875 874 event.push(*itRank,1,msg); 876 875 } 877 c ontextClientTmp->sendEvent(event);878 } 879 else c ontextClientTmp->sendEvent(event);876 client->sendEvent(event); 877 } 878 else client->sendEvent(event); 880 879 } 881 880 } … … 960 959 void CAxis::sendNonDistributedAttributes() 961 960 { 962 CContext* context = CContext::getCurrent(); 963 964 int nbSrvPools = (context->hasServer) ? (context->hasClient ? context->clientPrimServer.size() : 1) : 1; 965 for (int p = 0; p < nbSrvPools; ++p) 966 { 967 CContextClient* client = (0 != context->clientPrimServer.size()) ? context->clientPrimServer[p] : context->client; 961 std::set<CContextClient*>::iterator it; 962 for (it=clients.begin(); it!=clients.end(); ++it) 963 { 964 CContextClient* client = *it; 968 965 969 966 CEventClient event(getType(), EVENT_ID_NON_DISTRIBUTED_ATTRIBUTES); … … 1086 1083 { 1087 1084 int ns, n, i, j, ind, nv, idx; 1088 CContext* context = CContext::getCurrent(); 1089 1090 int nbSrvPools = (context->hasServer) ? (context->hasClient ? context->clientPrimServer.size() : 1) : 1; 1091 for (int p = 0; p < nbSrvPools; ++p) 1092 { 1093 CContextClient* client = (0 != context->clientPrimServer.size()) ? context->clientPrimServer[p] : context->client; 1085 std::set<CContextClient*>::iterator it; 1086 1087 for (it=clients.begin(); it!=clients.end(); ++it) 1088 { 1089 CContextClient* client = *it; 1094 1090 int nbServer = client->serverSize; 1095 1091 … … 1442 1438 } 1443 1439 1440 void CAxis::setContextClient(CContextClient* contextClient) 1441 { 1442 clients.insert(contextClient); 1443 } 1444 1444 1445 void CAxis::parse(xml::CXMLNode & node) 1445 1446 { -
XIOS/dev/XIOS_DEV_CMIP6/src/node/axis.hpp
r1337 r1345 94 94 virtual void parse(xml::CXMLNode & node); 95 95 96 void setContextClient(CContextClient* contextClient); 97 96 98 /// Accesseurs statiques /// 97 99 static StdString GetName(void); … … 150 152 151 153 private: 154 155 /** Clients that have to send a domain. There can be multiple clients in case of secondary server, otherwise only one client. */ 156 std::set<CContextClient*> clients; 157 152 158 bool isChecked; 153 159 bool areClientAttributesChecked_; -
XIOS/dev/XIOS_DEV_CMIP6/src/node/domain.cpp
r1337 r1345 33 33 , lonvalue(), latvalue(), bounds_lonvalue(), bounds_latvalue() 34 34 , globalLocalIndexMap_(), computedWrittenIndex_(false) 35 , clients() 35 36 { 36 37 } … … 44 45 , lonvalue(), latvalue(), bounds_lonvalue(), bounds_latvalue() 45 46 , globalLocalIndexMap_(), computedWrittenIndex_(false) 47 , clients() 46 48 { 47 49 } … … 2065 2067 { 2066 2068 int ns, n, i, j, ind, nv, idx; 2067 CContext* context = CContext::getCurrent(); 2068 2069 // int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1; 2070 int nbSrvPools = (context->hasServer) ? (context->hasClient ? context->clientPrimServer.size() : 0) : 1; 2071 for (int p = 0; p < nbSrvPools; ++p) 2069 std::set<CContextClient*>::iterator it; 2070 for (it=clients.begin(); it!=clients.end(); ++it) 2072 2071 { 2073 CContextClient* client = (0 != context->clientPrimServer.size()) ? context->clientPrimServer[p] : context->client; 2072 CContextClient* client = *it; 2073 2074 2074 int serverSize = client->serverSize; 2075 2075 CEventClient eventIndex(getType(), EVENT_ID_INDEX); … … 2115 2115 void CDomain::sendDistributionAttributes(void) 2116 2116 { 2117 CContext* context = CContext::getCurrent(); 2118 // Use correct context client to send message 2119 // int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1; 2120 int nbSrvPools = (context->hasServer) ? (context->hasClient ? context->clientPrimServer.size() : 0) : 1; 2121 for (int i = 0; i < nbSrvPools; ++i) 2117 std::set<CContextClient*>::iterator it; 2118 for (it=clients.begin(); it!=clients.end(); ++it) 2122 2119 { 2123 CContextClient* contextClientTmp = (context->hasServer) ? context->clientPrimServer[i] 2124 : context->client; 2125 int nbServer = contextClientTmp->serverSize; 2120 CContextClient* client = *it; 2121 int nbServer = client->serverSize; 2126 2122 std::vector<int> nGlobDomain(2); 2127 2123 nGlobDomain[0] = this->ni_glo; … … 2136 2132 2137 2133 CEventClient event(getType(),EVENT_ID_SERVER_ATTRIBUT); 2138 if (c ontextClientTmp->isServerLeader())2134 if (client->isServerLeader()) 2139 2135 { 2140 2136 std::list<CMessage> msgs; 2141 2137 2142 const std::list<int>& ranks = c ontextClientTmp->getRanksServerLeader();2138 const std::list<int>& ranks = client->getRanksServerLeader(); 2143 2139 for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank) 2144 2140 { … … 2158 2154 event.push(*itRank,1,msg); 2159 2155 } 2160 c ontextClientTmp->sendEvent(event);2161 } 2162 else c ontextClientTmp->sendEvent(event);2156 client->sendEvent(event); 2157 } 2158 else client->sendEvent(event); 2163 2159 } 2164 2160 } … … 2170 2166 { 2171 2167 int ns, n, i, j, ind, nv, idx; 2172 CContext* context = CContext::getCurrent(); 2173 2174 // int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1; 2175 int nbSrvPools = (context->hasServer) ? (context->hasClient ? context->clientPrimServer.size() : 0) : 1; 2176 for (int p = 0; p < nbSrvPools; ++p) 2168 std::set<CContextClient*>::iterator it; 2169 for (it=clients.begin(); it!=clients.end(); ++it) 2177 2170 { 2178 CContextClient* client = (0 != context->clientPrimServer.size()) ? context->clientPrimServer[p] : context->client;2171 CContextClient* client = *it; 2179 2172 int serverSize = client->serverSize; 2180 2173 … … 2219 2212 2220 2213 int ns, n, i, j, ind, nv, idx; 2221 CContext* context = CContext::getCurrent(); 2222 2223 // int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1; 2224 int nbSrvPools = (context->hasServer) ? (context->hasClient ? context->clientPrimServer.size() : 0) : 1; 2225 for (int p = 0; p < nbSrvPools; ++p) 2214 std::set<CContextClient*>::iterator it; 2215 2216 for (it=clients.begin(); it!=clients.end(); ++it) 2226 2217 { 2227 CContextClient* client = (0 != context->clientPrimServer.size()) ? context->clientPrimServer[p] : context->client;2218 CContextClient* client = *it; 2228 2219 int serverSize = client->serverSize; 2229 2220 … … 2271 2262 2272 2263 int ns, n, i, j, ind, nv, idx; 2273 CContext* context = CContext::getCurrent(); 2274 2275 // int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1; 2276 int nbSrvPools = (context->hasServer) ? (context->hasClient ? context->clientPrimServer.size() : 0) : 1; 2277 for (int p = 0; p < nbSrvPools; ++p) 2264 std::set<CContextClient*>::iterator it; 2265 for (it=clients.begin(); it!=clients.end(); ++it) 2278 2266 { 2279 CContextClient* client = (0 != context->clientPrimServer.size()) ? context->clientPrimServer[p] : context->client;2267 CContextClient* client = *it; 2280 2268 int serverSize = client->serverSize; 2281 2269 … … 2368 2356 { 2369 2357 int ns, n, i, j, ind, nv, idx; 2370 CContext* context = CContext::getCurrent(); 2371 2372 // int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1; 2373 int nbSrvPools = (context->hasServer) ? (context->hasClient ? context->clientPrimServer.size() : 0) : 1; 2374 for (int p = 0; p < nbSrvPools; ++p) 2358 std::set<CContextClient*>::iterator it; 2359 for (it=clients.begin(); it!=clients.end(); ++it) 2375 2360 { 2376 CContextClient* client = (0 != context->clientPrimServer.size()) ? context->clientPrimServer[p] : context->client; 2361 CContextClient* client = *it; 2362 2377 2363 int serverSize = client->serverSize; 2378 2364 … … 3128 3114 } 3129 3115 3116 void CDomain::setContextClient(CContextClient* contextClient) 3117 { 3118 clients.insert(contextClient); 3119 } 3120 3130 3121 /*! 3131 3122 Parse children nodes of a domain in xml file. -
XIOS/dev/XIOS_DEV_CMIP6/src/node/domain.hpp
r1337 r1345 71 71 72 72 virtual void parse(xml::CXMLNode & node); 73 74 void setContextClient(CContextClient* contextClient); 73 75 74 76 /// Vérifications /// … … 199 201 200 202 private: 203 204 /** Clients that have to send a domain. There can be multiple clients in case of secondary server, otherwise only one client. */ 205 std::set<CContextClient*> clients; 206 201 207 bool doZoomByIndex_; 202 208 bool isChecked, computedWrittenIndex_; -
XIOS/dev/XIOS_DEV_CMIP6/src/node/grid.cpp
r1340 r1345 2509 2509 { 2510 2510 clients.insert(contextClient); 2511 for (int i=0; i<this->getDomains().size(); i++) 2512 this->getDomains()[i]->setContextClient(contextClient); 2513 for (int i=0; i<this->getAxis().size(); i++) 2514 this->getAxis()[i]->setContextClient(contextClient); 2511 2515 } 2512 2516
Note: See TracChangeset
for help on using the changeset viewer.