Skip to content

Commit 89da965

Browse files
committed
ompi: disable functions removed from MPI-3.0 by default
This commit adds a new configure option: --enable-mpi1-compat. Without this option we will no longer provide APIs, typedefs, and defines that were removed from the standard in MPI-3.0. This option will exist for one major release (Open MPI v4.x.x) and then the option and associated code will be removed in Open MPI v5.x.x. Open MPI has already internally prepared for this change. Please prepare your codes accordingly. Signed-off-by: Nathan Hjelm <[email protected]>
1 parent f5631e5 commit 89da965

23 files changed

+1024
-860
lines changed

config/ompi_config_files.m4

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
# Copyright (c) 2009-2017 Cisco Systems, Inc. All rights reserved
44
# Copyright (c) 2017 Research Organization for Information Science
55
# and Technology (RIST). All rights reserved.
6+
# Copyright (c) 2018 Los Alamos National Security, LLC. All rights
7+
# reserved.
68
# $COPYRIGHT$
79
#
810
# Additional copyrights may follow
@@ -33,6 +35,7 @@ AC_DEFUN([OMPI_CONFIG_FILES],[
3335
ompi/mpi/fortran/use-mpi-ignore-tkr/Makefile
3436
ompi/mpi/fortran/use-mpi-ignore-tkr/mpi-ignore-tkr-interfaces.h
3537
ompi/mpi/fortran/use-mpi-ignore-tkr/mpi-ignore-tkr-file-interfaces.h
38+
ompi/mpi/fortran/use-mpi-ignore-tkr/mpi-ignore-tkr-removed-interfaces.h
3639
ompi/mpi/fortran/use-mpi-f08/Makefile
3740
ompi/mpi/fortran/use-mpi-f08/mod/Makefile
3841
ompi/mpi/fortran/mpiext/Makefile

config/ompi_configure_options.m4

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ dnl All rights reserved.
1313
dnl Copyright (c) 2006-2017 Cisco Systems, Inc. All rights reserved
1414
dnl Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
1515
dnl Copyright (c) 2009 IBM Corporation. All rights reserved.
16-
dnl Copyright (c) 2009 Los Alamos National Security, LLC. All rights
16+
dnl Copyright (c) 2009-2018 Los Alamos National Security, LLC. All rights
1717
dnl reserved.
1818
dnl Copyright (c) 2009 Oak Ridge National Labs. All rights reserved.
1919
dnl Copyright (c) 2013 Intel, Inc. All rights reserved.
@@ -196,6 +196,21 @@ fi
196196
AC_DEFINE_UNQUOTED([OMPI_WANT_MPI_CXX_SEEK], [$OMPI_WANT_MPI_CXX_SEEK],
197197
[do we want to try to work around C++ bindings SEEK_* issue?])
198198

199+
# Remove these when we finally kill them once and for all
200+
AC_ARG_ENABLE([mpi1-compatibility],
201+
[AC_HELP_STRING([--enable-mpi1-compatibility],
202+
[Enable support for MPI-1.x functions removed from the current MPI standard (MPI-3.x). This option will go away in a future release of Open MPI (default: disabled)])])
203+
204+
if test "x$enable_mpi1_compatibility" = "xyes" ; then
205+
ompi_mpi1_support=1
206+
else
207+
ompi_mpi1_support=0
208+
fi
209+
210+
211+
AC_DEFINE_UNQUOTED([OMPI_ENABLE_MPI1_COMPAT], [$ompi_mpi1_support], [whether we want MPI-1.x support])
212+
AC_SUBST([OMPI_ENABLE_MPI1_COMPAT], [$ompi_mpi1_support])
213+
AM_CONDITIONAL([OMPI_ENABLE_MPI1_COMPAT],[test $ompi_mpi1_support = 1])
199214

200215
#
201216
# Do we want to disable MPI parameter checking at run-time?

config/opal_check_attributes.m4

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ AC_DEFUN([OPAL_CHECK_ATTRIBUTES], [
223223
opal_cv___attribute__weak_alias=0
224224
opal_cv___attribute__destructor=0
225225
opal_cv___attribute__optnone=0
226+
opal_cv___attribute__error=0
226227
else
227228
AC_MSG_RESULT([yes])
228229

@@ -271,6 +272,13 @@ AC_DEFUN([OPAL_CHECK_ATTRIBUTES], [
271272
[],
272273
[])
273274

275+
_OPAL_CHECK_SPECIFIC_ATTRIBUTE([error],
276+
[
277+
int foo(int arg1, int arg2) __attribute__ ((__error__("")));
278+
],
279+
[],
280+
[])
281+
274282
ATTRIBUTE_CFLAGS=
275283
case "$opal_c_vendor" in
276284
gnu)
@@ -629,4 +637,6 @@ AC_DEFUN([OPAL_CHECK_ATTRIBUTES], [
629637
[Whether your compiler has __attribute__ optnone or not])
630638
AC_DEFINE_UNQUOTED(OPAL_HAVE_ATTRIBUTE_EXTENSION, [$opal_cv___attribute__extension],
631639
[Whether your compiler has __attribute__ extension or not])
640+
AC_DEFINE_UNQUOTED(OPAL_HAVE_ATTRIBUTE_ERROR, [$opal_cv___attribute__error],
641+
[Whether your compiler has __attribute__ error or not])
632642
])

ompi/datatype/ompi_datatype_args.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,9 @@ ompi_datatype_t* ompi_datatype_get_single_predefined_type_from_args( ompi_dataty
839839
return NULL;
840840
}
841841
}
842+
#if OMPI_ENABLE_MPI1_COMPAT
842843
if (current_predef != MPI_LB && current_predef != MPI_UB) {
844+
#endif
843845
if( NULL == predef ) { /* This is the first iteration */
844846
predef = current_predef;
845847
} else {
@@ -853,7 +855,9 @@ ompi_datatype_t* ompi_datatype_get_single_predefined_type_from_args( ompi_dataty
853855
return NULL;
854856
}
855857
}
858+
#if OMPI_ENABLE_MPI1_COMPAT
856859
}
860+
#endif
857861
}
858862
return predef;
859863
}

ompi/include/mpi.h.in

Lines changed: 151 additions & 114 deletions
Large diffs are not rendered by default.

ompi/mpi/c/Makefile.am

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# Copyright (c) 2011 Sandia National Laboratories. All rights reserved.
1414
# Copyright (c) 2012 Oak Rigde National Laboratory. All rights reserved.
1515
# Copyright (c) 2012-2013 Inria. All rights reserved.
16-
# Copyright (c) 2013 Los Alamos National Security, LLC. All rights
16+
# Copyright (c) 2013-2018 Los Alamos National Security, LLC. All rights
1717
# reserved.
1818
# Copyright (c) 2015-2017 Research Organization for Information Science
1919
# and Technology (RIST). All rights reserved.
@@ -65,7 +65,6 @@ libmpi_c_mpi_la_SOURCES = \
6565
add_error_class.c \
6666
add_error_code.c \
6767
add_error_string.c \
68-
address.c \
6968
allgather.c \
7069
iallgather.c \
7170
allgatherv.c \
@@ -79,9 +78,6 @@ libmpi_c_mpi_la_SOURCES = \
7978
ialltoallv.c \
8079
alltoallw.c \
8180
ialltoallw.c \
82-
attr_delete.c \
83-
attr_get.c \
84-
attr_put.c \
8581
barrier.c \
8682
ibarrier.c \
8783
bcast.c \
@@ -144,11 +140,8 @@ libmpi_c_mpi_la_SOURCES = \
144140
compare_and_swap.c \
145141
dims_create.c \
146142
errhandler_c2f.c \
147-
errhandler_create.c \
148143
errhandler_f2c.c \
149144
errhandler_free.c \
150-
errhandler_get.c \
151-
errhandler_set.c \
152145
error_class.c \
153146
error_string.c \
154147
exscan.c \
@@ -277,8 +270,6 @@ libmpi_c_mpi_la_SOURCES = \
277270
is_thread_main.c \
278271
isend.c \
279272
issend.c \
280-
keyval_create.c \
281-
keyval_free.c \
282273
lookup_name.c \
283274
message_f2c.c \
284275
message_c2f.c \
@@ -370,7 +361,6 @@ libmpi_c_mpi_la_SOURCES = \
370361
type_create_subarray.c \
371362
type_delete_attr.c \
372363
type_dup.c \
373-
type_extent.c \
374364
type_f2c.c \
375365
type_free.c \
376366
type_free_keyval.c \
@@ -382,17 +372,12 @@ libmpi_c_mpi_la_SOURCES = \
382372
type_get_name.c \
383373
type_get_true_extent.c \
384374
type_get_true_extent_x.c \
385-
type_hindexed.c \
386-
type_hvector.c \
387375
type_indexed.c \
388-
type_lb.c \
389376
type_match_size.c \
390377
type_set_attr.c \
391378
type_set_name.c \
392379
type_size.c \
393380
type_size_x.c \
394-
type_struct.c \
395-
type_ub.c \
396381
type_vector.c \
397382
unpack_external.c \
398383
unpack.c \
@@ -446,6 +431,25 @@ libmpi_c_mpi_la_SOURCES = \
446431
win_unlock_all.c \
447432
win_wait.c
448433

434+
if OMPI_ENABLE_MPI1_COMPAT
435+
libmpi_c_mpi_la_SOURCES += \
436+
address.c \
437+
attr_delete.c \
438+
attr_get.c \
439+
attr_put.c \
440+
errhandler_create.c \
441+
errhandler_get.c \
442+
errhandler_set.c \
443+
keyval_create.c \
444+
keyval_free.c \
445+
type_extent.c \
446+
type_hindexed.c \
447+
type_hvector.c \
448+
type_lb.c \
449+
type_struct.c \
450+
type_ub.c
451+
endif
452+
449453
# Conditionally install the header files
450454

451455
if WANT_INSTALL_HEADERS

ompi/mpi/c/attr_fn.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,11 @@ int OMPI_C_MPI_COMM_DUP_FN( MPI_Comm comm, int comm_keyval, void* extra_state,
131131
return MPI_SUCCESS;
132132
}
133133

134+
#if !defined(OMPI_ENABLE_MPI1_COMPAT)
135+
136+
#error "Need to delete the code below now that the removed functions are no longer shipping"
137+
138+
#elif OMPI_ENABLE_MPI1_COMPAT
134139
int OMPI_C_MPI_NULL_DELETE_FN( MPI_Comm comm, int comm_keyval,
135140
void* attribute_val_out,
136141
void* extra_state )
@@ -154,3 +159,4 @@ int OMPI_C_MPI_DUP_FN( MPI_Comm comm, int comm_keyval, void* extra_state,
154159
*(void**)attribute_val_out = attribute_val_in;
155160
return MPI_SUCCESS;
156161
}
162+
#endif

ompi/mpi/c/profile/Makefile.am

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# -*- makefile -*-
1+
# -*- makefile.am -*-
22
#
33
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
44
# University Research and Technology
@@ -45,7 +45,6 @@ nodist_libmpi_c_pmpi_la_SOURCES = \
4545
padd_error_class.c \
4646
padd_error_code.c \
4747
padd_error_string.c \
48-
paddress.c \
4948
pallgather.c \
5049
piallgather.c \
5150
pallgatherv.c \
@@ -59,9 +58,6 @@ nodist_libmpi_c_pmpi_la_SOURCES = \
5958
pialltoallv.c \
6059
palltoallw.c \
6160
pialltoallw.c \
62-
pattr_delete.c \
63-
pattr_get.c \
64-
pattr_put.c \
6561
pbarrier.c \
6662
pibarrier.c \
6763
pbcast.c \
@@ -124,11 +120,8 @@ nodist_libmpi_c_pmpi_la_SOURCES = \
124120
pcompare_and_swap.c \
125121
pdims_create.c \
126122
perrhandler_c2f.c \
127-
perrhandler_create.c \
128123
perrhandler_f2c.c \
129124
perrhandler_free.c \
130-
perrhandler_get.c \
131-
perrhandler_set.c \
132125
perror_class.c \
133126
perror_string.c \
134127
pexscan.c \
@@ -257,8 +250,6 @@ nodist_libmpi_c_pmpi_la_SOURCES = \
257250
pis_thread_main.c \
258251
pisend.c \
259252
pissend.c \
260-
pkeyval_create.c \
261-
pkeyval_free.c \
262253
plookup_name.c \
263254
pmessage_f2c.c \
264255
pmessage_c2f.c \
@@ -350,7 +341,6 @@ nodist_libmpi_c_pmpi_la_SOURCES = \
350341
ptype_create_subarray.c \
351342
ptype_delete_attr.c \
352343
ptype_dup.c \
353-
ptype_extent.c \
354344
ptype_f2c.c \
355345
ptype_free.c \
356346
ptype_free_keyval.c \
@@ -362,17 +352,12 @@ nodist_libmpi_c_pmpi_la_SOURCES = \
362352
ptype_get_name.c \
363353
ptype_get_true_extent.c \
364354
ptype_get_true_extent_x.c \
365-
ptype_hindexed.c \
366-
ptype_hvector.c \
367355
ptype_indexed.c \
368-
ptype_lb.c \
369356
ptype_match_size.c \
370357
ptype_set_attr.c \
371358
ptype_set_name.c \
372359
ptype_size.c \
373360
ptype_size_x.c \
374-
ptype_struct.c \
375-
ptype_ub.c \
376361
ptype_vector.c \
377362
punpack_external.c \
378363
punpack.c \
@@ -426,6 +411,25 @@ nodist_libmpi_c_pmpi_la_SOURCES = \
426411
pwin_unlock_all.c \
427412
pwin_wait.c
428413

414+
if OMPI_ENABLE_MPI1_COMPAT
415+
nodist_libmpi_c_pmpi_la_SOURCES += \
416+
paddress.c \
417+
pattr_delete.c \
418+
pattr_get.c \
419+
pattr_put.c \
420+
perrhandler_create.c \
421+
perrhandler_get.c \
422+
perrhandler_set.c \
423+
pkeyval_create.c \
424+
pkeyval_free.c \
425+
ptype_extent.c \
426+
ptype_hindexed.c \
427+
ptype_hvector.c \
428+
ptype_lb.c \
429+
ptype_struct.c \
430+
ptype_ub.c
431+
endif
432+
429433
#
430434
# Sym link in the sources from the real MPI directory
431435
#

ompi/mpi/fortran/configure-fortran-output.h.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@
106106
#define OMPI_KIND_FORTRAN_COMPLEX32 @OMPI_KIND_FORTRAN_COMPLEX32@
107107
#define OMPI_SIZEOF_FORTRAN_COMPLEX32 @OMPI_SIZEOF_FORTRAN_COMPLEX32@
108108
109+
#define OMPI_ENABLE_MPI1_COMPAT @OMPI_ENABLE_MPI1_COMPAT@
110+
109111
! Include some post-processing, based on the values from above
110112
111113
#include "ompi/mpi/fortran/configure-fortran-output-bottom.h"

0 commit comments

Comments
 (0)