|
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 | + * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved. |
23 | 24 | * $COPYRIGHT$
|
24 | 25 | *
|
25 | 26 | * Additional copyrights may follow
|
|
279 | 280 | # define __mpi_interface_deprecated__(msg) __attribute__((__deprecated__))
|
280 | 281 | # endif
|
281 | 282 | # endif
|
282 |
| -# if (OMPI_ENABLE_MPI1_COMPAT && !OMPI_BUILDING) |
283 |
| -# define __mpi_interface_removed__(msg) __mpi_interface_deprecated__(msg) |
284 |
| -# define OMPI_OMIT_MPI1_COMPAT_DECLS 0 |
285 |
| -# endif |
| 283 | +# endif |
| 284 | + |
| 285 | + /* For removed API, there is no portable way to cause the |
| 286 | + * C compiler to error with a nice message on the usage of |
| 287 | + * one of these symbols, so instead we use a C11 static_assert |
| 288 | + * If the user is not using a C11 compiler, they will get an |
| 289 | + * undefined reference, but no line number or nice message. |
| 290 | + * |
| 291 | + * Don't do MACRO magic for building Profiling library as it |
| 292 | + * interferes with that system. |
| 293 | + */ |
| 294 | +# if (OMPI_ENABLE_MPI1_COMPAT || OMPI_BUILDING) |
| 295 | +# define OMPI_OMIT_MPI1_COMPAT_DECLS 0 |
| 296 | +# define __mpi_interface_removed__(func, newfunc) __mpi_interface_deprecated__(#func " was removed in MPI-3.0. Use " #newfunc " instead. continuing...") |
| 297 | +# else |
| 298 | +# if (__STDC_VERSION__ >= 201112L) |
| 299 | +# define OMPI_REMOVED_STATIC_ASSERT_MSG(func, newfunc) _Static_assert(0, #func " was removed in MPI-3.0. Use " #newfunc " instead.") |
| 300 | +# define OMPI_OMIT_MPI1_COMPAT_DECLS 1 |
| 301 | +# define OMPI_REMOVED_USE_STATIC_ASSERT 1 |
| 302 | +# else |
| 303 | +# if OPAL_HAVE_ATTRIBUTE_ERROR |
| 304 | +# define __mpi_interface_removed__(func, newfunc) __attribute__((__error__(#func " was removed in MPI-3.0. Use " #newfunc " instead."))) |
| 305 | +# define OMPI_OMIT_MPI1_COMPAT_DECLS 0 |
| 306 | +# else |
| 307 | +# define OMPI_OMIT_MPI1_COMPAT_DECLS 1 |
| 308 | +# define OMPI_REMOVED_USE_STATIC_ASSERT 0 |
| 309 | +# endif |
| 310 | +# endif |
286 | 311 | # endif
|
287 | 312 | # endif
|
288 | 313 | #endif
|
|
297 | 322 | #endif
|
298 | 323 |
|
299 | 324 | #if !defined(__mpi_interface_removed__)
|
300 |
| -# define __mpi_interface_removed__(msg) |
| 325 | +# define __mpi_interface_removed__(A,B) |
| 326 | +#endif |
| 327 | + |
| 328 | +#if !defined(OMPI_REMOVED_STATIC_ASSERT_MSG) |
| 329 | +# define OMPI_REMOVED_STATIC_ASSERT_MSG(func, newfunc) |
| 330 | +#endif |
| 331 | + |
| 332 | +#if !defined(OMPI_REMOVED_USE_STATIC_ASSERT) |
| 333 | +# define OMPI_REMOVED_USE_STATIC_ASSERT 0 |
301 | 334 | #endif
|
302 | 335 |
|
303 | 336 | #if !defined(OMPI_OMIT_MPI1_COMPAT_DECLS)
|
@@ -1022,9 +1055,9 @@ OMPI_DECLSPEC extern MPI_Fint *MPI_F_STATUSES_IGNORE;
|
1022 | 1055 | #define MPI_LB OMPI_PREDEFINED_GLOBAL(MPI_Datatype, ompi_mpi_lb)
|
1023 | 1056 |
|
1024 | 1057 | OMPI_DECLSPEC extern struct ompi_predefined_datatype_t ompi_mpi_lb
|
1025 |
| - __mpi_interface_removed__("MPI_LB was removed in MPI-3.0; use MPI_Type_create_resized instead."); |
| 1058 | + OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_LB, MPI_Type_create_resized); |
1026 | 1059 | OMPI_DECLSPEC extern struct ompi_predefined_datatype_t ompi_mpi_ub
|
1027 |
| - __mpi_interface_removed__("MPI_UB was removed in MPI-3.0; use MPI_Type_create_resized instead."); |
| 1060 | + OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_UB, MPI_Type_create_resized); |
1028 | 1061 | #endif /* !OMPI_OMIT_MPI1_COMPAT_DECLS */
|
1029 | 1062 |
|
1030 | 1063 | /*
|
@@ -2695,61 +2728,74 @@ typedef void (MPI_Handler_function)(MPI_Comm *, int *, ...);
|
2695 | 2728 | * and should no longer be used in MPI applications.
|
2696 | 2729 | */
|
2697 | 2730 | OMPI_DECLSPEC int MPI_Address(void *location, MPI_Aint *address)
|
2698 |
| - __mpi_interface_removed__("MPI_Address was removed in MPI-3.0; use MPI_Get_address instead."); |
| 2731 | + __mpi_interface_removed__(MPI_Address, MPI_Get_address); |
2699 | 2732 | OMPI_DECLSPEC int PMPI_Address(void *location, MPI_Aint *address)
|
2700 |
| - __mpi_interface_removed__("PMPI_Address was removed in MPI-3.0; use MPI_Get_address instead."); |
| 2733 | + __mpi_interface_removed__(PMPI_Address, PMPI_Get_address); |
2701 | 2734 | OMPI_DECLSPEC int MPI_Errhandler_create(MPI_Handler_function *function,
|
2702 | 2735 | MPI_Errhandler *errhandler)
|
2703 |
| - __mpi_interface_removed__("MPI_Errhandler_create was removed in MPI-3.0; use MPI_Comm_create_errhandler instead."); |
| 2736 | + __mpi_interface_removed__(MPI_Errhandler_create, MPI_Comm_create_errhandler); |
2704 | 2737 | OMPI_DECLSPEC int PMPI_Errhandler_create(MPI_Handler_function *function,
|
2705 | 2738 | MPI_Errhandler *errhandler)
|
2706 |
| - __mpi_interface_removed__("PMPI_Errhandler_create was removed in MPI-3.0; use PMPI_Comm_create_errhandler instead."); |
| 2739 | + __mpi_interface_removed__(PMPI_Errhandler_create, PMPI_Comm_create_errhandler); |
2707 | 2740 | OMPI_DECLSPEC int MPI_Errhandler_get(MPI_Comm comm, MPI_Errhandler *errhandler)
|
2708 |
| - __mpi_interface_removed__("MPI_Errhandler_get was removed in MPI-3.0; use MPI_Comm_get_errhandler instead."); |
| 2741 | + __mpi_interface_removed__(MPI_Errhandler_get, MPI_Comm_get_errhandler); |
2709 | 2742 | OMPI_DECLSPEC int PMPI_Errhandler_get(MPI_Comm comm, MPI_Errhandler *errhandler)
|
2710 |
| - __mpi_interface_removed__("PMPI_Errhandler_get was removed in MPI-3.0; use PMPI_Comm_get_errhandler instead."); |
| 2743 | + __mpi_interface_removed__(PMPI_Errhandler_get, PMPI_Comm_get_errhandler); |
2711 | 2744 | OMPI_DECLSPEC int MPI_Errhandler_set(MPI_Comm comm, MPI_Errhandler errhandler)
|
2712 |
| - __mpi_interface_removed__("MPI_Errhandler_set was removed in MPI-3.0; use MPI_Comm_set_errhandler instead."); |
| 2745 | + __mpi_interface_removed__(MPI_Errhandler_set, MPI_Comm_set_errhandler); |
2713 | 2746 | OMPI_DECLSPEC int PMPI_Errhandler_set(MPI_Comm comm, MPI_Errhandler errhandler)
|
2714 |
| - __mpi_interface_removed__("PMPI_Errhandler_set was removed in MPI-3.0; use PMPI_Comm_set_errhandler instead."); |
| 2747 | + __mpi_interface_removed__(PMPI_Errhandler_set, PMPI_Comm_set_errhandler); |
2715 | 2748 | OMPI_DECLSPEC int MPI_Type_extent(MPI_Datatype type, MPI_Aint *extent)
|
2716 |
| - __mpi_interface_removed__("MPI_Type_extent was removed in MPI-3.0; use MPI_Type_get_extent instead."); |
| 2749 | + __mpi_interface_removed__(MPI_Type_extent, MPI_Type_get_extent); |
2717 | 2750 | OMPI_DECLSPEC int PMPI_Type_extent(MPI_Datatype type, MPI_Aint *extent)
|
2718 |
| - __mpi_interface_removed__("PMPI_Type_extent was removed in MPI-3.0; use PMPI_Type_get_extent instead."); |
| 2751 | + __mpi_interface_removed__(PMPI_Type_extent, PMPI_Type_get_extent); |
2719 | 2752 | OMPI_DECLSPEC int MPI_Type_hindexed(int count, int array_of_blocklengths[],
|
2720 | 2753 | MPI_Aint array_of_displacements[],
|
2721 | 2754 | MPI_Datatype oldtype, MPI_Datatype *newtype)
|
2722 |
| - __mpi_interface_removed__("MPI_Type_hindexed was removed in MPI-3.0; use MPI_Type_create_hindexed instead."); |
| 2755 | + __mpi_interface_removed__(MPI_Type_hindexed, MPI_Type_create_hindexed); |
2723 | 2756 | OMPI_DECLSPEC int PMPI_Type_hindexed(int count, int array_of_blocklengths[],
|
2724 | 2757 | MPI_Aint array_of_displacements[],
|
2725 | 2758 | MPI_Datatype oldtype, MPI_Datatype *newtype)
|
2726 |
| - __mpi_interface_removed__("PMPI_Type_hindexed was removed in MPI-3.0; use PMPI_Type_create_hindexed instead."); |
| 2759 | + __mpi_interface_removed__(PMPI_Type_hindexed, PMPI_Type_create_hindexed); |
2727 | 2760 | OMPI_DECLSPEC int MPI_Type_hvector(int count, int blocklength, MPI_Aint stride,
|
2728 | 2761 | MPI_Datatype oldtype, MPI_Datatype *newtype)
|
2729 |
| - __mpi_interface_removed__("MPI_Type_hvector was removed in MPI-3.0; use MPI_Type_create_hvector instead."); |
| 2762 | + __mpi_interface_removed__(MPI_Type_hvector, MPI_Type_create_hvector); |
2730 | 2763 | OMPI_DECLSPEC int PMPI_Type_hvector(int count, int blocklength, MPI_Aint stride,
|
2731 | 2764 | MPI_Datatype oldtype, MPI_Datatype *newtype)
|
2732 |
| - __mpi_interface_removed__("PMPI_Type_hvector was removed in MPI-3.0; use PMPI_Type_create_hvector instead."); |
| 2765 | + __mpi_interface_removed__(PMPI_Type_hvector, PMPI_Type_create_hvector); |
2733 | 2766 | OMPI_DECLSPEC int MPI_Type_lb(MPI_Datatype type, MPI_Aint *lb)
|
2734 |
| - __mpi_interface_removed__("MPI_Type_lb has been removed in MPI-3.0; use MPI_Type_get_extent instead."); |
| 2767 | + __mpi_interface_removed__(MPI_Type_lb, MPI_Type_get_extent); |
2735 | 2768 | OMPI_DECLSPEC int PMPI_Type_lb(MPI_Datatype type, MPI_Aint *lb)
|
2736 |
| - __mpi_interface_removed__("PMPI_Type_lb has been removed in MPI-3.0; use PMPI_Type_get_extent instead."); |
| 2769 | + __mpi_interface_removed__(PMPI_Type_lb, PMPI_Type_get_extent); |
2737 | 2770 | OMPI_DECLSPEC int MPI_Type_struct(int count, int array_of_blocklengths[],
|
2738 | 2771 | MPI_Aint array_of_displacements[],
|
2739 | 2772 | MPI_Datatype array_of_types[],
|
2740 | 2773 | MPI_Datatype *newtype)
|
2741 |
| - __mpi_interface_removed__("MPI_Type_struct was removed in MPI-3.0; use MPI_Type_create_struct instead."); |
| 2774 | + __mpi_interface_removed__(MPI_Type_struct, MPI_Type_create_struct); |
2742 | 2775 | OMPI_DECLSPEC int PMPI_Type_struct(int count, int array_of_blocklengths[],
|
2743 | 2776 | MPI_Aint array_of_displacements[],
|
2744 | 2777 | MPI_Datatype array_of_types[],
|
2745 | 2778 | MPI_Datatype *newtype)
|
2746 |
| - __mpi_interface_removed__("PMPI_Type_struct was removed in MPI-3.0; use PMPI_Type_create_struct instead."); |
| 2779 | + __mpi_interface_removed__(PMPI_Type_struct, PMPI_Type_create_struct); |
2747 | 2780 | OMPI_DECLSPEC int MPI_Type_ub(MPI_Datatype mtype, MPI_Aint *ub)
|
2748 |
| - __mpi_interface_removed__("MPI_Type_ub has been removed in MPI-3.0; use MPI_Type_get_extent instead."); |
| 2781 | + __mpi_interface_removed__(MPI_Type_ub, MPI_Type_get_extent); |
2749 | 2782 | OMPI_DECLSPEC int PMPI_Type_ub(MPI_Datatype mtype, MPI_Aint *ub)
|
2750 |
| - __mpi_interface_removed__("PMPI_Type_ub has been removed in MPI-3.0; use PMPI_Type_get_extent instead."); |
| 2783 | + __mpi_interface_removed__(PMPI_Type_ub, PMPI_Type_get_extent); |
2751 | 2784 | #endif /* !OMPI_OMIT_MPI1_COMPAT_DECLS */
|
2752 | 2785 |
|
| 2786 | +#if OMPI_REMOVED_USE_STATIC_ASSERT |
| 2787 | +#define MPI_Address(...) OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_Address, MPI_Get_address) |
| 2788 | +#define MPI_Errhandler_create OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_Errhandler_create, MPI_Comm_create_errhandler) |
| 2789 | +#define MPI_Errhandler_get(...) OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_Errhandler_get, MPI_Comm_get_errhandler) |
| 2790 | +#define MPI_Errhandler_set(...) OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_Errhandler_set, MPI_Comm_set_errhandler) |
| 2791 | +#define MPI_Type_extent(...) OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_Type_extent, MPI_Type_get_extent) |
| 2792 | +#define MPI_Type_hindexed(...) OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_Type_hindexed, MPI_Type_create_hindexed) |
| 2793 | +#define MPI_Type_hvector(...) OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_Type_hvector, MPI_Type_create_hvector) |
| 2794 | +#define MPI_Type_lb(...) OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_Type_lb, MPI_Type_get_extent) |
| 2795 | +#define MPI_Type_struct OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_Type_struct, MPI_Type_create_struct) |
| 2796 | +#define MPI_Type_ub(...) OMPI_REMOVED_STATIC_ASSERT_MSG(MPI_Type_ub, MPI_Type_get_extent) |
| 2797 | +#endif |
| 2798 | + |
2753 | 2799 | #if defined(c_plusplus) || defined(__cplusplus)
|
2754 | 2800 | }
|
2755 | 2801 | #endif
|
|
0 commit comments