Skip to content

Commit

Permalink
convert to int
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-janssen committed Dec 20, 2024
1 parent e93d616 commit 4b06eb5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion executorlib/interactive/flux.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from executorlib.standalone.interactive.spawner import BaseSpawner


def validate_max_workers(max_workers, cores, threads_per_core):
def validate_max_workers(max_workers: int, cores: int, threads_per_core: int):
handle = flux.Flux()
cores_total = flux.resource.list.resource_list(handle).get().up.ncores
cores_requested = max_workers * cores * threads_per_core
Expand Down
4 changes: 2 additions & 2 deletions executorlib/interactive/slurm.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
SLURM_COMMAND = "srun"


def validate_max_workers(max_workers, cores, threads_per_core):
cores_total = os.environ["SLURM_NTASKS"] * os.environ["SLURM_CPUS_PER_TASK"]
def validate_max_workers(max_workers: int, cores: int, threads_per_core: int):
cores_total = int(os.environ["SLURM_NTASKS"]) * int(os.environ["SLURM_CPUS_PER_TASK"])
cores_requested = max_workers * cores * threads_per_core
if cores_total < cores_requested:
raise ValueError(
Expand Down

0 comments on commit 4b06eb5

Please sign in to comment.