From 7f650d06733517da378e7ad0a3e7be5c9178c079 Mon Sep 17 00:00:00 2001 From: Ting-Jun Wang Date: Fri, 31 May 2024 22:59:14 +0800 Subject: [PATCH] fix: comment out some blocks to debug & thread join() --- src/communication.py | 5 +++-- src/node_manager.py | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/communication.py b/src/communication.py index 131d915..07ff4b8 100644 --- a/src/communication.py +++ b/src/communication.py @@ -191,11 +191,11 @@ class ClusterCommunicationModule(): print(f"Worker {conn_index} run") for i in range(7): print(f"[WORKER {conn_index}] {i}") + time.sleep(1) print(f"Worker {conn_index} finished") threads = [] master_t = threading.Thread(target=master_run, args=(image_name, )) - master_t.join() threads.append(master_t) for index, conn in enumerate(self.worker_conns): @@ -204,11 +204,12 @@ class ClusterCommunicationModule(): print(command) t = threading.Thread(target=send_and_wait, args=(index, conn, image_name)) - t.join() threads.append(t) for thread in threads: thread.start() + for thread in threads: + thread.join() print("[INFO] All workers finished.") diff --git a/src/node_manager.py b/src/node_manager.py index 29b30b2..cea5e10 100644 --- a/src/node_manager.py +++ b/src/node_manager.py @@ -85,6 +85,7 @@ class NodeManager(): print(f"And we have load your wallet private key {WALLET_KEY} (address={self.wallet.address})") print() if self.w3.is_connected(): + ''' print("[INFO] Connected Successfully.") print() @@ -116,6 +117,9 @@ class NodeManager(): print("\n[INFO] You Receive a new task:") print(f" - Download Image: {data_image}") print(f" - Training Image: {train_image}") + ''' + + data_image = "test/test" # Start Downloading self.cluster_communication_module.run_container(data_image)