-
Notifications
You must be signed in to change notification settings - Fork 82
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
PwBaseWorkChain
: Always do full restart for ERROR_OUT_OF_WALLTIME
#1012
Conversation
@AndresOrtegaGuerrero this should do the job, but there is one thing I'm still considering. For provenance reasons, in case the structure has changed I still pass it as an input to the restart calculation. However, for a full restart (
This means that we're passing an input structure that will be ignored in any case, and hence this might be slightly confusing for someone that's observing the provenance afterwards. However, running without the input structure is not to QE's liking:
So you always have to provide an input structure, even when the restart settings you specify explicitly decides to ignore it. ^^ I was considering perhaps restarting from the charge density instead, which should be pretty efficient. However, a full restart will most likely still be even more efficient, since it will also start from the correct kpt:
However, this calculation failed shortly thereafter:
Restarting from the charge density did not have this issue. So I would favor for this approach, which is perhaps slightly less efficient but probably more robust? |
I'll leave my 2-cents considerations:
|
Thanks @bastonero! Unfortunately this doesn't make the decision easier. ^^ Can we see from the outputs if QE has been compiled with HDF5? I suppose we could do a full restart, and in case this fails restart from scratch with the final structure. |
No clue if there's a way. I know the wfcs files have .hdf5 extension, if it can help |
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.
Shall we merge this? I think it's quite useful, I am currently running some hybrid functional calculations and due to the from_scratch
is never converging since it alwats lose the BFGS history, thus making the convergence extremely slow and inefficient.
@bastonero ah yes, I discussed this with @superstar54 last week, who was also keen to merge. Let me have a quick look again and then I'll merge. |
Ok, after reading into this again, I'm fine merging this PR, but perhaps with the following addition: since a full restart can sometimes fail with the
Perhaps we should also add an error handler that handles this, that restarts from scratch? EDIT: this should probably only trigger in case we're doing a geometry optimization though. |
The current error handler for the `ERROR_OUT_OF_WALLTIME` exit code of the `PwCalculation` will restart from scratch in case the structure has changed during the `pw.x` run, as is typically the case for `relax`/`vc-relax` calculations. For larger structures and more complex calculations - such as those using Hubbard corrections - this can be quite inefficient since obtaining the electronic ground state is often more challenging and hence expensive. Here we adapt the error handler to always do a full restart from the previous calculation. In case the structure has changed, we still set it as the input structure of the restart calculation. Even though Quantum ESPRESSO will restart from the `.save` directory and hence ignore the structure information in the input file, this at least makes the structure in the provenance consistent with the one run by Quantum ESPRESSO.
6299c46
to
cfdfc51
Compare
Adding such an error handler raises more issues that will slow down this PR, and I think this is still a vast improvement versus the status quo. So let's merge this and open a new issue/PR to deal with the I am a bit worried this will happen a lot more now with these full restarts, but I guess we'll find out. ^^ |
i am still puzzled that this error was thrown when doing the full restart. but as you say, let's see what happens in the long run, as indeed there is no general solution to that |
Yeah, it was only one test case, and I can't reproduce it. If restarting fully is really an issue, I guess we'll notice quickly. :) |
Strange, the docs build passed, but it's not updating here. I'll just go ahead and merge. |
Fixes #968
The current error handler for the
ERROR_OUT_OF_WALLTIME
exit code of thePwCalculation
will restart from scratch in case the structure has changed during thepw.x
run, as is typically the case forrelax
/vc-relax
calculations. For larger structures and more complex calculations - such as those using Hubbard corrections - this can be quite inefficient since obtaining the electronic ground state is often more challenging and hence expensive.Here we adapt the error handler to always do a full restart from the previous calculation. In case the structure has changed, we still set it as the input structure of the restart calculation.