justIN           Dashboard       Workflows       Jobs       AWT       Sites       Storages       Docs       Login

Workflow 3709, Stage 1

Priority50
Processors1
Wall seconds7200
RSS bytes4193255424 (3999 MiB)
Max distance for inputs0.0
Enabled input RSEs CERN_PDUNE_EOS, 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, MANCHESTER, MONTECARLO, NIKHEF, PRAGUE, QMUL, RAL-PP, RAL_ECHO, SURFSARA, T3_US_NERSC
Enabled output RSEs CERN_PDUNE_EOS, 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, MANCHESTER, 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, IN_TIFR, IT_CNAF, UK_Bristol, UK_Brunel, UK_Durham, UK_Edinburgh, UK_Imperial, UK_Lancaster, UK_Liverpool, UK_Manchester, UK_Oxford, UK_RAL-Tier1, UK_Sheffield, US_BNL, US_Caltech, US_Colorado, US_FNAL-FermiGrid, US_FNAL-T1, US_Michigan, US_MIT, US_Nebraska, 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 stage
1https://fndcadoor.fnal.gov:2880/dune/scratch/users/nbostan/justin/pdhd_ntuple_test_Oct17/03709/1*root

Environment variables

NameValue
DUNE_VERSIONv09_90_02d00
FCL_FILEpdhd_ana_MC_sce.fcl
NEVENTS1
NFILES1
NTUPLE_DIR/cvmfs/fifeuser3.opensciencegrid.org/sw/dune/0b0e77e50bec3aa86c8944031b79d1ae68ae0216
PREFIXpdhdana

File states

Total filesFindingUnallocatedAllocatedOutputtingProcessedNot foundFailed
1000001000

Job states

TotalSubmittedStartedProcessingOutputtingFinishedNotusedAbortedStalledJobscript errorOutputting failedNone processed
17000017000000
Files processed001122334455667788991010Oct-17 08:00Oct-17 09:00Oct-17 10:00Files processedBin start timesNumber per binES_PIC
Replicas per RSE10478.4572103547742196.66010539442110331.0646499837911327.2385195012832281.5427896452258196.6601053944212310.1731840872443155.181818217583041342.66010539442107135.54278964522581367.3074875691145129.4677555574749Replicas per RSEDUNE_ES_PIC (38%)FNAL_DCACHE (38%)RAL_ECHO (7%)SURFSARA (7%)DUNE_US_BNL_SDCC (3%)QMUL (3%)

RSEs used

NameInputsOutputs
DUNE_ES_PIC100

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/bash
#

#These must be defined
if [ -z $FCL_FILE ]; then
  echo "Fatal Must provide FCL_FILE env var"
  exit 1
fi

if [ -z $NTUPLE_DIR ]; then
  echo "Fatal Must provide NTUPLE_DIR env var"
  exit 1
fi

stat ${NTUPLE_DIR}
if [ $? -ne 0 ]; then
  echo "Failed to $NTUPLE_DIR. Exiting safely"
  exit 0
fi

source /cvmfs/dune.opensciencegrid.org/products/dune/setup_dune.sh
setup metacat
export METACAT_SERVER_URL=https://metacat.fnal.gov:9443/dune_meta_prod/app
export METACAT_AUTH_SERVER_URL=https://metacat.fnal.gov:8143/auth/dune

if [ -n "$PROTODUNEANA_TAR" ]; then
  stat ${PROTODUNEANA_TAR}
  if [ $? -ne 0 ]; then
    echo "Failed to stat $PROTODUNEANA_TAR. Exiting safely"
    exit 0
  fi

  export PRODUCTS=$PROTODUNEANA_TAR:$PRODUCTS 
  echo "Set protoduneana to $PROTODUNEANA_TAR"
fi

if [ -n "$GEANT4REWEIGHT_TAR" ]; then
  stat ${GEANT4REWEIGHT_TAR}
  if [ $? -ne 0 ]; then
    echo "Failed to stat $GEANT4REWEIGHT_TAR. Exiting safely"
    exit 0
  fi

  export PRODUCTS=$GEANT4REWEIGHT_TAR:$PRODUCTS 
  echo "Set protoduneana to $GEANT4REWEIGHT_TAR"
fi


#Setup recent lar software suite
DUNE_VERSION=${DUNE_VERSION:-v09_81_00d01}
setup dunesw \
   "${DUNE_VERSION}" \
   -q "${DUNE_QUALIFIER:-e26:prof}"

setup_exit=$?
if [ $? -ne 0 ]; then
  echo "Failed to setup dunesw $DUNE_VERSION $DUNE_QUALIFIER"
  exit $setup_exit
fi


echo "DUNESW loc:"
ups active | grep dunesw

if [ -z ${JUSTIN_PROCESSORS} ]; then
  JUSTIN_PROCESSORS=1
fi

echo "Justin processors: ${JUSTIN_PROCESSORS}"

export TF_NUM_THREADS=${JUSTIN_PROCESSORS}   
export OPENBLAS_NUM_THREADS=${JUSTIN_PROCESSORS} 
export JULIA_NUM_THREADS=${JUSTIN_PROCESSORS} 
export MKL_NUM_THREADS=${JUSTIN_PROCESSORS} 
export NUMEXPR_NUM_THREADS=${JUSTIN_PROCESSORS} 
export OMP_NUM_THREADS=${JUSTIN_PROCESSORS}  

echo "printing env"
env

echo "Justin specific env vars"
env | grep JUSTIN

echo "Will use justin-get-file"
#

nfiles=${NFILES:-1}

python $NTUPLE_DIR/ntuple_prod_utils.py get_nfiles_justin \
    -n $nfiles \
    --dids input_dids.list \
    --pfns input_pfns.list

#pfn_exit=$?
#if [ $pfn_exit -ne 0 ]; then
#  echo "Error in get_nfiles_justin. Exiting"
#  exit $pfn_exit
#fi

n_files_retrieved=`wc -l input_pfns.list | cut -f1 -d' '`
echo "Files retrieved: ${n_files_retrieved}"

if [ $n_files_retrieved -eq 0 ]; then
  echo "No files retrieved. Exiting safely"
  exit 0
fi

pfn_list=`cat input_pfns.list`
echo "PFN list:"
echo $pfn_list

now=$(date -u +"%Y%m%dT%H%M%SZ")

##TODO -- edit this
#jobid=`echo "${JUSTIN_JOBSUB_ID:-1}" | awk -F '.' '{print $1}'`
jobid=`echo "${JUSTIN_JOBSUB_ID:-1}" | cut -f1 -d'@' | sed -e "s/\./_/"`
PREFIX=${PREFIX:-"pdspana"}
OUTFILE="${PREFIX}_${jobid}_${JUSTIN_STAGE_ID}_${JUSTIN_WORKFLOW_ID}_${now}.root"


nevents=${NEVENTS:--1}

echo "Running pdspana"
touch ana.log
starttime=`date +"%s"`.0
lar -c ${FCL_FILE} \
    -n ${nevents} \
    -T ${OUTFILE} \
    -s ${pfn_list}  >ana.log 2>&1
larExit=$?
endtime=`date +"%s"`.0

if [ $larExit -ne 0 ]; then
  echo "Error in ntuple production"
  cat ana.log
  exit $larExit
fi

echo "Ran successfully"

echo "Forming metadata"

### Get the metadata
python $NTUPLE_DIR/ntuple_prod_utils.py \
  metadata \
  --root_file ${OUTFILE} \
  --dids input_dids.list \
  --version ${DUNE_VERSION} \
  --fcl_name ${FCL_FILE} \
  -o $OUTFILE.json
  #--log_file md.log \
mdExit=$?
if [ $mdExit -ne 0 ]; then
  echo "Error in ntuple metdata production"
  cat md.log
  exit $mdExit
fi

echo "formed"
cat ${OUTFILE}.json

echo "$pfn_list" > justin-processed-pfns.txt
justIN time: 2024-11-24 00:41:14 UTC       justIN version: 01.01.09