diff --git a/EM/cisTEM/cisTEM_preallocate b/EM/cisTEM/cisTEM_preallocate new file mode 100755 index 0000000..6803350 --- /dev/null +++ b/EM/cisTEM/cisTEM_preallocate @@ -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[@]}" "$@" + diff --git a/EM/cisTEM/preallocated.sh b/EM/cisTEM/preallocated.sh new file mode 100755 index 0000000..7fb4023 --- /dev/null +++ b/EM/cisTEM/preallocated.sh @@ -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 $@