#include "xbt/str.h"
#include "xbt/dict.h"
#include "xbt/RngStream.h"
+#include <xbt/functional.hpp>
#include <xbt/signal.hpp>
#include "src/surf/HostImpl.hpp"
#include "surf/surf.h"
xbt_assert(nullptr == xbt_lib_get_or_null(as_router_lib, router->id, ROUTING_ASR_LEVEL),
"Refusing to create a router named '%s': this name already describes a node.", router->id);
- simgrid::surf::NetCard *netcard =
+ simgrid::surf::NetCard* netcard =
new simgrid::surf::NetCardImpl(router->id, simgrid::surf::NetCard::Type::Router, current_routing);
- xbt_lib_set(as_router_lib, router->id, ROUTING_ASR_LEVEL, (void *) netcard);
+ xbt_lib_set(as_router_lib, router->id, ROUTING_ASR_LEVEL, netcard);
XBT_DEBUG("Having set name '%s' id '%d'", router->id, netcard->id());
if (router->coord && strcmp(router->coord, "")) {
current_as->parse_specific_arguments(cluster);
if(cluster->loopback_bw!=0 || cluster->loopback_lat!=0){
- current_as->nb_links_per_node_++;
- current_as->has_loopback_ = 1;
+ current_as->linkCountPerNode_++;
+ current_as->hasLoopback_ = 1;
}
if(cluster->limiter_link!=0){
- current_as->nb_links_per_node_++;
- current_as->has_limiter_ = 1;
+ current_as->linkCountPerNode_++;
+ current_as->hasLimiter_ = 1;
}
std::vector<int> *radicals = explodesRadical(cluster->radical);
link.latency = cluster->loopback_lat;
link.policy = SURF_LINK_FATPIPE;
sg_platf_new_link(&link);
- info_loop.link_up = info_loop.link_down = Link::byName(tmp_link);
+ info_loop.linkUp = info_loop.linkDown = Link::byName(tmp_link);
free(tmp_link);
auto as_cluster = static_cast<AsCluster*>(current_as);
- xbt_dynar_set(as_cluster->privateLinks_, rankId*as_cluster->nb_links_per_node_, &info_loop);
+ xbt_dynar_set(as_cluster->privateLinks_, rankId*as_cluster->linkCountPerNode_, &info_loop);
}
//add a limiter link (shared link to account for maximal bandwidth of the node)
link.latency = 0;
link.policy = SURF_LINK_SHARED;
sg_platf_new_link(&link);
- info_lim.link_up = info_lim.link_down = Link::byName(tmp_link);
+ info_lim.linkUp = info_lim.linkDown = Link::byName(tmp_link);
free(tmp_link);
- xbt_dynar_set(current_as->privateLinks_, rankId * current_as->nb_links_per_node_ + current_as->has_loopback_ , &info_lim);
+ xbt_dynar_set(current_as->privateLinks_, rankId * current_as->linkCountPerNode_ + current_as->hasLoopback_ , &info_lim);
}
//call the cluster function that adds the others links
}
else {
current_as->create_links_for_node(cluster, i, rankId,
- rankId*current_as->nb_links_per_node_ + current_as->has_loopback_ + current_as->has_limiter_ );
+ rankId*current_as->linkCountPerNode_ + current_as->hasLoopback_ + current_as->hasLimiter_ );
}
xbt_free(link_id);
xbt_free(host_id);
double kill_time = process->kill_time;
int auto_restart = process->on_failure == SURF_PROCESS_ON_FAILURE_DIE ? 0 : 1;
- std::function<void()> code = simgrid::simix::wrap_main(parse_code, process->argc, process->argv);
+ std::function<void()> code = simgrid::xbt::wrapMain(parse_code, process->argc, process->argv);
smx_process_arg_t arg = NULL;
smx_process_t process_created = NULL;
XBT_DEBUG("Process %s(%s) will be started at time %f",
arg->name.c_str(), arg->hostname, start_time);
- SIMIX_timer_set(start_time, [](void* p) {
- smx_process_arg_t arg = static_cast<smx_process_arg_t>(p);
+ SIMIX_timer_set(start_time, [=]() {
simix_global->create_process_function(
arg->name.c_str(),
std::move(arg->code),
arg->auto_restart,
NULL);
delete arg;
- }, arg);
+ });
} else { // start_time <= SIMIX_get_clock()
XBT_DEBUG("Starting Process %s(%s) right now",
arg->name.c_str(), sg_host_get_name(host));
"Only hosts from Cluster and Vivaldi ASes can get an host_link.");
s_surf_parsing_link_up_down_t link_up_down;
- link_up_down.link_up = Link::byName(hostlink->link_up);
- link_up_down.link_down = Link::byName(hostlink->link_down);
+ link_up_down.linkUp = Link::byName(hostlink->link_up);
+ link_up_down.linkDown = Link::byName(hostlink->link_down);
- xbt_assert(link_up_down.link_up, "Link '%s' not found!",hostlink->link_up);
- xbt_assert(link_up_down.link_down, "Link '%s' not found!",hostlink->link_down);
+ xbt_assert(link_up_down.linkUp, "Link '%s' not found!",hostlink->link_up);
+ xbt_assert(link_up_down.linkDown, "Link '%s' not found!",hostlink->link_down);
// If dynar is is greater than netcard id and if the host_link is already defined
auto as_cluster = static_cast<simgrid::surf::AsCluster*>(current_routing);