|
| 1 | +[](){#ref-devtools-vihps} |
| 2 | +# VI-HPS tools |
| 3 | + |
| 4 | +The [VI-HPS](https://www.vi-hps.org/tools) Institute (Virtual Institute for High Productivity Supercomputing) provides tools that can assist developers of simulation codes to address their needs in performance analysis. |
| 5 | + |
| 6 | +## [Score-P](https://www.vi-hps.org/projects/score-p/overview/overview.html) |
| 7 | + |
| 8 | +[Score-P](https://www.vi-hps.org/projects/score-p/overview/overview.html) |
| 9 | +is a highly scalable instrumentation and measurement infrastructure for profiling, event tracing, and online analysis. It supports a wide range of HPC platforms and programming models. Score-P provides core measurement services for a range of specialized analysis tools, such as Vampir, Scalasca and others. |
| 10 | + |
| 11 | +## [Vampir](https://www.vi-hps.org/tools/vampir.html) |
| 12 | + |
| 13 | +[Vampir](https://www.vi-hps.org/tools/vampir.html) |
| 14 | +is a performance visualizer that allows to quickly study the program runtime behavior at a fine level of details. This includes the display of detailed performance event recordings over time in timelines and aggregated profiles. Interactive navigation and zooming are the key features of the tool, which help to quickly identify inefficient or faulty parts of a program. |
| 15 | + |
| 16 | +!!! info |
| 17 | + While Score-P does not require a license, [Vampir](https://vampir.eu/licensing) does. CSCS standard license allows to read trace files with up to 256 concurrent threads of execution. |
| 18 | + |
| 19 | + The Vampir GUI is currently available only on `x86-64` CPU based systems and is not provided via a uenv (more details in the Quickstart guide below). |
| 20 | + You can use Score-P to generate OTF2 traces files on Alps compute nodes and then visualize the results with Vampir on a x86-64 CPU based system (for instance Eiger, LUMI or using your own license). |
| 21 | + |
| 22 | +## [Cube and Scalasca](http://www.vi-hps.org/tools/scalasca.html) |
| 23 | + |
| 24 | +[Cube and Scalasca](http://www.vi-hps.org/tools/scalasca.html) |
| 25 | +support the performance optimization of parallel programs with a collection of scalable trace-based tools for in-depth analyses of concurrent behavior. The analysis identifies potential performance bottlenecks - in particular those concerning communication and synchronization - and offers guidance in exploring their causes. |
| 26 | + |
| 27 | +## Quickstart guide |
| 28 | + |
| 29 | +The VI-HPS uenv is named `scorep` and it can be loaded into your environment as explained here and in the [uenv documentation][ref-uenv]. |
| 30 | + |
| 31 | +!!! example "Finding and pulling available `scorep` versions" |
| 32 | + |
| 33 | + ```console |
| 34 | + uenv image find scorep |
| 35 | + # uenv arch system id size(MB) date |
| 36 | + # scorep/9.2-gcc12:v1 gh200 daint bfd3b46d30404f2c 7,602 2025-07-14 |
| 37 | + # scorep/9.2-gcc13:v1 gh200 daint 3c0357a490c81f32 7,642 2025-07-14 |
| 38 | + |
| 39 | + uenv image pull scorep/9.2-gcc13:v1 |
| 40 | + # pulling 3c0357a490c81f32 100.00% |
| 41 | + ``` |
| 42 | + |
| 43 | + This uenv is configured to be mounted in the `/user-environment` path. |
| 44 | + |
| 45 | +!!! example "Start the `scorep` uenv" |
| 46 | + |
| 47 | + ```bash |
| 48 | + uenv start scorep/9.2-gcc13:v1 -v default |
| 49 | + |
| 50 | + uenv status # (1)! |
| 51 | + scorep --version # 9.2 |
| 52 | + scalasca --version # 2.6.2 |
| 53 | + cubelib-config --version # 4.9 |
| 54 | + otf2-print --version # 3.1.1 |
| 55 | + |
| 56 | + find /user-environment/ -name scorep.pdf # (2)! |
| 57 | + ``` |
| 58 | + |
| 59 | + 1. Test that everything has been mounted correctly and that the tools are in the PATH |
| 60 | + 2. A PDF version of the user guide is available in the uenv. |
| 61 | + |
| 62 | +!!! example "Recompile your code with `scorep` on Alps" |
| 63 | + |
| 64 | + ```bash |
| 65 | + # Building with CMake requires the following steps |
| 66 | + ## Invoke cmake with the scorep wrapper disabled: |
| 67 | + SCOREP_WRAPPER=OFF \ |
| 68 | + cmake -S src -B build \ |
| 69 | + -DCMAKE_CXX_COMPILER=scorep-mpic++ \ |
| 70 | + -DCMAKE_C_COMPILER=scorep-mpicc \ |
| 71 | + -DCMAKE_CUDA_COMPILER=scorep-nvcc \ |
| 72 | + -DCMAKE_CUDA_ARCHITECTURES=90 # [...] |
| 73 | + |
| 74 | + ## Then build with the scorep wrapper enabled: |
| 75 | + SCOREP_WRAPPER=ON \ |
| 76 | + cmake --build build |
| 77 | + ``` |
| 78 | + |
| 79 | +!!! example "Run your application with `scorep` on Alps" |
| 80 | + |
| 81 | + Pick one of the report type in your jobscript before running the executable compiled with `scorep`: |
| 82 | + |
| 83 | + === "Profiling" |
| 84 | + |
| 85 | + - Profiling gives an overview of the performance of your simulation on Alps |
| 86 | + |
| 87 | + ```bash |
| 88 | + export SCOREP_ENABLE_PROFILING=true |
| 89 | + # Call-path profiling: CUBE4 data format (profile.cubex) |
| 90 | + ``` |
| 91 | + |
| 92 | + - Then run your job as usual with `srun` or `sbatch` on Alps, |
| 93 | + - Copy the generated profile `profile.cubex` to your laptop, |
| 94 | + - Install the [Cube](https://www.scalasca.org/scalasca/software) tool on your laptop, |
| 95 | + - Analyze the results with the GUI: |
| 96 | + - performance metric (left panel) |
| 97 | + - call path (middle panel) |
| 98 | + - system resource (right panel) |
| 99 | + |
| 100 | + ```bash |
| 101 | + /Applications/Cube/4.9/Cube.app/Contents/MacOS/maccubegui.sh \ |
| 102 | + ./profile.cubex |
| 103 | + ``` |
| 104 | + |
| 105 | + { width="90%"} |
| 106 | + |
| 107 | + === "Tracing" |
| 108 | + |
| 109 | + - Tracing allows a detailed analysis of the performance of your simulation on Alps |
| 110 | + |
| 111 | + ```bash |
| 112 | + export SCOREP_ENABLE_TRACING=true |
| 113 | + # Event-based tracing: OTF2 data format (traces.otf2) |
| 114 | + ``` |
| 115 | + |
| 116 | + - Then run your job as usual with `srun` or `sbatch` on Alps, |
| 117 | + - Analyze the results with the GUI: |
| 118 | + |
| 119 | + ```bash |
| 120 | + ssh -X eiger.cscs.ch # Vampir GUI requires x86_64 ⚠️ |
| 121 | + /capstor/store/cscs/userlab/vampir/10.6.1/bin/vampir \ |
| 122 | + ./traces.otf2 |
| 123 | + ``` |
| 124 | + |
| 125 | + !!! info |
| 126 | + - Tracing allows more detailed analysis but will also make your simulation run longer than with profiling, |
| 127 | + - `scorep-score` allows to estimate the size of an OTF2 tracefile from a CUBE profile, |
| 128 | + it can also help to reduce the overhead of tracing via filtering: |
| 129 | + ```bash |
| 130 | + scorep-score -g profile.cubex # generate filter file |
| 131 | + scorep-score -f initial_scorep.filter profile.cubex |
| 132 | + export SCOREP_FILTERING_FILE='initial_scorep.filter' |
| 133 | + ``` |
| 134 | + - The [user guide](https://perftools.pages.jsc.fz-juelich.de/cicd/scorep/tags/scorep-9.2/html/group__SCOREP__User.html#gaab4b3ccc2b169320c1d3bf7fe19165f9) provides more details about how to reduce overhead. |
| 135 | + |
| 136 | + { width="90%"} |
0 commit comments