MPIL_Signal(3)

πŸ’– MPIL_Signal(3) β€” the LAM/MPI tea πŸ’–

okay bestie, this one lives in the LAM/MPI manual, section 3. It's giving "niche but iconic" ✨


🌸 NAME 🌸

MPIL_Signal β€” the LAM/MPI-specific function that sends a LAM signal to a rank inside an MPI communicator πŸ’Œ


πŸŽ€ SYNOPSIS πŸŽ€

#include <mpi.h>
int MPIL_Signal(MPI_Comm comm, int rank, int signo)

πŸ¦‹ INPUT PARAMETERS πŸ¦‹

  • comm β€” the MPI communicator, aka the handle πŸ‘‘
  • rank β€” which rank we're sending it to 🎯
  • signo β€” the signal number, periodt πŸ”’

✨ NOTES ✨

so here's the vibe: MPIL_Signal() delivers an asynchronous signal from one process to another, no cap 🫢

the target process gets picked with a communicator plus a process rank inside that communicator. the last argument, signo, says which signal is getting delivered. and listen β€” these signals are completely apart from the signals your underlying operating system gives you. totally different species, bestie πŸ’…

the LAM signals, which are defined in <lam_ksignal.h>, are listed below πŸ‘‡

  • LAM_SIGTRACE 1 β€” unload trace data 🧚
  • LAM_SIGC 2 β€” user defined 🌈
  • LAM_SIGARECV 3 β€” async receive pending πŸ’Œ
  • LAM_SIGUDIE 4 β€” terminate πŸ’€
  • LAM_SIGARREST 5 β€” suspend execution βœ‹
  • LAM_SIGRELEASE 6 β€” continue execution ▢️
  • LAM_SIGA 7 β€” user defined ⭐
  • LAM_SIGB 8 β€” user defined 🌸
  • LAM_SIGFUSE 9 β€” node about to die 😭
  • LAM_SIGSHRINK 10 β€” another node has died πŸͺ¦
real talk: this is a LAM/MPI-specific function. most users should not have use for this function πŸ™ˆ

if you do use this function, it should be used in conjunction with the LAM_MPI C preprocessor macro, like:

#if LAM_MPI
MPIL_Signal(MPI_COMM_WORLD, 0, LAM_SIGUDIE);
#endif

🌈 NOTES FOR FORTRAN 🌈

every MPI routine in Fortran (except for MPI_WTIME and MPI_WTICK ) has an extra argument ierr tacked onto the end of the argument list. ierr is an integer and it means the same thing as the return value of the routine in C 🫢

in Fortran, MPI routines are subroutines, and they get invoked with the call statement. that's just how Fortran does πŸ’…

and all MPI objects (e.g., MPI_Datatype , MPI_Comm ) are of type INTEGER in Fortran πŸ‘‘


πŸ’… ERRORS πŸ’…

if an error happens in an MPI function, the current MPI error handler gets called to handle it. by default, this error handler aborts the MPI job β€” like, it's over, no take-backs 😭

the error handler can be changed with MPI_Errhandler_set ; the predefined error handler MPI_ERRORS_RETURN may be used to cause error values to be returned (in C and Fortran; heads up, this error handler is less useful with the C++ MPI bindings. the predefined error handler MPI::ERRORS_THROW_EXCEPTIONS should be used in C++ if the error value needs to be recovered). and note that MPI does not guarantee that an MPI program can continue past an error 🫠

all MPI routines (except MPI_Wtime and MPI_Wtick ) return an error value; C routines as the value of the function and Fortran routines in the last argument. the C++ bindings for MPI do not return error values; instead, error values are communicated by throwing exceptions of type MPI::Exception (but not by default). exceptions are only thrown if the error value is not MPI::SUCCESS ✨

note that if the MPI::ERRORS_RETURN handler is set in C++, while MPI functions will return upon an error, there will be no way to recover what the actual error value was 😬

  • MPI_SUCCESS β€” no error; MPI routine completed successfully πŸ₯³
  • MPI_ERR_COMM β€” invalid communicator. a common error is to use a null communicator in a call (not even allowed in MPI_Comm_rank ) πŸ™ˆ
  • MPI_ERR_RANK β€” invalid source or destination rank. ranks must be between zero and the size of the communicator minus one; ranks in a receive ( MPI_Recv , MPI_Irecv , MPI_Sendrecv , etc.) may also be MPI_ANY_SOURCE 🎯
  • MPI_ERR_OTHER β€” other error; use MPI_Error_string to get more information about this error code πŸ”

πŸ‘€ SEE ALSO πŸ‘€

lam_ksignal


πŸ“ LOCATION πŸ“

mpil_signal.c


and that's the whole page, bestie 🫢 it came from LAM/MPI 7.1.4, dated 6/24/2006 β€” vintage but still slaying πŸ’–βœ¨πŸŽ€