Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
move the definition of resource's Metric as an inner class
authorMartin Quinson <martin.quinson@loria.fr>
Sat, 10 Mar 2018 16:57:37 +0000 (17:57 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Sat, 10 Mar 2018 16:57:37 +0000 (17:57 +0100)
src/kernel/model/Resource.hpp
src/surf/cpu_interface.hpp
src/surf/network_interface.hpp
src/surf/surf_interface.hpp

index 153325e..b34bcc0 100644 (file)
@@ -74,6 +74,12 @@ public: /* LMM */
 
 protected:
   const kernel::lmm::Constraint* constraint_ = nullptr;
 
 protected:
   const kernel::lmm::Constraint* constraint_ = nullptr;
+
+  struct Metric {
+    double peak;              /**< The peak of the metric, ie its max value */
+    double scale;             /**< Current availability of the metric according to the traces, in [0,1] */
+    tmgr_trace_event_t event; /**< The associated trace event associated to the metric */
+  };
 };
 } // namespace model
 } // namespace kernel
 };
 } // namespace model
 } // namespace kernel
index 1eb54c3..5b97cf2 100644 (file)
@@ -135,7 +135,7 @@ public:
   virtual void setSpeedTrace(tmgr_trace_t trace); /*< setup the trace file with availability events (peak speed changes due to external load). Trace must contain relative values (ratio between 0 and 1) */
 
   tmgr_trace_event_t stateEvent_ = nullptr;
   virtual void setSpeedTrace(tmgr_trace_t trace); /*< setup the trace file with availability events (peak speed changes due to external load). Trace must contain relative values (ratio between 0 and 1) */
 
   tmgr_trace_event_t stateEvent_ = nullptr;
-  s_surf_metric_t speed_ = {1.0, 0, nullptr};
+  Metric speed_                  = {1.0, 0, nullptr};
 };
 
 /**********
 };
 
 /**********
index aedbde8..87f37e0 100644 (file)
@@ -160,8 +160,8 @@ public:
                                    Trace must contain absolute values */
 
   tmgr_trace_event_t stateEvent_    = nullptr;
                                    Trace must contain absolute values */
 
   tmgr_trace_event_t stateEvent_    = nullptr;
-  s_surf_metric_t latency_          = {1.0, 0, nullptr};
-  s_surf_metric_t bandwidth_        = {1.0, 0, nullptr};
+  Metric latency_                   = {1.0, 0, nullptr};
+  Metric bandwidth_                 = {1.0, 0, nullptr};
 
   /* User data */
   void* getData() { return userData; }
 
   /* User data */
   void* getData() { return userData; }
index adfddab..6472c75 100644 (file)
@@ -373,14 +373,5 @@ private:
  * Resource *
  ************/
 
  * Resource *
  ************/
 
-/** @ingroup SURF_interface
- * @brief Resource which have a metric handled by a maxmin system
- */
-struct s_surf_metric_t {
-  double peak;              /**< The peak of the metric, ie its max value */
-  double scale;             /**< Current availability of the metric according to the traces, in [0,1] */
-  tmgr_trace_event_t event; /**< The associated trace event associated to the metric */
-};
-
 
 #endif /* SURF_MODEL_H_ */
 
 #endif /* SURF_MODEL_H_ */