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

Adding a Logger functionality for Spectra #103

Open
JensWehner opened this issue Jul 27, 2020 · 3 comments · May be fixed by #131
Open

Adding a Logger functionality for Spectra #103

JensWehner opened this issue Jul 27, 2020 · 3 comments · May be fixed by #131

Comments

@JensWehner
Copy link
Contributor

At the moment spectra solvers are sort of black-boxes, which return an enum at the end which signals convergence or failure.

This is sufficient for problems that do not take long to compute. For larger problems that take hours or days to run, more information about the internal state of the solver would be nice. users could benchmark there code better and it would also be useful for debugging.

I have two different ideas how to do this, but a lot more feedback is appreciated and probably better ideas as well.

a) Add a virtual class Log which can be set via setLogger(*log) and has to be implemented by the user. If no logger is set, no logging output is produced. The derived class has to implement a log(const& Data) method.

I am not sure what should be in the Data, probably iteration count, residues, current eigenvalues, for davidson maybe subspace size, number_of_converged eigenvalues().

b) The second choice would be to have a bool iterateOneStep() function, which would be called.

and the user would have to put this into a loop him/herself until the system is converged, in the meantime we would expose most of the solver internals via get() functions. So the user can write the iteration stuff him/herself.

I am not sure which method is better, I favour the first one. Instead of a setLogger method we can also pass an additional argument to the constructor.

@shivupa
Copy link
Contributor

shivupa commented Jul 13, 2021

Is anyone working on this? I have been finding that I would like this more and more. I am very much in favor of (a) the virtual class. If no one is working on this I could probably take a crack at it after 7/24.

@yixuan
Copy link
Owner

yixuan commented Jul 14, 2021

@shivupa Pull requests are always appreciated. 😄

@shivupa shivupa linked a pull request Oct 5, 2021 that will close this issue
@shivupa
Copy link
Contributor

shivupa commented Oct 5, 2021

Took a crack at this... very much after 7/24 haha

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 a pull request may close this issue.

3 participants