Skip to content

Spack

Spack is a package management tool designed to support multiple versions and configurations of software. You can use centrally installed software and /or install your software of choice on maxwell cluster via Spack.

You can acces spack command on maxwell cluster using

  source  /software/spack/activate_spack.sh

Some usefull spack commands

spack compilers      # List installed compilers 
spack list           # List packages available to install 
spack list  intel    # List packages that have  the word "intel"  in it
spack info <pkg>     # Get detailed information on a particular package
spack find           # List installed packages
spack load <pkg>     # Load a package to use
spack install <pkg>  # Install your software of choice
spack help           # More informations about Spack’s options

Spack with slurm

Example mpi code with slurm job script mpi_example.sh

#!/bin/bash -l                                        # Login shell
#SBATCH --job-name=mpi_test                           # Name your job, optional
#SBATCH --output mpi_test_%J.out                      # Name your output, optional
#SBATCH --error  mpi_test_%J.err                      # Name your error, optional
#SBATCH --nodes=2                                     # Request two nodes,
#SBATCH --ntasks=8                                    # 8 processors,
#SBATCH --time=00:10:00                               # for 10 minutes
#SBATCH --partition=hpcgwgpu                          # Choose partition: hpcgwgpu, allcpu, allgpu, maxcpu, maxgpu,... 

source  /software/spack/activate_spack.sh             # Make "spack" command available

spack load intel-oneapi-mpi@2021.16.0                 # Load MPI: Intel, OpenMPI, mvapich, mpich... 
mpif90 /software/spack/examples/mpi_sendreceive.f90   # compile your mpi code
mpirun ./a.out                                        # Run your executable 

Submit it to slurm via

   sbatch mpi_example.sh

See the error (if any) with

   cat mpi_test_*.err

See the ressult with

   cat mpi_test_*.out

See Tutorial section on Maxwell documentation for more example usages and further information of spack on Maxwell.