-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
👌 Simplify
Wannier90WorkChain.get_builder_from_protocol()
The `get_builder_from_protocol()` method of the `Wannier90WorkChain` relied on two external functions `get_scf_builder()` and `get_nscf_builder()` to construct the builder of the corresponding subprocesses. This had a few issues: * It was more challenging to figure out where parameters are set, especially since the `get_nscf_builder()` method was again nested in the `get_scf_builder()` one. * The overrides would not be properly respected. Here we simplify how the `get_builder_from_protocol()` method in two ways: * The `SpinType`-related inputs are stored in the same protocol overrides YAML which is used for the inputs related to the input arguments of the method. In case `SpinTyp` is equal to `NON_COLLINEAR` or `SPIN_ORBIT`, the overrides are adapted accordingly, but the user-specified `overrides` still take precedence. In order to avoid issues with calling the `PwBaseWorkChain.get_builder_from_protocol()` method, `SpinType.NONE` is passed to the method for the SCF and NSCF steps. * Instead of using the external functions, pass the `pseudo_family` and `nbnd` through the overrides, and use the `get_builder_from_protocol()` method. Since we can't yet remove/pop inputs through the overrides, adapt the `kpoints` input for the NSCF after obtaining the populated builder. Finally, note that the `protocol` was not passed to SCF and NSCF builder builder generators. This has now been fixed.
- Loading branch information
1 parent
f28e7df
commit a143916
Showing
8 changed files
with
234 additions
and
35 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
15 changes: 15 additions & 0 deletions
15
src/aiida_wannier90_workflows/workflows/protocols/wannier90.yaml
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
36 changes: 36 additions & 0 deletions
36
...workflows/protocols/test_protocols/test_overrides_overrides5_Wannier90BandsWorkChain_.yml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
kpoints: 1331 kpts | ||
kpoints_force_parity: false | ||
pw: | ||
code: test.quantumespresso.pw@localhost | ||
metadata: | ||
options: | ||
max_wallclock_seconds: 43200 | ||
resources: | ||
num_machines: 1 | ||
withmpi: true | ||
parameters: | ||
CONTROL: | ||
calculation: nscf | ||
etot_conv_thr: 2.0e-05 | ||
forc_conv_thr: 0.0001 | ||
restart_mode: from_scratch | ||
tprnfor: true | ||
tstress: true | ||
ELECTRONS: | ||
conv_thr: 4.0e-10 | ||
diago_full_acc: true | ||
electron_maxstep: 80 | ||
mixing_beta: 0.4 | ||
startingpot: file | ||
SYSTEM: | ||
calculation: bands | ||
degauss: 0.01 | ||
ecutrho: 240.0 | ||
ecutwfc: 30.0 | ||
nbnd: 16 | ||
noinv: true | ||
nosym: true | ||
occupations: smearing | ||
smearing: cold | ||
pseudos: | ||
Si: Si.pbe-n-rrkjus_psl.1.0.0.UPF |
34 changes: 34 additions & 0 deletions
34
...kflows/protocols/test_protocols/test_overrides_overrides5_Wannier90OpenGridWorkChain_.yml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
kpoints_distance: 0.2 | ||
kpoints_force_parity: false | ||
pw: | ||
code: test.quantumespresso.pw@localhost | ||
metadata: | ||
options: | ||
max_wallclock_seconds: 43200 | ||
resources: | ||
num_machines: 1 | ||
withmpi: true | ||
parameters: | ||
CONTROL: | ||
calculation: nscf | ||
etot_conv_thr: 2.0e-05 | ||
forc_conv_thr: 0.0001 | ||
restart_mode: from_scratch | ||
tprnfor: true | ||
tstress: true | ||
ELECTRONS: | ||
conv_thr: 4.0e-10 | ||
diago_full_acc: true | ||
electron_maxstep: 80 | ||
mixing_beta: 0.4 | ||
startingpot: file | ||
SYSTEM: | ||
calculation: bands | ||
degauss: 0.01 | ||
ecutrho: 240.0 | ||
ecutwfc: 30.0 | ||
nbnd: 16 | ||
occupations: smearing | ||
smearing: cold | ||
pseudos: | ||
Si: Si.pbe-n-rrkjus_psl.1.0.0.UPF |
36 changes: 36 additions & 0 deletions
36
...kflows/protocols/test_protocols/test_overrides_overrides5_Wannier90OptimizeWorkChain_.yml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
kpoints: 1331 kpts | ||
kpoints_force_parity: false | ||
pw: | ||
code: test.quantumespresso.pw@localhost | ||
metadata: | ||
options: | ||
max_wallclock_seconds: 43200 | ||
resources: | ||
num_machines: 1 | ||
withmpi: true | ||
parameters: | ||
CONTROL: | ||
calculation: nscf | ||
etot_conv_thr: 2.0e-05 | ||
forc_conv_thr: 0.0001 | ||
restart_mode: from_scratch | ||
tprnfor: true | ||
tstress: true | ||
ELECTRONS: | ||
conv_thr: 4.0e-10 | ||
diago_full_acc: true | ||
electron_maxstep: 80 | ||
mixing_beta: 0.4 | ||
startingpot: file | ||
SYSTEM: | ||
calculation: bands | ||
degauss: 0.01 | ||
ecutrho: 240.0 | ||
ecutwfc: 30.0 | ||
nbnd: 16 | ||
noinv: true | ||
nosym: true | ||
occupations: smearing | ||
smearing: cold | ||
pseudos: | ||
Si: Si.pbe-n-rrkjus_psl.1.0.0.UPF |
36 changes: 36 additions & 0 deletions
36
tests/workflows/protocols/test_protocols/test_overrides_overrides5_Wannier90WorkChain_.yml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
kpoints: 1331 kpts | ||
kpoints_force_parity: false | ||
pw: | ||
code: test.quantumespresso.pw@localhost | ||
metadata: | ||
options: | ||
max_wallclock_seconds: 43200 | ||
resources: | ||
num_machines: 1 | ||
withmpi: true | ||
parameters: | ||
CONTROL: | ||
calculation: nscf | ||
etot_conv_thr: 2.0e-05 | ||
forc_conv_thr: 0.0001 | ||
restart_mode: from_scratch | ||
tprnfor: true | ||
tstress: true | ||
ELECTRONS: | ||
conv_thr: 4.0e-10 | ||
diago_full_acc: true | ||
electron_maxstep: 80 | ||
mixing_beta: 0.4 | ||
startingpot: file | ||
SYSTEM: | ||
calculation: bands | ||
degauss: 0.01 | ||
ecutrho: 240.0 | ||
ecutwfc: 30.0 | ||
nbnd: 16 | ||
noinv: true | ||
nosym: true | ||
occupations: smearing | ||
smearing: cold | ||
pseudos: | ||
Si: Si.pbe-n-rrkjus_psl.1.0.0.UPF |