From 5fdfc1fa4cc6aa9d1e9262ce97b50e207cfdcf81 Mon Sep 17 00:00:00 2001
From: Rishi Sharma <rishi.sharma@epfl.ch>
Date: Sun, 9 Jan 2022 09:19:05 +0100
Subject: [PATCH] Debug TCP

---
 src/decentralizepy/sharing/Sharing.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/decentralizepy/sharing/Sharing.py b/src/decentralizepy/sharing/Sharing.py
index 648e481..8f8eb6a 100644
--- a/src/decentralizepy/sharing/Sharing.py
+++ b/src/decentralizepy/sharing/Sharing.py
@@ -112,6 +112,7 @@ class Sharing:
         all_neighbors = self.graph.neighbors(my_uid)
         iter_neighbors = self.get_neighbors(all_neighbors)
         data["degree"] = len(all_neighbors)
+        data["iteration"] = self.communication_round
         for neighbor in iter_neighbors:
             self.communication.send(neighbor, data)
 
@@ -120,9 +121,15 @@ class Sharing:
             sender, data = self.communication.receive()
             logging.debug("Received model from {}".format(sender))
             degree = data["degree"]
+            iteration = data["iteration"]
             del data["degree"]
+            del data["iteration"]
             self.peer_deques[sender].append((degree, data))
-            logging.debug("Deserialized received model from {}".format(sender))
+            logging.info(
+                "Deserialized received model from {} of iteration {}".format(
+                    sender, iteration
+                )
+            )
 
         logging.info("Starting model averaging after receiving from all neighbors")
         total = dict()
-- 
GitLab