diff options
| author | Bjoern Brandenburg <bbb@mpi-sws.org> | 2012-05-16 12:43:28 -0400 |
|---|---|---|
| committer | Bjoern Brandenburg <bbb@mpi-sws.org> | 2012-05-16 12:43:28 -0400 |
| commit | 403e13383f4b6813d27d4ec4067a29a552893de4 (patch) | |
| tree | 64670c0f1031db689351f9b258df1543dfcd4e20 /native/src/sharedres.cpp | |
| parent | 4bfee51d6ae7356b3f6cb2cee74123a684b4d593 (diff) | |
C++: Break out the P-OMLP code into own file
Part of refactoring sharedres.cpp.
Diffstat (limited to 'native/src/sharedres.cpp')
| -rw-r--r-- | native/src/sharedres.cpp | 75 |
1 files changed, 4 insertions, 71 deletions
diff --git a/native/src/sharedres.cpp b/native/src/sharedres.cpp index 4520ccb..02815dc 100644 --- a/native/src/sharedres.cpp +++ b/native/src/sharedres.cpp | |||
| @@ -451,8 +451,8 @@ static Interference max_local_request_span(const TaskInfo &tsk, | |||
| 451 | return span; | 451 | return span; |
| 452 | } | 452 | } |
| 453 | 453 | ||
| 454 | static void charge_arrival_blocking(const ResourceSharingInfo& info, | 454 | void charge_arrival_blocking(const ResourceSharingInfo& info, |
| 455 | BlockingBounds& bounds) | 455 | BlockingBounds& bounds) |
| 456 | { | 456 | { |
| 457 | unsigned int i = 0; | 457 | unsigned int i = 0; |
| 458 | const TaskInfos& tasks = info.get_tasks(); | 458 | const TaskInfos& tasks = info.get_tasks(); |
| @@ -496,11 +496,11 @@ static ClusterLimits np_fifo_limits( | |||
| 496 | return limits; | 496 | return limits; |
| 497 | } | 497 | } |
| 498 | 498 | ||
| 499 | static Interference np_fifo_per_resource( | 499 | Interference np_fifo_per_resource( |
| 500 | const TaskInfo& tsk, const ClusterResources& clusters, | 500 | const TaskInfo& tsk, const ClusterResources& clusters, |
| 501 | unsigned int procs_per_cluster, | 501 | unsigned int procs_per_cluster, |
| 502 | unsigned int res_id, unsigned int issued, | 502 | unsigned int res_id, unsigned int issued, |
| 503 | int dedicated_irq = NO_CPU) | 503 | int dedicated_irq) |
| 504 | { | 504 | { |
| 505 | const unsigned long interval = tsk.get_response(); | 505 | const unsigned long interval = tsk.get_response(); |
| 506 | ClusterLimits limits = np_fifo_limits(tsk, clusters, procs_per_cluster, | 506 | ClusterLimits limits = np_fifo_limits(tsk, clusters, procs_per_cluster, |
| @@ -553,73 +553,6 @@ static Interference bound_blocking(const LimitedContentionSet &lcs, unsigned int | |||
| 553 | return inter; | 553 | return inter; |
| 554 | } | 554 | } |
| 555 | 555 | ||
| 556 | BlockingBounds* part_omlp_bounds(const ResourceSharingInfo& info) | ||
| 557 | { | ||
| 558 | // split everything by partition | ||
| 559 | Clusters clusters; | ||
| 560 | |||
| 561 | split_by_cluster(info, clusters); | ||
| 562 | |||
| 563 | // split each partition by resource | ||
| 564 | ClusterResources resources; | ||
| 565 | |||
| 566 | split_by_resource(clusters, resources); | ||
| 567 | |||
| 568 | // sort each contention set by request length | ||
| 569 | sort_by_request_length(resources); | ||
| 570 | |||
| 571 | // We need for each task the maximum request span. We also need the | ||
| 572 | // maximum direct blocking from remote partitions for each request. We | ||
| 573 | // can determine both in one pass. | ||
| 574 | |||
| 575 | unsigned int i; | ||
| 576 | |||
| 577 | // direct blocking results | ||
| 578 | BlockingBounds* _results = new BlockingBounds(info); | ||
| 579 | BlockingBounds& results = *_results; | ||
| 580 | |||
| 581 | for (i = 0; i < info.get_tasks().size(); i++) | ||
| 582 | { | ||
| 583 | const TaskInfo& tsk = info.get_tasks()[i]; | ||
| 584 | Interference bterm; | ||
| 585 | |||
| 586 | foreach(tsk.get_requests(), jt) | ||
| 587 | { | ||
| 588 | const RequestBound& req = *jt; | ||
| 589 | |||
| 590 | Interference blocking; | ||
| 591 | |||
| 592 | blocking = np_fifo_per_resource( | ||
| 593 | tsk, resources, 1, | ||
| 594 | req.get_resource_id(), req.get_num_requests()); | ||
| 595 | |||
| 596 | // add in blocking term | ||
| 597 | bterm += blocking; | ||
| 598 | |||
| 599 | // Keep track of maximum request span. | ||
| 600 | // Is this already a single-issue request? | ||
| 601 | if (req.get_num_requests() != 1) | ||
| 602 | // nope, need to recompute | ||
| 603 | blocking = np_fifo_per_resource( | ||
| 604 | tsk, resources, 1, | ||
| 605 | req.get_resource_id(), 1); | ||
| 606 | |||
| 607 | // The span includes our own request. | ||
| 608 | blocking.total_length += req.get_request_length(); | ||
| 609 | blocking.count += 1; | ||
| 610 | |||
| 611 | // Update max. request span. | ||
| 612 | results.raise_request_span(i, blocking); | ||
| 613 | } | ||
| 614 | |||
| 615 | results[i] = bterm; | ||
| 616 | } | ||
| 617 | |||
| 618 | charge_arrival_blocking(info, results); | ||
| 619 | |||
| 620 | return _results; | ||
| 621 | } | ||
| 622 | |||
| 623 | 556 | ||
| 624 | BlockingBounds* clustered_omlp_bounds(const ResourceSharingInfo& info, | 557 | BlockingBounds* clustered_omlp_bounds(const ResourceSharingInfo& info, |
| 625 | unsigned int procs_per_cluster, | 558 | unsigned int procs_per_cluster, |
