Adding preallocated scripts

This commit is contained in:
2020-12-11 15:28:02 +01:00
parent 451d3db6f4
commit 51436c8166
2 changed files with 31 additions and 0 deletions

22
EM/cisTEM/cisTEM_preallocate Executable file
View File

@@ -0,0 +1,22 @@
#!/bin/bash
# Launch script for running cisTEM with the 'preallocated_44cpu' profile
# Default arguments
args=()
if [[ ! "${@}" =~ -t|--time ]]; then
args+=(--time=08:00:00)
fi
if [[ ! "${@}" =~ -p|--partition ]]; then
args+=(--partition=daily)
fi
if [[ ! "${@}" =~ -n|--ntasks ]]; then
# Take number of tasks from the script name
DEFAULT_TASKS="$(echo "$0"|sed -rn 's/.*[^0-9]([0-9]+$)/\1/p')"
args+=(--ntasks="${DEFAULT_TASKS:-44}")
fi
if [[ ! "${@}" =~ -c|--cpus-per-task ]]; then
args+=(--cpus-per-task=2)
fi
exec interactive "${args[@]}" "$@"

9
EM/cisTEM/preallocated.sh Executable file
View File

@@ -0,0 +1,9 @@
#!/bin/bash
# Wrapper for the 'preallocated' default profiles
# usage in cistem profile: preallocated.sh $command
set -e
# Ensure we actually allocated resources
: "${SLURM_NODELIST:?Error: No nodes preallocated! See https://intranet.psi.ch/BIO/ComputingCisTEM}"
srun -N 1 -n 1 -c 2 --exclusive $@