Intel® Advisor User Guide

ID 766448
Date 3/31/2023
Public

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

Document Table of Contents

Analyze MPI Applications

With Intel® Advisor, you can analyze parallel tasks running on a cluster to examine performance of your MPI application.

To start MPI jobs, use an MPI launcher such as mpirun, mpiexec, srun, aprun. You can use the Intel Advisor with the Intel® MPI Library or other MPI implementations only through the command line interface, but you can view the result using the standalone GUI, as well as the command line. The examples provided in this section use mpirun with the advisor command line interface (CLI) to spawn processes across the cluster and collect data about the application.

NOTE:
Use the MPI implementation that passes communication information using environment variables. The implementation needs to operate with the Intel Advisor process (advisor) being between the launcher process and the application process. Intel Advisor does not work on an MPI implementation that tries to pass communication information from its immediate parent process.

To analyze your MPI application:

  1. Prerequisite: Set up environment variables to enable Intel Advisor CLI.
  2. Optional: Get pre-configured command lines.
  3. Run Intel Advisor analyses with one of the following:
  4. View the results.

You can analyze your application as one of the following:

  • If you have a directory shared between remote and local systems: Collect data remotely to the shared directory. In this case, you do not need to move a project between the systems.
  • If you do not have a shared directory: Collect data to a directory on a remote system (for example, on a cluster), generate a snapshot (optionally), and copy the snapshot or a project to your local system to view the result. If you generate a snapshot, you do not need to configure the search paths for a project.

Get Preconfigured Command Lines

You can generate pre-configured command lines for collecting results for the Intel MPI Library launcher or a custom launcher using Intel Advisor graphical user interface (GUI). In this case, you do not need to type each command with all options and paths to a project directory and an application executable manually.

See Generate Command Lines for details.

Use Intel® MPI Library

With the Intel MPI Library, you can analyze a single MPI rank or several ranks of your MPI application with the Intel Advisor. This can help you to decrease analysis overhead.

Recommended MPI ranks to analyze are rank 1 and higher, because rank 0 might include time for configuration and not be a good representative for the general MPI application performance.

MPI Command Syntax

To collect performance data for an MPI application with Intel Advisor using the mpirun launcher of the Intel MPI Library, use the following command syntax:

mpirun -gtool "advisor --collect=<analysis-type> --search-dir src:r=<source-dir> [--no-auto-finalize] --project-dir=<project-dir>:<rank-set>" -n <N><application-name> [<application-options>]

where:

  • -gtool allows you to run Intel Advisor analyses for the specified MPI ranks only. This option is available for Intel MPI Library 5.0.2 or higher.
  • <analysis-type> is an Intel Advisor analysis to run: survey, tripcounts, map. dependencies, projection.
  • <source-dir> is the path to the directory where application sources are stored. Specify it if you disabled autofinalization.
  • <project-dir> is the path/name of the project directory where the analysis results are saved. Specify the same project directory when running various Intel Advisor collections for the selected process.
  • <ranks-set> is a set of MPI ranks to analyze. Each rank corresponds to an MPI process and is used to identify the result data. Separate ranks with a comma or use a dash " - " to set a range of ranks. Use with -gtool option only. Do not specify if you want to analyze all ranks.
  • <N> is the number of MPI processes to launch.
  • --no-auto-finalize disables result finalization on the target system to decrease overhead. The results are finalized when you import them or open in Intel Advisor GUI. Do not use this option if you do not use a shared directory and plan to copy results from cluster with snapshot. See Temporarily Disable Finalization for details.

Analyze a Single Rank of MPI Application with Intel MPI Library

Prerequisite: Set up environment variables to enable Intel Advisor CLI.

In the commands below:

  • Data is collected remotely to a shared directory.
  • The analyses are performed for an application running in four processes.
  • Path to an application executable is ./mpi_sample.

    Note: In the commands below, make sure to replace the application path and name before executing a command. If your application requires additional command line options, add them after the executable name.

  • Path to an Intel Advisor project directory is ./advi_results.

This example shows how to run a Survey, Trip Counts, and Roofline analyses for the rank 1 of the MPI application with the gtool option of the Intel MPI Library.

  1. Collect survey data for rank 1 into the shared ./advi_results project directory on a target system.
    mpirun -gtool "advisor --collect=survey --project-dir=./advi_results:1" -n 4 ./mpi_sample
  2. Run the Trip Counts analysis with FLOP collection for rank 1 on the target system.
    mpirun -gtool "advisor --collect=tripcounts --flop --project-dir=./advi_results:1" -n 4 ./mpi_sample

    After you collect the Survey, Trip Counts, and FLOP data, you also get the Roofline report for your application.

  3. If you did not collect data to a shared location and need to copy the data to the local system to view the results, do it now.
  4. On the local system, view the results with your preferred method. You can view only one process data at a time.

Analyze Multiple Ranks of MPI Application with Intel MPI Library

Prerequisite: Set up environment variables to enable Intel Advisor CLI.

In the commands below:

  • Data