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

MDEF enhancements #70

Open
3 tasks
jamesgardner1421 opened this issue Jun 17, 2021 · 5 comments
Open
3 tasks

MDEF enhancements #70

jamesgardner1421 opened this issue Jun 17, 2021 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@jamesgardner1421
Copy link
Member

There are a couple of things that could be done to improve performance of MDEF with tensorial and diagonal friction:

  • Ensure friction tensors are only 3*n_friction_atoms rather than 3*n_atoms in dimension. Currently there are lots of zeros which slows the eigen decomposition and matrix multiplications.
  • Make friction tensors Symmetric type, this will simplify representation of data.
  • Switch LDFA algorithm to expect only a vector of friction, rather than a diagonal matrix.
@reinimaurer1
Copy link
Member

the first point could be a performance issue. we should test.

@Alexsp32
Copy link
Member

Alexsp32 commented Nov 6, 2023

@wgst update loading and saving friction models

@Alexsp32 Alexsp32 added this to the End of 2023 update milestone Nov 7, 2023
@Alexsp32 Alexsp32 added the enhancement New feature or request label Nov 7, 2023
@Alexsp32
Copy link
Member

Make friction tensors Symmetric type, this will simplify representation of data.

Since we're using the LAPACK functions to solve the eigenvalue problem in the MDEF integrator, we would have to convert back to Matrix{Float64} at some point.

Ensure friction tensors are only 3n_friction_atoms rather than 3n_atoms in dimension. Currently there are lots of zeros which slows the eigen decomposition and matrix multiplications.

Couldn't we move the eigenvalue problem or even the generation of c1, c2 per time step into the friction! function of the DiffEq problem? That way you could work with a smaller matrix and fill with zeros.

Switch LDFA algorithm to expect only a vector of friction, rather than a diagonal matrix.

This could also be covered then, since you could skip the diagonalisation process for LDFA.

@jamesgardner1421
Copy link
Member Author

I believe if you call eigen on a LinearAlgebra symmetric matrix it automatically calls the right function.
I think this line is the algorithm: γ, c = LAPACK.syev!('V', 'U', Λ) # symmetric eigen could have been replaced by a call to eigen.

On the topic of separating concerns between the integration algorithm and the f/g functions, since we have our own in-built algorithms we can do whatever want. But in the usual DiffEq way, the friction function should really just return the friction, and all the other stuff should happen as part of the integration algorithm. This would then allow us to swap out different algorithms. But it's a bit complicated for MDEF and I never really unstood exactly how to do this with the stochastic problems, especially given this is one of the DynamicalSDEProblems.

@reinimaurer1
Copy link
Member

This issue is still live and is also affecting diabatic_mdef cases that @Nhertl is dealing with where the performance bottleneck is even worse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants