Index: XIOS/dev/branch_openmp/extern/remap/src/mapper.hpp
===================================================================
--- XIOS/dev/branch_openmp/extern/remap/src/mapper.hpp	(revision 1354)
+++ XIOS/dev/branch_openmp/extern/remap/src/mapper.hpp	(revision 1355)
@@ -18,5 +18,10 @@
 {
 public:
-       Mapper(ep_lib::MPI_Comm comm) : communicator(comm), verbose(SILENT), neighbourElements(NULL), sstree(comm) {}
+       //Mapper(ep_lib::MPI_Comm comm) : communicator(comm), verbose(SILENT), neighbourElements(NULL), sstree(comm) {}
+       Mapper(ep_lib::MPI_Comm comm) : verbose(SILENT), neighbourElements(NULL), sstree(comm) 
+       {
+         ep_lib::MPI_Comm_dup(comm, &communicator);
+       }
+
        ~Mapper();
        void setVerbosity(verbosity v) {verbose=v ;}
Index: XIOS/dev/branch_openmp/extern/remap/src/mpi_cascade.hpp
===================================================================
--- XIOS/dev/branch_openmp/extern/remap/src/mpi_cascade.hpp	(revision 1354)
+++ XIOS/dev/branch_openmp/extern/remap/src/mpi_cascade.hpp	(revision 1355)
@@ -12,6 +12,7 @@
 {
 public:
-  CCascadeLevel(ep_lib::MPI_Comm comm) : comm(comm)
+  CCascadeLevel(ep_lib::MPI_Comm in_comm) : comm(in_comm)
   {
+    ep_lib::MPI_Comm_dup(in_comm, &comm);
     ep_lib::MPI_Comm_size(comm, &size);
     ep_lib::MPI_Comm_rank(comm, &rank);
Index: XIOS/dev/branch_openmp/extern/remap/src/parallel_tree.cpp
===================================================================
--- XIOS/dev/branch_openmp/extern/remap/src/parallel_tree.cpp	(revision 1354)
+++ XIOS/dev/branch_openmp/extern/remap/src/parallel_tree.cpp	(revision 1355)
@@ -121,10 +121,11 @@
 }
 
-//CParallelTree::CParallelTree(MPI_Comm comm) : communicator(comm), cascade(MIN_NODE_SZ*MIN_NODE_SZ, comm)
-CParallelTree::CParallelTree(MPI_Comm comm) : communicator(comm), cascade(MAX_NODE_SZ*MAX_NODE_SZ*2, comm)
-{
-	treeCascade.reserve(cascade.num_levels);
-	for (int lev = 0; lev < cascade.num_levels; lev++)
-		treeCascade.push_back(CSampleTree(cascade.level[lev].group_size, assignLevel));
+//CParallelTree::CParallelTree(MPI_Comm comm) : communicator(comm), cascade(MIN_NODE_SZ*MIN_NODE_SZ*2, comm)
+CParallelTree::CParallelTree(MPI_Comm comm) : cascade(MAX_NODE_SZ*MAX_NODE_SZ*2, comm)
+{
+  MPI_Comm_dup(comm, &communicator);
+  treeCascade.reserve(cascade.num_levels);
+  for (int lev = 0; lev < cascade.num_levels; lev++)
+    treeCascade.push_back(CSampleTree(cascade.level[lev].group_size, assignLevel));
 }
 
Index: XIOS/dev/branch_openmp/extern/src_ep_dev/ep_create.cpp
===================================================================
--- XIOS/dev/branch_openmp/extern/src_ep_dev/ep_create.cpp	(revision 1354)
+++ XIOS/dev/branch_openmp/extern/src_ep_dev/ep_create.cpp	(revision 1355)
@@ -179,5 +179,5 @@
   
   
-  int MPI_Comm_create_endpoints(void* base_comm_ptr, int num_ep, MPI_Info info, MPI_Comm *& out_comm_hdls)
+  int MPI_Comm_create_endpoints(int* base_comm_ptr, int num_ep, MPI_Info info, MPI_Comm *& out_comm_hdls)
   {
 
@@ -199,6 +199,6 @@
       out_comm_hdls[idx].is_ep = true;
       out_comm_hdls[idx].is_intercomm = false;
-      out_comm_hdls[idx].ep_comm_ptr = new ep_communicator;
-      out_comm_hdls[idx].mpi_comm = base_comm_ptr;
+      out_comm_hdls[idx].ep_comm_ptr = new ep_communicator;     
+      *(out_comm_hdls[idx].mpi_comm) = *base_comm_ptr;
       out_comm_hdls[idx].ep_comm_ptr->comm_list = out_comm_hdls;
       out_comm_hdls[idx].ep_comm_ptr->comm_label = 0;
Index: XIOS/dev/branch_openmp/extern/src_ep_dev/ep_fortran.cpp
===================================================================
--- XIOS/dev/branch_openmp/extern/src_ep_dev/ep_fortran.cpp	(revision 1354)
+++ XIOS/dev/branch_openmp/extern/src_ep_dev/ep_fortran.cpp	(revision 1355)
@@ -18,9 +18,9 @@
     Debug("MPI_Comm_c2f");
     int fint;
-    #ifdef _intelmpi
+    //#ifdef _intelmpi
     fint = (::MPI_Fint)(to_mpi_comm(comm.mpi_comm));
-    #elif _openmpi
-    fint = ::MPI_Comm_c2f(to_mpi_comm(comm.mpi_comm));
-    #endif
+    //#elif _openmpi
+    //fint = ::MPI_Comm_c2f(to_mpi_comm(comm.mpi_comm));
+    //#endif
     
     std::map<std::pair<int, int>, MPI_Comm > ::iterator it;
@@ -60,12 +60,12 @@
        
       
-    #ifdef _openmpi
-    ::MPI_Comm base_comm = ::MPI_Comm_f2c(comm);
-    #elif _intelmpi
+    //#ifdef _openmpi
+    //::MPI_Comm base_comm = ::MPI_Comm_f2c(comm);
+    //#elif _intelmpi
     ::MPI_Comm *base_comm = new ::MPI_Comm;
     *base_comm = (::MPI_Comm)(comm);
-    #endif
+    //#endif
 
-    if(base_comm != static_cast< ::MPI_Comm* >(MPI_COMM_NULL.mpi_comm))
+    if(*base_comm != to_mpi_comm(MPI_COMM_NULL.mpi_comm))
     {
       if(omp_get_thread_num() == 0)
Index: XIOS/dev/branch_openmp/extern/src_ep_dev/ep_intercomm_world.cpp
===================================================================
--- XIOS/dev/branch_openmp/extern/src_ep_dev/ep_intercomm_world.cpp	(revision 1354)
+++ XIOS/dev/branch_openmp/extern/src_ep_dev/ep_intercomm_world.cpp	(revision 1355)
@@ -538,5 +538,5 @@
 
   // #elif _intelmpi
-  int MPI_Intercomm_create_from_world(MPI_Comm local_comm, int local_leader, void* peer_comm_ptr, int mpi_remote_leader, int tag, MPI_Comm *newintercomm)
+  int MPI_Intercomm_create_from_world(MPI_Comm local_comm, int local_leader, int* peer_comm_ptr, int mpi_remote_leader, int tag, MPI_Comm *newintercomm)
   {
     int ep_rank, ep_rank_loc, mpi_rank;
Index: XIOS/dev/branch_openmp/extern/src_ep_dev/ep_lib.cpp
===================================================================
--- XIOS/dev/branch_openmp/extern/src_ep_dev/ep_lib.cpp	(revision 1354)
+++ XIOS/dev/branch_openmp/extern/src_ep_dev/ep_lib.cpp	(revision 1355)
@@ -246,7 +246,7 @@
 }
 
-MPI_Comm to_mpi_comm(void* comm)
+MPI_Comm to_mpi_comm(int* comm)
 {
-  return *(static_cast< MPI_Comm* >(comm));
+  return static_cast< MPI_Comm >(*comm);
 }  
 
Index: XIOS/dev/branch_openmp/extern/src_ep_dev/ep_lib.hpp
===================================================================
--- XIOS/dev/branch_openmp/extern/src_ep_dev/ep_lib.hpp	(revision 1354)
+++ XIOS/dev/branch_openmp/extern/src_ep_dev/ep_lib.hpp	(revision 1355)
@@ -11,15 +11,15 @@
 namespace ep_lib
 {
-#ifdef _intelmpi
+//#ifdef _intelmpi
   typedef int MPI_Datatype;
   typedef int MPI_Op;
-  #define EP_ANY_SOURCE -2 
-  #define EP_ANY_TAG -1 
-#elif _openmpi
-  typedef void* MPI_Datatype;
-  typedef void* MPI_Op;
-  #define EP_ANY_SOURCE -1 
-  #define EP_ANY_TAG -1 
-#endif
+//  #define EP_ANY_SOURCE -2 
+//  #define EP_ANY_TAG -1 
+//#elif _openmpi
+//  typedef void* MPI_Datatype;
+//  typedef void* MPI_Op;
+//  #define EP_ANY_SOURCE -1 
+//  #define EP_ANY_TAG -1 
+//#endif
 
   int MPI_Init_thread(int* argc, char*** argv, int required, int*provided);
@@ -49,5 +49,5 @@
   // #endif
   
-  int MPI_Comm_create_endpoints(void* base_comm_ptr, int num_ep, MPI_Info info, MPI_Comm *& out_comm_hdls); // from EP to create endpoints
+  int MPI_Comm_create_endpoints(int* base_comm_ptr, int num_ep, MPI_Info info, MPI_Comm *& out_comm_hdls); // from EP to create endpoints
 
   int MPI_Send(void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm);
Index: XIOS/dev/branch_openmp/extern/src_ep_dev/ep_lib_intercomm.hpp
===================================================================
--- XIOS/dev/branch_openmp/extern/src_ep_dev/ep_lib_intercomm.hpp	(revision 1354)
+++ XIOS/dev/branch_openmp/extern/src_ep_dev/ep_lib_intercomm.hpp	(revision 1355)
@@ -41,5 +41,5 @@
   // #endif
 
-  int MPI_Intercomm_create_from_world(MPI_Comm local_comm, int local_leader, void* peer_comm_ptr, int mpi_remote_leader, int tag, MPI_Comm *newintercomm);
+  int MPI_Intercomm_create_from_world(MPI_Comm local_comm, int local_leader, int* peer_comm_ptr, int mpi_remote_leader, int tag, MPI_Comm *newintercomm);
   
   int MPI_Intercomm_create_unique_leader(MPI_Comm local_comm, int local_leader, MPI_Comm peer_comm, int remote_leader, int tag, MPI_Comm *newintercomm);
Index: XIOS/dev/branch_openmp/extern/src_ep_dev/ep_message.cpp
===================================================================
--- XIOS/dev/branch_openmp/extern/src_ep_dev/ep_message.cpp	(revision 1354)
+++ XIOS/dev/branch_openmp/extern/src_ep_dev/ep_message.cpp	(revision 1355)
@@ -38,5 +38,5 @@
       
 
-      #ifdef _openmpi
+      //#ifdef _openmpi
       #pragma omp critical (_mpi_call)
       {
@@ -51,19 +51,17 @@
         }
       }
-      #elif _intelmpi
-      #pragma omp critical (_mpi_call)
-      {
-        ::MPI_Iprobe(MPI_ANY_SOURCE, MPI_ANY_TAG, to_mpi_comm(comm.mpi_comm), &flag, &status);
-        if(flag)
-        {
-          Debug("find message in mpi comm \n");
-          mpi_source = status.MPI_SOURCE;
-          int tag = status.MPI_TAG;
-          ::MPI_Mprobe(mpi_source, tag, to_mpi_comm(comm.mpi_comm), &message, &status);
-
-        }
-      }
-      //::MPI_Improbe(MPI_ANY_SOURCE, MPI_ANY_TAG, to_mpi_comm(comm.mpi_comm), &flag, &message, &status); 
-      #endif
+      //#elif _intelmpi
+      //#pragma omp critical (_mpi_call)
+      //{
+      //  ::MPI_Iprobe(MPI_ANY_SOURCE, MPI_ANY_TAG, to_mpi_comm(comm.mpi_comm), &flag, &status);
+      //  if(flag)
+      //  {
+      //    Debug("find message in mpi comm \n");
+      //    mpi_source = status.MPI_SOURCE;
+      //    int tag = status.MPI_TAG;
+      //    ::MPI_Mprobe(mpi_source, tag, to_mpi_comm(comm.mpi_comm), &message, &status);
+      //  }
+      //}
+      //#endif
       
       if(flag)
@@ -118,5 +116,5 @@
       Debug("Message probing for intracomm\n");
 
-      #ifdef _openmpi
+      //#ifdef _openmpi
       #pragma omp critical (_mpi_call)
       {
@@ -131,19 +129,5 @@
         }
       }
-      #elif _intelmpi
-      #pragma omp critical (_mpi_call)
-      {
-        ::MPI_Iprobe(MPI_ANY_SOURCE, MPI_ANY_TAG, to_mpi_comm(comm.ep_comm_ptr->intercomm->mpi_inter_comm), &flag, &status);
-        if(flag)
-        {
-          Debug("find message in mpi comm \n");
-          mpi_source = status.MPI_SOURCE;
-          int tag = status.MPI_TAG;
-          ::MPI_Mprobe(mpi_source, tag, to_mpi_comm(comm.ep_comm_ptr->intercomm->mpi_inter_comm), &message, &status);
-
-        }
-      }
-      //::MPI_Improbe(MPI_ANY_SOURCE, MPI_ANY_TAG, to_mpi_comm(comm.ep_comm_ptr->intercomm->mpi_inter_comm), &flag, &message, &status);       
-      #endif
+      
 
       if(flag)
@@ -185,5 +169,5 @@
       Debug("Message probing for intracomm\n");
      
-      #ifdef _openmpi
+      //#ifdef _openmpi
       #pragma omp critical (_mpi_call)
       {
@@ -198,19 +182,5 @@
         }
       }
-      #elif _intelmpi
-      #pragma omp critical (_mpi_call)
-      {
-        ::MPI_Iprobe(MPI_ANY_SOURCE, MPI_ANY_TAG, to_mpi_comm(comm.mpi_comm), &flag, &status);
-        if(flag)
-        {
-          Debug("find message in mpi comm \n");
-          mpi_source = status.MPI_SOURCE;
-          int tag = status.MPI_TAG;
-          ::MPI_Mprobe(mpi_source, tag, to_mpi_comm(comm.mpi_comm), &message, &status);
-
-        }
-      }
-      //::MPI_Improbe(MPI_ANY_SOURCE, MPI_ANY_TAG, to_mpi_comm(comm.mpi_comm), &flag, &message, &status);       
-      #endif
+      
 
       if(flag)
Index: XIOS/dev/branch_openmp/extern/src_ep_dev/ep_mpi.hpp
===================================================================
--- XIOS/dev/branch_openmp/extern/src_ep_dev/ep_mpi.hpp	(revision 1354)
+++ XIOS/dev/branch_openmp/extern/src_ep_dev/ep_mpi.hpp	(revision 1355)
@@ -6,5 +6,5 @@
 MPI_Datatype to_mpi_type(ep_lib::MPI_Datatype type);
 MPI_Op       to_mpi_op(ep_lib::MPI_Op op);
-MPI_Comm     to_mpi_comm(void* comm);
+MPI_Comm     to_mpi_comm(int* comm);
 
 #endif // EP_MPI_HPP_INCLUDED
Index: XIOS/dev/branch_openmp/extern/src_ep_dev/ep_type.hpp
===================================================================
--- XIOS/dev/branch_openmp/extern/src_ep_dev/ep_type.hpp	(revision 1354)
+++ XIOS/dev/branch_openmp/extern/src_ep_dev/ep_type.hpp	(revision 1355)
@@ -57,14 +57,7 @@
     public:
 
-      #ifdef _intelmpi
       int ep_datatype;
-      #elif _openmpi
-      void * ep_datatype;
-      #endif
-      
       int ep_src;
       int ep_tag;
-
-      
       void* mpi_status;
   };
@@ -74,22 +67,11 @@
     public:
 
-      #ifdef _intelmpi
       int mpi_message;
-      #elif _openmpi
-      void * mpi_message;
-      #endif
-
       int ep_src;
       int ep_tag;
-
       void* mpi_status;
 
       MPI_Message() {}
-
-      #ifdef _intelmpi
       MPI_Message(int message): mpi_message(message) {}
-      #elif _openmpi
-      MPI_Message(void* message): mpi_message(message) {}
-      #endif
   };
 
@@ -152,12 +134,5 @@
     public:
 
-
-    // #ifdef _intelmpi
-    // int mpi_inter_comm;
-    // #elif _openmpi
-    // void * mpi_inter_comm;
-    // #endif
-
-    void * mpi_inter_comm;
+    int *mpi_inter_comm;
 
     RANK_MAP *intercomm_rank_map;
@@ -172,33 +147,8 @@
     int intercomm_tag;
 
-    ep_intercomm()
-    {
-      intercomm_rank_map = NULL;
-      local_rank_map = NULL;
-      remote_rank_map = NULL;
-    }
-
-
-    bool operator == (ep_intercomm right)
-    {
-      bool a = intercomm_rank_map == right.intercomm_rank_map;
-      bool b = local_rank_map == right.local_rank_map;
-      bool c = remote_rank_map == right.remote_rank_map;
-      bool d = mpi_inter_comm == right.mpi_inter_comm;
-      bool e = size_rank_info == right.size_rank_info;
-      bool f = intercomm_tag == right.intercomm_tag;
-      return a&&b&&c&&d&&e&&f;
-    }
-
-    bool operator != (ep_intercomm right)
-    {
-      bool a = intercomm_rank_map != right.intercomm_rank_map;
-      bool b = local_rank_map != right.local_rank_map;
-      bool c = remote_rank_map != right.remote_rank_map;
-      bool d = mpi_inter_comm != right.mpi_inter_comm;
-      bool e = size_rank_info != right.size_rank_info;
-      bool f = intercomm_tag != right.intercomm_tag;
-      return a||b||c||d||e||f;
-    }
+    ep_intercomm();
+    bool operator == (ep_intercomm right);
+    bool operator != (ep_intercomm right);
+    
 
 
@@ -224,27 +174,8 @@
     ep_intercomm *intercomm;
 
-    ep_communicator()
-    {
-      comm_list = NULL;
-      message_queue = NULL;
-      intercomm = NULL;
-    }
-
-    bool operator == (ep_communicator right)
-    {
-      bool a = size_rank_info == right.size_rank_info;
-      bool b = comm_label == right.comm_label;
-      bool c = intercomm == right.intercomm;
-      return a&&b&&c;
-    }
-
-    bool operator != (ep_communicator right)
-    {
-      bool a = size_rank_info != right.size_rank_info;
-      bool b = comm_label != right.comm_label;
-      bool c = intercomm != right.intercomm;
-      return a||b||c;
-    }
-
+    ep_communicator();
+    bool operator == (ep_communicator right);
+    bool operator != (ep_communicator right);
+    
   };
 
@@ -259,12 +190,4 @@
   {
     public:
-
-    // #ifdef _intelmpi
-    // int mpi_comm;
-    // #elif _openmpi
-    // void * mpi_comm;
-    // #endif
-
-    void * mpi_comm;
 
     bool is_ep;
@@ -274,92 +197,16 @@
     OMPbarrier *ep_barrier;
     RANK_MAP   *rank_map;
-
+    int* mpi_comm;
     EP_Comm ep_comm_ptr;
-
     MPI_Comm *mem_bridge;
-
-
-    // #ifdef _intelmpi
-    // int mpi_bridge;
-    // #elif _openmpi
-    // void * mpi_bridge;
-    // #endif
-
-    void * mpi_bridge;
-
-    MPI_Comm()
-    {
-      is_ep = true;
-      is_intercomm = false;
-      my_buffer = NULL;
-      ep_barrier = NULL;
-      rank_map = NULL;
-      ep_comm_ptr = NULL;
-      mem_bridge = NULL;
-      mpi_bridge = NULL;
-    }
-
-    // #ifdef _intelmpi
-    // MPI_Comm(int comm)
-    // {
-    //   is_ep = false;
-    //   is_intercomm = false;
-    //   my_buffer = NULL;
-    //   ep_barrier = NULL;
-    //   rank_map = NULL;
-    //   ep_comm_ptr = NULL;
-    //   mem_bridge = NULL;
-    //   mpi_bridge = NULL;
-    //   mpi_comm = comm;
-    // }
-
-    // #elif _openmpi
-
-    // MPI_Comm(void* comm)
-    // {
-    //   is_ep = false;
-    //   is_intercomm = false;
-    //   my_buffer = NULL;
-    //   ep_barrier = NULL;
-    //   rank_map = NULL;
-    //   ep_comm_ptr = NULL;
-    //   mem_bridge = NULL;
-    //   mpi_bridge = NULL;
-    //   mpi_comm = comm;
-    // }
-    // #endif
-    
-    MPI_Comm(void* comm)
-    {
-      is_ep = false;
-      is_intercomm = false;
-      my_buffer = NULL;
-      ep_barrier = NULL;
-      rank_map = NULL;
-      ep_comm_ptr = NULL;
-      mem_bridge = NULL;
-      mpi_bridge = NULL;
-      mpi_comm = comm;
-    }
-
-    bool operator == (MPI_Comm right)
-    {
-      bool a = is_ep == right.is_ep;
-      bool b = is_intercomm == right.is_intercomm;
-      bool c = mpi_comm == right.mpi_comm;
-      bool d = is_ep ? ep_comm_ptr == right.ep_comm_ptr : true;
-      return a&&b&&c&&d;
-    }
-
-    bool operator != (MPI_Comm right)
-    {
-      bool a = is_ep != right.is_ep;
-      bool b = is_intercomm != right.is_intercomm;
-      bool c = mpi_comm != right.mpi_comm;
-      bool d = is_ep ? ep_comm_ptr != right.ep_comm_ptr : true;
-
-      return a||b||c||d;
-    }
-
+    int* mpi_bridge;
+
+    MPI_Comm();  
+    //MPI_Comm(const MPI_Comm &comm);
+    MPI_Comm(int* comm);
+
+
+    bool operator == (MPI_Comm right);
+    bool operator != (MPI_Comm right);
     bool is_null();
 
@@ -371,17 +218,8 @@
     public:
 
-      #ifdef _intelmpi
       int mpi_info;
-      #elif _openmpi
-      void * mpi_info;
-      #endif
 
       MPI_Info(){ }
-      
-      #ifdef _intelmpi
       MPI_Info(int info): mpi_info(info) {}
-      #elif _openmpi
-      MPI_Info(void* info): mpi_info(info) {}
-      #endif
   };
 
@@ -391,9 +229,5 @@
     public:
 
-      #ifdef _intelmpi
       int mpi_request;
-      #elif _openmpi
-      void * mpi_request;
-      #endif
 
       int type;	//! type of the non-blocking communication. 1: Isend; 2:Irecv; 3:Imrecv; 4:Issend
@@ -402,31 +236,12 @@
       int ep_src;
       int ep_tag;
-      #ifdef _intelmpi
       int ep_datatype;
-      #elif _openmpi
-      void * ep_datatype;
-      #endif
 
       MPI_Comm comm;	//! EP communicator related to the communication
 
       MPI_Request() {}
-
-      #ifdef _intelmpi
       MPI_Request(int request): mpi_request(request) {}
-      #elif _openmpi
-      MPI_Request(void* request): mpi_request(request) {}
-      #endif
-
-
-    bool operator == (MPI_Request right)
-    {
-      //bool a = mpi_request == right.mpi_request;
-      bool b = type == right.type;
-      bool c = buf == right.buf;
-      bool d = ep_src == right.ep_src;
-      bool e = ep_tag == right.ep_tag;
-      bool f = ep_datatype == right.ep_datatype;
-      return b&&c&&d&&e&&f;
-    }
+      bool operator == (MPI_Request right);
+
   };
 
Index: XIOS/dev/branch_openmp/src/buffer_client.cpp
===================================================================
--- XIOS/dev/branch_openmp/src/buffer_client.cpp	(revision 1354)
+++ XIOS/dev/branch_openmp/src/buffer_client.cpp	(revision 1355)
@@ -15,7 +15,7 @@
   size_t CClientBuffer::maxRequestSize = 0;
 
-  CClientBuffer::CClientBuffer(MPI_Comm interComm, int serverRank, StdSize bufferSize, StdSize estimatedMaxEventSize, StdSize maxBufferedEvents)
-    : interComm(interComm)
-    , serverRank(serverRank)
+  CClientBuffer::CClientBuffer(MPI_Comm in_interComm, int serverRank, StdSize bufferSize, StdSize estimatedMaxEventSize, StdSize maxBufferedEvents): 
+    //interComm(interComm)
+    serverRank(serverRank)
     , bufferSize(bufferSize)
     , estimatedMaxEventSize(estimatedMaxEventSize)
@@ -27,4 +27,7 @@
     , pending(false)
   {
+    interComm = in_interComm;
+    *(interComm.mpi_comm) = *(in_interComm.mpi_comm);
+    *(interComm.ep_comm_ptr->intercomm->mpi_inter_comm) = *(in_interComm.ep_comm_ptr->intercomm->mpi_inter_comm);
     buffer[0] = new char[bufferSize]; // transform it with MPI_ALLOC_MEM later
     buffer[1] = new char[bufferSize];
Index: XIOS/dev/branch_openmp/src/buffer_client.hpp
===================================================================
--- XIOS/dev/branch_openmp/src/buffer_client.hpp	(revision 1354)
+++ XIOS/dev/branch_openmp/src/buffer_client.hpp	(revision 1355)
@@ -40,5 +40,5 @@
 
       CBufferOut* retBuffer;
-      const ep_lib::MPI_Comm interComm;
+      ep_lib::MPI_Comm interComm;
   };
 }
Index: XIOS/dev/branch_openmp/src/context_client.cpp
===================================================================
--- XIOS/dev/branch_openmp/src/context_client.cpp	(revision 1354)
+++ XIOS/dev/branch_openmp/src/context_client.cpp	(revision 1355)
@@ -27,4 +27,9 @@
       intraComm = intraComm_;
       interComm = interComm_;
+      *(intraComm.mpi_comm) = *(intraComm_.mpi_comm);
+      *(interComm.mpi_comm) = *(interComm_.mpi_comm);
+      *(interComm.ep_comm_ptr->intercomm->mpi_inter_comm) = *(interComm_.ep_comm_ptr->intercomm->mpi_inter_comm);
+      //MPI_Comm_dup(intraComm_, &intraComm);
+      //MPI_Comm_dup(interComm_, &interComm);
       MPI_Comm_rank(intraComm, &clientRank);
       MPI_Comm_size(intraComm, &clientSize);
Index: XIOS/dev/branch_openmp/src/cxios.cpp
===================================================================
--- XIOS/dev/branch_openmp/src/cxios.cpp	(revision 1354)
+++ XIOS/dev/branch_openmp/src/cxios.cpp	(revision 1355)
@@ -93,5 +93,5 @@
     {
       MPI_Comm *ep_comm;
-      MPI_Comm_create_endpoints(MPI_COMM_WORLD, num_ep, info, ep_comm);  // servers should reach here too.
+      MPI_Comm_create_endpoints(MPI_COMM_WORLD.mpi_comm, num_ep, info, ep_comm);  // servers should reach here too.
       passage = ep_comm;  
     }
Index: XIOS/dev/branch_openmp/src/io/inetcdf4.cpp
===================================================================
--- XIOS/dev/branch_openmp/src/io/inetcdf4.cpp	(revision 1354)
+++ XIOS/dev/branch_openmp/src/io/inetcdf4.cpp	(revision 1355)
@@ -23,6 +23,6 @@
     // even if Parallel NetCDF ends up being used.
     if (mpi)
-      //CNetCdfInterface::openPar(filename, NC_NOWRITE | NC_MPIIO, *comm, info_null, this->ncidp);
-      CNetCdfInterface::openPar(filename, NC_NOWRITE | NC_MPIIO, static_cast<MPI_Comm>(comm->mpi_comm), info_null.mpi_info, this->ncidp);
+      CNetCdfInterface::openPar(filename, NC_NOWRITE | NC_MPIIO, static_cast<MPI_Comm>(*(comm->mpi_comm)), info_null.mpi_info, this->ncidp);
+      //CNetCdfInterface::openPar(filename, NC_NOWRITE | NC_MPIIO, *(static_cast<MPI_Comm*>(comm->mpi_comm)), info_null.mpi_info, this->ncidp);
     else
       CNetCdfInterface::open(filename, NC_NOWRITE, this->ncidp);
Index: XIOS/dev/branch_openmp/src/io/onetcdf4.cpp
===================================================================
--- XIOS/dev/branch_openmp/src/io/onetcdf4.cpp	(revision 1354)
+++ XIOS/dev/branch_openmp/src/io/onetcdf4.cpp	(revision 1355)
@@ -58,5 +58,6 @@
             CTimer::get("Files : create").resume();
             if (wmpi)
-               CNetCdfInterface::createPar(filename, mode, static_cast<MPI_Comm>(comm->mpi_comm), info_null.mpi_info, this->ncidp);
+               CNetCdfInterface::createPar(filename, mode, static_cast<MPI_Comm>(*(comm->mpi_comm)), info_null.mpi_info, this->ncidp);
+               //CNetCdfInterface::createPar(filename, mode, *(static_cast<MPI_Comm*>(comm->mpi_comm)), info_null.mpi_info, this->ncidp);
             else
                CNetCdfInterface::create(filename, mode, this->ncidp);
@@ -70,5 +71,6 @@
             CTimer::get("Files : open").resume();
             if (wmpi)
-               CNetCdfInterface::openPar(filename, mode, static_cast<MPI_Comm>(comm->mpi_comm), info_null.mpi_info, this->ncidp);
+               CNetCdfInterface::openPar(filename, mode, static_cast<MPI_Comm>(*(comm->mpi_comm)), info_null.mpi_info, this->ncidp);
+               //CNetCdfInterface::openPar(filename, mode, *(static_cast<MPI_Comm*>(comm->mpi_comm)), info_null.mpi_info, this->ncidp);
             else
                CNetCdfInterface::open(filename, mode, this->ncidp);
