Skip to content

Commit

Permalink
workflow: Avoid overwriting GEN_TOPO_MYDIR
Browse files Browse the repository at this point in the history
  • Loading branch information
davidrohr committed Feb 11, 2023
1 parent 8c15bde commit a61b705
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 32 deletions.
8 changes: 4 additions & 4 deletions prodtests/full-system-test/async_tmux.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

MYDIR="$(dirname $(realpath $0))"
source $MYDIR/setenv.sh
[[ -z $GEN_TOPO_MYDIR ]] GEN_TOPO_MYDIR="$(dirname $(realpath $0))"
source $GEN_TOPO_MYDIR/setenv.sh

# This sets up the hardcoded configuration to run the async full system test workflow on the EPN
if [ $GPUTYPE == "CPU" ]; then
Expand Down Expand Up @@ -36,6 +36,6 @@ export NTIMEFRAMES=$((($NTIMEFRAMES + 1) / 2))
rm -f /dev/shm/*fmq*

tmux -L ASYNC \
new-session "sleep 0; NUMAID=0 $MYDIR/dpl-workflow.sh $LOGCMD0; $ENDCMD" \; \
split-window "sleep 2; NUMAID=1 $MYDIR/dpl-workflow.sh $LOGCMD1; $ENDCMD" \; \
new-session "sleep 0; NUMAID=0 $GEN_TOPO_MYDIR/dpl-workflow.sh $LOGCMD0; $ENDCMD" \; \
split-window "sleep 2; NUMAID=1 $GEN_TOPO_MYDIR/dpl-workflow.sh $LOGCMD1; $ENDCMD" \; \
select-layout even-vertical
2 changes: 1 addition & 1 deletion prodtests/full-system-test/calib-workflow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
source $O2DPG_ROOT/DATA/common/setenv.sh
source $O2DPG_ROOT/DATA/common/setenv_calib.sh

if [[ -z "$WORKFLOW" ]] || [[ -z "$MYDIR" ]]; then
if [[ -z "$WORKFLOW" ]] || [[ -z "$GEN_TOPO_MYDIR" ]]; then
echo This script must be called from the dpl-workflow.sh and not standalone 1>&2
exit 1
fi
Expand Down
4 changes: 2 additions & 2 deletions prodtests/full-system-test/datadistribution.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

MYDIR="$(dirname $(realpath $0))"
source $MYDIR/setenv.sh
[[ -z $GEN_TOPO_MYDIR ]] GEN_TOPO_MYDIR="$(dirname $(realpath $0))"
source $GEN_TOPO_MYDIR/setenv.sh

if [[ `which StfBuilder 2> /dev/null | wc -l` == "0" ]]; then
eval "`alienv shell-helper`"
Expand Down
14 changes: 7 additions & 7 deletions prodtests/full-system-test/dpl-workflow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

# ---------------------------------------------------------------------------------------------------------------------
# Get this script's directory and load common settings (use zsh first (e.g. on Mac) and fallback on `readlink -f` if zsh is not there)
MYDIR="$(dirname $(realpath $0))"
source $MYDIR/gen_topo_helper_functions.sh
source $MYDIR/setenv.sh
[[ -z $GEN_TOPO_MYDIR ]] GEN_TOPO_MYDIR="$(dirname $(realpath $0))"
source $GEN_TOPO_MYDIR/gen_topo_helper_functions.sh
source $GEN_TOPO_MYDIR/setenv.sh

if [[ $EPNSYNCMODE == 0 && $DPL_CONDITION_BACKEND != "http://o2-ccdb.internal" && $DPL_CONDITION_BACKEND != "http://localhost:8084" && $DPL_CONDITION_BACKEND != "http://127.0.0.1:8084" ]]; then
alien-token-info >& /dev/null
Expand All @@ -26,8 +26,8 @@ workflow_has_parameter GPU && { export GPUTYPE=HIP; export NGPUS=4; }

# ---------------------------------------------------------------------------------------------------------------------
# Set general arguments
source $MYDIR/getCommonArgs.sh
source $MYDIR/workflow-setup.sh
source $GEN_TOPO_MYDIR/getCommonArgs.sh
source $GEN_TOPO_MYDIR/workflow-setup.sh
workflow_has_parameter CALIB && { source $O2DPG_ROOT/DATA/common/setenv_calib.sh; [[ $? != 0 ]] && exit 1; }

[[ -z $SHM_MANAGER_SHMID ]] && ( [[ $EXTINPUT == 1 ]] || [[ $NUMAGPUIDS != 0 ]] ) && ARGS_ALL+=" --no-cleanup"
Expand Down Expand Up @@ -466,8 +466,8 @@ fi

# ---------------------------------------------------------------------------------------------------------------------
# Calibration workflows
workflow_has_parameter CALIB && { source ${CALIB_WF:-$MYDIR/calib-workflow.sh}; [[ $? != 0 ]] && exit 1; }
workflow_has_parameters CALIB CALIB_LOCAL_INTEGRATED_AGGREGATOR && { source ${CALIB_AGGREGATOR_WF:-$MYDIR/aggregator-workflow.sh}; [[ $? != 0 ]] && exit 1; }
workflow_has_parameter CALIB && { source ${CALIB_WF:-$GEN_TOPO_MYDIR/calib-workflow.sh}; [[ $? != 0 ]] && exit 1; }
workflow_has_parameters CALIB CALIB_LOCAL_INTEGRATED_AGGREGATOR && { source ${CALIB_AGGREGATOR_WF:-$GEN_TOPO_MYDIR/aggregator-workflow.sh}; [[ $? != 0 ]] && exit 1; }

# ---------------------------------------------------------------------------------------------------------------------
# Event display
Expand Down
4 changes: 2 additions & 2 deletions prodtests/full-system-test/raw-reader.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ if [ "0$O2_ROOT" == "0" ]; then
alienv --no-refresh load O2/latest
fi

MYDIR="$(dirname $(realpath $0))"
source $MYDIR/setenv.sh
[[ -z $GEN_TOPO_MYDIR ]] GEN_TOPO_MYDIR="$(dirname $(realpath $0))"
source $GEN_TOPO_MYDIR/setenv.sh

ARGS_ALL="--session ${OVERRIDE_SESSION:-default} --shm-throw-bad-alloc 0 --no-cleanup"
if [[ $NUMAGPUIDS == 1 ]]; then
Expand Down
6 changes: 3 additions & 3 deletions prodtests/full-system-test/run-workflow-on-inputlist.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

MYDIR="$(dirname $(realpath $0))"
[[ -z $GEN_TOPO_MYDIR ]] GEN_TOPO_MYDIR="$(dirname $(realpath $0))"

if [[ -z $1 || -z $2 ]]; then
echo "ERROR: Command line arguments missing. Syntax: run-workflow-on-inputlist.sh [CTF | DD | TF] [name of file with list of files to be processed] [Timeout in seconds (optional: default = disabled)] [Log to stdout (optional: default = enabled)]"
Expand Down Expand Up @@ -60,7 +60,7 @@ echo "Processing $2 in $1 mode"
if [[ $1 == "DD" ]]; then
export EXTINPUT=1
export DD_STARTUP_DELAY=5
start_process $MYDIR/datadistribution.sh
start_process $GEN_TOPO_MYDIR/datadistribution.sh
elif [[ $1 == "CTF" ]]; then
export CTFINPUT=1
elif [[ $1 == "TF" ]]; then
Expand All @@ -72,7 +72,7 @@ else
exit 1
fi

start_process ${DPL_WORKFLOW_FROM_OUTSIDE:-$MYDIR/dpl-workflow.sh}
start_process ${DPL_WORKFLOW_FROM_OUTSIDE:-$GEN_TOPO_MYDIR/dpl-workflow.sh}

if [[ "0$4" != "00" ]]; then
sleep 1
Expand Down
4 changes: 2 additions & 2 deletions prodtests/full-system-test/shm-tool.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[[ -z $SHMSIZE ]] && export SHMSIZE=$(( 112 << 30 )) # Please keep these defaults in sync with those in start_tmux.sh
[[ -z $DDSHMSIZE ]] && export DDSHMSIZE=$(( 112 << 10 ))

MYDIR="$(dirname $(realpath $0))"
source $MYDIR/setenv.sh
[[ -z $GEN_TOPO_MYDIR ]] GEN_TOPO_MYDIR="$(dirname $(realpath $0))"
source $GEN_TOPO_MYDIR/setenv.sh

o2-epn-shm-manager --shmid $SHM_MANAGER_SHMID --segments 0,$SHMSIZE,0 1,$SHMSIZE,1 2,$((10<<20)),-1 --regions 100,$(($DDSHMSIZE << 20)),-1 101,$(($DDHDRSIZE << 20)),-1 --nozero
18 changes: 9 additions & 9 deletions prodtests/full-system-test/start_tmux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ if [[ -z "${WORKFLOW_PARAMETERS+x}" ]]; then
fi
[[ -z "${SEVERITY}" ]] && export SEVERITY="important"

MYDIR="$(dirname $(realpath $0))"
source $MYDIR/setenv.sh
[[ -z $GEN_TOPO_MYDIR ]] GEN_TOPO_MYDIR="$(dirname $(realpath $0))"
source $GEN_TOPO_MYDIR/setenv.sh

if [[ "0$FST_TMUX_NO_EPN" != "01" ]]; then
# This sets up the hardcoded configuration to run the full system workflow on the EPN
Expand Down Expand Up @@ -110,28 +110,28 @@ if [[ ! -z $FST_TMUX_SINGLENUMA ]]; then
fi

if workflow_has_parameter CALIB_PROXIES; then
CALIB_COMMAND="$MYDIR/aggregator-workflow.sh"
CALIB_COMMAND="$GEN_TOPO_MYDIR/aggregator-workflow.sh"
CALIB_TASKS="BARREL_TF CALO_TF FORWARD_TF BARREL_SPORADIC" # CALO_SPORADIC MUON_TF MUON_SPORADIC
else
CALIB_TASKS=
fi

if [ "0$FST_TMUX_BATCH_MODE" == "01" ]; then
{ sleep $FST_SLEEP0; eval "NUMAID=0 $MYDIR/dpl-workflow.sh ${LOGCMD/\[REPLACE]/0}"; eval "$ENDCMD"; } &
{ sleep $FST_SLEEP1; eval "NUMAID=1 $MYDIR/dpl-workflow.sh ${LOGCMD/\[REPLACE]/1}"; eval "$ENDCMD"; } &
{ sleep $FST_SLEEP2; eval "SEVERITY=debug numactl --interleave=all $MYDIR/$CMD ${LOGCMD/\[REPLACE]/2}"; eval "$KILLCMD $ENDCMD"; } &
{ sleep $FST_SLEEP0; eval "NUMAID=0 $GEN_TOPO_MYDIR/dpl-workflow.sh ${LOGCMD/\[REPLACE]/0}"; eval "$ENDCMD"; } &
{ sleep $FST_SLEEP1; eval "NUMAID=1 $GEN_TOPO_MYDIR/dpl-workflow.sh ${LOGCMD/\[REPLACE]/1}"; eval "$ENDCMD"; } &
{ sleep $FST_SLEEP2; eval "SEVERITY=debug numactl --interleave=all $GEN_TOPO_MYDIR/$CMD ${LOGCMD/\[REPLACE]/2}"; eval "$KILLCMD $ENDCMD"; } &
for i in $CALIB_TASKS; do
{ eval "AGGREGATOR_TASKS=$i $CALIB_COMMAND ${LOGCMD/\[REPLACE]/3_${i}}"; eval "$ENDCMD"; } &
done
wait
else
TMUX_SPLIT_COMMAND="split-window"
TMUX_COMMAND="tmux -L FST"
TMUX_COMMAND+=" new-session \"sleep $FST_SLEEP0; NUMAID=0 $MYDIR/dpl-workflow.sh ${LOGCMD/\[REPLACE]/0}; $ENDCMD\" ';'"
TMUX_COMMAND+=" new-session \"sleep $FST_SLEEP0; NUMAID=0 $GEN_TOPO_MYDIR/dpl-workflow.sh ${LOGCMD/\[REPLACE]/0}; $ENDCMD\" ';'"
for i in `seq 1 $(($NUM_DPL_WORKFLOWS - 1))`; do
TMUX_COMMAND+=" $TMUX_SPLIT_COMMAND \"sleep $FST_SLEEP1; NUMAID=$i $MYDIR/dpl-workflow.sh ${LOGCMD/\[REPLACE]/1}; $ENDCMD\" ';'"
TMUX_COMMAND+=" $TMUX_SPLIT_COMMAND \"sleep $FST_SLEEP1; NUMAID=$i $GEN_TOPO_MYDIR/dpl-workflow.sh ${LOGCMD/\[REPLACE]/1}; $ENDCMD\" ';'"
done
TMUX_COMMAND+=" $TMUX_SPLIT_COMMAND \"sleep $FST_SLEEP2; SEVERITY=debug numactl --interleave=all $MYDIR/$CMD; $KILLCMD $ENDCMD\" ';'"
TMUX_COMMAND+=" $TMUX_SPLIT_COMMAND \"sleep $FST_SLEEP2; SEVERITY=debug numactl --interleave=all $GEN_TOPO_MYDIR/$CMD; $KILLCMD $ENDCMD\" ';'"
FIRST_CALIB=1
for i in $CALIB_TASKS; do
TMUX_COMMAND+=" $TMUX_SPLIT_COMMAND \"AGGREGATOR_TASKS=$i $CALIB_COMMAND ${LOGCMD/\[REPLACE]/3_${i}}; $ENDCMD\" ';'"
Expand Down
4 changes: 2 additions & 2 deletions prodtests/full-system-test/tf-reader.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ if [ "0$O2_ROOT" == "0" ]; then
alienv --no-refresh load O2/latest
fi

MYDIR="$(dirname $(realpath $0))"
source $MYDIR/setenv.sh
[[ -z $GEN_TOPO_MYDIR ]] GEN_TOPO_MYDIR="$(dirname $(realpath $0))"
source $GEN_TOPO_MYDIR/setenv.sh

ARGS_ALL="--session ${OVERRIDE_SESSION:-default} --shm-throw-bad-alloc 0 --no-cleanup"
if [[ $NUMAGPUIDS == 1 ]]; then
Expand Down

0 comments on commit a61b705

Please sign in to comment.