justIN           Dashboard       Workflows       Jobs       AWT       Sites       Storages       Docs       Login

Workflow 1937, Stage 1

Priority50
Processors1
Wall seconds80000
Image/cvmfs/singularity.opensciencegrid.org/fermilab/fnal-wn-sl7:latest
RSS bytes4194304000 (4000 MiB)
Max distance for inputs3000.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_Glasgow, 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
Scopeusertests
Events for this stage

Output patterns

 DestinationPatternLifetimeFor next stageRSE expression
1https://fndcadoor.fnal.gov:2880/dune/scratch/users/ichong/fnal/01937/1caf*.root

Environment variables

NameValue
DUNE_QUALIFIERe26:prof
DUNE_VERSIONv10_10_00d00
FCL_FILE/cvmfs/fifeuser2.opensciencegrid.org/sw/dune/152f797bfcf315d3c4c3684f118c8573b0c3662c/atm-norm-vtx-reco.fcl
FCL_SECONDARYcafmaker_atmos_dune10kt_1x2x6_runreco-nuenergy-nuangular_geov5.fcl
NUM_EVENTS200

File states

Total filesFindingUnallocatedAllocatedOutputtingProcessedNot foundFailed
100000004980502

Job states

TotalSubmittedStartedProcessingOutputtingFinishedNotusedAbortedStalledJobscript errorOutputting failedNone processed
4535000014360412112025750
Files processed00100100200200300300400400Aug-28 05:00Aug-28 06:00Aug-28 07:00Aug-28 08:00Aug-28 09:00Aug-28 10:00Aug-28 11:00Aug-28 12:00Aug-28 13:00Aug-28 14:00Aug-28 15:00Aug-28 16:00Aug-28 17:00Files processedBin start timesNumber per binUK_BristolUK_GlasgowNL_SURFsaraUK_DurhamUK_QMULUK_OxfordUK_ManchesterUK_RAL-Tier1UK_LancasterUK_RAL-PPDUS_UChicagoES_PICCZ_FZUCERNUS_UCSDUS_PuertoRicoBR_CBPF
Replicas per RSE1000479.5163347655381199.582139595359051000323.0107251379685322.54553941729546130283.0047568332702193.01204075552243122300.26457822317286165.2224417846091103322.24564862587886145.9515764061925475342.8851981129122135.45771729413771361.2016232184195130.3915494258420226373.7472320847785128.8858102186085811378.5662748890826128.70976098276572Replicas per RSEFNAL_DCACHE (39%)PRAGUE (39%)RAL_ECHO (5%)NIKHEF (4%)QMUL (4%)SURFSARA (2%)RAL-PP (2%)DUNE_FR_CCIN2P3_DISK (1%)DUNE_ES_PIC (0%)

RSEs used

NameInputsOutputs
PRAGUE19210
RAL_ECHO4190
QMUL3470
NIKHEF3010
RAL-PP2720
SURFSARA2490
DUNE_FR_CCIN2P3_DISK550
DUNE_ES_PIC310
None0981

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
CERN69369
CZ_FZU56285
UK_QMUL53144
UK_RAL-PPD47162
ES_PIC46185
UK_Manchester45164
NL_SURFsara40116
US_FNAL-FermiGrid28292
UK_RAL-Tier11655
UK_Lancaster1032
UK_Oxford1085
US_UCSD878
US_UChicago614
UK_Durham565
UK_Glasgow553
US_Wisconsin210
UK_Bristol26
US_PuertoRico210
BR_CBPF211
US_FNAL-T114
IT_CNAF10
FR_CCIN2P301

Jobscript

#!/bin/bash
:<<'EOF'
This jobscript runs ONLY the CAF-making step on an input file from JustIn.

Required environment variables:
  - FCL_SECONDARY         (FHiCL for CAF making)  [REQUIRED]
  - DUNE_VERSION         
  - DUNE_QUALIFIER        
  - CODE_TAR_DIR_LOCAL    (optional: path to localProducts/... for custom code)
  - NUM_EVENTS            (optional: limit events, e.g. -n 10)
EOF


# === Number of events option ===
events_option=""
if [ -n "${NUM_EVENTS:-}" ]; then
  events_option="-n $NUM_EVENTS"
fi

# === Get a file from JustIn ===
did_pfn_rse=$($JUSTIN_PATH/justin-get-file)
if [ -z "$did_pfn_rse" ]; then
  echo "No file assigned. Exiting jobscript."
  exit 0
fi

# === Track input DID for MetaCat ===
echo "$did_pfn_rse" | cut -f1 -d' ' >> all-input-dids.txt

# === Parse PFN from DID ===
pfn=$(echo "$did_pfn_rse" | cut -d' ' -f2)
echo "Input PFN = $pfn"
fname=$(basename "$pfn" .root)

# === Setup DUNE software ===
source /cvmfs/dune.opensciencegrid.org/products/dune/setup_dune.sh
setup dunesw "$DUNE_VERSION" -q "$DUNE_QUALIFIER"


# === Generate common timestamp and random suffix for output renaming ===
timestamp=$(date -u +"%Y-%m-%dT_%H%M%SZ")
rand_suffix=$((1 + RANDOM % 10))

# === Output file naming ===
fname=$(basename "$pfn" .root)
outFile="${fname}_truthvtx_${timestamp}.root"
logFile="truthvtx_${timestamp}_vtx.log"

# === Set FW search path ===
XML_DIR_MASTER=$(dirname "$XML_MASTER")
XML_DIR_NEUTRINO=$(dirname "$XML_NEUTRINO")
export FW_SEARCH_PATH="$XML_DIR_MASTER:$XML_DIR_NEUTRINO:$FW_SEARCH_PATH"




# === Run lar (primary) ===
export LD_PRELOAD=${XROOTD_LIB}/libXrdPosixPreload.so
echo "Running LArSoft with FCL: $FCL_FILE"
lar -c "$FCL_FILE" $events_option -o "$outFile" -s "$pfn" > "$logFile" 2>&1









# === Timestamp for outputs ===
timestamp=$(date -u +"%Y-%m-%dT_%H%M%SZ")

# === CAF output & log names ===
secondary_out="caf_${fname}_${timestamp}.root"
secondary_log="caf_${fname}_${timestamp}.log"

# === Run CAF step ===
export LD_PRELOAD=${XROOTD_LIB}/libXrdPosixPreload.so
echo "Running CAF step with FCL_SECONDARY: $FCL_SECONDARY"
echo "Output: $secondary_out"
lar -c "$FCL_SECONDARY" $events_option -o "$secondary_out" -s "$outFile" > "$secondary_log" 2>&1
# === Rename CAF output root file to include timestamp if needed ===
new_caf_out="caf_normalvtx_${timestamp}.root"
mv caf.root "$new_caf_out"
echo "Renamed caf.root -> $new_caf_out"
cafExit=$?

mv jobscript.log jobscript_$(date +%Y%m%d_%H%M%S).log


# === Show last 100 lines of CAF log ===
echo '=== Start last 100 lines of CAF log file ==='
tail -100 "$secondary_log" || true
echo '=== End last 100 lines of CAF log file ==='

# === Mark processed if success ===
if [ $cafExit -eq 0 ]; then
  echo "$pfn" > justin-processed-pfns.txt
  jobscriptExit=0
else
  jobscriptExit=1
fi

# === Package logs ===
tar zcf "${JUSTIN_JOBSUB_ID//[@]/_}.logs.tgz" *.log

# === Display output summary ===
echo "=== Generated output files ==="
ls -1 *.* 2>/dev/null | grep -v 'all-input-dids.txt' || echo "No output files found."

exit $jobscriptExit
justIN time: 2025-09-18 19:09:24 UTC       justIN version: 01.05.00