aiida_hubbard.workflows.hp.base#

Workchain to run a Quantum ESPRESSO hp.x calculation with automated error handling and restarts.

Module Contents#

Classes#

HpBaseWorkChain

Workchain to run a Quantum ESPRESSO hp.x calculation with automated error handling and restarts.

Attributes#

aiida_hubbard.workflows.hp.base.HpCalculation[source]#
class aiida_hubbard.workflows.hp.base.HpBaseWorkChain(*args, **kwargs)[source]#

Bases: aiida.engine.BaseRestartWorkChain, aiida_quantumespresso.workflows.protocols.utils.ProtocolMixin

Workchain to run a Quantum ESPRESSO hp.x calculation with automated error handling and restarts.

_process_class[source]#
defaults[source]#
classmethod define(spec)[source]#

Define the process specification.

classmethod get_protocol_filepath()[source]#

Return pathlib.Path to the .yaml file that defines the protocols.

classmethod get_builder_from_protocol(code, protocol=None, parent_scf_folder=None, parent_hp_folders: dict = None, overrides=None, options=None, **_)[source]#

Return a builder prepopulated with inputs selected according to the chosen protocol.

Parameters:
  • code – the Code instance configured for the quantumespresso.hp plugin.

  • protocol – protocol to use, if not specified, the default will be used.

  • parent_scf_folder – the parent RemoteData of the respective SCF calcualtion.

  • parent_hp_folders – the parent FolderData of the respective single atoms HP calcualtions.

  • overrides – optional dictionary of inputs to override the defaults of the protocol.

  • options – A dictionary of options that will be recursively set for the metadata.options input of all the CalcJobs that are nested in this work chain.

Returns:

a process builder instance with all inputs defined ready for launch.

setup()[source]#

Call the setup of the BaseRestartWorkChain and then create the inputs dictionary in self.ctx.inputs.

This self.ctx.inputs dictionary will be used by the BaseRestartWorkChain to submit the calculations in the internal loop.

validate_parameters()[source]#

Validate inputs that might depend on each other and cannot be validated by the spec.

set_max_seconds(max_wallclock_seconds)[source]#

Set the max_seconds to a fraction of max_wallclock_seconds option to prevent out-of-walltime problems.

Parameters:

max_wallclock_seconds – the maximum wallclock time that will be set in the scheduler settings.

prepare_process()[source]#

Prepare the inputs for the next calculation.

report_error_handled(node, action)[source]#

Report an action taken for a calculation that has failed.

This should be called in a registered error handler if its condition is met and an action was taken.

Parameters:
  • node – the failed calculation node

  • action – a string message with the action taken

handle_unrecoverable_failure(node)[source]#

Handle calculations with an exit status below 400 which are unrecoverable, so abort the work chain.

handle_computing_cholesky(_)[source]#

Handle ERROR_COMPUTING_CHOLESKY: set parallel diagonalization to 1 and restart.

Parallelization of diagonalization may produce in some cases too much numerical noise, giving rise to Cholesky factorization issues. As other diagonalization algorithms are not available in hp.x, we try to set the diagonalization flag to 1, if not already set.

handle_convergence_not_reached(_)[source]#

Handle ERROR_CONVERGENCE_NOT_REACHED: decrease alpha_mix and restart.

Since hp.x does not support restarting from incomplete calculations, the entire calculation will have to be restarted from scratch. By decreasing alpha_mix there is a chance that the next run will converge. If these keys are present in the input parameters, they will be scaled by a default factor, otherwise, a hardcoded default value will be set that is lower/higher than that of the code’s default.

on_terminated()[source]#

Clean the working directories of all child calculations if clean_workdir=True in the inputs.