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

LargeSigmaHandler set ISMEAR=0 if sigma reaches 0.02 minimum #275

Merged
merged 2 commits into from
Jul 22, 2023
Merged

LargeSigmaHandler set ISMEAR=0 if sigma reaches 0.02 minimum #275

merged 2 commits into from
Jul 22, 2023

Conversation

janosh
Copy link
Member

@janosh janosh commented Jul 21, 2023

Half the jobs in our atomate2 r2SCAN trial runs fizzle due to LargeSigmaHandler. The failed runs are mostly metals.

After starting with sigma=0.2 and decreasing 3 times, we reach the minimum of 0.02 allowed by Custodian at which point the LargeSigmaHandler aborts the job.

VASP wiki says Gaussian smearing leads to reasonable results in most cases. The final summary reiterates if you have no prior knowledge of the system, use ISMEAR = 0.

Alternative suggestion from @esoteric-ephemera is to increase the max allowed entropy from 1 meV/atom even though VASP docs recommend that value. They probably didn't benchmark that value for larger structures. Or better yet, make it a user-overridable entropy_tol kwarg.

if entropy_per_atom > 0.001:

@Andrew-S-Rosen
Copy link
Member

Andrew-S-Rosen commented Jul 21, 2023

I agree that ISMEAR = 0 is a good fallback option. It is a safe bet in virtually all cases and is likely to be more robust a solution. However, there is one important caveat. If the user has specified ISMEAR = -5, they almost certainly want to only do ISMEAR = -5. Changing ISMEAR = -5 to ISMEAR = 0 would likely cause hidden issues for the user that they likely would not know about. So, my personal $0.02 is to implement a change like this but only if vi["INCAR"].get("ISMEAR", 0) > 0.

Edit: Actually, SIGMA is just irrelevant with ISMEAR = -5 so none of this should matter then.

@janosh
Copy link
Member Author

janosh commented Jul 21, 2023

@arosen93 Looks like the handler only applies if ISMEAR is > 0 to begin with.

if incar.get("ISMEAR", 0) > 0:

@Andrew-S-Rosen
Copy link
Member

Andrew-S-Rosen commented Jul 21, 2023

@janosh: Beautiful. Then I think this makes sense.

I would also recommend explicitly setting a value for SIGMA if you set ISMEAR = 0. Perhaps 0.05, which is consistent with other parts of Custodian?

actions.append({"dict": "INCAR", "action": {"_set": {"ISMEAR": 0, "SIGMA": 0.05}}})

Per the VASP manual:

If you have no a priori knowledge of your system, for instance, if you do not know whether your system is an insulator, semiconductor or metal then always use Gaussian smearing ISMEAR=0 in combination with a small SIGMA=0.03-0.05.

@esoteric-ephemera
Copy link
Contributor

I second SIGMA = 0.05, that's pretty safe

@shyuep shyuep merged commit dde93e9 into materialsproject:master Jul 22, 2023
2 checks passed
@janosh janosh added enhancement handler Error handler labels Jul 22, 2023
@janosh janosh deleted the LargeSigmaHandler-fallback-to-ismear=0 branch July 22, 2023 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants