Skip to content

Commit

Permalink
build: Support for MPI ABI
Browse files Browse the repository at this point in the history
  • Loading branch information
dalcinl committed Jan 17, 2024
1 parent 8f5700f commit 6ad83c4
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 48 deletions.
2 changes: 2 additions & 0 deletions src/lib-mpi/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

#if defined(HAVE_PYMPICONF_H)
#include "pympiconf.h"
#elif defined(MPI_ABI)
#include "config/mpiapi.h"
#elif defined(MSMPI_VER)
#include "config/msmpi.h"
#elif defined(MPICH_NAME) && (MPICH_NAME >= 3)
Expand Down
14 changes: 14 additions & 0 deletions src/lib-mpi/config/mpiapi.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#ifndef PyMPI_CONFIG_MPIAPI_H
#define PyMPI_CONFIG_MPIAPI_H

#include "mpi-11.h"
#include "mpi-12.h"
#include "mpi-20.h"
#include "mpi-22.h"
#include "mpi-30.h"
#include "mpi-31.h"
#include "mpi-40.h"
#include "mpi-41.h"
#include "mpi-50.h"

#endif /* !PyMPI_CONFIG_MPIAPI_H */
14 changes: 5 additions & 9 deletions src/lib-mpi/config/mpich.h
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
#ifndef PyMPI_CONFIG_MPICH_H
#define PyMPI_CONFIG_MPICH_H

#include "mpi-11.h"
#include "mpi-12.h"
#include "mpi-20.h"
#include "mpi-22.h"
#include "mpi-30.h"
#include "mpi-31.h"
#include "mpi-40.h"
#include "mpi-41.h"
#include "mpi-50.h"
#include "mpiapi.h"

/* These types may not be available */
#ifndef MPI_REAL2
#undef PyMPI_HAVE_MPI_REAL2
#endif
#ifndef MPI_MPI_COMPLEX4
#undef PyMPI_HAVE_MPI_COMPLEX4
#endif

/* MPI I/O may not be available */
#ifndef ROMIO_VERSION
#include "mpi-io.h"
#endif
Expand Down
15 changes: 4 additions & 11 deletions src/lib-mpi/config/mpich2.h
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
#ifndef PyMPI_CONFIG_MPICH2_H
#define PyMPI_CONFIG_MPICH2_H

#include "mpi-11.h"
#include "mpi-12.h"
#include "mpi-20.h"
#include "mpi-22.h"
#include "mpi-30.h"
#include "mpi-31.h"
#include "mpi-40.h"
#include "mpi-41.h"
#include "mpi-50.h"

/* These types are difficult to implement portably */
#include "mpiapi.h"

/* These types are not available */
#undef PyMPI_HAVE_MPI_REAL2
#undef PyMPI_HAVE_MPI_COMPLEX4

Expand All @@ -26,6 +18,7 @@
#undef PyMPI_HAVE_MPI_Type_create_f90_complex
#endif /* MPICH2 < 1.1.0 */

/* MPI I/O may not be available */
#ifndef ROMIO_VERSION
#include "mpi-io.h"
#endif
Expand Down
10 changes: 1 addition & 9 deletions src/lib-mpi/config/msmpi.h
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
#ifndef PyMPI_CONFIG_MSMPI_H
#define PyMPI_CONFIG_MSMPI_H

#include "mpi-11.h"
#include "mpi-12.h"
#include "mpi-20.h"
#include "mpi-22.h"
#include "mpi-30.h"
#include "mpi-31.h"
#include "mpi-40.h"
#include "mpi-41.h"
#include "mpi-50.h"
#include "mpiapi.h"

#if MSMPI_VER >= 0x402
#define PyMPI_HAVE_MPI_AINT 1
Expand Down
10 changes: 1 addition & 9 deletions src/lib-mpi/config/openmpi.h
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
#ifndef PyMPI_CONFIG_OPENMPI_H
#define PyMPI_CONFIG_OPENMPI_H

#include "mpi-11.h"
#include "mpi-12.h"
#include "mpi-20.h"
#include "mpi-22.h"
#include "mpi-30.h"
#include "mpi-31.h"
#include "mpi-40.h"
#include "mpi-41.h"
#include "mpi-50.h"
#include "mpiapi.h"

#ifndef OMPI_HAVE_FORTRAN_LOGICAL1
#define OMPI_HAVE_FORTRAN_LOGICAL1 0
Expand Down
18 changes: 8 additions & 10 deletions src/lib-mpi/config/unknown.h
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
#ifndef PyMPI_CONFIG_UNKNOWN_H
#define PyMPI_CONFIG_UNKNOWN_H

#include "mpi-11.h"
#include "mpi-12.h"
#include "mpi-20.h"
#include "mpi-22.h"
#include "mpi-30.h"
#include "mpi-31.h"
#include "mpi-40.h"
#include "mpi-41.h"
#include "mpi-50.h"
#include "mpiapi.h"

/* These types are difficult to implement portably */
#undef PyMPI_HAVE_MPI_INTEGER16
#ifndef MPI_REAL2
#undef PyMPI_HAVE_MPI_REAL2
#endif
#ifndef MPI_COMPLEX4
#undef PyMPI_HAVE_MPI_COMPLEX4
#endif
#ifndef MPI_INTEGER16
#undef PyMPI_HAVE_MPI_INTEGER16
#endif

#endif /* !PyMPI_CONFIG_UNKNOWN_H */

0 comments on commit 6ad83c4

Please sign in to comment.