MPI_STATUS_F2C(3)
π NAME π
MPI_Status_f2c, MPI_Status_c2f β bestie, these two literally translate a C status into a Fortran INTEGER-style status, or the other way around. Both directions, one iconic little duo. π¦
(oh and hi, this page lives in the Open MPI manual, mwah π )
β¨ SYNTAX β¨
C Syntax
#include <mpi.h>
int MPI_Status_f2c(const MPI_Fint *f_status, MPI_Status *c_status)
int MPI_Status_c2f(const MPI_Status *c_status, MPI_Fint *f_status)
that's it, that's the whole vibe up there, no cap π
π PARAMETERS π
f_statusβ an mpi-styleINTEGERMPI status object. it's giving "Fortran energy" fr fr.c_statusβ a C-style MPI status object. structured, sleek, very main character.
πΈ DESCRIPTION πΈ
okay so. these two procedures are provided in C so you can convert from a Fortran status (which is, respectfully, just an array of integers) to a C status (which is, glamorously, a structure) β and vice versa, obviously, they understood the assignment. β¨
and the way that the conversion occurs on all the information in status, including that which is hidden?? that's the slay part. no status information is lost in the conversion. periodt. π
Now the specifics, because details matter and we're not messy here:
When using MPI_Status_f2c, if f_status is a valid Fortran status, but not the Fortran value of MPI_STATUS_IGNORE or MPI_STATUSES_IGNORE, then MPI_Status_f2c returns in c_status a valid C status with the same content. iconic. π«Ά
But iff_statusis the Fortran value ofMPI_STATUS_IGNOREorMPI_STATUSES_IGNORE, or iff_statusis not a valid Fortran status, then the call is erroneous. π not a warning, not a suggestion β erroneous. do not pass go.
When using MPI_Status_c2f, the opposite conversion is applied. so flip it and reverse it π. If c_status is MPI_STATUS_IGNORE or MPI_STATUSES_IGNORE, or if c_status is not a valid C status, then the call is erroneous. same energy, other direction. π
Also, little latte note: the input status has the same source, tag and error code values as the output status, and returns the same answers when queried for count, elements, and cancellation. π§
And here's the spicy bit β the conversion function may be called with an input status argument that has an undefined error field, in which case the value of the error field in the output status argument is undefined. so like, undefined in, undefined out, we don't make promises we can't keep bestie π
π NOTES π
These functions are only available in C. they are not available in any of the Fortran MPI interfaces. sorry Fortran girlies, this one's not for you (for this specific thing, anyway). π
See also:
MPI_Status_f082cMPI_Status_f2f08
go read those too, they're part of the same friend group π¦
π Copyright π
2003-2026, The Open MPI Community
okay and that's the whole page!! π big cute sign-off time: this was the Open MPI manual, and the page was stamped Sep 10, 2026. love you, go forth and convert your statuses responsibly, bestie. mwah πβ¨π
π¦ where this page comes from
- ubuntu stonking: openmpi-doc 5.0.10-6 Β· other
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms