]> AND Public Git Repository - simgrid.git/blobdiff - src/surf/cpu_interface.hpp
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
simplification
[simgrid.git] / src / surf / cpu_interface.hpp
index f745b5d44b5134c9d3f19333ed33925c24834fa5..03dffc67111c475276a649bf9534a85a35a4b36f 100644 (file)
@@ -38,7 +38,7 @@ public:
    *                         This ignores any potential external load coming from a trace.
    * @param core The number of core of this Cpu
    */
-  virtual Cpu* create_cpu(s4u::Host* host, const std::vector<double>& speed_per_pstate, int core) = 0;
+  virtual Cpu* create_cpu(s4u::Host* host, const std::vector<double>& speed_per_pstate) = 0;
 
   void update_actions_state_lazy(double now, double delta) override;
   void update_actions_state_full(double now, double delta) override;
@@ -48,7 +48,7 @@ public:
  * Resource *
  ************/
 
-class XBT_PUBLIC Cpu : public Resource {
+class XBT_PUBLIC Cpu : public Resource_T<Cpu> {
   friend vm::VirtualMachineImpl; // Resets the VCPU
 
   s4u::Host* piface_;
@@ -75,6 +75,8 @@ public:
   Cpu* set_core_count(int core_count);
   virtual int get_core_count();
 
+  void seal() override;
+
   /** @brief Get a forecast of the speed (in flops/s) if the load were as provided.
    *
    * The provided load should encompasses both the application's activities and the external load that come from a
@@ -95,13 +97,20 @@ public:
 
   virtual int get_pstate_count() const { return speed_per_pstate_.size(); }
 
-  virtual void set_pstate(int pstate_index);
   virtual int get_pstate() const { return pstate_; }
+  virtual Cpu* set_pstate(int pstate_index);
+
+  /*< @brief Setup the profile file with availability events (peak speed changes due to external load).
+   * Profile must contain relative values (ratio between 0 and 1)
+   */
+  virtual Cpu* set_speed_profile(profile::Profile* profile);
 
-  /*< @brief Setup the trace file with availability events (peak speed changes due to external load).
-   * Trace must contain relative values (ratio between 0 and 1)
+  /**
+   * @brief Set the CPU's speed
+   *
+   * @param speed_per_state list of powers for this processor (default power is at index 0)
    */
-  virtual void set_speed_profile(profile::Profile* profile);
+  Cpu* set_pstate_speed(const std::vector<double>& speed_per_state);
 
   /**
    * @brief Execute some quantity of computation