-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathslurm_util.sh
33 lines (29 loc) · 958 Bytes
/
slurm_util.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
get_slurm_header()
{
if [ $# -lt 9 ]; then
echo "#not enough arguments in ${FUNCNAME}.";
return -1;
fi
partition=$1
workdir=$2
time=$3
nodes=$4
ntasks=$5
mem=$6
job_name=$7
out_fn=$8
err_fn=$9
cmd_header="#"'!'"/bin/sh"
cmd_header="$cmd_header\n#SBATCH --partition=${partition}"
cmd_header="$cmd_header\n#SBATCH --workdir=${workdir}"
cmd_header="$cmd_header\n#SBATCH --time=${time}"
cmd_header="$cmd_header\n#SBATCH --nodes=${nodes}"
cmd_header="$cmd_header\n#SBATCH --ntasks=${ntasks}"
cmd_header="$cmd_header\n#SBATCH --mem=${mem}"
cmd_header="$cmd_header\n#SBATCH --job-name=${job_name}"
cmd_header="$cmd_header\n#SBATCH --output=${out_fn}"
cmd_header="$cmd_header\n#SBATCH --error=${err_fn}"
cmd_header="$cmd_header\n"
echo $cmd_header
return 0
}