summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern B. Brandenburg <bbb@cs.unc.edu>2008-11-02 16:43:50 -0500
committerBjoern B. Brandenburg <bbb@cs.unc.edu>2008-11-02 16:43:50 -0500
commit422627a1b86cf61b66076c76b1ae89b41b52463e (patch)
treeff188352c2159afd505e94a86de4b0b23a4ff4bc
parent0b850b10de844c4dba7781ef9cef5827e2138baf (diff)
speed up not_edf(), produce some output
-rw-r--r--pl/rules.pl36
1 files changed, 34 insertions, 2 deletions
diff --git a/pl/rules.pl b/pl/rules.pl
index 4aeada0..bf9a036 100644
--- a/pl/rules.pl
+++ b/pl/rules.pl
@@ -27,6 +27,10 @@ running_at(Job, Time) :-
27 Start =< Time, 27 Start =< Time,
28 Stop > Time. 28 Stop > Time.
29 29
30last_scheduled(Job, A, B) :-
31 setof((X, Y), scheduled(Job, X, Y), Bag),
32 last(Bag, (A, B)).
33
30selected_in(Job, Start, End, Point) :- 34selected_in(Job, Start, End, Point) :-
31 scheduled(Job, X, _Y), 35 scheduled(Job, X, _Y),
32 in_range(Start, End, X), 36 in_range(Start, End, X),
@@ -129,7 +133,6 @@ not_work_conserving_on(Cpus, Violations) :-
129 133
130not_edf(Job, Violator, Violation) :- 134not_edf(Job, Violator, Violation) :-
131 test_range(Job, Rel, Done), 135 test_range(Job, Rel, Done),
132 earlier_deadline(Job, Violator),
133 ( 136 (
134 ( 137 (
135 selected_in(Violator, Rel, Done, Violation), 138 selected_in(Violator, Rel, Done, Violation),
@@ -139,11 +142,40 @@ not_edf(Job, Violator, Violation) :-
139 preempted_in(Job, Rel, Done, Violation), 142 preempted_in(Job, Rel, Done, Violation),
140 running_at(Violator, Violation) 143 running_at(Violator, Violation)
141 ) 144 )
142 ). 145 ),
146 earlier_deadline(Job, Violator).
143 147
144edf_violations(Violations) :- 148edf_violations(Violations) :-
145 bagof((Job, V, Vt), not_edf(Job, V, Vt), Violations). 149 bagof((Job, V, Vt), not_edf(Job, V, Vt), Violations).
146 150
151show_job(Job) :-
152 (completed(Job, C) -> X = C ; X = '[never]'),
153 (deadline(Job, D) -> Y = D ; Y = '[never]'),
154 (released(Job, R) -> Z = R ; Z = '[never]'),
155 write(Job),
156 write(' R='), write(Z),
157 write(' D='), write(Y),
158 write(' C='), write(X).
159
160show_sched_at(Job, At) :-
161 scheduled(Job, X, Y),
162 X =< At, Y > At,
163 write(' S=('), write(X), write(', '), write(Y), write(')').
164show_sched_at(_, _) :-
165 write(' S=[none]').
166
167list_violations([]).
168list_violations([(Job, V, Vt)|Rest]) :-
169 completed(Job, _A),completed(V, _B),
170 write(Vt), write(': '),
171 nl, write('\t'), show_job(V), show_sched_at(V, Vt), write(' before '),
172 nl, write('\t'), show_job(Job), show_sched_at(Job, Vt), nl,
173 list_violations(Rest).
174list_violations([(Job, _, _)|Rest]) :-
175 write('skip '), write(Job), nl,
176 list_violations(Rest).
177list_edf_violations :-
178 edf_violations(X), list_violations(X).
147 179
148periodic :- \+ not_periodic(_Job, _Skew). 180periodic :- \+ not_periodic(_Job, _Skew).
149sporadic :- \+ not_sporadic(_Job, _Skew). 181sporadic :- \+ not_sporadic(_Job, _Skew).