Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
vain attempt to chase last leak in ptaskL07
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Wed, 22 Mar 2017 08:21:17 +0000 (09:21 +0100)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Wed, 22 Mar 2017 08:21:17 +0000 (09:21 +0100)
the destructors of CpuModel and NetworkModel do not seem to be called
at all
save one traversal while at it

src/surf/network_cm02.cpp
src/surf/network_cm02.hpp
src/surf/ptask_L07.cpp
src/surf/ptask_L07.hpp

index 1282315..2049393 100644 (file)
@@ -167,9 +167,6 @@ NetworkCm02Model::NetworkCm02Model(void (*specificSolveFun)(lmm_system_t self))
   maxminSystem_->solve_fun = specificSolveFun;
 }
 
-
-NetworkCm02Model::~NetworkCm02Model() {}
-
 LinkImpl* NetworkCm02Model::createLink(const char* name, double bandwidth, double latency,
                                        e_surf_link_sharing_policy_t policy)
 {
index 4020ec6..9f160e4 100644 (file)
@@ -39,7 +39,7 @@ namespace simgrid {
     public:
       NetworkCm02Model();
       explicit NetworkCm02Model(void (*solve_fun)(lmm_system_t self));
-      virtual ~NetworkCm02Model();
+      virtual ~NetworkCm02Model() = default;
       LinkImpl* createLink(const char* name, double bandwidth, double latency,
                            e_surf_link_sharing_policy_t policy) override;
       void updateActionsStateLazy(double now, double delta) override;
index 14e5cb1..ac0cf23 100644 (file)
@@ -53,7 +53,6 @@ CpuL07Model::CpuL07Model(HostL07Model *hmodel,lmm_system_t sys)
   {
     maxminSystem_ = sys;
   }
-CpuL07Model::~CpuL07Model() = default;
 
 NetworkL07Model::NetworkL07Model(HostL07Model *hmodel, lmm_system_t sys)
   : NetworkModel()
@@ -62,8 +61,6 @@ NetworkL07Model::NetworkL07Model(HostL07Model *hmodel, lmm_system_t sys)
     maxminSystem_ = sys;
     loopback_     = createLink("__loopback__", 498000000, 0.000015, SURF_LINK_FATPIPE);
   }
-NetworkL07Model::~NetworkL07Model() = default;
-
 
 double HostL07Model::nextOccuringEvent(double now)
 {
@@ -159,8 +156,11 @@ L07Action::L07Action(Model *model, int host_nb, sg_host_t *host_list,
   double latency = 0.0;
 
   this->hostList_->reserve(host_nb);
-  for (int i = 0; i<host_nb; i++)
+  for (int i = 0; i < host_nb; i++) {
     this->hostList_->push_back(host_list[i]);
+    if (flops_amount[i] > 0)
+      nb_used_host++;
+  }
 
   /* Compute the number of affected resources... */
   if(bytes_amount != nullptr) {
@@ -185,10 +185,6 @@ L07Action::L07Action(Model *model, int host_nb, sg_host_t *host_list,
     nb_link = affected_links.size();
   }
 
-  for (int i = 0; i < host_nb; i++)
-    if (flops_amount[i] > 0)
-      nb_used_host++;
-
   XBT_DEBUG("Creating a parallel task (%p) with %d hosts and %d unique links.", this, host_nb, nb_link);
   this->latency_ = latency;
 
index 4a2d68d..d5e3438 100644 (file)
@@ -48,7 +48,7 @@ public:
 class CpuL07Model : public CpuModel {
 public:
   CpuL07Model(HostL07Model *hmodel,lmm_system_t sys);
-  ~CpuL07Model();
+  ~CpuL07Model() = default;
 
   Cpu *createCpu(simgrid::s4u::Host *host, std::vector<double> *speedPerPstate, int core) override;
   HostL07Model *hostModel_;
@@ -57,7 +57,7 @@ public:
 class NetworkL07Model : public NetworkModel {
 public:
   NetworkL07Model(HostL07Model *hmodel, lmm_system_t sys);
-  ~NetworkL07Model();
+  ~NetworkL07Model() = default;
   LinkImpl* createLink(const char* name, double bandwidth, double latency,
                        e_surf_link_sharing_policy_t policy) override;