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

Introduce multi-ranges and use views for operator splitting #148

Open
termi-official opened this issue Sep 17, 2024 · 2 comments
Open

Introduce multi-ranges and use views for operator splitting #148

termi-official opened this issue Sep 17, 2024 · 2 comments
Labels
architecture Issues affecting the structural and design aspects of the software performance Something affecting the performance (e.g. scalability or flat runtime)

Comments

@termi-official
Copy link
Owner

Currently we copy (and hence duplicate) solutions between integrators in operator splitting procedures. However, we could work on views instead, which should reduce the memory overhead quite a bit.

@termi-official termi-official added performance Something affecting the performance (e.g. scalability or flat runtime) architecture Issues affecting the structural and design aspects of the software labels Sep 17, 2024
@kylebeggs
Copy link
Collaborator

So just to make sure I understand this issue completely - using the parlance from https://termi-official.github.io/Thunderbolt.jl/dev/topics/time-integration/ suppose we have two subproblems, $F_1$ and $F_2$, where $F_1$ has $N_1$ elements and $F_2$ has $N_2$ elements. We wish to be able to have a single parent solution vector, $u$, which is $N_1 + N_2$ elements in length and so when we solve problem $F_1$ we can pass just $u_1$ which a view of $u$ that corresponds to the $F_1$ problem? I tried looking through the code and don't see where the copies happen, can you link to those lines on the source code?

@termi-official
Copy link
Owner Author

Thas is kinda the rationale. Just that we usually can't pass views of u around, but for other objects like e.g. uprev. However, the tricky part is actually that, in general, F1 and F2 overlap.

A major incompatibility between OrdinaryDiffEq and Thunderbolt stems from the order of responsitiblity. In both frameworks init passes (Thunderbolt just sometimes) objects like u and uprev into the algorithm cache constructors. Thunderbolt now assumes that the cache holds the real solution vector type u, uprev, ... while in OrdinaryDiffEq assumes that the one passed into the cache is the real vector.

See e.g.

_uprev = alias_uprev ? uprev : SciMLBase.recursivecopy(uprev)
_u = alias_u ? u : SciMLBase.recursivecopy(u)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
architecture Issues affecting the structural and design aspects of the software performance Something affecting the performance (e.g. scalability or flat runtime)
Projects
None yet
Development

No branches or pull requests

2 participants