Skip to content

Commit

Permalink
change max nb cpus formula
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinBelthle committed Oct 9, 2023
1 parent ec890bf commit 4309e62
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion antarest/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ def from_dict(cls, data: JSON) -> "SlurmConfig":
# Use the old way to configure the NB cores for backward compatibility
nb_cores["default"] = int(data["default_n_cpu"])
nb_cores["min"] = min(nb_cores["min"], nb_cores["default"])
nb_cores["max"] = min(nb_cores["max"], nb_cores["default"])
nb_cores["max"] = max(nb_cores["max"], nb_cores["default"])
if enable_nb_cores_detection:
nb_cores.update(cls._autodetect_nb_cores())
return cls(
Expand Down
2 changes: 1 addition & 1 deletion tests/core/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def test_from_dict__default_n_cpu__backport(self):
"default_n_cpu": 15,
}
)
assert config.nb_cores == NbCoresConfig(min=1, default=15, max=15)
assert config.nb_cores == NbCoresConfig(min=1, default=15, max=24)

def test_from_dict__auto_detect(self):
with pytest.raises(NotImplementedError):
Expand Down

0 comments on commit 4309e62

Please sign in to comment.