Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
CPU factors: dynamic factors for CPU
[simgrid.git] / include / simgrid / s4u / Host.hpp
index 4280793..901b4f8 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(sg_size_t 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;