namespace surf {
class Resource;
class Cpu;
- class Link;
+ class LinkImpl;
class HostImpl;
}
namespace trace_mgr {
typedef simgrid::kernel::activity::ActivityImpl kernel_Activity;
typedef simgrid::kernel::routing::NetPoint routing_NetPoint;
typedef simgrid::surf::Cpu surf_Cpu;
-typedef simgrid::surf::Link Link;
+typedef simgrid::surf::LinkImpl Link;
typedef simgrid::surf::Resource surf_Resource;
typedef simgrid::trace_mgr::trace tmgr_Trace;
unsigned int group_;
unsigned int chassis_;
unsigned int blade_;
- surf::Link** blueLinks_ = nullptr;
- surf::Link** blackLinks_ = nullptr;
- surf::Link** greenLinks_ = nullptr;
- surf::Link** myNodes_ = nullptr;
+ surf::LinkImpl** blueLinks_ = nullptr;
+ surf::LinkImpl** blackLinks_ = nullptr;
+ surf::LinkImpl** greenLinks_ = nullptr;
+ surf::LinkImpl** myNodes_ = nullptr;
DragonflyRouter(int i, int j, int k);
~DragonflyRouter();
};
/* PRECONDITION: this is the common ancestor of src and dst */
bool NetZoneImpl::getBypassRoute(routing::NetPoint* src, routing::NetPoint* dst,
- /* OUT */ std::vector<surf::Link*>* links, double* latency)
+ /* OUT */ std::vector<surf::LinkImpl*>* links, double* latency)
{
// If never set a bypass route return nullptr without any further computations
if (bypassRoutes_.empty())
if (dst->netzone() == this && src->netzone() == this) {
if (bypassRoutes_.find({src, dst}) != bypassRoutes_.end()) {
BypassRoute* bypassedRoute = bypassRoutes_.at({src, dst});
- for (surf::Link* link : bypassedRoute->links) {
+ for (surf::LinkImpl* link : bypassedRoute->links) {
links->push_back(link);
if (latency)
*latency += link->latency();
src->cname(), dst->cname(), bypassedRoute->links.size());
if (src != key.first)
getGlobalRoute(src, const_cast<NetPoint*>(bypassedRoute->gw_src), links, latency);
- for (surf::Link* link : bypassedRoute->links) {
+ for (surf::LinkImpl* link : bypassedRoute->links) {
links->push_back(link);
if (latency)
*latency += link->latency();
}
void NetZoneImpl::getGlobalRoute(routing::NetPoint* src, routing::NetPoint* dst,
- /* OUT */ std::vector<surf::Link*>* links, double* latency)
+ /* OUT */ std::vector<surf::LinkImpl*>* links, double* latency)
{
s_sg_platf_route_cbarg_t route;
memset(&route, 0, sizeof(route));
/* Not in the same netzone, no bypass. We'll have to find our path between the netzones recursively */
- route.link_list = new std::vector<surf::Link*>();
+ route.link_list = new std::vector<surf::LinkImpl*>();
common_ancestor->getLocalRoute(src_ancestor->netpoint_, dst_ancestor->netpoint_, &route, latency);
xbt_assert((route.gw_src != nullptr) && (route.gw_dst != nullptr), "bad gateways for route from \"%s\" to \"%s\"",
/** @brief retrieves the list of all routes of size 1 (of type src x dst x Link) */
/* returns whether we found a bypass path */
bool getBypassRoute(routing::NetPoint * src, routing::NetPoint * dst,
- /* OUT */ std::vector<surf::Link*> * links, double* latency);
+ /* OUT */ std::vector<surf::LinkImpl*> * links, double* latency);
public:
/* @brief get the route between two nodes in the full platform
* @param latency Accumulator in which the latencies should be added (caller must set it to 0)
*/
static void getGlobalRoute(routing::NetPoint * src, routing::NetPoint * dst,
- /* OUT */ std::vector<surf::Link*> * links, double* latency);
+ /* OUT */ std::vector<surf::LinkImpl*> * links, double* latency);
virtual void getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges) = 0;
enum class RoutingMode {
}
}
-static void instr_routing_parse_start_link(simgrid::surf::Link* link)
+static void instr_routing_parse_start_link(simgrid::surf::LinkImpl* link)
{
if (currentContainer.empty()) // No ongoing parsing. Are you creating the loopback?
return;
//always need the call backs to ASes (we need only the root AS),
//to create the rootContainer and the rootType properly
if (!TRACE_needs_platform()) return;
- simgrid::surf::Link::onCreation.connect(instr_routing_parse_start_link);
+ simgrid::surf::LinkImpl::onCreation.connect(instr_routing_parse_start_link);
simgrid::s4u::onPlatformCreated.connect(instr_routing_parse_end_platform);
}
NetworkCm02Model::~NetworkCm02Model() {}
-Link* NetworkCm02Model::createLink(const char* name, double bandwidth, double latency,
- e_surf_link_sharing_policy_t policy)
+LinkImpl* NetworkCm02Model::createLink(const char* name, double bandwidth, double latency,
+ e_surf_link_sharing_policy_t policy)
{
return new NetworkCm02Link(this, name, bandwidth, latency, policy, maxminSystem_);
}
int failed = 0;
double bandwidth_bound;
double latency = 0.0;
- std::vector<Link*> * back_route = nullptr;
+ std::vector<LinkImpl*>* back_route = nullptr;
int constraints_per_variable = 0;
- std::vector<Link*> *route = new std::vector<Link*>();
+ std::vector<LinkImpl*>* route = new std::vector<LinkImpl*>();
XBT_IN("(%s,%s,%g,%g)", src->cname(), dst->cname(), size, rate);
failed = 1;
if (sg_network_crosstraffic == 1) {
- back_route = new std::vector<Link*>();
+ back_route = new std::vector<LinkImpl*>();
dst->routeTo(src, back_route, nullptr);
for (auto link: *back_route)
if (link->isOff())
delete back_route;
XBT_OUT();
- Link::onCommunicate(action, src, dst);
+ LinkImpl::onCommunicate(action, src, dst);
return action;
}
-void NetworkCm02Model::gapAppend(double size, const Link* link, NetworkAction* action)
-{
- // Nothing
+void NetworkCm02Model::gapAppend(double size, const LinkImpl* link, NetworkAction* action){
+ // Nothing
};
/************
************/
NetworkCm02Link::NetworkCm02Link(NetworkCm02Model* model, const char* name, double bandwidth, double latency,
e_surf_link_sharing_policy_t policy, lmm_system_t system)
- : Link(model, name, lmm_constraint_new(system, this, sg_bandwidth_factor * bandwidth))
+ : LinkImpl(model, name, lmm_constraint_new(system, this, sg_bandwidth_factor * bandwidth))
{
bandwidth_.scale = 1.0;
bandwidth_.peak = bandwidth;
if (policy == SURF_LINK_FATPIPE)
lmm_constraint_shared(getConstraint());
- Link::onCreation(this);
+ LinkImpl::onCreation(this);
}
lastValue_ = lmm_variable_getvalue(getVariable());
}
-void NetworkCm02Link::gapAppend(double size, const Link* link, NetworkAction* action)
-{
- // Nothing
+void NetworkCm02Link::gapAppend(double size, const LinkImpl* link, NetworkAction* action){
+ // Nothing
};
-
}
}
NetworkCm02Model();
explicit NetworkCm02Model(void (*solve_fun)(lmm_system_t self));
virtual ~NetworkCm02Model();
- Link* createLink(const char* name, double bandwidth, double latency,
- e_surf_link_sharing_policy_t policy) override;
+ LinkImpl* createLink(const char* name, double bandwidth, double latency,
+ e_surf_link_sharing_policy_t policy) override;
void updateActionsStateLazy(double now, double delta) override;
void updateActionsStateFull(double now, double delta) override;
Action* communicate(s4u::Host* src, s4u::Host* dst, double size, double rate) override;
- virtual void gapAppend(double size, const Link* link, NetworkAction* action);
+ virtual void gapAppend(double size, const LinkImpl* link, NetworkAction* action);
+
protected:
bool haveGap_ = false;
};
* Resource *
************/
- class NetworkCm02Link : public Link {
+ class NetworkCm02Link : public LinkImpl {
public:
NetworkCm02Link(NetworkCm02Model* model, const char* name, double bandwidth, double latency,
e_surf_link_sharing_policy_t policy, lmm_system_t system);
void apply_event(tmgr_trace_iterator_t event, double value) override;
void setBandwidth(double value) override;
void setLatency(double value) override;
- virtual void gapAppend(double size, const Link* link, NetworkAction* action);
+ virtual void gapAppend(double size, const LinkImpl* link, NetworkAction* action);
};
namespace simgrid {
namespace surf {
- Link* NetworkConstantModel::createLink(const char* name, double bw, double lat, e_surf_link_sharing_policy_t policy)
+ LinkImpl* NetworkConstantModel::createLink(const char* name, double bw, double lat,
+ e_surf_link_sharing_policy_t policy)
{
xbt_die("Refusing to create the link %s: there is no link in the Constant network model. "
{
NetworkConstantAction *action = new NetworkConstantAction(this, size, sg_latency_factor);
- Link::onCommunicate(action, src, dst);
+ LinkImpl::onCommunicate(action, src, dst);
return action;
}
double nextOccuringEvent(double now) override;
void updateActionsState(double now, double delta) override;
- Link* createLink(const char* name, double bw, double lat, e_surf_link_sharing_policy_t policy) override;
+ LinkImpl* createLink(const char* name, double bw, double lat, e_surf_link_sharing_policy_t policy) override;
};
/**********
namespace simgrid {
namespace surf {
- std::unordered_map<std::string,Link *> *Link::links = new std::unordered_map<std::string,Link *>();
- Link *Link::byName(const char* name) {
- if (links->find(name) == links->end())
- return nullptr;
- return links->at(name);
+ std::unordered_map<std::string, LinkImpl*>* LinkImpl::links = new std::unordered_map<std::string, LinkImpl*>();
+ LinkImpl* LinkImpl::byName(const char* name)
+ {
+ if (links->find(name) == links->end())
+ return nullptr;
+ return links->at(name);
}
/** @brief Returns the amount of links in the platform */
- int Link::linksCount() {
+ int LinkImpl::linksCount()
+ {
return links->size();
}
/** @brief Returns a list of all existing links */
- Link **Link::linksList() {
- Link **res = xbt_new(Link*, (int)links->size());
+ LinkImpl** LinkImpl::linksList()
+ {
+ LinkImpl** res = xbt_new(LinkImpl*, (int)links->size());
int i=0;
for (auto kv : *links) {
res[i++] = kv.second;
return res;
}
/** @brief destructor of the static data */
- void Link::linksExit() {
+ void LinkImpl::linksExit()
+ {
for (auto kv : *links)
(kv.second)->destroy();
delete links;
* Callbacks *
*************/
- simgrid::xbt::signal<void(Link*)> Link::onCreation;
- simgrid::xbt::signal<void(Link*)> Link::onDestruction;
- simgrid::xbt::signal<void(Link*)> Link::onStateChange;
+ simgrid::xbt::signal<void(LinkImpl*)> LinkImpl::onCreation;
+ simgrid::xbt::signal<void(LinkImpl*)> LinkImpl::onDestruction;
+ simgrid::xbt::signal<void(LinkImpl*)> LinkImpl::onStateChange;
simgrid::xbt::signal<void(NetworkAction*, Action::State, Action::State)> networkActionStateChangedCallbacks;
- simgrid::xbt::signal<void(NetworkAction*, s4u::Host* src, s4u::Host* dst)> Link::onCommunicate;
+ simgrid::xbt::signal<void(NetworkAction*, s4u::Host* src, s4u::Host* dst)> LinkImpl::onCommunicate;
}
}
* Resource *
************/
- Link::Link(simgrid::surf::NetworkModel* model, const char* name, lmm_constraint_t constraint)
+ LinkImpl::LinkImpl(simgrid::surf::NetworkModel* model, const char* name, lmm_constraint_t constraint)
: Resource(model, name, constraint)
{
if (strcmp(name,"__loopback__"))
- xbt_assert(!Link::byName(name), "Link '%s' declared several times in the platform.", name);
+ xbt_assert(!LinkImpl::byName(name), "Link '%s' declared several times in the platform.", name);
latency_.scale = 1;
bandwidth_.scale = 1;
}
/** @brief use destroy() instead of this destructor */
- Link::~Link() {
+ LinkImpl::~LinkImpl()
+ {
xbt_assert(currentlyDestroying_, "Don't delete Links directly. Call destroy() instead.");
}
/** @brief Fire the required callbacks and destroy the object
*
* Don't delete directly a Link, call l->destroy() instead.
*/
- void Link::destroy()
+ void LinkImpl::destroy()
{
if (!currentlyDestroying_) {
currentlyDestroying_ = true;
}
}
- bool Link::isUsed()
+ bool LinkImpl::isUsed()
{
return lmm_constraint_used(getModel()->getMaxminSystem(), getConstraint());
}
- double Link::latency()
+ double LinkImpl::latency()
{
return latency_.peak * latency_.scale;
}
- double Link::bandwidth()
+ double LinkImpl::bandwidth()
{
return bandwidth_.peak * bandwidth_.scale;
}
- int Link::sharingPolicy()
+ int LinkImpl::sharingPolicy()
{
return lmm_constraint_sharing_policy(getConstraint());
}
- void Link::turnOn(){
+ void LinkImpl::turnOn()
+ {
if (isOff()) {
Resource::turnOn();
onStateChange(this);
}
}
- void Link::turnOff(){
+ void LinkImpl::turnOff()
+ {
if (isOn()) {
Resource::turnOff();
onStateChange(this);
}
}
- void Link::setStateTrace(tmgr_trace_t trace) {
+ void LinkImpl::setStateTrace(tmgr_trace_t trace)
+ {
xbt_assert(stateEvent_ == nullptr, "Cannot set a second state trace to Link %s", getName());
stateEvent_ = future_evt_set->add_trace(trace, 0.0, this);
}
- void Link::setBandwidthTrace(tmgr_trace_t trace)
+ void LinkImpl::setBandwidthTrace(tmgr_trace_t trace)
{
xbt_assert(bandwidth_.event == nullptr, "Cannot set a second bandwidth trace to Link %s", getName());
bandwidth_.event = future_evt_set->add_trace(trace, 0.0, this);
}
- void Link::setLatencyTrace(tmgr_trace_t trace)
+ void LinkImpl::setLatencyTrace(tmgr_trace_t trace)
{
xbt_assert(latency_.event == nullptr, "Cannot set a second latency trace to Link %s", getName());
latency_.event = future_evt_set->add_trace(trace, 0.0, this);
* Signature: `void(NetworkAction *action, simgrid::surf::Action::State old, simgrid::surf::Action::State current)` */
XBT_PUBLIC_DATA(simgrid::xbt::signal<void(simgrid::surf::NetworkAction*, simgrid::surf::Action::State, simgrid::surf::Action::State)>) networkActionStateChangedCallbacks;
-/*********
- * Model *
- *********/
+ /*********
+ * Model *
+ *********/
/** @ingroup SURF_network_interface
* @brief SURF network model interface class
* @param latency The initial latency of the Link in seconds
* @param policy The sharing policy of the Link
*/
- virtual Link* createLink(const char* name, double bandwidth, double latency,
- e_surf_link_sharing_policy_t policy) = 0;
+ virtual LinkImpl* createLink(const char* name, double bandwidth, double latency,
+ e_surf_link_sharing_policy_t policy) = 0;
/**
* @brief Create a communication between two hosts.
virtual double bandwidthConstraint(double rate, double bound, double size);
double nextOccuringEventFull(double now) override;
- Link* loopback_ = nullptr;
+ LinkImpl* loopback_ = nullptr;
};
/************
* @brief SURF network link interface class
* @details A Link represents the link between two [hosts](\ref simgrid::surf::HostImpl)
*/
- class Link :
- public simgrid::surf::Resource,
- public simgrid::surf::PropertyHolder {
- public:
-
+ class LinkImpl : public simgrid::surf::Resource, public simgrid::surf::PropertyHolder {
+ public:
/** @brief Constructor of LMM links */
- Link(simgrid::surf::NetworkModel* model, const char* name, lmm_constraint_t constraint);
+ LinkImpl(simgrid::surf::NetworkModel* model, const char* name, lmm_constraint_t constraint);
- /* Link destruction logic */
- /**************************/
- protected:
- ~Link() override;
- public:
+ /* Link destruction logic */
+ /**************************/
+ protected:
+ ~LinkImpl() override;
+ public:
void destroy(); // Must be called instead of the destructor
- private:
+ private:
bool currentlyDestroying_ = false;
- public:
- /** @brief Callback signal fired when a new Link is created.
- * Signature: void(Link*) */
- static simgrid::xbt::signal<void(surf::Link*)> onCreation;
+ public:
+ /** @brief Callback signal fired when a new Link is created */
+ static simgrid::xbt::signal<void(surf::LinkImpl*)> onCreation;
- /** @brief Callback signal fired when a Link is destroyed.
- * Signature: void(Link*) */
- static simgrid::xbt::signal<void(surf::Link*)> onDestruction;
+ /** @brief Callback signal fired when a Link is destroyed */
+ static simgrid::xbt::signal<void(surf::LinkImpl*)> onDestruction;
- /** @brief Callback signal fired when the state of a Link changes (when it is turned on or off)
- * Signature: `void(Link*)` */
- static simgrid::xbt::signal<void(surf::Link*)> onStateChange;
+ /** @brief Callback signal fired when the state of a Link changes (when it is turned on or off) */
+ static simgrid::xbt::signal<void(surf::LinkImpl*)> onStateChange;
- /** @brief Callback signal fired when a communication starts
- * Signature: `void(NetworkAction *action, host *src, host *dst)` */
+ /** @brief Callback signal fired when a communication starts */
static simgrid::xbt::signal<void(surf::NetworkAction*, s4u::Host* src, s4u::Host* dst)> onCommunicate;
/** @brief Get the bandwidth in bytes per second of current Link */
/** @brief Update the latency in seconds of current Link */
virtual void setLatency(double value) = 0;
- /** @brief The sharing policy is a @{link e_surf_link_sharing_policy_t::EType} (0: FATPIPE, 1: SHARED, 2: FULLDUPLEX) */
+ /** @brief The sharing policy is a @{link e_surf_link_sharing_policy_t::EType} (0: FATPIPE, 1: SHARED, 2:
+ * FULLDUPLEX) */
virtual int sharingPolicy();
/** @brief Check if the Link is used */
void turnOn() override;
void turnOff() override;
- virtual void setStateTrace(tmgr_trace_t trace); /*< setup the trace file with states events (ON or OFF). Trace must contain boolean values. */
- virtual void setBandwidthTrace(tmgr_trace_t trace); /*< setup the trace file with bandwidth events (peak speed changes due to external load). Trace must contain percentages (value between 0 and 1). */
- virtual void setLatencyTrace(tmgr_trace_t trace); /*< setup the trace file with latency events (peak latency changes due to external load). Trace must contain absolute values */
+ virtual void setStateTrace(tmgr_trace_t trace); /*< setup the trace file with states events (ON or OFF).
+ Trace must contain boolean values. */
+ virtual void setBandwidthTrace(tmgr_trace_t trace); /*< setup the trace file with bandwidth events (peak speed changes due to external load).
+ Trace must contain percentages (value between 0 and 1). */
+ virtual void setLatencyTrace(tmgr_trace_t trace); /*< setup the trace file with latency events (peak latency changes due to external load).
+ Trace must contain absolute values */
tmgr_trace_iterator_t stateEvent_ = nullptr;
s_surf_metric_t latency_ = {1.0, 0, nullptr};
s_surf_metric_t bandwidth_ = {1.0, 0, nullptr};
/* User data */
- public:
+ public:
void *getData() { return userData;}
void setData(void *d) { userData=d;}
- private:
+ private:
void *userData = nullptr;
/* List of all links. FIXME: should move to the Engine */
- private:
- static std::unordered_map<std::string, Link *> *links;
- public:
- static Link *byName(const char* name);
+ private:
+ static std::unordered_map<std::string, LinkImpl*>* links;
+
+ public:
+ static LinkImpl* byName(const char* name);
static int linksCount();
- static Link **linksList();
+ static LinkImpl** linksList();
static void linksExit();
};
xbt_dict_free(&flowFromSock);
}
-Link* NetworkNS3Model::createLink(const char* name, double bandwidth, double latency,
- e_surf_link_sharing_policy_t policy)
+LinkImpl* NetworkNS3Model::createLink(const char* name, double bandwidth, double latency,
+ e_surf_link_sharing_policy_t policy)
{
return new LinkNS3(this, name, bandwidth, latency);
}
action->getState() == Action::State::running){
double data_delta_sent = sgFlow->sentBytes_ - action->lastSent_;
- std::vector<Link*> route = std::vector<Link*>();
+ std::vector<LinkImpl*> route = std::vector<LinkImpl*>();
action->src_->routeTo(action->dst_, &route, nullptr);
for (auto link : route)
************/
LinkNS3::LinkNS3(NetworkNS3Model* model, const char* name, double bandwidth, double latency)
- : Link(model, name, nullptr)
+ : LinkImpl(model, name, nullptr)
{
bandwidth_.peak = bandwidth;
latency_.peak = latency;
- Link::onCreation(this);
+ LinkImpl::onCreation(this);
}
LinkNS3::~LinkNS3() = default;
dst_ = dst;
ns3_create_flow(src, dst, surf_get_clock(), size, this);
- Link::onCommunicate(this, src, dst);
+ LinkImpl::onCommunicate(this, src, dst);
}
void NetworkNS3Action::suspend() {
public:
NetworkNS3Model();
~NetworkNS3Model();
- Link* createLink(const char* name, double bandwidth, double latency, e_surf_link_sharing_policy_t policy) override;
+ LinkImpl* createLink(const char* name, double bandwidth, double latency,
+ e_surf_link_sharing_policy_t policy) override;
Action* communicate(s4u::Host* src, s4u::Host* dst, double size, double rate) override;
double nextOccuringEvent(double now) override;
bool nextOccuringEventIsIdempotent() {return false;}
/************
* Resource *
************/
-class LinkNS3 : public Link {
+class LinkNS3 : public LinkImpl {
public:
explicit LinkNS3(NetworkNS3Model* model, const char* name, double bandwidth, double latency);
~LinkNS3();
xbt_dict_free(&gap_lookup);
}
- void NetworkSmpiModel::gapAppend(double size, Link* link, NetworkAction *act)
+ void NetworkSmpiModel::gapAppend(double size, LinkImpl* link, NetworkAction* act)
{
const char *src = link->getName();
xbt_fifo_t fifo;
~NetworkSmpiModel();
using NetworkCm02Model::gapAppend; // Explicit about overloaded method (silence Woverloaded-virtual from clang)
- void gapAppend(double size, Link* link, NetworkAction *action);
+ void gapAppend(double size, LinkImpl* link, NetworkAction* action);
void gapRemove(Action *action);
double latencyFactor(double size);
double bandwidthFactor(double size);
if (bytes_amount[i * host_nb + j] > 0) {
double lat=0.0;
- std::vector<Link*> route;
+ std::vector<LinkImpl*> route;
hostList_->at(i)->routeTo(hostList_->at(j), &route, &lat);
latency = MAX(latency, lat);
if (bytes_amount[i * host_nb + j] == 0.0)
continue;
- std::vector<Link*> route;
+ std::vector<LinkImpl*> route;
hostList_->at(i)->routeTo(hostList_->at(j), &route, nullptr);
for (auto link : route)
return new CpuL07(this, host, speedPerPstate, core);
}
-Link* NetworkL07Model::createLink(const char* name, double bandwidth, double latency,
- e_surf_link_sharing_policy_t policy)
+LinkImpl* NetworkL07Model::createLink(const char* name, double bandwidth, double latency,
+ e_surf_link_sharing_policy_t policy)
{
return new LinkL07(this, name, bandwidth, latency, policy);
}
LinkL07::LinkL07(NetworkL07Model* model, const char* name, double bandwidth, double latency,
e_surf_link_sharing_policy_t policy)
- : Link(model, name, lmm_constraint_new(model->getMaxminSystem(), this, bandwidth))
+ : LinkImpl(model, name, lmm_constraint_new(model->getMaxminSystem(), this, bandwidth))
{
bandwidth_.peak = bandwidth;
latency_.peak = latency;
if (policy == SURF_LINK_FATPIPE)
lmm_constraint_shared(getConstraint());
- Link::onCreation(this);
+ LinkImpl::onCreation(this);
}
Action *CpuL07::execution_start(double size)
if (communicationAmount_[i * hostNb + j] > 0) {
double lat = 0.0;
- std::vector<Link*> route;
+ std::vector<LinkImpl*> route;
hostList_->at(i)->routeTo(hostList_->at(j), &route, &lat);
lat_current = MAX(lat_current, lat * communicationAmount_[i * hostNb + j]);
public:
NetworkL07Model(HostL07Model *hmodel, lmm_system_t sys);
~NetworkL07Model();
- Link* createLink(const char* name, double bandwidth, double latency, e_surf_link_sharing_policy_t policy) override;
+ LinkImpl* createLink(const char* name, double bandwidth, double latency,
+ e_surf_link_sharing_policy_t policy) override;
Action* communicate(s4u::Host* src, s4u::Host* dst, double size, double rate) override;
void onSpeedChange() override;
};
-class LinkL07 : public Link {
+class LinkL07 : public LinkImpl {
public:
LinkL07(NetworkL07Model* model, const char* name, double bandwidth, double latency,
e_surf_link_sharing_policy_t policy);
simgrid::surf::on_cluster(cluster);
delete cluster->radicals;
}
-void routing_cluster_add_backbone(simgrid::surf::Link* bb) {
+void routing_cluster_add_backbone(simgrid::surf::LinkImpl* bb)
+{
simgrid::kernel::routing::ClusterZone* cluster =
dynamic_cast<simgrid::kernel::routing::ClusterZone*>(current_routing);
xbt_assert(dynamic_cast<simgrid::kernel::routing::ClusterZone*>(current_routing),
"Only hosts from Cluster and Vivaldi ASes can get an host_link.");
- simgrid::surf::Link* linkUp = Link::byName(hostlink->link_up);
- simgrid::surf::Link* linkDown = Link::byName(hostlink->link_down);
+ simgrid::surf::LinkImpl* linkUp = Link::byName(hostlink->link_up);
+ simgrid::surf::LinkImpl* linkDown = Link::byName(hostlink->link_down);
xbt_assert(linkUp, "Link '%s' not found!", hostlink->link_up);
xbt_assert(linkDown, "Link '%s' not found!", hostlink->link_down);
char* surf_parsed_filename = nullptr; // to locate parse error messages
-std::vector<simgrid::surf::Link *> parsed_link_list; /* temporary store of current list link of a route */
+std::vector<simgrid::surf::LinkImpl*> parsed_link_list; /* temporary store of current list link of a route */
+
/*
* Helping functions
*/
void STag_surfxml_link___ctn(){
- simgrid::surf::Link *link;
+ simgrid::surf::LinkImpl* link;
char *link_name=nullptr;
switch (A_surfxml_link___ctn_direction) {
case AU_surfxml_link___ctn_direction: