MPIL_Trace_off(3)

πŸ’– MPIL_Trace_off(3) πŸ’–

ok so bestie, welcome to the LAM/MPI corner of the manual pages β€” this one's a section 3 situation and it's giving "niche but iconic", iykyk πŸŽ€


✨ NAME ✨

MPIL_Trace_off β€” the LAM/MPI-specific function that turns run-time tracing OFF πŸ”‡


🌸 SYNOPSIS 🌸

#include <mpi.h>
int MPIL_Trace_off(void)

like. that's it. that's the whole call. no args, no drama πŸ’…


πŸ¦‹ NOTES πŸ¦‹

ok so the whole point of these functions: they let your application be picky about when it generates traces. Only during the interesting phases? Yes queen. πŸ‘‘

This technique can considerably reduce the size of the trace files and the burden of displaying them. Less mess, less stress, periodt.

Both functions are collective over the MPI_COMM_WORLD communicator. In typical usage, the -toff option of mpirun(1) would be used to enable tracing, but start with the runtime switch in the off position. Then:

  1. At the beginning of an interesting phase of program execution, MPIL_Trace_on gets called. ✨
  2. MPIL_Trace_off gets called after the interesting phase is over. πŸŒ™

Tracing can be turned on and off many times. Each period of tracing eventually forms a trace segment in the trace file extracted by lamtrace(1). And if you never use the on/off functions at all, and tracing is enabled with the -ton option of mpirun(1), you get a single trace segment. One and done. πŸ€·β™€οΈ

Real talk though: the on/off functions have no effect if tracing isn't enabled by mpirun(1) with either the -ton or -toff switches. So an application can be absolutely littered with these functions and still run without trace collection β€” with very little additional overhead, because those function calls are just no-ops. Free real estate. 🏠

This is a LAM/MPI-specific function and it's intended mainly for debugging. If you're gonna use it, use it in conjunction with the LAM_MPI C preprocessor macro, like:

#if LAM_MPI
MPIL_Trace_off();
#endif

😭 LIMITATIONS 😭

After the volume of generated traces exceeds a preset limit, the oldest traces are discarded in favour of new traces. πŸ’€

So yeah β€” avoiding discarded traces is further incentive to use MPIL_Trace_on and MPIL_Trace_off. Don't let your precious early traces get ghosted. πŸ‘»


🧚 NOTES FOR FORTRAN 🧚

All MPI routines in Fortran (except for MPI_WTIME and MPI_WTICK) have an additional argument ierr at the end of the argument list. ierr is an integer and has the same meaning as the return value of the routine in C. In Fortran, MPI routines are subroutines, and they're invoked with the call statement.

All MPI objects (e.g., MPI_Datatype, MPI_Comm) are of type INTEGER in Fortran. πŸ’œ


🚨 ERRORS 🚨

If an error occurs in an MPI function, the current MPI error handler is called to handle it. By default, this error handler aborts the MPI job. Not a vibe. The error handler may 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; 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). 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. That's the catch. 😬

Here's the error lineup:

  • MPI_SUCCESS β€” No error; MPI routine completed successfully. slay ✨
  • MPI_ERR_OTHER β€” Other error; use MPI_Error_string to get more information about this error code.

πŸ‘€ SEE ALSO πŸ‘€

  • MPI_Trace_on
  • mpirun

πŸ“ LOCATION πŸ“

mpil_trace.c


ok bestie that's the whole page, you're officially certified in toggling traces off πŸ’…

this was LAM/MPI 7.1.4, dated 6/24/2006 β€” yeah she's an elder but she still ate, and we love her for it. bye babes 🫢✨