Skip to content

Commit 4f8f2eb

Browse files
authored
Merge pull request #10098 from bwbarrett/make-master-abi-compatible-with-4.1.x
Make master abi compatible with 4.1.x
2 parents 119735d + 2308a9c commit 4f8f2eb

File tree

5 files changed

+45
-23
lines changed

5 files changed

+45
-23
lines changed

ompi/datatype/ompi_datatype_args.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -831,9 +831,7 @@ ompi_datatype_t* ompi_datatype_get_single_predefined_type_from_args( ompi_dataty
831831
return NULL;
832832
}
833833
}
834-
#if OMPI_ENABLE_MPI1_COMPAT
835834
if (current_predef != MPI_LB && current_predef != MPI_UB) {
836-
#endif
837835
if( NULL == predef ) { /* This is the first iteration */
838836
predef = current_predef;
839837
} else {
@@ -847,9 +845,7 @@ ompi_datatype_t* ompi_datatype_get_single_predefined_type_from_args( ompi_dataty
847845
return NULL;
848846
}
849847
}
850-
#if OMPI_ENABLE_MPI1_COMPAT
851848
}
852-
#endif
853849
}
854850
return predef;
855851
}

ompi/include/mpi.h.in

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* Copyright (c) 2017-2019 IBM Corporation. All rights reserved.
2323
* Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
2424
* Copyright (c) 2021-2022 Google, LLC. All rights reserved.
25-
* Copyright (c) 2021 Amazon.com, Inc. or its affiliates. All Rights
25+
* Copyright (c) 2021-2022 Amazon.com, Inc. or its affiliates. All Rights
2626
* reserved.
2727
* Copyright (c) 2021 Bull S.A.S. All rights reserved.
2828
* Copyright (c) 2018 Triad National Security, LLC. All rights
@@ -330,7 +330,9 @@
330330
* Don't do MACRO magic for building Profiling library as it
331331
* interferes with the above.
332332
*/
333-
# if (OMPI_ENABLE_MPI1_COMPAT || OMPI_BUILDING)
333+
# if defined(OMPI_OMIT_MPI1_COMPAT_DECLS)
334+
/* The user set OMPI_OMIT_MPI1_COMPAT_DECLS, do what he commands */
335+
# elif OMPI_ENABLE_MPI1_COMPAT
334336
# define OMPI_OMIT_MPI1_COMPAT_DECLS 0
335337
# define OMPI_REMOVED_USE_STATIC_ASSERT 0
336338
# define __mpi_interface_removed__(func, newfunc) __mpi_interface_deprecated__(#func " was removed in MPI-3.0. Use " #newfunc " instead. continuing...")
@@ -392,7 +394,7 @@
392394
#endif
393395

394396
#if !defined(OMPI_OMIT_MPI1_COMPAT_DECLS)
395-
# define OMPI_OMIT_MPI1_COMPAT_DECLS !OMPI_ENABLE_MPI1_COMPAT
397+
# define OMPI_OMIT_MPI1_COMPAT_DECLS (!(OMPI_ENABLE_MPI1_COMPAT || OMPI_BUILDING))
396398
#endif
397399

398400
/*
@@ -765,13 +767,25 @@ enum {
765767
MPI_COMBINER_DUP,
766768
MPI_COMBINER_CONTIGUOUS,
767769
MPI_COMBINER_VECTOR,
770+
#if (!OMPI_OMIT_MPI1_COMPAT_DECLS)
768771
MPI_COMBINER_HVECTOR_INTEGER,
772+
#else
773+
OMPI_WAS_MPI_COMBINER_HVECTOR_INTEGER, /* preserve ABI compatibility */
774+
#endif
769775
MPI_COMBINER_HVECTOR,
770776
MPI_COMBINER_INDEXED,
777+
#if (!OMPI_OMIT_MPI1_COMPAT_DECLS)
771778
MPI_COMBINER_HINDEXED_INTEGER,
779+
#else
780+
OMPI_WAS_MPI_COMBINER_HINDEXED_INTEGER, /* preserve ABI compatibility */
781+
#endif
772782
MPI_COMBINER_HINDEXED,
773783
MPI_COMBINER_INDEXED_BLOCK,
784+
#if (!OMPI_OMIT_MPI1_COMPAT_DECLS)
774785
MPI_COMBINER_STRUCT_INTEGER,
786+
#else
787+
OMPI_WAS_MPI_COMBINER_STRUCT_INTEGER, /* preserve ABI compatibility */
788+
#endif
775789
MPI_COMBINER_STRUCT,
776790
MPI_COMBINER_SUBARRAY,
777791
MPI_COMBINER_DARRAY,
@@ -782,6 +796,19 @@ enum {
782796
MPI_COMBINER_HINDEXED_BLOCK
783797
};
784798

799+
#if (OMPI_OMIT_MPI1_COMPAT_DECLS)
800+
/* If not building or configured --enable-mpi1-compatibility, then
801+
* we don't want these datatypes, instead we define MPI_COMBINER_*_INTEGER
802+
* to our Static Assert message if the compiler supports
803+
* that staticly assert with a nice message.
804+
*/
805+
# if (OMPI_REMOVED_USE_STATIC_ASSERT)
806+
# define MPI_COMBINER_HVECTOR_INTEGER THIS_SYMBOL_WAS_REMOVED_IN_MPI30(MPI_COMBINER_HVECTOR_INTEGER, MPI_COMBINER_HVECTOR);
807+
# define MPI_COMBINER_HINDEXED_INTEGER THIS_SYMBOL_WAS_REMOVED_IN_MPI30(MPI_COMBINER_HINDEXED_INTEGER, MPI_COMBINER_HINDEXED);
808+
# define MPI_COMBINER_STRUCT_INTEGER THIS_SYMBOL_WAS_REMOVED_IN_MPI30(MPI_COMBINER_STRUCT_INTEGER, MPI_COMBINER_STRUCT);
809+
# endif /* OMPI_REMOVED_USE_STATIC_ASSERT */
810+
#endif /* Removed datatypes */
811+
785812
/*
786813
* Communicator split type constants.
787814
* Do not change the order of these without also modifying mpif.h.in
@@ -1139,7 +1166,7 @@ OMPI_DECLSPEC extern MPI_Fint *MPI_F08_STATUSES_IGNORE;
11391166
* These datatypes were formally removed from the MPI specification
11401167
* and should no longer be used in MPI applications.
11411168
*/
1142-
#if (OMPI_ENABLE_MPI1_COMPAT || OMPI_BUILDING)
1169+
#if (!OMPI_OMIT_MPI1_COMPAT_DECLS)
11431170
# define MPI_UB OMPI_PREDEFINED_GLOBAL(MPI_Datatype, ompi_mpi_ub)
11441171
# define MPI_LB OMPI_PREDEFINED_GLOBAL(MPI_Datatype, ompi_mpi_lb)
11451172

@@ -1206,13 +1233,7 @@ OMPI_DECLSPEC extern struct ompi_predefined_datatype_t ompi_mpi_ub;
12061233
#define MPI_LONG_INT OMPI_PREDEFINED_GLOBAL(MPI_Datatype, ompi_mpi_long_int)
12071234
#define MPI_SHORT_INT OMPI_PREDEFINED_GLOBAL(MPI_Datatype, ompi_mpi_short_int)
12081235
#define MPI_2INT OMPI_PREDEFINED_GLOBAL(MPI_Datatype, ompi_mpi_2int)
1209-
#if !OMPI_OMIT_MPI1_COMPAT_DECLS
1210-
/*
1211-
* Removed datatypes
1212-
*/
1213-
#define MPI_UB OMPI_PREDEFINED_GLOBAL(MPI_Datatype, ompi_mpi_ub)
1214-
#define MPI_LB OMPI_PREDEFINED_GLOBAL(MPI_Datatype, ompi_mpi_lb)
1215-
#endif
1236+
12161237
#define MPI_WCHAR OMPI_PREDEFINED_GLOBAL(MPI_Datatype, ompi_mpi_wchar)
12171238
#if OPAL_HAVE_LONG_LONG
12181239
#define MPI_LONG_LONG_INT OMPI_PREDEFINED_GLOBAL(MPI_Datatype, ompi_mpi_long_long_int)
@@ -3021,7 +3042,7 @@ OMPI_DECLSPEC int OMPI_C_MPI_NULL_DELETE_FN( MPI_Comm comm, int comm_keyval,
30213042
void* extra_state )
30223043
__mpi_interface_deprecated__("MPI_NULL_DELETE_FN was deprecated in MPI-2.0; use MPI_COMM_NULL_DELETE_FN instead.");
30233044

3024-
#if !OMPI_OMIT_MPI1_COMPAT_DECLS
3045+
#if (!OMPI_OMIT_MPI1_COMPAT_DECLS)
30253046
/*
30263047
* Removed typedefs. These typedefs are only available if Open MPI
30273048
* was configured with --enable-mpi1-compatibility.

ompi/mpi/c/Makefile.am

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,10 @@ interface_profile_sources = \
484484
win_unlock_all.c \
485485
win_wait.c
486486

487-
if OMPI_ENABLE_MPI1_COMPAT
487+
# The following functions were removed from the MPI standard, but are
488+
# retained for ABI compliance reasons. They are listed independently
489+
# of the other MPI functions in case we one day change behavior around
490+
# ABI compliance.
488491
interface_profile_sources += \
489492
address.c \
490493
errhandler_create.c \
@@ -496,7 +499,6 @@ interface_profile_sources += \
496499
type_lb.c \
497500
type_struct.c \
498501
type_ub.c
499-
endif
500502

501503
libmpi_c_profile_la_SOURCES = $(interface_profile_sources)
502504
libmpi_c_profile_la_CPPFLAGS = -DOMPI_BUILD_MPI_PROFILING=1

ompi/mpi/fortran/mpif-h/Makefile.am

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -531,8 +531,10 @@ lib@OMPI_LIBMPI_NAME@_mpifh_la_SOURCES += \
531531
win_flush_local_f.c \
532532
win_flush_local_all_f.c
533533

534-
535-
if OMPI_ENABLE_MPI1_COMPAT
534+
# The following functions were removed from the MPI standard, but are
535+
# retained for ABI compliance reasons. They are listed independently
536+
# of the other MPI functions in case we one day change behavior around
537+
# ABI compliance.
536538
lib@OMPI_LIBMPI_NAME@_mpifh_la_SOURCES += \
537539
address_f.c \
538540
errhandler_create_f.c \
@@ -545,7 +547,6 @@ lib@OMPI_LIBMPI_NAME@_mpifh_la_SOURCES += \
545547
type_struct_f.c \
546548
type_ub_f.c
547549
endif
548-
endif
549550

550551
#
551552
# Conditionally install the header files

ompi/mpi/fortran/mpif-h/profile/Makefile.am

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,10 @@ linked_files = \
443443
pwin_flush_local_f.c \
444444
pwin_flush_local_all_f.c
445445

446-
if OMPI_ENABLE_MPI1_COMPAT
446+
# The following functions were removed from the MPI standard, but are
447+
# retained for ABI compliance reasons. They are listed independently
448+
# of the other MPI functions in case we one day change behavior around
449+
# ABI compliance.
447450
linked_files += \
448451
paddress_f.c \
449452
perrhandler_create_f.c \
@@ -455,7 +458,6 @@ linked_files += \
455458
ptype_lb_f.c \
456459
ptype_struct_f.c \
457460
ptype_ub_f.c
458-
endif
459461

460462
#
461463
# Sym link in the sources from the real MPI directory

0 commit comments

Comments
 (0)