Intel® Advisor User Guide

ID 766448
Date 7/13/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

Control Collection with an MPI_Pcontrol Function

By default, Intel® Advisor analyzes performance of a whole application. In some cases, you may want to focus on the most time-consuming section or disable collection for the initialization or finalization phases. This can decrease collection overhead.

Intel Advisor supports the MPI region control with the MPI_Pcontrol() function. This function allows you to enable and disable collection for specific application regions in the source code. The region control affects only MPI and OpenMP* metrics, while other metrics are collected for the entire application.

To use the function, add it to your application source code as follows:

  • To pause data collection, add MPI_Pcontrol(0)before the code region that you want to disable the collection for.
  • To resume data collection, add MPI_Pcontrol(1) where you want the collection to start again.
  • To skip the initialization phase:
    1. Add the MPI_Pcontrol(1) function right after initialization.
    2. Build the application.
    3. Run Intel Advisor analyses with the --start-paused option. For example, to run the Survey analysis:
      advisor --collect=survey --start-paused --project-dir=./advi_results -- ./mpi_sample
NOTE:
Intel Advisor accepts only 0 and 1 arguments for the MPI_Pcontrol() function. You can use other numbers to mark code regions, but Intel Advisor ignores them.

For code snippet examples, see Region Control with MPI_Pcontrol.

See Also