Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
(crudly) deal with I/O launched by maestro
[simgrid.git] / src / surf / network_constant.cpp
index 5bd7210..b786a20 100644 (file)
@@ -3,12 +3,12 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "network_constant.hpp"
-#include "simgrid/kernel/routing/NetZoneImpl.hpp"
-#include "simgrid/s4u/Engine.hpp"
+#include <simgrid/kernel/routing/NetZoneImpl.hpp>
+#include <simgrid/s4u/Engine.hpp>
+
 #include "src/kernel/EngineImpl.hpp"
+#include "src/surf/network_constant.hpp"
 #include "src/surf/surf_interface.hpp"
-#include "surf/surf.hpp"
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(res_network);
 
@@ -18,8 +18,9 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(res_network);
 void surf_network_model_init_Constant()
 {
   auto net_model = std::make_shared<simgrid::kernel::resource::NetworkConstantModel>("Network_Constant");
-  simgrid::kernel::EngineImpl::get_instance()->add_model(net_model);
-  simgrid::s4u::Engine::get_instance()->get_netzone_root()->get_impl()->set_network_model(net_model);
+  auto* engine   = simgrid::kernel::EngineImpl::get_instance();
+  engine->add_model(net_model);
+  engine->get_netzone_root()->set_network_model(net_model);
 }
 
 namespace simgrid {
@@ -74,10 +75,7 @@ void NetworkConstantModel::update_actions_state(double /*now*/, double delta)
 
 Action* NetworkConstantModel::communicate(s4u::Host* src, s4u::Host* dst, double size, double /*rate*/)
 {
-  auto* action = new NetworkConstantAction(this, *src, *dst, size);
-
-  s4u::Link::on_communicate(*action);
-  return action;
+  return (new NetworkConstantAction(this, *src, *dst, size));
 }
 
 /**********