-
Notifications
You must be signed in to change notification settings - Fork 177
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
Refactor JSON output to prevent concurrency bugs #66
Conversation
…PI workers The imaginary time propagation currently is not parallelized, so using multiple workers in not sensible yet.
@femtobit , thanks, I will look into this. A further issue we just identified is that now we are appending to the wave function file, instead of rewriting it from scratch, as we were doing before. The expected behaviour is to save the wave-function for backup purposes, so appending to the old file leads to undefined behaviour when loading the wave-function in further calculations. |
Ah, I see. I changed the code to rewrite the wavefunction every time. Maybe we should make this configurable, as it could be useful for tests with small systems to have the complete state information saved? |
@kchoo1118 what's the current status with the wave function log file then? You mentioned that this issue might be already solved in more recent commits? |
yea i just modified it in my local branch so that the wavefunction is not constantly appending |
OK then I will merge this PR, and maybe we can do another PR for the wavefuncion appending issue @kchoo1118 :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, it looks MPI safer now, thanks!
Refactor JSON output to prevent concurrency bugs
The JSON output bug fixed by #64 was caused because converting an
ObsManager
to JSON performs an MPI reduction and thus has to be called from all processes, while in the first version of my code it was only called by rank 0.This PR adds a few changes to the output code to make errors like this less likely.