From 3a9e0e4153cab80138c794bc7196bc5a0db9ab5c Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Thu, 27 Jul 2017 18:29:21 +0200 Subject: [PATCH] src/include/h5core/h5_types.h - define dummy MPI data-types only if MPI_VERSION is not set. According to the MPI specification, this macro must be set after including the header MPI header file 'mpi.h' --- src/include/h5core/h5_types.h | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/include/h5core/h5_types.h b/src/include/h5core/h5_types.h index b1abac5..32655fe 100644 --- a/src/include/h5core/h5_types.h +++ b/src/include/h5core/h5_types.h @@ -13,6 +13,21 @@ #include #include +#include + +#ifndef H5_HAVE_PARALLEL +/* + If someone want's to use serial H5hut with MPI, he must include + the header file "mpi.h" before including H5hut's header file. According + to the MPI standard the macro MPI_VERSION must be defined after reading + "mpi.h". + */ +#ifndef MPI_VERSION +typedef int MPI_Comm; +typedef int MPI_Datatype; +#endif +#endif + typedef enum { H5_STRING_T, H5_INT16_T, @@ -107,11 +122,6 @@ typedef h5_err_t (*h5_errorhandler_t)( const char*, va_list ap ); -#ifndef PARALLEL_IO -typedef int MPI_Comm; -typedef int MPI_Datatype; -#endif - typedef struct h5_loc_idlist { int32_t size; /* allocated space in number of items */ int32_t num_items; /* stored items */