-
Notifications
You must be signed in to change notification settings - Fork 31
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
Reduce time-tracking overhead #1988
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## develop #1988 +/- ##
===========================================
+ Coverage 75.92% 76.08% +0.15%
===========================================
Files 76 76
Lines 12995 13002 +7
===========================================
+ Hits 9867 9893 +26
+ Misses 3128 3109 -19
Flags with carried forward coverage won't be shown. Click here to find out more.
|
* Don't check `clock()` on every rhs evaluation, but only every 1000. * Avoid `clock()` completely, if there is no max time specified.
...models/amici_models/piecewise_with_boolean_operations/piecewise_with_boolean_operations_xB.h
Outdated
Show resolved
Hide resolved
Co-authored-by: Fabian Fröhlich <[email protected]>
src/solver_cvodes.cpp
Outdated
// Avoid expensive syscalls by checking only every N rhs evaluations | ||
static int eval_counter = 0; | ||
int const interval = 1000; | ||
if (++eval_counter / interval) { |
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.
What about rather extending solver->timeExceeded()
by adding the counter as private member of solver and checking against that in every call?
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.
Thought about it, but it wouldn't work with
Line 148 in eba2cad
if(ex.error_code == AMICI_RHSFUNC_FAIL && solver.timeExceeded()) { |
There we want to check on every call. Would have to add some force_check=True argument or a separate method.
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.
Thought about it, but it wouldn't work with
Line 148 in eba2cad
if(ex.error_code == AMICI_RHSFUNC_FAIL && solver.timeExceeded()) { There we want to check on every call. Would have to add some force_check=True argument or a separate method.
I think I would prefer that.
SonarCloud Quality Gate failed. |
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.
👍
clock()
on every rhs evaluation, but only every 500.clock()
completely, if there is no max time specified.