diff options
| author | Bjoern Brandenburg <bbb@mpi-sws.org> | 2012-05-17 09:41:49 -0400 |
|---|---|---|
| committer | Bjoern Brandenburg <bbb@mpi-sws.org> | 2012-05-17 09:41:49 -0400 |
| commit | c2e3e08ef2ce90237b7b50efd0adc1e2848a3729 (patch) | |
| tree | 9574a97377fafda742c6b75a21971a6c909e8394 /native/src/sharedres.cpp | |
| parent | 7cd7212e7273c9c137e4bb1825d2b9f3842c882d (diff) | |
C++: Properly consider priority ceilings in DPCP bound
The bound should not reflect requests executed by agents that can be preempted.
Diffstat (limited to 'native/src/sharedres.cpp')
| -rw-r--r-- | native/src/sharedres.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/native/src/sharedres.cpp b/native/src/sharedres.cpp index a91bfdf..5c8acee 100644 --- a/native/src/sharedres.cpp +++ b/native/src/sharedres.cpp | |||
| @@ -225,6 +225,26 @@ void sort_by_request_length(ClusterResources& resources) | |||
| 225 | apply_foreach(resources, sort_by_request_length); | 225 | apply_foreach(resources, sort_by_request_length); |
| 226 | } | 226 | } |
| 227 | 227 | ||
| 228 | void determine_priority_ceilings(const Resources& resources, | ||
| 229 | PriorityCeilings& ceilings) | ||
| 230 | { | ||
| 231 | ceilings.reserve(resources.size()); | ||
| 232 | |||
| 233 | foreach(resources, it) | ||
| 234 | { | ||
| 235 | unsigned int ceiling = UINT_MAX; | ||
| 236 | const ContentionSet& cs = *it; | ||
| 237 | |||
| 238 | foreach(cs, jt) | ||
| 239 | { | ||
| 240 | const RequestBound* req = *jt; | ||
| 241 | ceiling = std::min(ceiling, req->get_task()->get_priority()); | ||
| 242 | } | ||
| 243 | |||
| 244 | ceilings.push_back(ceiling); | ||
| 245 | } | ||
| 246 | } | ||
| 247 | |||
| 228 | typedef std::vector<TaskContention> ClusterContention; | 248 | typedef std::vector<TaskContention> ClusterContention; |
| 229 | 249 | ||
| 230 | typedef std::vector<ContentionSet> TaskContention; | 250 | typedef std::vector<ContentionSet> TaskContention; |
