Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 #!/bin/bash
0002 # One array task = one job list: lists/<set>/list_NN.txt, NN = SLURM_ARRAY_TASK_ID (2 digits).
0003 # Submitted by run_m_array.bash (which snapshots the binary and makes the output folders).
0004 # Outputs: root/<set>/chunks/corral_NN.root, pdf/<set>/chunks/corral_NN.pdf; the log is
0005 # log/<set>/chunks/corral_NN.log.
0006 #   $1 = set (dataset = the list folder, e.g. ana532); $2 = output set (= $1, or <set>_<variant>); $3 = run string (optional)
0007 SET=$1
0008 OUT=${2:-$1}
0009 CRS=$3
0010 # CORRAL_DIR is exported by run_m_array.bash (sbatch runs a spooled copy of this script, so it cannot
0011 # find the project directory from its own location)
0012 export PROJDIR=${CORRAL_DIR:?"CORRAL_DIR not set -- submit with run_m_array.bash"}
0013 NN=$(printf "%02d" ${SLURM_ARRAY_TASK_ID})
0014 LIST=$PROJDIR/lists/$SET/list_$NN.txt
0015 BIN=$PROJDIR/log/$OUT/chunks/corral.snapshot
0016 NAME=corral_$NN
0017 echo "hostname  = "$HOSTNAME
0018 echo "set       = "$SET"   -> "$OUT"   run string '"$CRS"'"
0019 echo "task      = "$NN"   (array job "$SLURM_ARRAY_JOB_ID")"
0020 echo "list      = "$LIST"   ("$(wc -l < $LIST)" files)"
0021 echo "binary    = "$BIN
0022 WORK=$TMPDIR/corral_${SLURM_ARRAY_JOB_ID}_$NN
0023 mkdir -p $WORK/root $WORK/pdf
0024 cd $WORK || exit 1
0025 pwd
0026 cp -v $BIN ./corral
0027 echo Starting..........................
0028 time ./corral -n 0 -l $LIST -o $NAME ${CRS:+-s $CRS}
0029 cp -v ./root/$NAME.root $PROJDIR/root/$OUT/chunks/
0030 cp -v ./pdf/$NAME.pdf   $PROJDIR/pdf/$OUT/chunks/
0031 cd $TMPDIR
0032 rm -rf $WORK
0033 exit