summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMac Mollison <mollison@cs.unc.edu>2009-03-02 20:54:27 -0500
committerMac Mollison <mollison@cs.unc.edu>2009-03-02 20:54:27 -0500
commitdd4d77b78fd2330bae814d69048f539a5e626aac (patch)
tree52f4a58c62451a2fe63322ecd790ff521e41e5f2
parent363ac8597f9dbe356371589b8d2ffe04ecb7e187 (diff)
Cleaning up EDF test output for current runnables/runnings
-rwxr-xr-xsta.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/sta.py b/sta.py
index 13670ed..8150fc4 100755
--- a/sta.py
+++ b/sta.py
@@ -120,13 +120,16 @@ class Trace:
120 ': ' + str(counts[key])) 120 ': ' + str(counts[key]))
121 print("") 121 print("")
122 122
123 def getStr(record): 123 def getStr(record,omitTime=False):
124 time = None 124 time = None
125 if 'when' in record: 125 if 'when' in record:
126 time = record['when'] 126 time = record['when']
127 else: 127 else:
128 time = record['release_time'] 128 time = record['release_time']
129 return "{0}: ({1},{2})".format(time,record['pid'],record['job']) 129 if not omitTime:
130 return "{0}: ({1},{2})".format(time,record['pid'],record['job'])
131 else:
132 return "({0},{1})".format(record['pid'],record['job'])
130 133
131 134
132################## 135##################
@@ -258,13 +261,17 @@ class EDF:
258 """Print the runnable jobs""" 261 """Print the runnable jobs"""
259 print("Runnable jobs:") 262 print("Runnable jobs:")
260 for record in self.runnables: 263 for record in self.runnables:
261 print('{0}, {1}'.format(Trace.getStr(record),record['deadline'])) 264 print('{0}, Deadline: {1}'.format(Trace.getStr(record,
265 omitTime=True),
266 record['deadline']))
262 267
263 def print_runnings(self): 268 def print_runnings(self):
264 """Print the runnable jobs""" 269 """Print the runnable jobs"""
265 print("Running jobs:") 270 print("Running jobs:")
266 for record in self.runnings: 271 for record in self.runnings:
267 print('{0}, {1}'.format(Trace.getStr(record),record['deadline'])) 272 print('{0}, Deadline: {1}'.format(Trace.getStr(record,
273 omitTime=True),
274 record['deadline']))
268 275
269 276
270#################################### 277####################################