-
-
Notifications
You must be signed in to change notification settings - Fork 60
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
ArrayPartition Incompatible for Native Implicit SDE Solvers #358
Comments
I think you forgot the reproducer? |
@ChrisRackauckas ok, all the details are there now! |
@AayushSabharwal looks like it's due to some missing overload in the linear algebra after one of the RAT changes? |
I don't think it's linear algebra. |
This is fixed on latest versions. |
Bug Description 🐞
Using
ArrayPartition
fails when using implicit solvers such asSKenCarp
orImplicitEM
. It seems to be fine for the explicit solverSOSRA
, although I haven't tested it on any others.The one caveat, is that it appears to depend on the array dimensions (as demonstrated below). For very small arrays,
SKenCarp
has no problem with theArrayPartition
, but for anything larger than this, it throws aMethodError
. The error is raised because there is nostrides
method defined forArrayPartition
.I "fixed" this by overloading
strides
method, however anotherMethodError
is raised because there is nopointer
method defined forArrayPartition
.I suppose this makes sense, because as far as I am aware, an
ArrayPartition
does not correspond to single location in memory. As in, the partition is made up of multiple arrays, each of which have their own location in memory?Expected Behavior
The native
SKenCarp
solver (and native solvers in general) should solve the SDE just like it would for the explicitSOSRA
solver.Minimal Reproducible Example
Obviously a very basic SDE, but demonstrates the error:
I also tried to overload
strides
(essentially the same definition as inBase
):Error & Stacktrace⚠️
Output of
julia> example(slightly_larger_u0, SKenCarp())
Then, after "fixing" the
strides
bug:Output of
julia> example(slightly_larger_u0, SKenCarp())
Environment
Output of
pkg> status
Output of
pkg> status -m
Output of
julia> versioninfo()
Additional context
The problem I am working on is a system of stiff SDEs (eg
size(2,10)
[ndim, nparticles]) coupled to a diffusion PDE (egsize(51,51)
finite diff matrix).I really did not want to have to unravel this into a flat vector, especially because of all the unnecessary allocations with reshaping the
Array
s on every function call.Hence why, I have tried to use
ArrayPartition(rand(2,10), zeros(51,51))
, sinceVector{Array{Float64, 2}}
is not supported, and neither isVectorOfArray
.The text was updated successfully, but these errors were encountered: