-
Notifications
You must be signed in to change notification settings - Fork 160
Isambard
The Isambard 2 service was retired on 30th September 2024. These notes are only for reference.
We have only tried installing on the XCI (ARM/ThunderX2/TX2) system, not the MACS, A64FX or Phase3 portions of the machine.
You should familiarise yourself with as much of Spack's functionality as possible. To achieve the same flexibility as we have on desktop installs the Firedrake Spack install leverages a lot of Spack's features. More information about Spack can be found on their website.
- The following clones the Spack repo, loads modules to setup the environment and activates Spack.
git clone -c feature.manyFiles=true [email protected]:spack/spack.git
module purge
module load Base-opts
module load PrgEnv-gnu
module load pmi-lib
module load cray-python/3.8.5.1
module load cray-mpich
. spack/share/spack/setup-env.sh
- Populate
$SPACK_USER_CONFIG_PATH/cray/compilers.yaml
with
$SPACK_USER_CONFIG_PATH/cray/compilers.yaml
compilers:
- compiler:
spec: [email protected]
paths:
cc: cc
cxx: CC
f77: ftn
fc: ftn
flags: {}
operating_system: cnl7
target: any
modules:
- PrgEnv-cray
- cce/11.0.4
environment: {}
extra_rpaths: []
- compiler:
spec: [email protected]
paths:
cc: cc
cxx: CC
f77: ftn
fc: ftn
flags: {}
operating_system: cnl7
target: any
modules:
- PrgEnv-gnu
- gcc/9.3.0
environment: {}
extra_rpaths: []
- Populate
$SPACK_USER_CONFIG_PATH/packages.yaml
with
$SPACK_USER_CONFIG_PATH/packages.yaml
packages:
all:
providers:
mpi: [cray-mpich]
pkg-config:
externals:
- spec: [email protected]
prefix: /usr
buildable: False
pkgconf:
externals:
- spec: [email protected]
prefix: /usr
buildable: False
cray-mpich:
externals:
- spec: [email protected]%[email protected]
modules:
- PrgEnv-gnu
- gcc/9.3.0
- cray-mpich/7.7.17
- spec: [email protected]%[email protected]
modules:
- PrgEnv-cray
- cce/11.0.4
- cray-mpich/7.7.17
buildable: False
cray-libsci:
externals:
- spec: [email protected]
modules:
- cray-libsci/20.09.1
- spec: [email protected]
modules:
- cray-libsci/19.06.1
buildable: False
python:
externals:
- spec: [email protected]
modules:
- cray-python/3.8.5.1
- spec: [email protected]
modules:
- cray-python/3.7.3.2
buildable: False
- Esure
$SPACK_USER_CONFIG_PATH/upstreams.yaml
does not exist. Upstream (system level installed Spack packages) for Isambard cause the Cray tools (compiler wrappers) to break.
-
Clone the repo:
git clone https://github.com/firedrakeproject/firedrake-spack.git # or git clone [email protected]:firedrakeproject/firedrake-spack.git
-
Add the repository to spack
spack repo add <repo directory>
-
Create an spack environment
spack env create -d ./firedrake
-
Activate that environment
spack env activate -p ./firedrake
-
To avoid a bunch of errors add a whole bunch of packages to the development package list:
spack develop py-firedrake@develop spack develop libsupermesh@develop spack develop petsc@develop spack develop chaco@petsc spack develop py-fiat@develop spack develop py-finat@develop spack develop py-islpy@develop spack develop py-petsc4py@develop spack develop py-pyadjoint@develop spack develop py-pyop2@develop spack develop py-coffee@develop spack develop py-loopy@develop spack develop py-cgen@develop spack develop py-codepy@develop spack develop py-genpy@develop spack develop py-tsfc@develop spack develop py-ufl@develop
-
Add Firedrake:
spack add py-firedrake@develop \ %[email protected] \ ^[email protected] \ ^[email protected]%[email protected] \ ^[email protected] \ ^firedrake.petsc@develop+fftw cflags=\"-O3 -march=native -mtune=native\" cxxflags=\"-O3 -march=native -mtune=native\" fflags=\"-O3 -march=native -mtune=native -ffree-line-length-512\"
-
Add to
$SPACK_ENV/spack.yaml
:spack: packages: all: compiler: [[email protected]] providers: mpi: [cray-mpich] blas: [cray-libsci] lapack: [cray-libsci] scalapack: [cray-libsci] netlib-scalapack: externals: # Pretend cray-libsci is netlib-scalapack - spec: [email protected] modules: - cray-libsci/20.09.1 buildable: False
-
Concretize (and log)
spack concretize -f 2>&1 | tee $SPACK_ENV/conc.log
- Splitting the concretize and install steps into 2 distinct parts allows you to review what is being installed before the lengthy installation process begins.
-
Install (and log)
spack install --fail-fast 2>&1 | tee $SPACK_ENV/spack-firedrake-install.log
Testing must be run on a compute node. An interactive session can be started using
qsub -I -q arm-dev -l walltime=00:10:00
Alternatively submit a jobscript, see additional notes.
- Test you can import Firedrake by running
aprun -n 1 python -c "from firedrake import *"
. You must run viaaprun
to make sure the MPI modules are found.- If this fails, before trying anything else, deactivate the environment with
spack env deactivate
and reactivate withspack env activate -p ./firedrake
(as above) and try runningpython -c "from firedrake import *"
again. This appears to be a shortcoming of spack.
- If this fails, before trying anything else, deactivate the environment with
- Run the basic functionality tests. Before running you will need to set a few pyop2 variables:
Run the tests with:
unset PYOP2_LD export PYOP2_CC=`which cc` export PYOP2_CXX=`which CC` export PYOP2_CFLAGS="-I${CRAY_MPICH_DIR}/include/" export PYOP2_LDFLAGS='-shared'
cd $SPACK_ENV/py-firedrake pytest tests/regression/ -m "not parallel" -k "poisson_strong or stokes_mini or dg_advection"
- When running the environment on the compute nodes the variable
$HOME
needs to be set to something like/work/_projectcode_/_projectcode_/_username_
or/tmp
as many dependencies expect to find configuration in$HOME
. - We don't run parallel tests due to an issue with the current parallel pytest hook, this is in the process of being fixed.
- When running the environment on the compute nodes the variable
- Run the full test suite:
cd $SPACK_ENV/src/firedrake pytest tests -m "not parallel"
This page is based off installation notes available here.
Other potential problems you may run into:
- At the
spack install
step, Spack may complain about a missing dependencygnuconfig
for thelibffi
package. It will tell you to adddepends_on('gnuconfig', type='build', when='@3.4.2')
to the package definition (exact version may not be3.4.2
). You can edit the package file withspack edit libffi
. This opens the package file located inspack/var/spack/repos/builtin/packages/libffi/package.py
with $EDITOR. You can see how to add dependencies from the example in the Spack documentation. - This guide assumes you are using your own Spack installation. After running
. spack/share/spack/setup-env.sh
you can check you are using the correct Spack installation withwhich spack
.
Isambard maintains an installation of Spack, but it is not up to date and does not contain many of the fixes required to install Firedrake. Documentation is available on the Isambard spack docs page.
Building locally
Tips
- Running Firedrake tests with different subpackage branches
- Modifying and Rebuilding PETSc and petsc4py
- Vectorisation
- Debugging C kernels with
lldb
on MacOS - Parallel MPI Debugging with
tmux-mpi
,pdb
andgdb
- Parallel MPI Debugging with VSCode and
debugpy
- Modifying generated code
- Kernel profiling with LIKWID
- breakpoint() builtin not working
- Debugging pytest with multiple processing
Developers Notes
- Upcoming meeting 2024-08-21
- 2024-08-07
- 2024-07-24
- 2024-07-17
- 2024-07-10
- 2024-06-26
- 2024-06-19
- 2024-06-05
- 2024-05-29
- 2024-05-15
- 2024-05-08
- 2024-05-01
- 2024-04-28
- 2024-04-17
- 2024-04-10
- 2024-04-03
- 2024-03-27
- 2024-03-20
- 2024-03-06
- 2024-02-28
- 2024-02-28
- 2024-02-21
- 2024-02-14
- 2024-02-07
- 2024-01-31
- 2024-01-24
- 2024-01-17
- 2024-01-10
- 2023-12-13
- 2023-12-06
- 2023-11-29
- 2023-11-22
- 2023-11-15
- 2023-11-08
- 2023-11-01
- 2023-10-25
- 2023-10-18
- 2023-10-11
- 2023-10-04
- 2023-09-27
- 2023-09-20
- 2023-09-06
- 2023-08-30
- 2023-08-23
- 2023-07-12
- 2023-07-05
- 2023-06-21
- 2023-06-14
- 2023-06-07
- 2023-05-17
- 2023-05-10
- 2023-03-08
- 2023-02-22
- 2023-02-15
- 2023-02-08
- 2023-01-18
- 2023-01-11
- 2023-12-14
- 2022-12-07
- 2022-11-23
- 2022-11-16
- 2022-11-09
- 2022-11-02
- 2022-10-26
- 2022-10-12
- 2022-10-05
- 2022-09-28
- 2022-09-21
- 2022-09-14
- 2022-09-07
- 2022-08-25
- 2022-08-11
- 2022-08-04
- 2022-07-28
- 2022-07-21
- 2022-07-07
- 2022-06-30
- 2022-06-23
- 2022-06-16
- 2022-05-26
- 2022-05-19
- 2022-05-12
- 2022-05-05
- 2022-04-21
- 2022-04-07
- 2022-03-17
- 2022-03-03
- 2022-02-24
- 2022-02-10
- 2022-02-03
- 2022-01-27
- 2022-01-20
- 2022-01-13
- 2021-12-15
- 2021-12-09
- 2021-11-25
- 2021-11-18
- 2021-11-11
- 2021-11-04
- 2021-10-28
- 2021-10-21
- 2021-10-14
- 2021-10-07
- 2021-09-30
- 2021-09-23
- 2021-09-09
- 2021-09-02
- 2021-08-26
- 2021-08-18
- 2021-08-11
- 2021-08-04
- 2021-07-28
- 2021-07-21
- 2021-07-14
- 2021-07-07
- 2021-06-30
- 2021-06-23
- 2021-06-16
- 2021-06-09
- 2021-06-02
- 2021-05-19
- 2021-05-12
- 2021-05-05
- 2021-04-28
- 2021-04-21
- 2021-04-14
- 2021-04-07
- 2021-03-17
- 2021-03-10
- 2021-02-24
- 2021-02-17
- 2021-02-10
- 2021-02-03
- 2021-01-27
- 2021-01-20
- 2021-01-13
- 2021-01-06