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

New error handling for SCF convergence edge cases #695

Merged

Conversation

zooks97
Copy link
Contributor

@zooks97 zooks97 commented May 20, 2021

Fixes #694

Copy link
Contributor

@sphuber sphuber left a comment

Choose a reason for hiding this comment

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

Thanks @zooks97 . Couple of minor changes and then we would need a test. All the infrastructure to write one is already in place. Just have a look in tests/workflows/pw/test_base.py. You can see examples there: essentially you create a workchain instance with specific inputs, call a few outline steps to initialize the state and then you call the new handler, checking afterwards that the report and context are correctly changed.

aiida_quantumespresso/calculations/pw.py Outdated Show resolved Hide resolved
aiida_quantumespresso/calculations/pw.py Outdated Show resolved Hide resolved
aiida_quantumespresso/workflows/pw/base.py Outdated Show resolved Hide resolved
aiida_quantumespresso/workflows/pw/base.py Outdated Show resolved Hide resolved
aiida_quantumespresso/workflows/pw/base.py Outdated Show resolved Hide resolved
@zooks97
Copy link
Contributor Author

zooks97 commented May 31, 2021

I've attempted to write a simple test for the new exit code, but I'm getting a bunch of md5 mismatch errors when running pytest (maybe my setup is bad?). Would like to have feedback on if the test is reasonable (maybe should test all combinations of the two pw inputs).

Edit: looks like the test is failing on CI. I need to get my DE setup right so that I can fix it, do you know why I'm getting only md5 check failures?

Copy link
Contributor

@sphuber sphuber left a comment

Choose a reason for hiding this comment

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

Thanks @zooks97 . Test looks fine in principle there is just a mistake which causes it to fail. That isn't anything to do with md5s though, but I reckon that is something you have locally. Most likely this is due to the SSSP pseudos. Are you running against a clean test profile? Can you post the exact error and stack trace?

tests/workflows/pw/test_base.py Outdated Show resolved Hide resolved
@sphuber
Copy link
Contributor

sphuber commented Jun 7, 2021

Thanks @zooks97 but you and git are not a match made in heaven 😅 I don't know how you do it, but you managed to get lines into the PR that are already in develop. I will fix her up

@sphuber sphuber force-pushed the fix/694/electron-non-convergence branch 3 times, most recently from 541c381 to 2cb8730 Compare June 7, 2021 13:47
In certain cases, a user will set inputs such that the SCF will not
converge, for example, by setting `scf_must_converge` to false, or by
setting `electron_maxstep` to zero. This can be useful to initialize a
charge density of a system and the workchain should not restart or fail
in this case.

The `PwParser` now returns `WARNING_ELECTRONIC_CONVERGENCE_NOT_REACHED`
instead of `ERROR_ELECTRONIC_CONVERGENCE_NOT_REACHED` if any of these
parameters are set as described. The `PwBaseWorkChain` has a new handler
for this new exit code to consider the calculation as successful and
finish the workchain.

Co-authored-by: Sebastiaan Huber <mail@sphuber.net>
@sphuber sphuber force-pushed the fix/694/electron-non-convergence branch from 2cb8730 to 94b4db0 Compare June 7, 2021 13:54
@sphuber
Copy link
Contributor

sphuber commented Jun 7, 2021

Fixed the branch and also added a test for the PwParser whose functionality was also changed. Thanks for the PR @zooks97

@sphuber sphuber merged commit da94161 into aiidateam:develop Jun 7, 2021
@zooks97
Copy link
Contributor Author

zooks97 commented Jun 7, 2021

Thanks!

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.

Allowing electronic non-convergence if electron_maxstep = 0 in PwCalculation
3 participants