Skip to content

Commit 5c7197c

Browse files
author
Thomas
committed
Use sc_venv_template for tests on JUWELS
1 parent ed741a6 commit 5c7197c

File tree

8 files changed

+77
-27
lines changed

8 files changed

+77
-27
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/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/activate.sh
9066
script:
9167
- bash etc/check_node_avail.sh || PARTITION_AVAIL=$?
9268
- if [ -n "$PARTITION_AVAIL" ] ; then exit $PARTITION_AVAIL ; fi

etc/venv_juwels/activate.sh

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/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/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/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
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 cluster partition of the Juelich wizard for European leadership in science (JUWELS).

etc/venv_juwels/requirements.txt

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/setup.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
FFTW_LIBRARY_DIR="/p/software/juwels/stages/2025/software/FFTW/3.3.10-GCC-13.3.0/lib64/" python3 -m pip install git+https://github.com/brownbaerchen/mpi4py-fft.git@cupy_implementation
18+
19+
python3 -m pip install -r "${ABSOLUTE_PATH}"/requirements.txt
20+
21+
python3 -m pip install -e "${ABSOLUTE_PATH}"/../../
22+

pySDC/tests/test_helpers/test_spectral_helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ def test_tau_method(bc, N, bc_val, kind='Dirichlet', useGPU=False):
519519

520520
sol_poly = np.polynomial.Chebyshev(sol_hat)
521521
d_sol_poly = sol_poly.deriv(1)
522-
x = xp.linspace(-1, 1, 100)
522+
x = np.linspace(-1, 1, 100)
523523

524524
if kind == 'integral':
525525
integral = sol_poly.integ(1, lbnd=-1)

0 commit comments

Comments
 (0)