Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
yet another bunch of int -> unsigned long
[simgrid.git] / include / simgrid / s4u / Host.hpp
index c39588f..cd0797a 100644 (file)
@@ -89,6 +89,19 @@ public:
   Host* set_cpu(kernel::resource::CpuImpl* cpu);
   kernel::resource::CpuImpl* get_cpu() const { return pimpl_cpu_; }
   kernel::routing::NetPoint* get_netpoint() const { return pimpl_netpoint_; }
+  /**
+   * @brief Callback to set CPU factor
+   *
+   * This callback offers a flexible way to create variability in CPU executions
+   *
+   * @param flops Execution size in flops
+   * @return Multiply factor
+   */
+  using CpuFactorCb = double(double flops);
+  /**
+   * @brief Configure the factor callback to the CPU associated to this host
+   */
+  Host* set_factor_cb(const std::function<CpuFactorCb>& cb);
 
   size_t get_actor_count() const;
   std::vector<ActorPtr> get_all_actors() const;
@@ -157,6 +170,16 @@ public:
   int get_core_count() const;
   Host* set_core_count(int core_count);
 
+  enum class SharingPolicy { NONLINEAR = 1, LINEAR = 0 };
+  /**
+   * @brief Describes how the CPU is shared between concurrent tasks
+   *
+   * @param policy Sharing policy
+   * @param cb Callback for NONLINEAR policies
+   */
+  Host* set_sharing_policy(SharingPolicy policy, const s4u::NonLinearResourceCb& cb = {});
+  SharingPolicy get_sharing_policy() const;
+
   /** Returns the current computation load (in flops per second)
    *
    * The external load (coming from an availability trace) is not taken in account.
@@ -164,10 +187,10 @@ public:
    */
   double get_load() const;
 
-  int get_pstate_count() const;
+  unsigned long get_pstate_count() const;
   int get_pstate() const;
-  double get_pstate_speed(int pstate_index) const;
-  Host* set_pstate(int pstate_index);
+  double get_pstate_speed(unsigned long pstate_index) const;
+  Host* set_pstate(unsigned long pstate_index);
   Host* set_coordinates(const std::string& coords);
 
   std::vector<Disk*> get_disks() const;