Index: /XIOS/trunk/src/distribution_client.cpp
===================================================================
--- /XIOS/trunk/src/distribution_client.cpp	(revision 869)
+++ /XIOS/trunk/src/distribution_client.cpp	(revision 870)
@@ -488,5 +488,5 @@
       if (isCurrentIndexDataCorrect)
       {
-        int gridMaskIndex = 0; //currentIndex[0];
+        int gridMaskIndex = 0;
         for (int k = 0; k < this->numElement_; ++k)
         {
@@ -505,5 +505,5 @@
           if (isIndexOnServer)
           {
-            size_t globalIndex = 0; //currentGlobalIndex[0];
+            size_t globalIndex = 0;
             for (int k = 0; k < numElement_; ++k)
             {
@@ -524,80 +524,4 @@
 }
 
-///*!
-//  Create local index of domain(s).
-//  A domain can have data index which even contains the "ghost" points. Very often, these
-//data surround the true data. In order to send correct data to server,
-//a client need to know index of the true data.
-//*/
-//void CDistributionClient::createLocalDomainDataIndex()
-//{
-//  int numDomain = 0;
-//  for (int i = 0; i < axisDomainOrder_.numElements(); ++i)
-//    if (axisDomainOrder_(i)) ++numDomain;
-//
-//  localDomainIndex_.resize(numDomain*2);
-//  indexDomainData_.resize(numDomain);
-//
-//  int idxDomain = 0;
-//  for (int i = 0; i < axisDomainOrder_.numElements(); ++i)
-//  {
-//    if (axisDomainOrder_(i))
-//    {
-//      int iIdx, jIdx = 0, count = 0;
-//      indexDomainData_[idxDomain].resize(dataNIndex_[i], false);
-//      for (int j = 0; j < dataNIndex_[i]; ++j)
-//      {
-//        iIdx = getDomainIndex((*dataIndex_[indexMap_[i]])(j), (*dataIndex_[indexMap_[i]+1])(j),
-//                              dataBegin_[indexMap_[i]], dataBegin_[indexMap_[i]+1],
-//                              dataDims_[i], nLocal_[indexMap_[i]], jIdx);
-//
-//        if ((iIdx >= nBeginLocal_[indexMap_[i]]) && (iIdx < nLocal_[indexMap_[i]]) &&
-//           (jIdx >= nBeginLocal_[indexMap_[i]+1]) && (jIdx < nLocal_[indexMap_[i]+1]) &&
-//           (domainMasks_[idxDomain](iIdx + jIdx*nLocal_[indexMap_[i]])))
-//        {
-//          (localDomainIndex_[idxDomain]).push_back(iIdx);
-//          (localDomainIndex_[idxDomain*2+1]).push_back(jIdx);
-//          indexDomainData_[idxDomain][j] = true;
-//        }
-//      }
-//      ++idxDomain;
-//    }
-//  }
-//}
-
-///*!
-//  Create local index of axis.
-//*/
-//void CDistributionClient::createLocalAxisDataIndex()
-//{
-//  int numAxis = 0;
-//  for (int i = 0; i < axisDomainOrder_.numElements(); ++i)
-//    if (!axisDomainOrder_(i)) ++numAxis;
-//
-//  localAxisIndex_.resize(numAxis);
-//  indexAxisData_.resize(numAxis);
-//
-//  int idxAxis = 0;
-//  for (int i = 0; i < axisDomainOrder_.numElements(); ++i)
-//  {
-//    if (!axisDomainOrder_(i))
-//    {
-//      int iIdx = 0;
-//      indexAxisData_[idxAxis].resize(dataNIndex_[i], false);
-//      for (int j = 0; j < dataNIndex_[i]; ++j)
-//      {
-//        iIdx = getAxisIndex((*dataIndex_[indexMap_[i]])(j), dataBegin_[indexMap_[i]], nLocal_[indexMap_[i]]);
-//        if ((iIdx >= nBeginLocal_[indexMap_[i]]) &&
-//           (iIdx < nLocal_[indexMap_[i]]) && (axisMasks_[idxAxis](iIdx)))
-//        {
-//          localAxisIndex_[idxAxis].push_back(iIdx);
-//          indexAxisData_[idxAxis][j] = true;
-//        }
-//      }
-//      ++idxAxis;
-//    }
-//  }
-//}
-
 void CDistributionClient::createGlobalIndex()
 {
@@ -652,289 +576,4 @@
 
 }
-
-
-///*!
-//   Create global index on client
-//   In order to do the mapping between client-server, each client creates its own
-//global index of sending data. This global index is then used to calculate to which server
-//the client needs to send it data as well as which part of data belongs to the server.
-//So as to make clients and server coherent in order of index, global index is calculated by
-//take into account of C-convention, the rightmost dimension varies faster.
-//*/
-//void CDistributionClient::createGlobalIndexSendToServer()
-//{
-//  if (isComputed_) return;
-//  isComputed_ = true;
-//  createLocalDomainDataIndex();
-//  createLocalAxisDataIndex();
-//
-//  int idxDomain = 0, idxAxis = 0;
-//  std::vector<int> eachElementSize(numElement_);
-//
-//  // Precompute size of the loop
-//  for (int i = 0; i < numElement_; ++i)
-//  {
-//    if(axisDomainOrder_(i))
-//    {
-//      eachElementSize[i] = localDomainIndex_[idxDomain].size();
-//      idxDomain += 2;
-//    }
-//    else
-//    {
-//      eachElementSize[i] = localAxisIndex_[idxAxis].size();
-//      ++idxAxis;
-//    }
-//  }
-//
-//  //   Compute size of the global index on client
-//  std::vector<StdSize> idxLoop(numElement_,0);
-//  std::vector<StdSize> currentIndex(this->dims_,0);
-//  int innerLoopSize = eachElementSize[0];
-//  size_t idx = 0, indexLocalDataOnClientCount = 0, indexSend2ServerCount = 0;
-//  size_t ssize = 1;
-//  for (int i = 0; i < numElement_; ++i) ssize *= eachElementSize[i];
-//  while (idx < ssize)
-//  {
-//    for (int i = 0; i < numElement_-1; ++i)
-//    {
-//      if (idxLoop[i] == eachElementSize[i])
-//      {
-//        idxLoop[i] = 0;
-//        ++idxLoop[i+1];
-//      }
-//    }
-//
-//    // Find out outer index
-//    // Depending the inner-most element is axis or domain,
-//    // The outer loop index begins correspondingly at one (1) or zero (0)
-//    idxDomain = idxAxis = 0;
-//    if (axisDomainOrder_(0)) ++idxDomain;
-//    else ++idxAxis;
-//    for (int i = 1; i < numElement_; ++i)
-//    {
-//      if (axisDomainOrder_(i))
-//      {
-//        currentIndex[indexMap_[i]]   = localDomainIndex_[idxDomain][idxLoop[i]];
-//        currentIndex[indexMap_[i]+1] = localDomainIndex_[idxDomain+1][idxLoop[i]];
-//        idxDomain += 2;
-//      }
-//      else
-//      {
-//        currentIndex[indexMap_[i]]   = localAxisIndex_[idxAxis][idxLoop[i]];
-//        ++idxAxis;
-//      }
-//    }
-//
-//    // Inner most index
-//    idxDomain = idxAxis = 0;
-//    for (int i = 0; i < innerLoopSize; ++i)
-//    {
-//      if (axisDomainOrder_(0))
-//      {
-//        currentIndex[0] = localDomainIndex_[idxDomain][i];
-//        currentIndex[1] = localDomainIndex_[idxDomain+1][i];
-//      }
-//      else currentIndex[0]   = localAxisIndex_[idxAxis][i];
-//
-//      StdSize gridMaskIndex = currentIndex[0];
-//      int mulDimMask = 1;
-//      for (int k = 1; k < this->dims_; ++k)
-//      {
-//        mulDimMask *= nLocal_[k-1];
-//        gridMaskIndex += (currentIndex[k])*mulDimMask;
-//      }
-//
-//      if (gridMask_(gridMaskIndex))
-//      {
-//        ++indexLocalDataOnClientCount;
-//        bool isIndexOnServer = true;
-//
-//        for (int idxElement = 0; idxElement < this->numElement_; ++idxElement)
-//        {
-//          int actualIdx = 0;
-//          if (axisDomainOrder_(idxElement))
-//          {
-//            actualIdx = currentIndex[indexMap_[idxElement]]+currentIndex[indexMap_[idxElement]+1]*nLocal_[indexMap_[idxElement]];
-//            isIndexOnServer = isIndexOnServer && (((*infoIndex_[indexMap_[idxElement]])(actualIdx)) <= nZoomEnd_[indexMap_[idxElement]])
-//                                              && (nZoomBegin_[indexMap_[idxElement]] <= ((*infoIndex_[indexMap_[idxElement]])(actualIdx)))
-//                                              && (((*infoIndex_[indexMap_[idxElement]+1])(actualIdx)) <= nZoomEnd_[indexMap_[idxElement]+1])
-//                                              && (nZoomBegin_[indexMap_[idxElement]+1] <= ((*infoIndex_[indexMap_[idxElement]+1])(actualIdx)));
-//          }
-//          else
-//          {
-//            isIndexOnServer = isIndexOnServer && (((*infoIndex_[indexMap_[idxElement]])(currentIndex[indexMap_[idxElement]])) <= nZoomEnd_[indexMap_[idxElement]])
-//                                              && (nZoomBegin_[indexMap_[idxElement]] <= ((*infoIndex_[indexMap_[idxElement]])(currentIndex[indexMap_[idxElement]])));
-//          }
-//        }
-//        if (isIndexOnServer) ++indexSend2ServerCount;
-//      }
-//
-//    }
-//    idxLoop[0] += innerLoopSize;
-//    idx += innerLoopSize;
-//  }
-//
-//  // Now allocate these arrays
-//  localDataIndex_.resize(indexLocalDataOnClientCount);
-//  localMaskIndex_.resize(indexSend2ServerCount);
-//  globalLocalDataSendToServerMap_.rehash(std::ceil(indexSend2ServerCount/globalLocalDataSendToServerMap_.max_load_factor())); //globalLocalDataSendToServerMap_.reserve(indexSend2ServerCount);
-//
-//  // We need to loop with data index
-//  idxLoop.assign(numElement_,0);
-//  idx = indexLocalDataOnClientCount = indexSend2ServerCount = 0;
-//  ssize = 1; for (int i = 0; i < numElement_; ++i) ssize *= dataNIndex_[i];
-//  innerLoopSize = dataNIndex_[0];
-//  int countLocalData = 0;
-//  std::vector<int> correctOuterIndex(numElement_,0);
-//  bool isOuterIndexCorrect = true;
-//  while (idx < ssize)
-//  {
-//    for (int i = 0; i < numElement_-1; ++i)
-//    {
-//      if (idxLoop[i] == dataNIndex_[i])
-//      {
-//        idxLoop[i] = 0;
-//        correctOuterIndex[i] = 0;
-//        ++idxLoop[i+1];
-//        if (isOuterIndexCorrect) ++correctOuterIndex[i+1];
-//      }
-//    }
-//
-//    // Depending the inner-most element axis or domain,
-//    // The outer loop index begins correspondingly at one (1) or zero (0)
-//    idxDomain = idxAxis = 0;
-//    if (axisDomainOrder_(0)) ++idxDomain;
-//    else ++idxAxis;
-//    bool isIndexDomainDataCorrect = true;
-//    bool isIndexAxisDataCorrect = true;
-//
-//    for (int i = 1; i < numElement_; ++i)
-//    {
-//      if (axisDomainOrder_(i))
-//      {
-//        if (indexDomainData_[idxDomain][idxLoop[i]])
-//        {
-//          currentIndex[indexMap_[i]]   = localDomainIndex_[idxDomain][correctOuterIndex[i]];
-//          currentIndex[indexMap_[i]+1] = localDomainIndex_[idxDomain*2+1][correctOuterIndex[i]];
-//          isIndexDomainDataCorrect &= true;
-//        }
-//        else isIndexDomainDataCorrect = false;
-//        ++idxDomain;
-//      }
-//      else
-//      {
-//        if (indexAxisData_[idxAxis][idxLoop[i]])
-//        {
-//          currentIndex[indexMap_[i]]   = localAxisIndex_[idxAxis][correctOuterIndex[i]];
-//          isIndexAxisDataCorrect &= true;
-//        }
-//        else isIndexAxisDataCorrect = false;
-//        ++idxAxis;
-//      }
-//    }
-//
-//    isOuterIndexCorrect = (isIndexAxisDataCorrect) && (isIndexDomainDataCorrect);
-//
-//    // Inner most index
-//    idxDomain = idxAxis = 0;
-//    int correctIndexDomain = 0, correctIndexAxis = 0;
-//    for (int i = 0; i < innerLoopSize; ++i)
-//    {
-//      bool isCurrentIndexDomainDataCorrect = isIndexDomainDataCorrect;
-//      bool isCurrentIndexAxisDataCorrect = isIndexAxisDataCorrect;
-//
-//      if (axisDomainOrder_(0))
-//      {
-//        if (indexDomainData_[idxDomain][i])
-//        {
-//          currentIndex[0] = localDomainIndex_[idxDomain][correctIndexDomain];
-//          currentIndex[1] = localDomainIndex_[idxDomain+1][correctIndexDomain];
-//          isCurrentIndexDomainDataCorrect &= true;
-//          ++correctIndexDomain;
-//        }
-//        else isCurrentIndexDomainDataCorrect = false;
-//      }
-//      else
-//      {
-//        if (indexAxisData_[idxAxis][i])
-//        {
-//          currentIndex[0] = localAxisIndex_[idxAxis][correctIndexAxis];
-//          isCurrentIndexAxisDataCorrect &= true;
-//          ++correctIndexAxis;
-//        }
-//        else isCurrentIndexAxisDataCorrect = false;
-//      }
-//
-//      int gridMaskIndex = currentIndex[0];
-//      int mulDimMask = 1;
-//      for (int k = 1; k < this->dims_; ++k)
-//      {
-//        mulDimMask *= nLocal_[k-1];
-//        gridMaskIndex += (currentIndex[k])*mulDimMask;
-//      }
-//
-//      if (isCurrentIndexDomainDataCorrect &&
-//          isCurrentIndexAxisDataCorrect &&
-//          gridMask_(gridMaskIndex))
-//      {
-//        localDataIndex_[indexLocalDataOnClientCount] = countLocalData;
-//        bool isIndexOnServer = true;
-//        for (int idxElement = 0; idxElement < this->numElement_; ++idxElement)
-//        {
-//          int actualIdx = 0;
-//          if (axisDomainOrder_(idxElement))
-//          {
-//            actualIdx = currentIndex[indexMap_[idxElement]]+currentIndex[indexMap_[idxElement]+1]*nLocal_[indexMap_[idxElement]];
-//            isIndexOnServer = isIndexOnServer && (((*infoIndex_[indexMap_[idxElement]])(actualIdx)) <= nZoomEnd_[indexMap_[idxElement]])
-//                                              && (nZoomBegin_[indexMap_[idxElement]] <= ((*infoIndex_[indexMap_[idxElement]])(actualIdx)))
-//                                              && (((*infoIndex_[indexMap_[idxElement]+1])(actualIdx)) <= nZoomEnd_[indexMap_[idxElement]+1])
-//                                              && (nZoomBegin_[indexMap_[idxElement]+1] <= ((*infoIndex_[indexMap_[idxElement]+1])(actualIdx)));
-//          }
-//          else
-//          {
-//            isIndexOnServer = isIndexOnServer && (((*infoIndex_[indexMap_[idxElement]])(currentIndex[indexMap_[idxElement]])) <= nZoomEnd_[indexMap_[idxElement]])
-//                                              && (nZoomBegin_[indexMap_[idxElement]] <= ((*infoIndex_[indexMap_[idxElement]])(currentIndex[indexMap_[idxElement]])));
-//          }
-//        }
-//
-//        if (isIndexOnServer)
-//        {
-//          int actualIdx = (axisDomainOrder_(0)) ? currentIndex[0]+currentIndex[1]*nLocal_[0]
-//                                                : currentIndex[0];
-//          size_t globalIndex = (*infoIndex_[0])(actualIdx); //idxLoop[0] + nBeginGlobal_[0];
-//          size_t mulDim = 1;
-//          for (int idxElement = 0; idxElement < this->numElement_; ++idxElement)
-//          {
-//            if (axisDomainOrder_(idxElement))
-//            {
-//              actualIdx = currentIndex[indexMap_[idxElement]]+currentIndex[indexMap_[idxElement]+1]*nLocal_[indexMap_[idxElement]];
-//              int jb = (0 == idxElement) ? 1 : 0;
-//              for (int j = jb; j <= 1; ++j)
-//              {
-//                mulDim *= nGlob_[indexMap_[idxElement]+j-1];
-//                globalIndex += ((*infoIndex_[indexMap_[idxElement]+j])(actualIdx))*mulDim;
-//              }
-//            }
-//            else
-//            {
-//              if (0 != idxElement)
-//              {
-//                mulDim *= nGlob_[indexMap_[idxElement]-1];
-//                globalIndex += ((*infoIndex_[indexMap_[idxElement]])(currentIndex[indexMap_[idxElement]]))*mulDim;
-//              }
-//            }
-//          }
-//          globalLocalDataSendToServerMap_[globalIndex] = indexLocalDataOnClientCount;
-//          localMaskIndex_[indexSend2ServerCount] = gridMaskIndex;
-//          ++indexSend2ServerCount;
-//        }
-//        ++indexLocalDataOnClientCount;
-//      }
-//      ++countLocalData;
-//    }
-//    idxLoop[0] += innerLoopSize;
-//    idx += innerLoopSize;
-//  }
-//}
 
 /*!
Index: OS/trunk/src/transformation/transformation_mapping.cpp
===================================================================
--- /XIOS/trunk/src/transformation/transformation_mapping.cpp	(revision 869)
+++ 	(revision )
@@ -1,249 +1,0 @@
-/*!
-   \file transformation_mapping.cpp
-   \author Ha NGUYEN
-   \since 14 May 2015
-   \date 18 June 2015
-
-   \brief Take charge of communication among clients to exchange transformed data.
- */
-
-#include "transformation_mapping.hpp"
-#include <boost/unordered_map.hpp>
-#include "context.hpp"
-#include "context_client.hpp"
-#include "distribution_client.hpp"
-#include "client_client_dht_template.hpp"
-#include "dht_data_types.hpp"
-#include "mpi_tag.hpp"
-
-namespace xios {
-
-CTransformationMapping::CTransformationMapping(CGrid* destination, CGrid* source)
-  : gridSource_(source), gridDestination_(destination)
-{
-  CContext* context = CContext::getCurrent();
-  CContextClient* client=context->client;
-  int clientRank = client->clientRank;
-
-  CDistributionClient distributionClientSrc(client->clientRank, gridSource_);
-  const CDistributionClient::GlobalLocalDataMap& globalLocalIndexGridSrc = distributionClientSrc.getGlobalLocalDataSendToServer();
-  CDistributionClient::GlobalLocalDataMap::const_iterator itIndex = globalLocalIndexGridSrc.begin(), iteIndex = globalLocalIndexGridSrc.end();
-
-  // Mapping of global index and pair containing rank and local index
-  CClientClientDHTPairIntInt::Index2InfoTypeMap globalIndexOfClientSrc;
-  globalIndexOfClientSrc.rehash(std::ceil(globalLocalIndexGridSrc.size()/globalIndexOfClientSrc.max_load_factor()));
-
-  PairIntInt pairIntInt;
-  for (; itIndex != iteIndex; ++itIndex)
-  {
-    pairIntInt.first  = clientRank;
-    pairIntInt.second = itIndex->second;
-    globalIndexOfClientSrc[itIndex->first] = pairIntInt;
-  }
-
-  gridIndexClientClientMapping_ = new CClientClientDHTPairIntInt(globalIndexOfClientSrc,
-                                                                 client->intraComm);
-}
-
-CTransformationMapping::CTransformationMapping(CAxis* destination, CAxis* source)
-  : gridSource_(0), gridDestination_(0)
-{
-  CContext* context = CContext::getCurrent();
-  CContextClient* client=context->client;
-  int clientRank = client->clientRank;
-
-  int niSrc     = source->n.getValue();
-  int ibeginSrc = source->begin.getValue();
-
-  CClientClientDHTPairIntInt::Index2InfoTypeMap globalIndexOfAxisSource;
-  PairIntInt pii;
-  for (int idx = 0; idx < niSrc; ++idx)
-  {
-    pii.first  = clientRank;
-    pii.second = idx;
-    globalIndexOfAxisSource[idx+ibeginSrc] = pii; //std::make_pair(clientRank,idx);
-  }
-
-  gridIndexClientClientMapping_ = new CClientClientDHTPairIntInt(globalIndexOfAxisSource,
-                                                                 client->intraComm);
-}
-
-CTransformationMapping::~CTransformationMapping()
-{
-  if (0 != gridIndexClientClientMapping_) delete gridIndexClientClientMapping_;
-}
-
-/*!
-  Suppose that we have transformations between two grids, which are represented in form of mapping between global indexes of these two grids,
-this function tries to find out which clients a client needs to send and receive these global indexes to accomplish the transformations.
-  The grid destination is the grid whose global indexes demande global indexes from the other grid
-  Grid destination and grid source are also distributed among clients but in different manners.
-  \param [in] globaIndexWeightFromDestToSource mapping representing the transformations
-*/
-void CTransformationMapping::computeTransformationMapping(const DestinationIndexMap& globaIndexWeightFromDestToSource)
-{
-  CContext* context = CContext::getCurrent();
-  CContextClient* client=context->client;
-
-  DestinationIndexMap::const_iterator itbMap = globaIndexWeightFromDestToSource.begin(), itMap,
-                                      iteMap = globaIndexWeightFromDestToSource.end();
-
-  // Not only one index on grid destination can demande two indexes from grid source
-  // but an index on grid source has to be sent to two indexes of grid destination
-  size_t nbGlobalIndexSrc = 0;
-  for (itMap = itbMap; itMap != iteMap; ++itMap)
-  {
-    nbGlobalIndexSrc += (itMap->second).size();
-  }
-
-  CArray<size_t,1> globalIndexMap(nbGlobalIndexSrc);
-  std::vector<std::pair<int, std::pair<size_t,double> > >::const_iterator itbVecPair, itVecPair, iteVecPair;
-  size_t idxSrc = 0;
-  for (itMap = itbMap; itMap != iteMap; ++itMap)
-  {
-    itbVecPair = (itMap->second).begin();
-    iteVecPair = (itMap->second).end();
-    for (itVecPair = itbVecPair; itVecPair != iteVecPair; ++itVecPair)
-    {
-      globalIndexMap(idxSrc) = itVecPair->second.first;
-      ++idxSrc;
-    }
-  }
-
-  // Find out on which clients the necessary indexes of grid source are.
-  gridIndexClientClientMapping_->computeIndexInfoMapping(globalIndexMap);
-  const CClientClientDHTPairIntInt::Index2InfoTypeMap& globalIndexSentFromGridSource = gridIndexClientClientMapping_->getInfoIndexMap();
-  CClientClientDHTPairIntInt::Index2InfoTypeMap::const_iterator itbMapSrc = globalIndexSentFromGridSource.begin(), itMapSrc,
-                                                                iteMapSrc = globalIndexSentFromGridSource.end();
-  size_t currentIndexSrc;
-  int nbClient = client->clientSize;
-  std::vector<int> nbIndexEachClient(nbClient,0);
-  std::vector<int> sendNbClientBuff(nbClient,0);
-  for (idxSrc = 0; idxSrc < nbGlobalIndexSrc; ++idxSrc)
-  {
-    currentIndexSrc = globalIndexMap(idxSrc);
-    itMapSrc = globalIndexSentFromGridSource.find(currentIndexSrc);
-    if (iteMapSrc != itMapSrc)
-    {
-      ++nbIndexEachClient[itMapSrc->second.first];
-    }
-  }
-
-  boost::unordered_map<int,size_t* > sendIndexMap;
-  for (int idx = 0; idx < nbClient; ++idx)
-  {
-    if (0 != nbIndexEachClient[idx])
-    {
-      globalIndexReceivedOnGridDestMapping_[idx].resize(nbIndexEachClient[idx]);
-      sendIndexMap[idx] = new unsigned long [2*nbIndexEachClient[idx]];
-      nbIndexEachClient[idx] = 0;
-      sendNbClientBuff[idx] = 1;
-    }
-  }
-
-  int srcRank;
-  for (itMap = itbMap; itMap != iteMap; ++itMap)
-  {
-    itbVecPair = (itMap->second).begin();
-    iteVecPair = (itMap->second).end();
-    for (itVecPair = itbVecPair; itVecPair != iteVecPair; ++itVecPair)
-    {
-      currentIndexSrc = itVecPair->second.first;
-      itMapSrc = globalIndexSentFromGridSource.find(currentIndexSrc);
-      if (iteMapSrc != itMapSrc)
-      {
-        srcRank = (itMapSrc->second).first;
-        int& ind = nbIndexEachClient[srcRank];
-        globalIndexReceivedOnGridDestMapping_[srcRank][ind] = ReceivedIndex(itVecPair->first, itMap->first, itVecPair->second.second);
-        sendIndexMap[srcRank][2*ind] = (itMapSrc->second).second;
-        sendIndexMap[srcRank][2*ind+1] = itMapSrc->first;
-        ++ind;
-      }
-    }
-  }
-
-  std::vector<int> recvNbClientBuff(nbClient,0);
-  MPI_Allreduce(&sendNbClientBuff[0], &recvNbClientBuff[0], nbClient, MPI_INT, MPI_SUM, client->intraComm);
-  int numClientToReceive = recvNbClientBuff[client->clientRank];
-
-  // Then specify the size of receiving buffer, because we use synch send/receive so only necessary to know maximum size
-  std::vector<int> recvIndexBuff(nbClient,0);
-  MPI_Allreduce(&nbIndexEachClient[0], &recvIndexBuff[0], nbClient, MPI_INT, MPI_MAX, client->intraComm);
-  std::vector<size_t>::const_iterator itbVec, itVec, iteVec;
-
-  int buffSize = 2*recvIndexBuff[client->clientRank]; // we send global as well as local index
-  unsigned long* recvBuffGlobalIndex;
-  if (0 != buffSize) recvBuffGlobalIndex = new unsigned long [buffSize];
-
-  std::map<int, MPI_Request> requests;
-
-  // Inform all "source clients" about index that they need to send
-  boost::unordered_map<int,size_t* >::const_iterator itSendIndex = sendIndexMap.begin(),
-                                                     iteSendIndex= sendIndexMap.end();
-  for (; itSendIndex != iteSendIndex; ++itSendIndex)
-  {
-    MPI_Isend((itSendIndex->second),
-              2*nbIndexEachClient[itSendIndex->first],
-              MPI_UNSIGNED_LONG,
-              (itSendIndex->first),
-              MPI_TRANSFORMATION_MAPPING_INDEX,
-              client->intraComm,
-              &requests[(itSendIndex->first)]);
-  }
-
-  // Now all the "source clients" try listening messages from other "destination clients"
-  int numClientReceived = 0;  // number of client to which data has been already sent
-  int countBuff;
-  while (numClientReceived < numClientToReceive)
-  {
-    MPI_Status status;
-    MPI_Recv(recvBuffGlobalIndex,
-             buffSize,
-             MPI_UNSIGNED_LONG,
-             MPI_ANY_SOURCE,
-             MPI_TRANSFORMATION_MAPPING_INDEX,
-             client->intraComm,
-             &status);
-
-    MPI_Get_count(&status, MPI_UNSIGNED_LONG, &countBuff);
-    int clientDestRank = status.MPI_SOURCE;
-    int sizeMap = countBuff/2;
-    globalIndexSendToGridDestMapping_[clientDestRank].resize(sizeMap);
-    for (int idx = 0, i = 0; idx < countBuff; idx += 2, ++i)
-    {
-      globalIndexSendToGridDestMapping_[clientDestRank][i].first = recvBuffGlobalIndex[idx];
-      globalIndexSendToGridDestMapping_[clientDestRank][i].second = recvBuffGlobalIndex[idx+1];
-    }
-    ++numClientReceived;
-  }
-
-  std::map<int, MPI_Request>::iterator itRequest;
-  for (itRequest = requests.begin(); itRequest != requests.end(); ++itRequest)
-    MPI_Wait(&itRequest->second, MPI_STATUS_IGNORE);
-
-  if (0 != buffSize) delete [] recvBuffGlobalIndex;
-  for (itSendIndex = sendIndexMap.begin(); itSendIndex != iteSendIndex; ++itSendIndex)
-    delete [] itSendIndex->second;
-}
-
-/*!
-  Return (grid) global index on grid destination. This mapping contains the rank of client source (that sends info to grid destination)
-and the corresponding global index to write on grid destination.
-  \return global index mapping to receive on grid destination
-*/
-const CTransformationMapping::ReceivedIndexMap& CTransformationMapping::getGlobalIndexReceivedOnGridDestMapping() const
-{
-  return globalIndexReceivedOnGridDestMapping_;
-}
-
-/*!
-  Return (grid) global index on grid source. This mapping contains the rank of client destination (which receives transformation info) and
-the corresponding global index to send
-  \return global index mapping to send on grid source
-*/
-const CTransformationMapping::SentIndexMap& CTransformationMapping::getGlobalIndexSendToGridDestMapping() const
-{
-  return globalIndexSendToGridDestMapping_;
-}
-
-}
Index: OS/trunk/src/transformation/transformation_mapping.hpp
===================================================================
--- /XIOS/trunk/src/transformation/transformation_mapping.hpp	(revision 869)
+++ 	(revision )
@@ -1,68 +1,0 @@
-/*!
-   \file transformation_mapping.hpp
-   \author Ha NGUYEN
-   \since 14 May 2015
-   \date 09 June 2015
-
-   \brief Take charge of communication among clients to exchange transformed data.
- */
-#ifndef __XIOS_TRANSFORMATION_MAPPING_HPP__
-#define __XIOS_TRANSFORMATION_MAPPING_HPP__
-
-#include <map>
-#include <set>
-#include "grid.hpp"
-#include "axis.hpp"
-#include "array_new.hpp"
-#include "client_server_mapping_distributed.hpp"
-
-namespace xios {
-
-/*!
-  \class CTransformationMapping
-  This class is in charge of transfer the global index form grid from grid source to grid destination in a rather generic way.
-In order to make a transformation, the grid destination will make a request to grid source about the global indexes which it needs.
-The same discovering algorithm as the case of client-server is applied to find the corresponding client which contains the demanding global index.
-*/
-class CTransformationMapping
-{
-public:
-  typedef boost::unordered_map<size_t, std::vector<std::pair<int, std::pair<size_t,double> > > > DestinationIndexMap;
-  struct ReceivedIndex {
-    ReceivedIndex(int l, size_t g, double w) : localIndex(l),globalIndex(g), weight(w) {}
-    ReceivedIndex() : localIndex(0), globalIndex(0), weight(0.0) {}
-    int localIndex;
-    size_t globalIndex;
-    double weight;
-  };
-
-  typedef boost::unordered_map<int,std::vector<ReceivedIndex> > ReceivedIndexMap;
-  typedef boost::unordered_map<int,std::vector<std::pair<int, size_t> > > SentIndexMap;
-
-public:
-  /** Default constructor */
-  CTransformationMapping(CGrid* destination, CGrid* source);
-  CTransformationMapping(CAxis* destination, CAxis* source);
-
-  ~CTransformationMapping();
-
-  void computeTransformationMapping(const DestinationIndexMap& globaIndexMapFromDestToSource);
-  const ReceivedIndexMap& getGlobalIndexReceivedOnGridDestMapping() const;
-  const SentIndexMap& getGlobalIndexSendToGridDestMapping() const;
-
-protected:
-  CGrid* gridSource_;  // Grid source
-  CGrid* gridDestination_; // Grid destination demande the necessary global index from grid source
-
-  //! Global index mapping of grid source and grid destination between two clients
-  CClientClientDHTPairIntInt* gridIndexClientClientMapping_;
-
-  //! Mapping of client rank of grid source and global index received in grid destination
-  ReceivedIndexMap globalIndexReceivedOnGridDestMapping_;
-
-  //! Mapping of client rank of grid destination and global index to send from grid source
-  SentIndexMap globalIndexSendToGridDestMapping_;
-};
-
-}
-#endif // __XIOS_TRANSFORMATION_MAPPING_HPP__
