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 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 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 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.

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

Methods

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
  meiTraceMaskBits Convert the trace mask into an array of trace bits.
  meiTraceMsg Convert the message identification value into a string.
  meiTraceMsgFunction Set a module's trace message function.
  meiTraceSet Set global trace mask

 

Data Types

  MEITrace  
  MEITraceFunction  
  MEITraceMask  

 

Constants

  MEITraceMaskGLOBAL