Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 #!/bin/bash
0002 #SBATCH -N 1
0003 #SBATCH -t 2-23:59:59
0004 
0005 #       called by slurm by run_m.bash
0006 
0007 SET=$1
0008 NEV=$2
0009 OUT=${3:-$1}            # output set: the dataset, or <dataset>_<variant> (run_m.bash CORRAL_VARIANT=)
0010 CRS=$4                  # run string of the variant (empty = the code defaults)
0011 echo "hostname  = "$HOSTNAME
0012 echo "dataset   = "$SET
0013 echo "nev       = "$NEV
0014 echo "output    = "$OUT"   run string '"$CRS"'"
0015 
0016 # CORRAL_DIR is exported by run_m.bash (sbatch runs a spooled copy of this script)
0017 export PROJDIR=${CORRAL_DIR:?"CORRAL_DIR not set -- submit with run_m.bash"}/
0018 echo "TMPDIR        = "$TMPDIR
0019 echo "PROJDIR       = "$PROJDIR
0020 export JOBSCR=$TMPDIR
0021 
0022 pwd 
0023 export JOBNUMA=`echo ${SLURM_JOBID} | awk -F. '{print $NR"\n"}'`
0024 # echo "JOBNUMA = "$JOBNUMA
0025 k=${#JOBNUMA} 
0026 echo "Digits in JOBNUMA = "$k
0027 if [ $k -lt 3 ]; then
0028         export JOBNUM=000000$JOBNUMA
0029 elif [ $k -lt 4 ]; then
0030         export JOBNUM=00000$JOBNUMA
0031 elif [ $k -lt 5 ]; then
0032         export JOBNUM=0000$JOBNUMA
0033 elif [ $k -lt 6 ]; then
0034         export JOBNUM=000$JOBNUMA
0035 elif [ $k -lt 7 ]; then
0036         export JOBNUM=00$JOBNUMA
0037 elif [ $k -lt 8 ]; then
0038         export JOBNUM=0$JOBNUMA
0039 elif [ $k -lt 9 ]; then
0040         export JOBNUM=$JOBNUMA
0041 fi
0042 # echo "JOBID     = "$SLURM_JOBID
0043 echo "JOBNUM    = "$JOBNUM
0044 # export JOBID=`echo $JOBNUM`
0045 
0046 cd $JOBSCR
0047 pwd
0048 mkdir corral_${JOBNUM}
0049 cd corral_${JOBNUM}
0050 pwd
0051 cp -v $PROJDIR/log/$OUT/corral.snapshot ./corral                # the binary run_m.bash snapshotted
0052 mkdir root
0053 mkdir pdf
0054 ls -lasF
0055 
0056 export rsd=`xxd -l 3 -ps -c 10 /dev/urandom` 
0057 export rsdn=`printf "%i" 0x$rsd` 
0058 echo "rsdn      = "$rsdn
0059 
0060 #--------------------------------------
0061 echo Starting..........................
0062 # No run string: the code defaults are the validated best effort; a variant adds its own (-s), output name stays corral
0063 time ./corral -n $NEV -l $PROJDIR/lists/$SET/list_all.txt -o corral ${CRS:+-s $CRS}
0064 cp -v ./root/corral.root $PROJDIR/root/$OUT/
0065 cp -v ./pdf/corral.pdf   $PROJDIR/pdf/$OUT/
0066 #--------------------------------------
0067 
0068 cd $JOBSCR
0069 rm -rf corral_${JOBNUM}
0070 
0071 exit
0072 
0073 
0074 
0075 
0076