Salome HOME
Enable MED compilation with MPI and MEDFile without MPI.
authorAnthony Geay <anthony.geay@edf.fr>
Wed, 15 Oct 2014 12:42:11 +0000 (14:42 +0200)
committerAnthony Geay <anthony.geay@edf.fr>
Wed, 15 Oct 2014 12:42:11 +0000 (14:42 +0200)
src/ParaMEDLoader/CMakeLists.txt
src/ParaMEDLoader/ParaMEDFileMesh.cxx

index 60a2261cdf5138852fb3c70ad243e0850a0ccefa..2ae6c96766fae7d89a6a239c84c90a62f123e06e 100644 (file)
 
 ADD_DEFINITIONS(${HDF5_DEFINITIONS} ${MEDFILE_DEFINITIONS} ${MPI_DEFINITIONS})
 
+IF(HDF5_ENABLE_PARALLEL OR HDF5_IS_PARALLEL)
+  ADD_DEFINITIONS("-DHDF5_IS_PARALLEL")
+ENDIF(HDF5_ENABLE_PARALLEL OR HDF5_IS_PARALLEL)
+
 INCLUDE_DIRECTORIES(
   ${MPI_INCLUDE_DIRS}
   ${MEDFILE_INCLUDE_DIRS}
index c73b7bb2dba00fe6c601729a5f653487f505597a..fa4181f67fcb923a9a9773886ef1abcc13f137aa 100644 (file)
@@ -89,7 +89,11 @@ MEDFileUMesh *ParaMEDFileUMesh::New(int iPart, int nbOfParts, const std::string&
 MEDFileUMesh *ParaMEDFileUMesh::ParaNew(int iPart, int nbOfParts, const MPI_Comm com, const MPI_Info nfo, const std::string& fileName, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs)
 {
   MEDCouplingAutoRefCountObjectPtr<MEDFileUMesh> ret(MEDFileUMesh::New());
+#ifdef HDF5_IS_PARALLEL
   MEDFileUtilities::AutoFid fid(MEDparFileOpen(fileName.c_str(),MED_ACC_RDONLY,com,nfo));
+#else
+  MEDFileUtilities::AutoFid fid(MEDfileOpen(fileName.c_str(),MED_ACC_RDONLY));
+#endif
   //
   int meshDim, spaceDim, numberOfNodes;
   std::vector< std::vector< std::pair<INTERP_KERNEL::NormalizedCellType,int> > > typesDistrib(MEDLoader::GetUMeshGlobalInfo(fileName,mName,meshDim,spaceDim,numberOfNodes));