-
Notifications
You must be signed in to change notification settings - Fork 14
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
run_relax should be used for get pw-parameters #319
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a logic bug here.
If we run scf
only, the pw_parameters
will be None
. Thus, the following code will raise a error.
energy_cutoff_wfc = round(pw_parameters["SYSTEM"]["ecutwfc"])
Since we use parameters["relax_type"]=RealxType.NONE
to run the scf
calculation. So, no matter what kind of calculations we choose, there should always have a relax
calculation. Therefore, line 33
run_relax = builder_parameters.get("relax_type") != "none"
needs change to:
run_relax = True
In file steps.py
, line 871,
# skip relax sub-workflow only when RelaxType is NONE and has property calculated.
if RelaxType(parameters["relax_type"]) is RelaxType.NONE and (
parameters["run_bands"] or parameters["run_pdos"]
):
builder.pop("relax")
The above code should be removed, to make sure there is a relax
calculation.
@unkcpz What do you think?
Hi @superstar54, the issue is more complex. Please check the comment I add to the code. The problem all comes from us running SCF which is a non-relax calculation using the PwRelaxWorkChain. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@unkcpz You are right. One quick solution would be:
Change
run_relax = builder_parameters.get("relax_type") != "none"
run_bands = builder_parameters.get("run_bands")
run_pdos = builder_parameters.get("run_pdos")
to:
run_bands = builder_parameters.get("run_bands")
run_pdos = builder_parameters.get("run_pdos")
run_relax = not (builder_parameters.get("relax_type") == "none" & (run_relax or run_pdos))
@superstar54 thanks! I implement it by check if the
I run two tests, one SCF and one relax=none + property. All works fine. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@superstar54 thanks millions! |
fixes #318
@superstar54 We had a discussion about this, seems I didn't change these parts of code back to normal.