-
Notifications
You must be signed in to change notification settings - Fork 0
/
paper_packing_launch.sh
34 lines (26 loc) · 1.01 KB
/
paper_packing_launch.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
#!/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 SciPy-bundle/2022.05-foss-2022a
module load pyvista/0.36.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 konigcell
# Execute your Python scripts
mpiexec -n 1 python -u paper_packing_method.py