diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-04-23 14:01:35 -0400 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-04-23 14:01:35 -0400 |
commit | 7545402506aa76261e18d85af585ff0ac1cf05c1 (patch) | |
tree | 6b5a6d2e819c10311f3b4cdc94174877bdfcfbde /common.py | |
parent | 25ccdb0cbc6b959b1f96c89b8bce91963cb67b4c (diff) |
Improved accuracy of sched_trace measurement parsing.
* Measurements from tasks missing > 20% of their scheduling records are
ignored. This is configurable in config/config.py.
* Measurements which only have zero values are ignored.
* If either of these 2 situations are encountered print out a message the
first time using the common.log_once() method. See parse_exps.py for how
this is used with multiple threads.
* Measurements from a task's last job are ignored.
* Miss ratio is calculated only as a fraction of the number of jobs whose
matching release and completion records were found, not just release.
Diffstat (limited to 'common.py')
-rw-r--r-- | common.py | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -193,3 +193,20 @@ def is_device(dev): | |||
193 | return False | 193 | return False |
194 | mode = os.stat(dev)[stat.ST_MODE] | 194 | mode = os.stat(dev)[stat.ST_MODE] |
195 | return not (not mode & stat.S_IFCHR) | 195 | return not (not mode & stat.S_IFCHR) |
196 | |||
197 | __logged = [] | ||
198 | |||
199 | def set_logged_list(logged): | ||
200 | global __logged | ||
201 | __logged = logged | ||
202 | |||
203 | def log_once(id, msg = None, indent = True): | ||
204 | global __logged | ||
205 | |||
206 | msg = msg if msg else id | ||
207 | |||
208 | if id not in __logged: | ||
209 | __logged += [id] | ||
210 | if indent: | ||
211 | msg = ' ' + msg.strip('\t').replace('\n', '\n\t') | ||
212 | sys.stderr.write('\n' + msg.strip('\n') + '\n') | ||