Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Initialize CPU model for VMs in init_HL13
[simgrid.git] / src / surf / network_interface.cpp
index f33fe69..31147f7 100644 (file)
@@ -19,8 +19,6 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(res_network, ker_resource, "Network resources, t
  * Model *
  *********/
 
-simgrid::kernel::resource::NetworkModel* surf_network_model = nullptr;
-
 namespace simgrid {
 namespace kernel {
 namespace resource {
@@ -115,7 +113,7 @@ s4u::Link::SharingPolicy LinkImpl::get_sharing_policy() const
   return get_constraint()->get_sharing_policy();
 }
 
-void LinkImpl::latency_check(double latency)
+void LinkImpl::latency_check(double latency) const
 {
   static double last_warned_latency = sg_surf_precision;
   if (latency != 0.0 && latency < last_warned_latency) {
@@ -155,6 +153,7 @@ void LinkImpl::turn_off()
 
 void LinkImpl::seal()
 {
+  xbt_assert(this->get_model(), "Cannot seal Link(%s) without setting the Network model first", this->get_cname());
   Resource::seal();
   simgrid::s4u::Link::on_creation(*get_iface());
 }