Skip to content

Commit

Permalink
Remove MPI1 functions and datatypes (API change!)
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
gpaulsen committed Feb 16, 2019
1 parent 115467c commit 0589597
Show file tree
Hide file tree
Showing 23 changed files with 12 additions and 931 deletions.
1 change: 0 additions & 1 deletion config/ompi_config_files.m4
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ AC_DEFUN([OMPI_CONFIG_FILES],[
ompi/mpi/fortran/use-mpi-ignore-tkr/Makefile
ompi/mpi/fortran/use-mpi-ignore-tkr/mpi-ignore-tkr-interfaces.h
ompi/mpi/fortran/use-mpi-ignore-tkr/mpi-ignore-tkr-file-interfaces.h
ompi/mpi/fortran/use-mpi-ignore-tkr/mpi-ignore-tkr-removed-interfaces.h
ompi/mpi/fortran/use-mpi-f08/Makefile
ompi/mpi/fortran/use-mpi-f08/bindings/Makefile
ompi/mpi/fortran/use-mpi-f08/mod/Makefile
Expand Down
28 changes: 11 additions & 17 deletions ompi/datatype/ompi_datatype_args.c
Original file line number Diff line number Diff line change
Expand Up @@ -841,25 +841,19 @@ ompi_datatype_t* ompi_datatype_get_single_predefined_type_from_args( ompi_dataty
return NULL;
}
}
#if OMPI_ENABLE_MPI1_COMPAT
if (current_predef != MPI_LB && current_predef != MPI_UB) {
#endif
if( NULL == predef ) { /* This is the first iteration */
predef = current_predef;
} else {
/**
* What exactly should we consider as identical types?
* If they are the same MPI level type, or if they map
* to the same OPAL datatype? In other words, MPI_FLOAT
* and MPI_REAL4 are they identical?
*/
if( predef != current_predef ) {
return NULL;
}
if( NULL == predef ) { /* This is the first iteration */
predef = current_predef;
} else {
/**
* What exactly should we consider as identical types?
* If they are the same MPI level type, or if they map
* to the same OPAL datatype? In other words, MPI_FLOAT
* and MPI_REAL4 are they identical?
*/
if( predef != current_predef ) {
return NULL;
}
#if OMPI_ENABLE_MPI1_COMPAT
}
#endif
}
return predef;
}
157 changes: 0 additions & 157 deletions ompi/include/mpi.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,6 @@
/* Whether we have FORTRAN REAL*8 or not */
#undef OMPI_HAVE_FORTRAN_REAL8

/* Whether in include MPI-1 compatibility */
#undef OMPI_ENABLE_MPI1_COMPAT

/* Whether we have float _Complex or not */
#undef HAVE_FLOAT__COMPLEX

Expand Down Expand Up @@ -280,35 +277,6 @@
# define __mpi_interface_deprecated__(msg) __attribute__((__deprecated__))
# endif
# endif
# endif

/* For removed API, there is no portable way to cause the
* C compiler to error with a nice message on the usage of
* one of these symbols, so instead we use a C11 static_assert
* If the user is not using a C11 compiler, they will get an
* undefined reference, but no line number or nice message.
*
* Don't do MACRO magic for building Profiling library as it
* interferes with that system.
*/
# if (OMPI_ENABLE_MPI1_COMPAT || OMPI_BUILDING)
# define OMPI_OMIT_MPI1_COMPAT_DECLS 0
# define __mpi_interface_removed__(func, newfunc) __mpi_interface_deprecated__(#func " was removed in MPI-3.0. Use " #newfunc " instead. continuing...")
# else
# if (__STDC_VERSION__ >= 201112L)
# define OMPI_REMOVED_STATIC_ASSERT_MSG(func, newfunc) _Static_assert(0, #func " was removed in MPI-3.0. Use " #newfunc " instead.")
# define OMPI_OMIT_MPI1_COMPAT_DECLS 1
# define OMPI_REMOVED_USE_STATIC_ASSERT 1
# else
# if OPAL_HAVE_ATTRIBUTE_ERROR
# define __mpi_interface_removed__(func, newfunc) __attribute__((__error__(#func " was removed in MPI-3.0. Use " #newfunc " instead.")))
# define OMPI_OMIT_MPI1_COMPAT_DECLS 0
# else
# define OMPI_OMIT_MPI1_COMPAT_DECLS 1
# define OMPI_REMOVED_USE_STATIC_ASSERT 0
# endif
# endif
>>>>>>> 94f21129... Fixes Issue 6278 (removed prototypes only warning)
# endif
# endif
#endif
Expand All @@ -322,22 +290,6 @@
# define __mpi_interface_deprecated__(msg)
#endif

#if !defined(__mpi_interface_removed__)
# define __mpi_interface_removed__(A,B)
#endif

#if !defined(OMPI_REMOVED_STATIC_ASSERT_MSG)
# define OMPI_REMOVED_STATIC_ASSERT_MSG(func, newfunc)
#endif

#if !defined(OMPI_REMOVED_USE_STATIC_ASSERT)
# define OMPI_REMOVED_USE_STATIC_ASSERT 0
#endif

#if !defined(OMPI_OMIT_MPI1_COMPAT_DECLS)
# define OMPI_OMIT_MPI1_COMPAT_DECLS !OMPI_ENABLE_MPI1_COMPAT
#endif

/*
* To accomodate programs written for MPI implementations that use a
* straight ROMIO import
Expand Down Expand Up @@ -1038,23 +990,6 @@ OMPI_DECLSPEC extern struct ompi_predefined_info_t ompi_mpi_info_env;
OMPI_DECLSPEC extern MPI_Fint *MPI_F_STATUS_IGNORE;
OMPI_DECLSPEC extern MPI_Fint *MPI_F_STATUSES_IGNORE;

#if !OMPI_OMIT_MPI1_COMPAT_DECLS
/*
* Removed datatypes. These datatypes are only available if Open MPI
* was configured with --enable-mpi1-compatibility.
*
* These datatypes were formally removed from the MPI specification
* and should no longer be used in MPI applications.
*/
#define MPI_UB OMPI_PREDEFINED_GLOBAL(MPI_Datatype, ompi_mpi_ub)
#define MPI_LB OMPI_PREDEFINED_GLOBAL(MPI_Datatype, ompi_mpi_lb)

OMPI_DECLSPEC extern struct ompi_predefined_datatype_t ompi_mpi_lb
OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_LB, MPI_Type_create_resized);
OMPI_DECLSPEC extern struct ompi_predefined_datatype_t ompi_mpi_ub
OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_UB, MPI_Type_create_resized);
#endif /* !OMPI_OMIT_MPI1_COMPAT_DECLS */

/*
* MPI predefined handles
*/
Expand Down Expand Up @@ -2705,98 +2640,6 @@ OMPI_DECLSPEC int OMPI_C_MPI_NULL_DELETE_FN( MPI_Comm comm, int comm_keyval,
void* extra_state )
__mpi_interface_deprecated__("MPI_NULL_DELETE_FN was deprecated in MPI-2.0; use MPI_COMM_NULL_DELETE_FN instead.");

#if !OMPI_OMIT_MPI1_COMPAT_DECLS
/*
* Removed typedefs. These typedefs are only available if Open MPI
* was configured with --enable-mpi1-compatibility.
*
* These typedefs were formally removed from the MPI specification
* and should no longer be used in MPI applications.
*
* Even though MPI_Handler_function is removed, we do not use the
* attributes marking it as such, because otherwise the compiler
* will warn for all the functions that are declared using them
* (e.g., MPI_Errhandler_create).
*/
typedef void (MPI_Handler_function)(MPI_Comm *, int *, ...);
/* MPI_Handler_function was removed in MPI-3.0; use MPI_Comm_use_errhandler_function instead. */

/*
* Removed prototypes. These prototypes are only available if Open
* MPI was configured with --enable-mpi1-compatibility.
*
* These functions were formally removed from the MPI specification
* and should no longer be used in MPI applications.
*/
OMPI_DECLSPEC int MPI_Address(void *location, MPI_Aint *address)
__mpi_interface_removed__(MPI_Address, MPI_Get_address);
OMPI_DECLSPEC int PMPI_Address(void *location, MPI_Aint *address)
__mpi_interface_removed__(PMPI_Address, PMPI_Get_address);
OMPI_DECLSPEC int MPI_Errhandler_create(MPI_Handler_function *function,
MPI_Errhandler *errhandler)
__mpi_interface_removed__(MPI_Errhandler_create, MPI_Comm_create_errhandler);
OMPI_DECLSPEC int PMPI_Errhandler_create(MPI_Handler_function *function,
MPI_Errhandler *errhandler)
__mpi_interface_removed__(PMPI_Errhandler_create, PMPI_Comm_create_errhandler);
OMPI_DECLSPEC int MPI_Errhandler_get(MPI_Comm comm, MPI_Errhandler *errhandler)
__mpi_interface_removed__(MPI_Errhandler_get, MPI_Comm_get_errhandler);
OMPI_DECLSPEC int PMPI_Errhandler_get(MPI_Comm comm, MPI_Errhandler *errhandler)
__mpi_interface_removed__(PMPI_Errhandler_get, PMPI_Comm_get_errhandler);
OMPI_DECLSPEC int MPI_Errhandler_set(MPI_Comm comm, MPI_Errhandler errhandler)
__mpi_interface_removed__(MPI_Errhandler_set, MPI_Comm_set_errhandler);
OMPI_DECLSPEC int PMPI_Errhandler_set(MPI_Comm comm, MPI_Errhandler errhandler)
__mpi_interface_removed__(PMPI_Errhandler_set, PMPI_Comm_set_errhandler);
OMPI_DECLSPEC int MPI_Type_extent(MPI_Datatype type, MPI_Aint *extent)
__mpi_interface_removed__(MPI_Type_extent, MPI_Type_get_extent);
OMPI_DECLSPEC int PMPI_Type_extent(MPI_Datatype type, MPI_Aint *extent)
__mpi_interface_removed__(PMPI_Type_extent, PMPI_Type_get_extent);
OMPI_DECLSPEC int MPI_Type_hindexed(int count, int array_of_blocklengths[],
MPI_Aint array_of_displacements[],
MPI_Datatype oldtype, MPI_Datatype *newtype)
__mpi_interface_removed__(MPI_Type_hindexed, MPI_Type_create_hindexed);
OMPI_DECLSPEC int PMPI_Type_hindexed(int count, int array_of_blocklengths[],
MPI_Aint array_of_displacements[],
MPI_Datatype oldtype, MPI_Datatype *newtype)
__mpi_interface_removed__(PMPI_Type_hindexed, PMPI_Type_create_hindexed);
OMPI_DECLSPEC int MPI_Type_hvector(int count, int blocklength, MPI_Aint stride,
MPI_Datatype oldtype, MPI_Datatype *newtype)
__mpi_interface_removed__(MPI_Type_hvector, MPI_Type_create_hvector);
OMPI_DECLSPEC int PMPI_Type_hvector(int count, int blocklength, MPI_Aint stride,
MPI_Datatype oldtype, MPI_Datatype *newtype)
__mpi_interface_removed__(PMPI_Type_hvector, PMPI_Type_create_hvector);
OMPI_DECLSPEC int MPI_Type_lb(MPI_Datatype type, MPI_Aint *lb)
__mpi_interface_removed__(MPI_Type_lb, MPI_Type_get_extent);
OMPI_DECLSPEC int PMPI_Type_lb(MPI_Datatype type, MPI_Aint *lb)
__mpi_interface_removed__(PMPI_Type_lb, PMPI_Type_get_extent);
OMPI_DECLSPEC int MPI_Type_struct(int count, int array_of_blocklengths[],
MPI_Aint array_of_displacements[],
MPI_Datatype array_of_types[],
MPI_Datatype *newtype)
__mpi_interface_removed__(MPI_Type_struct, MPI_Type_create_struct);
OMPI_DECLSPEC int PMPI_Type_struct(int count, int array_of_blocklengths[],
MPI_Aint array_of_displacements[],
MPI_Datatype array_of_types[],
MPI_Datatype *newtype)
__mpi_interface_removed__(PMPI_Type_struct, PMPI_Type_create_struct);
OMPI_DECLSPEC int MPI_Type_ub(MPI_Datatype mtype, MPI_Aint *ub)
__mpi_interface_removed__(MPI_Type_ub, MPI_Type_get_extent);
OMPI_DECLSPEC int PMPI_Type_ub(MPI_Datatype mtype, MPI_Aint *ub)
__mpi_interface_removed__(PMPI_Type_ub, PMPI_Type_get_extent);
#endif /* !OMPI_OMIT_MPI1_COMPAT_DECLS */

#if OMPI_REMOVED_USE_STATIC_ASSERT
#define MPI_Address(...) OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_Address, MPI_Get_address)
#define MPI_Errhandler_create OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_Errhandler_create, MPI_Comm_create_errhandler)
#define MPI_Errhandler_get(...) OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_Errhandler_get, MPI_Comm_get_errhandler)
#define MPI_Errhandler_set(...) OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_Errhandler_set, MPI_Comm_set_errhandler)
#define MPI_Type_extent(...) OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_Type_extent, MPI_Type_get_extent)
#define MPI_Type_hindexed(...) OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_Type_hindexed, MPI_Type_create_hindexed)
#define MPI_Type_hvector(...) OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_Type_hvector, MPI_Type_create_hvector)
#define MPI_Type_lb(...) OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_Type_lb, MPI_Type_get_extent)
#define MPI_Type_struct OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_Type_struct, MPI_Type_create_struct)
#define MPI_Type_ub(...) OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_Type_ub, MPI_Type_get_extent)
#endif

#if defined(c_plusplus) || defined(__cplusplus)
}
#endif
Expand Down
15 changes: 0 additions & 15 deletions ompi/mpi/c/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -436,21 +436,6 @@ libmpi_c_mpi_la_SOURCES = \
win_unlock_all.c \
win_wait.c


if OMPI_ENABLE_MPI1_COMPAT
libmpi_c_mpi_la_SOURCES += \
address.c \
errhandler_create.c \
errhandler_get.c \
errhandler_set.c \
type_extent.c \
type_hindexed.c \
type_hvector.c \
type_lb.c \
type_struct.c \
type_ub.c
endif

# Conditionally install the header files

if WANT_INSTALL_HEADERS
Expand Down
61 changes: 0 additions & 61 deletions ompi/mpi/c/address.c

This file was deleted.

50 changes: 0 additions & 50 deletions ompi/mpi/c/errhandler_create.c

This file was deleted.

Loading

0 comments on commit 0589597

Please sign in to comment.