Skip to content

Commit a368e23

Browse files
committed
Add env options GEN_TOPO_EPN_CCDB_SERVER and GEN_TOPO_EPN_CCDB_SERVER + cleanup
1 parent 03954f2 commit a368e23

File tree

3 files changed

+57
-25
lines changed

3 files changed

+57
-25
lines changed

DATA/tools/epn/gen_topo.sh

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,41 @@
11
#!/bin/bash
2-
# Settings coming from AliECS via env variables
3-
if [ -z $GEN_TOPO_PARTITION ]; then echo \$GEN_TOPO_PARTITION missing; exit 1; fi # Partition
4-
if [ -z $GEN_TOPO_HASH ]; then echo \$GEN_TOPO_HASH missing; exit 1; fi # Flag whether source is a hash or a folder
5-
if [ -z $GEN_TOPO_SOURCE ]; then echo \$GEN_TOPO_SOURCE missing; exit 1; fi # O2DPG repository source, either a commit hash or a path
6-
if [ -z $GEN_TOPO_LIBRARY_FILE ]; then echo \$GEN_TOPO_LIBRARY_FILE missing; exit 1; fi # Topology description library file in the DATA path of the O2DPG repository
7-
if [ -z $GEN_TOPO_WORKFLOW_NAME ]; then echo \$GEN_TOPO_WORKFLOW_NAME missing; exit 1; fi # Workflow name in library file
8-
if [ -z ${WORKFLOW_DETECTORS+x} ]; then echo \$WORKFLOW_DETECTORS missing; exit 1; fi # Comma-separated list of detectors to run processing for
9-
if [ -z ${WORKFLOW_DETECTORS_QC+x} ]; then echo \$WORKFLOW_DETECTORS_QC missing; exit 1; fi # Comma-separated list of detectors to run QC for
10-
if [ -z ${WORKFLOW_DETECTORS_CALIB+x} ]; then echo \$WORKFLOW_DETECTORS_CALIB missing; exit 1; fi # Comma-separated list of detectors to run calibration for
11-
if [ -z ${WORKFLOW_PARAMETERS+x} ]; then echo \$WORKFLOW_PARAMETERS missing; exit 1; fi # Additional parameters for workflow
12-
if [ -z ${RECO_NUM_NODES_OVERRIDE+x} ]; then echo \$RECO_NUM_NODES_OVERRIDE missing; exit 1; fi # Override number of nodes
13-
if [ -z $DDMODE ] && [ -z $DDWORKFLOW ]; then echo Either \$DDMODE or \$DDWORKFLOW must be set; exit 1; fi # Select data distribution workflow
14-
if [ -z "$MULTIPLICITY_FACTOR_RAWDECODERS" ]; then echo \$MULTIPLICITY_FACTOR_RAWDECODERS missing; exit 1; fi # Process multiplicity scaling parameter
15-
if [ -z "$MULTIPLICITY_FACTOR_CTFENCODERS" ]; then echo \$MULTIPLICITY_FACTOR_CTFENCODERS missing; exit 1; fi # Process multiplicity scaling parameter
16-
if [ -z "$MULTIPLICITY_FACTOR_REST" ]; then echo \$MULTIPLICITY_FACTOR_REST missing; exit 1; fi # Process multiplicity scaling parameter
2+
3+
# This is a wrapper script that sets EPN-related env variables needed for the PDP DPL Topology generation.
4+
# Author: David Rohr
5+
6+
# A reference version of this script is contained in the O2DPG repository: https://github.com/AliceO2Group/O2DPG/blob/master/DATA/tools/epn/gen_topo.sh
7+
8+
# The purpose of this script is to separate the topology generation (which is in O2DPG) from the setting of the EPN-related settings
179

1810
# Settings for some EPN paths / names / etc.
1911
[ -z "$FILEWORKDIR" ] && export FILEWORKDIR=/home/epn/odc/files # Path to common grp / geometry / etc files
2012
[ -z "$INRAWCHANNAME" ] && export INRAWCHANNAME=tf-builder-pipe-0 # Pipe name to get data from TfBuilder
2113
[ -z "$CTF_DIR" ] && export CTF_DIR=/data/tf/compressed # Output directory for CTFs
2214
[ -z "$CTF_METAFILES_DIR" ] && [ "0$WORKFLOWMODE" != "0print" ] && export CTF_METAFILES_DIR=/data/epn2eos_tool/epn2eos #CTF Metafiles directory
23-
[ -z "$GEN_TOPO_WORKDIR" ] && export GEN_TOPO_WORKDIR=$HOME/gen_topo/${GEN_TOPO_PARTITION}_${GEN_TOPO_ONTHEFLY} # Persistent working directory for checkout of O2DPG repository and for XML cache. Must be per partition. This script must not run twice in parallel with the same workdir
24-
[ -z "$GEN_TOPO_STDERR_LOGGING" ] && export GEN_TOPO_STDERR_LOGGING=1
15+
[ -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.
16+
[ -z "$GEN_TOPO_STDERR_LOGGING" ] && export GEN_TOPO_STDERR_LOGGING=1 # Enable logging of stderr messages
2517
[ -z "$IS_SIMULATED_DATA" ] && export IS_SIMULATED_DATA=0 # by default we are processing raw data
18+
[ -z "$GEN_TOPO_ODC_EPN_TOPO_ARGS" ] && export GEN_TOPO_ODC_EPN_TOPO_ARGS="--recown 'wn_(?"'!'"online-calib).*_.*' --calibwn 'wn_online-calib_.*'" # Arguments to pass to odc-epn-topo command
19+
[ -z "$GEN_TOPO_EPN_CCDB_SERVER" ] && export GEN_TOPO_EPN_CCDB_SERVER="http://o2-ccdb.internal" # CCDB server to use
2620

27-
if [[ "0$DDMODE" == "0discard" ]] || [[ "0$DDMODE" == "0disk" ]]; then
28-
export GEN_TOPO_LIBRARY_FILE="production/no-processing.desc"
29-
export GEN_TOPO_WORKFLOW_NAME="no-processing"
30-
fi
31-
21+
# GEN_TOPO_RUN_HOME is a debug setting used in some tests. This is not needed for online running.
3222
if [[ "0$GEN_TOPO_RUN_HOME" == "01" ]]; then
3323
[[ $WORKFLOWMODE != "print" ]] && { echo "ERROR: GEN_TOPO_RUN_HOME is only supported with WORKFLOWMODE=print!" 1>&2; exit 1; }
3424
else
3525
# Load required module and run gen_topo_o2dpg (PDP part of this script)
26+
# This makes sure to load ODC only when it is not already in the environment.
27+
# The background is that in the online system ODC is already loaded, but for tests it might not be loaded thus we just load the latest available versions for convenience.
3628
if [[ `module info-loaded ODC 2> /dev/null | grep ODC | wc -l` == 0 ]]; then
3729
module load ODC 1>&2 || { echo Error loading ODC / O2DPG 1>&2; exit 1; }
3830
fi
31+
# Set O2DPG_ROOT from the latest available O2DPG module, if not already set.
32+
# Note that this does not load the module, but just needs an O2DPG path to find, which then does the bulk of the topology generation.
33+
# gen_topo_o2dpg.sh is kept compatible between O2DPG versions, thus it doesn't really depend on which O2DPG version we use at this point.
3934
if [[ -z $O2DPG_ROOT ]]; then
4035
O2DPG_ROOT=`bash -c "module load O2DPG > /dev/null; echo \\\$O2DPG_ROOT;"`
4136
fi
4237
fi
38+
# Now we know which gen_topo_o2dpg.sh we can use, and all EPN related env variables are set, so we can run the topology generation.
4339
$O2DPG_ROOT/DATA/tools/epn/gen_topo_o2dpg.sh
4440
if [ $? != 0 ]; then
4541
echo topology generation failed 1>&2

DATA/tools/epn/gen_topo_o2dpg.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,40 @@
11
#!/bin/bash
2+
3+
# Check settings coming from AliECS via env variables
4+
if [ -z $GEN_TOPO_PARTITION ]; then echo \$GEN_TOPO_PARTITION missing; exit 1; fi # Partition
5+
if [ -z $GEN_TOPO_HASH ]; then echo \$GEN_TOPO_HASH missing; exit 1; fi # Flag whether source is a hash or a folder
6+
if [ -z $GEN_TOPO_SOURCE ]; then echo \$GEN_TOPO_SOURCE missing; exit 1; fi # O2DPG repository source, either a commit hash or a path
7+
if [ -z $GEN_TOPO_LIBRARY_FILE ]; then echo \$GEN_TOPO_LIBRARY_FILE missing; exit 1; fi # Topology description library file in the DATA path of the O2DPG repository
8+
if [ -z $GEN_TOPO_WORKFLOW_NAME ]; then echo \$GEN_TOPO_WORKFLOW_NAME missing; exit 1; fi # Workflow name in library file
9+
if [ -z ${WORKFLOW_DETECTORS+x} ]; then echo \$WORKFLOW_DETECTORS missing; exit 1; fi # Comma-separated list of detectors to run processing for
10+
if [ -z ${WORKFLOW_DETECTORS_QC+x} ]; then echo \$WORKFLOW_DETECTORS_QC missing; exit 1; fi # Comma-separated list of detectors to run QC for
11+
if [ -z ${WORKFLOW_DETECTORS_CALIB+x} ]; then echo \$WORKFLOW_DETECTORS_CALIB missing; exit 1; fi # Comma-separated list of detectors to run calibration for
12+
if [ -z ${WORKFLOW_PARAMETERS+x} ]; then echo \$WORKFLOW_PARAMETERS missing; exit 1; fi # Additional parameters for workflow
13+
if [ -z ${RECO_NUM_NODES_OVERRIDE+x} ]; then echo \$RECO_NUM_NODES_OVERRIDE missing; exit 1; fi # Override number of nodes
14+
if [ -z $DDMODE ] && [ -z $DDWORKFLOW ]; then echo Either \$DDMODE or \$DDWORKFLOW must be set; exit 1; fi # Select data distribution workflow
15+
if [ -z "$MULTIPLICITY_FACTOR_RAWDECODERS" ]; then echo \$MULTIPLICITY_FACTOR_RAWDECODERS missing; exit 1; fi # Process multiplicity scaling parameter
16+
if [ -z "$MULTIPLICITY_FACTOR_CTFENCODERS" ]; then echo \$MULTIPLICITY_FACTOR_CTFENCODERS missing; exit 1; fi # Process multiplicity scaling parameter
17+
if [ -z "$MULTIPLICITY_FACTOR_REST" ]; then echo \$MULTIPLICITY_FACTOR_REST missing; exit 1; fi # Process multiplicity scaling parameter
18+
19+
# Check settings coming from the EPN
20+
if [ -z "$FILEWORKDIR" ]; then echo \$FILEWORKDIR missing; exit 1; fi
21+
if [ -z "$INRAWCHANNAME" ]; then echo \$INRAWCHANNAME missing; exit 1; fi
22+
if [ -z "$CTF_DIR" ]; then echo \$CTF_DIR missing; exit 1; fi
23+
if [ -z "$CTF_METAFILES_DIR" ]; then echo \$CTF_METAFILES_DIR missing; exit 1; fi
24+
if [ -z "$GEN_TOPO_WORKDIR" ]; then echo \$GEN_TOPO_WORKDIR missing; exit 1; fi
25+
if [ -z "$GEN_TOPO_STDERR_LOGGING" ]; then echo \$GEN_TOPO_STDERR_LOGGING missing; exit 1; fi
26+
if [ -z "$IS_SIMULATED_DATA" ]; then echo \$IS_SIMULATED_DATA missing; exit 1; fi
27+
if [ -z "$GEN_TOPO_ODC_EPN_TOPO_ARGS" ]; then echo \$GEN_TOPO_ODC_EPN_TOPO_ARGS missing; exit 1; fi
28+
if [ -z "$GEN_TOPO_EPN_CCDB_SERVER" ]; then echo \$GEN_TOPO_EPN_CCDB_SERVER missing; exit 1; fi
29+
30+
31+
export GEN_TOPO_WORKDIR=$GEN_TOPO_WORKDIR/${GEN_TOPO_PARTITION}_${GEN_TOPO_ONTHEFLY}
32+
33+
if [[ "0$DDMODE" == "0discard" ]] || [[ "0$DDMODE" == "0disk" ]]; then
34+
export GEN_TOPO_LIBRARY_FILE="production/no-processing.desc"
35+
export GEN_TOPO_WORKFLOW_NAME="no-processing"
36+
fi
37+
238
mkdir -p $GEN_TOPO_WORKDIR/cache || { echo Error creating directory 1>&2; exit 1; }
339
if [ $GEN_TOPO_HASH == 1 ]; then
440
cd $GEN_TOPO_WORKDIR || { echo Cannot enter work dir 1>&2; exit 1; }

DATA/tools/parse

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ for line in f:
127127
if 'RECO_MAX_FAIL_NODES_OVERRIDE' in os.environ and os.environ['RECO_MAX_FAIL_NODES_OVERRIDE'] != "":
128128
reconodesmin = max(1, reconodes - int(os.environ['RECO_NUM_NODES_OVERRIDE']))
129129
if os.environ['WORKFLOWMODE'] == 'dds':
130-
odccommand = "odc-epn-topo"
130+
odccommand = "odc-epn-topo " + os.environ['GEN_TOPO_ODC_EPN_TOPO_ARGS']
131131
if reconodes:
132132
replacestring = ""
133133
dd_env_variables = ['DD_DISK_FRACTION']
@@ -143,11 +143,11 @@ for line in f:
143143
fddout.close()
144144
odccommand += " --dd " + filename
145145
if len(recoworkflows):
146-
odccommand += " --recown 'wn_(?!online-calib).*_.*' --reco " + " ".join(recoworkflows)
146+
odccommand += " --reco " + " ".join(recoworkflows)
147147
odccommand += " --n " + str(reconodes)
148148
# odccommand += " --nmin " + str(reconodesmin) # Currently disabled, since odc-epn-topo does not accept --nmin
149149
if len(calibworkflows):
150-
odccommand += " --calibwn 'wn_online-calib_.*' --calib " + " ".join(calibworkflows)
150+
odccommand += " --calib " + " ".join(calibworkflows)
151151
if "GEN_TOPO_STDERR_LOGGING" in os.environ and int(os.environ['GEN_TOPO_STDERR_LOGGING']):
152152
odccommand += " --mon tools/monitoring_workflows/epnstderrlog.xml"
153153
if args[1] != "":

0 commit comments

Comments
 (0)