/** @{ @ingroup SURF_lmm */
/**
* @brief Create a new Linear MaxMim system
- * @param selective_update [description]
+ * @param selective_update whether we should do lazy updates
*/
-XBT_PUBLIC(lmm_system_t) lmm_system_new(int selective_update);
+XBT_PUBLIC(lmm_system_t) lmm_system_new(bool selective_update);
/**
* @brief Free an existing Linear MaxMin system
CpuCas01Model::CpuCas01Model() : simgrid::surf::CpuModel()
{
char *optim = xbt_cfg_get_string("cpu/optim");
- int select = xbt_cfg_get_boolean("cpu/maxmin-selective-update");
+ bool select = xbt_cfg_get_boolean("cpu/maxmin-selective-update");
if (!strcmp(optim, "Full")) {
updateMechanism_ = UM_FULL;
selectiveUpdate_ = select;
} else if (!strcmp(optim, "Lazy")) {
updateMechanism_ = UM_LAZY;
- selectiveUpdate_ = 1;
- xbt_assert((select == 1)
- || (xbt_cfg_is_default_value("cpu/maxmin-selective-update")),
+ selectiveUpdate_ = true;
+ xbt_assert(select || (xbt_cfg_is_default_value("cpu/maxmin-selective-update")),
"Disabling selective update while using the lazy update mechanism is dumb!");
} else {
xbt_die("Unsupported optimization (%s) for this model", optim);
"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;
*/
typedef struct lmm_system {
int modified;
- int selective_update_active; /* flag to update partially the system only selecting changed portions */
+ bool selective_update_active; /* flag to update partially the system only selecting changed portions */
unsigned visited_counter; /* used by lmm_update_modified_set and lmm_remove_modified_set to cleverly (un-)flag the constraints (more details in these functions)*/
s_xbt_swag_t variable_set; /* a list of lmm_variable_t */
s_xbt_swag_t constraint_set; /* a list of lmm_constraint_t */
:NetworkModel()
{
char *optim = xbt_cfg_get_string("network/optim");
- int select = xbt_cfg_get_boolean("network/maxmin-selective-update");
+ bool select = xbt_cfg_get_boolean("network/maxmin-selective-update");
if (!strcmp(optim, "Full")) {
updateMechanism_ = UM_FULL;
selectiveUpdate_ = select;
} else if (!strcmp(optim, "Lazy")) {
updateMechanism_ = UM_LAZY;
- selectiveUpdate_ = 1;
- xbt_assert((select == 1) || (xbt_cfg_is_default_value("network/maxmin-selective-update")),
- "You cannot disable selective update while using the lazy update mechanism!");
+ selectiveUpdate_ = true;
+ xbt_assert(select || (xbt_cfg_is_default_value("network/maxmin-selective-update")),
+ "You cannot disable selective update when using the lazy update mechanism");
} else {
xbt_die("Unsupported optimization (%s) for this model. Accepted: Full, Lazy.", optim);
}
namespace surf {
HostL07Model::HostL07Model() : HostModel() {
- maxminSystem_ = lmm_system_new(1);
+ maxminSystem_ = lmm_system_new(true /* lazy */);
maxminSystem_->solve_fun = &bottleneck_solve;
surf_network_model = new NetworkL07Model(this,maxminSystem_);
surf_cpu_model_pm = new CpuL07Model(this,maxminSystem_);
#include <math.h> /*ceil*/
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_storage);
-static int storage_selective_update = 0;
static xbt_swag_t storage_running_action_set_that_does_not_need_being_checked = nullptr;
/*************
XBT_DEBUG("surf_storage_model_init_internal");
storage_running_action_set_that_does_not_need_being_checked = xbt_swag_new(xbt_swag_offset(*action, stateHookup_));
- if (!maxminSystem_) {
- maxminSystem_ = lmm_system_new(storage_selective_update);
- }
+ if (!maxminSystem_)
+ maxminSystem_ = lmm_system_new(false /*lazy?*/);
}
StorageN11Model::~StorageN11Model(){
ActionLmmListPtr modifiedSet_;
lmm_system_t maxminSystem_ = nullptr;
e_UM_t updateMechanism_ = UM_UNDEFINED;
- int selectiveUpdate_;
+ bool selectiveUpdate_;
xbt_heap_t actionHeap_;
private: