From b9a8dafbb99f7ed2f3b5873d043d529ec87b5ec3 Mon Sep 17 00:00:00 2001 From: Michael Reuscher <michael.reuscher@desy.de> Date: Mon, 14 Aug 2023 15:57:27 +0200 Subject: [PATCH] new working animation --- simrunner/config_processing.py | 2 -- simrunner/data_config.json | 2 +- simrunner/simulation.py | 10 ++++++++++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/simrunner/config_processing.py b/simrunner/config_processing.py index f6b64b5..d1e590b 100644 --- a/simrunner/config_processing.py +++ b/simrunner/config_processing.py @@ -6,7 +6,6 @@ import os def create_size_list(length): start = 16 size_list = [start * (2 ** i) for i in range(length)] - print(size_list) return size_list @@ -38,7 +37,6 @@ def set_arguments_various(da_config, test_data_path, args): event_arguments['-o'] = event_name e_dict[event_name] = event_arguments # Gib das Dictionary der Ereignisargumente für verschiedene Byte-Größen zurück - print(e_dict) return e_dict diff --git a/simrunner/data_config.json b/simrunner/data_config.json index a314e5c..967f2d7 100644 --- a/simrunner/data_config.json +++ b/simrunner/data_config.json @@ -5,7 +5,7 @@ "-N": "12"}, "data_config_long":{ "-s": "1024", - "-n": "5000", + "-n": "100", "-i": "0.1s", "-N": "4"}, "data_config_help":{ diff --git a/simrunner/simulation.py b/simrunner/simulation.py index f82d83f..308e5da 100644 --- a/simrunner/simulation.py +++ b/simrunner/simulation.py @@ -1,4 +1,5 @@ import os +import sys import time import signal import subprocess @@ -101,7 +102,16 @@ def run(e_dict, main_path): future = executor.submit(local_simulation, args.sim, e_dict[event], output_path) futures.append((folder_name, None, future)) + # Animierte Anzeige (z.B. sich drehende Röhre) + animation = ['|', '/', '-', '\\'] + animation_index = 0 + for folder_name, host, future in futures: + while not future.done(): + sys.stdout.write('\rWorking ' + animation[animation_index]) + sys.stdout.flush() + animation_index = (animation_index + 1) % len(animation) + time.sleep(0.1) output, errors, result = future.result() terminal_msg = f'{folder_name}_{host if host else ""} done!' if not stop_requested: -- GitLab