Tool Time: Installing POP tools with Spack

Sunday, January 12, 2025

Installing software on HPC systems is not always easy, therefore many users and system administrators rely on package managers to perform this task. Spack is becoming an increasingly important way to install software on HPC systems. It is widely used in US supercomputing facilities, but also in Europe as for instance at CINECA, LUMI, or HLRS.

Spack recipes are available for many of the tools used in the context of POP. I am aware of and have been using Score-P (v8.4), Scalasca (v2.6.1) , Cube (v4.8.2), Extrae (v4.2.3), Paraver (v.4.6.3), DLB/Talp (v3.2), OTF-CPT (v0.9), mpip (v3.5), and PAPI (v7.1.0).

My personal preference when working with tools which instrument applications, is to use matching compilers when compiling the tool, the application, and the MPI. Enforcing this with Spack can be a bit tricky. I like to explicitly specify compilers also for the dependency MPI. Below is an example of a Spack environment for the tools mentioned above.

spack:

  definitions:
  - core_compiler: [gcc@11.4]
  - compilers: [cce@18.0, clang@18.0]
  - mpis: [cray-mpich@8.1.30]
  - comp_mpis: ["%cce ^cray-mpich%cce", "%clang ^cray-mpich%clang"] # force matching compilers for mpi
  - gpu_variant: [+hip~cuda]  # or maybe ~hip+cuda
  - cflags_noerror_implicit: ['cflags="-Wno-error=implicit-function-declaration -Wno-error=implicit-int -Wno-error=int-conversion -Wno-error=incompatible-pointer-types"']
 
  specs:
  - matrix:
    - [cube, papi]
    - [$%core_compiler]
  - matrix:
    - [mpip, extrae+papi+single-mpi-lib]
    - [$cflags_noerror_implicit] # code is not fully C99
    - [$comp_mpis]
  - matrix:
    - [otf-cpt, scalasca, dlb]
    - [$comp_mpis]
  - matrix:
    - [scorep+papi]
    - [$gpu_variant]
    - [$comp_mpis]

On our system, the core compiler provided by the operating system is gcc/11.4. Our applications are compiled either with the Cray compiler cce/18.0, or the AMD ROCm compiler v6.2.2 which is known to Spack as clang/18.0. The only relevant MPI is Cray MPI cray-mpich/8.1.30. The next lines force matching compilers for the tool and the MPI implementation, choose variants for GPU support through HIP rather then CUDA, and finally define some CFLAGS for codes that still do not fully support C99 (sigh!).

The next section specs specifies which packages should be installed and how to build them. Cube and PAPI are mostly compiled with the core compiler, mpip and Extrae both need extra CFLAGS because they do not comply with C99, and I have chosen to compile Score-P with GPU support.

You might notice that I have not included Paraver. I prefer to install the binary that is available for download on their website rather then building it from source (even through Spack).

Have fun with Spack!

-- José Gracia (HLRS)

Tags: