From: Martin Quinson Date: Mon, 23 Jan 2017 21:52:33 +0000 (+0100) Subject: Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid X-Git-Tag: v3_15~527 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/3f9587e71330e7471ef675d2652cee260a0e3a96?hp=df3bdefc3df0a0810cf48411dd588ed63c65a302 Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid --- diff --git a/ChangeLog b/ChangeLog index 4e58ce7ae2..7db8399fb7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 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 (3.14.159) stable; urgency=low diff --git a/include/simgrid/forward.h b/include/simgrid/forward.h index 10cf0ec667..610f34fe5c 100644 --- a/include/simgrid/forward.h +++ b/include/simgrid/forward.h @@ -22,7 +22,7 @@ namespace simgrid { class ActivityImpl; } namespace routing { - class NetCard; + class NetPoint; } } namespace simix { @@ -43,7 +43,7 @@ namespace simgrid { 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; @@ -58,7 +58,7 @@ typedef struct simgrid_NetZone simgrid_NetZone; 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; @@ -72,7 +72,7 @@ typedef simgrid_Host* sg_host_t; 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: diff --git a/include/simgrid/modelchecker.h b/include/simgrid/modelchecker.h index 0579ca6e2a..a09795351b 100644 --- a/include/simgrid/modelchecker.h +++ b/include/simgrid/modelchecker.h @@ -31,10 +31,10 @@ XBT_PUBLIC(int) MC_random(int min, int max); * * 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 * diff --git a/include/simgrid/s4u/NetZone.hpp b/include/simgrid/s4u/NetZone.hpp index bf96c02933..155a95cf56 100644 --- a/include/simgrid/s4u/NetZone.hpp +++ b/include/simgrid/s4u/NetZone.hpp @@ -58,18 +58,18 @@ public: 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* link_list)> onRouteCreation; protected: - std::vector + std::vector vertices_; // our content, as known to our graph routing algorithm (maps vertexId -> vertex) private: diff --git a/include/simgrid/s4u/engine.hpp b/include/simgrid/s4u/engine.hpp index 7f5177adc3..3caf268250 100644 --- a/include/simgrid/s4u/engine.hpp +++ b/include/simgrid/s4u/engine.hpp @@ -73,10 +73,10 @@ public: 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 * 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 * list); + void netcardRegister(simgrid::kernel::routing::NetPoint * card); + void netcardUnregister(simgrid::kernel::routing::NetPoint * card); template void registerFunction(const char* name) diff --git a/include/simgrid/s4u/host.hpp b/include/simgrid/s4u/host.hpp index b03753569c..23e91e25bb 100644 --- a/include/simgrid/s4u/host.hpp +++ b/include/simgrid/s4u/host.hpp @@ -114,7 +114,7 @@ public: /** 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 */ diff --git a/src/bindings/lua/lua_platf.cpp b/src/bindings/lua/lua_platf.cpp index c662f755ac..bdcfef6ce2 100644 --- a/src/bindings/lua/lua_platf.cpp +++ b/src/bindings/lua/lua_platf.cpp @@ -7,7 +7,7 @@ /* 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" diff --git a/src/include/mc/mc.h b/src/include/mc/mc.h index 39213e1bd1..2d37e156a9 100644 --- a/src/include/mc/mc.h +++ b/src/include/mc/mc.h @@ -39,7 +39,7 @@ extern XBT_PUBLIC(char*) _sg_mc_property_file; 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; diff --git a/src/instr/instr_interface.cpp b/src/instr/instr_interface.cpp index 6801500b8f..da48497150 100644 --- a/src/instr/instr_interface.cpp +++ b/src/instr/instr_interface.cpp @@ -6,7 +6,7 @@ #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" diff --git a/src/instr/instr_paje_containers.cpp b/src/instr/instr_paje_containers.cpp index 6af90f2fd1..48d1af162d 100644 --- a/src/instr/instr_paje_containers.cpp +++ b/src/instr/instr_paje_containers.cpp @@ -68,7 +68,7 @@ container_t PJ_container_new (const char *name, e_container_types kind, containe //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: diff --git a/src/kernel/EngineImpl.cpp b/src/kernel/EngineImpl.cpp index f88b59cad8..3375539c53 100644 --- a/src/kernel/EngineImpl.cpp +++ b/src/kernel/EngineImpl.cpp @@ -4,7 +4,7 @@ * 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 @@ -15,7 +15,7 @@ EngineImpl::EngineImpl() = default; EngineImpl::~EngineImpl() { delete netRoot_; - for (auto kv : netcards_) + for (auto kv : netpoints_) delete kv.second; } } diff --git a/src/kernel/EngineImpl.hpp b/src/kernel/EngineImpl.hpp index d3501dc660..c25063d629 100644 --- a/src/kernel/EngineImpl.hpp +++ b/src/kernel/EngineImpl.hpp @@ -13,7 +13,7 @@ namespace simgrid { namespace kernel { namespace routing { class NetZoneImpl; -class NetCard; +class NetPoint; } class EngineImpl { @@ -23,7 +23,7 @@ public: kernel::routing::NetZoneImpl* netRoot_ = nullptr; protected: - std::unordered_map netcards_; + std::unordered_map netpoints_; friend simgrid::s4u::Engine; }; } diff --git a/src/kernel/routing/ClusterZone.cpp b/src/kernel/routing/ClusterZone.cpp index d2eb784757..c6e2679544 100644 --- a/src/kernel/routing/ClusterZone.cpp +++ b/src/kernel/routing/ClusterZone.cpp @@ -4,7 +4,7 @@ * 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" @@ -20,7 +20,7 @@ ClusterZone::ClusterZone(NetZone* father, const char* name) : NetZoneImpl(father { } -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(), diff --git a/src/kernel/routing/ClusterZone.hpp b/src/kernel/routing/ClusterZone.hpp index a9065181ab..0137d371d1 100644 --- a/src/kernel/routing/ClusterZone.hpp +++ b/src/kernel/routing/ClusterZone.hpp @@ -69,7 +69,7 @@ class XBT_PRIVATE ClusterZone : public NetZoneImpl { 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); @@ -81,7 +81,7 @@ public: 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) */ diff --git a/src/kernel/routing/DijkstraZone.cpp b/src/kernel/routing/DijkstraZone.cpp index 75068094a3..08fd4430fa 100644 --- a/src/kernel/routing/DijkstraZone.cpp +++ b/src/kernel/routing/DijkstraZone.cpp @@ -4,7 +4,7 @@ * 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 @@ -141,7 +141,7 @@ void DijkstraZone::newRoute(int src_id, int dst_id, sg_platf_route_cbarg_t e_rou 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(); @@ -239,8 +239,8 @@ void DijkstraZone::getLocalRoute(NetCard* src, NetCard* dst, sg_platf_route_cbar } /* 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); @@ -315,8 +315,8 @@ DijkstraZone::DijkstraZone(NetZone* father, const char* name, bool cached) : Rou 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(); @@ -353,7 +353,7 @@ void DijkstraZone::addRoute(sg_platf_route_cbarg_t route) 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; } diff --git a/src/kernel/routing/DijkstraZone.hpp b/src/kernel/routing/DijkstraZone.hpp index bf443fb83e..b19cd34155 100644 --- a/src/kernel/routing/DijkstraZone.hpp +++ b/src/kernel/routing/DijkstraZone.hpp @@ -58,7 +58,7 @@ public: * 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 */ diff --git a/src/kernel/routing/DragonflyZone.cpp b/src/kernel/routing/DragonflyZone.cpp index 02d4f0249a..0de5c30295 100644 --- a/src/kernel/routing/DragonflyZone.cpp +++ b/src/kernel/routing/DragonflyZone.cpp @@ -4,7 +4,7 @@ * 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 @@ -245,7 +245,7 @@ void DragonflyZone::generateLinks() } } -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 ? diff --git a/src/kernel/routing/DragonflyZone.hpp b/src/kernel/routing/DragonflyZone.hpp index 2cc15a51fa..bb3117d9d0 100644 --- a/src/kernel/routing/DragonflyZone.hpp +++ b/src/kernel/routing/DragonflyZone.hpp @@ -63,7 +63,7 @@ public: 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(); diff --git a/src/kernel/routing/EmptyZone.cpp b/src/kernel/routing/EmptyZone.cpp index 66729e69a6..b861258a8e 100644 --- a/src/kernel/routing/EmptyZone.cpp +++ b/src/kernel/routing/EmptyZone.cpp @@ -21,7 +21,7 @@ EmptyZone::EmptyZone(NetZone* father, const char* name) : NetZoneImpl(father, na 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*/) { } diff --git a/src/kernel/routing/EmptyZone.hpp b/src/kernel/routing/EmptyZone.hpp index 09b2fda222..90036ff87d 100644 --- a/src/kernel/routing/EmptyZone.hpp +++ b/src/kernel/routing/EmptyZone.hpp @@ -24,7 +24,7 @@ public: 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; }; } diff --git a/src/kernel/routing/FatTreeZone.cpp b/src/kernel/routing/FatTreeZone.cpp index 7a0222aae7..9475591fff 100644 --- a/src/kernel/routing/FatTreeZone.cpp +++ b/src/kernel/routing/FatTreeZone.cpp @@ -7,7 +7,7 @@ #include #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" @@ -57,7 +57,7 @@ bool FatTreeZone::isInSubTree(FatTreeNode* root, FatTreeNode* node) 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()) diff --git a/src/kernel/routing/FatTreeZone.hpp b/src/kernel/routing/FatTreeZone.hpp index 50776677c0..8d8538752f 100644 --- a/src/kernel/routing/FatTreeZone.hpp +++ b/src/kernel/routing/FatTreeZone.hpp @@ -100,7 +100,7 @@ class XBT_PRIVATE FatTreeZone : public ClusterZone { 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 * diff --git a/src/kernel/routing/FloydZone.cpp b/src/kernel/routing/FloydZone.cpp index 0caacff9c3..1c20629d16 100644 --- a/src/kernel/routing/FloydZone.cpp +++ b/src/kernel/routing/FloydZone.cpp @@ -3,9 +3,8 @@ /* 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" @@ -44,7 +43,7 @@ FloydZone::~FloydZone() 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(); @@ -136,7 +135,7 @@ void FloydZone::addRoute(sg_platf_route_cbarg_t route) 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; } diff --git a/src/kernel/routing/FloydZone.hpp b/src/kernel/routing/FloydZone.hpp index 74f0868cb9..f1cb156936 100644 --- a/src/kernel/routing/FloydZone.hpp +++ b/src/kernel/routing/FloydZone.hpp @@ -26,7 +26,7 @@ public: 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; diff --git a/src/kernel/routing/FullZone.cpp b/src/kernel/routing/FullZone.cpp index d9b0babfc8..71723c7292 100644 --- a/src/kernel/routing/FullZone.cpp +++ b/src/kernel/routing/FullZone.cpp @@ -4,7 +4,7 @@ * 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"); @@ -58,7 +58,7 @@ FullZone::~FullZone() } } -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()); @@ -78,8 +78,8 @@ void FullZone::getLocalRoute(NetCard* src, NetCard* dst, sg_platf_route_cbarg_t 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(); @@ -102,7 +102,7 @@ void FullZone::addRoute(sg_platf_route_cbarg_t route) 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; } diff --git a/src/kernel/routing/FullZone.hpp b/src/kernel/routing/FullZone.hpp index e81519c180..f13764ffa8 100644 --- a/src/kernel/routing/FullZone.hpp +++ b/src/kernel/routing/FullZone.hpp @@ -25,7 +25,7 @@ public: 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; diff --git a/src/kernel/routing/NetCard.cpp b/src/kernel/routing/NetPoint.cpp similarity index 74% rename from src/kernel/routing/NetCard.cpp rename to src/kernel/routing/NetPoint.cpp index d875e898b8..5bf404bfe0 100644 --- a/src/kernel/routing/NetCard.cpp +++ b/src/kernel/routing/NetPoint.cpp @@ -4,7 +4,8 @@ /* 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" @@ -15,15 +16,15 @@ namespace simgrid { namespace kernel { namespace routing { -simgrid::xbt::signal NetCard::onCreation; +simgrid::xbt::signal 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); } } } @@ -33,7 +34,7 @@ NetCard::NetCard(std::string name, NetCard::Type componentType, NetZoneImpl* net * * 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); } diff --git a/src/kernel/routing/NetCard.hpp b/src/kernel/routing/NetPoint.hpp similarity index 79% rename from src/kernel/routing/NetCard.hpp rename to src/kernel/routing/NetPoint.hpp index 0f0b45ddf9..b077a37c79 100644 --- a/src/kernel/routing/NetCard.hpp +++ b/src/kernel/routing/NetPoint.hpp @@ -22,15 +22,15 @@ namespace routing { /** @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 { +class NetPoint : public simgrid::xbt::Extendable { 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_; } @@ -43,14 +43,14 @@ public: bool isHost() { return componentType_ == Type::Host; } bool isRouter() { return componentType_ == Type::Router; } - static simgrid::xbt::signal onCreation; + static simgrid::xbt::signal 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_; }; } diff --git a/src/kernel/routing/NetZoneImpl.cpp b/src/kernel/routing/NetZoneImpl.cpp index d4637b302e..464e973735 100644 --- a/src/kernel/routing/NetZoneImpl.cpp +++ b/src/kernel/routing/NetZoneImpl.cpp @@ -6,7 +6,7 @@ #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" @@ -20,9 +20,9 @@ namespace routing { 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 links; }; @@ -31,7 +31,7 @@ NetZoneImpl::NetZoneImpl(NetZone* father, const char* name) : NetZone(father, na 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(father)); + netcard_ = new NetPoint(name, NetPoint::Type::NetZone, static_cast(father)); XBT_DEBUG("NetZone '%s' created with the id '%d'", name, netcard_->id()); } NetZoneImpl::~NetZoneImpl() @@ -50,7 +50,7 @@ simgrid::s4u::Host* NetZoneImpl::createHost(const char* name, std::vectorpimpl_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); @@ -141,7 +141,7 @@ void NetZoneImpl::addBypassRoute(sg_platf_route_cbarg_t e_route) * 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) { @@ -201,7 +201,7 @@ static void find_common_ancestors(NetCard* src, NetCard* dst, } /* 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* links, double* latency) { // If never set a bypass route return nullptr without any further computations @@ -255,7 +255,7 @@ bool NetZoneImpl::getBypassRoute(routing::NetCard* src, routing::NetCard* dst, /* (3) Search for a bypass making the path up to the ancestor useless */ BypassRoute* bypassedRoute = nullptr; - std::pair key; + std::pair 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) { @@ -292,21 +292,21 @@ bool NetZoneImpl::getBypassRoute(routing::NetCard* src, routing::NetCard* dst, "calls to getRoute", src->cname(), dst->cname(), bypassedRoute->links.size()); if (src != key.first) - getGlobalRoute(src, const_cast(bypassedRoute->gw_src), links, latency); + getGlobalRoute(src, const_cast(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(bypassedRoute->gw_dst), dst, links, latency); + getGlobalRoute(const_cast(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* links, double* latency) { s_sg_platf_route_cbarg_t route; diff --git a/src/kernel/routing/NetZoneImpl.hpp b/src/kernel/routing/NetZoneImpl.hpp index bac785d56f..bc922794db 100644 --- a/src/kernel/routing/NetZoneImpl.hpp +++ b/src/kernel/routing/NetZoneImpl.hpp @@ -72,10 +72,10 @@ protected: * @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 * links, double* latency); public: @@ -86,7 +86,7 @@ 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 * links, double* latency); virtual void getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges) = 0; @@ -99,8 +99,8 @@ public: RoutingMode hierarchy_ = RoutingMode::unset; private: - std::map, BypassRoute*> bypassRoutes_; // src x dst -> route - routing::NetCard* netcard_ = nullptr; // Our representative in the father NetZone + std::map, BypassRoute*> bypassRoutes_; // src x dst -> route + routing::NetPoint* netcard_ = nullptr; // Our representative in the father NetZone }; } } diff --git a/src/kernel/routing/RoutedZone.cpp b/src/kernel/routing/RoutedZone.cpp index 5209a95e81..deaadbe0ef 100644 --- a/src/kernel/routing/RoutedZone.cpp +++ b/src/kernel/routing/RoutedZone.cpp @@ -9,7 +9,7 @@ #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" @@ -157,7 +157,7 @@ sg_platf_route_cbarg_t RoutedZone::newExtendedRoute(RoutingMode hierarchy, sg_pl 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()); @@ -175,8 +175,8 @@ void RoutedZone::getRouteCheckParams(NetCard* src, NetCard* dst) } 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(); diff --git a/src/kernel/routing/RoutedZone.hpp b/src/kernel/routing/RoutedZone.hpp index c90df9de0b..25be9b45e5 100644 --- a/src/kernel/routing/RoutedZone.hpp +++ b/src/kernel/routing/RoutedZone.hpp @@ -57,7 +57,7 @@ public: bool change_order); protected: - void getRouteCheckParams(NetCard* src, NetCard* dst); + void getRouteCheckParams(NetPoint* src, NetPoint* dst); void addRouteCheckParams(sg_platf_route_cbarg_t route); }; } diff --git a/src/kernel/routing/TorusZone.cpp b/src/kernel/routing/TorusZone.cpp index 226d0f109f..a7fc92c8a7 100644 --- a/src/kernel/routing/TorusZone.cpp +++ b/src/kernel/routing/TorusZone.cpp @@ -4,8 +4,7 @@ * 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"); @@ -110,7 +109,7 @@ void TorusZone::parse_specific_arguments(sg_platf_cluster_cbarg_t cluster) 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(), diff --git a/src/kernel/routing/TorusZone.hpp b/src/kernel/routing/TorusZone.hpp index 8d8c7a1a92..94a98809c1 100644 --- a/src/kernel/routing/TorusZone.hpp +++ b/src/kernel/routing/TorusZone.hpp @@ -22,7 +22,7 @@ public: 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: diff --git a/src/kernel/routing/VivaldiZone.cpp b/src/kernel/routing/VivaldiZone.cpp index f4d289b508..9c54ab7487 100644 --- a/src/kernel/routing/VivaldiZone.cpp +++ b/src/kernel/routing/VivaldiZone.cpp @@ -8,7 +8,7 @@ #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" @@ -18,12 +18,12 @@ namespace simgrid { namespace kernel { namespace routing { namespace vivaldi { -simgrid::xbt::Extension Coords::EXTENSION_ID; +simgrid::xbt::Extension 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::EXTENSION_ID = NetPoint::extension_create(); std::vector string_values; boost::split(string_values, coordStr, boost::is_any_of(" ")); @@ -47,7 +47,7 @@ static inline double euclidean_dist_comp(int index, std::vector* src, st return (src_coord - dst_coord) * (src_coord - dst_coord); } -static std::vector* getCoordsFromNetcard(NetCard* nc) +static std::vector* getCoordsFromNetcard(NetPoint* nc) { simgrid::kernel::routing::vivaldi::Coords* coords = nc->extension(); xbt_assert(coords, "Please specify the Vivaldi coordinates of %s %s (%p)", @@ -58,7 +58,7 @@ VivaldiZone::VivaldiZone(NetZone* father, const char* name) : ClusterZone(father { } -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"); @@ -71,7 +71,7 @@ void VivaldiZone::setPeerLink(NetCard* netcard, double bw_in, double bw_out, con 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()); diff --git a/src/kernel/routing/VivaldiZone.hpp b/src/kernel/routing/VivaldiZone.hpp index 300b7e4b67..e2a6e62104 100644 --- a/src/kernel/routing/VivaldiZone.hpp +++ b/src/kernel/routing/VivaldiZone.hpp @@ -47,15 +47,15 @@ class XBT_PRIVATE VivaldiZone : public ClusterZone { 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 EXTENSION_ID; - explicit Coords(NetCard* host, const char* str); + static simgrid::xbt::Extension EXTENSION_ID; + explicit Coords(NetPoint* host, const char* str); virtual ~Coords(); std::vector coords; diff --git a/src/mc/Process.hpp b/src/mc/Process.hpp index a109f83142..07f510c931 100644 --- a/src/mc/Process.hpp +++ b/src/mc/Process.hpp @@ -147,7 +147,7 @@ public: 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(); diff --git a/src/mc/VisitedState.cpp b/src/mc/VisitedState.cpp index c57bf9c056..a2348a80ad 100644 --- a/src/mc/VisitedState.cpp +++ b/src/mc/VisitedState.cpp @@ -60,7 +60,7 @@ VisitedState::~VisitedState() 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& a, std::unique_ptr& b) { diff --git a/src/mc/checker/CommunicationDeterminismChecker.cpp b/src/mc/checker/CommunicationDeterminismChecker.cpp index fa5ab40612..e8999908e5 100644 --- a/src/mc/checker/CommunicationDeterminismChecker.cpp +++ b/src/mc/checker/CommunicationDeterminismChecker.cpp @@ -512,9 +512,9 @@ void CommunicationDeterminismChecker::main(void) 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()) diff --git a/src/mc/checker/LivenessChecker.cpp b/src/mc/checker/LivenessChecker.cpp index a28aa518cd..a505e097e4 100644 --- a/src/mc/checker/LivenessChecker.cpp +++ b/src/mc/checker/LivenessChecker.cpp @@ -220,7 +220,7 @@ void LivenessChecker::replay() */ int LivenessChecker::insertVisitedPair(std::shared_ptr visited_pair, simgrid::mc::Pair* pair) { - if (_sg_mc_visited == 0) + if (_sg_mc_max_visited_states == 0) return -1; if (visited_pair == nullptr) @@ -258,7 +258,7 @@ int LivenessChecker::insertVisitedPair(std::shared_ptr visited_pair 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 const a, std::shared_ptr const& b) { diff --git a/src/mc/checker/SafetyChecker.cpp b/src/mc/checker/SafetyChecker.cpp index 52e1e70831..21855771d7 100644 --- a/src/mc/checker/SafetyChecker.cpp +++ b/src/mc/checker/SafetyChecker.cpp @@ -158,7 +158,7 @@ void SafetyChecker::run() 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) */ diff --git a/src/mc/mc_base.cpp b/src/mc/mc_base.cpp index f5530bd3ee..e6e2a7797d 100644 --- a/src/mc/mc_base.cpp +++ b/src/mc/mc_base.cpp @@ -113,8 +113,8 @@ bool request_is_enabled(smx_simcall_t req) #if HAVE_MC // Fetch from MCed memory: // HACK, type puning - simgrid::mc::Remote temp_comm; if (mc_model_checker != nullptr) { + simgrid::mc::Remote temp_comm; mc_model_checker->process().read(temp_comm, remote(act)); act = static_cast(temp_comm.getBuffer()); } diff --git a/src/mc/mc_checkpoint.cpp b/src/mc/mc_checkpoint.cpp index 6deee1c5a2..37169199f7 100644 --- a/src/mc/mc_checkpoint.cpp +++ b/src/mc/mc_checkpoint.cpp @@ -578,7 +578,7 @@ std::shared_ptr take_snapshot(int num_state) 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); diff --git a/src/mc/mc_config.cpp b/src/mc/mc_config.cpp index 84b8b07dbc..67bebd4e6b 100644 --- a/src/mc/mc_config.cpp +++ b/src/mc/mc_config.cpp @@ -55,7 +55,7 @@ int _sg_mc_ksm = 0; 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; @@ -144,7 +144,7 @@ void _mc_cfg_cb_visited(const char *name) 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) diff --git a/src/mc/mc_state.cpp b/src/mc/mc_state.cpp index 861e399698..e85574f899 100644 --- a/src/mc/mc_state.cpp +++ b/src/mc/mc_state.cpp @@ -165,11 +165,10 @@ static inline smx_simcall_t MC_state_get_request_for_process( 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 @@ -177,7 +176,6 @@ static inline smx_simcall_t MC_state_get_request_for_process( 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)), @@ -191,7 +189,6 @@ static inline smx_simcall_t MC_state_get_request_for_process( 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( @@ -205,7 +202,6 @@ static inline smx_simcall_t MC_state_get_request_for_process( 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()); @@ -213,7 +209,6 @@ static inline smx_simcall_t MC_state_get_request_for_process( 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()); @@ -221,7 +216,7 @@ static inline smx_simcall_t MC_state_get_request_for_process( break; default: - state->internal_req = *req; + /* No translation needed */ break; } diff --git a/src/plugins/vm/VirtualMachineImpl.cpp b/src/plugins/vm/VirtualMachineImpl.cpp index 2e9179a4f2..5bd81fde07 100644 --- a/src/plugins/vm/VirtualMachineImpl.cpp +++ b/src/plugins/vm/VirtualMachineImpl.cpp @@ -236,7 +236,7 @@ void VirtualMachineImpl::setPm(s4u::Host* destination) 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; diff --git a/src/plugins/vm/s4u_VirtualMachine.cpp b/src/plugins/vm/s4u_VirtualMachine.cpp index f0884c9378..97d2749e8a 100644 --- a/src/plugins/vm/s4u_VirtualMachine.cpp +++ b/src/plugins/vm/s4u_VirtualMachine.cpp @@ -19,7 +19,7 @@ VirtualMachine::VirtualMachine(const char* name, s4u::Host* pm) : Host(name) 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(pm->pimpl_cpu); @@ -51,7 +51,7 @@ VirtualMachine::~VirtualMachine() extension_set(nullptr); /* Don't free these things twice: they are the ones of my physical host */ - pimpl_netcard = nullptr; + pimpl_netpoint = nullptr; } bool VirtualMachine::isMigrating() diff --git a/src/s4u/s4u_engine.cpp b/src/s4u/s4u_engine.cpp index 6cff0b1ce6..49844d197b 100644 --- a/src/s4u/s4u_engine.cpp +++ b/src/s4u/s4u_engine.cpp @@ -14,10 +14,8 @@ #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 @@ -114,31 +112,31 @@ NetZone* Engine::netzoneByNameOrNull(const char* name) } /** @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* list) +void Engine::netcardList(std::vector* 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; }); } } diff --git a/src/s4u/s4u_host.cpp b/src/s4u/s4u_host.cpp index d918006bcb..e602cebe6d 100644 --- a/src/s4u/s4u_host.cpp +++ b/src/s4u/s4u_host.cpp @@ -14,7 +14,7 @@ #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" @@ -54,8 +54,8 @@ Host::~Host() 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; } @@ -142,7 +142,7 @@ int Host::pstatesCount() const { */ void Host::routeTo(Host* dest, std::vector* 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)); diff --git a/src/s4u/s4u_netzone.cpp b/src/s4u/s4u_netzone.cpp index 1124461185..1ab825e048 100644 --- a/src/s4u/s4u_netzone.cpp +++ b/src/s4u/s4u_netzone.cpp @@ -8,7 +8,7 @@ #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"); @@ -16,8 +16,8 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_netzone, "S4U Networking Zones"); namespace simgrid { namespace s4u { -simgrid::xbt::signal* link_list)> NetZone::onRouteCreation; @@ -84,7 +84,7 @@ xbt_dynar_t NetZone::hosts() 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 diff --git a/src/simgrid/host.cpp b/src/simgrid/host.cpp index e655063fde..9808aa6f69 100644 --- a/src/simgrid/host.cpp +++ b/src/simgrid/host.cpp @@ -11,7 +11,7 @@ #include #include -#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"); @@ -91,8 +91,8 @@ xbt_dynar_t sg_hosts_as_dynar() 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; diff --git a/src/surf/network_ns3.cpp b/src/surf/network_ns3.cpp index 16d6986c2c..c354669848 100644 --- a/src/surf/network_ns3.cpp +++ b/src/surf/network_ns3.cpp @@ -16,7 +16,7 @@ #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" @@ -44,7 +44,7 @@ static int number_of_links = 1; static int number_of_networks = 1; static int port_number = 1025; //Port number is limited from 1025 to 65 000 -simgrid::xbt::Extension NetCardNs3::EXTENSION_ID; +simgrid::xbt::Extension NetCardNs3::EXTENSION_ID; NetCardNs3::NetCardNs3() { @@ -58,7 +58,7 @@ NetCardNs3::NetCardNs3() * Callbacks * *************/ -static void netcardCreation_cb(simgrid::kernel::routing::NetCard* netcard) +static void netcardCreation_cb(simgrid::kernel::routing::NetPoint* netcard) { netcard->extension_set(new NetCardNs3()); } @@ -75,7 +75,7 @@ static void clusterCreation_cb(sg_platf_cluster_cbarg_t cluster) // 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* host_src = sg_host_by_name(host_id)->pimpl_netpoint->extension(); 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); @@ -94,9 +94,9 @@ static void clusterCreation_cb(sg_platf_cluster_cbarg_t cluster) 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_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_list) { if (link_list->size() == 1) { simgrid::surf::LinkNS3* link = static_cast(link_list->at(0)); @@ -154,11 +154,11 @@ namespace simgrid { namespace surf { NetworkNS3Model::NetworkNS3Model() : NetworkModel() { - NetCardNs3::EXTENSION_ID = simgrid::kernel::routing::NetCard::extension_create(); + NetCardNs3::EXTENSION_ID = simgrid::kernel::routing::NetPoint::extension_create(); 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); @@ -343,8 +343,8 @@ void ns3_simulator(double maxSeconds) 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()->node_num; - int node2 = dst->pimpl_netcard->extension()->node_num; + int node1 = src->pimpl_netpoint->extension()->node_num; + int node2 = dst->pimpl_netpoint->extension()->node_num; ns3::Ptr src_node = nodes.Get(node1); ns3::Ptr dst_node = nodes.Get(node2); diff --git a/src/surf/ns3/ns3_interface.h b/src/surf/ns3/ns3_interface.h index b9270f91f2..3a92354b5a 100644 --- a/src/surf/ns3/ns3_interface.h +++ b/src/surf/ns3/ns3_interface.h @@ -16,7 +16,7 @@ class NetworkNS3Action; class NetCardNs3 { public: - static simgrid::xbt::Extension EXTENSION_ID; + static simgrid::xbt::Extension EXTENSION_ID; explicit NetCardNs3(); int node_num; diff --git a/src/surf/sg_platf.cpp b/src/surf/sg_platf.cpp index 3271fc0be0..3dff876900 100644 --- a/src/surf/sg_platf.cpp +++ b/src/surf/sg_platf.cpp @@ -21,7 +21,7 @@ #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" @@ -89,14 +89,14 @@ void sg_platf_new_host(sg_platf_host_cbarg_t args) 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(); @@ -105,8 +105,8 @@ simgrid::kernel::routing::NetCard* sg_platf_new_router(const char* name, const c 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, "")) @@ -557,7 +557,7 @@ void sg_platf_new_peer(sg_platf_peer_cbarg_t peer) 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) @@ -720,7 +720,7 @@ void sg_platf_new_AS_seal() /** @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(current_routing), "Only hosts from Cluster and Vivaldi ASes can get an host_link."); diff --git a/src/surf/storage_n11.cpp b/src/surf/storage_n11.cpp index 62939cdb13..6644b52a4b 100644 --- a/src/surf/storage_n11.cpp +++ b/src/surf/storage_n11.cpp @@ -5,9 +5,10 @@ * 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 /*ceil*/ + XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_storage); /************* @@ -41,7 +42,7 @@ static void check_disk_attachment() if (xbt_lib_get_level(xbt_lib_get_elm_or_null(storage_lib, key), SURF_STORAGE_LEVEL) != nullptr) { simgrid::surf::Storage* storage = static_cast(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_); } diff --git a/src/surf/surf_interface.cpp b/src/surf/surf_interface.cpp index 45ccea0f66..623aeba4ce 100644 --- a/src/surf/surf_interface.cpp +++ b/src/surf/surf_interface.cpp @@ -12,7 +12,7 @@ #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" diff --git a/src/surf/xml/platf_private.hpp b/src/surf/xml/platf_private.hpp index e3edce6d4b..017ce0809d 100644 --- a/src/surf/xml/platf_private.hpp +++ b/src/surf/xml/platf_private.hpp @@ -199,7 +199,7 @@ XBT_PUBLIC(void) sg_platf_new_AS_seal(); // That AS is fully 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 diff --git a/src/surf/xml/surfxml_sax_cb.cpp b/src/surf/xml/surfxml_sax_cb.cpp index 8e5a7cd1cd..47cf277f5e 100644 --- a/src/surf/xml/surfxml_sax_cb.cpp +++ b/src/surf/xml/surfxml_sax_cb.cpp @@ -11,7 +11,7 @@ #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" diff --git a/teshsuite/simdag/flatifier/flatifier.cpp b/teshsuite/simdag/flatifier/flatifier.cpp index 710bb1acce..5fbf34cff9 100644 --- a/teshsuite/simdag/flatifier/flatifier.cpp +++ b/teshsuite/simdag/flatifier/flatifier.cpp @@ -19,7 +19,7 @@ #include -#include "src/kernel/routing/NetCard.hpp" +#include "src/kernel/routing/NetPoint.hpp" #include "src/surf/network_interface.hpp" @@ -87,12 +87,12 @@ int main(int argc, char **argv) create_environment(parse_time, platformFile); - std::vector netcardList; + std::vector 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), @@ -150,11 +150,11 @@ int main(int argc, char **argv) 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 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(" \n ", host1->cname(), host2->cname()); @@ -191,7 +191,7 @@ int main(int argc, char **argv) simgrid::s4u::Host* host2 = hosts[it_dst]; std::printf(" \n ", value1->cname(), host2->cname()); std::vector 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->getName()); diff --git a/teshsuite/simdag/is-router/is-router.cpp b/teshsuite/simdag/is-router/is-router.cpp index 4e873ef1b0..a3401ded69 100644 --- a/teshsuite/simdag/is-router/is-router.cpp +++ b/teshsuite/simdag/is-router/is-router.cpp @@ -6,7 +6,7 @@ #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 @@ -18,17 +18,17 @@ int main(int argc, char **argv) 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 netcardList; + std::vector 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"))); } diff --git a/tools/cmake/DefinePackages.cmake b/tools/cmake/DefinePackages.cmake index 114ea2019d..94262a07e2 100644 --- a/tools/cmake/DefinePackages.cmake +++ b/tools/cmake/DefinePackages.cmake @@ -295,8 +295,8 @@ set(SURF_SRC 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