Skip to content

Commit

Permalink
Protocols: Add usage of metadata/paral. overrides
Browse files Browse the repository at this point in the history
The `metadata` and `parallelization` inputs of the `PwCalculation`,
stored in the `pw` namespace of the `PwBaseWorkChain`, are not
(properly) used in the `get_builder_from_protocol()` method. Here we
make the following changes to correct this issue:

* Move the `metadata` inputs under `pw` in the base.yaml file.
* Correctly obtain the `metadata` from the inputs in the
`get_builder_from_protocol()` method of the `PwBaseWorkChain`.
* Check if there is `parallelization` input in the `pw` namespace of the
inputs, and if so add it to the builder in the
`get_builder_from_protocol()` method of the `PwBaseWorkChain`.
  • Loading branch information
mbercx committed Feb 18, 2021
1 parent ae410f6 commit fb0cbc0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
12 changes: 6 additions & 6 deletions aiida_quantumespresso/workflows/protocols/pw/base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ default_inputs:
meta_parameters:
conv_thr_per_atom: 0.2e-9
etot_conv_thr_per_atom: 1.e-5
metadata:
options:
resources:
num_machines: 1
max_wallclock_seconds: 43200 # Twelve hours
withmpi: True
pseudo_family: 'SSSP/1.1/PBE/efficiency'
pw:
metadata:
options:
resources:
num_machines: 1
max_wallclock_seconds: 43200 # Twelve hours
withmpi: True
parameters:
CONTROL:
calculation: scf
Expand Down
4 changes: 3 additions & 1 deletion aiida_quantumespresso/workflows/pw/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,9 @@ def get_builder_from_protocol(
builder.pw['pseudos'] = pseudo_family.get_pseudos(structure=structure) # pylint: disable=no-member
builder.pw['structure'] = structure # pylint: disable=no-member
builder.pw['parameters'] = orm.Dict(dict=parameters) # pylint: disable=no-member
builder.pw['metadata'] = inputs['metadata'] # pylint: disable=no-member
builder.pw['metadata'] = inputs['pw']['metadata'] # pylint: disable=no-member
if 'parallelization' in inputs['pw']:
builder.pw['parallelization'] = orm.Dict(dict=inputs['pw']['parallelization'])
builder.clean_workdir = orm.Bool(inputs['clean_workdir'])
builder.kpoints_distance = orm.Float(inputs['kpoints_distance'])
builder.kpoints_force_parity = orm.Bool(inputs['kpoints_force_parity'])
Expand Down

0 comments on commit fb0cbc0

Please sign in to comment.