annotate bin/runme_c.sh @ 184:53a8ffe06460

use csing, and _runme_c.sh to get it initialised
author Henry S. Thompson <ht@inf.ed.ac.uk>
date Fri, 08 Sep 2023 21:44:48 +0100
parents
children acae526510e2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
184
53a8ffe06460 use csing, and _runme_c.sh to get it initialised
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
1 #!/usr/bin/bash
53a8ffe06460 use csing, and _runme_c.sh to get it initialised
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
2 # Invoke this as e.g. sbatch --ntasks=10 -c 20 runme.sh [-m first last] [args for work/bin/_runme.sh]
53a8ffe06460 use csing, and _runme_c.sh to get it initialised
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
3 # It will run on the login node
53a8ffe06460 use csing, and _runme_c.sh to get it initialised
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
4 # -m i j will launch _runme.sh multiple times with a -a in {first..last}
53a8ffe06460 use csing, and _runme_c.sh to get it initialised
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
5
53a8ffe06460 use csing, and _runme_c.sh to get it initialised
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
6 #SBATCH --time=01:00:00
53a8ffe06460 use csing, and _runme_c.sh to get it initialised
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
7 #SBATCH --partition=standard
53a8ffe06460 use csing, and _runme_c.sh to get it initialised
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
8 #SBATCH --qos=standard
53a8ffe06460 use csing, and _runme_c.sh to get it initialised
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
9 #SBATCH --account=ec184-hst
53a8ffe06460 use csing, and _runme_c.sh to get it initialised
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
10 #SBATCH --job-name runme
53a8ffe06460 use csing, and _runme_c.sh to get it initialised
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
11
53a8ffe06460 use csing, and _runme_c.sh to get it initialised
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
12 export W=/work/dc007/dc007
53a8ffe06460 use csing, and _runme_c.sh to get it initialised
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
13
53a8ffe06460 use csing, and _runme_c.sh to get it initialised
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
14 if [ "$1" = "-m" ]
53a8ffe06460 use csing, and _runme_c.sh to get it initialised
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
15 then
53a8ffe06460 use csing, and _runme_c.sh to get it initialised
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
16 ss={$2..$3}
53a8ffe06460 use csing, and _runme_c.sh to get it initialised
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
17 shift; shift; shift;
53a8ffe06460 use csing, and _runme_c.sh to get it initialised
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
18 echo $(date) Launching $SLURM_JOB_NUM_NODES nodes in $(pwd) for runme_c -a $ss "$@" from $(hostname) to do $SLURM_NTASKS tasks, $SLURM_CPUS_PER_TASK cpus each 1>&2
53a8ffe06460 use csing, and _runme_c.sh to get it initialised
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
19 for i in $(eval echo $ss)
53a8ffe06460 use csing, and _runme_c.sh to get it initialised
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
20 do
53a8ffe06460 use csing, and _runme_c.sh to get it initialised
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
21 srun --unbuffered -c $SLURM_CPUS_PER_TASK $W/shared/bin/csing $W/hst/bin/_runme_c.sh -a $i "$@"
53a8ffe06460 use csing, and _runme_c.sh to get it initialised
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
22 echo $(date) Finished $i
53a8ffe06460 use csing, and _runme_c.sh to get it initialised
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
23 done
53a8ffe06460 use csing, and _runme_c.sh to get it initialised
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
24 else
53a8ffe06460 use csing, and _runme_c.sh to get it initialised
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
25 echo $(date) Launching $SLURM_JOB_NUM_NODES nodes in $(pwd) for runme_c "$@" from $(hostname) to do $SLURM_NTASKS tasks, $SLURM_CPUS_PER_TASK cpus each 1>&2
53a8ffe06460 use csing, and _runme_c.sh to get it initialised
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
26
53a8ffe06460 use csing, and _runme_c.sh to get it initialised
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
27 srun --unbuffered -c $SLURM_CPUS_PER_TASK $W/shared/bin/csing $W/hst/bin/_runme_c.sh "$@"
53a8ffe06460 use csing, and _runme_c.sh to get it initialised
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
28 echo $(date) Finished
53a8ffe06460 use csing, and _runme_c.sh to get it initialised
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
29 fi