File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -359,10 +359,12 @@ def __init__(
359359 from executorlib .task_scheduler .file .task_scheduler import (
360360 create_file_executor ,
361361 )
362+
362363 if terminate_tasks_on_shutdown :
363364 from executorlib .task_scheduler .file .queue_spawner import (
364365 terminate_with_pysqa ,
365366 )
367+
366368 terminate_function = terminate_with_pysqa
367369 else :
368370 terminate_function = None
Original file line number Diff line number Diff line change @@ -165,10 +165,12 @@ def __init__(
165165 from executorlib .task_scheduler .file .task_scheduler import (
166166 create_file_executor ,
167167 )
168+
168169 if terminate_tasks_on_shutdown :
169170 from executorlib .task_scheduler .file .queue_spawner import (
170171 terminate_with_pysqa ,
171172 )
173+
172174 terminate_function = terminate_with_pysqa
173175 else :
174176 terminate_function = None
Original file line number Diff line number Diff line change @@ -223,4 +223,4 @@ def check_terminate_tasks_on_shutdown(terminate_tasks_on_shutdown: bool) -> None
223223 "terminate_tasks_on_shutdown is not supported for the executorlib.SingleNodeExecutor, "
224224 "executorlib.SlurmJobExecutor and executorlib.FluxJobExecutor."
225225 "Please use terminate_tasks_on_shutdown=True instead of terminate_tasks_on_shutdown=False."
226- )
226+ )
Original file line number Diff line number Diff line change 1010from executorlib .standalone .command import get_command_path
1111from executorlib .standalone .serialize import serialize_funct_h5
1212from executorlib .task_scheduler .file .hdf import dump , get_output
13- from executorlib .task_scheduler .file .subprocess_spawner import (
14- terminate_subprocess
15- )
13+ from executorlib .task_scheduler .file .subprocess_spawner import terminate_subprocess
1614
1715
1816class FutureItem :
@@ -89,7 +87,10 @@ def execute_tasks_h5(
8987 with contextlib .suppress (queue .Empty ):
9088 task_dict = future_queue .get_nowait ()
9189 if task_dict is not None and "shutdown" in task_dict and task_dict ["shutdown" ]:
92- if terminate_function is not None and terminate_function == terminate_subprocess :
90+ if (
91+ terminate_function is not None
92+ and terminate_function == terminate_subprocess
93+ ):
9394 for task in process_dict .values ():
9495 terminate_function (task = task )
9596 elif terminate_function is not None :
You can’t perform that action at this time.
0 commit comments