Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/distribution/grid_gatherer_connector.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/distribution/grid_gatherer_connector.hpp	(revision 1942)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/distribution/grid_gatherer_connector.hpp	(revision 1943)
@@ -41,4 +41,17 @@
       } 
 
+      template<typename T> 
+      void transfer(const map<int, CArray<T,1>>& input, CArray<T,1>& output, T missingValue)
+      {
+        int n = elementsConnector_.size()-1 ;
+        CGathererConnector** connector = elementsConnector_.data() + n ;
+        output.resize(dstSize_) ;
+        output = missingValue ;
+        for(auto& rankDataIn : input) 
+        {
+          elementsConnector_[n]->transfer(rankDataIn.first, connector, n, rankDataIn.second.dataFirst(), output.dataFirst()) ;
+        }
+      } 
+
       template<typename T>
       void transfer(CEventServer& event, CArray<T,1>& dataOut)
@@ -52,5 +65,17 @@
         transfer(dataIn, dataOut) ;
       }
-  
+ 
+      template<typename T>
+      void transfer(CEventServer& event, CArray<T,1>& dataOut, T missingValue)
+      {
+        map<int, CArray<T,1>> dataIn ;
+        for (auto& subEvent : event.subEvents) 
+        {
+          auto& data = dataIn[subEvent.rank]; 
+          (*subEvent.buffer) >> data ;
+        }
+        transfer(dataIn, dataOut, missingValue) ;
+      }
+
   };
 }
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/distribution/grid_mask_connector.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/distribution/grid_mask_connector.cpp	(revision 1943)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/distribution/grid_mask_connector.cpp	(revision 1943)
@@ -0,0 +1,19 @@
+#include "grid_mask_connector.hpp"
+
+namespace xios
+{
+  void CGridMaskConnector::computeConnector(CArray<bool,1>& mask)
+  {
+    nViews_ = views_.size() ;
+    for(auto& view : views_) 
+    {
+      size_.push_back(view->getLocalSize()) ;
+      elementsMask_.push_back(CArray<bool,1>(view->getLocalSize())) ;
+      elementsMask_.back() = false ;
+    }
+    index_.resize(nViews_,0) ;
+    bool* maskPtr = mask.dataFirst() ; 
+    recursiveInternal(nViews_-1, maskPtr) ;
+  }
+  
+}
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/distribution/grid_mask_connector.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/distribution/grid_mask_connector.hpp	(revision 1943)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/distribution/grid_mask_connector.hpp	(revision 1943)
@@ -0,0 +1,56 @@
+#ifndef __GRID_MASK_CONNECTOR_HPP__
+#define __GRID_MASK_CONNECTOR_HPP__
+
+#include "xios_spl.hpp"
+#include "array_new.hpp"
+#include "local_view.hpp"
+#include "distributed_view.hpp"
+
+namespace xios
+{
+ 
+  class CGridMaskConnector
+  {
+
+    public:
+
+      CGridMaskConnector(vector<CLocalView*>& views) : views_(views) {}
+      void computeConnector(CArray<bool,1>& mask) ;
+     
+      CArray<bool,1>& getElementMask(int pos) { return elementsMask_[pos] ;} 
+      vector<CArray<bool,1>>& getElementsMask(void) ;
+    
+    private:
+      vector<CLocalView*> views_ ;
+      vector<CArray<bool,1>> elementsMask_ ; 
+
+      vector<int> size_ ;
+      vector<int> index_ ;
+      int nViews_ ;
+    
+    private:
+  
+    void recursiveInternal(int level, bool*& mask)
+    {
+      if (level==0)
+      {
+        for(int i=0; i < size_[level] ; i++)
+        {
+          for(int j=0 ; j<nViews_ ; j++) elementsMask_[j](index_[j]) |= *mask ;
+          index_[level]++ ;
+          mask++ ;
+        }
+        index_[level] = 0 ;
+      }
+      else
+      {  
+        for(int i=0; i<size_[level] ; i++) recursiveInternal(level-1, mask) ;
+        index_[level] = 0 ;
+      }
+    }
+
+  } ;
+
+}
+
+#endif
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/distribution/scatterer_connector.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/distribution/scatterer_connector.cpp	(revision 1942)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/distribution/scatterer_connector.cpp	(revision 1943)
@@ -51,9 +51,7 @@
 
    // compute the number of senders for a remote destination view
-    int commSize ;
-    MPI_Comm_size(localComm_, &commSize) ;
-    vector<int> ranks(commSize,0) ;
+    vector<int> ranks(remoteCommSize_,0) ;
     for(auto& rank : connector_) ranks[rank.first] = 1 ;
-    MPI_Allreduce(MPI_IN_PLACE,ranks.data(),commSize,MPI_INT,MPI_SUM,localComm_) ;
+    MPI_Allreduce(MPI_IN_PLACE,ranks.data(),remoteCommSize_,MPI_INT,MPI_SUM,localComm_) ;
     for(auto& rank : connector_) nbSenders_[rank.first] = ranks[rank.first] ;
 
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/distribution/scatterer_connector.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/distribution/scatterer_connector.hpp	(revision 1942)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/distribution/scatterer_connector.hpp	(revision 1943)
@@ -21,4 +21,5 @@
       map<int, vector<bool>> mask_ ;  // mask is on dst view
       MPI_Comm localComm_ ;
+      int remoteCommSize_ ;
 
       CLocalView* srcView_ ;
@@ -30,6 +31,6 @@
     public:
 
-    CScattererConnector(CLocalView* srcView, CDistributedView* dstView, MPI_Comm localComm) 
-                       : srcView_(srcView), dstView_(dstView), localComm_(localComm) {}
+    CScattererConnector(CLocalView* srcView, CDistributedView* dstView, MPI_Comm localComm, int remoteCommSize) 
+                       : srcView_(srcView), dstView_(dstView), localComm_(localComm), remoteCommSize_(remoteCommSize) {}
     void computeConnector(void) ;
     
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/axis.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/axis.cpp	(revision 1942)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/axis.cpp	(revision 1943)
@@ -1656,5 +1656,6 @@
     CDistributedElement scatteredElement(n_glo,globalIndex) ;
     scatteredElement.addFullView() ;
-    CScattererConnector scattererConnector(localElement_->getView(CElementView::FULL), scatteredElement.getView(CElementView::FULL), context->getIntraComm()) ;
+    CScattererConnector scattererConnector(localElement_->getView(CElementView::FULL), scatteredElement.getView(CElementView::FULL), 
+                                           context->getIntraComm(), client->getRemoteSize()) ;
     scattererConnector.computeConnector() ;
     
@@ -1696,13 +1697,7 @@
     message2<<serverAxisId<<2 ; 
     clientToServerElement.sendToServer(client, event2, message2) ; 
-    clientToServerConnector_[client] = new CScattererConnector(localElement_->getView(CElementView::WORKFLOW),
-                                                              clientToServerElement.getView(CElementView::FULL), context->getIntraComm()) ;
+    clientToServerConnector_[client] = new CScattererConnector(localElement_->getView(CElementView::WORKFLOW), clientToServerElement.getView(CElementView::FULL), 
+                                                              context->getIntraComm(), client->getRemoteSize()) ;
     clientToServerConnector_[client]->computeConnector() ;
-
-
-    CEventClient event3(getType(), EVENT_ID_AXIS_DISTRIBUTION);
-    CMessage message3 ;
-    message3<<serverAxisId<<3 ; 
-    clientToServerConnector_[client]->transfer(maskIn,client,event3,message3) ; 
 
     clientFromServerConnector_[client] = new CGathererConnector(clientToServerElement.getView(CElementView::FULL), localElement_->getView(CElementView::WORKFLOW));
@@ -1763,21 +1758,23 @@
       gathererConnector_ -> computeConnector() ;
     }
-    else if (phasis==3)
-    {
-      CArray<bool,1> localMask ;
-      gathererConnector_->transfer(event,localMask,false) ;
-      localElement_->addView(CElementView::WORKFLOW, localMask) ;
-      mask.reference(localMask.copy()) ;
+  
+  }
+  CATCH
+
+  void CAxis::setServerMask(CArray<bool,1>& serverMask, CContextClient* client)
+  TRY
+  {
+    CContext* context = CContext::getCurrent();
+    localElement_->addView(CElementView::WORKFLOW, serverMask) ;
+    mask.reference(serverMask.copy()) ;
  
-      serverFromClientConnector_ = new CGathererConnector(elementFrom_->getView(CElementView::FULL), localElement_->getView(CElementView::WORKFLOW)) ;
-      serverFromClientConnector_->computeConnector() ;
-
-      serverToClientConnector_ = new CScattererConnector(localElement_->getView(CElementView::WORKFLOW), elementFrom_->getView(CElementView::FULL),
-                                                         context->getIntraComm()) ;
-      serverToClientConnector_->computeConnector() ;
-
-    }
-  }
-  CATCH
+    serverFromClientConnector_ = new CGathererConnector(elementFrom_->getView(CElementView::FULL), localElement_->getView(CElementView::WORKFLOW)) ;
+    serverFromClientConnector_->computeConnector() ;
+      
+    serverToClientConnector_ = new CScattererConnector(localElement_->getView(CElementView::WORKFLOW), elementFrom_->getView(CElementView::FULL),
+                                                         context->getIntraComm(), client->getRemoteSize()) ;
+    serverToClientConnector_->computeConnector() ;
+  }
+  CATCH_DUMP_ATTR
 
   void CAxis::sendDistributedAttributes(CContextClient* client, CScattererConnector& scattererConnector, const string& axisId)
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/axis.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/axis.hpp	(revision 1942)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/axis.hpp	(revision 1943)
@@ -258,5 +258,5 @@
          static void recvAxisDistribution(CEventServer& event) ;
          void receivedAxisDistribution(CEventServer& event, int phasis) ;
-
+         void setServerMask(CArray<bool,1>& serverMask, CContextClient* client ) ;
          void sendDistributedAttributes(CContextClient* client, CScattererConnector& scattererConnector, const string& axisId) ;
          static void recvDistributedAttributes(CEventServer& event) ;
@@ -272,4 +272,7 @@
        private:
          CGathererConnector*  gathererConnector_ ;
+       public:
+         CGathererConnector* getGathererConnector(void) { return gathererConnector_ ;}
+       private:
          CGathererConnector* serverFromClientConnector_ ;
          CDistributedElement* elementFrom_ ;
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/domain.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/domain.cpp	(revision 1942)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/domain.cpp	(revision 1943)
@@ -2305,5 +2305,6 @@
     CDistributedElement scatteredElement(ni_glo*nj_glo, globalIndex) ;
     scatteredElement.addFullView() ;
-    CScattererConnector scattererConnector(localElement_->getView(CElementView::FULL), scatteredElement.getView(CElementView::FULL), context->getIntraComm()) ;
+    CScattererConnector scattererConnector(localElement_->getView(CElementView::FULL), scatteredElement.getView(CElementView::FULL), 
+                                           context->getIntraComm(), client->getRemoteSize()) ;
     scattererConnector.computeConnector() ;
 
@@ -2347,14 +2348,8 @@
     message2<<serverDomainId<<2 ; 
     clientToServerElement.sendToServer(client, event2, message2) ; 
-    clientToServerConnector_[client] = new CScattererConnector(localElement_->getView(CElementView::WORKFLOW),
-                                                              clientToServerElement.getView(CElementView::FULL), context->getIntraComm()) ;
+    clientToServerConnector_[client] = new CScattererConnector(localElement_->getView(CElementView::WORKFLOW), clientToServerElement.getView(CElementView::FULL),
+                                                               context->getIntraComm(), client->getRemoteSize()) ;
     clientToServerConnector_[client]->computeConnector() ;
 
-
-    CEventClient event3(getType(), EVENT_ID_DOMAIN_DISTRIBUTION);
-    CMessage message3 ;
-    message3<<serverDomainId<<3 ; 
-    clientToServerConnector_[client]->transfer(maskIn,client,event3,message3) ; 
-    
     clientFromServerConnector_[client] = new CGathererConnector(clientToServerElement.getView(CElementView::FULL), localElement_->getView(CElementView::WORKFLOW));
     clientFromServerConnector_[client]->computeConnector() ;
@@ -2418,21 +2413,24 @@
       gathererConnector_ -> computeConnector() ;
     }
-    else if (phasis==3)
-    {
-      CArray<bool,1> localMask ;
-      gathererConnector_->transfer(event,localMask,false) ;
-      localElement_->addView(CElementView::WORKFLOW, localMask) ;
-      mask_1d.reference(localMask.copy()) ;
+  }
+  CATCH
+
+  void CDomain::setServerMask(CArray<bool,1>& serverMask, CContextClient* client)
+  TRY
+  {
+    // nota : the client is needed to get the remote size for the scatterer connector. Maybe it is not the good place for this
+    // Later, server to client connector can be computed on demand, with "client" as argument
+    CContext* context = CContext::getCurrent();
+    localElement_->addView(CElementView::WORKFLOW, serverMask) ;
+    mask_1d.reference(serverMask.copy()) ;
  
-      serverFromClientConnector_ = new CGathererConnector(elementFrom_->getView(CElementView::FULL), localElement_->getView(CElementView::WORKFLOW)) ;
-      serverFromClientConnector_->computeConnector() ;
+    serverFromClientConnector_ = new CGathererConnector(elementFrom_->getView(CElementView::FULL), localElement_->getView(CElementView::WORKFLOW)) ;
+    serverFromClientConnector_->computeConnector() ;
       
-      serverToClientConnector_ = new CScattererConnector(localElement_->getView(CElementView::WORKFLOW), elementFrom_->getView(CElementView::FULL),
-                                                         context->getIntraComm()) ;
-      serverToClientConnector_->computeConnector() ;
- 
-    }
-  }
-  CATCH
+    serverToClientConnector_ = new CScattererConnector(localElement_->getView(CElementView::WORKFLOW), elementFrom_->getView(CElementView::FULL),
+                                                       context->getIntraComm(), client->getRemoteSize()) ;
+    serverToClientConnector_->computeConnector() ;
+  }
+  CATCH_DUMP_ATTR
 
 
@@ -2579,5 +2577,6 @@
     CDistributedElement scatteredElement(remoteElement.getGlobalSize(), remoteConnector.getDistributedGlobalIndex()) ;
     scatteredElement.addFullView() ;
-    CScattererConnector scatterConnector(localElement_->getView(CElementView::FULL), scatteredElement.getView(CElementView::FULL), context->getIntraComm()) ;
+    CScattererConnector scatterConnector(localElement_->getView(CElementView::FULL), scatteredElement.getView(CElementView::FULL), 
+                                         context->getIntraComm(), client->getRemoteSize()) ;
     scatterConnector.computeConnector() ;
     CGridScattererConnector gridScatter({&scatterConnector}) ;
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/domain.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/domain.hpp	(revision 1942)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/domain.hpp	(revision 1943)
@@ -212,6 +212,5 @@
        private:
          std::set<CContextClient*> sendDomainToFileServer_done_ ;
-       private:
-         public:
+       public:
          void sendDomainToCouplerOut(CContextClient* client, const string& fieldId, int posInGrid) ;
        private:
@@ -341,4 +340,6 @@
          static void recvDistributedAttributes(CEventServer& event) ;
          void recvDistributedAttributes(CEventServer& event, const string& type) ;
+         void setServerMask(CArray<bool,1>& serverMask, CContextClient* client) ;
+
        private:
          map<CContextClient*, CDistributedElement*> remoteElement_ ;
@@ -352,4 +353,7 @@
        private:
          CGathererConnector*  gathererConnector_ ;
+       public:
+         CGathererConnector* getGathererConnector(void) { return gathererConnector_ ;}
+        private:
          CGathererConnector* serverFromClientConnector_ ;
          CDistributedElement* elementFrom_ ;
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/grid.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/grid.cpp	(revision 1942)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/grid.cpp	(revision 1943)
@@ -23,4 +23,5 @@
 #include "grid_elements.hpp"
 #include "grid_local_view.hpp"
+#include "grid_mask_connector.hpp"
 
 
@@ -275,4 +276,5 @@
   TRY
   {
+    setDomainList();
     std::vector<CDomain*> domList;
     if (!domList_.empty())
@@ -291,4 +293,5 @@
   TRY
   {
+    setAxisList();
     std::vector<CAxis*> aList;
     if (!axisList_.empty())
@@ -306,4 +309,5 @@
   TRY
   {
+    setScalarList() ;
     std::vector<CScalar*> sList;
     if (!scalarList_.empty())
@@ -2597,6 +2601,11 @@
            return true;
            break;
+
+         case EVENT_ID_SEND_MASK :
+           recvMask(event);
+           return true;
+           break;
         default :
-          ERROR("bool CDomain::dispatchEvent(CEventServer& event)",
+          ERROR("bool CGrid::dispatchEvent(CEventServer& event)",
                 << "Unknown Event");
           return false;
@@ -2671,6 +2680,5 @@
     gridRemoteConnector.computeConnector() ;
     
-    vector<CScattererConnector*> clientToServerConnectors ;
-    vector<CGathererConnector*>  clientFromServerConnectors ;
+    vector<CScattererConnector*> scattererConnectors ;
     for(int i=0 ; i<elements.size() ; i++)
     {
@@ -2680,6 +2688,5 @@
          sendAddDomain(domain->getId(),client) ;
          domain->distributeToServer(client, gridRemoteConnector.getDistributedGlobalIndex(i)) ;
-         clientToServerConnectors.push_back(domain->getClientToServerConnector(client)) ;
-         clientFromServerConnectors.push_back(domain->getClientFromServerConnector(client)) ;
+         scattererConnectors.push_back(domain->getClientToServerConnector(client)) ;
       }
       else if (elements[i].type==TYPE_AXIS)
@@ -2688,7 +2695,5 @@
         sendAddAxis(axis->getId(),client) ;
         axis->distributeToServer(client, gridRemoteConnector.getDistributedGlobalIndex(i)) ;
-        clientToServerConnectors.push_back(axis->getClientToServerConnector(client)) ;
-        clientFromServerConnectors.push_back(axis->getClientFromServerConnector(client)) ;
-
+        scattererConnectors.push_back(axis->getClientToServerConnector(client)) ;
       }
       else if (elements[i].type==TYPE_SCALAR)
@@ -2697,6 +2702,40 @@
         sendAddScalar(scalar->getId(),client) ;
         scalar->distributeToServer(client, gridRemoteConnector.getDistributedGlobalIndex(i)) ;
-        clientToServerConnectors.push_back(scalar->getClientToServerConnector(client)) ;
-        clientFromServerConnectors.push_back(scalar->getClientFromServerConnector(client)) ;
+        scattererConnectors.push_back(scalar->getClientToServerConnector(client)) ;
+      }
+    }
+
+    CGridScattererConnector gridScattererConnector(scattererConnectors) ;
+    CGridLocalConnector* workflowToFull = getGridLocalElements()->getConnector(CElementView::WORKFLOW, CElementView::FULL) ;
+    CArray<bool,1> maskIn(workflowToFull->getSrcSize()) ;
+    CArray<bool,1> maskOut(workflowToFull->getDstSize()) ;
+    maskIn = true ;
+    workflowToFull->transfer(maskIn,maskOut,false) ;
+
+    CEventClient event(getType(), EVENT_ID_SEND_MASK);
+    CMessage message ;
+    message<<getId() ; 
+    gridScattererConnector.transfer(maskOut, client, event, message) ;
+
+
+    vector<CScattererConnector*> clientToServerConnectors ;
+    vector<CGathererConnector*>  clientFromServerConnectors ;
+    for(auto& element : elements)
+    {
+      if (element.type==TYPE_DOMAIN) 
+      { 
+         clientToServerConnectors.push_back(element.domain->getClientToServerConnector(client)) ;
+         clientFromServerConnectors.push_back(element.domain->getClientFromServerConnector(client)) ;
+      }
+      else if (element.type==TYPE_AXIS)
+      {
+        clientToServerConnectors.push_back(element.axis->getClientToServerConnector(client)) ;
+        clientFromServerConnectors.push_back(element.axis->getClientFromServerConnector(client)) ;
+
+      }
+      else if (element.type==TYPE_SCALAR)
+      {
+        clientToServerConnectors.push_back(element.scalar->getClientToServerConnector(client)) ;
+        clientFromServerConnectors.push_back(element.scalar->getClientFromServerConnector(client)) ;
       }
     }
@@ -2707,4 +2746,53 @@
 
 
+  }
+
+  void CGrid::recvMask(CEventServer& event)
+  {
+    string gridId;
+    for (auto& subEvent : event.subEvents) (*subEvent.buffer) >> gridId  ;
+    get(gridId)->receiveMask(event);
+  }
+  
+  void CGrid::receiveMask(CEventServer& event)
+  {
+    vector<CGathererConnector*> gathererConnectors ;
+    vector<CLocalView*> fullViews ;
+
+    for(auto& element : getElements())
+    {
+      if (element.type==TYPE_DOMAIN) 
+      {
+        gathererConnectors.push_back(element.domain->getGathererConnector());
+        fullViews.push_back(element.domain->getLocalElement()->getView(CElementView::FULL));
+        
+      }
+      else if (element.type==TYPE_AXIS)
+      {
+       gathererConnectors.push_back(element.axis->getGathererConnector());
+       fullViews.push_back(element.axis->getLocalElement()->getView(CElementView::FULL));
+      }
+      else if (element.type==TYPE_SCALAR) 
+      {
+        gathererConnectors.push_back(element.scalar->getGathererConnector());
+        fullViews.push_back(element.scalar->getLocalElement()->getView(CElementView::FULL));
+      }
+    }
+    CGridGathererConnector gridGathererConnector(gathererConnectors) ;
+    CGridMaskConnector gridMaskConnector(fullViews) ;
+
+    CArray<bool,1> maskOut ;
+    gridGathererConnector.transfer(event,maskOut,false) ;
+    gridMaskConnector.computeConnector(maskOut) ;
+
+    CContextClient* client = event.getContextServer()->getAssociatedClient() ;
+    int i=0 ;
+    for(auto& element : getElements())
+    {
+      if (element.type==TYPE_DOMAIN) element.domain->setServerMask(gridMaskConnector.getElementMask(i),client);
+      else if (element.type==TYPE_AXIS) element.axis->setServerMask(gridMaskConnector.getElementMask(i),client);
+      else if (element.type==TYPE_SCALAR) element.scalar->setServerMask(gridMaskConnector.getElementMask(i),client);
+      i++ ;
+    }
   }
 
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/grid.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/grid.hpp	(revision 1942)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/grid.hpp	(revision 1943)
@@ -75,5 +75,7 @@
          enum EEventId
          {
-           EVENT_ID_INDEX, EVENT_ID_ADD_DOMAIN, EVENT_ID_ADD_AXIS, EVENT_ID_ADD_SCALAR
+           EVENT_ID_INDEX, EVENT_ID_ADD_DOMAIN, EVENT_ID_ADD_AXIS, EVENT_ID_ADD_SCALAR,
+           EVENT_ID_SEND_MASK,
+
          };
 
@@ -518,12 +520,13 @@
   */
 //        std::map<CContextClient*, CClientServerMapping::GlobalIndexMap> globalIndexOnServer_;
-        std::map<int, CClientServerMapping::GlobalIndexMap> globalIndexOnServer_;
-
-      
+      std::map<int, CClientServerMapping::GlobalIndexMap> globalIndexOnServer_;
+     
 
      //////////////////////////////////////////////////////////////////////////////////////
      //  this part is related to distribution, element definition, views and connectors  //
      //////////////////////////////////////////////////////////////////////////////////////
-
+      private:
+       static void recvMask(CEventServer& event) ;
+       void receiveMask(CEventServer& event) ;
 
       private:  
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/scalar.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/scalar.cpp	(revision 1942)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/scalar.cpp	(revision 1943)
@@ -313,5 +313,6 @@
     CDistributedElement scatteredElement(1,globalIndex) ;
     scatteredElement.addFullView() ;
-    CScattererConnector scattererConnector(localElement_->getView(CElementView::FULL), scatteredElement.getView(CElementView::FULL), context->getIntraComm()) ;
+    CScattererConnector scattererConnector(localElement_->getView(CElementView::FULL), scatteredElement.getView(CElementView::FULL), 
+                                           context->getIntraComm(), client->getRemoteSize()) ;
     scattererConnector.computeConnector() ;
     
@@ -353,13 +354,7 @@
     message2<<serverScalarId<<2 ; 
     clientToServerElement.sendToServer(client, event2, message2) ; 
-    clientToServerConnector_[client] = new CScattererConnector(localElement_->getView(CElementView::WORKFLOW),
-                                                              clientToServerElement.getView(CElementView::FULL), context->getIntraComm()) ;
+    clientToServerConnector_[client] = new CScattererConnector(localElement_->getView(CElementView::WORKFLOW), clientToServerElement.getView(CElementView::FULL),
+                                                               context->getIntraComm(), client->getRemoteSize()) ;
     clientToServerConnector_[client]->computeConnector() ;
-
-
-    CEventClient event3(getType(), EVENT_ID_SCALAR_DISTRIBUTION);
-    CMessage message3 ;
-    message3<<serverScalarId<<3 ; 
-    clientToServerConnector_[client]->transfer(maskIn,client,event3,message3) ; 
 
     clientFromServerConnector_[client] = new CGathererConnector(clientToServerElement.getView(CElementView::FULL), localElement_->getView(CElementView::WORKFLOW));
@@ -407,21 +402,22 @@
       gathererConnector_ -> computeConnector() ;
     }
-    else if (phasis==3)
-    {
-      CArray<bool,1> localMask ;
-      gathererConnector_->transfer(event,localMask,false) ;
-      localElement_->addView(CElementView::WORKFLOW, localMask) ;
-      mask = localMask(0) ;
-       
-      serverFromClientConnector_ = new CGathererConnector(elementFrom_->getView(CElementView::FULL), localElement_->getView(CElementView::WORKFLOW)) ;
-      serverFromClientConnector_->computeConnector() ;
-
-      serverToClientConnector_ = new CScattererConnector(localElement_->getView(CElementView::WORKFLOW), elementFrom_->getView(CElementView::FULL),
-                                                         context->getIntraComm()) ;
-      serverToClientConnector_->computeConnector() ;
-
-    }
   }
   CATCH
+
+  void CScalar::setServerMask(CArray<bool,1>& serverMask, CContextClient* client)
+  TRY
+  {
+    CContext* context = CContext::getCurrent();
+    localElement_->addView(CElementView::WORKFLOW, serverMask) ;
+    mask = serverMask(0) ;
+ 
+    serverFromClientConnector_ = new CGathererConnector(elementFrom_->getView(CElementView::FULL), localElement_->getView(CElementView::WORKFLOW)) ;
+    serverFromClientConnector_->computeConnector() ;
+      
+    serverToClientConnector_ = new CScattererConnector(localElement_->getView(CElementView::WORKFLOW), elementFrom_->getView(CElementView::FULL),
+                                                         context->getIntraComm(), client->getRemoteSize()) ;
+    serverToClientConnector_->computeConnector() ;
+  }
+  CATCH_DUMP_ATTR
 
   void CScalar::sendDistributedAttributes(CContextClient* client, CScattererConnector& scattererConnector, const string& scalarId)
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/scalar.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/scalar.hpp	(revision 1942)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/scalar.hpp	(revision 1943)
@@ -178,4 +178,5 @@
          static void recvScalarDistribution(CEventServer& event) ;
          void receivedScalarDistribution(CEventServer& event, int phasis) ;
+         void setServerMask(CArray<bool,1>& serverMask, CContextClient* client) ;
          void sendDistributedAttributes(CContextClient* client, CScattererConnector& scattererConnector, const string& scalarId) ;
          static void recvDistributedAttributes(CEventServer& event) ;
@@ -193,4 +194,7 @@
        private:
          CGathererConnector*  gathererConnector_ ;
+       public:
+         CGathererConnector* getGathererConnector(void) { return gathererConnector_ ;}
+       private:
          CGathererConnector* serverFromClientConnector_ ;
          CDistributedElement* elementFrom_ ;
