class Resource;
}
namespace routing {
- class NetPoint;
- class NetZoneImpl;
+class ClusterCreationArgs;
+class LinkCreationArgs;
+class NetPoint;
+class NetZoneImpl;
+class RouteCreationArgs;
}
}
namespace simix {
#include "simgrid/forward.h"
#include "simgrid/s4u/NetZone.hpp"
-#include "src/surf/xml/platf_private.hpp" // FIXME: kill sg_platf_route_cbarg_t to remove that UGLY include
namespace simgrid {
namespace kernel {
}
int console_add_backbone(lua_State *L) {
- LinkCreationArgs link;
+ simgrid::kernel::routing::LinkCreationArgs link;
link.properties = nullptr;
}
int console_add_host___link(lua_State *L) {
- HostLinkCreationArgs hostlink;
+ simgrid::kernel::routing::HostLinkCreationArgs hostlink;
int type;
lua_ensure(lua_istable(L, -1), "Bad Arguments to create host_link in Lua. Should be a table with named arguments.");
}
int console_add_host(lua_State *L) {
- s_sg_platf_host_cbarg_t host;
+ simgrid::kernel::routing::HostCreationArgs host;
int type;
// we get values from the table passed as argument
}
int console_add_link(lua_State *L) {
- LinkCreationArgs link;
+ simgrid::kernel::routing::LinkCreationArgs link;
const char* policy;
int console_add_route(lua_State *L) {
XBT_DEBUG("Adding route");
- RouteCreationArgs route;
+ simgrid::kernel::routing::RouteCreationArgs route;
int type;
lua_ensure(lua_istable(L, -1), "Bad Arguments to add a route. Should be a table with named arguments");
}
int console_add_ASroute(lua_State *L) {
- RouteCreationArgs ASroute;
+ simgrid::kernel::routing::RouteCreationArgs ASroute;
lua_pushstring(L, "src");
lua_gettable(L, -2);
mode_int = A_surfxml_AS_routing_None;
else xbt_die("Don't have the model name '%s'",mode);
- ZoneCreationArgs AS;
+ simgrid::kernel::routing::ZoneCreationArgs AS;
AS.id = id;
AS.routing = mode_int;
simgrid::s4u::NetZone* new_as = sg_platf_new_Zone_begin(&AS);
#include "simgrid/kernel/routing/NetPoint.hpp"
#include "simgrid/kernel/routing/RoutedZone.hpp"
#include "src/surf/network_interface.hpp"
+#include "src/surf/xml/platf_private.hpp" // FIXME: RouteCreationArgs and friends
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_cluster, surf, "Routing part of surf");
#include "simgrid/kernel/routing/DijkstraZone.hpp"
#include "simgrid/kernel/routing/NetPoint.hpp"
#include "src/surf/network_interface.hpp"
+#include "src/surf/xml/platf_private.hpp"
#include <cfloat>
#include <queue>
static void graph_edge_data_free(void* e)
{
- delete static_cast<RouteCreationArgs*>(e);
+ delete static_cast<simgrid::kernel::routing::RouteCreationArgs*>(e);
}
/* Utility functions */
}
if (not found) {
- RouteCreationArgs* e_route = new RouteCreationArgs();
+ RouteCreationArgs* e_route = new simgrid::kernel::routing::RouteCreationArgs();
e_route->link_list.push_back(surf_network_model->loopback_);
xbt_graph_new_edge(routeGraph_, node, node, e_route);
}
/* Parsing */
-void DijkstraZone::newRoute(int src_id, int dst_id, RouteCreationArgs* e_route)
+void DijkstraZone::newRoute(int src_id, int dst_id, simgrid::kernel::routing::RouteCreationArgs* e_route)
{
XBT_DEBUG("Load Route from \"%d\" to \"%d\"", src_id, dst_id);
xbt_node_t src = nullptr;
#include "simgrid/kernel/routing/DragonflyZone.hpp"
#include "simgrid/kernel/routing/NetPoint.hpp"
#include "src/surf/network_interface.hpp"
+#include "src/surf/xml/platf_private.hpp"
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/split.hpp>
#include "simgrid/kernel/routing/FatTreeZone.hpp"
#include "simgrid/kernel/routing/NetPoint.hpp"
#include "src/surf/network_interface.hpp"
+#include "src/surf/xml/platf_private.hpp"
+
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/split.hpp>
#include "simgrid/kernel/routing/NetPoint.hpp"
#include "src/surf/network_interface.hpp"
#include "xbt/log.h"
+#include "src/surf/xml/platf_private.hpp"
#include <cfloat>
#include <limits>
#include "simgrid/kernel/routing/FullZone.hpp"
#include "simgrid/kernel/routing/NetPoint.hpp"
#include "src/surf/network_interface.hpp"
+#include "src/surf/xml/platf_private.hpp"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_full, surf, "Routing part of surf");
#include "simgrid/s4u/Host.hpp"
#include "src/surf/cpu_interface.hpp"
#include "src/surf/network_interface.hpp"
-
+#include "src/surf/xml/platf_private.hpp"
#include "xbt/log.h"
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_route);
#include "xbt/graph.h"
#include "xbt/log.h"
#include "xbt/sysdep.h"
-
#include "simgrid/kernel/routing/NetPoint.hpp"
#include "simgrid/kernel/routing/RoutedZone.hpp"
#include "src/surf/network_interface.hpp"
+#include "src/surf/xml/platf_private.hpp"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_routing_generic, surf_route, "Generic implementation of the surf routing");
#include "simgrid/kernel/routing/TorusZone.hpp"
#include "simgrid/kernel/routing/NetPoint.hpp"
#include "src/surf/network_interface.hpp"
+#include "src/surf/xml/platf_private.hpp"
#include <boost/algorithm/string/classification.hpp>
#include <boost/algorithm/string/split.hpp>
#include "simgrid/s4u/Engine.hpp"
#include "simgrid/s4u/Host.hpp"
#include "src/surf/network_interface.hpp"
+#include "src/surf/xml/platf_private.hpp"
#include <boost/algorithm/string.hpp>
void SIMIX_process_set_function(const char* process_host, const char* process_function, xbt_dynar_t arguments,
double process_start_time, double process_kill_time)
{
- ActorCreationArgs actor;
+ simgrid::kernel::routing::ActorCreationArgs actor;
sg_host_t host = sg_host_by_name(process_host);
if (not host)
actor.host = process_host;
actor.kill_time = process_kill_time;
actor.start_time = process_start_time;
- actor.on_failure = ActorOnFailure::DIE;
+ actor.on_failure = simgrid::kernel::routing::ActorOnFailure::DIE;
sg_platf_new_actor(&actor);
}
#include "simgrid/plugins/energy.h"
#include "simgrid/s4u/Engine.hpp"
#include "simgrid/s4u/NetZone.hpp"
+#include "src/surf/xml/platf_private.hpp"
#include "src/instr/instr_private.hpp" // TRACE_is_enabled(). FIXME: remove by subscribing tracing to the surf signals
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ns3, surf, "Logging specific to the SURF network NS3 module");
* Callbacks *
*************/
-static void clusterCreation_cb(ClusterCreationArgs* cluster)
+static void clusterCreation_cb(simgrid::kernel::routing::ClusterCreationArgs* cluster)
{
for (int const& i : *cluster->radicals) {
// Routers don't create a router on the other end of the private link by themselves.
#include "simgrid/s4u/Engine.hpp"
#include "simgrid/s4u/Storage.hpp"
-
#include "src/kernel/EngineImpl.hpp"
#include "src/simix/smx_private.hpp"
-
#include "src/include/simgrid/sg_config.h"
-
#include "src/surf/HostImpl.hpp"
#include "src/surf/cpu_interface.hpp"
#include "src/surf/network_interface.hpp"
-
+#include "src/surf/xml/platf_private.hpp"
#include "simgrid/kernel/routing/ClusterZone.hpp"
#include "simgrid/kernel/routing/DijkstraZone.hpp"
#include "simgrid/kernel/routing/DragonflyZone.hpp"
#include "simgrid/kernel/routing/NetZoneImpl.hpp"
#include "simgrid/kernel/routing/TorusZone.hpp"
#include "simgrid/kernel/routing/VivaldiZone.hpp"
+
#include <string>
+
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_parse);
XBT_PRIVATE std::map<std::string, simgrid::surf::StorageImpl*> mount_list;
namespace simgrid {
namespace surf {
-simgrid::xbt::signal<void(ClusterCreationArgs*)> on_cluster;
+simgrid::xbt::signal<void(kernel::routing::ClusterCreationArgs*)> on_cluster;
}
}
}
/** @brief Add an host to the current AS */
-void sg_platf_new_host(sg_platf_host_cbarg_t args)
+void sg_platf_new_host(simgrid::kernel::routing::HostCreationArgs* args)
{
std::map<std::string, std::string> props;
if (args->properties) {
return netpoint;
}
-void sg_platf_new_link(LinkCreationArgs* link)
+void sg_platf_new_link(simgrid::kernel::routing::LinkCreationArgs* link)
{
std::vector<std::string> names;
delete link->properties;
}
-void sg_platf_new_cluster(ClusterCreationArgs* cluster)
+void sg_platf_new_cluster(simgrid::kernel::routing::ClusterCreationArgs* cluster)
{
using simgrid::kernel::routing::ClusterZone;
using simgrid::kernel::routing::DragonflyZone;
int rankId=0;
// What an inventive way of initializing the AS that I have as ancestor :-(
- ZoneCreationArgs zone;
+ simgrid::kernel::routing::ZoneCreationArgs zone;
zone.id = cluster->id;
switch (cluster->topology) {
- case ClusterTopology::TORUS:
+ case simgrid::kernel::routing::ClusterTopology::TORUS:
zone.routing = A_surfxml_AS_routing_ClusterTorus;
break;
- case ClusterTopology::DRAGONFLY:
+ case simgrid::kernel::routing::ClusterTopology::DRAGONFLY:
zone.routing = A_surfxml_AS_routing_ClusterDragonfly;
break;
- case ClusterTopology::FAT_TREE:
+ case simgrid::kernel::routing::ClusterTopology::FAT_TREE:
zone.routing = A_surfxml_AS_routing_ClusterFatTree;
break;
default:
XBT_DEBUG("<host\tid=\"%s\"\tpower=\"%f\">", host_id.c_str(), cluster->speeds.front());
- s_sg_platf_host_cbarg_t host;
+ simgrid::kernel::routing::HostCreationArgs host;
host.id = host_id.c_str();
if ((cluster->properties != nullptr) && (not cluster->properties->empty())) {
host.properties = new std::map<std::string, std::string>;
std::string tmp_link = link_id + "_loopback";
XBT_DEBUG("<loopback\tid=\"%s\"\tbw=\"%f\"/>", tmp_link.c_str(), cluster->loopback_bw);
- LinkCreationArgs link;
+ simgrid::kernel::routing::LinkCreationArgs link;
link.id = tmp_link;
link.bandwidth = cluster->loopback_bw;
link.latency = cluster->loopback_lat;
std::string tmp_link = std::string(link_id) + "_limiter";
XBT_DEBUG("<limiter\tid=\"%s\"\tbw=\"%f\"/>", tmp_link.c_str(), cluster->limiter_link);
- LinkCreationArgs link;
+ simgrid::kernel::routing::LinkCreationArgs link;
link.id = tmp_link;
link.bandwidth = cluster->limiter_link;
link.latency = 0;
}
//call the cluster function that adds the others links
- if (cluster->topology == ClusterTopology::FAT_TREE) {
+ if (cluster->topology == simgrid::kernel::routing::ClusterTopology::FAT_TREE) {
static_cast<FatTreeZone*>(current_as)->addProcessingNode(i);
} else {
current_as->create_links_for_node(cluster, i, rankId, current_as->nodePositionWithLimiter(rankId));
//Make the backbone
if ((cluster->bb_bw > 0) || (cluster->bb_lat > 0)) {
- LinkCreationArgs link;
+ simgrid::kernel::routing::LinkCreationArgs link;
link.id = std::string(cluster->id)+ "_backbone";
link.bandwidth = cluster->bb_bw;
link.latency = cluster->bb_lat;
XBT_DEBUG("Add a backbone to AS '%s'", current_routing->getCname());
}
-void sg_platf_new_cabinet(CabinetCreationArgs* cabinet)
+void sg_platf_new_cabinet(simgrid::kernel::routing::CabinetCreationArgs* cabinet)
{
for (int const& radical : *cabinet->radicals) {
std::string hostname = cabinet->prefix + std::to_string(radical) + cabinet->suffix;
- s_sg_platf_host_cbarg_t host;
+ simgrid::kernel::routing::HostCreationArgs host;
host.pstate = 0;
host.core_amount = 1;
host.id = hostname.c_str();
host.speed_per_pstate.push_back(cabinet->speed);
sg_platf_new_host(&host);
- LinkCreationArgs link;
+ simgrid::kernel::routing::LinkCreationArgs link;
link.policy = SURF_LINK_SPLITDUPLEX;
link.latency = cabinet->lat;
link.bandwidth = cabinet->bw;
link.id = "link_" + hostname;
sg_platf_new_link(&link);
- HostLinkCreationArgs host_link;
+ simgrid::kernel::routing::HostLinkCreationArgs host_link;
host_link.id = hostname;
host_link.link_up = std::string("link_") + hostname + "_UP";
host_link.link_down = std::string("link_") + hostname + "_DOWN";
delete cabinet->radicals;
}
-void sg_platf_new_storage(StorageCreationArgs* storage)
+void sg_platf_new_storage(simgrid::kernel::routing::StorageCreationArgs* storage)
{
xbt_assert(std::find(known_storages.begin(), known_storages.end(), storage->id) == known_storages.end(),
"Refusing to add a second storage named \"%s\"", storage->id.c_str());
}
}
-void sg_platf_new_storage_type(StorageTypeCreationArgs* storage_type)
+void sg_platf_new_storage_type(simgrid::kernel::routing::StorageTypeCreationArgs* storage_type)
{
xbt_assert(storage_types.find(storage_type->id) == storage_types.end(),
"Reading a storage type, processing unit \"%s\" already exists", storage_type->id.c_str());
storage_types[storage_type->id] = stype;
}
-void sg_platf_new_mount(MountCreationArgs* mount)
+void sg_platf_new_mount(simgrid::kernel::routing::MountCreationArgs* mount)
{
xbt_assert(std::find(known_storages.begin(), known_storages.end(), mount->storageId) != known_storages.end(),
"Cannot mount non-existent disk \"%s\"", mount->storageId.c_str());
mount_list.insert({mount->name, simgrid::s4u::Engine::getInstance()->storageByName(mount->storageId)->getImpl()});
}
-void sg_platf_new_route(RouteCreationArgs* route)
+void sg_platf_new_route(simgrid::kernel::routing::RouteCreationArgs* route)
{
routing_get_current()->addRoute(route->src, route->dst, route->gw_src, route->gw_dst, route->link_list,
route->symmetrical);
}
-void sg_platf_new_bypassRoute(RouteCreationArgs* bypassRoute)
+void sg_platf_new_bypassRoute(simgrid::kernel::routing::RouteCreationArgs* bypassRoute)
{
routing_get_current()->addBypassRoute(bypassRoute->src, bypassRoute->dst, bypassRoute->gw_src, bypassRoute->gw_dst,
bypassRoute->link_list, bypassRoute->symmetrical);
}
-void sg_platf_new_actor(ActorCreationArgs* actor)
+void sg_platf_new_actor(simgrid::kernel::routing::ActorCreationArgs* actor)
{
sg_host_t host = sg_host_by_name(actor->host);
if (not host) {
double start_time = actor->start_time;
double kill_time = actor->kill_time;
- bool auto_restart = actor->on_failure != ActorOnFailure::DIE;
+ bool auto_restart = actor->on_failure != simgrid::kernel::routing::ActorOnFailure::DIE;
std::string actor_name = actor->args[0];
std::function<void()> code = factory(std::move(actor->args));
}
}
-void sg_platf_new_peer(PeerCreationArgs* peer)
+void sg_platf_new_peer(simgrid::kernel::routing::PeerCreationArgs* peer)
{
simgrid::kernel::routing::VivaldiZone* as = dynamic_cast<simgrid::kernel::routing::VivaldiZone*>(current_routing);
xbt_assert(as, "<peer> tag can only be used in Vivaldi netzones.");
*
* @param zone the parameters defining the Zone to build.
*/
-simgrid::s4u::NetZone* sg_platf_new_Zone_begin(ZoneCreationArgs* zone)
+simgrid::s4u::NetZone* sg_platf_new_Zone_begin(simgrid::kernel::routing::ZoneCreationArgs* zone)
{
if (not surf_parse_models_setup_already_called) {
/* Initialize the surf models. That must be done after we got all config, and before we need the models.
}
/** @brief Add a link connecting an host to the rest of its AS (which must be cluster or vivaldi) */
-void sg_platf_new_hostlink(HostLinkCreationArgs* hostlink)
+void sg_platf_new_hostlink(simgrid::kernel::routing::HostLinkCreationArgs* hostlink)
{
simgrid::kernel::routing::NetPoint* netpoint = sg_host_by_name(hostlink->id.c_str())->pimpl_netpoint;
xbt_assert(netpoint, "Host '%s' not found!", hostlink->id.c_str());
as_cluster->privateLinks_.insert({netpoint->id(), {linkUp, linkDown}});
}
-void sg_platf_new_trace(TraceCreationArgs* trace)
+void sg_platf_new_trace(simgrid::kernel::routing::TraceCreationArgs* trace)
{
tmgr_trace_t tmgr_trace;
if (not trace->file.empty()) {
#include "simgrid/kernel/routing/NetPoint.hpp"
#include "simgrid/s4u/Engine.hpp"
#include "simgrid/s4u/Host.hpp"
+#include "src/surf/xml/platf.hpp"
#include "src/kernel/lmm/maxmin.hpp"
#include "xbt/utility.hpp"
#include <cmath> /*ceil*/
#include "src/kernel/lmm/maxmin.hpp" // Constraint
#include "src/surf/HostImpl.hpp"
#include "xbt/utility.hpp"
+#include "src/surf/xml/platf.hpp"
#include <fstream>
#include <set>
#include <string>
#include <vector>
-extern "C" {
-#include "src/surf/xml/simgrid_dtd.h"
-
-#ifndef YY_TYPEDEF_YY_SIZE_T
-#define YY_TYPEDEF_YY_SIZE_T
-typedef size_t yy_size_t;
-#endif
-
+namespace simgrid {
+namespace kernel {
+namespace routing {
/* ***************************************** */
/*
* Platform creation functions. Instead of passing 123 arguments to the creation functions
* used, instead of malloced structures.
*/
-struct s_sg_platf_host_cbarg_t {
+struct HostCreationArgs {
const char* id = nullptr;
std::vector<double> speed_per_pstate;
int pstate = 0;
const char* coord = nullptr;
std::map<std::string, std::string>* properties = nullptr;
};
-typedef s_sg_platf_host_cbarg_t* sg_platf_host_cbarg_t;
+typedef HostCreationArgs* sg_platf_host_cbarg_t; // FIXME: killme
class HostLinkCreationArgs {
public:
std::string element;
};
-enum class ActorOnFailure { DIE, RESTART };
+enum class ActorOnFailure { DIE, RESTART }; // FIXME: move to a better namespace
class ActorCreationArgs {
public:
std::string id;
int routing;
};
+}}}
+
+extern "C" {
+#include "src/surf/xml/simgrid_dtd.h"
+
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef size_t yy_size_t;
+#endif
/********** Routing **********/
void routing_cluster_add_backbone(simgrid::surf::LinkImpl* bb);
XBT_PUBLIC void sg_platf_begin(); // Start a new platform
XBT_PUBLIC void sg_platf_end(); // Finish the creation of the platform
-XBT_PUBLIC simgrid::s4u::NetZone* sg_platf_new_Zone_begin(ZoneCreationArgs* zone); // Begin description of new Zone
+XBT_PUBLIC simgrid::s4u::NetZone* sg_platf_new_Zone_begin(simgrid::kernel::routing::ZoneCreationArgs* zone); // Begin description of new Zone
XBT_PUBLIC void sg_platf_new_Zone_seal(); // That Zone is fully described
-XBT_PUBLIC void sg_platf_new_host(sg_platf_host_cbarg_t host); // Add a host to the current Zone
-XBT_PUBLIC void sg_platf_new_hostlink(HostLinkCreationArgs* h); // Add a host_link to the current Zone
-XBT_PUBLIC void sg_platf_new_link(LinkCreationArgs* link); // Add a link to the current Zone
-XBT_PUBLIC void sg_platf_new_peer(PeerCreationArgs* peer); // Add a peer to the current Zone
-XBT_PUBLIC void sg_platf_new_cluster(ClusterCreationArgs* clust); // Add a cluster to the current Zone
-XBT_PUBLIC void sg_platf_new_cabinet(CabinetCreationArgs* cabinet); // Add a cabinet to the current Zone
+XBT_PUBLIC void sg_platf_new_host(simgrid::kernel::routing::HostCreationArgs* host); // Add a host to the current Zone
+XBT_PUBLIC void sg_platf_new_hostlink(simgrid::kernel::routing::HostLinkCreationArgs* h); // Add a host_link to the current Zone
+XBT_PUBLIC void sg_platf_new_link(simgrid::kernel::routing::LinkCreationArgs* link); // Add a link to the current Zone
+XBT_PUBLIC void sg_platf_new_peer(simgrid::kernel::routing::PeerCreationArgs* peer); // Add a peer to the current Zone
+XBT_PUBLIC void sg_platf_new_cluster(simgrid::kernel::routing::ClusterCreationArgs* clust); // Add a cluster to the current Zone
+XBT_PUBLIC void sg_platf_new_cabinet(simgrid::kernel::routing::CabinetCreationArgs* cabinet); // Add a cabinet to the current Zone
XBT_PUBLIC simgrid::kernel::routing::NetPoint* // Add a router to the current Zone
sg_platf_new_router(std::string, const char* coords);
-XBT_PUBLIC void sg_platf_new_route(RouteCreationArgs* route); // Add a route
-XBT_PUBLIC void sg_platf_new_bypassRoute(RouteCreationArgs* bypassroute); // Add a bypassRoute
+XBT_PUBLIC void sg_platf_new_route(simgrid::kernel::routing::RouteCreationArgs* route); // Add a route
+XBT_PUBLIC void sg_platf_new_bypassRoute(simgrid::kernel::routing::RouteCreationArgs* bypassroute); // Add a bypassRoute
-XBT_PUBLIC void sg_platf_new_trace(TraceCreationArgs* trace);
+XBT_PUBLIC void sg_platf_new_trace(simgrid::kernel::routing::TraceCreationArgs* trace);
-XBT_PUBLIC void sg_platf_new_storage(StorageCreationArgs* storage); // Add a storage to the current Zone
-XBT_PUBLIC void sg_platf_new_storage_type(StorageTypeCreationArgs* storage_type);
-XBT_PUBLIC void sg_platf_new_mount(MountCreationArgs* mount);
+XBT_PUBLIC void sg_platf_new_storage(simgrid::kernel::routing::StorageCreationArgs* storage); // Add a storage to the current Zone
+XBT_PUBLIC void sg_platf_new_storage_type(simgrid::kernel::routing::StorageTypeCreationArgs* storage_type);
+XBT_PUBLIC void sg_platf_new_mount(simgrid::kernel::routing::MountCreationArgs* mount);
-XBT_PUBLIC void sg_platf_new_actor(ActorCreationArgs* actor);
-XBT_PRIVATE void sg_platf_trace_connect(TraceConnectCreationArgs* trace_connect);
+XBT_PUBLIC void sg_platf_new_actor(simgrid::kernel::routing::ActorCreationArgs* actor);
+XBT_PRIVATE void sg_platf_trace_connect(simgrid::kernel::routing::TraceConnectCreationArgs* trace_connect);
/* Prototypes of the functions offered by flex */
XBT_PUBLIC int surf_parse_lex();
namespace simgrid {
namespace surf {
-extern XBT_PRIVATE simgrid::xbt::signal<void(ClusterCreationArgs*)> on_cluster;
+extern XBT_PRIVATE simgrid::xbt::signal<void(kernel::routing::ClusterCreationArgs*)> on_cluster;
}
}
XBT_PRIVATE std::unordered_map<std::string, std::string> trace_connect_list_link_lat;
extern "C" {
-void sg_platf_trace_connect(TraceConnectCreationArgs* trace_connect)
+void sg_platf_trace_connect(simgrid::kernel::routing::TraceConnectCreationArgs* trace_connect)
{
xbt_assert(traces_set_list.find(trace_connect->trace) != traces_set_list.end(),
"Cannot connect trace %s to %s: trace unknown", trace_connect->trace.c_str(),
trace_connect->element.c_str());
switch (trace_connect->kind) {
- case TraceConnectKind::HOST_AVAIL:
+ case simgrid::kernel::routing::TraceConnectKind::HOST_AVAIL:
trace_connect_list_host_avail.insert({trace_connect->trace, trace_connect->element});
break;
- case TraceConnectKind::SPEED:
+ case simgrid::kernel::routing::TraceConnectKind::SPEED:
trace_connect_list_host_speed.insert({trace_connect->trace, trace_connect->element});
break;
- case TraceConnectKind::LINK_AVAIL:
+ case simgrid::kernel::routing::TraceConnectKind::LINK_AVAIL:
trace_connect_list_link_avail.insert({trace_connect->trace, trace_connect->element});
break;
- case TraceConnectKind::BANDWIDTH:
+ case simgrid::kernel::routing::TraceConnectKind::BANDWIDTH:
trace_connect_list_link_bw.insert({trace_connect->trace, trace_connect->element});
break;
- case TraceConnectKind::LATENCY:
+ case simgrid::kernel::routing::TraceConnectKind::LATENCY:
trace_connect_list_link_lat.insert({trace_connect->trace, trace_connect->element});
break;
default:
void ETag_surfxml_storage()
{
- StorageCreationArgs storage;
+ simgrid::kernel::routing::StorageCreationArgs storage;
storage.properties = current_property_set;
current_property_set = nullptr;
}
void ETag_surfxml_storage___type()
{
- StorageTypeCreationArgs storage_type;
+ simgrid::kernel::routing::StorageTypeCreationArgs storage_type;
storage_type.properties = current_property_set;
current_property_set = nullptr;
void ETag_surfxml_mount()
{
- MountCreationArgs mount;
+ simgrid::kernel::routing::MountCreationArgs mount;
mount.name = A_surfxml_mount_name;
mount.storageId = A_surfxml_mount_storageId;
}
void ETag_surfxml_host() {
- s_sg_platf_host_cbarg_t host;
+ simgrid::kernel::routing::HostCreationArgs host;
host.properties = current_property_set;
current_property_set = nullptr;
void STag_surfxml_host___link(){
XBT_DEBUG("Create a Host_link for %s",A_surfxml_host___link_id);
- HostLinkCreationArgs host_link;
+ simgrid::kernel::routing::HostLinkCreationArgs host_link;
host_link.id = A_surfxml_host___link_id;
host_link.link_up = A_surfxml_host___link_up;
}
void ETag_surfxml_cluster(){
- ClusterCreationArgs cluster;
+ simgrid::kernel::routing::ClusterCreationArgs cluster;
cluster.properties = current_property_set;
current_property_set = nullptr;
switch(AX_surfxml_cluster_topology){
case A_surfxml_cluster_topology_FLAT:
- cluster.topology = ClusterTopology::FLAT;
+ cluster.topology = simgrid::kernel::routing::ClusterTopology::FLAT;
break;
case A_surfxml_cluster_topology_TORUS:
- cluster.topology = ClusterTopology::TORUS;
+ cluster.topology = simgrid::kernel::routing::ClusterTopology::TORUS;
break;
case A_surfxml_cluster_topology_FAT___TREE:
- cluster.topology = ClusterTopology::FAT_TREE;
+ cluster.topology = simgrid::kernel::routing::ClusterTopology::FAT_TREE;
break;
case A_surfxml_cluster_topology_DRAGONFLY:
- cluster.topology = ClusterTopology::DRAGONFLY;
+ cluster.topology = simgrid::kernel::routing::ClusterTopology::DRAGONFLY;
break;
default:
surf_parse_error(std::string("Invalid cluster topology for cluster ") + cluster.id);
void STag_surfxml_cabinet(){
parse_after_config();
- CabinetCreationArgs cabinet;
+ simgrid::kernel::routing::CabinetCreationArgs cabinet;
cabinet.id = A_surfxml_cabinet_id;
cabinet.prefix = A_surfxml_cabinet_prefix;
cabinet.suffix = A_surfxml_cabinet_suffix;
void STag_surfxml_peer(){
parse_after_config();
- PeerCreationArgs peer;
+ simgrid::kernel::routing::PeerCreationArgs peer;
peer.id = std::string(A_surfxml_peer_id);
peer.speed = surf_parse_get_speed(A_surfxml_peer_speed, "speed of peer", peer.id.c_str());
}
void ETag_surfxml_link(){
- LinkCreationArgs link;
+ simgrid::kernel::routing::LinkCreationArgs link;
link.properties = current_property_set;
current_property_set = nullptr;
}
void ETag_surfxml_backbone(){
- LinkCreationArgs link;
+ simgrid::kernel::routing::LinkCreationArgs link;
link.properties = nullptr;
link.id = std::string(A_surfxml_backbone_id);
}
void ETag_surfxml_route(){
- RouteCreationArgs route;
+ simgrid::kernel::routing::RouteCreationArgs route;
route.src = sg_netpoint_by_name_or_null(A_surfxml_route_src); // tested to not be nullptr in start tag
route.dst = sg_netpoint_by_name_or_null(A_surfxml_route_dst); // tested to not be nullptr in start tag
}
void ETag_surfxml_zoneRoute()
{
- RouteCreationArgs ASroute;
+ simgrid::kernel::routing::RouteCreationArgs ASroute;
ASroute.src = sg_netpoint_by_name_or_null(A_surfxml_zoneRoute_src); // tested to not be nullptr in start tag
ASroute.dst = sg_netpoint_by_name_or_null(A_surfxml_zoneRoute_dst); // tested to not be nullptr in start tag
}
void ETag_surfxml_bypassRoute(){
- RouteCreationArgs route;
+ simgrid::kernel::routing::RouteCreationArgs route;
route.src = sg_netpoint_by_name_or_null(A_surfxml_bypassRoute_src); // tested to not be nullptr in start tag
route.dst = sg_netpoint_by_name_or_null(A_surfxml_bypassRoute_dst); // tested to not be nullptr in start tag
}
void ETag_surfxml_bypassZoneRoute()
{
- RouteCreationArgs ASroute;
+ simgrid::kernel::routing::RouteCreationArgs ASroute;
ASroute.src = sg_netpoint_by_name_or_null(A_surfxml_bypassZoneRoute_src);
ASroute.dst = sg_netpoint_by_name_or_null(A_surfxml_bypassZoneRoute_dst);
}
void ETag_surfxml_trace(){
- TraceCreationArgs trace;
+ simgrid::kernel::routing::TraceCreationArgs trace;
trace.id = A_surfxml_trace_id;
trace.file = A_surfxml_trace_file;
void STag_surfxml_trace___connect()
{
parse_after_config();
- TraceConnectCreationArgs trace_connect;
+ simgrid::kernel::routing::TraceConnectCreationArgs trace_connect;
trace_connect.element = A_surfxml_trace___connect_element;
trace_connect.trace = A_surfxml_trace___connect_trace;
switch (A_surfxml_trace___connect_kind) {
case AU_surfxml_trace___connect_kind:
case A_surfxml_trace___connect_kind_SPEED:
- trace_connect.kind = TraceConnectKind::SPEED;
+ trace_connect.kind = simgrid::kernel::routing::TraceConnectKind::SPEED;
break;
case A_surfxml_trace___connect_kind_BANDWIDTH:
- trace_connect.kind = TraceConnectKind::BANDWIDTH;
+ trace_connect.kind = simgrid::kernel::routing::TraceConnectKind::BANDWIDTH;
break;
case A_surfxml_trace___connect_kind_HOST___AVAIL:
- trace_connect.kind = TraceConnectKind::HOST_AVAIL;
+ trace_connect.kind = simgrid::kernel::routing::TraceConnectKind::HOST_AVAIL;
break;
case A_surfxml_trace___connect_kind_LATENCY:
- trace_connect.kind = TraceConnectKind::LATENCY;
+ trace_connect.kind = simgrid::kernel::routing::TraceConnectKind::LATENCY;
break;
case A_surfxml_trace___connect_kind_LINK___AVAIL:
- trace_connect.kind = TraceConnectKind::LINK_AVAIL;
+ trace_connect.kind = simgrid::kernel::routing::TraceConnectKind::LINK_AVAIL;
break;
default:
surf_parse_error("Invalid trace kind");
{
parse_after_config();
ZONE_TAG = 1;
- ZoneCreationArgs zone;
+ simgrid::kernel::routing::ZoneCreationArgs zone;
zone.id = A_surfxml_zone_id;
zone.routing = static_cast<int>(A_surfxml_zone_routing);
void ETag_surfxml_actor()
{
- ActorCreationArgs actor;
+ simgrid::kernel::routing::ActorCreationArgs actor;
actor.properties = current_property_set;
current_property_set = nullptr;
switch (A_surfxml_actor_on___failure) {
case AU_surfxml_actor_on___failure:
case A_surfxml_actor_on___failure_DIE:
- actor.on_failure = ActorOnFailure::DIE;
+ actor.on_failure = simgrid::kernel::routing::ActorOnFailure::DIE;
break;
case A_surfxml_actor_on___failure_RESTART:
- actor.on_failure = ActorOnFailure::RESTART;
+ actor.on_failure = simgrid::kernel::routing::ActorOnFailure::RESTART;
break;
default:
surf_parse_error("Invalid on failure behavior");