Index: XIOS/dev/XIOS_DEV_CMIP6/src/node/axis.cpp
===================================================================
--- XIOS/dev/XIOS_DEV_CMIP6/src/node/axis.cpp	(revision 1336)
+++ XIOS/dev/XIOS_DEV_CMIP6/src/node/axis.cpp	(revision 1337)
@@ -180,6 +180,6 @@
      {
        // size estimation for sendDistributedValue
-       boost::unordered_map<int, vector<size_t> >::const_iterator it, ite = indSrv_[client].end();
-       for (it = indSrv_[client].begin(); it != ite; ++it)
+       boost::unordered_map<int, vector<size_t> >::const_iterator it, ite = indSrv_[client->serverSize].end();
+       for (it = indSrv_[client->serverSize].begin(); it != ite; ++it)
        {
          size_t sizeIndexEvent = CArray<int,1>::size(it->second.size());
@@ -607,26 +607,27 @@
 
 
-      indSrv_[client].swap(globalIndexAxisOnServer);
+      indSrv_[nbServer].swap(globalIndexAxisOnServer);
 
       if (distType==CServerDistributionDescription::ROOT_DISTRIBUTION)
       {
-        for(int i=1; i<nbServer; ++i) indSrv_[client].insert(pair<int, vector<size_t> >(i,indSrv_[client][0]) ) ;
+        for(int i=1; i<nbServer; ++i) indSrv_[nbServer].insert(pair<int, vector<size_t> >(i,indSrv_[nbServer][0]) ) ;
         serverZeroIndexLeader.clear() ;
       }
          
-      CClientServerMapping::GlobalIndexMap::const_iterator it  = indSrv_[client].begin(),
-                                                           ite = indSrv_[client].end();
-
-      for (it = indSrv_[client].begin(); it != ite; ++it) connectedServerRank_[client].push_back(it->first);
+      CClientServerMapping::GlobalIndexMap::const_iterator it  = indSrv_[nbServer].begin(),
+                                                           ite = indSrv_[nbServer].end();
+
+      for (it = indSrv_[nbServer].begin(); it != ite; ++it) connectedServerRank_[nbServer].push_back(it->first);
 
       for (std::list<int>::const_iterator it = serverZeroIndexLeader.begin(); it != serverZeroIndexLeader.end(); ++it)
-        connectedServerRank_[client].push_back(*it);
+        connectedServerRank_[nbServer].push_back(*it);
 
        // Even if a client has no index, it must connect to at least one server and 
        // send an "empty" data to this server
-       if (connectedServerRank_[client].empty())
-        connectedServerRank_[client].push_back(client->clientRank % client->serverSize);
-
-      nbSenders[client] = CClientServerMapping::computeConnectedClients(client->serverSize, client->clientSize, client->intraComm, connectedServerRank_[client]);
+       if (connectedServerRank_[nbServer].empty())
+        connectedServerRank_[nbServer].push_back(client->clientRank % client->serverSize);
+
+//       nbSenders[client] = CClientServerMapping::computeConnectedClients(client->serverSize, client->clientSize, client->intraComm, connectedServerRank_[client]);
+       nbSenders[nbServer] = CClientServerMapping::computeConnectedClients(client->serverSize, client->clientSize, client->intraComm, connectedServerRank_[nbServer]);
 
       delete clientServerMap;
@@ -1091,4 +1092,5 @@
     {
       CContextClient* client = (0 != context->clientPrimServer.size()) ? context->clientPrimServer[p] : context->client;
+      int nbServer = client->serverSize;
 
       CEventClient eventData(getType(), EVENT_ID_DISTRIBUTED_ATTRIBUTES);
@@ -1111,10 +1113,10 @@
 
       boost::unordered_map<int, std::vector<size_t> >::const_iterator it, iteMap;
-      iteMap = indSrv_[client].end();
-      for (int k = 0; k < connectedServerRank_[client].size(); ++k)
+      iteMap = indSrv_[nbServer].end();
+      for (int k = 0; k < connectedServerRank_[nbServer].size(); ++k)
       {
         int nbData = 0;
-        int rank = connectedServerRank_[client][k];        
-        it = indSrv_[client].find(rank);
+        int rank = connectedServerRank_[nbServer][k];
+        it = indSrv_[nbServer].find(rank);
         if (iteMap != it)
           nbData = it->second.size();
@@ -1182,5 +1184,5 @@
           listData.back() << list_label.back();
 
-        eventData.push(rank, nbSenders[client][rank], listData.back());
+        eventData.push(rank, nbSenders[nbServer][rank], listData.back());
       }
 
Index: XIOS/dev/XIOS_DEV_CMIP6/src/node/axis.hpp
===================================================================
--- XIOS/dev/XIOS_DEV_CMIP6/src/node/axis.hpp	(revision 1336)
+++ XIOS/dev/XIOS_DEV_CMIP6/src/node/axis.hpp	(revision 1337)
@@ -157,6 +157,6 @@
          //! True if and only if the data defined on the axis can be outputted in a compressed way
          bool isCompressible_;
-         std::map<CContextClient*, map<int,int> > nbSenders; // Mapping of number of communicating client to a server
-         std::map<CContextClient*, boost::unordered_map<int, vector<size_t> > > indSrv_; // Global index of each client sent to server
+         std::map<int, map<int,int> > nbSenders; // Mapping of number of communicating client to a server
+         std::map<int, boost::unordered_map<int, vector<size_t> > > indSrv_; // Global index of each client sent to server
          // std::map<int, vector<int> > indWrittenSrv_; // Global written index of each client sent to server
          boost::unordered_map<size_t,size_t> globalLocalIndexMap_;
@@ -164,5 +164,5 @@
          std::map<int,int> numberWrittenIndexes_, totalNumberWrittenIndexes_, offsetWrittenIndexes_;
          std::map<int, CArray<int, 1> > compressedIndexToWriteOnServer;
-         std::map<CContextClient*, std::vector<int> > connectedServerRank_;         
+         std::map<int, std::vector<int> > connectedServerRank_;
          bool hasBounds;
          bool hasLabel;         
Index: XIOS/dev/XIOS_DEV_CMIP6/src/node/domain.cpp
===================================================================
--- XIOS/dev/XIOS_DEV_CMIP6/src/node/domain.cpp	(revision 1336)
+++ XIOS/dev/XIOS_DEV_CMIP6/src/node/domain.cpp	(revision 1337)
@@ -45,5 +45,5 @@
       , globalLocalIndexMap_(), computedWrittenIndex_(false)
    {
-	 }
+    }
 
    CDomain::~CDomain(void)
@@ -147,10 +147,10 @@
      }
 
-     boost::unordered_map<int, vector<size_t> >::const_iterator itIndexEnd = indSrv_[client].end();
+     boost::unordered_map<int, vector<size_t> >::const_iterator itIndexEnd = indSrv_[client->serverSize].end();
      // std::map<int, std::vector<int> >::const_iterator itWrittenIndexEnd = indWrittenSrv_.end();
-     for (size_t k = 0; k < connectedServerRank_[client].size(); ++k)
-     {
-       int rank = connectedServerRank_[client][k];
-       boost::unordered_map<int, std::vector<size_t> >::const_iterator it = indSrv_[client].find(rank);
+     for (size_t k = 0; k < connectedServerRank_[client->serverSize].size(); ++k)
+     {
+       int rank = connectedServerRank_[client->serverSize][k];
+       boost::unordered_map<int, std::vector<size_t> >::const_iterator it = indSrv_[client->serverSize].find(rank);
        size_t idxCount = (it != itIndexEnd) ? it->second.size() : 0;
 
@@ -635,28 +635,28 @@
    void CDomain::AllgatherRectilinearLonLat(CArray<double,1>& lon, CArray<double,1>& lat, CArray<double,1>& lon_g, CArray<double,1>& lat_g)
    {
-	  CContext* context = CContext::getCurrent();
+     CContext* context = CContext::getCurrent();
     // For now the assumption is that secondary server pools consist of the same number of procs.
     // CHANGE the line below if the assumption changes.
     CContextClient* client = (0 != context->clientPrimServer.size()) ? context->clientPrimServer[0] : context->client;
-	  lon_g.resize(ni_glo) ;
-	  lat_g.resize(nj_glo) ;
-
-
-	  int* ibegin_g = new int[client->clientSize] ;
-	  int* jbegin_g = new int[client->clientSize] ;
-	  int* ni_g = new int[client->clientSize] ;
-	  int* nj_g = new int[client->clientSize] ;
-	  int v ;
-	  v=ibegin ;
-	  MPI_Allgather(&v,1,MPI_INT,ibegin_g,1,MPI_INT,client->intraComm) ;
-	  v=jbegin ;
-	  MPI_Allgather(&v,1,MPI_INT,jbegin_g,1,MPI_INT,client->intraComm) ;
-	  v=ni ;
-	  MPI_Allgather(&v,1,MPI_INT,ni_g,1,MPI_INT,client->intraComm) ;
-	  v=nj ;
-	  MPI_Allgather(&v,1,MPI_INT,nj_g,1,MPI_INT,client->intraComm) ;
-
-	  MPI_Allgatherv(lon.dataFirst(),ni,MPI_DOUBLE,lon_g.dataFirst(),ni_g, ibegin_g,MPI_DOUBLE,client->intraComm) ;
-	  MPI_Allgatherv(lat.dataFirst(),nj,MPI_DOUBLE,lat_g.dataFirst(),nj_g, jbegin_g,MPI_DOUBLE,client->intraComm) ;
+     lon_g.resize(ni_glo) ;
+     lat_g.resize(nj_glo) ;
+
+
+     int* ibegin_g = new int[client->clientSize] ;
+     int* jbegin_g = new int[client->clientSize] ;
+     int* ni_g = new int[client->clientSize] ;
+     int* nj_g = new int[client->clientSize] ;
+     int v ;
+     v=ibegin ;
+     MPI_Allgather(&v,1,MPI_INT,ibegin_g,1,MPI_INT,client->intraComm) ;
+     v=jbegin ;
+     MPI_Allgather(&v,1,MPI_INT,jbegin_g,1,MPI_INT,client->intraComm) ;
+     v=ni ;
+     MPI_Allgather(&v,1,MPI_INT,ni_g,1,MPI_INT,client->intraComm) ;
+     v=nj ;
+     MPI_Allgather(&v,1,MPI_INT,nj_g,1,MPI_INT,client->intraComm) ;
+
+     MPI_Allgatherv(lon.dataFirst(),ni,MPI_DOUBLE,lon_g.dataFirst(),ni_g, ibegin_g,MPI_DOUBLE,client->intraComm) ;
+     MPI_Allgatherv(lat.dataFirst(),nj,MPI_DOUBLE,lat_g.dataFirst(),nj_g, jbegin_g,MPI_DOUBLE,client->intraComm) ;
 
       delete[] ibegin_g ;
@@ -783,9 +783,9 @@
      if (type == type_attr::gaussian) 
      {
-  	   hasPole=true ;
-	     type.setValue(type_attr::unstructured) ;
-	   }
-	   else if (type == type_attr::rectilinear) hasPole=true ;
-	 
+        hasPole=true ;
+        type.setValue(type_attr::unstructured) ;
+      }
+      else if (type == type_attr::rectilinear) hasPole=true ;
+
      if (type == type_attr::unstructured)
      {
@@ -1048,7 +1048,7 @@
       else
       {
-		domainMask.resize(mask_1d.numElements());
-		domainMask=mask_1d ;
-	  }  
+      domainMask.resize(mask_1d.numElements());
+      domainMask=mask_1d ;
+     }
    }
 
@@ -1712,157 +1712,169 @@
       CContextClient* client = (0 != context->clientPrimServer.size()) ? context->clientPrimServer[p] : context->client;
       int nbServer = client->serverSize;
+      int nbClient = client->clientSize;
       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();
-
-      if (doZoomByIndex_) 
-      {
-        globalIndexCountZoom = zoom_i_index.numElements();
-      }
-      else 
-      {
-        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;
-          }
-        }
-      }
-
-
-      // Fill in index
-      CArray<size_t,1> globalIndexDomainZoom(globalIndexCountZoom);
-      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(i) = globalIndex;                
-      }
-
-      if (globalLocalIndexMap_.empty())
-      {
-        for (i = 0; i < nbIndex; ++i)
-          globalLocalIndexMap_[globalIndexDomain(i)] = i;
-      }
-
-      globalIndexCountZoom = 0;
-      if (doZoomByIndex_) 
-      {
-        int nbIndexZoom = zoom_i_index.numElements();        
-        
-        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;
-        }
-      }
-      else 
-      {
-          int global_zoom_iend=global_zoom_ibegin+global_zoom_ni-1;
-          int global_zoom_jend=global_zoom_jbegin+global_zoom_nj-1;
-          for (i = 0; i < nbIndex; ++i)
-          {
+      if (indSrv_.find(nbServer) == indSrv_.end())
+      {
+         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();
+
+         if (doZoomByIndex_)
+         {
+            globalIndexCountZoom = zoom_i_index.numElements();
+         }
+         else
+         {
+            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;
+               }
+            }
+         }
+
+
+         // Fill in index
+         CArray<size_t,1> globalIndexDomainZoom(globalIndexCountZoom);
+         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;
-            if (i_ind >= global_zoom_ibegin && i_ind <= global_zoom_iend && j_ind >= global_zoom_jbegin && j_ind <= global_zoom_jend)
+            globalIndexDomain(i) = globalIndex;
+         }
+
+         if (globalLocalIndexMap_.empty())
+         {
+            for (i = 0; i < nbIndex; ++i)
+               globalLocalIndexMap_[globalIndexDomain(i)] = i;
+         }
+
+         globalIndexCountZoom = 0;
+         if (doZoomByIndex_)
+         {
+            int nbIndexZoom = zoom_i_index.numElements();
+
+            for (i = 0; i < nbIndexZoom; ++i)
             {
-              globalIndexDomainZoom(globalIndexCountZoom) = globalIndex;
-              ++globalIndexCountZoom;
+               i_ind=zoom_i_index(i);
+               j_ind=zoom_j_index(i);
+               globalIndex = i_ind + j_ind * ni_glo;
+               globalIndexDomainZoom(globalIndexCountZoom) = globalIndex;
+               ++globalIndexCountZoom;
             }
-          }
-
-          int iend = ibegin + ni -1;
-          int jend = jbegin + nj -1;
-          zoom_ibegin = global_zoom_ibegin > ibegin ? global_zoom_ibegin : ibegin;
-          int zoom_iend  = global_zoom_iend < iend ? zoom_iend : iend ;
-          zoom_ni     = zoom_iend-zoom_ibegin+1 ;
-
-          zoom_jbegin = global_zoom_jbegin > jbegin ? global_zoom_jbegin : jbegin ;
-          int zoom_jend   = global_zoom_jend < jend ? zoom_jend : jend;
-          zoom_nj     = zoom_jend-zoom_jbegin+1;
-      }
-
-
-      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;
-      }
-
-       // Even if servers have no index, they must received something from client
-       // We only use several client to send "empty" message to these servers
-      CServerDistributionDescription serverDescription(nGlobDomain, nbServer);
-      std::vector<int> serverZeroIndex;
-      if (isUnstructed_) serverZeroIndex = serverDescription.computeServerGlobalIndexInRange(std::make_pair<size_t,size_t>(indexBegin, indexEnd), 0);
-      else serverZeroIndex = serverDescription.computeServerGlobalIndexInRange(std::make_pair<size_t,size_t>(indexBegin, indexEnd), 1);
-
-       std::list<int> serverZeroIndexLeader;
-       std::list<int> serverZeroIndexNotLeader; 
-       CContextClient::computeLeader(client->clientRank, client->clientSize, serverZeroIndex.size(), serverZeroIndexLeader, serverZeroIndexNotLeader);
-       for (std::list<int>::iterator it = serverZeroIndexLeader.begin(); it != serverZeroIndexLeader.end(); ++it)
-         *it = serverZeroIndex[*it];
-
-      CClientServerMapping* clientServerMap = new CClientServerMappingDistributed(serverDescription.getGlobalIndexRange(),
-                                                                                  client->intraComm);
-      clientServerMap->computeServerIndexMapping(globalIndexDomain, nbServer);
-      CClientServerMapping::GlobalIndexMap& globalIndexDomainOnServer = clientServerMap->getGlobalIndexOnServer();
-
-      CClientServerMapping::GlobalIndexMap::const_iterator it  = globalIndexDomainOnServer.begin(),
-                                                           ite = globalIndexDomainOnServer.end();
-      indSrv_[client].swap(globalIndexDomainOnServer);
-      connectedServerRank_[client].clear();
-      for (it = indSrv_[client].begin(); it != ite; ++it) 
-        connectedServerRank_[client].push_back(it->first);
-
-      for (std::list<int>::const_iterator it = serverZeroIndexLeader.begin(); it != serverZeroIndexLeader.end(); ++it)
-        connectedServerRank_[client].push_back(*it);
-
-       // Even if a client has no index, it must connect to at least one server and 
-       // send an "empty" data to this server
-       if (connectedServerRank_[client].empty())
-        connectedServerRank_[client].push_back(client->clientRank % client->serverSize);
-
-      nbSenders[client] = clientServerMap->computeConnectedClients(client->serverSize, client->clientSize, client->intraComm, connectedServerRank_[client]);
-
-      delete clientServerMap;
+         }
+         else
+         {
+            int global_zoom_iend=global_zoom_ibegin+global_zoom_ni-1;
+            int global_zoom_jend=global_zoom_jbegin+global_zoom_nj-1;
+            for (i = 0; i < nbIndex; ++i)
+            {
+               i_ind=i_index(i);
+               j_ind=j_index(i);
+               globalIndex = i_ind + j_ind * ni_glo;
+               if (i_ind >= global_zoom_ibegin && i_ind <= global_zoom_iend && j_ind >= global_zoom_jbegin && j_ind <= global_zoom_jend)
+               {
+                  globalIndexDomainZoom(globalIndexCountZoom) = globalIndex;
+                  ++globalIndexCountZoom;
+               }
+            }
+
+            int iend = ibegin + ni -1;
+            int jend = jbegin + nj -1;
+            zoom_ibegin = global_zoom_ibegin > ibegin ? global_zoom_ibegin : ibegin;
+            int zoom_iend  = global_zoom_iend < iend ? zoom_iend : iend ;
+            zoom_ni     = zoom_iend-zoom_ibegin+1 ;
+
+            zoom_jbegin = global_zoom_jbegin > jbegin ? global_zoom_jbegin : jbegin ;
+            int zoom_jend   = global_zoom_jend < jend ? zoom_jend : jend;
+            zoom_nj     = zoom_jend-zoom_jbegin+1;
+         }
+
+
+         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;
+         }
+
+         // Even if servers have no index, they must received something from client
+         // We only use several client to send "empty" message to these servers
+         CServerDistributionDescription serverDescription(nGlobDomain, nbServer);
+         std::vector<int> serverZeroIndex;
+         if (isUnstructed_) serverZeroIndex = serverDescription.computeServerGlobalIndexInRange(std::make_pair<size_t,size_t>(indexBegin, indexEnd), 0);
+         else serverZeroIndex = serverDescription.computeServerGlobalIndexInRange(std::make_pair<size_t,size_t>(indexBegin, indexEnd), 1);
+
+         std::list<int> serverZeroIndexLeader;
+         std::list<int> serverZeroIndexNotLeader;
+         CContextClient::computeLeader(client->clientRank, client->clientSize, serverZeroIndex.size(), serverZeroIndexLeader, serverZeroIndexNotLeader);
+         for (std::list<int>::iterator it = serverZeroIndexLeader.begin(); it != serverZeroIndexLeader.end(); ++it)
+            *it = serverZeroIndex[*it];
+
+         CClientServerMapping* clientServerMap = new CClientServerMappingDistributed(serverDescription.getGlobalIndexRange(),
+               client->intraComm);
+         clientServerMap->computeServerIndexMapping(globalIndexDomain, nbServer);
+         CClientServerMapping::GlobalIndexMap& globalIndexDomainOnServer = clientServerMap->getGlobalIndexOnServer();
+
+         CClientServerMapping::GlobalIndexMap::const_iterator it  = globalIndexDomainOnServer.begin(),
+               ite = globalIndexDomainOnServer.end();
+//         indSrv_[client].swap(globalIndexDomainOnServer);
+//         connectedServerRank_[client].clear();
+//         for (it = indSrv_[client].begin(); it != ite; ++it)
+//            connectedServerRank_[client].push_back(it->first);
+         indSrv_[nbServer].swap(globalIndexDomainOnServer);
+         connectedServerRank_[nbServer].clear();
+         for (it = indSrv_[nbServer].begin(); it != ite; ++it)
+            connectedServerRank_[nbServer].push_back(it->first);
+
+         for (std::list<int>::const_iterator it = serverZeroIndexLeader.begin(); it != serverZeroIndexLeader.end(); ++it)
+            connectedServerRank_[nbServer].push_back(*it);
+
+         // Even if a client has no index, it must connect to at least one server and
+        // send an "empty" data to this server
+         if (connectedServerRank_[nbServer].empty())
+            connectedServerRank_[nbServer].push_back(client->clientRank % client->serverSize);
+
+         nbSenders[nbServer] = clientServerMap->computeConnectedClients(client->serverSize, client->clientSize, client->intraComm, connectedServerRank_[nbServer]);
+//         if (connectedServerRank_[client].empty())
+//            connectedServerRank_[client].push_back(client->clientRank % client->serverSize);
+//
+//         nbSenders[client] = clientServerMap->computeConnectedClients(client->serverSize, client->clientSize, client->intraComm, connectedServerRank_[client]);
+
+         delete clientServerMap;
+      }
     }
   }
@@ -2060,5 +2072,5 @@
     {
       CContextClient* client = (0 != context->clientPrimServer.size()) ? context->clientPrimServer[p] : context->client;
-
+      int serverSize = client->serverSize;
       CEventClient eventIndex(getType(), EVENT_ID_INDEX);
 
@@ -2067,10 +2079,10 @@
 
       boost::unordered_map<int, vector<size_t> >::const_iterator itIndex, iteIndex;
-      iteIndex = indSrv_[client].end();
-      for (int k = 0; k < connectedServerRank_[client].size(); ++k)
+      iteIndex = indSrv_[serverSize].end();
+      for (int k = 0; k < connectedServerRank_[serverSize].size(); ++k)
       {
         int nbIndGlob = 0;
-        int rank = connectedServerRank_[client][k];
-        itIndex = indSrv_[client].find(rank);
+        int rank = connectedServerRank_[serverSize][k];
+        itIndex = indSrv_[serverSize].find(rank);
         if (iteIndex != itIndex)
           nbIndGlob = itIndex->second.size();
@@ -2089,5 +2101,5 @@
         list_msgsIndex.back() << list_indGlob.back(); //list_indi.back() << list_indj.back();
        
-        eventIndex.push(rank, nbSenders[client][rank], list_msgsIndex.back());
+        eventIndex.push(rank, nbSenders[serverSize][rank], list_msgsIndex.back());
       }
 
@@ -2165,4 +2177,5 @@
     {
       CContextClient* client = (0 != context->clientPrimServer.size()) ? context->clientPrimServer[p] : context->client;
+      int serverSize = client->serverSize;
 
       // send area for each connected server
@@ -2173,10 +2186,10 @@
 
       boost::unordered_map<int, vector<size_t> >::const_iterator it, iteMap;
-      iteMap = indSrv_[client].end();
-      for (int k = 0; k < connectedServerRank_[client].size(); ++k)
+      iteMap = indSrv_[serverSize].end();
+      for (int k = 0; k < connectedServerRank_[serverSize].size(); ++k)
       {
         int nbData = 0;
-        int rank = connectedServerRank_[client][k];
-        it = indSrv_[client].find(rank);
+        int rank = connectedServerRank_[serverSize][k];
+        it = indSrv_[serverSize].find(rank);
         if (iteMap != it)
           nbData = it->second.size();
@@ -2192,5 +2205,5 @@
         list_msgsMask.push_back(CMessage());
         list_msgsMask.back() << this->getId() << list_mask.back();
-        eventMask.push(rank, nbSenders[client][rank], list_msgsMask.back());
+        eventMask.push(rank, nbSenders[serverSize][rank], list_msgsMask.back());
       }
       client->sendEvent(eventMask);
@@ -2213,4 +2226,5 @@
     {
       CContextClient* client = (0 != context->clientPrimServer.size()) ? context->clientPrimServer[p] : context->client;
+      int serverSize = client->serverSize;
 
       // send area for each connected server
@@ -2221,10 +2235,10 @@
 
       boost::unordered_map<int, vector<size_t> >::const_iterator it, iteMap;
-      iteMap = indSrv_[client].end();
-      for (int k = 0; k < connectedServerRank_[client].size(); ++k)
+      iteMap = indSrv_[serverSize].end();
+      for (int k = 0; k < connectedServerRank_[serverSize].size(); ++k)
       {
         int nbData = 0;
-        int rank = connectedServerRank_[client][k];
-        it = indSrv_[client].find(rank);
+        int rank = connectedServerRank_[serverSize][k];
+        it = indSrv_[serverSize].find(rank);
         if (iteMap != it)
           nbData = it->second.size();
@@ -2241,5 +2255,5 @@
         list_msgsArea.back() << this->getId() << hasArea;
         list_msgsArea.back() << list_area.back();
-        eventArea.push(rank, nbSenders[client][rank], list_msgsArea.back());
+        eventArea.push(rank, nbSenders[serverSize][rank], list_msgsArea.back());
       }
       client->sendEvent(eventArea);
@@ -2264,4 +2278,5 @@
     {
       CContextClient* client = (0 != context->clientPrimServer.size()) ? context->clientPrimServer[p] : context->client;
+      int serverSize = client->serverSize;
 
       // send lon lat for each connected server
@@ -2274,10 +2289,10 @@
 
       boost::unordered_map<int, vector<size_t> >::const_iterator it, iteMap;
-      iteMap = indSrv_[client].end();
-      for (int k = 0; k < connectedServerRank_[client].size(); ++k)
+      iteMap = indSrv_[serverSize].end();
+      for (int k = 0; k < connectedServerRank_[serverSize].size(); ++k)
       {
         int nbData = 0;
-        int rank = connectedServerRank_[client][k];
-        it = indSrv_[client].find(rank);
+        int rank = connectedServerRank_[serverSize][k];
+        it = indSrv_[serverSize].find(rank);
         if (iteMap != it)
           nbData = it->second.size();
@@ -2336,6 +2351,6 @@
         }
 
-        eventLon.push(rank, nbSenders[client][rank], list_msgsLon.back());
-        eventLat.push(rank, nbSenders[client][rank], list_msgsLat.back());
+        eventLon.push(rank, nbSenders[serverSize][rank], list_msgsLon.back());
+        eventLat.push(rank, nbSenders[serverSize][rank], list_msgsLat.back());
       }
       client->sendEvent(eventLon);
@@ -2360,4 +2375,5 @@
     {
       CContextClient* client = (0 != context->clientPrimServer.size()) ? context->clientPrimServer[p] : context->client;
+      int serverSize = client->serverSize;
 
       // send area for each connected server
@@ -2392,10 +2408,10 @@
 
       boost::unordered_map<int, vector<size_t> >::const_iterator it, iteMap;
-      iteMap = indSrv_[client].end();
-      for (int k = 0; k < connectedServerRank_[client].size(); ++k)
+      iteMap = indSrv_[serverSize].end();
+      for (int k = 0; k < connectedServerRank_[serverSize].size(); ++k)
       {
         int nbData = 0;
-        int rank = connectedServerRank_[client][k];
-        it = indSrv_[client].find(rank);
+        int rank = connectedServerRank_[serverSize][k];
+        it = indSrv_[serverSize].find(rank);
         if (iteMap != it)
           nbData = it->second.size();
@@ -2415,5 +2431,5 @@
         list_msgsDataIndex.back() << this->getId();
         list_msgsDataIndex.back() << list_data_i_index.back() << list_data_j_index.back();
-        eventDataIndex.push(rank, nbSenders[client][rank], list_msgsDataIndex.back());
+        eventDataIndex.push(rank, nbSenders[serverSize][rank], list_msgsDataIndex.back());
       }
       client->sendEvent(eventDataIndex);
Index: XIOS/dev/XIOS_DEV_CMIP6/src/node/domain.hpp
===================================================================
--- XIOS/dev/XIOS_DEV_CMIP6/src/node/domain.hpp	(revision 1336)
+++ XIOS/dev/XIOS_DEV_CMIP6/src/node/domain.hpp	(revision 1337)
@@ -205,7 +205,8 @@
          bool isClientAfterTransformationChecked;
          std::map<int, CArray<int,1> > indGlob_;
-         std::map<CContextClient*, map<int,int> > nbSenders; // Mapping of number of communicating client to a server
-
-         std::map<CContextClient*, boost::unordered_map<int, vector<size_t> > > indSrv_; // Global index of each client sent to server         
+         std::map<int, map<int,int> > nbSenders; // Mapping of number of communicating client to a server
+
+/** Global index of each client sent to server: map<serverSize, map<serverRank, indexes>> */
+         std::map<int, boost::unordered_map<int, vector<size_t> > > indSrv_;
          // std::map<CContextClient*, std::map<int, vector<int> > > indWrittenSrv_; // Global written index of each client sent to server
          std::vector<int> indexesToWrite;
@@ -213,6 +214,6 @@
          std::map<int,int> numberWrittenIndexes_, totalNumberWrittenIndexes_, offsetWrittenIndexes_;
          std::map<int, CArray<int, 1> > compressedIndexToWriteOnServer;     
-         std::map<CContextClient*, std::map<int,size_t> > connectedDataSize_;
-         std::map<CContextClient*, std::vector<int> > connectedServerRank_;
+         std::map<int, std::map<int,size_t> > connectedDataSize_;
+         std::map<int, std::vector<int> > connectedServerRank_;
 
          //! True if and only if the data defined on the domain can be outputted in a compressed way
