Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge pull request #65 from fabienchaix/master
[simgrid.git] / src / surf / network_cm02.cpp
index dc0d4f9..64ba10d 100644 (file)
@@ -9,6 +9,7 @@
 #include "network_cm02.hpp"
 #include "maxmin_private.hpp"
 #include "simgrid/sg_config.h"
 #include "network_cm02.hpp"
 #include "maxmin_private.hpp"
 #include "simgrid/sg_config.h"
+#include "src/instr/instr_private.h" // TRACE_is_enabled(). FIXME: remove by subscribing tracing to the surf signals
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_network);
 
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_network);
 
@@ -162,7 +163,7 @@ NetworkCm02Model::NetworkCm02Model()
 
   routing_model_create(createLink("__loopback__",
                                 498000000, NULL, 0.000015, NULL,
 
   routing_model_create(createLink("__loopback__",
                                 498000000, NULL, 0.000015, NULL,
-                                1 /*SURF_RESOURCE_ON*/, NULL,
+                                NULL,
                                 SURF_LINK_FATPIPE, NULL));
 
   if (p_updateMechanism == UM_LAZY) {
                                 SURF_LINK_FATPIPE, NULL));
 
   if (p_updateMechanism == UM_LAZY) {
@@ -176,7 +177,7 @@ NetworkCm02Model::NetworkCm02Model()
 Link* NetworkCm02Model::createLink(const char *name,
     double bw_initial, tmgr_trace_t bw_trace,
     double lat_initial, tmgr_trace_t lat_trace,
 Link* NetworkCm02Model::createLink(const char *name,
     double bw_initial, tmgr_trace_t bw_trace,
     double lat_initial, tmgr_trace_t lat_trace,
-    int initiallyOn, tmgr_trace_t state_trace,
+    tmgr_trace_t state_trace,
     e_surf_link_sharing_policy_t policy, xbt_dict_t properties)
 {
   xbt_assert(NULL == Link::byName(name),
     e_surf_link_sharing_policy_t policy, xbt_dict_t properties)
 {
   xbt_assert(NULL == Link::byName(name),
@@ -184,7 +185,7 @@ Link* NetworkCm02Model::createLink(const char *name,
              name);
 
   Link* link = new NetworkCm02Link(this, name, properties, p_maxminSystem, sg_bandwidth_factor * bw_initial,
              name);
 
   Link* link = new NetworkCm02Link(this, name, properties, p_maxminSystem, sg_bandwidth_factor * bw_initial,
-                     initiallyOn, state_trace, bw_initial, bw_trace, lat_initial, lat_trace, policy);
+                     state_trace, bw_initial, bw_trace, lat_initial, lat_trace, policy);
   Link::onCreation(link);
   return link;
 }
   Link::onCreation(link);
   return link;
 }
@@ -436,17 +437,12 @@ Action *NetworkCm02Model::communicate(NetCard *src, NetCard *dst,
 NetworkCm02Link::NetworkCm02Link(NetworkCm02Model *model, const char *name, xbt_dict_t props,
     lmm_system_t system,
     double constraint_value,
 NetworkCm02Link::NetworkCm02Link(NetworkCm02Model *model, const char *name, xbt_dict_t props,
     lmm_system_t system,
     double constraint_value,
-    int initiallyOn, tmgr_trace_t state_trace,
+    tmgr_trace_t state_trace,
     double bw_peak, tmgr_trace_t bw_trace,
     double lat_initial, tmgr_trace_t lat_trace,
     e_surf_link_sharing_policy_t policy)
 : Link(model, name, props, lmm_constraint_new(system, this, constraint_value), state_trace)
 {
     double bw_peak, tmgr_trace_t bw_trace,
     double lat_initial, tmgr_trace_t lat_trace,
     e_surf_link_sharing_policy_t policy)
 : Link(model, name, props, lmm_constraint_new(system, this, constraint_value), state_trace)
 {
-  if (initiallyOn)
-    turnOn();
-  else
-    turnOff();
-
   m_bandwidth.scale = 1.0;
   m_bandwidth.peak = bw_peak;
   if (bw_trace)
   m_bandwidth.scale = 1.0;
   m_bandwidth.peak = bw_peak;
   if (bw_trace)