Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fix NS3 build
authorMartin Quinson <martin.quinson@loria.fr>
Sat, 15 Oct 2016 11:19:55 +0000 (13:19 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Sat, 15 Oct 2016 11:19:55 +0000 (13:19 +0200)
src/surf/network_ns3.cpp
src/surf/network_ns3.hpp

index a2956c8..968f590 100644 (file)
@@ -251,7 +251,7 @@ Link* NetworkNS3Model::createLink(const char *name, double bandwidth, double lat
   return new LinkNS3(this, name, properties, bandwidth, latency);
 }
 
-Action *NetworkNS3Model::communicate(simgrid::kernel::routing::NetCard *src,simgrid::kernel::routing::NetCard *dst, double size, double rate)
+Action* NetworkNS3Model::communicate(s4u::Host* src, s4u::Host* dst, double size, double rate)
 {
   return new NetworkNS3Action(this, size, src, dst);
 }
@@ -305,7 +305,7 @@ void NetworkNS3Model::updateActionsState(double now, double delta)
 
       std::vector<Link*> *route = new std::vector<Link*>();
 
-      routing_platf->getRouteAndLatency (action->src_, action->dst_, route, nullptr);
+      routing_platf->getRouteAndLatency(action->src_->pimpl_netcard, action->dst_->pimpl_netcard, route, nullptr);
       for (auto link : *route)
         TRACE_surf_link_set_utilization (link->getName(), action->getCategory(), (data_delta_sent)/delta, now-delta, delta);
       delete route;
@@ -364,14 +364,14 @@ void LinkNS3::setLatencyTrace(tmgr_trace_t trace) {
  * Action *
  **********/
 
-NetworkNS3Action::NetworkNS3Action(Model *model, double size, simgrid::kernel::routing::NetCard *src, simgrid::kernel::routing::NetCard *dst)
-: NetworkAction(model, size, false)
+NetworkNS3Action::NetworkNS3Action(Model* model, double size, s4u::Host* src, s4u::Host* dst)
+    : NetworkAction(model, size, false)
 {
-  XBT_DEBUG("Communicate from %s to %s", src->name(), dst->name());
+  XBT_DEBUG("Communicate from %s to %s", src->name().c_str(), dst->name().c_str());
 
   src_ = src;
   dst_ = dst;
-  ns3_create_flow(src->name(), dst->name(), surf_get_clock(), size, this);
+  ns3_create_flow(src->name().c_str(), dst->name().c_str(), surf_get_clock(), size, this);
 
   Link::onCommunicate(this, src, dst);
 }
index 0660b01..626e7f3 100644 (file)
@@ -21,7 +21,7 @@ public:
   ~NetworkNS3Model();
   Link* createLink(const char *name, double bandwidth, double latency,
       e_surf_link_sharing_policy_t policy, xbt_dict_t properties) override;
-  Action *communicate(kernel::routing::NetCard *src, kernel::routing::NetCard *dst, double size, double rate);
+  Action* communicate(s4u::Host* src, s4u::Host* dst, double size, double rate) override;
   double nextOccuringEvent(double now) override;
   bool nextOccuringEventIsIdempotent() {return false;}
   void updateActionsState(double now, double delta) override;
@@ -47,7 +47,7 @@ public:
  **********/
 class XBT_PRIVATE NetworkNS3Action : public NetworkAction {
 public:
-  NetworkNS3Action(Model *model, double cost, kernel::routing::NetCard *src, kernel::routing::NetCard *dst);
+  NetworkNS3Action(Model* model, double cost, s4u::Host* src, s4u::Host* dst);
 
   bool isSuspended();
   int unref();
@@ -56,8 +56,8 @@ public:
 
 //private:
   double lastSent_ = 0;
-  kernel::routing::NetCard *src_;
-  kernel::routing::NetCard *dst_;
+  s4u::Host* src_;
+  s4u::Host* dst_;
 };
 
 }