|
5 | 5 | import queue |
6 | 6 | import subprocess |
7 | 7 | from enum import Enum |
8 | | -from typing import Dict, List |
| 8 | +from typing import Dict, List, Optional |
9 | 9 |
|
10 | 10 | from parsl.multiprocessing import SpawnContext |
11 | 11 | from parsl.serialize import pack_res_spec_apply_message, unpack_res_spec_apply_message |
@@ -86,8 +86,8 @@ def __init__( |
86 | 86 | def put_task(self, task) -> None: |
87 | 87 | return self.pending_task_q.put(task) |
88 | 88 |
|
89 | | - def get_result(self, block: bool, timeout: float): |
90 | | - return self.pending_result_q.get(block, timeout=timeout) |
| 89 | + def get_result(self, block: bool = True, timeout: Optional[float] = None): |
| 90 | + return self.pending_result_q.get(block, timeout) |
91 | 91 |
|
92 | 92 |
|
93 | 93 | class MPITaskScheduler(TaskScheduler): |
@@ -191,9 +191,9 @@ def _schedule_backlog_tasks(self): |
191 | 191 | # Keep attempting to schedule tasks till we are out of resources |
192 | 192 | self._schedule_backlog_tasks() |
193 | 193 |
|
194 | | - def get_result(self, block: bool, timeout: float): |
| 194 | + def get_result(self, block: bool = True, timeout: Optional[float] = None): |
195 | 195 | """Return result and relinquish provisioned nodes""" |
196 | | - result_pkl = self.pending_result_q.get(block, timeout=timeout) |
| 196 | + result_pkl = self.pending_result_q.get(block, timeout) |
197 | 197 | result_dict = pickle.loads(result_pkl) |
198 | 198 | # TODO (wardlt): If the task did not request nodes, it won't be in `self._map_tasks_to_nodes`. |
199 | 199 | # Causes Parsl to hang. See Issue #3427 |
|
0 commit comments