# HG changeset patch # User Henry S. Thompson # Date 1689935867 -3600 # Node ID 235004978b22457fb3e3b561b2542bf7b6a154ca # Parent b8d4a5ede7a38ab89ebc6095287e173fd1506bff add support for multiple calls to srun with a counter diff -r b8d4a5ede7a3 -r 235004978b22 bin/_runme.sh --- a/bin/_runme.sh Thu Jul 20 10:32:55 2023 +0100 +++ b/bin/_runme.sh Fri Jul 21 11:37:47 2023 +0100 @@ -1,6 +1,6 @@ #!/bin/bash # This runs on the compute nodes... -# Args: wd [-d] [-t nthreads] [-b CMDS] [-i input] CMDS +# Args: [-a i] wd [-d] [-t nthreads] [-b CMDS] [-i input] CMDS # See ug4/azure/notes.txt for documentation N=$SLURM_JOB_NUM_NODES @@ -11,6 +11,15 @@ node=$SLURM_NODEID task=$SLURM_PROCID +if [ "$1" = "-a" ] +then + shift + xarg="$1" + shift +else + xarg= +fi + cd "$1" shift @@ -34,7 +43,7 @@ echo $(date) task $n.$task on $nodename:$N.$node start $pjobs jobs 1>&2 PATH=$W/$USER/bin:$W/shared/bin:$PATH -export task PATH n +export task PATH n xarg if [ "$1" = "-b" ] then @@ -43,6 +52,8 @@ shift fi +input="seq 1 $pjobs" # default to make sure something runs + if [ "$1" = "-i" ] then shift @@ -59,7 +70,7 @@ doit () { arg="$1" - echo $(date) start $task $PARALLEL_SEQ "|$cmd|$arg|" + echo $(date) start $task $PARALLEL_SEQ "|$cmd|$xarg|$arg|" eval "$cmd" echo $(date) end $task $PARALLEL_SEQ }