X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/5ce7954780a1bff9dec8111b835749decb85a158..164354d45e8fc361488fcdff50aee3c655c0d220:/src/surf/network_ns3.cpp diff --git a/src/surf/network_ns3.cpp b/src/surf/network_ns3.cpp index 6a56dbdd53..f9d8731294 100644 --- a/src/surf/network_ns3.cpp +++ b/src/surf/network_ns3.cpp @@ -190,7 +190,7 @@ double NetworkNS3Model::next_occuring_event(double now) XBT_DEBUG("ns3_next_occuring_event"); //get the first relevant value from the running_actions list - if (not get_running_action_set()->size() || now == 0.0) + if (not get_started_action_set()->size() || now == 0.0) return -1.0; else do { @@ -211,7 +211,7 @@ void NetworkNS3Model::update_actions_state(double now, double delta) static std::vector socket_to_destroy; /* If there are no running flows, advance the NS3 simulator and return */ - if (get_running_action_set()->empty()) { + if (get_started_action_set()->empty()) { while(double_positive(now - ns3::Simulator::Now().GetSeconds(), sg_surf_precision)) ns3_simulator(now-ns3::Simulator::Now().GetSeconds()); @@ -227,15 +227,15 @@ void NetworkNS3Model::update_actions_state(double now, double delta) XBT_DEBUG("Processing socket %p (action %p)",sgFlow,action); action->set_remains(action->get_cost() - sgFlow->sentBytes_); - if (TRACE_is_enabled() && action->get_state() == kernel::resource::Action::State::running) { + if (TRACE_is_enabled() && action->get_state() == kernel::resource::Action::State::STARTED) { double data_delta_sent = sgFlow->sentBytes_ - action->lastSent_; std::vector route = std::vector(); - action->src_->routeTo(action->dst_, route, nullptr); + action->src_->route_to(action->dst_, route, nullptr); for (auto const& link : route) - TRACE_surf_link_set_utilization(link->get_cname(), action->get_category(), (data_delta_sent) / delta, - now - delta, delta); + TRACE_surf_resource_set_utilization("LINK", "bandwidth_used", link->get_cname(), action->get_category(), + (data_delta_sent) / delta, now - delta, delta); action->lastSent_ = sgFlow->sentBytes_; } @@ -243,7 +243,7 @@ void NetworkNS3Model::update_actions_state(double now, double delta) if(sgFlow->finished_){ socket_to_destroy.push_back(ns3Socket); XBT_DEBUG("Destroy socket %p of action %p", ns3Socket.c_str(), action); - action->finish(kernel::resource::Action::State::done); + action->finish(kernel::resource::Action::State::FINISHED); } else { XBT_DEBUG("Socket %p sent %u bytes out of %u (%u remaining)", ns3Socket.c_str(), sgFlow->sentBytes_, sgFlow->totalBytes_, sgFlow->remaining_);