Ignore:
Timestamp:
11/24/17 15:13:47 (6 years ago)
Author:
oabramkina
Message:

In addition to r1294: all domain/axis attributes are only sent to secondary-server pools that need them (and not to all pools).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/XIOS_DEV_CMIP6/src/node/axis.cpp

    r1337 r1345  
    2626      , transformationMap_(), hasValue(false), hasLabel(false) 
    2727      , computedWrittenIndex_(false) 
     28          , clients() 
    2829   { 
    2930   } 
     
    3738      , transformationMap_(), hasValue(false), hasLabel(false) 
    3839      , computedWrittenIndex_(false) 
     40          , clients() 
    3941   { 
    4042   } 
     
    839841                                        CServerDistributionDescription::ServerDistributionType distType) 
    840842  { 
    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; 
    849848 
    850849      CServerDistributionDescription serverDescription(globalDim, nbServer); 
     
    855854 
    856855      CEventClient event(getType(),EVENT_ID_DISTRIBUTION_ATTRIBUTE); 
    857       if (contextClientTmp->isServerLeader()) 
     856      if (client->isServerLeader()) 
    858857      { 
    859858        std::list<CMessage> msgs; 
    860859 
    861         const std::list<int>& ranks = contextClientTmp->getRanksServerLeader(); 
     860        const std::list<int>& ranks = client->getRanksServerLeader(); 
    862861        for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank) 
    863862        { 
     
    875874          event.push(*itRank,1,msg); 
    876875        } 
    877         contextClientTmp->sendEvent(event); 
    878       } 
    879       else contextClientTmp->sendEvent(event); 
     876        client->sendEvent(event); 
     877      } 
     878      else client->sendEvent(event); 
    880879    } 
    881880  } 
     
    960959  void CAxis::sendNonDistributedAttributes() 
    961960  { 
    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; 
    968965 
    969966      CEventClient event(getType(), EVENT_ID_NON_DISTRIBUTED_ATTRIBUTES); 
     
    10861083  { 
    10871084    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; 
    10941090      int nbServer = client->serverSize; 
    10951091 
     
    14421438  } 
    14431439 
     1440  void CAxis::setContextClient(CContextClient* contextClient) 
     1441  { 
     1442    clients.insert(contextClient); 
     1443  } 
     1444 
    14441445  void CAxis::parse(xml::CXMLNode & node) 
    14451446  { 
Note: See TracChangeset for help on using the changeset viewer.