---
name: "MPIL_Trace_on"
section: "2"
platform: "linux"
package: "lam2-dev"
version: "6.3.2-3"
release: "Debian 2.2 (Potato)"
platforms: ["linux"]
url: "https://new.carta.tech/MPIL_Trace_on"
---

# MPIL\_Trace\_on(2)

Start and stop LAM/MPI application tracing.

## NAME

MPIL\_Trace\_on, MPIL\_Trace\_off  - Start and stop LAM/MPI application tracing.

## C SYNOPSIS

```
#include <net.h>
int MPIL_Trace_on (void);
int MPIL_Trace_off (void);
```

## FORTRAN SYNOPSIS

```
subroutine MPIL_TRACE_ON (ierr)
subroutine MPIL_TRACE_OFF (ierr)
integer ierr
```

## DESCRIPTION

These functions give the application the flexibility to generate traces only during certain interesting phases of the application's execution. This technique can considerably reduce the size of the trace files and burden of displaying them.

Both functions are collective over MPI\_COMM\_WORLD. In typical usage, the -toff option of [mpirun(1)](/mpirun/1.md) would be used to enable tracing, but start with the runtime switch in the off position. At the beginning of an interesting phase of program execution, *MPIL\_Trace\_on()* would be called. *MPIL\_Trace\_off()* would be called after the interesting phase. 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)](/lamtrace/1.md). If the on/off functions are never used and tracing is enabled with the -ton option of [mpirun(1)](/mpirun/1.md), a single trace segment is produced.

The on/off functions have no effect if tracing is not enabled by [mpirun(1)](/mpirun/1.md) with either -ton or -toff. Thus, an application can be littered with these functions but run without trace collection and very little additional overhead due to the no-operation function calls.

### Limitations

After the volume of generated traces exceeds a preset limit, the oldest traces are discarded in favour of new traces. Avoiding discarded traces is further incentive to use *MPIL\_Trace\_on()* and *MPIL\_Trace\_off()*.

## SEE ALSO

[mpirun(1)](/mpirun/1.md), [lamtrace(1)](/lamtrace/1.md)
