From 980a4f468f88029a653faad118568030707a0e13 Mon Sep 17 00:00:00 2001
From: David Hendriks <davidhendriks93@gmail.com>
Date: Thu, 14 Jan 2021 11:35:52 +0000
Subject: [PATCH] small updates

---
 README.md                                    | 4 +---
 binarycpython/utils/grid.py                  | 5 +++++
 binarycpython/utils/grid_options_defaults.py | 2 +-
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/README.md b/README.md
index 5eecc43d4..bca8ac65f 100644
--- a/README.md
+++ b/README.md
@@ -61,8 +61,6 @@ Building issues with binary_c itself:
 
 Pip install failed:
 - Run the installation with `-v` and/or `--log <logfile>` to get some more info
-- If gcc throws errors like `gcc: error: unrecognized command line option ‘-ftz’; did you mean ‘-flto’?`, this might be due to that the python on that system was built with a different compiler. It then passes the python3.6-config --cflags to the binarycpython installation, which, if done with gcc, will not work. Try a different python3.6. I suggest using `pyenv` to manage python versions. 
-
-
+- If gcc throws errors like `gcc: error: unrecognized command line option ‘-ftz’; did you mean ‘-flto’?`, this might be due to that the python on that system was built with a different compiler. It then passes the python3.6-config --cflags to the binarycpython installation, which, if done with gcc, will not work. Try a different python3.6. I suggest using `pyenv` to manage python versions. If installing a version of python with pyenv is not possible, then try to use a python version that is avaible to the machine that is built with the same compiler as binary_c was built with. 
 
 if pip installation results in `No files/directories in /tmp/pip-1ckzg0p9-build/pip-egg-info (from PKG-INFO)`, try running it verbose (`-v`) to see what is actually going wrong. 
diff --git a/binarycpython/utils/grid.py b/binarycpython/utils/grid.py
index e2c298231..b80b843b1 100644
--- a/binarycpython/utils/grid.py
+++ b/binarycpython/utils/grid.py
@@ -931,6 +931,11 @@ class Population:
                     #
                     print("Process {} is handling system {}".format(ID, localcounter))
 
+
+                    # In some cases, the whole run crashes. To be able to figure out which system that was on, we log each current system to a file (each thread has one). Each new system overrides the previous
+                    with open(os.path.join(self.grid_options["tmp_dir"], "thread_{}_current_system.txt".format(self.process_ID)), 'w') as f:
+                        f.write(full_system_dict)
+
                     # Evolve the system
                     self._evolve_system_mp(full_system_dict)
 
diff --git a/binarycpython/utils/grid_options_defaults.py b/binarycpython/utils/grid_options_defaults.py
index 37cba2cb5..e6c20526f 100644
--- a/binarycpython/utils/grid_options_defaults.py
+++ b/binarycpython/utils/grid_options_defaults.py
@@ -49,7 +49,7 @@ grid_options_defaults_dict = {
     "_binary_c_config_executable": os.path.join(
         os.environ["BINARY_C"], "binary_c-config"
     ),  # TODO: make this more robust
-    "_binary_c_dir": os.environ["BINARYC_DIR"],
+    "_binary_c_dir": os.environ["BINARY_C"],
     ##########################
     # Custom logging
     ##########################
-- 
GitLab