Skip to content

API to access and update MPI_Status public fields #645

Closed
@jeffhammond

Description

@jeffhammond

Problem

MPI_Status is the only non-opaque handle and users are expected to access and update the three public fields directly.

This is not good for users of languages that are not C/C++ or Fortran. Currently, users are working around this by writing their own get/set functions (e.g. mpi4py's pympistatus.h) or linking libclang to parse header files and generate these functions (e.g. rsmpi).

Proposal

Add MPI_Status_{get,set}_{source,tag,error} functions that allow non-first-party languages to support the field access.

I don't know if the set routines make sense, but we have them for elements and cancelled, which are the "hidden" status fields.

Changes to the Text

Add the following in LIS way and define them in the obvious way.

int MPI_Status_get_source(MPI_Status * status, int * source);
int MPI_Status_set_source(MPI_Status * status, int source);
int MPI_Status_get_tag(MPI_Status * status, int * tag);
int MPI_Status_set_tag(MPI_Status * status, int tag);
int MPI_Status_get_error(MPI_Status * status, int * error);
int MPI_Status_set_error(MPI_Status * status, int error);

Impact on Implementations

These are trivial to implement.

Impact on Users

Users of C/C++ and Fortran are not required to use these.

Implementers of MPI support for Python, Julia, Rust, etc. will find it easier to use MPI.

References and Pull Requests

Metadata

Metadata

Assignees

Labels

chap-p2pPoint to Point Communication Chapter Committeehad readingCompleted the formal proposal readingmpi-4.1For inclusion in the MPI 4.1 standardpassed final votePassed the final formal votepassed first votePassed the first formal votewg-languagesLanguages Working Group

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions