From 25ccdb0cbc6b959b1f96c89b8bce91963cb67b4c Mon Sep 17 00:00:00 2001 From: Jonathan Herman Date: Mon, 22 Apr 2013 15:32:12 -0400 Subject: Improved robustness of run_exps.py execution. Thanks to bcw and gelliott for debugging and ideas. * Print out experiment number and total experiments when starting experiments. * Only sleep and re-release tasks if tasks are waiting to release. * Fail experiment with verbose messages if any tasks fail before becoming ready to release. * When waiting for tasks to become ready for release, reset the waiting time whenever a new task (or task(s)) become ready. * Start regular tracers BEFORE the plugin switch to log data from the switch. * Check the number of running tasks AFTER trying to switch the linux scheduler. This gives plugin deactivate code the opportunity to kill these tasks. * If an invalid executable is specified in the schedule file, fail before attempting to run the experiment and print out the problem. * Propogate exceptions up from experiment failures instead of creating ExperimentFailed exceptions. This commit also made clock-frequency automatically ignored by parse_exps.py. The value of this would change by +- a Mhz between experiments, ruining graphs. --- run/litmus_util.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'run/litmus_util.py') diff --git a/run/litmus_util.py b/run/litmus_util.py index 70da262..81f690b 100644 --- a/run/litmus_util.py +++ b/run/litmus_util.py @@ -20,7 +20,7 @@ def switch_scheduler(switch_to_in): with open('/proc/litmus/active_plugin', 'w') as active_plugin: subprocess.Popen(["echo", switch_to], stdout=active_plugin) - # it takes a bit to do the switch, sleep an arbitrary amount of time + # It takes a bit to do the switch, sleep an arbitrary amount of time time.sleep(2) cur_plugin = scheduler() @@ -29,24 +29,21 @@ def switch_scheduler(switch_to_in): (switch_to, cur_plugin)) def waiting_tasks(): - reg = re.compile(r'^ready.*?(?P\d+)$', re.M) + reg = re.compile(r'^ready.*?(?P\d+)$', re.M) with open('/proc/litmus/stats', 'r') as f: data = f.read() # Ignore if no tasks are waiting for release - match = re.search(reg, data) - ready = match.group("READY") + waiting = re.search(reg, data).group("WAITING") - return 0 if not ready else int(ready) + return 0 if not waiting else int(waiting) def all_tasks(): reg = re.compile(r'^real-time.*?(?P\d+)$', re.M) with open('/proc/litmus/stats', 'r') as f: data = f.read() - # Ignore if no tasks are waiting for release - match = re.search(reg, data) - ready = match.group("TASKS") + ready = re.search(reg, data).group("TASKS") return 0 if not ready else int(ready) -- cgit v1.2.2