From: Martin Quinson Date: Sun, 27 Dec 2015 21:27:18 +0000 (+0100) Subject: Rename RoutingEdge into NetCard X-Git-Tag: v3_13~1377 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/ec4e2d87d99b8ad76c9096033eb858e9052b09fa Rename RoutingEdge into NetCard That's shorter and hopefully more explicit --- diff --git a/include/simgrid/forward.h b/include/simgrid/forward.h index 18b14f488e..5c4cc38a56 100644 --- a/include/simgrid/forward.h +++ b/include/simgrid/forward.h @@ -19,7 +19,7 @@ namespace simgrid { namespace surf { class Cpu; -class RoutingEdge; +class NetCard; class As; class Link; @@ -28,7 +28,7 @@ class Link; typedef simgrid::Host simgrid_Host; typedef simgrid::surf::Cpu surf_Cpu; -typedef simgrid::surf::RoutingEdge surf_RoutingEdge; +typedef simgrid::surf::NetCard surf_NetCard; typedef simgrid::surf::As surf_As; typedef simgrid::surf::Link Link; @@ -36,7 +36,7 @@ typedef simgrid::surf::Link Link; typedef struct simgrid_Host simgrid_Host; typedef struct surf_Cpu surf_Cpu; -typedef struct surf_RoutingEdge surf_RoutingEdge; +typedef struct surf_NetCard surf_NetCard; typedef struct surf_As surf_As; typedef struct Link Link; @@ -44,7 +44,7 @@ typedef struct Link Link; typedef simgrid_Host* sg_host_t; typedef surf_Cpu *surf_cpu_t; -typedef surf_RoutingEdge *sg_routing_edge_t; +typedef surf_NetCard *sg_netcard_t; typedef surf_As *AS_t; // Types which are in fact dictelmt: @@ -176,8 +176,8 @@ typedef struct s_sg_platf_route_cbarg { int symmetrical; const char *src; const char *dst; - sg_routing_edge_t gw_src; - sg_routing_edge_t gw_dst; + sg_netcard_t gw_src; + sg_netcard_t gw_dst; xbt_dynar_t link_list; } s_sg_platf_route_cbarg_t; diff --git a/include/simgrid/host.h b/include/simgrid/host.h index 3ddb6a73ce..387eea2c8a 100644 --- a/include/simgrid/host.h +++ b/include/simgrid/host.h @@ -52,8 +52,8 @@ XBT_PUBLIC(void) sg_host_simix_set(sg_host_t host, smx_host_priv_t priv); XBT_PUBLIC(void) sg_host_simix_destroy(sg_host_t host); // ========== RoutingEdge ============ -XBT_PUBLIC(sg_routing_edge_t) sg_host_edge(sg_host_t host); -XBT_PUBLIC(void) sg_host_edge_set(sg_host_t host, sg_routing_edge_t edge); +XBT_PUBLIC(sg_netcard_t) sg_host_edge(sg_host_t host); +XBT_PUBLIC(void) sg_host_edge_set(sg_host_t host, sg_netcard_t edge); XBT_PUBLIC(void) sg_host_edge_destroy(sg_host_t host, int do_callback); diff --git a/include/simgrid/platf.h b/include/simgrid/platf.h index bff42d7fef..d340ed856a 100644 --- a/include/simgrid/platf.h +++ b/include/simgrid/platf.h @@ -19,7 +19,7 @@ static inline char* sg_storage_name(sg_storage_t storage) { return storage->key; } -XBT_PUBLIC(sg_routing_edge_t) sg_routing_edge_by_name_or_null(const char *name); +XBT_PUBLIC(sg_netcard_t) sg_routing_edge_by_name_or_null(const char *name); XBT_PUBLIC(tmgr_trace_t) tmgr_trace_new_from_file(const char *filename); XBT_PUBLIC(tmgr_trace_t) tmgr_trace_new_from_string(const char *id, diff --git a/src/include/surf/surf.h b/src/include/surf/surf.h index 09f0db0416..36bfb089fd 100644 --- a/src/include/surf/surf.h +++ b/src/include/surf/surf.h @@ -1081,7 +1081,7 @@ XBT_PUBLIC_DATA(const char *) surf_AS_get_model(AS_t as); XBT_PUBLIC_DATA(xbt_dynar_t) surf_AS_get_hosts(AS_t as); XBT_PUBLIC_DATA(void) surf_AS_get_graph(AS_t as, xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges); XBT_PUBLIC_DATA(AS_t) surf_platf_get_root(routing_platf_t platf); -XBT_PUBLIC_DATA(e_surf_network_element_type_t) surf_routing_edge_get_rc_type(sg_routing_edge_t edge); +XBT_PUBLIC_DATA(e_surf_network_element_type_t) surf_routing_edge_get_rc_type(sg_netcard_t edge); /*******************************************/ /*** SURF Globals **************************/ @@ -1189,7 +1189,7 @@ void instr_routing_platform_graph_export_graphviz (xbt_graph_t g, const char *fi /********** Routing **********/ void routing_AS_begin(sg_platf_AS_cbarg_t AS); void routing_AS_end(void); -surf_RoutingEdge* routing_add_host(surf_As* as, sg_platf_host_cbarg_t host); +surf_NetCard* routing_add_host(surf_As* as, sg_platf_host_cbarg_t host); void routing_cluster_add_backbone(void* bb); surf_As* routing_get_current(); diff --git a/src/instr/instr_interface.c b/src/instr/instr_interface.c index 9dbed9638f..be6cebe312 100644 --- a/src/instr/instr_interface.c +++ b/src/instr/instr_interface.c @@ -364,10 +364,10 @@ static void instr_user_srcdst_variable(double time, InstrUserVariable what) { xbt_dynar_t route=NULL; - sg_routing_edge_t src_elm = sg_routing_edge_by_name_or_null(src); + sg_netcard_t src_elm = sg_routing_edge_by_name_or_null(src); if(!src_elm) xbt_die("Element '%s' not found!",src); - sg_routing_edge_t dst_elm = sg_routing_edge_by_name_or_null(dst); + sg_netcard_t dst_elm = sg_routing_edge_by_name_or_null(dst); if(!dst_elm) xbt_die("Element '%s' not found!",dst); routing_get_route_and_latency (src_elm, dst_elm, &route,NULL); diff --git a/src/instr/instr_private.h b/src/instr/instr_private.h index f64dbc7536..6a6621230d 100644 --- a/src/instr/instr_private.h +++ b/src/instr/instr_private.h @@ -89,7 +89,7 @@ typedef enum { typedef struct s_container *container_t; typedef struct s_container { - sg_routing_edge_t net_elm; + sg_netcard_t net_elm; char *name; /* Unique name of this container */ char *id; /* Unique id of this container */ type_t type; /* Type of this container */ diff --git a/src/simgrid/host.cpp b/src/simgrid/host.cpp index 233d081757..56c787381c 100644 --- a/src/simgrid/host.cpp +++ b/src/simgrid/host.cpp @@ -73,7 +73,7 @@ void sg_host_init() }); ROUTING_HOST_LEVEL = simgrid::Host::extension_create([](void *p) { - delete static_cast(p); + delete static_cast(p); }); SD_HOST_LEVEL = simgrid::Host::extension_create(__SD_workstation_destroy); @@ -125,10 +125,10 @@ void sg_host_simix_destroy(sg_host_t host) { } // ========== RoutingEdge ============ -surf_RoutingEdge *sg_host_edge(sg_host_t host) { - return (surf_RoutingEdge*) host->extension(ROUTING_HOST_LEVEL); +surf_NetCard *sg_host_edge(sg_host_t host) { + return (surf_NetCard*) host->extension(ROUTING_HOST_LEVEL); } -void sg_host_edge_set(sg_host_t host, surf_RoutingEdge *edge) { +void sg_host_edge_set(sg_host_t host, surf_NetCard *edge) { host->extension_set(ROUTING_HOST_LEVEL, edge); } void sg_host_edge_destroy(sg_host_t host, int do_callback) { diff --git a/src/surf/host_interface.cpp b/src/surf/host_interface.cpp index 6a67a721e2..a639622920 100644 --- a/src/surf/host_interface.cpp +++ b/src/surf/host_interface.cpp @@ -36,7 +36,7 @@ simgrid::xbt::Extension Host::EXTENSION_ID; /********* * Model * *********/ -Host *HostModel::createHost(const char *name,RoutingEdge *netElm, Cpu *cpu, xbt_dict_t props){ +Host *HostModel::createHost(const char *name,NetCard *netElm, Cpu *cpu, xbt_dict_t props){ Host *host = new simgrid::surf::Host(surf_host_model, name, props, (xbt_dynar_t)xbt_lib_get_or_null(storage_lib, name, ROUTING_STORAGE_HOST_LEVEL), netElm, cpu); @@ -96,7 +96,7 @@ void Host::classInit() } Host::Host(simgrid::surf::Model *model, const char *name, xbt_dict_t props, - xbt_dynar_t storage, RoutingEdge *netElm, Cpu *cpu) + xbt_dynar_t storage, NetCard *netElm, Cpu *cpu) : Resource(model, name) , PropertyHolder(props) , p_storage(storage), p_netElm(netElm), p_cpu(cpu) @@ -105,7 +105,7 @@ Host::Host(simgrid::surf::Model *model, const char *name, xbt_dict_t props, } Host::Host(simgrid::surf::Model *model, const char *name, xbt_dict_t props, lmm_constraint_t constraint, - xbt_dynar_t storage, RoutingEdge *netElm, Cpu *cpu) + xbt_dynar_t storage, NetCard *netElm, Cpu *cpu) : Resource(model, name, constraint) , PropertyHolder(props) , p_storage(storage), p_netElm(netElm), p_cpu(cpu) diff --git a/src/surf/host_interface.hpp b/src/surf/host_interface.hpp index 01ceeb6c9d..3177e18ca2 100644 --- a/src/surf/host_interface.hpp +++ b/src/surf/host_interface.hpp @@ -52,7 +52,7 @@ public: HostModel() : Model() {} ~HostModel() {} - Host *createHost(const char *name, RoutingEdge *net, Cpu *cpu, xbt_dict_t props); + Host *createHost(const char *name, NetCard *net, Cpu *cpu, xbt_dict_t props); void addTraces() override {DIE_IMPOSSIBLE;} virtual void adjustWeightOfDummyCpuActions(); @@ -96,7 +96,7 @@ public: * @param cpu The Cpu associated to this Host */ Host(simgrid::surf::Model *model, const char *name, xbt_dict_t props, - xbt_dynar_t storage, RoutingEdge *netElm, Cpu *cpu); + xbt_dynar_t storage, NetCard *netElm, Cpu *cpu); /** * @brief Host constructor @@ -110,7 +110,7 @@ public: * @param cpu The Cpu associated to this Host */ Host(simgrid::surf::Model *model, const char *name, xbt_dict_t props, - lmm_constraint_t constraint, xbt_dynar_t storage, RoutingEdge *netElm, + lmm_constraint_t constraint, xbt_dynar_t storage, NetCard *netElm, Cpu *cpu); /* Host destruction logic */ @@ -242,7 +242,7 @@ public: public: xbt_dynar_t p_storage; - RoutingEdge *p_netElm; + NetCard *p_netElm; Cpu *p_cpu; simgrid::Host* p_host = nullptr; diff --git a/src/surf/host_ptask_L07.cpp b/src/surf/host_ptask_L07.cpp index 6f3675a131..5563153b4f 100644 --- a/src/surf/host_ptask_L07.cpp +++ b/src/surf/host_ptask_L07.cpp @@ -278,7 +278,7 @@ L07Action::L07Action(Model *model, int host_nb, } } -Action *NetworkL07Model::communicate(RoutingEdge *src, RoutingEdge *dst, +Action *NetworkL07Model::communicate(NetCard *src, NetCard *dst, double size, double rate) { sg_host_t*host_list = xbt_new0(sg_host_t, 2); diff --git a/src/surf/host_ptask_L07.hpp b/src/surf/host_ptask_L07.hpp index e21dc4471b..4db4ea2cff 100644 --- a/src/surf/host_ptask_L07.hpp +++ b/src/surf/host_ptask_L07.hpp @@ -81,7 +81,7 @@ public: e_surf_link_sharing_policy_t policy, xbt_dict_t properties) override; - Action *communicate(RoutingEdge *src, RoutingEdge *dst, double size, double rate) override; + Action *communicate(NetCard *src, NetCard *dst, double size, double rate) override; void addTraces() override {DIE_IMPOSSIBLE;}; bool shareResourcesIsIdempotent() override {return true;} @@ -157,7 +157,7 @@ public: void setPriority(double priority) override; double getRemains() override; - std::vector * p_edgeList = new std::vector(); + std::vector * p_edgeList = new std::vector(); double *p_computationAmount; double *p_communicationAmount; double m_latency; diff --git a/src/surf/network_cm02.cpp b/src/surf/network_cm02.cpp index a1ad735e13..a17692f73c 100644 --- a/src/surf/network_cm02.cpp +++ b/src/surf/network_cm02.cpp @@ -347,7 +347,7 @@ void NetworkCm02Model::updateActionsStateFull(double now, double delta) return; } -Action *NetworkCm02Model::communicate(RoutingEdge *src, RoutingEdge *dst, +Action *NetworkCm02Model::communicate(NetCard *src, NetCard *dst, double size, double rate) { unsigned int i; @@ -360,7 +360,7 @@ Action *NetworkCm02Model::communicate(RoutingEdge *src, RoutingEdge *dst, xbt_dynar_t back_route = NULL; int constraints_per_variable = 0; - xbt_dynar_t route = xbt_dynar_new(sizeof(RoutingEdge*), NULL); + xbt_dynar_t route = xbt_dynar_new(sizeof(NetCard*), NULL); XBT_IN("(%s,%s,%g,%g)", src->getName(), dst->getName(), size, rate); diff --git a/src/surf/network_cm02.hpp b/src/surf/network_cm02.hpp index e164901567..8d7e33a266 100644 --- a/src/surf/network_cm02.hpp +++ b/src/surf/network_cm02.hpp @@ -61,7 +61,7 @@ public: void addTraces(); void updateActionsStateLazy(double now, double delta); void updateActionsStateFull(double now, double delta); - Action *communicate(RoutingEdge *src, RoutingEdge *dst, + Action *communicate(NetCard *src, NetCard *dst, double size, double rate); bool shareResourcesIsIdempotent() {return true;} virtual void gapAppend(double /*size*/, const Link* /*link*/, NetworkAction * /*action*/) {}; @@ -98,7 +98,7 @@ public: * Action * **********/ class NetworkCm02Action : public NetworkAction { - friend Action *NetworkCm02Model::communicate(RoutingEdge *src, RoutingEdge *dst, double size, double rate); + friend Action *NetworkCm02Model::communicate(NetCard *src, NetCard *dst, double size, double rate); friend NetworkSmpiModel; public: diff --git a/src/surf/network_constant.cpp b/src/surf/network_constant.cpp index 77488ace5a..0d90ff7148 100644 --- a/src/surf/network_constant.cpp +++ b/src/surf/network_constant.cpp @@ -85,7 +85,7 @@ void NetworkConstantModel::updateActionsState(double /*now*/, double delta) } } -Action *NetworkConstantModel::communicate(RoutingEdge *src, RoutingEdge *dst, +Action *NetworkConstantModel::communicate(NetCard *src, NetCard *dst, double size, double rate) { char *src_name = src->getName(); diff --git a/src/surf/network_constant.hpp b/src/surf/network_constant.hpp index b79c6a5973..8f3e1b9427 100644 --- a/src/surf/network_constant.hpp +++ b/src/surf/network_constant.hpp @@ -29,7 +29,7 @@ public: NetworkConstantModel() : NetworkModel() { }; ~NetworkConstantModel() { } - Action *communicate(RoutingEdge *src, RoutingEdge *dst, double size, double rate); + Action *communicate(NetCard *src, NetCard *dst, double size, double rate); double shareResources(double now); void updateActionsState(double now, double delta); bool shareResourcesIsIdempotent() {return true;} @@ -44,7 +44,7 @@ public: e_surf_link_sharing_policy_t policy, xbt_dict_t properties) { DIE_IMPOSSIBLE; } void addTraces() { DIE_IMPOSSIBLE; } - xbt_dynar_t getRoute(RoutingEdge *src, RoutingEdge *dst) { DIE_IMPOSSIBLE; } + xbt_dynar_t getRoute(NetCard *src, NetCard *dst) { DIE_IMPOSSIBLE; } }; /********** diff --git a/src/surf/network_ib.cpp b/src/surf/network_ib.cpp index bf1390bdcb..1b62f23259 100644 --- a/src/surf/network_ib.cpp +++ b/src/surf/network_ib.cpp @@ -48,7 +48,7 @@ static void IB_action_state_changed_callback( static void IB_action_init_callback( - simgrid::surf::NetworkAction *action, simgrid::surf::RoutingEdge *src, simgrid::surf::RoutingEdge *dst, + simgrid::surf::NetworkAction *action, simgrid::surf::NetCard *src, simgrid::surf::NetCard *dst, double size, double rate) { using namespace simgrid::surf; diff --git a/src/surf/network_interface.cpp b/src/surf/network_interface.cpp index b4708a0d5e..be4bc069fc 100644 --- a/src/surf/network_interface.cpp +++ b/src/surf/network_interface.cpp @@ -100,7 +100,7 @@ simgrid::surf::signal Link::onDestruction; simgrid::surf::signal Link::onStateChange; simgrid::surf::signal networkActionStateChangedCallbacks; -simgrid::surf::signal networkCommunicateCallbacks; +simgrid::surf::signal networkCommunicateCallbacks; } } diff --git a/src/surf/network_interface.hpp b/src/surf/network_interface.hpp index bd6def3522..4cb6b8066a 100644 --- a/src/surf/network_interface.hpp +++ b/src/surf/network_interface.hpp @@ -40,7 +40,7 @@ XBT_PUBLIC_DATA(simgrid::surf::signal) networkCommunicateCallbacks; +XBT_PUBLIC_DATA(simgrid::surf::signal) networkCommunicateCallbacks; } } @@ -114,7 +114,7 @@ public: * unlimited. * @return The action representing the communication */ - virtual Action *communicate(RoutingEdge *src, RoutingEdge *dst, + virtual Action *communicate(NetCard *src, NetCard *dst, double size, double rate)=0; /** @brief Function pointer to the function to use to solve the lmm_system_t diff --git a/src/surf/network_ns3.cpp b/src/surf/network_ns3.cpp index 5e38359996..163de0c20b 100644 --- a/src/surf/network_ns3.cpp +++ b/src/surf/network_ns3.cpp @@ -63,7 +63,7 @@ static void parse_ns3_add_link(sg_platf_link_cbarg_t link) link->properties); } -static void simgrid_ns3_add_router(simgrid::surf::RoutingEdge* router) +static void simgrid_ns3_add_router(simgrid::surf::NetCard* router) { const char* router_id = router->getName(); XBT_DEBUG("NS3_ADD_ROUTER '%s'",router_id); @@ -303,7 +303,7 @@ Link* NetworkNS3Model::createLink(const char *name, return link; } -xbt_dynar_t NetworkNS3Model::getRoute(RoutingEdge *src, RoutingEdge *dst) +xbt_dynar_t NetworkNS3Model::getRoute(NetCard *src, NetCard *dst) { xbt_dynar_t route = NULL; routing_get_route_and_latency(src, dst, &route, NULL); @@ -311,7 +311,7 @@ xbt_dynar_t NetworkNS3Model::getRoute(RoutingEdge *src, RoutingEdge *dst) return route; } -Action *NetworkNS3Model::communicate(RoutingEdge *src, RoutingEdge *dst, +Action *NetworkNS3Model::communicate(NetCard *src, NetCard *dst, double size, double rate) { XBT_DEBUG("Communicate from %s to %s", src->getName(), dst->getName()); diff --git a/src/surf/network_ns3.hpp b/src/surf/network_ns3.hpp index 1923e55e5c..e9c07a04d3 100644 --- a/src/surf/network_ns3.hpp +++ b/src/surf/network_ns3.hpp @@ -52,8 +52,8 @@ public: tmgr_trace_t state_trace, e_surf_link_sharing_policy_t policy, xbt_dict_t properties); - xbt_dynar_t getRoute(RoutingEdge *src, RoutingEdge *dst); - Action *communicate(RoutingEdge *src, RoutingEdge *dst, + xbt_dynar_t getRoute(NetCard *src, NetCard *dst); + Action *communicate(NetCard *src, NetCard *dst, double size, double rate); double shareResources(double now); void updateActionsState(double now, double delta); @@ -101,8 +101,8 @@ void resume(); //private: double m_lastSent; - RoutingEdge *p_srcElm; - RoutingEdge *p_dstElm; + NetCard *p_srcElm; + NetCard *p_dstElm; }; } diff --git a/src/surf/sg_platf.cpp b/src/surf/sg_platf.cpp index 2006197702..7d72227a17 100644 --- a/src/surf/sg_platf.cpp +++ b/src/surf/sg_platf.cpp @@ -55,7 +55,7 @@ void sg_platf_new_host(sg_platf_host_cbarg_t host) xbt_assert(! sg_host_by_name(host->id), "Refusing to create a second host named '%s'.", host->id); - simgrid::surf::RoutingEdge *net = NULL; + simgrid::surf::NetCard *net = NULL; simgrid::surf::As* current_routing = routing_get_current(); if (current_routing) net = routing_add_host(current_routing, host); @@ -88,7 +88,7 @@ void sg_platf_new_router(sg_platf_router_cbarg_t router) "Reading a router, processing unit \"%s\" already exists", router->id); - simgrid::surf::RoutingEdge *info = new simgrid::surf::RoutingEdgeImpl( + simgrid::surf::NetCard *info = new simgrid::surf::RoutingEdgeImpl( xbt_strdup(router->id), -1, SURF_NETWORK_ELEMENT_ROUTER, current_routing); info->setId(current_routing->parsePU(info)); xbt_lib_set(as_router_lib, router->id, ROUTING_ASR_LEVEL, (void *) info); diff --git a/src/surf/surf_c_bindings.cpp b/src/surf/surf_c_bindings.cpp index e557df9342..5214c36eee 100644 --- a/src/surf/surf_c_bindings.cpp +++ b/src/surf/surf_c_bindings.cpp @@ -160,7 +160,7 @@ double surf_solve(double max_date) return surf_min; } -void routing_get_route_and_latency(sg_routing_edge_t src, sg_routing_edge_t dst, +void routing_get_route_and_latency(sg_netcard_t src, sg_netcard_t dst, xbt_dynar_t * route, double *latency){ routing_platf->getRouteAndLatency(src, dst, route, latency); } diff --git a/src/surf/surf_private.h b/src/surf/surf_private.h index 95b3557c23..954a1931d9 100644 --- a/src/surf/surf_private.h +++ b/src/surf/surf_private.h @@ -76,7 +76,7 @@ XBT_PUBLIC(void) generic_free_route(sg_platf_route_cbarg_t route); // FIXME rena // FIXME: make previous function private to routing again? -XBT_PUBLIC(void) routing_get_route_and_latency(sg_routing_edge_t src, sg_routing_edge_t dst, +XBT_PUBLIC(void) routing_get_route_and_latency(sg_netcard_t src, sg_netcard_t dst, xbt_dynar_t * route, double *latency); XBT_PUBLIC(void) generic_get_graph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges, AS_t rc); diff --git a/src/surf/surf_routing.cpp b/src/surf/surf_routing.cpp index 719d130698..14ea442a42 100644 --- a/src/surf/surf_routing.cpp +++ b/src/surf/surf_routing.cpp @@ -23,7 +23,7 @@ namespace simgrid { namespace surf { -simgrid::surf::signal routingEdgeCreatedCallbacks; +simgrid::surf::signal routingEdgeCreatedCallbacks; simgrid::surf::signal asCreatedCallbacks; } @@ -56,12 +56,12 @@ static xbt_dict_t random_value = NULL; * * Routing edges are either host and routers, whatever */ -simgrid::surf::RoutingEdge *sg_routing_edge_by_name_or_null(const char *name) +simgrid::surf::NetCard *sg_routing_edge_by_name_or_null(const char *name) { sg_host_t h = sg_host_by_name(name); - simgrid::surf::RoutingEdge *net_elm = h==NULL?NULL: sg_host_edge(h); + simgrid::surf::NetCard *net_elm = h==NULL?NULL: sg_host_edge(h); if (!net_elm) - net_elm = (simgrid::surf::RoutingEdge*) xbt_lib_get_or_null(as_router_lib, name, ROUTING_ASR_LEVEL); + net_elm = (simgrid::surf::NetCard*) xbt_lib_get_or_null(as_router_lib, name, ROUTING_ASR_LEVEL); return net_elm; } @@ -128,7 +128,7 @@ struct s_model_type routing_models[] = { */ void sg_platf_new_host_link(sg_platf_host_link_cbarg_t host) { - simgrid::surf::RoutingEdge *info = sg_host_edge(sg_host_by_name(host->id)); + simgrid::surf::NetCard *info = sg_host_edge(sg_host_by_name(host->id)); xbt_assert(info, "Host '%s' not found!", host->id); xbt_assert(current_routing->p_modelDesc == &routing_models[SURF_MODEL_CLUSTER] || current_routing->p_modelDesc == &routing_models[SURF_MODEL_VIVALDI], @@ -156,7 +156,7 @@ void sg_platf_new_host_link(sg_platf_host_link_cbarg_t host) /** * \brief Add a "host" to the network element list */ -simgrid::surf::RoutingEdge *routing_add_host( +simgrid::surf::NetCard *routing_add_host( simgrid::surf::As* current_routing, sg_platf_host_cbarg_t host) { if (current_routing->p_hierarchy == SURF_ROUTING_NULL) @@ -164,7 +164,7 @@ simgrid::surf::RoutingEdge *routing_add_host( xbt_assert(!sg_host_by_name(host->id), "Reading a host, processing unit \"%s\" already exists", host->id); - simgrid::surf::RoutingEdge *routingEdge = + simgrid::surf::NetCard *routingEdge = new simgrid::surf::RoutingEdgeImpl(xbt_strdup(host->id), -1, SURF_NETWORK_ELEMENT_HOST, @@ -315,7 +315,7 @@ void routing_AS_begin(sg_platf_AS_cbarg_t AS) new_as->p_hierarchy = SURF_ROUTING_NULL; new_as->p_name = xbt_strdup(AS->id); - simgrid::surf::RoutingEdge *info = + simgrid::surf::NetCard *info = new simgrid::surf::RoutingEdgeImpl(xbt_strdup(new_as->p_name), -1, SURF_NETWORK_ELEMENT_AS, @@ -391,7 +391,7 @@ void routing_AS_end() * Get the common father of the to processing units, and the first different * father in the chain */ -static void elements_father(sg_routing_edge_t src, sg_routing_edge_t dst, +static void elements_father(sg_netcard_t src, sg_netcard_t dst, AS_t * res_father, AS_t * res_src, AS_t * res_dst) @@ -409,8 +409,8 @@ static void elements_father(sg_routing_edge_t src, sg_routing_edge_t dst, simgrid::surf::As *father; /* (1) find the as where the src and dst are located */ - sg_routing_edge_t src_data = src; - sg_routing_edge_t dst_data = dst; + sg_netcard_t src_data = src; + sg_netcard_t dst_data = dst; src_as = src_data->getRcComponent(); dst_as = dst_data->getRcComponent(); #ifndef NDEBUG @@ -467,7 +467,7 @@ static void elements_father(sg_routing_edge_t src, sg_routing_edge_t dst, * recursively through the ASes tree. */ static void _get_route_and_latency( - simgrid::surf::RoutingEdge *src, simgrid::surf::RoutingEdge *dst, + simgrid::surf::NetCard *src, simgrid::surf::NetCard *dst, xbt_dynar_t * links, double *latency) { s_sg_platf_route_cbarg_t route = SG_PLATF_ROUTE_INITIALIZER; @@ -507,8 +507,8 @@ static void _get_route_and_latency( route.link_list = xbt_dynar_new(sizeof(sg_routing_link_t), NULL); // Find the net_card corresponding to father - simgrid::surf::RoutingEdge *src_father_net_elm = src_father->p_netElem; - simgrid::surf::RoutingEdge *dst_father_net_elm = dst_father->p_netElem; + simgrid::surf::NetCard *src_father_net_elm = src_father->p_netElem; + simgrid::surf::NetCard *dst_father_net_elm = dst_father->p_netElem; common_father->getRouteAndLatency(src_father_net_elm, dst_father_net_elm, &route, latency); @@ -516,8 +516,8 @@ static void _get_route_and_latency( xbt_assert((route.gw_src != NULL) && (route.gw_dst != NULL), "bad gateways for route from \"%s\" to \"%s\"", src->getName(), dst->getName()); - sg_routing_edge_t src_gateway_net_elm = route.gw_src; - sg_routing_edge_t dst_gateway_net_elm = route.gw_dst; + sg_netcard_t src_gateway_net_elm = route.gw_src; + sg_netcard_t dst_gateway_net_elm = route.gw_dst; /* If source gateway is not our source, we have to recursively find our way up to this point */ if (src != src_gateway_net_elm) @@ -535,7 +535,7 @@ AS_t surf_platf_get_root(routing_platf_t platf){ return platf->p_root; } -e_surf_network_element_type_t surf_routing_edge_get_rc_type(sg_routing_edge_t edge){ +e_surf_network_element_type_t surf_routing_edge_get_rc_type(sg_netcard_t edge){ return edge->getRcType(); } @@ -557,7 +557,7 @@ namespace surf { * by calling the differents "get_route" functions in each routing component. */ void RoutingPlatf::getRouteAndLatency( - simgrid::surf::RoutingEdge *src, simgrid::surf::RoutingEdge *dst, + simgrid::surf::NetCard *src, simgrid::surf::NetCard *dst, xbt_dynar_t* route, double *latency) { XBT_DEBUG("routing_get_route_and_latency from %s to %s", src->getName(), dst->getName()); @@ -602,7 +602,7 @@ xbt_dynar_t RoutingPlatf::recursiveGetOneLinkRoutes(As *rc) e_surf_network_element_type_t routing_get_network_element_type(const char *name) { - simgrid::surf::RoutingEdge *rc = sg_routing_edge_by_name_or_null(name); + simgrid::surf::NetCard *rc = sg_routing_edge_by_name_or_null(name); if (rc) return rc->getRcType(); @@ -983,7 +983,7 @@ void routing_new_cluster(sg_platf_cluster_cbarg_t cluster) bprintf("%s%s_router%s", cluster->prefix, cluster->id, cluster->suffix); sg_platf_new_router(&router); - ((AsCluster*)current_routing)->p_router = (simgrid::surf::RoutingEdge*) xbt_lib_get_or_null(as_router_lib, router.id, ROUTING_ASR_LEVEL); + ((AsCluster*)current_routing)->p_router = (simgrid::surf::NetCard*) xbt_lib_get_or_null(as_router_lib, router.id, ROUTING_ASR_LEVEL); free(newid); //Make the backbone @@ -1018,7 +1018,7 @@ static void routing_parse_postparse(void) { void sg_platf_new_peer(sg_platf_peer_cbarg_t peer) { - using simgrid::surf::RoutingEdge; + using simgrid::surf::NetCard; using simgrid::surf::AsCluster; char *host_id = NULL; @@ -1089,7 +1089,7 @@ void sg_platf_new_peer(sg_platf_peer_cbarg_t peer) router.id = router_id; router.coord = peer->coord; sg_platf_new_router(&router); - static_cast(current_routing)->p_router = static_cast(xbt_lib_get_or_null(as_router_lib, router.id, ROUTING_ASR_LEVEL)); + static_cast(current_routing)->p_router = static_cast(xbt_lib_get_or_null(as_router_lib, router.id, ROUTING_ASR_LEVEL)); XBT_DEBUG(""); sg_platf_new_AS_end(); @@ -1228,7 +1228,7 @@ static void check_disk_attachment() xbt_lib_cursor_t cursor; char *key; void **data; - simgrid::surf::RoutingEdge *host_elm; + simgrid::surf::NetCard *host_elm; xbt_lib_foreach(storage_lib, cursor, key, data) { if(xbt_lib_get_level(xbt_lib_get_elm_or_null(storage_lib, key), SURF_STORAGE_LEVEL) != NULL) { simgrid::surf::Storage *storage = static_cast(xbt_lib_get_level(xbt_lib_get_elm_or_null(storage_lib, key), SURF_STORAGE_LEVEL)); @@ -1336,8 +1336,8 @@ xbt_dynar_t surf_AS_get_hosts(simgrid::surf::As *as) int count = xbt_dynar_length(elms); xbt_dynar_t res = xbt_dynar_new(sizeof(sg_host_t), NULL); for (int index = 0; index < count; index++) { - sg_routing_edge_t relm = - xbt_dynar_get_as(elms, index, simgrid::surf::RoutingEdge*); + sg_netcard_t relm = + xbt_dynar_get_as(elms, index, simgrid::surf::NetCard*); sg_host_t delm = simgrid::Host::by_name_or_null(relm->getName()); if (delm!=NULL) { xbt_dynar_push(res, &delm); diff --git a/src/surf/surf_routing.hpp b/src/surf/surf_routing.hpp index f7ab0d0dab..0b6fb7446b 100644 --- a/src/surf/surf_routing.hpp +++ b/src/surf/surf_routing.hpp @@ -27,12 +27,12 @@ class XBT_PRIVATE Onelink; class RoutingPlatf; /** @ingroup SURF_routing_interface - * @brief A routing edge - * @details [long description] + * @brief A network card + * @details This represents a position in the network. One can route information between two netcards */ -class RoutingEdge { +class NetCard { public: - virtual ~RoutingEdge(){}; + virtual ~NetCard(){}; virtual int getId()=0; virtual int *getIdPtr()=0; virtual void setId(int id)=0; @@ -54,7 +54,7 @@ public: char *p_name; As *p_routingFather; xbt_dict_t p_routingSons; - RoutingEdge *p_netElem; + NetCard *p_netElem; xbt_dynar_t p_linkUpDownList; /** @@ -81,26 +81,26 @@ public: * @param latency [description] */ virtual void getRouteAndLatency( - RoutingEdge *src, RoutingEdge *dst, + NetCard *src, NetCard *dst, sg_platf_route_cbarg_t into, double *latency)=0; virtual xbt_dynar_t getOneLinkRoutes()=0; virtual void getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges)=0; virtual sg_platf_route_cbarg_t getBypassRoute( - RoutingEdge *src, RoutingEdge *dst, + NetCard *src, NetCard *dst, double *lat)=0; /* The parser calls the following functions to inform the routing models * that a new element is added to the AS currently built. * * Of course, only the routing model of this AS is informed, not every ones */ - virtual int parsePU(RoutingEdge *elm)=0; /* A host or a router, whatever */ - virtual int parseAS(RoutingEdge *elm)=0; + virtual int parsePU(NetCard *elm)=0; /* A host or a router, whatever */ + virtual int parseAS(NetCard *elm)=0; virtual void parseRoute(sg_platf_route_cbarg_t route)=0; virtual void parseASroute(sg_platf_route_cbarg_t route)=0; virtual void parseBypassroute(sg_platf_route_cbarg_t e_route)=0; }; -struct XBT_PRIVATE RoutingEdgeImpl : public RoutingEdge { +struct XBT_PRIVATE RoutingEdgeImpl : public NetCard { public: RoutingEdgeImpl(char *name, int id, e_surf_network_element_type_t rcType, As *rcComponent) : p_rcComponent(rcComponent), p_rcType(rcType), m_id(id), p_name(name) {} @@ -119,9 +119,9 @@ private: char *p_name; }; -struct RoutingEdgeWrapper : public RoutingEdge { +struct RoutingEdgeWrapper : public NetCard { public: - RoutingEdgeWrapper(RoutingEdge *re) : p_re(re){} + RoutingEdgeWrapper(NetCard *re) : p_re(re){} ~RoutingEdgeWrapper(){} int getId() {return p_re->getId();} int *getIdPtr() {return p_re->getIdPtr();} @@ -130,7 +130,7 @@ public: As *getRcComponent() {return p_re->getRcComponent();} e_surf_network_element_type_t getRcType() {return p_re->getRcType();} private: - RoutingEdge *p_re; + NetCard *p_re; }; /** @ingroup SURF_routing_interface @@ -138,10 +138,10 @@ private: */ class Onelink { public: - Onelink(void *link, RoutingEdge *src, RoutingEdge *dst) + Onelink(void *link, NetCard *src, NetCard *dst) : p_src(src), p_dst(dst), p_link(link) {}; - RoutingEdge *p_src; - RoutingEdge *p_dst; + NetCard *p_src; + NetCard *p_dst; void *p_link; }; @@ -156,14 +156,14 @@ public: xbt_dynar_t p_lastRoute; xbt_dynar_t getOneLinkRoutes(void); xbt_dynar_t recursiveGetOneLinkRoutes(As *rc); - void getRouteAndLatency(RoutingEdge *src, RoutingEdge *dst, xbt_dynar_t * links, double *latency); + void getRouteAndLatency(NetCard *src, NetCard *dst, xbt_dynar_t * links, double *latency); }; /************* * Callbacks * *************/ -XBT_PUBLIC_DATA(simgrid::surf::signal) routingEdgeCreatedCallbacks; +XBT_PUBLIC_DATA(simgrid::surf::signal) routingEdgeCreatedCallbacks; XBT_PUBLIC_DATA(simgrid::surf::signal) asCreatedCallbacks; } diff --git a/src/surf/surf_routing_cluster.cpp b/src/surf/surf_routing_cluster.cpp index bf0564b571..04f9da6c22 100644 --- a/src/surf/surf_routing_cluster.cpp +++ b/src/surf/surf_routing_cluster.cpp @@ -33,7 +33,7 @@ AsCluster::AsCluster() : AsNone() } /* Business methods */ -void AsCluster::getRouteAndLatency(RoutingEdge *src, RoutingEdge *dst, sg_platf_route_cbarg_t route, double *lat) +void AsCluster::getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbarg_t route, double *lat) { s_surf_parsing_link_up_down_t info; XBT_VERB("cluster_get_route_and_latency from '%s'[%d] to '%s'[%d]", @@ -91,7 +91,7 @@ void AsCluster::getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges) int isrc; int table_size = xbt_dynar_length(p_indexNetworkElm); - RoutingEdge *src; + NetCard *src; xbt_node_t current, previous, backboneNode = NULL, routerNode; s_surf_parsing_link_up_down_t info; @@ -109,7 +109,7 @@ void AsCluster::getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges) } for (isrc = 0; isrc < table_size; isrc++) { - src = xbt_dynar_get_as(p_indexNetworkElm, isrc, RoutingEdge*); + src = xbt_dynar_get_as(p_indexNetworkElm, isrc, NetCard*); if (src->getRcType() != SURF_NETWORK_ELEMENT_ROUTER) { previous = new_xbt_graph_node(graph, src->getName(), nodes); @@ -176,15 +176,15 @@ void AsCluster::create_links_for_node(sg_platf_cluster_cbarg_t cluster, int id, xbt_free(link_id); } -int AsCluster::parsePU(RoutingEdge *elm) { +int AsCluster::parsePU(NetCard *elm) { XBT_DEBUG("Load process unit \"%s\"", elm->getName()); - xbt_dynar_push_as(p_indexNetworkElm, RoutingEdge*, elm); + xbt_dynar_push_as(p_indexNetworkElm, NetCard*, elm); return xbt_dynar_length(p_indexNetworkElm)-1; } -int AsCluster::parseAS(RoutingEdge *elm) { +int AsCluster::parseAS(NetCard *elm) { XBT_DEBUG("Load Autonomous system \"%s\"", elm->getName()); - xbt_dynar_push_as(p_indexNetworkElm, RoutingEdge*, elm); + xbt_dynar_push_as(p_indexNetworkElm, NetCard*, elm); return xbt_dynar_length(p_indexNetworkElm)-1; } diff --git a/src/surf/surf_routing_cluster.hpp b/src/surf/surf_routing_cluster.hpp index 4588624f5f..4cdb430327 100644 --- a/src/surf/surf_routing_cluster.hpp +++ b/src/surf/surf_routing_cluster.hpp @@ -28,7 +28,7 @@ class AsCluster: public AsNone { public: AsCluster(); - virtual void getRouteAndLatency(RoutingEdge *src, RoutingEdge *dst, sg_platf_route_cbarg_t into, double *latency); + virtual void getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbarg_t into, double *latency); //xbt_dynar_t getOneLinkRoutes(); //void parseRoute(sg_platf_route_cbarg_t route); //void parseASroute(sg_platf_route_cbarg_t route); @@ -40,12 +40,12 @@ public: * that a new element is added to the AS currently built. * * Of course, only the routing model of this AS is informed, not every ones */ - int parsePU(RoutingEdge *elm); /* A host or a router, whatever */ - int parseAS(RoutingEdge *elm); + int parsePU(NetCard *elm); /* A host or a router, whatever */ + int parseAS(NetCard *elm); virtual void create_links_for_node(sg_platf_cluster_cbarg_t cluster, int id, int rank, int position); Link* p_backbone; void *p_loopback; - RoutingEdge *p_router; + NetCard *p_router; int p_has_limiter; int p_has_loopback; int p_nb_links_per_node; diff --git a/src/surf/surf_routing_cluster_fat_tree.cpp b/src/surf/surf_routing_cluster_fat_tree.cpp index 83bd2ebe93..83ca962cb6 100644 --- a/src/surf/surf_routing_cluster_fat_tree.cpp +++ b/src/surf/surf_routing_cluster_fat_tree.cpp @@ -58,8 +58,8 @@ bool AsClusterFatTree::isInSubTree(FatTreeNode *root, FatTreeNode *node) { return true; } -void AsClusterFatTree::getRouteAndLatency(RoutingEdge *src, - RoutingEdge *dst, +void AsClusterFatTree::getRouteAndLatency(NetCard *src, + NetCard *dst, sg_platf_route_cbarg_t into, double *latency) { FatTreeNode *source, *destination, *currentNode; diff --git a/src/surf/surf_routing_cluster_fat_tree.hpp b/src/surf/surf_routing_cluster_fat_tree.hpp index 8aae47c2ea..30253876e8 100644 --- a/src/surf/surf_routing_cluster_fat_tree.hpp +++ b/src/surf/surf_routing_cluster_fat_tree.hpp @@ -119,7 +119,7 @@ class XBT_PRIVATE AsClusterFatTree : public AsCluster { public: AsClusterFatTree(); ~AsClusterFatTree(); - virtual void getRouteAndLatency(RoutingEdge *src, RoutingEdge *dst, + virtual void getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbarg_t into, double *latency); diff --git a/src/surf/surf_routing_cluster_torus.cpp b/src/surf/surf_routing_cluster_torus.cpp index 12d08df0ca..645a313d92 100644 --- a/src/surf/surf_routing_cluster_torus.cpp +++ b/src/surf/surf_routing_cluster_torus.cpp @@ -121,7 +121,7 @@ void AsClusterTorus::parse_specific_arguments(sg_platf_cluster_cbarg_t cluster){ xbt_dynar_free(&dimensions); } -void AsClusterTorus::getRouteAndLatency(RoutingEdge *src, RoutingEdge *dst, sg_platf_route_cbarg_t route, double *lat){ +void AsClusterTorus::getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbarg_t route, double *lat){ XBT_VERB("torus_get_route_and_latency from '%s'[%d] to '%s'[%d]", src->getName(), src->getId(), diff --git a/src/surf/surf_routing_cluster_torus.hpp b/src/surf/surf_routing_cluster_torus.hpp index cb74764c19..d6de7a0402 100644 --- a/src/surf/surf_routing_cluster_torus.hpp +++ b/src/surf/surf_routing_cluster_torus.hpp @@ -22,7 +22,7 @@ public: AsClusterTorus(); virtual ~AsClusterTorus(); virtual void create_links_for_node(sg_platf_cluster_cbarg_t cluster, int id, int rank, int position); - virtual void getRouteAndLatency(RoutingEdge *src, RoutingEdge *dst, sg_platf_route_cbarg_t into, double *latency); + virtual void getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbarg_t into, double *latency); void parse_specific_arguments(sg_platf_cluster_cbarg_t cluster); xbt_dynar_t p_dimensions; }; diff --git a/src/surf/surf_routing_dijkstra.cpp b/src/surf/surf_routing_dijkstra.cpp index 28ed73238b..cb0ac0de27 100644 --- a/src/surf/surf_routing_dijkstra.cpp +++ b/src/surf/surf_routing_dijkstra.cpp @@ -182,13 +182,13 @@ xbt_dynar_t AsDijkstra::getOnelinkRoutes() route->link_list = xbt_dynar_new(sizeof(sg_routing_link_t),NULL); int src,dst; - RoutingEdge *src_elm, *dst_elm; + NetCard *src_elm, *dst_elm; int table_size = (int)xbt_dynar_length(p_indexNetworkElm); for(src=0; src < table_size; src++) { for(dst=0; dst< table_size; dst++) { xbt_dynar_reset(route->link_list); - src_elm = xbt_dynar_get_as(p_indexNetworkElm, src, RoutingEdge*); - dst_elm = xbt_dynar_get_as(p_indexNetworkElm, dst, RoutingEdge*); + src_elm = xbt_dynar_get_as(p_indexNetworkElm, src, NetCard*); + dst_elm = xbt_dynar_get_as(p_indexNetworkElm, dst, NetCard*); this->getRouteAndLatency(src_elm, dst_elm,route, NULL); if (xbt_dynar_length(route->link_list) == 1) { @@ -207,7 +207,7 @@ xbt_dynar_t AsDijkstra::getOnelinkRoutes() return ret; } -void AsDijkstra::getRouteAndLatency(RoutingEdge *src, RoutingEdge *dst, sg_platf_route_cbarg_t route, double *lat) +void AsDijkstra::getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbarg_t route, double *lat) { /* set utils vars */ @@ -331,8 +331,8 @@ void AsDijkstra::getRouteAndLatency(RoutingEdge *src, RoutingEdge *dst, sg_platf } /* compose route path with links */ - RoutingEdge *gw_src = NULL, *gw_dst, *prev_gw_src, *first_gw = NULL; - RoutingEdge *gw_dst_net_elm = NULL, *prev_gw_src_net_elm = NULL; + NetCard *gw_src = NULL, *gw_dst, *prev_gw_src, *first_gw = NULL; + NetCard *gw_dst_net_elm = NULL, *prev_gw_src_net_elm = NULL; for (v = dst_node_id; v != src_node_id; v = pred_arr[v]) { xbt_node_t node_pred_v = @@ -481,7 +481,7 @@ void AsDijkstra::parseRoute(sg_platf_route_cbarg_t route) surf_parse_error("The gw_src '%s' does not exist!",route->gw_src->getName()); } - RoutingEdge *src_net_elm, *dst_net_elm; + NetCard *src_net_elm, *dst_net_elm; src_net_elm = sg_routing_edge_by_name_or_null(src); dst_net_elm = sg_routing_edge_by_name_or_null(dst); @@ -522,7 +522,7 @@ void AsDijkstra::parseRoute(sg_platf_route_cbarg_t route) THROWF(arg_error,0,"(AS)Route from '%s' to '%s' already exists",src,dst); if (route->gw_dst && route->gw_src) { - RoutingEdge *gw_tmp; + NetCard *gw_tmp; gw_tmp = route->gw_src; route->gw_src = route->gw_dst; route->gw_dst = gw_tmp; diff --git a/src/surf/surf_routing_dijkstra.hpp b/src/surf/surf_routing_dijkstra.hpp index 0cc6908837..9450b2e446 100644 --- a/src/surf/surf_routing_dijkstra.hpp +++ b/src/surf/surf_routing_dijkstra.hpp @@ -55,7 +55,7 @@ public: * will have a loopback attached to it. */ void addLoopback(); - void getRouteAndLatency(RoutingEdge *src, RoutingEdge *dst, sg_platf_route_cbarg_t route, double *lat); + void getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbarg_t route, double *lat); xbt_dynar_t getOnelinkRoutes(); void getRouteAndLatency(sg_platf_route_cbarg_t route, double *lat); void parseASroute(sg_platf_route_cbarg_t route); diff --git a/src/surf/surf_routing_floyd.cpp b/src/surf/surf_routing_floyd.cpp index 8309a02721..1c20aebdc2 100644 --- a/src/surf/surf_routing_floyd.cpp +++ b/src/surf/surf_routing_floyd.cpp @@ -59,13 +59,13 @@ xbt_dynar_t AsFloyd::getOneLinkRoutes() route->link_list = xbt_dynar_new(sizeof(sg_routing_link_t), NULL); int src,dst; - sg_routing_edge_t src_elm, dst_elm; + sg_netcard_t src_elm, dst_elm; int table_size = xbt_dynar_length(p_indexNetworkElm); for(src=0; src < table_size; src++) { for(dst=0; dst< table_size; dst++) { xbt_dynar_reset(route->link_list); - src_elm = xbt_dynar_get_as(p_indexNetworkElm, src, RoutingEdge*); - dst_elm = xbt_dynar_get_as(p_indexNetworkElm, dst, RoutingEdge*); + src_elm = xbt_dynar_get_as(p_indexNetworkElm, src, NetCard*); + dst_elm = xbt_dynar_get_as(p_indexNetworkElm, dst, NetCard*); this->getRouteAndLatency(src_elm, dst_elm, route, NULL); if (xbt_dynar_length(route->link_list) == 1) { @@ -85,7 +85,7 @@ xbt_dynar_t AsFloyd::getOneLinkRoutes() return ret; } -void AsFloyd::getRouteAndLatency(RoutingEdge *src, RoutingEdge *dst, sg_platf_route_cbarg_t res, double *lat) +void AsFloyd::getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbarg_t res, double *lat) { /* set utils vars */ @@ -110,7 +110,7 @@ void AsFloyd::getRouteAndLatency(RoutingEdge *src, RoutingEdge *dst, sg_platf_ro res->gw_dst = xbt_dynar_getfirst_as(route_stack, sg_platf_route_cbarg_t)->gw_dst; } - sg_routing_edge_t prev_dst_gw = NULL; + sg_netcard_t prev_dst_gw = NULL; while (!xbt_dynar_is_empty(route_stack)) { sg_platf_route_cbarg_t e_route = xbt_dynar_pop_as(route_stack, sg_platf_route_cbarg_t); xbt_dynar_t links; @@ -152,7 +152,7 @@ void AsFloyd::parseRoute(sg_platf_route_cbarg_t route) /* set the size of table routing */ int table_size = (int)xbt_dynar_length(p_indexNetworkElm); - RoutingEdge *src_net_elm, *dst_net_elm; + NetCard *src_net_elm, *dst_net_elm; src_net_elm = sg_routing_edge_by_name_or_null(src); dst_net_elm = sg_routing_edge_by_name_or_null(dst); @@ -246,8 +246,8 @@ void AsFloyd::parseRoute(sg_platf_route_cbarg_t route) { if(route->gw_dst && route->gw_src) { - sg_routing_edge_t gw_src = route->gw_src; - sg_routing_edge_t gw_dst = route->gw_dst; + sg_netcard_t gw_src = route->gw_src; + sg_netcard_t gw_dst = route->gw_dst; route->gw_src = gw_dst; route->gw_dst = gw_src; } diff --git a/src/surf/surf_routing_floyd.hpp b/src/surf/surf_routing_floyd.hpp index 761969747d..1302a84e9b 100644 --- a/src/surf/surf_routing_floyd.hpp +++ b/src/surf/surf_routing_floyd.hpp @@ -25,7 +25,7 @@ public: AsFloyd(); ~AsFloyd(); - void getRouteAndLatency(RoutingEdge *src, RoutingEdge *dst, sg_platf_route_cbarg_t into, double *latency); + void getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbarg_t into, double *latency); xbt_dynar_t getOneLinkRoutes(); void parseASroute(sg_platf_route_cbarg_t route); void parseRoute(sg_platf_route_cbarg_t route); diff --git a/src/surf/surf_routing_full.cpp b/src/surf/surf_routing_full.cpp index 2855d52f10..da22330ec4 100644 --- a/src/surf/surf_routing_full.cpp +++ b/src/surf/surf_routing_full.cpp @@ -83,9 +83,9 @@ xbt_dynar_t AsFull::getOneLinkRoutes() void *link = *(void **) xbt_dynar_get_ptr(route->link_list, 0); Onelink *onelink; if (p_hierarchy == SURF_ROUTING_BASE) { - RoutingEdge *tmp_src = xbt_dynar_get_as(p_indexNetworkElm, src, sg_routing_edge_t); + NetCard *tmp_src = xbt_dynar_get_as(p_indexNetworkElm, src, sg_netcard_t); tmp_src->setId(src); - RoutingEdge *tmp_dst = xbt_dynar_get_as(p_indexNetworkElm, dst, sg_routing_edge_t); + NetCard *tmp_dst = xbt_dynar_get_as(p_indexNetworkElm, dst, sg_netcard_t); tmp_dst->setId(dst); onelink = new Onelink(link, tmp_src, tmp_dst); } else if (p_hierarchy == SURF_ROUTING_RECURSIVE) @@ -103,7 +103,7 @@ xbt_dynar_t AsFull::getOneLinkRoutes() return ret; } -void AsFull::getRouteAndLatency(RoutingEdge *src, RoutingEdge *dst, sg_platf_route_cbarg_t res, double *lat) +void AsFull::getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbarg_t res, double *lat) { XBT_DEBUG("full_get_route_and_latency from %s[%d] to %s[%d]", src->getName(), @@ -145,7 +145,7 @@ void AsFull::parseRoute(sg_platf_route_cbarg_t route) int as_route = 0; char *src = (char*)(route->src); char *dst = (char*)(route->dst); - RoutingEdge *src_net_elm, *dst_net_elm; + NetCard *src_net_elm, *dst_net_elm; src_net_elm = sg_routing_edge_by_name_or_null(src); dst_net_elm = sg_routing_edge_by_name_or_null(dst); @@ -233,7 +233,7 @@ void AsFull::parseRoute(sg_platf_route_cbarg_t route) || (route->symmetrical == TRUE && as_route == 1) ) { if (route->gw_dst && route->gw_src) { - sg_routing_edge_t gw_tmp; + sg_netcard_t gw_tmp; gw_tmp = route->gw_src; route->gw_src = route->gw_dst; route->gw_dst = gw_tmp; diff --git a/src/surf/surf_routing_full.hpp b/src/surf/surf_routing_full.hpp index e9b747492d..4a6676f926 100644 --- a/src/surf/surf_routing_full.hpp +++ b/src/surf/surf_routing_full.hpp @@ -26,7 +26,7 @@ public: AsFull(); ~AsFull(); - void getRouteAndLatency(RoutingEdge *src, RoutingEdge *dst, sg_platf_route_cbarg_t into, double *latency); + void getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbarg_t into, double *latency); xbt_dynar_t getOneLinkRoutes(); void parseRoute(sg_platf_route_cbarg_t route); void parseASroute(sg_platf_route_cbarg_t route); diff --git a/src/surf/surf_routing_generic.cpp b/src/surf/surf_routing_generic.cpp index 84bbba4f90..8882b3aba3 100644 --- a/src/surf/surf_routing_generic.cpp +++ b/src/surf/surf_routing_generic.cpp @@ -43,7 +43,7 @@ void AsGeneric::parseASroute(sg_platf_route_cbarg_t /*route*/){ THROW_IMPOSSIBLE; } -void AsGeneric::getRouteAndLatency(RoutingEdge */*src*/, RoutingEdge */*dst*/, sg_platf_route_cbarg_t /*into*/, double */*latency*/){ +void AsGeneric::getRouteAndLatency(NetCard */*src*/, NetCard */*dst*/, sg_platf_route_cbarg_t /*into*/, double */*latency*/){ THROW_IMPOSSIBLE; } @@ -55,17 +55,17 @@ AsGeneric::~AsGeneric() { xbt_dict_free(&p_bypassRoutes); } -int AsGeneric::parsePU(RoutingEdge *elm) +int AsGeneric::parsePU(NetCard *elm) { XBT_DEBUG("Load process unit \"%s\"", elm->getName()); - xbt_dynar_push_as(p_indexNetworkElm, RoutingEdge*, elm); + xbt_dynar_push_as(p_indexNetworkElm, NetCard*, elm); return xbt_dynar_length(p_indexNetworkElm)-1; } -int AsGeneric::parseAS(RoutingEdge *elm) +int AsGeneric::parseAS(NetCard *elm) { XBT_DEBUG("Load Autonomous system \"%s\"", elm->getName()); - xbt_dynar_push_as(p_indexNetworkElm, RoutingEdge*, elm); + xbt_dynar_push_as(p_indexNetworkElm, NetCard*, elm); return xbt_dynar_length(p_indexNetworkElm)-1; } @@ -168,13 +168,13 @@ void AsGeneric::getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges) for (src = 0; src < table_size; src++) { - RoutingEdge *my_src = - xbt_dynar_get_as(p_indexNetworkElm, src, RoutingEdge*); + NetCard *my_src = + xbt_dynar_get_as(p_indexNetworkElm, src, NetCard*); for (dst = 0; dst < table_size; dst++) { if (src == dst) continue; - RoutingEdge *my_dst = - xbt_dynar_get_as(p_indexNetworkElm, dst, RoutingEdge*); + NetCard *my_dst = + xbt_dynar_get_as(p_indexNetworkElm, dst, NetCard*); sg_platf_route_cbarg_t route = xbt_new0(s_sg_platf_route_cbarg_t, 1); route->link_list = xbt_dynar_new(sizeof(sg_routing_link_t), NULL); @@ -224,8 +224,8 @@ void AsGeneric::getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges) } } -sg_platf_route_cbarg_t AsGeneric::getBypassRoute(RoutingEdge *src, - RoutingEdge *dst, +sg_platf_route_cbarg_t AsGeneric::getBypassRoute(NetCard *src, + NetCard *dst, double *lat) { // If never set a bypass route return NULL without any further computations @@ -427,7 +427,7 @@ As *AsGeneric::autonomousSystemExist(char *element) As *element_as, *result, *elem; xbt_dict_cursor_t cursor = NULL; char *key; - element_as = ((RoutingEdge*) + element_as = ((NetCard*) xbt_lib_get_or_null(as_router_lib, element, ROUTING_ASR_LEVEL))->getRcComponent(); result = ((As*) - 1); @@ -455,7 +455,7 @@ As *AsGeneric::processingUnitsExist(char *element) return asExist(element_as); } -void AsGeneric::srcDstCheck(RoutingEdge *src, RoutingEdge *dst) +void AsGeneric::srcDstCheck(NetCard *src, NetCard *dst) { if (src == NULL || dst == NULL) xbt_die("Ask for route \"from\"(%s) or \"to\"(%s) no found at AS \"%s\"", diff --git a/src/surf/surf_routing_generic.hpp b/src/surf/surf_routing_generic.hpp index f01fdd9767..69ba2e9e56 100644 --- a/src/surf/surf_routing_generic.hpp +++ b/src/surf/surf_routing_generic.hpp @@ -21,17 +21,17 @@ public: AsGeneric(); ~AsGeneric(); - virtual void getRouteAndLatency(RoutingEdge *src, RoutingEdge *dst, sg_platf_route_cbarg_t into, double *latency); + virtual void getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbarg_t into, double *latency); virtual xbt_dynar_t getOneLinkRoutes(); virtual void getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges); - virtual sg_platf_route_cbarg_t getBypassRoute(RoutingEdge *src, RoutingEdge *dst, double *lat); + virtual sg_platf_route_cbarg_t getBypassRoute(NetCard *src, NetCard *dst, double *lat); /* The parser calls the following functions to inform the routing models * that a new element is added to the AS currently built. * * Of course, only the routing model of this AS is informed, not every ones */ - virtual int parsePU(RoutingEdge *elm); /* A host or a router, whatever */ - virtual int parseAS(RoutingEdge *elm); + virtual int parsePU(NetCard *elm); /* A host or a router, whatever */ + virtual int parseAS(NetCard *elm); virtual void parseRoute(sg_platf_route_cbarg_t route); virtual void parseASroute(sg_platf_route_cbarg_t route); virtual void parseBypassroute(sg_platf_route_cbarg_t e_route); @@ -40,7 +40,7 @@ public: virtual As *asExist(As *to_find); virtual As *autonomousSystemExist(char *element); virtual As *processingUnitsExist(char *element); - virtual void srcDstCheck(RoutingEdge *src, RoutingEdge *dst); + virtual void srcDstCheck(NetCard *src, NetCard *dst); }; } diff --git a/src/surf/surf_routing_none.cpp b/src/surf/surf_routing_none.cpp index 190604762a..28c64fb237 100644 --- a/src/surf/surf_routing_none.cpp +++ b/src/surf/surf_routing_none.cpp @@ -20,7 +20,7 @@ xbt_dynar_t AsNone::getOneLinkRoutes() { return NULL; } -void AsNone::getRouteAndLatency(RoutingEdge * /*src*/, RoutingEdge * /*dst*/, +void AsNone::getRouteAndLatency(NetCard * /*src*/, NetCard * /*dst*/, sg_platf_route_cbarg_t /*res*/, double *lat) { *lat = 0.0; @@ -31,20 +31,20 @@ void AsNone::getGraph(xbt_graph_t /*graph*/, xbt_dict_t /*nodes*/, xbt_dict_t /* XBT_INFO("No routing no graph"); } -sg_platf_route_cbarg_t AsNone::getBypassRoute(RoutingEdge * /*src*/, RoutingEdge * /*dst*/, double * /*lat*/) { +sg_platf_route_cbarg_t AsNone::getBypassRoute(NetCard * /*src*/, NetCard * /*dst*/, double * /*lat*/) { return NULL; } -int AsNone::parsePU(RoutingEdge *elm) { +int AsNone::parsePU(NetCard *elm) { XBT_DEBUG("Load process unit \"%s\"", elm->getName()); - xbt_dynar_push_as(p_indexNetworkElm, RoutingEdge*, elm); + xbt_dynar_push_as(p_indexNetworkElm, NetCard*, elm); /* don't care about PUs */ return -1; } -int AsNone::parseAS(RoutingEdge *elm) { +int AsNone::parseAS(NetCard *elm) { XBT_DEBUG("Load Autonomous system \"%s\"", elm->getName()); - xbt_dynar_push_as(p_indexNetworkElm, RoutingEdge*, elm); + xbt_dynar_push_as(p_indexNetworkElm, NetCard*, elm); /* even don't care about sub-ASes -- I'm as nihilist as an old punk*/ return -1; } diff --git a/src/surf/surf_routing_none.hpp b/src/surf/surf_routing_none.hpp index 472aa08605..a7f1cc9c53 100644 --- a/src/surf/surf_routing_none.hpp +++ b/src/surf/surf_routing_none.hpp @@ -19,17 +19,17 @@ public: AsNone(); ~AsNone(); - void getRouteAndLatency(RoutingEdge *src, RoutingEdge *dst, sg_platf_route_cbarg_t into, double *latency); + void getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbarg_t into, double *latency); xbt_dynar_t getOneLinkRoutes(); void getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges); - sg_platf_route_cbarg_t getBypassRoute(RoutingEdge *src, RoutingEdge *dst, double *lat); + sg_platf_route_cbarg_t getBypassRoute(NetCard *src, NetCard *dst, double *lat); /* The parser calls the following functions to inform the routing models * that a new element is added to the AS currently built. * * Of course, only the routing model of this AS is informed, not every ones */ - int parsePU(RoutingEdge *elm); /* A host or a router, whatever */ - int parseAS( RoutingEdge *elm); + int parsePU(NetCard *elm); /* A host or a router, whatever */ + int parseAS( NetCard *elm); void parseRoute(sg_platf_route_cbarg_t route); void parseASroute(sg_platf_route_cbarg_t route); void parseBypassroute(sg_platf_route_cbarg_t e_route); diff --git a/src/surf/surf_routing_private.hpp b/src/surf/surf_routing_private.hpp index b6aee9fa38..22778d6ba1 100644 --- a/src/surf/surf_routing_private.hpp +++ b/src/surf/surf_routing_private.hpp @@ -30,8 +30,8 @@ XBT_PRIVATE void model_none_finalize(AS_t as); XBT_PRIVATE AS_t model_generic_create_sized(size_t childsize); XBT_PRIVATE void model_generic_finalize(AS_t as); -XBT_PRIVATE int generic_parse_PU(AS_t rc, sg_routing_edge_t elm); -XBT_PRIVATE int generic_parse_AS(AS_t rc, sg_routing_edge_t elm); +XBT_PRIVATE int generic_parse_PU(AS_t rc, sg_netcard_t elm); +XBT_PRIVATE int generic_parse_AS(AS_t rc, sg_netcard_t elm); XBT_PRIVATE void generic_parse_bypassroute(AS_t rc, sg_platf_route_cbarg_t e_route); /* ************************************************************************** */ @@ -39,8 +39,8 @@ XBT_PRIVATE void generic_parse_bypassroute(AS_t rc, sg_platf_route_cbarg_t e_rou XBT_PRIVATE xbt_dynar_t generic_get_onelink_routes(AS_t rc); XBT_PRIVATE sg_platf_route_cbarg_t generic_get_bypassroute(AS_t rc, - sg_routing_edge_t src, - sg_routing_edge_t dst, + sg_netcard_t src, + sg_netcard_t dst, double *lat); /* ************************************************************************** */ @@ -55,8 +55,8 @@ XBT_PRIVATE AS_t generic_autonomous_system_exist(AS_t rc, char *element); XBT_PRIVATE AS_t generic_processing_units_exist(AS_t rc, char *element); -void generic_src_dst_check(AS_t rc, sg_routing_edge_t src, - sg_routing_edge_t dst); +void generic_src_dst_check(AS_t rc, sg_netcard_t src, + sg_netcard_t dst); /* ************************************************************************** */ /* *************************** FLOYD ROUTING ******************************** */ diff --git a/src/surf/surf_routing_vivaldi.cpp b/src/surf/surf_routing_vivaldi.cpp index d47f4ed1d4..1601e9e8f9 100644 --- a/src/surf/surf_routing_vivaldi.cpp +++ b/src/surf/surf_routing_vivaldi.cpp @@ -26,7 +26,7 @@ AS_t model_vivaldi_create(void) namespace simgrid { namespace surf { -void AsVivaldi::getRouteAndLatency(RoutingEdge *src, RoutingEdge *dst, sg_platf_route_cbarg_t route, double *lat) +void AsVivaldi::getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbarg_t route, double *lat) { s_surf_parsing_link_up_down_t info; @@ -36,8 +36,8 @@ void AsVivaldi::getRouteAndLatency(RoutingEdge *src, RoutingEdge *dst, sg_platf_ if(src->getRcType() == SURF_NETWORK_ELEMENT_AS) { char *src_name = ROUTER_PEER(src->getName()); char *dst_name = ROUTER_PEER(dst->getName()); - route->gw_src = (sg_routing_edge_t) xbt_lib_get_or_null(as_router_lib, src_name, ROUTING_ASR_LEVEL); - route->gw_dst = (sg_routing_edge_t) xbt_lib_get_or_null(as_router_lib, dst_name, ROUTING_ASR_LEVEL); + route->gw_src = (sg_netcard_t) xbt_lib_get_or_null(as_router_lib, src_name, ROUTING_ASR_LEVEL); + route->gw_dst = (sg_netcard_t) xbt_lib_get_or_null(as_router_lib, dst_name, ROUTING_ASR_LEVEL); xbt_free(src_name); xbt_free(dst_name); } @@ -108,9 +108,9 @@ void AsVivaldi::getRouteAndLatency(RoutingEdge *src, RoutingEdge *dst, sg_platf_ } } -int AsVivaldi::parsePU(RoutingEdge *elm) { +int AsVivaldi::parsePU(NetCard *elm) { XBT_DEBUG("Load process unit \"%s\"", elm->getName()); - xbt_dynar_push_as(p_indexNetworkElm, sg_routing_edge_t, elm); + xbt_dynar_push_as(p_indexNetworkElm, sg_netcard_t, elm); return xbt_dynar_length(p_indexNetworkElm)-1; } diff --git a/src/surf/surf_routing_vivaldi.hpp b/src/surf/surf_routing_vivaldi.hpp index 0ebfef3ef5..9ad8f53da4 100644 --- a/src/surf/surf_routing_vivaldi.hpp +++ b/src/surf/surf_routing_vivaldi.hpp @@ -33,7 +33,7 @@ public: AsVivaldi() : AsGeneric() {}; ~AsVivaldi() {}; - void getRouteAndLatency(RoutingEdge *src, RoutingEdge *dst, sg_platf_route_cbarg_t into, double *latency); + void getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbarg_t into, double *latency); //void getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges); //sg_platf_route_cbarg_t getBypassRoute(RoutingEdge *src, RoutingEdge *dst, double *lat); @@ -41,7 +41,7 @@ public: * that a new element is added to the AS currently built. * * Of course, only the routing model of this AS is informed, not every ones */ - int parsePU(RoutingEdge *elm); /* A host or a router, whatever */ + int parsePU(NetCard *elm); /* A host or a router, whatever */ //virtual int parseAS( RoutingEdge *elm)=0; //virtual void parseBypassroute(sg_platf_route_cbarg_t e_route)=0; diff --git a/src/surf/vm_hl13.cpp b/src/surf/vm_hl13.cpp index cf79554f5f..173c26d724 100644 --- a/src/surf/vm_hl13.cpp +++ b/src/surf/vm_hl13.cpp @@ -277,8 +277,8 @@ void VMHL13::migrate(sg_host_t host_dest) xbt_assert(surfHost_dst); /* update net_elm with that of the destination physical host */ - RoutingEdge *old_net_elm = p_netElm; - RoutingEdge *new_net_elm = new RoutingEdgeWrapper(sg_host_edge(sg_host_by_name(pm_name_dst))); + NetCard *old_net_elm = p_netElm; + NetCard *new_net_elm = new RoutingEdgeWrapper(sg_host_edge(sg_host_by_name(pm_name_dst))); xbt_assert(new_net_elm); /* Unregister the current net_elm from host_lib. Do not call the free callback. */ diff --git a/teshsuite/simdag/platforms/flatifier.c b/teshsuite/simdag/platforms/flatifier.c index ad49f948b8..462f159d2b 100644 --- a/teshsuite/simdag/platforms/flatifier.c +++ b/teshsuite/simdag/platforms/flatifier.c @@ -97,8 +97,8 @@ int main(int argc, char **argv) xbt_lib_cursor_t cursor_src = NULL; xbt_lib_cursor_t cursor_dst = NULL; char *src,*dst,*key,*data; - sg_routing_edge_t value1; - sg_routing_edge_t value2; + sg_netcard_t value1; + sg_netcard_t value2; const SD_workstation_t *hosts; const SD_link_t *links; @@ -220,7 +220,7 @@ int main(int argc, char **argv) ,dst); xbt_dynar_t route=NULL; value2 = xbt_lib_get_or_null(as_router_lib,dst,ROUTING_ASR_LEVEL); - routing_get_route_and_latency((sg_routing_edge_t)value1,(sg_routing_edge_t)value2,&route,NULL); + routing_get_route_and_latency((sg_netcard_t)value1,(sg_netcard_t)value2,&route,NULL); for(i=0;i