Skip to content

Commit 8531773

Browse files
committed
fixes
1 parent c2b7af4 commit 8531773

4 files changed

Lines changed: 19 additions & 6 deletions

File tree

src/executorlib/executor/flux.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ def __init__(
310310
plot_dependency_graph_filename: Optional[str] = None,
311311
export_workflow_filename: Optional[str] = None,
312312
log_obj_size: bool = False,
313-
cancel_futures_on_shutdown: bool = True,
313+
cancel_futures_on_shutdown: bool = False,
314314
):
315315
"""
316316
The executorlib.FluxClusterExecutor leverages either the message passing interface (MPI), the SLURM workload

src/executorlib/executor/single.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ def __init__(
279279
plot_dependency_graph_filename: Optional[str] = None,
280280
export_workflow_filename: Optional[str] = None,
281281
log_obj_size: bool = False,
282-
cancel_futures_on_shutdown: bool = True,
282+
cancel_futures_on_shutdown: bool = False,
283283
):
284284
"""
285285
The executorlib.api.TestClusterExecutor is designed to test the file based communication used in the

src/executorlib/task_scheduler/file/shared.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def execute_tasks_h5(
5757
backend: Optional[str] = None,
5858
disable_dependencies: bool = False,
5959
pmi_mode: Optional[str] = None,
60-
cancel_futures_on_shutdown: bool = True,
60+
cancel_futures_on_shutdown: bool = False,
6161
) -> None:
6262
"""
6363
Execute tasks stored in a queue using HDF5 files.
@@ -89,7 +89,7 @@ def execute_tasks_h5(
8989
with contextlib.suppress(queue.Empty):
9090
task_dict = future_queue.get_nowait()
9191
if task_dict is not None and "shutdown" in task_dict and task_dict["shutdown"]:
92-
if task_dict["wait"]:
92+
if task_dict["wait"] and not cancel_futures_on_shutdown:
9393
while len(memory_dict) > 0:
9494
memory_dict = {
9595
key: _check_task_output(
@@ -100,7 +100,7 @@ def execute_tasks_h5(
100100
for key, value in memory_dict.items()
101101
if not value.done()
102102
}
103-
if task_dict["cancel_futures"] or cancel_futures_on_shutdown:
103+
if not task_dict["cancel_futures"] and not cancel_futures_on_shutdown:
104104
if (
105105
terminate_function is not None
106106
and terminate_function == terminate_subprocess
@@ -114,6 +114,19 @@ def execute_tasks_h5(
114114
config_directory=pysqa_config_directory,
115115
backend=backend,
116116
)
117+
else:
118+
memory_dict = {
119+
key: _check_task_output(
120+
task_key=key,
121+
future_obj=value,
122+
cache_directory=cache_dir_dict[key],
123+
)
124+
for key, value in memory_dict.items()
125+
if not value.done()
126+
}
127+
for value in memory_dict.values():
128+
if not value.done():
129+
value.cancel()
117130
future_queue.task_done()
118131
future_queue.join()
119132
break

src/executorlib/task_scheduler/file/task_scheduler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def __init__(
3535
backend: Optional[str] = None,
3636
disable_dependencies: bool = False,
3737
pmi_mode: Optional[str] = None,
38-
cancel_futures_on_shutdown: bool = True,
38+
cancel_futures_on_shutdown: bool = False,
3939
):
4040
"""
4141
Initialize the FileExecutor.

0 commit comments

Comments
 (0)