Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
further cleanups to all our next_occuring_event functions
authorMartin Quinson <martin.quinson@loria.fr>
Sun, 2 Oct 2016 14:50:45 +0000 (16:50 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Sun, 2 Oct 2016 14:50:45 +0000 (16:50 +0200)
src/surf/cpu_cas01.cpp
src/surf/cpu_cas01.hpp
src/surf/network_constant.cpp
src/surf/network_interface.cpp
src/surf/storage_n11.cpp
src/surf/surf_interface.cpp

index 5294f60..50c92d0 100644 (file)
@@ -82,11 +82,6 @@ Cpu *CpuCas01Model::createCpu(simgrid::s4u::Host *host, std::vector<double> *spe
   return new CpuCas01(this, host, speedPerPstate, core);
 }
 
-double CpuCas01Model::next_occuring_event_full(double /*now*/)
-{
-  return shareResourcesMaxMin(getRunningActionSet(), maxminSystem_, lmm_solve);
-}
-
 /************
  * Resource *
  ************/
index 39f1a37..f05453d 100644 (file)
@@ -28,7 +28,6 @@ public:
   ~CpuCas01Model() override;
 
   Cpu *createCpu(simgrid::s4u::Host *host, std::vector<double> *speedPerPstate, int core) override;
-  double next_occuring_event_full(double now) override;
   ActionList *p_cpuRunningActionSetThatDoesNotNeedBeingChecked;
 };
 
index 297a964..4daf864 100644 (file)
@@ -35,13 +35,11 @@ namespace simgrid {
 
     double NetworkConstantModel::next_occuring_event(double /*now*/)
     {
-      NetworkConstantAction *action = nullptr;
       double min = -1.0;
 
       ActionList *actionSet = getRunningActionSet();
-      for(ActionList::iterator it(actionSet->begin()), itend(actionSet->end())
-          ; it != itend ; ++it) {
-        action = static_cast<NetworkConstantAction*>(&*it);
+      for(auto it(actionSet->begin()), itend(actionSet->end()) ; it != itend ; ++it) {
+        NetworkConstantAction *action = static_cast<NetworkConstantAction*>(&*it);
         if (action->latency_ > 0 && (min < 0 || action->latency_ < min))
           min = action->latency_;
       }
index 6a0a74a..038b535 100644 (file)
@@ -132,10 +132,9 @@ namespace simgrid {
     double NetworkModel::next_occuring_event_full(double now)
     {
       ActionList *runningActions = surf_network_model->getRunningActionSet();
-      double minRes = shareResourcesMaxMin(runningActions, surf_network_model->maxminSystem_, surf_network_model->f_networkSolve);
+      double minRes = shareResourcesMaxMin(runningActions, maxminSystem_, f_networkSolve);
 
-      for(ActionList::iterator it(runningActions->begin()), itend(runningActions->end())
-          ; it != itend ; ++it) {
+      for(auto it(runningActions->begin()), itend(runningActions->end()); it != itend ; ++it) {
         NetworkAction *action = static_cast<NetworkAction*>(&*it);
         if (action->latency_ > 0)
           minRes = (minRes < 0) ? action->latency_ : std::min(minRes, action->latency_);
index bec7c64..2894740 100644 (file)
@@ -116,10 +116,9 @@ double StorageN11Model::next_occuring_event(double /*now*/)
 
   double min_completion = shareResourcesMaxMin(getRunningActionSet(), maxminSystem_, lmm_solve);
 
-  double rate;
   // Foreach disk
   for(auto storage: p_storageList) {
-    rate = 0;
+    double rate = 0;
     // Foreach write action on disk
     for (auto write_action: storage->writeActions_) {
       rate += lmm_variable_getvalue(write_action->getVariable());
index 798c991..6a9c6b0 100644 (file)
@@ -472,8 +472,7 @@ double Model::next_occuring_event_lazy(double now)
 }
 
 double Model::next_occuring_event_full(double /*now*/) {
-  THROW_UNIMPLEMENTED;
-  return 0.0;
+  return shareResourcesMaxMin(getRunningActionSet(), maxminSystem_, lmm_solve);
 }
 
 double shareResourcesMaxMin(ActionList *runningActions, lmm_system_t sys, void (*solve) (lmm_system_t))