A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
NS3.25 is out now
[simgrid.git]
/
src
/
surf
/
maxmin.cpp
diff --git
a/src/surf/maxmin.cpp
b/src/surf/maxmin.cpp
index
6645a0d
..
623a3b2
100644
(file)
--- a/
src/surf/maxmin.cpp
+++ b/
src/surf/maxmin.cpp
@@
-74,7
+74,7
@@
inline void lmm_increase_concurrency(lmm_element_t elem) {
"Concurrency limit overflow!");
}
"Concurrency limit overflow!");
}
-lmm_system_t lmm_system_new(
int
selective_update)
+lmm_system_t lmm_system_new(
bool
selective_update)
{
lmm_system_t l = nullptr;
s_lmm_variable_t var;
{
lmm_system_t l = nullptr;
s_lmm_variable_t var;
@@
-102,6
+102,8
@@
lmm_system_t lmm_system_new(int selective_update)
lmm_variable_mallocator_free_f,
lmm_variable_mallocator_reset_f);
lmm_variable_mallocator_free_f,
lmm_variable_mallocator_reset_f);
+ l->solve_fun = &lmm_solve;
+
return l;
}
return l;
}
@@
-1220,25
+1222,28
@@
static void lmm_remove_all_modified_set(lmm_system_t sys)
}
/**
}
/**
- * Returns
total resource load
+ * Returns
resource load (in flop per second, or byte per second, or similar)
*
*
- * \param cnst the lmm_constraint_t associated to the resource
+ * If the resource is shared (the default case), the load is sum of
+ * resource usage made by every variables located on this resource.
*
*
- * This is dead code, but we may use it later for debug/trace.
+ * If the resource is not shared (ie in FATPIPE mode), then the the
+ * load is the max (not the sum) of all resource usages located on this resource.
+ * .
+ * \param cnst the lmm_constraint_t associated to the resource
*/
double lmm_constraint_get_usage(lmm_constraint_t cnst) {
double usage = 0.0;
xbt_swag_t elem_list = &(cnst->enabled_element_set);
void *_elem;
*/
double lmm_constraint_get_usage(lmm_constraint_t cnst) {
double usage = 0.0;
xbt_swag_t elem_list = &(cnst->enabled_element_set);
void *_elem;
- lmm_element_t elem = nullptr;
xbt_swag_foreach(_elem, elem_list) {
xbt_swag_foreach(_elem, elem_list) {
- elem = (lmm_element_t)_elem;
- if (
(elem->value > 0)
) {
+
lmm_element_t
elem = (lmm_element_t)_elem;
+ if (
elem->value > 0
) {
if (cnst->sharing_policy)
usage += elem->value * elem->variable->value;
else if (usage < elem->value * elem->variable->value)
if (cnst->sharing_policy)
usage += elem->value * elem->variable->value;
else if (usage < elem->value * elem->variable->value)
- usage =
elem->value * elem->variable->value
;
+ usage =
std::max(usage, elem->value * elem->variable->value)
;
}
}
return usage;
}
}
return usage;