Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of github.com:simgrid/simgrid
[simgrid.git] / src / surf / ptask_L07.cpp
index 68203b5..a963b8c 100644 (file)
@@ -45,22 +45,34 @@ HostL07Model::~HostL07Model()
 {
   lmm_system_free(maxminSystem_);
   maxminSystem_ = nullptr;
+  delete surf_network_model;
+  delete surf_cpu_model_pm;
 }
 
 CpuL07Model::CpuL07Model(HostL07Model *hmodel,lmm_system_t sys)
   : CpuModel()
   , hostModel_(hmodel)
-  {
-    maxminSystem_ = sys;
-  }
+{
+  maxminSystem_ = sys;
+}
+
+CpuL07Model::~CpuL07Model()
+{
+  maxminSystem_ = nullptr;
+}
 
 NetworkL07Model::NetworkL07Model(HostL07Model *hmodel, lmm_system_t sys)
   : NetworkModel()
   , hostModel_(hmodel)
-  {
-    maxminSystem_ = sys;
-    loopback_     = createLink("__loopback__", 498000000, 0.000015, SURF_LINK_FATPIPE);
-  }
+{
+  maxminSystem_ = sys;
+  loopback_     = createLink("__loopback__", 498000000, 0.000015, SURF_LINK_FATPIPE);
+}
+
+NetworkL07Model::~NetworkL07Model()
+{
+  maxminSystem_ = nullptr;
+}
 
 double HostL07Model::nextOccuringEvent(double now)
 {
@@ -314,7 +326,8 @@ bool LinkL07::isUsed(){
   return lmm_constraint_used(model()->getMaxminSystem(), constraint());
 }
 
-void CpuL07::apply_event(tmgr_trace_iterator_t triggered, double value){
+void CpuL07::apply_event(tmgr_trace_event_t triggered, double value)
+{
   XBT_DEBUG("Updating cpu %s (%p) with value %g", cname(), this, value);
   if (triggered == speed_.event) {
     speed_.scale = value;
@@ -333,7 +346,8 @@ void CpuL07::apply_event(tmgr_trace_iterator_t triggered, double value){
   }
 }
 
-void LinkL07::apply_event(tmgr_trace_iterator_t triggered, double value) {
+void LinkL07::apply_event(tmgr_trace_event_t triggered, double value)
+{
   XBT_DEBUG("Updating link %s (%p) with value=%f", cname(), this, value);
   if (triggered == bandwidth_.event) {
     setBandwidth(value);