Skip to content

Commit 5700f4f

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 ee6b039 commit 5700f4f

23 files changed

+12
-991
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 & 186 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,51 +277,6 @@
280277
# define __mpi_interface_deprecated__(msg) __attribute__((__deprecated__))
281278
# endif
282279
# endif
283-
# endif
284-
285-
/* For MPI removed APIs, there is no generally portable way to cause
286-
* the C compiler to error with a nice message, on the _usage_ of
287-
* one of these symbols. We've gone with tiered appraoch:
288-
*
289-
* If the user configured with --enable-mpi1-compatibility,
290-
* just emit a compiletime warning (via the deprecation function
291-
* attribute) that they're using an MPI1 removed function.
292-
*
293-
* Otherwise, we'd like to issue a fatal error directing the user
294-
* that they've used an MPI1 removed function. If the user's
295-
* compiler supports C11 _Static_assert feature, we #define
296-
* the MPI routines to instead be a call to _Static_assert
297-
* with an appropreate message suggesting the new MPI3 equivalent.
298-
*
299-
* Otherwise, if the user's compiler supports the error function
300-
* attribute, define the MPI routines with that error attribute.
301-
* This is supported by most modern GNU compilers.
302-
*
303-
* Finally if the compiler doesn't support any of those, just
304-
* Don't declare those MPI routines at all in mpi.h
305-
*
306-
* Don't do MACRO magic for building Profiling library as it
307-
* interferes with the above.
308-
*/
309-
# if (OMPI_ENABLE_MPI1_COMPAT || OMPI_BUILDING)
310-
# define OMPI_OMIT_MPI1_COMPAT_DECLS 0
311-
# define OMPI_REMOVED_USE_STATIC_ASSERT 0
312-
# define __mpi_interface_removed__(func, newfunc) __mpi_interface_deprecated__(#func " was removed in MPI-3.0. Use " #newfunc " instead. continuing...")
313-
# else
314-
# if (__STDC_VERSION__ >= 201112L)
315-
# define OMPI_OMIT_MPI1_COMPAT_DECLS 1
316-
# define OMPI_REMOVED_USE_STATIC_ASSERT 1
317-
# define OMPI_REMOVED_STATIC_ASSERT_MSG(func, newfunc) _Static_assert(0, #func " was removed in MPI-3.0. Use " #newfunc " instead.")
318-
# else
319-
# if OPAL_HAVE_ATTRIBUTE_ERROR
320-
# define OMPI_OMIT_MPI1_COMPAT_DECLS 0
321-
# define OMPI_REMOVED_USE_STATIC_ASSERT 0
322-
# define __mpi_interface_removed__(func, newfunc) __attribute__((__error__(#func " was removed in MPI-3.0. Use " #newfunc " instead.")))
323-
# else
324-
# define OMPI_OMIT_MPI1_COMPAT_DECLS 1
325-
# define OMPI_REMOVED_USE_STATIC_ASSERT 0
326-
# endif
327-
# endif
328280
# endif
329281
# endif
330282
#endif
@@ -338,22 +290,6 @@
338290
# define __mpi_interface_deprecated__(msg)
339291
#endif
340292

341-
#if !defined(__mpi_interface_removed__)
342-
# define __mpi_interface_removed__(A,B)
343-
#endif
344-
345-
#if !defined(OMPI_REMOVED_STATIC_ASSERT_MSG)
346-
# define OMPI_REMOVED_STATIC_ASSERT_MSG(func, newfunc)
347-
#endif
348-
349-
#if !defined(OMPI_REMOVED_USE_STATIC_ASSERT)
350-
# define OMPI_REMOVED_USE_STATIC_ASSERT 0
351-
#endif
352-
353-
#if !defined(OMPI_OMIT_MPI1_COMPAT_DECLS)
354-
# define OMPI_OMIT_MPI1_COMPAT_DECLS !OMPI_ENABLE_MPI1_COMPAT
355-
#endif
356-
357293
/*
358294
* To accomodate programs written for MPI implementations that use a
359295
* straight ROMIO import
@@ -1054,36 +990,6 @@ OMPI_DECLSPEC extern struct ompi_predefined_info_t ompi_mpi_info_env;
1054990
OMPI_DECLSPEC extern MPI_Fint *MPI_F_STATUS_IGNORE;
1055991
OMPI_DECLSPEC extern MPI_Fint *MPI_F_STATUSES_IGNORE;
1056992

1057-
/*
1058-
* Removed datatypes. These datatypes are only available if Open MPI
1059-
* was configured with --enable-mpi1-compatibility.
1060-
*
1061-
* These datatypes were formally removed from the MPI specification
1062-
* and should no longer be used in MPI applications.
1063-
*/
1064-
#if (OMPI_ENABLE_MPI1_COMPAT || OMPI_BUILDING)
1065-
# define MPI_UB OMPI_PREDEFINED_GLOBAL(MPI_Datatype, ompi_mpi_ub)
1066-
# define MPI_LB OMPI_PREDEFINED_GLOBAL(MPI_Datatype, ompi_mpi_lb)
1067-
1068-
OMPI_DECLSPEC extern struct ompi_predefined_datatype_t ompi_mpi_lb;
1069-
OMPI_DECLSPEC extern struct ompi_predefined_datatype_t ompi_mpi_ub;
1070-
1071-
#else
1072-
/* If not building or configured --enable-mpi1-compatibility,
1073-
* then we don't want these, but we include them so that we can
1074-
* Staticly assert with a nice message.
1075-
*/
1076-
# if (OMPI_REMOVED_USE_STATIC_ASSERT)
1077-
# define MPI_UB OMPI_PREDEFINED_GLOBAL(MPI_Datatype, ompi_mpi_ub)
1078-
# define MPI_LB OMPI_PREDEFINED_GLOBAL(MPI_Datatype, ompi_mpi_lb)
1079-
1080-
OMPI_DECLSPEC extern struct ompi_predefined_datatype_t ompi_mpi_lb
1081-
OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_LB, MPI_Type_create_resized);
1082-
OMPI_DECLSPEC extern struct ompi_predefined_datatype_t ompi_mpi_ub
1083-
OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_UB, MPI_Type_create_resized);
1084-
#endif /* Removed datatypes */
1085-
1086-
1087993
/*
1088994
* MPI predefined handles
1089995
*/
@@ -2734,98 +2640,6 @@ OMPI_DECLSPEC int OMPI_C_MPI_NULL_DELETE_FN( MPI_Comm comm, int comm_keyval,
27342640
void* extra_state )
27352641
__mpi_interface_deprecated__("MPI_NULL_DELETE_FN was deprecated in MPI-2.0; use MPI_COMM_NULL_DELETE_FN instead.");
27362642

2737-
#if !OMPI_OMIT_MPI1_COMPAT_DECLS
2738-
/*
2739-
* Removed typedefs. These typedefs are only available if Open MPI
2740-
* was configured with --enable-mpi1-compatibility.
2741-
*
2742-
* These typedefs were formally removed from the MPI specification
2743-
* and should no longer be used in MPI applications.
2744-
*
2745-
* Even though MPI_Handler_function is removed, we do not use the
2746-
* attributes marking it as such, because otherwise the compiler
2747-
* will warn for all the functions that are declared using them
2748-
* (e.g., MPI_Errhandler_create).
2749-
*/
2750-
typedef void (MPI_Handler_function)(MPI_Comm *, int *, ...);
2751-
/* MPI_Handler_function was removed in MPI-3.0; use MPI_Comm_use_errhandler_function instead. */
2752-
2753-
/*
2754-
* Removed prototypes. These prototypes are only available if Open
2755-
* MPI was configured with --enable-mpi1-compatibility.
2756-
*
2757-
* These functions were formally removed from the MPI specification
2758-
* and should no longer be used in MPI applications.
2759-
*/
2760-
OMPI_DECLSPEC int MPI_Address(void *location, MPI_Aint *address)
2761-
__mpi_interface_removed__(MPI_Address, MPI_Get_address);
2762-
OMPI_DECLSPEC int PMPI_Address(void *location, MPI_Aint *address)
2763-
__mpi_interface_removed__(PMPI_Address, PMPI_Get_address);
2764-
OMPI_DECLSPEC int MPI_Errhandler_create(MPI_Handler_function *function,
2765-
MPI_Errhandler *errhandler)
2766-
__mpi_interface_removed__(MPI_Errhandler_create, MPI_Comm_create_errhandler);
2767-
OMPI_DECLSPEC int PMPI_Errhandler_create(MPI_Handler_function *function,
2768-
MPI_Errhandler *errhandler)
2769-
__mpi_interface_removed__(PMPI_Errhandler_create, PMPI_Comm_create_errhandler);
2770-
OMPI_DECLSPEC int MPI_Errhandler_get(MPI_Comm comm, MPI_Errhandler *errhandler)
2771-
__mpi_interface_removed__(MPI_Errhandler_get, MPI_Comm_get_errhandler);
2772-
OMPI_DECLSPEC int PMPI_Errhandler_get(MPI_Comm comm, MPI_Errhandler *errhandler)
2773-
__mpi_interface_removed__(PMPI_Errhandler_get, PMPI_Comm_get_errhandler);
2774-
OMPI_DECLSPEC int MPI_Errhandler_set(MPI_Comm comm, MPI_Errhandler errhandler)
2775-
__mpi_interface_removed__(MPI_Errhandler_set, MPI_Comm_set_errhandler);
2776-
OMPI_DECLSPEC int PMPI_Errhandler_set(MPI_Comm comm, MPI_Errhandler errhandler)
2777-
__mpi_interface_removed__(PMPI_Errhandler_set, PMPI_Comm_set_errhandler);
2778-
OMPI_DECLSPEC int MPI_Type_extent(MPI_Datatype type, MPI_Aint *extent)
2779-
__mpi_interface_removed__(MPI_Type_extent, MPI_Type_get_extent);
2780-
OMPI_DECLSPEC int PMPI_Type_extent(MPI_Datatype type, MPI_Aint *extent)
2781-
__mpi_interface_removed__(PMPI_Type_extent, PMPI_Type_get_extent);
2782-
OMPI_DECLSPEC int MPI_Type_hindexed(int count, int array_of_blocklengths[],
2783-
MPI_Aint array_of_displacements[],
2784-
MPI_Datatype oldtype, MPI_Datatype *newtype)
2785-
__mpi_interface_removed__(MPI_Type_hindexed, MPI_Type_create_hindexed);
2786-
OMPI_DECLSPEC int PMPI_Type_hindexed(int count, int array_of_blocklengths[],
2787-
MPI_Aint array_of_displacements[],
2788-
MPI_Datatype oldtype, MPI_Datatype *newtype)
2789-
__mpi_interface_removed__(PMPI_Type_hindexed, PMPI_Type_create_hindexed);
2790-
OMPI_DECLSPEC int MPI_Type_hvector(int count, int blocklength, MPI_Aint stride,
2791-
MPI_Datatype oldtype, MPI_Datatype *newtype)
2792-
__mpi_interface_removed__(MPI_Type_hvector, MPI_Type_create_hvector);
2793-
OMPI_DECLSPEC int PMPI_Type_hvector(int count, int blocklength, MPI_Aint stride,
2794-
MPI_Datatype oldtype, MPI_Datatype *newtype)
2795-
__mpi_interface_removed__(PMPI_Type_hvector, PMPI_Type_create_hvector);
2796-
OMPI_DECLSPEC int MPI_Type_lb(MPI_Datatype type, MPI_Aint *lb)
2797-
__mpi_interface_removed__(MPI_Type_lb, MPI_Type_get_extent);
2798-
OMPI_DECLSPEC int PMPI_Type_lb(MPI_Datatype type, MPI_Aint *lb)
2799-
__mpi_interface_removed__(PMPI_Type_lb, PMPI_Type_get_extent);
2800-
OMPI_DECLSPEC int MPI_Type_struct(int count, int array_of_blocklengths[],
2801-
MPI_Aint array_of_displacements[],
2802-
MPI_Datatype array_of_types[],
2803-
MPI_Datatype *newtype)
2804-
__mpi_interface_removed__(MPI_Type_struct, MPI_Type_create_struct);
2805-
OMPI_DECLSPEC int PMPI_Type_struct(int count, int array_of_blocklengths[],
2806-
MPI_Aint array_of_displacements[],
2807-
MPI_Datatype array_of_types[],
2808-
MPI_Datatype *newtype)
2809-
__mpi_interface_removed__(PMPI_Type_struct, PMPI_Type_create_struct);
2810-
OMPI_DECLSPEC int MPI_Type_ub(MPI_Datatype mtype, MPI_Aint *ub)
2811-
__mpi_interface_removed__(MPI_Type_ub, MPI_Type_get_extent);
2812-
OMPI_DECLSPEC int PMPI_Type_ub(MPI_Datatype mtype, MPI_Aint *ub)
2813-
__mpi_interface_removed__(PMPI_Type_ub, PMPI_Type_get_extent);
2814-
#endif /* !OMPI_OMIT_MPI1_COMPAT_DECLS */
2815-
2816-
#if OMPI_REMOVED_USE_STATIC_ASSERT
2817-
#define MPI_Address(...) OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_Address, MPI_Get_address)
2818-
#define MPI_Errhandler_create(...) OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_Errhandler_create, MPI_Comm_create_errhandler)
2819-
#define MPI_Errhandler_get(...) OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_Errhandler_get, MPI_Comm_get_errhandler)
2820-
#define MPI_Errhandler_set(...) OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_Errhandler_set, MPI_Comm_set_errhandler)
2821-
#define MPI_Type_extent(...) OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_Type_extent, MPI_Type_get_extent)
2822-
#define MPI_Type_hindexed(...) OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_Type_hindexed, MPI_Type_create_hindexed)
2823-
#define MPI_Type_hvector(...) OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_Type_hvector, MPI_Type_create_hvector)
2824-
#define MPI_Type_lb(...) OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_Type_lb, MPI_Type_get_extent)
2825-
#define MPI_Type_struct(...) OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_Type_struct, MPI_Type_create_struct)
2826-
#define MPI_Type_ub(...) OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_Type_ub, MPI_Type_get_extent)
2827-
#endif
2828-
28292643
#if defined(c_plusplus) || defined(__cplusplus)
28302644
}
28312645
#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 & 64 deletions
This file was deleted.

0 commit comments

Comments
 (0)