- All fortran interop C API are included in MPI C ABI, e.g.
MPI_INTEGER
,MPI_Comm_f2c
,MPI_F_STATUS_IGNORE
- Jeff intended an MPI ABI implementation that does not depend on Fortran
- Thus the ABI standard need fix all relevant Fortran ABIs
- The key requirement: Fortran
INTEGER
is equivalent to Cint
, but also need fix all Fortran datatypes with C equivalents. - MPI C ABI need implement
MPI_Comm_f2c
etc. with a dictionary mechanism - MPI C ABI does not do any Fortran compiler checks, only via assumptions
- MPI should not specifiy
INTEGER
is Cint
if Fortran doesn't say so - MPI Fortran binding should implement proper MPI Fortran inter-op, via compiler feature checks and value conversions if necessary.
- A C-only MPI Fortran inter-op is useless. For example, to inter-op with Fortran
INTEGER
, just useMPI_Int
.
- Do not change any MPI API
- MPI C ABI does not contain any Fortran parts
mpi_abi.h
only contains non-fortran APIsmpi.h
includesmpi_abi.h
+mpi_fort.h
libmpi_abi.so
does not contain any Fortran related symbolslibmpifort.so
contains or Fortran related symbols include Fortran interface and inter-op C APIs
- Fortran related API is provided in header via an opt-in option and in linker via
libmpifort.so
case 1: t.c
is a C-only MPI code
$ mpicc -mpi-abi -o t t.c
# t will link with `libmpi_abi.so`
case 2: t.c
is a C code that uses MPI_INTEGER
(or MPI_Comm_f2c
)
$ mpicc -mpi-abi -o t t.c
ERROR: name undefined
$ mpicc -mpi-abi -fort -o t t.c
# SUCCESS. t will link with `libmpifort.so libmpi_abi.so`
case 3: t.f
is a FORTRAN code
$ mpifort -mpi-abi -o t t.f
# SUCCESS. t will link with `libmpifort.so libmpi_abi.so`