Trace Objects


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 meiPlatformTraceFunction(...) 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 meiTrace#(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 meiTrace(...) 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 XMP\include\trace.h header file. In order for your application to use Trace functions, you must build your application with the MEI_TRACE conditional-compile symbol defined.

To install trace, simply install the DLL for either the Debug or DebugSingle configuration. The Debug and DebugSingle configurations of the MPI library are built with the MEI_TRACE compile-time symbol defined.

Note: Debug and DebugSingle are the only MPI library configurations that will produce trace output.

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

To obtain the current global trace mask, call meiTraceGet(...).
To modify the global trace mask, call meiTraceSet(...).

To obtain an object's trace mask, call meiObjectTraceGet(...) (defined in stdmei.h).
To modify an object's trace mask, call meiObjectTraceSet(...).


Configuration and Information Methods
  meiTraceEol Set the end-of-line character to be used by Trace
  meiTraceFile Send trace output to a file
  meiTraceFunction sets function used to display a trace buffer
  meiTraceGet Get global trace mask
  meiTraceSet Set global trace mask

Data Types