X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/dc1369e2055686dde3d178efb2001dbad8972d54..39cfe4998b59626bdcc96dc00d3bf029825a10a5:/src/surf/sg_platf.cpp diff --git a/src/surf/sg_platf.cpp b/src/surf/sg_platf.cpp index 3b46bc1529..4201ba0b49 100644 --- a/src/surf/sg_platf.cpp +++ b/src/surf/sg_platf.cpp @@ -19,6 +19,7 @@ #include "src/include/simgrid/sg_config.hpp" #include "src/include/surf/surf.hpp" #include "src/kernel/EngineImpl.hpp" +#include "src/kernel/resource/profile/Profile.hpp" #include "src/simix/smx_private.hpp" #include "src/surf/HostImpl.hpp" #include "src/surf/xml/platf_private.hpp" @@ -112,7 +113,7 @@ simgrid::kernel::routing::NetPoint* sg_platf_new_router(const std::string& name, static void sg_platf_new_link(simgrid::kernel::routing::LinkCreationArgs* link, const std::string& link_name) { simgrid::kernel::resource::LinkImpl* l = - surf_network_model->create_link(link_name, link->bandwidth, link->latency, link->policy); + surf_network_model->create_link(link_name, link->bandwidths, link->latency, link->policy); if (link->properties) { l->set_properties(*link->properties); @@ -166,6 +167,9 @@ void sg_platf_new_cluster(simgrid::kernel::routing::ClusterCreationArgs* cluster sg_platf_new_Zone_begin(&zone); simgrid::kernel::routing::ClusterZone* current_as = static_cast(routing_get_current()); current_as->parse_specific_arguments(cluster); + if (cluster->properties != nullptr) + for (auto const& elm : *cluster->properties) + current_as->get_iface()->set_property(elm.first, elm.second); if(cluster->loopback_bw > 0 || cluster->loopback_lat > 0){ current_as->num_links_per_node_++; @@ -216,7 +220,7 @@ void sg_platf_new_cluster(simgrid::kernel::routing::ClusterCreationArgs* cluster simgrid::kernel::routing::LinkCreationArgs link; link.id = tmp_link; - link.bandwidth = cluster->loopback_bw; + link.bandwidths.push_back(cluster->loopback_bw); link.latency = cluster->loopback_lat; link.policy = simgrid::s4u::Link::SharingPolicy::FATPIPE; sg_platf_new_link(&link); @@ -236,7 +240,7 @@ void sg_platf_new_cluster(simgrid::kernel::routing::ClusterCreationArgs* cluster simgrid::kernel::routing::LinkCreationArgs link; link.id = tmp_link; - link.bandwidth = cluster->limiter_link; + link.bandwidths.push_back(cluster->limiter_link); link.latency = 0; link.policy = simgrid::s4u::Link::SharingPolicy::SHARED; sg_platf_new_link(&link); @@ -271,7 +275,7 @@ void sg_platf_new_cluster(simgrid::kernel::routing::ClusterCreationArgs* cluster simgrid::kernel::routing::LinkCreationArgs link; link.id = std::string(cluster->id)+ "_backbone"; - link.bandwidth = cluster->bb_bw; + link.bandwidths.push_back(cluster->bb_bw); link.latency = cluster->bb_lat; link.policy = cluster->bb_sharing_policy; @@ -314,7 +318,7 @@ void sg_platf_new_cabinet(simgrid::kernel::routing::CabinetCreationArgs* cabinet simgrid::kernel::routing::LinkCreationArgs link; link.policy = simgrid::s4u::Link::SharingPolicy::SPLITDUPLEX; link.latency = cabinet->lat; - link.bandwidth = cabinet->bw; + link.bandwidths.push_back(cabinet->bw); link.id = "link_" + hostname; sg_platf_new_link(&link); @@ -448,12 +452,12 @@ void sg_platf_new_actor(simgrid::kernel::routing::ActorCreationArgs* actor) XBT_DEBUG("Process %s@%s will be started at time %f", arg->name.c_str(), arg->host->get_cname(), start_time); simgrid::simix::Timer::set(start_time, [arg, auto_restart]() { - simgrid::kernel::actor::ActorImplPtr actor = simgrid::kernel::actor::ActorImpl::create( + simgrid::kernel::actor::ActorImplPtr new_actor = simgrid::kernel::actor::ActorImpl::create( arg->name.c_str(), std::move(arg->code), arg->data, arg->host, arg->properties.get(), nullptr); if (arg->kill_time >= 0) - actor->set_kill_time(arg->kill_time); + new_actor->set_kill_time(arg->kill_time); if (auto_restart) - actor->set_auto_restart(auto_restart); + new_actor->set_auto_restart(auto_restart); delete arg; }); } else { // start_time <= SIMIX_get_clock()