Skip to content

Commit

Permalink
Adding check for the raw calculation to see if lammps has exited with…
Browse files Browse the repository at this point in the history
… an error. Addresses aiidaplugins#87
  • Loading branch information
Jonathan Chico committed Nov 25, 2023
1 parent 12a4c95 commit e378375
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion aiida_lammps/calculations/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def define(cls, spec):
spec.exit_code(
309,
"ERROR_PARSER_DETECTED_LAMMPS_RUN_ERROR",
message="The parser detected the lampps error :{error}",
message="The parser detected the lammps error :{error}",
)
spec.exit_code(
400,
Expand Down
5 changes: 5 additions & 0 deletions aiida_lammps/calculations/raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ def define(cls, spec):
required=True,
help="The data extracted from the lammps out file",
)
spec.exit_code(
309,
"ERROR_PARSER_DETECTED_LAMMPS_RUN_ERROR",
message="The parser detected the lammps error :{error}",
)
spec.exit_code(
351,
"ERROR_OUTFILE_MISSING",
Expand Down
7 changes: 7 additions & 0 deletions aiida_lammps/parsers/raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ def parse(self, **kwargs):
if parsed_data is None:
return self.exit_codes.ERROR_PARSING_OUTFILE

if parsed_data["global"]["errors"]:
for entry in parsed_data["global"]["errors"]:
self.logger.error(f"LAMMPS emitted the error {entry}")
return self.exit_codes.ERROR_PARSER_DECTECTED_LAMMPS_RUN_ERROR.format(
error=entry
)

global_data = parsed_data["global"]
results = {"compute_variables": global_data}

Expand Down

0 comments on commit e378375

Please sign in to comment.