justIN           Dashboard       Workflows       Jobs       AWT       Sites       Storages       Docs       Login

Workflow 11951, Stage 1

Workflow11951
Campaign351
Priority50
Processors1
Wall seconds14400
Image/cvmfs/singularity.opensciencegrid.org/fermilab/fnal-wn-sl7:latest
RSS bytes4194304000 (4000 MiB)
Max distance for inputs0.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, CA_Victoria, 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_Imperial, UK_Lancaster, UK_Liverpool, UK_Manchester, UK_Oxford, UK_QMUL, UK_RAL-PPD, UK_RAL-Tier1, UK_Sheffield, US_BNL, US_Colorado, US_FNAL-FermiGrid, US_FNAL-T1, US_Michigan, 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
1Rucio usertests:fnal-w11951s1p1*_gen.root86400True

Environment variables

NameValue
JOB_FHICL_FILEmpvmpr_gen_1x2x6.fcl
NEVENTS20

File states

Total filesFindingUnallocatedAllocatedOutputtingProcessedNot foundFailed
5000004406

Job states

TotalSubmittedStartedProcessingOutputtingFinishedNotusedAbortedStalledJobscript errorOutputting failedNone processed
1200000840306000
Files processed001010202030304040Jan-15 04:00Jan-15 05:00Jan-15 06:00Files processedBin start timesNumber per binNL_SURFsaraUK_QMULCA_SFUUK_RAL-Tier1NL_NIKHEFBR_CBPFFR_CCIN2P3ES_PICUK_ImperialUS_FNAL-FermiG…US_FNAL-FermiGrid

RSEs used

NameInputsOutputs
MONTECARLO800
DUNE_ES_PIC012
SURFSARA012
DUNE_UK_MANCHESTER_CEPH05
DUNE_FR_CCIN2P3_DISK04
DUNE_US_FNAL_DISK_STAGE03
NIKHEF03
RAL_ECHO03
DUNE_CA_SFU01
QMUL01

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
NL_SURFsara100
NL_NIKHEF50
UK_Edinburgh30
CA_SFU20
UK_RAL-Tier120
UK_QMUL10
US_FNAL-FermiGrid10
FR_CCIN2P305
UK_Imperial01

Jobscript

#!/bin/bash
#set -euo pipefail

echo "=== GEN job starting ==="
echo "Host: $(hostname)"
echo "PWD(cmd): $(/bin/pwd -P || pwd || true)"
echo "PWD(var): ${PWD:-unset}"
echo "JUSTIN_JOB_INDEX=${JUSTIN_JOB_INDEX:-unset}"
echo "JUSTIN_PATH=${JUSTIN_PATH:-unset}"

# ----------------------------------------------------------------------
# Get the allocated Monte Carlo "counter file" and remember it
# ----------------------------------------------------------------------
if [[ -z "${JUSTIN_PATH:-}" ]]; then
  echo "ERROR: JUSTIN_PATH is not set (job not running under justIN wrapper?)"
  exit 2
fi

alloc="$("$JUSTIN_PATH/justin-get-file")"
if [[ -z "$alloc" ]]; then
  echo "No more inputs allocated (workflow complete). Exiting cleanly."
  exit 0
fi

did="$(echo "$alloc" | awk '{print $1}')"
pfn="$(echo "$alloc" | awk '{print $2}')"
rse="$(echo "$alloc" | awk '{print $3}')"
echo "Allocated input: did=$did pfn=$pfn rse=$rse"

# Output value of expected input environment variables
echo "# events: ${NEVENTS}"
echo "fhicl file: ${JOB_FHICL_FILE}"

# Work in the sandbox
cd $PWD

# ----------------------------------------------------------------------
# Grab the tarball that has our fhicl files we'll need
# ----------------------------------------------------------------------
FCL_TGZ_URL="https://raw.githubusercontent.com/SFBayLaser/dune-justin/main/bundles/fhicl_bundle.tgz"
curl -L -o fhicl_bundle.tgz "$FCL_TGZ_URL"
tar xzf fhicl_bundle.tgz

# ----------------------------------------------------------------------
# Environment setup
# ----------------------------------------------------------------------
echo "Sourcing DUNE setup..."
# setup_dune.sh can reference unset vars, so disable nounset only while sourcing

source /cvmfs/dune.opensciencegrid.org/products/dune/setup_dune.sh

setup dunesw v10_16_00d00 -q e26:prof

ups active
lar --version

# ----------------------------------------------------------------------
# Point fhicl to our local files
# ----------------------------------------------------------------------
export FHICL_FILE_PATH="$PWD/fhicl:${FHICL_FILE_PATH:-.}"

# ----------------------------------------------------------------------
# Create the starting run/subrun/event number
# ----------------------------------------------------------------------
did="$(printf '%s' "$did" | tr -d '\r' | xargs)"
jobnum_str="${did##*-}"         # everything after the last '-': 000028
jobnum=$((10#$jobnum_str))      # force decimal
RUN_BASE=200000

RUN=$((RUN_BASE + jobnum))
SUBRUN=0
EVENT=1

# ----------------------------------------------------------------------
# Run GEN
# ----------------------------------------------------------------------
FCL=${JOB_FHICL_FILE}

#Can we recover first portion for name?
genType=$(echo "$FCL" | awk -F"_" '{print $1}')
echo "GEN stage type: $genType"

OUTFILE="${genType}_${did}_gen.root"

echo "Running lar GEN:"
echo "  FCL: ${FCL}"
echo "  Events: ${NEVENTS}"
echo "  Output: ${OUTFILE}"

lar -c "${FCL}" -n "${NEVENTS}" -e "${RUN}:${SUBRUN}:${EVENT}" -o "${OUTFILE}"

# ----------------------------------------------------------------------
# Sanity checks
# ----------------------------------------------------------------------
test -f "${OUTFILE}" || { echo "ERROR: ${OUTFILE} not produced"; exit 1; }
ls -lh "${OUTFILE}"

# ----------------------------------------------------------------------
# Tell justIN we successfully processed the allocated input
# ----------------------------------------------------------------------
echo "$did" >> justin-processed-dids.txt
# (Alternative: echo "$pfn" >> justin-processed-pfns.txt)

echo "Input fcl file: ${JOB_FHICL_FILE}"
echo "genType: ${genType}"

echo "Wrote processed DID to justin-processed-dids.txt: $did"
echo "=== GEN job completed successfully ==="
justIN time: 2026-02-04 06:00:03 UTC       justIN version: 01.06.00