Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests for TimerOutputs #31

Merged
merged 1 commit into from
Oct 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ TrixiBaseMPIExt = "MPI"

[compat]
MPI = "0.20"
TimerOutputs = "0.5"
TimerOutputs = "0.5.25"
julia = "1.8"

[extras]
52 changes: 26 additions & 26 deletions test/test_timers.jl
Original file line number Diff line number Diff line change
@@ -6,14 +6,14 @@
TrixiBase.TimerOutputs.reset_timer!(timer())

timer_output = """
────────────────────────────────────────────────────────────────────
Time Allocations
─────────────────────── ────────────────────────
Tot / % measured: 91.5s / 0.0% 5.43MiB / 0.0%

Section ncalls time %tot avg alloc %tot avg
────────────────────────────────────────────────────────────────────
────────────────────────────────────────────────────────────────────
────────────────────────────────────────────────────────────────────
Time Allocations
─────────────────────── ────────────────────────
Tot / % measured: 91.5s / 0.0% 5.43MiB / 0.0%

Section ncalls time %tot avg alloc %tot avg
────────────────────────────────────────────────────────────────────
────────────────────────────────────────────────────────────────────
"""
# Remove "Tot / % measured" line and trailing white spaces
expected = replace(timer_output, r"Tot / % measured: .*" => "",
@@ -34,15 +34,15 @@
@trixi_timeit timer() "test timer" sin(0.0)

timer_output = """
───────────────────────────────────────────────────────────────────────
Time Allocations
─────────────────────── ────────────────────────
Tot / % measured: 61.4ms / 99.2% 5.60MiB / 99.6%

Section ncalls time %tot avg alloc %tot avg
───────────────────────────────────────────────────────────────────────
test timer 2 60.9ms 100.0% 60.9ms 5.57MiB 100.0% 5.57MiB
───────────────────────────────────────────────────────────────────────
───────────────────────────────────────────────────────────────────────
Time Allocations
─────────────────────── ────────────────────────
Tot / % measured: 61.4ms / 99.2% 5.60MiB / 99.6%

Section ncalls time %tot avg alloc %tot avg
───────────────────────────────────────────────────────────────────────
test timer 2 60.9ms 100.0% 60.9ms 5.57MiB 100.0% 5.57MiB
───────────────────────────────────────────────────────────────────────
"""
# Remove "Tot / % measured" line and trailing white spaces and replace
# the "test timer" line (but don't remove it, we want to check that it's there).
@@ -77,15 +77,15 @@
println(timer())

timer_output = """
─────────────────────────────────────────────────────────────────────────
Time Allocations
─────────────────────── ────────────────────────
Tot / % measured: 23.7ms / 0.0% 1.00MiB / 0.0%

Section ncalls time %tot avg alloc %tot avg
─────────────────────────────────────────────────────────────────────────
test timer 2 1 875ns 100.0% 875ns 48.0B 100.0% 48.0B
─────────────────────────────────────────────────────────────────────────
─────────────────────────────────────────────────────────────────────────
Time Allocations
─────────────────────── ────────────────────────
Tot / % measured: 23.7ms / 0.0% 1.00MiB / 0.0%

Section ncalls time %tot avg alloc %tot avg
─────────────────────────────────────────────────────────────────────────
test timer 2 1 875ns 100.0% 875ns 48.0B 100.0% 48.0B
─────────────────────────────────────────────────────────────────────────
"""
# Remove "Tot / % measured" line and trailing white spaces and replace
# the "test timer" line (but don't remove it, we want to check that it's there).
Loading