diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2014-02-21 01:11:47 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2014-02-21 01:11:47 -0500 |
commit | 77474dbbf1b2589e3a93d9ef47c19d326eae52b5 (patch) | |
tree | aa87f197a24149f02865006df68cf7d2ddf81720 | |
parent | 2205f6ad1c943137a1ce0f1dd2807fb84870d98b (diff) |
Try to compute tighter bounds with uniprocessorswip-ecrts14-pgm
-rw-r--r-- | schedcat/sched/edf/gel_pl.py | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/schedcat/sched/edf/gel_pl.py b/schedcat/sched/edf/gel_pl.py index 2349f7b..62a5229 100644 --- a/schedcat/sched/edf/gel_pl.py +++ b/schedcat/sched/edf/gel_pl.py | |||
@@ -54,18 +54,32 @@ def compute_gedf_response_details(no_cpus, tasks, rounds): | |||
54 | return compute_response_details(no_cpus, tasks, rounds) | 54 | return compute_response_details(no_cpus, tasks, rounds) |
55 | 55 | ||
56 | def compute_response_details(no_cpus, tasks, rounds): | 56 | def compute_response_details(no_cpus, tasks, rounds): |
57 | if (no_cpus == 1) and forall(tasks)(lambda t: t.prio_pt == t.period): | 57 | # if (no_cpus == 1) and forall(tasks)(lambda t: t.prio_pt == t.period): |
58 | details = AnalysisDetails(tasks) | 58 | # details = AnalysisDetails(tasks) |
59 | details.bounds = [task.period for task in tasks] | 59 | # details.bounds = [task.period for task in tasks] |
60 | details.S_i = [0.0 for task in tasks] | 60 | # details.S_i = [0.0 for task in tasks] |
61 | details.G_i = [0.0 for task in tasks] | 61 | # details.G_i = [0.0 for task in tasks] |
62 | return details | 62 | # return details |
63 | details = None | ||
63 | if schedcat.sched.using_native: | 64 | if schedcat.sched.using_native: |
64 | native_ts = schedcat.sched.get_native_taskset(tasks) | 65 | native_ts = schedcat.sched.get_native_taskset(tasks) |
65 | gel_obj = native.GELPl(no_cpus, native_ts, rounds) | 66 | gel_obj = native.GELPl(no_cpus, native_ts, rounds) |
66 | return AnalysisDetails(tasks, gel_obj) | 67 | details = AnalysisDetails(tasks, gel_obj) |
67 | else: | 68 | else: |
68 | return compute_response_bounds(no_cpus, tasks, rounds) | 69 | details = compute_response_bounds(no_cpus, tasks, rounds) |
70 | if (no_cpus == 1) and forall(tasks)(lambda t: t.prio_pt == t.period): | ||
71 | # compute bounds for optimal uniprocessor | ||
72 | details2 = AnalysisDetails(tasks) | ||
73 | details2.bounds = [task.period for task in tasks] | ||
74 | # use the optimal bounds if the computed bound is ever | ||
75 | # greater than optimal bound (period) | ||
76 | for computed_bound, optimal_bound in zip(details.bounds, details2.bounds): | ||
77 | if computed_bound > optimal_bound: | ||
78 | details2.S_i = [0.0] * len(tasks) | ||
79 | details2.G_i = [0.0] * len(tasks) | ||
80 | details = details2 | ||
81 | break | ||
82 | return details | ||
69 | 83 | ||
70 | def compute_response_bounds(no_cpus, tasks, rounds): | 84 | def compute_response_bounds(no_cpus, tasks, rounds): |
71 | """This function computes response time bounds for the given set of tasks | 85 | """This function computes response time bounds for the given set of tasks |