Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Sanitize the handling of the future_event_set
authorMartin Quinson <martin.quinson@loria.fr>
Sun, 7 Feb 2016 21:34:06 +0000 (22:34 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Sun, 7 Feb 2016 21:35:54 +0000 (22:35 +0100)
- Make it private to surf
- dont pass it as parameter in public API. That's a singleton after all

include/simgrid/forward.h
src/surf/host_ptask_L07.cpp
src/surf/network_cm02.cpp
src/surf/network_cm02.hpp
src/surf/network_interface.cpp
src/surf/network_interface.hpp
src/surf/surf_interface.cpp
src/surf/surf_interface.hpp
src/surf/surf_private.h

index 8696b47..19082b7 100644 (file)
@@ -33,7 +33,6 @@ typedef simgrid::surf::Cpu surf_Cpu;
 typedef simgrid::surf::NetCard surf_NetCard;
 typedef simgrid::surf::Link Link;
 typedef simgrid::surf::Resource surf_Resource;
-typedef simgrid::trace_mgr::future_evt_set sg_future_evt_set;
 
 #else
 
@@ -43,7 +42,6 @@ typedef struct surf_Cpu surf_Cpu;
 typedef struct surf_NetCard surf_NetCard;
 typedef struct surf_Resource surf_Resource;
 typedef struct Link Link;
-typedef struct future_evt_set sg_future_evt_set;
 #endif
 
 typedef simgrid_Host* sg_host_t;
@@ -51,7 +49,6 @@ typedef surf_As *AS_t;
 typedef surf_Cpu *surf_cpu_t;
 typedef surf_NetCard *sg_netcard_t;
 typedef surf_Resource *sg_resource_t;
-typedef sg_future_evt_set *sg_future_evt_set_t;
 
 // Types which are in fact dictelmt:
 typedef xbt_dictelm_t sg_storage_t;
index ece1449..d77a0f7 100644 (file)
@@ -408,14 +408,11 @@ CpuL07::~CpuL07()
 }
 
 LinkL07::LinkL07(NetworkL07Model *model, const char* name, xbt_dict_t props,
-             double bw_initial,
-             tmgr_trace_t bw_trace,
-             double lat_initial,
-             tmgr_trace_t lat_trace,
-             int initiallyOn,
-             tmgr_trace_t state_trace,
+             double bw_initial, tmgr_trace_t bw_trace,
+             double lat_initial, tmgr_trace_t lat_trace,
+             int initiallyOn, tmgr_trace_t state_trace,
              e_surf_link_sharing_policy_t policy)
- : Link(model, name, props, lmm_constraint_new(model->getMaxminSystem(), this, bw_initial), future_evt_set, state_trace)
+ : Link(model, name, props, lmm_constraint_new(model->getMaxminSystem(), this, bw_initial), state_trace)
 {
   m_bandwidth.peak = bw_initial;
   if (bw_trace)
index 318c3b9..7adf7b1 100644 (file)
@@ -209,7 +209,7 @@ Link* NetworkCm02Model::createLink(const char *name,
              "Link '%s' declared several times in the platform",
              name);
 
-  Link* link = new NetworkCm02Link(this, name, properties, p_maxminSystem, sg_bandwidth_factor * bw_initial, future_evt_set,
+  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);
   Link::onCreation(link);
   return link;
@@ -516,12 +516,11 @@ void NetworkCm02Model::addTraces(){
 NetworkCm02Link::NetworkCm02Link(NetworkCm02Model *model, const char *name, xbt_dict_t props,
                              lmm_system_t system,
                              double constraint_value,
-                             sg_future_evt_set_t fes,
                              int initiallyOn, 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), fes, state_trace)
+: Link(model, name, props, lmm_constraint_new(system, this, constraint_value), state_trace)
 {
   if (initiallyOn)
     turnOn();
@@ -531,14 +530,14 @@ NetworkCm02Link::NetworkCm02Link(NetworkCm02Model *model, const char *name, xbt_
   m_bandwidth.scale = 1.0;
   m_bandwidth.peak = bw_peak;
   if (bw_trace)
-    m_bandwidth.event = fes->add_trace(bw_trace, 0.0, this);
+    m_bandwidth.event = future_evt_set->add_trace(bw_trace, 0.0, this);
   else
     m_bandwidth.event = NULL;
 
   m_latency.scale = 1.0;
   m_latency.peak = lat_initial;
   if (lat_trace)
-    m_latency.event = fes->add_trace(lat_trace, 0.0, this);
+    m_latency.event = future_evt_set->add_trace(lat_trace, 0.0, this);
 
   if (policy == SURF_LINK_FATPIPE)
   lmm_constraint_shared(getConstraint());
index fb354f7..a5c4284 100644 (file)
@@ -75,7 +75,6 @@ public:
   NetworkCm02Link(NetworkCm02Model *model, const char *name, xbt_dict_t props,
                              lmm_system_t system,
                              double constraint_value,
-                             sg_future_evt_set_t fes,
                              int initiallyOn,
                              tmgr_trace_t state_trace,
                              double metric_peak,
index b649476..45ca1ef 100644 (file)
@@ -203,7 +203,6 @@ Link::Link(simgrid::surf::NetworkModel *model, const char *name, xbt_dict_t prop
 
 Link::Link(simgrid::surf::NetworkModel *model, const char *name, xbt_dict_t props,
                      lmm_constraint_t constraint,
-                     sg_future_evt_set_t fes,
                        tmgr_trace_t state_trace)
 : Resource(model, name, constraint),
   PropertyHolder(props)
@@ -211,7 +210,7 @@ Link::Link(simgrid::surf::NetworkModel *model, const char *name, xbt_dict_t prop
   m_latency.scale = 1;
   m_bandwidth.scale = 1;
   if (state_trace)
-    m_stateEvent = fes->add_trace(state_trace, 0.0, this);
+    m_stateEvent = future_evt_set->add_trace(state_trace, 0.0, this);
 
   links->insert({name, this});
   XBT_DEBUG("Create link '%s'",name);
index 599b24e..e199d1d 100644 (file)
@@ -185,12 +185,10 @@ public:
    * @param name The name of the Link
    * @param props Dictionary of properties associated to this Link
    * @param constraint The lmm constraint associated to this Cpu if it is part of a LMM component
-   * @param fes Future Event Set in which our events must be registered
    * @param state_trace [TODO]
    */
   Link(simgrid::surf::NetworkModel *model, const char *name, xbt_dict_t props,
               lmm_constraint_t constraint,
-              sg_future_evt_set_t fes,
               tmgr_trace_t state_trace);
 
   /* Link destruction logic */
index 5a9ccce..ed60663 100644 (file)
@@ -29,7 +29,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_kernel, surf,
 xbt_dynar_t all_existing_models = NULL; /* to destroy models correctly */
 xbt_dynar_t model_list_invoke = NULL;  /* to invoke callbacks */
 
-sg_future_evt_set_t future_evt_set = nullptr;
+simgrid::trace_mgr::future_evt_set *future_evt_set = nullptr;
 xbt_dynar_t surf_path = NULL;
 xbt_dynar_t host_that_restart = NULL;
 xbt_dict_t watched_hosts_lib;
index e2cfb09..d0739e7 100644 (file)
 #include "simgrid/platf_interface.h"
 #include "surf/surf.h"
 #include "src/surf/surf_private.h"
-#include "src/surf/trace_mgr.hpp"
 #include "src/internal_config.h"
 
-extern XBT_PRIVATE sg_future_evt_set_t future_evt_set;
 #define NO_MAX_DURATION -1.0
 
 /*********
index b1600e5..d59ad24 100644 (file)
@@ -65,6 +65,9 @@ typedef enum {
   SURF_ROUTING_RECURSIVE   /**< Recursive case: also return gateway informations */
 } e_surf_routing_hierarchy_t;
 
+extern XBT_PRIVATE simgrid::trace_mgr::future_evt_set *future_evt_set;
+
+
 XBT_PUBLIC(void) routing_model_create(void *loopback);
 XBT_PUBLIC(void) routing_exit(void);
 XBT_PUBLIC(void) storage_register_callbacks(void);