Ignore:
Timestamp:
09/08/16 11:18:51 (8 years ago)
Author:
rlacroix
Message:

Fix: Ensure that the buffer sizes needed to send the axis attributes are evaluated before actually sending any data.

This should avoid unexpected buffer requests (which would not cause any real issue most of the times since XIOS tries to recover from those).

File:
1 edited

Legend:

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

    r906 r927  
    2424      : CObjectTemplate<CAxis>() 
    2525      , CAxisAttributes(), isChecked(false), relFiles(), areClientAttributesChecked_(false) 
     26      , isClientAfterTransformationChecked(false) 
    2627      , isDistributed_(false), hasBounds_(false), isCompressible_(false) 
    2728      , numberWrittenIndexes_(0), totalNumberWrittenIndexes_(0), offsetWrittenIndexes_(0) 
     
    3334      : CObjectTemplate<CAxis>(id) 
    3435      , CAxisAttributes(), isChecked(false), relFiles(), areClientAttributesChecked_(false) 
     36      , isClientAfterTransformationChecked(false) 
    3537      , isDistributed_(false), hasBounds_(false), isCompressible_(false) 
    3638      , numberWrittenIndexes_(0), totalNumberWrittenIndexes_(0), offsetWrittenIndexes_(0) 
     
    362364   } 
    363365 
     366   void CAxis::checkAttributesOnClientAfterTransformation(const std::vector<int>& globalDim, int orderPositionInGrid, 
     367                                                          CServerDistributionDescription::ServerDistributionType distType) 
     368   { 
     369     CContext* context=CContext::getCurrent() ; 
     370 
     371     if (this->isClientAfterTransformationChecked) return; 
     372     if (context->hasClient) 
     373     { 
     374       if (n.getValue() != n_glo.getValue()) computeConnectedServer(globalDim, orderPositionInGrid, distType); 
     375     } 
     376 
     377     this->isClientAfterTransformationChecked = true; 
     378   } 
     379 
    364380   // Send all checked attributes to server 
    365381   void CAxis::sendCheckedAttributes(const std::vector<int>& globalDim, int orderPositionInGrid, 
     
    367383   { 
    368384     if (!this->areClientAttributesChecked_) checkAttributesOnClient(); 
     385     if (!this->isClientAfterTransformationChecked) checkAttributesOnClientAfterTransformation(globalDim, orderPositionInGrid, distType); 
    369386     CContext* context = CContext::getCurrent(); 
    370387 
     
    373390     { 
    374391       sendServerAttribut(globalDim, orderPositionInGrid, distType); 
    375        if (hasValue) sendValue(globalDim, orderPositionInGrid, distType); 
     392       if (hasValue) sendValue(); 
    376393     } 
    377394 
     
    379396   } 
    380397 
    381   void CAxis::sendValue(const std::vector<int>& globalDim, int orderPositionInGrid, 
    382                         CServerDistributionDescription::ServerDistributionType distType) 
     398  void CAxis::sendValue() 
    383399  { 
    384400     if (n.getValue() == n_glo.getValue()) 
    385      { 
    386401       sendNonDistributedValue(); 
    387      } 
    388402     else 
    389      { 
    390        computeConnectedServer(globalDim, orderPositionInGrid, distType); 
    391403       sendDistributedValue(); 
    392      } 
    393404  } 
    394405 
Note: See TracChangeset for help on using the changeset viewer.