-
Notifications
You must be signed in to change notification settings - Fork 160
CX1 is Imperial's entry-level HPC cluster. These are the instructions for building and running Firedrake on CX1.
module load anaconda3/personal
module load bison
module load flex
module load cmake/3.7.0
module load gcc/9.3.0
module load mpi
export PETSC_CONFIGURE_OPTIONS=--download-fblaslapack
curl -O https://raw.githubusercontent.com/firedrakeproject/firedrake/master/scripts/firedrake-install
python firedrake-install --no-package-manager
At the moment, although the build script finishes successfully, firedrake fails to import after activating the environment because it cannot import vtk. This is because the binary wheel for vtk installed by pip is linked against a much newer version of libc than what is available on cx1. You therefore have to rebuild this package locally (see section below). Note that further modules may also be required, see Troubleshooting below.
The following is a sample pbs script running the Helmholtz demo. Don't forget to run make in the firedrake/src/firedrake/demos
directory before submitting. Note, that we don't load the anaconda3 module as it puts libraries in our path that conflict with our firedrake build.
#!/bin/bash
# Job name
#PBS -N helmholtz_demo
# Time required in hh:mm:ss
#PBS -l walltime=00:02:00
# Resource requirements
#PBS -l select=1:ncpus=4:mpiprocs=4:ompthreads=1:mem=15999Mb
# Files to contain standard error and standard output
#PBS -o stdout
#PBS -e stderr
# Mail notification
#PBS -m ae
#PBS -M [email protected]
echo Working Directory is $PBS_O_WORKDIR
cd $PBS_O_WORKDIR
rm -f stdout* stderr*
module load gcc/9.3.0
module load mpi
# Change the next line to wherever you put your firedrake/ installation
source $HOME/firedrake/bin/activate
# Start time
echo Start time is `date` > date
mpiexec python $VIRTUAL_ENV/src/firedrake/demos/helmholtz/helmholtz.py
# End time
echo End time is `date` >> date
After build script finishes, activate the environment
source firedrake/bin/activate
try to import vtk using
python -c "import vtk"
At the moment this fails complaining about the GLIBC version. To fix this rebuild vtk using the following steps. Ensure that you still have the same modules loaded as recommended above for building firedrake
# checkout the vtk source and the right version tag
git clone https://gitlab.kitware.com/vtk/vtk.git
cd vtk
git checkout tags/v9.0.1 -b v9.0.1
# install some build dependencies (easiest to just install in the new firedrake environment)
pip install scikit-build
pip install ninja
# make a directory to build in
mkdir build
cd build
# and configure and build (this may take more than 5 hours!)
cmake -GNinja -DVTK_WHEEL_BUILD=ON -DVTK_PYTHON_VERSION=3 -DVTK_WRAP_PYTHON=ON ../
ninja
python setup.py bdist_wheel
The last step should have created a .whl python binary package in dist/, which you can install with (make sure the firedrake environment is activated!):
pip install --upgrade dist/vtk-9.0.1-cp39-cp39-linux_x86_64.whl
- An unsuccessful installation may be due to the default modules on cx1. E.g. to resolve an error of form
-- Configuring incomplete, errors occurred!CMake Error at CMakeLists.txt:16 (CMAKE_MINIMUM_REQUIRED):
CMake 3.1 or higher is required. You are running version 2.8.12.2
add module load cmake/3.1.3
to the modules to be loaded when building firedrake.
- If an error of type
PETSC ERROR: Caught signal number 4 Illegal instruction: Likely due to memory corruption
occurs, this can be resolved by activating the virtual environment and running firedrake-clean
.
- If you get an error
[Errno 13] Permission denied.
byshutil.copytree
you can runmodule load fix_setxattr
and run the installation again.
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