Skip to content

Commit

Permalink
Enable mpi-compat.h to always be included
Browse files Browse the repository at this point in the history
  • Loading branch information
ZedThree committed Sep 29, 2023
1 parent f1e697b commit b0a030f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
6 changes: 6 additions & 0 deletions include/mpi-compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
#ifndef MPI_COMPAT_H
#define MPI_COMPAT_H

#include "netcdf-compat.h"

#if HAS_PARALLEL_SUPPORT

#include <mpi.h>

#if (MPI_VERSION < 3) && !defined(PyMPI_HAVE_MPI_Message)
Expand All @@ -16,4 +20,6 @@ typedef void *PyMPI_MPI_Session;
#define MPI_Session PyMPI_MPI_Session
#endif

#endif /* HAS_PARALLEL_SUPPORT */

#endif/*MPI_COMPAT_H*/
4 changes: 2 additions & 2 deletions include/netCDF4.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,8 @@ cdef extern from "netcdf.h":
int nc_inq_enum_ident(int ncid, nc_type xtype, long long value, char *identifier) nogil


IF HAS_PARALLEL_SUPPORT:
cdef extern from "mpi-compat.h": pass
cdef extern from "mpi-compat.h":
pass


# taken from numpy.pxi in numpy 1.0rc2.
Expand Down
5 changes: 5 additions & 0 deletions include/netcdf-compat.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#ifndef NETCDF_COMPAT_H
#define NETCDF_COMPAT_H

#include <netcdf.h>
#include <netcdf_meta.h>

Expand Down Expand Up @@ -192,3 +195,5 @@ static inline int nc_inq_var_blosc(int ncid, int varid, int* hasfilterp, unsigne
# endif
#define HAS_BLOSC_SUPPORT 0
#endif

#endif /* NETCDF_COMPAT_H */

0 comments on commit b0a030f

Please sign in to comment.