Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
sanitize surf API: s/shareResources/next_occuring_event/
authorMartin Quinson <martin.quinson@loria.fr>
Sun, 7 Feb 2016 23:06:47 +0000 (00:06 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Sun, 7 Feb 2016 23:06:50 +0000 (00:06 +0100)
This means that we describe the external event (what it does for the
caller) instead of the internal behavior (how it gets to that result)

25 files changed:
src/surf/cpu_cas01.cpp
src/surf/cpu_cas01.hpp
src/surf/cpu_interface.hpp
src/surf/cpu_ti.cpp
src/surf/cpu_ti.hpp
src/surf/host_clm03.cpp
src/surf/host_clm03.hpp
src/surf/host_interface.hpp
src/surf/host_ptask_L07.cpp
src/surf/host_ptask_L07.hpp
src/surf/network_cm02.hpp
src/surf/network_constant.cpp
src/surf/network_constant.hpp
src/surf/network_interface.cpp
src/surf/network_interface.hpp
src/surf/network_ns3.cpp
src/surf/network_ns3.hpp
src/surf/storage_interface.hpp
src/surf/storage_n11.cpp
src/surf/storage_n11.hpp
src/surf/surf_c_bindings.cpp
src/surf/surf_interface.cpp
src/surf/surf_interface.hpp
src/surf/vm_hl13.cpp
src/surf/vm_hl13.hpp

index 7b28ade..a174238 100644 (file)
@@ -100,10 +100,9 @@ Cpu *CpuCas01Model::createCpu(simgrid::s4u::Host *host, xbt_dynar_t speedPeak,
   return cpu;
 }
 
   return cpu;
 }
 
-double CpuCas01Model::shareResourcesFull(double /*now*/)
+double CpuCas01Model::next_occuring_event_full(double /*now*/)
 {
 {
-  return Model::shareResourcesMaxMin(getRunningActionSet(),
-                             p_maxminSystem, lmm_solve);
+  return Model::shareResourcesMaxMin(getRunningActionSet(), p_maxminSystem, lmm_solve);
 }
 
 void CpuCas01Model::addTraces()
 }
 
 void CpuCas01Model::addTraces()
index ff12def..99cea9d 100644 (file)
@@ -32,7 +32,7 @@ public:
                           tmgr_trace_t speedTrace, int core,
                           int initiallyOn,
                           tmgr_trace_t state_trace) override;
                           tmgr_trace_t speedTrace, int core,
                           int initiallyOn,
                           tmgr_trace_t state_trace) override;
-  double shareResourcesFull(double now) override;
+  double next_occuring_event_full(double now) override;
   void addTraces() override;
   ActionList *p_cpuRunningActionSetThatDoesNotNeedBeingChecked;
 };
   void addTraces() override;
   ActionList *p_cpuRunningActionSetThatDoesNotNeedBeingChecked;
 };
index 1684541..baa184b 100644 (file)
@@ -59,7 +59,7 @@ public:
 
   void updateActionsStateLazy(double now, double delta);
   void updateActionsStateFull(double now, double delta);
 
   void updateActionsStateLazy(double now, double delta);
   void updateActionsStateFull(double now, double delta);
-  bool shareResourcesIsIdempotent() {return true;}
+  bool next_occuring_event_isIdempotent() {return true;}
 };
 
 /************
 };
 
 /************
index 2f97c5b..4a573ef 100644 (file)
@@ -444,7 +444,7 @@ Cpu *CpuTiModel::createCpu(simgrid::s4u::Host *host,
   return cpu;
 }
 
   return cpu;
 }
 
-double CpuTiModel::shareResources(double now)
+double CpuTiModel::next_occuring_event(double now)
 {
   double min_action_duration = -1;
 
 {
   double min_action_duration = -1;
 
index 9538984..20d9cbc 100644 (file)
@@ -158,7 +158,7 @@ public:
                           tmgr_trace_t speedTrace, int core,
                           int initiallyOn,
                           tmgr_trace_t state_trace) override;
                           tmgr_trace_t speedTrace, int core,
                           int initiallyOn,
                           tmgr_trace_t state_trace) override;
-  double shareResources(double now) override;
+  double next_occuring_event(double now) override;
   void updateActionsState(double now, double delta) override;
   void addTraces() override;
 
   void updateActionsState(double now, double delta) override;
   void addTraces() override;
 
index 0bfbc87..c240e0e 100644 (file)
@@ -46,12 +46,12 @@ void surf_host_model_init_compound()
 namespace simgrid {
 namespace surf {
 
 namespace simgrid {
 namespace surf {
 
-double HostCLM03Model::shareResources(double now){
+double HostCLM03Model::next_occuring_event(double now){
   adjustWeightOfDummyCpuActions();
 
   adjustWeightOfDummyCpuActions();
 
-  double min_by_cpu = surf_cpu_model_pm->shareResources(now);
-  double min_by_net = surf_network_model->shareResourcesIsIdempotent() ? surf_network_model->shareResources(now) : -1;
-  double min_by_sto = surf_storage_model->shareResources(now);
+  double min_by_cpu = surf_cpu_model_pm->next_occuring_event(now);
+  double min_by_net = surf_network_model->next_occuring_event_isIdempotent() ? surf_network_model->next_occuring_event(now) : -1;
+  double min_by_sto = surf_storage_model->next_occuring_event(now);
 
   XBT_DEBUG("model %p, %s min_by_cpu %f, %s min_by_net %f, %s min_by_sto %f",
       this, typeid(surf_cpu_model_pm).name(), min_by_cpu,
 
   XBT_DEBUG("model %p, %s min_by_cpu %f, %s min_by_net %f, %s min_by_sto %f",
       this, typeid(surf_cpu_model_pm).name(), min_by_cpu,
index 74bff01..4c66fc7 100644 (file)
@@ -31,7 +31,7 @@ class HostCLM03Model : public HostModel {
 public:
   HostCLM03Model(): HostModel(){}
   ~HostCLM03Model() {}
 public:
   HostCLM03Model(): HostModel(){}
   ~HostCLM03Model() {}
-  double shareResources(double now) override;
+  double next_occuring_event(double now) override;
 
   void updateActionsState(double now, double delta) override;
 };
 
   void updateActionsState(double now, double delta) override;
 };
index 9ab3f50..dfef15a 100644 (file)
@@ -62,7 +62,7 @@ public:
       double *bytes_amount,
       double rate);
 
       double *bytes_amount,
       double rate);
 
-  bool shareResourcesIsIdempotent() override {return true;}
+  bool next_occuring_event_isIdempotent() override {return true;}
 };
 
 /************
 };
 
 /************
index 54ad084..a3224f7 100644 (file)
@@ -89,7 +89,7 @@ NetworkL07Model::~NetworkL07Model()
 }
 
 
 }
 
 
-double HostL07Model::shareResources(double /*now*/)
+double HostL07Model::next_occuring_event(double /*now*/)
 {
   L07Action *action;
 
 {
   L07Action *action;
 
index 1e1064d..0b0349e 100644 (file)
@@ -43,7 +43,7 @@ public:
   HostL07Model();
   ~HostL07Model();
 
   HostL07Model();
   ~HostL07Model();
 
-  double shareResources(double now) override;
+  double next_occuring_event(double now) override;
   void updateActionsState(double now, double delta) override;
   Action *executeParallelTask(int host_nb, sg_host_t *host_list,
                 double *flops_amount, double *bytes_amount,
   void updateActionsState(double now, double delta) override;
   Action *executeParallelTask(int host_nb, sg_host_t *host_list,
                 double *flops_amount, double *bytes_amount,
@@ -83,7 +83,7 @@ public:
 
   Action *communicate(NetCard *src, NetCard *dst, double size, double rate) override;
   void addTraces() override {DIE_IMPOSSIBLE;};
 
   Action *communicate(NetCard *src, NetCard *dst, double size, double rate) override;
   void addTraces() override {DIE_IMPOSSIBLE;};
-  bool shareResourcesIsIdempotent() override {return true;}
+  bool next_occuring_event_isIdempotent() override {return true;}
 
   HostL07Model *p_hostModel;
 };
 
   HostL07Model *p_hostModel;
 };
index e4fa8f6..61e8b1c 100644 (file)
@@ -60,7 +60,7 @@ public:
   void updateActionsStateFull(double now, double delta) override;
   Action *communicate(NetCard *src, NetCard *dst,
                                double size, double rate) override;
   void updateActionsStateFull(double now, double delta) override;
   Action *communicate(NetCard *src, NetCard *dst,
                                double size, double rate) override;
-  bool shareResourcesIsIdempotent() override {return true;}
+  bool next_occuring_event_isIdempotent() override {return true;}
   virtual void gapAppend(double /*size*/, const Link* /*link*/, NetworkAction * /*action*/) {};
 protected:
   bool m_haveGap = false;
   virtual void gapAppend(double /*size*/, const Link* /*link*/, NetworkAction * /*action*/) {};
 protected:
   bool m_haveGap = false;
index 836a8c4..df75a9d 100644 (file)
@@ -31,7 +31,7 @@ void surf_network_model_init_Constant()
 namespace simgrid {
 namespace surf {
 
 namespace simgrid {
 namespace surf {
 
-double NetworkConstantModel::shareResources(double /*now*/)
+double NetworkConstantModel::next_occuring_event(double /*now*/)
 {
   NetworkConstantAction *action = NULL;
   double min = -1.0;
 {
   NetworkConstantAction *action = NULL;
   double min = -1.0;
index 9ff6964..0096b3d 100644 (file)
@@ -30,18 +30,15 @@ public:
   ~NetworkConstantModel() { }
 
   Action *communicate(NetCard *src, NetCard *dst, double size, double rate) override;
   ~NetworkConstantModel() { }
 
   Action *communicate(NetCard *src, NetCard *dst, double size, double rate) override;
-  double shareResources(double now) override;
+  double next_occuring_event(double now) override;
+  bool next_occuring_event_isIdempotent() override {return true;}
   void updateActionsState(double now, double delta) override;
   void updateActionsState(double now, double delta) override;
-  bool shareResourcesIsIdempotent() override {return true;}
 
   Link*
   createLink(const char *name,
 
   Link*
   createLink(const char *name,
-      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,
       xbt_dict_t properties)          override { DIE_IMPOSSIBLE; }
   void addTraces()                    override { DIE_IMPOSSIBLE; }
       e_surf_link_sharing_policy_t policy,
       xbt_dict_t properties)          override { DIE_IMPOSSIBLE; }
   void addTraces()                    override { DIE_IMPOSSIBLE; }
index 45ca1ef..4489f8a 100644 (file)
@@ -158,7 +158,7 @@ double NetworkModel::bandwidthConstraint(double rate, double /*bound*/, double /
   return rate;
 }
 
   return rate;
 }
 
-double NetworkModel::shareResourcesFull(double now)
+double NetworkModel::next_occuring_event_full(double now)
 {
   NetworkAction *action = NULL;
   ActionList *runningActions = surf_network_model->getRunningActionSet();
 {
   NetworkAction *action = NULL;
   ActionList *runningActions = surf_network_model->getRunningActionSet();
index cba3892..2b94aaf 100644 (file)
@@ -155,7 +155,7 @@ public:
    * @return The new bandwidth.
    */
   virtual double bandwidthConstraint(double rate, double bound, double size);
    * @return The new bandwidth.
    */
   virtual double bandwidthConstraint(double rate, double bound, double size);
-  double shareResourcesFull(double now);
+  double next_occuring_event_full(double now) override;
 };
 
 /************
 };
 
 /************
index 2143f2c..0ffb5df 100644 (file)
@@ -301,9 +301,9 @@ Action *NetworkNS3Model::communicate(NetCard *src, NetCard *dst,
   return (surf_action_t) action;
 }
 
   return (surf_action_t) action;
 }
 
-double NetworkNS3Model::shareResources(double now)
+double NetworkNS3Model::next_occuring_event(double now)
 {
 {
-  XBT_DEBUG("ns3_share_resources");
+  XBT_DEBUG("ns3_next_occuring_event");
 
   //get the first relevant value from the running_actions list
   if (!getRunningActionSet()->size() || now == 0.0)
 
   //get the first relevant value from the running_actions list
   if (!getRunningActionSet()->size() || now == 0.0)
index bbcbb1c..0fbed87 100644 (file)
@@ -53,12 +53,11 @@ public:
                                      e_surf_link_sharing_policy_t policy,
                                      xbt_dict_t properties);
   xbt_dynar_t getRoute(NetCard *src, NetCard *dst);
                                      e_surf_link_sharing_policy_t policy,
                                      xbt_dict_t properties);
   xbt_dynar_t getRoute(NetCard *src, NetCard *dst);
-  Action *communicate(NetCard *src, NetCard *dst,
-                               double size, double rate);
-  double shareResources(double now);
-  void updateActionsState(double now, double delta);
-  void addTraces(){DIE_IMPOSSIBLE;}
-  bool shareResourcesIsIdempotent() {return false;}
+  Action *communicate(NetCard *src, NetCard *dst, double size, double rate);
+  double next_occuring_event(double now) override;
+  void updateActionsState(double now, double delta) override;
+  void addTraces() override {DIE_IMPOSSIBLE;}
+  bool next_occuring_event_isIdempotent() {return false;}
 };
 
 /************
 };
 
 /************
index 60ec6c6..a7438da 100644 (file)
@@ -83,7 +83,7 @@ public:
                                     xbt_dict_t properties,
                                     const char *attach) = 0;
 
                                     xbt_dict_t properties,
                                     const char *attach) = 0;
 
-  bool shareResourcesIsIdempotent() {return true;}
+  bool next_occuring_event_isIdempotent() {return true;}
 
   xbt_dynar_t p_storageList;
 };
 
   xbt_dynar_t p_storageList;
 };
index c89ecfe..061023e 100644 (file)
@@ -114,7 +114,7 @@ Storage *StorageN11Model::createStorage(const char* id, const char* type_id,
   return storage;
 }
 
   return storage;
 }
 
-double StorageN11Model::shareResources(double /*now*/)
+double StorageN11Model::next_occuring_event(double /*now*/)
 {
   XBT_DEBUG("storage_share_resources");
   unsigned int i, j;
 {
   XBT_DEBUG("storage_share_resources");
   unsigned int i, j;
index ec2c3ae..e27a296 100644 (file)
@@ -32,9 +32,9 @@ public:
   ~StorageN11Model();
   Storage *createStorage(const char* id, const char* type_id,
        const char* content_name, const char* content_type, xbt_dict_t properties, const char* attach);
   ~StorageN11Model();
   Storage *createStorage(const char* id, const char* type_id,
        const char* content_name, const char* content_type, xbt_dict_t properties, const char* attach);
-  void addTraces(){DIE_IMPOSSIBLE;}
-  double shareResources(double now);
-  void updateActionsState(double now, double delta);
+  void addTraces() override {DIE_IMPOSSIBLE;}
+  double next_occuring_event(double now) override;
+  void updateActionsState(double now, double delta) override;
 };
 
 /************
 };
 
 /************
index b6a24be..08e1e51 100644 (file)
@@ -56,7 +56,7 @@ void surf_presolve(void)
 
 double surf_solve(double max_date)
 {
 
 double surf_solve(double max_date)
 {
-  double surf_min = -1.0; /* duration */
+  double time_delta = -1.0; /* duration */
   double next_event_date = -1.0;
   double model_next_action_end = -1.0;
   double value = -1.0;
   double next_event_date = -1.0;
   double model_next_action_end = -1.0;
   double value = -1.0;
@@ -68,24 +68,26 @@ double surf_solve(double max_date)
   if(!host_that_restart)
     host_that_restart = xbt_dynar_new(sizeof(char*), NULL);
 
   if(!host_that_restart)
     host_that_restart = xbt_dynar_new(sizeof(char*), NULL);
 
-  if (max_date > 0.0 && max_date != NOW) {
-    surf_min = max_date - NOW;
+  if (max_date > 0.0) {
+    xbt_assert(max_date > NOW,"You asked to simulate up to %f, but that's in the past already", max_date);
+
+    time_delta = max_date - NOW;
   }
 
   /* Physical models MUST be resolved first */
   XBT_DEBUG("Looking for next event in physical models");
   }
 
   /* Physical models MUST be resolved first */
   XBT_DEBUG("Looking for next event in physical models");
-  double next_event_phy = surf_host_model->shareResources(NOW);
-  if ((surf_min < 0.0 || next_event_phy < surf_min) && next_event_phy >= 0.0) {
-    surf_min = next_event_phy;
+  double next_event_phy = surf_host_model->next_occuring_event(NOW);
+  if ((time_delta < 0.0 || next_event_phy < time_delta) && next_event_phy >= 0.0) {
+    time_delta = next_event_phy;
   }
   if (surf_vm_model != NULL) {
     XBT_DEBUG("Looking for next event in virtual models");
   }
   if (surf_vm_model != NULL) {
     XBT_DEBUG("Looking for next event in virtual models");
-    double next_event_virt = surf_vm_model->shareResources(NOW);
-    if ((surf_min < 0.0 || next_event_virt < surf_min) && next_event_virt >= 0.0)
-      surf_min = next_event_virt;
+    double next_event_virt = surf_vm_model->next_occuring_event(NOW);
+    if ((time_delta < 0.0 || next_event_virt < time_delta) && next_event_virt >= 0.0)
+      time_delta = next_event_virt;
   }
 
   }
 
-  XBT_DEBUG("Min for resources (remember that NS3 don't update that value): %f", surf_min);
+  XBT_DEBUG("Min for resources (remember that NS3 don't update that value): %f", time_delta);
 
   XBT_DEBUG("Looking for next trace event");
 
 
   XBT_DEBUG("Looking for next trace event");
 
@@ -93,20 +95,20 @@ double surf_solve(double max_date)
     next_event_date = future_evt_set->next_date();
     XBT_DEBUG("Next TRACE event: %f", next_event_date);
 
     next_event_date = future_evt_set->next_date();
     XBT_DEBUG("Next TRACE event: %f", next_event_date);
 
-    if(! surf_network_model->shareResourcesIsIdempotent()){ // NS3, I see you
-      if (next_event_date!=-1.0 && surf_min!=-1.0) {
-        surf_min = MIN(next_event_date - NOW, surf_min);
+    if(! surf_network_model->next_occuring_event_isIdempotent()){ // NS3, I see you
+      if (next_event_date!=-1.0 && time_delta!=-1.0) {
+        time_delta = MIN(next_event_date - NOW, time_delta);
       } else {
       } else {
-        surf_min = MAX(next_event_date - NOW, surf_min); // Get the positive component
+        time_delta = MAX(next_event_date - NOW, time_delta); // Get the positive component
       }
 
       }
 
-      XBT_DEBUG("Run the NS3 network at most %fs", surf_min);
+      XBT_DEBUG("Run the NS3 network at most %fs", time_delta);
       // run until min or next flow
       // run until min or next flow
-      model_next_action_end = surf_network_model->shareResources(surf_min);
+      model_next_action_end = surf_network_model->next_occuring_event(time_delta);
 
       XBT_DEBUG("Min for network : %f", model_next_action_end);
       if(model_next_action_end>=0.0)
 
       XBT_DEBUG("Min for network : %f", model_next_action_end);
       if(model_next_action_end>=0.0)
-        surf_min = model_next_action_end;
+        time_delta = model_next_action_end;
     }
 
     if (next_event_date < 0.0) {
     }
 
     if (next_event_date < 0.0) {
@@ -114,15 +116,15 @@ double surf_solve(double max_date)
       break;
     }
 
       break;
     }
 
-    if ((surf_min == -1.0) || (next_event_date > NOW + surf_min))
+    if ((time_delta == -1.0) || (next_event_date > NOW + time_delta))
       break; // next event occurs after the next resource change, bail out
 
       break; // next event occurs after the next resource change, bail out
 
-    XBT_DEBUG("Updating models (min = %g, NOW = %g, next_event_date = %g)", surf_min, NOW, next_event_date);
+    XBT_DEBUG("Updating models (min = %g, NOW = %g, next_event_date = %g)", time_delta, NOW, next_event_date);
 
     while ((event = future_evt_set->pop_leq(next_event_date, &value, &resource))) {
       if (resource->isUsed() || xbt_dict_get_or_null(watched_hosts_lib, resource->getName())) {
 
     while ((event = future_evt_set->pop_leq(next_event_date, &value, &resource))) {
       if (resource->isUsed() || xbt_dict_get_or_null(watched_hosts_lib, resource->getName())) {
-        surf_min = next_event_date - NOW;
-        XBT_DEBUG("This event will modify model state. Next event set to %f", surf_min);
+        time_delta = next_event_date - NOW;
+        XBT_DEBUG("This event will modify model state. Next event set to %f", time_delta);
       }
       // FIXME: I'm too lame to update NOW live, so I change it and restore it so that the real update with surf_min will work
       double round_start = NOW;
       }
       // FIXME: I'm too lame to update NOW live, so I change it and restore it so that the real update with surf_min will work
       double round_start = NOW;
@@ -138,24 +140,24 @@ double surf_solve(double max_date)
   /* FIXME: Moved this test to here to avoid stopping simulation if there are actions running on cpus and all cpus are with availability = 0.
    * This may cause an infinite loop if one cpu has a trace with periodicity = 0 and the other a trace with periodicity > 0.
    * The options are: all traces with same periodicity(0 or >0) or we need to change the way how the events are managed */
   /* FIXME: Moved this test to here to avoid stopping simulation if there are actions running on cpus and all cpus are with availability = 0.
    * This may cause an infinite loop if one cpu has a trace with periodicity = 0 and the other a trace with periodicity > 0.
    * The options are: all traces with same periodicity(0 or >0) or we need to change the way how the events are managed */
-  if (surf_min == -1.0) {
+  if (time_delta == -1.0) {
     XBT_DEBUG("No next event at all. Bail out now.");
     return -1.0;
   }
 
     XBT_DEBUG("No next event at all. Bail out now.");
     return -1.0;
   }
 
-  XBT_DEBUG("Duration set to %f", surf_min);
+  XBT_DEBUG("Duration set to %f", time_delta);
 
   // Bump the time: jump into the future
 
   // Bump the time: jump into the future
-  NOW = NOW + surf_min;
+  NOW = NOW + time_delta;
 
   // Inform the models of the date change
   xbt_dynar_foreach(all_existing_models, iter, model) {
 
   // Inform the models of the date change
   xbt_dynar_foreach(all_existing_models, iter, model) {
-    model->updateActionsState(NOW, surf_min);
+    model->updateActionsState(NOW, time_delta);
   }
 
   TRACE_paje_dump_buffer (0);
 
   }
 
   TRACE_paje_dump_buffer (0);
 
-  return surf_min;
+  return time_delta;
 }
 
 /*********
 }
 
 /*********
index ed60663..fabd2d8 100644 (file)
@@ -412,18 +412,18 @@ Model::~Model(){
   delete p_doneActionSet;
 }
 
   delete p_doneActionSet;
 }
 
-double Model::shareResources(double now)
+double Model::next_occuring_event(double now)
 {
   //FIXME: set the good function once and for all
   if (p_updateMechanism == UM_LAZY)
 {
   //FIXME: set the good function once and for all
   if (p_updateMechanism == UM_LAZY)
-    return shareResourcesLazy(now);
+    return next_occuring_event_lazy(now);
   else if (p_updateMechanism == UM_FULL)
   else if (p_updateMechanism == UM_FULL)
-    return shareResourcesFull(now);
+    return next_occuring_event_full(now);
   else
     xbt_die("Invalid cpu update mechanism!");
 }
 
   else
     xbt_die("Invalid cpu update mechanism!");
 }
 
-double Model::shareResourcesLazy(double now)
+double Model::next_occuring_event_lazy(double now)
 {
   Action *action = NULL;
   double min = -1;
 {
   Action *action = NULL;
   double min = -1;
@@ -500,7 +500,7 @@ double Model::shareResourcesLazy(double now)
   return min;
 }
 
   return min;
 }
 
-double Model::shareResourcesFull(double /*now*/) {
+double Model::next_occuring_event_full(double /*now*/) {
   THROW_UNIMPLEMENTED;
 }
 
   THROW_UNIMPLEMENTED;
 }
 
index aff65e2..d660a81 100644 (file)
@@ -312,12 +312,11 @@ public:
    * @param now The current time of the simulation
    * @return The delta of time till the next action will finish
    */
    * @param now The current time of the simulation
    * @return The delta of time till the next action will finish
    */
-  virtual double shareResources(double now);
-  virtual double shareResourcesLazy(double now);
-  virtual double shareResourcesFull(double now);
+  virtual double next_occuring_event(double now);
+  virtual double next_occuring_event_lazy(double now);
+  virtual double next_occuring_event_full(double now);
   double shareResourcesMaxMin(ActionList* running_actions,
   double shareResourcesMaxMin(ActionList* running_actions,
-                                      lmm_system_t sys,
-                                      void (*solve) (lmm_system_t));
+      lmm_system_t sys, void (*solve) (lmm_system_t));
 
   /**
    * @brief Update action to the current time
 
   /**
    * @brief Update action to the current time
@@ -334,7 +333,7 @@ public:
    * The only model that is not is NS3: computing the next timestamp moves the model up to that point,
    * so we need to call it only when the next timestamp of other sources is computed.
    */
    * The only model that is not is NS3: computing the next timestamp moves the model up to that point,
    * so we need to call it only when the next timestamp of other sources is computed.
    */
-  virtual bool shareResourcesIsIdempotent()=0;
+  virtual bool next_occuring_event_isIdempotent()=0;
 
 protected:
   ActionLmmListPtr p_modifiedSet;
 
 protected:
   ActionLmmListPtr p_modifiedSet;
index 35b7b7b..9edc53a 100644 (file)
@@ -49,7 +49,7 @@ VirtualMachine *VMHL13Model::createVM(const char *name, sg_host_t host_PM)
 // const double virt_overhead = 0.95;
 const double virt_overhead = 1;
 
 // const double virt_overhead = 0.95;
 const double virt_overhead = 1;
 
-double VMHL13Model::shareResources(double now)
+double VMHL13Model::next_occuring_event(double now)
 {
   /* TODO: update action's cost with the total cost of processes on the VM. */
 
 {
   /* TODO: update action's cost with the total cost of processes on the VM. */
 
@@ -101,8 +101,8 @@ double VMHL13Model::shareResources(double now)
   /* 2. Calculate resource share at the virtual machine layer. */
   adjustWeightOfDummyCpuActions();
 
   /* 2. Calculate resource share at the virtual machine layer. */
   adjustWeightOfDummyCpuActions();
 
-  double min_by_cpu = surf_cpu_model_vm->shareResources(now);
-  double min_by_net = surf_network_model->shareResourcesIsIdempotent() ? surf_network_model->shareResources(now) : -1;
+  double min_by_cpu = surf_cpu_model_vm->next_occuring_event(now);
+  double min_by_net = surf_network_model->next_occuring_event_isIdempotent() ? surf_network_model->next_occuring_event(now) : -1;
   // Fixme: take storage into account once it's implemented
   double min_by_sto = -1;
 
   // Fixme: take storage into account once it's implemented
   double min_by_sto = -1;
 
index 6b0d8b2..7b66c2a 100644 (file)
@@ -34,7 +34,7 @@ public:
   ~VMHL13Model(){};
 
   VirtualMachine *createVM(const char *name, sg_host_t host_PM) override;
   ~VMHL13Model(){};
 
   VirtualMachine *createVM(const char *name, sg_host_t host_PM) override;
-  double shareResources(double now) override;
+  double next_occuring_event(double now) override;
   void adjustWeightOfDummyCpuActions() override {};
   void updateActionsState(double /*now*/, double /*delta*/) override;
 };
   void adjustWeightOfDummyCpuActions() override {};
   void updateActionsState(double /*now*/, double /*delta*/) override;
 };