justIN           Dashboard       Workflows       Jobs       AWT       Sites       Storages       Docs       Login

Workflow 2128, Stage 1

Priority50
Processors1
Wall seconds80000
RSS bytes4194304000 (4000 MiB)
Max distance for inputs30.0
Enabled input RSEs
Enabled output RSEs
Enabled sites
Scopefardet-hd
Events for this stage

Output patterns

 DestinationPatternLifetimeFor next stage
0Rucio fardet-hd:fardet-hd-reco2_ritm2032831_atmnu_skip100000_limit15000_2128*reco2.root5184000False

Environment variables

NameValue
CONVERT_DIR/cvmfs/fifeuser1.opensciencegrid.org/sw/dune/44d20531d7f4df4da7bdbbf128916be0f41363ca

File states

Total filesFindingUnallocatedAllocatedOutputtingProcessedNot foundFailed
15000000014983017

Job states

TotalSubmittedStartedProcessingOutputtingFinishedNotusedAbortedStalledJobscript errorOutputting failedNone processed
1747500001579901142025500
Files processed0040040080080012001200160016002000200024002400280028003200320036003600May-10 01:00May-10 02:00May-10 03:00May-10 04:00May-10 05:00May-10 06:00May-10 07:00May-10 08:00Files processedBin start timesNumber per binUS_NotreDameUS_ColoradoUK_BrunelIT_CNAFCERNUS_UCSDCA_VictoriaUS_UChicagoUS_PuertoRicoES_PICUK_SheffieldCZ_FZUNL_SURFsaraUK_LiverpoolUK_OxfordUK_LancasterUK_RAL-Tier1US_FNAL-T1US_FNAL-FermiG…US_FNAL-FermiGridUK_QMULUK_EdinburghUK_DurhamUK_ManchesterUK_ImperialUS_BNLNL_NIKHEFFR_CCIN2P3CA_SFU
Replicas per RSE15000490.025244.515000269.975244.50000000000003Replicas per RSEDUNE_FR_CCIN2P3_DISK (50%)DUNE_US_BNL_SDCC (50%)

RSEs used

NameInputsOutputs
DUNE_FR_CCIN2P3_DISK11374419
DUNE_US_BNL_SDCC4143557
DUNE_CERN_EOS04430
DUNE_US_FNAL_DISK_STAGE03180
RAL_ECHO01451
QMUL01317
PRAGUE01089
RAL-PP01045
SURFSARA0847
NIKHEF0376
DUNE_ES_PIC0272

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
US_NotreDame1983
CERN270
US_UCSD171
US_PuertoRico90
US_FNAL-FermiGrid70
UK_Manchester50
NL_SURFsara30
UK_Imperial20
UK_QMUL20
UK_Edinburgh11
UK_Liverpool10
UK_Brunel10

Jobscript

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


##TODO -- write usage



DETECTOR="${DETPROD:-HD}"

## Build up the fcls to use
if [ "${DETECTOR}" = "HD" ]; then
  RECOFCL="reco2_atmos_dune10kt_1x2x6_geov5.fcl"
  MDDETTYPE="fardet-hd"

elif [ "${DETECTOR}" = "TEST" ]; then
  RECOFCL="${INPUT_TAR_DIR_LOCAL}/test.fcl"

elif [ "${DETECTOR}" = "TEST2" ]; then
  RECOFCL="${INPUT_TAR_DIR_LOCAL}/test2.fcl"

else
  echo "NEED TO REQUEST EITHER HD OR VD. USER REQUESTED ${DETECTOR}"
  exit 1
fi

echo "Using Reco fcl: ${RECOFCL}"

#Setup recent lar software suite
setup dunesw \
   "${DUNE_VERSION:-v09_89_01d01}" \
   -q "${DUNE_QUALIFIER:-e26:prof}"
echo "printing env"
env


##Force certain env vars to force good behavior
#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   

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 "Will use justin-get-file"
#
DID_PFN_RSE=`$JUSTIN_PATH/justin-get-file`
#getfileExit=$?

#if [ $getfileExit -ne 0 ] ; then
#  # Success !
#  # Error -- exit immediately 
#  jobscriptExit=1
#  echo "Error in justin-get-file"
#  exit $jobscriptExit
#fi

##Check that any file was returned
if [ "${DID_PFN_RSE}" == "" ] ; then
  echo "Could not get file"
  exit 0
fi

FILE=`echo ${DID_PFN_RSE} | cut -f2 -d' '`
DID=`echo ${DID_PFN_RSE} | cut -f1 -d' '`
echo "DID: ${DID}"

metacat file show -mj ${DID} > old_md.json
mcExit=$?
if [ $mcExit -eq 0 ] ; then
  echo "old metadata:"
  cat old_md.json
else
  echo "Could not retrieve old metadata"
  exit 1 
fi

#
#
now=$(date -u +"%Y%m%dT%H%M%SZ")
#OUTFILE="${OUTPREFIX:-fd_mc_prod_test}.${JUSTIN_REQUEST_ID}"
#OUTFILE="$OUTFILE.$JUSTIN_JOBSUB_ID.${now}"
#OUTFILE=`echo $OUTFILE | sed -e 's/@/./'`
#
####Run reco2
lar -c "${RECOFCL}" \
    -n "${NEVENTS:--1}" \
    "$FILE" >reco2.log 2>&1
    #-o "$OUTFILE.root" \
    #-n "${NEVENTS:--1}" \
    #"$FILE" >$OUTFILE.log 2>&1

larExit=$?
echo "Reco step lar exit code $larExit"

if [ $larExit -eq 0 ] ; then
  # Success !
  # Log the file for justin and move on to the next step
  echo "Moving on to metadata extractor "
else
  # Error -- exit immediately 
  #jobscriptExit=1
  tail -100 reco2.log
  exit $larExit 
fi

if [ "${DETECTOR}" = "TEST" ] || [ "${DETECTOR}" = "TEST2" ]; then
  echo "Done testing. Exiting"
  exit 0
fi
ORIG_OUTFILE=`ls *reco2.root`
OUTFILE=`echo "${ORIG_OUTFILE}_${now}_reco2" | sed -e 's/reco2.root//'`

mv ${ORIG_OUTFILE} ${OUTFILE}.root

### Get the metadata
##TODO -- convert this is the right file extensions
extractor_prod.py --infile ${OUTFILE}.root --campaign ${CAMPAIGN:-fd_mc_he_2023a_reco2} \
                  --requestid ritm2032831 --no_crc > ${OUTFILE}.root.json
extractorExit=$?
if [ $extractorExit -eq 0 ] ; then
  # Success !
  echo "Extracted metadata"
else
  # Error -- exit immediately 
  jobscriptExit=1
  echo "Failed to extract md"
  exit $extractorExit
fi

### Convert the metadata to metacat
##TODO -- make sure the RCDS behavior is correct
python $CONVERT_DIR/convert_metadata.py -i ${OUTFILE}.root.json \
                                                -c ${RECOFCL} -j old_md.json \
                                                --app "art.reco2" \
                                                --app_ver "${DUNE_VERSION:-v09_85_00d00}" \
                                                --det "${MDDETTYPE}" \
                                                --parent ${DID}
converterExit=$?
if [ $converterExit -eq 0 ] ; then
  # Success !
  echo "Converted metadata"
  echo "$FILE" > justin-processed-pfns.txt
else
  # Error -- exit immediately 
  jobscriptExit=1
  echo "Failed to convert md"
  exit $converterExit
fi

ls
exit 0
justIN time: 2024-11-17 05:42:05 UTC       justIN version: 01.01.09