Skip to content

Commit a4f859c

Browse files
authored
Debug mode for topology generation (#1460)
1 parent 843a100 commit a4f859c

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

DATA/tools/epn/gen_topo.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ if [[ -z "$EPN2EOS_METAFILES_DIR" ]] && [[ "0$WORKFLOWMODE" != "0print" ]]; then
1818
export EPN2EOS_METAFILES_DIR=/data/epn2eos_tool/epn2eos # Directory for epn2eos meta data files
1919
fi
2020
if [[ $USER == "epn" ]]; then
21-
[[ -z "$GEN_TOPO_WORKDIR" ]] && export GEN_TOPO_WORKDIR=/scratch/services/gen_topo # Working directory for checkout of O2DPG repository and for XML cache. If this directory is wiped, gen_topo will recreate all necessary content the next time it runs. The folder should be persistent to cache workflows.
21+
if [[ "${GEN_TOPO_DEPLOYMENT_TYPE:-}" == "ALICE_STAGING" ]]; then
22+
[[ -z "$GEN_TOPO_WORKDIR" ]] && export GEN_TOPO_WORKDIR=/scratch/services/staging_gen_topo # Working directory for checkout of O2DPG repository and for XML cache. If this directory is wiped, gen_topo will recreate all necessary content the next time it runs. The folder should be persistent to cache workflows.
23+
else
24+
[[ -z "$GEN_TOPO_WORKDIR" ]] && export GEN_TOPO_WORKDIR=/scratch/services/gen_topo # Working directory for checkout of O2DPG repository and for XML cache. If this directory is wiped, gen_topo will recreate all necessary content the next time it runs. The folder should be persistent to cache workflows.
25+
fi
2226
else
2327
[[ -z "$GEN_TOPO_WORKDIR" ]] && export GEN_TOPO_WORKDIR=$HOME/gen_topo # Working directory for checkout of O2DPG repository and for XML cache. If this directory is wiped, gen_topo will recreate all necessary content the next time it runs. The folder should be persistent to cache workflows.
2428
mkdir -p $HOME/gen_topo

DATA/tools/epn/gen_topo_o2dpg.sh

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,15 @@ if [[ -z "$MULTIPLICITY_FACTOR_REST" ]]; then echo \$MULTIPLICITY_FACTOR_REST mi
2222
if [[ -z "$RECOSHMSIZE" ]]; then echo \$RECOSHMSIZE missing; exit 1; fi # SHM Size for reconstruction collections
2323
if [[ -z "$DDSHMSIZE" ]]; then echo \$DDSHMSIZE missing; exit 1; fi # SHM Size for DD
2424

25+
# In case of debug mode, overwrite some settings
26+
if [[ "${DEBUG_TOPOLOGY_GENERATION:=0}" == "1" ]]; then
27+
echo "Debugging mode enabled. Setting options accordingly" 1>&2
28+
RECO_NUM_NODES_OVERRIDE=1 # to avoid slurm query, specify number of nodes to fixed value
29+
GEN_TOPO_MI100_NODES=1 # also for MI100 nodes
30+
GEN_TOPO_OVERRIDE_TEMPDIR=$PWD # keep temporary files like QC jsons in local directory
31+
EPN2EOS_METAFILES_DIR=/tmp # nothing is written here, just needs to be set to something
32+
fi
33+
2534
# Check settings coming from the EPN
2635
if [[ -z "$FILEWORKDIR" ]]; then echo \$FILEWORKDIR missing; exit 1; fi
2736
if [[ -z "$INRAWCHANNAME" ]]; then echo \$INRAWCHANNAME missing; exit 1; fi
@@ -103,6 +112,7 @@ while true; do
103112
break
104113
done
105114

115+
106116
if [[ ! -z "$GEN_TOPO_ODC_EPN_TOPO_POST_CACHING_CMD" ]] && [[ "0$WORKFLOWMODE" != "0print" ]]; then
107117
TMP_POST_CACHING_CMD="$GEN_TOPO_ODC_EPN_TOPO_POST_CACHING_CMD $GEN_TOPO_ODC_EPN_TOPO_POST_CACHING_ARGS"
108118
TMP_POST_CACHING_NMIN=$(( $RECO_NUM_NODES_OVERRIDE > $RECO_MAX_FAIL_NODES_OVERRIDE ? $RECO_NUM_NODES_OVERRIDE - $RECO_MAX_FAIL_NODES_OVERRIDE : 0 ))
@@ -126,6 +136,9 @@ if [[ ! -z "$ECS_ENVIRONMENT_ID" && -d "/var/log/topology/" && $USER == "epn" ]]
126136
fi
127137

128138
cat $GEN_TOPO_WORKDIR/output.xml
129-
echo Removing temporary output file $GEN_TOPO_WORKDIR/output.xml 1>&2
130-
rm $GEN_TOPO_WORKDIR/output.xml
139+
140+
if [[ "$DEBUG_TOPOLOGY_GENERATION" == "0" ]]; then
141+
echo Removing temporary output file $GEN_TOPO_WORKDIR/output.xml 1>&2
142+
rm $GEN_TOPO_WORKDIR/output.xml
143+
fi
131144
rm -f $GEN_TOPO_LOCKFILE

0 commit comments

Comments
 (0)