Skip to content

Commit ca8b6f7

Browse files
author
Thomas
committed
Added venv for juwels cluster
1 parent a333eff commit ca8b6f7

File tree

10 files changed

+84
-3
lines changed

10 files changed

+84
-3
lines changed

.gitlab-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ prepare_JUWELS:
2828
script:
2929
- mkdir -p benchmarks
3030
- jutil env activate -p ${JUWELS_PROJECT}
31-
- source ./etc/venv_juwels_booster/setup.sh
31+
- source ./etc/venv_juwels/setup.sh
3232

3333

3434
test_JUWELS:
@@ -62,7 +62,7 @@ test_JUWELS:
6262
before_script:
6363
- mkdir -p benchmarks
6464
- jutil env activate -p ${JUWELS_PROJECT}
65-
- source ./etc/venv_juwels_booster/activate.sh
65+
- source ./etc/venv_juwels/activate.sh
6666
script:
6767
- bash etc/check_node_avail.sh || PARTITION_AVAIL=$?
6868
- if [ -n "$PARTITION_AVAIL" ] ; then exit $PARTITION_AVAIL ; fi

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,7 @@
22
path = /p/project1/ccstma/baumann7/pySDC/etc/venv_juwels_booster/mpi4py-fft
33
url = https://github.com/brownbaerchen/mpi4py-fft.git
44
branch = cupy_implementation
5+
[submodule "/p/project1/ccstma/baumann7/pySDC/etc/venv_juwels/mpi4py-fft"]
6+
path = /p/project1/ccstma/baumann7/pySDC/etc/venv_juwels/mpi4py-fft
7+
url = https://github.com/brownbaerchen/mpi4py-fft.git
8+
branch = cupy_implementation

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/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/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: 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/juwels/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+

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)