Changeset 908


Ignore:
Timestamp:
07/28/16 15:43:07 (5 years ago)
Author:
rlacroix
Message:

Fix: The buffers sizes for servers to clients communications were overestimated.

The servers do not need to send the attributes to the clients so there is no need to account for those when computing the buffers sizes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/node/context.cpp

    r887 r908  
    837837     std::map<int, StdSize> attributesSize; 
    838838 
    839      size_t numEnabledFiles = this->enabledFiles.size(); 
    840      for (size_t i = 0; i < numEnabledFiles; ++i) 
    841      { 
    842        CFile* file = this->enabledFiles[i]; 
    843  
    844        std::vector<CField*> enabledFields = file->getEnabledFields(); 
    845        size_t numEnabledFields = enabledFields.size(); 
    846        for (size_t j = 0; j < numEnabledFields; ++j) 
     839     if (hasClient) 
     840     { 
     841       size_t numEnabledFiles = this->enabledFiles.size(); 
     842       for (size_t i = 0; i < numEnabledFiles; ++i) 
    847843       { 
    848          const std::map<int, StdSize> mapSize = enabledFields[j]->getGridAttributesBufferSize(); 
    849          std::map<int, StdSize>::const_iterator it = mapSize.begin(), itE = mapSize.end(); 
    850          for (; it != itE; ++it) 
     844         CFile* file = this->enabledFiles[i]; 
     845 
     846         std::vector<CField*> enabledFields = file->getEnabledFields(); 
     847         size_t numEnabledFields = enabledFields.size(); 
     848         for (size_t j = 0; j < numEnabledFields; ++j) 
    851849         { 
    852            // If attributesSize[it->first] does not exist, it will be zero-initialized 
    853            // so we can use it safely without checking for its existance 
    854            if (attributesSize[it->first] < it->second) 
    855              attributesSize[it->first] = it->second; 
     850           const std::map<int, StdSize> mapSize = enabledFields[j]->getGridAttributesBufferSize(); 
     851           std::map<int, StdSize>::const_iterator it = mapSize.begin(), itE = mapSize.end(); 
     852           for (; it != itE; ++it) 
     853           { 
     854             // If attributesSize[it->first] does not exist, it will be zero-initialized 
     855             // so we can use it safely without checking for its existance 
     856             if (attributesSize[it->first] < it->second) 
     857               attributesSize[it->first] = it->second; 
     858           } 
    856859         } 
    857860       } 
Note: See TracChangeset for help on using the changeset viewer.