Trace Objects

Introduction

Use the Trace module to selectively produce trace output on a global and/or per-object basis for your application. You can specify the types of trace output when an application is linked, or dynamically (by using a debugger).

Note: You can also define your own trace function, using mpiPlatformTraceFunction(...) For example, you could define your own function to send traces to a circular memory buffer.

The format of the trace output is determined by printf(...)-like trace macros located in MPI library source. The trace macros are of the form mpiTrace#(mask, format, arg ...), where format and the args determine the trace output, and where # indicates the total number of arguments following the format argument (because macros cannot take variable numbers of arguments).

The placement and content of the mpiTrace(...) macros in the MPI library source is the responsibility of whomever maintains the library. Because trace can be added as desired, it is often useful to leave trace statements in the library source code rather than remove them, as is similarly done with debug printf(...) statements. It is also useful to define per-object trace output types so that the volume of trace output is set to a manageable level.

The Trace module interface is declared in the \include\trace.h header file. In order for your application to use Trace functions, you must build your application with the MPI_TRACE conditional-compile symbol defined.

By default, trace output is sent to standard error. However, to send trace output to a file, your application can call the mpiTraceFile(char *fileName) function.

To obtain the current global trace mask, call mpiTraceGet.
To modify the global trace mask, call mpiTraceSet.

See Also:
Trace Masks
Global Trace Outputs
Per-Object Trace Outputs

Methods

Configuration and Information Methods
   
mpiTraceEol Set the end-of-line character to be used by Trace
mpiTraceFile Send trace output to a file
mpiTraceFunction sets function used to display a trace buffer
mpiTraceGet Get global trace mask
mpiTraceMaskBits Convert the trace mask into an array of trace bits.
mpiTraceMsg Convert the message identification value into a string.
mpiTraceMsgFunction Set a module's trace message function.
mpiTraceSet Set global trace mask

Data Types

MPITrace
MPITraceFunction
MPITraceMsgFunction
MPITraceMask

Constants

MPITraceMaskGLOBAL