MPI_T_event_copy(3)
π MPI_T_event_copy(3) π
okay bestie, welcome to section 3 of the MPI manual β yes, that MPI, the Message Passing Interface, the β¨iconicβ¨ one. this page is about MPI_T_event_copy, and no cap, it's a whole mood: it just copies event data, as a whole, into a buffer you made yourself. π«Ά
π NAME π
MPI_T_event_copy β copy event data as a whole into a user-specified buffer
like. the whole thing. into your buffer. that's the assignment, and it ate. π
β¨ SYNOPSIS β¨
int MPI_T_event_copy(MPI_T_event_instance event_instance, void *buffer)
look at her. one function, two args, zero drama. πΈ
πΈ INPUT PARAMETERS πΈ
event_instanceβ the event instance that got handed to your callback function (it's a handle, bestie). it's giving "you already have this, you just have to use it." π
π¦ OUTPUT PARAMETERS π¦
bufferβ a user-allocated buffer for the event data. that's a choice type, so you're the one choosing where all that data goes. allocate it yourself, no one's doing it for you, main character energy only. π
π₯ THREAD AND INTERRUPT SAFETY π₯
This routine is thread-safe. slay!! that means multiple threads can use it at the same time and you do not have to bring your own thread locks. no lock, no stress, we love to see it. β¨
but β and this is the part where we lower our voices β the routine is not interrupt safe. π typically that's because it uses memory allocation routines like malloc or other non-MPICH runtime routines, and those are themselves not interrupt-safe. so yeah. thread-safe: yes. interrupt-safe: absolutely not. periodt.
π ERRORS π
okay so this is the standard MPI error lore, and it applies to basically everything, so let's get into it:
all MPI routines (MPI_Wtime and MPI_Wtick are the exceptions, they're built different) return an error value. C routines return it as the value of the function, Fortran routines put it in the last argument.
before that value comes back to you, the current MPI error handler gets called. by default, that error handler aborts the MPI job β like, the whole thing, gone, no warning. π if you'd rather not live that life, you can change it:
MPI_Comm_set_errhandlerfor communicatorsMPI_File_set_errhandlerfor filesMPI_Win_set_errhandlerfor RMA windows
the MPI-1 routine MPI_Errhandler_set may be used but its use is deprecated (ngl, don't). and if you want error values handed back to you instead of the whole job getting cancelled, use the predefined error handler MPI_ERRORS_RETURN.
heads up bestie: MPI does not guarantee that an MPI program can continue past an error. however, MPI implementations will attempt to continue whenever possible. so... maybe it continues, maybe it doesn't. the vibes are π².
and here's the actual error list, every single one, no skips:
MPI_SUCCESSβ no error; the MPI routine did the thing. we love her. πMPI_T_ERR_INVALIDβ invalid use of the interface, or bad parameter value(s). you did something funky with the args, bestie. πMPI_T_ERR_INVALID_HANDLEβ the handle is invalid. that handle is not passing the vibe check. πMPI_T_ERR_NOT_INITIALIZEDβ the MPI tool information interface isn't initialized. you gotta turn it on before you use it, iykyk. πMPI_ERR_OTHERβ other error; useMPI_Error_stringto get more info about this error code. it's the catch-all bucket, andMPI_Error_stringis your bestie for the details. π
β little reminder: keep yourevent_instancearound from the callback, allocate your ownbuffer, and remember that thread-safe β interrupt-safe. that's the whole page, you got this. π
written for the MPI manual, section 3, dated 4/10/2026 β mwah, go forth and copy those events, bestie ππ β¨
π¦ 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