|
19 | 19 | * Copyright (c) 2015 University of Houston. All rights reserved.
|
20 | 20 | * Copyright (c) 2015-2018 Research Organization for Information Science
|
21 | 21 | * and Technology (RIST). All rights reserved.
|
22 |
| - * Copyright (c) 2017-2018 IBM Corporation. All rights reserved. |
| 22 | + * Copyright (c) 2017-2019 IBM Corporation. All rights reserved. |
23 | 23 | * $COPYRIGHT$
|
24 | 24 | *
|
25 | 25 | * Additional copyrights may follow
|
|
279 | 279 | # define __mpi_interface_deprecated__(msg) __attribute__((__deprecated__))
|
280 | 280 | # endif
|
281 | 281 | # endif
|
282 |
| -# if OMPI_ENABLE_MPI1_COMPAT |
283 |
| -# define __mpi_interface_removed__(msg) __mpi_interface_deprecated__(msg) |
| 282 | +# endif |
| 283 | + |
| 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."))) |
284 | 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 |
285 | 305 | # endif
|
286 | 306 | # endif
|
287 | 307 | # endif
|
@@ -2687,62 +2707,63 @@ typedef void (MPI_Handler_function)(MPI_Comm *, int *, ...);
|
2687 | 2707 | * These functions were formally removed from the MPI specification
|
2688 | 2708 | * and should no longer be used in MPI applications.
|
2689 | 2709 | */
|
2690 |
| -OMPI_DECLSPEC int MPI_Address(void *location, MPI_Aint *address) |
2691 |
| - __mpi_interface_removed__("MPI_Address was removed in MPI-3.0; use MPI_Get_address instead."); |
2692 |
| -OMPI_DECLSPEC int PMPI_Address(void *location, MPI_Aint *address) |
2693 |
| - __mpi_interface_removed__("PMPI_Address was removed in MPI-3.0; use MPI_Get_address instead."); |
| 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) |
2694 | 2714 | OMPI_DECLSPEC int MPI_Errhandler_create(MPI_Handler_function *function,
|
2695 |
| - MPI_Errhandler *errhandler) |
2696 |
| - __mpi_interface_removed__("MPI_Errhandler_create was removed in MPI-3.0; use MPI_Comm_create_errhandler instead."); |
| 2715 | + MPI_Errhandler *errhandler); |
| 2716 | +#define MPI_Errhandler_create MPI_INTERFACE_REMOVED(MPI_Errhandler_create, MPI_Comm_create_errhandler) |
2697 | 2717 | OMPI_DECLSPEC int PMPI_Errhandler_create(MPI_Handler_function *function,
|
2698 |
| - MPI_Errhandler *errhandler) |
2699 |
| - __mpi_interface_removed__("PMPI_Errhandler_create was removed in MPI-3.0; use PMPI_Comm_create_errhandler instead."); |
2700 |
| -OMPI_DECLSPEC int MPI_Errhandler_get(MPI_Comm comm, MPI_Errhandler *errhandler) |
2701 |
| - __mpi_interface_removed__("MPI_Errhandler_get was removed in MPI-3.0; use MPI_Comm_get_errhandler instead."); |
2702 |
| -OMPI_DECLSPEC int PMPI_Errhandler_get(MPI_Comm comm, MPI_Errhandler *errhandler) |
2703 |
| - __mpi_interface_removed__("PMPI_Errhandler_get was removed in MPI-3.0; use PMPI_Comm_get_errhandler instead."); |
2704 |
| -OMPI_DECLSPEC int MPI_Errhandler_set(MPI_Comm comm, MPI_Errhandler errhandler) |
2705 |
| - __mpi_interface_removed__("MPI_Errhandler_set was removed in MPI-3.0; use MPI_Comm_set_errhandler instead."); |
2706 |
| -OMPI_DECLSPEC int PMPI_Errhandler_set(MPI_Comm comm, MPI_Errhandler errhandler) |
2707 |
| - __mpi_interface_removed__("PMPI_Errhandler_set was removed in MPI-3.0; use PMPI_Comm_set_errhandler instead."); |
2708 |
| -OMPI_DECLSPEC int MPI_Type_extent(MPI_Datatype type, MPI_Aint *extent) |
2709 |
| - __mpi_interface_removed__("MPI_Type_extent was removed in MPI-3.0; use MPI_Type_get_extent instead."); |
2710 |
| -OMPI_DECLSPEC int PMPI_Type_extent(MPI_Datatype type, MPI_Aint *extent) |
2711 |
| - __mpi_interface_removed__("PMPI_Type_extent was removed in MPI-3.0; use PMPI_Type_get_extent instead."); |
| 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) |
2712 | 2732 | OMPI_DECLSPEC int MPI_Type_hindexed(int count, int array_of_blocklengths[],
|
2713 | 2733 | MPI_Aint array_of_displacements[],
|
2714 |
| - MPI_Datatype oldtype, MPI_Datatype *newtype) |
2715 |
| - __mpi_interface_removed__("MPI_Type_hindexed was removed in MPI-3.0; use MPI_Type_create_hindexed instead."); |
| 2734 | + MPI_Datatype oldtype, MPI_Datatype *newtype); |
| 2735 | +#define MPI_Type_hindexed(...) MPI_INTERFACE_REMOVED(MPI_Type_hindexed, MPI_Type_create_hindexed) |
2716 | 2736 | OMPI_DECLSPEC int PMPI_Type_hindexed(int count, int array_of_blocklengths[],
|
2717 | 2737 | MPI_Aint array_of_displacements[],
|
2718 |
| - MPI_Datatype oldtype, MPI_Datatype *newtype) |
2719 |
| - __mpi_interface_removed__("PMPI_Type_hindexed was removed in MPI-3.0; use PMPI_Type_create_hindexed instead."); |
| 2738 | + MPI_Datatype oldtype, MPI_Datatype *newtype); |
| 2739 | +#define PMPI_Type_hindexed(...) MPI_INTERFACE_REMOVED(PMPI_Type_hindexed, PMPI_Type_create_hindexed) |
2720 | 2740 | OMPI_DECLSPEC int MPI_Type_hvector(int count, int blocklength, MPI_Aint stride,
|
2721 |
| - MPI_Datatype oldtype, MPI_Datatype *newtype) |
2722 |
| - __mpi_interface_removed__("MPI_Type_hvector was removed in MPI-3.0; use MPI_Type_create_hvector instead."); |
| 2741 | + MPI_Datatype oldtype, MPI_Datatype *newtype); |
| 2742 | +#define MPI_Type_hvector(...) MPI_INTERFACE_REMOVED(MPI_Type_hvector, MPI_Type_create_hvector) |
2723 | 2743 | OMPI_DECLSPEC int PMPI_Type_hvector(int count, int blocklength, MPI_Aint stride,
|
2724 |
| - MPI_Datatype oldtype, MPI_Datatype *newtype) |
2725 |
| - __mpi_interface_removed__("PMPI_Type_hvector was removed in MPI-3.0; use PMPI_Type_create_hvector instead."); |
2726 |
| -OMPI_DECLSPEC int MPI_Type_lb(MPI_Datatype type, MPI_Aint *lb) |
2727 |
| - __mpi_interface_removed__("MPI_Type_lb has been removed in MPI-3.0; use MPI_Type_get_extent instead."); |
2728 |
| -OMPI_DECLSPEC int PMPI_Type_lb(MPI_Datatype type, MPI_Aint *lb) |
2729 |
| - __mpi_interface_removed__("PMPI_Type_lb has been removed in MPI-3.0; use PMPI_Type_get_extent instead."); |
| 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) |
2730 | 2750 | OMPI_DECLSPEC int MPI_Type_struct(int count, int array_of_blocklengths[],
|
2731 | 2751 | MPI_Aint array_of_displacements[],
|
2732 | 2752 | MPI_Datatype array_of_types[],
|
2733 |
| - MPI_Datatype *newtype) |
2734 |
| - __mpi_interface_removed__("MPI_Type_struct was removed in MPI-3.0; use MPI_Type_create_struct instead."); |
| 2753 | + MPI_Datatype *newtype); |
| 2754 | +#define MPI_Type_struct MPI_INTERFACE_REMOVED(MPI_Type_struct, MPI_Type_create_struct) |
2735 | 2755 | OMPI_DECLSPEC int PMPI_Type_struct(int count, int array_of_blocklengths[],
|
2736 | 2756 | MPI_Aint array_of_displacements[],
|
2737 | 2757 | MPI_Datatype array_of_types[],
|
2738 |
| - MPI_Datatype *newtype) |
2739 |
| - __mpi_interface_removed__("PMPI_Type_struct was removed in MPI-3.0; use PMPI_Type_create_struct instead."); |
2740 |
| -OMPI_DECLSPEC int MPI_Type_ub(MPI_Datatype mtype, MPI_Aint *ub) |
2741 |
| - __mpi_interface_removed__("MPI_Type_ub has been removed in MPI-3.0; use MPI_Type_get_extent instead."); |
2742 |
| -OMPI_DECLSPEC int PMPI_Type_ub(MPI_Datatype mtype, MPI_Aint *ub) |
2743 |
| - __mpi_interface_removed__("PMPI_Type_ub has been removed in MPI-3.0; use PMPI_Type_get_extent instead."); |
| 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) |
2744 | 2764 | #endif /* !OMPI_OMIT_MPI1_COMPAT_DECLS */
|
2745 | 2765 |
|
| 2766 | + |
2746 | 2767 | #if defined(c_plusplus) || defined(__cplusplus)
|
2747 | 2768 | }
|
2748 | 2769 | #endif
|
|
0 commit comments