forked from AliceO2Group/Run3AnalysisValidation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config_tasks_dummy.sh
78 lines (65 loc) · 2.08 KB
/
config_tasks_dummy.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/bin/bash
# shellcheck disable=SC2034 # Ignore unused parameters.
# Configuration of tasks for runtest.sh
# (Cleans directory, modifies step activation, modifies JSON, generates step scripts.)
# Mandatory functions:
# Clean Performs cleanup before (argument=1) and after (argument=2) running.
# AdjustJson Modifies the JSON file.
# MakeScriptAli Generates the AliPhysics script.
# MakeScriptO2 Generates the O2 script.
# MakeScriptPostprocess Generates the postprocessing script.
####################################################################################################
# Steps
DOCLEAN=1 # Delete created files (before and after running tasks).
DOCONVERT=1 # Convert AliESDs.root to AO2D.root.
DOALI=1 # Run AliPhysics tasks.
DOO2=1 # Run O2 tasks.
DOPOSTPROCESS=1 # Run output postprocessing. (Compare AliPhysics and O2 output.)
DEBUG=1 # Print out more information.
####################################################################################################
# Clean before (argument=1) and after (argument=2) running.
function Clean {
# Cleanup before running
[ "$1" -eq 1 ] && MsgWarn "Before"
# Cleanup after running
[ "$1" -eq 2 ] && MsgWarn "After"
return 0
}
# Modify the JSON file.
function AdjustJson {
MsgWarn "Running AdjustJson"
}
# Generate the O2 script containing the full workflow specification.
function MakeScriptO2 {
MsgWarn "Running MakeScriptO2"
O2EXEC="echo \"O2\""
O2EXEC+=" && cp \"\$FileIn\" $FILEOUT"
# Create the script with the full O2 command.
cat << EOF > "$SCRIPT_O2"
#!/bin/bash
FileIn="\$1"
JSON="\$2"
$O2EXEC
EOF
}
function MakeScriptAli {
MsgWarn "Running MakeScriptAli"
ALIEXEC="echo \"Ali\""
ALIEXEC+=" && cp \"\$FileIn\" $FILEOUT"
cat << EOF > "$SCRIPT_ALI"
#!/bin/bash
FileIn="\$1"
JSON="\$2"
$ALIEXEC
EOF
}
function MakeScriptPostprocess {
MsgWarn "Running MakeScriptPostprocess"
POSTEXEC="echo \"Postprocessing\""
cat << EOF > "$SCRIPT_POSTPROCESS"
#!/bin/bash
FileO2="\$1"
FileAli="\$2"
$POSTEXEC
EOF
}