Skip to content

Commit

Permalink
Use num_machines * num_mpiprocs_per_machines to set num_cpus
Browse files Browse the repository at this point in the history
  • Loading branch information
unkcpz committed Aug 19, 2024
1 parent f00dcbb commit e21bcf9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion aiida_hyperqueue/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ def validate_resources(cls, **kwargs):
try:
resources.num_cpus = kwargs.pop("num_cpus")
except KeyError:
raise KeyError("Must specify `num_cpus`")
try:
resources.num_cpus = kwargs.pop("num_machines") * kwargs.pop("num_mpiprocs_per_machine")
except KeyError:
raise KeyError("Must specify `num_cpus`, or (`num_machines` and `num_mpiproces_per_machine`)")
else:
if not isinstance(resources.num_cpus, int):
raise ValueError("`num_cpus` must be an integer")
Expand Down

0 comments on commit e21bcf9

Please sign in to comment.