Fixes to Timer logic - #3488
Conversation
|
Shouldn't "stop" imply a "flush" if we want to maintain the timing API? There isn't a way to "pause" a timer, as "start" resets the accumulated time. Thus stop should imply flush. |
The logic has always been that durations are logged with the Timer is destroyed.
There was a |
That is a bit tedious on the python side, as a user would manually have to delete a timer if it is not made with a context manager, or call flush explicitly. This assumption has at least never been documented on the Python-side of things. I am ok with forcing a While looking through this, I also observe that the docs are wrong in C++: |
|
The Python wrappers could call |
This also allowed for one less state to manage in the Timer and thus simpler logic. I think keeping the states to a minimum is best here. What do we need the |
If we use the |
There are users who use stop/resume. It wasn't covered by tests (it is now), but that doesn't mean it's not used. Timings should only be logged to when finished (by the destructor, or when manually flushed), otherwise the logger counter get messed up. |
* Update CI versions and behavior * Refactor timings, due to: FEniCS/dolfinx#3487 FEniCS/dolfinx#3488 * API changes from: FEniCS/dolfinx#3500 * Fix demo * Install boost * Set tag * Only check docker on release branch * Fixes for refernece value size * More timing fixes * Another round of timing changes * Remove last old timing instance
The logic behind the interaction between
TimerandTimeLoggerwas messed up. This attempts to fix it without interface changes.Improves and fixes tests.