Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Last revisionBoth sides next revision
doku:spack [2021/08/26 06:47] – created mhickeldoku:spack [2023/05/17 14:46] msiegel
Line 1: Line 1:
-placeholder+===== SPACK - a package manager for HPC systems ===== 
 + 
 +[[https://spack.readthedocs.io/en/latest/basic_usage.html|Official documentation of SPACK]] 
 + 
 + 
 +==== New SPACK without environments ==== 
 + 
 +Having worked with spack environments for some time, we have encountered several severe issues which have convinced us that we need to find a more practical way of maintaining software packages at VSC. 
 + 
 +There are now three separate spack installation trees corresponding to the CPU/GPU architectures on VSC: 
 + 
 +  * skylake - Intel CPUs; works on Intel Skylake and Cascadelake CPUs 
 +  * zen - AMD CPUs; works on Zen 2 and 3 CPUs 
 +  * cuda-zen - AMD CPUs + NVIDIA GPUs; works on all nodes equipped with graphics cards 
 + 
 +By default the spack installation tree suitable for the current compute/login node is activated and will be indicated by a **prefix** on the command line, e.g.: 
 + 
 +<code> 
 +zen [user@l51 ~]$ 
 +</code> 
 + 
 +Read more at: 
 + 
 +[[doku:spack-transition | Transition to new SPACK without Environments]] 
 + 
 + 
 +==== List available packages ==== 
 + 
 +Most software on VSC4/5 is installed via spack, to list available software packages use: 
 + 
 +<code> 
 +spack find 
 +</code> 
 + 
 +List all available packages compiled with a specific compiler: 
 + 
 +<code> 
 +spack find %gcc@9.1.0 
 +</code> 
 + 
 +A specific version can be requested as well: 
 + 
 +<code> 
 +spack find openmpi@4.1.0 
 +</code> 
 + 
 +List a specific version compiled with a specific compiler: 
 + 
 +<code> 
 +spack find openmpi@4.1.0%gcc@9.1.0 
 +</code> 
 + 
 +The detail level of information can be specified with the following options: 
 + 
 +<code> 
 +spack find -l openmpi@4.1.0%gcc@9.1.0 
 +spack find -lv openmpi@4.1.0%gcc@9.1.0 
 +spack find -lvd openmpi@4.1.0%gcc@9.1.0 
 +</code> 
 + 
 +The latter lists all dependencies of the package. 
 + 
 +**Dependencies**: dependencies of software packages can be specified with a ''^''
 +e.g.:  
 +<code> 
 +spack find -lvd py-scipy %intel@19.0.5.281 ^python@3.7.4 ^intel-mkl 
 +</code> 
 + 
 +This will list all available versions of ''py-scipy'' which have been build with ''python@3.7.4'' and any version of ''intel-mkl''
 + 
 +List all currently loaded packages: 
 +<code> 
 +spack find --loaded 
 +</code> 
 + 
 +==== Load modules ==== 
 + 
 +The ''spack'' command can be used to load software modules. The general form is: 
 +<code> 
 +spack load <package> 
 +</code> 
 +''package'' has to be a uniquely defined software package where all dependencies have been resolved, e.g.: 
 + 
 +<code> 
 +spack load openmpi@4.1.0%gcc@9.1.0 
 +</code> 
 + 
 +This will load the corresponding module: 
 +<code> 
 +# module list 
 +Currently Loaded Modulefiles: 
 + 1) openmpi/4.1.0-gcc-9.1.0-2cmze2s 
 +</code> 
 + 
 +and is equivalent to loading the module as: 
 + 
 +<code> 
 +module load openmpi/4.1.0-gcc-9.1.0-2cmze2s 
 +</code> 
 + 
 + 
 +Alternatively a package can be loaded by using the unique hash of a package. 
 +The option ''-l'' will display the short hash of a package: 
 + 
 +<code> 
 +# spack find -l openmpi@4.1.0%gcc@9.1.0 
 +==> 1 installed package 
 +-- linux-centos7-x86_64 / gcc@9.1.0 ----------------------------- 
 +2cmze2s openmpi@4.1.0 
 +</code> 
 + 
 +The hash ''2cmze2s'' uniquely identifies the package and can also be used to load the software module: 
 + 
 + 
 +<code> 
 +spack load /2cmze2s 
 +</code> 
 + 
 +Unload all currently loaded packages: 
 +<code> 
 +spack unload --all 
 +</code> 
  • doku/spack.txt
  • Last modified: 2023/05/17 15:26
  • by msiegel