From cc5c5a7eac0ebcf97c283e1e0dd1674c855a261a Mon Sep 17 00:00:00 2001 From: Matthijs Bijman Date: Mon, 27 Feb 2017 13:55:50 +0100 Subject: Implement logging of cores_used in task_states --- Simulator/include/modeling/machine/CPU.h | 27 +++++++++++++++------------ Simulator/include/modeling/machine/Machine.h | 5 +++++ 2 files changed, 20 insertions(+), 12 deletions(-) (limited to 'Simulator/include/modeling/machine') diff --git a/Simulator/include/modeling/machine/CPU.h b/Simulator/include/modeling/machine/CPU.h index dce4d2c5..95af1c86 100644 --- a/Simulator/include/modeling/machine/CPU.h +++ b/Simulator/include/modeling/machine/CPU.h @@ -5,27 +5,30 @@ namespace Modeling class CPU { public: + /** + * \brief Creates a CPU with the given speed/core, number of cores, energy consumption, and failure model id. + */ CPU(int speed, int cores, int energyConsumption, int failureModelId); - /* - Returns the speed of this CPU. + /** + * \return the speed of this CPU. */ - int getSpeed(); + int getSpeed() const; - /* - Returns the nr of cores of this CPU. + /** + * \return The nr of cores of this CPU. */ - int getCores(); + int getCores() const; - /* - Returns the energy consumed by this CPU. + /** + * \return The energy consumed by this CPU. */ - int getEnergyConsumption(); + int getEnergyConsumption() const; - /* - Returns the failure model id of this CPU. + /** + * \return The failure model id of this CPU. */ - int getFailureModelId(); + int getFailureModelId() const; private: diff --git a/Simulator/include/modeling/machine/Machine.h b/Simulator/include/modeling/machine/Machine.h index c89d32d1..f18f8352 100644 --- a/Simulator/include/modeling/machine/Machine.h +++ b/Simulator/include/modeling/machine/Machine.h @@ -76,6 +76,11 @@ namespace Modeling */ float getLoad() const; + /** + * \return The number of cores in this machine. + */ + uint32_t getNumberOfCores() const; + private: // A list of cpus in this machine. std::vector cpus; -- cgit v1.2.3