Index: /XIOS/trunk/src/distribution.hpp
===================================================================
--- /XIOS/trunk/src/distribution.hpp	(revision 929)
+++ /XIOS/trunk/src/distribution.hpp	(revision 930)
@@ -12,4 +12,5 @@
 #include "xios_spl.hpp"
 #include "array_new.hpp"
+#include <boost/unordered_map.hpp>
 
 namespace xios {
@@ -22,4 +23,7 @@
 class CDistribution
 {
+  public:
+  typedef boost::unordered_map<size_t,int> GlobalLocalMap;
+
   public:
     /** Default constructor */
Index: /XIOS/trunk/src/distribution_client.hpp
===================================================================
--- /XIOS/trunk/src/distribution_client.hpp	(revision 929)
+++ /XIOS/trunk/src/distribution_client.hpp	(revision 930)
@@ -14,5 +14,4 @@
 #include "domain.hpp"
 #include "grid.hpp"
-#include <boost/unordered_map.hpp>
 
 namespace xios {
@@ -31,5 +30,5 @@
 {
 public:
-  typedef boost::unordered_map<size_t,int> GlobalLocalDataMap;
+  typedef CDistribution::GlobalLocalMap GlobalLocalDataMap;
 
   public:
Index: /XIOS/trunk/src/distribution_server.cpp
===================================================================
--- /XIOS/trunk/src/distribution_server.cpp	(revision 929)
+++ /XIOS/trunk/src/distribution_server.cpp	(revision 930)
@@ -3,5 +3,5 @@
    \author Ha NGUYEN
    \since 13 Jan 2015
-   \date 04 Feb 2015
+   \date 10 Sep 2016
 
    \brief Index distribution on server side.
@@ -13,5 +13,5 @@
 
 CDistributionServer::CDistributionServer(int rank, int dims, const CArray<size_t,1>& globalIndex)
-  : CDistribution(rank, dims, globalIndex), nGlobal_(), nZoomSize_(), nZoomBegin_()
+  : CDistribution(rank, dims, globalIndex), nGlobal_(), nZoomSize_(), nZoomBegin_(), globalLocalIndexMap_()
 {
 }
@@ -19,5 +19,5 @@
 CDistributionServer::CDistributionServer(int rank, const std::vector<int>& nZoomBegin,
                                          const std::vector<int>& nZoomSize, const std::vector<int>& nGlobal)
-  : CDistribution(rank, nGlobal.size()), nGlobal_(nGlobal), nZoomSize_(nZoomSize), nZoomBegin_(nZoomBegin)
+  : CDistribution(rank, nGlobal.size()), nGlobal_(nGlobal), nZoomSize_(nZoomSize), nZoomBegin_(nZoomBegin), globalLocalIndexMap_()
 {
   createGlobalIndex();
@@ -29,5 +29,5 @@
                                          const std::vector<int>& nGlobal)
   : CDistribution(rank, nGlobal.size()), nGlobal_(nGlobal), nZoomBeginGlobal_(nZoomBeginGlobal),
-    nZoomSize_(nZoomSize), nZoomBegin_(nZoomBegin)
+    nZoomSize_(nZoomSize), nZoomBegin_(nZoomBegin), globalLocalIndexMap_()
 {
   createGlobalIndex();
@@ -54,4 +54,5 @@
   int innerLoopSize = nZoomSize_[0];
 
+  globalLocalIndexMap_.rehash(std::ceil(ssize/globalLocalIndexMap_.max_load_factor()));
   while (idx<ssize)
   {
@@ -78,5 +79,7 @@
         globalIndex += (currentIndex[k])*mulDim;
       }
+      globalLocalIndexMap_[globalIndex] = idx;
       this->globalIndex_(idx) = globalIndex;
+
       ++idx;
     }
@@ -93,22 +96,11 @@
 {
   int ssize = globalIndex.numElements();
-  int nbGlobalIndex = this->globalIndex_.numElements();
-
-  std::vector<int>::iterator it;
-  std::vector<int> permutIndex(nbGlobalIndex);
-  XIOSAlgorithms::fillInIndex(nbGlobalIndex, permutIndex);
-  XIOSAlgorithms::sortWithIndex<size_t, CArrayStorage>(this->globalIndex_, permutIndex);
-  typedef XIOSBinarySearchWithIndex<size_t, CArrayStorage> BinarySearch;
-  BinarySearch binarySearch(this->globalIndex_);
-
   CArray<size_t,1> localIndex(ssize);
-  int idx = 0;
-  for (int i = 0; i < ssize; ++i)
+  GlobalLocalMap::const_iterator ite = globalLocalIndexMap_.end(), it;
+  for (int idx = 0; idx < ssize; ++idx)
   {
-    if (binarySearch.search(permutIndex.begin(), permutIndex.end(), globalIndex(i), it))
-    {
-      localIndex(idx) = *it;
-      ++idx;
-    }
+    it = globalLocalIndexMap_.find(globalIndex(idx));
+    if (ite != it)
+      localIndex(idx) = it->second;
   }
 
@@ -123,25 +115,14 @@
 {
   int ssize = globalIndex.numElements();
-  int nbGlobalIndex = this->globalIndex_.numElements();
-
-  std::vector<int>::iterator it;
-  std::vector<int> permutIndex(nbGlobalIndex);
-  XIOSAlgorithms::fillInIndex(nbGlobalIndex, permutIndex);
-  XIOSAlgorithms::sortWithIndex<size_t, CArrayStorage>(this->globalIndex_, permutIndex);
-  typedef XIOSBinarySearchWithIndex<size_t, CArrayStorage> BinarySearch;
-  BinarySearch binarySearch(this->globalIndex_);
-
   CArray<size_t,1> localIndex(ssize);
-  int idx = 0;
-  for (int i = 0; i < ssize; ++i)
+  GlobalLocalMap::const_iterator ite = globalLocalIndexMap_.end(), it;
+  for (int idx = 0; idx < ssize; ++idx)
   {
-    if (binarySearch.search(permutIndex.begin(), permutIndex.end(), globalIndex(i), it))
-    {
-      localIndex(idx) = *it;
-      ++idx;
-    }
+    it = globalLocalIndexMap_.find(globalIndex(idx));
+    if (ite != it)
+      localIndex(idx) = it->second;
   }
 
-  globalIndex = localIndex;
+  globalIndex.reference(localIndex);
 }
 
Index: /XIOS/trunk/src/distribution_server.hpp
===================================================================
--- /XIOS/trunk/src/distribution_server.hpp	(revision 929)
+++ /XIOS/trunk/src/distribution_server.hpp	(revision 930)
@@ -44,4 +44,8 @@
   protected:
     virtual void createGlobalIndex();
+
+  protected:
+    GlobalLocalMap globalLocalIndexMap_;
+
   private:
     std::vector<int> nGlobal_;
