* This accounts for external load (see @ref simgrid::surf::Cpu::set_speed_profile()).
*/
double get_available_speed() const;
+
/** Returns the number of core of the processor. */
int get_core_count() const;
+ Host* set_core_count(int core_count);
+
/** Returns the current computation load (in flops per second)
*
* The external load (coming from an availability trace) is not taken in account.
return this->pimpl_cpu->get_core_count();
}
+Host* Host::set_core_count(int core_count)
+{
+ this->pimpl_cpu->set_core_count(core_count);
+ return this;
+}
+
/** @brief Set the pstate at which the host should run */
void Host::set_pstate(int pstate_index)
{
s4u::Host::on_speed_change(*host_);
}
+Cpu* Cpu::set_core_count(int core_count)
+{
+ xbt_assert(core_count > 0, "Host %s must have at least one core, not 0.", host_->get_cname());
+ core_count_ = core_count;
+ return this;
+}
+
int Cpu::get_core_count()
{
return core_count_;
*/
virtual CpuAction* sleep(double duration) = 0;
+ Cpu* set_core_count(int core_count);
/** @brief Get the amount of cores */
virtual int get_core_count();