* under the terms of the license (GNU LGPL) which comes with this package. */
#include "src/kernel/routing/AsCluster.hpp"
+#include "src/kernel/routing/NetCard.hpp"
#include "src/surf/network_interface.hpp"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_cluster, surf, "Routing part of surf");
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "src/kernel/routing/AsClusterDragonfly.hpp"
+#include "src/kernel/routing/NetCard.hpp"
#include "src/surf/network_interface.hpp"
#include "src/surf/xml/platf.hpp" // FIXME: move that back to the parsing area
#include <sstream>
#include "src/kernel/routing/AsClusterFatTree.hpp"
+#include "src/kernel/routing/NetCard.hpp"
#include "src/surf/network_interface.hpp"
#include "xbt/lib.h"
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "src/kernel/routing/AsClusterTorus.hpp"
+#include "src/kernel/routing/NetCard.hpp"
+
#include "src/surf/network_interface.hpp"
#include "src/surf/xml/platf.hpp" // FIXME: move that back to the parsing area
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "src/kernel/routing/AsDijkstra.hpp"
+#include "src/kernel/routing/NetCard.hpp"
+
#include "src/surf/network_interface.hpp"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_dijkstra, surf, "Routing part of surf -- dijkstra routing logic");
#include <limits>
-#include "xbt/log.h"
#include "src/kernel/routing/AsFloyd.hpp"
+#include "src/kernel/routing/NetCard.hpp"
#include "src/surf/network_interface.hpp"
+#include "xbt/log.h"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_floyd, surf, "Routing part of surf");
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "src/kernel/routing/AsFull.hpp"
+#include "src/kernel/routing/NetCard.hpp"
#include "src/surf/network_interface.hpp"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_full, surf, "Routing part of surf");
#include "simgrid/s4u/host.hpp"
#include "src/kernel/routing/AsImpl.hpp"
+#include "src/kernel/routing/NetCard.hpp"
#include "src/surf/cpu_interface.hpp"
#include "src/surf/network_interface.hpp"
#include "xbt/graph.h"
#include "src/kernel/routing/AsRoutedGraph.hpp"
+#include "src/kernel/routing/NetCard.hpp"
#include "src/surf/network_interface.hpp"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_routing_generic, surf_route, "Generic implementation of the surf routing");
#include <simgrid/s4u/host.hpp>
#include "src/kernel/routing/AsVivaldi.hpp"
+#include "src/kernel/routing/NetCard.hpp"
#include "src/surf/network_interface.hpp"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_vivaldi, surf, "Routing part of surf");
--- /dev/null
+/* Copyright (c) 2013-2016. The SimGrid Team. All rights reserved. */
+
+/* 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. */
+
+#ifndef KERNEL_ROUTING_NETCARD_HPP_
+#define KERNEL_ROUTING_NETCARD_HPP_
+
+#include <xbt/base.h>
+#include <xbt/signal.hpp>
+
+#include "src/kernel/routing/AsImpl.hpp"
+/*
+#include <float.h>
+#include <vector>
+*/
+namespace simgrid {
+namespace kernel {
+namespace routing {
+XBT_PUBLIC_DATA(simgrid::xbt::signal<void(NetCard*)>) netcardCreatedCallbacks;
+
+/** @ingroup SURF_routing_interface
+ * @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 route information between two netcards
+ */
+class NetCard {
+public:
+ enum class Type { Host, Router, As };
+
+ NetCard(std::string name, NetCard::Type componentType, AsImpl* containingAS)
+ : name_(name), componentType_(componentType), containingAS_(containingAS)
+ {
+ if (containingAS != nullptr)
+ id_ = containingAS->addComponent(this);
+ simgrid::kernel::routing::netcardCreatedCallbacks(this);
+ }
+ ~NetCard() = default;
+
+ // Our rank in the vertices_ array of our containing AS.
+ unsigned int id() { return id_; }
+ std::string name() { return name_; }
+ const char* cname() { return name_.c_str(); }
+ // This is the AS in which I am
+ AsImpl* containingAS() { return containingAS_; }
+
+ bool isAS() { return componentType_ == Type::As; }
+ bool isHost() { return componentType_ == Type::Host; }
+ bool isRouter() { return componentType_ == Type::Router; }
+
+private:
+ unsigned int id_;
+ std::string name_;
+ NetCard::Type componentType_;
+ AsImpl* containingAS_;
+};
+}
+}
+}
+
+#endif /* KERNEL_ROUTING_NETCARD_HPP_ */
#include <simgrid/s4u/host.hpp>
#include <simgrid/s4u/As.hpp>
-#include "src/surf/surf_routing.hpp"
+#include "src/kernel/routing/NetCard.hpp"
#include "src/surf/network_interface.hpp" // Link FIXME: move to proper header
+#include "src/surf/surf_routing.hpp"
XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_as,"S4U autonomous systems");
#include <unordered_map>
+#include "simgrid/s4u/host.hpp"
+#include "simgrid/s4u/storage.hpp"
#include "simgrid/simix.hpp"
-#include "src/surf/HostImpl.hpp"
-#include "xbt/log.h"
+#include "src/kernel/routing/NetCard.hpp"
#include "src/msg/msg_private.h"
#include "src/simix/ActorImpl.hpp"
#include "src/simix/smx_private.h"
+#include "src/surf/HostImpl.hpp"
#include "src/surf/cpu_interface.hpp"
-#include "simgrid/s4u/host.hpp"
-#include "simgrid/s4u/storage.hpp"
+#include "xbt/log.h"
XBT_LOG_EXTERNAL_CATEGORY(surf_route);
#include <xbt/Extendable.hpp>
#include <simgrid/s4u/host.hpp>
+#include "src/kernel/routing/NetCard.hpp"
#include "src/surf/HostImpl.hpp"
-#include "surf/surf.h" // routing_get_network_element_type FIXME:killme
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(sg_host, sd, "Logging specific to sg_hosts");
extern std::unordered_map<std::string, simgrid::s4u::Host*>
- host_list; // FIXME: don't dupplicate the content of s4u::Host this way
+ host_list; // FIXME: don't duplicate the content of s4u::Host this way
void sg_host_exit()
{
#include "ns3/ns3_simulator.h"
#include "network_ns3.hpp"
-#include "src/surf/HostImpl.hpp"
-#include "src/surf/surf_private.h"
#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/surf/HostImpl.hpp"
+#include "src/surf/surf_private.h"
#include "simgrid/s4u/As.hpp"
#include "simgrid/s4u/engine.hpp"
#include "src/surf/cpu_interface.hpp"
#include "src/surf/network_interface.hpp"
-#include "src/kernel/routing/AsImpl.hpp"
#include "src/kernel/routing/AsCluster.hpp"
-#include "src/kernel/routing/AsClusterTorus.hpp"
-#include "src/kernel/routing/AsClusterFatTree.hpp"
#include "src/kernel/routing/AsClusterDragonfly.hpp"
+#include "src/kernel/routing/AsClusterFatTree.hpp"
+#include "src/kernel/routing/AsClusterTorus.hpp"
#include "src/kernel/routing/AsDijkstra.hpp"
#include "src/kernel/routing/AsFloyd.hpp"
#include "src/kernel/routing/AsFull.hpp"
+#include "src/kernel/routing/AsImpl.hpp"
#include "src/kernel/routing/AsNone.hpp"
#include "src/kernel/routing/AsVivaldi.hpp"
+#include "src/kernel/routing/NetCard.hpp"
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_parse);
#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/simix/smx_host_private.h"
#include "src/surf/HostImpl.hpp"
#include "surf_private.h"
-#include "surf_routing.hpp"
#include <vector>
XBT_LOG_NEW_CATEGORY(surf, "All SURF categories");
namespace routing {
XBT_PUBLIC_DATA(simgrid::xbt::signal<void(s4u::As*)>) asCreatedCallbacks;
- XBT_PUBLIC_DATA(simgrid::xbt::signal<void(NetCard*)>) netcardCreatedCallbacks;
/***********
* Classes *
class XBT_PRIVATE Onelink;
class RoutingPlatf;
-/** @ingroup SURF_routing_interface
- * @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 route information between two netcards
- */
-class NetCard {
-public:
- enum class Type {
- Host, Router, As
- };
-
- NetCard(std::string name, NetCard::Type componentType, AsImpl* containingAS)
- : name_(name), componentType_(componentType), containingAS_(containingAS)
- {
- if (containingAS != nullptr)
- id_ = containingAS->addComponent(this);
- simgrid::kernel::routing::netcardCreatedCallbacks(this);
- }
- ~NetCard() = default;
-
- // Our rank in the vertices_ array of our containing AS.
- unsigned int id() {return id_;}
- std::string name() { return name_; }
- const char* cname() { return name_.c_str(); }
- // This is the AS in which I am
- AsImpl *containingAS() {return containingAS_;}
-
- bool isAS() {return componentType_ == Type::As;}
- bool isHost() {return componentType_ == Type::Host;}
- bool isRouter() {return componentType_ == Type::Router;}
-
-
-private:
- unsigned int id_;
- std::string name_;
- NetCard::Type componentType_;
- AsImpl *containingAS_;
-};
-
class AsRoute {
public:
explicit AsRoute(NetCard* gwSrc, NetCard* gwDst) : gw_src(gwSrc), gw_dst(gwDst) {}
#include <simgrid/simdag.h>
+#include "src/kernel/routing/NetCard.hpp"
#include "src/surf/network_interface.hpp"
/* 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 <stdio.h>
+#include "simgrid/s4u/host.hpp"
#include "simgrid/simdag.h"
+#include "src/kernel/routing/NetCard.hpp"
#include "src/surf/surf_routing.hpp"
-#include "simgrid/s4u/host.hpp"
-
+#include <stdio.h>
int main(int argc, char **argv)
{
src/kernel/routing/AsRoutedGraph.hpp
src/kernel/routing/AsNone.hpp
src/kernel/routing/AsVivaldi.hpp
+ src/kernel/routing/NetCard.hpp
src/surf/storage_interface.hpp
src/surf/storage_n11.hpp