Skip to content

Commit 5ccee1c

Browse files
committed
SQUASH_ME: OMNIBUS commit 5
fix req converter abi to ompi fix problem with request_get_status_some bindings: fix up REQUEST_CONST for abi tools: first steps to add support for ABI Turns out that the ABI standard impacts MPI_T related constants, etc. and we don't want to switch to this for our OMPI standard, so we need to add support for MPI_T_ ABI compliant functions. Additions to the binding infrastructure to support generation of ABI bindings will be introduced in a subsequent commit. fix problem with undefined symbols in libmpi_abi hack on abi json file The MPI_T source order and MPI_T cb named enum types and their enum constants need special treatment. Ultimately the tool used to generate this json file - https://github.com/Joe-Downs/mpi-standard/blob/pr/handle-constant-tool/const-tool/test.py needs to find a home either in the MPI standard or in the pympistandard repo or elsewhere. abi.h template - add MPI_T related structs binding framework: fixes for MPI T stuff Add various MPI_T related structs to the manglizer. Also more workarounds for pympistandard not knowing about MPI 5.1 chapter sections 19.3.4 and 19.3.5 not being part of the ABI standard. binding framework: add a TS_LEVEL type more hacks on the mpi-standard-5.0-abi.json json file fix for enable-mca-dso makefile changes to add symbols to libmpi_abi abi: fix problems with error handler converters Fix problem with the abi -> ompi and ompi -> abi converters for errhandler handles. Also fix the bindings code where the original problem was. We aren't using the bindings framework now to generate the converters but we may possibly return to that approach at some point so fix that code in this commit. fix problems with makefiles and some symbols being doubly defined in the profile/non-profile abi mpi libs. abi: move mpi_type_get_envelope etc. into templates MPI_Type_get_envelop and MPI_Type_get_contents are a big mess as the MPI Forum decided not just to add big variants but also add additional arguments for the big count variants. So this necessitated enhancements to the binding infrastructure to support optional suppressing of bc and non-bc variants of prototype files. rebase fixup add abi variantes of mpi_aint_diff and add add abi_set/get_fortran_info implementation of abi_set_fortran_info is not complete. abi_fortran_stuff: fix up the imp of these abi_converters: add fortran datatypes to the converters. fix for mac-os CI pr feedback on add/diff for aints configury: discover fortran logical false rather than assuming its '0'/ configury fix for case of configure with fortran squashme: temporary commit Signed-off-by: Howard Pritchard <howardp@lanl.gov>
1 parent 722a2c1 commit 5ccee1c

File tree

103 files changed

+1918
-453
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+1918
-453
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,7 @@ ompi/mpi/c/standard_*.c
539539
ompi/mpi/c/abi.h
540540
ompi/mpi/c/abi_get_info.c
541541
ompi/mpi/c/standard_abi
542+
ompi/mpi/tool/*_generated*.c
542543

543544
# Generated Fortran Bindings
544545
ompi/mpi/fortran/use-mpi-f08/*_generated.F90

config/ompi_fortran_check_logical_array.m4

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ dnl All rights reserved.
1111
dnl Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
1212
dnl Copyright (c) 2015 Research Organization for Information Science
1313
dnl and Technology (RIST). All rights reserved.
14+
dnl Copyright (c) 2025 Triad National Security, LLC. All rights
15+
dnl reserved.
1416
dnl $COPYRIGHT$
1517
dnl
1618
dnl Additional copyrights may follow
@@ -64,7 +66,7 @@ void ompi_check_f(ompi_fortran_logical_t * logical)
6466
FILE *f=fopen("conftestval", "w");
6567
if (!f) exit(1);
6668

67-
if (logical[[0]] == 0 &&
69+
if (logical[[0]] == $ompi_cv_fortran_false_value &&
6870
logical[[1]] == $ompi_cv_fortran_true_value)
6971
result = 1;
7072
fprintf(f, "%d\n", result);

config/ompi_fortran_get_value_true.m4

Lines changed: 56 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ dnl All rights reserved.
1111
dnl Copyright (c) 2011-2012 Cisco Systems, Inc. All rights reserved.
1212
dnl Copyright (c) 2015 Research Organization for Information Science
1313
dnl and Technology (RIST). All rights reserved.
14+
dnl Copyright (c) 2025 Triad National Security, LLC. All rights
15+
dnl reserved.
1416
dnl $COPYRIGHT$
1517
dnl
1618
dnl Additional copyrights may follow
@@ -27,16 +29,22 @@ AC_DEFUN([OMPI_FORTRAN_GET_VALUE_TRUE],[
2729
if test "$ompi_cv_fortran_true_value" = "0" ; then
2830
unset ompi_cv_fortran_true_value
2931
fi
32+
if test "$ompi_cv_fortran_false_value" = "0" ; then
33+
unset ompi_cv_fortran_false_value
34+
fi
3035

3136
AS_VAR_PUSHDEF([fortran_true_var],
3237
[ompi_cv_fortran_true_value])
38+
AS_VAR_PUSHDEF([fortran_false_var],
39+
[ompi_cv_fortran_false_value])
3340

3441
AC_CACHE_CHECK([Fortran value for .TRUE. logical type],
3542
fortran_true_var,
3643
[if test "$1" = "none" || \
3744
test $OMPI_TRY_FORTRAN_BINDINGS -eq $OMPI_FORTRAN_NO_BINDINGS || \
3845
test $ompi_fortran_happy -eq 0 ; then
39-
value=77
46+
tvalue=77
47+
fvalue=77
4048
else
4149
#
4250
# C module
@@ -98,6 +106,14 @@ EOF
98106
CALL ompi_print(value)
99107
end
100108
EOF
109+
cat > conftestf2.f <<EOF
110+
program main
111+
logical value
112+
value=.FALSE.
113+
CALL ompi_print(value)
114+
end
115+
EOF
116+
101117

102118
#
103119
# Try the compilation and run.
@@ -114,11 +130,40 @@ EOF
114130
AS_IF([test "$cross_compiling" = "yes"],
115131
[AC_MSG_ERROR([Can not determine value of .TRUE. when cross-compiling])],
116132
[OPAL_LOG_COMMAND([./conftest],
117-
[value=`sed 's/ *//' conftestval`],
133+
[tvalue=`sed 's/ *//' conftestval`],
118134
[AC_MSG_ERROR([Could not determine value of Fotran .TRUE.. Aborting.])])])
135+
136+
cat > conftestf.f <<EOF
137+
program main
138+
logical value
139+
value=.FALSE.
140+
CALL ompi_print(value)
141+
end
142+
EOF
143+
144+
#
145+
# Try the compilation and run.
146+
#
147+
OPAL_LOG_COMMAND([$CC $CFLAGS -I. -c conftest.c],
148+
[OPAL_LOG_COMMAND([$FC $FCFLAGS -o conftest conftest.o conftestf.f $LDFLAGS $LIBS],
149+
[happy=1], [happy=0])],
150+
[happy=0])
151+
152+
AS_IF([test $happy -eq 0 && test $ompi_fortran_happy -eq 1],
153+
[AC_MSG_ERROR([Could not compile Fortran .FALSE. test. Aborting.])
154+
])
155+
156+
AS_IF([test "$cross_compiling" = "yes"],
157+
[AC_MSG_ERROR([Can not determine value of .FALSE. when cross-compiling])],
158+
[OPAL_LOG_COMMAND([./conftest],
159+
[fvalue=`sed 's/ *//' conftestval`],
160+
[AC_MSG_ERROR([Could not determine value of Fotran .FALSE.. Aborting.])])])
119161
fi
120-
AS_VAR_SET(fortran_true_var, [$value])
121-
unset value
162+
AS_VAR_SET(fortran_true_var, [$tvalue])
163+
unset tvalue
164+
AS_VAR_SET(fortran_false_var, [$fvalue])
165+
unset fvalue
166+
122167
])
123168

124169
AS_VAR_COPY([ompi_fortran_true_value], [fortran_true_var])
@@ -127,6 +172,13 @@ EOF
127172
[Fortran value for LOGICAL .TRUE. value])
128173
AS_VAR_POPDEF([fortran_true_var])
129174

175+
AS_VAR_COPY([ompi_fortran_false_value], [fortran_false_var])
176+
AC_DEFINE_UNQUOTED([OMPI_FORTRAN_VALUE_FALSE],
177+
[$ompi_fortran_false_value],
178+
[Fortran value for LOGICAL .FALSE. value])
179+
AS_VAR_POPDEF([fortran_false_var])
180+
181+
130182
unset happy ompi_print_logical_fn
131183
rm -rf conftest*
132184
])dnl

docs/man-openmpi/man3/MPI_Errors.3.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,9 +348,13 @@ Standard error return classes for Open MPI:
348348
- Value is too large to store.
349349

350350
* - MPI_ERR_ERRHANDLER
351-
- 89
351+
- 80
352352
- Invalid error handler handle.
353353

354+
* - MPI_ERR_ABI
355+
- 81
356+
- Invalid use of ABI method.
357+
354358
* - MPI_ERR_LASTCODE
355359
- 93
356360
- Last error code.

docs/mpi-standard-5.0-abi.json

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -6889,8 +6889,8 @@
68896889
"mpi_comm_null_copy_fn": {
68906890
"handle_types": {
68916891
"c": {
6892-
"type": "MPI_Comm_copy_attr_function",
6893-
"description": "\\ctype{MPI_Comm_copy_attr_function}"
6892+
"type": "MPI_Comm_copy_attr_function *",
6893+
"description": "\\ctype{MPI_Comm_copy_attr_function *}"
68946894
},
68956895
"f90": {
68966896
"type": "COMM_COPY_ATTR_FUNCTION",
@@ -6910,7 +6910,7 @@
69106910
"mpi_comm_dup_fn": {
69116911
"handle_types": {
69126912
"c": {
6913-
"type": "MPI_Comm_copy_attr_function",
6913+
"type": "MPI_Comm_copy_attr_function *",
69146914
"description": "\\ctype{MPI_Comm_copy_attr_function}"
69156915
},
69166916
"f90": {
@@ -6931,8 +6931,8 @@
69316931
"mpi_comm_null_delete_fn": {
69326932
"handle_types": {
69336933
"c": {
6934-
"type": "MPI_Comm_delete_attr_function",
6935-
"description": "\\ctype{MPI_Comm_delete_attr_function}"
6934+
"type": "MPI_Comm_delete_attr_function *",
6935+
"description": "\\ctype{MPI_Comm_delete_attr_function *}"
69366936
},
69376937
"f90": {
69386938
"type": "COMM_DELETE_ATTR_FUNCTION",
@@ -6952,8 +6952,8 @@
69526952
"mpi_win_null_copy_fn": {
69536953
"handle_types": {
69546954
"c": {
6955-
"type": "MPI_Win_copy_attr_function",
6956-
"description": "\\ctype{MPI_Win_copy_attr_function}"
6955+
"type": "MPI_Win_copy_attr_function *",
6956+
"description": "\\ctype{MPI_Win_copy_attr_function *}"
69576957
},
69586958
"f90": {
69596959
"type": "WIN_COPY_ATTR_FUNCTION",
@@ -6973,8 +6973,8 @@
69736973
"mpi_win_dup_fn": {
69746974
"handle_types": {
69756975
"c": {
6976-
"type": "MPI_Win_copy_attr_function",
6977-
"description": "\\ctype{MPI_Win_copy_attr_function}"
6976+
"type": "MPI_Win_copy_attr_function *",
6977+
"description": "\\ctype{MPI_Win_copy_attr_function *}"
69786978
},
69796979
"f90": {
69806980
"type": "WIN_COPY_ATTR_FUNCTION",
@@ -6994,8 +6994,8 @@
69946994
"mpi_win_null_delete_fn": {
69956995
"handle_types": {
69966996
"c": {
6997-
"type": "MPI_Win_delete_attr_function",
6998-
"description": "\\ctype{MPI_Win_delete_attr_function}"
6997+
"type": "MPI_Win_delete_attr_function *",
6998+
"description": "\\ctype{MPI_Win_delete_attr_function *}"
69996999
},
70007000
"f90": {
70017001
"type": "WIN_DELETE_ATTR_FUNCTION",
@@ -7015,8 +7015,8 @@
70157015
"mpi_type_null_copy_fn": {
70167016
"handle_types": {
70177017
"c": {
7018-
"type": "MPI_Type_copy_attr_function",
7019-
"description": "\\ctype{MPI_Type_copy_attr_function}"
7018+
"type": "MPI_Type_copy_attr_function *",
7019+
"description": "\\ctype{MPI_Type_copy_attr_function *}"
70207020
},
70217021
"f90": {
70227022
"type": "TYPE_COPY_ATTR_FUNCTION",
@@ -7036,8 +7036,8 @@
70367036
"mpi_type_dup_fn": {
70377037
"handle_types": {
70387038
"c": {
7039-
"type": "MPI_Type_copy_attr_function",
7040-
"description": "\\ctype{MPI_Type_copy_attr_function}"
7039+
"type": "MPI_Type_copy_attr_function *",
7040+
"description": "\\ctype{MPI_Type_copy_attr_function *}"
70417041
},
70427042
"f90": {
70437043
"type": "TYPE_COPY_ATTR_FUNCTION",
@@ -7057,8 +7057,8 @@
70577057
"mpi_type_null_delete_fn": {
70587058
"handle_types": {
70597059
"c": {
7060-
"type": "MPI_Type_delete_attr_function",
7061-
"description": "\\ctype{MPI_Type_delete_attr_function}"
7060+
"type": "MPI_Type_delete_attr_function *",
7061+
"description": "\\ctype{MPI_Type_delete_attr_function *}"
70627062
},
70637063
"f90": {
70647064
"type": "TYPE_DELETE_ATTR_FUNCTION",
@@ -7078,8 +7078,8 @@
70787078
"mpi_conversion_fn_null": {
70797079
"handle_types": {
70807080
"c": {
7081-
"type": "MPI_Datarep_conversion_function",
7082-
"description": "\\ctype{MPI_Datarep_conversion_function}"
7081+
"type": "MPI_Datarep_conversion_function *",
7082+
"description": "\\ctype{MPI_Datarep_conversion_function *}"
70837083
},
70847084
"f90": {
70857085
"type": "DATAREP_CONVERSION_FUNCTION",
@@ -7099,8 +7099,8 @@
70997099
"mpi_conversion_fn_null_c": {
71007100
"handle_types": {
71017101
"c": {
7102-
"type": "MPI_Datarep_conversion_function_c",
7103-
"description": "\\ctype{MPI_Datarep_conversion_function_c}"
7102+
"type": "MPI_Datarep_conversion_function_c *",
7103+
"description": "\\ctype{MPI_Datarep_conversion_function_c *}"
71047104
},
71057105
"f90": {
71067106
"type": null,
@@ -7120,8 +7120,8 @@
71207120
"mpi_null_copy_fn": {
71217121
"handle_types": {
71227122
"c": {
7123-
"type": "MPI_Copy_function",
7124-
"description": "\\ctype{MPI_Copy_function}"
7123+
"type": "MPI_Copy_function *",
7124+
"description": "\\ctype{MPI_Copy_function *}"
71257125
},
71267126
"f90": {
71277127
"type": "COPY_FUNCTION",
@@ -7141,8 +7141,8 @@
71417141
"mpi_dup_fn": {
71427142
"handle_types": {
71437143
"c": {
7144-
"type": "MPI_Copy_function",
7145-
"description": "\\ctype{MPI_Copy_function}"
7144+
"type": "MPI_Copy_function *",
7145+
"description": "\\ctype{MPI_Copy_function *}"
71467146
},
71477147
"f90": {
71487148
"type": "COPY_FUNCTION",
@@ -7162,8 +7162,8 @@
71627162
"mpi_null_delete_fn": {
71637163
"handle_types": {
71647164
"c": {
7165-
"type": "MPI_Delete_function",
7166-
"description": "\\ctype{MPI_Delete_function}"
7165+
"type": "MPI_Delete_function *",
7166+
"description": "\\ctype{MPI_Delete_function *}"
71677167
},
71687168
"f90": {
71697169
"type": "DELETE_FUNCTION",
@@ -8170,8 +8170,8 @@
81708170
"mpi_t_source_ordered": {
81718171
"handle_types": {
81728172
"c": {
8173-
"type": "int",
8174-
"description": "integer constant expression of type \\ctype{int}"
8173+
"type": "MPI_T_source_order",
8174+
"description": "integer constant expression of type \\ctype{MPI_T_source_order}"
81758175
},
81768176
"f90": {
81778177
"type": null,
@@ -8191,8 +8191,8 @@
81918191
"mpi_t_source_unordered": {
81928192
"handle_types": {
81938193
"c": {
8194-
"type": "int",
8195-
"description": "integer constant expression of type \\ctype{int}"
8194+
"type": "MPI_T_source_order",
8195+
"description": "integer constant expression of type \\ctype{MPI_T_source_order}"
81968196
},
81978197
"f90": {
81988198
"type": null,
@@ -8212,8 +8212,8 @@
82128212
"mpi_t_cb_require_none": {
82138213
"handle_types": {
82148214
"c": {
8215-
"type": "int",
8216-
"description": "integer constant expression of type \\ctype{int}"
8215+
"type": "MPI_T_cb_safety",
8216+
"description": "integer constant expression of type \\ctype{MPI_T_cb_safety}"
82178217
},
82188218
"f90": {
82198219
"type": null,
@@ -8233,8 +8233,8 @@
82338233
"mpi_t_cb_require_mpi_restricted": {
82348234
"handle_types": {
82358235
"c": {
8236-
"type": "int",
8237-
"description": "integer constant expression of type \\ctype{int}"
8236+
"type": "MPI_T_cb_safety",
8237+
"description": "integer constant expression of type \\ctype{MPI_T_cb_safety}"
82388238
},
82398239
"f90": {
82408240
"type": null,
@@ -8254,8 +8254,8 @@
82548254
"mpi_t_cb_require_thread_safe": {
82558255
"handle_types": {
82568256
"c": {
8257-
"type": "int",
8258-
"description": "integer constant expression of type \\ctype{int}"
8257+
"type": "MPI_T_cb_safety",
8258+
"description": "integer constant expression of type \\ctype{MPI_T_cb_safety}"
82598259
},
82608260
"f90": {
82618261
"type": null,
@@ -8275,8 +8275,8 @@
82758275
"mpi_t_cb_require_async_signal_safe": {
82768276
"handle_types": {
82778277
"c": {
8278-
"type": "int",
8279-
"description": "integer constant expression of type \\ctype{int}"
8278+
"type": "MPI_T_cb_safety",
8279+
"description": "integer constant expression of type \\ctype{MPI_T_cb_safety}"
82808280
},
82818281
"f90": {
82828282
"type": null,

ompi/errhandler/errcode.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ static ompi_mpi_errcode_t ompi_err_revoked;
129129
static ompi_mpi_errcode_t ompi_err_session;
130130
static ompi_mpi_errcode_t ompi_err_value_too_large;
131131
static ompi_mpi_errcode_t ompi_err_errhandler;
132+
static ompi_mpi_errcode_t ompi_err_abi;
132133

133134
static void ompi_mpi_errcode_construct(ompi_mpi_errcode_t* errcode);
134135
static void ompi_mpi_errcode_destruct(ompi_mpi_errcode_t* errcode);
@@ -248,6 +249,7 @@ int ompi_mpi_errcode_init (void)
248249
CONSTRUCT_ERRCODE( ompi_err_session, MPI_ERR_SESSION, "MPI_ERR_SESSION: Invalid session handle" );
249250
CONSTRUCT_ERRCODE( ompi_err_value_too_large, MPI_ERR_VALUE_TOO_LARGE, "MPI_ERR_VALUE_TOO_LARGE: Value is too large to store" );
250251
CONSTRUCT_ERRCODE( ompi_err_errhandler, MPI_ERR_ERRHANDLER, "MPI_ERR_ERRHANDLER: Invalid error handler handle" );
252+
CONSTRUCT_ERRCODE( ompi_err_abi, MPI_ERR_ABI, "MPI_ERR_ABI: Invalid call to abi fortran method" );
251253

252254
/* Per MPI-3 p353:27-32, MPI_LASTUSEDCODE must be >=
253255
MPI_ERR_LASTCODE. So just start it as == MPI_ERR_LASTCODE. */
@@ -367,6 +369,7 @@ int ompi_mpi_errcode_finalize (void)
367369
OBJ_DESTRUCT(&ompi_err_session);
368370
OBJ_DESTRUCT(&ompi_err_value_too_large);
369371
OBJ_DESTRUCT(&ompi_err_errhandler);
372+
OBJ_DESTRUCT(&ompi_err_abi);
370373
OBJ_DESTRUCT(&ompi_mpi_errcodes);
371374
ompi_mpi_errcode_lastpredefined = 0;
372375
opal_mutex_unlock(&errcode_lock);

0 commit comments

Comments
 (0)