Skip to content

Commit

Permalink
fix: allow empty XRD URL overrides for local read/write
Browse files Browse the repository at this point in the history
  • Loading branch information
wdconinc authored Dec 21, 2024
1 parent f74d8d4 commit 220d6d6
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions scripts/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ fi
# Output location
BASEDIR=${DATADIR:-${PWD}}

# XRD Write locations
XRDWURL="xroots://dtn2201.jlab.org/"
# XRD Write locations (allow for empty URL override)
XRDWURL=${XRDWURL-"xroots://dtn2201.jlab.org/"}
XRDWBASE=${XRDWBASE:-"/eic/eic2/EPIC"}

# XRD Read locations
XRDRURL="root://dtn-eic.jlab.org/"
XRDRBASE="/work/eic2/EPIC"
# XRD Read locations (allow for empty URL override)
XRDRURL=${XRDRURL-"root://dtn-eic.jlab.org/"}
XRDRBASE=${XRDRBASE:-"/work/eic2/EPIC"}

# Local temp dir
echo "SLURM_TMPDIR=${SLURM_TMPDIR:-}"
Expand Down Expand Up @@ -178,7 +178,11 @@ mkdir -p ${RECO_TEMP}
if [ "${COPYFULL:-false}" == "true" ] ; then
# Token for write authentication
export BEARER_TOKEN=$(cat ${_CONDOR_CREDS}/eic.use)
xrdfs ${XRDWURL} mkdir -p ${XRDWBASE}/${FULL_DIR} || echo "Cannot write simulation outputs to xrootd server"
if [ -n ${XRDWURL} ] ; then
xrdfs ${XRDWURL} mkdir -p ${XRDWBASE}/${FULL_DIR} || echo "Cannot write simulation outputs to xrootd server"
else
mkdir -p ${XRDWBASE}/${FULL_DIR} || echo "Cannot write simulation outputs to xrootd server"
fi
xrdcp --force --recursive ${FULL_TEMP}/${TASKNAME}.edm4hep.root ${XRDWURL}/${XRDWBASE}/${FULL_DIR}
fi

Expand Down Expand Up @@ -206,13 +210,21 @@ ls -al ${LOG_TEMP}/${TASKNAME}.*
if [ "${COPYRECO:-false}" == "true" ] ; then
# Token for write authentication
export BEARER_TOKEN=$(cat ${_CONDOR_CREDS}/eic.use)
xrdfs ${XRDWURL} mkdir -p ${XRDWBASE}/${RECO_DIR} || echo "Cannot write reconstructed outputs to xrootd server"
if [ -n ${XRDWURL} ] ; then
xrdfs ${XRDWURL} mkdir -p ${XRDWBASE}/${RECO_DIR} || echo "Cannot write reconstructed outputs to xrootd server"
else
mkdir -p ${XRDWBASE}/${RECO_DIR} || echo "Cannot write reconstructed outputs to xrootd server"
fi
xrdcp --force --recursive ${RECO_TEMP}/${TASKNAME}*.edm4eic.root ${XRDWURL}/${XRDWBASE}/${RECO_DIR}
fi
if [ "${COPYLOG:-false}" == "true" ] ; then
# Token for write authentication
export BEARER_TOKEN=$(cat ${_CONDOR_CREDS}/eic.use)
xrdfs ${XRDWURL} mkdir -p ${XRDWBASE}/${LOG_DIR} || echo "Cannot write log outputs to xrootd server"
if [ -n ${XRDWURL} ] ; then
xrdfs ${XRDWURL} mkdir -p ${XRDWBASE}/${LOG_DIR} || echo "Cannot write log outputs to xrootd server"
else
mkdir -p ${XRDWBASE}/${LOG_DIR} || echo "Cannot write log outputs to xrootd server"
fi
xrdcp --force --recursive ${LOG_TEMP}/${TASKNAME}.* ${XRDWURL}/${XRDWBASE}/${LOG_DIR}
fi

Expand Down

0 comments on commit 220d6d6

Please sign in to comment.