MPI_Status_set_tag(3)
π MPI_Status_set_tag(3) β the MPI manual, bestie edition π
okay so this is a page from the MPI manual set, and today's main character is MPI_Status_set_tag. she's a lil one. she does one thing and she does it slayfully.
β¨ NAME β¨
MPI_Status_set_tag β set the MPI_TAG field in the status π
like. that's the whole job. she sets the tag. iconic behavior honestly.
πΈ SYNOPSIS πΈ
int MPI_Status_set_tag(MPI_Status *status, int tag)
π INPUT PARAMETERS π
tagβ the tag you wanna set into theMPI_TAGfield, bestie. it's an integer. π·οΈ
π¦ INPUT/OUTPUT PARAMETERS π¦
statusβ the status you're associating the source rank with. it's aStatus. she goes in, she comes out changed. glow-up energy fr. β¨
π₯ THREAD AND INTERRUPT SAFETY π₯
so this one is thread-safe, no cap. that means multiple threads can use this routine at the same time and you don't have to bring your own thread locks β none of that user-provided lock nonsense, she handles herself. π
however β and this is the part where i need you to lock in β 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. so like, the vibe is safe, but the interrupt is not. noted.
π«Ά NOTES FOR FORTRAN π«Ά
every MPI routine in Fortran (except for MPI_WTIME and MPI_WTICK, the two little exceptions, the rebels) has an additional argument at the very end of the argument list called ierr. π
ierr is an integer, and it means the exact same thing as the return value of the routine in C. no translation needed, same energy, different language.
also, in Fortran, MPI routines are subroutines, and you invoke them with the call statement. that's just how Fortran does it. respect the process. π
and all MPI objects β like MPI_Datatype, MPI_Comm β are of type INTEGER in Fortran. all of them. yes, even the fancy ones. π
π ERRORS π
so every MPI routine (except MPI_Wtime and MPI_Wtick, again with the exceptions, they're built different) returns an error value. in C it's the value of the function; in Fortran it's in that last argument. π«‘
before that value comes back to you, the current MPI error handler gets called. by default, this error handler aborts the MPI job. like, full stop, the whole job, gone, bye. π
you can change the error handler:
MPI_Comm_set_errhandlerβ for communicatorsMPI_File_set_errhandlerβ for filesMPI_Win_set_errhandlerβ for RMA windows
the MPI-1 routine MPI_Errhandler_set may be used too, but its use is deprecated β so like, she's still there but she's giving vintage and not in the cute way. π
the predefined error handler MPI_ERRORS_RETURN may be used to cause error values to be returned instead.
big caveat, bestie: note that MPI does not guarantee that an MPI program can continue past an error. however, MPI implementations will attempt to continue whenever possible. so like. fingers crossed. π€
and here are the error codes you might meet:
MPI_SUCCESSβ no error; the MPI routine completed successfully. π she ate.MPI_ERR_OTHERβ other error; useMPI_Error_stringto get more information about this error code. π
β that's the whole page β
she's short, she's sweet, she sets one tag and dips. obsessed, honestly. no notes. π
sign-off time: this page came from the MPI manual set, and the version/date stamped on it is 4/10/2026, under the title MPI_Status_set_tag(3). consider yourself tagged. π·οΈβ¨π¦
π¦ 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