From a145fdb95678bd9c80ce5a84f220cbf21d545b5f Mon Sep 17 00:00:00 2001
From: "nabil.abdennad" <nabil.abdennadher@hesge.ch>
Date: Tue, 24 Sep 2024 10:19:58 +0200
Subject: [PATCH] updating prompts

---
 Local-Without-Prediction/docker-compose.yml | 8 ++++----
 Local-Without-Prediction/sock.py            | 6 +++---
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/Local-Without-Prediction/docker-compose.yml b/Local-Without-Prediction/docker-compose.yml
index bd06d59..02fc6bb 100644
--- a/Local-Without-Prediction/docker-compose.yml
+++ b/Local-Without-Prediction/docker-compose.yml
@@ -2,7 +2,7 @@
 services:
 
   node0:
-    image: image-dfl-bad
+    image: image-bad
     container_name: node0
     environment:
       - RANK=0
@@ -15,7 +15,7 @@ services:
 
 
   node1:
-    image: image-dfl-bad
+    image: image-bad
     container_name: node1
     environment:
       - RANK=1
@@ -28,7 +28,7 @@ services:
 
 
   node2:
-    image: image-dfl-bad
+    image: image-bad
     container_name: node2
     environment:
       - RANK=2
@@ -41,7 +41,7 @@ services:
 
 
   node3:
-    image: image-dfl-bad
+    image: image-bad
     container_name: node3
     environment:
       - RANK=3
diff --git a/Local-Without-Prediction/sock.py b/Local-Without-Prediction/sock.py
index 027015a..0ff2437 100644
--- a/Local-Without-Prediction/sock.py
+++ b/Local-Without-Prediction/sock.py
@@ -40,7 +40,7 @@ def mainProg(neighbors, rank, base_port, ip_address):
             try:
                 neighbor_ip = f"node{neighbor}" 
                 send_Message(rank,neighbor_ip,"REQUEST_WEIGHT")
-                #logger.info(f"Rank {rank} sent REQUEST_WEIGHT to {neighbor} at iteration {iteration}")
+                logger.info(f"Rank {rank} sent REQUEST_WEIGHT to {neighbor} at iteration {iteration}")
             except ConnectionRefusedError as e:
                 logger.error(f"Exception {e}\nConnection refused when {rank} tried to connect to {neighbor}'s service {neighbor_ip}.")
                 continue
@@ -52,18 +52,18 @@ def mainProg(neighbors, rank, base_port, ip_address):
             data = conn.recv(1024).decode()
             message_rcvd, sender = json.loads(data)
             conn.close()
-            
+            logger.info(f"Rank {rank} -- iteration {iteration} and message received {message_rcvd} from {sender}")
             if message_rcvd == "REQUEST_WEIGHT": # a Neighbor is asking help
                 try:
                     sender = f"node{sender}" 
                     send_Message(rank,sender,"WEIGHTS")
+                    logger.info(f"Rank {rank} sent WEIGHT to {neighbor} at iteration {iteration}")
                 except ConnectionRefusedError as e:
                     logger.error(f"Exception {e}\nConnection refused when {rank} tried to send WEIGHTS to {sender}'s service {sender}.")
                     continue
 
             if message_rcvd == "WEIGHTS":   #a Neighbor to whom I have sent a help REQUEST_WEIGHT just replied to my request
                 received_dict[sender] = True
-                logger.info(f"I am here -- iteration {iteration} and message received {message_rcvd} from {sender}")
 
         iteration += 1
 
-- 
GitLab