From dab364ac8a145078906abd3cb47fe55f805e3c10 Mon Sep 17 00:00:00 2001 From: Sandro Wenzel Date: Sat, 21 Nov 2026 14:59:19 +0100 Subject: [PATCH 1/2] Stop anchorMC when the reco workflow printout is missing This adds a check that workflowconfig.log contains the printed reco workflow of every step. - If the printout was lost, config-json.json was created with empty ConfigParams and passed the existing check. - The MC then ran the reconstruction without the anchored settings, for example ITS cluster squashing off. - Existing reco tags keep the O2 script that can lose the printout, so the check is needed independently of an O2 fix. - The check is added to anchorMC.sh and anchorMC_DataEmbedding.sh. https://its.cern.ch/jira/browse/O2-7359 Co-Authored-By: Claude Opus 5.5 --- MC/run/ANCHOR/anchorMC.sh | 7 +++++++ MC/run/ANCHOR/anchorMC_DataEmbedding.sh | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/MC/run/ANCHOR/anchorMC.sh b/MC/run/ANCHOR/anchorMC.sh index 4016c3e54..aed99c835 100755 --- a/MC/run/ANCHOR/anchorMC.sh +++ b/MC/run/ANCHOR/anchorMC.sh @@ -309,6 +309,13 @@ if [[ ! -f workflowconfig.log ]]; then echo "Workflowconfig.log file not found" exit 1 fi +# each reco step must have its workflow printout, otherwise the MC would run without the anchored reco settings +NRECOSTEPS=$(grep -c "^Step [0-9])" workflowconfig.log) +[[ ${NRECOSTEPS} -eq 0 ]] && NRECOSTEPS=1 +if [[ $(grep -c "#Workflow command" workflowconfig.log) -lt ${NRECOSTEPS} ]]; then + echo_error "workflowconfig.log does not contain the reco workflow of every step. Exiting." + exit 1 +fi export ALIEN_JDL_LPMPRODUCTIONTAG=$ALIEN_JDL_LPMPRODUCTIONTAG_KEEP echo_info "Setting back ALIEN_JDL_LPMPRODUCTIONTAG to $ALIEN_JDL_LPMPRODUCTIONTAG" diff --git a/MC/run/ANCHOR/anchorMC_DataEmbedding.sh b/MC/run/ANCHOR/anchorMC_DataEmbedding.sh index 01d40fef7..5874a0f02 100755 --- a/MC/run/ANCHOR/anchorMC_DataEmbedding.sh +++ b/MC/run/ANCHOR/anchorMC_DataEmbedding.sh @@ -315,6 +315,13 @@ if [[ ! -f workflowconfig.log ]]; then echo "Workflowconfig.log file not found" exit 1 fi +# each reco step must have its workflow printout, otherwise the MC would run without the anchored reco settings +NRECOSTEPS=$(grep -c "^Step [0-9])" workflowconfig.log) +[[ ${NRECOSTEPS} -eq 0 ]] && NRECOSTEPS=1 +if [[ $(grep -c "#Workflow command" workflowconfig.log) -lt ${NRECOSTEPS} ]]; then + echo_error "workflowconfig.log does not contain the reco workflow of every step. Exiting." + exit 1 +fi export ALIEN_JDL_LPMPRODUCTIONTAG=$ALIEN_JDL_LPMPRODUCTIONTAG_KEEP echo_info "Setting back ALIEN_JDL_LPMPRODUCTIONTAG to $ALIEN_JDL_LPMPRODUCTIONTAG" From ea3f2ff5096217058a3718d33cba3f949c36ba64 Mon Sep 17 00:00:00 2001 From: Sandro Wenzel Date: Sat, 21 Nov 2026 17:10:15 +0100 Subject: [PATCH 2/2] Also stop anchorMC on a truncated workflow printout This extends the workflowconfig.log check to printouts that were cut off part-way. - Such jobs kept the anchored settings only for the first executables of the reco workflow. - The check now also requires the final o2-dpl-run line for every step. https://its.cern.ch/jira/browse/O2-7359 Co-Authored-By: Claude Opus 5.5 --- MC/run/ANCHOR/anchorMC.sh | 6 +++--- MC/run/ANCHOR/anchorMC_DataEmbedding.sh | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/MC/run/ANCHOR/anchorMC.sh b/MC/run/ANCHOR/anchorMC.sh index aed99c835..9059673f5 100755 --- a/MC/run/ANCHOR/anchorMC.sh +++ b/MC/run/ANCHOR/anchorMC.sh @@ -309,11 +309,11 @@ if [[ ! -f workflowconfig.log ]]; then echo "Workflowconfig.log file not found" exit 1 fi -# each reco step must have its workflow printout, otherwise the MC would run without the anchored reco settings +# each reco step must have its complete workflow printout (ending with o2-dpl-run), otherwise the MC would run without the anchored reco settings NRECOSTEPS=$(grep -c "^Step [0-9])" workflowconfig.log) [[ ${NRECOSTEPS} -eq 0 ]] && NRECOSTEPS=1 -if [[ $(grep -c "#Workflow command" workflowconfig.log) -lt ${NRECOSTEPS} ]]; then - echo_error "workflowconfig.log does not contain the reco workflow of every step. Exiting." +if [[ $(grep -c "#Workflow command" workflowconfig.log) -lt ${NRECOSTEPS} || $(grep -c "^o2-dpl-run " workflowconfig.log) -lt ${NRECOSTEPS} ]]; then + echo_error "workflowconfig.log does not contain the complete reco workflow of every step. Exiting." exit 1 fi diff --git a/MC/run/ANCHOR/anchorMC_DataEmbedding.sh b/MC/run/ANCHOR/anchorMC_DataEmbedding.sh index 5874a0f02..313f913ec 100755 --- a/MC/run/ANCHOR/anchorMC_DataEmbedding.sh +++ b/MC/run/ANCHOR/anchorMC_DataEmbedding.sh @@ -315,11 +315,11 @@ if [[ ! -f workflowconfig.log ]]; then echo "Workflowconfig.log file not found" exit 1 fi -# each reco step must have its workflow printout, otherwise the MC would run without the anchored reco settings +# each reco step must have its complete workflow printout (ending with o2-dpl-run), otherwise the MC would run without the anchored reco settings NRECOSTEPS=$(grep -c "^Step [0-9])" workflowconfig.log) [[ ${NRECOSTEPS} -eq 0 ]] && NRECOSTEPS=1 -if [[ $(grep -c "#Workflow command" workflowconfig.log) -lt ${NRECOSTEPS} ]]; then - echo_error "workflowconfig.log does not contain the reco workflow of every step. Exiting." +if [[ $(grep -c "#Workflow command" workflowconfig.log) -lt ${NRECOSTEPS} || $(grep -c "^o2-dpl-run " workflowconfig.log) -lt ${NRECOSTEPS} ]]; then + echo_error "workflowconfig.log does not contain the complete reco workflow of every step. Exiting." exit 1 fi