Skip to content

Commit

Permalink
remove threading and add prints
Browse files Browse the repository at this point in the history
  • Loading branch information
Robin Fievet committed Aug 19, 2024
1 parent 2d5912b commit cbe713b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions LIReC/lib/pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,16 @@ class WorkerPool:
result_queues: Dict[str, Queue]

def __init__(self: WorkerPool) -> None:
print('Starting __init__ WorkerPool ...')
self.manager = Manager()
self.job_queue = self.manager.Queue()
self.log_queue = self.manager.Queue()
self.result_queues = {}

def start(self: WorkerPool, modules: Dict[str, Any]): # -> module_id, timings
print('Starting WorkerPool ...')
Process(target=print_logger, args=(self.log_queue,)).start()
print("Process started")
pipes = []
for i, (module_path, module_config) in enumerate(modules):
module_id = f'{i}@{module_path}'
Expand Down
5 changes: 3 additions & 2 deletions run_lirec.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def run_lirec():
# Assuming LIReC has an entry point in its package
# Run LIReC (same as from run_jobs.py)
from LIReC.jobs import run
print("Running run.main()")
run.main()

def main():
Expand All @@ -39,8 +40,8 @@ def main():
# run_lirec()

# Start the print_status function in a background thread
status_thread = threading.Thread(target=print_status, daemon=True)
status_thread.start()
# status_thread = threading.Thread(target=print_status, daemon=True)
# status_thread.start()

# The rest of the functions can now execute without being blocked by print_status
# install_python()
Expand Down

0 comments on commit cbe713b

Please sign in to comment.