justIN           Dashboard       Workflows       Jobs       AWT       Sites       Storages       Docs       Login

21 July 2025: This instance at RAL is read-only. Please do not try submitting new workflows for now.

Workflow 7776, Stage 1

Priority50
Processors1
Wall seconds80000
Image/cvmfs/singularity.opensciencegrid.org/fermilab/fnal-wn-sl7:latest
RSS bytes2097152000 (2000 MiB)
Max distance for inputs100.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_Victoria, CERN, CH_UNIBE-LHEP, CZ_FZU, ES_CIEMAT, ES_PIC, FR_CCIN2P3, IN_TIFR, IT_CNAF, NL_NIKHEF, NL_SURFsara, UK_Bristol, UK_Brunel, UK_Durham, UK_Edinburgh, UK_Lancaster, UK_Manchester, UK_Oxford, UK_QMUL, UK_RAL-PPD, UK_RAL-Tier1, UK_Sheffield, US_Caltech, US_Colorado, US_FNAL-FermiGrid, US_FNAL-T1, US_Michigan, US_MIT, US_Nebraska, US_NotreDame, US_PuertoRico, US_SU-ITS, US_Swan, US_UChicago, US_UConn-HPC, US_UCSD, US_Wisconsin
Scopeusertests
Events for this stage

Output patterns

 DestinationPatternLifetimeFor next stageRSE expression
1https://fndcadoor.fnal.gov:2880/dune/scratch/users/calcuttj/extracted_raw/07776/1*h5

Environment variables

NameValue
DUNESW_TAR/cvmfs/fifeuser2.opensciencegrid.org/sw/dune/0dfda6f3cdbf24bb65facea8e0c5f8ae2c77aa87/
DUNESW_VERSIONv10_01_03d00
MCJob1
NEVENTS10
pipyaml1
UNET_DIR/cvmfs/fifeuser4.opensciencegrid.org/sw/dune/2cf0c0fd37c08f1a25107bb8049ca4f6de7f31ed
UTIL_TAR/cvmfs/fifeuser1.opensciencegrid.org/sw/dune/216c4fd621c67724d2251f7fb7a8df2a0a68a63d
YAMLFILEpdhd_unet_raw.yaml

File states

Total filesFindingUnallocatedAllocatedOutputtingProcessedNot foundFailed
100000010000

Job states

TotalSubmittedStartedProcessingOutputtingFinishedNotusedAbortedStalledJobscript errorOutputting failedNone processed
244000020100301300
Files processed0044881212161620202424282832323636Jun-19 16:00Jun-19 17:00Jun-19 18:00Jun-19 19:00Jun-19 20:00Jun-19 21:00Jun-19 22:00Jun-19 23:00Jun-20 00:00Jun-20 01:00Jun-20 02:00Jun-20 03:00Files processedBin start timesNumber per binUK_OxfordUK_SheffieldCZ_FZUUS_FNAL-FermiG…US_FNAL-FermiGridUS_ColoradoUK_RAL-PPDCERNUS_UChicagoES_PICES_CIEMATUK_DurhamUK_RAL-Tier1UK_ManchesterCH_UNIBE-LHEP

RSEs used

NameInputsOutputs
MONTECARLO1430
None01000

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

SiteAllocatedOutputting
US_Wisconsin100
UK_RAL-PPD100
UK_RAL-Tier130
UK_Sheffield20
ES_PIC10
ES_CIEMAT10
UK_Edinburgh10
UK_Durham10
US_PuertoRico10

Jobscript

#!/bin/bash
#

#These must be defined
if [ -z $UTIL_TAR ]; then
  echo "Fatal must provide UTIL_TAR env var"
  exit 1
fi
export PYTHONPATH=$UTIL_TAR:$PYTHONPATH

if [ -z $UNET_DIR ]; then
        echo "fatal must provide UNET_DIR env var"
        exit 1
fi

source /cvmfs/dune.opensciencegrid.org/products/dune/setup_dune.sh
setup metacat
setup python v3_9_15
export METACAT_SERVER_URL=https://metacat.fnal.gov:9443/dune_meta_prod/app
export METACAT_AUTH_SERVER_URL=https://metacat.fnal.gov:8143/auth/dune

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}  

echo "Will use justin-get-file"
DID_PFN_RSE=`$JUSTIN_PATH/justin-get-file`
if [ "${DID_PFN_RSE}" == "" ] ; then
  echo "Could not get file"
  exit 0
fi
export pfn=`echo ${DID_PFN_RSE} | cut -f2 -d' '`
export did=`echo ${DID_PFN_RSE} | cut -f1 -d' '`
 

echo "Justin specific env vars"
env | grep JUSTIN
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}
a=1

###Subshell for lar
#(
 if [ -n "$DUNESW_TAR" ]; then
   stat ${DUNESW_TAR}
   if [ $? -ne 0 ]; then
     echo "Failed to stat $DUNESW_TAR. Exiting safely"
     exit 0
   fi
 
   export PRODUCTS=$DUNESW_TAR:$PRODUCTS 
   echo "Set dunesw to $DUNESW_TAR"
 fi

 if [ -n "$WIRECELL_TAR" ]; then
   stat ${WIRECELL_TAR}
   if [ $? -ne 0 ]; then
     echo "Failed to stat $WIRECELL_TAR. Exiting safely"
     exit 0
   fi
 
   export PRODUCTS=$WIRECELL_TAR:$PRODUCTS 
   echo "Set wirecell to $WIRECELL_TAR"
 fi

 #Setup recent lar software suite
 DUNESW_VERSION=${DUNESW_VERSION:-v10_02_02d00}
 setup dunesw \
    "${DUNESW_VERSION}" \
    -q "${DUNE_QUALIFIER:-e26:prof}"
 
 setup_exit=$?
 if [ $? -ne 0 ]; then
   echo "Failed to setup dunesw $DUNESW_VERSION $DUNE_QUALIFIER"
   exit $setup_exit
 fi
 
 echo "DUNESW loc:"
 ups active | grep dunesw

 echo "WIRECELL loc:"
 ups active | grep wirecell
 
 
 echo "printing env"
 env
 echo "DUNE specific env vars"
 env | grep DUNE

 # User can specify to pip install pyyaml
 if [ -n "$pipyaml" ]; then
   echo "Installing yaml"
   pip install --user pyyaml h5py
   echo "Done"
 # elif [ -n "${YAML_TAR}" ]; then
 #   echo "Using venv at ${YAML_TAR}"
 #   source ${YAML_TAR}/yaml_venv/bin/activate
 fi


 input_filename=`echo $did | cut -f2 -d':'`
 echo "input file: $input_filename"

 echo "jobsub_id: ${JUSTIN_JOBSUB_ID:-1}"
 
 #Get run/subrun from parent if using input -- else from justin job ID/process
 if [ -z "$MCJob" ]; then
   echo "Getting run subrun from $did"
   run_subrun=`python -m beam_job_utils get_run_subrun -i $did`
   get_run_ret=$?
   if [ $get_run_ret -ne 0 ]; then
     echo "error in get_run_subrun"
   fi
 
   echo $run_subrun
   run=`echo $run_subrun | cut -f1 -d' '`
   subrun=`echo $run_subrun | cut -f2 -d' '`
 else
   run=`echo $jobid | cut -f1 -d'_'`  ##TODO -- check order here
   subrun=`echo $jobid | cut -f2 -d'_'`
 fi
 nevents=${NEVENTS:--1} #Set from env override or -1 
 NSKIP=${NSKIP:-0} 
 echo "nevents: $nevents"
 
 overrides="core.data_tier=full-reconstructed \
  core.application.version=${DUNESW_VERSION} \
  core.application.name=reco \
  core.application.family=dunesw \
  core.application=dunesw.reco \
 "

 #User specifies if theyd like to use an input file or not 
 if [ -n "$MCJob" ]; then
   inputflag=""
 else
   inputflag="-i $pfn --parent $did"
 fi
 
 echo "input flag: $inputflag"
 
 # TODO -- metadata file configurable
 python -m beam_job_utils run_job \
       --json ${UTIL_TAR}/${JSONFILE:-pdsp_beam_base_meta.json} \
       --overrides ${overrides} \
       --run $run \
       --subrun $subrun \
       --yaml ${UTIL_TAR}/${YAMLFILE:-pdsp_beam_gen.yaml} \
       --nevents $nevents \
       --set_esr \
       $inputflag
 
 exitcode=$?
 if [ $exitcode -ne 0 ]; then
   echo "Error running. Exiting with ${exitcode}"
   exit $exitcode
 fi
#)

#if  [ -n $TESTFILE ]; then
#  echo $TESTFILE
#  ln -s $TESTFILE extracted.h5
#  ls -lht
#fi

export PYTHONPATH=${UNET_DIR}:${PYTHONPATH}

python -m extract -f *stage6.root \
       --input_tag "wclsnfbadapa1:raw" \
       --truth_tag "wclsnfperfect:raw" \
       --ranges ${UNET_DIR}/output_ranges.yaml

h5files=extracted*h5
for i in $h5files; do
  echo $i
  mv $i `echo $i | sed -e "s/\.h5/_${now}_${jobid}_${stageid}.h5/"`
done


###subshell for convert
#(
#  echo "installing torch"
#  pip install --user torch h5py
#  
#  exitcode=$?
#  if [ $exitcode -ne 0 ]; then
#    echo "Error installing torch. Exiting with ${exitcode}"
#    exit $exitcode
#  fi
#  
#  
#  ### Run convert on the output
#  #python $UNET_DIR/convert_to_pt.py extracted*h5
#  #exitcode=$?
#  #if [ $exitcode -ne 0 ]; then
#  #  echo "Error converting to torch. Exiting with ${exitcode}"
#  #  exit $exitcode
#  #fi
#  ### Run convert on the output
#  for f in `ls extracted*h5`; do
#    echo $f
#    python $UNET_DIR/convert_to_pt.py $f #$files #$pfn #extracted*h5
#    exitcode=$?
#    if [ $exitcode -ne 0 ]; then
#      echo "Error converting to torch. Exiting with ${exitcode}"
#      exit $exitcode
#    fi
#  done
#)

echo "$pfn" > justin-processed-pfns.txt

justIN time: 2025-08-14 16:31:58 UTC       justIN version: 01.03.02