From 1764ed63ff765e147c5d3bf75ac65190f03a1b36 Mon Sep 17 00:00:00 2001 From: paugier Date: Wed, 4 Sep 2024 15:06:16 +0200 Subject: [PATCH] examples/clusters/adastra --- doc/examples/clusters/adastra/README.md | 84 +++++++++++++++++++++ doc/examples/clusters/adastra/setup_venv.sh | 32 ++++++++ doc/install-clusters.md | 1 + 3 files changed, 117 insertions(+) create mode 100644 doc/examples/clusters/adastra/README.md create mode 100644 doc/examples/clusters/adastra/setup_venv.sh diff --git a/doc/examples/clusters/adastra/README.md b/doc/examples/clusters/adastra/README.md new file mode 100644 index 00000000..a7787b15 --- /dev/null +++ b/doc/examples/clusters/adastra/README.md @@ -0,0 +1,84 @@ +# Using Fluidsim on Adastra (CINES) + +We show in this directory +() +how to use Fluidsim on Adastra. The main documentation for this HPC platform is +[here](https://dci.dci-gitlab.cines.fr/webextranet/index.html). +We use modules produced by [Spack](https://spack.io/). + +## Get a login and setup ssh + +Get an account on . + +Set the alias + +```sh +alias sshadastra='ssh -X augier@adastra.cines.fr' +``` + +## Setup Mercurial and clone fluidsim + +Install and setup Mercurial as explained +[here](https://fluidhowto.readthedocs.io/en/latest/mercurial/install-setup.html). Clone +the Fluidsim repository in `$HOME/dev`. + +```{warning} +The file `.bashrc` is not sourced at login so the user should to it is use pipx install applications. +``` + +```sh +mkdir ~/dev +cd ~/dev +. ~/.bashrc +hg clone https://foss.heptapod.net/fluiddyn/fluidsim +cd ~/dev/fluidsim/doc/examples/clusters/adastra + +``` + +## Setup a virtual environment + +Execute the script `setup_venv.sh`. + +```sh +./setup_venv.sh +``` + +```{literalinclude} ./setup_venv.sh +``` + +Due to a bug in Meson (the build system used by few fluidfft pluggins, see +https://github.com/mesonbuild/meson/pull/13619), we need to complete the installation: + +```sh +module purge +module load cpe/23.12 +module load craype-x86-genoa +module load PrgEnv-gnu +module load gcc/13.2.0 +module load cray-hdf5-parallel cray-fftw +module load cray-python + +. ~/venv-fluidsim/bin/activate + +# --no-build-isolation because of the Meson bug + +# because of --no-build-isolation +cd ~/dev +hg clone https://github.com/paugier/meson.git +cd meson +hg up mpi-detection +pip install -e . +cd +pip install ninja fluidfft-builder +# + +pip install fluidfft-fftwmpi --no-binary fluidfft-fftwmpi --no-build-isolation --force-reinstall --no-cache-dir --no-deps -v +``` + +## Install Fluidsim from source + +```sh +cd ~/dev/fluidsim +# update to the wanted commit +pip install . -v -C setup-args=-Dnative=true +``` diff --git a/doc/examples/clusters/adastra/setup_venv.sh b/doc/examples/clusters/adastra/setup_venv.sh new file mode 100644 index 00000000..f8a1bd70 --- /dev/null +++ b/doc/examples/clusters/adastra/setup_venv.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash +set -e + +module purge +module load cpe/23.12 +module load craype-x86-genoa +module load PrgEnv-gnu +module load gcc/13.2.0 +module load cray-hdf5-parallel cray-fftw +module load cray-python + +cd $HOME +python -m venv venv-fluidsim +. ~/venv-fluidsim/bin/activate + +# install fluidsim and all dependencies from wheels! +pip install "fluidsim[fft,test]" + +# fix/improve few packages (force recompilation) +pip install fluidfft --no-binary fluidfft -C setup-args=-Dnative=true --force-reinstall --no-cache-dir --no-deps -v + +CC=mpicc pip install mpi4py --no-binary mpi4py --force-reinstall --no-cache-dir --no-deps -v +CC="mpicc" HDF5_MPI="ON" pip install --no-binary=h5py h5py --force-reinstall --no-cache-dir --no-deps -v + +export LIBRARY_PATH=/opt/cray/pe/fftw/3.3.10.6/x86_genoa/lib +export CFLAGS="-I/opt/cray/pe/fftw/3.3.10.6/x86_genoa/include" +export PYFFTW_LIB_DIR="/opt/cray/pe/fftw/3.3.10.6/x86_genoa/lib" + +pip install pyfftw --no-binary pyfftw --force-reinstall --no-cache-dir --no-deps -v + +# install fluidfft pluggins +pip install fluidfft-fftw --no-binary fluidfft-fftw --force-reinstall --no-cache-dir --no-deps -v diff --git a/doc/install-clusters.md b/doc/install-clusters.md index 35746b8d..39df1f2a 100644 --- a/doc/install-clusters.md +++ b/doc/install-clusters.md @@ -33,4 +33,5 @@ caption: Examples maxdepth: 1 --- ./examples/clusters/gricad/README.md +./examples/clusters/adastra/README.md ```