aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Erickson <jerickso@cs.unc.edu>2013-11-25 15:40:23 -0500
committerJeremy Erickson <jerickso@cs.unc.edu>2013-11-25 15:40:23 -0500
commit052203a707d0ba828c05b516a7306020a660a98c (patch)
tree174884bd79dbf602a21c604663ee06a31847051a
parent0677e653b5822e99852ef55001cf2c89a95357c3 (diff)
Replace pp with prio_pt in Python code, to match C++ code
-rw-r--r--schedcat/sched/__init__.py4
-rw-r--r--schedcat/sched/edf/gel_pl.py9
2 files changed, 7 insertions, 6 deletions
diff --git a/schedcat/sched/__init__.py b/schedcat/sched/__init__.py
index 0390dfb..fb5d295 100644
--- a/schedcat/sched/__init__.py
+++ b/schedcat/sched/__init__.py
@@ -10,8 +10,8 @@ try:
10 def get_native_taskset(tasks): 10 def get_native_taskset(tasks):
11 ts = TaskSet() 11 ts = TaskSet()
12 for t in tasks: 12 for t in tasks:
13 if (hasattr(t, 'pp')): 13 if (hasattr(t, 'prio_pt')):
14 ts.add_task(t.cost, t.period, t.deadline, t.pp) 14 ts.add_task(t.cost, t.period, t.deadline, t.prio_pt)
15 else: 15 else:
16 ts.add_task(t.cost, t.period, t.deadline) 16 ts.add_task(t.cost, t.period, t.deadline)
17 return ts 17 return ts
diff --git a/schedcat/sched/edf/gel_pl.py b/schedcat/sched/edf/gel_pl.py
index 2397e80..2349f7b 100644
--- a/schedcat/sched/edf/gel_pl.py
+++ b/schedcat/sched/edf/gel_pl.py
@@ -40,7 +40,8 @@ def compute_gfl_response_details(no_cpus, tasks, rounds):
40 using "0" results in using the exact algorithm. 40 using "0" results in using the exact algorithm.
41 """ 41 """
42 for task in tasks: 42 for task in tasks:
43 task.pp = task.deadline - int((no_cpus - 1) / (no_cpus) * task.cost) 43 task.prio_pt = task.deadline - \
44 int((no_cpus - 1) / (no_cpus) * task.cost)
44 return compute_response_details(no_cpus, tasks, rounds) 45 return compute_response_details(no_cpus, tasks, rounds)
45 46
46def compute_gedf_response_details(no_cpus, tasks, rounds): 47def compute_gedf_response_details(no_cpus, tasks, rounds):
@@ -49,11 +50,11 @@ def compute_gedf_response_details(no_cpus, tasks, rounds):
49 using "0" results in using the exact algorithm. 50 using "0" results in using the exact algorithm.
50 """ 51 """
51 for task in tasks: 52 for task in tasks:
52 task.pp = task.deadline 53 task.prio_pt = task.deadline
53 return compute_response_details(no_cpus, tasks, rounds) 54 return compute_response_details(no_cpus, tasks, rounds)
54 55
55def compute_response_details(no_cpus, tasks, rounds): 56def compute_response_details(no_cpus, tasks, rounds):
56 if (no_cpus == 1) and forall(tasks)(lambda t: t.pp == t.period): 57 if (no_cpus == 1) and forall(tasks)(lambda t: t.prio_pt == t.period):
57 details = AnalysisDetails(tasks) 58 details = AnalysisDetails(tasks)
58 details.bounds = [task.period for task in tasks] 59 details.bounds = [task.period for task in tasks]
59 details.S_i = [0.0 for task in tasks] 60 details.S_i = [0.0 for task in tasks]
@@ -80,7 +81,7 @@ def compute_response_bounds(no_cpus, tasks, rounds):
80 # First uniformly reduce scheduler priority points to derive analysis 81 # First uniformly reduce scheduler priority points to derive analysis
81 # priority points. Due to uniform reduction, does not change scheduling 82 # priority points. Due to uniform reduction, does not change scheduling
82 # decisions. Shown in EA'12 to improve bounds. 83 # decisions. Shown in EA'12 to improve bounds.
83 sched_pps = [task.pp for task in tasks] 84 sched_pps = [task.prio_pt for task in tasks]
84 min_priority_point = min(sched_pps) 85 min_priority_point = min(sched_pps)
85 analysis_pps = [sched_pps[i] - min_priority_point 86 analysis_pps = [sched_pps[i] - min_priority_point
86 for i in range(len(sched_pps))] 87 for i in range(len(sched_pps))]