Skip to content

Commit 3c0dec7

Browse files
authored
[Fix] Rename run_time_limit to run_time_max (#953)
Primarily for consistency with pysqa.
1 parent c1654f7 commit 3c0dec7

13 files changed

Lines changed: 50 additions & 50 deletions

File tree

docs/trouble_shooting.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ The resource dictionary parameter `resource_dict` can contain one or more of the
5050
* `exclusive` (bool): boolean flag to reserve exclusive access to selected compute nodes - do not allow other tasks to
5151
use the same compute node.
5252
* `error_log_file` (str): path to the error log file, primarily used to merge the log of multiple tasks in one file.
53-
* `run_time_limit` (int): the maximum time the execution of the submitted Python function is allowed to take in seconds.
53+
* `run_time_max` (int): the maximum time the execution of the submitted Python function is allowed to take in seconds.
5454
* `priority` (int): the queuing system priority assigned to a given Python function to influence the scheduling.
5555
* `slurm_cmd_args` (list): Additional command line arguments for the srun call (SLURM only)
5656

src/executorlib/executor/flux.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ class FluxJobExecutor(BaseExecutor):
5151
do not allow other tasks to use the same compute node.
5252
* error_log_file (str): path to the error log file, primarily used to merge the log of
5353
multiple tasks in one file.
54-
* run_time_limit (int): the maximum time the execution of the submitted Python function is
55-
allowed to take in seconds.
54+
* run_time_max (int): the maximum time the execution of the submitted Python function is
55+
allowed to take in seconds.
5656
* priority (int): the queuing system priority assigned to a given Python function to
5757
influence the scheduling.
5858
* slurm_cmd_args (list): Additional command line arguments for the srun call (SLURM only)
@@ -154,7 +154,7 @@ def __init__(
154154
- do not allow other tasks to use the same compute node.
155155
* error_log_file (str): path to the error log file, primarily used to merge the log of
156156
multiple tasks in one file.
157-
* run_time_limit (int): the maximum time the execution of the submitted Python
157+
* run_time_max (int): the maximum time the execution of the submitted Python
158158
function is allowed to take in seconds.
159159
* priority (int): the queuing system priority assigned to a given Python function to
160160
influence the scheduling.
@@ -283,8 +283,8 @@ class FluxClusterExecutor(BaseExecutor):
283283
do not allow other tasks to use the same compute node.
284284
* error_log_file (str): path to the error log file, primarily used to merge the log of
285285
multiple tasks in one file.
286-
* run_time_limit (int): the maximum time the execution of the submitted Python function is
287-
allowed to take in seconds.
286+
* run_time_max (int): the maximum time the execution of the submitted Python function is
287+
allowed to take in seconds.
288288
* priority (int): the queuing system priority assigned to a given Python function to
289289
influence the scheduling.
290290
* slurm_cmd_args (list): Additional command line arguments for the srun call (SLURM only)
@@ -380,7 +380,7 @@ def __init__(
380380
- do not allow other tasks to use the same compute node.
381381
* error_log_file (str): path to the error log file, primarily used to merge the log of
382382
multiple tasks in one file.
383-
* run_time_limit (int): the maximum time the execution of the submitted Python
383+
* run_time_max (int): the maximum time the execution of the submitted Python
384384
function is allowed to take in seconds.
385385
* priority (int): the queuing system priority assigned to a given Python function to
386386
influence the scheduling.
@@ -417,7 +417,7 @@ def __init__(
417417
"cwd": None,
418418
"openmpi_oversubscribe": openmpi_oversubscribe,
419419
"slurm_cmd_args": [],
420-
"run_time_limit": None,
420+
"run_time_max": None,
421421
}
422422
if resource_dict is None:
423423
resource_dict = {}
@@ -540,8 +540,8 @@ def create_flux_executor(
540540
do not allow other tasks to use the same compute node.
541541
* error_log_file (str): path to the error log file, primarily used to merge the log of
542542
multiple tasks in one file.
543-
* run_time_limit (int): the maximum time the execution of the submitted Python function is
544-
allowed to take in seconds.
543+
* run_time_max (int): the maximum time the execution of the submitted Python function is
544+
allowed to take in seconds.
545545
* priority (int): the queuing system priority assigned to a given Python function to
546546
influence the scheduling.
547547
* slurm_cmd_args (list): Additional command line arguments for the srun call (SLURM only)

src/executorlib/executor/single.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ class SingleNodeExecutor(BaseExecutor):
5050
do not allow other tasks to use the same compute node.
5151
* error_log_file (str): path to the error log file, primarily used to merge the log of
5252
multiple tasks in one file.
53-
* run_time_limit (int): the maximum time the execution of the submitted Python function is
54-
allowed to take in seconds.
53+
* run_time_max (int): the maximum time the execution of the submitted Python function is
54+
allowed to take in seconds.
5555
* priority (int): the queuing system priority assigned to a given Python function to
5656
influence the scheduling.
5757
* slurm_cmd_args (list): Additional command line arguments for the srun call (SLURM only)
@@ -145,7 +145,7 @@ def __init__(
145145
- do not allow other tasks to use the same compute node.
146146
* error_log_file (str): path to the error log file, primarily used to merge the log of
147147
multiple tasks in one file.
148-
* run_time_limit (int): the maximum time the execution of the submitted Python
148+
* run_time_max (int): the maximum time the execution of the submitted Python
149149
function is allowed to take in seconds.
150150
* priority (int): the queuing system priority assigned to a given Python function to
151151
influence the scheduling.
@@ -259,8 +259,8 @@ class TestClusterExecutor(BaseExecutor):
259259
do not allow other tasks to use the same compute node.
260260
* error_log_file (str): path to the error log file, primarily used to merge the log of
261261
multiple tasks in one file.
262-
* run_time_limit (int): the maximum time the execution of the submitted Python function is
263-
allowed to take in seconds.
262+
* run_time_max (int): the maximum time the execution of the submitted Python function is
263+
allowed to take in seconds.
264264
* priority (int): the queuing system priority assigned to a given Python function to
265265
influence the scheduling.
266266
* slurm_cmd_args (list): Additional command line arguments for the srun call (SLURM only)
@@ -350,7 +350,7 @@ def __init__(
350350
- do not allow other tasks to use the same compute node.
351351
* error_log_file (str): path to the error log file, primarily used to merge the log of
352352
multiple tasks in one file.
353-
* run_time_limit (int): the maximum time the execution of the submitted Python
353+
* run_time_max (int): the maximum time the execution of the submitted Python
354354
function is allowed to take in seconds.
355355
* priority (int): the queuing system priority assigned to a given Python function to
356356
influence the scheduling.
@@ -479,8 +479,8 @@ def create_single_node_executor(
479479
do not allow other tasks to use the same compute node.
480480
* error_log_file (str): path to the error log file, primarily used to merge the log of
481481
multiple tasks in one file.
482-
* run_time_limit (int): the maximum time the execution of the submitted Python function is
483-
allowed to take in seconds.
482+
* run_time_max (int): the maximum time the execution of the submitted Python function is
483+
allowed to take in seconds.
484484
* priority (int): the queuing system priority assigned to a given Python function to
485485
influence the scheduling.
486486
* slurm_cmd_args (list): Additional command line arguments for the srun call (SLURM only)

src/executorlib/executor/slurm.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ class SlurmClusterExecutor(BaseExecutor):
5252
do not allow other tasks to use the same compute node.
5353
* error_log_file (str): path to the error log file, primarily used to merge the log of
5454
multiple tasks in one file.
55-
* run_time_limit (int): the maximum time the execution of the submitted Python function is
56-
allowed to take in seconds.
55+
* run_time_max (int): the maximum time the execution of the submitted Python function is
56+
allowed to take in seconds.
5757
* priority (int): the queuing system priority assigned to a given Python function to
5858
influence the scheduling.
5959
* slurm_cmd_args (list): Additional command line arguments for the srun call (SLURM only)
@@ -149,7 +149,7 @@ def __init__(
149149
- do not allow other tasks to use the same compute node.
150150
* error_log_file (str): path to the error log file, primarily used to merge the log of
151151
multiple tasks in one file.
152-
* run_time_limit (int): the maximum time the execution of the submitted Python
152+
* run_time_max (int): the maximum time the execution of the submitted Python
153153
function is allowed to take in seconds.
154154
* priority (int): the queuing system priority assigned to a given Python function to
155155
influence the scheduling.
@@ -293,8 +293,8 @@ class SlurmJobExecutor(BaseExecutor):
293293
do not allow other tasks to use the same compute node.
294294
* error_log_file (str): path to the error log file, primarily used to merge the log of
295295
multiple tasks in one file.
296-
* run_time_limit (int): the maximum time the execution of the submitted Python function is
297-
allowed to take in seconds.
296+
* run_time_max (int): the maximum time the execution of the submitted Python function is
297+
allowed to take in seconds.
298298
* priority (int): the queuing system priority assigned to a given Python function to
299299
influence the scheduling.
300300
* slurm_cmd_args (list): Additional command line arguments for the srun call (SLURM only)
@@ -390,7 +390,7 @@ def __init__(
390390
- do not allow other tasks to use the same compute node.
391391
* error_log_file (str): path to the error log file, primarily used to merge the log of
392392
multiple tasks in one file.
393-
* run_time_limit (int): the maximum time the execution of the submitted Python
393+
* run_time_max (int): the maximum time the execution of the submitted Python
394394
function is allowed to take in seconds.
395395
* priority (int): the queuing system priority assigned to a given Python function to
396396
influence the scheduling.
@@ -518,8 +518,8 @@ def create_slurm_executor(
518518
do not allow other tasks to use the same compute node.
519519
* error_log_file (str): path to the error log file, primarily used to merge the log of
520520
multiple tasks in one file.
521-
* run_time_limit (int): the maximum time the execution of the submitted Python function is
522-
allowed to take in seconds.
521+
* run_time_max (int): the maximum time the execution of the submitted Python function is
522+
allowed to take in seconds.
523523
* priority (int): the queuing system priority assigned to a given Python function to
524524
influence the scheduling.
525525
* slurm_cmd_args (list): Additional command line arguments for the srun call (SLURM only)

src/executorlib/standalone/command.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def generate_slurm_command(
126126
openmpi_oversubscribe: bool = False,
127127
slurm_cmd_args: Optional[list[str]] = None,
128128
pmi_mode: Optional[str] = None,
129-
run_time_limit: Optional[int] = None,
129+
run_time_max: Optional[int] = None,
130130
) -> list[str]:
131131
"""
132132
Generate the command list for the SLURM interface.
@@ -141,7 +141,7 @@ def generate_slurm_command(
141141
openmpi_oversubscribe (bool, optional): Whether to oversubscribe the cores. Defaults to False.
142142
slurm_cmd_args (list[str], optional): Additional command line arguments. Defaults to [].
143143
pmi_mode (str): PMI interface to use (OpenMPI v5 requires pmix) default is None
144-
run_time_limit (int): The maximum runtime in seconds for each task. Default: None
144+
run_time_max (int): The maximum runtime in seconds for each task. Default: None
145145
146146
Returns:
147147
list[str]: The generated command list.
@@ -161,8 +161,8 @@ def generate_slurm_command(
161161
command_prepend_lst += ["--exact"]
162162
if openmpi_oversubscribe:
163163
command_prepend_lst += ["--oversubscribe"]
164-
if run_time_limit is not None:
165-
command_prepend_lst += ["--time=" + str(run_time_limit // 60 + 1)]
164+
if run_time_max is not None:
165+
command_prepend_lst += ["--time=" + str(run_time_max // 60 + 1)]
166166
if slurm_cmd_args is not None and len(slurm_cmd_args) > 0:
167167
command_prepend_lst += slurm_cmd_args
168168
return command_prepend_lst

src/executorlib/standalone/validate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class ResourceDictValidation(BaseModel):
2323
num_nodes: Optional[int] = None
2424
exclusive: Optional[bool] = None
2525
error_log_file: Optional[str] = None
26-
run_time_limit: Optional[int] = None
26+
run_time_max: Optional[int] = None
2727
priority: Optional[int] = None
2828
slurm_cmd_args: Optional[list[str]] = None
2929
submission_template: Optional[str] = None

src/executorlib/task_scheduler/file/spawner_pysqa.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def execute_with_pysqa(
6969
"command": " ".join(command),
7070
"dependency_list": [str(qid) for qid in task_dependent_lst],
7171
"working_directory": os.path.abspath(cwd),
72-
"run_time_max": resource_dict.get("run_time_limit"),
72+
"run_time_max": resource_dict.get("run_time_max"),
7373
}
7474
if "cwd" in resource_dict:
7575
del resource_dict["cwd"]

src/executorlib/task_scheduler/interactive/spawner_flux.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class FluxPythonSpawner(BaseSpawner):
4444
flux_executor (flux.job.FluxExecutor, optional): The FluxExecutor instance. Defaults to None.
4545
flux_executor_nesting (bool, optional): Whether to use nested FluxExecutor. Defaults to False.
4646
flux_log_files (bool, optional): Write flux stdout and stderr files. Defaults to False.
47-
run_time_limit (int): The maximum runtime in seconds for each task. Default: None
47+
run_time_max (int): The maximum runtime in seconds for each task. Default: None
4848
"""
4949

5050
def __init__(
@@ -62,7 +62,7 @@ def __init__(
6262
flux_executor: Optional[flux.job.FluxExecutor] = None,
6363
flux_executor_nesting: bool = False,
6464
flux_log_files: bool = False,
65-
run_time_limit: Optional[int] = None,
65+
run_time_max: Optional[int] = None,
6666
):
6767
super().__init__(
6868
cwd=cwd,
@@ -80,7 +80,7 @@ def __init__(
8080
self._flux_log_files = flux_log_files
8181
self._priority = priority
8282
self._future = None
83-
self._run_time_limit = run_time_limit
83+
self._run_time_max = run_time_max
8484

8585
def bootup(
8686
self,
@@ -131,8 +131,8 @@ def bootup(
131131
if self._cwd is not None:
132132
jobspec.cwd = self._cwd
133133
os.makedirs(self._cwd, exist_ok=True)
134-
if self._run_time_limit is not None:
135-
jobspec.duration = self._run_time_limit
134+
if self._run_time_max is not None:
135+
jobspec.duration = self._run_time_max
136136
file_prefix = "flux_" + str(self._worker_id)
137137
if self._flux_log_files and self._cwd is not None:
138138
jobspec.stderr = os.path.join(self._cwd, file_prefix + ".err")

0 commit comments

Comments
 (0)