Skip to content

Commit 4aa91e1

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) NOTE: This commit is *NOT* a cherry-pick from master, because on master, we are no longer building those symbols by default, but on v4.0.x we _ARE_ still building these symbols by default. This is because the v4.0.x branch is to remain backwards compatible with v3.0.x, while at the same time removing the "removed" symbols from mpi.h (unless the user configures with --enable-mpi1-compatibility) Signed-off-by: Geoffrey Paulsen <[email protected]>
1 parent 0ade49c commit 4aa91e1

25 files changed

+69
-13
lines changed

ompi/include/mpi.h.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@
279279
# define __mpi_interface_deprecated__(msg) __attribute__((__deprecated__))
280280
# endif
281281
# endif
282-
# if OMPI_ENABLE_MPI1_COMPAT
282+
# if (OMPI_ENABLE_MPI1_COMPAT && !OMPI_BUILDING)
283283
# define __mpi_interface_removed__(msg) __mpi_interface_deprecated__(msg)
284284
# define OMPI_OMIT_MPI1_COMPAT_DECLS 0
285285
# endif
@@ -1001,7 +1001,7 @@ OMPI_DECLSPEC extern struct ompi_predefined_info_t ompi_mpi_info_env;
10011001
OMPI_DECLSPEC extern MPI_Fint *MPI_F_STATUS_IGNORE;
10021002
OMPI_DECLSPEC extern MPI_Fint *MPI_F_STATUSES_IGNORE;
10031003

1004-
#if !OMPI_OMIT_MPI1_COMPAT_DECLS
1004+
#if (!OMPI_OMIT_MPI1_COMPAT_DECLS || OMPI_BUILDING)
10051005
/*
10061006
* Removed datatypes. These datatypes are only available if Open MPI
10071007
* was configured with --enable-mpi1-compatibility.
@@ -2662,7 +2662,7 @@ OMPI_DECLSPEC int OMPI_C_MPI_NULL_DELETE_FN( MPI_Comm comm, int comm_keyval,
26622662
void* extra_state )
26632663
__mpi_interface_deprecated__("MPI_NULL_DELETE_FN was deprecated in MPI-2.0; use MPI_COMM_NULL_DELETE_FN instead.");
26642664

2665-
#if !OMPI_OMIT_MPI1_COMPAT_DECLS
2665+
#if (!OMPI_OMIT_MPI1_COMPAT_DECLS || OMPI_BUILDING)
26662666
/*
26672667
* Removed typedefs. These typedefs are only available if Open MPI
26682668
* was configured with --enable-mpi1-compatibility.

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: 1 addition & 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

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

Lines changed: 1 addition & 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

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

Lines changed: 1 addition & 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

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

Lines changed: 1 addition & 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

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: 1 addition & 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

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

Lines changed: 1 addition & 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

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

Lines changed: 1 addition & 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

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

Lines changed: 1 addition & 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

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

Lines changed: 1 addition & 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

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

Lines changed: 1 addition & 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

0 commit comments

Comments
 (0)