justIN           Dashboard       Workflows       Jobs       AWT       Sites       Storages       Docs       Login

Workflow 1934, 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/01934/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
10000000001000

Job states

TotalSubmittedStartedProcessingOutputtingFinishedNotusedAbortedStalledJobscript errorOutputting failedNone processed
74950000129360650308051786
Replicas per RSE1000479.5331156633197199.63069848902621000322.8811800476508322.46202805300766107281.9540614966476195.59317843147073105295.28046298615584171.4644897025707100313.70047843503613152.1925221006240288334.362397693998139.103744774837486355.7067504491337131.5406030358399232370.8838425112629129.0953496138491219377.52274160553077128.72914367762067Replicas per RSEFNAL_DCACHE (39%)PRAGUE (39%)RAL_ECHO (4%)SURFSARA (4%)NIKHEF (3%)QMUL (3%)RAL-PP (3%)DUNE_FR_CCIN2P3_DISK (1%)DUNE_ES_PIC (0%)

RSEs used

NameInputsOutputs
PRAGUE30080
RAL_ECHO6100
SURFSARA5550
NIKHEF5340
RAL-PP5150
QMUL5070
DUNE_FR_CCIN2P3_DISK1760
DUNE_ES_PIC950

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_Manchester2291193
CERN108774
UK_RAL-PPD103606
UK_Bristol29139
CZ_FZU27112
UK_Lancaster23280
US_FNAL-FermiGrid22292
ES_PIC22247
US_UCSD18162
UK_Oxford15177
NL_SURFsara1369
NL_NIKHEF1212
UK_QMUL913
US_UChicago612
FR_CCIN2P3561
UK_RAL-Tier1535
US_PuertoRico514
BR_CBPF423
UK_Glasgow321
UK_Durham222
US_FNAL-T1265
US_Wisconsin27

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