Skip to content

Commit

Permalink
prevent future errors like this
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew-S-Rosen committed Jun 12, 2024
1 parent ab5706e commit 60b78e6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions custodian/vasp/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,17 +189,18 @@ def correct(self, directory="./"):
actions = []
vi = VaspInput.from_directory(directory)

if self.errors.intersection(["tet", "dentet"]):
if "tet" in self.errors:
actions.append({"dict": "INCAR", "action": {"_set": {"ISMEAR": 0, "SIGMA": 0.05}}})

if "dentet" in self.errors:
# follow advice in this thread
# https://vasp.at/forum/viewtopic.php?f=3&t=416&p=4047&hilit=dentet#p4047
err_type = "tet" if "tet" in self.errors else "dentet"
if vi["INCAR"].get("KSPACING"):
# decrease KSPACING by 20% in each direction (approximately double no. of kpoints)
action = {"_set": {"KSPACING": vi["INCAR"].get("KSPACING") * 0.8}}
actions.append({"dict": "INCAR", "action": action})
else:
actions.append({"dict": "INCAR", "action": {"_set": {"ISMEAR": 0, "SIGMA": 0.05}}})
self.error_count[err_type] += 1

# Missing AMIN error handler:
# previously, custodian would kill the job without letting it run if AMIN was flagged
Expand Down

0 comments on commit 60b78e6

Please sign in to comment.