Skip to content

Commit 1b205ef

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 0d6d5d4 commit 1b205ef

File tree

10 files changed

+14
-232
lines changed

10 files changed

+14
-232
lines changed

ompi/datatype/ompi_datatype_args.c

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* reserved.
1616
* Copyright (c) 2015-2019 Research Organization for Information Science
1717
* and Technology (RIST). All rights reserved.
18-
* Copyright (c) 2017 IBM Corporation. All rights reserved.
18+
* Copyright (c) 2017-2019 IBM Corporation. All rights reserved.
1919
* $COPYRIGHT$
2020
*
2121
* Additional copyrights may follow
@@ -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 & 133 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,6 @@
136136
/* Whether we have FORTRAN REAL*8 or not */
137137
#undef OMPI_HAVE_FORTRAN_REAL8
138138

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

@@ -281,32 +278,6 @@
281278
# endif
282279
# endif
283280

284-
/* For removed API, there is no portable way to cause the
285-
* C compiler to error with a nice message on the usage of
286-
* one of these symbols, so instead we use a C11 static_assert
287-
* If the user is not using a C11 compiler, they will get an
288-
* undefined reference, but no line number or nice message.
289-
*/
290-
# if (OMPI_ENABLE_MPI1_COMPAT || OMPI_BUILDING)
291-
# define OMPI_OMIT_MPI1_COMPAT_DECLS 0
292-
# define MPI_INTERFACE_REMOVED(func, newfunc, ...) func(__VA_ARGS) __mpi_interface_deprecated__((#func " was removed in MPI-3.0. Use " #newfunc " instead. continuing..."))
293-
# else
294-
# if (__STDC_VERSION__ >= 201112L)
295-
# define MPI_INTERFACE_REMOVED(func, newfunc, ...) _Static_assert(0, #func " was removed in MPI-3.0. Use " #newfunc " instead.")
296-
# define OMPI_OMIT_MPI1_COMPAT_DECLS 0
297-
# else
298-
# if OPAL_HAVE_ATTRIBUTE_ERROR
299-
# define MPI_INTERFACE_REMOVED(func, newfunc, ...) func(__VA_ARGS) __attribute__((__error__(#func " was removed in MPI-3.0. Use " #newfunc " instead.")))
300-
# define OMPI_OMIT_MPI1_COMPAT_DECLS 0
301-
# else
302-
# define MPI_INTERFACE_REMOVED(func, newfunc, ...) func(__VA_ARGS)
303-
# define OMPI_OMIT_MPI1_COMPAT_DECLS 1
304-
# endif
305-
# endif
306-
# endif
307-
# endif
308-
#endif
309-
310281
/*
311282
* If we didn't define __mpi_interface_deprecated__ above, then we
312283
* don't want it, so define it to empty (can't use #undef in the logic
@@ -316,14 +287,6 @@
316287
# define __mpi_interface_deprecated__(msg)
317288
#endif
318289

319-
#if !defined(__mpi_interface_removed__)
320-
# define __mpi_interface_removed__(msg)
321-
#endif
322-
323-
#if !defined(OMPI_OMIT_MPI1_COMPAT_DECLS)
324-
# define OMPI_OMIT_MPI1_COMPAT_DECLS !OMPI_ENABLE_MPI1_COMPAT
325-
#endif
326-
327290
/*
328291
* To accomodate programs written for MPI implementations that use a
329292
* straight ROMIO import
@@ -1023,23 +986,6 @@ OMPI_DECLSPEC extern struct ompi_predefined_info_t ompi_mpi_info_env;
1023986
OMPI_DECLSPEC extern MPI_Fint *MPI_F_STATUS_IGNORE;
1024987
OMPI_DECLSPEC extern MPI_Fint *MPI_F_STATUSES_IGNORE;
1025988

1026-
#if !OMPI_OMIT_MPI1_COMPAT_DECLS
1027-
/*
1028-
* Removed datatypes. These datatypes are only available if Open MPI
1029-
* was configured with --enable-mpi1-compatibility.
1030-
*
1031-
* These datatypes were formally removed from the MPI specification
1032-
* and should no longer be used in MPI applications.
1033-
*/
1034-
#define MPI_UB OMPI_PREDEFINED_GLOBAL(MPI_Datatype, ompi_mpi_ub)
1035-
#define MPI_LB OMPI_PREDEFINED_GLOBAL(MPI_Datatype, ompi_mpi_lb)
1036-
1037-
OMPI_DECLSPEC extern struct ompi_predefined_datatype_t ompi_mpi_lb
1038-
__mpi_interface_removed__("MPI_LB was removed in MPI-3.0; use MPI_Type_create_resized instead.");
1039-
OMPI_DECLSPEC extern struct ompi_predefined_datatype_t ompi_mpi_ub
1040-
__mpi_interface_removed__("MPI_UB was removed in MPI-3.0; use MPI_Type_create_resized instead.");
1041-
#endif /* !OMPI_OMIT_MPI1_COMPAT_DECLS */
1042-
1043989
/*
1044990
* MPI predefined handles
1045991
*/
@@ -2684,85 +2630,6 @@ OMPI_DECLSPEC int OMPI_C_MPI_NULL_DELETE_FN( MPI_Comm comm, int comm_keyval,
26842630
void* extra_state )
26852631
__mpi_interface_deprecated__("MPI_NULL_DELETE_FN was deprecated in MPI-2.0; use MPI_COMM_NULL_DELETE_FN instead.");
26862632

2687-
#if !OMPI_OMIT_MPI1_COMPAT_DECLS
2688-
/*
2689-
* Removed typedefs. These typedefs are only available if Open MPI
2690-
* was configured with --enable-mpi1-compatibility.
2691-
*
2692-
* These typedefs were formally removed from the MPI specification
2693-
* and should no longer be used in MPI applications.
2694-
*
2695-
* Even though MPI_Handler_function is removed, we do not use the
2696-
* attributes marking it as such, because otherwise the compiler
2697-
* will warn for all the functions that are declared using them
2698-
* (e.g., MPI_Errhandler_create).
2699-
*/
2700-
typedef void (MPI_Handler_function)(MPI_Comm *, int *, ...);
2701-
/* MPI_Handler_function was removed in MPI-3.0; use MPI_Comm_use_errhandler_function instead. */
2702-
2703-
/*
2704-
* Removed prototypes. These prototypes are only available if Open
2705-
* MPI was configured with --enable-mpi1-compatibility.
2706-
*
2707-
* These functions were formally removed from the MPI specification
2708-
* and should no longer be used in MPI applications.
2709-
*/
2710-
OMPI_DECLSPEC int MPI_Address(void *location, MPI_Aint *address);
2711-
#define MPI_Address(...) MPI_INTERFACE_REMOVED(MPI_Address, MPI_Get_address)
2712-
OMPI_DECLSPEC int PMPI_Address(void *location, MPI_Aint *address);
2713-
#define PMPI_Address(...) MPI_INTERFACE_REMOVED(PMPI_Address, PMPI_Get_address)
2714-
OMPI_DECLSPEC int MPI_Errhandler_create(MPI_Handler_function *function,
2715-
MPI_Errhandler *errhandler);
2716-
#define MPI_Errhandler_create MPI_INTERFACE_REMOVED(MPI_Errhandler_create, MPI_Comm_create_errhandler)
2717-
OMPI_DECLSPEC int PMPI_Errhandler_create(MPI_Handler_function *function,
2718-
MPI_Errhandler *errhandler);
2719-
#define PMPI_Errhandler_create MPI_INTERFACE_REMOVED(PMPI_Errhandler_create, PMPI_Comm_create_errhandler)
2720-
OMPI_DECLSPEC int MPI_Errhandler_get(MPI_Comm comm, MPI_Errhandler *errhandler);
2721-
#define MPI_Errhandler_get(...) MPI_INTERFACE_REMOVED(MPI_Errhandler_get, MPI_Comm_get_errhandler)
2722-
OMPI_DECLSPEC int PMPI_Errhandler_get(MPI_Comm comm, MPI_Errhandler *errhandler);
2723-
#define PMPI_Errhandler_get(...) MPI_INTERFACE_REMOVED(PMPI_Errhandler_get, PMPI_Comm_get_errhandler)
2724-
OMPI_DECLSPEC int MPI_Errhandler_set(MPI_Comm comm, MPI_Errhandler errhandler);
2725-
#define MPI_Errhandler_set(...) MPI_INTERFACE_REMOVED(MPI_Errhandler_set, MPI_Comm_set_errhandler)
2726-
OMPI_DECLSPEC int PMPI_Errhandler_set(MPI_Comm comm, MPI_Errhandler errhandler);
2727-
#define PMPI_Errhandler_set(...) MPI_INTERFACE_REMOVED(PMPI_Errhandler_set, PMPI_Comm_set_errhandler)
2728-
OMPI_DECLSPEC int MPI_Type_extent(MPI_Datatype type, MPI_Aint *extent);
2729-
#define MPI_Type_extent(...) MPI_INTERFACE_REMOVED(MPI_Type_extent, MPI_Type_get_extent)
2730-
OMPI_DECLSPEC int PMPI_Type_extent(MPI_Datatype type, MPI_Aint *extent);
2731-
#define PMPI_Type_extent(...) MPI_INTERFACE_REMOVED(PMPI_Type_extent, PMPI_Type_get_extent)
2732-
OMPI_DECLSPEC int MPI_Type_hindexed(int count, int array_of_blocklengths[],
2733-
MPI_Aint array_of_displacements[],
2734-
MPI_Datatype oldtype, MPI_Datatype *newtype);
2735-
#define MPI_Type_hindexed(...) MPI_INTERFACE_REMOVED(MPI_Type_hindexed, MPI_Type_create_hindexed)
2736-
OMPI_DECLSPEC int PMPI_Type_hindexed(int count, int array_of_blocklengths[],
2737-
MPI_Aint array_of_displacements[],
2738-
MPI_Datatype oldtype, MPI_Datatype *newtype);
2739-
#define PMPI_Type_hindexed(...) MPI_INTERFACE_REMOVED(PMPI_Type_hindexed, PMPI_Type_create_hindexed)
2740-
OMPI_DECLSPEC int MPI_Type_hvector(int count, int blocklength, MPI_Aint stride,
2741-
MPI_Datatype oldtype, MPI_Datatype *newtype);
2742-
#define MPI_Type_hvector(...) MPI_INTERFACE_REMOVED(MPI_Type_hvector, MPI_Type_create_hvector)
2743-
OMPI_DECLSPEC int PMPI_Type_hvector(int count, int blocklength, MPI_Aint stride,
2744-
MPI_Datatype oldtype, MPI_Datatype *newtype);
2745-
#define PMPI_Type_hvector(...) MPI_INTERFACE_REMOVED(PMPI_Type_hvector, PMPI_Type_create_hvector)
2746-
OMPI_DECLSPEC int MPI_Type_lb(MPI_Datatype type, MPI_Aint *lb);
2747-
#define MPI_Type_lb(...) MPI_INTERFACE_REMOVED(MPI_Type_lb, MPI_Type_get_extent)
2748-
OMPI_DECLSPEC int PMPI_Type_lb(MPI_Datatype type, MPI_Aint *lb);
2749-
#define PMPI_Type_lb(...) MPI_INTERFACE_REMOVED(PMPI_Type_lb, PMPI_Type_get_extent)
2750-
OMPI_DECLSPEC int MPI_Type_struct(int count, int array_of_blocklengths[],
2751-
MPI_Aint array_of_displacements[],
2752-
MPI_Datatype array_of_types[],
2753-
MPI_Datatype *newtype);
2754-
#define MPI_Type_struct MPI_INTERFACE_REMOVED(MPI_Type_struct, MPI_Type_create_struct)
2755-
OMPI_DECLSPEC int PMPI_Type_struct(int count, int array_of_blocklengths[],
2756-
MPI_Aint array_of_displacements[],
2757-
MPI_Datatype array_of_types[],
2758-
MPI_Datatype *newtype);
2759-
#define PMPI_Type_struct MPI_INTERFACE_REMOVED(PMPI_Type_struct, PMPI_Type_create_struct)
2760-
OMPI_DECLSPEC int MPI_Type_ub(MPI_Datatype mtype, MPI_Aint *ub);
2761-
#define MPI_Type_ub(...) MPI_INTERFACE_REMOVED(MPI_Type_ub, MPI_Type_get_extent)
2762-
OMPI_DECLSPEC int PMPI_Type_ub(MPI_Datatype mtype, MPI_Aint *ub);
2763-
#define PMPI_Type_ub(...) MPI_INTERFACE_REMOVED(PMPI_Type_ub, PMPI_Type_get_extent)
2764-
#endif /* !OMPI_OMIT_MPI1_COMPAT_DECLS */
2765-
27662633

27672634
#if defined(c_plusplus) || defined(__cplusplus)
27682635
}

ompi/mpi/c/Makefile.am

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
# reserved.
1818
# Copyright (c) 2015-2018 Research Organization for Information Science
1919
# and Technology (RIST). All rights reserved.
20+
# Copyright (c) 2019 IBM Corporation. All rights reserved.
2021
# $COPYRIGHT$
2122
#
2223
# Additional copyrights may follow
@@ -436,21 +437,6 @@ libmpi_c_mpi_la_SOURCES = \
436437
win_unlock_all.c \
437438
win_wait.c
438439

439-
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/profile/Makefile.am

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -416,20 +416,6 @@ nodist_libmpi_c_pmpi_la_SOURCES = \
416416
pwin_unlock_all.c \
417417
pwin_wait.c
418418

419-
if OMPI_ENABLE_MPI1_COMPAT
420-
nodist_libmpi_c_pmpi_la_SOURCES += \
421-
paddress.c \
422-
perrhandler_create.c \
423-
perrhandler_get.c \
424-
perrhandler_set.c \
425-
ptype_extent.c \
426-
ptype_hindexed.c \
427-
ptype_hvector.c \
428-
ptype_lb.c \
429-
ptype_struct.c \
430-
ptype_ub.c
431-
endif
432-
433419
#
434420
# Sym link in the sources from the real MPI directory
435421
#

ompi/mpi/cxx/mpicxx.cc

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
// Copyright (c) 2011 FUJITSU LIMITED. All rights reserved.
1616
// Copyright (c) 2017 Research Organization for Information Science
1717
// and Technology (RIST). All rights reserved.
18+
// Copyright (c) 2019 IBM Corporation. All rights reserved.
1819
// $COPYRIGHT$
1920
//
2021
// Additional copyrights may follow
@@ -163,10 +164,4 @@ const char*** ARGVS_NULL = (const char***) MPI_ARGVS_NULL;
163164
// empty group
164165
const Group GROUP_EMPTY(MPI_GROUP_EMPTY);
165166

166-
#if OMPI_ENABLE_MPI1_COMPAT
167-
// special datatypes for contstruction of derived datatypes
168-
const Datatype UB(MPI_UB);
169-
const Datatype LB(MPI_LB);
170-
#endif
171-
172167
} /* namespace MPI */

ompi/mpi/fortran/configure-fortran-output.h.in

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,6 @@
106106
#define OMPI_KIND_FORTRAN_COMPLEX32 @OMPI_KIND_FORTRAN_COMPLEX32@
107107
#define OMPI_SIZEOF_FORTRAN_COMPLEX32 @OMPI_SIZEOF_FORTRAN_COMPLEX32@
108108
109-
#define OMPI_ENABLE_MPI1_COMPAT @OMPI_ENABLE_MPI1_COMPAT@
110-
111109
! Include some post-processing, based on the values from above
112110
113111
#include "ompi/mpi/fortran/configure-fortran-output-bottom.h"

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

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -482,21 +482,6 @@ lib@OMPI_LIBMPI_NAME@_mpifh_la_SOURCES += \
482482
win_flush_local_all_f.c
483483

484484

485-
if OMPI_ENABLE_MPI1_COMPAT
486-
lib@OMPI_LIBMPI_NAME@_mpifh_la_SOURCES += \
487-
address_f.c \
488-
errhandler_create_f.c \
489-
errhandler_get_f.c \
490-
errhandler_set_f.c \
491-
type_extent_f.c \
492-
type_hindexed_f.c \
493-
type_hvector_f.c \
494-
type_lb_f.c \
495-
type_struct_f.c \
496-
type_ub_f.c
497-
endif
498-
endif
499-
500485
#
501486
# Conditionally install the header files
502487
#

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

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -397,19 +397,6 @@ linked_files = \
397397
pwin_flush_local_f.c \
398398
pwin_flush_local_all_f.c
399399

400-
if OMPI_ENABLE_MPI1_COMPAT
401-
linked_files += \
402-
paddress_f.c \
403-
perrhandler_create_f.c \
404-
perrhandler_get_f.c \
405-
perrhandler_set_f.c \
406-
ptype_extent_f.c \
407-
ptype_hindexed_f.c \
408-
ptype_hvector_f.c \
409-
ptype_lb_f.c \
410-
ptype_struct_f.c \
411-
ptype_ub_f.c
412-
endif
413400

414401
#
415402
# Sym link in the sources from the real MPI directory

ompi/mpi/fortran/use-mpi-ignore-tkr/mpi-ignore-tkr.F90

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,6 @@ module mpi
4343

4444
include "ompi/mpi/fortran/use-mpi-ignore-tkr/mpi-ignore-tkr-interfaces.h"
4545
include "ompi/mpi/fortran/use-mpi-ignore-tkr/mpi-ignore-tkr-file-interfaces.h"
46-
#if !defined(OMPI_ENABLE_MPI1_COMPAT)
47-
48-
#error "Remove MPI-1 compat code"
49-
50-
#elif OMPI_ENABLE_MPI1_COMPAT
51-
include "ompi/mpi/fortran/use-mpi-ignore-tkr/mpi-ignore-tkr-removed-interfaces.h"
52-
#endif
5346

5447
include 'mpi-ignore-tkr-sizeof.h'
5548

ompi/mpi/fortran/use-mpi-tkr/mpi.F90

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,4 @@ module mpi
6060
include "mpi-tkr-sizeof.h"
6161
#endif
6262

63-
#if !defined(OMPI_ENABLE_MPI1_COMPAT)
64-
65-
#error "Remove MPI-1 compat code"
66-
67-
#elif OMPI_ENABLE_MPI1_COMPAT
68-
include "mpi-f90-removed-interfaces.h"
69-
include "pmpi-f90-removed-interfaces.h"
70-
#endif
71-
7263
end module mpi

0 commit comments

Comments
 (0)