Visible to Intel only — GUID: GUID-E9F2D13E-7E37-4B6D-9CA5-3F94EA175AA1
Visible to Intel only — GUID: GUID-E9F2D13E-7E37-4B6D-9CA5-3F94EA175AA1
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:
- Add the MPI_Pcontrol(1) function right after initialization.
- Build the application.
- 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
For code snippet examples, see Region Control with MPI_Pcontrol.