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-style INTEGER MPI 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 if f_status is the Fortran value of MPI_STATUS_IGNORE or MPI_STATUSES_IGNORE, or if f_status is 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_f082c
  • MPI_Status_f2f08

go read those too, they're part of the same friend group πŸ¦‹


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