Index: XIOS/dev/dev_olga/src/io/nc4_data_output.cpp
===================================================================
--- XIOS/dev/dev_olga/src/io/nc4_data_output.cpp	(revision 1026)
+++ XIOS/dev/dev_olga/src/io/nc4_data_output.cpp	(revision 1027)
@@ -1043,112 +1043,117 @@
       {
         CContext* context = CContext::getCurrent();
-        CContextServer* server = (context->hasServer) ? context->server : context->serverPrimServer;
-
-        if (axis->IsWritten(this->filename)) return;
-        axis->checkAttributes();
-
-        int local_size_write  = axis->getLocalWriteSize();
-        int global_size_write = axis->getGlobalWriteSize();
-        int start_write = axis->getStartWriteIndex();
-        int count_write = axis->getCountWriteIndex();
-
-        if ((0 == local_size_write) && (MULTI_FILE == SuperClass::type)) return;
-
-        std::vector<StdString> dims;
-        StdString axisid = axis->getAxisOutputName();
-        if (isWrittenAxis(axisid)) return ;
-        else setWrittenAxis(axisid);
-
-        try
+
+        int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1;
+        for (int i = 0; i < nbSrvPools; ++i)
         {
-          SuperClassWriter::addDimension(axisid, global_size_write);
-          if (axis->hasValue)
+          CContextServer* server = (context->hasServer) ? context->server : context->serverPrimServer[i];
+
+          if (axis->IsWritten(this->filename)) return;
+          axis->checkAttributes();
+
+          int local_size_write  = axis->getLocalWriteSize();
+          int global_size_write = axis->getGlobalWriteSize();
+          int start_write = axis->getStartWriteIndex();
+          int count_write = axis->getCountWriteIndex();
+
+          if ((0 == local_size_write) && (MULTI_FILE == SuperClass::type)) return;
+
+          std::vector<StdString> dims;
+          StdString axisid = axis->getAxisOutputName();
+          if (isWrittenAxis(axisid)) return ;
+          else setWrittenAxis(axisid);
+
+          try
           {
-            dims.push_back(axisid);
-            SuperClassWriter::addVariable(axisid, NC_FLOAT, dims);
-
-            if (!axis->name.isEmpty())
-              SuperClassWriter::addAttribute("name", axis->name.getValue(), &axisid);
-
-            if (!axis->standard_name.isEmpty())
-              SuperClassWriter::addAttribute("standard_name", axis->standard_name.getValue(), &axisid);
-
-            if (!axis->long_name.isEmpty())
-              SuperClassWriter::addAttribute("long_name", axis->long_name.getValue(), &axisid);
-
-            if (!axis->unit.isEmpty())
-              SuperClassWriter::addAttribute("units", axis->unit.getValue(), &axisid);
-
-            if (!axis->positive.isEmpty())
+            SuperClassWriter::addDimension(axisid, global_size_write);
+            if (axis->hasValue)
             {
-              SuperClassWriter::addAttribute("axis", string("Z"), &axisid);
-              SuperClassWriter::addAttribute("positive",
-                                             (axis->positive == CAxis::positive_attr::up) ? string("up") : string("down"),
-                                             &axisid);
-            }
-
-            StdString axisBoundsId = axisid + "_bounds";
-            if (!axis->bounds.isEmpty())
-            {
-              dims.push_back("axis_nbounds");
-              SuperClassWriter::addVariable(axisBoundsId, NC_FLOAT, dims);
-              SuperClassWriter::addAttribute("bounds", axisBoundsId, &axisid);
-            }
-
-            SuperClassWriter::definition_end();
-
-            switch (SuperClass::type)
-            {
-              case MULTI_FILE:
+              dims.push_back(axisid);
+              SuperClassWriter::addVariable(axisid, NC_FLOAT, dims);
+
+              if (!axis->name.isEmpty())
+                SuperClassWriter::addAttribute("name", axis->name.getValue(), &axisid);
+
+              if (!axis->standard_name.isEmpty())
+                SuperClassWriter::addAttribute("standard_name", axis->standard_name.getValue(), &axisid);
+
+              if (!axis->long_name.isEmpty())
+                SuperClassWriter::addAttribute("long_name", axis->long_name.getValue(), &axisid);
+
+              if (!axis->unit.isEmpty())
+                SuperClassWriter::addAttribute("units", axis->unit.getValue(), &axisid);
+
+              if (!axis->positive.isEmpty())
               {
-                CArray<double,1> axis_value(local_size_write);
-                for (int i = 0; i < local_size_write; i++) axis_value(i) = axis->value(i);
-                SuperClassWriter::writeData(axis_value, axisid, isCollective, 0);
-
-                if (!axis->bounds.isEmpty())
-                  SuperClassWriter::writeData(axis->bounds, axisBoundsId, isCollective, 0);
-
-                SuperClassWriter::definition_start();
-
-                break;
+                SuperClassWriter::addAttribute("axis", string("Z"), &axisid);
+                SuperClassWriter::addAttribute("positive",
+                                               (axis->positive == CAxis::positive_attr::up) ? string("up") : string("down"),
+                                               &axisid);
               }
-              case ONE_FILE:
+
+              StdString axisBoundsId = axisid + "_bounds";
+              if (!axis->bounds.isEmpty())
               {
-                CArray<double,1> axis_value(count_write);
-                axis_value = axis->value;
-
-                std::vector<StdSize> start(1), startBounds(2) ;
-                std::vector<StdSize> count(1), countBounds(2) ;
-                start[0] = startBounds[0] = start_write;
-                count[0] = countBounds[0] = count_write;
-                startBounds[1] = 0;
-                countBounds[1] = 2;
-                SuperClassWriter::writeData(axis_value, axisid, isCollective, 0, &start, &count);
-
-                if (!axis->bounds.isEmpty())
-                  SuperClassWriter::writeData(axis->bounds, axisBoundsId, isCollective, 0, &startBounds, &countBounds);
-
-                SuperClassWriter::definition_start();
-
-                break;
+                dims.push_back("axis_nbounds");
+                SuperClassWriter::addVariable(axisBoundsId, NC_FLOAT, dims);
+                SuperClassWriter::addAttribute("bounds", axisBoundsId, &axisid);
               }
-              default :
-                ERROR("CNc4DataOutput::writeAxis_(CAxis* axis)",
-                      << "[ type = " << SuperClass::type << "]"
-                      << " not implemented yet !");
+
+              SuperClassWriter::definition_end();
+
+              switch (SuperClass::type)
+              {
+                case MULTI_FILE:
+                {
+                  CArray<double,1> axis_value(local_size_write);
+                  for (int i = 0; i < local_size_write; i++) axis_value(i) = axis->value(i);
+                  SuperClassWriter::writeData(axis_value, axisid, isCollective, 0);
+
+                  if (!axis->bounds.isEmpty())
+                    SuperClassWriter::writeData(axis->bounds, axisBoundsId, isCollective, 0);
+
+                  SuperClassWriter::definition_start();
+
+                  break;
+                }
+                case ONE_FILE:
+                {
+                  CArray<double,1> axis_value(count_write);
+                  axis_value = axis->value;
+
+                  std::vector<StdSize> start(1), startBounds(2) ;
+                  std::vector<StdSize> count(1), countBounds(2) ;
+                  start[0] = startBounds[0] = start_write;
+                  count[0] = countBounds[0] = count_write;
+                  startBounds[1] = 0;
+                  countBounds[1] = 2;
+                  SuperClassWriter::writeData(axis_value, axisid, isCollective, 0, &start, &count);
+
+                  if (!axis->bounds.isEmpty())
+                    SuperClassWriter::writeData(axis->bounds, axisBoundsId, isCollective, 0, &startBounds, &countBounds);
+
+                  SuperClassWriter::definition_start();
+
+                  break;
+                }
+                default :
+                  ERROR("CNc4DataOutput::writeAxis_(CAxis* axis)",
+                        << "[ type = " << SuperClass::type << "]"
+                        << " not implemented yet !");
+              }
             }
           }
-        }
-        catch (CNetCdfException& e)
-        {
-          StdString msg("On writing the axis : ");
-          msg.append(axisid); msg.append("\n");
-          msg.append("In the context : ");
-          CContext* context = CContext::getCurrent() ;
-          msg.append(context->getId()); msg.append("\n");
-          msg.append(e.what());
-          ERROR("CNc4DataOutput::writeAxis_(CAxis* axis)", << msg);
-        }
-        axis->addRelFile(this->filename);
+          catch (CNetCdfException& e)
+          {
+            StdString msg("On writing the axis : ");
+            msg.append(axisid); msg.append("\n");
+            msg.append("In the context : ");
+            CContext* context = CContext::getCurrent() ;
+            msg.append(context->getId()); msg.append("\n");
+            msg.append(e.what());
+            ERROR("CNc4DataOutput::writeAxis_(CAxis* axis)", << msg);
+          }
+      } // loop over nbSrvPools
+      axis->addRelFile(this->filename);
      }
 
Index: XIOS/dev/dev_olga/src/node/axis.cpp
===================================================================
--- XIOS/dev/dev_olga/src/node/axis.cpp	(revision 1026)
+++ XIOS/dev/dev_olga/src/node/axis.cpp	(revision 1027)
@@ -453,148 +453,152 @@
   {
     CContext* context = CContext::getCurrent();
-    CContextClient* client = (0 != context->clientPrimServer) ? context->clientPrimServer : context->client;
-    int nbServer = client->serverSize;
-    int range, clientSize = client->clientSize;
-    int rank = client->clientRank;
-
-    // size_t ni = this->n.getValue();
-    // size_t ibegin = this->begin.getValue();
-    // size_t zoom_end = global_zoom_begin+global_zoom_n-1;
-    // size_t nZoomCount = 0;
-    size_t nbIndex = index.numElements();
-    for (size_t idx = 0; idx < nbIndex; ++idx)
-    {
-      globalLocalIndexMap_[index(idx)] = idx;
-      // size_t globalIndex = index(idx);
-      // if (globalIndex >= global_zoom_begin && globalIndex <= zoom_end) ++nZoomCount;
-    }
-
-    // CArray<size_t,1> globalIndexAxis(nbIndex);
-    // std::vector<size_t> globalAxisZoom(nZoomCount);
-    // nZoomCount = 0;
-    // for (size_t idx = 0; idx < nbIndex; ++idx)
-    // {
-    //   size_t globalIndex = index(idx);
-    //   globalIndexAxis(idx) = globalIndex;
-    //   if (globalIndex >= global_zoom_begin && globalIndex <= zoom_end)
-    //   {
-    //     globalAxisZoom[nZoomCount] = globalIndex;
-    //     ++nZoomCount;
-    //   }
-    // }
-
-    // std::set<int> writtenInd;
-    // if (isCompressible_)
-    // {
-    //   for (int idx = 0; idx < data_index.numElements(); ++idx)
-    //   {
-    //     int ind = CDistributionClient::getAxisIndex(data_index(idx), data_begin, ni);
-
-    //     if (ind >= 0 && ind < ni && mask(ind))
-    //     {
-    //       ind += ibegin;
-    //       if (ind >= global_zoom_begin && ind <= zoom_end)
-    //         writtenInd.insert(ind);
-    //     }
-    //   }
-    // }
-
-    CServerDistributionDescription serverDescriptionGlobal(globalDim, nbServer, distType);
-    int distributedDimensionOnServer = serverDescriptionGlobal.getDimensionDistributed();
-    CClientServerMapping::GlobalIndexMap globalIndexAxisOnServer;
-    if (distributedDimensionOnServer == orderPositionInGrid) // So we have distributed axis on client side and also on server side*
-    {
-      std::vector<int> nGlobAxis(1);
-      nGlobAxis[0] = n_glo.getValue();
-
-      size_t globalSizeIndex = 1, indexBegin, indexEnd;
-      for (int i = 0; i < nGlobAxis.size(); ++i) globalSizeIndex *= nGlobAxis[i];
-      indexBegin = 0;
-      if (globalSizeIndex <= clientSize)
-      {
-        indexBegin = rank%globalSizeIndex;
-        indexEnd = indexBegin;
+    int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1;
+    for (int i = 0; i < nbSrvPools; ++i)
+    {
+      CContextClient* client = (0 != context->clientPrimServer.size()) ? context->clientPrimServer[i] : context->client;
+      int nbServer = client->serverSize;
+      int range, clientSize = client->clientSize;
+      int rank = client->clientRank;
+
+      // size_t ni = this->n.getValue();
+      // size_t ibegin = this->begin.getValue();
+      // size_t zoom_end = global_zoom_begin+global_zoom_n-1;
+      // size_t nZoomCount = 0;
+      size_t nbIndex = index.numElements();
+      for (size_t idx = 0; idx < nbIndex; ++idx)
+      {
+        globalLocalIndexMap_[index(idx)] = idx;
+        // size_t globalIndex = index(idx);
+        // if (globalIndex >= global_zoom_begin && globalIndex <= zoom_end) ++nZoomCount;
+      }
+
+      // CArray<size_t,1> globalIndexAxis(nbIndex);
+      // std::vector<size_t> globalAxisZoom(nZoomCount);
+      // nZoomCount = 0;
+      // for (size_t idx = 0; idx < nbIndex; ++idx)
+      // {
+      //   size_t globalIndex = index(idx);
+      //   globalIndexAxis(idx) = globalIndex;
+      //   if (globalIndex >= global_zoom_begin && globalIndex <= zoom_end)
+      //   {
+      //     globalAxisZoom[nZoomCount] = globalIndex;
+      //     ++nZoomCount;
+      //   }
+      // }
+
+      // std::set<int> writtenInd;
+      // if (isCompressible_)
+      // {
+      //   for (int idx = 0; idx < data_index.numElements(); ++idx)
+      //   {
+      //     int ind = CDistributionClient::getAxisIndex(data_index(idx), data_begin, ni);
+
+      //     if (ind >= 0 && ind < ni && mask(ind))
+      //     {
+      //       ind += ibegin;
+      //       if (ind >= global_zoom_begin && ind <= zoom_end)
+      //         writtenInd.insert(ind);
+      //     }
+      //   }
+      // }
+
+      CServerDistributionDescription serverDescriptionGlobal(globalDim, nbServer, distType);
+      int distributedDimensionOnServer = serverDescriptionGlobal.getDimensionDistributed();
+      CClientServerMapping::GlobalIndexMap globalIndexAxisOnServer;
+      if (distributedDimensionOnServer == orderPositionInGrid) // So we have distributed axis on client side and also on server side*
+      {
+        std::vector<int> nGlobAxis(1);
+        nGlobAxis[0] = n_glo.getValue();
+
+        size_t globalSizeIndex = 1, indexBegin, indexEnd;
+        for (int i = 0; i < nGlobAxis.size(); ++i) globalSizeIndex *= nGlobAxis[i];
+        indexBegin = 0;
+        if (globalSizeIndex <= clientSize)
+        {
+          indexBegin = rank%globalSizeIndex;
+          indexEnd = indexBegin;
+        }
+        else
+        {
+          for (int i = 0; i < clientSize; ++i)
+          {
+            range = globalSizeIndex / clientSize;
+            if (i < (globalSizeIndex%clientSize)) ++range;
+            if (i == client->clientRank) break;
+            indexBegin += range;
+          }
+          indexEnd = indexBegin + range - 1;
+        }
+
+        CArray<size_t,1> globalIndex(index.numElements());
+        for (size_t idx = 0; idx < globalIndex.numElements(); ++idx)
+          globalIndex(idx) = index(idx);
+
+        CServerDistributionDescription serverDescription(nGlobAxis, nbServer);
+        serverDescription.computeServerGlobalIndexInRange(std::make_pair<size_t,size_t>(indexBegin, indexEnd));
+        CClientServerMapping* clientServerMap = new CClientServerMappingDistributed(serverDescription.getGlobalIndexRange(), client->intraComm);
+        clientServerMap->computeServerIndexMapping(globalIndex);
+        globalIndexAxisOnServer = clientServerMap->getGlobalIndexOnServer();
+        delete clientServerMap;
       }
       else
       {
-        for (int i = 0; i < clientSize; ++i)
-        {
-          range = globalSizeIndex / clientSize;
-          if (i < (globalSizeIndex%clientSize)) ++range;
-          if (i == client->clientRank) break;
-          indexBegin += range;
-        }
-        indexEnd = indexBegin + range - 1;
-      }
-
-      CArray<size_t,1> globalIndex(index.numElements());
-      for (size_t idx = 0; idx < globalIndex.numElements(); ++idx)
-        globalIndex(idx) = index(idx);
-
-      CServerDistributionDescription serverDescription(nGlobAxis, nbServer);
-      serverDescription.computeServerGlobalIndexInRange(std::make_pair<size_t,size_t>(indexBegin, indexEnd));
-      CClientServerMapping* clientServerMap = new CClientServerMappingDistributed(serverDescription.getGlobalIndexRange(), client->intraComm);
-      clientServerMap->computeServerIndexMapping(globalIndex);
-      globalIndexAxisOnServer = clientServerMap->getGlobalIndexOnServer();
-      delete clientServerMap;
-    }
-    else
-    {
-      std::vector<size_t> globalIndexServer(n_glo.getValue());
-      for (size_t idx = 0; idx < n_glo.getValue(); ++idx)
-      {
-        globalIndexServer[idx] = idx;
-      }
-
-      for (int idx = 0; idx < nbServer; ++idx)
-      {
-        globalIndexAxisOnServer[idx] = globalIndexServer;
-      }
-    }
-
-    indSrv_.swap(globalIndexAxisOnServer);
-
-    // CClientServerMapping::GlobalIndexMap::const_iterator it = globalIndexAxisOnServer.begin(),
-    //                                                      ite = globalIndexAxisOnServer.end();
-    CClientServerMapping::GlobalIndexMap::const_iterator it = indSrv_.begin(),
-                                                         ite = indSrv_.end();
-    // std::vector<size_t>::const_iterator itbVec = (globalAxisZoom).begin(),
-    //                                     iteVec = (globalAxisZoom).end();
-    // indSrv_.clear();
-    // indWrittenSrv_.clear();
-    // for (; it != ite; ++it)
-    // {
-    //   int rank = it->first;
-    //   const std::vector<size_t>& globalIndexTmp = it->second;
-    //   int nb = globalIndexTmp.size();
-
-    //   for (int i = 0; i < nb; ++i)
-    //   {
-    //     if (std::binary_search(itbVec, iteVec, globalIndexTmp[i]))
-    //     {
-    //       indSrv_[rank].push_back(globalIndexTmp[i]);
-    //     }
-
-    //     if (writtenInd.count(globalIndexTmp[i]))
-    //     {
-    //       indWrittenSrv_[rank].push_back(globalIndexTmp[i]);
-    //     }
-    //   }
-    // }
-
-    connectedServerRank_.clear();
-    for (it = indSrv_.begin(); it != ite; ++it) {
-      connectedServerRank_.push_back(it->first);
-    }
-
-    // if (!indSrv_.empty())
-    // {
-    //   std::map<int, vector<size_t> >::const_iterator itIndSrv  = indSrv_.begin(),
-    //                                                  iteIndSrv = indSrv_.end();
-    //   connectedServerRank_.clear();
-    //   for (; itIndSrv != iteIndSrv; ++itIndSrv)
-    //     connectedServerRank_.push_back(itIndSrv->first);
-    // }
-    nbConnectedClients_ = CClientServerMapping::computeConnectedClients(client->serverSize, client->clientSize, client->intraComm, connectedServerRank_);
+        std::vector<size_t> globalIndexServer(n_glo.getValue());
+        for (size_t idx = 0; idx < n_glo.getValue(); ++idx)
+        {
+          globalIndexServer[idx] = idx;
+        }
+
+        for (int idx = 0; idx < nbServer; ++idx)
+        {
+          globalIndexAxisOnServer[idx] = globalIndexServer;
+        }
+      }
+
+      indSrv_.swap(globalIndexAxisOnServer);
+
+      // CClientServerMapping::GlobalIndexMap::const_iterator it = globalIndexAxisOnServer.begin(),
+      //                                                      ite = globalIndexAxisOnServer.end();
+      CClientServerMapping::GlobalIndexMap::const_iterator it = indSrv_.begin(),
+                                                           ite = indSrv_.end();
+      // std::vector<size_t>::const_iterator itbVec = (globalAxisZoom).begin(),
+      //                                     iteVec = (globalAxisZoom).end();
+      // indSrv_.clear();
+      // indWrittenSrv_.clear();
+      // for (; it != ite; ++it)
+      // {
+      //   int rank = it->first;
+      //   const std::vector<size_t>& globalIndexTmp = it->second;
+      //   int nb = globalIndexTmp.size();
+
+      //   for (int i = 0; i < nb; ++i)
+      //   {
+      //     if (std::binary_search(itbVec, iteVec, globalIndexTmp[i]))
+      //     {
+      //       indSrv_[rank].push_back(globalIndexTmp[i]);
+      //     }
+
+      //     if (writtenInd.count(globalIndexTmp[i]))
+      //     {
+      //       indWrittenSrv_[rank].push_back(globalIndexTmp[i]);
+      //     }
+      //   }
+      // }
+
+      connectedServerRank_.clear();
+      for (it = indSrv_.begin(); it != ite; ++it) {
+        connectedServerRank_.push_back(it->first);
+      }
+
+      // if (!indSrv_.empty())
+      // {
+      //   std::map<int, vector<size_t> >::const_iterator itIndSrv  = indSrv_.begin(),
+      //                                                  iteIndSrv = indSrv_.end();
+      //   connectedServerRank_.clear();
+      //   for (; itIndSrv != iteIndSrv; ++itIndSrv)
+      //     connectedServerRank_.push_back(itIndSrv->first);
+      // }
+      nbConnectedClients_ = CClientServerMapping::computeConnectedClients(client->serverSize, client->clientSize, client->intraComm, connectedServerRank_);
+    }
   }
 
@@ -744,50 +748,55 @@
   {
     CContext* context = CContext::getCurrent();
-    CContextClient* client = (0 != context->clientPrimServer) ? context->clientPrimServer : context->client;
+    int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1;
     
-    CEventClient event(getType(), EVENT_ID_NON_DISTRIBUTED_ATTRIBUTES);
-    size_t nbIndex = index.numElements();
-    size_t nbDataIndex = 0;
-
-    for (int idx = 0; idx < data_index.numElements(); ++idx)
-    {      
-      int ind = data_index(idx);
-      if (ind >= 0 && ind < nbIndex) ++nbDataIndex;
-    }
-
-    CArray<int,1> dataIndex(nbDataIndex);
-    nbDataIndex = 0;
-    for (int idx = 0; idx < data_index.numElements(); ++idx)
-    {      
-      int ind = data_index(idx);
-      if (ind >= 0 && ind < nbIndex)
-      {
-        dataIndex(nbDataIndex) = ind;
-        ++nbDataIndex;
-      } 
-    }
-
-    if (client->isServerLeader())
-    { 
-      std::list<CMessage> msgs;
-
-      const std::list<int>& ranks = client->getRanksServerLeader();
-      for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
-      {
-        msgs.push_back(CMessage());
-        CMessage& msg = msgs.back();
-        msg << this->getId();
-        msg << index.getValue() << dataIndex << zoom_index.getValue() << mask.getValue();
-        msg << hasValue;
-        if (hasValue) msg << value.getValue();
-
-        msg << hasBounds_;
-        if (hasBounds_) msg << bounds.getValue();
-        
-        event.push(*itRank, 1, msg);
-      }
-      client->sendEvent(event);
-    }
-    else client->sendEvent(event);
+    for (int i = 0; i < nbSrvPools; ++i)
+    {
+      CContextClient* client = (0 != context->clientPrimServer.size()) ? context->clientPrimServer[i] : context->client;
+
+      CEventClient event(getType(), EVENT_ID_NON_DISTRIBUTED_ATTRIBUTES);
+      size_t nbIndex = index.numElements();
+      size_t nbDataIndex = 0;
+
+      for (int idx = 0; idx < data_index.numElements(); ++idx)
+      {
+        int ind = data_index(idx);
+        if (ind >= 0 && ind < nbIndex) ++nbDataIndex;
+      }
+
+      CArray<int,1> dataIndex(nbDataIndex);
+      nbDataIndex = 0;
+      for (int idx = 0; idx < data_index.numElements(); ++idx)
+      {
+        int ind = data_index(idx);
+        if (ind >= 0 && ind < nbIndex)
+        {
+          dataIndex(nbDataIndex) = ind;
+          ++nbDataIndex;
+        }
+      }
+
+      if (client->isServerLeader())
+      {
+        std::list<CMessage> msgs;
+
+        const std::list<int>& ranks = client->getRanksServerLeader();
+        for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+        {
+          msgs.push_back(CMessage());
+          CMessage& msg = msgs.back();
+          msg << this->getId();
+          msg << index.getValue() << dataIndex << zoom_index.getValue() << mask.getValue();
+          msg << hasValue;
+          if (hasValue) msg << value.getValue();
+
+          msg << hasBounds_;
+          if (hasBounds_) msg << bounds.getValue();
+
+          event.push(*itRank, 1, msg);
+        }
+        client->sendEvent(event);
+      }
+      else client->sendEvent(event);
+    }
   }
 
@@ -845,91 +854,96 @@
     int ns, n, i, j, ind, nv, idx;
     CContext* context = CContext::getCurrent();
-    CContextClient* client = (0 != context->clientPrimServer) ? context->clientPrimServer : context->client;
-
-    CEventClient eventData(getType(), EVENT_ID_DISTRIBUTED_ATTRIBUTES);
-    
-    list<CMessage> listData;
-    list<CArray<int,1> > list_indi, list_dataInd, list_zoomInd;    
-    list<CArray<bool,1> > list_mask;
-    list<CArray<double,1> > list_val;
-    list<CArray<double,2> > list_bounds;
-
-    int nbIndex = index.numElements();
-    CArray<int,1> dataIndex(nbIndex);
-    dataIndex = -1;
-    for (int idx = 0; idx < data_index.numElements(); ++idx)
-    {
-      if (0 <= data_index(idx) && data_index(idx) < nbIndex)
-        dataIndex(idx) = data_index(idx);
-    }
-
-    boost::unordered_map<int, std::vector<size_t> >::const_iterator it, iteMap;
-    iteMap = indSrv_.end();
-    for (int k = 0; k < connectedServerRank_.size(); ++k)
-    {
-      int nbData = 0;
-      int rank = connectedServerRank_[k];
-      int nbSendingClient = nbConnectedClients_[rank];
-      it = indSrv_.find(rank);
-      if (iteMap != it)
-        nbData = it->second.size();
-
-      list_indi.push_back(CArray<int,1>(nbData));
-      list_dataInd.push_back(CArray<int,1>(nbData));
-      list_zoomInd.push_back(CArray<int,1>(nbData));
-      list_mask.push_back(CArray<bool,1>(nbData));
-
-
-      if (hasValue)
-        list_val.push_back(CArray<double,1>(nbData));
-
-      if (hasBounds_)
-      {
-        list_bounds.push_back(CArray<double,2>(2,nbData));
-      }
-
-      CArray<int,1>& indi = list_indi.back();
-      CArray<int,1>& dataIndi = list_dataInd.back();
-      CArray<int,1>& zoomIndi = list_zoomInd.back();
-      CArray<bool,1>& maskIndi = list_mask.back();      
-
-      for (n = 0; n < nbData; ++n)
-      {
-        idx = static_cast<int>(it->second[n]);
-        indi(n) = idx;
-
-        ind = globalLocalIndexMap_[idx];
-        dataIndi(n) = dataIndex(ind);
-        maskIndi(n) = mask(ind);
-        zoomIndi(n) = zoom_index(ind);        
+    int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1;
+
+    for (int i = 0; i < nbSrvPools; ++i)
+    {
+      CContextClient* client = (0 != context->clientPrimServer.size()) ? context->clientPrimServer[i] : context->client;
+
+      CEventClient eventData(getType(), EVENT_ID_DISTRIBUTED_ATTRIBUTES);
+
+      list<CMessage> listData;
+      list<CArray<int,1> > list_indi, list_dataInd, list_zoomInd;
+      list<CArray<bool,1> > list_mask;
+      list<CArray<double,1> > list_val;
+      list<CArray<double,2> > list_bounds;
+
+      int nbIndex = index.numElements();
+      CArray<int,1> dataIndex(nbIndex);
+      dataIndex = -1;
+      for (int inx = 0; inx < data_index.numElements(); ++inx)
+      {
+        if (0 <= data_index(inx) && data_index(inx) < nbIndex)
+          dataIndex(inx) = data_index(inx);
+      }
+
+      boost::unordered_map<int, std::vector<size_t> >::const_iterator it, iteMap;
+      iteMap = indSrv_.end();
+      for (int k = 0; k < connectedServerRank_.size(); ++k)
+      {
+        int nbData = 0;
+        int rank = connectedServerRank_[k];
+        int nbSendingClient = nbConnectedClients_[rank];
+        it = indSrv_.find(rank);
+        if (iteMap != it)
+          nbData = it->second.size();
+
+        list_indi.push_back(CArray<int,1>(nbData));
+        list_dataInd.push_back(CArray<int,1>(nbData));
+        list_zoomInd.push_back(CArray<int,1>(nbData));
+        list_mask.push_back(CArray<bool,1>(nbData));
+
 
         if (hasValue)
-        {
-          CArray<double,1>& val = list_val.back();
-          val(n) = value(ind);
-        }
+          list_val.push_back(CArray<double,1>(nbData));
 
         if (hasBounds_)
         {
-          CArray<double,2>& boundsVal = list_bounds.back();
-          boundsVal(0, n) = bounds(0,n);
-          boundsVal(1, n) = bounds(1,n);
-        }
-      }
-
-      listData.push_back(CMessage());
-      listData.back() << this->getId()  
-                      << list_indi.back() << list_dataInd.back() << list_zoomInd.back() << list_mask.back()
-                      << hasValue;
-      if (hasValue)
-        listData.back() << list_val.back();
-      listData.back() << hasBounds_;
-      if (hasBounds_)
-        listData.back() << list_bounds.back();
-
-      eventData.push(rank, nbConnectedClients_[rank], listData.back());
-    }
-
-    client->sendEvent(eventData);
+          list_bounds.push_back(CArray<double,2>(2,nbData));
+        }
+
+        CArray<int,1>& indi = list_indi.back();
+        CArray<int,1>& dataIndi = list_dataInd.back();
+        CArray<int,1>& zoomIndi = list_zoomInd.back();
+        CArray<bool,1>& maskIndi = list_mask.back();
+
+        for (n = 0; n < nbData; ++n)
+        {
+          idx = static_cast<int>(it->second[n]);
+          indi(n) = idx;
+
+          ind = globalLocalIndexMap_[idx];
+          dataIndi(n) = dataIndex(ind);
+          maskIndi(n) = mask(ind);
+          zoomIndi(n) = zoom_index(ind);
+
+          if (hasValue)
+          {
+            CArray<double,1>& val = list_val.back();
+            val(n) = value(ind);
+          }
+
+          if (hasBounds_)
+          {
+            CArray<double,2>& boundsVal = list_bounds.back();
+            boundsVal(0, n) = bounds(0,n);
+            boundsVal(1, n) = bounds(1,n);
+          }
+        }
+
+        listData.push_back(CMessage());
+        listData.back() << this->getId()
+                        << list_indi.back() << list_dataInd.back() << list_zoomInd.back() << list_mask.back()
+                        << hasValue;
+        if (hasValue)
+          listData.back() << list_val.back();
+        listData.back() << hasBounds_;
+        if (hasBounds_)
+          listData.back() << list_bounds.back();
+
+        eventData.push(rank, nbConnectedClients_[rank], listData.back());
+      }
+
+      client->sendEvent(eventData);
+    }
   }
 
@@ -1114,7 +1128,4 @@
   //   *buffer >> axisId;
   //   get(axisId)->recvServerAttribut(*buffer);
-    {
-      CContextClient* contextClientTmp = (context->hasServer) ? context->clientPrimServer[i]
-    }
 
   //   CContext* context = CContext::getCurrent();
Index: XIOS/dev/dev_olga/src/node/context.cpp
===================================================================
--- XIOS/dev/dev_olga/src/node/context.cpp	(revision 1026)
+++ XIOS/dev/dev_olga/src/node/context.cpp	(revision 1027)
@@ -519,18 +519,22 @@
    void CContext::sendPostProcessingGlobalAttributes()
    {
-         // Use correct context client to send message
-     CContextClient* contextClientTmp = (0 != clientPrimServer) ? clientPrimServer : client;
-     CEventClient event(getType(),EVENT_ID_POST_PROCESS_GLOBAL_ATTRIBUTES);
-
-     if (contextClientTmp->isServerLeader())
-     {
-       CMessage msg;
-       msg<<this->getIdServer();
-       const std::list<int>& ranks = contextClientTmp->getRanksServerLeader();
-       for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
-         event.push(*itRank,1,msg);
-       contextClientTmp->sendEvent(event);
-     }
-     else contextClientTmp->sendEvent(event);
+      // Use correct context client to send message
+     int nbSrvPools = (hasServer) ? clientPrimServer.size() : 1;
+     for (int i = 0; i < nbSrvPools; ++i)
+     {
+       CContextClient* contextClientTmp = (0 != clientPrimServer.size()) ? clientPrimServer[i] : client;
+       CEventClient event(getType(),EVENT_ID_POST_PROCESS_GLOBAL_ATTRIBUTES);
+
+       if (contextClientTmp->isServerLeader())
+       {
+         CMessage msg;
+         msg<<this->getIdServer();
+         const std::list<int>& ranks = contextClientTmp->getRanksServerLeader();
+         for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+           event.push(*itRank,1,msg);
+         contextClientTmp->sendEvent(event);
+       }
+       else contextClientTmp->sendEvent(event);
+     }
    }
 
@@ -1028,17 +1032,21 @@
    {
       // Use correct context client to send message
-     CContextClient* contextClientTmp = (0 != clientPrimServer) ? clientPrimServer : client;
-     CEventClient event(getType(),EVENT_ID_PROCESS_GRID_ENABLED_FIELDS);
-
-     if (contextClientTmp->isServerLeader())
-     {
-       CMessage msg;
-       msg<<this->getIdServer();
-       const std::list<int>& ranks = contextClientTmp->getRanksServerLeader();
-       for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
-         event.push(*itRank,1,msg);
-       contextClientTmp->sendEvent(event);
-     }
-     else contextClientTmp->sendEvent(event);
+     int nbSrvPools = (hasServer) ? clientPrimServer.size() : 1;
+     for (int i = 0; i < nbSrvPools; ++i)
+     {
+       CContextClient* contextClientTmp = (0 != clientPrimServer.size()) ? clientPrimServer[i] : client;
+       CEventClient event(getType(),EVENT_ID_PROCESS_GRID_ENABLED_FIELDS);
+
+       if (contextClientTmp->isServerLeader())
+       {
+         CMessage msg;
+         msg<<this->getIdServer();
+         const std::list<int>& ranks = contextClientTmp->getRanksServerLeader();
+         for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+           event.push(*itRank,1,msg);
+         contextClientTmp->sendEvent(event);
+       }
+       else contextClientTmp->sendEvent(event);
+     }
    }
 
Index: XIOS/dev/dev_olga/src/node/domain.cpp
===================================================================
--- XIOS/dev/dev_olga/src/node/domain.cpp	(revision 1026)
+++ XIOS/dev/dev_olga/src/node/domain.cpp	(revision 1027)
@@ -1495,186 +1495,190 @@
   {
     CContext* context=CContext::getCurrent() ;
-    CContextClient* client = (0 != context->clientPrimServer) ? context->clientPrimServer : context->client;
-    int nbServer=client->serverSize;
-    int rank = client->clientRank;
-    bool doComputeGlobalIndexServer = true;
-
-    int i,j,i_ind,j_ind, nbIndex, nbIndexZoom;
-    int global_zoom_iend=global_zoom_ibegin+global_zoom_ni-1 ;
-    int global_zoom_jend=global_zoom_jbegin+global_zoom_nj-1 ;
-
-    // Precompute number of index
-    int globalIndexCountZoom = 0;
-    nbIndex = i_index.numElements();
-    // for (i = 0; i < nbIndex; ++i)
-    // {
-    //   i_ind=i_index(i);
-    //   j_ind=j_index(i);
-
-    //   if (i_ind >= global_zoom_ibegin && i_ind <= global_zoom_iend && j_ind >= global_zoom_jbegin && j_ind <= global_zoom_jend)
-    //   {
-    //     ++globalIndexCountZoom;
-    //   }
-    // }
-
-    // int globalIndexWrittenCount = 0;
-    // if (isCompressible_)
-    // {
-    //   for (i = 0; i < data_i_index.numElements(); ++i)
-    //   {
-    //     i_ind = CDistributionClient::getDomainIndex(data_i_index(i), data_j_index(i),
-    //                                                 data_ibegin, data_jbegin, data_dim, ni,
-    //                                                 j_ind);
-    //     if (i_ind >= 0 && i_ind < ni && j_ind >= 0 && j_ind < nj && mask_1d(i_ind + j_ind * ni))
-    //     {
-    //       i_ind += ibegin;
-    //       j_ind += jbegin;
-    //       if (i_ind >= global_zoom_ibegin && i_ind <= global_zoom_iend && j_ind >= global_zoom_jbegin && j_ind <= global_zoom_jend)
-    //         ++globalIndexWrittenCount;
-    //     }
-    //   }
-    // }
-
-    // Fill in index
-    
-    CArray<size_t,1> localIndexDomainZoom(globalIndexCountZoom);
-    CArray<size_t,1> globalIndexDomain(nbIndex);
-    size_t globalIndex;
-    int globalIndexCount = 0;
-    
-
-    for (i = 0; i < nbIndex; ++i)
-    {
-      i_ind=i_index(i);
-      j_ind=j_index(i);
-      globalIndex = i_ind + j_ind * ni_glo;
-      globalIndexDomain(globalIndexCount) = globalIndex;
-      globalLocalIndexMap_[globalIndex] = i;
-      ++globalIndexCount;
-    }
-
-    nbIndexZoom = zoom_i_index.numElements();
-    CArray<size_t,1> globalIndexDomainZoom(nbIndexZoom);
-    globalIndexCountZoom = 0;
-    for (i = 0; i < nbIndexZoom; ++i)
-    {
-      i_ind=zoom_i_index(i);
-      j_ind=zoom_j_index(i);
-      globalIndex = i_ind + j_ind * ni_glo;
-      globalIndexDomainZoom(globalIndexCountZoom) = globalIndex;
-
-      ++globalIndexCountZoom;
-      // if (i_ind >= global_zoom_ibegin && i_ind <= global_zoom_iend && j_ind >= global_zoom_jbegin && j_ind <= global_zoom_jend)
+    int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1;
+    for (int i = 0; i < nbSrvPools; ++i)
+    {
+      CContextClient* client = (0 != context->clientPrimServer.size()) ? context->clientPrimServer[i] : context->client;
+      int nbServer=client->serverSize;
+      int rank = client->clientRank;
+      bool doComputeGlobalIndexServer = true;
+
+      int i,j,i_ind,j_ind, nbIndex, nbIndexZoom;
+      int global_zoom_iend=global_zoom_ibegin+global_zoom_ni-1 ;
+      int global_zoom_jend=global_zoom_jbegin+global_zoom_nj-1 ;
+
+      // Precompute number of index
+      int globalIndexCountZoom = 0;
+      nbIndex = i_index.numElements();
+      // for (i = 0; i < nbIndex; ++i)
       // {
-      //   globalIndexDomainZoom(globalIndexCountZoom) = globalIndex;
-      //   localIndexDomainZoom(globalIndexCountZoom) = i;
-      //   ++globalIndexCountZoom;
+      //   i_ind=i_index(i);
+      //   j_ind=j_index(i);
+
+      //   if (i_ind >= global_zoom_ibegin && i_ind <= global_zoom_iend && j_ind >= global_zoom_jbegin && j_ind <= global_zoom_jend)
+      //   {
+      //     ++globalIndexCountZoom;
+      //   }
       // }
-    }
-
-    // CArray<int,1> globalIndexWrittenDomain(globalIndexWrittenCount);
-    // if (isCompressible_)
-    // {
-    //   globalIndexWrittenCount = 0;
-    //   for (i = 0; i < data_i_index.numElements(); ++i)
-    //   {
-    //     i_ind = CDistributionClient::getDomainIndex(data_i_index(i), data_j_index(i),
-    //                                                 data_ibegin, data_jbegin, data_dim, ni,
-    //                                                 j_ind);
-    //     if (i_ind >= 0 && i_ind < ni && j_ind >= 0 && j_ind < nj && mask_1d(i_ind + j_ind * ni))
-    //     {
-    //       i_ind += ibegin;
-    //       j_ind += jbegin;
-    //       if (i_ind >= global_zoom_ibegin && i_ind <= global_zoom_iend && j_ind >= global_zoom_jbegin && j_ind <= global_zoom_jend)
-    //       {
-    //         globalIndexWrittenDomain(globalIndexWrittenCount) = i_ind + j_ind * ni_glo;
-    //         ++globalIndexWrittenCount;
-    //       }
-    //     }
-    //   }
-    // }
-
-    size_t globalSizeIndex = 1, indexBegin, indexEnd;
-    int range, clientSize = client->clientSize;
-    std::vector<int> nGlobDomain(2);
-    nGlobDomain[0] = this->ni_glo;
-    nGlobDomain[1] = this->nj_glo;
-    for (int i = 0; i < nGlobDomain.size(); ++i) globalSizeIndex *= nGlobDomain[i];
-    indexBegin = 0;
-    if (globalSizeIndex <= clientSize)
-    {
-      indexBegin = rank%globalSizeIndex;
-      indexEnd = indexBegin;
-    }
-    else
-    {
-      for (int i = 0; i < clientSize; ++i)
-      {
-        range = globalSizeIndex / clientSize;
-        if (i < (globalSizeIndex%clientSize)) ++range;
-        if (i == client->clientRank) break;
-        indexBegin += range;
-      }
-      indexEnd = indexBegin + range - 1;
-    }
-
-    CServerDistributionDescription serverDescription(nGlobDomain, nbServer);
-    if (isUnstructed_) serverDescription.computeServerGlobalIndexInRange(std::make_pair<size_t,size_t>(indexBegin, indexEnd), 0);
-    else serverDescription.computeServerGlobalIndexInRange(std::make_pair<size_t,size_t>(indexBegin, indexEnd), 1);
-
-    CClientServerMapping* clientServerMap = new CClientServerMappingDistributed(serverDescription.getGlobalIndexRange(),
-                                                                                client->intraComm);
-    clientServerMap->computeServerIndexMapping(globalIndexDomain);
-    CClientServerMapping::GlobalIndexMap& globalIndexDomainOnServer = clientServerMap->getGlobalIndexOnServer();
-
-    CClientServerMapping::GlobalIndexMap::const_iterator it  = globalIndexDomainOnServer.begin(),
-                                                         ite = globalIndexDomainOnServer.end();
-    // typedef XIOSBinarySearchWithIndex<size_t> BinarySearch;
-    // std::vector<int>::iterator itVec;
-    
-    // indSrv_.clear();
-    // indWrittenSrv_.clear();
-    // for (; it != ite; ++it)
-    // {
-    //   int rank = it->first;
-    //   int indexSize = it->second.size();
-    //   std::vector<int> permutIndex(indexSize);
-    //   XIOSAlgorithms::fillInIndex(indexSize, permutIndex);
-    //   XIOSAlgorithms::sortWithIndex<size_t, CVectorStorage>(it->second, permutIndex);
-    //   BinarySearch binSearch(it->second);
-    //   int nb = globalIndexDomainZoom.numElements();
-    //   for (int i = 0; i < nb; ++i)
-    //   {
-    //     if (binSearch.search(permutIndex.begin(), permutIndex.end(), globalIndexDomainZoom(i), itVec))
-    //     {
-    //       indSrv_[rank].push_back(localIndexDomainZoom(i));
-    //     }
-    //   }
-    //   for (int i = 0; i < globalIndexWrittenDomain.numElements(); ++i)
-    //   {
-    //     if (binSearch.search(permutIndex.begin(), permutIndex.end(), globalIndexWrittenDomain(i), itVec))
-    //     {
-    //       indWrittenSrv_[rank].push_back(globalIndexWrittenDomain(i));
-    //     }
-    //   }
-    // }
-
-    connectedServerRank_.clear();
-    for (it = globalIndexDomainOnServer.begin(); it != ite; ++it) {
-      connectedServerRank_.push_back(it->first);
-    }
-
-    indSrv_.swap(globalIndexDomainOnServer);
-    nbConnectedClients_ = clientServerMap->computeConnectedClients(client->serverSize, client->clientSize, client->intraComm, connectedServerRank_);
-
-    clientServerMap->computeServerIndexMapping(globalIndexDomainZoom);
-    CClientServerMapping::GlobalIndexMap& globalIndexDomainZoomOnServer = clientServerMap->getGlobalIndexOnServer();
-    indZoomSrv_.swap(globalIndexDomainZoomOnServer);
-    std::vector<int> connectedServerZoomRank(indZoomSrv_.size());
-    for (it = indZoomSrv_.begin(); it != indZoomSrv_.end(); ++it)
-      connectedServerZoomRank.push_back(it->first);
-    nbConnectedClientsZoom_ = clientServerMap->computeConnectedClients(client->serverSize, client->clientSize, client->intraComm, connectedServerZoomRank);       
-
-    delete clientServerMap;
+
+      // int globalIndexWrittenCount = 0;
+      // if (isCompressible_)
+      // {
+      //   for (i = 0; i < data_i_index.numElements(); ++i)
+      //   {
+      //     i_ind = CDistributionClient::getDomainIndex(data_i_index(i), data_j_index(i),
+      //                                                 data_ibegin, data_jbegin, data_dim, ni,
+      //                                                 j_ind);
+      //     if (i_ind >= 0 && i_ind < ni && j_ind >= 0 && j_ind < nj && mask_1d(i_ind + j_ind * ni))
+      //     {
+      //       i_ind += ibegin;
+      //       j_ind += jbegin;
+      //       if (i_ind >= global_zoom_ibegin && i_ind <= global_zoom_iend && j_ind >= global_zoom_jbegin && j_ind <= global_zoom_jend)
+      //         ++globalIndexWrittenCount;
+      //     }
+      //   }
+      // }
+
+      // Fill in index
+
+      CArray<size_t,1> localIndexDomainZoom(globalIndexCountZoom);
+      CArray<size_t,1> globalIndexDomain(nbIndex);
+      size_t globalIndex;
+      int globalIndexCount = 0;
+
+
+      for (i = 0; i < nbIndex; ++i)
+      {
+        i_ind=i_index(i);
+        j_ind=j_index(i);
+        globalIndex = i_ind + j_ind * ni_glo;
+        globalIndexDomain(globalIndexCount) = globalIndex;
+        globalLocalIndexMap_[globalIndex] = i;
+        ++globalIndexCount;
+      }
+
+      nbIndexZoom = zoom_i_index.numElements();
+      CArray<size_t,1> globalIndexDomainZoom(nbIndexZoom);
+      globalIndexCountZoom = 0;
+      for (i = 0; i < nbIndexZoom; ++i)
+      {
+        i_ind=zoom_i_index(i);
+        j_ind=zoom_j_index(i);
+        globalIndex = i_ind + j_ind * ni_glo;
+        globalIndexDomainZoom(globalIndexCountZoom) = globalIndex;
+
+        ++globalIndexCountZoom;
+        // if (i_ind >= global_zoom_ibegin && i_ind <= global_zoom_iend && j_ind >= global_zoom_jbegin && j_ind <= global_zoom_jend)
+        // {
+        //   globalIndexDomainZoom(globalIndexCountZoom) = globalIndex;
+        //   localIndexDomainZoom(globalIndexCountZoom) = i;
+        //   ++globalIndexCountZoom;
+        // }
+      }
+
+      // CArray<int,1> globalIndexWrittenDomain(globalIndexWrittenCount);
+      // if (isCompressible_)
+      // {
+      //   globalIndexWrittenCount = 0;
+      //   for (i = 0; i < data_i_index.numElements(); ++i)
+      //   {
+      //     i_ind = CDistributionClient::getDomainIndex(data_i_index(i), data_j_index(i),
+      //                                                 data_ibegin, data_jbegin, data_dim, ni,
+      //                                                 j_ind);
+      //     if (i_ind >= 0 && i_ind < ni && j_ind >= 0 && j_ind < nj && mask_1d(i_ind + j_ind * ni))
+      //     {
+      //       i_ind += ibegin;
+      //       j_ind += jbegin;
+      //       if (i_ind >= global_zoom_ibegin && i_ind <= global_zoom_iend && j_ind >= global_zoom_jbegin && j_ind <= global_zoom_jend)
+      //       {
+      //         globalIndexWrittenDomain(globalIndexWrittenCount) = i_ind + j_ind * ni_glo;
+      //         ++globalIndexWrittenCount;
+      //       }
+      //     }
+      //   }
+      // }
+
+      size_t globalSizeIndex = 1, indexBegin, indexEnd;
+      int range, clientSize = client->clientSize;
+      std::vector<int> nGlobDomain(2);
+      nGlobDomain[0] = this->ni_glo;
+      nGlobDomain[1] = this->nj_glo;
+      for (int i = 0; i < nGlobDomain.size(); ++i) globalSizeIndex *= nGlobDomain[i];
+      indexBegin = 0;
+      if (globalSizeIndex <= clientSize)
+      {
+        indexBegin = rank%globalSizeIndex;
+        indexEnd = indexBegin;
+      }
+      else
+      {
+        for (int i = 0; i < clientSize; ++i)
+        {
+          range = globalSizeIndex / clientSize;
+          if (i < (globalSizeIndex%clientSize)) ++range;
+          if (i == client->clientRank) break;
+          indexBegin += range;
+        }
+        indexEnd = indexBegin + range - 1;
+      }
+
+      CServerDistributionDescription serverDescription(nGlobDomain, nbServer);
+      if (isUnstructed_) serverDescription.computeServerGlobalIndexInRange(std::make_pair<size_t,size_t>(indexBegin, indexEnd), 0);
+      else serverDescription.computeServerGlobalIndexInRange(std::make_pair<size_t,size_t>(indexBegin, indexEnd), 1);
+
+      CClientServerMapping* clientServerMap = new CClientServerMappingDistributed(serverDescription.getGlobalIndexRange(),
+                                                                                  client->intraComm);
+      clientServerMap->computeServerIndexMapping(globalIndexDomain);
+      CClientServerMapping::GlobalIndexMap& globalIndexDomainOnServer = clientServerMap->getGlobalIndexOnServer();
+
+      CClientServerMapping::GlobalIndexMap::const_iterator it  = globalIndexDomainOnServer.begin(),
+                                                           ite = globalIndexDomainOnServer.end();
+      // typedef XIOSBinarySearchWithIndex<size_t> BinarySearch;
+      // std::vector<int>::iterator itVec;
+
+      // indSrv_.clear();
+      // indWrittenSrv_.clear();
+      // for (; it != ite; ++it)
+      // {
+      //   int rank = it->first;
+      //   int indexSize = it->second.size();
+      //   std::vector<int> permutIndex(indexSize);
+      //   XIOSAlgorithms::fillInIndex(indexSize, permutIndex);
+      //   XIOSAlgorithms::sortWithIndex<size_t, CVectorStorage>(it->second, permutIndex);
+      //   BinarySearch binSearch(it->second);
+      //   int nb = globalIndexDomainZoom.numElements();
+      //   for (int i = 0; i < nb; ++i)
+      //   {
+      //     if (binSearch.search(permutIndex.begin(), permutIndex.end(), globalIndexDomainZoom(i), itVec))
+      //     {
+      //       indSrv_[rank].push_back(localIndexDomainZoom(i));
+      //     }
+      //   }
+      //   for (int i = 0; i < globalIndexWrittenDomain.numElements(); ++i)
+      //   {
+      //     if (binSearch.search(permutIndex.begin(), permutIndex.end(), globalIndexWrittenDomain(i), itVec))
+      //     {
+      //       indWrittenSrv_[rank].push_back(globalIndexWrittenDomain(i));
+      //     }
+      //   }
+      // }
+
+      connectedServerRank_.clear();
+      for (it = globalIndexDomainOnServer.begin(); it != ite; ++it) {
+        connectedServerRank_.push_back(it->first);
+      }
+
+      indSrv_.swap(globalIndexDomainOnServer);
+      nbConnectedClients_ = clientServerMap->computeConnectedClients(client->serverSize, client->clientSize, client->intraComm, connectedServerRank_);
+
+      clientServerMap->computeServerIndexMapping(globalIndexDomainZoom);
+      CClientServerMapping::GlobalIndexMap& globalIndexDomainZoomOnServer = clientServerMap->getGlobalIndexOnServer();
+      indZoomSrv_.swap(globalIndexDomainZoomOnServer);
+      std::vector<int> connectedServerZoomRank(indZoomSrv_.size());
+      for (it = indZoomSrv_.begin(); it != indZoomSrv_.end(); ++it)
+        connectedServerZoomRank.push_back(it->first);
+      nbConnectedClientsZoom_ = clientServerMap->computeConnectedClients(client->serverSize, client->clientSize, client->intraComm, connectedServerZoomRank);
+
+      delete clientServerMap;
+    }
   }
 
@@ -1706,61 +1710,65 @@
     int ns, n, i, j, ind, nv, idx;
     CContext* context = CContext::getCurrent();
-    CContextClient* client = (0 != context->clientPrimServer) ? context->clientPrimServer : context->client;
-
-    CEventClient eventIndex(getType(), EVENT_ID_INDEX);
-
-    list<CMessage> list_msgsIndex;
-    list<CArray<int,1> > list_indZoom, list_writtenInd, list_indGlob;
-
-    boost::unordered_map<int, vector<size_t> >::const_iterator itIndex, iteIndex, itZoom, iteZoom;
-    iteIndex = indSrv_.end(); iteZoom = indZoomSrv_.end();
-    for (int k = 0; k < connectedServerRank_.size(); ++k)
-    {
-      int nbIndGlob = 0;
-      int rank = connectedServerRank_[k];
-      itIndex = indSrv_.find(rank);
-      if (iteIndex != itIndex)
-        nbIndGlob = itIndex->second.size();
-      int nbIndZoom = 0;
-      itZoom = indZoomSrv_.find(rank);
-      if (iteZoom != itZoom)
-        nbIndZoom = itZoom->second.size(); 
-
-      list_indGlob.push_back(CArray<int,1>(nbIndGlob));
-      list_indZoom.push_back(CArray<int,1>(nbIndZoom));
-
-      CArray<int,1>& indZoom = list_indZoom.back();
-      CArray<int,1>& indGlob = list_indGlob.back();      
-      for (n = 0; n < nbIndGlob; ++n)
-      {
-        indGlob(n) = static_cast<int>(itIndex->second[n]);        
-      }
-
-      for (n = 0; n < nbIndZoom; ++n)
-      {
-        indZoom(n) = static_cast<int>(itZoom->second[n]);        
-      }
-
-      list_msgsIndex.push_back(CMessage());
-      list_msgsIndex.back() << this->getId() << (int)type; // enum ne fonctionne pour les message => ToFix
-      list_msgsIndex.back() << isCurvilinear;
-      list_msgsIndex.back() << list_indGlob.back() << list_indZoom.back(); //list_indi.back() << list_indj.back();
-
-      // if (isCompressible_)
-      // {
-      //   std::vector<int>& writtenIndSrc = indWrittenSrv_[rank];
-      //   list_writtenInd.push_back(CArray<int,1>(writtenIndSrc.size()));
-      //   CArray<int,1>& writtenInd = list_writtenInd.back();
-
-      //   for (n = 0; n < writtenInd.numElements(); ++n)
-      //     writtenInd(n) = writtenIndSrc[n];
-
-      //   list_msgsIndex.back() << writtenInd;
-      // }
-
-      eventIndex.push(rank, nbConnectedClients_[rank], list_msgsIndex.back());
-    }
-
-    client->sendEvent(eventIndex);
+    int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1;
+    for (int i = 0; i < nbSrvPools; ++i)
+    {
+      CContextClient* client = (0 != context->clientPrimServer.size()) ? context->clientPrimServer[i] : context->client;
+
+      CEventClient eventIndex(getType(), EVENT_ID_INDEX);
+
+      list<CMessage> list_msgsIndex;
+      list<CArray<int,1> > list_indZoom, list_writtenInd, list_indGlob;
+
+      boost::unordered_map<int, vector<size_t> >::const_iterator itIndex, iteIndex, itZoom, iteZoom;
+      iteIndex = indSrv_.end(); iteZoom = indZoomSrv_.end();
+      for (int k = 0; k < connectedServerRank_.size(); ++k)
+      {
+        int nbIndGlob = 0;
+        int rank = connectedServerRank_[k];
+        itIndex = indSrv_.find(rank);
+        if (iteIndex != itIndex)
+          nbIndGlob = itIndex->second.size();
+        int nbIndZoom = 0;
+        itZoom = indZoomSrv_.find(rank);
+        if (iteZoom != itZoom)
+          nbIndZoom = itZoom->second.size();
+
+        list_indGlob.push_back(CArray<int,1>(nbIndGlob));
+        list_indZoom.push_back(CArray<int,1>(nbIndZoom));
+
+        CArray<int,1>& indZoom = list_indZoom.back();
+        CArray<int,1>& indGlob = list_indGlob.back();
+        for (n = 0; n < nbIndGlob; ++n)
+        {
+          indGlob(n) = static_cast<int>(itIndex->second[n]);
+        }
+
+        for (n = 0; n < nbIndZoom; ++n)
+        {
+          indZoom(n) = static_cast<int>(itZoom->second[n]);
+        }
+
+        list_msgsIndex.push_back(CMessage());
+        list_msgsIndex.back() << this->getId() << (int)type; // enum ne fonctionne pour les message => ToFix
+        list_msgsIndex.back() << isCurvilinear;
+        list_msgsIndex.back() << list_indGlob.back() << list_indZoom.back(); //list_indi.back() << list_indj.back();
+
+        // if (isCompressible_)
+        // {
+        //   std::vector<int>& writtenIndSrc = indWrittenSrv_[rank];
+        //   list_writtenInd.push_back(CArray<int,1>(writtenIndSrc.size()));
+        //   CArray<int,1>& writtenInd = list_writtenInd.back();
+
+        //   for (n = 0; n < writtenInd.numElements(); ++n)
+        //     writtenInd(n) = writtenIndSrc[n];
+
+        //   list_msgsIndex.back() << writtenInd;
+        // }
+
+        eventIndex.push(rank, nbConnectedClients_[rank], list_msgsIndex.back());
+      }
+
+      client->sendEvent(eventIndex);
+    }
   }
 
@@ -1772,35 +1780,39 @@
     int ns, n, i, j, ind, nv, idx;
     CContext* context = CContext::getCurrent();
-    CContextClient* client = (0 != context->clientPrimServer) ? context->clientPrimServer : context->client;
-
-    // send area for each connected server
-    CEventClient eventMask(getType(), EVENT_ID_MASK);
-
-    list<CMessage> list_msgsMask;
-    list<CArray<bool,1> > list_mask;
-
-    boost::unordered_map<int, vector<size_t> >::const_iterator it, iteMap;
-    iteMap = indSrv_.end();
-    for (int k = 0; k < connectedServerRank_.size(); ++k)
-    {
-      int nbData = 0;
-      int rank = connectedServerRank_[k];
-      it = indSrv_.find(rank);
-      if (iteMap != it)
-        nbData = it->second.size();
-      list_mask.push_back(CArray<bool,1>(nbData));
-
-      const std::vector<size_t>& temp = it->second;
-      for (n = 0; n < nbData; ++n)
-      {
-        idx = static_cast<int>(it->second[n]);
-        list_mask.back()(n) = mask_1d(globalLocalIndexMap_[idx]);          
-      }
-
-      list_msgsMask.push_back(CMessage());
-      list_msgsMask.back() << this->getId() << list_mask.back();
-      eventMask.push(rank, nbConnectedClients_[rank], list_msgsMask.back());
-    }
-    client->sendEvent(eventMask);
+    int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1;
+    for (int i = 0; i < nbSrvPools; ++i)
+    {
+      CContextClient* client = (0 != context->clientPrimServer.size()) ? context->clientPrimServer[i] : context->client;
+
+      // send area for each connected server
+      CEventClient eventMask(getType(), EVENT_ID_MASK);
+
+      list<CMessage> list_msgsMask;
+      list<CArray<bool,1> > list_mask;
+
+      boost::unordered_map<int, vector<size_t> >::const_iterator it, iteMap;
+      iteMap = indSrv_.end();
+      for (int k = 0; k < connectedServerRank_.size(); ++k)
+      {
+        int nbData = 0;
+        int rank = connectedServerRank_[k];
+        it = indSrv_.find(rank);
+        if (iteMap != it)
+          nbData = it->second.size();
+        list_mask.push_back(CArray<bool,1>(nbData));
+
+        const std::vector<size_t>& temp = it->second;
+        for (n = 0; n < nbData; ++n)
+        {
+          idx = static_cast<int>(it->second[n]);
+          list_mask.back()(n) = mask_1d(globalLocalIndexMap_[idx]);
+        }
+
+        list_msgsMask.push_back(CMessage());
+        list_msgsMask.back() << this->getId() << list_mask.back();
+        eventMask.push(rank, nbConnectedClients_[rank], list_msgsMask.back());
+      }
+      client->sendEvent(eventMask);
+    }
   }
 
@@ -1814,36 +1826,40 @@
     int ns, n, i, j, ind, nv, idx;
     CContext* context = CContext::getCurrent();
-    CContextClient* client = (0 != context->clientPrimServer) ? context->clientPrimServer : context->client;
-
-    // send area for each connected server
-    CEventClient eventArea(getType(), EVENT_ID_AREA);
-
-    list<CMessage> list_msgsArea;
-    list<CArray<double,1> > list_area;
-
-    boost::unordered_map<int, vector<size_t> >::const_iterator it, iteMap;
-    iteMap = indSrv_.end();
-    for (int k = 0; k < connectedServerRank_.size(); ++k)
-    {
-      int nbData = 0;
-      int rank = connectedServerRank_[k];
-      it = indSrv_.find(rank);
-      if (iteMap != it)
-        nbData = it->second.size();
-      list_area.push_back(CArray<double,1>(nbData));
-
-      const std::vector<size_t>& temp = it->second;
-      for (n = 0; n < nbData; ++n)
-      {
-        idx = static_cast<int>(it->second[n]);
-        list_area.back()(n) = areavalue(globalLocalIndexMap_[idx]); 
-      }
-
-      list_msgsArea.push_back(CMessage());
-      list_msgsArea.back() << this->getId() << hasArea;
-      list_msgsArea.back() << list_area.back();
-      eventArea.push(rank, nbConnectedClients_[rank], list_msgsArea.back());
-    }
-    client->sendEvent(eventArea);
+    int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1;
+    for (int i = 0; i < nbSrvPools; ++i)
+    {
+      CContextClient* client = (0 != context->clientPrimServer.size()) ? context->clientPrimServer[i] : context->client;
+
+      // send area for each connected server
+      CEventClient eventArea(getType(), EVENT_ID_AREA);
+
+      list<CMessage> list_msgsArea;
+      list<CArray<double,1> > list_area;
+
+      boost::unordered_map<int, vector<size_t> >::const_iterator it, iteMap;
+      iteMap = indSrv_.end();
+      for (int k = 0; k < connectedServerRank_.size(); ++k)
+      {
+        int nbData = 0;
+        int rank = connectedServerRank_[k];
+        it = indSrv_.find(rank);
+        if (iteMap != it)
+          nbData = it->second.size();
+        list_area.push_back(CArray<double,1>(nbData));
+
+        const std::vector<size_t>& temp = it->second;
+        for (n = 0; n < nbData; ++n)
+        {
+          idx = static_cast<int>(it->second[n]);
+          list_area.back()(n) = areavalue(globalLocalIndexMap_[idx]);
+        }
+
+        list_msgsArea.push_back(CMessage());
+        list_msgsArea.back() << this->getId() << hasArea;
+        list_msgsArea.back() << list_area.back();
+        eventArea.push(rank, nbConnectedClients_[rank], list_msgsArea.back());
+      }
+      client->sendEvent(eventArea);
+    }
   }
 
@@ -1859,74 +1875,78 @@
     int ns, n, i, j, ind, nv, idx;
     CContext* context = CContext::getCurrent();
-    CContextClient* client = (0 != context->clientPrimServer) ? context->clientPrimServer : context->client;
-
-    // send lon lat for each connected server
-    CEventClient eventLon(getType(), EVENT_ID_LON);
-    CEventClient eventLat(getType(), EVENT_ID_LAT);
-
-    list<CMessage> list_msgsLon, list_msgsLat;
-    list<CArray<double,1> > list_lon, list_lat;
-    list<CArray<double,2> > list_boundslon, list_boundslat;
-
-    boost::unordered_map<int, vector<size_t> >::const_iterator it, iteMap;
-    iteMap = indSrv_.end();
-    for (int k = 0; k < connectedServerRank_.size(); ++k)
-    {
-      int nbData = 0;
-      int rank = connectedServerRank_[k];
-      it = indSrv_.find(rank);
-      if (iteMap != it)
-        nbData = it->second.size();
-
-      list_lon.push_back(CArray<double,1>(nbData));
-      list_lat.push_back(CArray<double,1>(nbData));
-
-      if (hasBounds)
-      {
-        list_boundslon.push_back(CArray<double,2>(nvertex, nbData));
-        list_boundslat.push_back(CArray<double,2>(nvertex, nbData));
-      }
-
-      CArray<double,1>& lon = list_lon.back();
-      CArray<double,1>& lat = list_lat.back();
-      const std::vector<size_t>& temp = it->second;
-      for (n = 0; n < nbData; ++n)
-      {
-        idx = static_cast<int>(it->second[n]);
-        int localInd = globalLocalIndexMap_[idx];
-        lon(n) = lonvalue(localInd);
-        lat(n) = latvalue(localInd);
+    int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1;
+    for (int i = 0; i < nbSrvPools; ++i)
+    {
+      CContextClient* client = (0 != context->clientPrimServer.size()) ? context->clientPrimServer[i] : context->client;
+
+      // send lon lat for each connected server
+      CEventClient eventLon(getType(), EVENT_ID_LON);
+      CEventClient eventLat(getType(), EVENT_ID_LAT);
+
+      list<CMessage> list_msgsLon, list_msgsLat;
+      list<CArray<double,1> > list_lon, list_lat;
+      list<CArray<double,2> > list_boundslon, list_boundslat;
+
+      boost::unordered_map<int, vector<size_t> >::const_iterator it, iteMap;
+      iteMap = indSrv_.end();
+      for (int k = 0; k < connectedServerRank_.size(); ++k)
+      {
+        int nbData = 0;
+        int rank = connectedServerRank_[k];
+        it = indSrv_.find(rank);
+        if (iteMap != it)
+          nbData = it->second.size();
+
+        list_lon.push_back(CArray<double,1>(nbData));
+        list_lat.push_back(CArray<double,1>(nbData));
 
         if (hasBounds)
         {
-          CArray<double,2>& boundslon = list_boundslon.back();
-          CArray<double,2>& boundslat = list_boundslat.back();
-
-          for (nv = 0; nv < nvertex; ++nv)
+          list_boundslon.push_back(CArray<double,2>(nvertex, nbData));
+          list_boundslat.push_back(CArray<double,2>(nvertex, nbData));
+        }
+
+        CArray<double,1>& lon = list_lon.back();
+        CArray<double,1>& lat = list_lat.back();
+        const std::vector<size_t>& temp = it->second;
+        for (n = 0; n < nbData; ++n)
+        {
+          idx = static_cast<int>(it->second[n]);
+          int localInd = globalLocalIndexMap_[idx];
+          lon(n) = lonvalue(localInd);
+          lat(n) = latvalue(localInd);
+
+          if (hasBounds)
           {
-            boundslon(nv, n) = bounds_lonvalue(nv, localInd);
-            boundslat(nv, n) = bounds_latvalue(nv, localInd);
+            CArray<double,2>& boundslon = list_boundslon.back();
+            CArray<double,2>& boundslat = list_boundslat.back();
+
+            for (nv = 0; nv < nvertex; ++nv)
+            {
+              boundslon(nv, n) = bounds_lonvalue(nv, localInd);
+              boundslat(nv, n) = bounds_latvalue(nv, localInd);
+            }
           }
         }
-      }
-
-      list_msgsLon.push_back(CMessage());
-      list_msgsLat.push_back(CMessage());
-
-      list_msgsLon.back() << this->getId() << hasLonLat << list_lon.back() << hasBounds;
-      list_msgsLat.back() << this->getId() << hasLonLat << list_lat.back() << hasBounds;
-
-      if (hasBounds)
-      {
-        list_msgsLon.back() << list_boundslon.back();
-        list_msgsLat.back() << list_boundslat.back();
-      }
-
-      eventLon.push(rank, nbConnectedClients_[rank], list_msgsLon.back());
-      eventLat.push(rank, nbConnectedClients_[rank], list_msgsLat.back());
-    }
-
-    client->sendEvent(eventLon);
-    client->sendEvent(eventLat);
+
+        list_msgsLon.push_back(CMessage());
+        list_msgsLat.push_back(CMessage());
+
+        list_msgsLon.back() << this->getId() << hasLonLat << list_lon.back() << hasBounds;
+        list_msgsLat.back() << this->getId() << hasLonLat << list_lat.back() << hasBounds;
+
+        if (hasBounds)
+        {
+          list_msgsLon.back() << list_boundslon.back();
+          list_msgsLat.back() << list_boundslat.back();
+        }
+
+        eventLon.push(rank, nbConnectedClients_[rank], list_msgsLon.back());
+        eventLat.push(rank, nbConnectedClients_[rank], list_msgsLat.back());
+      }
+
+      client->sendEvent(eventLon);
+      client->sendEvent(eventLat);
+    }
   }
 
@@ -1940,52 +1960,56 @@
     int ns, n, i, j, ind, nv, idx;
     CContext* context = CContext::getCurrent();
-    CContextClient* client = (0 != context->clientPrimServer) ? context->clientPrimServer : context->client;
-
-    // send area for each connected server
-    CEventClient eventDataIndex(getType(), EVENT_ID_DATA_INDEX);
-
-    list<CMessage> list_msgsDataIndex;
-    list<CArray<int,1> > list_data_i_index, list_data_j_index;
-
-    int nbIndex = i_index.numElements();
-    CArray<int,1> dataIIndex(nbIndex), dataJIndex(nbIndex);
-    dataIIndex = -1; dataJIndex = -1, ind = 0;
-    for (idx = 0; idx < data_i_index.numElements(); ++idx)
-    {
-      if ((0 <= data_i_index(idx)) && (data_i_index(idx) < ni) && (ind < nbIndex))
-      {
-        dataIIndex(ind) = data_i_index(idx);
-        dataJIndex(ind) = data_j_index(idx);
-        ++ind;
-      }
-    }
-
-    boost::unordered_map<int, vector<size_t> >::const_iterator it, iteMap;
-    iteMap = indSrv_.end();
-    for (int k = 0; k < connectedServerRank_.size(); ++k)
-    {
-      int nbData = 0;
-      int rank = connectedServerRank_[k];
-      it = indSrv_.find(rank);
-      if (iteMap != it)
-        nbData = it->second.size();
-      list_data_i_index.push_back(CArray<int,1>(nbData));
-      list_data_j_index.push_back(CArray<int,1>(nbData));
-
-      const std::vector<size_t>& temp = it->second;
-      for (n = 0; n < nbData; ++n)
-      {
-        idx = static_cast<int>(it->second[n]);
-        i = globalLocalIndexMap_[idx];
-        list_data_i_index.back()(n) = dataIIndex(i);
-        list_data_j_index.back()(n) = dataJIndex(i);          
-      }
-
-      list_msgsDataIndex.push_back(CMessage());
-      list_msgsDataIndex.back() << this->getId();
-      list_msgsDataIndex.back() << list_data_i_index.back() << list_data_j_index.back();
-      eventDataIndex.push(rank, nbConnectedClients_[rank], list_msgsDataIndex.back());
-    }
-    client->sendEvent(eventDataIndex);
+    int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1;
+    for (int i = 0; i < nbSrvPools; ++i)
+    {
+      CContextClient* client = (0 != context->clientPrimServer.size()) ? context->clientPrimServer[i] : context->client;
+
+      // send area for each connected server
+      CEventClient eventDataIndex(getType(), EVENT_ID_DATA_INDEX);
+
+      list<CMessage> list_msgsDataIndex;
+      list<CArray<int,1> > list_data_i_index, list_data_j_index;
+
+      int nbIndex = i_index.numElements();
+      CArray<int,1> dataIIndex(nbIndex), dataJIndex(nbIndex);
+      dataIIndex = -1; dataJIndex = -1, ind = 0;
+      for (idx = 0; idx < data_i_index.numElements(); ++idx)
+      {
+        if ((0 <= data_i_index(idx)) && (data_i_index(idx) < ni) && (ind < nbIndex))
+        {
+          dataIIndex(ind) = data_i_index(idx);
+          dataJIndex(ind) = data_j_index(idx);
+          ++ind;
+        }
+      }
+
+      boost::unordered_map<int, vector<size_t> >::const_iterator it, iteMap;
+      iteMap = indSrv_.end();
+      for (int k = 0; k < connectedServerRank_.size(); ++k)
+      {
+        int nbData = 0;
+        int rank = connectedServerRank_[k];
+        it = indSrv_.find(rank);
+        if (iteMap != it)
+          nbData = it->second.size();
+        list_data_i_index.push_back(CArray<int,1>(nbData));
+        list_data_j_index.push_back(CArray<int,1>(nbData));
+
+        const std::vector<size_t>& temp = it->second;
+        for (n = 0; n < nbData; ++n)
+        {
+          idx = static_cast<int>(it->second[n]);
+          i = globalLocalIndexMap_[idx];
+          list_data_i_index.back()(n) = dataIIndex(i);
+          list_data_j_index.back()(n) = dataJIndex(i);
+        }
+
+        list_msgsDataIndex.push_back(CMessage());
+        list_msgsDataIndex.back() << this->getId();
+        list_msgsDataIndex.back() << list_data_i_index.back() << list_data_j_index.back();
+        eventDataIndex.push(rank, nbConnectedClients_[rank], list_msgsDataIndex.back());
+      }
+      client->sendEvent(eventDataIndex);
+    }
   }
   
Index: XIOS/dev/dev_olga/src/node/field.cpp
===================================================================
--- XIOS/dev/dev_olga/src/node/field.cpp	(revision 1026)
+++ XIOS/dev/dev_olga/src/node/field.cpp	(revision 1027)
@@ -991,5 +991,5 @@
      {
         if (!instantDataFilter)
-          instantDataFilter = clientSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(grid));
+          instantDataFilter = clientSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid));
 
              // If the field data is to be read by the client or/and written to a file
@@ -1006,5 +1006,5 @@
      {
        if (!instantDataFilter)
-          instantDataFilter = clientSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(grid));
+         instantDataFilter = clientSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid));
 
              // If the field data is to be read by the client or/and written to a file
Index: XIOS/dev/dev_olga/src/node/grid.cpp
===================================================================
--- XIOS/dev/dev_olga/src/node/grid.cpp	(revision 1026)
+++ XIOS/dev/dev_olga/src/node/grid.cpp	(revision 1027)
@@ -273,63 +273,63 @@
    {
      CContext* context = CContext::getCurrent();
-     CContextClient* client= context->hasServer ? context->clientPrimServer : context->client;
-
      int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1;
+
      for (int i = 0; i < nbSrvPools; ++i)
      {
-		 if (isScalarGrid())
-		 {
-		   // if (context->hasClient && !context->hasServer)
-			if (context->hasClient)
-			  if (this->isChecked && doSendingIndex && !isIndexSent) { sendIndexScalarGrid(); this->isIndexSent = true; }
-
-		   if (this->isChecked) return;
-		   // if (context->hasClient && !context->hasServer)
-		   if (context->hasClient)
-		   {
-			  this->computeIndexScalarGrid();
-		   }
-
-//         this->isChecked = true;
+       CContextClient* client= context->hasServer ? context->clientPrimServer[i] : context->client;
+       if (isScalarGrid())
+       {
+         // if (context->hasClient && !context->hasServer)
+        if (context->hasClient)
+          if (this->isChecked && doSendingIndex && !isIndexSent) { sendIndexScalarGrid(); this->isIndexSent = true; }
+
+         if (this->isChecked) return;
+         // if (context->hasClient && !context->hasServer)
+         if (context->hasClient)
+         {
+          this->computeIndexScalarGrid();
+         }
+
+  //         this->isChecked = true;
+           if (!(this->hasTransform() && !this->isTransformed()))
+            this->isChecked = true;
+         return;
+       }
+
+       // if (context->hasClient && !context->hasServer)
+      // if (context->hasClient)
+      //   if (doSendingIndex && !isIndexSent)
+        {
+        if (context->hasClient)
+        {
+          if (this->isChecked && doSendingIndex && !isIndexSent)
+            {sendIndex(); this->isIndexSent = true;}
+        }
+
+        if (this->isChecked) return;
+        this->checkAttributesAfterTransformation();
+        this->checkMask();
+        this->computeIndex();
+    //       this->isChecked = true;
          if (!(this->hasTransform() && !this->isTransformed()))
           this->isChecked = true;
-		   return;
-		 }
-
-		 // if (context->hasClient && !context->hasServer)
-		// if (context->hasClient)
-		//   if (doSendingIndex && !isIndexSent) 
-		  {
-			if (context->hasClient) 
-			{
-			  if (this->isChecked && doSendingIndex && !isIndexSent) 
-			    {sendIndex(); this->isIndexSent = true;}
-			}
-
-			if (this->isChecked) return;
-			this->checkAttributesAfterTransformation();
-			this->checkMask();
-			this->computeIndex();     
-	//       this->isChecked = true;
-		   if (!(this->hasTransform() && !this->isTransformed()))
-		    this->isChecked = true;
-
-		   if (!(this->hasTransform() && (!this->isGenerated())))
-		    this->isChecked = true;
-			
-
-		  }
-
-		//  if (this->isChecked) return;
-
-		//  // if (context->hasClient && !context->hasServer)
-		// // if (context->hasClient)
-		//  {
-		//     this->checkAttributesAfterTransformation();
-		//     this->checkMask();
-		//     this->computeIndex();
-		//  }
-		//  this->isChecked = true;
-     }
+
+         if (!(this->hasTransform() && (!this->isGenerated())))
+          this->isChecked = true;
+
+
+        }
+
+      //  if (this->isChecked) return;
+
+      //  // if (context->hasClient && !context->hasServer)
+      // // if (context->hasClient)
+      //  {
+      //     this->checkAttributesAfterTransformation();
+      //     this->checkMask();
+      //     this->computeIndex();
+      //  }
+      //  this->isChecked = true;
+      }
    }
 
@@ -521,19 +521,23 @@
      CContext* context = CContext::getCurrent();
 
-     CContextClient* client = (context->hasServer) ? context->clientPrimServer : context->client;
-     CContextServer* server = (context->hasServer) ? context->server : 0 ;
-     int rank = (server && !client) ? server->intraCommRank : client->clientRank;
-
-     // First of all, compute distribution on client side
-     if (0 != serverDistribution_)
-       clientDistribution_ = new CDistributionClient(rank, this, serverDistribution_->getGlobalLocalIndex());
-     else
-       clientDistribution_ = new CDistributionClient(rank, this);
-
-     // Get local data index on client     
-     storeIndex_client.resize(clientDistribution_->getLocalDataIndexOnClient().size());
-     int nbStoreIndex = storeIndex_client.numElements();
-     for (int idx = 0; idx < nbStoreIndex; ++idx) storeIndex_client(idx) = (clientDistribution_->getLocalDataIndexOnClient())[idx];
-     isDataDistributed_= clientDistribution_->isDataDistributed();
+     int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1;
+     for (int i = 0; i < nbSrvPools; ++i)
+     {
+       CContextClient* client = (context->hasServer) ? context->clientPrimServer[i] : context->client;
+       CContextServer* server = (context->hasServer) ? context->server : 0 ;
+       int rank = (server && !client) ? server->intraCommRank : client->clientRank;
+
+       // First of all, compute distribution on client side
+       if (0 != serverDistribution_)
+         clientDistribution_ = new CDistributionClient(rank, this, serverDistribution_->getGlobalLocalIndex());
+       else
+         clientDistribution_ = new CDistributionClient(rank, this);
+
+       // Get local data index on client
+       storeIndex_client.resize(clientDistribution_->getLocalDataIndexOnClient().size());
+       int nbStoreIndex = storeIndex_client.numElements();
+       for (int idx = 0; idx < nbStoreIndex; ++idx) storeIndex_client(idx) = (clientDistribution_->getLocalDataIndexOnClient())[idx];
+       isDataDistributed_= clientDistribution_->isDataDistributed();
+     }
    }
 
@@ -541,62 +545,66 @@
    {
      CContext* context = CContext::getCurrent();
-     CContextClient* client = (context->hasServer) ? context->clientPrimServer : context->client;
-
-     connectedServerRank_.clear();
-
-     if (!doGridHaveDataDistributed())
+     int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1;
+     for (int i = 0; i < nbSrvPools; ++i)
      {
-        if (client->isServerLeader())
-        {
-          size_t ssize = clientDistribution_->getLocalDataIndexOnClient().size();
-          const std::list<int>& ranks = client->getRanksServerLeader();
-          for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+       CContextClient* client = (context->hasServer) ? context->clientPrimServer[i] : context->client;
+
+       connectedServerRank_.clear();
+
+       if (!doGridHaveDataDistributed())
+       {
+          if (client->isServerLeader())
           {
-            connectedServerRank_.push_back(*itRank);
-            connectedDataSize_[*itRank] = ssize;
+            size_t ssize = clientDistribution_->getLocalDataIndexOnClient().size();
+            const std::list<int>& ranks = client->getRanksServerLeader();
+            for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+            {
+              connectedServerRank_.push_back(*itRank);
+              connectedDataSize_[*itRank] = ssize;
+            }
           }
-        }
-        return;
+          return;
+       }
+
+       // Compute mapping between client and server
+       std::vector<boost::unordered_map<size_t,std::vector<int> > > indexServerOnElement;
+       CServerDistributionDescription serverDistributionDescription(globalDim_, client->serverSize);
+       serverDistributionDescription.computeServerGlobalByElement(indexServerOnElement,
+                                                                  client->clientRank,
+                                                                  client->clientSize,
+                                                                  axis_domain_order,
+                                                                  positionDimensionDistributed_);
+       computeIndexByElement(indexServerOnElement, globalIndexOnServer_);
+
+       const CDistributionClient::GlobalLocalDataMap& globalLocalIndexSendToServer = clientDistribution_->getGlobalLocalDataSendToServer();
+       CDistributionClient::GlobalLocalDataMap::const_iterator iteGlobalLocalIndexMap = globalLocalIndexSendToServer.end(), itGlobalLocalIndexMap;
+       CClientServerMapping::GlobalIndexMap::const_iterator iteGlobalMap, itbGlobalMap, itGlobalMap;
+       itGlobalMap  = itbGlobalMap = globalIndexOnServer_.begin();
+       iteGlobalMap = globalIndexOnServer_.end();
+
+       for (; itGlobalMap != iteGlobalMap; ++itGlobalMap)
+       {
+         int serverRank = itGlobalMap->first;
+         int indexSize = itGlobalMap->second.size();
+         const std::vector<size_t>& indexVec = itGlobalMap->second;
+         for (int idx = 0; idx < indexSize; ++idx)
+         {
+            itGlobalLocalIndexMap = globalLocalIndexSendToServer.find(indexVec[idx]);
+            if (iteGlobalLocalIndexMap != itGlobalLocalIndexMap)
+            {
+               if (connectedDataSize_.end() == connectedDataSize_.find(serverRank))
+                 connectedDataSize_[serverRank] = 1;
+               else
+                 ++connectedDataSize_[serverRank];
+            }
+         }
+       }
+
+       for (itGlobalMap = itbGlobalMap; itGlobalMap != iteGlobalMap; ++itGlobalMap) {
+         connectedServerRank_.push_back(itGlobalMap->first);
+       }
+
+       nbSenders = clientServerMap_->computeConnectedClients(client->serverSize, client->clientSize, client->intraComm, connectedServerRank_);
      }
-
-     // Compute mapping between client and server
-     std::vector<boost::unordered_map<size_t,std::vector<int> > > indexServerOnElement;
-     CServerDistributionDescription serverDistributionDescription(globalDim_, client->serverSize);
-     serverDistributionDescription.computeServerGlobalByElement(indexServerOnElement,
-                                                                client->clientRank,
-                                                                client->clientSize,
-                                                                axis_domain_order,
-                                                                positionDimensionDistributed_);
-     computeIndexByElement(indexServerOnElement, globalIndexOnServer_);
-
-     const CDistributionClient::GlobalLocalDataMap& globalLocalIndexSendToServer = clientDistribution_->getGlobalLocalDataSendToServer();
-     CDistributionClient::GlobalLocalDataMap::const_iterator iteGlobalLocalIndexMap = globalLocalIndexSendToServer.end(), itGlobalLocalIndexMap;
-     CClientServerMapping::GlobalIndexMap::const_iterator iteGlobalMap, itbGlobalMap, itGlobalMap;
-     itGlobalMap  = itbGlobalMap = globalIndexOnServer_.begin();
-     iteGlobalMap = globalIndexOnServer_.end();
-
-     for (; itGlobalMap != iteGlobalMap; ++itGlobalMap)
-     {
-       int serverRank = itGlobalMap->first;
-       int indexSize = itGlobalMap->second.size();
-       const std::vector<size_t>& indexVec = itGlobalMap->second;
-       for (int idx = 0; idx < indexSize; ++idx)
-       {
-          itGlobalLocalIndexMap = globalLocalIndexSendToServer.find(indexVec[idx]);
-          if (iteGlobalLocalIndexMap != itGlobalLocalIndexMap)
-          {
-             if (connectedDataSize_.end() == connectedDataSize_.find(serverRank))
-               connectedDataSize_[serverRank] = 1;
-             else
-               ++connectedDataSize_[serverRank];
-          }
-       }
-     }
-
-     for (itGlobalMap = itbGlobalMap; itGlobalMap != iteGlobalMap; ++itGlobalMap) {
-       connectedServerRank_.push_back(itGlobalMap->first);
-     }
-
-     nbSenders = clientServerMap_->computeConnectedClients(client->serverSize, client->clientSize, client->intraComm, connectedServerRank_);
    }
 
@@ -1365,145 +1373,149 @@
   {
     CContext* context = CContext::getCurrent();
-    CContextServer* server = (context->hasServer) ? context->server : context->serverPrimServer;
-    CContextClient* client = (context->hasServer) ? context->client : context->clientPrimServer;
-    numberWrittenIndexes_ = totalNumberWrittenIndexes_ = offsetWrittenIndexes_ = 0;
-    connectedServerRank_ = ranks;
-
-    for (int n = 0; n < ranks.size(); n++)
-    {
-      int rank = ranks[n];
-      CBufferIn& buffer = *buffers[n];
-
-      buffer >> isDataDistributed_ >> isCompressible_;
-      size_t dataSize = 0;
-
-      if (0 == serverDistribution_)
-      {
-        int idx = 0, numElement = axis_domain_order.numElements();
-        int ssize = numElement;
-        std::vector<int> indexMap(numElement);
-        for (int i = 0; i < numElement; ++i)
-        {
-          indexMap[i] = idx;
-          if (2 == axis_domain_order(i))
+    int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1;
+    for (int i = 0; i < nbSrvPools; ++i)
+    {
+      CContextServer* server = (context->hasServer) ? context->server : context->serverPrimServer[i];
+      CContextClient* client = (context->hasServer) ? context->client : context->clientPrimServer[i];
+      numberWrittenIndexes_ = totalNumberWrittenIndexes_ = offsetWrittenIndexes_ = 0;
+      connectedServerRank_ = ranks;
+
+      for (int n = 0; n < ranks.size(); n++)
+      {
+        int rank = ranks[n];
+        CBufferIn& buffer = *buffers[n];
+
+        buffer >> isDataDistributed_ >> isCompressible_;
+        size_t dataSize = 0;
+
+        if (0 == serverDistribution_)
+        {
+          int idx = 0, numElement = axis_domain_order.numElements();
+          int ssize = numElement;
+          std::vector<int> indexMap(numElement);
+          for (int i = 0; i < numElement; ++i)
           {
-            ++ssize;
-            idx += 2;
+            indexMap[i] = idx;
+            if (2 == axis_domain_order(i))
+            {
+              ++ssize;
+              idx += 2;
+            }
+            else
+              ++idx;
           }
-          else
-            ++idx;
-        }
-
-        int axisId = 0, domainId = 0, scalarId = 0, globalSize = 1;
-        std::vector<CDomain*> domainList = getDomains();
-        std::vector<CAxis*> axisList = getAxis();
-        std::vector<int> nZoomBegin(ssize), nZoomSize(ssize), nGlob(ssize), nZoomBeginGlobal(ssize), nGlobElement(numElement);
-        std::vector<CArray<int,1> > zoomIndex; 
-        for (int i = 0; i < numElement; ++i)
-        {
-          nGlobElement[i] = globalSize; 
-          if (2 == axis_domain_order(i)) //domain
+
+          int axisId = 0, domainId = 0, scalarId = 0, globalSize = 1;
+          std::vector<CDomain*> domainList = getDomains();
+          std::vector<CAxis*> axisList = getAxis();
+          std::vector<int> nZoomBegin(ssize), nZoomSize(ssize), nGlob(ssize), nZoomBeginGlobal(ssize), nGlobElement(numElement);
+          std::vector<CArray<int,1> > zoomIndex;
+          for (int i = 0; i < numElement; ++i)
           {
-            // nZoomBegin[indexMap[i]] = domainList[domainId]->zoom_ibegin_srv;
-            // nZoomSize[indexMap[i]]  = domainList[domainId]->zoom_ni_srv;
-            // nZoomBeginGlobal[indexMap[i]] = domainList[domainId]->global_zoom_ibegin;
-            // zoomIndex.push_back(domainList[domainId]->zoom_i_index);
-            // nGlob[indexMap[i]] = domainList[domainId]->ni_glo;
-
-            // nZoomBegin[indexMap[i] + 1] = domainList[domainId]->zoom_jbegin_srv;
-            // nZoomSize[indexMap[i] + 1] = domainList[domainId]->zoom_nj_srv;
-            // nZoomBeginGlobal[indexMap[i] + 1] = domainList[domainId]->global_zoom_jbegin;
-            // zoomIndex.push_back(domainList[domainId]->zoom_j_index);
-            // nGlob[indexMap[i] + 1] = domainList[domainId]->nj_glo;
-
-            int nbZoom = domainList[domainId]->zoom_i_index.numElements();            
-            zoomIndex.push_back(CArray<int,1>(nbZoom));
-            CArray<int,1>& zoomDomain = zoomIndex.back();
-            for (int ind = 0; ind < nbZoom; ++ind)
+            nGlobElement[i] = globalSize;
+            if (2 == axis_domain_order(i)) //domain
             {
-              zoomDomain(ind) = domainList[domainId]->zoom_i_index(ind) + domainList[domainId]->zoom_j_index(ind) * domainList[domainId]->ni_glo;  
+              // nZoomBegin[indexMap[i]] = domainList[domainId]->zoom_ibegin_srv;
+              // nZoomSize[indexMap[i]]  = domainList[domainId]->zoom_ni_srv;
+              // nZoomBeginGlobal[indexMap[i]] = domainList[domainId]->global_zoom_ibegin;
+              // zoomIndex.push_back(domainList[domainId]->zoom_i_index);
+              // nGlob[indexMap[i]] = domainList[domainId]->ni_glo;
+
+              // nZoomBegin[indexMap[i] + 1] = domainList[domainId]->zoom_jbegin_srv;
+              // nZoomSize[indexMap[i] + 1] = domainList[domainId]->zoom_nj_srv;
+              // nZoomBeginGlobal[indexMap[i] + 1] = domainList[domainId]->global_zoom_jbegin;
+              // zoomIndex.push_back(domainList[domainId]->zoom_j_index);
+              // nGlob[indexMap[i] + 1] = domainList[domainId]->nj_glo;
+
+              int nbZoom = domainList[domainId]->zoom_i_index.numElements();
+              zoomIndex.push_back(CArray<int,1>(nbZoom));
+              CArray<int,1>& zoomDomain = zoomIndex.back();
+              for (int ind = 0; ind < nbZoom; ++ind)
+              {
+                zoomDomain(ind) = domainList[domainId]->zoom_i_index(ind) + domainList[domainId]->zoom_j_index(ind) * domainList[domainId]->ni_glo;
+              }
+
+              globalSize *= domainList[domainId]->ni_glo * domainList[domainId]->nj_glo;
+              ++domainId;
             }
-
-            globalSize *= domainList[domainId]->ni_glo * domainList[domainId]->nj_glo;
-            ++domainId;
+            else if (1 == axis_domain_order(i)) // axis
+            {
+              // nZoomBegin[indexMap[i]] = axisList[axisId]->zoom_begin_srv;
+              // nZoomSize[indexMap[i]]  = axisList[axisId]->zoom_size_srv;
+              // nZoomBeginGlobal[indexMap[i]] = axisList[axisId]->global_zoom_begin;
+              zoomIndex.push_back(axisList[axisId]->zoom_index);
+              // nGlob[indexMap[i]] = axisList[axisId]->n_glo;
+              globalSize *= axisList[axisId]->n_glo;
+              ++axisId;
+            }
+            else // scalar
+            {
+              CArray<int,1> zoomScalar(1);
+              zoomScalar(0) = 0;
+              // nZoomBegin[indexMap[i]] = 0;
+              // nZoomSize[indexMap[i]]  = 1;
+              // nZoomBeginGlobal[indexMap[i]] = 0;
+              zoomIndex.push_back(zoomScalar);
+              // nGlob[indexMap[i]] = 1;
+              ++scalarId;
+            }
           }
-          else if (1 == axis_domain_order(i)) // axis
+          dataSize = 1;
+
+          // for (int i = 0; i < nZoomSize.size(); ++i)
+          //   dataSize *= nZoomSize[i];
+          // serverDistribution_ = new CDistributionServer(server->intraCommRank, nZoomBegin, nZoomSize,
+          //                                               nZoomBeginGlobal, nGlob);
+          for (int i = 0; i < zoomIndex.size(); ++i)
           {
-            // nZoomBegin[indexMap[i]] = axisList[axisId]->zoom_begin_srv;
-            // nZoomSize[indexMap[i]]  = axisList[axisId]->zoom_size_srv;
-            // nZoomBeginGlobal[indexMap[i]] = axisList[axisId]->global_zoom_begin;
-            zoomIndex.push_back(axisList[axisId]->zoom_index);            
-            // nGlob[indexMap[i]] = axisList[axisId]->n_glo;
-            globalSize *= axisList[axisId]->n_glo;
-            ++axisId;
+            dataSize *= zoomIndex[i].numElements();
           }
-          else // scalar
-          {
-            CArray<int,1> zoomScalar(1);
-            zoomScalar(0) = 0;
-            // nZoomBegin[indexMap[i]] = 0;
-            // nZoomSize[indexMap[i]]  = 1;
-            // nZoomBeginGlobal[indexMap[i]] = 0;
-            zoomIndex.push_back(zoomScalar);
-            // nGlob[indexMap[i]] = 1;
-            ++scalarId;
-          }
-        }
-        dataSize = 1;
-
-        // for (int i = 0; i < nZoomSize.size(); ++i)
-        //   dataSize *= nZoomSize[i];
-        // serverDistribution_ = new CDistributionServer(server->intraCommRank, nZoomBegin, nZoomSize,
-        //                                               nZoomBeginGlobal, nGlob);
-        for (int i = 0; i < zoomIndex.size(); ++i)
-        {
-          dataSize *= zoomIndex[i].numElements();
-        }
-        serverDistribution_ = new CDistributionServer(server->intraCommRank, zoomIndex, nGlobElement);
-      }
-
-      CArray<size_t,1> outIndex;
-      buffer >> outIndex;
+          serverDistribution_ = new CDistributionServer(server->intraCommRank, zoomIndex, nGlobElement);
+        }
+
+        CArray<size_t,1> outIndex;
+        buffer >> outIndex;
+        if (isDataDistributed_)
+          serverDistribution_->computeLocalIndex(outIndex);
+        else
+        {
+          dataSize = outIndex.numElements();
+          for (int i = 0; i < outIndex.numElements(); ++i) outIndex(i) = i;
+        }
+        writtenDataSize_ += dataSize;
+
+        outIndexFromClient.insert(std::make_pair(rank, outIndex));
+        connectedDataSize_[rank] = outIndex.numElements();
+        numberWrittenIndexes_ += outIndex.numElements();
+      }
+
+      int sizeData = 0;
+      for (map<int, CArray<size_t, 1> >::iterator it = outIndexFromClient.begin(); it != outIndexFromClient.end(); ++it)
+      {
+        sizeData += it->second.numElements();
+      }
+      indexFromClients.resize(sizeData);
+      sizeData = 0;
+      for (map<int, CArray<size_t, 1> >::iterator it = outIndexFromClient.begin(); it != outIndexFromClient.end(); ++it)
+      {
+         CArray<size_t, 1>& tmp0 = it->second;
+         CArray<size_t, 1> tmp1 = indexFromClients(Range(sizeData, sizeData + tmp0.numElements() - 1));
+         tmp1 = tmp0;
+         sizeData += tmp0.numElements();
+      }
+
+      // if (isScalarGrid()) return;
+
       if (isDataDistributed_)
-        serverDistribution_->computeLocalIndex(outIndex);
+      {
+        MPI_Allreduce(&numberWrittenIndexes_, &totalNumberWrittenIndexes_, 1, MPI_INT, MPI_SUM, server->intraComm);
+        MPI_Scan(&numberWrittenIndexes_, &offsetWrittenIndexes_, 1, MPI_INT, MPI_SUM, server->intraComm);
+        offsetWrittenIndexes_ -= numberWrittenIndexes_;
+      }
       else
-      {
-        dataSize = outIndex.numElements();
-        for (int i = 0; i < outIndex.numElements(); ++i) outIndex(i) = i;
-      }
-      writtenDataSize_ += dataSize;
-      
-      outIndexFromClient.insert(std::make_pair(rank, outIndex));
-      connectedDataSize_[rank] = outIndex.numElements();
-      numberWrittenIndexes_ += outIndex.numElements();
-    }
-    
-    int sizeData = 0;
-    for (map<int, CArray<size_t, 1> >::iterator it = outIndexFromClient.begin(); it != outIndexFromClient.end(); ++it)
-    {
-      sizeData += it->second.numElements();
-    }
-    indexFromClients.resize(sizeData);
-    sizeData = 0;
-    for (map<int, CArray<size_t, 1> >::iterator it = outIndexFromClient.begin(); it != outIndexFromClient.end(); ++it)
-    {
-       CArray<size_t, 1>& tmp0 = it->second;
-       CArray<size_t, 1> tmp1 = indexFromClients(Range(sizeData, sizeData + tmp0.numElements() - 1));
-       tmp1 = tmp0;
-       sizeData += tmp0.numElements();
-    }
-
-    // if (isScalarGrid()) return;
-
-    if (isDataDistributed_)
-    {
-      MPI_Allreduce(&numberWrittenIndexes_, &totalNumberWrittenIndexes_, 1, MPI_INT, MPI_SUM, server->intraComm);
-      MPI_Scan(&numberWrittenIndexes_, &offsetWrittenIndexes_, 1, MPI_INT, MPI_SUM, server->intraComm);
-      offsetWrittenIndexes_ -= numberWrittenIndexes_;
-    }
-    else
-      totalNumberWrittenIndexes_ = numberWrittenIndexes_;
-
-    nbSenders = CClientServerMappingDistributed::computeConnectedClients(client->serverSize, client->clientSize, client->intraComm, ranks);
+        totalNumberWrittenIndexes_ = numberWrittenIndexes_;
+
+      nbSenders = CClientServerMappingDistributed::computeConnectedClients(client->serverSize, client->clientSize, client->intraComm, ranks);
+    }
   }
 
