diff options
author | Mac Mollison <mollison@cs.unc.edu> | 2009-03-01 00:26:59 -0500 |
---|---|---|
committer | Mac Mollison <mollison@cs.unc.edu> | 2009-03-01 00:26:59 -0500 |
commit | 6d9ceacb59e1a3dec05b964d6df5974eef5b31c0 (patch) | |
tree | 23f08e67319b1d48d99793c57594be56e585a188 | |
parent | a67ab292bd7b58b6bebca2c1d4d9105b47b7420c (diff) |
Minor changes to EDF output
-rwxr-xr-x | run.py | 27 | ||||
-rwxr-xr-x | sta.py | 36 |
2 files changed, 29 insertions, 34 deletions
@@ -20,7 +20,8 @@ def oneCPU(): | |||
20 | trace.print_records() | 20 | trace.print_records() |
21 | 21 | ||
22 | def myEDF(): | 22 | def myEDF(): |
23 | test = sta.EDF(g6_list,0) | 23 | test = sta.EDF(g6_list,20000000) |
24 | #test = sta.EDF(g6_list) | ||
24 | test.run_test() | 25 | test.run_test() |
25 | 26 | ||
26 | def myTrace(): | 27 | def myTrace(): |
@@ -59,36 +60,24 @@ def sampleTrace(): | |||
59 | 60 | ||
60 | path = '/home/mollison/sta/traces/' | 61 | path = '/home/mollison/sta/traces/' |
61 | 62 | ||
62 | full_list = [ | ||
63 | path + 'st-g6-0.bin', | ||
64 | path + 'st-g6-1.bin', | ||
65 | path + 'st-g6-2.bin', | ||
66 | path + 'st-g6-3.bin', | ||
67 | path + 'st-x19-0.bin', | ||
68 | path + 'st-x19-1.bin', | ||
69 | path + 'st-x19-2.bin', | ||
70 | path + 'st-x19-3.bin', | ||
71 | path + 'st0.fg', | ||
72 | path + 'st1.fg'] | ||
73 | |||
74 | short_list = [ | ||
75 | path + 'st-x19-2.bin'] | ||
76 | |||
77 | g6_list = [ | 63 | g6_list = [ |
78 | path + 'st-g6-0.bin', | 64 | path + 'st-g6-0.bin', |
79 | path + 'st-g6-1.bin', | 65 | path + 'st-g6-1.bin', |
80 | path + 'st-g6-2.bin', | 66 | path + 'st-g6-2.bin', |
81 | path + 'st-g6-3.bin'] | 67 | path + 'st-g6-3.bin'] |
82 | 68 | ||
69 | g5_list = [ | ||
70 | path + 'st-g5-0.bin', | ||
71 | path + 'st-g5-1.bin', | ||
72 | path + 'st-g5-2.bin', | ||
73 | path + 'st-g5-3.bin'] | ||
74 | |||
83 | x19_list = [ | 75 | x19_list = [ |
84 | path + 'st-x19-0.bin', | 76 | path + 'st-x19-0.bin', |
85 | path + 'st-x19-1.bin', | 77 | path + 'st-x19-1.bin', |
86 | path + 'st-x19-2.bin', | 78 | path + 'st-x19-2.bin', |
87 | path + 'st-x19-3.bin'] | 79 | path + 'st-x19-3.bin'] |
88 | 80 | ||
89 | simple_list = [ | ||
90 | path + 'st0.fg', | ||
91 | path + 'st1.fg'] | ||
92 | 81 | ||
93 | 82 | ||
94 | ############## | 83 | ############## |
@@ -157,7 +157,7 @@ class EDF: | |||
157 | if record['type'] == 3: | 157 | if record['type'] == 3: |
158 | if not self.check_duplicate_release(record): | 158 | if not self.check_duplicate_release(record): |
159 | self.runnables.append(record) | 159 | self.runnables.append(record) |
160 | debug("{0} became runnable" | 160 | print("{0} became runnable" |
161 | .format(Trace.getStr(record))) | 161 | .format(Trace.getStr(record))) |
162 | 162 | ||
163 | #Switch Tos | 163 | #Switch Tos |
@@ -166,18 +166,20 @@ class EDF: | |||
166 | self.runnings.append(release_record) | 166 | self.runnings.append(release_record) |
167 | check_tuple = self.check_deadline(release_record) | 167 | check_tuple = self.check_deadline(release_record) |
168 | if check_tuple[0] == True: | 168 | if check_tuple[0] == True: |
169 | debug("{0} became running (VALID)" | 169 | print("{0} became running (VALID)" |
170 | .format(Trace.getStr(release_record))) | 170 | .format(Trace.getStr(release_record))) |
171 | self.corrects += 1 | 171 | self.corrects += 1 |
172 | else: | 172 | else: |
173 | debug('='*50) | 173 | print('='*50) |
174 | debug("{0} became running (INVALID)" | 174 | print("{0} became running (INVALID)" |
175 | .format(Trace.getStr(release_record))) | 175 | .format(Trace.getStr(release_record))) |
176 | debug('Deadline of {0} greater than deadline of {1} in the following record:' | 176 | print('Deadline of {0} greater than deadline of {1} in the following record:' |
177 | .format(release_record['deadline'], | 177 | .format(release_record['deadline'], |
178 | check_tuple[1]['deadline'])) | 178 | check_tuple[1]['deadline'])) |
179 | debug(check_tuple[1]) | 179 | print(check_tuple[1]) |
180 | debug('='*50) | 180 | self.print_runnables() |
181 | self.print_runnings() | ||
182 | print('='*50) | ||
181 | self.errors += 1 | 183 | self.errors += 1 |
182 | 184 | ||
183 | #Switch Aways | 185 | #Switch Aways |
@@ -185,7 +187,7 @@ class EDF: | |||
185 | release_record = EDF.pop_job(record, self.runnings) | 187 | release_record = EDF.pop_job(record, self.runnings) |
186 | if release_record: | 188 | if release_record: |
187 | self.runnables.append(release_record) | 189 | self.runnables.append(release_record) |
188 | debug('{0} went from running to runnable' | 190 | print('{0} went from running to runnable' |
189 | .format(Trace.getStr(release_record))) | 191 | .format(Trace.getStr(release_record))) |
190 | 192 | ||
191 | #Completions | 193 | #Completions |
@@ -193,7 +195,7 @@ class EDF: | |||
193 | release_record = EDF.pop_job(record,self.runnings) | 195 | release_record = EDF.pop_job(record,self.runnings) |
194 | if not release_record: | 196 | if not release_record: |
195 | release_record = EDF.pop_job(record,self.runnables) | 197 | release_record = EDF.pop_job(record,self.runnables) |
196 | debug('{0} completed' | 198 | print('{0} completed' |
197 | .format(Trace.getStr(release_record))) | 199 | .format(Trace.getStr(release_record))) |
198 | 200 | ||
199 | print('Corrects: {0}'.format(self.corrects)) | 201 | print('Corrects: {0}'.format(self.corrects)) |
@@ -247,13 +249,17 @@ class EDF: | |||
247 | return True | 249 | return True |
248 | return False | 250 | return False |
249 | 251 | ||
252 | def print_runnables(self): | ||
253 | """Print the runnable jobs""" | ||
254 | print("Runnable jobs:") | ||
255 | for record in self.runnables: | ||
256 | print('{0}, {1}'.format(Trace.getStr(record),record['deadline'])) | ||
250 | 257 | ||
251 | #################################### | 258 | def print_runnings(self): |
252 | # Debug # | 259 | """Print the runnable jobs""" |
253 | #################################### | 260 | print("Running jobs:") |
254 | 261 | for record in self.runnings: | |
255 | def debug(string): | 262 | print('{0}, {1}'.format(Trace.getStr(record),record['deadline'])) |
256 | print(string) | ||
257 | 263 | ||
258 | 264 | ||
259 | #################################### | 265 | #################################### |