Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
use signal to trace link usage
[simgrid.git] / src / surf / network_interface.cpp
index 7fdfce0..7391e1d 100644 (file)
@@ -216,8 +216,10 @@ void LinkImpl::setLatencyTrace(tmgr_trace_t trace)
 
 void NetworkAction::set_state(Action::State state)
 {
+  Action::State previous = get_state();
   Action::set_state(state);
-  s4u::Link::on_communication_state_change(this);
+  if (previous != state) // Trigger only if the state changed
+    s4u::Link::on_communication_state_change(this);
 }
 
 /** @brief returns a list of all Links that this action is using */