justIN           Dashboard       Workflows       Jobs       AWT       Sites       Storages       Docs       Login

Workflow 1954, 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/01954/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
100000004910509

Job states

TotalSubmittedStartedProcessingOutputtingFinishedNotusedAbortedStalledJobscript errorOutputting failedNone processed
4444000013090420131025840
Files processed00100100200200300300400400Aug-28 03:00Aug-28 04:00Aug-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:00Files processedBin start timesNumber per binUK_BristolUS_PuertoRicoUK_GlasgowNL_SURFsaraUK_DurhamUK_QMULUK_OxfordUK_ManchesterUK_RAL-Tier1UK_LancasterUK_RAL-PPDBR_CBPFUS_UChicagoES_PICCZ_FZUCERNUS_UCSD
Replicas per RSE1000479.56664594992594199.727955790730871000322.6221513831992322.29423813651425117282.5973016359418193.98994687081387101296.8086760072953169.4454214455641499315.18798686107294151.009079093677187335.86328804178083138.396440142026184356.9594772468911131.251645700461638372.69803695413094128.953480135338349378.8255520205531128.70654971963558Replicas per RSEFNAL_DCACHE (39%)PRAGUE (39%)NIKHEF (4%)QMUL (3%)SURFSARA (3%)RAL_ECHO (3%)RAL-PP (3%)DUNE_FR_CCIN2P3_DISK (1%)DUNE_ES_PIC (0%)

RSEs used

NameInputsOutputs
PRAGUE18420
NIKHEF3750
QMUL3590
SURFSARA3170
RAL_ECHO3000
RAL-PP2730
DUNE_FR_CCIN2P3_DISK1430
DUNE_ES_PIC130
None0964

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
UK_RAL-PPD107408
CERN94448
UK_Manchester92388
UK_Oxford28143
UK_Lancaster22141
UK_RAL-Tier12115
CZ_FZU1978
US_UChicago1872
ES_PIC1563
US_FNAL-FermiGrid14196
UK_Bristol1225
FR_CCIN2P31150
NL_NIKHEF1115
UK_QMUL82
NL_SURFsara729
US_UCSD421
US_PuertoRico410
BR_CBPF43
US_Wisconsin213
UK_Edinburgh10
UK_Durham15
US_FNAL-T110
UK_Glasgow01

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 22:15:47 UTC       justIN version: 01.05.00