From c25c08438d65cd18f285419fa88faf73057b0f70 Mon Sep 17 00:00:00 2001
From: David Hendriks <davidhendriks93@gmail.com>
Date: Fri, 15 Jan 2021 12:50:08 +0000
Subject: [PATCH] fixed bug

---
 binarycpython/utils/grid.py | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/binarycpython/utils/grid.py b/binarycpython/utils/grid.py
index cd379cab9..6c02274d0 100644
--- a/binarycpython/utils/grid.py
+++ b/binarycpython/utils/grid.py
@@ -911,8 +911,12 @@ class Population:
             "Process {} started at {}".format(ID, datetime.datetime.now().isoformat()), self.grid_options["verbosity"], 0
         )
 
+        round_number_mod = 0
+
         # Go over the generator
         while running:
+            # round_number_mod = (localcounter+1)%self.grid_options["amt_cores"]
+
             try:
                 # Get the system
                 system = next(generator)
@@ -948,9 +952,13 @@ class Population:
             except StopIteration:
                 running = False
 
+            if (localcounter+1)%self.grid_options["amt_cores"]==0:
+                round_number_mod += 1
+            # round_number_mod = (localcounter+1)%self.grid_options["amt_cores"]
+            # print("thread {} round_nr_mod {}. localcounter {}".format(ID, round_number_mod, localcounter))
+
             # Has to be here because this one is used for the (localcounter+ID) % (self..)
             localcounter += 1
-            round_number_mod = (localcounter+1)%self.grid_options["amt_cores"]
 
         # Handle ensemble output: is ensemble==1, then either directly write that data to a file, or combine everything into 1 file.
         ensemble_json = {}  # Make sure it exists already
-- 
GitLab