8000 Move density build to solver object by pitsteinbach · Pull Request #262 · tblite/tblite · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Move density build to solver object #262

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

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

pitsteinbach
Copy link
Contributor

In order to prepare for solvers which are not based on diagonalization, I propose as done before by @awvwgk to move all the functions relevant to building the density matrix to the solver type object, this allows a later overwrite by a solver object that uses DMP methods for example.

Another functionality introduced by this PR is that the solver might not be deleted at the end of an SCF cycle if a flag within the context is changed. The reason for that is that for applications such as CREST or geometry optimizations in general, we would want to reuse the solver instance as to not pay the setup time too often. This is especially helpful in the context of GPU based methods as it allows to reuse buffers allocated on the GPU in latter SCF cycles.

Relating to #71.

Copy link
codecov bot commented May 2, 2025

Codecov Report

Attention: Patch coverage is 59.67742% with 25 lines in your changes missing coverage. Please review.

Project coverage is 70.63%. Comparing base (171274c) to head (b13c4b3).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
src/tblite/scf/solver.f90 63.41% 2 Missing and 13 partials ⚠️
src/tblite/xtb/singlepoint.f90 33.33% 2 Missing and 2 partials ⚠️
src/tblite/context/type.F90 50.00% 0 Missing and 2 partials ⚠️
src/tblite/ceh/singlepoint.f90 50.00% 0 Missing and 1 partial ⚠️
src/tblite/lapack/solver.f90 75.00% 0 Missing and 1 partial ⚠️
src/tblite/post_processing/wbo.f90 75.00% 0 Missing and 1 partial ⚠️
src/tblite/scf/iterator.f90 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #262      +/-   ##
==========================================
- Coverage   70.65%   70.63%   -0.03%     
==========================================
  Files         159      160       +1     
  Lines       20058    20073      +15     
  Branches     7133     7138       +5     
==========================================
+ Hits        14172    14178       +6     
- Misses       2267     2271       +4     
- Partials     3619     3624       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@@ -44,9 +46,11 @@ module tblite_context_type
!> Optional logger to be used for writing messages
class(context_logger), allocatable :: io
!> Optional factory for creating electronic solvers
class(context_solver), allocatable :: solver
class(context_solver), allocatable :: ctxsolver
Copy link
Member

Choose a reason for hiding this comment

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

Can we keep the original name? The ctx prefix hete does not seem necessary

Copy link
Contributor Author

Choose a reason for hiding this comment

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

then I would need to rename the solver 4 lines down from this line. I wanted to have the actual solver as part of the context since this object usually persists in implementations.

Copy link
Member

Choose a reason for hiding this comment

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

I think the context_solver is already flexible enough to allow keeping persistent memory or implementation details between runs. I would like to keep the current logic of instantiating a new solver in every singlepoint from the context_solver. You can use a pointer in the created solver which references the persistent context memory for example.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, I see your point, I will transfer the setup logic to the context solver.
Can you elaborate on why you think having this overhead in creating a solver every time makes sense?

@pitsteinbach pitsteinbach requested a review from awvwgk May 5, 2025 08:37
@pitsteinbach
Copy link
Contributor Author

in order to run the whole CI I added some fixes regarding the newest meson version giving errors.
@awvwgk do you want me to open a separate PR for that, how to we want to address this situation?
Other suggestions for this PR?

@marvinfriede
Copy link
Member

in order to run the whole CI I added some fixes regarding the newest meson version giving errors. @awvwgk do you want me to open a separate PR for that, how to we want to address this situation? Other suggestions for this PR?

I would prefer a separate PR. Otherwise, we have to wait for this PR to be merged.
Also, can you only ex 8000 clude the broken version without excluding later version (meson!=1.8.0)?

@pitsteinbach
Copy link
Contributor Author

@awvwgk can we move forward with this or do you want more changes?

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.

4 participants
0