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"

ompi/mpi/c/type_struct.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

2529
#if OMPI_BUILD_MPI_PROFILING

ompi/mpi/c/type_ub.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/fortran/mpif-h/Makefile.am

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -481,8 +481,8 @@ lib@OMPI_LIBMPI_NAME@_mpifh_la_SOURCES += \
481481
win_flush_local_f.c \
482482
win_flush_local_all_f.c
483483

484-
485-
if OMPI_ENABLE_MPI1_COMPAT
484+
# include all of the removed MPI functions in library
485+
# for v4.0.x regardless of state of OMPI_ENABLE_MPI1_COMPAT
486486
lib@OMPI_LIBMPI_NAME@_mpifh_la_SOURCES += \
487487
address_f.c \
488488
errhandler_create_f.c \
@@ -495,7 +495,6 @@ lib@OMPI_LIBMPI_NAME@_mpifh_la_SOURCES += \
495495
type_struct_f.c \
496496
type_ub_f.c
497497
endif
498-
endif
499498

500499
#
501500
# Conditionally install the header files

ompi/mpi/fortran/mpif-h/address_f.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
1313
* Copyright (c) 2015 Research Organization for Information Science
1414
* and Technology (RIST). All rights reserved.
15+
* Copyright (c) 2018 IBM Corporation. All rights reserved.
1516
* $COPYRIGHT$
1617
*
1718
* Additional copyrights may follow
@@ -21,6 +22,10 @@
2122

2223
#include "ompi_config.h"
2324

25+
/* defining #define OMPI_OMIT_MPI1_COMPAT_DECLS to 0 for removed
26+
* implementations here. see comments in address.c for more information. */
27+
#define OMPI_OMIT_MPI1_COMPAT_DECLS 0
28+
2429
#include "ompi/mpi/fortran/mpif-h/bindings.h"
2530

2631
#if OMPI_BUILD_MPI_PROFILING

ompi/mpi/fortran/mpif-h/errhandler_create_f.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* Copyright (c) 2008-2012 Cisco Systems, Inc. All rights reserved.
1313
* Copyright (c) 2015 Research Organization for Information Science
1414
* and Technology (RIST). All rights reserved.
15+
* Copyright (c) 2018 IBM Corporation. All rights reserved.
1516
* $COPYRIGHT$
1617
*
1718
* Additional copyrights may follow
@@ -21,6 +22,10 @@
2122

2223
#include "ompi_config.h"
2324

25+
/* defining #define OMPI_OMIT_MPI1_COMPAT_DECLS to 0 for removed
26+
* implementations here. see comments in address.c for more information. */
27+
#define OMPI_OMIT_MPI1_COMPAT_DECLS 0
28+
2429
#include "ompi/mpi/fortran/mpif-h/bindings.h"
2530
#include "ompi/errhandler/errhandler.h"
2631

ompi/mpi/fortran/mpif-h/errhandler_get_f.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
1313
* Copyright (c) 2015 Research Organization for Information Science
1414
* and Technology (RIST). All rights reserved.
15+
* Copyright (c) 2018 IBM Corporation. All rights reserved.
1516
* $COPYRIGHT$
1617
*
1718
* Additional copyrights may follow
@@ -21,6 +22,10 @@
2122

2223
#include "ompi_config.h"
2324

25+
/* defining #define OMPI_OMIT_MPI1_COMPAT_DECLS to 0 for removed
26+
* implementations here. see comments in address.c for more information. */
27+
#define OMPI_OMIT_MPI1_COMPAT_DECLS 0
28+
2429
#include "ompi/mpi/fortran/mpif-h/bindings.h"
2530

2631
#if OMPI_BUILD_MPI_PROFILING

ompi/mpi/fortran/mpif-h/errhandler_set_f.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* Copyright (c) 2008-2012 Cisco Systems, Inc. All rights reserved.
1313
* Copyright (c) 2015 Research Organization for Information Science
1414
* and Technology (RIST). All rights reserved.
15+
* Copyright (c) 2018 IBM Corporation. All rights reserved.
1516
* $COPYRIGHT$
1617
*
1718
* Additional copyrights may follow
@@ -21,6 +22,10 @@
2122

2223
#include "ompi_config.h"
2324

25+
/* defining #define OMPI_OMIT_MPI1_COMPAT_DECLS to 0 for removed
26+
* implementations here. see comments in address.c for more information. */
27+
#define OMPI_OMIT_MPI1_COMPAT_DECLS 0
28+
2429
#include "ompi/mpi/fortran/mpif-h/bindings.h"
2530
#include "ompi/errhandler/errhandler.h"
2631

ompi/mpi/fortran/mpif-h/profile/Makefile.am

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,8 @@ linked_files = \
397397
pwin_flush_local_f.c \
398398
pwin_flush_local_all_f.c
399399

400-
if OMPI_ENABLE_MPI1_COMPAT
400+
# include all of the removed MPI functions in library
401+
# for v4.0.x regardless of state of OMPI_ENABLE_MPI1_COMPAT
401402
linked_files += \
402403
paddress_f.c \
403404
perrhandler_create_f.c \
@@ -409,7 +410,6 @@ linked_files += \
409410
ptype_lb_f.c \
410411
ptype_struct_f.c \
411412
ptype_ub_f.c
412-
endif
413413

414414
#
415415
# Sym link in the sources from the real MPI directory

ompi/mpi/fortran/mpif-h/type_extent_f.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
1313
* Copyright (c) 2015 Research Organization for Information Science
1414
* and Technology (RIST). All rights reserved.
15+
* Copyright (c) 2018 IBM Corporation. All rights reserved.
1516
* $COPYRIGHT$
1617
*
1718
* Additional copyrights may follow
@@ -21,6 +22,10 @@
2122

2223
#include "ompi_config.h"
2324

25+
/* defining #define OMPI_OMIT_MPI1_COMPAT_DECLS to 0 for removed
26+
* implementations here. see comments in address.c for more information. */
27+
#define OMPI_OMIT_MPI1_COMPAT_DECLS 0
28+
2429
#include "ompi/mpi/fortran/mpif-h/bindings.h"
2530

2631
#if OMPI_BUILD_MPI_PROFILING

ompi/mpi/fortran/mpif-h/type_hindexed_f.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
1313
* Copyright (c) 2015 Research Organization for Information Science
1414
* and Technology (RIST). All rights reserved.
15+
* Copyright (c) 2018 IBM Corporation. All rights reserved.
1516
* $COPYRIGHT$
1617
*
1718
* Additional copyrights may follow
@@ -21,6 +22,10 @@
2122

2223
#include "ompi_config.h"
2324

25+
/* defining #define OMPI_OMIT_MPI1_COMPAT_DECLS to 0 for removed
26+
* implementations here. see comments in address.c for more information. */
27+
#define OMPI_OMIT_MPI1_COMPAT_DECLS 0
28+
2429
#include "ompi/mpi/fortran/mpif-h/bindings.h"
2530
#include "ompi/errhandler/errhandler.h"
2631
#include "ompi/communicator/communicator.h"

ompi/mpi/fortran/mpif-h/type_hvector_f.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
1313
* Copyright (c) 2015 Research Organization for Information Science
1414
* and Technology (RIST). All rights reserved.
15+
* Copyright (c) 2018 IBM Corporation. All rights reserved.
1516
* $COPYRIGHT$
1617
*
1718
* Additional copyrights may follow
@@ -21,6 +22,10 @@
2122

2223
#include "ompi_config.h"
2324

25+
/* defining #define OMPI_OMIT_MPI1_COMPAT_DECLS to 0 for removed
26+
* implementations here. see comments in address.c for more information. */
27+
#define OMPI_OMIT_MPI1_COMPAT_DECLS 0
28+
2429
#include "ompi/mpi/fortran/mpif-h/bindings.h"
2530

2631
#if OMPI_BUILD_MPI_PROFILING

ompi/mpi/fortran/mpif-h/type_lb_f.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
1313
* Copyright (c) 2015 Research Organization for Information Science
1414
* and Technology (RIST). All rights reserved.
15+
* Copyright (c) 2018 IBM Corporation. All rights reserved.
1516
* $COPYRIGHT$
1617
*
1718
* Additional copyrights may follow
@@ -21,6 +22,10 @@
2122

2223
#include "ompi_config.h"
2324

25+
/* defining #define OMPI_OMIT_MPI1_COMPAT_DECLS to 0 for removed
26+
* implementations here. see comments in address.c for more information. */
27+
#define OMPI_OMIT_MPI1_COMPAT_DECLS 0
28+
2429
#include "ompi/mpi/fortran/mpif-h/bindings.h"
2530

2631
#if OMPI_BUILD_MPI_PROFILING

ompi/mpi/fortran/mpif-h/type_struct_f.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
1313
* Copyright (c) 2015 Research Organization for Information Science
1414
* and Technology (RIST). All rights reserved.
15+
* Copyright (c) 2018 IBM Corporation. All rights reserved.
1516
* $COPYRIGHT$
1617
*
1718
* Additional copyrights may follow
@@ -21,6 +22,10 @@
2122

2223
#include "ompi_config.h"
2324

25+
/* defining #define OMPI_OMIT_MPI1_COMPAT_DECLS to 0 for removed
26+
* implementations here. see comments in address.c for more information. */
27+
#define OMPI_OMIT_MPI1_COMPAT_DECLS 0
28+
2429
#include "ompi/mpi/fortran/mpif-h/bindings.h"
2530
#include "ompi/errhandler/errhandler.h"
2631
#include "ompi/communicator/communicator.h"

ompi/mpi/fortran/mpif-h/type_ub_f.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
* Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
1313
* Copyright (c) 2015 Research Organization for Information Science
1414
* and Technology (RIST). All rights reserved.
15+
* Copyright (c) 2018 IBM Corporation. All rights reserved.
1516
* $COPYRIGHT$
1617
*
1718
* Additional copyrights may follow
@@ -21,6 +22,10 @@
2122

2223
#include "ompi_config.h"
2324

25+
/* defining #define OMPI_OMIT_MPI1_COMPAT_DECLS to 0 for removed
26+
* implementations here. see comments in address.c for more information. */
27+
#define OMPI_OMIT_MPI1_COMPAT_DECLS 0
28+
2429
#include "ompi/mpi/fortran/mpif-h/bindings.h"
2530

2631
#if OMPI_BUILD_MPI_PROFILING

0 commit comments

Comments
 (0)