SimGrid (3.15) UNRELEASED; urgency=low
+ - Rename NetCards to NetPoints.
+ This was intended to help NS3 users, but that's not a netcard.
+ That's a point in the routing algorithm, let's avoid do wrong simplifications.
+
-- target_date=March 20 2017 -- Da SimGrid team <simgrid-devel@lists.gforge.inria.fr>
SimGrid (3.14.159) stable; urgency=low
class ActivityImpl;
}
namespace routing {
- class NetCard;
+ class NetPoint;
}
}
namespace simix {
typedef simgrid::s4u::NetZone simgrid_NetZone;
typedef simgrid::s4u::Host simgrid_Host;
typedef simgrid::kernel::activity::ActivityImpl kernel_Activity;
-typedef simgrid::kernel::routing::NetCard routing_NetCard;
+typedef simgrid::kernel::routing::NetPoint routing_NetPoint;
typedef simgrid::surf::Cpu surf_Cpu;
typedef simgrid::surf::Link Link;
typedef simgrid::surf::Resource surf_Resource;
typedef struct simgrid_Host simgrid_Host;
typedef struct kernel_Activity kernel_Activity;
typedef struct surf_Cpu surf_Cpu;
-typedef struct routing_NetCard routing_NetCard;
+typedef struct routing_NetPoint routing_NetPoint;
typedef struct surf_Resource surf_Resource;
typedef struct Link Link;
typedef struct Trace tmgr_Trace;
typedef kernel_Activity *smx_activity_t;
typedef surf_Cpu *surf_cpu_t;
-typedef routing_NetCard *sg_netcard_t;
+typedef routing_NetPoint* sg_netcard_t;
typedef surf_Resource *sg_resource_t;
// Types which are in fact dictelmt:
*
* Please don't use directly: you should use MC_is_active. */
extern XBT_PUBLIC(int) _sg_do_model_check;
-extern XBT_PUBLIC(int) _sg_mc_visited;
+extern XBT_PUBLIC(int) _sg_mc_max_visited_states;
#define MC_is_active() _sg_do_model_check
-#define MC_visited_reduction() _sg_mc_visited
+#define MC_visited_reduction() _sg_mc_max_visited_states
/** Assertion for the model-checker
*
void setProperty(const char* key, const char* value);
/* Add content to the netzone, at parsing time. It should be sealed afterward. */
- virtual int addComponent(kernel::routing::NetCard * elm); /* A host, a router or a netzone, whatever */
+ virtual int addComponent(kernel::routing::NetPoint * elm); /* A host, a router or a netzone, whatever */
virtual void addRoute(sg_platf_route_cbarg_t route);
virtual void addBypassRoute(sg_platf_route_cbarg_t e_route) = 0;
/*** Called on each newly created regular route (not on bypass routes) */
- static simgrid::xbt::signal<void(bool symmetrical, kernel::routing::NetCard* src, kernel::routing::NetCard* dst,
- kernel::routing::NetCard* gw_src, kernel::routing::NetCard* gw_dst,
+ static simgrid::xbt::signal<void(bool symmetrical, kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst,
+ kernel::routing::NetPoint* gw_src, kernel::routing::NetPoint* gw_dst,
std::vector<Link*>* link_list)>
onRouteCreation;
protected:
- std::vector<kernel::routing::NetCard*>
+ std::vector<kernel::routing::NetPoint*>
vertices_; // our content, as known to our graph routing algorithm (maps vertexId -> vertex)
private:
simgrid::s4u::NetZone* netzoneByNameOrNull(const char* name);
/** @brief Retrieve the netcard of the given name (or nullptr if not found) */
- simgrid::kernel::routing::NetCard* netcardByNameOrNull(const char* name);
- void netcardList(std::vector<simgrid::kernel::routing::NetCard*> * list);
- void netcardRegister(simgrid::kernel::routing::NetCard * card);
- void netcardUnregister(simgrid::kernel::routing::NetCard * card);
+ simgrid::kernel::routing::NetPoint* netcardByNameOrNull(const char* name);
+ void netcardList(std::vector<simgrid::kernel::routing::NetPoint*> * list);
+ void netcardRegister(simgrid::kernel::routing::NetPoint * card);
+ void netcardUnregister(simgrid::kernel::routing::NetPoint * card);
template<class F>
void registerFunction(const char* name)
/** DO NOT USE DIRECTLY (@todo: these should be protected, once our code is clean) */
surf::Cpu *pimpl_cpu = nullptr;
/** DO NOT USE DIRECTLY (@todo: these should be protected, once our code is clean) */
- kernel::routing::NetCard *pimpl_netcard = nullptr;
+ kernel::routing::NetPoint* pimpl_netpoint = nullptr;
public:
/*** Called on each newly created object */
/* SimGrid Lua bindings */
#include "lua_private.h"
-#include "src/kernel/routing/NetCard.hpp"
+#include "src/kernel/routing/NetPoint.hpp"
#include "src/surf/network_interface.hpp"
#include "src/surf/xml/platf_private.hpp"
#include "surf/surf_routing.h"
extern XBT_PRIVATE int _sg_mc_timeout;
extern XBT_PRIVATE int _sg_mc_hash;
extern XBT_PRIVATE int _sg_mc_max_depth;
-extern XBT_PUBLIC(int) _sg_mc_visited;
+extern XBT_PUBLIC(int) _sg_mc_max_visited_states;
extern XBT_PRIVATE char* _sg_mc_dot_output_file;
extern XBT_PUBLIC(int) _sg_mc_comms_determinism;
extern XBT_PUBLIC(int) _sg_mc_send_determinism;
#include "simgrid_config.h"
#include "src/instr/instr_private.h"
-#include "src/kernel/routing/NetCard.hpp"
+#include "src/kernel/routing/NetPoint.hpp"
#include "src/surf/network_interface.hpp"
#include "src/surf/surf_private.h"
#include "surf/surf.h"
//Search for network_element_t
switch (kind){
case INSTR_HOST:
- newContainer->netcard = sg_host->pimpl_netcard;
+ newContainer->netcard = sg_host->pimpl_netpoint;
xbt_assert(newContainer->netcard, "Element '%s' not found",name);
break;
case INSTR_ROUTER:
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "src/kernel/EngineImpl.hpp"
-#include "src/kernel/routing/NetCard.hpp"
+#include "src/kernel/routing/NetPoint.hpp"
#include "src/kernel/routing/NetZoneImpl.hpp"
#include <simgrid/s4u/host.hpp>
EngineImpl::~EngineImpl()
{
delete netRoot_;
- for (auto kv : netcards_)
+ for (auto kv : netpoints_)
delete kv.second;
}
}
namespace kernel {
namespace routing {
class NetZoneImpl;
-class NetCard;
+class NetPoint;
}
class EngineImpl {
kernel::routing::NetZoneImpl* netRoot_ = nullptr;
protected:
- std::unordered_map<std::string,simgrid::kernel::routing::NetCard*> netcards_;
+ std::unordered_map<std::string, simgrid::kernel::routing::NetPoint*> netpoints_;
friend simgrid::s4u::Engine;
};
}
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "src/kernel/routing/ClusterZone.hpp"
-#include "src/kernel/routing/NetCard.hpp"
+#include "src/kernel/routing/NetPoint.hpp"
#include "src/kernel/routing/RoutedZone.hpp"
#include "src/surf/network_interface.hpp"
{
}
-void ClusterZone::getLocalRoute(NetCard* src, NetCard* dst, sg_platf_route_cbarg_t route, double* lat)
+void ClusterZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t route, double* lat)
{
XBT_VERB("cluster getLocalRoute from '%s'[%d] to '%s'[%d]", src->cname(), src->id(), dst->cname(), dst->id());
xbt_assert(!privateLinks_.empty(),
public:
explicit ClusterZone(NetZone* father, const char* name);
- void getLocalRoute(NetCard* src, NetCard* dst, sg_platf_route_cbarg_t into, double* latency) override;
+ void getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t into, double* latency) override;
void getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges) override;
virtual void create_links_for_node(sg_platf_cluster_cbarg_t cluster, int id, int rank, int position);
Link* backbone_ = nullptr;
void* loopback_ = nullptr;
- NetCard* router_ = nullptr;
+ NetPoint* router_ = nullptr;
bool hasLimiter_ = false;
bool hasLoopback_ = false;
unsigned int linkCountPerNode_ = 1; /* may be 1 (if only a private link), 2 or 3 (if limiter and loopback) */
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "src/kernel/routing/DijkstraZone.hpp"
-#include "src/kernel/routing/NetCard.hpp"
+#include "src/kernel/routing/NetPoint.hpp"
#include "src/surf/network_interface.hpp"
#include <float.h>
xbt_graph_new_edge(routeGraph_, src, dst, e_route);
}
-void DijkstraZone::getLocalRoute(NetCard* src, NetCard* dst, sg_platf_route_cbarg_t route, double* lat)
+void DijkstraZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t route, double* lat)
{
getRouteCheckParams(src, dst);
int src_id = src->id();
}
/* compose route path with links */
- NetCard *gw_src = nullptr, *gw_dst, *prev_gw_src, *first_gw = nullptr;
- NetCard *gw_dst_net_elm = nullptr, *prev_gw_src_net_elm = nullptr;
+ NetPoint *gw_src = nullptr, *gw_dst, *prev_gw_src, *first_gw = nullptr;
+ NetPoint *gw_dst_net_elm = nullptr, *prev_gw_src_net_elm = nullptr;
for (int v = dst_node_id; v != src_node_id; v = pred_arr[v]) {
xbt_node_t node_pred_v = xbt_dynar_get_as(nodes, pred_arr[v], xbt_node_t);
void DijkstraZone::addRoute(sg_platf_route_cbarg_t route)
{
- NetCard* src = route->src;
- NetCard* dst = route->dst;
+ NetPoint* src = route->src;
+ NetPoint* dst = route->dst;
const char* srcName = src->name().c_str();
const char* dstName = dst->name().c_str();
route->gw_src->name().c_str());
if (route->gw_dst && route->gw_src) {
- NetCard* gw_tmp = route->gw_src;
+ NetPoint* gw_tmp = route->gw_src;
route->gw_src = route->gw_dst;
route->gw_dst = gw_tmp;
}
* After this function returns, any node in the graph
* will have a loopback attached to it.
*/
- void getLocalRoute(NetCard* src, NetCard* dst, sg_platf_route_cbarg_t route, double* lat) override;
+ void getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t route, double* lat) override;
void addRoute(sg_platf_route_cbarg_t route) override;
xbt_graph_t routeGraph_ = nullptr; /* xbt_graph */
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "src/kernel/routing/DragonflyZone.hpp"
-#include "src/kernel/routing/NetCard.hpp"
+#include "src/kernel/routing/NetPoint.hpp"
#include "src/surf/network_interface.hpp"
#include <boost/algorithm/string/classification.hpp>
}
}
-void DragonflyZone::getLocalRoute(NetCard* src, NetCard* dst, sg_platf_route_cbarg_t route, double* latency)
+void DragonflyZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t route, double* latency)
{
// Minimal routing version.
// TODO : non-minimal random one, and adaptive ?
explicit DragonflyZone(NetZone* father, const char* name);
~DragonflyZone() override;
// void create_links_for_node(sg_platf_cluster_cbarg_t cluster, int id, int rank, int position) override;
- void getLocalRoute(NetCard* src, NetCard* dst, sg_platf_route_cbarg_t into, double* latency) override;
+ void getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t into, double* latency) override;
void parse_specific_arguments(sg_platf_cluster_cbarg_t cluster) override;
void seal() override;
void generateRouters();
EmptyZone::~EmptyZone() = default;
-void EmptyZone::getLocalRoute(NetCard* /*src*/, NetCard* /*dst*/, sg_platf_route_cbarg_t /*res*/, double* /*lat*/)
+void EmptyZone::getLocalRoute(NetPoint* /*src*/, NetPoint* /*dst*/, sg_platf_route_cbarg_t /*res*/, double* /*lat*/)
{
}
explicit EmptyZone(NetZone* father, const char* name);
~EmptyZone() override;
- void getLocalRoute(NetCard* src, NetCard* dst, sg_platf_route_cbarg_t into, double* latency) override;
+ void getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t into, double* latency) override;
void getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges) override;
};
}
#include <sstream>
#include "src/kernel/routing/FatTreeZone.hpp"
-#include "src/kernel/routing/NetCard.hpp"
+#include "src/kernel/routing/NetPoint.hpp"
#include "src/surf/network_interface.hpp"
#include "xbt/lib.h"
return true;
}
-void FatTreeZone::getLocalRoute(NetCard* src, NetCard* dst, sg_platf_route_cbarg_t into, double* latency)
+void FatTreeZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t into, double* latency)
{
if (dst->isRouter() || src->isRouter())
public:
explicit FatTreeZone(NetZone* father, const char* name);
~FatTreeZone() override;
- void getLocalRoute(NetCard* src, NetCard* dst, sg_platf_route_cbarg_t into, double* latency) override;
+ void getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t into, double* latency) override;
/** \brief Generate the fat tree
*
/* 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 "src/kernel/routing/FloydZone.hpp"
-#include "src/kernel/routing/NetCard.hpp"
+#include "src/kernel/routing/NetPoint.hpp"
#include "src/surf/network_interface.hpp"
#include "xbt/log.h"
xbt_free(costTable_);
}
-void FloydZone::getLocalRoute(NetCard* src, NetCard* dst, sg_platf_route_cbarg_t route, double* lat)
+void FloydZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t route, double* lat)
{
size_t table_size = vertices_.size();
route->dst->name().c_str(), route->src->name().c_str());
if (route->gw_dst && route->gw_src) {
- NetCard* gw_tmp = route->gw_src;
+ NetPoint* gw_tmp = route->gw_src;
route->gw_src = route->gw_dst;
route->gw_dst = gw_tmp;
}
explicit FloydZone(NetZone* father, const char* name);
~FloydZone() override;
- void getLocalRoute(NetCard* src, NetCard* dst, sg_platf_route_cbarg_t into, double* latency) override;
+ void getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t into, double* latency) override;
void addRoute(sg_platf_route_cbarg_t route) override;
void seal() override;
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "src/kernel/routing/FullZone.hpp"
-#include "src/kernel/routing/NetCard.hpp"
+#include "src/kernel/routing/NetPoint.hpp"
#include "src/surf/network_interface.hpp"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_full, surf, "Routing part of surf");
}
}
-void FullZone::getLocalRoute(NetCard* src, NetCard* dst, sg_platf_route_cbarg_t res, double* lat)
+void FullZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t res, double* lat)
{
XBT_DEBUG("full getLocalRoute from %s[%d] to %s[%d]", src->cname(), src->id(), dst->cname(), dst->id());
void FullZone::addRoute(sg_platf_route_cbarg_t route)
{
- NetCard* src = route->src;
- NetCard* dst = route->dst;
+ NetPoint* src = route->src;
+ NetPoint* dst = route->dst;
addRouteCheckParams(route);
size_t table_size = vertices_.size();
if (route->symmetrical == true && src != dst) {
if (route->gw_dst && route->gw_src) {
- NetCard* gw_tmp = route->gw_src;
+ NetPoint* gw_tmp = route->gw_src;
route->gw_src = route->gw_dst;
route->gw_dst = gw_tmp;
}
void seal() override;
~FullZone() override;
- void getLocalRoute(NetCard* src, NetCard* dst, sg_platf_route_cbarg_t into, double* latency) override;
+ void getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t into, double* latency) override;
void addRoute(sg_platf_route_cbarg_t route) override;
sg_platf_route_cbarg_t* routingTable_ = nullptr;
/* 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 "src/kernel/routing/NetCard.hpp"
+#include "src/kernel/routing/NetPoint.hpp"
+
#include "simgrid/s4u/engine.hpp"
#include "simgrid/s4u/host.hpp"
#include "surf/surf_routing.h"
namespace kernel {
namespace routing {
-simgrid::xbt::signal<void(NetCard*)> NetCard::onCreation;
+simgrid::xbt::signal<void(NetPoint*)> NetPoint::onCreation;
-NetCard::NetCard(std::string name, NetCard::Type componentType, NetZoneImpl* netzone_p)
+NetPoint::NetPoint(std::string name, NetPoint::Type componentType, NetZoneImpl* netzone_p)
: name_(name), componentType_(componentType), netzone_(netzone_p)
{
if (netzone_p != nullptr)
id_ = netzone_p->addComponent(this);
simgrid::s4u::Engine::instance()->netcardRegister(this);
- simgrid::kernel::routing::NetCard::onCreation(this);
+ simgrid::kernel::routing::NetPoint::onCreation(this);
}
}
}
*
* Netcards are the thing that connect host or routers to the network
*/
-simgrid::kernel::routing::NetCard* sg_netcard_by_name_or_null(const char* name)
+simgrid::kernel::routing::NetPoint* sg_netcard_by_name_or_null(const char* name)
{
return simgrid::s4u::Engine::instance()->netcardByNameOrNull(name);
}
/** @ingroup ROUTING_API
* @brief Network cards are the vertices in the graph representing the network, used to compute paths between nodes.
*
- * @details This represents a position in the network. One can send information between two netcards
+ * @details This represents a position in the network. One can send information between two netpoints
*/
-class NetCard : public simgrid::xbt::Extendable<NetCard> {
+class NetPoint : public simgrid::xbt::Extendable<NetPoint> {
public:
enum class Type { Host, Router, NetZone };
- NetCard(std::string name, NetCard::Type componentType, NetZoneImpl* netzone_p);
- ~NetCard() = default;
+ NetPoint(std::string name, NetPoint::Type componentType, NetZoneImpl* netzone_p);
+ ~NetPoint() = default;
// Our rank in the vertices_ array of the netzone that contains us.
unsigned int id() { return id_; }
bool isHost() { return componentType_ == Type::Host; }
bool isRouter() { return componentType_ == Type::Router; }
- static simgrid::xbt::signal<void(NetCard*)> onCreation;
+ static simgrid::xbt::signal<void(NetPoint*)> onCreation;
- bool operator<(const NetCard &rhs) const { return name_ < rhs.name_; }
+ bool operator<(const NetPoint& rhs) const { return name_ < rhs.name_; }
private:
unsigned int id_;
std::string name_;
- NetCard::Type componentType_;
+ NetPoint::Type componentType_;
NetZoneImpl* netzone_;
};
}
#include "src/kernel/routing/NetZoneImpl.hpp"
#include "simgrid/s4u/engine.hpp"
#include "simgrid/s4u/host.hpp"
-#include "src/kernel/routing/NetCard.hpp"
+#include "src/kernel/routing/NetPoint.hpp"
#include "src/surf/cpu_interface.hpp"
#include "src/surf/network_interface.hpp"
class BypassRoute {
public:
- explicit BypassRoute(NetCard* gwSrc, NetCard* gwDst) : gw_src(gwSrc), gw_dst(gwDst) {}
- const NetCard* gw_src;
- const NetCard* gw_dst;
+ explicit BypassRoute(NetPoint* gwSrc, NetPoint* gwDst) : gw_src(gwSrc), gw_dst(gwDst) {}
+ const NetPoint* gw_src;
+ const NetPoint* gw_dst;
std::vector<Link*> links;
};
xbt_assert(nullptr == simgrid::s4u::Engine::instance()->netcardByNameOrNull(name),
"Refusing to create a second NetZone called '%s'.", name);
- netcard_ = new NetCard(name, NetCard::Type::NetZone, static_cast<NetZoneImpl*>(father));
+ netcard_ = new NetPoint(name, NetPoint::Type::NetZone, static_cast<NetZoneImpl*>(father));
XBT_DEBUG("NetZone '%s' created with the id '%d'", name, netcard_->id());
}
NetZoneImpl::~NetZoneImpl()
if (hierarchy_ == RoutingMode::unset)
hierarchy_ = RoutingMode::base;
- res->pimpl_netcard = new NetCard(name, NetCard::Type::Host, this);
+ res->pimpl_netpoint = new NetPoint(name, NetPoint::Type::Host, this);
surf_cpu_model_pm->createCpu(res, speedPerPstate, coreAmount);
* dst
* @endverbatim
*/
-static void find_common_ancestors(NetCard* src, NetCard* dst,
+static void find_common_ancestors(NetPoint* src, NetPoint* dst,
/* OUT */ NetZoneImpl** common_ancestor, NetZoneImpl** src_ancestor,
NetZoneImpl** dst_ancestor)
{
}
/* PRECONDITION: this is the common ancestor of src and dst */
-bool NetZoneImpl::getBypassRoute(routing::NetCard* src, routing::NetCard* dst,
+bool NetZoneImpl::getBypassRoute(routing::NetPoint* src, routing::NetPoint* dst,
/* OUT */ std::vector<surf::Link*>* links, double* latency)
{
// If never set a bypass route return nullptr without any further computations
/* (3) Search for a bypass making the path up to the ancestor useless */
BypassRoute* bypassedRoute = nullptr;
- std::pair<kernel::routing::NetCard*, kernel::routing::NetCard*> key;
+ std::pair<kernel::routing::NetPoint*, kernel::routing::NetPoint*> key;
for (int max = 0; max <= max_index; max++) {
for (int i = 0; i < max; i++) {
if (i <= max_index_src && max <= max_index_dst) {
"calls to getRoute",
src->cname(), dst->cname(), bypassedRoute->links.size());
if (src != key.first)
- getGlobalRoute(src, const_cast<NetCard*>(bypassedRoute->gw_src), links, latency);
+ getGlobalRoute(src, const_cast<NetPoint*>(bypassedRoute->gw_src), links, latency);
for (surf::Link* link : bypassedRoute->links) {
links->push_back(link);
if (latency)
*latency += link->latency();
}
if (dst != key.second)
- getGlobalRoute(const_cast<NetCard*>(bypassedRoute->gw_dst), dst, links, latency);
+ getGlobalRoute(const_cast<NetPoint*>(bypassedRoute->gw_dst), dst, links, latency);
return true;
}
XBT_DEBUG("No bypass route from '%s' to '%s'.", src->cname(), dst->cname());
return false;
}
-void NetZoneImpl::getGlobalRoute(routing::NetCard* src, routing::NetCard* dst,
+void NetZoneImpl::getGlobalRoute(routing::NetPoint* src, routing::NetPoint* dst,
/* OUT */ std::vector<surf::Link*>* links, double* latency)
{
s_sg_platf_route_cbarg_t route;
* @param into Container into which the traversed links and gateway informations should be pushed
* @param latency Accumulator in which the latencies should be added (caller must set it to 0)
*/
- virtual void getLocalRoute(NetCard * src, NetCard * dst, sg_platf_route_cbarg_t into, double* latency) = 0;
+ virtual void getLocalRoute(NetPoint * src, NetPoint * dst, sg_platf_route_cbarg_t into, double* latency) = 0;
/** @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::NetCard * src, routing::NetCard * dst,
+ bool getBypassRoute(routing::NetPoint * src, routing::NetPoint * dst,
/* OUT */ std::vector<surf::Link*> * links, double* latency);
public:
* @param links Accumulator in which all traversed links should be pushed (caller must empty it)
* @param latency Accumulator in which the latencies should be added (caller must set it to 0)
*/
- static void getGlobalRoute(routing::NetCard * src, routing::NetCard * dst,
+ static void getGlobalRoute(routing::NetPoint * src, routing::NetPoint * dst,
/* OUT */ std::vector<surf::Link*> * links, double* latency);
virtual void getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges) = 0;
RoutingMode hierarchy_ = RoutingMode::unset;
private:
- std::map<std::pair<NetCard*, NetCard*>, BypassRoute*> bypassRoutes_; // src x dst -> route
- routing::NetCard* netcard_ = nullptr; // Our representative in the father NetZone
+ std::map<std::pair<NetPoint*, NetPoint*>, BypassRoute*> bypassRoutes_; // src x dst -> route
+ routing::NetPoint* netcard_ = nullptr; // Our representative in the father NetZone
};
}
}
#include "xbt/log.h"
#include "xbt/sysdep.h"
-#include "src/kernel/routing/NetCard.hpp"
+#include "src/kernel/routing/NetPoint.hpp"
#include "src/kernel/routing/RoutedZone.hpp"
#include "src/surf/network_interface.hpp"
return result;
}
-void RoutedZone::getRouteCheckParams(NetCard* src, NetCard* dst)
+void RoutedZone::getRouteCheckParams(NetPoint* src, NetPoint* dst)
{
xbt_assert(src, "Cannot find a route from nullptr to %s", dst->cname());
xbt_assert(dst, "Cannot find a route from %s to nullptr", src->cname());
}
void RoutedZone::addRouteCheckParams(sg_platf_route_cbarg_t route)
{
- NetCard* src = route->src;
- NetCard* dst = route->dst;
+ NetPoint* src = route->src;
+ NetPoint* dst = route->dst;
const char* srcName = src->cname();
const char* dstName = dst->cname();
bool change_order);
protected:
- void getRouteCheckParams(NetCard* src, NetCard* dst);
+ void getRouteCheckParams(NetPoint* src, NetPoint* dst);
void addRouteCheckParams(sg_platf_route_cbarg_t route);
};
}
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "src/kernel/routing/TorusZone.hpp"
-#include "src/kernel/routing/NetCard.hpp"
-
+#include "src/kernel/routing/NetPoint.hpp"
#include "src/surf/network_interface.hpp"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_cluster_torus, surf_route_cluster, "Torus Routing part of surf");
xbt_dynar_free(&dimensions);
}
-void TorusZone::getLocalRoute(NetCard* src, NetCard* dst, sg_platf_route_cbarg_t route, double* lat)
+void TorusZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t route, double* lat)
{
XBT_VERB("torus getLocalRoute from '%s'[%d] to '%s'[%d]", src->name().c_str(), src->id(), dst->name().c_str(),
explicit TorusZone(NetZone* father, const char* name);
~TorusZone() override;
void create_links_for_node(sg_platf_cluster_cbarg_t cluster, int id, int rank, int position) override;
- void getLocalRoute(NetCard* src, NetCard* dst, sg_platf_route_cbarg_t into, double* latency) override;
+ void getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t into, double* latency) override;
void parse_specific_arguments(sg_platf_cluster_cbarg_t cluster) override;
private:
#include "simgrid/s4u/engine.hpp"
#include "simgrid/s4u/host.hpp"
-#include "src/kernel/routing/NetCard.hpp"
+#include "src/kernel/routing/NetPoint.hpp"
#include "src/kernel/routing/VivaldiZone.hpp"
#include "src/surf/network_interface.hpp"
namespace kernel {
namespace routing {
namespace vivaldi {
-simgrid::xbt::Extension<NetCard, Coords> Coords::EXTENSION_ID;
+simgrid::xbt::Extension<NetPoint, Coords> Coords::EXTENSION_ID;
-Coords::Coords(NetCard* netcard, const char* coordStr)
+Coords::Coords(NetPoint* netcard, const char* coordStr)
{
if (!Coords::EXTENSION_ID.valid())
- Coords::EXTENSION_ID = NetCard::extension_create<Coords>();
+ Coords::EXTENSION_ID = NetPoint::extension_create<Coords>();
std::vector<std::string> string_values;
boost::split(string_values, coordStr, boost::is_any_of(" "));
return (src_coord - dst_coord) * (src_coord - dst_coord);
}
-static std::vector<double>* getCoordsFromNetcard(NetCard* nc)
+static std::vector<double>* getCoordsFromNetcard(NetPoint* nc)
{
simgrid::kernel::routing::vivaldi::Coords* coords = nc->extension<simgrid::kernel::routing::vivaldi::Coords>();
xbt_assert(coords, "Please specify the Vivaldi coordinates of %s %s (%p)",
{
}
-void VivaldiZone::setPeerLink(NetCard* netcard, double bw_in, double bw_out, const char* coord)
+void VivaldiZone::setPeerLink(NetPoint* netcard, double bw_in, double bw_out, const char* coord)
{
xbt_assert(netcard->netzone() == this, "Cannot add a peer link to a netcard that is not in this netzone");
privateLinks_.insert({netcard->id(), {linkUp, linkDown}});
}
-void VivaldiZone::getLocalRoute(NetCard* src, NetCard* dst, sg_platf_route_cbarg_t route, double* lat)
+void VivaldiZone::getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t route, double* lat)
{
XBT_DEBUG("vivaldi getLocalRoute from '%s'[%d] '%s'[%d]", src->cname(), src->id(), dst->cname(), dst->id());
public:
explicit VivaldiZone(NetZone* father, const char* name);
- void setPeerLink(NetCard* netcard, double bw_in, double bw_out, const char* coord);
- void getLocalRoute(NetCard* src, NetCard* dst, sg_platf_route_cbarg_t into, double* latency) override;
+ void setPeerLink(NetPoint* netcard, double bw_in, double bw_out, const char* coord);
+ void getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t into, double* latency) override;
};
namespace vivaldi {
class XBT_PRIVATE Coords {
public:
- static simgrid::xbt::Extension<NetCard, Coords> EXTENSION_ID;
- explicit Coords(NetCard* host, const char* str);
+ static simgrid::xbt::Extension<NetPoint, Coords> EXTENSION_ID;
+ explicit Coords(NetPoint* host, const char* str);
virtual ~Coords();
std::vector<double> coords;
this->refresh_heap();
return this->heap.get();
}
- malloc_info* get_malloc_info()
+ const malloc_info* get_malloc_info()
{
if (!(this->cache_flags_ & Process::cache_malloc))
this->refresh_malloc_info();
void VisitedStates::prune()
{
- while (states_.size() > (std::size_t) _sg_mc_visited) {
+ while (states_.size() > (std::size_t)_sg_mc_max_visited_states) {
XBT_DEBUG("Try to remove visited state (maximum number of stored states reached)");
auto min_element = boost::range::min_element(states_,
[](std::unique_ptr<simgrid::mc::VisitedState>& a, std::unique_ptr<simgrid::mc::VisitedState>& b) {
bool compare_snapshots = all_communications_are_finished()
&& this->initial_communications_pattern_done;
- if (_sg_mc_visited == 0
- || (visited_state = visitedStates_.addVisitedState(
- expandedStatesCount_, next_state.get(), compare_snapshots)) == nullptr) {
+ if (_sg_mc_max_visited_states == 0 ||
+ (visited_state = visitedStates_.addVisitedState(expandedStatesCount_, next_state.get(), compare_snapshots)) ==
+ nullptr) {
/* Get enabled actors and insert them in the interleave set of the next state */
for (auto& actor : mc_model_checker->process().actors())
*/
int LivenessChecker::insertVisitedPair(std::shared_ptr<VisitedPair> visited_pair, simgrid::mc::Pair* pair)
{
- if (_sg_mc_visited == 0)
+ if (_sg_mc_max_visited_states == 0)
return -1;
if (visited_pair == nullptr)
void LivenessChecker::purgeVisitedPairs()
{
- if (_sg_mc_visited != 0 && visitedPairs_.size() > (std::size_t) _sg_mc_visited) {
+ if (_sg_mc_max_visited_states != 0 && visitedPairs_.size() > (std::size_t)_sg_mc_max_visited_states) {
// Remove the oldest entry with a linear search:
visitedPairs_.erase(boost::min_element(visitedPairs_,
[](std::shared_ptr<VisitedPair> const a, std::shared_ptr<VisitedPair> const& b) {
this->checkNonTermination(next_state.get());
/* Check whether we already explored next_state in the past (but only if interested in state-equality reduction) */
- if (_sg_mc_visited == true)
+ if (_sg_mc_max_visited_states == true)
visitedState_ = visitedStates_.addVisitedState(expandedStatesCount_, next_state.get(), true);
/* If this is a new state (or if we don't care about state-equality reduction) */
#if HAVE_MC
// Fetch from MCed memory:
// HACK, type puning
- simgrid::mc::Remote<simgrid::kernel::activity::Comm> temp_comm;
if (mc_model_checker != nullptr) {
+ simgrid::mc::Remote<simgrid::kernel::activity::Comm> temp_comm;
mc_model_checker->process().read(temp_comm, remote(act));
act = static_cast<simgrid::kernel::activity::Comm*>(temp_comm.getBuffer());
}
snapshot->to_ignore = mc_model_checker->process().ignored_heap();
- if (_sg_mc_visited > 0 || strcmp(_sg_mc_property_file, "")) {
+ if (_sg_mc_max_visited_states > 0 || strcmp(_sg_mc_property_file, "")) {
snapshot->stacks = take_snapshot_stacks(snapshot.get());
if (_sg_mc_hash)
snapshot->hash = simgrid::mc::hash(*snapshot);
char *_sg_mc_property_file = nullptr;
int _sg_mc_hash = 0;
int _sg_mc_max_depth = 1000;
-int _sg_mc_visited = 0;
+int _sg_mc_max_visited_states = 0;
char *_sg_mc_dot_output_file = nullptr;
int _sg_mc_comms_determinism = 0;
int _sg_mc_send_determinism = 0;
xbt_die
("You are specifying a number of stored visited states after the initialization (through MSG_config?), but model-checking was not activated at config time (through bu the program was not runned under the model-checker (with simgrid-mc)). This won't work, sorry.");
- _sg_mc_visited = xbt_cfg_get_int(name);
+ _sg_mc_max_visited_states = xbt_cfg_get_int(name);
}
void _mc_cfg_cb_dot_output(const char *name)
if (!req)
return nullptr;
- // Fetch the data of the request and translate it:
-
state->transition.pid = process->pid;
-
state->executed_req = *req;
+ // Fetch the data of the request and translate it:
+ state->internal_req = *req;
/* The waitany and testany request are transformed into a wait or test request
* over the corresponding communication action so it can be treated later by
switch (req->call) {
case SIMCALL_COMM_WAITANY: {
state->internal_req.call = SIMCALL_COMM_WAIT;
- state->internal_req.issuer = req->issuer;
smx_activity_t remote_comm;
read_element(mc_model_checker->process(),
&remote_comm, remote(simcall_comm_waitany__get__comms(req)),
case SIMCALL_COMM_TESTANY:
state->internal_req.call = SIMCALL_COMM_TEST;
- state->internal_req.issuer = req->issuer;
if (state->transition.argument > 0) {
smx_activity_t remote_comm = mc_model_checker->process().read(
break;
case SIMCALL_COMM_WAIT:
- state->internal_req = *req;
mc_model_checker->process().read_bytes(&state->internal_comm ,
sizeof(state->internal_comm), remote(simcall_comm_wait__get__comm(req)));
simcall_comm_wait__set__comm(&state->executed_req, state->internal_comm.getBuffer());
break;
case SIMCALL_COMM_TEST:
- state->internal_req = *req;
mc_model_checker->process().read_bytes(&state->internal_comm,
sizeof(state->internal_comm), remote(simcall_comm_test__get__comm(req)));
simcall_comm_test__set__comm(&state->executed_req, state->internal_comm.getBuffer());
break;
default:
- state->internal_req = *req;
+ /* No translation needed */
break;
}
const char* pm_name_dst = destination->cname();
/* update net_elm with that of the destination physical host */
- piface_->pimpl_netcard = destination->pimpl_netcard;
+ piface_->pimpl_netpoint = destination->pimpl_netpoint;
hostPM_ = destination;
pimpl_vm_ = new vm::VirtualMachineImpl(this, pm);
/* Currently, a VM uses the network resource of its physical host */
- pimpl_netcard = pm->pimpl_netcard;
+ pimpl_netpoint = pm->pimpl_netpoint;
// Create a VCPU for this VM
surf::CpuCas01* sub_cpu = dynamic_cast<surf::CpuCas01*>(pm->pimpl_cpu);
extension_set<simgrid::simix::Host>(nullptr);
/* Don't free these things twice: they are the ones of my physical host */
- pimpl_netcard = nullptr;
+ pimpl_netpoint = nullptr;
}
bool VirtualMachine::isMigrating()
#include "simgrid/s4u/storage.hpp"
#include "simgrid/simix.h"
#include "src/kernel/EngineImpl.hpp"
+#include "src/kernel/routing/NetPoint.hpp"
#include "src/kernel/routing/NetZoneImpl.hpp"
-#include "src/kernel/routing/NetCard.hpp"
-
-
#include "src/surf/network_interface.hpp"
#include "surf/surf.h" // routing_platf. FIXME:KILLME. SOON
}
/** @brief Retrieve the netcard of the given name (or nullptr if not found) */
-simgrid::kernel::routing::NetCard* Engine::netcardByNameOrNull(const char* name)
+simgrid::kernel::routing::NetPoint* Engine::netcardByNameOrNull(const char* name)
{
- if (pimpl->netcards_.find(name) == pimpl->netcards_.end())
+ if (pimpl->netpoints_.find(name) == pimpl->netpoints_.end())
return nullptr;
- return pimpl->netcards_.at(name);
+ return pimpl->netpoints_.at(name);
}
/** @brief Fill the provided vector with all existing netcards */
-void Engine::netcardList(std::vector<simgrid::kernel::routing::NetCard*>* list)
+void Engine::netcardList(std::vector<simgrid::kernel::routing::NetPoint*>* list)
{
- for (auto kv: pimpl->netcards_)
+ for (auto kv : pimpl->netpoints_)
list->push_back(kv.second);
}
/** @brief Register a new netcard to the system */
-void Engine::netcardRegister(simgrid::kernel::routing::NetCard* card)
+void Engine::netcardRegister(simgrid::kernel::routing::NetPoint* card)
{
// simgrid::simix::kernelImmediate([&]{ FIXME: this segfaults in set_thread
- pimpl->netcards_[card->name()] = card;
+pimpl->netpoints_[card->name()] = card;
// });
}
/** @brief Unregister a given netcard */
-void Engine::netcardUnregister(simgrid::kernel::routing::NetCard* card)
+void Engine::netcardUnregister(simgrid::kernel::routing::NetPoint* card)
{
- simgrid::simix::kernelImmediate([&]{
- pimpl->netcards_.erase(card->name());
- delete card;
+ simgrid::simix::kernelImmediate([&] {
+ pimpl->netpoints_.erase(card->name());
+ delete card;
});
}
}
#include "simgrid/s4u/host.hpp"
#include "simgrid/s4u/storage.hpp"
#include "simgrid/simix.hpp"
-#include "src/kernel/routing/NetCard.hpp"
+#include "src/kernel/routing/NetPoint.hpp"
#include "src/msg/msg_private.h"
#include "src/simix/ActorImpl.hpp"
#include "src/simix/smx_private.h"
xbt_assert(currentlyDestroying_, "Please call h->destroy() instead of manually deleting it.");
delete pimpl_;
- if (pimpl_netcard != nullptr) // not removed yet by a children class
- simgrid::s4u::Engine::instance()->netcardUnregister(pimpl_netcard);
+ if (pimpl_netpoint != nullptr) // not removed yet by a children class
+ simgrid::s4u::Engine::instance()->netcardUnregister(pimpl_netpoint);
delete pimpl_cpu;
delete mounts;
}
*/
void Host::routeTo(Host* dest, std::vector<Link*>* links, double* latency)
{
- simgrid::kernel::routing::NetZoneImpl::getGlobalRoute(pimpl_netcard, dest->pimpl_netcard, links, latency);
+ simgrid::kernel::routing::NetZoneImpl::getGlobalRoute(pimpl_netpoint, dest->pimpl_netpoint, links, latency);
if (XBT_LOG_ISENABLED(surf_route, xbt_log_priority_debug)) {
XBT_CDEBUG(surf_route, "Route from '%s' to '%s' (latency: %f):", cname(), dest->cname(),
(latency == nullptr ? -1 : *latency));
#include "simgrid/s4u/NetZone.hpp"
#include "simgrid/s4u/host.hpp"
#include "simgrid/simix.hpp"
-#include "src/kernel/routing/NetCard.hpp"
+#include "src/kernel/routing/NetPoint.hpp"
#include "src/surf/network_interface.hpp" // Link FIXME: move to proper header
XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_netzone, "S4U Networking Zones");
namespace simgrid {
namespace s4u {
-simgrid::xbt::signal<void(bool symmetrical, kernel::routing::NetCard* src, kernel::routing::NetCard* dst,
- kernel::routing::NetCard* gw_src, kernel::routing::NetCard* gw_dst,
+simgrid::xbt::signal<void(bool symmetrical, kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst,
+ kernel::routing::NetPoint* gw_src, kernel::routing::NetPoint* gw_dst,
std::vector<Link*>* link_list)>
NetZone::onRouteCreation;
return res;
}
-int NetZone::addComponent(kernel::routing::NetCard* elm)
+int NetZone::addComponent(kernel::routing::NetPoint* elm)
{
vertices_.push_back(elm);
return vertices_.size() - 1; // The rank of the newly created object
#include <xbt/Extendable.hpp>
#include <simgrid/s4u/host.hpp>
-#include "src/kernel/routing/NetCard.hpp"
+#include "src/kernel/routing/NetPoint.hpp"
#include "src/surf/HostImpl.hpp"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(sg_host, sd, "Logging specific to sg_hosts");
for (auto kv : host_list) {
simgrid::s4u::Host* host = kv.second;
- if (host && host->pimpl_netcard && host->pimpl_netcard->isHost())
- xbt_dynar_push(res, &host);
+ if (host && host->pimpl_netpoint && host->pimpl_netpoint->isHost())
+ xbt_dynar_push(res, &host);
}
xbt_dynar_sort(res, hostcmp_voidp);
return res;
#include "simgrid/sg_config.h"
#include "src/instr/instr_private.h" // TRACE_is_enabled(). FIXME: remove by subscribing tracing to the surf signals
-#include "src/kernel/routing/NetCard.hpp"
+#include "src/kernel/routing/NetPoint.hpp"
#include "src/surf/HostImpl.hpp"
#include "src/surf/surf_private.h"
static int number_of_networks = 1;
static int port_number = 1025; //Port number is limited from 1025 to 65 000
-simgrid::xbt::Extension<simgrid::kernel::routing::NetCard, NetCardNs3> NetCardNs3::EXTENSION_ID;
+simgrid::xbt::Extension<simgrid::kernel::routing::NetPoint, NetCardNs3> NetCardNs3::EXTENSION_ID;
NetCardNs3::NetCardNs3()
{
* Callbacks *
*************/
-static void netcardCreation_cb(simgrid::kernel::routing::NetCard* netcard)
+static void netcardCreation_cb(simgrid::kernel::routing::NetPoint* netcard)
{
netcard->extension_set<NetCardNs3>(new NetCardNs3());
}
// Create private link
char* host_id = bprintf("%s%d%s", cluster->prefix, i, cluster->suffix);
- NetCardNs3* host_src = sg_host_by_name(host_id)->pimpl_netcard->extension<NetCardNs3>();
+ NetCardNs3* host_src = sg_host_by_name(host_id)->pimpl_netpoint->extension<NetCardNs3>();
xbt_assert(host_src, "Cannot find a NS3 host of name %s", host_id);
ns3_add_link(host_src->node_num, host_dst->node_num, bw,lat);
xbt_free(bw);
}
-static void routeCreation_cb(bool symmetrical, simgrid::kernel::routing::NetCard* src,
- simgrid::kernel::routing::NetCard* dst, simgrid::kernel::routing::NetCard* gw_src,
- simgrid::kernel::routing::NetCard* gw_dst, std::vector<Link*>* link_list)
+static void routeCreation_cb(bool symmetrical, simgrid::kernel::routing::NetPoint* src,
+ simgrid::kernel::routing::NetPoint* dst, simgrid::kernel::routing::NetPoint* gw_src,
+ simgrid::kernel::routing::NetPoint* gw_dst, std::vector<Link*>* link_list)
{
if (link_list->size() == 1) {
simgrid::surf::LinkNS3* link = static_cast<simgrid::surf::LinkNS3*>(link_list->at(0));
namespace surf {
NetworkNS3Model::NetworkNS3Model() : NetworkModel() {
- NetCardNs3::EXTENSION_ID = simgrid::kernel::routing::NetCard::extension_create<NetCardNs3>();
+ NetCardNs3::EXTENSION_ID = simgrid::kernel::routing::NetPoint::extension_create<NetCardNs3>();
ns3_initialize(ns3_tcp_model.get().c_str());
- simgrid::kernel::routing::NetCard::onCreation.connect(&netcardCreation_cb);
+ simgrid::kernel::routing::NetPoint::onCreation.connect(&netcardCreation_cb);
simgrid::surf::on_cluster.connect(&clusterCreation_cb);
simgrid::surf::on_postparse.connect(&postparse_cb);
simgrid::s4u::NetZone::onRouteCreation.connect(&routeCreation_cb);
void ns3_create_flow(simgrid::s4u::Host* src, simgrid::s4u::Host* dst, double startTime, u_int32_t TotalBytes,
simgrid::surf::NetworkNS3Action* action)
{
- int node1 = src->pimpl_netcard->extension<NetCardNs3>()->node_num;
- int node2 = dst->pimpl_netcard->extension<NetCardNs3>()->node_num;
+ int node1 = src->pimpl_netpoint->extension<NetCardNs3>()->node_num;
+ int node2 = dst->pimpl_netpoint->extension<NetCardNs3>()->node_num;
ns3::Ptr<ns3::Node> src_node = nodes.Get(node1);
ns3::Ptr<ns3::Node> dst_node = nodes.Get(node2);
class NetCardNs3 {
public:
- static simgrid::xbt::Extension<simgrid::kernel::routing::NetCard, NetCardNs3> EXTENSION_ID;
+ static simgrid::xbt::Extension<simgrid::kernel::routing::NetPoint, NetCardNs3> EXTENSION_ID;
explicit NetCardNs3();
int node_num;
#include "src/kernel/routing/FatTreeZone.hpp"
#include "src/kernel/routing/FloydZone.hpp"
#include "src/kernel/routing/FullZone.hpp"
-#include "src/kernel/routing/NetCard.hpp"
+#include "src/kernel/routing/NetPoint.hpp"
#include "src/kernel/routing/NetZoneImpl.hpp"
#include "src/kernel/routing/TorusZone.hpp"
#include "src/kernel/routing/VivaldiZone.hpp"
if (args->pstate != 0)
host->pimpl_cpu->setPState(args->pstate);
if (args->coord && strcmp(args->coord, ""))
- new simgrid::kernel::routing::vivaldi::Coords(host->pimpl_netcard, args->coord);
+ new simgrid::kernel::routing::vivaldi::Coords(host->pimpl_netpoint, args->coord);
if (TRACE_is_enabled() && TRACE_needs_platform())
sg_instr_new_host(*host);
}
/** @brief Add a "router" to the network element list */
-simgrid::kernel::routing::NetCard* sg_platf_new_router(const char* name, const char* coords)
+simgrid::kernel::routing::NetPoint* sg_platf_new_router(const char* name, const char* coords)
{
simgrid::kernel::routing::NetZoneImpl* current_routing = routing_get_current();
xbt_assert(nullptr == simgrid::s4u::Engine::instance()->netcardByNameOrNull(name),
"Refusing to create a router named '%s': this name already describes a node.", name);
- simgrid::kernel::routing::NetCard* netcard =
- new simgrid::kernel::routing::NetCard(name, simgrid::kernel::routing::NetCard::Type::Router, current_routing);
+ simgrid::kernel::routing::NetPoint* netcard =
+ new simgrid::kernel::routing::NetPoint(name, simgrid::kernel::routing::NetPoint::Type::Router, current_routing);
XBT_DEBUG("Router '%s' has the id %d", name, netcard->id());
if (coords && strcmp(coords, ""))
speedPerPstate.push_back(peer->speed);
simgrid::s4u::Host* host = as->createHost(peer->id, &speedPerPstate, 1, nullptr);
- as->setPeerLink(host->pimpl_netcard, peer->bw_in, peer->bw_out, peer->coord);
+ as->setPeerLink(host->pimpl_netpoint, peer->bw_in, peer->bw_out, peer->coord);
/* Change from the defaults */
if (peer->state_trace)
/** @brief Add a link connecting an host to the rest of its AS (which must be cluster or vivaldi) */
void sg_platf_new_hostlink(sg_platf_host_link_cbarg_t hostlink)
{
- simgrid::kernel::routing::NetCard *netcard = sg_host_by_name(hostlink->id)->pimpl_netcard;
+ simgrid::kernel::routing::NetPoint* netcard = sg_host_by_name(hostlink->id)->pimpl_netpoint;
xbt_assert(netcard, "Host '%s' not found!", hostlink->id);
xbt_assert(dynamic_cast<simgrid::kernel::routing::ClusterZone*>(current_routing),
"Only hosts from Cluster and Vivaldi ASes can get an host_link.");
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "storage_n11.hpp"
-#include "src/kernel/routing/NetCard.hpp"
+#include "src/kernel/routing/NetPoint.hpp"
#include "surf_private.h"
#include <math.h> /*ceil*/
+
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_storage);
/*************
if (xbt_lib_get_level(xbt_lib_get_elm_or_null(storage_lib, key), SURF_STORAGE_LEVEL) != nullptr) {
simgrid::surf::Storage* storage =
static_cast<simgrid::surf::Storage*>(xbt_lib_get_or_null(storage_lib, key, SURF_STORAGE_LEVEL));
- simgrid::kernel::routing::NetCard* host_elm = sg_netcard_by_name_or_null(storage->attach_);
+ simgrid::kernel::routing::NetPoint* host_elm = sg_netcard_by_name_or_null(storage->attach_);
if (!host_elm)
surf_parse_error("Unable to attach storage %s: host %s does not exist.", storage->getName(), storage->attach_);
}
#include "simgrid/sg_config.h"
#include "src/instr/instr_private.h" // TRACE_is_enabled(). FIXME: remove by subscribing tracing to the surf signals
#include "src/internal_config.h"
-#include "src/kernel/routing/NetCard.hpp"
+#include "src/kernel/routing/NetPoint.hpp"
#include "src/simix/smx_host_private.h"
#include "src/surf/HostImpl.hpp"
#include "surf_private.h"
XBT_PUBLIC(void) sg_platf_new_host (sg_platf_host_cbarg_t host); // Add an host to the currently described AS
XBT_PUBLIC(void) sg_platf_new_hostlink(sg_platf_host_link_cbarg_t h); // Add an host_link to the currently described AS
-XBT_PUBLIC(simgrid::kernel::routing::NetCard*)
+XBT_PUBLIC(simgrid::kernel::routing::NetPoint*)
sg_platf_new_router(const char* name, const char* coords); // Add a router to the currently described AS
XBT_PUBLIC(void) sg_platf_new_link (sg_platf_link_cbarg_t link); // Add a link to the currently described AS
XBT_PUBLIC(void) sg_platf_new_peer (sg_platf_peer_cbarg_t peer); // Add a peer to the currently described AS
#include "simgrid/link.h"
#include "simgrid/s4u/engine.hpp"
#include "simgrid/sg_config.h"
-#include "src/kernel/routing/NetCard.hpp"
+#include "src/kernel/routing/NetPoint.hpp"
#include "src/surf/network_interface.hpp"
#include "src/surf/surf_private.h"
#include "xbt/dict.h"
#include <simgrid/simdag.h>
-#include "src/kernel/routing/NetCard.hpp"
+#include "src/kernel/routing/NetPoint.hpp"
#include "src/surf/network_interface.hpp"
create_environment(parse_time, platformFile);
- std::vector<simgrid::kernel::routing::NetCard*> netcardList;
+ std::vector<simgrid::kernel::routing::NetPoint*> netcardList;
simgrid::s4u::Engine::instance()->netcardList(&netcardList);
std::sort(netcardList.begin(), netcardList.end(),
- [](simgrid::kernel::routing::NetCard* a, simgrid::kernel::routing::NetCard* b) {
- return a->name() < b->name();
- });
+ [](simgrid::kernel::routing::NetPoint* a, simgrid::kernel::routing::NetPoint* b) {
+ return a->name() < b->name();
+ });
if (timings) {
XBT_INFO("Parsing time: %fs (%zu hosts, %d links)", xbt_os_timer_elapsed(parse_time),
for (unsigned int it_src = 0; it_src < totalHosts; it_src++) { // Routes from host
simgrid::s4u::Host* host1 = hosts[it_src];
- simgrid::kernel::routing::NetCard* netcardSrc = host1->pimpl_netcard;
+ simgrid::kernel::routing::NetPoint* netcardSrc = host1->pimpl_netpoint;
for (unsigned int it_dst = 0; it_dst < totalHosts; it_dst++) { // Routes to host
simgrid::s4u::Host* host2 = hosts[it_dst];
std::vector<Link*> route;
- simgrid::kernel::routing::NetCard* netcardDst = host2->pimpl_netcard;
+ simgrid::kernel::routing::NetPoint* netcardDst = host2->pimpl_netpoint;
simgrid::kernel::routing::NetZoneImpl::getGlobalRoute(netcardSrc, netcardDst, &route, nullptr);
if (!route.empty()) {
std::printf(" <route src=\"%s\" dst=\"%s\">\n ", host1->cname(), host2->cname());
simgrid::s4u::Host* host2 = hosts[it_dst];
std::printf(" <route src=\"%s\" dst=\"%s\">\n ", value1->cname(), host2->cname());
std::vector<Link*> route;
- simgrid::kernel::routing::NetCard* netcardDst = host2->pimpl_netcard;
+ simgrid::kernel::routing::NetPoint* netcardDst = host2->pimpl_netpoint;
simgrid::kernel::routing::NetZoneImpl::getGlobalRoute(value1, netcardDst, &route, nullptr);
for (auto link : route)
std::printf("<link_ctn id=\"%s\"/>",link->getName());
#include "simgrid/s4u/engine.hpp"
#include "simgrid/s4u/host.hpp"
#include "simgrid/simdag.h"
-#include "src/kernel/routing/NetCard.hpp"
+#include "src/kernel/routing/NetPoint.hpp"
#include "surf/surf_routing.h"
#include <stdio.h>
xbt_dynar_t hosts = sg_hosts_as_dynar();
std::printf("Host count: %zu, link number: %d\n", sg_host_count(), sg_link_count());
- std::vector<simgrid::kernel::routing::NetCard*> netcardList;
+ std::vector<simgrid::kernel::routing::NetPoint*> netcardList;
simgrid::s4u::Engine::instance()->netcardList(&netcardList);
std::sort(netcardList.begin(), netcardList.end(),
- [](simgrid::kernel::routing::NetCard* a, simgrid::kernel::routing::NetCard* b) {
- return a->name() < b->name();
- });
+ [](simgrid::kernel::routing::NetPoint* a, simgrid::kernel::routing::NetPoint* b) {
+ return a->name() < b->name();
+ });
int it;
sg_host_t host;
xbt_dynar_foreach(hosts, it, host) {
- simgrid::kernel::routing::NetCard * nc = host->pimpl_netcard;
+ simgrid::kernel::routing::NetPoint* nc = host->pimpl_netpoint;
std::printf(" - Seen: \"%s\". Type: %s\n", host->cname(),
nc->isRouter() ? "router" : (nc->isNetZone() ? "netzone" : (nc->isHost() ? "host" : "buggy")));
}
src/kernel/routing/FloydZone.hpp
src/kernel/routing/FullZone.cpp
src/kernel/routing/FullZone.hpp
- src/kernel/routing/NetCard.cpp
- src/kernel/routing/NetCard.hpp
+ src/kernel/routing/NetPoint.cpp
+ src/kernel/routing/NetPoint.hpp
src/kernel/routing/NetZoneImpl.cpp
src/kernel/routing/NetZoneImpl.hpp
src/kernel/routing/RoutedZone.cpp