Controlling Amount of Collected Data

Application Performance Snapshot (APS) provides several methods to control the amount of collected data. This enables you to reduce profiling overhead and focus on relevant application sections.

Collection Control API

By default, APS collects statistics for the whole application run. In some cases, it is important to enable or disable the collection for a specific application phase. For example, you may want to focus on the most time consuming section or disable collection for the initialization or finalization phases. APS provides APIs to control data collection from source code.

For MPI applications, use the MPI_Pcontrol() API. Call MPI_Pcontrol(0) to pause data collection, call MPI_Pcontrol(1) to resume it again. For more information, refer to Region Control with MPI_Pcontrol.

For non-MPI applications, ITT API is also available. Before using ITT API, you need to configure your system. For instructions, refer to: https://software.intel.com/en-us/vtune-amplifier-help-configuring-your-build-system. If APS is installed as a standalone package,  <install_dir> is equal to <install_dir>/internal/. After the system is configured, you can use ITT API. Call __itt_pause()and __itt_resume()to pause and resume data collection, respectively.

By default, profiling is enabled when the application is launched. To launch the application without profiling, use the -start-paused option. Profiling will begin automatically with the first call of MPI_Pcontrol(1) or __itt_resume(). This can be useful to skip the initialization phase.

Filtering Data by Type

APS allows you to filter statistics collection by type: MPI statistics, OpenMP* statistics, or hardware counters statistics. By default, data of all types is collected.

To specify data collection types, use the -c (--collection-mode) option. As an argument, specify a comma-separated list of values mpi, omp, or hwc to enable statistics collection of the specified types. Use the all argument to enable statistics collection of all types (default).

For example, to disable hardware counters statistics in an MPI application:

$ mpirun -n 2 aps -c mpi,omp ./myapp

Setting MPI Level of Detail

For MPI applications, APS introduces the multi-level approach to statistics collection. There are five levels of detail that vary by the amount of data collected. By default, level 1 is enabled. To change the level, use the MPS_STAT_LEVEL environment variable. For example:

$ export MPS_STAT_LEVEL=2

The table below summarizes all the available levels of detail.

Level

Information is collected about

1 (default)

MPI functions and their times

2

MPI functions and amount of transmitted data

3

MPI functions, communicators, and message sizes

4

MPI functions, communicators, communication directions and aggregated traffic for each direction

5

MPI functions, communicators, message sizes, and communication directions

Level 5 may provide too much information if an application uses a lot of communicators. In this case, you may consider reducing the statistics level. Also, some diagrams may be unavailable for statistics levels 1–4. It depends on the availability of the information provided on the given level.