Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions executorlib/executor/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,16 @@ def submit( # type: ignore
fn (callable): function to submit for execution
args: arguments for the submitted function
kwargs: keyword arguments for the submitted function
resource_dict (dict): resource dictionary, which defines the resources used for the execution of the
function. Example resource dictionary: {
cores: 1,
threads_per_core: 1,
gpus_per_worker: 0,
oversubscribe: False,
cwd: None,
executor: None,
hostname_localhost: False,
}
resource_dict (dict): A dictionary of resources required by the task. With the following keys:
- cores (int): number of MPI cores to be used for each function call
- threads_per_core (int): number of OpenMP threads to be used for each function call
- gpus_per_core (int): number of GPUs per worker - defaults to 0
- cwd (str/None): current working directory where the parallel python task is executed
- openmpi_oversubscribe (bool): adds the `--oversubscribe` command line flag (OpenMPI and
SLURM only) - default False
- slurm_cmd_args (list): Additional command line arguments for the srun call (SLURM only)
- error_log_file (str): Name of the error log file to use for storing exceptions raised
by the Python functions submitted to the Executor.

Returns:
Future: A Future representing the given call.
Expand Down
2 changes: 1 addition & 1 deletion executorlib/standalone/interactive/spawner.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def __init__(
cwd (str, optional): The current working directory. Defaults to None.
cores (int, optional): The number of cores to use. Defaults to 1.
threads_per_core (int, optional): The number of threads per core. Defaults to 1.
oversubscribe (bool, optional): Whether to oversubscribe the cores. Defaults to False.
openmpi_oversubscribe (bool, optional): Whether to oversubscribe the cores. Defaults to False.
"""
super().__init__(
cwd=cwd,
Expand Down
20 changes: 10 additions & 10 deletions executorlib/standalone/serialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@ def serialize_funct_h5(
fn (Callable): The function to be serialized.
fn_args (list): The arguments of the function.
fn_kwargs (dict): The keyword arguments of the function.
resource_dict (dict): resource dictionary, which defines the resources used for the execution of the function.
Example resource dictionary: {
cores: 1,
threads_per_core: 1,
gpus_per_worker: 0,
oversubscribe: False,
cwd: None,
executor: None,
hostname_localhost: False,
}
resource_dict (dict): A dictionary of resources required by the task. With the following keys:
- cores (int): number of MPI cores to be used for each function call
- threads_per_core (int): number of OpenMP threads to be used for each function call
- gpus_per_core (int): number of GPUs per worker - defaults to 0
- cwd (str/None): current working directory where the parallel python task is executed
- openmpi_oversubscribe (bool): adds the `--oversubscribe` command line flag (OpenMPI and
SLURM only) - default False
- slurm_cmd_args (list): Additional command line arguments for the srun call (SLURM only)
- error_log_file (str): Name of the error log file to use for storing exceptions raised
by the Python functions submitted to the Executor.
cache_key (str, optional): By default the cache_key is generated based on the function hash, this can be
overwritten by setting the cache_key.

Expand Down
20 changes: 10 additions & 10 deletions executorlib/task_scheduler/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,16 @@ def submit( # type: ignore
fn (callable): function to submit for execution
args: arguments for the submitted function
kwargs: keyword arguments for the submitted function
resource_dict (dict): resource dictionary, which defines the resources used for the execution of the
function. Example resource dictionary: {
cores: 1,
threads_per_core: 1,
gpus_per_worker: 0,
oversubscribe: False,
cwd: None,
executor: None,
hostname_localhost: False,
}
resource_dict (dict): A dictionary of resources required by the task. With the following keys:
- cores (int): number of MPI cores to be used for each function call
- threads_per_core (int): number of OpenMP threads to be used for each function call
- gpus_per_core (int): number of GPUs per worker - defaults to 0
- cwd (str/None): current working directory where the parallel python task is executed
- openmpi_oversubscribe (bool): adds the `--oversubscribe` command line flag (OpenMPI and
SLURM only) - default False
- slurm_cmd_args (list): Additional command line arguments for the srun call (SLURM only)
- error_log_file (str): Name of the error log file to use for storing exceptions raised
by the Python functions submitted to the Executor.
Comment on lines +90 to +99
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Ensure check_resource_dict recognises gpus_per_core

The docstring now documents gpus_per_core, but executorlib.standalone.inputcheck.check_resource_dict historically expected gpus_per_worker. Verify the helper was updated accordingly to avoid false validation errors.


🏁 Script executed:

#!/bin/bash
# Search for gpus_per_worker vs gpus_per_core in the input-check helper
fd inputcheck | xargs rg -n 'gpus_per_(worker|core)'

Length of output: 754


Update inputcheck to support gpus_per_core

The executorlib.standalone.inputcheck module still defines and tests:

  • check_gpus_per_worker(gpus_per_worker: int)
    File: executorlib/standalone/inputcheck.py (lines 30–38)
  • Calls in tests: tests/test_standalone_inputcheck.py (lines 5, 31–33)

These must be renamed to check_gpus_per_core(gpus_per_core: int) (and all related call sites in check_resource_dict) to match the updated docstring in executorlib/task_scheduler/base.py and avoid validation errors.

Tagging as

🤖 Prompt for AI Agents
In executorlib/standalone/inputcheck.py around lines 30 to 38 and
tests/test_standalone_inputcheck.py around lines 5 and 31 to 33, rename the
function check_gpus_per_worker to check_gpus_per_core and update all related
call sites in the check_resource_dict function accordingly. This change aligns
the validation function and its usage with the updated resource_dict key
gpus_per_core in executorlib/task_scheduler/base.py, preventing validation
errors.


Returns:
Future: A Future representing the given call.
Expand Down
20 changes: 10 additions & 10 deletions executorlib/task_scheduler/interactive/blockallocation.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,16 @@ def submit( # type: ignore
fn (Callable): function to submit for execution
args: arguments for the submitted function
kwargs: keyword arguments for the submitted function
resource_dict (dict): resource dictionary, which defines the resources used for the execution of the
function. Example resource dictionary: {
cores: 1,
threads_per_core: 1,
gpus_per_worker: 0,
oversubscribe: False,
cwd: None,
executor: None,
hostname_localhost: False,
}
resource_dict (dict): A dictionary of resources required by the task. With the following keys:
- cores (int): number of MPI cores to be used for each function call
- threads_per_core (int): number of OpenMP threads to be used for each function call
- gpus_per_core (int): number of GPUs per worker - defaults to 0
- cwd (str/None): current working directory where the parallel python task is executed
- openmpi_oversubscribe (bool): adds the `--oversubscribe` command line flag (OpenMPI and
SLURM only) - default False
- slurm_cmd_args (list): Additional command line arguments for the srun call (SLURM only)
- error_log_file (str): Name of the error log file to use for storing exceptions raised
by the Python functions submitted to the Executor.

Returns:
Future: A Future representing the given call.
Expand Down
Loading