|
1 | 1 | #!/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 |
17 | 9 |
|
18 | 10 | # Settings for some EPN paths / names / etc. |
19 | 11 | [ -z "$FILEWORKDIR" ] && export FILEWORKDIR=/home/epn/odc/files # Path to common grp / geometry / etc files |
20 | 12 | [ -z "$INRAWCHANNAME" ] && export INRAWCHANNAME=tf-builder-pipe-0 # Pipe name to get data from TfBuilder |
21 | 13 | [ -z "$CTF_DIR" ] && export CTF_DIR=/data/tf/compressed # Output directory for CTFs |
22 | 14 | [ -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 |
25 | 17 | [ -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 |
26 | 20 |
|
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. |
32 | 22 | if [[ "0$GEN_TOPO_RUN_HOME" == "01" ]]; then |
33 | 23 | [[ $WORKFLOWMODE != "print" ]] && { echo "ERROR: GEN_TOPO_RUN_HOME is only supported with WORKFLOWMODE=print!" 1>&2; exit 1; } |
34 | 24 | else |
35 | 25 | # 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. |
36 | 28 | if [[ `module info-loaded ODC 2> /dev/null | grep ODC | wc -l` == 0 ]]; then |
37 | 29 | module load ODC 1>&2 || { echo Error loading ODC / O2DPG 1>&2; exit 1; } |
38 | 30 | 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. |
39 | 34 | if [[ -z $O2DPG_ROOT ]]; then |
40 | 35 | O2DPG_ROOT=`bash -c "module load O2DPG > /dev/null; echo \\\$O2DPG_ROOT;"` |
41 | 36 | fi |
42 | 37 | 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. |
43 | 39 | $O2DPG_ROOT/DATA/tools/epn/gen_topo_o2dpg.sh |
44 | 40 | if [ $? != 0 ]; then |
45 | 41 | echo topology generation failed 1>&2 |
|
0 commit comments