Workflow 9384, Stage 1
| Priority | 50 | 
| Processors | 1 | 
| Wall seconds | 80000 | 
| Image | /cvmfs/singularity.opensciencegrid.org/fermilab/fnal-wn-sl7:latest | 
| RSS bytes | 9437184000 (9000 MiB) | 
| Max distance for inputs | 30.0 | 
| Enabled input RSEs | 
CERN_PDUNE_EOS, DUNE_CA_SFU, DUNE_CERN_EOS, DUNE_ES_PIC, DUNE_FR_CCIN2P3_DISK, DUNE_IN_TIFR, DUNE_IT_INFN_CNAF, DUNE_UK_GLASGOW, DUNE_UK_LANCASTER_CEPH, DUNE_UK_MANCHESTER_CEPH, DUNE_US_BNL_SDCC, DUNE_US_FNAL_DISK_STAGE, FNAL_DCACHE, FNAL_DCACHE_STAGING, FNAL_DCACHE_TEST, MONTECARLO, NIKHEF, PRAGUE, QMUL, RAL-PP, RAL_ECHO, SURFSARA, T3_US_NERSC | 
| Enabled output RSEs | 
CERN_PDUNE_EOS, DUNE_CA_SFU, DUNE_CERN_EOS, DUNE_ES_PIC, DUNE_FR_CCIN2P3_DISK, DUNE_IN_TIFR, DUNE_IT_INFN_CNAF, DUNE_UK_GLASGOW, DUNE_UK_LANCASTER_CEPH, DUNE_UK_MANCHESTER_CEPH, DUNE_US_BNL_SDCC, DUNE_US_FNAL_DISK_STAGE, FNAL_DCACHE, FNAL_DCACHE_STAGING, FNAL_DCACHE_TEST, NIKHEF, PRAGUE, QMUL, RAL-PP, RAL_ECHO, SURFSARA, T3_US_NERSC | 
| Enabled sites | 
BR_CBPF, CA_SFU, CERN, CH_UNIBE-LHEP, CZ_FZU, ES_CIEMAT, ES_PIC, FR_CCIN2P3, IT_CNAF, NL_NIKHEF, NL_SURFsara, UK_Bristol, UK_Brunel, UK_Durham, UK_Edinburgh, UK_Lancaster, UK_Liverpool, UK_Manchester, UK_Oxford, UK_QMUL, UK_RAL-PPD, UK_RAL-Tier1, UK_Sheffield, US_Colorado, US_FNAL-FermiGrid, US_FNAL-T1, US_Michigan, US_PuertoRico, US_SU-ITS, US_Swan, US_UChicago, US_UConn-HPC, US_UCSD, US_Wisconsin | 
| Scope | usertests | 
| Events for this stage | 
Output patterns
|   | Destination | Pattern | Lifetime | For next stage | RSE expression | 
|---|
| 1 | Rucio usertests:mwrobel_mc-5_S3_wirefilt-fnal-w9384s1p1 | *_detsim_reco1.root | 2592000 | False |  | 
Environment variables
| Name | Value | 
|---|
| extra_fcl_path | /cvmfs/fifeuser2.opensciencegrid.org/sw/dune/8e4abe10da4dfc1fa6dc3a9800848b867f7dbf65 | 
| momentum | 5 | 
| reco_fcl | wirefilter_reco_protodunehd_MC.fcl | 
| stage | DetsimReco | 
File states
| Total files | Finding | Unallocated | Allocated | Outputting | Processed | Not found | Failed | 
|---|
|
| 180 | 0 | 0 | 0 | 0 | 180 | 0 | 0 | 
Job states
| Total | Submitted | Started | Processing | Outputting | Finished | Notused | Aborted | Stalled | Jobscript error | Outputting failed | None processed | 
|---|
| 278 | 0 | 0 | 0 | 0 | 272 | 0 | 0 | 4 | 0 | 2 | 0 | 
 
 
RSEs used
| Name | Inputs | Outputs | 
|---|
| DUNE_US_FNAL_DISK_STAGE | 169 | 120 | 
| DUNE_US_BNL_SDCC | 16 | 60 | 
Stats of processed input files as CSV or JSON, and of uploaded output files as CSV or JSON (up to 10000 files included)
File reset events, by site
| Site | Allocated | Outputting | 
|---|
| US_FNAL-FermiGrid | 4 | 0 | 
| US_UChicago | 0 | 1 | 
Jobscript
#!/bin/sh
#
# Example jobscript that runs lar for all the files
# referred to by the MQL expression given on the justin command line.
#
# Submit with something like this:
#
# ./justin simple-workflow \
#  --max-distance 30 \
#  --mql "rucio-dataset protodune-sp:np04_raw_run_number_5769" \
#  --jobscript lar.jobscript
#
# Then monitor with dashboard or ./justin show-jobs --workflow-id ID
# where ID is the value printed by the first command
#
# the xroot lib for streaming non-root files is in testproducts, 
# so add it to the start of the path
source /cvmfs/dune.opensciencegrid.org/products/dune/setup_dune.sh
if [ -z ${JUSTIN_PROCESSORS} ]; then
  JUSTIN_PROCESSORS=1
fi
echo "Justin processors: ${JUSTIN_PROCESSORS}"
export TF_NUM_THREADS=${JUSTIN_PROCESSORS}   
export OPENBLAS_NUM_THREADS=${JUSTIN_PROCESSORS} 
export JULIA_NUM_THREADS=${JUSTIN_PROCESSORS} 
export MKL_NUM_THREADS=${JUSTIN_PROCESSORS} 
export NUMEXPR_NUM_THREADS=${JUSTIN_PROCESSORS} 
export OMP_NUM_THREADS=${JUSTIN_PROCESSORS}  
# From jobsub
export CLUSTER=${CLUSTER:-1}
export PROCESS=${PROCESS:-1}
setup dunesw ${DUNESW_VERSION:-v10_10_04d00} -q e26:prof
setup_exit=$?
if [ "$setup_exit" != 0 ]; then
  echo "Error setting up dunesw ${DUNESW_VERSION}"
  exit
fi
if [ -n "${extra_fcl_path}" ]; then
  echo "ADDING ${extra_fcl_path} to fcl file path"
  sleep 1
  export FHICL_FILE_PATH=${extra_fcl_path}:${FHICL_FILE_PATH}
fi
# Get an unprocessed file from this stage
did_pfn_rse=`$JUSTIN_PATH/justin-get-file`
if [ "${did_pfn_rse}" == "" ] ; then
  echo "Could not get file"
  exit 0
fi
did=`echo $did_pfn_rse | cut -f1 -d' '`
pfn=`echo $did_pfn_rse | cut -f2 -d' '`
rse=`echo $did_pfn_rse | cut -f3 -d' '`
name_only=$(echo $did | cut -f2 -d':')
echo "name" $name_only
echo "Found input file URL $pfn at $rse"
#Get the stage and momentum 
export stage=${stage:-"Gen"}
export momentum=${momentum:-1}
if [ "$momentum" == 1 ]; then
  export gen_fcl="pdhd_1GeV_h4input_cosmics.fcl"
elif [ "$momentum" == 5 ]; then
  export gen_fcl="pdhd_5GeV_h4input_cosmics.fcl"
else
  echo "Error. Provided invalid momentum: ${momentum}. Can only use 1 or 5"
  exit 1
fi
echo "Using gen fcl: ${gen_fcl}"
now=$(date -u +"%Y%m%dT%H%M%SZ")
jobid=`echo "${JUSTIN_JOBSUB_ID:-1}" | cut -f1 -d'@' | sed -e "s/\./_/"`
stageid=${JUSTIN_STAGE_ID:-1}
output_preamble="pdhd_prod_beam_"
nevents=${nevents:--1}
nskip=${nskip:-0}
echo "RUNNING STAGE ${stage}"
#-------------- GEN STAGE --------------------
echo "-------- running generation ---------"
if [ "$stage" == "Gen" ]; then
  if [[ $nevents -gt 10 || $nevents -lt 1 ]]; then
    echo "Setting nevents to 10 in gen"
    nevents=10
  fi
  #Generation
  LD_PRELOAD=$XROOTD_LIB/libXrdPosixPreload.so lar \
      -n  ${nevents} \
      --nskip ${nskip} \
      -c  ${gen_fcl} \
      -o temp_gen.root \
      $pfn
  larReturnCode=$?
  echo "gen lar returns $larReturnCode"
  if [ "$larReturnCode" != 0 ] ; then
    exit $larReturnCode
  fi
  #Generation Done
  #G4
  echo "-------- running G4 ---------"
  lar \
      -c  standard_g4_protodunehd_stage1.fcl \
      -o temp_largeant.root \
      temp_gen.root
  larReturnCode=$?
  echo "g4 lar returns $larReturnCode"
  if [ "$larReturnCode" != 0 ] ; then
    exit $larReturnCode
  fi
  #G4 Done
  #IonScintPDExt
  echo "-------- running IonScintPDExt ---------"
  lar \
      -c  standard_g4_protodunehd_IonScint_PDExt.fcl \
      -o ${output_preamble}_${jobid}_${stageid}_${now}_gen_g4_IonScintPDExt.root \
      temp_largeant.root
  larReturnCode=$?
  echo "ionscint pdext lar returns $larReturnCode"
  if [ "$larReturnCode" != 0 ] ; then
    exit $larReturnCode
  fi
  #IonScintPDExt Done
#---------------------------------------------
#-------------- PD STAGE --------------------
elif [ "$stage" = "PD" ]; then 
  #TPC1
  lar \
      -n ${nevents} \
      --nskip ${nskip} \
      -c  standard_g4_protodunehd_PDInt_TPC1.fcl \
      -o temp_PD_TPC1.root \
      $pfn
  larReturnCode=$?
  echo "PD TPC1 returns $larReturnCode"
  if [ "$larReturnCode" != 0 ] ; then
    exit $larReturnCode
  fi
  #TPC1 Done
  #TPC2
  lar \
      -c  standard_g4_protodunehd_PDInt_TPC2.fcl \
      -o temp_PD_TPC2.root \
      temp_PD_TPC1.root
  larReturnCode=$?
  echo "PD TPC2 returns $larReturnCode"
  if [ "$larReturnCode" != 0 ] ; then
    exit $larReturnCode
  fi
  #TPC2 Done
  #TPC5
  lar \
      -c  standard_g4_protodunehd_PDInt_TPC5.fcl \
      -o temp_PD_TPC5.root \
      temp_PD_TPC2.root
  larReturnCode=$?
  echo "PD TPC5 returns $larReturnCode"
  if [ "$larReturnCode" != 0 ] ; then
    exit $larReturnCode
  fi
  #TPC5 Done
  #TPC6
  lar \
      -c  standard_g4_protodunehd_PDInt_TPC6.fcl \
      -o ${name_only}_${jobid}_${stageid}_${now}_PDInt.root \
      temp_PD_TPC5.root
  larReturnCode=$?
  echo "PD TPC6 returns $larReturnCode"
  if [ "$larReturnCode" != 0 ] ; then
    exit $larReturnCode
  fi
  #TPC6 Done
#--------------------------------------------
#-------------- DetsimReco STAGE --------------------
elif [ "$stage" == "DetsimReco" ]; then
  #Detsim
  lar \
      -n ${nevents} \
      --nskip ${nskip} \
      -c  standard_detsim_protodunehd.fcl \
      -o temp_detsim.root \
      $pfn
  larReturnCode=$?
  echo "Detsim returns $larReturnCode"
  if [ "$larReturnCode" != 0 ] ; then
    exit $larReturnCode
  fi
  #Detsim Done
  reco_fcl=${reco_fcl:-standard_reco_protodunehd_MC.fcl}
  #Reco
  lar \
      -c  ${reco_fcl} \
      -o ${name_only}_${jobid}_${stageid}_${now}_detsim_reco1.root \
      temp_detsim.root
  larReturnCode=$?
  echo "Reco returns $larReturnCode"
  if [ "$larReturnCode" != 0 ] ; then
    exit $larReturnCode
  fi
  #Reco Done
else
  echo "ERROR. Provided invalid stage ${stage}. Can only provide one of: (Gen, PD, DetsimReco)"
  exit 3
fi
####EDIT METADATA FOR THE FOLLOWING FILE
#${name_only}_${jobid}_${stageid}_${now}_detsim_reco1.root
# Record that we processed the input file ok (did we???)
echo "$pfn" > justin-processed-pfns.txt
# For debugging
#for i in *.json
#do
#  echo "==== Start $i ===="
#  cat $  echo "==== End $i ===="
#  echo "==== End $i ===="
#done
ls -ltR
exit 0