Mercurial > hg > cc > cirrus_home
changeset 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 | efaa10c1e9ea |
children | acae526510e2 |
files | bin/runme_c.sh |
diffstat | 1 files changed, 29 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bin/runme_c.sh Fri Sep 08 21:44:48 2023 +0100 @@ -0,0 +1,29 @@ +#!/usr/bin/bash +# Invoke this as e.g. sbatch --ntasks=10 -c 20 runme.sh [-m first last] [args for work/bin/_runme.sh] +# It will run on the login node +# -m i j will launch _runme.sh multiple times with a -a in {first..last} + +#SBATCH --time=01:00:00 +#SBATCH --partition=standard +#SBATCH --qos=standard +#SBATCH --account=ec184-hst +#SBATCH --job-name runme + +export W=/work/dc007/dc007 + +if [ "$1" = "-m" ] +then + ss={$2..$3} + shift; shift; shift; + 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 + for i in $(eval echo $ss) + do + srun --unbuffered -c $SLURM_CPUS_PER_TASK $W/shared/bin/csing $W/hst/bin/_runme_c.sh -a $i "$@" + echo $(date) Finished $i + done +else + 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 + + srun --unbuffered -c $SLURM_CPUS_PER_TASK $W/shared/bin/csing $W/hst/bin/_runme_c.sh "$@" + echo $(date) Finished +fi