|
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 && !OMPI_BUILDING) |
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
|
@@ -2685,62 +2705,63 @@ typedef void (MPI_Handler_function)(MPI_Comm *, int *, ...);
|
2685 | 2705 | * These functions were formally removed from the MPI specification
|
2686 | 2706 | * and should no longer be used in MPI applications.
|
2687 | 2707 | */
|
2688 |
| -OMPI_DECLSPEC int MPI_Address(void *location, MPI_Aint *address) |
2689 |
| - __mpi_interface_removed__("MPI_Address was removed in MPI-3.0; use MPI_Get_address instead."); |
2690 |
| -OMPI_DECLSPEC int PMPI_Address(void *location, MPI_Aint *address) |
2691 |
| - __mpi_interface_removed__("PMPI_Address was removed in MPI-3.0; use MPI_Get_address instead."); |
| 2708 | +OMPI_DECLSPEC int MPI_Address(void *location, MPI_Aint *address); |
| 2709 | +#define MPI_Address(...) MPI_INTERFACE_REMOVED(MPI_Address, MPI_Get_address) |
| 2710 | +OMPI_DECLSPEC int PMPI_Address(void *location, MPI_Aint *address); |
| 2711 | +#define PMPI_Address(...) MPI_INTERFACE_REMOVED(PMPI_Address, PMPI_Get_address) |
2692 | 2712 | OMPI_DECLSPEC int MPI_Errhandler_create(MPI_Handler_function *function,
|
2693 |
| - MPI_Errhandler *errhandler) |
2694 |
| - __mpi_interface_removed__("MPI_Errhandler_create was removed in MPI-3.0; use MPI_Comm_create_errhandler instead."); |
| 2713 | + MPI_Errhandler *errhandler); |
| 2714 | +#define MPI_Errhandler_create MPI_INTERFACE_REMOVED(MPI_Errhandler_create, MPI_Comm_create_errhandler) |
2695 | 2715 | OMPI_DECLSPEC int PMPI_Errhandler_create(MPI_Handler_function *function,
|
2696 |
| - MPI_Errhandler *errhandler) |
2697 |
| - __mpi_interface_removed__("PMPI_Errhandler_create was removed in MPI-3.0; use PMPI_Comm_create_errhandler instead."); |
2698 |
| -OMPI_DECLSPEC int MPI_Errhandler_get(MPI_Comm comm, MPI_Errhandler *errhandler) |
2699 |
| - __mpi_interface_removed__("MPI_Errhandler_get was removed in MPI-3.0; use MPI_Comm_get_errhandler instead."); |
2700 |
| -OMPI_DECLSPEC int PMPI_Errhandler_get(MPI_Comm comm, MPI_Errhandler *errhandler) |
2701 |
| - __mpi_interface_removed__("PMPI_Errhandler_get was removed in MPI-3.0; use PMPI_Comm_get_errhandler instead."); |
2702 |
| -OMPI_DECLSPEC int MPI_Errhandler_set(MPI_Comm comm, MPI_Errhandler errhandler) |
2703 |
| - __mpi_interface_removed__("MPI_Errhandler_set was removed in MPI-3.0; use MPI_Comm_set_errhandler instead."); |
2704 |
| -OMPI_DECLSPEC int PMPI_Errhandler_set(MPI_Comm comm, MPI_Errhandler errhandler) |
2705 |
| - __mpi_interface_removed__("PMPI_Errhandler_set was removed in MPI-3.0; use PMPI_Comm_set_errhandler instead."); |
2706 |
| -OMPI_DECLSPEC int MPI_Type_extent(MPI_Datatype type, MPI_Aint *extent) |
2707 |
| - __mpi_interface_removed__("MPI_Type_extent was removed in MPI-3.0; use MPI_Type_get_extent instead."); |
2708 |
| -OMPI_DECLSPEC int PMPI_Type_extent(MPI_Datatype type, MPI_Aint *extent) |
2709 |
| - __mpi_interface_removed__("PMPI_Type_extent was removed in MPI-3.0; use PMPI_Type_get_extent instead."); |
| 2716 | + MPI_Errhandler *errhandler); |
| 2717 | +#define PMPI_Errhandler_create MPI_INTERFACE_REMOVED(PMPI_Errhandler_create, PMPI_Comm_create_errhandler) |
| 2718 | +OMPI_DECLSPEC int MPI_Errhandler_get(MPI_Comm comm, MPI_Errhandler *errhandler); |
| 2719 | +#define MPI_Errhandler_get(...) MPI_INTERFACE_REMOVED(MPI_Errhandler_get, MPI_Comm_get_errhandler) |
| 2720 | +OMPI_DECLSPEC int PMPI_Errhandler_get(MPI_Comm comm, MPI_Errhandler *errhandler); |
| 2721 | +#define PMPI_Errhandler_get(...) MPI_INTERFACE_REMOVED(PMPI_Errhandler_get, PMPI_Comm_get_errhandler) |
| 2722 | +OMPI_DECLSPEC int MPI_Errhandler_set(MPI_Comm comm, MPI_Errhandler errhandler); |
| 2723 | +#define MPI_Errhandler_set(...) MPI_INTERFACE_REMOVED(MPI_Errhandler_set, MPI_Comm_set_errhandler) |
| 2724 | +OMPI_DECLSPEC int PMPI_Errhandler_set(MPI_Comm comm, MPI_Errhandler errhandler); |
| 2725 | +#define PMPI_Errhandler_set(...) MPI_INTERFACE_REMOVED(PMPI_Errhandler_set, PMPI_Comm_set_errhandler) |
| 2726 | +OMPI_DECLSPEC int MPI_Type_extent(MPI_Datatype type, MPI_Aint *extent); |
| 2727 | +#define MPI_Type_extent(...) MPI_INTERFACE_REMOVED(MPI_Type_extent, MPI_Type_get_extent) |
| 2728 | +OMPI_DECLSPEC int PMPI_Type_extent(MPI_Datatype type, MPI_Aint *extent); |
| 2729 | +#define PMPI_Type_extent(...) MPI_INTERFACE_REMOVED(PMPI_Type_extent, PMPI_Type_get_extent) |
2710 | 2730 | OMPI_DECLSPEC int MPI_Type_hindexed(int count, int array_of_blocklengths[],
|
2711 | 2731 | MPI_Aint array_of_displacements[],
|
2712 |
| - MPI_Datatype oldtype, MPI_Datatype *newtype) |
2713 |
| - __mpi_interface_removed__("MPI_Type_hindexed was removed in MPI-3.0; use MPI_Type_create_hindexed instead."); |
| 2732 | + MPI_Datatype oldtype, MPI_Datatype *newtype); |
| 2733 | +#define MPI_Type_hindexed(...) MPI_INTERFACE_REMOVED(MPI_Type_hindexed, MPI_Type_create_hindexed) |
2714 | 2734 | OMPI_DECLSPEC int PMPI_Type_hindexed(int count, int array_of_blocklengths[],
|
2715 | 2735 | MPI_Aint array_of_displacements[],
|
2716 |
| - MPI_Datatype oldtype, MPI_Datatype *newtype) |
2717 |
| - __mpi_interface_removed__("PMPI_Type_hindexed was removed in MPI-3.0; use PMPI_Type_create_hindexed instead."); |
| 2736 | + MPI_Datatype oldtype, MPI_Datatype *newtype); |
| 2737 | +#define PMPI_Type_hindexed(...) MPI_INTERFACE_REMOVED(PMPI_Type_hindexed, PMPI_Type_create_hindexed) |
2718 | 2738 | OMPI_DECLSPEC int MPI_Type_hvector(int count, int blocklength, MPI_Aint stride,
|
2719 |
| - MPI_Datatype oldtype, MPI_Datatype *newtype) |
2720 |
| - __mpi_interface_removed__("MPI_Type_hvector was removed in MPI-3.0; use MPI_Type_create_hvector instead."); |
| 2739 | + MPI_Datatype oldtype, MPI_Datatype *newtype); |
| 2740 | +#define MPI_Type_hvector(...) MPI_INTERFACE_REMOVED(MPI_Type_hvector, MPI_Type_create_hvector) |
2721 | 2741 | OMPI_DECLSPEC int PMPI_Type_hvector(int count, int blocklength, MPI_Aint stride,
|
2722 |
| - MPI_Datatype oldtype, MPI_Datatype *newtype) |
2723 |
| - __mpi_interface_removed__("PMPI_Type_hvector was removed in MPI-3.0; use PMPI_Type_create_hvector instead."); |
2724 |
| -OMPI_DECLSPEC int MPI_Type_lb(MPI_Datatype type, MPI_Aint *lb) |
2725 |
| - __mpi_interface_removed__("MPI_Type_lb has been removed in MPI-3.0; use MPI_Type_get_extent instead."); |
2726 |
| -OMPI_DECLSPEC int PMPI_Type_lb(MPI_Datatype type, MPI_Aint *lb) |
2727 |
| - __mpi_interface_removed__("PMPI_Type_lb has been removed in MPI-3.0; use PMPI_Type_get_extent instead."); |
| 2742 | + MPI_Datatype oldtype, MPI_Datatype *newtype); |
| 2743 | +#define PMPI_Type_hvector(...) MPI_INTERFACE_REMOVED(PMPI_Type_hvector, PMPI_Type_create_hvector) |
| 2744 | +OMPI_DECLSPEC int MPI_Type_lb(MPI_Datatype type, MPI_Aint *lb); |
| 2745 | +#define MPI_Type_lb(...) MPI_INTERFACE_REMOVED(MPI_Type_lb, MPI_Type_get_extent) |
| 2746 | +OMPI_DECLSPEC int PMPI_Type_lb(MPI_Datatype type, MPI_Aint *lb); |
| 2747 | +#define PMPI_Type_lb(...) MPI_INTERFACE_REMOVED(PMPI_Type_lb, PMPI_Type_get_extent) |
2728 | 2748 | OMPI_DECLSPEC int MPI_Type_struct(int count, int array_of_blocklengths[],
|
2729 | 2749 | MPI_Aint array_of_displacements[],
|
2730 | 2750 | MPI_Datatype array_of_types[],
|
2731 |
| - MPI_Datatype *newtype) |
2732 |
| - __mpi_interface_removed__("MPI_Type_struct was removed in MPI-3.0; use MPI_Type_create_struct instead."); |
| 2751 | + MPI_Datatype *newtype); |
| 2752 | +#define MPI_Type_struct MPI_INTERFACE_REMOVED(MPI_Type_struct, MPI_Type_create_struct) |
2733 | 2753 | OMPI_DECLSPEC int PMPI_Type_struct(int count, int array_of_blocklengths[],
|
2734 | 2754 | MPI_Aint array_of_displacements[],
|
2735 | 2755 | MPI_Datatype array_of_types[],
|
2736 |
| - MPI_Datatype *newtype) |
2737 |
| - __mpi_interface_removed__("PMPI_Type_struct was removed in MPI-3.0; use PMPI_Type_create_struct instead."); |
2738 |
| -OMPI_DECLSPEC int MPI_Type_ub(MPI_Datatype mtype, MPI_Aint *ub) |
2739 |
| - __mpi_interface_removed__("MPI_Type_ub has been removed in MPI-3.0; use MPI_Type_get_extent instead."); |
2740 |
| -OMPI_DECLSPEC int PMPI_Type_ub(MPI_Datatype mtype, MPI_Aint *ub) |
2741 |
| - __mpi_interface_removed__("PMPI_Type_ub has been removed in MPI-3.0; use PMPI_Type_get_extent instead."); |
| 2756 | + MPI_Datatype *newtype); |
| 2757 | +#define PMPI_Type_struct MPI_INTERFACE_REMOVED(PMPI_Type_struct, PMPI_Type_create_struct) |
| 2758 | +OMPI_DECLSPEC int MPI_Type_ub(MPI_Datatype mtype, MPI_Aint *ub); |
| 2759 | +#define MPI_Type_ub(...) MPI_INTERFACE_REMOVED(MPI_Type_ub, MPI_Type_get_extent) |
| 2760 | +OMPI_DECLSPEC int PMPI_Type_ub(MPI_Datatype mtype, MPI_Aint *ub); |
| 2761 | +#define PMPI_Type_ub(...) MPI_INTERFACE_REMOVED(PMPI_Type_ub, PMPI_Type_get_extent) |
2742 | 2762 | #endif /* !OMPI_OMIT_MPI1_COMPAT_DECLS */
|
2743 | 2763 |
|
| 2764 | + |
2744 | 2765 | #if defined(c_plusplus) || defined(__cplusplus)
|
2745 | 2766 | }
|
2746 | 2767 | #endif
|
|
0 commit comments