Cookbook

  • 06/18/2020
  • Public Content

Analyze Performance Remotely and Visualize Results on a Local macOS* System

If you must run your application on a dedicated remote system like clusters with strict time schedules and limited capabilities for visualization and data manipulation, you can analyze the application with the Intel® Advisor CLI and benefit from using the Intel® Advisor GUI for results investigation. This recipe shows how to collect performance data on a remote system using the Intel Advisor command line interface and view the results on a local macOS* system using the Intel Advisor GUI.

Scenario

It is a common use case for a high performance, parallel and vectorized code to be run on dedicated remote systems like clusters with strict time schedules and limited capabilities for visualization and data manipulation. Tools for performance assessment are often limited to running from the command line, and many conveniences like GUI interfaces and access to online documentation resources are often unavailable on these types of systems.
On macOS* systems, the Intel® Advisor capabilities are limited and it does not support data collection; you can only view data collected on a Windows* OS or Linux* OS.

Ingredients

This section lists the hardware and software used to produce the specific result shown in this recipe:

Prerequisites

  • Make sure you build your application for analysis with debug information enabled and inline debug information included. For more information, see Before You Begin in Get Started with the Intel® Advisor.
  • Recommendation
    : The application for analysis, along with its binaries, symbol information, and source code, should be located on a shared drive visible to both local and remote machines.

Collect Performance Data on a Remote System

On the remote system, you can collect any performance data for your application. This recipe describes how to collect Roofline, Memory Access Patterns, and Dependencies data using the Intel Advisor CLI.
Get Command Lines for Your Application from GUI
Your application, its binaries, symbol information, and source code, should be located on a shared drive visible to both local and remote machines. Otherwise, you must replace paths in the commands you get with the correct paths to the application before running them.
You can use the Intel Advisor GUI on your local machine to get command lines for running an analysis on your application that you can copy and run on the remote system.
  1. Open the Intel Advisor GUI on the local machine.
  2. Set up the project properties.
  3. Click the
    Get Command Line
    button on the Workflow tab under the desired analysis.
  4. From the opened dialog window, copy the generated command lines for launching this type of analysis with the current settings.
    For example, for the Roofline analysis, the Intel Advisor generates two commands for Survey and Trip Counts and FLOP analyses, which include parameters with search paths to binary, symbol, and source files as set in the project properties:
  5. Optional
    : if your application, its binaries, symbol information, and source code are not located on a shared drive, replace the local paths with the correct paths on the remote system.
  6. Switch to your remote system and run the command lines copied.
For more information about the
Copy Command Line to Clipboard
, see the Corresponding advixe-cl Command Options Dialog Box in the Intel Advisor User Guide.
If you want to view the results on a local macOS* system, it is
not
recommended to use
--no-auto-finalize
option for reducing collection and finalization time. We suggest doing all the finalization on the target (remote) system along with the analysis. As a macOS* system might not have the same version of compiler, runtimes, math libraries, and other parts of analyzed application stack, finalization on the target system should better capture all these details.
Run the Roofline Analysis
While on the remote system:
  1. Run the Roofline analysis from a command prompt. For example, you can use the shortcut
    --collect=roofline
    command:
    advixe-cl --collect=roofline --project-dir=/user/test/vec_project --search-dir sym:p=<sample_dir>/vec_samples --search-dir bin:p=<sample_dir>/vec_samples --search-dir src:p=<sample_dir>/vec_samples -- <sample_dir>/vec_sample/vec_samples
  2. Optional
    : If you only need the Roofline report, you can export it as an HTML file with the following command:
    advixe-cl --report=roofline --project-dir=/user/test/vec_project --report-output=./roofline.html
For more information about the Roofline analysis, see the Roofline Analysis topic in the Intel Advisor User Guide.
Run the Memory Access Patterns and Dependencies Analyses
After getting Survey and/or Roofline analysis results, you may want to perform deeper analysis for certain loops to detect inefficient memory access patterns or determine whether they have data dependencies between iterations.
While on the
remote
system:
  1. Mark up loops for analysis using the
    --mark-up-loops
    action. This command accepts a comma-separated list of source locations in a
    filename:linenumber
    format. To mark line 34 in the
    foo.cpp
    file and line 192 in the
    bar.cpp
    file:
    advixe-cl --mark-up-loops –-select=foo.cpp:34,bar.cpp:192 --project-dir=/user/test/vec_project --search-dir sym:p=<sample_dir>/vec_samples --search-dir bin:p=<sample_dir>/vec_samples --search-dir src:p=<sample_dir>/vec_samples -- <sample_dir>/vec_sample/vec_samples
    These loops will remain selected for future Trip Counts, Memory Access Patterns, and Dependencies analyses unless otherwise specified.
  2. Collect Memory Access Patterns data for the loops marked up:
    advixe-cl --collect=map --project-dir=/user/test/vec_project --search-dir sym:p=<sample_dir>/vec_samples --search-dir bin:p=<sample_dir>/vec_samples --search-dir src:p=<sample_dir>/vec_samples -- <sample_dir>/vec_sample/vec_samples
  3. Run the Dependencies analysis for the marked-up loops:
    advixe-cl --collect=dependencies --project-dir=/user/test/vec_project --search-dir sym:p=<sample_dir>/vec_samples --search-dir bin:p=<sample_dir>/vec_samples --search-dir src:p=<sample_dir>/vec_samples -- <sample_dir>/vec_sample/vec_samples
You can also mark up loops for one analysis only using the
--mark-up-list
option during collection. This option takes a comma-separated list of loop ID or source locations. To get the IDs or source locations, use the Survey report generated with the CLI or select loops with checkboxes on the
Survey
report tab the GUI and get the corresponding command line on the
Workflow
pane.
After you identify loops for analysis, run the analysis of choice with the
--mark-up-list
option. For example, run the Memory Access Patterns analysis with loop IDs specified:
advixe-cl --collect=map –-mark-up-list=58,72 --project-dir=/user/test/vec_project --search-dir sym:p=<sample_dir>/vec_samples --search-dir bin:p=<sample_dir>/vec_samples --search-dir src:p=<sample_dir>/vec_samples -- <sample_dir>/vec_sample/vec_samples

View Results on a Local macOS* System

To view the results on a local system, you need to copy them from your remote system. Do one of the following:
  • Option 1.
    If you
    do not
    have a shared drive visible to both local and remote systems:
    1. On the remote system, pack your analysis results into a snapshot with the
      my_proj_snapshot
      name:
      advixe-cl --snapshot --project-dir=/user/test/vec_project --pack --cache-sources --cache-binaries -- /tmp/my_proj_snapshot
    2. Copy
      my_proj_snapshot.advixeexpz
      to the local macOS host.
    3. Switch to the local macOS system.
    4. Open the snapshot in the Intel Advisor GUI to view the results:
      • From the command prompt:
        advixe-gui my_proj_snapshot.advixeexpz
      • From the GUI: Launch the Intel Advisor, go to
        File
        Open
        Result
        , and navigate to the copied snapshot.
    5. View the results.
  • Option 2.
    If you
    have
    a shared drive visible to both local and remote systems:
    1. Copy the
      vec_project
      directory to a shared drive.
    2. Open the project in the Intel Advisor GUI:
      • From the command prompt:
        advixe-gui vec_project
      • From the GUI: Launch the Intel Advisor, go to
        File
        Open
        Project
        , and navigate to the copied snapshot.
    3. Go to the
      File
      Project properties
      and set up the binary, symbol, and source paths for the analyzed application in the shared location in the
      Binary/Symbol Search
      and
      Source Search
      tabs.
    4. View the results.
  • Option 3 (for Roofline only)
    . If you only need a Roofline report and you have it exported as an HTML file:
    1. Copy the HTML report to a shared drive or to the local macOS system.
    2. Switch to the local system.
    3. Open the report in a browser and view the results.
Once you open the results, the full content of the GUI should be available on your macOS system. You can view the results of Intel Advisor analyses, identify the vectorization inefficiencies and optimization opportunities, and study the Roofline chart. All these performance observations are mapped to source code and assembly.

Key Take-Aways

  • You can have full Intel Advisor GUI experience on a local macOS or Windows system without the need to set up the GUI on a remote Linux cluster node.
  • You cannot run a new analysis on a macOS system, but you can visualize your results generated on a remote system like cluster system with the Intel Advisor CLI.

See Also

This section also lists links to all documents and resources the recipe refers to:

Product and Performance Information

1

Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804