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 11, 2019
1 parent 0d6d5d4 commit ed18e56
Show file tree
Hide file tree
Showing 13 changed files with 15 additions and 241 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
30 changes: 12 additions & 18 deletions ompi/datatype/ompi_datatype_args.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* reserved.
* Copyright (c) 2015-2019 Research Organization for Information Science
* and Technology (RIST). All rights reserved.
* Copyright (c) 2017 IBM Corporation. All rights reserved.
* Copyright (c) 2017-2019 IBM Corporation. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down 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;
}
133 changes: 0 additions & 133 deletions ompi/include/mpi.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,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 @@ -281,32 +278,6 @@
# 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.
*/
# if (OMPI_ENABLE_MPI1_COMPAT || OMPI_BUILDING)
# define OMPI_OMIT_MPI1_COMPAT_DECLS 0
# define MPI_INTERFACE_REMOVED(func, newfunc, ...) func(__VA_ARGS) __mpi_interface_deprecated__((#func " was removed in MPI-3.0. Use " #newfunc " instead. continuing..."))
# else
# if (__STDC_VERSION__ >= 201112L)
# define MPI_INTERFACE_REMOVED(func, newfunc, ...) _Static_assert(0, #func " was removed in MPI-3.0. Use " #newfunc " instead.")
# define OMPI_OMIT_MPI1_COMPAT_DECLS 0
# else
# if OPAL_HAVE_ATTRIBUTE_ERROR
# define MPI_INTERFACE_REMOVED(func, newfunc, ...) func(__VA_ARGS) __attribute__((__error__(#func " was removed in MPI-3.0. Use " #newfunc " instead.")))
# define OMPI_OMIT_MPI1_COMPAT_DECLS 0
# else
# define MPI_INTERFACE_REMOVED(func, newfunc, ...) func(__VA_ARGS)
# define OMPI_OMIT_MPI1_COMPAT_DECLS 1
# endif
# endif
# endif
# endif
#endif

/*
* If we didn't define __mpi_interface_deprecated__ above, then we
* don't want it, so define it to empty (can't use #undef in the logic
Expand All @@ -316,14 +287,6 @@
# define __mpi_interface_deprecated__(msg)
#endif

#if !defined(__mpi_interface_removed__)
# define __mpi_interface_removed__(msg)
#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 @@ -1023,23 +986,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
__mpi_interface_removed__("MPI_LB was removed in MPI-3.0; use MPI_Type_create_resized instead.");
OMPI_DECLSPEC extern struct ompi_predefined_datatype_t ompi_mpi_ub
__mpi_interface_removed__("MPI_UB was removed in MPI-3.0; use MPI_Type_create_resized instead.");
#endif /* !OMPI_OMIT_MPI1_COMPAT_DECLS */

/*
* MPI predefined handles
*/
Expand Down Expand Up @@ -2684,85 +2630,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);
#define MPI_Address(...) MPI_INTERFACE_REMOVED(MPI_Address, MPI_Get_address)
OMPI_DECLSPEC int PMPI_Address(void *location, MPI_Aint *address);
#define PMPI_Address(...) MPI_INTERFACE_REMOVED(PMPI_Address, PMPI_Get_address)
OMPI_DECLSPEC int MPI_Errhandler_create(MPI_Handler_function *function,
MPI_Errhandler *errhandler);
#define MPI_Errhandler_create MPI_INTERFACE_REMOVED(MPI_Errhandler_create, MPI_Comm_create_errhandler)
OMPI_DECLSPEC int PMPI_Errhandler_create(MPI_Handler_function *function,
MPI_Errhandler *errhandler);
#define PMPI_Errhandler_create MPI_INTERFACE_REMOVED(PMPI_Errhandler_create, PMPI_Comm_create_errhandler)
OMPI_DECLSPEC int MPI_Errhandler_get(MPI_Comm comm, MPI_Errhandler *errhandler);
#define MPI_Errhandler_get(...) MPI_INTERFACE_REMOVED(MPI_Errhandler_get, MPI_Comm_get_errhandler)
OMPI_DECLSPEC int PMPI_Errhandler_get(MPI_Comm comm, MPI_Errhandler *errhandler);
#define PMPI_Errhandler_get(...) MPI_INTERFACE_REMOVED(PMPI_Errhandler_get, PMPI_Comm_get_errhandler)
OMPI_DECLSPEC int MPI_Errhandler_set(MPI_Comm comm, MPI_Errhandler errhandler);
#define MPI_Errhandler_set(...) MPI_INTERFACE_REMOVED(MPI_Errhandler_set, MPI_Comm_set_errhandler)
OMPI_DECLSPEC int PMPI_Errhandler_set(MPI_Comm comm, MPI_Errhandler errhandler);
#define PMPI_Errhandler_set(...) MPI_INTERFACE_REMOVED(PMPI_Errhandler_set, PMPI_Comm_set_errhandler)
OMPI_DECLSPEC int MPI_Type_extent(MPI_Datatype type, MPI_Aint *extent);
#define MPI_Type_extent(...) MPI_INTERFACE_REMOVED(MPI_Type_extent, MPI_Type_get_extent)
OMPI_DECLSPEC int PMPI_Type_extent(MPI_Datatype type, MPI_Aint *extent);
#define PMPI_Type_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);
#define MPI_Type_hindexed(...) 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);
#define PMPI_Type_hindexed(...) 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);
#define MPI_Type_hvector(...) 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);
#define PMPI_Type_hvector(...) MPI_INTERFACE_REMOVED(PMPI_Type_hvector, PMPI_Type_create_hvector)
OMPI_DECLSPEC int MPI_Type_lb(MPI_Datatype type, MPI_Aint *lb);
#define MPI_Type_lb(...) MPI_INTERFACE_REMOVED(MPI_Type_lb, MPI_Type_get_extent)
OMPI_DECLSPEC int PMPI_Type_lb(MPI_Datatype type, MPI_Aint *lb);
#define PMPI_Type_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);
#define MPI_Type_struct 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);
#define PMPI_Type_struct MPI_INTERFACE_REMOVED(PMPI_Type_struct, PMPI_Type_create_struct)
OMPI_DECLSPEC int MPI_Type_ub(MPI_Datatype mtype, MPI_Aint *ub);
#define MPI_Type_ub(...) MPI_INTERFACE_REMOVED(MPI_Type_ub, MPI_Type_get_extent)
OMPI_DECLSPEC int PMPI_Type_ub(MPI_Datatype mtype, MPI_Aint *ub);
#define PMPI_Type_ub(...) MPI_INTERFACE_REMOVED(PMPI_Type_ub, PMPI_Type_get_extent)
#endif /* !OMPI_OMIT_MPI1_COMPAT_DECLS */


#if defined(c_plusplus) || defined(__cplusplus)
}
Expand Down
16 changes: 1 addition & 15 deletions ompi/mpi/c/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
# reserved.
# Copyright (c) 2015-2018 Research Organization for Information Science
# and Technology (RIST). All rights reserved.
# Copyright (c) 2019 IBM Corporation. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
Expand Down Expand Up @@ -436,21 +437,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
14 changes: 0 additions & 14 deletions ompi/mpi/c/profile/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -416,20 +416,6 @@ nodist_libmpi_c_pmpi_la_SOURCES = \
pwin_unlock_all.c \
pwin_wait.c

if OMPI_ENABLE_MPI1_COMPAT
nodist_libmpi_c_pmpi_la_SOURCES += \
paddress.c \
perrhandler_create.c \
perrhandler_get.c \
perrhandler_set.c \
ptype_extent.c \
ptype_hindexed.c \
ptype_hvector.c \
ptype_lb.c \
ptype_struct.c \
ptype_ub.c
endif

#
# Sym link in the sources from the real MPI directory
#
Expand Down
7 changes: 1 addition & 6 deletions ompi/mpi/cxx/mpicxx.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
// Copyright (c) 2011 FUJITSU LIMITED. All rights reserved.
// Copyright (c) 2017 Research Organization for Information Science
// and Technology (RIST). All rights reserved.
// Copyright (c) 2019 IBM Corporation. All rights reserved.
// $COPYRIGHT$
//
// Additional copyrights may follow
Expand Down Expand Up @@ -163,10 +164,4 @@ const char*** ARGVS_NULL = (const char***) MPI_ARGVS_NULL;
// empty group
const Group GROUP_EMPTY(MPI_GROUP_EMPTY);

#if OMPI_ENABLE_MPI1_COMPAT
// special datatypes for contstruction of derived datatypes
const Datatype UB(MPI_UB);
const Datatype LB(MPI_LB);
#endif

} /* namespace MPI */
2 changes: 0 additions & 2 deletions ompi/mpi/fortran/configure-fortran-output.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,6 @@
#define OMPI_KIND_FORTRAN_COMPLEX32 @OMPI_KIND_FORTRAN_COMPLEX32@
#define OMPI_SIZEOF_FORTRAN_COMPLEX32 @OMPI_SIZEOF_FORTRAN_COMPLEX32@
#define OMPI_ENABLE_MPI1_COMPAT @OMPI_ENABLE_MPI1_COMPAT@
! Include some post-processing, based on the values from above
#include "ompi/mpi/fortran/configure-fortran-output-bottom.h"
Expand Down
15 changes: 0 additions & 15 deletions ompi/mpi/fortran/mpif-h/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -482,21 +482,6 @@ lib@OMPI_LIBMPI_NAME@_mpifh_la_SOURCES += \
win_flush_local_all_f.c


if OMPI_ENABLE_MPI1_COMPAT
lib@OMPI_LIBMPI_NAME@_mpifh_la_SOURCES += \
address_f.c \
errhandler_create_f.c \
errhandler_get_f.c \
errhandler_set_f.c \
type_extent_f.c \
type_hindexed_f.c \
type_hvector_f.c \
type_lb_f.c \
type_struct_f.c \
type_ub_f.c
endif
endif

#
# Conditionally install the header files
#
Expand Down
13 changes: 0 additions & 13 deletions ompi/mpi/fortran/mpif-h/profile/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -397,19 +397,6 @@ linked_files = \
pwin_flush_local_f.c \
pwin_flush_local_all_f.c

if OMPI_ENABLE_MPI1_COMPAT
linked_files += \
paddress_f.c \
perrhandler_create_f.c \
perrhandler_get_f.c \
perrhandler_set_f.c \
ptype_extent_f.c \
ptype_hindexed_f.c \
ptype_hvector_f.c \
ptype_lb_f.c \
ptype_struct_f.c \
ptype_ub_f.c
endif

#
# Sym link in the sources from the real MPI directory
Expand Down
5 changes: 1 addition & 4 deletions ompi/mpi/fortran/use-mpi-ignore-tkr/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,11 @@ lib_LTLIBRARIES = lib@OMPI_LIBMPI_NAME@_usempi_ignore_tkr.la

mpi-ignore-tkr-interfaces.h: mpi-ignore-tkr-interfaces.h.in
mpi-ignore-tkr-file-interfaces.h: mpi-ignore-tkr-file-interfaces.h.in
mpi-ignore-tkr-removed-interfaces.h: mpi-ignore-tkr-removed-interfaces.h.in

mpi-ignore-tkr.lo: $(top_srcdir)/ompi/mpi/fortran/base/attr-fn-int-callback-interfaces.h
mpi-ignore-tkr.lo: $(top_srcdir)/ompi/mpi/fortran/base/conversion-fn-null-int-interface.h
mpi-ignore-tkr.lo: mpi-ignore-tkr-interfaces.h
mpi-ignore-tkr.lo: mpi-ignore-tkr-file-interfaces.h
mpi-ignore-tkr.lo: mpi-ignore-tkr-removed-interfaces.h
mpi-ignore-tkr.lo: mpi-ignore-tkr-sizeof.h
mpi-ignore-tkr.lo: mpi-ignore-tkr-sizeof.f90
mpi-ignore-tkr.lo: mpi-ignore-tkr.F90
Expand All @@ -42,8 +40,7 @@ lib@OMPI_LIBMPI_NAME@_usempi_ignore_tkr_la_SOURCES = \
mpi-ignore-tkr.F90
nodist_lib@OMPI_LIBMPI_NAME@_usempi_ignore_tkr_la_SOURCES = \
mpi-ignore-tkr-interfaces.h \
mpi-ignore-tkr-file-interfaces.h \
mpi-ignore-tkr-removed-interfaces.h
mpi-ignore-tkr-file-interfaces.h

if BUILD_FORTRAN_SIZEOF
# These files are generated; do not distribute them
Expand Down
7 changes: 0 additions & 7 deletions ompi/mpi/fortran/use-mpi-ignore-tkr/mpi-ignore-tkr.F90
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,6 @@ module mpi

include "ompi/mpi/fortran/use-mpi-ignore-tkr/mpi-ignore-tkr-interfaces.h"
include "ompi/mpi/fortran/use-mpi-ignore-tkr/mpi-ignore-tkr-file-interfaces.h"
#if !defined(OMPI_ENABLE_MPI1_COMPAT)

#error "Remove MPI-1 compat code"

#elif OMPI_ENABLE_MPI1_COMPAT
include "ompi/mpi/fortran/use-mpi-ignore-tkr/mpi-ignore-tkr-removed-interfaces.h"
#endif

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

Expand Down
Loading

0 comments on commit ed18e56

Please sign in to comment.