Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PwBaseWorkChain: Allow restarts from RemoteData that do not have a creator #721

Closed
mbercx opened this issue Aug 30, 2021 · 0 comments · Fixed by #722
Closed

PwBaseWorkChain: Allow restarts from RemoteData that do not have a creator #721

mbercx opened this issue Aug 30, 2021 · 0 comments · Fixed by #722

Comments

@mbercx
Copy link
Member

mbercx commented Aug 30, 2021

Currently, the PwBaseWorkChain expects the RemoteData provided to the pw.parent_folder input to have a creator:

if 'parent_folder' in self.ctx.inputs:
self.ctx.restart_calc = self.ctx.inputs.parent_folder.creator

This is then used to set up a restart_calc in the context, similar to how actual restarts are done in the work chain. However, there can be cases where the user wants to provide a RemoteData that does not have a PwCalculation as a creator. Maybe this is a RemoteData that is constructed manually or is the result of a calcfunction.

Moreover, later in the prepare_process step, the input for the restart_mode tag is overwritten in case a restart_calc is found in the context:

if self.ctx.restart_calc:
self.ctx.inputs.parameters['CONTROL']['restart_mode'] = 'restart'
self.ctx.inputs.parent_folder = self.ctx.restart_calc.outputs.remote_folder

This means that when providing the parent_folder input, restart_mode is always set to 'restart', overriding the input provided by the user. This means that restarting from only a charge density with startingpot is not possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant