-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PwBaseWorkChain
: Improve restart and validate inputs (#722)
Improve the code regarding restarting in the `PwBaseWorkChain` in several ways: * Remove some of the logic in the `PwBaseWorkChain` regarding restarting from a previous calculation using a `RemoteData` provided to the `pw.parent_folder` input. The current logic expected the `RemoteData` to have a `PwCalculation` creator, which is not always the case. Moreover, the `restart_mode` chosen by the user was overriden, which means that e.g. restarting from _only_ the charge density with `startingpot` was not possible. * For users who want to restart in the first `PwCalculation`, the inputs are now validated to make sure that they are sensible. In case the calculation will still run correctly but the inputs are not consistent, a warning is raised during the validation. In case the inputs lead to failed calculation, an error is raised. * For restarts made by the `PwBaseWorkChain`, the restart logic is gathered inside the `set_restart_type` method. A new `Enum`, `RestartType` is added for the different modes of restarting. Each of the error handlers is updated to use this new method. * Only for the `sanity_check_insufficient_bands` error handler, the restart method is changed to restart from the charge density. Finally, the `validate_parameters` step in the outline of the `PwBaseWorkChain` is merged into the `setup` step, since no more validation is performed and the other code in this step is more at home in the `setup` step.
- Loading branch information
Showing
8 changed files
with
279 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.