Index: XIOS/dev/branch_openmp/src/filter/spatial_transform_filter.cpp
===================================================================
--- XIOS/dev/branch_openmp/src/filter/spatial_transform_filter.cpp	(revision 1545)
+++ XIOS/dev/branch_openmp/src/filter/spatial_transform_filter.cpp	(revision 1642)
@@ -1,3 +1,2 @@
-#include "mpi.hpp"
 #include "spatial_transform_filter.hpp"
 #include "grid_transformation.hpp"
@@ -5,5 +4,4 @@
 #include "context_client.hpp"
 #include "timer.hpp"
-using namespace ep_lib;
 
 namespace xios
@@ -70,8 +68,4 @@
       onOutputReady(outputPacket);
   }
-
-
-
-
 
   CSpatialTemporalFilter::CSpatialTemporalFilter(CGarbageCollector& gc, CSpatialTransformFilterEngine* engine, CGridTransformation* gridTransformation, double outputValue, size_t inputSlotsCount)
@@ -142,5 +136,5 @@
   }
 
-  std::map<CGridTransformation*, std::shared_ptr<CSpatialTransformFilterEngine> > *CSpatialTransformFilterEngine::engines_ptr = 0;
+  std::map<CGridTransformation*, std::shared_ptr<CSpatialTransformFilterEngine> > CSpatialTransformFilterEngine::engines;
 
   CSpatialTransformFilterEngine* CSpatialTransformFilterEngine::get(CGridTransformation* gridTransformation)
@@ -149,13 +143,10 @@
       ERROR("CSpatialTransformFilterEngine& CSpatialTransformFilterEngine::get(CGridTransformation* gridTransformation)",
             "Impossible to get the requested engine, the grid transformation is invalid.");
-    
-    if(engines_ptr == NULL) engines_ptr = new std::map<CGridTransformation*, std::shared_ptr<CSpatialTransformFilterEngine> >;
-
-
-    std::map<CGridTransformation*, std::shared_ptr<CSpatialTransformFilterEngine> >::iterator it = engines_ptr->find(gridTransformation);
-    if (it == engines_ptr->end())
+
+    std::map<CGridTransformation*, std::shared_ptr<CSpatialTransformFilterEngine> >::iterator it = engines.find(gridTransformation);
+    if (it == engines.end())
     {
       std::shared_ptr<CSpatialTransformFilterEngine> engine(new CSpatialTransformFilterEngine(gridTransformation));
-      it = engines_ptr->insert(std::make_pair(gridTransformation, engine)).first;
+      it = engines.insert(std::make_pair(gridTransformation, engine)).first;
     }
 
@@ -206,5 +197,4 @@
     const std::list<CGridTransformation::RecvIndexGridDestinationMap>& listLocalIndexToReceive = gridTransformation->getLocalIndexToReceiveOnGridDest();
     const std::list<size_t>& listNbLocalIndexToReceive = gridTransformation->getNbLocalIndexToReceiveOnGridDest();
-    const std::list<std::vector<bool> >& listLocalIndexMaskOnDest = gridTransformation->getLocalMaskIndexOnGridDest();
     const std::vector<CGenericAlgorithmTransformation*>& listAlgos = gridTransformation->getAlgos();
 
@@ -215,8 +205,7 @@
     std::list<CGridTransformation::RecvIndexGridDestinationMap>::const_iterator itListRecv = listLocalIndexToReceive.begin();
     std::list<size_t>::const_iterator itNbListRecv = listNbLocalIndexToReceive.begin();
-    std::list<std::vector<bool> >::const_iterator itLocalMaskIndexOnDest = listLocalIndexMaskOnDest.begin();
     std::vector<CGenericAlgorithmTransformation*>::const_iterator itAlgo = listAlgos.begin();
 
-    for (; itListSend != iteListSend; ++itListSend, ++itListRecv, ++itNbListRecv, ++itLocalMaskIndexOnDest, ++itAlgo)
+    for (; itListSend != iteListSend; ++itListSend, ++itListRecv, ++itNbListRecv, ++itAlgo)
     {
       CArray<double,1> dataCurrentSrc(dataCurrentDest);
@@ -235,6 +224,5 @@
 
       idxSendBuff = 0;
-      std::vector<MPI_Request> sendRecvRequest(localIndexToSend.size() + itListRecv->size());
-      int position = 0;
+      std::vector<ep_lib::MPI_Request> sendRecvRequest;
       for (itSend = itbSend; itSend != iteSend; ++itSend, ++idxSendBuff)
       {
@@ -246,5 +234,6 @@
           sendBuff[idxSendBuff][idx] = dataCurrentSrc(localIndex_p(idx));
         }
-        MPI_Isend(sendBuff[idxSendBuff], countSize, MPI_DOUBLE, destRank, 12, client->intraComm, &sendRecvRequest[position++]);
+        sendRecvRequest.push_back(ep_lib::MPI_Request());
+        ep_lib::MPI_Isend(sendBuff[idxSendBuff], countSize, EP_DOUBLE, destRank, 12, client->intraComm, &sendRecvRequest.back());
       }
 
@@ -263,15 +252,13 @@
         int srcRank = itRecv->first;
         int countSize = itRecv->second.size();
-        MPI_Irecv(recvBuff + currentBuff, countSize, MPI_DOUBLE, srcRank, 12, client->intraComm, &sendRecvRequest[position++]);
+        sendRecvRequest.push_back(ep_lib::MPI_Request());
+        ep_lib::MPI_Irecv(recvBuff + currentBuff, countSize, EP_DOUBLE, srcRank, 12, client->intraComm, &sendRecvRequest.back());
         currentBuff += countSize;
       }
-      std::vector<MPI_Status> status(sendRecvRequest.size());
-      MPI_Waitall(sendRecvRequest.size(), &sendRecvRequest[0], &status[0]);
+      std::vector<ep_lib::MPI_Status> status(sendRecvRequest.size());
+      ep_lib::MPI_Waitall(sendRecvRequest.size(), &sendRecvRequest[0], &status[0]);
 
       dataCurrentDest.resize(*itNbListRecv);
-      const std::vector<bool>& localMaskDest = *itLocalMaskIndexOnDest;
-      for (int i = 0; i < localMaskDest.size(); ++i)
-        if (localMaskDest[i]) dataCurrentDest(i) = 0.0;
-        else dataCurrentDest(i) = defaultValue;
+      dataCurrentDest = 0.0;
 
       std::vector<bool> localInitFlag(dataCurrentDest.numElements(), true);
