[WIP] Better handling of large, flexible systems and meta-GGAs/hybrids #177
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Background
I have opened a PR for a number of additions to the VASP error handlers in Custodian. These new INCAR switches are based on my personal experience carrying out tens of thousands of DFT relaxations for metal-organic frameworks (https://materialsproject.org/mofs), albeit not via the use of Custodian. In most cases, I have tried to ensure that no changes are made to existing INCAR swaps. Rather, if the existing INCAR swaps do not resolve the issue, I have added new backup options.
I have labeled this WIP for a few reasons: 1) I need to write unittests for this, but I figured I'd see if there's any interest before I do a deep dive on the testing. 2) I'd like to test this out for a bit in production calculations to make sure nothing unusual crops up. Let's consider this the start of a conversation.
Below, I outline the proposed changes. I can also split this into multiple PRs if preferred.
Main Changes
zbrent: This error is perhaps the most important one I have addressed. Currently, Custodian switches to IBRION = 1 and copies CONTCAR to POSCAR. For materials that are large and have flexible structures, this is rarely sufficient. There is still too much numerical noise in the forces when this error occurs near the local minimum in the PES. A fallback option of tightening EDIFF to 1e-6 (if it was larger than this value) and increasing NELMIN to 6 is applied. These ensure that the forces are of higher quality. I have also created a new
vtst_enabled
variable, which gives the user an option to support VTST-related INCAR swaps if they have a VASP build with VTST. I've setvtst_enabled = False
as the default for compatibility purposes. However, ifvtst_enabled
is set toTrue
, the optimizer will switch to FIRE. In my experience, FIRE with the modified EDIFF and NELMIN has worked every single time to fix the ZBRENT issue, and I have received it hundreds of times.grad_not_orth: Depending on how you've compiled VASP, the Algo = All SCF convergence algorithm can sometimes lead to grad_not_orth errors. It's extremely machine and compilation-dependent. Switching to any other major SCF convergence algorithm resolves the issue in these cases. So, I've added a swap from All to Fast if this error comes up (unless dealing with meta-GGAs/hybrids, as discussed below). Related to Better EDWAV error fix #92. Also, I don't think changing ISMEAR is the way to go here.
posmap: There was no
self.error_count["posmap"] += 1
line despite there being an if/elif switch based on the error count. I have added that in now. I'm not sure the second loop was ever reached?real_optlay: Currently, this INCAR swap implicitly assumes the user has set LREAL = Auto, but there is no guarantee this is the case. The LREAL = Auto --> True [for large systems] --> False chain now only takes place if LREAL != False in the first place.
Additionally, a few important changes were made to the SCF ladder in
NonConvergingErrorHandler
:MPScanRelaxSet
already uses Algo = All as the default, but other users may not be so careful.MPHSERelaxSet
already uses Algo = All. In principle, if Algo = All doesn't work, one could switch to Algo = Damped with TIME = 0.5 per the VASP manual, but given the high cost of hybrids, I do not know that this is advisable in general and so I have left it as a comment.