Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2026-10-15 08:17:26

0001 #!/bin/bash
0002 # Submit corral over a chunked production as a SLURM job array (one task per job list).
0003 #   Usage: ./run_m_array.bash <set> [array-range]
0004 #     <set>          dataset = list folder under lists/, made by lists/make_lists.bash (e.g. ana532)
0005 #     [array-range]  optional, e.g. 0-3 or 7 (default: all lists, 0..nlists-1)
0006 #   CORRAL_VARIANT=<name> CORRAL_RS=<runstring> ./run_m_array.bash <set> ...   a VARIANT of the set (README_SplitTracks573, Final state):
0007 #     the same lists, run with -s <runstring>, outputs under <set>_<name>/ (lists/<set>_<name> is made as a symlink to
0008 #     lists/<set>, so Finalize runs unchanged with -d <set>_<name>). e.g. CORRAL_VARIANT=raw CORRAL_RS=noLS_noulstest_... ./run_m_array.bash ana573_795xx
0009 #     (not VAR/RS: the login profile already sets RS=/rs/rs_grp_rhi)
0010 # Snapshots the current corral to log/<out>/chunks/corral.snapshot so every task runs the same binary.
0011 # Outputs (<out> = <set>, or <set>_<CORRAL_VARIANT>): root/<out>/chunks/corral_NN.root, pdf/<out>/chunks/corral_NN.pdf,
0012 #   log/<out>/chunks/corral_NN.log
0013 # project directory = $CORRAL_DIR if set, else the directory this script lives in (passed on to the tasks)
0014 PROJDIR=${CORRAL_DIR:-$(cd "$(dirname "$(readlink -f "$0")")" && pwd)}
0015 export CORRAL_DIR=$PROJDIR
0016 SET=$1
0017 if [ -z "$SET" ] || [ ! -f $PROJDIR/lists/$SET/manifest.txt ]; then
0018         echo "usage: $0 <set> [array-range]   (no lists/$SET/manifest.txt -- run lists/make_lists.bash first)"; exit 1
0019 fi
0020 NL=$(awk '$1=="nlists"{print $2}' $PROJDIR/lists/$SET/manifest.txt)
0021 RANGE=${2:-0-$((NL-1))}
0022 OUT=$SET
0023 VAR=$CORRAL_VARIANT
0024 CRS=$CORRAL_RS
0025 if [ -n "$CRS" ] && [ -z "$VAR" ]; then echo "CORRAL_RS='$CRS' needs a CORRAL_VARIANT=<name> (outputs go to <set>_<name>/)"; exit 1; fi
0026 if [ -n "$VAR" ]; then
0027         [ -z "$CRS" ] && echo "variant $VAR: the code defaults (no run string), e.g. a new code version next to the old outputs"
0028         OUT=${SET}_$VAR
0029         [ -e $PROJDIR/lists/$OUT ] || ln -s $SET $PROJDIR/lists/$OUT
0030 fi
0031 mkdir -p $PROJDIR/root/$OUT/chunks $PROJDIR/pdf/$OUT/chunks $PROJDIR/log/$OUT/chunks
0032 cp -v $PROJDIR/corral $PROJDIR/log/$OUT/chunks/corral.snapshot
0033 echo "set $SET -> $OUT: $NL lists, run string '${CRS}', submitting array $RANGE"
0034 #---- keep off the hax* and rpr* nodes (user, 2026-09-28: hax18 stalled reading /rs); EXCLUDE="..." replaces the
0035 #---- list (sbatch --exclude syntax), EXCLUDE= (empty) allows every node
0036 EXCLUDE=${EXCLUDE-hax[1-18],rpr[1-24]}
0037 sbatch --partition=prip --time=2-23:59:59 ${EXCLUDE:+--exclude=$EXCLUDE} \
0038         --array=$RANGE \
0039         --job-name=crm_$OUT \
0040         --output=$PROJDIR/log/$OUT/chunks/corral_%2a.log \
0041         --error=$PROJDIR/log/$OUT/chunks/corral_%2a.log \
0042         --mem=8G \
0043         --export=ALL \
0044         $PROJDIR/run_m_array.slurm $SET $OUT $CRS