Index: /XIOS/trunk/src/context_client.cpp
===================================================================
--- /XIOS/trunk/src/context_client.cpp	(revision 594)
+++ /XIOS/trunk/src/context_client.cpp	(revision 595)
@@ -21,20 +21,54 @@
     \cxtSer [in] cxtSer Pointer to context of server side. (It is only used on case of attached mode)
     */
-    CContextClient::CContextClient(CContext* parent,MPI_Comm intraComm_, MPI_Comm interComm_, CContext* cxtSer)
+    CContextClient::CContextClient(CContext* parent, MPI_Comm intraComm_, MPI_Comm interComm_, CContext* cxtSer)
      : mapBufferSize_(), parentServer(cxtSer)
     {
-      context=parent ;
-      intraComm=intraComm_ ;
-      interComm=interComm_ ;
-      MPI_Comm_rank(intraComm,&clientRank) ;
-      MPI_Comm_size(intraComm,&clientSize) ;
-
-      int flag ;
-      MPI_Comm_test_inter(interComm,&flag) ;
-      if (flag) MPI_Comm_remote_size(interComm,&serverSize);
-      else  MPI_Comm_size(interComm,&serverSize) ;
-
-      timeLine=0 ;
-
+      context = parent;
+      intraComm = intraComm_;
+      interComm = interComm_;
+      MPI_Comm_rank(intraComm, &clientRank);
+      MPI_Comm_size(intraComm, &clientSize);
+
+      int flag;
+      MPI_Comm_test_inter(interComm, &flag);
+      if (flag) MPI_Comm_remote_size(interComm, &serverSize);
+      else  MPI_Comm_size(interComm, &serverSize);
+
+      if (clientSize < serverSize)
+      {
+        int serverByClient = serverSize / clientSize;
+        int remain = serverSize % clientSize;
+        int rankStart = serverByClient * clientRank;
+
+        if (clientRank < remain)
+        {
+          serverByClient++;
+          rankStart += clientRank;
+        }
+        else
+          rankStart += remain;
+
+        for (int i = 0; i < serverByClient; i++)
+          ranksServerLeader.push_back(rankStart + i);
+      }
+      else
+      {
+        int clientByServer = clientSize / serverSize;
+        int remain = clientSize % serverSize;
+
+        if (clientRank < (clientByServer + 1) * remain)
+        {
+          if (clientRank % (clientByServer + 1) == 0)
+            ranksServerLeader.push_back(clientRank / (clientByServer + 1));
+        }
+        else
+        {
+          int rank = clientRank - (clientByServer + 1) * remain;
+          if (rank % clientByServer == 0)
+            ranksServerLeader.push_back(remain + rank / clientByServer);
+        }
+      }
+
+      timeLine = 0;
     }
 
@@ -45,30 +79,29 @@
     void CContextClient::sendEvent(CEventClient& event)
     {
-      list<int>::iterator itServer ;
-      list<int> ranks ;
-      list<int> sizes ;
-      list<int>::iterator itSize ;
-
-      ranks=event.getRanks() ;
-      if (! event.isEmpty())
-      {
-        sizes=event.getSizes() ;
-        CMessage msg ;
-
-        msg<<*(sizes.begin())<<timeLine ;
-        for(list<int>::iterator it=sizes.begin();it!=sizes.end();it++) *it+=msg.size() ;
-        list<CBufferOut*> buffList=getBuffers(ranks,sizes) ;
-
-        list<CBufferOut*>::iterator it ;
-        for(it=buffList.begin(),itSize=sizes.begin();it!=buffList.end();++it,++itSize)
-        {
-          **it<<*itSize<<timeLine ;
-        }
-        event.send(buffList) ;
-        checkBuffers(ranks) ;
-      }
-
-//      if (context->hasServer)
-      if (0 != parentServer)
+      list<int>::iterator itServer;
+      list<int> ranks;
+      list<int> sizes;
+      list<int>::iterator itSize;
+
+      ranks = event.getRanks();
+      if (!event.isEmpty())
+      {
+        sizes = event.getSizes();
+        CMessage msg;
+
+        msg << *(sizes.begin()) << timeLine;
+        for (list<int>::iterator it = sizes.begin(); it != sizes.end(); it++) *it += msg.size();
+        list<CBufferOut*> buffList = getBuffers(ranks, sizes);
+
+        list<CBufferOut*>::iterator it;
+        for (it = buffList.begin(), itSize = sizes.begin(); it != buffList.end(); ++it, ++itSize)
+        {
+          **it << *itSize << timeLine;
+        }
+        event.send(buffList);
+        checkBuffers(ranks);
+      }
+
+      if (0 != parentServer) // context->hasServer
       {
         waitEvent(ranks);
@@ -76,5 +109,5 @@
       }
 
-      timeLine++ ;
+      timeLine++;
     }
 
@@ -85,9 +118,9 @@
     void CContextClient::sendBufferSizeEvent()
     {
-      std::map<int, CClientBuffer*>::iterator it, itE;
-      std::map<int, StdSize>::const_iterator itMap = mapBufferSize_.begin(), iteMap = mapBufferSize_.end();
+      std::map<int,CClientBuffer*>::iterator it, itE;
+      std::map<int,StdSize>::const_iterator itMap = mapBufferSize_.begin(), iteMap = mapBufferSize_.end();
 
       if (itMap == iteMap)
-         ERROR("CBufferOut*  CContextClient::sendBufferSizeEvent() ;",
+         ERROR("void CContextClient::sendBufferSizeEvent()",
               <<"No information about server buffer, that should not happen...");
 
@@ -115,26 +148,26 @@
     void CContextClient::waitEvent(list<int>& ranks)
     {
-//      context->server->setPendingEvent() ;
-//      while(checkBuffers(ranks))
+//      context->server->setPendingEvent();
+//      while (checkBuffers(ranks))
 //      {
-//        context->server->listen() ;
-//        context->server->checkPendingRequest() ;
+//        context->server->listen();
+//        context->server->checkPendingRequest();
 //      }
 //
-//      while(context->server->hasPendingEvent())
+//      while (context->server->hasPendingEvent())
 //      {
-//       context->server->eventLoop() ;
+//       context->server->eventLoop();
 //      }
 
-      parentServer->server->setPendingEvent() ;
-      while(checkBuffers(ranks))
-      {
-        parentServer->server->listen() ;
-        parentServer->server->checkPendingRequest() ;
-      }
-
-      while(parentServer->server->hasPendingEvent())
-      {
-       parentServer->server->eventLoop() ;
+      parentServer->server->setPendingEvent();
+      while (checkBuffers(ranks))
+      {
+        parentServer->server->listen();
+        parentServer->server->checkPendingRequest();
+      }
+
+      while (parentServer->server->hasPendingEvent())
+      {
+       parentServer->server->eventLoop();
       }
     }
@@ -148,41 +181,40 @@
     list<CBufferOut*> CContextClient::getBuffers(list<int>& serverList, list<int>& sizeList)
     {
-      list<int>::iterator itServer,itSize ;
-      list<CClientBuffer*> bufferList ;
-      map<int,CClientBuffer*>::iterator it ;
-      list<CClientBuffer*>::iterator itBuffer ;
-      list<CBufferOut*>  retBuffer ;
-      bool free ;
-
-      for(itServer=serverList.begin();itServer!=serverList.end();itServer++)
-      {
-        it=buffers.find(*itServer) ;
-        if (it==buffers.end())
-        {
-          newBuffer(*itServer) ;
-          it=buffers.find(*itServer) ;
-        }
-        bufferList.push_back(it->second) ;
-      }
-      free=false ;
+      list<int>::iterator itServer, itSize;
+      list<CClientBuffer*> bufferList;
+      map<int,CClientBuffer*>::iterator it;
+      list<CClientBuffer*>::iterator itBuffer;
+      list<CBufferOut*>  retBuffer;
+      bool free;
+
+      for (itServer = serverList.begin(); itServer != serverList.end(); itServer++)
+      {
+        it = buffers.find(*itServer);
+        if (it == buffers.end())
+        {
+          newBuffer(*itServer);
+          it = buffers.find(*itServer);
+        }
+        bufferList.push_back(it->second);
+      }
+      free = false;
 
       CTimer::get("Blocking time").resume();
-      while(!free)
-      {
-        free=true ;
-        for(itBuffer=bufferList.begin(),itSize=sizeList.begin(); itBuffer!=bufferList.end();itBuffer++,itSize++)
-        {
-          (*itBuffer)->checkBuffer() ;
-         free&=(*itBuffer)->isBufferFree(*itSize) ;
+      while (!free)
+      {
+        free = true;
+        for (itBuffer = bufferList.begin(), itSize = sizeList.begin(); itBuffer != bufferList.end(); itBuffer++, itSize++)
+        {
+          (*itBuffer)->checkBuffer();
+         free &= (*itBuffer)->isBufferFree(*itSize);
         }
       }
       CTimer::get("Blocking time").suspend();
 
-      for(itBuffer=bufferList.begin(),itSize=sizeList.begin(); itBuffer!=bufferList.end();itBuffer++,itSize++)
-      {
-        retBuffer.push_back((*itBuffer)->getBuffer(*itSize)) ;
-      }
-      return retBuffer ;
-
+      for (itBuffer = bufferList.begin(), itSize = sizeList.begin(); itBuffer != bufferList.end(); itBuffer++, itSize++)
+      {
+        retBuffer.push_back((*itBuffer)->getBuffer(*itSize));
+      }
+      return retBuffer;
    }
 
@@ -193,5 +225,5 @@
    void CContextClient::newBuffer(int rank)
    {
-      buffers[rank]=new CClientBuffer(interComm,rank, mapBufferSize_[rank]) ;
+      buffers[rank] = new CClientBuffer(interComm, rank, mapBufferSize_[rank]);
    }
 
@@ -202,8 +234,8 @@
    bool CContextClient::checkBuffers(void)
    {
-      map<int,CClientBuffer*>::iterator itBuff ;
-      bool pending=false ;
-      for(itBuff=buffers.begin();itBuff!=buffers.end();itBuff++) pending|=itBuff->second->checkBuffer() ;
-      return pending ;
+      map<int,CClientBuffer*>::iterator itBuff;
+      bool pending = false;
+      for (itBuff = buffers.begin(); itBuff != buffers.end(); itBuff++) pending |= itBuff->second->checkBuffer();
+      return pending;
    }
 
@@ -211,6 +243,6 @@
    void CContextClient::releaseBuffers(void)
    {
-      map<int,CClientBuffer*>::iterator itBuff ;
-      for(itBuff=buffers.begin();itBuff!=buffers.end();itBuff++) delete itBuff->second ;
+      map<int,CClientBuffer*>::iterator itBuff;
+      for (itBuff = buffers.begin(); itBuff != buffers.end(); itBuff++) delete itBuff->second;
    }
 
@@ -222,8 +254,8 @@
    bool CContextClient::checkBuffers(list<int>& ranks)
    {
-      list<int>::iterator it ;
-      bool pending=false ;
-      for(it=ranks.begin();it!=ranks.end();it++) pending|=buffers[*it]->checkBuffer() ;
-      return pending ;
+      list<int>::iterator it;
+      bool pending = false;
+      for (it = ranks.begin(); it != ranks.end(); it++) pending |= buffers[*it]->checkBuffer();
+      return pending;
    }
 
@@ -232,5 +264,5 @@
    \param [in] mapSize mapping rank of connected server to size of allocated buffer
    */
-   void CContextClient::setBufferSize(const std::map<int, StdSize>& mapSize)
+   void CContextClient::setBufferSize(const std::map<int,StdSize>& mapSize)
    {
      mapBufferSize_ = mapSize;
@@ -238,47 +270,21 @@
    }
 
-   /*!
-   Get leading server in the group of connected server
-   \return rank of leading server
-   */
-   int CContextClient::getServerLeader(void)
-   {
-     int clientByServer=clientSize/serverSize ;
-     int remain=clientSize%serverSize ;
-
-     if (clientRank<(clientByServer+1)*remain)
-     {
-       return clientRank/(clientByServer+1) ;
-     }
-     else
-     {
-       int rank=clientRank-(clientByServer+1)*remain ;
-       int nbServer=serverSize-remain ;
-       return remain+rank/clientByServer ;
-     }
-   }
-
-   /*!
-   Check if client connects to leading server
-   \return connected(true), not connected (false)
-   */
-   bool CContextClient::isServerLeader(void)
-   {
-     int clientByServer=clientSize/serverSize ;
-     int remain=clientSize%serverSize ;
-
-     if (clientRank<(clientByServer+1)*remain)
-     {
-       if (clientRank%(clientByServer+1)==0) return true ;
-       else return false ;
-     }
-     else
-     {
-       int rank=clientRank-(clientByServer+1)*remain ;
-       int nbServer=serverSize-remain ;
-       if  (rank%clientByServer==0) return true ;
-       else return false ;
-     }
-   }
+  /*!
+  Get leading server in the group of connected server
+  \return ranks of leading servers
+  */
+  const std::list<int>& CContextClient::getRanksServerLeader(void) const
+  {
+    return ranksServerLeader;
+  }
+
+  /*!
+  Check if client connects to leading server
+  \return connected(true), not connected (false)
+  */
+  bool CContextClient::isServerLeader(void) const
+  {
+    return !ranksServerLeader.empty();
+  }
 
    /*!
@@ -287,37 +293,39 @@
    void CContextClient::finalize(void)
    {
-     map<int,CClientBuffer*>::iterator itBuff ;
-     bool stop=true ;
-
-     CEventClient event(CContext::GetType(),CContext::EVENT_ID_CONTEXT_FINALIZE) ;
+     map<int,CClientBuffer*>::iterator itBuff;
+     bool stop = true;
+
+     CEventClient event(CContext::GetType(), CContext::EVENT_ID_CONTEXT_FINALIZE);
      if (isServerLeader())
      {
-       CMessage msg ;
-       event.push(getServerLeader(),1,msg) ;
-       sendEvent(event) ;
+       CMessage msg;
+       const std::list<int>& ranks = getRanksServerLeader();
+       for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+         event.push(*itRank, 1, msg);
+       sendEvent(event);
      }
-     else sendEvent(event) ;
+     else sendEvent(event);
 
      CTimer::get("Blocking time").resume();
-     while(stop)
+     while (stop)
      {
-       checkBuffers() ;
-       stop=false ;
-       for(itBuff=buffers.begin();itBuff!=buffers.end();itBuff++) stop|=itBuff->second->hasPendingRequest() ;
+       checkBuffers();
+       stop = false;
+       for (itBuff = buffers.begin(); itBuff != buffers.end(); itBuff++) stop |= itBuff->second->hasPendingRequest();
      }
      CTimer::get("Blocking time").suspend();
 
-     std::map<int, StdSize>::const_iterator itbMap = mapBufferSize_.begin(),
-                                            iteMap = mapBufferSize_.end(), itMap;
+     std::map<int,StdSize>::const_iterator itbMap = mapBufferSize_.begin(),
+                                           iteMap = mapBufferSize_.end(), itMap;
      StdSize totalBuf = 0;
      for (itMap = itbMap; itMap != iteMap; ++itMap)
      {
-       report(10)<< " Memory report : Context <"<<context->getId()<<"> : client side : memory used for buffer of each connection to server" << endl
-                 << "  +) To server with rank " << itMap->first << " : " << itMap->second << " bytes " << endl;
+       report(10) << " Memory report : Context <" << context->getId() << "> : client side : memory used for buffer of each connection to server" << endl
+                  << "  +) To server with rank " << itMap->first << " : " << itMap->second << " bytes " << endl;
        totalBuf += itMap->second;
      }
-     report(0)<< " Memory report : Context <"<<context->getId()<<"> : client side : total memory used for buffer "<<totalBuf<<" bytes"<<endl ;
-
-     releaseBuffers() ;
+     report(0) << " Memory report : Context <" << context->getId() << "> : client side : total memory used for buffer " << totalBuf << " bytes" << endl;
+
+     releaseBuffers();
    }
 }
Index: /XIOS/trunk/src/context_client.hpp
===================================================================
--- /XIOS/trunk/src/context_client.hpp	(revision 594)
+++ /XIOS/trunk/src/context_client.hpp	(revision 595)
@@ -10,5 +10,5 @@
 namespace xios
 {
-  class CContext ;
+  class CContext;
 
   /*!
@@ -23,59 +23,62 @@
   {
     public:
-    // Contructor
-    CContextClient(CContext* parent,MPI_Comm intraComm, MPI_Comm interComm, CContext* parentServer = 0) ;
+      // Contructor
+      CContextClient(CContext* parent, MPI_Comm intraComm, MPI_Comm interComm, CContext* parentServer = 0);
 
-    // Send event to server
-    void sendEvent(CEventClient& event) ;
-    void waitEvent(list<int>& ranks) ;
+      // Send event to server
+      void sendEvent(CEventClient& event);
+      void waitEvent(list<int>& ranks);
 
-    // Functions relates to set/get buffers
-    list<CBufferOut*> getBuffers(list<int>& serverlist, list<int>& sizeList) ;
-    void newBuffer(int rank) ;
-    bool checkBuffers(list<int>& ranks) ;
-    bool checkBuffers(void);
-    void releaseBuffers(void);
+      // Functions relates to set/get buffers
+      list<CBufferOut*> getBuffers(list<int>& serverlist, list<int>& sizeList);
+      void newBuffer(int rank);
+      bool checkBuffers(list<int>& ranks);
+      bool checkBuffers(void);
+      void releaseBuffers(void);
 
-    bool isServerLeader(void) ;
-    int getServerLeader(void) ;
+      bool isServerLeader(void) const;
+      const std::list<int>& getRanksServerLeader(void) const;
 
-    // Close and finalize context client
-    void closeContext(void) ;
-    void finalize(void) ;
+      // Close and finalize context client
+      void closeContext(void);
+      void finalize(void);
 
-    void setBufferSize(const std::map<int, StdSize>& mapSize);
-    void sendBufferSizeEvent();
+      void setBufferSize(const std::map<int,StdSize>& mapSize);
+      void sendBufferSizeEvent();
 
     public:
-      CContext* context ; //!< Context for client
+      CContext* context; //!< Context for client
 
-      size_t timeLine ; //!< Timeline of each event
+      size_t timeLine; //!< Timeline of each event
 
-      int clientRank ; //!< Rank of current client
+      int clientRank; //!< Rank of current client
 
-      int clientSize ; //!< Size of client group
+      int clientSize; //!< Size of client group
 
-      int serverSize ; //!< Size of server group
+      int serverSize; //!< Size of server group
 
-      MPI_Comm interComm ; //!< Communicator of server group
+      MPI_Comm interComm; //!< Communicator of server group
 
-      MPI_Comm intraComm ; //!< Communicator of client group
+      MPI_Comm intraComm; //!< Communicator of client group
 
-      map<int,CClientBuffer*> buffers ; //!< Buffers for connection to servers
+      map<int,CClientBuffer*> buffers; //!< Buffers for connection to servers
 
     private:
       //! Mapping of server and buffer size for each connection to server
-      std::map<int, StdSize> mapBufferSize_;
+      std::map<int,StdSize> mapBufferSize_;
 
       //! Context for server (Only used in attached mode)
       CContext* parentServer;
 
+      //! List of server ranks for which the client is leader
+      std::list<int> ranksServerLeader;
+
     public: // Some function should be removed in the future
-      //    void registerEvent(CEventClient& event) ;
-//    list<CBufferOut*> newEvent(CEventClient& event,list<int>& sizes) ;
-//    bool locked ;
-//    set<int> connectedServer ;
+      //    void registerEvent(CEventClient& event);
+//    list<CBufferOut*> newEvent(CEventClient& event,list<int>& sizes);
+//    bool locked;
+//    set<int> connectedServer;
 
-  } ;
+  };
 }
 
Index: /XIOS/trunk/src/group_template_impl.hpp
===================================================================
--- /XIOS/trunk/src/group_template_impl.hpp	(revision 594)
+++ /XIOS/trunk/src/group_template_impl.hpp	(revision 595)
@@ -385,5 +385,7 @@
          msg<<this->getId() ;
          msg<<id ;
-         event.push(client->getServerLeader(),1,msg) ;
+         const std::list<int>& ranks = client->getRanksServerLeader();
+         for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+           event.push(*itRank,1,msg) ;
          client->sendEvent(event) ;
        }
@@ -407,5 +409,7 @@
          msg<<this->getId() ;
          msg<<id ;
-         event.push(client->getServerLeader(),1,msg) ;
+         const std::list<int>& ranks = client->getRanksServerLeader();
+         for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+           event.push(*itRank,1,msg) ;
          client->sendEvent(event) ;
        }
Index: /XIOS/trunk/src/node/axis.cpp
===================================================================
--- /XIOS/trunk/src/node/axis.cpp	(revision 594)
+++ /XIOS/trunk/src/node/axis.cpp	(revision 595)
@@ -119,11 +119,11 @@
       StdSize zoom_begin,zoom_end, zoom_size, axisSize;
 
-      zoom_begin = (this->zoom_begin.isEmpty()) ?  0 : this->zoom_begin.getValue() ;
-      zoom_size  = (this->zoom_size.isEmpty()) ?  size.getValue() : this->zoom_size.getValue() ;
-      zoom_end   = (this->zoom_end.isEmpty()) ?  (size.getValue() - 1) : this->zoom_end.getValue() ;
-
-      if (this->zoom_begin.isEmpty()) zoom_begin=zoom_end-zoom_size+1 ;
-      if (this->zoom_end.isEmpty()) zoom_end=zoom_begin+zoom_size-1 ;
-      if (this->zoom_size.isEmpty()) zoom_size=zoom_end-zoom_begin+1 ;
+      zoom_begin = this->zoom_begin.isEmpty() ? 0 : this->zoom_begin.getValue();
+      zoom_size  = this->zoom_size.isEmpty() ? size.getValue() : this->zoom_size.getValue();
+      zoom_end   = this->zoom_end.isEmpty() ? (size.getValue() - 1) : this->zoom_end.getValue();
+
+      if (this->zoom_begin.isEmpty()) zoom_begin = zoom_end - zoom_size + 1;
+      if (this->zoom_end.isEmpty()) zoom_end = zoom_begin + zoom_size - 1;
+      if (this->zoom_size.isEmpty()) zoom_size = zoom_end - zoom_begin + 1;
       axisSize = size.getValue();
 
@@ -132,7 +132,7 @@
               << "One or more attributes among <zoom_begin>, <zoom_end>, <zoom_size> of axis [ id = '" << getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] are not well specified");
 
-      this->zoom_begin.setValue(zoom_begin) ;
-      this->zoom_end.setValue(zoom_end) ;
-      this->zoom_size.setValue(zoom_size) ;
+      this->zoom_begin.setValue(zoom_begin);
+      this->zoom_end.setValue(zoom_end);
+      this->zoom_size.setValue(zoom_size);
    }
 
@@ -158,7 +158,7 @@
          if (mask.extent(0) != ni)
             ERROR("CAxis::checkMask(void)",
-                  <<"the mask has not the same size than the local axis"<<endl
-                  <<"Local size is "<<ni<<"x"<<endl
-                  <<"Mask size is "<<mask.extent(0)<<"x");
+                  << "the mask has not the same size than the local axis" << endl
+                  << "Local size is " << ni << "x" << endl
+                  << "Mask size is " << mask.extent(0) << "x");
          for (int i = 0; i < ni; ++i)
          {
@@ -181,5 +181,5 @@
   bool CAxis::dispatchEvent(CEventServer& event)
    {
-      if (SuperClass::dispatchEvent(event)) return true ;
+      if (SuperClass::dispatchEvent(event)) return true;
       else
       {
@@ -187,11 +187,11 @@
         {
            case EVENT_ID_SERVER_ATTRIBUT :
-             recvServerAttribut(event) ;
-             return true ;
-             break ;
+             recvServerAttribut(event);
+             return true;
+             break;
            default :
              ERROR("bool CContext::dispatchEvent(CEventServer& event)",
-                    <<"Unknown Event") ;
-           return false ;
+                    << "Unknown Event");
+           return false;
          }
       }
@@ -202,31 +202,8 @@
    {
      if (this->areClientAttributesChecked_) return;
+
      this->checkAttributes();
 
-     CContext* context=CContext::getCurrent() ;
-     if (context->hasClient)
-     {
-       computeServerIndex(globalDim, orderPositionInGrid, distType);
-     }
-
      this->areClientAttributesChecked_ = true;
-   }
-
-   void CAxis::computeServerIndex(const std::vector<int>& globalDim, int orderPositionInGrid,
-                                  CServerDistributionDescription::ServerDistributionType distType)
-   {
-     CServerDistributionDescription serverDescription(globalDim);
-
-     CContext* context=CContext::getCurrent() ;
-     CContextClient* client=context->client ;
-     int nbServer=client->serverSize ;
-     int serverRank=client->getServerLeader() ;
-
-     serverDescription.computeServerDistribution(nbServer, false, distType);
-     std::vector<std::vector<int> > serverIndexBegin = serverDescription.getServerIndexBegin();
-     std::vector<std::vector<int> > serverDimensionSizes = serverDescription.getServerDimensionSizes();
-     begin_srv = (serverIndexBegin[serverRank])[orderPositionInGrid];
-     ni_srv = serverDimensionSizes[serverRank][orderPositionInGrid];
-     end_srv = begin_srv+ni_srv-1;
    }
 
@@ -238,10 +215,10 @@
                                                                      orderPositionInGrid,
                                                                      distType);
-     CContext* context=CContext::getCurrent() ;
+     CContext* context = CContext::getCurrent();
 
      if (this->isChecked) return;
      if (context->hasClient)
      {
-       sendServerAttribut() ;
+       sendServerAttribut(globalDim, orderPositionInGrid, distType);
      }
 
@@ -249,27 +226,49 @@
    }
 
-  void CAxis::sendServerAttribut(void)
+  void CAxis::sendServerAttribut(const std::vector<int>& globalDim, int orderPositionInGrid,
+                                 CServerDistributionDescription::ServerDistributionType distType)
   {
-    CContext* context=CContext::getCurrent();
-    CContextClient* client=context->client;
-
-    CEventClient event(getType(),EVENT_ID_SERVER_ATTRIBUT) ;
+    CContext* context = CContext::getCurrent();
+    CContextClient* client = context->client;
+
+    CServerDistributionDescription serverDescription(globalDim);
+
+    int nbServer = client->serverSize;
+
+    serverDescription.computeServerDistribution(nbServer, false, distType);
+    std::vector<std::vector<int> > serverIndexBegin = serverDescription.getServerIndexBegin();
+    std::vector<std::vector<int> > serverDimensionSizes = serverDescription.getServerDimensionSizes();
+
+    CEventClient event(getType(),EVENT_ID_SERVER_ATTRIBUT);
     if (client->isServerLeader())
     {
-      CMessage msg ;
-      msg<<this->getId() ;
-      msg<<ni_srv<<begin_srv<<end_srv;
-      event.push(client->getServerLeader(),1,msg) ;
-      client->sendEvent(event) ;
+      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)
+      {
+        // Use const int to ensure CMessage holds a copy of the value instead of just a reference
+        const int begin = serverIndexBegin[*itRank][orderPositionInGrid];
+        const int ni    = serverDimensionSizes[*itRank][orderPositionInGrid];
+        const int end   = begin + ni - 1;
+
+        msgs.push_back(CMessage());
+        CMessage& msg = msgs.back();
+        msg << this->getId();
+        msg << ni << begin << end;
+
+        event.push(*itRank,1,msg);
+      }
+      client->sendEvent(event);
     }
-    else client->sendEvent(event) ;
+    else client->sendEvent(event);
   }
 
   void CAxis::recvServerAttribut(CEventServer& event)
   {
-    CBufferIn* buffer=event.subEvents.begin()->buffer;
-    string axisId ;
-    *buffer>>axisId ;
-    get(axisId)->recvServerAttribut(*buffer) ;
+    CBufferIn* buffer = event.subEvents.begin()->buffer;
+    string axisId;
+    *buffer >> axisId;
+    get(axisId)->recvServerAttribut(*buffer);
   }
 
@@ -281,11 +280,11 @@
     buffer>>ni_srv>>begin_srv>>end_srv;
 
-    zoom_begin_srv = zoom_begin.getValue() > begin_srv ? zoom_begin.getValue() : begin_srv ;
-    zoom_end_srv   = zoom_end < end_srv ? zoom_end : end_srv ;
-    zoom_size_srv  = zoom_end_srv-zoom_begin_srv+1 ;
+    zoom_begin_srv = zoom_begin.getValue() > begin_srv ? zoom_begin.getValue() : begin_srv;
+    zoom_end_srv   = zoom_end < end_srv ? zoom_end : end_srv;
+    zoom_size_srv  = zoom_end_srv - zoom_begin_srv + 1;
 
     if (zoom_size_srv<=0)
     {
-      zoom_begin_srv=0 ; zoom_end_srv=0 ; zoom_size_srv=0 ;
+      zoom_begin_srv = 0; zoom_end_srv = 0; zoom_size_srv = 0;
     }
 
@@ -294,5 +293,5 @@
       zoom_begin_srv = zoom_begin.getValue();
       zoom_end_srv   = zoom_end;
-      zoom_size_srv  = zoom_end_srv-zoom_begin_srv+1 ;
+      zoom_size_srv  = zoom_end_srv - zoom_begin_srv + 1;
     }
   }
Index: /XIOS/trunk/src/node/axis.hpp
===================================================================
--- /XIOS/trunk/src/node/axis.hpp	(revision 594)
+++ /XIOS/trunk/src/node/axis.hpp	(revision 595)
@@ -14,5 +14,4 @@
 
 namespace xios {
-
    /// ////////////////////// DÃ©clarations ////////////////////// ///
 
@@ -75,5 +74,6 @@
          static ENodeType GetType(void);
 
-         void sendServerAttribut(void);
+         void sendServerAttribut(const std::vector<int>& globalDim, int orderPositionInGrid,
+                                 CServerDistributionDescription::ServerDistributionType distType);
          static bool dispatchEvent(CEventServer& event);
          static void recvServerAttribut(CEventServer& event);
@@ -86,10 +86,10 @@
         int zoom_begin_srv, zoom_end_srv, zoom_size_srv;
         int ni_srv, begin_srv, end_srv;
+
       private :
          void checkData();
          void checkMask();
          void checkZoom();
-         void computeServerIndex(const std::vector<int>& globalDim, int orderPositionInGrid,
-                                 CServerDistributionDescription::ServerDistributionType disType);
+
       private:
 
@@ -100,6 +100,4 @@
 
          DECLARE_REF_FUNC(Axis,axis)
-
-
    }; // class CAxis
 
@@ -108,7 +106,4 @@
    // Declare/Define CAxisGroup and CAxisDefinition
    DECLARE_GROUP(CAxis);
-
-   ///--------------------------------------------------------------
-
 } // namespace xios
 
Index: /XIOS/trunk/src/node/context.cpp
===================================================================
--- /XIOS/trunk/src/node/context.cpp	(revision 594)
+++ /XIOS/trunk/src/node/context.cpp	(revision 595)
@@ -241,7 +241,7 @@
      if (hasClient)
      {
-       size_t bufferSizeMin = 10*sizeof(size_t)*1024;
+       size_t bufferSizeMin = 10 * sizeof(size_t) * 1024;
 #define DECLARE_NODE(Name_, name_)    \
-   bufferSizeMin = (bufferSizeMin < sizeof(C##Name_##Definition)) ?  sizeof(C##Name_##Definition) : bufferSizeMin;
+       bufferSizeMin = (bufferSizeMin < sizeof(C##Name_##Definition)) ?  sizeof(C##Name_##Definition) : bufferSizeMin;
 #define DECLARE_NODE_PAR(Name_, name_)
 #include "node_type.conf"
@@ -251,14 +251,19 @@
          if (client->isServerLeader())
          {
-           bufferSize[client->getServerLeader()] = bufferSizeMin;
+           const std::list<int>& ranks = client->getRanksServerLeader();
+           for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+             bufferSize[*itRank] = bufferSizeMin;
          }
          else
           return;
        }
-
-       std::map<int, StdSize>::iterator  it = bufferSize.begin(),
-                                        ite = bufferSize.end();
-       for (; it != ite; ++it)
-       it->second = (it->second < bufferSizeMin) ? bufferSizeMin : it->second;
+       else
+       {
+         std::map<int, StdSize>::iterator it  = bufferSize.begin(),
+                                          ite = bufferSize.end();
+         for (; it != ite; ++it)
+           it->second = (it->second < bufferSizeMin) ? bufferSizeMin : it->second;
+       }
+
        client->setBufferSize(bufferSize);
      }
@@ -513,5 +518,7 @@
        CMessage msg;
        msg<<this->getIdServer();
-       event.push(client->getServerLeader(),1,msg);
+       const std::list<int>& ranks = client->getRanksServerLeader();
+       for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+         event.push(*itRank,1,msg);
        client->sendEvent(event);
      }
@@ -539,5 +546,7 @@
          CMessage msg;
          msg<<this->getIdServer()<<step;
-         event.push(client->getServerLeader(),1,msg);
+         const std::list<int>& ranks = client->getRanksServerLeader();
+         for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+           event.push(*itRank,1,msg);
          client->sendEvent(event);
        }
@@ -549,5 +558,4 @@
    void CContext::recvUpdateCalendar(CEventServer& event)
    {
-
       CBufferIn* buffer=event.subEvents.begin()->buffer;
       string id;
@@ -572,5 +580,7 @@
        CMessage msg;
        msg<<this->getIdServer();
-       event.push(client->getServerLeader(),1,msg);
+       const std::list<int>& ranks = client->getRanksServerLeader();
+       for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+         event.push(*itRank,1,msg) ;
        client->sendEvent(event);
      }
@@ -603,5 +613,7 @@
          CMessage msg;
          msg<<this->getIdServer();
-         event.push(client->getServerLeader(),1,msg);
+         const std::list<int>& ranks = client->getRanksServerLeader();
+         for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+           event.push(*itRank,1,msg);
          client->sendEvent(event);
        }
Index: /XIOS/trunk/src/node/domain.cpp
===================================================================
--- /XIOS/trunk/src/node/domain.cpp	(revision 594)
+++ /XIOS/trunk/src/node/domain.cpp	(revision 595)
@@ -646,37 +646,38 @@
     CServerDistributionDescription serverDescription(nGlobDomain);
 
-    int ni_srv=ni_glo.getValue() ;
-    int ibegin_srv=0 ;
-    int iend_srv=ni_glo.getValue() ;
-
-    int nj_srv ;
-    int jbegin_srv ;
-    int jend_srv ;
-
-    CContext* context=CContext::getCurrent() ;
-    CContextClient* client=context->client ;
-    int nbServer=client->serverSize ;
-    int serverRank=client->getServerLeader() ;
-
-     serverDescription.computeServerDistribution(nbServer);
-     std::vector<std::vector<int> > serverIndexBegin = serverDescription.getServerIndexBegin();
-     std::vector<std::vector<int> > serverDimensionSizes = serverDescription.getServerDimensionSizes();
-     ibegin_srv = (serverIndexBegin[serverRank])[0];
-     jbegin_srv = serverIndexBegin[serverRank][1];
-     ni_srv = serverDimensionSizes[serverRank][0];
-     nj_srv = serverDimensionSizes[serverRank][1];
-     iend_srv = ibegin_srv+ni_srv-1;
-     jend_srv = jbegin_srv+nj_srv-1;
-
-     CEventClient event(getType(),EVENT_ID_SERVER_ATTRIBUT) ;
-     if (client->isServerLeader())
-     {
-       CMessage msg ;
-       msg<<this->getId() ;
-       msg<<ni_srv<<ibegin_srv<<iend_srv<<nj_srv<<jbegin_srv<<jend_srv;
-       event.push(client->getServerLeader(),1,msg) ;
-       client->sendEvent(event) ;
-     }
-     else client->sendEvent(event) ;
+    CContext* context = CContext::getCurrent();
+    CContextClient* client = context->client;
+    int nbServer = client->serverSize;
+
+    serverDescription.computeServerDistribution(nbServer);
+    std::vector<std::vector<int> > serverIndexBegin = serverDescription.getServerIndexBegin();
+    std::vector<std::vector<int> > serverDimensionSizes = serverDescription.getServerDimensionSizes();
+
+    CEventClient event(getType(),EVENT_ID_SERVER_ATTRIBUT);
+    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)
+      {
+        // Use const int to ensure CMessage holds a copy of the value instead of just a reference
+        const int ibegin_srv = serverIndexBegin[*itRank][0];
+        const int jbegin_srv = serverIndexBegin[*itRank][1];
+        const int ni_srv = serverDimensionSizes[*itRank][0];
+        const int nj_srv = serverDimensionSizes[*itRank][1];
+        const int iend_srv = ibegin_srv + ni_srv - 1;
+        const int jend_srv = jbegin_srv + nj_srv - 1;
+
+        msgs.push_back(CMessage());
+        CMessage& msg = msgs.back();
+        msg << this->getId() ;
+        msg << ni_srv << ibegin_srv << iend_srv << nj_srv << jbegin_srv << jend_srv;
+
+        event.push(*itRank,1,msg);
+      }
+      client->sendEvent(event);
+    }
+    else client->sendEvent(event);
   }
 
@@ -921,9 +922,8 @@
   void CDomain::recvServerAttribut(CBufferIn& buffer)
   {
-    int zoom_iend=zoom_ibegin.getValue()+zoom_ni.getValue()-1 ;
-    int zoom_jend=zoom_jbegin.getValue()+zoom_nj.getValue()-1 ;
-
-     buffer>>ni_srv>>ibegin_srv>>iend_srv>>nj_srv>>jbegin_srv>>jend_srv;
-
+    int zoom_iend = zoom_ibegin.getValue() + zoom_ni.getValue() - 1;
+    int zoom_jend = zoom_jbegin.getValue() + zoom_nj.getValue() - 1;
+
+    buffer >> ni_srv >> ibegin_srv >> iend_srv >> nj_srv >> jbegin_srv >> jend_srv;
 
     zoom_ibegin_srv = zoom_ibegin.getValue() > ibegin_srv ? zoom_ibegin.getValue() : ibegin_srv ;
Index: /XIOS/trunk/src/node/field.cpp
===================================================================
--- /XIOS/trunk/src/node/field.cpp	(revision 594)
+++ /XIOS/trunk/src/node/field.cpp	(revision 595)
@@ -872,5 +872,7 @@
          msg << this->getId();
          msg << id;
-         event.push(client->getServerLeader(),1,msg);
+         const std::list<int>& ranks = client->getRanksServerLeader();
+         for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+           event.push(*itRank,1,msg);
          client->sendEvent(event);
        }
@@ -892,5 +894,7 @@
          msg << this->getId();
          msg << id;
-         event.push(client->getServerLeader(),1,msg);
+         const std::list<int>& ranks = client->getRanksServerLeader();
+         for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+           event.push(*itRank,1,msg);
          client->sendEvent(event);
        }
Index: /XIOS/trunk/src/node/file.cpp
===================================================================
--- /XIOS/trunk/src/node/file.cpp	(revision 594)
+++ /XIOS/trunk/src/node/file.cpp	(revision 595)
@@ -617,5 +617,7 @@
          msg<<this->getId() ;
          msg<<id ;
-         event.push(client->getServerLeader(),1,msg) ;
+         const std::list<int>& ranks = client->getRanksServerLeader();
+         for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+           event.push(*itRank,1,msg);
          client->sendEvent(event) ;
        }
@@ -642,5 +644,7 @@
          msg<<this->getId() ;
          msg<<id ;
-         event.push(client->getServerLeader(),1,msg) ;
+         const std::list<int>& ranks = client->getRanksServerLeader();
+         for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+           event.push(*itRank,1,msg);
          client->sendEvent(event) ;
        }
@@ -744,5 +748,7 @@
          msg<<this->getId() ;
          msg<<id ;
-         event.push(client->getServerLeader(),1,msg) ;
+         const std::list<int>& ranks = client->getRanksServerLeader();
+         for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+           event.push(*itRank,1,msg);
          client->sendEvent(event) ;
        }
@@ -769,5 +775,7 @@
          msg<<this->getId() ;
          msg<<id ;
-         event.push(client->getServerLeader(),1,msg) ;
+         const std::list<int>& ranks = client->getRanksServerLeader();
+         for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+           event.push(*itRank,1,msg);
          client->sendEvent(event) ;
        }
Index: /XIOS/trunk/src/node/grid.cpp
===================================================================
--- /XIOS/trunk/src/node/grid.cpp	(revision 594)
+++ /XIOS/trunk/src/node/grid.cpp	(revision 595)
@@ -949,5 +949,7 @@
          msg<<this->getId() ;
          msg<<id ;
-         event.push(client->getServerLeader(),1,msg) ;
+         const std::list<int>& ranks = client->getRanksServerLeader();
+         for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+           event.push(*itRank,1,msg);
          client->sendEvent(event) ;
        }
@@ -974,5 +976,7 @@
          msg<<this->getId() ;
          msg<<id ;
-         event.push(client->getServerLeader(),1,msg) ;
+         const std::list<int>& ranks = client->getRanksServerLeader();
+         for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+           event.push(*itRank,1,msg);
          client->sendEvent(event) ;
        }
Index: /XIOS/trunk/src/node/variable.cpp
===================================================================
--- /XIOS/trunk/src/node/variable.cpp	(revision 594)
+++ /XIOS/trunk/src/node/variable.cpp	(revision 595)
@@ -87,5 +87,7 @@
          msg<<this->getId() ;
          msg<<content ;
-         event.push(client->getServerLeader(),1,msg) ;
+         const std::list<int>& ranks = client->getRanksServerLeader();
+         for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+           event.push(*itRank,1,msg);
          client->sendEvent(event) ;
        }
Index: /XIOS/trunk/src/object_template_impl.hpp
===================================================================
--- /XIOS/trunk/src/object_template_impl.hpp	(revision 594)
+++ /XIOS/trunk/src/object_template_impl.hpp	(revision 595)
@@ -198,5 +198,7 @@
          msg << attr.getName();
          msg << attr;
-         event.push(client->getServerLeader(),1,msg);
+         const std::list<int>& ranks = client->getRanksServerLeader();
+         for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+           event.push(*itRank,1,msg);
          client->sendEvent(event);
        }
