-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathslurm-run-select.sh
More file actions
32 lines (27 loc) · 1007 Bytes
/
slurm-run-select.sh
File metadata and controls
32 lines (27 loc) · 1007 Bytes
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
#!/bin/zsh
#SBATCH --job-name="SELECT"
#SBATCH --cpus-per-task 2
#SBATCH --mem=20G
#SBATCH -t 12:00:00
#SBATCH -A naumann
#SBATCH -p magic
#SBATCH --constraint=ARCH:X86
#source ~/.zshrc
set -o pipefail # trace exit code of failed piped commands
trim() {
local var="$*"
# remove leading whitespace characters
var="${var#"${var%%[![:space:]]*}"}"
# remove trailing whitespace characters
var="${var%"${var##*[![:space:]]}"}"
printf '%s' "$var"
}
echo "Processing Job ${SLURM_JOB_NAME}"
logfile="results-select/${SLURM_JOBID}-screen.log"
mkdir -p "results-select"
/hpi/fs00/home/sebastian.schmidl/opt/miniconda3/envs/autotsad/bin/python -m autotsad baselines select --results-path "results-select" "$@" 2>&1 | tee -a "${logfile}"
# copy logfile to results-folder
result_path=$(head -n 20 "${logfile}" | grep -e "RESULT directory" | cut -d '=' -f 2)
result_path=$(trim "${result_path}")
cp "${logfile}" "${result_path}/screen.log"
echo "$(hostname)" > "${result_path}/hostname.txt"