2. Requests from our HPC users
• “Give me root password to install XXX.”
• “Why can’t I run apt-get install on CentOS?”
• “Why are there so many export PATH in ~/.bashrc?”
• ”Pleas install pkg1...pkgN for me so I can install XXX.”
• “I need the latest version of XXX.”
3. Why SJTU Pi Supercomputer chooses Spack?
• Installation in $HOME requires NO root privilege.
• Distro invariant. Same syntax works for CentOS/Ubuntu/SUSE...
• Modules are loaded only when needed. NO more export in
~/.bashrc.
• Dependency packages are built automatically.
• An active community to update packages to the latest version ASAP.
Spack is easy to setup and depends on GCC and glibc only!
4. What does Spack do on SJTU Pi Supercomputer?
• Install a minimal set of HPC system software (compilers, binary
libraries...) for global use.
• Build per-user or per-group software when requested.
• Maintain software environments for various hardware
platforms (SandyBridge, Haswell, SGI, PowerPC...).
6. Pre-built Modules on Pi
https://pi.sjtu.edu.cn/doc/modules
• A8 9 1 A A 8 A 9 D 8
– 8 CA 8 2 C7
– G
– ..4 1 , 3 C 00 8 7 8
$ unset MODULEPATH
$ module use /lustre/usr/modulefiles
$ module list
9. R Extensions
https://pi.sjtu.edu.cn/doc/r
• . .
$ spack install r+external-lapack %gcc@5.4.0
^openblas threads=openmp
$ source <( spack module loads –dependencies r )
$ which R
$ R
> source("https://bioconductor.org/biocLite.R")
> biocLite
10. LLNL-PRES-806064
5http://github.com/LLNL/spack
§ Not much standardization in HPC: every machine/app has a different software stack
— This is done to get the best performance
§ HPC frequently trades reuse and usability for performance
— Reusing a piece of software frequently requires you to port it to many new platforms
§ Example environment for some LLNL codes:
HPC Software Complexity Prevents Reuse & Reduces Productivity
48 third party packages 3 MPI versions
mvapich mvapich2 OpenMPI
x 3-ish Platforms
Linux BlueGene Cray
x
Up to 7 compilers
Intel GCC XLC Clang
PGI Cray Pathscale
x Oh, and 2-3 versions of
each package
x = ~7,500 combinations
Spack lowers barriers to software reuse by automating these builds!
12. LLNL-PRES-806064
22http://github.com/LLNL/spack
§ Each expression is a spec for a particular configuration
— Each clause adds a constraint to the spec
— Constraints are optional – specify only what you need.
— Customize install on the command line!
§ Spec syntax is recursive
— Full control over the combinatorial build space
Spack provides a spec syntax to describe customized DAG
configurations
$ spack install mpileaks unconstrained
$ spack install mpileaks@3.3 @ custom version
$ spack install mpileaks@3.3 %gcc@4.7.3 % custom compiler
$ spack install mpileaks@3.3 %gcc@4.7.3 +threads +/- build option
$ spack install mpileaks@3.3 cppflags=”-O3” setting compiler flags
$ spack install mpileaks@3.3 os=CNL10 target=haswell setting target for X-compile
$ spack install mpileaks@3.3 ^mpich@3.2 %gcc@4.9.3 ^ dependency information
15. LLNL-PRES-806064
34http://github.com/LLNL/spack
§ Each unique dependency graph is a unique
configuration.
§ Each configuration installed in a unique directory.
— Configurations of the same package can coexist.
§ Hash of entire directed acyclic graph (DAG) is
appended to each prefix.
§ Installed packages automatically find dependencies
— Spack embeds RPATHs in binaries.
— No need to use modules or set LD_LIBRARY_PATH
— Things work the way you built them
Spack handles combinatorial software complexity.
spack/opt/
linux-x86_64/
gcc-4.7.2/
mpileaks-1.1-
0f54bf34cadk/
intel-14.1/
hdf5-1.8.15-lkf14aq3nqiz/
bgq/
xl-12.1/
hdf5-1-8.16-fqb3a15abrwx/
...
mpileaks
mpi
callpath
dyninst
libdwarf
libelf
Installation Layout
Dependency DAG
Hash
16. LLNL-PRES-806064
53http://github.com/LLNL/spack
§ Purpose of module files
— modify dynamically user’s env
— manage multiple versions of
same library / application
— minimal user interface
§ State of the art
— different file formats
— different layouts
— different tools
§ Spack support for module files
— TCL / Non-hierarchical layout
— Lua / Hierarchical layout
TCL
Non-hierarchical
Lua
Hierarchical
Generator name tcl lmod
Default folder share/spack/modules share/spack/lmod
Compatible tools
Env. modules
LMod
LMod
What are module files?
18. Extra settings in your SLURM job scripts
if [ -d "$HOME/spack" ]; then
export SPACK_ROOT=$HOME/spack
source $SPACK_ROOT/share/spack/setup-
env.sh
fi
source <( spack module loads xxx )
19. DEMO 1: Install Spack
https://pi.sjtu.edu.cn/doc/spack
$ cd
$ git clone https://github.com/sjtuhpcc/spack.git
$ cd spack && git pull origin develop
$ ./bootstrap.sh user --install
Add settings to ~/.bashrc
if [ -d ”$HOME/spack” ]; then
export SPACK_ROOT=$HOME/spack
source $SPACK_ROOT/share/spack/setup-env.sh
fi
Apply settings.
$ source ~/.bashrc
26. Summary
• Spack requires NO root privilege and is easy to setup.
• Site-wide compilers and per-user software repos are mostly
managed by Spack, beneficial for both administrators and users.
• We acknowledge Spack community for such a wonderful tool and
tutorial slides.
https://spack.io