Skip to content

Improve ABI for identifying an MPI implementation #159

Open
@simonbyrne

Description

@simonbyrne

Problem

I realise the specification of an MPI ABI is a very complicated endeavour, but as a very small step in this direction, I would like to propose that there be an ABI for identifying a particular MPI implementation.

This is important when using MPI with other languages: I am one of the maintainers of the Julia language MPI bindings, and one of the biggest difficulties is identifying which implementation of MPI is being used. At the moment, we compile a small C program to identify the MPI implementation and the necessary constants, but this has many drawbacks in terms of usability (namely that it requires a C compiler, and makes it difficult to switch between versions).

MPI_Get_library_version can currently be used to identify an implementation, but it is not well specified as a C ABI as it is not possible to determine the following without parsing a header file:

  1. the size of the buffer to allocate (i.e. the value of MPI_MAX_LIBRARY_VERSION_STRING from the header file)
  2. if a non-default calling convention is used (e.g. Microsoft MPI uses stdcall)

Proposal

Point 1 could easily be addressed by adding in the specification the maximum value of MPI_MAX_LIBRARY_VERSION_STRING: the largest value I have seen is 8192 used by mpich.

Point 2 is more difficult to standardize, since it is much more platform specific. However it only affects one implementation on one platform, and on that platform it appears to be the dominant implementation, so this is less of an issue. If anyone does have a suggestion for solving this, I would be grateful.

Changes to the Text

MPI_MAX_LIBRARY_VERSION_STRING must be a value less than or equal to 8192.

Impact on Implementation

As far as I know, this should not affect any implementations. If it does, the value can be chosen to be larger.

Impact on Users

This will make it easier to develop MPI bindings in languages other than C or Fortran, which in turn should improve user experience.

References

There is some discussion of this problem in JuliaParallel/MPI.jl#169.

Metadata

Metadata

Assignees

Labels

mpi-6For inclusion in the MPI 5.1 or 6.0 standardwg-abiABI Working Group

Type

No type

Projects

Status

To Do

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions