Skip to content

Commit

Permalink
Restrict the selectable value for cpus_per_node to the node size.
Browse files Browse the repository at this point in the history
  • Loading branch information
csadorf committed Jul 15, 2021
1 parent c737379 commit 8c05ee9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion aiidalab_qe/steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,8 @@ def _update_cpus_per_node(self, change):
if change["new"]:
current_value = self.resources_config.cpus_per_node.value
new_value = self._get_default_cpus_per_node()
self.resources_config.cpus_per_node.max = new_value
if current_value != new_value:
self.resources_config.cpus_per_node.max = new_value
self.resources_config.cpus_per_node.value = new_value
self._show_alert_message(
"The number cpus per node was automatically adjusted to "
Expand Down
2 changes: 1 addition & 1 deletion aiidalab_qe/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ def __init__(self, **kwargs):
value=1, step=1, min=1, description="# nodes", disabled=False, **extra
)
self.cpus_per_node = ipw.BoundedIntText(
value=1, step=1, min=1, description="# cpus per node", **extra
value=1, step=1, min=1, max=1, description="# cpus per node", **extra
)
self.total_num_cpus = ipw.BoundedIntText(
value=1, step=1, min=1, description="# total cpus", disabled=True, **extra
Expand Down

0 comments on commit 8c05ee9

Please sign in to comment.