aiida_quantumespresso.workflows.xspectra.base#

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

Module Contents#

Classes#

XspectraBaseWorkChain

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

Attributes#

XspectraCalculation

aiida_quantumespresso.workflows.xspectra.base.XspectraCalculation[source]#
class aiida_quantumespresso.workflows.xspectra.base.XspectraBaseWorkChain(*args, **kwargs)[source]#

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

Workchain to run a Quantum ESPRESSO xspectra.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, core_wfc_data, parent_folder, abs_atom_marker='X', protocol=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.xspectra plugin.

  • core_wfc_data – a SinglefileData object for the initial-state core wavefunction, normally derived from upf2plotcore.sh, required for the xspectra.x calculation.

  • parent_folder – a RemoteData object for the parent calculation (either pw.x or xspectra.x).

  • abs_atom_marker – the name given to the Kind representing the absorbing atom. Matches to Kind.name for the absorbing atom in the structure, used to set the parameter xiabs automatically.

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

  • 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_kpoints()[source]#

Validate the inputs related to k-points.

Either an explicit KpointsData with given mesh, or a desired k-points distance should be specified. In the case of the latter, the KpointsData will be constructed for the input StructureData using the create_kpoints_from_distance calculation function.

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.

If a restart_calc has been set in the context, its remote_folder will be used as the parent_folder input for the next calculation and the restart_mode is set to restart.

report_error_handled(calculation, 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:
  • calculation – 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_scheduler_out_of_walltime(node)[source]#

Handle ERROR_SCHEDULER_OUT_OF_WALLTIME exit code: decrease the time_limit and restart from scratch.

handle_out_of_walltime(node)[source]#

Handle ERROR_OUT_OF_WALLTIME exit code: calculation shut down neatly and we can simply restart.