From dfc4d1bd2c12fc45a64f4370a32778cbed28b98e Mon Sep 17 00:00:00 2001
From: Wouter Deconinck <wdconinc@gmail.com>
Date: Wed, 1 Feb 2023 22:53:15 +0000
Subject: [PATCH] tcs.sh: allow gaudirun $? == 4

---
 benchmarks/backgrounds/synchrotron.sh | 3 ++-
 benchmarks/dis/dis.sh                 | 2 +-
 benchmarks/dvcs/dvcs.sh               | 3 ++-
 benchmarks/dvmp/dvmp.sh               | 2 +-
 benchmarks/single/reconstruct.sh      | 2 +-
 benchmarks/tcs/tcs.sh                 | 2 +-
 benchmarks/u_omega/u_omega.sh         | 3 ++-
 7 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/benchmarks/backgrounds/synchrotron.sh b/benchmarks/backgrounds/synchrotron.sh
index bae4ec73..de796f4d 100644
--- a/benchmarks/backgrounds/synchrotron.sh
+++ b/benchmarks/backgrounds/synchrotron.sh
@@ -91,6 +91,7 @@ echo "DETECTOR    = ${DETECTOR}"
 ## Step 1. Get the data
 if [[ -n "${DATA_INIT}" || -n "${DO_ALL}" ]] ; then
   mc -C . config host add S3 https://dtn01.sdcc.bnl.gov:9000 $S3_ACCESS_KEY $S3_SECRET_KEY
+  set +o pipefail
   mc -C . head -n $((2+5*${JUGGLER_N_EVENTS})) --insecure ${DATA_URL} | sanitize_hepmc3 > ${JUGGLER_MC_FILE}
   if [[ "$?" -ne "0" ]] ; then
     echo "Failed to download hepmc files"
@@ -126,7 +127,7 @@ if [[ -n "${DO_REC}" || -n "${DO_ALL}" ]] ; then
   fi
 
   if [[ ${RECO} == "juggler" ]] ; then
-    gaudirun.py options/reconstruction.py
+    gaudirun.py options/reconstruction.py || [ $? -eq 4 ]
     if [ "$?" -ne "0" ] ; then
       echo "ERROR running juggler"
       exit 1
diff --git a/benchmarks/dis/dis.sh b/benchmarks/dis/dis.sh
index b3851707..243de8f3 100755
--- a/benchmarks/dis/dis.sh
+++ b/benchmarks/dis/dis.sh
@@ -91,7 +91,7 @@ fi
 if [[ ${RECO} == "juggler" ]] ; then
   export JUGGLER_SIM_FILE=${SIM_FILE}
   export JUGGLER_REC_FILE=${REC_FILE}
-  gaudirun.py options/reconstruction.py
+  gaudirun.py options/reconstruction.py || [ $? -eq 4 ]
   if [ "$?" -ne "0" ] ; then
     echo "ERROR running juggler"
     exit 1
diff --git a/benchmarks/dvcs/dvcs.sh b/benchmarks/dvcs/dvcs.sh
index deb95f0b..1bb063e1 100644
--- a/benchmarks/dvcs/dvcs.sh
+++ b/benchmarks/dvcs/dvcs.sh
@@ -91,6 +91,7 @@ echo "DETECTOR    = ${DETECTOR}"
 ## Step 1. Get the data
 if [[ -n "${DATA_INIT}" || -n "${DO_ALL}" ]] ; then
   mc -C . config host add S3 https://dtn01.sdcc.bnl.gov:9000 $S3_ACCESS_KEY $S3_SECRET_KEY
+  set +o pipefail
   mc -C . head  -n 1004 --insecure ${DATA_URL} |  sanitize_hepmc3 > "${JUGGLER_MC_FILE}"
   if [[ "$?" -ne "0" ]] ; then
     echo "Failed to download hepmc file"
@@ -126,7 +127,7 @@ if [[ -n "${DO_REC}" || -n "${DO_ALL}" ]] ; then
   fi
 
   if [[ ${RECO} == "juggler" ]] ; then
-    gaudirun.py options/reconstruction.py
+    gaudirun.py options/reconstruction.py || [ $? -eq 4 ]
     if [ "$?" -ne "0" ] ; then
       echo "ERROR running juggler"
       exit 1
diff --git a/benchmarks/dvmp/dvmp.sh b/benchmarks/dvmp/dvmp.sh
index 96274fcb..8fba7f3d 100755
--- a/benchmarks/dvmp/dvmp.sh
+++ b/benchmarks/dvmp/dvmp.sh
@@ -95,7 +95,7 @@ if [ ${RECO} == "eicrecon" ] ; then
 fi
 
 if [[ ${RECO} == "juggler" ]] ; then
-  gaudirun.py options/reconstruction.py
+  gaudirun.py options/reconstruction.py || [ $? -eq 4 ]
   if [ "$?" -ne "0" ] ; then
     echo "ERROR running juggler"
     exit 1
diff --git a/benchmarks/single/reconstruct.sh b/benchmarks/single/reconstruct.sh
index 2e95c83c..bfcbed6e 100644
--- a/benchmarks/single/reconstruct.sh
+++ b/benchmarks/single/reconstruct.sh
@@ -13,7 +13,7 @@ if [ ${RECO} == "eicrecon" ] ; then
 fi
 
 if [[ ${RECO} == "juggler" ]] ; then
-  gaudirun.py options/reconstruction.py
+  gaudirun.py options/reconstruction.py || [ $? -eq 4 ]
   if [ "$?" -ne "0" ] ; then
     echo "ERROR running juggler"
     exit 1
diff --git a/benchmarks/tcs/tcs.sh b/benchmarks/tcs/tcs.sh
index 4ceb8c67..a260f78a 100644
--- a/benchmarks/tcs/tcs.sh
+++ b/benchmarks/tcs/tcs.sh
@@ -146,7 +146,7 @@ if [[ -n "${DO_REC}" || -n "${DO_ALL}" ]] ; then
   fi
 
   if [[ ${RECO} == "juggler" ]] ; then
-    gaudirun.py options/reconstruction.py
+    gaudirun.py options/reconstruction.py || [ $? -eq 4 ]
     if [ "$?" -ne "0" ] ; then
       echo "ERROR running juggler"
       exit 1
diff --git a/benchmarks/u_omega/u_omega.sh b/benchmarks/u_omega/u_omega.sh
index e29810c4..095a6a1e 100644
--- a/benchmarks/u_omega/u_omega.sh
+++ b/benchmarks/u_omega/u_omega.sh
@@ -90,6 +90,7 @@ echo "DETECTOR    = ${DETECTOR}"
 ## Step 1. Get the data
 if [[ -n "${DATA_INIT}" || -n "${DO_ALL}" ]] ; then
   mc -C . config host add S3 https://dtn01.sdcc.bnl.gov:9000 $S3_ACCESS_KEY $S3_SECRET_KEY
+  set +o pipefail
   mc -C . head  -n 1004  --insecure ${DATA_URL} | sanitize_hepmc3 > "${JUGGLER_MC_FILE}"
   if [[ "$?" -ne "0" ]] ; then
     echo "Failed to download hepmc file"
@@ -125,7 +126,7 @@ if [[ -n "${DO_REC}" || -n "${DO_ALL}" ]] ; then
   fi
 
   if [[ ${RECO} == "juggler" ]] ; then
-    gaudirun.py options/reconstruction.py
+    gaudirun.py options/reconstruction.py || [ $? -eq 4 ]
     if [ "$?" -ne "0" ] ; then
       echo "ERROR running juggler"
       exit 1
-- 
GitLab