Skip to content

Commit 4f2f6ef

Browse files
committed
Return MPI1 function implementations to build list
Adding the implementations of the functions that were removed from the MPI standard to the build list, regardless of the state of the OMPI_ENABLE_MPI1_COMPAT. According to the README, we want the OMPI_ENABLE_MPI1_COMPAT configure flag to control which MPI prototypes are exposed in mpi.h, NOT, which are built into the mpi library. Those will remain in the mpi library until a future major release (5.0?) NOTE: for the Fortran implementations, we instead define OMPI_OMIT_MPI1_COMPAT_DECLS to 0 instead of OMPI_ENABLE_MPI1_COMPAT to 1. I'm not sure why, but this seems to work correctly. Also changing the removed MPI_Errhandler_create implementation to use the non removed MPI_Comm_errhandler_function prototype (prototype remains unchanged from MPI_Comm_errhandler_fn) Signed-off-by: Geoffrey Paulsen <[email protected]>
1 parent f7d0a7d commit 4f2f6ef

24 files changed

+106
-10
lines changed

ompi/mpi/c/Makefile.am

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,8 @@ libmpi_c_mpi_la_SOURCES = \
437437
win_wait.c
438438

439439

440-
if OMPI_ENABLE_MPI1_COMPAT
440+
# include all of the removed MPI functions in library
441+
# for v4.0.x regardless of state of OMPI_ENABLE_MPI1_COMPAT
441442
libmpi_c_mpi_la_SOURCES += \
442443
address.c \
443444
errhandler_create.c \
@@ -449,7 +450,6 @@ libmpi_c_mpi_la_SOURCES += \
449450
type_lb.c \
450451
type_struct.c \
451452
type_ub.c
452-
endif
453453

454454
# Conditionally install the header files
455455

ompi/mpi/c/address.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,17 @@
2121
#include "ompi_config.h"
2222
#include <stdio.h>
2323

24+
/* This implementation has been removed from the MPI 3.1 standard.
25+
* Open MPI v4.0.x is keeping the implementation in the library, but
26+
* removing the prototypes from the headers, unless the user configures
27+
* with --enable-mpi1-compatibility.
28+
*
29+
* To prevent having to port these implementations of removed functions
30+
* to the newer MPI calls, we are defining ENABLE_MPI1_COMPAT to 1
31+
* before including the c bindings.
32+
*/
33+
#define ENABLE_MPI1_COMPAT 1
34+
2435
#include "ompi/mpi/c/bindings.h"
2536
#include "ompi/runtime/params.h"
2637
#include "ompi/communicator/communicator.h"

ompi/mpi/c/errhandler_create.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020

2121
#include "ompi_config.h"
2222

23+
/* defining ENABLE_MPI1_COMPAT to 1 for removed implementations here.
24+
* see comments in address.c for more information. */
25+
#define ENABLE_MPI1_COMPAT 1
26+
2327
#include "ompi/mpi/c/bindings.h"
2428
#include "ompi/communicator/communicator.h"
2529
#include "ompi/errhandler/errhandler.h"
@@ -31,7 +35,7 @@
3135
#define MPI_Errhandler_create PMPI_Errhandler_create
3236
#endif
3337

34-
int MPI_Errhandler_create(MPI_Handler_function *function,
38+
int MPI_Errhandler_create(MPI_Comm_errhandler_function *function,
3539
MPI_Errhandler *errhandler)
3640
{
3741

ompi/mpi/c/errhandler_get.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020

2121
#include "ompi_config.h"
2222

23+
/* defining ENABLE_MPI1_COMPAT to 1 for removed implementations here.
24+
* see comments in address.c for more information. */
25+
#define ENABLE_MPI1_COMPAT 1
26+
2327
#include "ompi/mpi/c/bindings.h"
2428
#include "ompi/runtime/params.h"
2529
#include "ompi/communicator/communicator.h"

ompi/mpi/c/errhandler_set.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020

2121
#include "ompi_config.h"
2222

23+
/* defining ENABLE_MPI1_COMPAT to 1 for removed implementations here.
24+
* see comments in address.c for more information. */
25+
#define ENABLE_MPI1_COMPAT 1
26+
2327
#include "ompi/mpi/c/bindings.h"
2428
#include "ompi/runtime/params.h"
2529
#include "ompi/communicator/communicator.h"

ompi/mpi/c/profile/Makefile.am

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,8 @@ nodist_libmpi_c_pmpi_la_SOURCES = \
416416
pwin_unlock_all.c \
417417
pwin_wait.c
418418

419-
if OMPI_ENABLE_MPI1_COMPAT
419+
# include all of the removed MPI functions in library
420+
# for v4.0.x regardless of state of OMPI_ENABLE_MPI1_COMPAT
420421
nodist_libmpi_c_pmpi_la_SOURCES += \
421422
paddress.c \
422423
perrhandler_create.c \
@@ -428,7 +429,6 @@ nodist_libmpi_c_pmpi_la_SOURCES += \
428429
ptype_lb.c \
429430
ptype_struct.c \
430431
ptype_ub.c
431-
endif
432432

433433
#
434434
# Sym link in the sources from the real MPI directory

ompi/mpi/c/type_extent.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020

2121
#include "ompi_config.h"
2222

23+
/* defining ENABLE_MPI1_COMPAT to 1 for removed implementations here.
24+
* see comments in address.c for more information. */
25+
#define ENABLE_MPI1_COMPAT 1
26+
2327
#include "ompi/mpi/c/bindings.h"
2428
#include "ompi/runtime/params.h"
2529
#include "ompi/communicator/communicator.h"

ompi/mpi/c/type_hindexed.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020

2121
#include "ompi_config.h"
2222

23+
/* defining ENABLE_MPI1_COMPAT to 1 for removed implementations here.
24+
* see comments in address.c for more information. */
25+
#define ENABLE_MPI1_COMPAT 1
26+
2327
#include "ompi/mpi/c/bindings.h"
2428
#include "ompi/runtime/params.h"
2529
#include "ompi/communicator/communicator.h"

ompi/mpi/c/type_hvector.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020

2121
#include "ompi_config.h"
2222

23+
/* defining ENABLE_MPI1_COMPAT to 1 for removed implementations here.
24+
* see comments in address.c for more information. */
25+
#define ENABLE_MPI1_COMPAT 1
26+
2327
#include "ompi/mpi/c/bindings.h"
2428
#include "ompi/runtime/params.h"
2529
#include "ompi/communicator/communicator.h"

ompi/mpi/c/type_lb.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020

2121
#include "ompi_config.h"
2222

23+
/* defining ENABLE_MPI1_COMPAT to 1 for removed implementations here.
24+
* see comments in address.c for more information. */
25+
#define ENABLE_MPI1_COMPAT 1
26+
2327
#include "ompi/mpi/c/bindings.h"
2428
#include "ompi/runtime/params.h"
2529
#include "ompi/communicator/communicator.h"

0 commit comments

Comments
 (0)