MPIL_Request_set_name(3)

πŸ’– MPIL_Request_set_name β€” a LAM/MPI moment πŸ’–

okay bestie, so this one lives in the LAM/MPI manual, section 3, and it's genuinely such a specific little guy. it's the LAM/MPI-specific function that sets a string name on an MPI_Request. that's it. that's the whole job. and honestly? iconic for it.


✨ NAME ✨

MPIL_Request_set_name β€” a LAM/MPI-specific function that puts a string name on an MPI_Request, no cap πŸŽ€


🌸 SYNOPSIS 🌸

#include <mpi.h>
int
MPIL_Request_set_name(MPI_Request req, char *name)

πŸ¦‹ INPUT PARAMETERS πŸ¦‹

  • req β€” an MPI_Request (it's a handle, bestie, you know how these things go πŸ’…)
  • name β€” the Name. the actual name. the string. that one.

πŸ’œ NOTES πŸ’œ

okay so listen, the name has to be a null-terminated string. non-negotiable. and it gets copied into internal storage during this call β€” so it's giving "we made a lil photocopy and kept it", not "we're holding onto your pointer forever". she takes a copy and moves on. periodt ✨


πŸ”₯ ERRORS πŸ”₯

so here's the thing β€” if an error pops off inside an MPI function, the current MPI error handler gets called to deal with it. and by default? that error handler aborts the MPI job. like, full send, everyone's done. 😭

good news: you can change the error handler with MPI_Errhandler_set. and there's a predefined one, MPI_ERRORS_RETURN, which you can use to make error values get returned instead β€” and yes that works in C and Fortran. but girlie, in the C++ MPI bindings it's less useful. if you're in C++ and you actually need to recover the error value, you want the predefined error handler MPI::ERRORS_THROW_EXCEPTIONS. πŸ‘‘

🚨 also: MPI does not guarantee that an MPI program can keep going past an error. so don't get cute with it.

all MPI routines (with the exception of MPI_Wtime and MPI_Wtick) return an error value β€” C routines give it back as the value of the function, and Fortran routines put it in the last argument. the C++ bindings for MPI do not return error values at all; instead error values get communicated by throwing exceptions of type MPI::Exception (but not by default, so don't just assume). exceptions are only thrown if the error value is not MPI::SUCCESS.

🫢 heads up: if the MPI::ERRORS_RETURN handler is set in C++, MPI functions will return when an error happens, but there is literally no way to recover what the actual error value was. so like... tradeoffs, bestie.
  • MPI_SUCCESS β€” no error, the MPI routine did its lil thing and completed successfully. slay 🌈
  • MPI_ERR_ARG β€” invalid argument. some argument is invalid and it's not identified by a specific error class. this is typically a NULL pointer or other such error. πŸ™ˆ

πŸ‘‘ SEE ALSO πŸ‘‘

MPIL_Request_get_name β€” the other half of this duo, go read her too πŸ’–


πŸŽ€ LOCATION πŸŽ€

mpil_rsetname.c β€” that's where she lives. go say hi.


and that's the whole vibe check, bestie! this page is brought to you by LAM/MPI 7.1.4, dated 6/24/2006 β€” vintage, lowkey a relic, and still out here naming requests. mwah πŸ’…πŸ’–βœ¨