Index: XIOS/dev/XIOS_DEV_CMIP6/src/node/axis.cpp
===================================================================
--- XIOS/dev/XIOS_DEV_CMIP6/src/node/axis.cpp	(revision 1370)
+++ XIOS/dev/XIOS_DEV_CMIP6/src/node/axis.cpp	(revision 1371)
@@ -155,10 +155,13 @@
     * \return A map associating the server rank with its minimum buffer size.
     */
-   std::map<int, StdSize> CAxis::getAttributesBufferSize(CContextClient* client, bool bufferForWriting /*= false*/)
+   std::map<int, StdSize> CAxis::getAttributesBufferSize(CContextClient* client, const std::vector<int>& globalDim, int orderPositionInGrid,
+                                                         CServerDistributionDescription::ServerDistributionType distType)
    {
 
      std::map<int, StdSize> attributesSizes = getMinimumBufferSizeForAttributes(client);
 
-     bool isNonDistributed = (n = n_glo);     
+//     bool isNonDistributed = (n_glo == n);
+     bool isDistributed = (orderPositionInGrid == CServerDistributionDescription::defaultDistributedDimension(globalDim.size(), distType))
+    		                 || (index.numElements() != n_glo);
 
      if (client->isServerLeader())
@@ -167,6 +170,16 @@
        size_t size = 6 * sizeof(size_t);
        // size estimation for sendNonDistributedValue
-       if (isNonDistributed)
-         size = std::max(size, CArray<double,1>::size(n_glo) + (isCompressible_ ? CArray<int,1>::size(n_glo) : 0));
+       if (!isDistributed)
+       {
+//         size = std::max(size, CArray<double,1>::size(n_glo) + (isCompressible_ ? CArray<int,1>::size(n_glo) : 0));
+         size += CArray<int,1>::size(n_glo);
+         size += CArray<int,1>::size(n_glo);
+         size += CArray<bool,1>::size(n_glo);
+         size += CArray<double,1>::size(n_glo);
+         if (hasBounds)
+           size += CArray<double,2>::size(2*n_glo);
+         if (hasLabel)
+          size += CArray<StdString,1>::size(n_glo);
+       }
        size += CEventClient::headerSize + getId().size() + sizeof(size_t);
 
@@ -177,7 +190,14 @@
            attributesSizes[*itRank] = size;
        }
+       const std::list<int>& ranksNonLeaders = client->getRanksServerNotLeader();
+       for (std::list<int>::const_iterator itRank = ranksNonLeaders.begin(), itRankEnd = ranksNonLeaders.end(); itRank != itRankEnd; ++itRank)
+       {
+         if (size > attributesSizes[*itRank])
+           attributesSizes[*itRank] = size;
+       }
+
      }
 
-     if (!isNonDistributed)
+     if (isDistributed)
      {
        // size estimation for sendDistributedValue
@@ -185,16 +205,15 @@
        for (it = indSrv_[client->serverSize].begin(); it != ite; ++it)
        {
-         size_t sizeIndexEvent = CArray<int,1>::size(it->second.size());
-         // if (isCompressible_)
-         //   sizeIndexEvent += CArray<int,1>::size(indWrittenSrv_[it->first].size());
-
-         size_t sizeValEvent = CArray<double,1>::size(it->second.size());
+         size_t size = 6 * sizeof(size_t);
+         size += CArray<int,1>::size(it->second.size());
+         size += CArray<int,1>::size(it->second.size());
+         size += CArray<bool,1>::size(it->second.size());
+         size += CArray<double,1>::size(it->second.size());
          if (hasBounds)
-           sizeValEvent += CArray<double,2>::size(2 * it->second.size());
- 
+           size += CArray<double,2>::size(2 * it->second.size());
          if (hasLabel)
-           sizeValEvent += CArray<StdString,1>::size(it->second.size());
-
-         size_t size = CEventClient::headerSize + getId().size() + sizeof(size_t) + std::max(sizeIndexEvent, sizeValEvent);
+           size += CArray<StdString,1>::size(it->second.size());
+
+         size += CEventClient::headerSize + getId().size() + sizeof(size_t);
          if (size > attributesSizes[it->first])
            attributesSizes[it->first] = size;
Index: XIOS/dev/XIOS_DEV_CMIP6/src/node/axis.hpp
===================================================================
--- XIOS/dev/XIOS_DEV_CMIP6/src/node/axis.hpp	(revision 1370)
+++ XIOS/dev/XIOS_DEV_CMIP6/src/node/axis.hpp	(revision 1371)
@@ -74,5 +74,6 @@
          CArray<int, 1>& getCompressedIndexToWriteOnServer(MPI_Comm writtenCom);
 
-         std::map<int, StdSize> getAttributesBufferSize(CContextClient* client, bool bufferForWriting = false);
+         std::map<int, StdSize> getAttributesBufferSize(CContextClient* client, const std::vector<int>& globalDim, int orderPositionInGrid,
+                                                        CServerDistributionDescription::ServerDistributionType disType = CServerDistributionDescription::BAND_DISTRIBUTION);
 
          /// Test ///
Index: XIOS/dev/XIOS_DEV_CMIP6/src/node/grid.cpp
===================================================================
--- XIOS/dev/XIOS_DEV_CMIP6/src/node/grid.cpp	(revision 1370)
+++ XIOS/dev/XIOS_DEV_CMIP6/src/node/grid.cpp	(revision 1371)
@@ -111,15 +111,11 @@
      // The grid indexes require a similar size as the actual data
      std::map<int, StdSize> dataSizes = getDataBufferSize(client, "", bufferForWriting);
-     // for (size_t i = 0; i < dataSizes.size(); ++i)
-     // {
-       std::map<int, StdSize>::iterator it, itE = dataSizes.end();
-       for (it = dataSizes.begin(); it != itE; ++it)
-       {
-         it->second += 2 * sizeof(bool);
-         if (it->second > attributesSizes[it->first])
-           attributesSizes[it->first] = it->second;
-       }
-     // }
-
+     std::map<int, StdSize>::iterator it, itE = dataSizes.end();
+     for (it = dataSizes.begin(); it != itE; ++it)
+     {
+       it->second += 2 * sizeof(bool);
+       if (it->second > attributesSizes[it->first])
+         attributesSizes[it->first] = it->second;
+     }
      
      // Account for the axis attributes
@@ -127,7 +123,8 @@
      for (size_t i = 0; i < axisList.size(); ++i)
      {
-       std::map<int, StdSize> axisAttBuffSize = axisList[i]->getAttributesBufferSize(client);       
+       std::map<int, StdSize> axisAttBuffSize = axisList[i]->getAttributesBufferSize(client, getGlobalDimension(),axisPositionInGrid_[i]);
        for (it = axisAttBuffSize.begin(), itE = axisAttBuffSize.end(); it != itE; ++it)
        {
+         it->second += 2 * sizeof(bool);
          if (it->second > attributesSizes[it->first])
            attributesSizes[it->first] = it->second;
@@ -142,4 +139,5 @@
        for (it = domAttBuffSize.begin(), itE = domAttBuffSize.end(); it != itE; ++it)
        {
+         it->second += 2 * sizeof(bool);
          if (it->second > attributesSizes[it->first])
            attributesSizes[it->first] = it->second;
