Skip to content

Commit

Permalink
fix script bug
Browse files Browse the repository at this point in the history
  • Loading branch information
paulgessinger committed Mar 5, 2024
1 parent d77a9c3 commit 0291fb5
Showing 1 changed file with 20 additions and 15 deletions.
35 changes: 20 additions & 15 deletions CI/physmon/phys_perf_mon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ if [ "$(uname)" == "Darwin" ]; then
shift
echo "Measure Darwin $label"
tmp=$(mktemp)
/usr/bin/time -l -o "$tmp" "$@"
echo "+ $@" >&2
/usr/bin/time -l -o "$tmp" "$@"

of="${memory_dir}/mem_${slug}.csv"
{
Expand All @@ -70,6 +71,7 @@ elif [ "$(uname)" == "Linux" ]; then
shift
echo "Measure Linux $label"
tmp=$(mktemp)
echo "+ $@" >&2
/usr/bin/time -v -o "$tmp" "$@"
# in kbytes
max_rss=$(grep "Maximum resident set size (kbytes):" "$tmp" | awk '{printf $(NF)}')
Expand Down Expand Up @@ -98,7 +100,10 @@ else
export measure
fi

set +e
if [ -n "$CI" ]; then
echo "CI mode, do not abort immediately on failure"
set +e
fi
ec=0

source $SCRIPT_DIR/setup.sh
Expand All @@ -109,7 +114,7 @@ function run_physmon_gen() {

script=CI/physmon/workflows/physmon_${slug}.py

measure "$title" ${script} $outdir 2>&1 > $outdir/run_${slug}.log
measure "$title" "$slug" ${script} $outdir 2>&1 > $outdir/run_${slug}.log

this_ec=$?
ec=$(($ec | $this_ec))
Expand All @@ -120,7 +125,7 @@ function run_physmon_gen() {
echo "::notice::✅ Dataset generation succeeded: ${script}"
fi

$SPYRAL_BIN plot $outdir/memory/mem_${slug}.csv --output $outdir/memory
run $SPYRAL_BIN plot $outdir/memory/mem_${slug}.csv --output $outdir/memory
}

echo "::group::Generate validation dataset"
Expand Down Expand Up @@ -166,7 +171,7 @@ function run_histcmp() {
ec=1
fi

histcmp $a $b \
run histcmp $a $b \
--label-reference=reference \
--label-monitored=monitored \
--title="$title" \
Expand Down Expand Up @@ -212,7 +217,7 @@ function full_chain() {
ckf_${suffix} \
-c $config

Examples/Scripts/generic_plotter.py \
run Examples/Scripts/generic_plotter.py \
$outdir/performance_ivf_${suffix}.root \
vertexing \
$outdir/performance_ivf_${suffix}_hist.root \
Expand All @@ -229,7 +234,7 @@ function full_chain() {
"IVF ${suffix}" \
ivf_${suffix}

Examples/Scripts/generic_plotter.py \
run Examples/Scripts/generic_plotter.py \
$outdir/performance_amvf_${suffix}.root \
vertexing \
$outdir/performance_amvf_${suffix}_hist.root \
Expand All @@ -247,7 +252,7 @@ function full_chain() {
amvf_${suffix}

if [ $suffix == seeded ]; then
Examples/Scripts/generic_plotter.py \
run Examples/Scripts/generic_plotter.py \
$outdir/performance_amvf_gridseeder_${suffix}.root \
vertexing \
$outdir/performance_amvf_gridseeder_${suffix}_hist.root \
Expand All @@ -265,7 +270,7 @@ function full_chain() {
amvf_gridseeder_${suffix}
fi

Examples/Scripts/generic_plotter.py \
run Examples/Scripts/generic_plotter.py \
$outdir/tracksummary_ckf_${suffix}.root \
tracksummary \
$outdir/tracksummary_ckf_${suffix}_hist.root \
Expand All @@ -289,7 +294,7 @@ function simulation() {

config="CI/physmon/simulation_config.yml"

Examples/Scripts/generic_plotter.py \
run Examples/Scripts/generic_plotter.py \
$outdir/particles_${suffix}.root \
particles \
$outdir/particles_${suffix}_hist.root \
Expand Down Expand Up @@ -345,15 +350,15 @@ if [[ "$mode" == "all" || "$mode" == "fullchains" ]]; then
"Ambisolver " \
ambi_ttbar

Examples/Scripts/generic_plotter.py \
run Examples/Scripts/generic_plotter.py \
$outdir/performance_amvf_ttbar.root \
vertexing \
$outdir/performance_amvf_ttbar_hist.root \
--silent \
--config CI/physmon/vertexing_ttbar_config.yml
ec=$(($ec | $?))

Examples/Scripts/generic_plotter.py \
run Examples/Scripts/generic_plotter.py \
$outdir/tracksummary_ckf_ttbar.root \
tracksummary \
$outdir/tracksummary_ckf_ttbar_hist.root \
Expand All @@ -378,7 +383,7 @@ if [[ "$mode" == "all" || "$mode" == "fullchains" ]]; then
"AMVF ttbar" \
amvf_ttbar

Examples/Scripts/generic_plotter.py \
run Examples/Scripts/generic_plotter.py \
$outdir/performance_amvf_gridseeder_ttbar.root \
vertexing \
$outdir/performance_amvf_gridseeder_ttbar_hist.root \
Expand Down Expand Up @@ -424,7 +429,7 @@ if [[ "$mode" == "all" || "$mode" == "gx2f" ]]; then
fi

if [[ "$mode" == "all" || "$mode" == "vertexing" ]]; then
Examples/Scripts/vertex_mu_scan.py \
run Examples/Scripts/vertex_mu_scan.py \
$outdir/performance_vertexing_*mu*.root \
$outdir/vertexing_mu_scan.pdf

Expand All @@ -436,7 +441,7 @@ if [[ "$mode" == "all" || "$mode" == "simulation" ]]; then
simulation geant4
fi

CI/physmon/summary.py $histcmp_results \
run CI/physmon/summary.py $histcmp_results \
--md $outdir/summary.md \
--html $outdir/summary.html
ec=$(($ec | $?))
Expand Down

0 comments on commit 0291fb5

Please sign in to comment.