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

PwCalculation: Fix restart validation for nscf/bands #906

Merged
merged 2 commits into from
Apr 16, 2023

Conversation

mbercx
Copy link
Member

@mbercx mbercx commented Apr 9, 2023

Fixes #905

For interrupted runs, restarting from a previous nscf/bands run with CONTROL.restart_mode set to restart is a valid use case. Here we remove the validation that raised a warning when the user tried to restart an interrupted run with this input.

src/aiida_quantumespresso/calculations/pw.py Outdated Show resolved Hide resolved
warnings.warn(f'`restart_mode` should be set to `from_scratch` for a `{calculation_type}` calculation.')
elif 'parent_folder' in value:
# If a `parent_folder` input is provided, make sure the inputs are set to restart
if 'parent_folder' in value and calculation_type not in ('nscf', 'bands'):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't an scf calculation also not have "some" restart parameters if a parent_folder is specified? Why only nscf and bands? What is the use case for restarting an scf calc from_scratch and without reading the CD from file?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got confused myself here again. Note the not in ('nscf', 'bands'), i.e. this check is only done for other calculation types. The reason is that for nscf and bands, the default of ELECTRONS.startingpot changes to 'file', see:

https://www.quantum-espresso.org/Doc/INPUT_PW.html#idm899

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still not sure about the logic though. Why would there only have to be validation for anything but nscf and bands? For example, if the user specifies bands but then ELECTRONS.startingpot = 'atomic', surely that should also emit a warning then?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, that'd be another validation we can do. Much less likely use case though, someone what assigns a parent folder and then specifically sets ELECTRONS.startingpot = 'atomic' might be up to some weird business that actually requires this input.

@mbercx mbercx force-pushed the fix/905/pw-restart-validation branch 2 times, most recently from 09fb3cb to b046982 Compare April 15, 2023 18:02
@mbercx mbercx requested a review from sphuber April 15, 2023 18:47
sphuber
sphuber previously approved these changes Apr 16, 2023
mbercx added 2 commits April 16, 2023 17:20
For interrupted runs, restarting from a previous `nscf`/`bands` run with
`CONTROL.restart_mode` set to `restart` is a valid use case. Here we
remove the validation that raised a warning when the user tried to
restart an interrupted run with this input.
@mbercx mbercx force-pushed the fix/905/pw-restart-validation branch from b046982 to 57a1f48 Compare April 16, 2023 15:20
@mbercx mbercx merged commit 29a0dfa into aiidateam:main Apr 16, 2023
@mbercx mbercx deleted the fix/905/pw-restart-validation branch April 16, 2023 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PwCalculation: Fix restart validation for nscf/bands
2 participants