Skip to content

Commit 6b91cc3

Browse files
committed
c_header: comment out deprecated functions
The ABI doesn't support any of the functions deprecated in MPI 3.1 or earlier. See section 20.2.1 of the MPI 5.0 standard. Signed-off-by: Howard Pritchard <[email protected]>
1 parent 2fefab2 commit 6b91cc3

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

ompi/mpi/bindings/c_header.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,24 @@
5757
"MPI_Delete_function",
5858
]
5959

60+
DEPRECATED_FUNCTIONS = [
61+
"MPI_Keyval_create",
62+
"MPI_Keyval_free",
63+
"MPI_Attr_put",
64+
"MPI_Attr_get",
65+
"MPI_Attr_delete",
66+
"MPI_Address",
67+
"MPI_Errhandler_create",
68+
"MPI_Errhandler_get",
69+
"MPI_Errhandler_set",
70+
"MPI_Type_extent",
71+
"MPI_Type_hindexed",
72+
"MPI_Type_hvector",
73+
"MPI_Type_lb",
74+
"MPI_Type_struct",
75+
"MPI_Type_ub",
76+
]
77+
6078
ENUM_CATEGORIES = [
6179
"ERROR_CLASSES",
6280
"MODE_CONSTANTS",
@@ -302,9 +320,17 @@ def output_constant(const, use_enum: bool, mangle_name: bool):
302320
# like "MPI_Group_difference"
303321
datatype_pattern = r"([\( ]?)(" + datatype + r")([; \*\)]{1})"
304322
line = re.sub(datatype_pattern, f"\\g<1>\\g<2>{ABI_INTERNAL}\\g<3>", line)
323+
# TODO: need to enhance pympistandard to be able to prune out deprecated functions
324+
# This stands in as a workaround
325+
comment_out = any(i in line for i in DEPRECATED_FUNCTIONS)
326+
327+
# function is not in the ABI standard (things in MPI 5.1 chapter 19 sections 19.3.4 and 19.3.5
305328
# TODO: need to enhance pympistandard to have field in json to indicate a
306329
# function is not in the ABI standard (things in MPI 5.1 chapter 19 sections 19.3.4 and 19.3.5
307330
if "MPI_Fint" in line or "MPI_F08_status" in line:
331+
comment_out = True
332+
333+
if comment_out == True:
308334
# Comment out a line if it has references to MPI_Fint or MPI_F08_status, since
309335
# functions with these argument types are not in the ABI
310336
line = line[:-1]

0 commit comments

Comments
 (0)