Skip to content

Commit 97f51e4

Browse files
committed
Remove MPI1 functions and datatypes (API change!)
This commit REMOVES the MPI1 functions and datatypes from both the mpi.h header and from the library. WARNING: This changes the MPI API, in a non-backwards compatible way. This also removes the configure option that was added in Open MPI v4.0.x, requiring users to change their apps if they are using any of these almost 20 year old APIs. This removes the following MPI1 removed functions at datatypes MPI_Address MPI_Errhandler_create MPI_Errhandler_get MPI_Errhandler_set MPI_Type_extent MPI_Type_hindexed MPI_Type_hvector MPI_Type_struct MPI_Type_UB MPI_Type_LB Signed-off-by: Geoffrey Paulsen <[email protected]>
1 parent 115467c commit 97f51e4

23 files changed

+12
-932
lines changed

config/ompi_config_files.m4

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ AC_DEFUN([OMPI_CONFIG_FILES],[
3636
ompi/mpi/fortran/use-mpi-ignore-tkr/Makefile
3737
ompi/mpi/fortran/use-mpi-ignore-tkr/mpi-ignore-tkr-interfaces.h
3838
ompi/mpi/fortran/use-mpi-ignore-tkr/mpi-ignore-tkr-file-interfaces.h
39-
ompi/mpi/fortran/use-mpi-ignore-tkr/mpi-ignore-tkr-removed-interfaces.h
4039
ompi/mpi/fortran/use-mpi-f08/Makefile
4140
ompi/mpi/fortran/use-mpi-f08/bindings/Makefile
4241
ompi/mpi/fortran/use-mpi-f08/mod/Makefile

ompi/datatype/ompi_datatype_args.c

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -841,25 +841,19 @@ ompi_datatype_t* ompi_datatype_get_single_predefined_type_from_args( ompi_dataty
841841
return NULL;
842842
}
843843
}
844-
#if OMPI_ENABLE_MPI1_COMPAT
845-
if (current_predef != MPI_LB && current_predef != MPI_UB) {
846-
#endif
847-
if( NULL == predef ) { /* This is the first iteration */
848-
predef = current_predef;
849-
} else {
850-
/**
851-
* What exactly should we consider as identical types?
852-
* If they are the same MPI level type, or if they map
853-
* to the same OPAL datatype? In other words, MPI_FLOAT
854-
* and MPI_REAL4 are they identical?
855-
*/
856-
if( predef != current_predef ) {
857-
return NULL;
858-
}
844+
if( NULL == predef ) { /* This is the first iteration */
845+
predef = current_predef;
846+
} else {
847+
/**
848+
* What exactly should we consider as identical types?
849+
* If they are the same MPI level type, or if they map
850+
* to the same OPAL datatype? In other words, MPI_FLOAT
851+
* and MPI_REAL4 are they identical?
852+
*/
853+
if( predef != current_predef ) {
854+
return NULL;
859855
}
860-
#if OMPI_ENABLE_MPI1_COMPAT
861856
}
862-
#endif
863857
}
864858
return predef;
865859
}

ompi/include/mpi.h.in

Lines changed: 0 additions & 157 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,6 @@
137137
/* Whether we have FORTRAN REAL*8 or not */
138138
#undef OMPI_HAVE_FORTRAN_REAL8
139139

140-
/* Whether in include MPI-1 compatibility */
141-
#undef OMPI_ENABLE_MPI1_COMPAT
142-
143140
/* Whether we have float _Complex or not */
144141
#undef HAVE_FLOAT__COMPLEX
145142

@@ -280,35 +277,6 @@
280277
# define __mpi_interface_deprecated__(msg) __attribute__((__deprecated__))
281278
# endif
282279
# endif
283-
# endif
284-
285-
/* For removed API, there is no portable way to cause the
286-
* C compiler to error with a nice message on the usage of
287-
* one of these symbols, so instead we use a C11 static_assert
288-
* If the user is not using a C11 compiler, they will get an
289-
* undefined reference, but no line number or nice message.
290-
*
291-
* Don't do MACRO magic for building Profiling library as it
292-
* interferes with that system.
293-
*/
294-
# if (OMPI_ENABLE_MPI1_COMPAT || OMPI_BUILDING)
295-
# define OMPI_OMIT_MPI1_COMPAT_DECLS 0
296-
# define __mpi_interface_removed__(func, newfunc) __mpi_interface_deprecated__(#func " was removed in MPI-3.0. Use " #newfunc " instead. continuing...")
297-
# else
298-
# if (__STDC_VERSION__ >= 201112L)
299-
# define OMPI_REMOVED_STATIC_ASSERT_MSG(func, newfunc) _Static_assert(0, #func " was removed in MPI-3.0. Use " #newfunc " instead.")
300-
# define OMPI_OMIT_MPI1_COMPAT_DECLS 1
301-
# define OMPI_REMOVED_USE_STATIC_ASSERT 1
302-
# else
303-
# if OPAL_HAVE_ATTRIBUTE_ERROR
304-
# define __mpi_interface_removed__(func, newfunc) __attribute__((__error__(#func " was removed in MPI-3.0. Use " #newfunc " instead.")))
305-
# define OMPI_OMIT_MPI1_COMPAT_DECLS 0
306-
# else
307-
# define OMPI_OMIT_MPI1_COMPAT_DECLS 1
308-
# define OMPI_REMOVED_USE_STATIC_ASSERT 0
309-
# endif
310-
# endif
311-
>>>>>>> 94f21129... Fixes Issue 6278 (removed prototypes only warning)
312280
# endif
313281
# endif
314282
#endif
@@ -322,22 +290,6 @@
322290
# define __mpi_interface_deprecated__(msg)
323291
#endif
324292

325-
#if !defined(__mpi_interface_removed__)
326-
# define __mpi_interface_removed__(A,B)
327-
#endif
328-
329-
#if !defined(OMPI_REMOVED_STATIC_ASSERT_MSG)
330-
# define OMPI_REMOVED_STATIC_ASSERT_MSG(func, newfunc)
331-
#endif
332-
333-
#if !defined(OMPI_REMOVED_USE_STATIC_ASSERT)
334-
# define OMPI_REMOVED_USE_STATIC_ASSERT 0
335-
#endif
336-
337-
#if !defined(OMPI_OMIT_MPI1_COMPAT_DECLS)
338-
# define OMPI_OMIT_MPI1_COMPAT_DECLS !OMPI_ENABLE_MPI1_COMPAT
339-
#endif
340-
341293
/*
342294
* To accomodate programs written for MPI implementations that use a
343295
* straight ROMIO import
@@ -1038,23 +990,6 @@ OMPI_DECLSPEC extern struct ompi_predefined_info_t ompi_mpi_info_env;
1038990
OMPI_DECLSPEC extern MPI_Fint *MPI_F_STATUS_IGNORE;
1039991
OMPI_DECLSPEC extern MPI_Fint *MPI_F_STATUSES_IGNORE;
1040992

1041-
#if !OMPI_OMIT_MPI1_COMPAT_DECLS
1042-
/*
1043-
* Removed datatypes. These datatypes are only available if Open MPI
1044-
* was configured with --enable-mpi1-compatibility.
1045-
*
1046-
* These datatypes were formally removed from the MPI specification
1047-
* and should no longer be used in MPI applications.
1048-
*/
1049-
#define MPI_UB OMPI_PREDEFINED_GLOBAL(MPI_Datatype, ompi_mpi_ub)
1050-
#define MPI_LB OMPI_PREDEFINED_GLOBAL(MPI_Datatype, ompi_mpi_lb)
1051-
1052-
OMPI_DECLSPEC extern struct ompi_predefined_datatype_t ompi_mpi_lb
1053-
OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_LB, MPI_Type_create_resized);
1054-
OMPI_DECLSPEC extern struct ompi_predefined_datatype_t ompi_mpi_ub
1055-
OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_UB, MPI_Type_create_resized);
1056-
#endif /* !OMPI_OMIT_MPI1_COMPAT_DECLS */
1057-
1058993
/*
1059994
* MPI predefined handles
1060995
*/
@@ -2705,98 +2640,6 @@ OMPI_DECLSPEC int OMPI_C_MPI_NULL_DELETE_FN( MPI_Comm comm, int comm_keyval,
27052640
void* extra_state )
27062641
__mpi_interface_deprecated__("MPI_NULL_DELETE_FN was deprecated in MPI-2.0; use MPI_COMM_NULL_DELETE_FN instead.");
27072642

2708-
#if !OMPI_OMIT_MPI1_COMPAT_DECLS
2709-
/*
2710-
* Removed typedefs. These typedefs are only available if Open MPI
2711-
* was configured with --enable-mpi1-compatibility.
2712-
*
2713-
* These typedefs were formally removed from the MPI specification
2714-
* and should no longer be used in MPI applications.
2715-
*
2716-
* Even though MPI_Handler_function is removed, we do not use the
2717-
* attributes marking it as such, because otherwise the compiler
2718-
* will warn for all the functions that are declared using them
2719-
* (e.g., MPI_Errhandler_create).
2720-
*/
2721-
typedef void (MPI_Handler_function)(MPI_Comm *, int *, ...);
2722-
/* MPI_Handler_function was removed in MPI-3.0; use MPI_Comm_use_errhandler_function instead. */
2723-
2724-
/*
2725-
* Removed prototypes. These prototypes are only available if Open
2726-
* MPI was configured with --enable-mpi1-compatibility.
2727-
*
2728-
* These functions were formally removed from the MPI specification
2729-
* and should no longer be used in MPI applications.
2730-
*/
2731-
OMPI_DECLSPEC int MPI_Address(void *location, MPI_Aint *address)
2732-
__mpi_interface_removed__(MPI_Address, MPI_Get_address);
2733-
OMPI_DECLSPEC int PMPI_Address(void *location, MPI_Aint *address)
2734-
__mpi_interface_removed__(PMPI_Address, PMPI_Get_address);
2735-
OMPI_DECLSPEC int MPI_Errhandler_create(MPI_Handler_function *function,
2736-
MPI_Errhandler *errhandler)
2737-
__mpi_interface_removed__(MPI_Errhandler_create, MPI_Comm_create_errhandler);
2738-
OMPI_DECLSPEC int PMPI_Errhandler_create(MPI_Handler_function *function,
2739-
MPI_Errhandler *errhandler)
2740-
__mpi_interface_removed__(PMPI_Errhandler_create, PMPI_Comm_create_errhandler);
2741-
OMPI_DECLSPEC int MPI_Errhandler_get(MPI_Comm comm, MPI_Errhandler *errhandler)
2742-
__mpi_interface_removed__(MPI_Errhandler_get, MPI_Comm_get_errhandler);
2743-
OMPI_DECLSPEC int PMPI_Errhandler_get(MPI_Comm comm, MPI_Errhandler *errhandler)
2744-
__mpi_interface_removed__(PMPI_Errhandler_get, PMPI_Comm_get_errhandler);
2745-
OMPI_DECLSPEC int MPI_Errhandler_set(MPI_Comm comm, MPI_Errhandler errhandler)
2746-
__mpi_interface_removed__(MPI_Errhandler_set, MPI_Comm_set_errhandler);
2747-
OMPI_DECLSPEC int PMPI_Errhandler_set(MPI_Comm comm, MPI_Errhandler errhandler)
2748-
__mpi_interface_removed__(PMPI_Errhandler_set, PMPI_Comm_set_errhandler);
2749-
OMPI_DECLSPEC int MPI_Type_extent(MPI_Datatype type, MPI_Aint *extent)
2750-
__mpi_interface_removed__(MPI_Type_extent, MPI_Type_get_extent);
2751-
OMPI_DECLSPEC int PMPI_Type_extent(MPI_Datatype type, MPI_Aint *extent)
2752-
__mpi_interface_removed__(PMPI_Type_extent, PMPI_Type_get_extent);
2753-
OMPI_DECLSPEC int MPI_Type_hindexed(int count, int array_of_blocklengths[],
2754-
MPI_Aint array_of_displacements[],
2755-
MPI_Datatype oldtype, MPI_Datatype *newtype)
2756-
__mpi_interface_removed__(MPI_Type_hindexed, MPI_Type_create_hindexed);
2757-
OMPI_DECLSPEC int PMPI_Type_hindexed(int count, int array_of_blocklengths[],
2758-
MPI_Aint array_of_displacements[],
2759-
MPI_Datatype oldtype, MPI_Datatype *newtype)
2760-
__mpi_interface_removed__(PMPI_Type_hindexed, PMPI_Type_create_hindexed);
2761-
OMPI_DECLSPEC int MPI_Type_hvector(int count, int blocklength, MPI_Aint stride,
2762-
MPI_Datatype oldtype, MPI_Datatype *newtype)
2763-
__mpi_interface_removed__(MPI_Type_hvector, MPI_Type_create_hvector);
2764-
OMPI_DECLSPEC int PMPI_Type_hvector(int count, int blocklength, MPI_Aint stride,
2765-
MPI_Datatype oldtype, MPI_Datatype *newtype)
2766-
__mpi_interface_removed__(PMPI_Type_hvector, PMPI_Type_create_hvector);
2767-
OMPI_DECLSPEC int MPI_Type_lb(MPI_Datatype type, MPI_Aint *lb)
2768-
__mpi_interface_removed__(MPI_Type_lb, MPI_Type_get_extent);
2769-
OMPI_DECLSPEC int PMPI_Type_lb(MPI_Datatype type, MPI_Aint *lb)
2770-
__mpi_interface_removed__(PMPI_Type_lb, PMPI_Type_get_extent);
2771-
OMPI_DECLSPEC int MPI_Type_struct(int count, int array_of_blocklengths[],
2772-
MPI_Aint array_of_displacements[],
2773-
MPI_Datatype array_of_types[],
2774-
MPI_Datatype *newtype)
2775-
__mpi_interface_removed__(MPI_Type_struct, MPI_Type_create_struct);
2776-
OMPI_DECLSPEC int PMPI_Type_struct(int count, int array_of_blocklengths[],
2777-
MPI_Aint array_of_displacements[],
2778-
MPI_Datatype array_of_types[],
2779-
MPI_Datatype *newtype)
2780-
__mpi_interface_removed__(PMPI_Type_struct, PMPI_Type_create_struct);
2781-
OMPI_DECLSPEC int MPI_Type_ub(MPI_Datatype mtype, MPI_Aint *ub)
2782-
__mpi_interface_removed__(MPI_Type_ub, MPI_Type_get_extent);
2783-
OMPI_DECLSPEC int PMPI_Type_ub(MPI_Datatype mtype, MPI_Aint *ub)
2784-
__mpi_interface_removed__(PMPI_Type_ub, PMPI_Type_get_extent);
2785-
#endif /* !OMPI_OMIT_MPI1_COMPAT_DECLS */
2786-
2787-
#if OMPI_REMOVED_USE_STATIC_ASSERT
2788-
#define MPI_Address(...) OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_Address, MPI_Get_address)
2789-
#define MPI_Errhandler_create OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_Errhandler_create, MPI_Comm_create_errhandler)
2790-
#define MPI_Errhandler_get(...) OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_Errhandler_get, MPI_Comm_get_errhandler)
2791-
#define MPI_Errhandler_set(...) OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_Errhandler_set, MPI_Comm_set_errhandler)
2792-
#define MPI_Type_extent(...) OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_Type_extent, MPI_Type_get_extent)
2793-
#define MPI_Type_hindexed(...) OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_Type_hindexed, MPI_Type_create_hindexed)
2794-
#define MPI_Type_hvector(...) OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_Type_hvector, MPI_Type_create_hvector)
2795-
#define MPI_Type_lb(...) OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_Type_lb, MPI_Type_get_extent)
2796-
#define MPI_Type_struct OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_Type_struct, MPI_Type_create_struct)
2797-
#define MPI_Type_ub(...) OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_Type_ub, MPI_Type_get_extent)
2798-
#endif
2799-
28002643
#if defined(c_plusplus) || defined(__cplusplus)
28012644
}
28022645
#endif

ompi/mpi/c/Makefile.am

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -437,20 +437,6 @@ libmpi_c_mpi_la_SOURCES = \
437437
win_wait.c
438438

439439

440-
if OMPI_ENABLE_MPI1_COMPAT
441-
libmpi_c_mpi_la_SOURCES += \
442-
address.c \
443-
errhandler_create.c \
444-
errhandler_get.c \
445-
errhandler_set.c \
446-
type_extent.c \
447-
type_hindexed.c \
448-
type_hvector.c \
449-
type_lb.c \
450-
type_struct.c \
451-
type_ub.c
452-
endif
453-
454440
# Conditionally install the header files
455441

456442
if WANT_INSTALL_HEADERS

ompi/mpi/c/address.c

Lines changed: 0 additions & 61 deletions
This file was deleted.

ompi/mpi/c/errhandler_create.c

Lines changed: 0 additions & 50 deletions
This file was deleted.

0 commit comments

Comments
 (0)