Skip to content

Commit 0fcd866

Browse files
committed
corrections etc. to ABI README
Signed-off-by: Howard Pritchard <[email protected]>
1 parent 18f3b3e commit 0fcd866

File tree

1 file changed

+31
-27
lines changed

1 file changed

+31
-27
lines changed

ompi/mpi/README_ABI.md

Lines changed: 31 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@ Last updated: November 2025
44

55
This README describes the current approach to supporting the MPI-5
66
Application Binary Interface (ABI). The MPI ABI is described in
7-
Chapter 21 of the MPI-5 standard. The standardizes values for
7+
Chapter 20 of the MPI-5 standard. The standardized values for
88
constants, etc. are presented in Appendix A of that document.
99

10-
At this time, Open MPI is only supporting the 'c' ABI functionality
11-
although the Fortran related query methods presented in Chapter 21
12-
are supported.
10+
Open MPI supports the 'c' ABI functionality described in that chapter.
1311

1412
## What does having a defined ABI mean to applications?
1513

@@ -21,10 +19,14 @@ This only applies to dynamically linked applications.
2119
In principle a single mpi.h include file can be used, for example
2220
the one provided at https://github.com/mpi-forum/mpi-abi-stubs.
2321

24-
Chapter 21 specifies the shared library name (soname) of the ABI MPI
25-
library and its file name (libmpi\_abi). The major and minor versions
26-
of the library are specified in this chapter as well. The name of
27-
the compiler wrapper - mpicc\_abi - is also specified.
22+
The MPI ABI specifies the file name of the ABI MPI
23+
library (libmpi_abi). It does not explicitly specify the shared library
24+
name(SONAME), but it presumably is libmpi_abi.0. Note we need for this to
25+
by the same name as that used by the MPICH implementation of the MPI ABI.
26+
The major and minor versions of the library are specified in this chapter as well.
27+
See the top level VERSION file for adjusting the SONAME.
28+
29+
The name of the compiler wrapper - mpicc_abi - is also specified.
2830

2931
## Refactor of Open MPI to support the MPI ABI
3032

@@ -39,14 +41,14 @@ libraries are linked. The structure is depicted below:
3941

4042
MPI ABI OMPI ABI
4143
+----------------------+----------------------+
42-
| libmpi\_abi.la | libmpi.la |
44+
| libmpi_abi.la | libmpi.la |
4345
+----------------------+----------------------+
44-
| libopen\_mpi.la |
46+
| libopen_mpi.la |
4547
+----------------------+----------------------+
4648

4749
Note the ability to change the name of the OMPI ABI library (libmpi.la)
4850
is still supported, so in the code base Makefiles this library actually
49-
appears as lib@OMPI\_LIBMPI\_NAME@.la).
51+
appears as lib@OMPI_LIBMPI_NAME@.la).
5052

5153
Since the Fortran ABI is not currently supported, the Fortran libraries
5254
are only linked against libmpi.so.0.
@@ -56,9 +58,9 @@ are only linked against libmpi.so.0.
5658
The MPI and OMPI libraries are installed in the same <install-path>/lib
5759
folder. They have different file names so this presents no problems.
5860
The OMPI ABI include files are installed in <install-path>/include as usual.
59-
The MPI ABI include file is installed in <install-path>/include/standard\_abi.
60-
The mpicc\_abi compiler wrapper points the c compiler to the correct mpi.h and
61-
links the the executable/shared library against libmpi\_abi.
61+
The MPI ABI include file is installed in <install-path>/include/standard_abi.
62+
The mpicc_abi compiler wrapper points the c compiler to the correct mpi.h and
63+
links the executable/shared library against libmpi_abi.
6264

6365
## Generating the ABI compliant mpi.h
6466

@@ -77,21 +79,23 @@ components:
7779
2. two json files: mpi-standard-apis.json and mpi-standard-abi.json.
7880
The former is generated as part of the build process for the MPI standard.
7981
The later is generated via a tool (not yet incorporated in the upstream
80-
mpi-standard code base). The tool converts the values embedded in the
82+
MPI standard code base). The tool converts the values embedded in the
8183
appendix A latex file into a json file specifying the values for MPI
82-
constants, e.g. value of MPI\_COMM\_WORLD. These json files reside in
84+
constants, e.g. value of MPI_COMM_WORLD. These json files reside in
8385
the top level docs folder. Note the first json file is also used to
8486
generate makefile content.
8587

86-
3. A tool - c\_header.py was written to parse the two json files
88+
3. A tool - c_header.py was written to parse the two json files
8789
described above and generate the MPI ABI compliant mpi.h and a name mangled
8890
version - abi.h. Eventually this tool will be incorporated into the
8991
binding infrastructure. More on the binding infrastructure below.
9092
The tool uses methods from pympistandard.
9193

92-
4. The c\_header.py tool uses a template file - abi.h.in located in
94+
4. The c_header.py tool uses a template file - abi.h.in located in
9395
the ompi/mpi/c folder to generate the MPI ABI mpi.h and the name
94-
mangled version - abi.h. The tool uses methods from pympistandard.
96+
mangled version - abi.h. The template is just used to structure how the
97+
various blocks of the resulting mpi.h are placed, not the actual content.
98+
The tool uses methods from pympistandard.
9599

96100
## Generating the MPI ABI compliant c bindings
97101

@@ -103,7 +107,7 @@ This infrastructure uses templates (*.c.in) files to generate up to four
103107
variants: OMPI ABI int count, OMPI ABI big count, MPI ABI int count,
104108
MPI ABI big count. There are a small set of functions which have
105109
only int count or big count. The templates for these files have
106-
suffixes of (*.c.in\_obc for big count only and *.c.in\_nbc for int
110+
suffixes of (*.c.in_obc for big count only and *.c.in_nbc for int
107111
count only).
108112

109113
Note a number of procedures (e.g. all the _f2c/_c2f) are not present in
@@ -120,9 +124,9 @@ generated include both the OMPI ABI mpi.h and the name
120124
mangled MPI ABI abi.h include files. Thus the generated source files
121125
have two definitions of MPI predefined constants. As an example
122126
in a MPI ABI source file there are two world communicator values defined:
123-
MPI\_COMM\_WORLD, and MPI\_COMM\_WORLD\_ABI\_INTERNAL. The former
127+
MPI_COMM_WORLD, and MPI_COMM_WORLD_ABI_INTERNAL. The former
124128
is the OMPI ABI defintion of the world communicator(address of a
125-
global variable) , the later the MPI ABI value for this constant (an integer).
129+
global variable) , the later being the MPI ABI value for this constant (an integer).
126130

127131
The bindings framework parses the input argument types to the function
128132
and generates calls to appropriate converter methods to convert any MPI ABI
@@ -132,8 +136,8 @@ are converted from the OMPI ABI values back to MPI ABI ones.
132136
This includes fields in MPI_Status objects which require conversion
133137
(in particular error values) and error return values from the wrapped code.
134138

135-
The bindings framework also generates two helper files - abi\_converter.h
136-
and abi\_converter.c in addition to the generatedd OMPI and MPI ABI
139+
The bindings framework also generates two helper files - abi_converter.h
140+
and abi_converter.c in addition to the generatedd OMPI and MPI ABI
137141
source files.
138142

139143
There are several implications of this approach.
@@ -142,7 +146,7 @@ First very few changes have to made to the internal Open MPI source code.
142146

143147
A second is that top level MPI ABI c entry points are expecting
144148
argument values using MPI ABI constants. Thus calling top
145-
level MPI functions from within libompi\_mpi will not work
149+
level MPI functions from within libompi_mpi will not work
146150
properly.
147151

148152
A third is there are a few places in non-blocking/persistent
@@ -171,12 +175,12 @@ ops functions to allow for invocation of a translation routine to
171175
convert the datatype argument from the OMPI ABI to MPI ABI values
172176
as appropriate. A similar approach is taken for errhandlers.
173177

174-
Generalized requests don't need speial support as the MPI Status
178+
Generalized requests don't need special support as the MPI Status
175179
structure for both MPI and OMPI ABIs are similar enough as to not
176180
require conversion.
177181

178182
OMPI doesn't really support datarep functions so currently there
179-
is no need for any argument conversion operations.
183+
is no need for any argument conversion operations for these functions.
180184

181185
The MPI_T event implementation is just a set of stubs so there's
182186
no need for special support for MPI_T_event callback functions.

0 commit comments

Comments
 (0)