X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/eadbe829389f23151f79257824f3164d7801bbc7..043ae887210f9720621e83305f5fb434604f6b83:/src/surf/sg_platf.cpp diff --git a/src/surf/sg_platf.cpp b/src/surf/sg_platf.cpp index 1e04af4a01..83178f8d8a 100644 --- a/src/surf/sg_platf.cpp +++ b/src/surf/sg_platf.cpp @@ -74,7 +74,7 @@ void sg_platf_new_host(simgrid::kernel::routing::HostCreationArgs* args) } simgrid::s4u::Host* host = - routing_get_current()->create_host(args->id, &args->speed_per_pstate, args->core_amount, &props); + routing_get_current()->create_host(args->id, args->speed_per_pstate, args->core_amount, &props); host->pimpl_->storage_ = mount_list; mount_list.clear(); @@ -86,7 +86,7 @@ void sg_platf_new_host(simgrid::kernel::routing::HostCreationArgs* args) host->pimpl_cpu->set_speed_profile(args->speed_trace); if (args->pstate != 0) host->pimpl_cpu->set_pstate(args->pstate); - if (args->coord && strcmp(args->coord, "")) + if (not args->coord.empty()) new simgrid::kernel::routing::vivaldi::Coords(host->pimpl_netpoint, args->coord); } @@ -115,8 +115,7 @@ static void sg_platf_new_link(simgrid::kernel::routing::LinkCreationArgs* link, surf_network_model->create_link(link_name, link->bandwidth, link->latency, link->policy); if (link->properties) { - for (auto const& elm : *link->properties) - l->set_property(elm.first, elm.second); + l->set_properties(*link->properties); } if (link->latency_trace) @@ -362,8 +361,7 @@ void sg_platf_new_storage(simgrid::kernel::routing::StorageCreationArgs* storage auto s = surf_storage_model->createStorage(storage->id, stype->id, storage->content, storage->attach); if (storage->properties) { - for (auto const& elm : *storage->properties) - s->set_property(elm.first, elm.second); + s->set_properties(*storage->properties); delete storage->properties; } } @@ -450,12 +448,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() @@ -481,9 +479,9 @@ void sg_platf_new_peer(simgrid::kernel::routing::PeerCreationArgs* peer) simgrid::kernel::routing::VivaldiZone* as = dynamic_cast(current_routing); xbt_assert(as, " tag can only be used in Vivaldi netzones."); - std::vector speedPerPstate; - speedPerPstate.push_back(peer->speed); - simgrid::s4u::Host* host = as->create_host(peer->id.c_str(), &speedPerPstate, 1, nullptr); + std::vector speed_per_pstate; + speed_per_pstate.push_back(peer->speed); + simgrid::s4u::Host* host = as->create_host(peer->id.c_str(), speed_per_pstate, 1, nullptr); as->set_peer_link(host->pimpl_netpoint, peer->bw_in, peer->bw_out, peer->coord);