Skip to content

Commit

Permalink
Add init_walltime input.
Browse files Browse the repository at this point in the history
So far, the walltime for the initialization `HpBaseWorkChain` was set to 3600 seconds which was hard coded. This might cause some problems on certain HPC partitions, especially the ones for testing. Here, we add the walltime as an input to the `HpParallelizeAtomsWorkChain` and `HpParallelizeQpointsWorkChain`, with a default of 1 hour.
  • Loading branch information
t-reents committed Feb 12, 2024
1 parent 31ae4e9 commit 6f92f42
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ def define(cls, spec):
spec.expose_inputs(HpBaseWorkChain, exclude=('only_initialization', 'clean_workdir'))
spec.input('parallelize_qpoints', valid_type=orm.Bool, default=lambda: orm.Bool(False))
spec.input('max_concurrent_base_workchains', valid_type=orm.Int, required=False)
spec.input(
'init_walltime', valid_type=int, default=3600, non_db=True,
help='The walltime of the initialization `HpBaseWorkChain` in seconds (default: 3600).'
)
spec.input('clean_workdir', valid_type=orm.Bool, default=lambda: orm.Bool(False),
help='If `True`, work directories of all called calculation will be cleaned at the end of execution.')
spec.outline(
Expand Down Expand Up @@ -56,7 +60,7 @@ def run_init(self):
inputs = AttributeDict(self.exposed_inputs(HpBaseWorkChain))
inputs.only_initialization = orm.Bool(True)
inputs.clean_workdir = self.inputs.clean_workdir
inputs.hp.metadata.options.max_wallclock_seconds = 3600 # 1 hour is more than enough
inputs.hp.metadata.options.max_wallclock_seconds = self.inputs.init_walltime
inputs.metadata.call_link_label = 'initialization'

node = self.submit(HpBaseWorkChain, **inputs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ def define(cls, spec):
super().define(spec)
spec.expose_inputs(HpBaseWorkChain, exclude=('only_initialization', 'clean_workdir'))
spec.input('max_concurrent_base_workchains', valid_type=orm.Int, required=False)
spec.input(
'init_walltime', valid_type=int, default=3600, non_db=True,
help='The walltime of the initialization `HpBaseWorkChain` in seconds (default: 3600).'
)
spec.input('clean_workdir', valid_type=orm.Bool, default=lambda: orm.Bool(False),
help='If `True`, work directories of all called calculation will be cleaned at the end of execution.')
spec.outline(
Expand Down Expand Up @@ -63,7 +67,7 @@ def run_init(self):
inputs.hp.parameters = orm.Dict(parameters)
inputs.clean_workdir = self.inputs.clean_workdir

inputs.hp.metadata.options.max_wallclock_seconds = 3600 # 1 hour is more than enough
inputs.hp.metadata.options.max_wallclock_seconds = self.inputs.init_walltime
inputs.metadata.call_link_label = 'initialization'

node = self.submit(HpBaseWorkChain, **inputs)
Expand Down

0 comments on commit 6f92f42

Please sign in to comment.