Repository navigation
Expose the counters of the integrators for profiling - #1425
Merged
Merged
Conversation
Integrator::getStatistics returns the counters of the work of the integrator since the last resetStatistics, which RoadRunner calls when a simulation starts (simulate, and oneStep when it resets the integrator). In Python, r.integrator.getStatistics() returns them as a dict. CVODE returns the counters of CVODE (steps, RHS evaluations, error test failures, linear solver setups, nonlinear solver iterations and convergence failures, Jacobian evaluations, root function evaluations, ...) plus the number of events and of reinitializations, and the step sizes and orders of the last step. CVODE sets its counters to zero when roadrunner reinitializes it after an event, so the integrator sums them over the reinitializations. The counters of the linear solver interface are set to zero at the first step after a reinitialization, which the sum takes into account. With the new setting collect_timing it also measures the time of the integration, of the RHS and root function evaluations, and of the setups and solves of the linear solver, which it wraps for that. rk4, rk45, euler and gillespie return the counters that apply to them under the same keys. The SWIG typemap for a map of settings did not compile for a map returned by value, and leaked the keys and values of the dict. Both typemaps use the new settingsMap_to_py. Fixes sys-bio#1411.
CVODE is reinitialized at every root of its root functions, which includes a piecewise condition that switches without an event, and after a delayed event. The documentation of getStatistics said only after events.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Integrator::getStatistics returns the counters of the work of the
integrator since the last resetStatistics, which RoadRunner calls when a
simulation starts (simulate, and oneStep when it resets the
integrator). In Python, r.integrator.getStatistics() returns them as a
dict.
CVODE returns the counters of CVODE (steps, RHS evaluations, error test
failures, linear solver setups, nonlinear solver iterations and
convergence failures, Jacobian evaluations, root function evaluations,
...) plus the number of events and of reinitializations, and the step
sizes and orders of the last step. CVODE sets its counters to zero when
roadrunner reinitializes it after an event, so the integrator sums them
over the reinitializations. The counters of the linear solver interface
are set to zero at the first step after a reinitialization, which the
sum takes into account. With the new setting collect_timing it also
measures the time of the integration, of the RHS and root function
evaluations, and of the setups and solves of the linear solver, which
it wraps for that.
rk4, rk45, euler and gillespie return the counters that apply to them
under the same keys.
The SWIG typemap for a map of settings did not compile for a map
returned by value, and leaked the keys and values of the dict. Both
typemaps use the new settingsMap_to_py.
Fixes #1411.
Example with Chen_MSB2009 (500 species):