Index: XIOS/dev/branch_openmp/extern/ep_dev/ep_barrier.hpp
===================================================================
--- XIOS/dev/branch_openmp/extern/ep_dev/ep_barrier.hpp	(revision 1502)
+++ XIOS/dev/branch_openmp/extern/ep_dev/ep_barrier.hpp	(revision 1502)
@@ -0,0 +1,65 @@
+#ifndef EP_BARRIER_HPP_INCLUDED
+#define EP_BARRIER_HPP_INCLUDED
+
+
+namespace ep_lib
+{
+
+  class ep_barrier
+  {
+    private:
+      int nbThreads;          //<The number of threads for this barrier
+      int currentNbThread;    //<The current number of threads waiting
+      bool sense;             //<Direct barrier feedback protection
+      omp_lock_t mutex;       //<To have an atomic int
+
+      ep_barrier(ep_barrier&){}
+      ep_barrier& operator=(ep_barrier&){return *this;}
+
+    public:
+      /** Constructor with the number of threads */
+      explicit ep_barrier(const int inNbThreads)
+          : nbThreads(inNbThreads), currentNbThread(0), sense(false) {
+          omp_init_lock( &mutex );
+      }
+
+      /** Destructor, release the omp lock */
+      ~ep_barrier(){
+          omp_destroy_lock( &mutex );
+      }
+
+      /** Perform a barrier */
+      void wait(){
+          const bool mySense = sense;
+          omp_set_lock( &mutex );
+          const int nbThreadsArrived = (++currentNbThread);
+          omp_unset_lock( &mutex );
+
+          if(nbThreadsArrived == nbThreads) {
+              currentNbThread = 0;
+              sense = !sense;
+              #pragma omp flush
+          }
+          else {
+              volatile const bool* const ptSense = &sense;
+              while( (*ptSense) == mySense){
+              }
+          }
+      }
+
+
+      /** Change the number of threads */
+      void setNbThreads(const int inNbThread){
+          omp_set_lock( &mutex );
+          nbThreads = inNbThread;
+          omp_unset_lock( &mutex );
+      }
+  };
+
+
+}
+
+
+
+#endif // EP_BARRIER_HPP_INCLUDED
+
Index: XIOS/dev/branch_openmp/extern/ep_dev/ep_buffer.hpp
===================================================================
--- XIOS/dev/branch_openmp/extern/ep_dev/ep_buffer.hpp	(revision 1502)
+++ XIOS/dev/branch_openmp/extern/ep_dev/ep_buffer.hpp	(revision 1502)
@@ -0,0 +1,19 @@
+#ifndef EP_BUFFER_HPP_INCLUDED
+#define EP_BUFFER_HPP_INCLUDED
+
+
+namespace ep_lib
+{
+
+  struct BUFFER
+  {
+    void * void_buffer[12];
+  };
+
+
+}
+
+
+
+#endif // EP_BUFFER_HPP_INCLUDED
+
Index: XIOS/dev/branch_openmp/extern/ep_dev/ep_comm.hpp
===================================================================
--- XIOS/dev/branch_openmp/extern/ep_dev/ep_comm.hpp	(revision 1502)
+++ XIOS/dev/branch_openmp/extern/ep_dev/ep_comm.hpp	(revision 1502)
@@ -0,0 +1,78 @@
+#ifndef EP_COMM_HPP_INCLUDED
+#define EP_COMM_HPP_INCLUDED
+
+#include "ep_message.hpp"
+#include "ep_intercomm.hpp"
+#include "ep_barrier.hpp"
+#include "ep_buffer.hpp"
+
+typedef std::pair< int, int > SIZE_RANK_INFO; // < rank, size>
+typedef std::vector< std::pair<int, int> > RANK_MAP;  // at(ep_rank) = <ep_rank_local, mpi_rank>
+typedef std::map<int, std::pair<int, int> > EP_RANK_MAP;  // key(ep_rank) = <ep_rank_local, mpi_rank>
+typedef std::vector<std::pair< std::pair<int, int>, std::pair<int, int> > > INTERCOMM_RANK_MAP;
+typedef std::list<ep_lib::MPI_Message > Message_list;
+
+namespace ep_lib
+{
+
+  class ep_comm;
+  
+  class ep_communicator
+  {
+    public:
+
+    SIZE_RANK_INFO size_rank_info[3]; // 0: ep_rank,     ep_size
+                                      // 1: ep_rank_loc, num_ep
+                                      // 2: mpi_rank,    mpi_size
+
+
+    ep_comm **comm_list;
+
+    Message_list *message_queue;
+
+
+    int comm_label;
+
+    ep_intercomm *intercomm;
+
+    ep_communicator();
+    bool operator == (ep_communicator right);
+    bool operator != (ep_communicator right);
+    
+  };
+  
+
+  class ep_comm
+  {
+    public:
+
+    bool is_ep;
+    bool is_intercomm;
+
+    BUFFER     *my_buffer;
+    ep_barrier *ep_barrier;
+    RANK_MAP   *rank_map;
+    void* mpi_comm;
+    ep_communicator *ep_comm_ptr;
+    ep_comm    **mem_bridge;
+    void* mpi_bridge;
+
+    ep_comm();  
+    ep_comm(void* comm);
+
+
+    bool operator == (ep_comm right);
+    bool operator != (ep_comm right);
+    bool is_null();
+
+  };
+  
+  typedef ep_comm*  MPI_Comm;
+
+
+}
+
+
+
+#endif // EP_COMM_HPP_INCLUDED
+
Index: XIOS/dev/branch_openmp/extern/ep_dev/ep_info.hpp
===================================================================
--- XIOS/dev/branch_openmp/extern/ep_dev/ep_info.hpp	(revision 1502)
+++ XIOS/dev/branch_openmp/extern/ep_dev/ep_info.hpp	(revision 1502)
@@ -0,0 +1,26 @@
+#ifndef EP_INFO_HPP_INCLUDED
+#define EP_INFO_HPP_INCLUDED
+
+
+namespace ep_lib
+{
+
+  class ep_info
+  {
+    public:
+
+      void* mpi_info;
+
+      ep_info();
+      ep_info(void* info);
+  };
+  
+  typedef ep_info* MPI_Info;
+
+
+}
+
+
+
+#endif // EP_INFO_HPP_INCLUDED
+
Index: XIOS/dev/branch_openmp/extern/ep_dev/ep_intercomm.hpp
===================================================================
--- XIOS/dev/branch_openmp/extern/ep_dev/ep_intercomm.hpp	(revision 1502)
+++ XIOS/dev/branch_openmp/extern/ep_dev/ep_intercomm.hpp	(revision 1502)
@@ -0,0 +1,44 @@
+#ifndef EP_INTERCOMM_HPP_INCLUDED
+#define EP_INTERCOMM_HPP_INCLUDED
+
+typedef std::pair< int, int > SIZE_RANK_INFO; // < rank, size>
+typedef std::vector< std::pair<int, int> > RANK_MAP;  // at(ep_rank) = <ep_rank_local, mpi_rank>
+typedef std::map<int, std::pair<int, int> > EP_RANK_MAP;  // key(ep_rank) = <ep_rank_local, mpi_rank>
+typedef std::vector<std::pair< std::pair<int, int>, std::pair<int, int> > > INTERCOMM_RANK_MAP;
+
+namespace ep_lib
+{
+
+  class ep_comm;
+
+  class ep_intercomm
+  {
+    public:
+
+    void *mpi_inter_comm;
+
+    RANK_MAP *intercomm_rank_map;
+    RANK_MAP *local_rank_map;
+    RANK_MAP *remote_rank_map;
+
+
+    SIZE_RANK_INFO size_rank_info[3];
+
+
+    ep_comm *local_comm;
+    int intercomm_tag;
+
+    ep_intercomm();
+    //~ep_intercomm(){delete mpi_inter_comm;}
+    bool operator == (ep_intercomm right);
+    bool operator != (ep_intercomm right);
+    
+  };
+
+
+}
+
+
+
+#endif // EP_INTERCOMM_HPP_INCLUDED
+
Index: XIOS/dev/branch_openmp/extern/ep_dev/ep_message.hpp
===================================================================
--- XIOS/dev/branch_openmp/extern/ep_dev/ep_message.hpp	(revision 1502)
+++ XIOS/dev/branch_openmp/extern/ep_dev/ep_message.hpp	(revision 1502)
@@ -0,0 +1,29 @@
+#ifndef EP_MESSAGE_HPP_INCLUDED
+#define EP_MESSAGE_HPP_INCLUDED
+
+
+namespace ep_lib
+{
+
+  class ep_message
+  {
+    public:
+
+      void* mpi_message;
+      int ep_src;
+      int ep_tag;
+      void* mpi_status;
+
+      ep_message() {}
+      ep_message(void* message);
+  };
+  
+  typedef ep_message* MPI_Message;
+
+
+}
+
+
+
+#endif // EP_MESSAGE_HPP_INCLUDED
+
Index: XIOS/dev/branch_openmp/extern/ep_dev/ep_request.hpp
===================================================================
--- XIOS/dev/branch_openmp/extern/ep_dev/ep_request.hpp	(revision 1502)
+++ XIOS/dev/branch_openmp/extern/ep_dev/ep_request.hpp	(revision 1502)
@@ -0,0 +1,45 @@
+#ifndef EP_REQUEST_HPP_INCLUDED
+#define EP_REQUEST_HPP_INCLUDED
+
+#include "ep_comm.hpp"
+
+namespace ep_lib
+{
+  
+  class ep_request
+  {
+    public:
+
+      void* mpi_request;
+
+      int type;	//! type of the non-blocking communication. 
+                // 1: Isend 
+                // 2:Irecv 
+                // 3:Imrecv 
+                // 4:Issend
+      int state; // 0: new 
+                 // 1: imrecvd
+                 // 2: tested or waited
+                   
+      void* buf;
+
+      int ep_src;
+      int ep_tag;
+      void* ep_datatype;
+
+      ep_comm *comm;	//! EP communicator related to the communication
+
+      ep_request() {}
+      ep_request(void* request);
+      bool operator == (ep_request right);
+  };
+  
+  typedef ep_request* MPI_Request;
+
+
+}
+
+
+
+#endif // EP_REQUEST_HPP_INCLUDED
+
Index: XIOS/dev/branch_openmp/extern/ep_dev/ep_window.hpp
===================================================================
--- XIOS/dev/branch_openmp/extern/ep_dev/ep_window.hpp	(revision 1502)
+++ XIOS/dev/branch_openmp/extern/ep_dev/ep_window.hpp	(revision 1502)
@@ -0,0 +1,26 @@
+#ifndef EP_WINDOW_HPP_INCLUDED
+#define EP_WINDOW_HPP_INCLUDED
+
+
+namespace ep_lib
+{
+
+  class ep_win
+  {
+    public:
+    bool is_ep;
+    MPI_Comm comm;
+
+    void* server_win[16];
+    void* client_win;
+    void* null_win[16];
+  };
+  
+  typedef ep_win* MPI_Win;
+
+}
+
+
+
+#endif // EP_WINDOW_HPP_INCLUDED
+
