MPI_Status_get_tag(3)
โจ MPI_Status_get_tag(3) โจ
okay bestie, you're in the MPI part of the man pages, and today's main character is MPI_Status_get_tag. ๐
๐ธ NAME ๐ธ
MPI_Status_get_tag โ get the MPI_TAG field out of the status ๐
๐ซถ SYNOPSIS ๐ซถ
int MPI_Status_get_tag(const MPI_Status *status, int *tag)
๐ INPUT PARAMETERS ๐
statusโ the status you're pulling from, aka the one whose source rank we're retrieving (Status) ๐
โญ OUTPUT PARAMETERS โญ
tagโ the tag that's sitting in theMPI_TAGfield (integer) โจ
๐งต THREAD AND INTERRUPT SAFETY ๐งต
This routine is thread-safe, no cap. Which means multiple threads can run it at the same time and you do not need to bring your own thread locks โ she handles herself ๐
But โ and this is the part where we all gasp โ she is not interrupt safe. ๐ Typically that's because of memory allocation routines like malloc, or other non-MPICH runtime routines that are themselves not interrupt-safe. Not her fault, she's just built different (derogatory). ๐ญ
๐ฎ NOTES FOR FORTRAN ๐ฎ
Every single MPI routine in Fortran โ except for MPI_WTIME and MPI_WTICK , those two are the rebels โ gets an extra argument called ierr tacked onto the very end of the argument list. ierr is an integer and it means the exact same thing as the return value of the routine in C. ๐ง
Also, in Fortran, MPI routines are subroutines, and you invoke them with the call statement. Periodt.
And all MPI objects (e.g., MPI_Datatype , MPI_Comm ) are of type INTEGER in Fortran. That's just the vibe over there. ๐
๐ ERRORS ๐
Every MPI routine (again โ except MPI_Wtime and MPI_Wtick , the two exceptions that live rent free) returns an error value: C routines as the value of the function, and Fortran routines in that last argument we just talked about. Before the value comes back to you, the current MPI error handler gets called. ๐ณ
By default, that error handler aborts the MPI job. Like, whole thing, gone. So maybe pay attention here.
You can swap the error handler with:
MPI_Comm_set_errhandler(for communicators)MPI_File_set_errhandler(for files)MPI_Win_set_errhandler(for RMA windows)
There's also the MPI-1 routine MPI_Errhandler_set , which you may use, but its use is deprecated โ so like, technically allowed but we're all side-eyeing it. ๐
The predefined error handler MPI_ERRORS_RETURN may be used to make error values actually get returned to you instead.
Heads up: MPI does not guarantee that an MPI program can continue past an error. That said, MPI implementations will attempt to continue whenever possible. So it's giving "we'll try" energy, not "we promise" energy. ๐ซถ
Here's the error code list:
MPI_SUCCESSโ no error at all, the MPI routine completed successfully. Slay. โจMPI_ERR_OTHERโ other error; hit upMPI_Error_stringto get more info about this error code. ๐
aaaand that's the whole page, bestie!! this one was served up by MPI and it's dated 4/10/2026 โ go forth and read your status tags responsibly ๐โจ๐๐ฆ no cap.
๐ฆ where this page comes from
- nixos 26.05: mpich 5.0.1
- ubuntu stonking: mpich-doc 5.0.1-9 ยท other
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms