Skip to content

Commit 9660123

Browse files
authored
Specify instance attributes in init (#3770)
There's no sense in delaying the creation of these instance variables. Move them to init to allow typing to be able to reason about them slightly better. # Changed Behaviour No changed behaviour. ## Type of change - Code maintenance/cleanup
1 parent 4dd7fbf commit 9660123

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

parsl/executors/high_throughput/process_worker_pool.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,8 @@ def __init__(self, *,
214214
math.floor(cores_on_node / cores_per_worker))
215215

216216
self._mp_manager = SpawnContext.Manager() # Starts a server process
217+
self._tasks_in_progress = self._mp_manager.dict()
218+
self._kill_event = threading.Event()
217219

218220
self.monitoring_queue = self._mp_manager.Queue()
219221
self.pending_task_queue = SpawnContext.Queue()
@@ -507,9 +509,6 @@ def start(self):
507509
508510
TODO: Move task receiving to a thread
509511
"""
510-
self._kill_event = threading.Event()
511-
self._tasks_in_progress = self._mp_manager.dict()
512-
513512
self.procs = {}
514513
for worker_id in range(self.worker_count):
515514
p = self._start_worker(worker_id)

0 commit comments

Comments
 (0)