Index: XIOS/dev/dev_ym/XIOS_COUPLING/src/config/coupler_in_attribute.conf
===================================================================
--- XIOS/dev/dev_ym/XIOS_COUPLING/src/config/coupler_in_attribute.conf	(revision 1782)
+++ XIOS/dev/dev_ym/XIOS_COUPLING/src/config/coupler_in_attribute.conf	(revision 1784)
@@ -1,1 +1,2 @@
 DECLARE_ATTRIBUTE(StdString, context)
+DECLARE_ATTRIBUTE(bool, enabled)
Index: XIOS/dev/dev_ym/XIOS_COUPLING/src/config/coupler_out_attribute.conf
===================================================================
--- XIOS/dev/dev_ym/XIOS_COUPLING/src/config/coupler_out_attribute.conf	(revision 1782)
+++ XIOS/dev/dev_ym/XIOS_COUPLING/src/config/coupler_out_attribute.conf	(revision 1784)
@@ -1,1 +1,2 @@
 DECLARE_ATTRIBUTE(StdString, context)
+DECLARE_ATTRIBUTE(bool, enabled)
Index: XIOS/dev/dev_ym/XIOS_COUPLING/src/context_client.hpp
===================================================================
--- XIOS/dev/dev_ym/XIOS_COUPLING/src/context_client.hpp	(revision 1782)
+++ XIOS/dev/dev_ym/XIOS_COUPLING/src/context_client.hpp	(revision 1784)
@@ -65,4 +65,7 @@
       void setBufferSize(const std::map<int,StdSize>& mapSize, const std::map<int,StdSize>& maxEventSize);
 
+      int getRemoteSize(void) {return serverSize;}
+      int getServerSize(void) {return serverSize;}
+      
     public:
       CContext* context; //!< Context for client
Index: XIOS/dev/dev_ym/XIOS_COUPLING/src/filter/spatial_transform_filter.cpp
===================================================================
--- XIOS/dev/dev_ym/XIOS_COUPLING/src/filter/spatial_transform_filter.cpp	(revision 1782)
+++ XIOS/dev/dev_ym/XIOS_COUPLING/src/filter/spatial_transform_filter.cpp	(revision 1784)
@@ -187,7 +187,7 @@
     CTimer::get("CSpatialTransformFilterEngine::apply").resume(); 
     
-    CContextClient* client = CContext::getCurrent()->client;
+    CContext* context = CContext::getCurrent();
     int rank;
-    MPI_Comm_rank (client->intraComm, &rank);
+    MPI_Comm_rank (context->intraComm_, &rank);
 
     // Get default value for output data
@@ -246,5 +246,5 @@
           }
           sendRecvRequest.push_back(MPI_Request());
-          MPI_Isend(sendBuff[idxSendBuff], countSize, MPI_DOUBLE, destRank, 12, client->intraComm, &sendRecvRequest.back());
+          MPI_Isend(sendBuff[idxSendBuff], countSize, MPI_DOUBLE, destRank, 12, context->intraComm_, &sendRecvRequest.back());
         }
         else
@@ -279,5 +279,5 @@
           int countSize = itRecv->second.size();
           sendRecvRequest.push_back(MPI_Request());
-          MPI_Irecv(recvBuff + currentBuff, countSize, MPI_DOUBLE, srcRank, 12, client->intraComm, &sendRecvRequest.back());
+          MPI_Irecv(recvBuff + currentBuff, countSize, MPI_DOUBLE, srcRank, 12, context->intraComm_, &sendRecvRequest.back());
           currentBuff += countSize;
         }
Index: XIOS/dev/dev_ym/XIOS_COUPLING/src/group_template.hpp
===================================================================
--- XIOS/dev/dev_ym/XIOS_COUPLING/src/group_template.hpp	(revision 1782)
+++ XIOS/dev/dev_ym/XIOS_COUPLING/src/group_template.hpp	(revision 1784)
@@ -72,7 +72,6 @@
          void addChildGroup(V* childGroup) ; 
          static bool dispatchEvent(CEventServer& event) ;
-         void sendCreateChild(const string& id="") ;
          void sendCreateChild(const string& id, CContextClient* client) ;
-         void sendCreateChildGroup(const string& id="") ;
+         void sendCreateChildGroup(const string& id, CContextClient* client) ;
          static void recvCreateChild(CEventServer& event) ;
          void recvCreateChild(CBufferIn& buffer) ;
Index: XIOS/dev/dev_ym/XIOS_COUPLING/src/group_template_impl.hpp
===================================================================
--- XIOS/dev/dev_ym/XIOS_COUPLING/src/group_template_impl.hpp	(revision 1782)
+++ XIOS/dev/dev_ym/XIOS_COUPLING/src/group_template_impl.hpp	(revision 1784)
@@ -368,37 +368,4 @@
     return CGroupFactory::AddGroup<V>(this->getShared(), childGroup->getShared()) ;
   }
-
-
-   template <class U, class V, class W>
-   void CGroupTemplate<U, V, W>::sendCreateChild(const string& id)
-   {
-    CContext* context=CContext::getCurrent() ;  
-
-    if (context->hasClient)
-    // if (!context->hasServer )
-    {
-      // Use correct context client to send message
-//      CContextClient* contextClientTmp = (0 != context->clientPrimServer) ? context->clientPrimServer : context->client;
-      int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1;
-      for (int i = 0; i < nbSrvPools; ++i)
-      {
-         CContextClient* contextClientTmp = (context->hasServer) ? context->clientPrimServer[i] : context->client;
-
-         CEventClient event(this->getType(),EVENT_ID_CREATE_CHILD) ;
-         if (contextClientTmp->isServerLeader())
-         {
-           CMessage msg ;
-           msg<<this->getId() ;
-           msg<<id ;
-           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) ;
-      }
-    }
-      
-   }
 
    template <class U, class V, class W>
@@ -420,33 +387,22 @@
    }
 
-
-   template <class U, class V, class W>
-   void CGroupTemplate<U, V, W>::sendCreateChildGroup(const string& id)
-   {
-    CContext* context=CContext::getCurrent() ;
-    if (context->hasClient)
-    {
-      // Use correct context client to send message
-      // int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1;
-      int nbSrvPools = (context->hasServer) ? (context->hasClient ? context->clientPrimServer.size() : 1) : 1;
-      for (int i = 0; i < nbSrvPools; ++i)
-      {
-        CContextClient* contextClientTmp = (context->hasServer) ? context->clientPrimServer[i] : context->client;
-        CEventClient event(this->getType(),EVENT_ID_CREATE_CHILD_GROUP) ;
-        if (contextClientTmp->isServerLeader())
-        {
-          CMessage msg ;
-          msg<<this->getId() ;
-          msg<<id ;
-          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) ;
-      }
-    }
-   }
-   
+   template <class U, class V, class W>
+   void CGroupTemplate<U, V, W>::sendCreateChildGroup(const string& id, CContextClient* client)
+   {
+     CEventClient event(this->getType(),EVENT_ID_CREATE_CHILD_GROUP) ;
+     if (client->isServerLeader())
+     {
+       CMessage msg ;
+       msg<<this->getId() ;
+       msg<<id ;
+       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) ;
+     }
+     else client->sendEvent(event) ;
+   }   
+
+
    template <class U, class V, class W>
    void CGroupTemplate<U, V, W>::recvCreateChild(CEventServer& event)
Index: XIOS/dev/dev_ym/XIOS_COUPLING/src/node/axis.cpp
===================================================================
--- XIOS/dev/dev_ym/XIOS_COUPLING/src/node/axis.cpp	(revision 1782)
+++ XIOS/dev/dev_ym/XIOS_COUPLING/src/node/axis.cpp	(revision 1784)
@@ -600,18 +600,22 @@
     CContext* context = CContext::getCurrent();
 
-    int nbSrvPools = (context->hasServer) ? (context->hasClient ? context->clientPrimServer.size() : 1) : 1;
-
-    connectedServerRank_.clear();
-    nbSenders.clear();
-
-    for (int p = 0; p < nbSrvPools; ++p)
-    {
-      CContextClient* client = (0 != context->clientPrimServer.size()) ? context->clientPrimServer[p] : context->client;
+    set<int> listNbServer ;
+
+    for (auto client : clients)
+    {
       int nbServer = client->serverSize;
       int range, clientSize = client->clientSize;
       int rank = client->clientRank;
 
-      if (connectedServerRank_.find(nbServer) == connectedServerRank_.end())
-      {
+      if (listNbServer.find(nbServer)==listNbServer.end())
+      {
+        listNbServer.insert(nbServer) ;
+ 
+        if (connectedServerRank_.find(nbServer) != connectedServerRank_.end())
+        {
+          nbSenders.erase(nbServer);
+          connectedServerRank_.erase(nbServer);
+        }
+
         size_t ni = this->n.getValue();
         size_t ibegin = this->begin.getValue();
Index: XIOS/dev/dev_ym/XIOS_COUPLING/src/node/context.cpp
===================================================================
--- XIOS/dev/dev_ym/XIOS_COUPLING/src/node/context.cpp	(revision 1782)
+++ XIOS/dev/dev_ym/XIOS_COUPLING/src/node/context.cpp	(revision 1784)
@@ -24,4 +24,6 @@
 #include "cxios.hpp"
 #include "client.hpp"
+#include "coupler_in.hpp"
+#include "coupler_out.hpp"
 
 namespace xios {
@@ -353,4 +355,7 @@
    {
       intraComm_=intraComm ;
+      MPI_Comm_rank(intraComm_, &intraCommRank_) ;
+      MPI_Comm_size(intraComm_, &intraCommSize_) ;
+
       serviceType_ = CServicesManager::CLIENT ;
       if (serviceType_==CServicesManager::CLIENT)
@@ -385,4 +390,7 @@
      hasServer=true;
      intraComm_=intraComm ;
+     MPI_Comm_rank(intraComm_, &intraCommRank_) ;
+     MPI_Comm_size(intraComm_, &intraCommSize_) ;
+
      serviceType_=serviceType ;
 
@@ -544,4 +552,14 @@
     }
 
+    for (auto it=couplerClient_.begin(); it!=couplerClient_.end(); ++it)
+    {
+      if (!finalized) it->second->checkBuffers();
+    }
+
+    for (auto it=couplerServer_.begin(); it!=couplerServer_.end(); ++it)
+    {
+      if (!finalized) it->second->eventLoop(enableEventsProcessing);
+    }
+
     if (server!=nullptr) if (!finalized) finished &= server->eventLoop(enableEventsProcessing);
   
@@ -549,5 +567,59 @@
   }
 
- 
+  void CContext::addCouplingChanel(const std::string& context, bool out)
+  {
+     vector<string> vectStr=splitRegex(context,"::") ;
+     string poolId=vectStr[0] ;
+     string serviceId=poolId ;
+     string contextId=vectStr[1] ;
+
+     int contextLeader ;
+     int type = CServicesManager::CLIENT ;
+     string contextName=CXios::getContextsManager()->getServerContextName(poolId, serviceId, 0, type, contextId) ;
+     
+     if (couplerClient_.find(contextName)==couplerClient_.end())
+     {
+       bool ok=CXios::getContextsManager()->getContextLeader(contextName, contextLeader, getIntraComm()) ;
+     
+       MPI_Comm interComm, interCommClient, interCommServer  ;
+       MPI_Comm intraCommClient, intraCommServer ;
+
+       if (ok) MPI_Intercomm_create(getIntraComm(), 0, CXios::getXiosComm(), contextLeader, 0, &interComm) ;
+
+       MPI_Comm_dup(intraComm_, &intraCommClient) ;
+       MPI_Comm_dup(intraComm_, &intraCommServer) ;
+       if (out)
+       {
+         MPI_Comm_dup(interComm, &interCommClient) ;
+         MPI_Comm_dup(interComm, &interCommServer) ;
+         CContextClient* client = new CContextClient(this, intraCommClient, interCommClient);
+         CContextServer* server = new CContextServer(this, intraCommServer, interCommServer);
+       }
+       else
+       {
+          MPI_Comm_dup(interComm, &interCommServer) ;
+          MPI_Comm_dup(interComm, &interCommClient) ;
+          CContextServer* server = new CContextServer(this, intraCommServer, interCommServer);
+          CContextClient* client = new CContextClient(this, intraCommClient, interCommClient);
+       }
+       MPI_Comm_free(&interComm) ;
+
+
+      // for now, we don't now which beffer size must be used for client coupler
+      // It will be evaluated later. Fix a constant size for now...
+      // set to 10Mb for development
+       map<int,size_t> bufferSize, maxEventSize ;
+       for(int i=0;i<client->getRemoteSize();i++)
+       {
+         bufferSize[i]=10000000 ;
+         maxEventSize[i]=10000000 ;
+       }
+
+       client->setBufferSize(bufferSize, maxEventSize);    
+       
+       couplerClient_[contextName] = client ;
+       couplerServer_[contextName] = server ;
+     }
+  }
   
   void CContext::globalEventLoop(void)
@@ -649,9 +721,9 @@
      postProcessing();
 
+     // Distribute files between secondary servers according to the data size
+     distributeFiles();
+
      // Check grid and calculate its distribution
      checkGridEnabledFields();
- 
-     // Distribute files between secondary servers according to the data size
-     distributeFiles();
 
      setClientServerBuffer(client, (hasClient && !hasServer));
@@ -659,11 +731,21 @@
          setClientServerBuffer(clientPrimServer[i], true);
 
+    
      if (hasClient)
-     {
-      // Send all attributes of current context to server
-      this->sendAllAttributesToServer();
-
-      // Send all attributes of current calendar
-      CCalendarWrapper::get(CCalendarWrapper::GetDefName())->sendAllAttributesToServer();
+     { 
+       if (hasServer)
+       { 
+         for (auto it=clientPrimServer.begin(); it!=clientPrimServer.end();++it) 
+         {
+           this->sendAllAttributesToServer(*it); // Send all attributes of current context to server
+           CCalendarWrapper::get(CCalendarWrapper::GetDefName())->sendAllAttributesToServer(*it); // Send all attributes of current calendar
+         }
+       }
+       else
+       {
+         this->sendAllAttributesToServer(client);   // Send all attributes of current context to server
+         CCalendarWrapper::get(CCalendarWrapper::GetDefName())->sendAllAttributesToServer(client); // Send all attributes of current calendar
+       }
+
 
       // We have enough information to send to server
@@ -779,5 +861,5 @@
     {
       buildFilterGraphOfFieldsWithReadAccess();
-      postProcessFilterGraph();
+      postProcessFilterGraph(); // For coupling in, modify this later
     }
     
@@ -849,4 +931,10 @@
        enabledFiles[i]->checkGridOfEnabledFields();       
      }
+
+     size = enabledCouplerOut.size();
+     for (int i = 0; i < size; ++i)
+     {
+       enabledCouplerOut[i]->checkGridOfEnabledFields();       
+     }
    }
    CATCH_DUMP_ATTR
@@ -872,5 +960,5 @@
       \param [in] sendToServer Flag to indicate whether calculated information will be sent
    */
-   void CContext::solveOnlyRefOfEnabledFields(bool sendToServer)
+   void CContext::solveOnlyRefOfEnabledFields(void)
    TRY
    {
@@ -878,5 +966,5 @@
      for (int i = 0; i < size; ++i)
      {
-       this->enabledFiles[i]->solveOnlyRefOfEnabledFields(sendToServer);
+       this->enabledFiles[i]->solveOnlyRefOfEnabledFields();
      }
 
@@ -884,4 +972,15 @@
      {
        this->enabledFiles[i]->generateNewTransformationGridDest();
+     }
+
+     size = this->enabledCouplerOut.size();
+     for (int i = 0; i < size; ++i)
+     {
+       this->enabledCouplerOut[i]->solveOnlyRefOfEnabledFields();
+     }
+
+     for (int i = 0; i < size; ++i)
+     {
+       this->enabledCouplerOut[i]->generateNewTransformationGridDest();
      }
    }
@@ -894,5 +993,5 @@
       \param [in] sendToServer Flag to indicate whether calculated information will be sent
    */
-   void CContext::solveAllRefOfEnabledFieldsAndTransform(bool sendToServer)
+   void CContext::solveAllRefOfEnabledFieldsAndTransform(void)
    TRY
    {
@@ -900,6 +999,13 @@
      for (int i = 0; i < size; ++i)
      {
-       this->enabledFiles[i]->solveAllRefOfEnabledFieldsAndTransform(sendToServer);
-     }
+       this->enabledFiles[i]->solveAllRefOfEnabledFieldsAndTransform();
+     }
+
+     size = this->enabledCouplerOut.size();
+     for (int i = 0; i < size; ++i)
+     {
+       this->enabledCouplerOut[i]->solveAllRefOfEnabledFieldsAndTransform();
+     }
+
    }
    CATCH_DUMP_ATTR
@@ -912,4 +1018,10 @@
      {
        this->enabledFiles[i]->buildFilterGraphOfEnabledFields(garbageCollector);
+     }
+
+     size = this->enabledCouplerOut.size();
+     for (int i = 0; i < size; ++i)
+     {
+       this->enabledCouplerOut[i]->buildFilterGraphOfEnabledFields(garbageCollector);
      }
    }
@@ -1002,4 +1114,6 @@
      // RÃ©solution des hÃ©ritages par rÃ©fÃ©rence au niveau des fichiers.
       const vector<CFile*> allFiles=CFile::getAll();
+      const vector<CCouplerIn*> allCouplerIn=CCouplerIn::getAll();
+      const vector<CCouplerOut*> allCouplerOut=CCouplerOut::getAll();
       const vector<CGrid*> allGrids= CGrid::getAll();
 
@@ -1009,4 +1123,10 @@
         for (unsigned int i = 0; i < allFiles.size(); i++)
           allFiles[i]->solveFieldRefInheritance(apply);
+
+        for (unsigned int i = 0; i < allCouplerIn.size(); i++)
+          allCouplerIn[i]->solveFieldRefInheritance(apply);
+
+        for (unsigned int i = 0; i < allCouplerOut.size(); i++)
+          allCouplerOut[i]->solveFieldRefInheritance(apply);
       }
 
@@ -1071,4 +1191,35 @@
    CATCH_DUMP_ATTR
 
+   void CContext::findEnabledCouplerIn(void)
+   TRY
+   {
+      const std::vector<CCouplerIn*> allCouplerIn = CCouplerIn::getAll();
+      bool enabled ;
+      for (size_t i = 0; i < allCouplerIn.size(); i++)
+      {
+        if (allCouplerIn[i]->enabled.isEmpty()) enabled=true ;
+        else enabled=allCouplerIn[i]->enabled ;
+        if (enabled) enabledCouplerIn.push_back(allCouplerIn[i]) ;
+      }
+   }
+   CATCH_DUMP_ATTR
+
+   void CContext::findEnabledCouplerOut(void)
+   TRY
+   {
+      const std::vector<CCouplerOut*> allCouplerOut = CCouplerOut::getAll();
+      bool enabled ;
+      for (size_t i = 0; i < allCouplerOut.size(); i++)
+      {
+        if (allCouplerOut[i]->enabled.isEmpty()) enabled=true ;
+        else enabled=allCouplerOut[i]->enabled ;
+        if (enabled) enabledCouplerOut.push_back(allCouplerOut[i]) ;
+      }
+   }
+   CATCH_DUMP_ATTR
+
+
+
+
    void CContext::distributeFiles(void)
    TRY
@@ -1669,4 +1820,8 @@
       findEnabledWriteModeFiles();
       findEnabledReadModeFiles();
+      findEnabledCouplerIn();
+      findEnabledCouplerOut();
+      
+      createCouplerInterCommunicator() ;
 
       // For now, only read files with client and only one level server
@@ -1689,8 +1844,8 @@
 
       // Only search and rebuild all reference objects of enable fields, don't transform
-      this->solveOnlyRefOfEnabledFields(false);
+      this->solveOnlyRefOfEnabledFields();
 
       // Search and rebuild all reference object of enabled fields, and transform
-      this->solveAllRefOfEnabledFieldsAndTransform(false);
+      this->solveAllRefOfEnabledFieldsAndTransform();
 
       // Find all fields with read access from the public API
@@ -1700,4 +1855,20 @@
 
       isPostProcessed = true;
+   }
+   CATCH_DUMP_ATTR
+
+   void CContext::createCouplerInterCommunicator(void)
+   TRY
+   {
+      // juste for test now, in future need an scheduler to avoid dead-lock
+      for(auto it=enabledCouplerOut.begin();it!=enabledCouplerOut.end();++it)
+      {
+        (*it)->createInterCommunicator() ;
+      }
+
+      for(auto it=enabledCouplerIn.begin();it!=enabledCouplerIn.end();++it)
+      {
+        (*it)->createInterCommunicator() ;
+      }
    }
    CATCH_DUMP_ATTR
@@ -1953,5 +2124,6 @@
    TRY
    {
-     std::set<StdString> gridIds;
+     std::set<pair<StdString,CContextClient*>> gridIds;
+
      int sizeFile = activeFiles.size();
      CFile* filePtr(NULL);
@@ -1966,5 +2138,5 @@
        {
          if (0 != enabledFields[numField]->getRelGrid())
-           gridIds.insert(CGrid::get(enabledFields[numField]->getRelGrid())->getId());
+           gridIds.insert(make_pair(CGrid::get(enabledFields[numField]->getRelGrid())->getId(),enabledFields[numField]->getContextClient()));
        }
      }
@@ -1973,12 +2145,11 @@
      StdString gridDefRoot("grid_definition");
      CGridGroup* gridPtr = CGridGroup::get(gridDefRoot);
-     std::set<StdString>::const_iterator it, itE = gridIds.end();
-     for (it = gridIds.begin(); it != itE; ++it)
-     {
-       gridPtr->sendCreateChild(*it);
-       CGrid::get(*it)->sendAllAttributesToServer();
-       CGrid::get(*it)->sendAllDomains();
-       CGrid::get(*it)->sendAllAxis();
-       CGrid::get(*it)->sendAllScalars();
+     for (auto it = gridIds.begin(); it != gridIds.end(); ++it)
+     {
+       gridPtr->sendCreateChild(it->first,it->second);
+       CGrid::get(it->first)->sendAllAttributesToServer(it->second);
+       CGrid::get(it->first)->sendAllDomains(it->second);
+       CGrid::get(it->first)->sendAllAxis(it->second);
+       CGrid::get(it->first)->sendAllScalars(it->second);
      }
    }
@@ -1989,5 +2160,5 @@
    TRY
    {
-     std::set<StdString> domainIds, axisIds, scalarIds;
+     std::set<pair<StdString,CContextClient*>> domainIds, axisIds, scalarIds;
 
      // Find all reference domain and axis of all active fields
@@ -1999,8 +2170,9 @@
        for (int j = 0; j < numEnabledFields; ++j)
        {
+         CContextClient* contextClient=enabledFields[j]->getContextClient() ;
          const std::vector<StdString>& prDomAxisScalarId = enabledFields[j]->getRefDomainAxisIds();
-         if ("" != prDomAxisScalarId[0]) domainIds.insert(prDomAxisScalarId[0]);
-         if ("" != prDomAxisScalarId[1]) axisIds.insert(prDomAxisScalarId[1]);
-         if ("" != prDomAxisScalarId[2]) scalarIds.insert(prDomAxisScalarId[2]);
+         if ("" != prDomAxisScalarId[0]) domainIds.insert(make_pair(prDomAxisScalarId[0],contextClient));
+         if ("" != prDomAxisScalarId[1]) axisIds.insert(make_pair(prDomAxisScalarId[1],contextClient));
+         if ("" != prDomAxisScalarId[2]) scalarIds.insert(make_pair(prDomAxisScalarId[2],contextClient));
        }
      }
@@ -2012,11 +2184,11 @@
      StdString scalarDefRoot("scalar_definition");
      CScalarGroup* scalarPtr = CScalarGroup::get(scalarDefRoot);
-     itE = scalarIds.end();
-     for (itScalar = scalarIds.begin(); itScalar != itE; ++itScalar)
-     {
-       if (!itScalar->empty())
+     
+     for (auto itScalar = scalarIds.begin(); itScalar != scalarIds.end(); ++itScalar)
+     {
+       if (!itScalar->first.empty())
        {
-         scalarPtr->sendCreateChild(*itScalar);
-         CScalar::get(*itScalar)->sendAllAttributesToServer();
+         scalarPtr->sendCreateChild(itScalar->first,itScalar->second);
+         CScalar::get(itScalar->first)->sendAllAttributesToServer(itScalar->second);
        }
      }
@@ -2024,11 +2196,11 @@
      StdString axiDefRoot("axis_definition");
      CAxisGroup* axisPtr = CAxisGroup::get(axiDefRoot);
-     itE = axisIds.end();
-     for (itAxis = axisIds.begin(); itAxis != itE; ++itAxis)
-     {
-       if (!itAxis->empty())
+     
+     for (auto itAxis = axisIds.begin(); itAxis != axisIds.end(); ++itAxis)
+     {
+       if (!itAxis->first.empty())
        {
-         axisPtr->sendCreateChild(*itAxis);
-         CAxis::get(*itAxis)->sendAllAttributesToServer();
+         axisPtr->sendCreateChild(itAxis->first, itAxis->second);
+         CAxis::get(itAxis->first)->sendAllAttributesToServer(itAxis->second);
        }
      }
@@ -2037,10 +2209,10 @@
      StdString domDefRoot("domain_definition");
      CDomainGroup* domPtr = CDomainGroup::get(domDefRoot);
-     itE = domainIds.end();
-     for (itDom = domainIds.begin(); itDom != itE; ++itDom)
-     {
-       if (!itDom->empty()) {
-          domPtr->sendCreateChild(*itDom);
-          CDomain::get(*itDom)->sendAllAttributesToServer();
+     
+     for (auto itDom = domainIds.begin(); itDom != domainIds.end(); ++itDom)
+     {
+       if (!itDom->first.empty()) {
+          domPtr->sendCreateChild(itDom->first, itDom->second);
+          CDomain::get(itDom->first)->sendAllAttributesToServer(itDom->second);
        }
      }
Index: XIOS/dev/dev_ym/XIOS_COUPLING/src/node/context.hpp
===================================================================
--- XIOS/dev/dev_ym/XIOS_COUPLING/src/node/context.hpp	(revision 1782)
+++ XIOS/dev/dev_ym/XIOS_COUPLING/src/node/context.hpp	(revision 1784)
@@ -26,4 +26,6 @@
    class CContext;
    class CFile;
+   class CCouplerIn ;
+   class CCouplerOut ;
    ///--------------------------------------------------------------
 
@@ -120,4 +122,7 @@
          void solveAllInheritance(bool apply=true);
          void findEnabledFiles(void);
+         void findEnabledCouplerIn(void);
+         void findEnabledCouplerOut(void);
+         void createCouplerInterCommunicator(void) ;
          void findEnabledWriteModeFiles(void);
          void findEnabledReadModeFiles(void);
@@ -128,5 +133,5 @@
          void checkAxisDomainsGridsEligibilityForCompressedOutput();
          void prepareTimeseries(void);
-         void solveOnlyRefOfEnabledFields(bool sendToServer);         
+         void solveOnlyRefOfEnabledFields(void);         
          void buildFilterGraphOfEnabledFields();
          void postProcessFilterGraph();
@@ -140,5 +145,5 @@
          void postProcessingGlobalAttributes();         
 
-         void solveAllRefOfEnabledFieldsAndTransform(bool sendToServer);
+         void solveAllRefOfEnabledFieldsAndTransform(void);
          void checkGridEnabledFields();
          void checkGridEnabledFieldsInFiles(const std::vector<CFile*>& activeFiles);
@@ -243,4 +248,7 @@
          bool setProcessingEvent(void) {isProcessingEvent_=true ;}
          bool unsetProcessingEvent(void) {isProcessingEvent_=false ;}
+         MPI_Comm getIntraComm(void) { return intraComm_ ;}
+
+         void addCouplingChanel(const std::string& contextId, bool out) ;
 
       public :
@@ -255,4 +263,8 @@
          std::vector<CFile*> enabledWriteModeFiles;
 
+         std::vector<CCouplerIn*> enabledCouplerIn;
+         std::vector<CCouplerOut*> enabledCouplerOut;
+
+
          // List of all enabled fields whose instant data is accessible from the public API
          // but which are not part of a file
@@ -272,4 +284,8 @@
          std::vector<CContextServer*> serverPrimServer;
          std::vector<CContextClient*> clientPrimServer;
+         std::map<std::string, CContextClient*> couplerClient_ ;
+         std::map<std::string, CContextServer*> couplerServer_ ;
+
+
          std::vector<std::string> primServerId_;
 
@@ -279,5 +295,7 @@
 
         MPI_Comm intraComm_ ; //! context intra communicator
-
+        int intraCommRank_ ; //! context intra communicator rank
+        int intraCommSize_ ; //! context intra communicator size
+        
       private:
          bool isPostProcessed;
Index: XIOS/dev/dev_ym/XIOS_COUPLING/src/node/coupler_in.cpp
===================================================================
--- XIOS/dev/dev_ym/XIOS_COUPLING/src/node/coupler_in.cpp	(revision 1782)
+++ XIOS/dev/dev_ym/XIOS_COUPLING/src/node/coupler_in.cpp	(revision 1784)
@@ -51,5 +51,18 @@
    CATCH_DUMP_ATTR
 
-   
+   void CCouplerIn::createInterCommunicator(void)
+   TRY
+   {
+     if (context.isEmpty())
+     {
+        ERROR("void CCouplerOut::createInterCommunicator(void)",
+               "The attribute <context> must be defined to specify the target coupling context");
+     }
+     CContext* contextPtr = CContext::getCurrent();
+     contextPtr->addCouplingChanel(context, false) ;
+   }
+   CATCH_DUMP_ATTR
+
+  
    /*!
    \brief Parse xml file and write information into coupler_in object
@@ -86,5 +99,21 @@
    CATCH
 
+   void CCouplerIn::solveDescInheritance(bool apply, const CAttributeMap * const parent)
+   TRY
+   {
+      SuperClassAttribute::setAttributes(parent,apply);
+      this->getVirtualFieldGroup()->solveDescInheritance(apply, NULL);
+   }
+   CATCH_DUMP_ATTR
 
+   void CCouplerIn::solveFieldRefInheritance(bool apply)
+   TRY
+   {
+      // Rsolution des hritages par rfrence de chacun des champs contenus dans le fichier.
+      std::vector<CField*> allF = this->getAllFields();
+      for (unsigned int i = 0; i < allF.size(); i++)
+         allF[i]->solveRefInheritance(apply);
+   }
+   CATCH_DUMP_ATTR
    /*!
    \brief Get virtual variable group
Index: XIOS/dev/dev_ym/XIOS_COUPLING/src/node/coupler_in.hpp
===================================================================
--- XIOS/dev/dev_ym/XIOS_COUPLING/src/node/coupler_in.hpp	(revision 1782)
+++ XIOS/dev/dev_ym/XIOS_COUPLING/src/node/coupler_in.hpp	(revision 1784)
@@ -11,4 +11,5 @@
 #include "context_client.hpp"
 #include "mpi.hpp"
+#include "string_tools.hpp"
 
 namespace xios
@@ -92,4 +93,7 @@
 
       public:
+         virtual void solveDescInheritance(bool apply, const CAttributeMap* const parent = 0);
+         void solveFieldRefInheritance(bool apply);
+         void createInterCommunicator(void) ;
 
       private :
Index: XIOS/dev/dev_ym/XIOS_COUPLING/src/node/coupler_out.cpp
===================================================================
--- XIOS/dev/dev_ym/XIOS_COUPLING/src/node/coupler_out.cpp	(revision 1782)
+++ XIOS/dev/dev_ym/XIOS_COUPLING/src/node/coupler_out.cpp	(revision 1784)
@@ -6,4 +6,8 @@
 #include "context.hpp"
 #include "xios_spl.hpp"
+#include "string_tools.hpp"
+#include "contexts_manager.hpp"
+#include "services_manager.hpp"
+
 
 namespace xios
@@ -102,5 +106,95 @@
    CATCH
 
-
+   void CCouplerOut::solveDescInheritance(bool apply, const CAttributeMap * const parent)
+   TRY
+   {
+      SuperClassAttribute::setAttributes(parent,apply);
+      this->getVirtualFieldGroup()->solveDescInheritance(apply, NULL);
+   }
+   CATCH_DUMP_ATTR
+
+   void CCouplerOut::solveFieldRefInheritance(bool apply)
+   TRY
+   {
+      // Rsolution des hritages par rfrence de chacun des champs contenus dans le fichier.
+      std::vector<CField*> allF = this->getAllFields();
+      for (unsigned int i = 0; i < allF.size(); i++)
+         allF[i]->solveRefInheritance(apply);
+   }
+   CATCH_DUMP_ATTR
+
+   void CCouplerOut::createInterCommunicator(void)
+   TRY
+   {
+     if (context.isEmpty())
+     {
+        ERROR("void CCouplerOut::createInterCommunicator(void)",
+               "The attribute <context> must be defined to specify the target coupling context");
+     }
+     CContext* contextPtr = CContext::getCurrent();
+     contextPtr->addCouplingChanel(context, true) ;
+   }
+   CATCH_DUMP_ATTR
+
+  
+   void CCouplerOut::solveOnlyRefOfEnabledFields(void)
+   TRY
+   {
+     int size = this->enabledFields.size();
+     for (int i = 0; i < size; ++i)
+     {
+       this->enabledFields[i]->solveOnlyReferenceEnabledField();
+     }
+   }
+   CATCH_DUMP_ATTR
+
+   void CCouplerOut::generateNewTransformationGridDest(void)
+   TRY
+   {
+     int size = this->enabledFields.size();
+     for (int i = 0; i < size; ++i)
+     {
+       this->enabledFields[i]->generateNewTransformationGridDest();
+     }
+   }
+   CATCH_DUMP_ATTR
+
+   void CCouplerOut::solveAllRefOfEnabledFieldsAndTransform(void)
+   TRY
+   {
+     int size = this->enabledFields.size();
+     for (int i = 0; i < size; ++i)
+     {       
+      this->enabledFields[i]->solveAllEnabledFieldsAndTransform();
+     }
+   }
+   CATCH_DUMP_ATTR
+
+   /*!
+    * Constructs the filter graph for each active field.
+    *
+    * \param gc the garbage collector to use when building the filter graph
+    */
+   void CCouplerOut::buildFilterGraphOfEnabledFields(CGarbageCollector& gc)
+   TRY
+   {
+     int size = this->enabledFields.size();
+     for (int i = 0; i < size; ++i)
+     {
+       this->enabledFields[i]->buildFilterGraph(gc, true);
+     }
+   }
+   CATCH_DUMP_ATTR
+
+   void CCouplerOut::checkGridOfEnabledFields(void)
+   TRY
+   { 
+     int size = this->enabledFields.size();
+     for (int i = 0; i < size; ++i)
+     {
+       this->enabledFields[i]->checkGridOfEnabledFields();
+     }
+   }
+   CATCH_DUMP_ATTR
 
    //----------------------------------------------------------------
Index: XIOS/dev/dev_ym/XIOS_COUPLING/src/node/coupler_out.hpp
===================================================================
--- XIOS/dev/dev_ym/XIOS_COUPLING/src/node/coupler_out.hpp	(revision 1782)
+++ XIOS/dev/dev_ym/XIOS_COUPLING/src/node/coupler_out.hpp	(revision 1784)
@@ -88,4 +88,12 @@
 
       public:
+        virtual void solveDescInheritance(bool apply, const CAttributeMap* const parent = 0);
+        void solveFieldRefInheritance(bool apply);
+        void createInterCommunicator(void) ;
+        void solveOnlyRefOfEnabledFields(void);
+        void generateNewTransformationGridDest(void);
+        void solveAllRefOfEnabledFieldsAndTransform() ;
+        void buildFilterGraphOfEnabledFields(CGarbageCollector& gc);
+        void checkGridOfEnabledFields(void) ;
 
       private :
Index: XIOS/dev/dev_ym/XIOS_COUPLING/src/node/domain.cpp
===================================================================
--- XIOS/dev/dev_ym/XIOS_COUPLING/src/node/domain.cpp	(revision 1782)
+++ XIOS/dev/dev_ym/XIOS_COUPLING/src/node/domain.cpp	(revision 1784)
@@ -302,6 +302,6 @@
      // 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;
-     int rankClient = client->clientRank;
+
+     int rankClient = context->intraCommRank_;
      int rankOnDomain = rankClient%nbLocalDomain;
 
@@ -680,25 +680,25 @@
     // 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;
+     int clientSize = context->intraCommSize_ ;
      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* ibegin_g = new int[clientSize] ;
+     int* jbegin_g = new int[clientSize] ;
+     int* ni_g = new int[clientSize] ;
+     int* nj_g = new int[clientSize] ;
      int v ;
      v=ibegin ;
-     MPI_Allgather(&v,1,MPI_INT,ibegin_g,1,MPI_INT,client->intraComm) ;
+     MPI_Allgather(&v,1,MPI_INT,ibegin_g,1,MPI_INT,context->intraComm_) ;
      v=jbegin ;
-     MPI_Allgather(&v,1,MPI_INT,jbegin_g,1,MPI_INT,client->intraComm) ;
+     MPI_Allgather(&v,1,MPI_INT,jbegin_g,1,MPI_INT,context->intraComm_) ;
      v=ni ;
-     MPI_Allgather(&v,1,MPI_INT,ni_g,1,MPI_INT,client->intraComm) ;
+     MPI_Allgather(&v,1,MPI_INT,ni_g,1,MPI_INT,context->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) ;
+     MPI_Allgather(&v,1,MPI_INT,nj_g,1,MPI_INT,context->intraComm_) ;
+
+     MPI_Allgatherv(lon.dataFirst(),ni,MPI_DOUBLE,lon_g.dataFirst(),ni_g, ibegin_g,MPI_DOUBLE,context->intraComm_) ;
+     MPI_Allgatherv(lat.dataFirst(),nj,MPI_DOUBLE,lat_g.dataFirst(),nj_g, jbegin_g,MPI_DOUBLE,context->intraComm_) ;
 
       delete[] ibegin_g ;
@@ -1831,21 +1831,23 @@
   {
     CContext* context=CContext::getCurrent() ;
-    
-    // This line should be changed soon.
-    int nbSrvPools = (context->hasServer) ? (context->hasClient ? context->clientPrimServer.size() : 0) : 1;
-
-    nbSenders.clear();
-    connectedServerRank_.clear();
-
-    for (int p = 0; p < nbSrvPools; ++p)
+    set<int> listNbServer ;
+
+    for (auto client : clients)
     {
-      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;
-
-      if (connectedServerRank_.find(nbServer) == connectedServerRank_.end())
-      {
+   
+      if (listNbServer.find(nbServer)==listNbServer.end())
+      {
+        listNbServer.insert(nbServer) ;
+ 
+        if (connectedServerRank_.find(nbServer) != connectedServerRank_.end())
+        {
+          nbSenders.erase(nbServer);
+          connectedServerRank_.erase(nbServer);
+        }
 
         if (indSrv_.find(nbServer) == indSrv_.end())
Index: XIOS/dev/dev_ym/XIOS_COUPLING/src/node/field.cpp
===================================================================
--- XIOS/dev/dev_ym/XIOS_COUPLING/src/node/field.cpp	(revision 1782)
+++ XIOS/dev/dev_ym/XIOS_COUPLING/src/node/field.cpp	(revision 1784)
@@ -976,5 +976,5 @@
    CATCH_DUMP_ATTR
 
-   void CField::solveOnlyReferenceEnabledField(bool doSending2Server)
+   void CField::solveOnlyReferenceEnabledField(void)
    TRY
    {
@@ -987,5 +987,5 @@
         {
           solveRefInheritance(true);
-          if (hasDirectFieldReference()) getDirectFieldReference()->solveOnlyReferenceEnabledField(false);
+          if (hasDirectFieldReference()) getDirectFieldReference()->solveOnlyReferenceEnabledField();
         }
 
@@ -1009,5 +1009,5 @@
    {
      CContext* context = CContext::getCurrent();
-     solveOnlyReferenceEnabledField(doSending2Server);
+     solveOnlyReferenceEnabledField();
 
      if (!areAllReferenceSolved)
Index: XIOS/dev/dev_ym/XIOS_COUPLING/src/node/field.hpp
===================================================================
--- XIOS/dev/dev_ym/XIOS_COUPLING/src/node/field.hpp	(revision 1782)
+++ XIOS/dev/dev_ym/XIOS_COUPLING/src/node/field.hpp	(revision 1784)
@@ -122,5 +122,5 @@
          void solveCheckMaskIndex(bool doSendingIndex);
          void solveAllReferenceEnabledField(bool doSending2Server);
-         void solveOnlyReferenceEnabledField(bool doSending2Server);
+         void solveOnlyReferenceEnabledField(void);
          void generateNewTransformationGridDest();
          void updateRef(CGrid* grid);
Index: XIOS/dev/dev_ym/XIOS_COUPLING/src/node/file.cpp
===================================================================
--- XIOS/dev/dev_ym/XIOS_COUPLING/src/node/file.cpp	(revision 1782)
+++ XIOS/dev/dev_ym/XIOS_COUPLING/src/node/file.cpp	(revision 1784)
@@ -834,5 +834,5 @@
    \param [in] sendToServer: Send all info to server (true) or only a part of it (false)
    */
-   void CFile::solveOnlyRefOfEnabledFields(bool sendToServer)
+   void CFile::solveOnlyRefOfEnabledFields(void)
    TRY
    {
@@ -840,5 +840,5 @@
      for (int i = 0; i < size; ++i)
      {
-       this->enabledFields[i]->solveOnlyReferenceEnabledField(sendToServer);
+       this->enabledFields[i]->solveOnlyReferenceEnabledField();
      }
    }
@@ -953,5 +953,5 @@
    \param [in] sendToServer: Send all info to server (true) or only a part of it (false)
    */
-   void CFile::solveAllRefOfEnabledFieldsAndTransform(bool sendToServer)
+   void CFile::solveAllRefOfEnabledFieldsAndTransform(void)
    TRY
    {
Index: XIOS/dev/dev_ym/XIOS_COUPLING/src/node/file.hpp
===================================================================
--- XIOS/dev/dev_ym/XIOS_COUPLING/src/node/file.hpp	(revision 1782)
+++ XIOS/dev/dev_ym/XIOS_COUPLING/src/node/file.hpp	(revision 1784)
@@ -108,5 +108,5 @@
          void solveFieldRefInheritance(bool apply);
          void processEnabledFile(void);
-         void solveOnlyRefOfEnabledFields(bool sendToServer);
+         void solveOnlyRefOfEnabledFields(void);
          void generateNewTransformationGridDest();
          
@@ -117,5 +117,5 @@
          void doPostTimestepOperationsForEnabledReadModeFields();
 
-         void solveAllRefOfEnabledFieldsAndTransform(bool sendToServer);
+         void solveAllRefOfEnabledFieldsAndTransform(void);
          void checkGridOfEnabledFields();
          void sendGridOfEnabledFields();
Index: XIOS/dev/dev_ym/XIOS_COUPLING/src/node/grid.cpp
===================================================================
--- XIOS/dev/dev_ym/XIOS_COUPLING/src/node/grid.cpp	(revision 1782)
+++ XIOS/dev/dev_ym/XIOS_COUPLING/src/node/grid.cpp	(revision 1784)
@@ -331,23 +331,11 @@
    {
      CContext* context = CContext::getCurrent();
-     int nbSrvPools = (context->hasServer) ? (context->hasClient ? context->clientPrimServer.size() : 0) : 1;   
-     nbSrvPools = 1;  
-     for (int p = 0; p < nbSrvPools; ++p)
-     {    
-       if (context->hasClient && this->isChecked && doSendingIndex && !isIndexSent) 
-       { 
-         if (isScalarGrid())
-           sendIndexScalarGrid();
-         else
-           sendIndex();
-         this->isIndexSent = true; 
-       }
-
-       // Not sure about this
-       //if (!(this->hasTransform() && !this->isTransformed()))
-       // this->isChecked = true;
-       //return;
+     if (context->hasClient && this->isChecked && doSendingIndex && !isIndexSent) 
+     { 
+       if (isScalarGrid())  sendIndexScalarGrid();
+       else  sendIndex();
+       this->isIndexSent = true; 
      }
-    
+
      if (this->isChecked) return;
      this->checkAttributesAfterTransformation();
@@ -364,4 +352,6 @@
    }
    CATCH_DUMP_ATTR
+
+
    bool CGrid::hasMask() const
    TRY
@@ -763,19 +753,27 @@
    {
      CContext* context = CContext::getCurrent();
-     int nbSrvPools = (context->clientPrimServer.size() == 0) ? 1 : context->clientPrimServer.size();
-     connectedServerRank_.clear();
-     connectedDataSize_.clear();
-     globalIndexOnServer_.clear();
-     nbSenders.clear();
-
-     for (int p = 0; p < nbSrvPools; ++p)
+     
+     set<int> listReceiverSize ;
+     for (auto it=clients.begin(); it!=clients.end(); ++it)
      {
-       CContextClient* client = (context->clientPrimServer.size() == 0) ? context->client : context->clientPrimServer[p];
+       
+       CContextClient* client = *it ;
+
        int receiverSize = client->serverSize;
-//       connectedServerRank_[client].clear();
-
-       if (connectedServerRank_.find(receiverSize) == connectedServerRank_.end())
+      
+       if (listReceiverSize.find(receiverSize)==listReceiverSize.end())
        {
-        if (!doGridHaveDataDistributed(client))
+         listReceiverSize.insert(receiverSize) ;
+         if (connectedServerRank_.find(receiverSize) != connectedServerRank_.end())
+         {
+            // delete corresponding map in case of recompute, probably because a grid could has been modifiedd 
+            // by a transformation
+            connectedServerRank_.erase(receiverSize);
+            connectedDataSize_.erase(receiverSize);
+            globalIndexOnServer_.erase(receiverSize);
+            nbSenders.erase(receiverSize);
+         }
+
+         if (!doGridHaveDataDistributed(client))
          {
             if (client->isServerLeader())
@@ -1307,35 +1305,4 @@
    CATCH
 
-/*
-   void CGrid::outputField(int rank, const CArray<double, 1>& stored, double* field)
-   {
-     const CArray<size_t,1>& out_i = outIndexFromClient[rank];
-     StdSize numElements = stored.numElements();
-     for (StdSize n = 0; n < numElements; ++n)
-     {
-       field[out_i(n)] = stored(n);
-     }
-   }
-
-   void CGrid::inputField(int rank, const double* const field, CArray<double,1>& stored)
-   {
-     const CArray<size_t,1>& out_i = outIndexFromClient[rank];
-     StdSize numElements = stored.numElements();
-     for (StdSize n = 0; n < numElements; ++n)
-     {
-       stored(n) = field[out_i(n)];
-     }
-   }
-
-   void CGrid::outputCompressedField(int rank, const CArray<double,1>& stored, double* field)
-   {
-     const CArray<size_t,1>& out_i = compressedOutIndexFromClient[rank];
-     StdSize numElements = stored.numElements();
-     for (StdSize n = 0; n < numElements; ++n)
-     {
-       field[out_i(n)] = stored(n);
-     }
-   }
-*/
    //----------------------------------------------------------------
 
@@ -1420,19 +1387,28 @@
   TRY
   {
-    CContext* context = CContext::getCurrent();    
-    int nbSrvPools = (context->clientPrimServer.size()==0) ? 1 : context->clientPrimServer.size();
-    connectedServerRank_.clear();
-    connectedDataSize_.clear();
-    nbSenders.clear();
-
-    for (int p = 0; p < nbSrvPools; ++p)
-    {
-      CContextClient* client = (context->clientPrimServer.size()==0) ? context->client : context->clientPrimServer[p];
+
+    CContext* context = CContext::getCurrent();
+     
+    set<int> listReceiverSize ;
+    for (auto it=clients.begin(); it!=clients.end(); ++it)
+    {
+       
+      CContextClient* client = *it ;
+
       int receiverSize = client->serverSize;
-
-//      connectedServerRank_[client].clear();
-
-      if (connectedServerRank_.find(receiverSize)==connectedServerRank_.end())
-      {
+      
+      if (listReceiverSize.find(receiverSize)==listReceiverSize.end())
+      {
+        listReceiverSize.insert(receiverSize) ;
+        if (connectedServerRank_.find(receiverSize) != connectedServerRank_.end())
+        {
+           // delete corresponding map in case of recompute, probably because a grid could has been modifiedd 
+           // by a transformation
+          connectedServerRank_.erase(receiverSize);
+          connectedDataSize_.erase(receiverSize);
+          globalIndexOnServer_.erase(receiverSize);
+          nbSenders.erase(receiverSize);
+        }
+
         if (client->isServerLeader())
         {
@@ -1680,141 +1656,63 @@
     connectedServerRankRead_ = ranks;
 
-// ym something is bad here, I comment some line, to be checked in future
-   // int nbSrvPools = (context->hasServer) ? (context->hasClient ? context->clientPrimServer.size() : 1) : 1;
-    int nbSrvPools = 1;    
     nbReadSenders.clear();
-    for (int p = 0; p < nbSrvPools; ++p)
-    {
-     // CContextServer* server = (!context->hasClient) ? context->server : context->serverPrimServer[p];
-      CContextServer* server = context->server  ;
-      CContextClient* client = context->client;   //(!context->hasClient) ? context->client : context->clientPrimServer[p];
+    CContextServer* server = context->server  ;
+    CContextClient* client = context->client;   
       
-      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))
-        {
-          ++ssize;
-          idx += 2;
-        }
-        else
-          ++idx;
-      }
-
-      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 axisId = 0, domainId = 0, scalarId = 0, globalSize = 1;
-          std::vector<CDomain*> domainList = getDomains();
-          std::vector<CAxis*> axisList = getAxis();
-          std::vector<int> nBegin(ssize), nSize(ssize), nGlob(ssize), nBeginGlobal(ssize), nGlobElement(numElement);
-          std::vector<CArray<int,1> > globalIndex(numElement);
-          for (int i = 0; i < numElement; ++i)
-          {
-            nGlobElement[i] = globalSize;
-            if (2 == axis_domain_order(i)) //domain
-            {
-              nBegin[indexMap[i]] = domainList[domainId]->ibegin;
-              nSize[indexMap[i]]  = domainList[domainId]->ni;
-              nBeginGlobal[indexMap[i]] = 0;
-              nGlob[indexMap[i]] = domainList[domainId]->ni_glo;
-
-              nBegin[indexMap[i] + 1] = domainList[domainId]->jbegin;
-              nSize[indexMap[i] + 1] = domainList[domainId]->nj;
-              nBeginGlobal[indexMap[i] + 1] = 0;
-              nGlob[indexMap[i] + 1] = domainList[domainId]->nj_glo;
-
-              {
-                int count = 0;
-                globalIndex[i].resize(nSize[indexMap[i]]*nSize[indexMap[i]+1]);
-                for (int jdx = 0; jdx < nSize[indexMap[i]+1]; ++jdx)
-                  for (int idx = 0; idx < nSize[indexMap[i]]; ++idx)
-                  {
-                    globalIndex[i](count) = (nBegin[indexMap[i]] + idx) + (nBegin[indexMap[i]+1] + jdx) * nGlob[indexMap[i]];
-                    ++count;
-                  }
-              }
-
-              ++domainId;
-            }
-            else if (1 == axis_domain_order(i)) // axis
-            {
-              nBegin[indexMap[i]] = axisList[axisId]->begin;
-              nSize[indexMap[i]]  = axisList[axisId]->n;
-              nBeginGlobal[indexMap[i]] = 0;
-              nGlob[indexMap[i]] = axisList[axisId]->n_glo;     
-              globalIndex[i].resize(nSize[indexMap[i]]);
-              for (int idx = 0; idx < nSize[indexMap[i]]; ++idx)
-                globalIndex[i](idx) = nBegin[indexMap[i]] + idx;
-
-              ++axisId;
-            }
-            else // scalar
-            { 
-              nBegin[indexMap[i]] = 0;
-              nSize[indexMap[i]]  = 1;
-              nBeginGlobal[indexMap[i]] = 0;
-              nGlob[indexMap[i]] = 1;
-              globalIndex[i].resize(1);
-              globalIndex[i](0) = 0;
-              ++scalarId;
-            }
-          }
-          dataSize = 1;
-
-          for (int i = 0; i < nSize.size(); ++i)
-            dataSize *= nSize[i];
-          serverDistribution_ = new CDistributionServer(server->intraCommRank, 
-                                                        globalIndex, axis_domain_order,
-                                                        nBegin, nSize, nBeginGlobal, nGlob);
-        }
-
-        CArray<size_t,1> outIndex;
-        buffer >> outIndex;
-        outGlobalIndexFromClient.insert(std::make_pair(rank, outIndex));
-        connectedDataSizeRead_[rank] = outIndex.numElements();
-
-        if (doGridHaveDataDistributed(client))
-        {}
-        else
-        {
-          // THE PROBLEM HERE IS THAT DATA CAN BE NONDISTRIBUTED ON CLIENT AND DISTRIBUTED ON SERVER
-          // BELOW IS THE TEMPORARY FIX only for a single type of element (domain, asix, scalar)
-          dataSize = serverDistribution_->getGridSize();
-        }
-        writtenDataSize_ += dataSize;
-      }
-
-
-      // Compute mask of the current grid
+    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))
+      {
+        ++ssize;
+        idx += 2;
+      }
+      else
+        ++idx;
+    }
+
+    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 axisId = 0, domainId = 0, scalarId = 0, globalSize = 1;
         std::vector<CDomain*> domainList = getDomains();
         std::vector<CAxis*> axisList = getAxis();
-        int dimSize = 2 * domainList.size() + axisList.size();
-        std::vector<int> nBegin(dimSize), nSize(dimSize), nGlob(dimSize), nBeginGlobal(dimSize);        
+        std::vector<int> nBegin(ssize), nSize(ssize), nGlob(ssize), nBeginGlobal(ssize), nGlobElement(numElement);
+        std::vector<CArray<int,1> > globalIndex(numElement);
         for (int i = 0; i < numElement; ++i)
-        {          
+        {
+          nGlobElement[i] = globalSize;
           if (2 == axis_domain_order(i)) //domain
           {
             nBegin[indexMap[i]] = domainList[domainId]->ibegin;
             nSize[indexMap[i]]  = domainList[domainId]->ni;
-            nBeginGlobal[indexMap[i]] = 0;              
+            nBeginGlobal[indexMap[i]] = 0;
             nGlob[indexMap[i]] = domainList[domainId]->ni_glo;
 
             nBegin[indexMap[i] + 1] = domainList[domainId]->jbegin;
             nSize[indexMap[i] + 1] = domainList[domainId]->nj;
-            nBeginGlobal[indexMap[i] + 1] = 0;              
+            nBeginGlobal[indexMap[i] + 1] = 0;
             nGlob[indexMap[i] + 1] = domainList[domainId]->nj_glo;
+
+            {
+              int count = 0;
+              globalIndex[i].resize(nSize[indexMap[i]]*nSize[indexMap[i]+1]);
+              for (int jdx = 0; jdx < nSize[indexMap[i]+1]; ++jdx)
+                for (int idx = 0; idx < nSize[indexMap[i]]; ++idx)
+                {
+                  globalIndex[i](count) = (nBegin[indexMap[i]] + idx) + (nBegin[indexMap[i]+1] + jdx) * nGlob[indexMap[i]];
+                  ++count;
+                }
+            }
 
             ++domainId;
@@ -1824,26 +1722,97 @@
             nBegin[indexMap[i]] = axisList[axisId]->begin;
             nSize[indexMap[i]]  = axisList[axisId]->n;
-            nBeginGlobal[indexMap[i]] = 0;              
-            nGlob[indexMap[i]] = axisList[axisId]->n_glo;              
+            nBeginGlobal[indexMap[i]] = 0;
+            nGlob[indexMap[i]] = axisList[axisId]->n_glo;     
+            globalIndex[i].resize(nSize[indexMap[i]]);
+            for (int idx = 0; idx < nSize[indexMap[i]]; ++idx)
+              globalIndex[i](idx) = nBegin[indexMap[i]] + idx;
+
             ++axisId;
           }
           else // scalar
-          {  
+          { 
+            nBegin[indexMap[i]] = 0;
+            nSize[indexMap[i]]  = 1;
+            nBeginGlobal[indexMap[i]] = 0;
+            nGlob[indexMap[i]] = 1;
+            globalIndex[i].resize(1);
+            globalIndex[i](0) = 0;
+            ++scalarId;
           }
         }
-        
-        if (nSize.empty()) // Scalar grid
-        {
-          nBegin.push_back(0);
-          nSize.push_back(1);
-          nBeginGlobal.push_back(0);              
-          nGlob.push_back(1);  
-        }
-      }
-
-      if (isScalarGrid()) return;
-
-      nbReadSenders[client] = CClientServerMappingDistributed::computeConnectedClients(context->client->serverSize, context->client->clientSize, context->client->intraComm, ranks);
-    }
+        dataSize = 1;
+
+        for (int i = 0; i < nSize.size(); ++i)
+        dataSize *= nSize[i];
+        serverDistribution_ = new CDistributionServer(server->intraCommRank, 
+                                                      globalIndex, axis_domain_order,
+                                                      nBegin, nSize, nBeginGlobal, nGlob);
+      }
+
+      CArray<size_t,1> outIndex;
+      buffer >> outIndex;
+      outGlobalIndexFromClient.insert(std::make_pair(rank, outIndex));
+      connectedDataSizeRead_[rank] = outIndex.numElements();
+
+      if (doGridHaveDataDistributed(client))
+      {}
+      else
+      {
+        // THE PROBLEM HERE IS THAT DATA CAN BE NONDISTRIBUTED ON CLIENT AND DISTRIBUTED ON SERVER
+        // BELOW IS THE TEMPORARY FIX only for a single type of element (domain, asix, scalar)
+        dataSize = serverDistribution_->getGridSize();
+      }
+      writtenDataSize_ += dataSize;
+    }
+
+
+    // Compute mask of the current grid
+    {
+      int axisId = 0, domainId = 0, scalarId = 0, globalSize = 1;
+      std::vector<CDomain*> domainList = getDomains();
+      std::vector<CAxis*> axisList = getAxis();
+      int dimSize = 2 * domainList.size() + axisList.size();
+      std::vector<int> nBegin(dimSize), nSize(dimSize), nGlob(dimSize), nBeginGlobal(dimSize);        
+      for (int i = 0; i < numElement; ++i)
+      {          
+        if (2 == axis_domain_order(i)) //domain
+        {
+          nBegin[indexMap[i]] = domainList[domainId]->ibegin;
+          nSize[indexMap[i]]  = domainList[domainId]->ni;
+          nBeginGlobal[indexMap[i]] = 0;              
+          nGlob[indexMap[i]] = domainList[domainId]->ni_glo;
+
+          nBegin[indexMap[i] + 1] = domainList[domainId]->jbegin;
+          nSize[indexMap[i] + 1] = domainList[domainId]->nj;
+          nBeginGlobal[indexMap[i] + 1] = 0;              
+          nGlob[indexMap[i] + 1] = domainList[domainId]->nj_glo;
+          ++domainId;
+        }
+        else if (1 == axis_domain_order(i)) // axis
+        {
+          nBegin[indexMap[i]] = axisList[axisId]->begin;
+          nSize[indexMap[i]]  = axisList[axisId]->n;
+          nBeginGlobal[indexMap[i]] = 0;              
+          nGlob[indexMap[i]] = axisList[axisId]->n_glo;              
+          ++axisId;
+        }
+        else // scalar
+        {  
+        }
+      }
+     
+      if (nSize.empty()) // Scalar grid
+      {
+        nBegin.push_back(0);
+        nSize.push_back(1);
+        nBeginGlobal.push_back(0);              
+        nGlob.push_back(1);  
+      }
+    }
+
+    if (isScalarGrid()) return;
+
+    nbReadSenders[client] = CClientServerMappingDistributed::computeConnectedClients(context->client->serverSize, context->client->clientSize, context->client->intraComm, ranks);
+
   }
   CATCH_DUMP_ATTR
@@ -2122,8 +2091,8 @@
    \param[in] id String identity of domain that will be created on server
    */
-   void CGrid::sendAddDomain(const string& id)
-   TRY
-  {
-      sendAddItem(id, (int)EVENT_ID_ADD_DOMAIN);
+   void CGrid::sendAddDomain(const string& id, CContextClient* contextClient)
+   TRY
+  {
+      sendAddItem(id, (int)EVENT_ID_ADD_DOMAIN, contextClient);
    }
    CATCH_DUMP_ATTR
@@ -2133,8 +2102,8 @@
    \param[in] id String identity of axis that will be created on server
    */
-   void CGrid::sendAddAxis(const string& id)
-   TRY
-   {
-      sendAddItem(id, (int)EVENT_ID_ADD_AXIS);
+   void CGrid::sendAddAxis(const string& id, CContextClient* contextClient)
+   TRY
+   {
+      sendAddItem(id, (int)EVENT_ID_ADD_AXIS, contextClient);
    }
    CATCH_DUMP_ATTR
@@ -2144,8 +2113,8 @@
    \param[in] id String identity of scalar that will be created on server
    */
-   void CGrid::sendAddScalar(const string& id)
-   TRY
-   {
-      sendAddItem(id, (int)EVENT_ID_ADD_SCALAR);
+   void CGrid::sendAddScalar(const string& id, CContextClient* contextClient)
+   TRY
+   {
+      sendAddItem(id, (int)EVENT_ID_ADD_SCALAR, contextClient);
    }
    CATCH_DUMP_ATTR
@@ -2654,5 +2623,5 @@
     Send all attributes of domains from client to server
   */
-  void CGrid::sendAllDomains()
+  void CGrid::sendAllDomains(CContextClient* contextClient)
   TRY
   {
@@ -2661,6 +2630,6 @@
     for (int i = 0; i < dSize; ++i)
     {
-      sendAddDomain(domList[i]->getId());
-      domList[i]->sendAllAttributesToServer();
+      sendAddDomain(domList[i]->getId(),contextClient);
+      domList[i]->sendAllAttributesToServer(contextClient);
     }
   }
@@ -2670,5 +2639,5 @@
     Send all attributes of axis from client to server
   */
-  void CGrid::sendAllAxis()
+  void CGrid::sendAllAxis(CContextClient* contextClient)
   TRY
   {
@@ -2678,6 +2647,6 @@
     for (int i = 0; i < aSize; ++i)
     {
-      sendAddAxis(aList[i]->getId());
-      aList[i]->sendAllAttributesToServer();
+      sendAddAxis(aList[i]->getId(),contextClient);
+      aList[i]->sendAllAttributesToServer(contextClient);
     }
   }
@@ -2687,5 +2656,5 @@
     Send all attributes of scalars from client to server
   */
-  void CGrid::sendAllScalars()
+  void CGrid::sendAllScalars(CContextClient* contextClient)
   TRY
   {
@@ -2695,6 +2664,6 @@
     for (int i = 0; i < sSize; ++i)
     {
-      sendAddScalar(sList[i]->getId());
-      sList[i]->sendAllAttributesToServer();
+      sendAddScalar(sList[i]->getId(),contextClient);
+      sList[i]->sendAllAttributesToServer(contextClient);
     }
   }
Index: XIOS/dev/dev_ym/XIOS_COUPLING/src/node/grid.hpp
===================================================================
--- XIOS/dev/dev_ym/XIOS_COUPLING/src/node/grid.hpp	(revision 1782)
+++ XIOS/dev/dev_ym/XIOS_COUPLING/src/node/grid.hpp	(revision 1784)
@@ -144,10 +144,10 @@
          CAxis* addAxis(const std::string& id=StdString());
          CScalar* addScalar(const std::string& id=StdString());
-         void sendAddDomain(const std::string& id="");
-         void sendAddAxis(const std::string& id="");
-         void sendAddScalar(const std::string& id="");
-         void sendAllDomains();
-         void sendAllAxis();
-         void sendAllScalars();
+         void sendAddDomain(const std::string& id,CContextClient* contextClient);
+         void sendAddAxis(const std::string& id,CContextClient* contextClient);
+         void sendAddScalar(const std::string& id,CContextClient* contextClient);
+         void sendAllDomains(CContextClient* contextClient);
+         void sendAllAxis(CContextClient* contextClient);
+         void sendAllScalars(CContextClient* contextClient);
 
          static void recvAddDomain(CEventServer& event);
@@ -219,6 +219,4 @@
          map<int, CArray<int, 1> > storeIndex_fromSrv; // Support, for now, reading with level-1 server
 
-         map<int, CArray<size_t, 1> > outIndexFromClient;  // Deprecated
-
          map<int, CArray<size_t, 1> > compressedOutIndexFromClient;
 
@@ -365,5 +363,5 @@
 
 
-/** List order of axis and domain in a grid, if there is a domain, it will take value 1 (true), axis 0 (false) */
+/** List order of axis and domain in a grid, if there is a domain, it will take value 2, axis 1, scalar 0 */
         std::vector<int> order_;
 
Index: XIOS/dev/dev_ym/XIOS_COUPLING/src/node/variable.cpp
===================================================================
--- XIOS/dev/dev_ym/XIOS_COUPLING/src/node/variable.cpp	(revision 1782)
+++ XIOS/dev/dev_ym/XIOS_COUPLING/src/node/variable.cpp	(revision 1784)
@@ -94,36 +94,6 @@
    *
    */
-   void CVariable::sendValue()
-   {
-     CContext* context=CContext::getCurrent() ;
-
-     if (context->hasClient)
-     {
-       // Use correct context client to send message
-       // int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1;
-      int nbSrvPools = (context->hasServer) ? (context->hasClient ? context->clientPrimServer.size() : 0) : 1;
-       for (int i = 0; i < nbSrvPools; ++i)
-       {
-//       CContextClient* contextClientTmp = (0 != context->clientPrimServer) ? context->clientPrimServer
-         CContextClient* contextClientTmp = (context->hasServer) ? context->clientPrimServer[i]
-                                                                             : context->client;
-
-         CEventClient event(this->getType(),EVENT_ID_VARIABLE_VALUE) ;
-         if (contextClientTmp->isServerLeader())
-         {
-           CMessage msg ;
-           msg<<this->getId() ;
-           msg<<content ;
-           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) ;
-      }
-     }
-   }
-
-   void CVariable::sendValue(CContextClient* client, bool clientPrim /*= false*/)
+
+   void CVariable::sendValue(CContextClient* client)
    {
      CEventClient event(this->getType(),EVENT_ID_VARIABLE_VALUE) ;
Index: XIOS/dev/dev_ym/XIOS_COUPLING/src/node/variable.hpp
===================================================================
--- XIOS/dev/dev_ym/XIOS_COUPLING/src/node/variable.hpp	(revision 1782)
+++ XIOS/dev/dev_ym/XIOS_COUPLING/src/node/variable.hpp	(revision 1784)
@@ -79,6 +79,5 @@
 
             //! Sending a request to set up variable data
-            void sendValue();
-            void sendValue(CContextClient* client, bool clientPrim = false);
+            void sendValue(CContextClient* client);
 
             static void recvValue(CEventServer& event) ;
Index: XIOS/dev/dev_ym/XIOS_COUPLING/src/object_template.hpp
===================================================================
--- XIOS/dev/dev_ym/XIOS_COUPLING/src/object_template.hpp	(revision 1782)
+++ XIOS/dev/dev_ym/XIOS_COUPLING/src/object_template.hpp	(revision 1784)
@@ -56,11 +56,7 @@
          static void ClearAllAttributes(void);
          std::map<int, size_t> getMinimumBufferSizeForAttributes(CContextClient* client);
-         void sendAttributToServer(const string& id);
          void sendAttributToServer(const string& id, CContextClient* client);
-         void sendAttributToServer(CAttribute& attr) ;
          void sendAttributToServer(CAttribute& attr, CContextClient* client) ;
-         void sendAllAttributesToServer();
          void sendAllAttributesToServer(CContextClient* client);
-         void sendAddItem(const string& id, int itemType);
          void sendAddItem(const string& id, int itemType, CContextClient* client);
          static void recvAttributFromClient(CEventServer& event) ;
Index: XIOS/dev/dev_ym/XIOS_COUPLING/src/object_template_impl.hpp
===================================================================
--- XIOS/dev/dev_ym/XIOS_COUPLING/src/object_template_impl.hpp	(revision 1782)
+++ XIOS/dev/dev_ym/XIOS_COUPLING/src/object_template_impl.hpp	(revision 1784)
@@ -215,16 +215,4 @@
    }
 
-
-   template<typename T>
-   void CObjectTemplate<T>::sendAllAttributesToServer()
-   {
-     CAttributeMap& attrMap = *this;
-     CAttributeMap::const_iterator it = attrMap.begin(), itE = attrMap.end();
-     for (; it != itE; ++it)
-     {
-       if (it->second->doSend() && !(it->second)->isEmpty()) sendAttributToServer(*(it->second));
-     }
-   }
-
    template<typename T>
    void CObjectTemplate<T>::sendAllAttributesToServer(CContextClient* client)
@@ -239,12 +227,4 @@
 
    template <class T>
-   void CObjectTemplate<T>::sendAttributToServer(const string& id)
-   {
-      CAttributeMap & attrMap = *this;
-      CAttribute* attr=attrMap[id];
-      sendAttributToServer(*attr);
-   }
-
-   template <class T>
    void CObjectTemplate<T>::sendAttributToServer(const string& id, CContextClient* client)
    {
@@ -253,35 +233,4 @@
       sendAttributToServer(*attr, client);
    }
-
-  template <class T>
-  void CObjectTemplate<T>::sendAttributToServer(CAttribute& attr)
-  {
-     // Use correct context client to send message
-    CContext* context=CContext::getCurrent();
-    if (context->hasClient)
-    {
-      // int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1;
-      int nbSrvPools = (context->hasServer) ? (context->hasClient ? context->clientPrimServer.size() : 0) : 1;
-      for (int i = 0; i < nbSrvPools; ++i)
-      {
-        CContextClient* contextClientTmp = (context->hasServer) ? context->clientPrimServer[i] : context->client;
-        CEventClient event(getType(),EVENT_ID_SEND_ATTRIBUTE);
-        if (contextClientTmp->isServerLeader())
-        {
-          CMessage msg;
-          if (context->hasServer)  msg<<this->getIdServer(i);
-          else  msg<<this->getIdServer(); 
-
-          msg << attr.getName();
-          msg << attr;
-          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);
-      }
-    }
-  }
 
   template <class T>
@@ -309,32 +258,4 @@
     \param [in] itemType type of added item
   */
-  template<class T>
-  void CObjectTemplate<T>::sendAddItem(const StdString& id, int itemType)
-  {
-    CContext* context = CContext::getCurrent();
-    typedef typename T::EEventId ItemType;
-    if (context->hasClient)
-    {
-      // Use correct context client to send message
-      // int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1;
-      int nbSrvPools = (context->hasServer) ? (context->hasClient ? context->clientPrimServer.size() : 0) : 1;
-      for (int i = 0; i < nbSrvPools; ++i)
-      {
-         CContextClient* contextClientTmp = (context->hasServer) ? context->clientPrimServer[i] : context->client;
-         CEventClient event(this->getType(),ItemType(itemType));
-         if (contextClientTmp->isServerLeader())
-         {
-           CMessage msg;
-           msg << this->getId();
-           msg << id;
-           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);
-      }
-    }
-  }
 
   template<class T>
Index: XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm_interpolate.cpp
===================================================================
--- XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm_interpolate.cpp	(revision 1782)
+++ XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm_interpolate.cpp	(revision 1784)
@@ -72,6 +72,5 @@
   CTimer::get("CAxisAlgorithmInterpolate::computeIndexSourceMapping_").resume() ;
   CContext* context = CContext::getCurrent();
-  CContextClient* client=context->client;
-  int nbClient = client->clientSize;
+  int nbClient = context->intraCommSize_;
   CArray<bool,1>& axisMask = axisSrc_->mask;
   int srcSize  = axisSrc_->n_glo.getValue();
@@ -227,6 +226,5 @@
 {
   CContext* context = CContext::getCurrent();
-  CContextClient* client=context->client;
-  int nbClient = client->clientSize;
+  int nbClient = context->intraCommSize_;
 
   int srcSize  = axisSrc_->n_glo.getValue();
@@ -272,5 +270,5 @@
 
     int* recvCount=new int[nbClient];
-    MPI_Allgather(&numValue,1,MPI_INT,recvCount,1,MPI_INT,client->intraComm);
+    MPI_Allgather(&numValue,1,MPI_INT,recvCount,1,MPI_INT,context->intraComm_);
 
     int* displ=new int[nbClient];
@@ -279,6 +277,6 @@
 
     // Each client have enough global info of axis
-    MPI_Allgatherv(sendIndexBuff,numValue,MPI_INT,recvIndexBuff,recvCount,displ,MPI_INT,client->intraComm);
-    MPI_Allgatherv(sendValueBuff,numValue,MPI_DOUBLE,&(recvBuff[0]),recvCount,displ,MPI_DOUBLE,client->intraComm);
+    MPI_Allgatherv(sendIndexBuff,numValue,MPI_INT,recvIndexBuff,recvCount,displ,MPI_INT,context->intraComm_);
+    MPI_Allgatherv(sendValueBuff,numValue,MPI_DOUBLE,&(recvBuff[0]),recvCount,displ,MPI_DOUBLE,context->intraComm_);
 
     for (int idx = 0; idx < srcSize; ++idx)
Index: XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm_inverse.cpp
===================================================================
--- XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm_inverse.cpp	(revision 1782)
+++ XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm_inverse.cpp	(revision 1784)
@@ -98,7 +98,6 @@
 {
   CContext* context = CContext::getCurrent();
-  CContextClient* client=context->client;
-  int clientRank = client->clientRank;
-  int nbClient = client->clientSize;
+  int clientRank = context->intraCommRank_;
+  int nbClient = context->intraCommSize_;
 
   int niSrc     = axisSrc_->n.getValue();
@@ -131,5 +130,5 @@
   }
 
-  CClientClientDHTInt dhtIndexProcRank(globalIndex2ProcRank, client->intraComm);
+  CClientClientDHTInt dhtIndexProcRank(globalIndex2ProcRank, context->intraComm_);
   dhtIndexProcRank.computeIndexInfoMapping(globalSrcIndex);
   CClientClientDHTInt::Index2VectorInfoTypeMap& computedGlobalIndexOnProc = dhtIndexProcRank.getInfoIndexMap();
@@ -161,5 +160,5 @@
     sendRankSizeMap[itIndex->first] = sendSize;
   }
-  MPI_Allgather(&connectedClient,1,MPI_INT,recvCount,1,MPI_INT,client->intraComm);
+  MPI_Allgather(&connectedClient,1,MPI_INT,recvCount,1,MPI_INT,context->intraComm_);
 
   displ[0]=0 ;
@@ -168,6 +167,6 @@
   int* recvRankBuff=new int[recvSize];
   int* recvSizeBuff=new int[recvSize];
-  MPI_Allgatherv(sendRankBuff,connectedClient,MPI_INT,recvRankBuff,recvCount,displ,MPI_INT,client->intraComm);
-  MPI_Allgatherv(sendSizeBuff,connectedClient,MPI_INT,recvSizeBuff,recvCount,displ,MPI_INT,client->intraComm);
+  MPI_Allgatherv(sendRankBuff,connectedClient,MPI_INT,recvRankBuff,recvCount,displ,MPI_INT,context->intraComm_);
+  MPI_Allgatherv(sendSizeBuff,connectedClient,MPI_INT,recvSizeBuff,recvCount,displ,MPI_INT,context->intraComm_);
   for (int i = 0; i < nbClient; ++i)
   {
@@ -193,5 +192,5 @@
 
     requests.push_back(MPI_Request());
-    MPI_Irecv(recvGlobalIndexSrc[recvRank], recvSize, MPI_UNSIGNED_LONG, recvRank, 46, client->intraComm, &requests.back());
+    MPI_Irecv(recvGlobalIndexSrc[recvRank], recvSize, MPI_UNSIGNED_LONG, recvRank, 46, context->intraComm_, &requests.back());
   }
 
@@ -215,5 +214,5 @@
     // Send global index source and mask
     requests.push_back(MPI_Request());
-    MPI_Isend(sendGlobalIndexSrc[sendRank], sendSize, MPI_UNSIGNED_LONG, sendRank, 46, client->intraComm, &requests.back());
+    MPI_Isend(sendGlobalIndexSrc[sendRank], sendSize, MPI_UNSIGNED_LONG, sendRank, 46, context->intraComm_, &requests.back());
   }
 
@@ -232,5 +231,5 @@
 
     requests.push_back(MPI_Request());
-    MPI_Irecv(recvValueFromSrc[recvRank], recvSize, MPI_DOUBLE, recvRank, 48, client->intraComm, &requests.back());
+    MPI_Irecv(recvValueFromSrc[recvRank], recvSize, MPI_DOUBLE, recvRank, 48, context->intraComm_, &requests.back());
   }
 
@@ -250,5 +249,5 @@
     // Okie, now inform the destination which source index are masked
     requests.push_back(MPI_Request());
-    MPI_Isend(sendValueToDest[recvRank], recvSize, MPI_DOUBLE, recvRank, 48, client->intraComm, &requests.back());
+    MPI_Isend(sendValueToDest[recvRank], recvSize, MPI_DOUBLE, recvRank, 48, context->intraComm_, &requests.back());
   }
   status.resize(requests.size());
Index: XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm_transformation.cpp
===================================================================
--- XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm_transformation.cpp	(revision 1782)
+++ XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm_transformation.cpp	(revision 1784)
@@ -76,7 +76,6 @@
 {
   CContext* context = CContext::getCurrent();
-  CContextClient* client=context->client;
-  int clientRank = client->clientRank;
-  int clientSize = client->clientSize;
+  int clientRank = context->intraCommRank_;
+  int clientSize = context->intraCommSize_;
 
   size_t globalIndex;
@@ -127,5 +126,5 @@
   }
 
-  CClientClientDHTInt dhtIndexProcRank(globalIndex2ProcRank, client->intraComm);
+  CClientClientDHTInt dhtIndexProcRank(globalIndex2ProcRank, context->intraComm_);
   dhtIndexProcRank.computeIndexInfoMapping(globalAxisIndex);
 
Index: XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm_expand.cpp
===================================================================
--- XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm_expand.cpp	(revision 1782)
+++ XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm_expand.cpp	(revision 1784)
@@ -94,6 +94,5 @@
 {
   CContext* context = CContext::getCurrent();
-  CContextClient* client=context->client;
-
+ 
   int type = 1; // For edge
   CMesh mesh;
@@ -103,5 +102,5 @@
   switch (domainSource->type) {
    case CDomain::type_attr::unstructured:      
-      mesh.getGlobalNghbFaces(type, client->intraComm, domainSource->i_index, bounds_lon_src, bounds_lat_src, neighborsSrc);
+      mesh.getGlobalNghbFaces(type, context->intraComm_, domainSource->i_index, bounds_lon_src, bounds_lat_src, neighborsSrc);
       updateUnstructuredDomainAttributes(domainDestination, domainSource, neighborsSrc);
       break;
@@ -123,5 +122,4 @@
 {
   CContext* context = CContext::getCurrent();
-  CContextClient* client=context->client;
 
   int type = 1; // For edge
@@ -132,5 +130,5 @@
   switch (domainSource->type) {
    case CDomain::type_attr::unstructured:      
-      mesh.getGlobalNghbFaces(type, client->intraComm, domainSource->i_index, bounds_lon_src, bounds_lat_src, neighborsSrc);
+      mesh.getGlobalNghbFaces(type, context->intraComm_, domainSource->i_index, bounds_lon_src, bounds_lat_src, neighborsSrc);
       updateUnstructuredDomainAttributes(domainDestination, domainSource, neighborsSrc);
       break;
@@ -158,5 +156,4 @@
   int iindexSrc, jindexSrc, globIndexSrc;
   CContext* context = CContext::getCurrent();
-  CContextClient* client=context->client;
 
   // First of all, "copy" all attributes of domain source to domain destination
@@ -341,5 +338,5 @@
   }
 
-  CClientClientDHTDouble dhtData(localData,client->intraComm);
+  CClientClientDHTDouble dhtData(localData,context->intraComm_);
   dhtData.computeIndexInfoMapping(globalIndexSrcOnDstDomain);
   CClientClientDHTDouble::Index2VectorInfoTypeMap& neighborData = dhtData.getInfoIndexMap();
@@ -482,5 +479,4 @@
 
   CContext* context = CContext::getCurrent();
-  CContextClient* client=context->client;
 
   // First of all, "copy" all attributes of domain source to domain destination
@@ -606,5 +602,5 @@
   }
 
-  CClientClientDHTDouble dhtData(localData,client->intraComm);
+  CClientClientDHTDouble dhtData(localData, context->intraComm_);
   CArray<size_t,1> neighborInd(nbNeighbor);
   for (int idx = 0; idx < nbNeighbor; ++idx)
Index: XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm_generate_rectilinear.cpp
===================================================================
--- XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm_generate_rectilinear.cpp	(revision 1782)
+++ XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm_generate_rectilinear.cpp	(revision 1784)
@@ -48,6 +48,7 @@
 {
   CContext* context = CContext::getCurrent();
-  CContextClient* client = context->client;
-
+  int clientSize = context->intraCommSize_ ;
+  int clientRank = context->intraCommRank_ ;
+  
   std::vector<CDomain*> domListSrcP = gridSrc->getDomains();
   std::vector<CAxis*> axisListSrcP = gridSrc->getAxis();
@@ -56,5 +57,5 @@
   {
     // First, find (roundly) distribution of associated axis (if any)
-    if (axisListSrcP.empty()) nbDomainDistributedPart_ = client->clientSize;
+    if (axisListSrcP.empty()) nbDomainDistributedPart_ = clientSize;
     else
     {
@@ -69,10 +70,10 @@
         HashXIOS<int> hashFunc;
         StdSize hashValue = hashFunc.hashVec(globalAxisIndex);
-        std::vector<StdSize> recvBuff(client->clientSize);
+        std::vector<StdSize> recvBuff(clientSize);
         MPI_Gather(&hashValue, 1, MPI_UNSIGNED_LONG,
                    &recvBuff[0], 1, MPI_UNSIGNED_LONG,
                    0,
-                   client->intraComm);
-        if (0 == client->clientRank)
+                   context->intraComm_);
+        if (0 == clientRank)
         {
           std::set<StdSize> setTmp;
@@ -88,10 +89,10 @@
 
         MPI_Bcast(&nbLocalAxis[0], nbAxis, MPI_INT,
-                  0, client->intraComm);
+                  0, context->intraComm_);
       }
 
       int nbAxisDistributedPart = 1;
       for (int j = 0; j < nbAxis; ++j) nbAxisDistributedPart *= nbLocalAxis[j];
-      nbDomainDistributedPart_ = client->clientSize/nbAxisDistributedPart;
+      nbDomainDistributedPart_ = clientSize/nbAxisDistributedPart;
     }
   }
@@ -118,10 +119,9 @@
 
   CContext* context = CContext::getCurrent();
-  CContextClient* client = context->client;
-  int modPart = (client->clientSize) % nbPartition;
+  int modPart = (context->intraCommSize_) % nbPartition;
   if (0 != modPart)
     ERROR("CDomainAlgorithmGenerateRectilinear::computeDistributionGridDestination(CGrid* gridDest)",
        << "The grid " <<gridDest->getId() << " is not well-distributed. There is an incompatibility between distribution of axis and domain.");
-  nbDomainDistributedPart_ = client->clientSize/nbPartition;
+  nbDomainDistributedPart_ = context->intraCommSize_/nbPartition;
 
 }
Index: XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm_interpolate.cpp
===================================================================
--- XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm_interpolate.cpp	(revision 1782)
+++ XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm_interpolate.cpp	(revision 1784)
@@ -109,6 +109,5 @@
 
   CContext* context = CContext::getCurrent();
-  CContextClient* client=context->client;
-  int clientRank = client->clientRank;
+  int clientRank = context->intraCommRank_;
   int i, j, k, idx;
   std::vector<double> srcPole(3,0), dstPole(3,0);
@@ -300,5 +299,5 @@
 
   // Calculate weight index
-  Mapper mapper(client->intraComm);
+  Mapper mapper(context->intraComm_);
   mapper.setVerbosity(PROGRESS) ;
 
@@ -432,8 +431,7 @@
 {
   CContext* context = CContext::getCurrent();
-  CContextClient* client=context->client;
-
+  
   MPI_Comm poleComme(MPI_COMM_NULL);
-  MPI_Comm_split(client->intraComm, interMapValuePole.empty() ? MPI_UNDEFINED : 1, 0, &poleComme);
+  MPI_Comm_split(context->intraComm_, interMapValuePole.empty() ? MPI_UNDEFINED : 1, 0, &poleComme);
   if (MPI_COMM_NULL != poleComme)
   {
@@ -534,6 +532,5 @@
 {
   CContext* context = CContext::getCurrent();
-  CContextClient* client=context->client;
-  int clientRank = client->clientRank;
+  int clientRank = context->intraCommRank_;
 
   this->transformationMapping_.resize(1);
@@ -800,6 +797,5 @@
 {
   CContext* context = CContext::getCurrent();
-  CContextClient* client=context->client;
-
+  
   size_t n_src = domainSrc_->ni_glo * domainSrc_->nj_glo;
   size_t n_dst = domainDest_->ni_glo * domainDest_->nj_glo;
@@ -835,6 +831,6 @@
   }
 
-  MPI_Allreduce(&localNbWeight, &globalNbWeight, 1, MPI_LONG, MPI_SUM, client->intraComm);
-  MPI_Scan(&localNbWeight, &startIndex, 1, MPI_LONG, MPI_SUM, client->intraComm);
+  MPI_Allreduce(&localNbWeight, &globalNbWeight, 1, MPI_LONG, MPI_SUM, context->intraComm_);
+  MPI_Scan(&localNbWeight, &startIndex, 1, MPI_LONG, MPI_SUM, context->intraComm_);
   
   if (0 == globalNbWeight)
@@ -850,5 +846,5 @@
   std::vector<StdSize> count(1, localNbWeight);
   
-  WriteNetCdf netCdfWriter(filename, client->intraComm);  
+  WriteNetCdf netCdfWriter(filename, context->intraComm_);  
 
   // Define some dimensions
@@ -895,7 +891,6 @@
 
   CContext* context = CContext::getCurrent();
-  CContextClient* client=context->client;
-  int clientRank = client->clientRank;
-  int clientSize = client->clientSize;
+  int clientRank = context->intraCommRank_;
+  int clientSize = context->intraCommSize_;
 
 
Index: XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm_transformation.cpp
===================================================================
--- XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm_transformation.cpp	(revision 1782)
+++ XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm_transformation.cpp	(revision 1784)
@@ -39,7 +39,6 @@
 {
   CContext* context = CContext::getCurrent();
-  CContextClient* client=context->client;
-  int clientRank = client->clientRank;
-  int clientSize = client->clientSize;
+  int clientRank = context->intraCommRank_;
+  int clientSize = context->intraCommSize_;
 
   int niGlob = domainSrc_->ni_glo.getValue();
@@ -62,5 +61,5 @@
   }
 
-  CClientClientDHTInt dhtIndexProcRank(globalIndex2ProcRank, client->intraComm);
+  CClientClientDHTInt dhtIndexProcRank(globalIndex2ProcRank, context->intraComm_);
   dhtIndexProcRank.computeIndexInfoMapping(globalDomainIndex);
   globalDomainIndexOnProc = dhtIndexProcRank.getInfoIndexMap();
Index: XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/generic_algorithm_transformation.cpp
===================================================================
--- XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/generic_algorithm_transformation.cpp	(revision 1782)
+++ XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/generic_algorithm_transformation.cpp	(revision 1784)
@@ -124,6 +124,5 @@
     {
       CContext* context = CContext::getCurrent();
-      CContextClient* client = context->client;
-  
+        
       computePositionElements(gridSrc, gridDst);
       std::vector<CScalar*> scalarListSrcP  = gridSrc->getScalars();
@@ -136,5 +135,5 @@
       {
         distributed=domainListSrcP[elementPositionInGridSrc2DomainPosition_[elementPositionInGrid]]->isDistributed() ;
-        MPI_Allreduce(&distributed,&distributed_glo, 1, MPI_INT, MPI_LOR, client->intraComm) ;
+        MPI_Allreduce(&distributed,&distributed_glo, 1, MPI_INT, MPI_LOR, context->intraComm_) ;
     
       }
@@ -142,5 +141,5 @@
       {
         distributed=axisListSrcP[elementPositionInGridSrc2AxisPosition_[elementPositionInGrid]]->isDistributed() ;
-        MPI_Allreduce(&distributed,&distributed_glo, 1, MPI_INT, MPI_LOR, client->intraComm) ;
+        MPI_Allreduce(&distributed,&distributed_glo, 1, MPI_INT, MPI_LOR, context->intraComm_) ;
       }
       else //it's a scalar
@@ -170,6 +169,5 @@
  {
   CContext* context = CContext::getCurrent();
-  CContextClient* client = context->client;
-  int nbClient = client->clientSize;
+  int nbClient = context->intraCommSize_;
 
   typedef std::unordered_map<int, std::vector<std::pair<int,double> > > SrcToDstMap;
@@ -238,5 +236,5 @@
   int sendValue = (computeGlobalIndexOnProc) ? 1 : 0;
   int recvValue = 0;
-  MPI_Allreduce(&sendValue, &recvValue, 1, MPI_INT, MPI_SUM, client->intraComm);
+  MPI_Allreduce(&sendValue, &recvValue, 1, MPI_INT, MPI_SUM, context->intraComm_);
   computeGlobalIndexOnProc = (0 < recvValue);
 
@@ -475,6 +473,5 @@
   
   CContext* context = CContext::getCurrent();
-  CContextClient* client=context->client;
-  int clientRank = client->clientRank;
+  int clientRank = context->intraCommRank_;
   
   std::vector<CDomain*> domainListSrcP = gridSrc->getDomains();
@@ -667,7 +664,6 @@
 {
   CContext* context = CContext::getCurrent();
-  CContextClient* client=context->client;
-  int clientRank = client->clientRank;
-  int clientSize = client->clientSize;
+  int clientRank = context->intraCommRank_;
+  int clientSize = context->intraCommSize_;
 
   globalScalarIndexOnProc.rehash(std::ceil(clientSize/globalScalarIndexOnProc.max_load_factor()));
@@ -693,7 +689,6 @@
 {
   CContext* context = CContext::getCurrent();
-  CContextClient* client=context->client;
-  int clientRank = client->clientRank;
-  int clientSize = client->clientSize;
+  int clientRank = context->intraCommRank_;
+  int clientSize = context->intraCommSize_;
 
   size_t globalIndex;
@@ -710,5 +705,5 @@
   }
 
-  CClientClientDHTInt dhtIndexProcRank(globalIndex2ProcRank, client->intraComm);
+  CClientClientDHTInt dhtIndexProcRank(globalIndex2ProcRank, context->intraComm_);
   CArray<size_t,1> globalAxisIndex(axisDst->index.numElements());
   for (int idx = 0; idx < globalAxisIndex.numElements(); ++idx)
@@ -764,7 +759,6 @@
 {
   CContext* context = CContext::getCurrent();
-  CContextClient* client=context->client;
-  int clientRank = client->clientRank;
-  int clientSize = client->clientSize;
+  int clientRank = context->intraCommRank_;
+  int clientSize = context->intraCommSize_;
 
   int niGlobSrc = domainSrc->ni_glo.getValue();
@@ -820,5 +814,5 @@
   }
 
-  CClientClientDHTInt dhtIndexProcRank(globalIndex2ProcRank, client->intraComm);
+  CClientClientDHTInt dhtIndexProcRank(globalIndex2ProcRank, context->intraComm_);
   dhtIndexProcRank.computeIndexInfoMapping(globalDomainIndex);
 
@@ -862,6 +856,5 @@
 
   CContext* context = CContext::getCurrent();
-  CContextClient* client = context->client;
-  int nbClient = client->clientSize;
+  int nbClient = context->intraCommSize_;
 
   computePositionElements(gridDst, gridSrc);
Index: XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/grid_transformation.cpp
===================================================================
--- XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/grid_transformation.cpp	(revision 1782)
+++ XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/grid_transformation.cpp	(revision 1784)
@@ -365,5 +365,4 @@
 
   CContext* context = CContext::getCurrent();
-  CContextClient* client = context->client;
 
   ListAlgoType::const_iterator itb = listAlgos_.begin(),
@@ -419,5 +418,5 @@
         CTimer::get("computeTransformationMappingConvert").resume();  
         nbLocalIndexOnGridDest_.push_back(nbLocalIndexOnGridDest) ;
-        int clientRank=client->clientRank ;
+        int clientRank=context->intraCommRank_ ;
         {
           SendingIndexGridSourceMap tmp;
@@ -475,10 +474,9 @@
 {
   CContext* context = CContext::getCurrent();
-  CContextClient* client = context->client;
-  int nbClient = client->clientSize;
-  int clientRank = client->clientRank;
+  int nbClient = context->intraCommSize_;
+  int clientRank = context->intraCommRank_;
 
   // Recalculate the distribution of grid destination
-  CDistributionClient distributionClientDest(client->clientRank, tmpGridDestination_);
+  CDistributionClient distributionClientDest(clientRank, tmpGridDestination_);
   CDistributionClient::GlobalLocalDataMap& globalLocalIndexGridDestSendToServer = distributionClientDest.getGlobalLocalDataSendToServer();
 
@@ -514,5 +512,5 @@
     sendRankSizeMap[itIndex->first] = sendSize;
   }
-  MPI_Allgather(&connectedClient,1,MPI_INT,recvCount,1,MPI_INT,client->intraComm);
+  MPI_Allgather(&connectedClient,1,MPI_INT,recvCount,1,MPI_INT, context->intraComm_);
 
   displ[0]=0 ;
@@ -521,6 +519,6 @@
   int* recvRankBuff=new int[recvSize];
   int* recvSizeBuff=new int[recvSize];
-  MPI_Allgatherv(sendRankBuff,connectedClient,MPI_INT,recvRankBuff,recvCount,displ,MPI_INT,client->intraComm);
-  MPI_Allgatherv(sendSizeBuff,connectedClient,MPI_INT,recvSizeBuff,recvCount,displ,MPI_INT,client->intraComm);
+  MPI_Allgatherv(sendRankBuff,connectedClient,MPI_INT,recvRankBuff,recvCount,displ,MPI_INT,context->intraComm_);
+  MPI_Allgatherv(sendSizeBuff,connectedClient,MPI_INT,recvSizeBuff,recvCount,displ,MPI_INT,context->intraComm_);
   for (int i = 0; i < nbClient; ++i)
   {
@@ -546,7 +544,7 @@
 
     requests.push_back(MPI_Request());
-    MPI_Irecv(recvGlobalIndexSrc[recvRank], recvSize, MPI_UNSIGNED_LONG, recvRank, 46, client->intraComm, &requests.back());
+    MPI_Irecv(recvGlobalIndexSrc[recvRank], recvSize, MPI_UNSIGNED_LONG, recvRank, 46, context->intraComm_, &requests.back());
     requests.push_back(MPI_Request());
-    MPI_Irecv(recvMaskDst[recvRank], recvSize, MPI_UNSIGNED_CHAR, recvRank, 47, client->intraComm, &requests.back());
+    MPI_Irecv(recvMaskDst[recvRank], recvSize, MPI_UNSIGNED_CHAR, recvRank, 47, context->intraComm_, &requests.back());
   }
 
@@ -584,7 +582,7 @@
     // Send global index source and mask
     requests.push_back(MPI_Request());
-    MPI_Isend(sendGlobalIndexSrc[sendRank], sendSize, MPI_UNSIGNED_LONG, sendRank, 46, client->intraComm, &requests.back());
+    MPI_Isend(sendGlobalIndexSrc[sendRank], sendSize, MPI_UNSIGNED_LONG, sendRank, 46, context->intraComm_, &requests.back());
     requests.push_back(MPI_Request());
-    MPI_Isend(sendMaskDst[sendRank], sendSize, MPI_UNSIGNED_CHAR, sendRank, 47, client->intraComm, &requests.back());
+    MPI_Isend(sendMaskDst[sendRank], sendSize, MPI_UNSIGNED_CHAR, sendRank, 47, context->intraComm_, &requests.back());
   }
 
@@ -602,9 +600,9 @@
 
     requests.push_back(MPI_Request());
-    MPI_Irecv(sendMaskDst[recvRank], recvSize, MPI_UNSIGNED_CHAR, recvRank, 48, client->intraComm, &requests.back());
+    MPI_Irecv(sendMaskDst[recvRank], recvSize, MPI_UNSIGNED_CHAR, recvRank, 48, context->intraComm_, &requests.back());
   }
 
   // Ok, now we fill in local index of grid source (we even count for masked index)
-  CDistributionClient distributionClientSrc(client->clientRank, gridSource_);
+  CDistributionClient distributionClientSrc(clientRank, gridSource_);
   CDistributionClient::GlobalLocalDataMap& globalLocalIndexGridSrcSendToServer = distributionClientSrc.getGlobalLocalDataSendToServer();
   localIndexToSendFromGridSource_.push_back(SendingIndexGridSourceMap());
@@ -639,5 +637,5 @@
     // Okie, now inform the destination which source index are masked
     requests.push_back(MPI_Request());
-    MPI_Isend(recvMaskDst[recvRank], recvSize, MPI_UNSIGNED_CHAR, recvRank, 48, client->intraComm, &requests.back());
+    MPI_Isend(recvMaskDst[recvRank], recvSize, MPI_UNSIGNED_CHAR, recvRank, 48, context->intraComm_, &requests.back());
   }
   status.resize(requests.size());
Index: XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/scalar_algorithm_transformation.cpp
===================================================================
--- XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/scalar_algorithm_transformation.cpp	(revision 1782)
+++ XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/scalar_algorithm_transformation.cpp	(revision 1784)
@@ -60,7 +60,6 @@
 {
   CContext* context = CContext::getCurrent();
-  CContextClient* client=context->client;
-  int clientRank = client->clientRank;
-  int clientSize = client->clientSize;
+  int clientRank = context->intraCommRank_;
+  int clientSize = context->intraCommSize_;
 
   if (2 == elementSourceType) // Source is a domain
@@ -84,5 +83,5 @@
     }
 
-    CClientClientDHTInt dhtIndexProcRank(globalIndex2ProcRank, client->intraComm);
+    CClientClientDHTInt dhtIndexProcRank(globalIndex2ProcRank, context->intraComm_);
     dhtIndexProcRank.computeIndexInfoMapping(globalIndexElementSource);
     globalIndexElementSourceOnProc = dhtIndexProcRank.getInfoIndexMap();
@@ -106,5 +105,5 @@
     }
 
-    CClientClientDHTInt dhtIndexProcRank(globalIndex2ProcRank, client->intraComm);
+    CClientClientDHTInt dhtIndexProcRank(globalIndex2ProcRank, context->intraComm_);
     dhtIndexProcRank.computeIndexInfoMapping(globalIndexElementSource);
     globalIndexElementSourceOnProc = dhtIndexProcRank.getInfoIndexMap();
@@ -117,5 +116,5 @@
     globalIndex2ProcRank[globalIndex][0] = clientRank;
 
-    CClientClientDHTInt dhtIndexProcRank(globalIndex2ProcRank, client->intraComm);
+    CClientClientDHTInt dhtIndexProcRank(globalIndex2ProcRank, context->intraComm_);
     dhtIndexProcRank.computeIndexInfoMapping(globalIndexElementSource);
     globalIndexElementSourceOnProc = dhtIndexProcRank.getInfoIndexMap();
