-
Notifications
You must be signed in to change notification settings - Fork 5
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
Introduce timers with the @timeit_debug
macro
#50
Conversation
- Allows enabling/disabling timers - Disabled by default
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if we want to keep the timers in the long term, but I think that during development it's worth having them directly in the main branch.
|
||
tsunami_update!(@view(states.particles[:,ip]), hm, hn, fn, fm, fe, gg, params) | ||
@timeit_debug timer "Particle State Update" begin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't try, but I think you can put @timeit_debug timer "Particle State Update"
right before the for
loop in the next line? That line becomes a bit long, but at least you don't need a whole new begin
-end
block here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you can't
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally I'd put the timer on the line inside the loop, but I think there was some issue with threads
@@ -91,6 +91,7 @@ Base.@kwdef struct tdac_params{T<:AbstractFloat} | |||
obs_noise_amplitude::T = 1.0 | |||
|
|||
random_seed::Int = 12345 | |||
enable_timers::Bool = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it worth documenting it or you prefer to keep this field out of casual users' reach?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, right, forgot to update the docstring
@timeit_debug
macro
I'm tired of maintaining separate branches with timers. I discovered there is a
@timeit_debug
macro that can be enabled/disabled. I added a parameter that enables the timers and set it to disabled by default. I think we can merge this into master, the only downside I see is it makes the code a bit cluttered.