comparison 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
comparison
equal deleted inserted replaced
184:53a8ffe06460 185:acae526510e2
1 #!/usr/bin/bash 1 #!/usr/bin/bash
2 # Invoke this as e.g. sbatch --ntasks=10 -c 20 runme.sh [-m first last] [args for work/bin/_runme.sh] 2 # Invoke this as e.g. sbatch --ntasks=10 -c 20 runme.sh [-m ( '{...}' | first last)] [args for work/bin/_runme.sh]
3 # It will run on the login node 3 # It will run on the login node
4 # -m i j will launch _runme.sh multiple times with a -a in {first..last} 4 # -m i j will launch _runme.sh multiple times with a -a in {...} or {first..last}
5 5
6 #SBATCH --time=01:00:00 6 #SBATCH --time=01:00:00
7 #SBATCH --partition=standard 7 #SBATCH --partition=standard
8 #SBATCH --qos=standard 8 #SBATCH --qos=standard
9 #SBATCH --account=ec184-hst 9 #SBATCH --account=ec184-hst
11 11
12 export W=/work/dc007/dc007 12 export W=/work/dc007/dc007
13 13
14 if [ "$1" = "-m" ] 14 if [ "$1" = "-m" ]
15 then 15 then
16 ss={$2..$3} 16 shift
17 shift; shift; shift; 17 if [[ "$1" == {*} ]]
18 then
19 ss="$1"
20 shift
21 else
22 ss={$1..$2}
23 shift; shift
24 fi
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 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
19 for i in $(eval echo $ss) 26 for i in $(eval echo $ss)
20 do 27 do
21 srun --unbuffered -c $SLURM_CPUS_PER_TASK $W/shared/bin/csing $W/hst/bin/_runme_c.sh -a $i "$@" 28 srun --unbuffered -c $SLURM_CPUS_PER_TASK $W/shared/bin/csing $W/hst/bin/_runme_c.sh -a $i "$@"
22 echo $(date) Finished $i 29 echo $(date) Finished $i