-
Notifications
You must be signed in to change notification settings - Fork 105
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
Reset threads at the beginning of every simulation #1583
Comments
Sounds reasonable - where would you like to do that? I am also not sure whether there should be an option to disable it. |
Good question. It would be nice if that happened right in the Instead, maybe put it in the semidiscretize? I guess it's really unlikely that someone breaks the threading and then only calls |
When I'm breaking threading on purpose (e.g., by running different simulation setups and recording the time when they crash), I usually don't use a
On the other hand, it also breaks the single-purpose rule since |
For the record: The required version of Polyester.jl for this is v0.7.5. |
I agree. However, as you pointed out, there is no perfect (or "clean") place for this unless we want to add another callback or something similar, which is akin to just adding the reset statement directly to each elixir.
To keep it flexible, we could consider adding it as a kwarg to |
Originally posted by @ranocha in JuliaSIMD/Polyester.jl#30 (comment)
With this, I suggest to always call
reset_threads!
at the beginning of each simulation from within Trixi.When Trixi crashes due to an error inside a threaded loop, and sometimes when one interrupts a simulation, threading breaks. I got used to calling the PolyesterWeave.jl and ThreadingUtilities.jl version manually every time I interrupt a simulation to avoid running non-threaded simulations accidentally. I thought about doing that automatically in TrixiParticles, but adding more dependencies was a big downside. Now, I feel like it's a no-brainer.
The text was updated successfully, but these errors were encountered: