aiida_lammps.workflows.base
#
Workchain to run a LAMMPS calculation with automated error handling and restarts.
Module Contents#
Classes#
Base workchain for calculations using LAMMPS |
- class aiida_lammps.workflows.base.LammpsBaseWorkChain(*args, **kwargs)[source]#
Bases:
aiida.engine.BaseRestartWorkChain
Base workchain for calculations using LAMMPS
- setup()[source]#
Call the
setup
of theBaseRestartWorkChain
and create the inputs dictionary inself.ctx.inputs
.This
self.ctx.inputs
dictionary will be used by theBaseRestartWorkChain
to submit the calculations in the internal loop.The
parameters
andsettings
inputDict
nodes are converted into a regular dictionary and the default namelists for theparameters
are set to empty dictionaries if not specified.
- 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. :param calculation: the failed calculation node :param action: a string message with the action taken
- _check_restart_in_remote(calculation)[source]#
Check if the remote folder of a previous calculation contains a restartfile
- Parameters:
calculation – node from the previous calculation
- Returns:
latest restartfile found or None
- set_restart_type(restart_type, calculation)[source]#
Set the parameters to run the restart calculation
Depending on the type of restart several variables of the input parameters will be changed to try to ensure that the calculation can resume from the last stored structure
- Parameters:
restart_type – type of the restart approach to be used
calculation – node from the previous calculation
- handle_unrecoverable_failure(calculation)[source]#
Handle calculations with unrecoverable errors.
Checks if the calculation ended with an exit status below 400 if so abort the work chain.
- handle_out_of_walltime(calculation)[source]#
Handle calculations where the walltime was reached.
The handler will try to find a configuration to restart from with the following priority
Use a stored restart file in the repository from the previous calculation.
Use a restartfile found in the remote folder from the previous calculation.
Use the structure from the last step of the trajectory from the previous calculation.
Restart from scratch
- handle_minimization_not_converged(calculation)[source]#
Handle calculations where the minimization did not converge
The handler will try to find a configuration to restart from with the following priority
Use a stored restart file in the repository from the previous calculation.
Use a restartfile found in the remote folder from the previous calculation.
Use the structure from the last step of the trajectory from the previous calculation.
This handler should never start from restart as at least the trajectory should always exist, if the calculation finished successfully.