/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
+#include <algorithm>
+
#include "network_cm02.hpp"
#include "maxmin_private.hpp"
#include "simgrid/sg_config.h"
if (surf_network_model)
return;
- surf_network_model = new NetworkCm02Model();
+ surf_network_model = new simgrid::surf::NetworkCm02Model();
net_define_callbacks();
- Model *model = surf_network_model;
+ simgrid::surf::Model *model = surf_network_model;
xbt_dynar_push(all_existing_models, &model);
xbt_cfg_setdefault_double(_sg_cfg_set, "network/latency_factor",
if (surf_network_model)
return;
- surf_network_model = new NetworkCm02Model();
+ surf_network_model = new simgrid::surf::NetworkCm02Model();
net_define_callbacks();
- Model *model = surf_network_model;
+ simgrid::surf::Model *model = surf_network_model;
xbt_dynar_push(all_existing_models, &model);
xbt_cfg_setdefault_double(_sg_cfg_set, "network/latency_factor", 1.0);
if (surf_network_model)
return;
- surf_network_model = new NetworkCm02Model();
+ surf_network_model = new simgrid::surf::NetworkCm02Model();
net_define_callbacks();
- Model *model = surf_network_model;
+ simgrid::surf::Model *model = surf_network_model;
xbt_dynar_push(all_existing_models, &model);
lmm_set_default_protocol_function(func_reno_f, func_reno_fp,
func_reno_fpi);
if (surf_network_model)
return;
- surf_network_model = new NetworkCm02Model();
+ surf_network_model = new simgrid::surf::NetworkCm02Model();
net_define_callbacks();
- Model *model = surf_network_model;
+ simgrid::surf::Model *model = surf_network_model;
xbt_dynar_push(all_existing_models, &model);
lmm_set_default_protocol_function(func_reno2_f, func_reno2_fp,
func_reno2_fpi);
if (surf_network_model)
return;
- surf_network_model = new NetworkCm02Model();
+ surf_network_model = new simgrid::surf::NetworkCm02Model();
net_define_callbacks();
- Model *model = surf_network_model;
+ simgrid::surf::Model *model = surf_network_model;
xbt_dynar_push(all_existing_models, &model);
lmm_set_default_protocol_function(func_vegas_f, func_vegas_fp,
func_vegas_fpi);
xbt_cfg_setdefault_double(_sg_cfg_set, "network/weight_S", 8775);
}
+namespace simgrid {
+namespace surf {
+
NetworkCm02Model::NetworkCm02Model()
:NetworkModel()
{
Link* link = new NetworkCm02Link(this, name, properties, p_maxminSystem, sg_bandwidth_factor * bw_initial, history,
state_initial, state_trace, bw_initial, bw_trace, lat_initial, lat_trace, policy);
- surf_callback_emit(networkLinkCreatedCallbacks, link);
+ Link::onCreation(link);
return link;
}
link = static_cast<NetworkCm02Link*>(_link);
double bb = bandwidthFactor(size) * link->getBandwidth();
bandwidth_bound =
- (bandwidth_bound < 0.0) ? bb : min(bandwidth_bound, bb);
+ (bandwidth_bound < 0.0) ? bb : std::min(bandwidth_bound, bb);
}
action->m_latCurrent = action->m_latency;
if (action->m_rate < 0) {
lmm_update_variable_bound(p_maxminSystem, action->getVariable(), (action->m_latCurrent > 0) ? sg_tcp_gamma / (2.0 * action->m_latCurrent) : -1.0);
} else {
- lmm_update_variable_bound(p_maxminSystem, action->getVariable(), (action->m_latCurrent > 0) ? min(action->m_rate, sg_tcp_gamma / (2.0 * action->m_latCurrent)) : action->m_rate);
+ lmm_update_variable_bound(p_maxminSystem, action->getVariable(), (action->m_latCurrent > 0) ? std::min(action->m_rate, sg_tcp_gamma / (2.0 * action->m_latCurrent)) : action->m_rate);
}
xbt_dynar_foreach(route, i, _link) {
xbt_dynar_free(&route);
XBT_OUT();
- surf_callback_emit(networkCommunicateCallbacks, action, src, dst, size, rate);
+ networkCommunicateCallbacks(action, src, dst, size, rate);
return action;
}
lmm_update_variable_bound(getModel()->getMaxminSystem(), action->getVariable(), sg_tcp_gamma / (2.0 * action->m_latCurrent));
else {
lmm_update_variable_bound(getModel()->getMaxminSystem(), action->getVariable(),
- min(action->m_rate, sg_tcp_gamma / (2.0 * action->m_latCurrent)));
+ std::min(action->m_rate, sg_tcp_gamma / (2.0 * action->m_latCurrent)));
if (action->m_rate < sg_tcp_gamma / (2.0 * action->m_latCurrent)) {
XBT_INFO("Flow is limited BYBANDWIDTH");
m_lastValue = lmm_variable_getvalue(getVariable());
}
+}
+}