diff options
author | Bjoern Brandenburg <bbb@mpi-sws.org> | 2013-02-12 05:07:23 -0500 |
---|---|---|
committer | Bjoern Brandenburg <bbb@mpi-sws.org> | 2013-02-12 06:49:39 -0500 |
commit | 4b07d5bcd33e4b0433d4b91f9268a54399df676b (patch) | |
tree | fc0cbf11ec0dabad4d53917387a1d649ef026b02 | |
parent | 9674c4edf23e3f43f7c07ba219f2c8540f1813d7 (diff) |
MPCP: accurately track per-processor priority ceilings
The priority ceilings under the MPCP are defined in a way
such that one processor has a slightly lower ceiling.
This doesn't really affect the outcome much, but this patch
changes the analysis to be exactly as defined for the sake
of accuracy.
-rw-r--r-- | native/include/mpcp.h | 7 | ||||
-rw-r--r-- | native/src/blocking/mpcp.cpp | 59 |
2 files changed, 57 insertions, 9 deletions
diff --git a/native/include/mpcp.h b/native/include/mpcp.h index 75f77b1..22494d7 100644 --- a/native/include/mpcp.h +++ b/native/include/mpcp.h | |||
@@ -5,7 +5,12 @@ typedef std::vector<unsigned long> ResponseTimes; | |||
5 | typedef std::vector<ResponseTimes> TaskResponseTimes; | 5 | typedef std::vector<ResponseTimes> TaskResponseTimes; |
6 | typedef std::vector<TaskResponseTimes> ClusterResponseTimes; | 6 | typedef std::vector<TaskResponseTimes> ClusterResponseTimes; |
7 | 7 | ||
8 | typedef std::vector<PriorityCeilings> MPCPCeilings; | ||
9 | |||
8 | void determine_gcs_response_times(const Clusters& clusters, | 10 | void determine_gcs_response_times(const Clusters& clusters, |
9 | const PriorityCeilings& ceilings, | 11 | const MPCPCeilings& ceilings, |
10 | ClusterResponseTimes& times); | 12 | ClusterResponseTimes& times); |
13 | |||
14 | MPCPCeilings get_mpcp_ceilings(const ResourceSharingInfo& info); | ||
15 | |||
11 | #endif | 16 | #endif |
diff --git a/native/src/blocking/mpcp.cpp b/native/src/blocking/mpcp.cpp index 67d62ac..c218013 100644 --- a/native/src/blocking/mpcp.cpp +++ b/native/src/blocking/mpcp.cpp | |||
@@ -6,17 +6,61 @@ | |||
6 | 6 | ||
7 | # include "mpcp.h" | 7 | # include "mpcp.h" |
8 | 8 | ||
9 | static void determine_mpcp_ceilings(const Resources& resources, | ||
10 | const unsigned int cluster, | ||
11 | PriorityCeilings& ceilings) | ||
12 | { | ||
13 | ceilings.reserve(resources.size()); | ||
14 | |||
15 | foreach(resources, it) | ||
16 | { | ||
17 | unsigned int ceiling = UINT_MAX; | ||
18 | const ContentionSet& cs = *it; | ||
19 | |||
20 | foreach(cs, jt) | ||
21 | { | ||
22 | const RequestBound* req = *jt; | ||
23 | // count only requests of tasks on remote clusters | ||
24 | if (req->get_task()->get_cluster() != cluster) | ||
25 | { | ||
26 | ceiling = std::min(ceiling, req->get_task()->get_priority()); | ||
27 | } | ||
28 | } | ||
29 | |||
30 | ceilings.push_back(ceiling); | ||
31 | } | ||
32 | } | ||
33 | |||
34 | MPCPCeilings get_mpcp_ceilings(const ResourceSharingInfo& info) | ||
35 | { | ||
36 | Resources resources; | ||
37 | Clusters clusters; | ||
38 | MPCPCeilings ceilings; | ||
39 | unsigned int cluster; | ||
40 | |||
41 | split_by_resource(info, resources); | ||
42 | split_by_cluster(info, clusters); | ||
43 | |||
44 | enumerate(clusters, it, cluster) | ||
45 | { | ||
46 | ceilings.push_back(PriorityCeilings()); | ||
47 | determine_mpcp_ceilings(resources, cluster, ceilings.back()); | ||
48 | } | ||
49 | return ceilings; | ||
50 | } | ||
51 | |||
52 | |||
9 | // *************************** MPCP ****************************************** | 53 | // *************************** MPCP ****************************************** |
10 | 54 | ||
11 | static unsigned long get_max_gcs_length(const TaskInfo* tsk, | 55 | static unsigned long get_max_gcs_length(const TaskInfo* tsk, |
12 | const PriorityCeilings& ceilings, | 56 | const MPCPCeilings& ceilings, |
13 | unsigned int preempted_ceiling) | 57 | unsigned int preempted_ceiling) |
14 | { | 58 | { |
15 | unsigned long gcs_length = 0; | 59 | unsigned long gcs_length = 0; |
16 | 60 | ||
17 | foreach(tsk->get_requests(), it) | 61 | foreach(tsk->get_requests(), it) |
18 | { | 62 | { |
19 | unsigned int prio = ceilings[it->get_resource_id()]; | 63 | unsigned int prio = ceilings[it->get_task()->get_cluster()][it->get_resource_id()]; |
20 | if (prio <= preempted_ceiling) | 64 | if (prio <= preempted_ceiling) |
21 | gcs_length = std::max(gcs_length, | 65 | gcs_length = std::max(gcs_length, |
22 | (unsigned long) it->get_request_length()); | 66 | (unsigned long) it->get_request_length()); |
@@ -27,7 +71,7 @@ static unsigned long get_max_gcs_length(const TaskInfo* tsk, | |||
27 | 71 | ||
28 | static void determine_gcs_response_times(const TaskInfo* tsk, | 72 | static void determine_gcs_response_times(const TaskInfo* tsk, |
29 | const Cluster& cluster, | 73 | const Cluster& cluster, |
30 | const PriorityCeilings& ceilings, | 74 | const MPCPCeilings& ceilings, |
31 | ResponseTimes& times) | 75 | ResponseTimes& times) |
32 | { | 76 | { |
33 | times.reserve(tsk->get_requests().size()); | 77 | times.reserve(tsk->get_requests().size()); |
@@ -35,7 +79,7 @@ static void determine_gcs_response_times(const TaskInfo* tsk, | |||
35 | foreach(tsk->get_requests(), it) | 79 | foreach(tsk->get_requests(), it) |
36 | { | 80 | { |
37 | unsigned long resp = it->get_request_length(); | 81 | unsigned long resp = it->get_request_length(); |
38 | unsigned int prio = ceilings[it->get_resource_id()]; | 82 | unsigned int prio = ceilings[it->get_task()->get_cluster()][it->get_resource_id()]; |
39 | 83 | ||
40 | // Equation (2) in LNR:09. | 84 | // Equation (2) in LNR:09. |
41 | // One request of each local gcs that can preempt our ceiling, | 85 | // One request of each local gcs that can preempt our ceiling, |
@@ -54,7 +98,7 @@ static void determine_gcs_response_times(const TaskInfo* tsk, | |||
54 | } | 98 | } |
55 | 99 | ||
56 | static void determine_gcs_response_times(const Cluster& cluster, | 100 | static void determine_gcs_response_times(const Cluster& cluster, |
57 | const PriorityCeilings& ceilings, | 101 | const MPCPCeilings& ceilings, |
58 | TaskResponseTimes& times) | 102 | TaskResponseTimes& times) |
59 | { | 103 | { |
60 | times.reserve(cluster.size()); | 104 | times.reserve(cluster.size()); |
@@ -67,7 +111,7 @@ static void determine_gcs_response_times(const Cluster& cluster, | |||
67 | } | 111 | } |
68 | 112 | ||
69 | void determine_gcs_response_times(const Clusters& clusters, | 113 | void determine_gcs_response_times(const Clusters& clusters, |
70 | const PriorityCeilings& ceilings, | 114 | const MPCPCeilings& ceilings, |
71 | ClusterResponseTimes& times) | 115 | ClusterResponseTimes& times) |
72 | { | 116 | { |
73 | times.reserve(clusters.size()); | 117 | times.reserve(clusters.size()); |
@@ -256,8 +300,7 @@ BlockingBounds* mpcp_bounds(const ResourceSharingInfo& info, | |||
256 | split_by_cluster(info, clusters); | 300 | split_by_cluster(info, clusters); |
257 | 301 | ||
258 | // 2) Determine priority ceiling for each request. | 302 | // 2) Determine priority ceiling for each request. |
259 | PriorityCeilings gc; | 303 | MPCPCeilings gc = get_mpcp_ceilings(info); |
260 | determine_priority_ceilings(resources, gc); | ||
261 | 304 | ||
262 | 305 | ||
263 | // 3) For each request, determine response time. This only depends on the | 306 | // 3) For each request, determine response time. This only depends on the |