-
Notifications
You must be signed in to change notification settings - Fork 29
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
ParallelDynamicalSystem
for StroboscopicMap
and other API
#225
base: main
Are you sure you want to change the base?
Conversation
Hi @rusandris I see that this PR is still a draft? Perhaps you want to finish it (i.e., open it for review if it is ready)? |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #225 +/- ##
==========================================
+ Coverage 82.00% 84.44% +2.43%
==========================================
Files 15 17 +2
Lines 717 945 +228
==========================================
+ Hits 588 798 +210
- Misses 129 147 +18 ☔ View full report in Codecov by Sentry. |
This can be extended to |
And I still need to figure out how to solve the dispatching problem: creation of |
Let's leave this for another PR please because I just did a massive correctness improvement of the interface of PoincareMap in another PR. |
Is there anything outstanding for this PR? |
I just simply left it to be general. Now both ParallelDynamicalSystem(duffing_map,[[0.1,0.2],[0.3,0.4]])
ParallelDynamicalSystem(duffing_map,StateSpaceSet(rand(3,2))) create
I've seen it, good job btw. Since
I'm not sure if I understand your question, but the problem description and solution is in the first comment. Everything is related to this feature request, since this would allow an efficient implementation of the ensemble approach for nonautonomous systems ( |
Okay, so I don't understand: does this PR work? I see there are no changes at all to the |
I am really surprised how little changes you had to do in this PR for things to work, if that's the case! |
Yes. I think the "parallel stroboscopic" testset inside @testset "IIP=$iip" for (ds, iip) in zip((pds_cont_oop, pds_cont_iip,), (true, false))
test_dynamical_system(ds, u0, p0; idt = true, iip = true, test_trajectory = false)
end covers that. |
doesn't work either. Or was this fixed by v3.12.0 as well? I am still using v3.11.2 |
Unfortunately only relying on this test:
is not enough. Because the I don't think there is much meaning in calling trajectory with parallel dynamical systems. It should just throw an error saying "just loop the trajectory over the different initial conditions". Because the type of the output for |
As mentioned here, there is specialized parallel integrator for
CoupledODEs
and a generic fallback that copies systems for anything else. ButStroboscopicmap
is actually just an ODE under the hood.This PR attempts to implement the same specialized parallel
ODEProblem
that is built whenParallelDynamicalSystem(ds::CoreDynamicalSystem, states::Vector{<:AbstractArray{<:Real}})
is called on aCoupledODEs
system, but for theStroboscopicMap
. This is done by a new method that creates a parallel rule from the ODEs behind theStroboscopicMap
(parallel_rule(smap.ds, states)
).Example:
which creates a
ParallelDynamicalSystemAnalytic
.The problem is that
still dispatches to the
ParallelDiscreteTimeDynamicalSystem
generic fallback. Which is weird, right?I think it shouldn't depend on the type of the states, I need to think about this more.
Also, this PR contains a small fix for the
set_parameter!
method that dispatches to the generic fallback system (see #223 ).