-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathOptimised_APM.sh
52 lines (40 loc) · 1.46 KB
/
Optimised_APM.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
# Name.
#PBS -N optAPM
# Project.
#PBS -P q97
# Queue.
#PBS -q normal
# CPUs.
#
# Ideally the number of seed models (eg, 400) divided by this number
# should be an integer (eg, 400 / 100 = 4).
# This is because each MPI process gets allocated a fixed number of seed models.
# If it's not an integer multiple then some processes get allocated an extra seed
# (which can cause the other processes to idle while waiting).
# For example, if 400 seed models are distributed across 96 cpus then 16 cpus (= 400 % 96)
# are allocated 5 seed models (= (400 // 96) + 1) and 80 cpus are allocated only 4 seed models.
#PBS -l ncpus=96
# Total memory.
#PBS -l mem=190GB
# Time limit.
#PBS -l walltime=6:00:00
# Working directory (set to where job was submitted).
#PBS -l wd
#
# Set up the environment.
#
# Use the system MPI implementation (not conda's MPI).
module load openmpi
# Initialise the shell for conda environments to avoid the error:
# "CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'."
source ~/.bashrc
# Activate the "optAPM" conda environment in our home Miniconda installation.
conda activate optAPM
#
# Run the job.
#
# Note: It seems "LD_PRELOAD=libmpi.so" is needed to prevent the error:
# "[LOG_CAT_ML] component basesmuma is not available but requested in hierarchy".
# See https://www.mail-archive.com/[email protected]/msg35048.html
mpirun -x LD_PRELOAD=libmpi.so -np $PBS_NCPUS python Optimised_APM.py