diff --git a/README.md b/README.md index 0356c6b..b5e2a4c 100644 --- a/README.md +++ b/README.md @@ -1,72 +1,76 @@ -WIP - # The PSI Spack Deployment ## How to use on Merlin7 +### Install your own software ```bash -source /afs/psi.ch/sys/spack-rhel7/spack/share/spack/setup-env.sh # can be also include in your .bashrc +# Check if your package is already in Spack +user@login001:~> spack list $pkg_name # e.g opal -spack env list -spack env activate -d # e.g ffbidx all for whole software stack +# Check the package variants you want to set e.g +cuda +openmp ^openmpi ... +user@login001:~> spack info $pkg_name # e.g opal -# Install env if local development, else skip -spack install # -v for verbose +# Check the whole dependency tree of your spec and +# if you don't need to set more variants +user@login001:~> spack spec $pkg_name@version +variant1 ^dep1@version ... -spack load +# e.g spack spec opal@2022.1%gcc@7.5.0 +mithra ~python ^openmpi@4.1.6 ^openblas + +# Install your package +user@login001:~> spack install $pkg_name@version +variant1 ^dep1@version1 + +# Load your package +user@login001:~> spack load $pkg_name@version +variant1 ^dep1@version1 + +# Submit your script +user@login001:~> sbatch batch.script ``` -## How to use on Merlin6 +### Develop your own software +```bash +# Check if your package is already in Spack +user@login001:~> spack list $pkg_name # e.g opal + +# Check the package variants you want to set e.g +cuda +openmp ^openmpi ... +user@login001:~> spack info $pkg_name # e.g opal + +# Create your own env and load it +user@login001:~> spack env activate --create -p myenv + +# Add the spec you want to build to your environement +user@login001:~> spack add $pkg_name@version +variant1 ^dep1@version ... + +# e.g spack add opal@master%gcc@7.5.0 +mithra ~python ^openmpi@4.1.6 ^openblas + +# Tell Spack you want to develop locally under +# /afs/psi.ch/sys/spack.x86_64_cos3.0/user/$USER/spack-environment/$pkg_name +user@login001:~> spack develop $pkg_name@version + +# Install the package locally +user@login001:~> spack install # first time, then you can just use make directly + +# Load your package +user@login001:~> spack load $pkg_name@version +variant1 ^dep1@version1 + +# Submit your script +user@login001:~> sbatch batch.script + +``` + +## How to use on other systems + +### Install Spack ```bash -source /afs/psi.ch/sys/spack-rhel7/spack/share/spack/setup-env.sh # can be also include in your .bashrc +user@supersystem:~> cd /scratch/$USER -spack env list -spack env activate -d # e.g ffbidx all for whole software stack +user@supersystem:~> git clone -c feature.manyFiles=true https://github.com/spack/spack.git -# Install env if local development, else skip -spack install # -v for verbose - -spack load - -# The OPAL Spack recipe - -[Official Spack documentation](https://spack.readthedocs.io/en/latest/) - -## Install Spack - -```bash -cd /scratch/$USER -git clone -c feature.manyFiles=true https://github.com/spack/spack.git -. spack/share/spack/setup-env.sh +user@supersystem:~> . spack/share/spack/setup-env.sh # Add PSI specific recipes -cd OPAL/spack -spack repo add . -``` +user@supersystem:~> git clone https://gitlab.psi.ch/lsm-hpce/alps/spack-psi.git -## Install OPAL@version +user@supersystem:~> spack repo add $PWD/spack-psi -```bash -spack info opal # Find out which version and which variants you want to set - -# Install env if local development, else skip -spack install opal@2022.1.0 # -v for verbose -j 8 for 8 parallel jobs - -# Load environment before launching any scripts -spack load opal - -sbatch ... -``` - -## Develop OPAL - -```bash -spack env activate -d OPAL/spack/env/opal/ - -# $OPAL_SRC_DIRECTORY is where you did the git clone git@gitlab.psi.ch:OPAL/src.git -spack develop -p $OPAL_SRC_DIRECTORY opal@master - -spack install # -v for verbose -j 8 for 8 parallel jobs - -``` +user@supersystem:~> spack install $pkg_name # -v for verbose