Index: XIOS/dev/dev_trunk_omp/arch/arch-IRENE_omp.env
===================================================================
--- XIOS/dev/dev_trunk_omp/arch/arch-IRENE_omp.env	(revision 1605)
+++ XIOS/dev/dev_trunk_omp/arch/arch-IRENE_omp.env	(revision 1605)
@@ -0,0 +1,19 @@
+module unload netcdf-c netcdf-fortran hdf5 flavor perl hdf5 boost blitz mpi gnu
+module load gnu
+module load mpi/openmpi/2.0.2
+module load flavor/hdf5/parallel
+module load netcdf-fortran/4.4.4
+module load hdf5/1.8.20
+module load boost
+module load blitz
+module load feature/bridge/heterogenous_mpmd
+
+module unload netcdf
+module unload hdf5
+
+export HDF5_INC_DIR=$HOME/lib/hdf5_intel/include
+export HDF5_LIB_DIR=$HOME/lib/hdf5_intel/lib
+
+export NETCDF_INC_DIR=$HOME/lib/netcdf_intel/include
+export NETCDF_LIB_DIR=$HOME/lib/netcdf_intel/lib
+
Index: XIOS/dev/dev_trunk_omp/arch/arch-IRENE_omp.fcm
===================================================================
--- XIOS/dev/dev_trunk_omp/arch/arch-IRENE_omp.fcm	(revision 1605)
+++ XIOS/dev/dev_trunk_omp/arch/arch-IRENE_omp.fcm	(revision 1605)
@@ -0,0 +1,26 @@
+################################################################################
+###################                Projet XIOS               ###################
+################################################################################
+
+%CCOMPILER      mpicc -qopenmp -D_usingEP -D_openmpi -std=c++11
+%FCOMPILER      mpif90 -qopenmp
+%LINKER         mpif90 -qopenmp -nofor-main -Wl,-rpath -Wl,$HOME/lib/netcdf_f_intel/lib
+
+%BASE_CFLAGS    -std=c++11 -diag-disable 1125 -diag-disable 279
+%PROD_CFLAGS    -O3 -D BOOST_DISABLE_ASSERTS
+#%DEV_CFLAGS     -g -traceback
+%DEV_CFLAGS     -g 
+%DEBUG_CFLAGS   -DBZ_DEBUG -g -traceback -fno-inline
+
+%BASE_FFLAGS    -D__NONE__ 
+%PROD_FFLAGS    -O3
+#%DEV_FFLAGS     -g -traceback
+%DEV_FFLAGS     -g 
+%DEBUG_FFLAGS   -g -traceback
+
+%BASE_INC       -D__NONE__
+%BASE_LD        -lstdc++
+
+%CPP            mpicc -EP
+%FPP            cpp -P
+%MAKE           gmake
Index: XIOS/dev/dev_trunk_omp/arch/arch-IRENE_omp.path
===================================================================
--- XIOS/dev/dev_trunk_omp/arch/arch-IRENE_omp.path	(revision 1605)
+++ XIOS/dev/dev_trunk_omp/arch/arch-IRENE_omp.path	(revision 1605)
@@ -0,0 +1,29 @@
+NETCDF_INCDIR="-I $NETCDFC_INCDIR -I $NETCDFFORTRAN_INCDIR -I $NETCDF_INC_DIR -I $HOME/lib/netcdf_f_intel/include"
+NETCDF_LIBDIR="-L $NETCDFC_LIBDIR -L $NETCDFFORTRAN_LIBDIR -L $NETCDF_LIB_DIR -L $HOME/lib/netcdf_f_intel/lib"
+NETCDF_LIB="-lnetcdf -lnetcdff"
+
+MPI_INCDIR=""
+MPI_LIBDIR=""
+MPI_LIB=""
+
+HDF5_INCDIR=" -I $HDF5_INC_DIR"
+HDF5_LIBDIR=" -L $HDF5_LIB_DIR"
+HDF5_LIB="-lhdf5_hl -lhdf5 -lz -ldl -lcurl"
+#HDF5_LIB="-lz -ldl -lcurl"
+
+BOOST_INCDIR="-I $BOOST_INCDIR"
+BOOST_LIBDIR="-L $BOOST_LIBDIR"
+BOOST_LIB=""
+
+BLITZ_INCDIR="-I $BLITZ_INCDIR"
+BLITZ_LIBDIR="-L $BLITZ_LIBDIR"
+BLITZ_LIB=""
+
+OASIS_INCDIR="-I$PWD/../../oasis3-mct/BLD/build/lib/psmile.MPI1"
+OASIS_LIBDIR="-L$PWD/../../oasis3-mct/BLD/lib"
+OASIS_LIB="-lpsmile.MPI1 -lscrip -lmct -lmpeu"
+
+
+#only for MEMTRACK debuging : developper only
+ADDR2LINE_LIBDIR="-L${WORKDIR}/ADDR2LINE_LIB"
+ADDR2LINE_LIB="-laddr2line"
Index: XIOS/dev/dev_trunk_omp/bld.cfg
===================================================================
--- XIOS/dev/dev_trunk_omp/bld.cfg	(revision 1604)
+++ XIOS/dev/dev_trunk_omp/bld.cfg	(revision 1605)
@@ -41,9 +41,10 @@
 src::netcdf $PWD/extern/netcdf4
 src::remap $PWD/extern/remap/src
+src::src_ep_dev $PWD/extern/src_ep_dev
 bld::lib xios
 bld::target libxios.a 
 #bld::target generate_fortran_interface.exe 
 #bld::target test_remap.exe
-bld::target xios_server.exe 
+#bld::target xios_server.exe 
 #bld::target test_regular.exe
 #bld::target test_xios2_cmip6.exe
@@ -51,5 +52,7 @@
 #bld::target test_remap.exe
 #bld::target test_complete.exe
+bld::target test_complete_omp.exe
 #bld::target test_client.exe
+bld::target test_omp.exe
 #bld::target test_unstruct_complete.exe
 #bld::target test_unstructured.exe
@@ -80,2 +83,3 @@
 bld::excl_dep        use::netcdf
 bld::excl_dep        inc::mpif.h
+bld::excl_dep        use::omp_lib
Index: XIOS/dev/dev_trunk_omp/extern/ep_dev/Makefile
===================================================================
--- XIOS/dev/dev_trunk_omp/extern/ep_dev/Makefile	(revision 1605)
+++ XIOS/dev/dev_trunk_omp/extern/ep_dev/Makefile	(revision 1605)
@@ -0,0 +1,28 @@
+appname := EP_test
+
+CXX := mpiicc -D_intelmpi -D_noMemory_check -D_nocheck_sum -D_noshowinfo -qopenmp 
+CXXFLAGS := -std=c++11  -g
+
+srcfiles := $(shell find . -name "*.cpp")
+headfiles := $(shell find . -name "*.hpp")
+objects  := $(patsubst %.cpp, %.o, $(srcfiles))
+
+all: $(appname)
+
+$(appname): $(objects) $(headfiles)
+	$(CXX) $(CXXFLAGS) $(LDFLAGS) -o $(appname) $(objects) $(LDLIBS)
+
+depend: .depend
+
+.depend: $(srcfiles) 
+	rm -f ./.depend
+	$(CXX) $(CXXFLAGS) -MM $^>>./.depend;
+
+clean:
+	rm -f $(objects) $(appname)
+
+dist-clean: clean
+	rm -f *~ .depend
+
+include .depend
+
Index: XIOS/dev/dev_trunk_omp/extern/ep_dev/ep_create.cpp
===================================================================
--- XIOS/dev/dev_trunk_omp/extern/ep_dev/ep_create.cpp	(revision 1604)
+++ XIOS/dev/dev_trunk_omp/extern/ep_dev/ep_create.cpp	(revision 1605)
@@ -124,5 +124,6 @@
       for(int j=0; j<recv_num_ep[i]; j++)
       {
-        out_comm_hdls[0]->ep_rank_map->insert(std::pair< int, std::pair<int,int> >(ind, j, i));
+        //out_comm_hdls[0]->ep_rank_map->insert(std::pair< int, std::pair<int,int> >(ind, j, i));
+        (*(out_comm_hdls[0]->ep_rank_map))[ind] = std::make_pair(j, i);
         ind++;
       }
Index: XIOS/dev/dev_trunk_omp/extern/ep_dev/ep_split.cpp
===================================================================
--- XIOS/dev/dev_trunk_omp/extern/ep_dev/ep_split.cpp	(revision 1604)
+++ XIOS/dev/dev_trunk_omp/extern/ep_dev/ep_split.cpp	(revision 1605)
@@ -286,5 +286,6 @@
           for(int i=0; i<new_ep_size; i++)
           {
-            (*newcomm)->ep_comm_ptr->comm_list[0]->ep_rank_map->insert(std::pair< int, std::pair<int,int> >(my_triple_vector_recv[3*i], my_triple_vector_recv[3*i+1], my_triple_vector_recv[3*i+2]));
+            //(*newcomm)->ep_comm_ptr->comm_list[0]->ep_rank_map->insert(std::pair< int, std::pair<int,int> >(my_triple_vector_recv[3*i], my_triple_vector_recv[3*i+1], my_triple_vector_recv[3*i+2]));
+            (*((*newcomm)->ep_comm_ptr->comm_list[0]->ep_rank_map))[my_triple_vector_recv[3*i]] = std::make_pair( my_triple_vector_recv[3*i+1], my_triple_vector_recv[3*i+2]);
           }
           
Index: XIOS/dev/dev_trunk_omp/extern/src_ep_dev/ep_create.cpp
===================================================================
--- XIOS/dev/dev_trunk_omp/extern/src_ep_dev/ep_create.cpp	(revision 1604)
+++ XIOS/dev/dev_trunk_omp/extern/src_ep_dev/ep_create.cpp	(revision 1605)
@@ -124,5 +124,6 @@
       for(int j=0; j<recv_num_ep[i]; j++)
       {
-        out_comm_hdls[0]->ep_rank_map->insert(std::pair< int, std::pair<int,int> >(ind, j, i));
+        //out_comm_hdls[0]->ep_rank_map->insert(std::pair< int, std::pair<int,int> >(ind, j, i));
+        (*(out_comm_hdls[0]->ep_rank_map))[ind] = std::make_pair(j,i);//->insert(std::pair< int, std::pair<int,int> >(ind, j, i));
         ind++;
       }
Index: XIOS/dev/dev_trunk_omp/extern/src_ep_dev/ep_fortran.cpp
===================================================================
--- XIOS/dev/dev_trunk_omp/extern/src_ep_dev/ep_fortran.cpp	(revision 1604)
+++ XIOS/dev/dev_trunk_omp/extern/src_ep_dev/ep_fortran.cpp	(revision 1605)
@@ -8,26 +8,26 @@
 
 
-namespace ep_lib
-{
+//namespace ep_lib
+//{
 
-  void* EP_Comm_c2f(MPI_Comm comm)
+  void* EP_Comm_c2f(ep_lib::MPI_Comm comm)
   {
     Debug("MPI_Comm_c2f");
-    void* fint = new ::MPI_Fint;
+    void* fint = new MPI_Fint;
     #ifdef _intelmpi
     *static_cast< ::MPI_Fint*>(fint) = (::MPI_Fint)(to_mpi_comm(comm->mpi_comm));
     #elif _openmpi
-    *static_cast< ::MPI_Fint*>(fint) = MPI_Comm_c2f(to_mpi_comm(comm->mpi_comm));
+    *static_cast< MPI_Fint*>(fint) = MPI_Comm_c2f(to_mpi_comm(comm->mpi_comm));
     #endif
     
-    std::map<std::pair< ::MPI_Fint, int>, MPI_Comm > ::iterator it;
+    std::map<std::pair< MPI_Fint, int>, ep_lib::MPI_Comm > ::iterator it;
     
     #pragma omp critical (fc_comm_map)
     {
-      it = fc_comm_map.find(std::make_pair(*static_cast< ::MPI_Fint*>(fint), omp_get_thread_num()));
-      if(it == fc_comm_map.end())
+      it = ep_lib::fc_comm_map.find(std::make_pair(*static_cast< MPI_Fint*>(fint), omp_get_thread_num()));
+      if(it == ep_lib::fc_comm_map.end())
       {
-        fc_comm_map.insert(std::make_pair( std::make_pair( *static_cast< ::MPI_Fint*>(fint), omp_get_thread_num()) , comm));
-        printf("EP_Comm_c2f : MAP %p insert: %d, %d, %p\n", &fc_comm_map, *static_cast< ::MPI_Fint*>(fint), omp_get_thread_num(), comm->ep_comm_ptr);
+        ep_lib::fc_comm_map.insert(std::make_pair( std::make_pair( *static_cast< MPI_Fint*>(fint), omp_get_thread_num()) , comm));
+        printf("EP_Comm_c2f : MAP %p insert: %d, %d, %p\n", &(ep_lib::fc_comm_map), *static_cast< MPI_Fint*>(fint), omp_get_thread_num(), comm->ep_comm_ptr);
       }
     }
@@ -38,19 +38,19 @@
   }
 
-  MPI_Comm EP_Comm_f2c(void* comm)
+  ep_lib::MPI_Comm EP_Comm_f2c(void* comm)
   {
     Debug("MPI_Comm_f2c");
     
     
-    std::map<std::pair< ::MPI_Fint, int>, MPI_Comm > ::iterator it;
+    std::map<std::pair< MPI_Fint, int>, ep_lib::MPI_Comm > ::iterator it;
     
     #pragma omp critical (fc_comm_map)
-    it = fc_comm_map.find(std::make_pair(*static_cast< ::MPI_Fint*>(comm), omp_get_thread_num()));
+    it = ep_lib::fc_comm_map.find(std::make_pair(*static_cast< MPI_Fint*>(comm), omp_get_thread_num()));
     
-    if(it != fc_comm_map.end())
+    if(it != ep_lib::fc_comm_map.end())
     {
-      MPI_Comm comm_ptr;
+      ep_lib::MPI_Comm comm_ptr;
       comm_ptr = it->second;
-      printf("EP_Comm_f2c : MAP %p find: %d, %d, %p\n", &fc_comm_map, it->first.first, it->first.second, comm_ptr->ep_comm_ptr);
+      printf("EP_Comm_f2c : MAP %p find: %d, %d, %p\n", &(ep_lib::fc_comm_map), it->first.first, it->first.second, comm_ptr->ep_comm_ptr);
       return  comm_ptr;
     }
@@ -58,9 +58,9 @@
       
     
+    MPI_Comm *base_comm = new MPI_Comm;
     #ifdef _intelmpi
-    ::MPI_Comm *base_comm = new ::MPI_Comm;
-    *base_comm = (::MPI_Comm)(*static_cast< ::MPI_Fint*>(comm));
+    *base_comm = (MPI_Comm)(*static_cast< MPI_Fint*>(comm));
     #elif _openmpi
-    ::MPI_Comm *base_comm = ::MPI_Comm_f2c(*static_cast< ::MPI_Fint*>(comm));
+    *base_comm = MPI_Comm_f2c(*static_cast< MPI_Fint*>(comm));
     #endif
 
@@ -70,12 +70,12 @@
       {
         int num_ep = omp_get_num_threads();
-        MPI_Comm *new_comm;
-        MPI_Info info;
-        MPI_Comm_create_endpoints(base_comm, num_ep, info, new_comm);
-        passage = new_comm;
+        ep_lib::MPI_Comm *new_comm;
+        ep_lib::MPI_Info info;
+        ep_lib::MPI_Comm_create_endpoints(base_comm, num_ep, info, new_comm);
+        ep_lib::passage = new_comm;
       }
       #pragma omp barrier
 
-      MPI_Comm return_comm = passage[omp_get_thread_num()];
+      ep_lib::MPI_Comm return_comm = ep_lib::passage[omp_get_thread_num()];
       return return_comm;
         
@@ -85,5 +85,5 @@
   }
 
-}
+//}
 
 
Index: XIOS/dev/dev_trunk_omp/extern/src_ep_dev/ep_lib_fortran.hpp
===================================================================
--- XIOS/dev/dev_trunk_omp/extern/src_ep_dev/ep_lib_fortran.hpp	(revision 1604)
+++ XIOS/dev/dev_trunk_omp/extern/src_ep_dev/ep_lib_fortran.hpp	(revision 1605)
@@ -4,10 +4,10 @@
 #include "ep_type.hpp"
 
-namespace ep_lib
-{
+//namespace ep_lib
+//{
 
-  void* EP_Comm_c2f(MPI_Comm comm);
-  MPI_Comm EP_Comm_f2c(void* comm);
-}
+  void* EP_Comm_c2f(ep_lib::MPI_Comm comm);
+  ep_lib::MPI_Comm EP_Comm_f2c(void* comm);
+//}
 
 
Index: XIOS/dev/dev_trunk_omp/extern/src_ep_dev/ep_split.cpp
===================================================================
--- XIOS/dev/dev_trunk_omp/extern/src_ep_dev/ep_split.cpp	(revision 1604)
+++ XIOS/dev/dev_trunk_omp/extern/src_ep_dev/ep_split.cpp	(revision 1605)
@@ -286,5 +286,6 @@
           for(int i=0; i<new_ep_size; i++)
           {
-            (*newcomm)->ep_comm_ptr->comm_list[0]->ep_rank_map->insert(std::pair< int, std::pair<int,int> >(my_triple_vector_recv[3*i], my_triple_vector_recv[3*i+1], my_triple_vector_recv[3*i+2]));
+            //(*newcomm)->ep_comm_ptr->comm_list[0]->ep_rank_map->insert(std::pair< int, std::pair<int,int> >(my_triple_vector_recv[3*i], my_triple_vector_recv[3*i+1], my_triple_vector_recv[3*i+2]));
+            (*((*newcomm)->ep_comm_ptr->comm_list[0]->ep_rank_map)) [ my_triple_vector_recv[3*i] ] = std::make_pair(my_triple_vector_recv[3*i+1], my_triple_vector_recv[3*i+2]);
           }
           
Index: XIOS/dev/dev_trunk_omp/inputs/COMPLETE/job.sh
===================================================================
--- XIOS/dev/dev_trunk_omp/inputs/COMPLETE/job.sh	(revision 1605)
+++ XIOS/dev/dev_trunk_omp/inputs/COMPLETE/job.sh	(revision 1605)
@@ -0,0 +1,24 @@
+#!/bin/bash 
+#MSUB -r XIOS_test_client                 # Request name 
+#MSUB -n 4                       # Number of tasks to use 
+#MSUB -c 4
+#MSUB -T 1800                       # Elapsed time limit in seconds 
+#MSUB -o client_output.out                 # Standard output. %I is the job id 
+#MSUB -e client_error.err                 # Error output. %I is the job id
+#MSUB -q skylake
+#MSUB -Q test
+#MSUB -A devcmip6                # Project ID
+
+export OMP_NUM_THREADS=${BRIDGE_MSUB_NCORE}
+#export  ALLINEA_DISABLE_PRETTY_PRINT=1
+
+
+module load gnu
+
+set -x 
+#cp $HOME/dev/dev_yushan/bin/xios_server.exe ./
+
+ccc_mprun ../../bin/test_complete_omp.exe
+#ccc_mprun ./EP_test
+#ddt -start -n 4 ./EP_test
+
Index: XIOS/dev/dev_trunk_omp/inputs/job.sh
===================================================================
--- XIOS/dev/dev_trunk_omp/inputs/job.sh	(revision 1605)
+++ XIOS/dev/dev_trunk_omp/inputs/job.sh	(revision 1605)
@@ -0,0 +1,23 @@
+#!/bin/bash 
+#MSUB -r XIOS_test_client                 # Request name 
+#MSUB -n 4                       # Number of tasks to use 
+#MSUB -c 4
+#MSUB -T 1800                       # Elapsed time limit in seconds 
+#MSUB -o client_output.out                 # Standard output. %I is the job id 
+#MSUB -e client_error.err                 # Error output. %I is the job id
+#MSUB -q skylake
+#MSUB -Q test
+#MSUB -A devcmip6                # Project ID
+
+export OMP_NUM_THREADS=${BRIDGE_MSUB_NCORE}
+#export  ALLINEA_DISABLE_PRETTY_PRINT=1
+
+module load gnu
+
+set -x 
+#cp $HOME/dev/dev_yushan/bin/xios_server.exe ./
+
+ccc_mprun ../bin/test_omp.exe
+#ccc_mprun ./EP_test
+#ddt -start -n 4 ./EP_test
+
Index: XIOS/dev/dev_trunk_omp/src/interface/c/icdata.cpp
===================================================================
--- XIOS/dev/dev_trunk_omp/src/interface/c/icdata.cpp	(revision 1604)
+++ XIOS/dev/dev_trunk_omp/src/interface/c/icdata.cpp	(revision 1605)
@@ -67,5 +67,5 @@
       #elif _usingEP
       ep_lib::fc_comm_map.clear();
-      if (initialized) local_comm=ep_lib::EP_Comm_f2c((f_local_comm));
+      if (initialized) local_comm=EP_Comm_f2c((f_local_comm));
       else local_comm=MPI_COMM_NULL;
       #endif
@@ -77,5 +77,5 @@
       *f_return_comm=MPI_Comm_c2f(return_comm);
       #elif _usingEP
-      *f_return_comm=*static_cast<MPI_Fint*>(ep_lib::EP_Comm_c2f(return_comm));
+      *f_return_comm=*static_cast<MPI_Fint*>(EP_Comm_c2f(return_comm));
       #endif
       CTimer::get("XIOS init").suspend();
@@ -94,5 +94,5 @@
      comm=MPI_Comm_f2c(*f_comm);
      #elif _usingEP
-     comm = ep_lib::EP_Comm_f2c(f_comm);
+     comm = EP_Comm_f2c(f_comm);
      #endif
      CClient::registerContext(str, comm);
