Skip to content

Commit a333eff

Browse files
author
Thomas
committed
Changed to sc_venv_template for tests on juwels
1 parent ed741a6 commit a333eff

File tree

9 files changed

+83
-26
lines changed

9 files changed

+83
-26
lines changed

.gitlab-ci.yml

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -27,24 +27,8 @@ prepare_JUWELS:
2727
- shell
2828
script:
2929
- mkdir -p benchmarks
30-
- module --force purge
31-
- module load Stages/2024
32-
- module load GCC
33-
- module load OpenMPI
34-
- module load FFTW
35-
- module load mpi4py
36-
- module load SciPy-Stack
37-
- module load CuPy
3830
- jutil env activate -p ${JUWELS_PROJECT}
39-
- python -m venv --clear $SCRATCH/.venv/pySDC
40-
- source $SCRATCH/.venv/pySDC/bin/activate
41-
- pip install -e .
42-
- pip install pytest-benchmark coverage
43-
- git submodule add -f https://github.com/brownbaerchen/mpi4py-fft.git
44-
- cd mpi4py-fft
45-
- git checkout cupy_implementation
46-
- FFTW_LIBRARY_DIR="/p/software/juwels/stages/2024/software/FFTW/3.3.10-GCC-12.3.0/lib64" pip install --force-reinstall .
47-
- cd ../
31+
- source ./etc/venv_juwels_booster/setup.sh
4832

4933

5034
test_JUWELS:
@@ -77,16 +61,8 @@ test_JUWELS:
7761
- sbatch.out
7862
before_script:
7963
- mkdir -p benchmarks
80-
- module --force purge
81-
- module load Stages/2024
82-
- module load GCC
83-
- module load OpenMPI
84-
- module load FFTW
85-
- module load mpi4py
86-
- module load SciPy-Stack
87-
- module load CuPy
8864
- jutil env activate -p ${JUWELS_PROJECT}
89-
- source $SCRATCH/.venv/pySDC/bin/activate
65+
- source ./etc/venv_juwels_booster/activate.sh
9066
script:
9167
- bash etc/check_node_avail.sh || PARTITION_AVAIL=$?
9268
- if [ -n "$PARTITION_AVAIL" ] ; then exit $PARTITION_AVAIL ; fi

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[submodule "/p/project1/ccstma/baumann7/pySDC/etc/venv_juwels_booster/mpi4py-fft"]
2+
path = /p/project1/ccstma/baumann7/pySDC/etc/venv_juwels_booster/mpi4py-fft
3+
url = https://github.com/brownbaerchen/mpi4py-fft.git
4+
branch = cupy_implementation
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
# See https://stackoverflow.com/a/28336473
4+
SOURCE_PATH="${BASH_SOURCE[0]:-${(%):-%x}}"
5+
6+
RELATIVE_PATH="$(dirname "$SOURCE_PATH")"
7+
ABSOLUTE_PATH="$(realpath "${RELATIVE_PATH}")"
8+
9+
[[ "$0" != "${SOURCE_PATH}" ]] && echo "The activation script must be sourced, otherwise the virtual environment will not work." || ( echo "Vars script must be sourced." && exit 1) ;
10+
11+
source "${ABSOLUTE_PATH}"/config.sh
12+
source "${ABSOLUTE_PATH}"/modules.sh
13+
14+
export PYTHONPATH="$(echo "${ENV_DIR}"/lib/python*/site-packages):${PYTHONPATH}"
15+
16+
source "${ENV_DIR}"/bin/activate

etc/venv_juwels_booster/config.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
SOURCE_PATH="${BASH_SOURCE[0]:-${(%):-%x}}"
2+
3+
## Check if this script is sourced
4+
[[ "$0" != "${SOURCE_PATH}" ]] && echo "Setting vars" || ( echo "Vars script must be sourced." && exit 1) ;
5+
## Determine location of this file
6+
RELATIVE_PATH="$(dirname "$SOURCE_PATH")"
7+
ABSOLUTE_PATH="$(realpath "${RELATIVE_PATH}")"
8+
####################################
9+
10+
### User Configuration
11+
export ENV_NAME="$(basename "$ABSOLUTE_PATH")" # Default Name of the venv is the directory that contains this file
12+
export ENV_DIR="${ABSOLUTE_PATH}"/venv # Default location of this VENV is "./venv"

etc/venv_juwels_booster/modules.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
module --force purge
2+
module load Stages/2025
3+
module load GCC/13.3.0
4+
module load ParaStationMPI
5+
module load NCCL
6+
module load MPI-settings/CUDA
7+
module load UCX-settings/RC-CUDA
8+
module load Python
9+
module load CuPy
10+
module load FFTW
11+
module load mpi4py
12+
module load SciPy-Stack

etc/venv_juwels_booster/mpi4py-fft

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit a7aeec6ace99dd49561625c866c605ed0b337c18

etc/venv_juwels_booster/readme.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Python venv for Juwels Booster
2+
==============================
3+
4+
This is a version of the [JSC venv template](https://gitlab.jsc.fz-juelich.de/kesselheim1/sc_venv_template/-/tree/master) adapted to the booster partition of the Juelich wizard for European leadership in science (JUWELS).
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Add here the pip packages you would like to install on this virtual environment / kernel
2+
numpy>=2.0
3+
matplotlib>=3.0
4+
dill>=0.2.6
5+
scipy>=1.14
6+
qmat
7+
pytest-benchmark
8+
coverage

etc/venv_juwels_booster/setup.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
3+
SOURCE_PATH="${BASH_SOURCE[0]:-${(%):-%x}}"
4+
5+
RELATIVE_PATH="$(dirname "$SOURCE_PATH")"
6+
ABSOLUTE_PATH="$(realpath "${RELATIVE_PATH}")"
7+
8+
source "${ABSOLUTE_PATH}"/config.sh
9+
source "${ABSOLUTE_PATH}"/modules.sh
10+
11+
python3 -m venv --prompt "$ENV_NAME" --system-site-packages "${ENV_DIR}"
12+
python3 -m pip install --upgrade pip
13+
14+
source "${ABSOLUTE_PATH}"/activate.sh
15+
16+
17+
git submodule add -b cupy_implementation -f https://github.com/brownbaerchen/mpi4py-fft.git "${ABSOLUTE_PATH}"/mpi4py-fft
18+
FFTW_LIBRARY_DIR="/p/software/juwelsbooster/stages/2025/software/FFTW/3.3.10-GCC-13.3.0/lib64/" python3 -m pip install -e "${ABSOLUTE_PATH}"/mpi4py-fft
19+
20+
21+
python3 -m pip install -r "${ABSOLUTE_PATH}"/requirements.txt
22+
23+
python3 -m pip install -e "${ABSOLUTE_PATH}"/../../
24+

0 commit comments

Comments
 (0)