Skip to content

Commit

Permalink
Propagate clean_workchain to evaluation workchain (#159)
Browse files Browse the repository at this point in the history
The evaluate workchains of every properties are also all inherit from `SelfCleanWorkChain`
to to the remote workdir clean after single evaluation step is done.
This immediate clean will keep remote machine quato avaliable with many
verification at the same time.
However, the `clean_workchain` flag setting from parent workchain which
calls the evaluate workchain are not properly propagate this parameter
to evaluate workchain, lead to that evaluate workchain always get
cleaned as default.
  • Loading branch information
unkcpz authored Jun 13, 2022
1 parent fb2bd82 commit 07fbae5
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions aiida_sssp_workflow/workflows/convergence/bands.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ def _get_inputs(self, ecutwfc, ecutrho):
"run_bands_structure": orm.Bool(
False
), # for convergence with no band structure evaluate
"clean_workchain": self.inputs.clean_workchain,
}

return inputs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ def _get_inputs(self, ecutwfc, ecutrho):
},
"kpoints": atom_kpoints,
},
"clean_workchain": self.inputs.clean_workchain,
}

return inputs
Expand Down
1 change: 1 addition & 0 deletions aiida_sssp_workflow/workflows/convergence/delta.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ def _get_inputs(self, ecutwfc, ecutrho):
},
"element": orm.Str(self.ctx.element),
"configuration": orm.Str(self.ctx.configuration),
"clean_workchain": self.inputs.clean_workchain,
}

return inputs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ def _get_inputs(self, ecutwfc, ecutrho):
},
"settings": orm.Dict(dict={"CMDLINE": cmdline_list}),
},
}
},
"clean_workchain": self.inputs.clean_workchain,
}

return inputs
Expand Down
1 change: 1 addition & 0 deletions aiida_sssp_workflow/workflows/convergence/pressure.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ def _get_inputs(self, ecutwfc, ecutrho):
"parallelization": orm.Dict(dict=self.ctx.parallelization),
},
"kpoints_distance": orm.Float(self.ctx.kpoints_distance),
"clean_workchain": self.inputs.clean_workchain,
}

return inputs
Expand Down
1 change: 1 addition & 0 deletions aiida_sssp_workflow/workflows/measure/bands.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ def _get_inputs(self, pseudos):
"fermi_shift": orm.Float(self.ctx.fermi_shift),
"run_bands_structure": orm.Bool(True),
"kpoints_distance_band_structure": orm.Float(self.ctx.kpoints_distance_band_structure),
"clean_workchain": self.inputs.clean_workchain,
}

return inputs
Expand Down
1 change: 1 addition & 0 deletions aiida_sssp_workflow/workflows/measure/delta.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ def _get_inputs(self, structure, configuration):
},
"element": orm.Str(self.ctx.element),
"configuration": orm.Str(configuration),
"clean_workchain": self.inputs.clean_workchain,
}

return inputs
Expand Down
4 changes: 2 additions & 2 deletions aiida_sssp_workflow/workflows/verifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ def define(cls, spec):
super().define(spec)
# yapf: disable
spec.expose_inputs(_BaseMeasureWorkChain, namespace='accuracy',
exclude=['code', 'pseudo', 'options', 'parallelization'])
exclude=['code', 'pseudo', 'options', 'parallelization', 'clean_workchain'])
spec.expose_inputs(_BaseConvergenceWorkChain, namespace='convergence',
exclude=['code', 'pseudo', 'options', 'parallelization'])
exclude=['code', 'pseudo', 'options', 'parallelization', 'clean_workchain'])
spec.input('pw_code', valid_type=orm.Code,
help='The `pw.x` code use for the `PwCalculation`.')
spec.input('ph_code', valid_type=orm.Code,
Expand Down
4 changes: 2 additions & 2 deletions examples/example_verification.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ def run_verification(
"withmpi": True,
}
),
"parallelization": orm.Dict(dict={"npool": 2}),
"clean_workchain": orm.Bool(True),
"parallelization": orm.Dict(dict={"npool": 1}),
"clean_workchain": orm.Bool(clean_workchain),
}

res, node = run_get_node(VerificationWorkChain, **inputs)
Expand Down

0 comments on commit 07fbae5

Please sign in to comment.