diff options
author | Bjoern Brandenburg <bbb@mpi-sws.org> | 2013-01-29 07:47:01 -0500 |
---|---|---|
committer | Bjoern Brandenburg <bbb@mpi-sws.org> | 2013-07-12 08:19:22 -0400 |
commit | 064f6a2915d8bcecea31f07b2a57de80203c6f37 (patch) | |
tree | 92ce02d07ba1779e434942616113f967c42d79ed /native/src/blocking/linprog/lp_common.cpp | |
parent | e17645921697351bd968f034a85299c02332ad16 (diff) |
Implement LP-based OMIP blocking analysis
Diffstat (limited to 'native/src/blocking/linprog/lp_common.cpp')
-rw-r--r-- | native/src/blocking/linprog/lp_common.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/native/src/blocking/linprog/lp_common.cpp b/native/src/blocking/linprog/lp_common.cpp index 1715d3b..2df1284 100644 --- a/native/src/blocking/linprog/lp_common.cpp +++ b/native/src/blocking/linprog/lp_common.cpp | |||
@@ -119,6 +119,40 @@ void set_blocking_objective_part_shm( | |||
119 | } | 119 | } |
120 | } | 120 | } |
121 | 121 | ||
122 | // This version is for suspension-oblivious shared-memory protocols, | ||
123 | // where the analysis does not differentiate among the different kinds | ||
124 | // of blocking (since they are all just added to the execution time anyway). | ||
125 | void set_blocking_objective_sob( | ||
126 | VarMapper& vars, | ||
127 | const ResourceSharingInfo& info, | ||
128 | const TaskInfo& ti, | ||
129 | LinearProgram& lp) | ||
130 | { | ||
131 | LinearExpression *obj; | ||
132 | |||
133 | obj = lp.get_objective(); | ||
134 | |||
135 | foreach_task_except(info.get_tasks(), ti, tx) | ||
136 | { | ||
137 | unsigned int t = tx->get_id(); | ||
138 | |||
139 | foreach(tx->get_requests(), request) | ||
140 | { | ||
141 | unsigned int q = request->get_resource_id(); | ||
142 | double length = request->get_request_length();; | ||
143 | |||
144 | foreach_request_instance(*request, ti, v) | ||
145 | { | ||
146 | unsigned int var_id; | ||
147 | |||
148 | var_id = vars.lookup(t, q, v, BLOCKING_SOB); | ||
149 | obj->add_term(length, var_id); | ||
150 | } | ||
151 | } | ||
152 | } | ||
153 | } | ||
154 | |||
155 | |||
122 | // Constraint 1 in [Brandenburg 2013] | 156 | // Constraint 1 in [Brandenburg 2013] |
123 | void add_mutex_constraints( | 157 | void add_mutex_constraints( |
124 | VarMapper& vars, | 158 | VarMapper& vars, |