Skip to content
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

Add Wfact and Wfact_t support #149

Merged
merged 2 commits into from
Aug 28, 2019
Merged

Add Wfact and Wfact_t support #149

merged 2 commits into from
Aug 28, 2019

Conversation

devmotion
Copy link
Member

This PR adds support for Wfact and Wfact_t (see #138).

I added more tests but probably someone should check if my implementations of Wfact and Wfact_t are correct.

The tests indicate that the support and statistics for Jacobian and W evaluations can (and should) be improved a lot in OrdinaryDiffEq. Maybe the tests are too ambitious for the current state of the implementation, but at the moment 33 of 68 tests are broken.

@test sol.t ≈ sol_Wfact_t.t
@test sol.u ≈ sol_Wfact_t.u
else
@test_broken sol.t ≈ sol_Wfact_t.t
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that means it's not working, since IIRC at this point only Rosenbrock23 is using the untransformed version still?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, as I said, maybe it's a bit too ambitious at this point. The main motivation of the tests is that:

  1. If we specify the Jacobian, the number of Jacobian and W evaluations should be equal to the non-zero value of our counter, and the solution should be the same.
  2. If we specify Wfact or Wfact_t, the number of Jacobian evaluations should be zero and the number of W evaluations should be equal to the non-zero value of our counter, and the solution should be the same.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see: the time points are equal, not that the value is correct. Yeah, I am not sure this will be the case, since symbolic CSE stuff happens on the symbolic factorization (the main source of the speedup)

@devmotion
Copy link
Member Author

What is this waiting for? Should the tests be changed?

@ChrisRackauckas
Copy link
Member

I think the tests should be changed: I wouldn't expect W_fact to get the exact same floating point value results, just in the same tolerances.

@ChrisRackauckas ChrisRackauckas merged commit 1576486 into master Aug 28, 2019
@ChrisRackauckas
Copy link
Member

That said the rest of the PR is fine so I'm willing to merge.

@ChrisRackauckas ChrisRackauckas deleted the Wfact branch August 28, 2019 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants