From 2324750ff43bef8c2dfbbb42050439f67e930483 Mon Sep 17 00:00:00 2001 From: Erik Faulhaber <44124897+efaulhaber@users.noreply.github.com> Date: Sun, 11 Oct 2026 11:19:26 +0300 Subject: [PATCH 1/2] Fix timers with TimerOutputs v1 --- src/callbacks/info.jl | 2 +- test/callbacks/info.jl | 17 +++++++---------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/callbacks/info.jl b/src/callbacks/info.jl index 28e8af885d..70f4cc1c0a 100644 --- a/src/callbacks/info.jl +++ b/src/callbacks/info.jl @@ -293,6 +293,6 @@ function print_summary(integrator) # Print timer TimerOutputs.complement!(timer()) print_timer(timer(), title="TrixiParticles.jl", - allocations=true, linechars=:unicode, compact=false) + allocations=true, linechars=:unicode, compact=false, bars=false) println() end diff --git a/test/callbacks/info.jl b/test/callbacks/info.jl index 16d27df443..420446c8a0 100644 --- a/test/callbacks/info.jl +++ b/test/callbacks/info.jl @@ -148,17 +148,16 @@ TrixiParticles.isfinished(::NamedTuple) = true TrixiParticles.derivative_discontinuity!(::NamedTuple, _) = nothing + # Reset the timer to make the timer table independent of previous tests + TrixiParticles.reset_timer!(TrixiParticles.timer()) + expected = """ ──────────────────────────────────────────────────────────────────────────────────────────────────── Trixi simulation finished. Final time: 23.0 Time steps: 453 (accepted) 472 (total) ──────────────────────────────────────────────────────────────────────────────────────────────────── - - TrixiParticles.jl - ──────────────────────────────────────────────────────────── - Time Allocations - ───────────────── ──────────────────""" + """ # Redirect `stdout` to a string pipe = Pipe() @@ -171,6 +170,8 @@ @test startswith(output, expected) # TimerOutputs controls the table layout, which differs between versions. @test occursin(r"TrixiParticles\.jl[\s─]*Time\s+Allocations", output) + # With `bars=true`, there would be extra spacing between "avg" and "alloc". + @test occursin("\n Section ncalls time %tot avg alloc %tot avg\n", output) end @testset verbose=true "affect! finished with split integration" begin @@ -200,11 +201,7 @@ Time steps: 123 (accepted) 150 (total) Split integration time steps: 938 (accepted) 1023 (total) ──────────────────────────────────────────────────────────────────────────────────────────────────── - - TrixiParticles.jl - ──────────────────────────────────────────────────────────── - Time Allocations - ───────────────── ──────────────────""" + """ # Redirect `stdout` to a string pipe = Pipe() From 8f9757d57b4abf8db27bad43084609e2c20ddfb2 Mon Sep 17 00:00:00 2001 From: Erik Faulhaber <44124897+efaulhaber@users.noreply.github.com> Date: Sun, 11 Oct 2026 11:26:12 +0300 Subject: [PATCH 2/2] Reformat --- test/callbacks/info.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/callbacks/info.jl b/test/callbacks/info.jl index 420446c8a0..10990fc22c 100644 --- a/test/callbacks/info.jl +++ b/test/callbacks/info.jl @@ -171,7 +171,8 @@ # TimerOutputs controls the table layout, which differs between versions. @test occursin(r"TrixiParticles\.jl[\s─]*Time\s+Allocations", output) # With `bars=true`, there would be extra spacing between "avg" and "alloc". - @test occursin("\n Section ncalls time %tot avg alloc %tot avg\n", output) + @test occursin("\n Section ncalls time %tot avg alloc %tot avg\n", + output) end @testset verbose=true "affect! finished with split integration" begin