namespace surf {
HostL07Model::HostL07Model() : HostModel() {
- p_maxminSystem = lmm_system_new(1);
- surf_network_model = new NetworkL07Model(this,p_maxminSystem);
- surf_cpu_model_pm = new CpuL07Model(this,p_maxminSystem);
-
- routing_model_create(surf_network_model->createLink("__loopback__",
- 498000000, NULL,
- 0.000015, NULL,
- NULL,
- SURF_LINK_FATPIPE, NULL));
+ maxminSystem_ = lmm_system_new(1);
+ surf_network_model = new NetworkL07Model(this,maxminSystem_);
+ surf_cpu_model_pm = new CpuL07Model(this,maxminSystem_);
+
+ routing_model_create(surf_network_model->createLink("__loopback__", 498000000, 0.000015, SURF_LINK_FATPIPE, NULL));
}
HostL07Model::~HostL07Model() {
: CpuModel()
, p_hostModel(hmodel)
{
- p_maxminSystem = sys;
+ maxminSystem_ = sys;
}
CpuL07Model::~CpuL07Model() {
surf_cpu_model_pm = NULL;
- lmm_system_free(p_maxminSystem);
- p_maxminSystem = NULL;
+ lmm_system_free(maxminSystem_);
+ maxminSystem_ = NULL;
}
NetworkL07Model::NetworkL07Model(HostL07Model *hmodel, lmm_system_t sys)
: NetworkModel()
, p_hostModel(hmodel)
{
- p_maxminSystem = sys;
+ maxminSystem_ = sys;
}
NetworkL07Model::~NetworkL07Model()
{
surf_network_model = NULL;
- p_maxminSystem = NULL; // Avoid multi-free
+ maxminSystem_ = NULL; // Avoid multi-free
}
ActionList *running_actions = getRunningActionSet();
double min = this->shareResourcesMaxMin(running_actions,
- p_maxminSystem,
+ maxminSystem_,
bottleneck_solve);
for(ActionList::iterator it(running_actions->begin()), itend(running_actions->end())
}
if ((action->m_latency == 0.0) && (action->isSuspended() == 0)) {
action->updateBound();
- lmm_update_variable_weight(p_maxminSystem, action->getVariable(), 1.0);
+ lmm_update_variable_weight(maxminSystem_, action->getVariable(), 1.0);
}
}
XBT_DEBUG("Action (%p) : remains (%g) updated by %g.",
lmm_constraint_t cnst = NULL;
int i = 0;
- while ((cnst = lmm_get_cnst_from_var(p_maxminSystem, action->getVariable(), i++))) {
+ while ((cnst = lmm_get_cnst_from_var(maxminSystem_, action->getVariable(), i++))) {
void *constraint_id = lmm_constraint_id(cnst);
if (static_cast<HostImpl*>(constraint_id)->isOff()) {
return cpu;
}
-Link* NetworkL07Model::createLink(const char *name,
- double bw_initial,
- tmgr_trace_t bw_trace,
- double lat_initial,
- tmgr_trace_t lat_trace,
- tmgr_trace_t state_trace,
- e_surf_link_sharing_policy_t policy,
- xbt_dict_t properties)
+Link* NetworkL07Model::createLink(const char *name, double bandwidth, double latency,
+ e_surf_link_sharing_policy_t policy, xbt_dict_t properties)
{
xbt_assert(!Link::byName(name),
- "Link '%s' declared several times in the platform file.", name);
+ "Link '%s' declared several times in the platform.", name);
- Link* link = new LinkL07(this, name, properties,
- bw_initial, bw_trace,
- lat_initial, lat_trace,
- state_trace,
- policy);
+ Link* link = new LinkL07(this, name, properties, bandwidth, latency, policy);
Link::onCreation(link);
return link;
}
{
}
-LinkL07::LinkL07(NetworkL07Model *model, const char* name, xbt_dict_t props,
- double bw_initial, tmgr_trace_t bw_trace,
- double lat_initial, tmgr_trace_t lat_trace,
- tmgr_trace_t state_trace,
+LinkL07::LinkL07(NetworkL07Model *model, const char* name, xbt_dict_t props, double bandwidth, double latency,
e_surf_link_sharing_policy_t policy)
- : Link(model, name, props, lmm_constraint_new(model->getMaxminSystem(), this, bw_initial), state_trace)
+ : Link(model, name, props, lmm_constraint_new(model->getMaxminSystem(), this, bandwidth))
{
- m_bandwidth.peak = bw_initial;
- if (bw_trace)
- m_bandwidth.event = future_evt_set->add_trace(bw_trace, 0.0, this);
-
- m_latency.peak = lat_initial;
- if (lat_trace)
- m_latency.event = future_evt_set->add_trace(lat_trace, 0.0, this);
+ m_bandwidth.peak = bandwidth;
+ m_latency.peak = latency;
if (policy == SURF_LINK_FATPIPE)
lmm_constraint_shared(getConstraint());