std::string link_up = "link_" + netpoint->get_name() + "_UP";
std::string link_down = "link_" + netpoint->get_name() + "_DOWN";
- resource::LinkImpl* linkUp = surf_network_model->createLink(link_up, bw_out, 0, s4u::Link::SharingPolicy::SHARED);
- resource::LinkImpl* linkDown = surf_network_model->createLink(link_down, bw_in, 0, s4u::Link::SharingPolicy::SHARED);
+ resource::LinkImpl* linkUp = surf_network_model->create_link(link_up, bw_out, 0, s4u::Link::SharingPolicy::SHARED);
+ resource::LinkImpl* linkDown = surf_network_model->create_link(link_down, bw_in, 0, s4u::Link::SharingPolicy::SHARED);
private_links_.insert({netpoint->id(), {linkUp, linkDown}});
}
}
set_maxmin_system(make_new_lmm_system(select));
- loopback_ = NetworkCm02Model::createLink("__loopback__", 498000000, 0.000015, s4u::Link::SharingPolicy::FATPIPE);
+ loopback_ = NetworkCm02Model::create_link("__loopback__", 498000000, 0.000015, s4u::Link::SharingPolicy::FATPIPE);
}
-LinkImpl* NetworkCm02Model::createLink(const std::string& name, double bandwidth, double latency,
- s4u::Link::SharingPolicy policy)
+LinkImpl* NetworkCm02Model::create_link(const std::string& name, double bandwidth, double latency,
+ s4u::Link::SharingPolicy policy)
{
return new NetworkCm02Link(this, name, bandwidth, latency, policy, get_maxmin_system());
}
});
}
- double bandwidth_bound = route.empty() ? -1.0 : bandwidthFactor(size) * route.front()->get_bandwidth();
+ double bandwidth_bound = route.empty() ? -1.0 : get_bandwidth_factor(size) * route.front()->get_bandwidth();
for (auto const& link : route)
- bandwidth_bound = std::min(bandwidth_bound, bandwidthFactor(size) * link->get_bandwidth());
+ bandwidth_bound = std::min(bandwidth_bound, get_bandwidth_factor(size) * link->get_bandwidth());
action->lat_current_ = action->latency_;
- action->latency_ *= latencyFactor(size);
- action->rate_ = bandwidthConstraint(action->rate_, bandwidth_bound, size);
+ action->latency_ *= get_latency_factor(size);
+ action->rate_ = get_bandwidth_constraint(action->rate_, bandwidth_bound, size);
int constraints_per_variable = route.size();
constraints_per_variable += back_route.size();
public:
explicit NetworkCm02Model(lmm::System* (*make_new_sys)(bool) = &lmm::make_new_maxmin_system);
virtual ~NetworkCm02Model() = default;
- LinkImpl* createLink(const std::string& name, double bandwidth, double latency,
- s4u::Link::SharingPolicy policy) override;
+ LinkImpl* create_link(const std::string& name, double bandwidth, double latency,
+ s4u::Link::SharingPolicy policy) override;
void update_actions_state_lazy(double now, double delta) override;
void update_actions_state_full(double now, double delta) override;
Action* communicate(s4u::Host* src, s4u::Host* dst, double size, double rate) override;
namespace simgrid {
namespace kernel {
namespace resource {
-LinkImpl* NetworkConstantModel::createLink(const std::string& name, double bw, double lat,
- s4u::Link::SharingPolicy policy)
+LinkImpl* NetworkConstantModel::create_link(const std::string& name, double bw, double lat,
+ s4u::Link::SharingPolicy policy)
{
xbt_die("Refusing to create the link %s: there is no link in the Constant network model. "
double next_occuring_event(double now) override;
void update_actions_state(double now, double delta) override;
- LinkImpl* createLink(const std::string& name, double bw, double lat, s4u::Link::SharingPolicy policy) override;
+ LinkImpl* create_link(const std::string& name, double bw, double lat, s4u::Link::SharingPolicy policy) override;
};
/**********
NetworkModel::~NetworkModel() = default;
-double NetworkModel::latencyFactor(double /*size*/)
+double NetworkModel::get_latency_factor(double /*size*/)
{
return sg_latency_factor;
}
-double NetworkModel::bandwidthFactor(double /*size*/)
+double NetworkModel::get_bandwidth_factor(double /*size*/)
{
return sg_bandwidth_factor;
}
-double NetworkModel::bandwidthConstraint(double rate, double /*bound*/, double /*size*/)
+double NetworkModel::get_bandwidth_constraint(double rate, double /*bound*/, double /*size*/)
{
return rate;
}
/** @brief use destroy() instead of this destructor */
LinkImpl::~LinkImpl()
{
- xbt_assert(currentlyDestroying_, "Don't delete Links directly. Call destroy() instead.");
+ xbt_assert(currently_destroying_, "Don't delete Links directly. Call destroy() instead.");
}
/** @brief Fire the required callbacks and destroy the object
*
*/
void LinkImpl::destroy()
{
- if (not currentlyDestroying_) {
- currentlyDestroying_ = true;
+ if (not currently_destroying_) {
+ currently_destroying_ = true;
s4u::Link::on_destruction(this->piface_);
delete this;
}
* @param latency The initial latency of the Link in seconds
* @param policy The sharing policy of the Link
*/
- virtual LinkImpl* createLink(const std::string& name, double bandwidth, double latency,
- s4u::Link::SharingPolicy policy) = 0;
+ virtual LinkImpl* create_link(const std::string& name, double bandwidth, double latency,
+ s4u::Link::SharingPolicy policy) = 0;
/**
* @brief Create a communication between two hosts.
* @param size The size of the message.
* @return The latency factor.
*/
- virtual double latencyFactor(double size);
+ virtual double get_latency_factor(double size);
/**
* @brief Get the right multiplicative factor for the bandwidth.
* @param size The size of the message.
* @return The bandwidth factor.
*/
- virtual double bandwidthFactor(double size);
+ virtual double get_bandwidth_factor(double size);
/**
* @brief Get definitive bandwidth.
* @param size The size of the message.
* @return The new bandwidth.
*/
- virtual double bandwidthConstraint(double rate, double bound, double size);
+ virtual double get_bandwidth_constraint(double rate, double bound, double size);
double next_occuring_event_full(double now) override;
LinkImpl* loopback_ = nullptr;
public:
void destroy(); // Must be called instead of the destructor
private:
- bool currentlyDestroying_ = false;
+ bool currently_destroying_ = false;
public:
/** @brief Public interface */
IPV4addr.clear();
}
-LinkImpl* NetworkNS3Model::createLink(const std::string& name, double bandwidth, double latency,
- s4u::Link::SharingPolicy policy)
+LinkImpl* NetworkNS3Model::create_link(const std::string& name, double bandwidth, double latency,
+ s4u::Link::SharingPolicy policy)
{
return new LinkNS3(this, name, bandwidth, latency);
}
public:
NetworkNS3Model();
~NetworkNS3Model();
- LinkImpl* createLink(const std::string& name, double bandwidth, double latency,
- s4u::Link::SharingPolicy policy) override;
+ LinkImpl* create_link(const std::string& name, double bandwidth, double latency,
+ s4u::Link::SharingPolicy policy) override;
kernel::resource::Action* communicate(s4u::Host* src, s4u::Host* dst, double size, double rate) override;
double next_occuring_event(double now) override;
bool next_occuring_event_is_idempotent() override { return false; }
NetworkSmpiModel::~NetworkSmpiModel() = default;
-double NetworkSmpiModel::bandwidthFactor(double size)
+double NetworkSmpiModel::get_bandwidth_factor(double size)
{
if (smpi_bw_factor.empty())
smpi_bw_factor = parse_factor(simgrid::config::get_value<std::string>("smpi/bw-factor"));
return current;
}
-double NetworkSmpiModel::latencyFactor(double size)
+double NetworkSmpiModel::get_latency_factor(double size)
{
if (smpi_lat_factor.empty())
smpi_lat_factor = parse_factor(simgrid::config::get_value<std::string>("smpi/lat-factor"));
return current;
}
-double NetworkSmpiModel::bandwidthConstraint(double rate, double bound, double size)
+double NetworkSmpiModel::get_bandwidth_constraint(double rate, double bound, double size)
{
- return rate < 0 ? bound : std::min(bound, rate * bandwidthFactor(size));
+ return rate < 0 ? bound : std::min(bound, rate * get_bandwidth_factor(size));
}
/************
NetworkSmpiModel();
~NetworkSmpiModel();
- double latencyFactor(double size);
- double bandwidthFactor(double size);
- double bandwidthConstraint(double rate, double bound, double size);
+ double get_latency_factor(double size);
+ double get_bandwidth_factor(double size);
+ double get_bandwidth_constraint(double rate, double bound, double size);
};
} // namespace resource
} // namespace kernel
: NetworkModel(Model::UpdateAlgo::FULL), hostModel_(hmodel)
{
set_maxmin_system(sys);
- loopback_ = NetworkL07Model::createLink("__loopback__", 498000000, 0.000015, s4u::Link::SharingPolicy::FATPIPE);
+ loopback_ = NetworkL07Model::create_link("__loopback__", 498000000, 0.000015, s4u::Link::SharingPolicy::FATPIPE);
}
NetworkL07Model::~NetworkL07Model()
return new CpuL07(this, host, speed_per_pstate, core);
}
-kernel::resource::LinkImpl* NetworkL07Model::createLink(const std::string& name, double bandwidth, double latency,
- s4u::Link::SharingPolicy policy)
+kernel::resource::LinkImpl* NetworkL07Model::create_link(const std::string& name, double bandwidth, double latency,
+ s4u::Link::SharingPolicy policy)
{
return new LinkL07(this, name, bandwidth, latency, policy);
}
public:
NetworkL07Model(HostL07Model* hmodel, kernel::lmm::System* sys);
~NetworkL07Model();
- kernel::resource::LinkImpl* createLink(const std::string& name, double bandwidth, double latency,
- s4u::Link::SharingPolicy policy) override;
+ kernel::resource::LinkImpl* create_link(const std::string& name, double bandwidth, double latency,
+ s4u::Link::SharingPolicy policy) override;
kernel::resource::Action* communicate(s4u::Host* src, s4u::Host* dst, double size, double rate) override;
}
for (auto const& link_name : names) {
simgrid::kernel::resource::LinkImpl* l =
- surf_network_model->createLink(link_name, link->bandwidth, link->latency, link->policy);
+ surf_network_model->create_link(link_name, link->bandwidth, link->latency, link->policy);
if (link->properties) {
for (auto const& elm : *link->properties)