Mercurial > hg > cc > cirrus_home
annotate bin/runme_c.sh @ 185:acae526510e2
too many overdue updates to break down
author | Henry S. Thompson <ht@inf.ed.ac.uk> |
---|---|
date | Wed, 06 Dec 2023 13:38:58 +0000 |
parents | 53a8ffe06460 |
children |
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 |
185
acae526510e2
too many overdue updates to break down
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
184
diff
changeset
|
2 # Invoke this as e.g. sbatch --ntasks=10 -c 20 runme.sh [-m ( '{...}' | first last)] [args for work/bin/_runme.sh] |
184
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 |
185
acae526510e2
too many overdue updates to break down
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
184
diff
changeset
|
4 # -m i j will launch _runme.sh multiple times with a -a in {...} or {first..last} |
184
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 |
185
acae526510e2
too many overdue updates to break down
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
184
diff
changeset
|
16 shift |
acae526510e2
too many overdue updates to break down
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
184
diff
changeset
|
17 if [[ "$1" == {*} ]] |
acae526510e2
too many overdue updates to break down
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
184
diff
changeset
|
18 then |
acae526510e2
too many overdue updates to break down
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
184
diff
changeset
|
19 ss="$1" |
acae526510e2
too many overdue updates to break down
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
184
diff
changeset
|
20 shift |
acae526510e2
too many overdue updates to break down
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
184
diff
changeset
|
21 else |
acae526510e2
too many overdue updates to break down
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
184
diff
changeset
|
22 ss={$1..$2} |
acae526510e2
too many overdue updates to break down
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
184
diff
changeset
|
23 shift; shift |
acae526510e2
too many overdue updates to break down
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
184
diff
changeset
|
24 fi |
184
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 -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
|
26 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
|
27 do |
53a8ffe06460
use csing, and _runme_c.sh to get it initialised
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
28 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
|
29 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
|
30 done |
53a8ffe06460
use csing, and _runme_c.sh to get it initialised
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
31 else |
53a8ffe06460
use csing, and _runme_c.sh to get it initialised
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
32 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
|
33 |
53a8ffe06460
use csing, and _runme_c.sh to get it initialised
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff
changeset
|
34 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
|
35 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
|
36 fi |