Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/custodian/vasp/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ class VaspErrorHandler(ErrorHandler):
"auto_nbands": ["The number of bands has been changed"],
"ibzkpt": ["not all point group operations"],
"fexcf": ["supplied exchange-correlation table"],
"kpt_set_change": ["VASP internal routines have requested a change of the k-point set"],
}

def __init__(
Expand Down Expand Up @@ -776,6 +777,10 @@ def correct(self, directory="./"):
UserWarning,
)

if "kpt_set_change" in self.errors:
# The error message says to remove NPAR. We will do that.
actions.append({"dict": "INCAR", "action": {"_unset": {"NPAR": 0}}})

VaspModder(vi=vi, directory=directory).apply_actions(actions)
return {"errors": list(self.errors), "actions": actions}

Expand Down
18 changes: 18 additions & 0 deletions tests/files/vasp.kpt_set_change
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
-----------------------------------------------------------------------------
| |
| EEEEEEE RRRRRR RRRRRR OOOOOOO RRRRRR ### ### ### |
| E R R R R O O R R ### ### ### |
| E R R R R O O R R ### ### ### |
| EEEEE RRRRRR RRRRRR O O RRRRRR # # # |
| E R R R R O O R R |
| E R R R R O O R R ### ### ### |
| EEEEEEE R R R R OOOOOOO R R ### ### ### |
| |
| VASP internal routines have requested a change of the k-point set. |
| Unfortunately, this is only possible if NPAR=number of nodes. |
| Please remove the tag NPAR from the INCAR file and restart the |
| calculation. |
| |
| ----> I REFUSE TO CONTINUE WITH THIS SICK JOB ... BYE!!! <---- |
| |
-----------------------------------------------------------------------------
7 changes: 7 additions & 0 deletions tests/vasp/test_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,13 @@ def test_auto_nbands_bad_parallelization(self) -> None:
assert "auto_nbands" in dct["errors"]
assert dct["actions"] == [{"dict": "INCAR", "action": {"_set": {"NBANDS": 64}}}]

def test_kpt_set_change(self) -> None:
handler = VaspErrorHandler("vasp.kpt_set_change")
assert handler.check() is True
assert handler.correct()["errors"] == ["kpt_set_change"]
incar = Incar.from_file("INCAR")
assert "NPAR" not in incar


class AliasingErrorHandlerTest(PymatgenTest):
def setUp(self) -> None:
Expand Down
Loading