Index: XIOS/dev/branch_openmp/src/io/inetcdf4.cpp
===================================================================
--- XIOS/dev/branch_openmp/src/io/inetcdf4.cpp	(revision 1287)
+++ XIOS/dev/branch_openmp/src/io/inetcdf4.cpp	(revision 1328)
@@ -4,12 +4,8 @@
 
 #include <boost/algorithm/string.hpp>
-// mpi_std.hpp
-#ifdef _usingEP
-#include "ep_declaration.hpp"
-#endif
 
 namespace xios
 {
-  CINetCDF4::CINetCDF4(const StdString& filename, const MPI_Comm* comm /*= NULL*/, bool multifile /*= true*/, const StdString& timeCounterName /*= "time_counter"*/)
+  CINetCDF4::CINetCDF4(const StdString& filename, const ep_lib::MPI_Comm* comm /*= NULL*/, bool multifile /*= true*/, const StdString& timeCounterName /*= "time_counter"*/)
   {
     // Don't use parallel mode if there is only one process
@@ -17,16 +13,16 @@
     {
       int commSize = 0;
-      MPI_Comm_size(*comm, &commSize);
+      ep_lib::MPI_Comm_size(*comm, &commSize);
       if (commSize <= 1)
         comm = NULL;
     }
-
     mpi = comm && !multifile;
-    MPI_Info m_info = MPI_INFO_NULL.mpi_info;
+    ep_lib::MPI_Info info_null;
 
     // The file format will be detected automatically by NetCDF, it is safe to always set NC_MPIIO
     // even if Parallel NetCDF ends up being used.
     if (mpi)
-      CNetCdfInterface::openPar(filename, NC_NOWRITE | NC_MPIIO, *comm, m_info, this->ncidp);
+      //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);
     else
       CNetCdfInterface::open(filename, NC_NOWRITE, this->ncidp);
Index: XIOS/dev/branch_openmp/src/io/inetcdf4.hpp
===================================================================
--- XIOS/dev/branch_openmp/src/io/inetcdf4.hpp	(revision 1287)
+++ XIOS/dev/branch_openmp/src/io/inetcdf4.hpp	(revision 1328)
@@ -14,5 +14,4 @@
 #endif  // UNLIMITED_DIM
 
-
 namespace xios
 {
@@ -23,5 +22,5 @@
     public:
       /// Constructors ///
-      CINetCDF4(const StdString& filename, const MPI_Comm* comm = NULL, bool multifile = true,
+      CINetCDF4(const StdString& filename, const ep_lib::MPI_Comm* comm = NULL, bool multifile = true,
                 const StdString& timeCounterName = "time_counter");
       CINetCDF4(const CINetCDF4& inetcdf4);       // Not implemented.
Index: XIOS/dev/branch_openmp/src/io/inetcdf4_decl.cpp
===================================================================
--- XIOS/dev/branch_openmp/src/io/inetcdf4_decl.cpp	(revision 1287)
+++ XIOS/dev/branch_openmp/src/io/inetcdf4_decl.cpp	(revision 1328)
@@ -1,4 +1,3 @@
 #include "inetcdf4_impl.hpp"
-// mpi_std.hpp
 
 namespace xios
Index: XIOS/dev/branch_openmp/src/io/inetcdf4_impl.hpp
===================================================================
--- XIOS/dev/branch_openmp/src/io/inetcdf4_impl.hpp	(revision 1287)
+++ XIOS/dev/branch_openmp/src/io/inetcdf4_impl.hpp	(revision 1328)
@@ -4,5 +4,4 @@
 #include "inetcdf4.hpp"
 #include "netCdfInterface.hpp"
-// mpi_std.hpp
 
 namespace xios
Index: XIOS/dev/branch_openmp/src/io/nc4_data_input.cpp
===================================================================
--- XIOS/dev/branch_openmp/src/io/nc4_data_input.cpp	(revision 1287)
+++ XIOS/dev/branch_openmp/src/io/nc4_data_input.cpp	(revision 1328)
@@ -8,9 +8,7 @@
 #include "scalar.hpp"
 
-// mpi.hpp
-
 namespace xios
 {
-  CNc4DataInput::CNc4DataInput(const StdString& filename, ::MPI_Comm comm_file, bool multifile, bool isCollective /*= true*/, const StdString& timeCounterName /*= "time_counter"*/)
+  CNc4DataInput::CNc4DataInput(const StdString& filename, ep_lib::MPI_Comm comm_file, bool multifile, bool isCollective /*= true*/, const StdString& timeCounterName /*= "time_counter"*/)
     : SuperClass()
     , SuperClassWriter(filename, &comm_file, multifile, timeCounterName)
@@ -55,8 +53,5 @@
     CArray<double,1> fieldData(grid->getWrittenDataSize());
     if (!field->default_value.isEmpty()) fieldData = field->default_value;
-    #ifdef _usingEP
-    SuperClass::type = ONE_FILE;
-    printf("SuperClass::type = %d\n", SuperClass::type);
-    #endif
+
     switch (SuperClass::type)
     {
@@ -326,5 +321,5 @@
       std::vector<StdSize> nBeginBndsLatLon(3), nSizeBndsLatLon(3);
       nBeginBndsLatLon[0] = 0; nSizeBndsLatLon[0] = domain->nj_glo.getValue();
-      nBeginBndsLatLon[1] = 0; nSizeBndsLatLon[1] = domain->nj_glo.getValue();
+      nBeginBndsLatLon[1] = 0; nSizeBndsLatLon[1] = domain->ni_glo.getValue();
       nBeginBndsLatLon[2] = 0; nSizeBndsLatLon[2] = nbVertex;
 
Index: XIOS/dev/branch_openmp/src/io/nc4_data_input.hpp
===================================================================
--- XIOS/dev/branch_openmp/src/io/nc4_data_input.hpp	(revision 1287)
+++ XIOS/dev/branch_openmp/src/io/nc4_data_input.hpp	(revision 1328)
@@ -3,8 +3,8 @@
 
 /// XIOS headers ///
+#include "mpi_std.hpp"
 #include "xios_spl.hpp"
 #include "data_input.hpp"
 #include "inetcdf4.hpp"
-// mpi_std.hpp
 
 namespace xios
@@ -24,5 +24,5 @@
 
     /// Constructors ///
-    CNc4DataInput(const StdString& filename, MPI_Comm comm_file, bool multifile, bool isCollective = true,
+    CNc4DataInput(const StdString& filename, ep_lib::MPI_Comm comm_file, bool multifile, bool isCollective = true,
                   const StdString& timeCounterName = "time_counter");
     CNc4DataInput(const CNc4DataInput& dataInput);       // Not implemented.
@@ -71,5 +71,5 @@
   private:
     /// Private attributes ///
-    MPI_Comm comm_file;
+    ep_lib::MPI_Comm comm_file;
     const StdString filename;
     bool isCollective;
Index: XIOS/dev/branch_openmp/src/io/nc4_data_output.cpp
===================================================================
--- XIOS/dev/branch_openmp/src/io/nc4_data_output.cpp	(revision 1287)
+++ XIOS/dev/branch_openmp/src/io/nc4_data_output.cpp	(revision 1328)
@@ -13,6 +13,4 @@
 #include "timer.hpp"
 #include "uuid.hpp"
-// mpi.hpp
-
 namespace xios
 {
@@ -30,5 +28,5 @@
       CNc4DataOutput::CNc4DataOutput
          (CFile* file, const StdString & filename, bool exist, bool useClassicFormat, bool useCFConvention,
-          ::MPI_Comm comm_file, bool multifile, bool isCollective, const StdString& timeCounterName)
+          ep_lib::MPI_Comm comm_file, bool multifile, bool isCollective, const StdString& timeCounterName)
             : SuperClass()
             , SuperClassWriter(filename, exist, useClassicFormat, useCFConvention, &comm_file, multifile, timeCounterName)
@@ -465,5 +463,5 @@
       StdString domainName = domain->name;
       domain->assignMesh(domainName, domain->nvertex);
-      domain->mesh->createMeshEpsilon(static_cast< ::MPI_Comm >(server->intraComm.mpi_comm), domain->lonvalue_srv, domain->latvalue_srv, domain->bounds_lon_srv, domain->bounds_lat_srv);
+      domain->mesh->createMeshEpsilon(server->intraComm, domain->lonvalue_srv, domain->latvalue_srv, domain->bounds_lon_srv, domain->bounds_lat_srv);
 
       StdString node_x = domainName + "_node_x";
Index: XIOS/dev/branch_openmp/src/io/nc4_data_output.hpp
===================================================================
--- XIOS/dev/branch_openmp/src/io/nc4_data_output.hpp	(revision 1287)
+++ XIOS/dev/branch_openmp/src/io/nc4_data_output.hpp	(revision 1328)
@@ -4,7 +4,7 @@
 /// XIOS headers ///
 #include "xios_spl.hpp"
+#include "mpi_std.hpp"
 #include "onetcdf4.hpp"
 #include "data_output.hpp"
-// mpi_std.hpp
 
 namespace xios
@@ -27,6 +27,7 @@
             CNc4DataOutput
                (CFile* file, const StdString & filename, bool exist, bool useClassicFormat,
-                bool useCFConvention, MPI_Comm comm_file, bool multifile, 
-                bool isCollective = true, const StdString& timeCounterName = "time_counter");
+                bool useCFConvention,
+                ep_lib::MPI_Comm comm_file, bool multifile, bool isCollective = true,
+                const StdString& timeCounterName = "time_counter");
 
             CNc4DataOutput(const CNc4DataOutput & dataoutput);       // Not implemented.
@@ -116,5 +117,5 @@
 
             /// PropriÃ©tÃ©s privÃ©es ///
-            MPI_Comm comm_file;
+            ep_lib::MPI_Comm comm_file;
             const StdString filename;
             std::map<Time, StdSize> timeToRecordCache;
Index: XIOS/dev/branch_openmp/src/io/netCdfInterface.cpp
===================================================================
--- XIOS/dev/branch_openmp/src/io/netCdfInterface.cpp	(revision 1287)
+++ XIOS/dev/branch_openmp/src/io/netCdfInterface.cpp	(revision 1328)
@@ -10,5 +10,4 @@
 #include "netCdfInterface.hpp"
 #include "netCdfException.hpp"
-// mpi_std.hpp
 
 namespace xios
@@ -50,5 +49,5 @@
 int CNetCdfInterface::createPar(const StdString& fileName, int cMode, MPI_Comm comm, MPI_Info info, int& ncId)
 {
-  int status = xios::nc_create_par(fileName.c_str(), cMode, comm, info, &ncId);
+  int status = xios::nc_create_par(fileName.c_str(), cMode, comm, MPI_INFO_NULL.mpi_info, &ncId);
   if (NC_NOERR != status)
   {
@@ -75,8 +74,5 @@
 int CNetCdfInterface::open(const StdString& fileName, int oMode, int& ncId)
 {
-  int status = NC_NOERR;
-  #pragma omp critical (_netcdf)
-  status = nc_open(fileName.c_str(), oMode, &ncId);
-  
+  int status = nc_open(fileName.c_str(), oMode, &ncId);
   if (NC_NOERR != status)
   {
@@ -106,7 +102,6 @@
 int CNetCdfInterface::openPar(const StdString& fileName, int oMode, MPI_Comm comm, MPI_Info info, int& ncId)
 {
-  int status;
-  #pragma omp critical (_netcdf)
-  status = xios::nc_open_par(fileName.c_str(), oMode, comm, info, &ncId); // nc_open
+  //int status = xios::nc_open_par(fileName.c_str(), oMode, comm, info, &ncId);
+  int status = xios::nc_open_par(fileName.c_str(), oMode, comm, MPI_INFO_NULL.mpi_info, &ncId);
   if (NC_NOERR != status)
   {
@@ -131,9 +126,5 @@
 int CNetCdfInterface::close(int ncId)
 {
-  int status = NC_NOERR;
-  #pragma omp critical (_netcdf)
-  //#pragma omp master
-  {
-  status = nc_close(ncId);
+  int status = nc_close(ncId);
   if (NC_NOERR != status)
   {
@@ -146,5 +137,5 @@
     throw CNetCdfException(e);
   }
-  }
+
   return status;
 }
@@ -356,7 +347,5 @@
 int CNetCdfInterface::inqDimLen(int ncid, int dimId, StdSize& dimLen)
 {
-  int status;
-  #pragma omp critical (_netcdf)
-  status = nc_inq_dimlen(ncid, dimId, &dimLen);
+  int status = nc_inq_dimlen(ncid, dimId, &dimLen);
   if (NC_NOERR != status)
   {
Index: XIOS/dev/branch_openmp/src/io/netCdfInterface.hpp
===================================================================
--- XIOS/dev/branch_openmp/src/io/netCdfInterface.hpp	(revision 1287)
+++ XIOS/dev/branch_openmp/src/io/netCdfInterface.hpp	(revision 1328)
@@ -10,4 +10,5 @@
 #define __NETCDF_INTERFACE_HPP_
 
+#include "mpi_std.hpp"
 #include "xios_spl.hpp"
 
@@ -16,5 +17,4 @@
 #endif
 
-#include "mpi_std.hpp"
 #include "netcdf.hpp"
 
Index: XIOS/dev/branch_openmp/src/io/netCdfInterface_decl.cpp
===================================================================
--- XIOS/dev/branch_openmp/src/io/netCdfInterface_decl.cpp	(revision 1287)
+++ XIOS/dev/branch_openmp/src/io/netCdfInterface_decl.cpp	(revision 1328)
@@ -9,5 +9,4 @@
 
 #include "netCdfInterface_impl.hpp"
-// mpi_std.hpp
 
 namespace xios
Index: XIOS/dev/branch_openmp/src/io/netCdfInterface_impl.hpp
===================================================================
--- XIOS/dev/branch_openmp/src/io/netCdfInterface_impl.hpp	(revision 1287)
+++ XIOS/dev/branch_openmp/src/io/netCdfInterface_impl.hpp	(revision 1328)
@@ -13,5 +13,4 @@
 #include "netCdfInterface.hpp"
 #include "netCdfException.hpp"
-// mpi_std.hpp
 
 namespace xios
@@ -86,7 +85,5 @@
   int CNetCdfInterface::getVaraType(int ncid, int varId, const StdSize* start, const StdSize* count, T* data)
   {
-    int status;
-    #pragma omp critical (_netcdf)
-    status = ncGetVaraType(ncid, varId, start, count, data);
+    int status = ncGetVaraType(ncid, varId, start, count, data);
     if (NC_NOERR != status)
     {
Index: XIOS/dev/branch_openmp/src/io/netCdf_cf_constant.hpp
===================================================================
--- XIOS/dev/branch_openmp/src/io/netCdf_cf_constant.hpp	(revision 1287)
+++ XIOS/dev/branch_openmp/src/io/netCdf_cf_constant.hpp	(revision 1328)
@@ -4,6 +4,4 @@
 #include "inetcdf4.hpp"
 #include "netCdfInterface.hpp"
-
-// mpi_std.hpp
 
 namespace xios
Index: XIOS/dev/branch_openmp/src/io/netcdf.hpp
===================================================================
--- XIOS/dev/branch_openmp/src/io/netcdf.hpp	(revision 1287)
+++ XIOS/dev/branch_openmp/src/io/netcdf.hpp	(revision 1328)
@@ -18,5 +18,5 @@
 extern "C"
 {
-  #include <netcdf_par.h>
+#  include <netcdf_par.h>
 }
 #  endif
Index: XIOS/dev/branch_openmp/src/io/onetcdf4.cpp
===================================================================
--- XIOS/dev/branch_openmp/src/io/onetcdf4.cpp	(revision 1287)
+++ XIOS/dev/branch_openmp/src/io/onetcdf4.cpp	(revision 1328)
@@ -12,6 +12,7 @@
       /// ////////////////////// DÃ©finitions ////////////////////// ///
 
-      CONetCDF4::CONetCDF4(const StdString& filename, bool append, bool useClassicFormat, bool useCFConvention, 
-                           const MPI_Comm* comm, bool multifile, const StdString& timeCounterName)
+      CONetCDF4::CONetCDF4(const StdString& filename, bool append, bool useClassicFormat,
+							bool useCFConvention,
+                           const ep_lib::MPI_Comm* comm, bool multifile, const StdString& timeCounterName)
         : path()
         , wmpi(false)
@@ -31,5 +32,5 @@
 
       void CONetCDF4::initialize(const StdString& filename, bool append, bool useClassicFormat, bool useCFConvention, 
-                                 const MPI_Comm* comm, bool multifile, const StdString& timeCounterName)
+                                 const ep_lib::MPI_Comm* comm, bool multifile, const StdString& timeCounterName)
       {
          this->useClassicFormat = useClassicFormat;
@@ -42,9 +43,10 @@
          {
             int commSize = 0;
-            MPI_Comm_size(*comm, &commSize);
+            ep_lib::MPI_Comm_size(*comm, &commSize);
             if (commSize <= 1)
                comm = NULL;
          }
          wmpi = comm && !multifile;
+         ep_lib::MPI_Info info_null;
 
          if (wmpi)
@@ -56,5 +58,5 @@
             CTimer::get("Files : create").resume();
             if (wmpi)
-               CNetCdfInterface::createPar(filename, mode, *comm, MPI_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);
@@ -68,5 +70,5 @@
             CTimer::get("Files : open").resume();
             if (wmpi)
-               CNetCdfInterface::openPar(filename, mode, *comm, MPI_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);
@@ -539,7 +541,6 @@
                                  const std::vector<StdSize>& scount, const int* data)
       {
-         CNetCdfInterface::putVaraType(grpid, varid, &sstart[0], &scount[0], data);
-      }
-
+          CNetCdfInterface::putVaraType(grpid, varid, &sstart[0], &scount[0], data);
+      }
       //---------------------------------------------------------------
 
@@ -549,5 +550,5 @@
                                  const std::vector<StdSize>& scount, const float* data)
       {
-         CNetCdfInterface::putVaraType(grpid, varid, &sstart[0], &scount[0], data);
+          CNetCdfInterface::putVaraType(grpid, varid, &sstart[0], &scount[0], data);
       }
 
Index: XIOS/dev/branch_openmp/src/io/onetcdf4.hpp
===================================================================
--- XIOS/dev/branch_openmp/src/io/onetcdf4.hpp	(revision 1287)
+++ XIOS/dev/branch_openmp/src/io/onetcdf4.hpp	(revision 1328)
@@ -4,8 +4,8 @@
 /// XIOS headers ///
 #include "xios_spl.hpp"
+#include "mpi_std.hpp"
 #include "exception.hpp"
 #include "data_output.hpp"
 #include "array_new.hpp"
-#include "mpi_std.hpp"
 #include "netcdf.hpp"
 
@@ -13,6 +13,4 @@
    #define UNLIMITED_DIM (size_t)(-1)
 #endif  //UNLIMITED_DIM
-
-// mpi_std.hpp
 
 namespace xios
@@ -30,5 +28,5 @@
             CONetCDF4(const StdString& filename, bool append, bool useClassicFormat = false,
             		  bool useCFConvention = true,
-                      const MPI_Comm* comm = NULL, bool multifile = true,
+                      const ep_lib::MPI_Comm* comm = NULL, bool multifile = true,
                       const StdString& timeCounterName = "time_counter");
 
@@ -39,5 +37,5 @@
             /// Initialisation ///
             void initialize(const StdString& filename, bool append, bool useClassicFormat, bool useCFConvention,
-                            const MPI_Comm* comm, bool multifile, const StdString& timeCounterName);
+                            const ep_lib::MPI_Comm* comm, bool multifile, const StdString& timeCounterName);
             void close(void);
             void sync(void);
Index: XIOS/dev/branch_openmp/src/io/onetcdf4_decl.cpp
===================================================================
--- XIOS/dev/branch_openmp/src/io/onetcdf4_decl.cpp	(revision 1287)
+++ XIOS/dev/branch_openmp/src/io/onetcdf4_decl.cpp	(revision 1328)
@@ -1,4 +1,3 @@
 #include "onetcdf4_impl.hpp"
-// mpi_std.hpp
 
 namespace xios
Index: XIOS/dev/branch_openmp/src/io/onetcdf4_impl.hpp
===================================================================
--- XIOS/dev/branch_openmp/src/io/onetcdf4_impl.hpp	(revision 1287)
+++ XIOS/dev/branch_openmp/src/io/onetcdf4_impl.hpp	(revision 1328)
@@ -5,5 +5,4 @@
 #include "netCdfInterface.hpp"
 #include "timer.hpp"
-// mpi_std.hpp
 
 namespace xios
