From 6dc6cea0b738c74852b920a9cf2fb1c49634dbe9 Mon Sep 17 00:00:00 2001
From: Florian Fischer <florian.fl.fischer@fau.de>
Date: Mon, 24 Jun 2019 17:20:37 +0200
Subject: [PATCH] give each allocator a unique color

---
 bench.py | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/bench.py b/bench.py
index e75fa01..ce21fe3 100755
--- a/bench.py
+++ b/bench.py
@@ -117,8 +117,19 @@ def main():
         importlib.import_module('src.allocators.installed_allocators')
         allocators = src.allocators.installed_allocators.allocators
 
+    # set colors
+    explicit_colors = [v["color"] for k, v in allocators.items() if v["color"] is not None]
+    print_debug("Explicit colors:", explicit_colors)
+    avail_colors = [color for color in ["C" + str(i) for i in range(0,16)] if color not in explicit_colors]
+    print_debug("available colors:", avail_colors)
+
+    for k, v in allocators.items():
+        if v["color"] is None:
+            v["color"] = avail_colors.pop()
+
     src.globalvars.allocators = allocators
     print_info("Allocators:", *src.globalvars.allocators.keys())
+    print_debug("Allocators:", *src.globalvars.allocators.items())
 
     # Load facts
     if args.load:
-- 
GitLab