From: Anthony Geay Date: Wed, 15 Oct 2014 12:42:11 +0000 (+0200) Subject: Enable MED compilation with MPI and MEDFile without MPI. X-Git-Tag: V7_5_0b1~6 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4c4fadf89543c2036a749b47558bf038cf78ad80;p=modules%2Fmed.git Enable MED compilation with MPI and MEDFile without MPI. --- diff --git a/src/ParaMEDLoader/CMakeLists.txt b/src/ParaMEDLoader/CMakeLists.txt index 60a2261cd..2ae6c9676 100644 --- a/src/ParaMEDLoader/CMakeLists.txt +++ b/src/ParaMEDLoader/CMakeLists.txt @@ -20,6 +20,10 @@ 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} diff --git a/src/ParaMEDLoader/ParaMEDFileMesh.cxx b/src/ParaMEDLoader/ParaMEDFileMesh.cxx index c73b7bb2d..fa4181f67 100644 --- a/src/ParaMEDLoader/ParaMEDFileMesh.cxx +++ b/src/ParaMEDLoader/ParaMEDFileMesh.cxx @@ -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 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 > > typesDistrib(MEDLoader::GetUMeshGlobalInfo(fileName,mName,meshDim,spaceDim,numberOfNodes));