Index: XIOS/trunk/src/context_client.cpp
===================================================================
--- XIOS/trunk/src/context_client.cpp	(revision 982)
+++ XIOS/trunk/src/context_client.cpp	(revision 988)
@@ -50,4 +50,6 @@
         for (int i = 0; i < serverByClient; i++)
           ranksServerLeader.push_back(rankStart + i);
+
+        ranksServerNotLeader.resize(0);
       }
       else
@@ -60,4 +62,6 @@
           if (clientRank % (clientByServer + 1) == 0)
             ranksServerLeader.push_back(clientRank / (clientByServer + 1));
+          else
+            ranksServerNotLeader.push_back(clientRank / (clientByServer + 1));
         }
         else
@@ -66,5 +70,7 @@
           if (rank % clientByServer == 0)
             ranksServerLeader.push_back(remain + rank / clientByServer);
-        }
+          else
+            ranksServerNotLeader.push_back(remain + rank / clientByServer);
+        }        
       }
 
@@ -249,4 +255,22 @@
   \return ranks of leading servers
   */
+  const std::list<int>& CContextClient::getRanksServerNotLeader(void) const
+  {
+    return ranksServerNotLeader;
+  }
+
+  /*!
+  Check if client connects to leading server
+  \return connected(true), not connected (false)
+  */
+  bool CContextClient::isServerNotLeader(void) const
+  {
+    return !ranksServerNotLeader.empty();
+  }
+
+  /*!
+  Get leading server in the group of connected server
+  \return ranks of leading servers
+  */
   const std::list<int>& CContextClient::getRanksServerLeader(void) const
   {
Index: XIOS/trunk/src/context_client.hpp
===================================================================
--- XIOS/trunk/src/context_client.hpp	(revision 982)
+++ XIOS/trunk/src/context_client.hpp	(revision 988)
@@ -41,5 +41,7 @@
 
       bool isServerLeader(void) const;
+      bool isServerNotLeader(void) const;
       const std::list<int>& getRanksServerLeader(void) const;
+      const std::list<int>& getRanksServerNotLeader(void) const;
 
       bool isAttachedModeEnabled() const;
@@ -80,4 +82,7 @@
       std::list<int> ranksServerLeader;
 
+      //! List of server ranks for which the client is not leader
+      std::list<int> ranksServerNotLeader;
+
     public: // Some function should be removed in the future
       //    void registerEvent(CEventClient& event);
Index: XIOS/trunk/src/filter/source_filter.cpp
===================================================================
--- XIOS/trunk/src/filter/source_filter.cpp	(revision 982)
+++ XIOS/trunk/src/filter/source_filter.cpp	(revision 988)
@@ -48,8 +48,9 @@
     packet->status = CDataPacket::NO_ERROR;
 
-    if (data.size() != grid->storeIndex_toSrv.size())
+    // if (data.size() != grid->storeIndex_toSrv.size())
+    if (data.size() != grid->storeIndex_fromSrv.size())
       ERROR("CSourceFilter::streamDataFromServer(CDate date, const std::map<int, CArray<double, 1> >& data)",
             << "Incoherent data received from servers,"
-            << " expected " << grid->storeIndex_toSrv.size() << " chunks but " << data.size() << " were given.");
+            << " expected " << grid->storeIndex_fromSrv.size() << " chunks but " << data.size() << " were given.");
 
     packet->data.resize(grid->storeIndex_client.numElements());
@@ -57,6 +58,6 @@
     for (it = data.begin(); it != itEnd; it++)
     {
-      CArray<int,1>& index = grid->storeIndex_toSrv[it->first];
-
+      // CArray<int,1>& index = grid->storeIndex_toSrv[it->first];
+      CArray<int,1>& index = grid->storeIndex_fromSrv[it->first];
       for (int n = 0; n < index.numElements(); n++)
         packet->data(index(n)) = it->second(n);
Index: XIOS/trunk/src/node/field.cpp
===================================================================
--- XIOS/trunk/src/node/field.cpp	(revision 982)
+++ XIOS/trunk/src/node/field.cpp	(revision 988)
@@ -310,16 +310,62 @@
 
     map<int, CArray<double,1> >::iterator it;
-    for (it = data_srv.begin(); it != data_srv.end(); it++)
-    {
-      msgs.push_back(CMessage());
-      CMessage& msg = msgs.back();
-      msg << getId();
-      if (hasData)
-        msg << getNStep() - 1 << it->second;
-      else
-        msg << int(-1);
-      event.push(it->first, grid->nbSenders[it->first], msg);
-    }
-    client->sendEvent(event);
+    if (!grid->doGridHaveDataDistributed())
+    {
+       if (client->isServerLeader())
+       {
+          if (!data_srv.empty())
+          {
+            it = data_srv.begin();
+            const std::list<int>& ranks = client->getRanksServerLeader();
+            for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+            {
+              msgs.push_back(CMessage());
+              CMessage& msg = msgs.back();
+              msg << getId();
+              if (hasData)
+                msg << getNStep() - 1 << it->second;
+              else
+                msg << int(-1);
+              event.push(*itRank, 1, msg);
+            }
+          }
+          client->sendEvent(event);
+       } 
+       else 
+       {
+          // if (!data_srv.empty())
+          // {
+          //   it = data_srv.begin();
+          //   const std::list<int>& ranks = client->getRanksServerNotLeader();
+          //   for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+          //   {
+          //     msgs.push_back(CMessage());
+          //     CMessage& msg = msgs.back();
+          //     msg << getId();
+          //     if (hasData)
+          //       msg << getNStep() - 1 << it->second;
+          //     else
+          //       msg << int(-1);
+          //     event.push(*itRank, 1, msg);
+          //   }
+          // }
+          client->sendEvent(event);
+       }
+    }
+    else
+    {
+      for (it = data_srv.begin(); it != data_srv.end(); it++)
+      {
+        msgs.push_back(CMessage());
+        CMessage& msg = msgs.back();
+        msg << getId();
+        if (hasData)
+          msg << getNStep() - 1 << it->second;
+        else
+          msg << int(-1);
+        event.push(it->first, grid->nbSenders[it->first], msg);
+      }
+      client->sendEvent(event);
+    }
   }
 
Index: XIOS/trunk/src/node/grid.cpp
===================================================================
--- XIOS/trunk/src/node/grid.cpp	(revision 982)
+++ XIOS/trunk/src/node/grid.cpp	(revision 988)
@@ -1044,5 +1044,5 @@
         int rank = *itRank;
         int nb = 1;
-        storeIndex_toSrv.insert(std::make_pair(rank, CArray<int,1>(nb)));
+        storeIndex_toSrv.insert(std::make_pair(rank, CArray<int,1>(nb)));        
         listOutIndex.push_back(CArray<size_t,1>(nb));
 
@@ -1056,4 +1056,5 @@
         }
 
+        storeIndex_fromSrv.insert(std::make_pair(rank, CArray<int,1>(outLocalIndexToServer)));
         listMsg.push_back(CMessage());
         listMsg.back() << getId( )<< isDataDistributed_ << isCompressible_ << listOutIndex.back();
@@ -1064,5 +1065,19 @@
     }
     else
+    {
+      const std::list<int>& ranks = client->getRanksServerNotLeader();
+      for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+      {
+        int rank = *itRank;
+        int nb = 1;        
+        storeIndex_fromSrv.insert(std::make_pair(rank, CArray<int,1>(nb)));
+        CArray<int, 1>& outLocalIndexToServer = storeIndex_fromSrv[rank];
+        for (int k = 0; k < nb; ++k)
+        {          
+          outLocalIndexToServer(k)  = 0;
+        }
+      }
       client->sendEvent(event);
+    }
   }
 
@@ -1092,10 +1107,10 @@
           outLocalIndexToServer(idx) = itIndex->second;
         }
-
-        //int nbClient = client->clientSize; // This stupid variable signals the servers the number of client connect to them
+        
         const std::list<int>& ranks = client->getRanksServerLeader();
         for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
         {
           storeIndex_toSrv.insert(std::make_pair(*itRank, CArray<int,1>(outLocalIndexToServer)));
+          storeIndex_fromSrv.insert(std::make_pair(*itRank, CArray<int,1>(outLocalIndexToServer)));
           listOutIndex.push_back(CArray<size_t,1>(outGlobalIndexOnServer));
 
@@ -1107,6 +1122,20 @@
         client->sendEvent(event);
       }
-      else
+      else 
+      {
+        int indexSize = globalLocalIndexSendToServer.size();        
+        CArray<int,1> outLocalIndexToServer(indexSize);
+        for (int idx = 0; itIndex != iteIndex; ++itIndex, ++idx)
+        {          
+          outLocalIndexToServer(idx) = itIndex->second;
+        }
+        
+        const std::list<int>& ranks = client->getRanksServerNotLeader();
+        for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+        {          
+          storeIndex_fromSrv.insert(std::make_pair(*itRank, CArray<int,1>(outLocalIndexToServer)));
+        }
         client->sendEvent(event);
+      }
     }
     else
@@ -1141,5 +1170,5 @@
           nb = globalIndexTmp[rank].size();
 
-        storeIndex_toSrv.insert(make_pair(rank, CArray<int,1>(nb)));
+        storeIndex_toSrv.insert(make_pair(rank, CArray<int,1>(nb)));        
         listOutIndex.push_back(CArray<size_t,1>(nb));
 
@@ -1153,4 +1182,5 @@
         }
 
+        storeIndex_fromSrv.insert(make_pair(rank, CArray<int,1>(outLocalIndexToServer)));
         listMsg.push_back(CMessage());
         listMsg.back() << getId() << isDataDistributed_ << isCompressible_ << listOutIndex.back();
Index: XIOS/trunk/src/node/grid.hpp
===================================================================
--- XIOS/trunk/src/node/grid.hpp	(revision 982)
+++ XIOS/trunk/src/node/grid.hpp	(revision 988)
@@ -221,4 +221,5 @@
 
          map<int, CArray<int, 1> > storeIndex_toSrv;
+         map<int, CArray<int, 1> > storeIndex_fromSrv;
          map<int,int> nbSenders;
 
