justIN           Dashboard       Workflows       Jobs       AWT       Sites       Storages       Docs       Login

Workflow 1958, 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/01958/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
1000000040996

Job states

TotalSubmittedStartedProcessingOutputtingFinishedNotusedAbortedStalledJobscript errorOutputting failedNone processed
7849000018520569159052690
Files processed000.20.20.40.40.60.60.80.8111.21.21.41.41.61.61.81.8222.22.22.42.42.62.62.82.833Sep-02 10:00Sep-02 11:00Sep-02 12:00Sep-02 13:00Files processedBin start timesNumber per binUK_ManchesterUK_RAL-Tier1ES_PICBR_CBPF
Replicas per RSE1000479.042388348912198.24115060375551000326.64448377681737324.7814897903625118280.3592689118137199.94394755389672107293.3792520484261174.12566472761546105311.64743792870803153.8999546923337893332.8737682081684139.8341448448400793355.34926169710053131.626023320758136371.75753580395383129.0230892816096614378.1952029941474128.71546786081223Replicas per RSEFNAL_DCACHE (38%)PRAGUE (38%)RAL_ECHO (4%)QMUL (4%)NIKHEF (4%)RAL-PP (3%)SURFSARA (3%)DUNE_FR_CCIN2P3_DISK (1%)DUNE_ES_PIC (0%)

RSEs used

NameInputsOutputs
PRAGUE32410
RAL-PP5400
QMUL5200
RAL_ECHO5090
NIKHEF4870
SURFSARA4770
DUNE_FR_CCIN2P3_DISK1650
DUNE_ES_PIC600
None08

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
CERN113855
CZ_FZU84519
US_FNAL-FermiGrid70889
UK_Manchester58387
NL_SURFsara45233
UK_RAL-PPD45253
UK_QMUL30171
UK_Bristol30108
NL_NIKHEF2615
US_UChicago19118
UK_Oxford13120
UK_Lancaster13104
UK_RAL-Tier11353
UK_Glasgow1291
ES_PIC12165
FR_CCIN2P3957
BR_CBPF733
IT_CNAF773
US_FNAL-T179
US_UCSD634
UK_Durham271
US_Wisconsin15
US_PuertoRico113

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