Skip to content

Commit

Permalink
PwBaseWorkChain: add handler for ERROR_COMPUTING_CHOLESKY
Browse files Browse the repository at this point in the history
Currently there is no known cure for this problem so a handler is added
to abort the workchain.
  • Loading branch information
sphuber committed Mar 27, 2020
1 parent 2e047c6 commit 7c299a2
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion aiida_quantumespresso/workflows/pw/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ def define(cls, spec):
spec.exit_code(211, 'ERROR_INVALID_INPUT_AUTOMATIC_PARALLELIZATION_UNRECOGNIZED_KEY',
message='Unrecognized keys were specified for `automatic_parallelization`.')
spec.exit_code(300, 'ERROR_UNRECOVERABLE_FAILURE',
message='The calculation failed with an unrecoverable error.')
message='The calculation failed with an unidentified unrecoverable error.')
spec.exit_code(310, 'ERROR_KNOWN_UNRECOVERABLE_FAILURE',
message='The calculation failed with a known unrecoverable error.')
spec.exit_code(320, 'ERROR_INITIALIZATION_CALCULATION_FAILED',
message='The initialization calculation failed.')
spec.exit_code(501, 'ERROR_IONIC_CONVERGENCE_REACHED_EXCEPT_IN_FINAL_SCF',
Expand Down Expand Up @@ -350,6 +352,21 @@ def _handle_unrecoverable_failure(self, calculation):
return ErrorHandlerReport(True, True, self.exit_codes.ERROR_UNRECOVERABLE_FAILURE)


@register_error_handler(PwBaseWorkChain, 590)
def _handle_known_unrecoverable_failure(self, calculation):
"""Handle calculations with an exit status that correspond to a known failure mode that are unrecoverable.
These failures may always be unrecoverable or at some point a handler may be devised.
"""
exit_code_labels = [
'ERROR_COMPUTING_CHOLESKY',
]

if calculation.exit_status in PwCalculation.get_exit_statuses(exit_code_labels):
self.report_error_handled(calculation, 'known unrecoverable failure detected, aborting...')
return ErrorHandlerReport(True, True, self.exit_codes.ERROR_KNOWN_UNRECOVERABLE_FAILURE)


@register_error_handler(PwBaseWorkChain, 580)
def _handle_out_of_walltime(self, calculation):
"""Handle `ERROR_OUT_OF_WALLTIME` exit code: calculation shut down neatly and we can simply restart."""
Expand Down

0 comments on commit 7c299a2

Please sign in to comment.