Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Initialize another bunch of variables.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Thu, 21 Nov 2013 20:48:21 +0000 (21:48 +0100)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Thu, 21 Nov 2013 20:50:25 +0000 (21:50 +0100)
src/surf/cpu_cas01.cpp
src/surf/cpu_ti.cpp
src/surf/network.hpp
src/surf/surf.cpp
src/surf/surf_routing_dijkstra.cpp

index 89bd2ee..e8d2447 100644 (file)
@@ -204,6 +204,7 @@ CpuCas01Lmm::CpuCas01Lmm(CpuCas01ModelPtr model, const char *name, xbt_dynar_t p
                          e_surf_resource_state_t stateInitial, tmgr_trace_t stateTrace,
                          xbt_dict_t properties) :
        Resource(model, name, properties), CpuLmm(model, name, properties) {
+  p_powerEvent = NULL;
   m_powerPeak = xbt_dynar_get_as(powerPeak, pstate, double);
   p_powerPeakList = powerPeak;
   m_pstate = pstate;
index ea61b9a..b32b41b 100644 (file)
@@ -583,6 +583,7 @@ CpuTi::CpuTi(CpuTiModelPtr model, const char *name, xbt_dynar_t powerPeak,
         e_surf_resource_state_t stateInitial, tmgr_trace_t stateTrace,
        xbt_dict_t properties) :
        Resource(model, name, properties), Cpu(model, name, properties) {
+  p_powerEvent = NULL;
   p_stateCurrent = stateInitial;
   m_powerScale = powerScale;
   m_core = core;
@@ -595,6 +596,8 @@ CpuTi::CpuTi(CpuTiModelPtr model, const char *name, xbt_dynar_t powerPeak,
   CpuTiActionPtr action = NULL;
   p_actionSet = xbt_swag_new(xbt_swag_offset(*action, p_cpuListHookup));
 
+  m_lastUpdate = 0;
+
   xbt_dynar_get_cpy(powerPeak, 0, &m_powerPeak);
   xbt_dynar_free(&powerPeak);  /* kill memory leak */
   m_pstate = pstate;
index 695b754..efc1ba6 100644 (file)
@@ -77,8 +77,9 @@ public:
 
 class NetworkCm02Link : virtual public Resource {
 public:
-  NetworkCm02Link(){};
-  NetworkCm02Link(NetworkCm02ModelPtr model, const char* name, xbt_dict_t properties) : Resource(model, name, properties) {};
+  NetworkCm02Link() : p_latEvent(NULL) {};
+  NetworkCm02Link(NetworkCm02ModelPtr model, const char* name, xbt_dict_t properties)
+    : Resource(model, name, properties), p_latEvent(NULL) {};
   virtual double getBandwidth()=0;
   virtual double getLatency();
   virtual bool isShared()=0;
index 2d96617..17fe0b0 100644 (file)
@@ -731,6 +731,8 @@ ResourceLmm::ResourceLmm(surf_model_t model, const char *name, xbt_dict_t props,
   p_power.peak = metric_peak;
   if (metric_trace)
     p_power.event = tmgr_history_add_trace(history, metric_trace, 0.0, 0, static_cast<ResourcePtr>(this));
+  else
+    p_power.event = NULL;
 }
 
 /**********
index d56dff8..f5f7206 100644 (file)
@@ -409,10 +409,17 @@ AsDijkstra::~AsDijkstra()
 
 /* Creation routing model functions */
 
-AsDijkstra::AsDijkstra() : AsGeneric(), m_cached(0) {}
+AsDijkstra::AsDijkstra() : AsGeneric(), m_cached(0) {
+  p_routeGraph = NULL;
+  p_graphNodeMap = NULL;
+  p_routeCache = NULL;
+}
 
 AsDijkstra::AsDijkstra(int cached) : AsGeneric(), m_cached(cached)
 {
+  p_routeGraph = NULL;
+  p_graphNodeMap = NULL;
+  p_routeCache = NULL;
   /*new_component->generic_routing.parse_route = model_dijkstra_both_parse_route;
   new_component->generic_routing.parse_ASroute = model_dijkstra_both_parse_route;
   new_component->generic_routing.get_route_and_latency = dijkstra_get_route_and_latency;