-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathperegrine_job.sh
44 lines (35 loc) · 1.04 KB
/
peregrine_job.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
#!/bin/bash
#SBATCH --job-name=polyInfect
#SBATCH --output=./slurm_log/%j.log
#SBATCH --time=01-00:00:00
#SBATCH --partition=regular
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=1
#SBATCH --mem=4GB
#SBATCH --mail-type=END,FAIL
#SBATCH --mail-user=t.s.n.mai@student.rug.nl
# Check if arguments are given
if [ "$#" -eq "0" ]; then
echo "ERROR: No arguments supplied. Please provide parameter file name and log file name...";
exit 1;
fi
if [ -z "$1" ]; then
echo "ERROR: argument 1 is an empty string. Please provide parameter file name...";
exit 2;
fi
if [ -z "$2" ]; then
echo "ERROR: argument 2 is an empty string. Please provide log file name...";
exit 2;
fi
# Parse arguments
param_file=$1
log_file=$2
shift 2
options=$@
# Write JobID
echo -e $SLURM_JOB_ID"\t"$param_file"\t"$log_file >> ./jobs.tsv
# Add job to job-queue
RUN_SCRIPT="/home/s4278836/polyInfect/run_experiment.py"
python $RUN_SCRIPT -f $param_file $options > $log_file 2>&1
# echo $PWD $param_file $log_file $options > $log_file 2>&1 # this is just for testing the script