Skip to main content
⚠ INFORMATION
This page was translated by an AI (LLM) with a cursory human check and is awaiting full review.

Application Performance Snapshot (APS)

We invite you to consult the best practices for code profiling for general advice on performance analysis on Jean Zay.

Description​

APS (Application Performance Snapshot) is a performance analysis tool provided with Intel VTune Amplifier. Sampling is done very simply on the command line and produces result files in various formats (text, HTML, VTune).

Installed Versions​

  • Several versions of APS are accessible via the various versions of Intel Parallel Studio XE installed on the machine.
  • APS is perfectly suited to hybrid MPI and OpenMP applications.

Usage​

Initialisation​

The version of APS used depends on the Intel environment you are using. The module command allows access to the various Intel environments.

The command module avail intel-all will show you the different versions available:

$ module avail intel-all
intel-all/2016.4(16.0.4) intel-all/2019.2(19.0.2) intel-all/2020.0
intel-all/2018.1(18.0.1) intel-all/2019.4(19.0.4) intel-all/2020.1
intel-all/2018.5(18.0.5) intel-all/2019.5(19.0.5) intel-all/2020.2

Before working with this tool, you must therefore execute a command of the type:

$ module load intel-all/2019.4
INFO

Note that the intel-all/XXXX.Y.Z modules contain the complete Intel environments with the compilers, the MKL math library, the MPI library and the code analysis tools.

Once the module is loaded, the use of APS is done in two steps:

  • Execution of the application via APS (on the command line);
  • Analysis/visualisation of the results according to the chosen writing format:
    • with a text editor (output file of the batch job)
    • online with the command aps-report (see the command aps-report -h)
    • or with a WEB browser.
Attention

We strongly recommend using the same version of the Intel environment when compiling, running and analysing your code.

Execution​

The simplest way is to sample on the command line in your Slurm scripts: just add the command aps in the call to srun. To ensure this command is recognised, do not forget to load the appropriate intel-all/20XX.Y module in your job.

For help with the options of the aps command, simply type aps --help.

At the end of sampling, APS writes its files to a directory whose name can be specified via the option -r=nom_repertoire or --result-dir=nom_repertoire. Make sure to specify a directory located in one of your permanent (such as WORK) or semi-temporary (such as SCRATCH) disk spaces.

Attention

If the directory already exists, the current execution will overwrite the results of previous executions.

  • Here is an example of submission for a purely MPI code (without OpenMP threads):
job_aps_mpi.slurm
#!/bin/bash
#SBATCH --job-name=aps_mpi # nom du job
#SBATCH --ntasks=4 # nombre total de processus MPI
#SBATCH --ntasks-per-node=4 # Nombre de processus MPI par noeud
# /!\ Attention, la ligne suivante est trompeuse mais dans le vocabulaire
# de Slurm "multithread" fait bien référence à l'hyperthreading.
#SBATCH --hint=nomultithread # on réserve des coeurs physiques et non logiques
# La ligne ci-dessous peut ĂȘtre dĂ©commentĂ©e pour passer en mode exclusif et disposer
# d'un accÚs complet aux compteurs matériels (cf. les bonnes pratiques pour le profilage)
##SBATCH --exclusive -C prof
#SBATCH --time=00:30:00 # temps d'exécution maximum demande (HH:MM:SS)
#SBATCH --output=%x_%j.out # nom du fichier de sortie
#SBATCH --error=%x_%j.out # nom du fichier d'erreur (ici commun avec la sortie)

## Choix d'un environnement Intel disposant de APS
module load intel/2019.4

##echo des commandes
set -x

## Execution sous le SCRATCH
cd $SCRATCH

## Echantillonnage du binaire ./my_bin_exe
## Les fichiers de rapport sont automatiquement generes apres l'echantillonnage.
srun aps --collection-mode=mpi ./my_bin_exe
Attention

The various versions of APS cannot use the Intel sampling drivers because they are not installed on the compute nodes. As a result, certain analyses, which can be activated via the option --collection-mode, are not available on Jean Zay. In particular, the option --collection-mode=all, which is the default value, is not usable. You are therefore obliged to specify the option --collection-mode=mpi for a purely MPI code.

  • Here is an example of submission for a hybrid MPI/OpenMP code:
job_aps_mpi_omp.slurm
#!/bin/bash
#SBATCH --job-name=aps_mpi_omp # nom du job
#SBATCH --ntasks=4 # nombre total de processus MPI
#SBATCH --ntasks-per-node=4 # Nombre de processus MPI par noeud
#SBATCH --cpus-per-task=10 # nombre de threads OpenMP
# /!\ Attention, la ligne suivante est trompeuse mais dans le vocabulaire
# de Slurm "multithread" fait bien référence à l'hyperthreading.
#SBATCH --hint=nomultithread # on réserve des coeurs physiques et non logiques
# La ligne ci-dessous peut ĂȘtre dĂ©commentĂ©e pour passer en mode exclusif et disposer
# d'un accÚs complet aux compteurs matériels (cf. les bonnes pratiques pour le profilage)
##SBATCH --exclusive -C prof
#SBATCH --time=00:30:00 # temps d'exécution maximum demande (HH:MM:SS)
#SBATCH --output=%x_%j.out # nom du fichier de sortie
#SBATCH --error=%x_%j.out # nom du fichier d'erreur (ici commun avec la sortie)

## Choix d'un environnement Intel disposant de APS
module load intel/2019.4

##echo des commandes
set -x

## Execution sous le SCRATCH
cd $SCRATCH

## Echantillonnage du binaire ./my_bin_exe
## Les fichiers de rapport sont automatiquement generes apres l'echantillonnage.
srun aps --collection-mode=mpi,omp ./my_bin_exe
Attention

The various versions of APS cannot use the Intel sampling drivers because they are not installed on the compute nodes. As a result, certain analyses, which can be activated via the option --collection-mode, are not available on Jean Zay. In particular, the option --collection-mode=all, which is the default value, is not usable. You are therefore obliged to specify one of the following options:

  • --collection-mode=mpi to perform MPI sampling.
  • --collection-mode=omp to perform OpenMP sampling.
  • --collection-mode=mpi,omp to perform MPI and OpenMP sampling.

Visualisation/Analysis of Results​

You will find global information about the code at the end of the output file of your job: MPI subroutines called, functions that consume the most elapsed time, etc...

The aps-report tool does not require a remote graphical display. It can therefore be called directly from an interactive session on Jean Zay, by providing it with the name of the directory containing the results to be displayed (by default aps_result_yyyymmdd).

Here is an example of a call that allows you to see the data related to each MPI process in your console:

$ aps-report -t -D aps_result_yyyymmdd

aps will also generate an HTML file (by default aps_report_yyyymmdd_hhmmss.html) but there is no web browser on Jean Zay that allows you to view it.

Documentation​

Your opinion matters!

To give your feedback, report an error, or suggest an improvement, click here:

quick anonymous questionnaire

This questionnaire is temporary and will take less than a minute, so take the opportunity!