-
Notifications
You must be signed in to change notification settings - Fork 0
/
launch_rolling_generator.sh
35 lines (27 loc) · 1.03 KB
/
launch_rolling_generator.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
#SBATCH --time=01:00:00
#SBATCH --nodes=1
#SBATCH --constraint=icelake
#SBATCH --ntasks=1
module purge; module load bluebear
module load bear-apps/2022a
module load Python/3.10.4-GCCcore-11.3.0
module load SciPy-bundle/2022.05-foss-2022a
module load sympy/1.11.1-foss-2022a
module load natsort/8.2.0-foss-2022a
export VENV_DIR="${HOME}/virtual-environments"
export VENV_PATH="${VENV_DIR}/my-virtual-env-${BB_CPU}"
# Create a master venv directory if necessary
mkdir -p ${VENV_DIR}
# Check if virtual environment exists and create it if not
if [[ ! -d ${VENV_PATH} ]]; then
python -m venv --system-site-packages ${VENV_PATH}
fi
# Activate the virtual environment
source ${VENV_PATH}/bin/activate
# Perform any required pip installations. For reasons of consistency we would recommend
# that you define the version of the Python module – this will also ensure that if the
# module is already installed in the virtual environment it won't be modified.
pip install gmsh
# Execute your Python scripts
python rolling_generator.py