Changeset 729


Ignore:
Timestamp:
10/13/15 15:14:22 (6 years ago)
Author:
rlacroix
Message:

Ensure all needed buffers are properly initialized with the minimum buffer size.

File:
1 edited

Legend:

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

    r719 r729  
    275275 
    276276     std::map<int, StdSize> bufferSize = getDataSize(); 
    277      if (bufferSize.empty()) 
    278      { 
    279        if (client->isServerLeader()) 
    280        { 
    281          const std::list<int>& ranks = client->getRanksServerLeader(); 
    282          for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank) 
    283            bufferSize[*itRank] = bufferSizeMin; 
    284        } 
    285        else 
    286         return; 
    287      } 
    288      else 
    289      { 
    290        std::map<int, StdSize>::iterator it  = bufferSize.begin(), 
    291                                         ite = bufferSize.end(); 
    292        for (; it != ite; ++it) 
    293          it->second = (it->second < bufferSizeMin) ? bufferSizeMin : it->second; 
    294      } 
    295  
    296      client->setBufferSize(bufferSize); 
     277     std::map<int, StdSize>::iterator it  = bufferSize.begin(), 
     278                                      ite = bufferSize.end(); 
     279     for (; it != ite; ++it) 
     280       if (it->second < bufferSizeMin) it->second = bufferSizeMin; 
     281 
     282     if (client->isServerLeader()) 
     283     { 
     284       const std::list<int>& ranks = client->getRanksServerLeader(); 
     285       for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank) 
     286         if (!bufferSize.count(*itRank)) bufferSize[*itRank] = bufferSizeMin; 
     287     } 
     288 
     289     if (!bufferSize.empty()) 
     290       client->setBufferSize(bufferSize); 
    297291   } 
    298292 
Note: See TracChangeset for help on using the changeset viewer.