adc-connect / adcc

adcc: Seamlessly connect your program to ADC
https://adc-connect.org
GNU General Public License v3.0
32 stars 19 forks source link

More verbose output if desired #88

Open maxscheurer opened 4 years ago

maxscheurer commented 4 years ago

I'm wondering if we could make the output more verbose before the solver starts during the construction of the ADC matrix, import etc. I have no real plan on how to do this in a nice way, but it feels awkward especially for large calculations to have no sign of progress output 😢 Leaving this here as a note that we don't forget.

mfherbst commented 4 years ago

That's a good point, but I'm very suspicious about this. The point of adcc is not to be like one of the traditional text-in, text-out codes. Perhaps one could commit to the logger system of python and send different kinds of outputs there? Like every class (HF, LazyMp, AdcStates, etc) has some sort of a function called by the workflow, which writes basic stuff to the logger (e.g. dipole moments or something like that). The difficult thing is to make sure that the underlying lazy computations are only triggered when the output is needed.

maxscheurer commented 4 years ago

The point of adcc is not to be like one of the traditional text-in, text-out codes.

That's precisely the point!

I've never used the Python logger system, but it's probably worth it, because currently we're always writing to standard output (I guess?). For most cases, you probably don't need any super-verbose output, but the user should at least be able to enforce verbose output if desired without corrupting the demand-driven paradigm.

mfherbst commented 4 years ago

Agree. I never used logger either, but it seems exactly what we want. I don't know the details how it works. Maybe it's no problem to integrate that sensibly with the demand-driven workflow, maybe we need to add some icing on top, but knowing python it's probably not too big an issue.

maxscheurer commented 4 years ago

I agree. However, all of the logging needs to 'co-exist' with stuff like print(state.describe()) etc. I think I'm in favor of steering 'meta' output on the progress of the calculation (like currently Davidson iterations) with logging, but probably we should not mix it up with printing of 'preliminary' properties...

What do you think?

mfherbst commented 4 years ago

What I would do is that the standard workflow (that includes davidson output any sort of progress prints, intermediate results etc) goes to the logger. If you "display" an object or print it manually, than obviously that goes to stdout or wherever you want it to go. The latter thing is kind of the building block for the former thing.