Skip to content

Commit

Permalink
Apptainer: pfft & p3dfft
Browse files Browse the repository at this point in the history
  • Loading branch information
paugier committed Jun 17, 2024
1 parent dcf97cf commit 4c72438
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 3 deletions.
15 changes: 13 additions & 2 deletions doc/apptainer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ apptainer build image-fluidsim.sif image-fluidsim.def

## Run the image to install Fluidsim from source

From the host:
From the host (a node of the cluster!):

```sh
cd ~/apptainer
Expand All @@ -25,5 +25,16 @@ apptainer shell --no-home image-fluidsim.sif
From the container:

```sh
...
python -m venv venv-fluidsim
. venv-fluidsim/bin/activate
HDF5_MPI="ON" pip install --no-binary=h5py h5py pytest pytest-mpi
python -c 'import h5py; h5py.run_tests()'
hg clone https://foss.heptapod.net/fluiddyn/fluidsim
cd fluidsim/
pip install ".[test,mpi,fft]"
pytest --pyargs fluidsim
pip install fluidfft-fftw fluidfft-fftwmpi fluidfft-mpi_with_fftw
mpirun -np 2 pytest --pyargs fluidsim
pip install fluidfft-p3dfft
pip install fluidfft-pfft
```
25 changes: 24 additions & 1 deletion doc/apptainer/image-fluidsim.def
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,16 @@ From: python:3.11
apt-get -y install mercurial git less meld nano

apt-get install -y --no-install-recommends \
libfftw3-dev libfftw3-mpi-dev openmpi-bin libhdf5-openmpi-dev libopenblas-dev
libfftw3-dev libfftw3-mpi-dev openmpi-bin libhdf5-openmpi-dev libopenblas-dev \
gfortran

mkdir -p /root/.local/include
mkdir -p /root/.local/lib
export PATH=/root/.local/bin:$PATH
export CPATH=/root/.local/include
export LIBRARY_PATH=/root/.local/lib
export LD_LIBRARY_PATH=/root/.local/lib

python -m pip install pipx

pipx install mercurial
Expand All @@ -19,12 +26,28 @@ From: python:3.11

wget https://foss.heptapod.net/fluiddyn/fluidsim/-/raw/topic/default/apptainer/doc/apptainer/hgrc -O ~/hgrc

ln -s /usr/include/fftw* /root/.local/include
ln -s /usr/lib/x86_64-linux-gnu/libfftw3* /root/.local/lib

wget https://foss.heptapod.net/fluiddyn/fluidfft/raw/branch/default/doc/install/install_p3dfft.sh -O ./install_p3dfft.sh
chmod +x install_p3dfft.sh
export FCFLAGS="-w -fallow-argument-mismatch -O2"
export FFLAGS="-w -fallow-argument-mismatch -O2"
./install_p3dfft.sh

wget https://foss.heptapod.net/fluiddyn/fluidfft/raw/branch/default/doc/install/install_pfft.sh -O ./install_pfft.sh
chmod +x install_pfft.sh
./install_pfft.sh

%startscript
mkdir -p home

%environment
export LC_ALL=C
export PATH=/root/.local/bin:$PATH
export CPATH=/root/.local/include
export LIBRARY_PATH=/root/.local/lib
export LD_LIBRARY_PATH=/root/.local/lib
export HOME=$HOME/apptainer/home
export HGRCPATH=/root/hgrc

Expand Down

0 comments on commit 4c72438

Please sign in to comment.