justIN           Dashboard       Workflows       Jobs       AWT       Sites       Storages       Docs       Login

Workflow 138, Stage 1

Priority50
Processors1
Wall seconds80000
Image/cvmfs/singularity.opensciencegrid.org/fermilab/fnal-wn-sl7:latest
RSS bytes2097152000 (2000 MiB)
Max distance for inputs100.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_Imperial, 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/szh2/MC_pdhd_Michel/MY_production/fnal/00138/1cosmic_g4_stage2_*.root

File states

Total filesFindingUnallocatedAllocatedOutputtingProcessedNot foundFailed
30300000

Job states

TotalSubmittedStartedProcessingOutputtingFinishedNotusedAbortedStalledJobscript errorOutputting failedNone processed
6880000003952553701

RSEs used

NameInputsOutputs
None01

Stats of processed input files as CSV or JSON, and of uploaded output files as CSV or JSON (up to 10000 files included)

Jobscript

#!/bin/sh

# From jobsub
export CLUSTER=${CLUSTER:-1}
export PROCESS=${PROCESS:-1}
export FILETIMESTAMP=$(date -u +%Y%m%dT%H%M%SZ)
jobid=${PROCESS}

# Construct jobid from CLUSTER and PROCESS, fallback to PID if undefined
if [[ -n "$CLUSTER" && -n "$PROCESS" ]]; then
  jobid="${CLUSTER}_${PROCESS}"
else
  jobid="pid_$$"
fi

echo "Resolved job ID: $jobid"

echo "Running with CLUSTER=$CLUSTER, PROCESS=$PROCESS, TIMESTAMP=$FILETIMESTAMP"

# Setup environment
. /cvmfs/fermilab.opensciencegrid.org/products/common/etc/setups
source /cvmfs/dune.opensciencegrid.org/products/dune/setup_dune.sh
setup dunesw v10_08_02d00 -q e26:prof
setup duneutil

echo "Environment set up"

# To setup ifdh cp, Shu, 20250728---
#htgettoken -i dune -a htvaultprod.fnal.gov

# Local directory info
echo "printing working directory of grid node"
pwd
ls -ltrha


# ------------
# GEN STAGE
# ------------
lar -c prod_cosmics_radiologicals_protodunehd.fcl -n 2 -o cosmic_gen_${jobid}.root
if [ $? -ne 0 ]; then
    echo "GEN stage failed"
    exit 10
fi
echo "Gen successfully made!"
ls -ltrha


# ------------
# G4 STAGE 1
# ------------
lar -c standard_g4_protodunehd_stage1.fcl -s cosmic_gen_${jobid}.root -o cosmic_g4_stage1_${jobid}.root
if [ $? -ne 0 ]; then
    echo "G4 Stage 1 failed"
    exit 11
fi
echo "G4 Stage 1 completed. Removing input file from GEN stage..."
#rm -f cosmic_gen_${jobid}.root


# ------------
# G4 STAGE 2
# ------------
lar -c standard_g4_protodunehd_stage2.fcl -s cosmic_g4_stage1_${jobid}.root -o cosmic_g4_stage2_${jobid}.root
if [ $? -ne 0 ]; then
    echo "G4 Stage 2 failed"
    exit 12
fi
echo "G4 Stage 2 completed. Removing G4 Stage 1 output..."
#rm -f cosmic_g4_stage1_${jobid}.root
ls -ltrha


# -------------------------------
# Copy final output
# -------------------------------
#ifdh cp -D cosmic_g4_stage2_${jobid}.root /pnfs/dune/scratch/users/szh2/MC_pdhd_Michel/MY_production/
#if [ $? -ne 0 ]; then
#     echo "Output copy failed!"
#     exit 13
# fi
# echo "Final output copied. Removing G4 Stage 2 output..."
#rm -f cosmic_g4_stage2_${jobid}.root


# Mark input (if needed by justIN)
echo "GEN job complete (no input PFN to record)" > justin-processed-pfns.txt

exit 0
justIN time: 2025-08-04 14:07:56 UTC       justIN version: 01.04.00