Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Don't mix LMM sharing policy with S4U.
[simgrid.git] / src / surf / network_interface.cpp
index de4f57e..2983342 100644 (file)
@@ -84,12 +84,16 @@ bool LinkImpl::is_used() const
 
 LinkImpl* LinkImpl::set_sharing_policy(s4u::Link::SharingPolicy policy)
 {
-  get_constraint()->set_sharing_policy(policy);
+  lmm::Constraint::SharingPolicy ct_policy = lmm::Constraint::SharingPolicy::SHARED;
+  if (policy == s4u::Link::SharingPolicy::FATPIPE)
+    ct_policy = lmm::Constraint::SharingPolicy::FATPIPE;
+  get_constraint()->set_sharing_policy(ct_policy);
+  sharing_policy_ = policy;
   return this;
 }
 s4u::Link::SharingPolicy LinkImpl::get_sharing_policy() const
 {
-  return get_constraint()->get_sharing_policy();
+  return sharing_policy_;
 }
 
 void LinkImpl::latency_check(double latency) const