From: Frederic Suter Date: Fri, 12 Apr 2019 11:01:15 +0000 (+0200) Subject: changing namespace for cpu_interface X-Git-Tag: v3.22.2~144 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/fce09c24b85088743448b2bd504833a3b33937f3 changing namespace for cpu_interface --- diff --git a/include/simgrid/forward.h b/include/simgrid/forward.h index 723d15ff51..233d1852e7 100644 --- a/include/simgrid/forward.h +++ b/include/simgrid/forward.h @@ -133,8 +133,10 @@ class System; } namespace resource { class Action; +class Cpu; class Model; class Resource; +class CpuModel; class NetworkModel; class LinkImpl; class NetworkAction; @@ -160,8 +162,6 @@ namespace simix { class Timer; } namespace surf { - class Cpu; - class CpuModel; class HostImpl; class HostModel; } diff --git a/include/simgrid/s4u/Host.hpp b/include/simgrid/s4u/Host.hpp index f15116e049..ea0afe0655 100644 --- a/include/simgrid/s4u/Host.hpp +++ b/include/simgrid/s4u/Host.hpp @@ -144,7 +144,7 @@ private: public: #ifndef DOXYGEN /** DO NOT USE DIRECTLY (@todo: these should be protected, once our code is clean) */ - surf::Cpu* pimpl_cpu = nullptr; + kernel::resource::Cpu* pimpl_cpu = nullptr; // TODO, this could be a unique_ptr surf::HostImpl* pimpl_ = nullptr; /** DO NOT USE DIRECTLY (@todo: these should be protected, once our code is clean) */ diff --git a/src/include/surf/surf.hpp b/src/include/surf/surf.hpp index b5b027e67a..410508c4b2 100644 --- a/src/include/surf/surf.hpp +++ b/src/include/surf/surf.hpp @@ -11,12 +11,12 @@ /** @ingroup SURF_models * @brief The CPU model object for the physical machine layer */ -XBT_PUBLIC_DATA simgrid::surf::CpuModel* surf_cpu_model_pm; +XBT_PUBLIC_DATA simgrid::kernel::resource::CpuModel* surf_cpu_model_pm; /** @ingroup SURF_models * @brief The CPU model object for the virtual machine layer */ -XBT_PUBLIC_DATA simgrid::surf::CpuModel* surf_cpu_model_vm; +XBT_PUBLIC_DATA simgrid::kernel::resource::CpuModel* surf_cpu_model_vm; /** @ingroup SURF_models * @brief The host model diff --git a/src/instr/instr_platform.cpp b/src/instr/instr_platform.cpp index e2607795f8..a19c6998a0 100644 --- a/src/instr/instr_platform.cpp +++ b/src/instr/instr_platform.cpp @@ -249,7 +249,7 @@ static void instr_action_on_state_change(simgrid::kernel::resource::Action const /* Beware of composite actions: ptasks put links and cpus together. Extra pb: we cannot dynamic_cast from void* */ simgrid::kernel::resource::Resource* resource = static_cast(action.get_variable()->get_constraint(i)->get_id()); - simgrid::surf::Cpu* cpu = dynamic_cast(resource); + simgrid::kernel::resource::Cpu* cpu = dynamic_cast(resource); if (cpu != nullptr) TRACE_surf_resource_set_utilization("HOST", "speed_used", cpu->get_cname(), action.get_category(), value, @@ -367,7 +367,7 @@ void instr_define_callbacks() } simgrid::s4u::NetZone::on_creation.connect(instr_netzone_on_creation); - simgrid::surf::CpuAction::on_state_change.connect(instr_action_on_state_change); + simgrid::kernel::resource::CpuAction::on_state_change.connect(instr_action_on_state_change); simgrid::s4u::Link::on_communication_state_change.connect(instr_action_on_state_change); if (TRACE_actor_is_enabled()) { diff --git a/src/plugins/host_energy.cpp b/src/plugins/host_energy.cpp index 92a6b5c157..f380c167de 100644 --- a/src/plugins/host_energy.cpp +++ b/src/plugins/host_energy.cpp @@ -411,10 +411,10 @@ static void on_creation(simgrid::s4u::Host& host) host.extension_set(new HostEnergy(&host)); } -static void on_action_state_change(simgrid::surf::CpuAction const& action, +static void on_action_state_change(simgrid::kernel::resource::CpuAction const& action, simgrid::kernel::resource::Action::State /*previous*/) { - for (simgrid::surf::Cpu* const& cpu : action.cpus()) { + for (simgrid::kernel::resource::Cpu* const& cpu : action.cpus()) { simgrid::s4u::Host* host = cpu->get_host(); if (host != nullptr) { @@ -490,7 +490,7 @@ void sg_host_energy_plugin_init() simgrid::s4u::Host::on_speed_change.connect(&on_host_change); simgrid::s4u::Host::on_destruction.connect(&on_host_destruction); simgrid::s4u::on_simulation_end.connect(&on_simulation_end); - simgrid::surf::CpuAction::on_state_change.connect(&on_action_state_change); + simgrid::kernel::resource::CpuAction::on_state_change.connect(&on_action_state_change); // We may only have one actor on a node. If that actor executes something like // compute -> recv -> compute // the recv operation will not trigger a "CpuAction::on_state_change". This means diff --git a/src/plugins/vm/VirtualMachineImpl.cpp b/src/plugins/vm/VirtualMachineImpl.cpp index a46137176d..9e20699df0 100644 --- a/src/plugins/vm/VirtualMachineImpl.cpp +++ b/src/plugins/vm/VirtualMachineImpl.cpp @@ -23,8 +23,8 @@ namespace vm { /************* * Callbacks * *************/ -simgrid::xbt::signal VirtualMachineImpl::on_creation; -simgrid::xbt::signal VirtualMachineImpl::on_destruction; +xbt::signal VirtualMachineImpl::on_creation; +xbt::signal VirtualMachineImpl::on_destruction; /********* * Model * @@ -115,7 +115,7 @@ double VMModel::next_occuring_event(double now) /* iterate for all virtual machines */ for (s4u::VirtualMachine* const& ws_vm : VirtualMachineImpl::allVms_) { - surf::Cpu* cpu = ws_vm->pimpl_cpu; + kernel::resource::Cpu* cpu = ws_vm->pimpl_cpu; double solved_value = ws_vm->get_impl()->action_->get_variable()->get_value(); // this is X1 in comment above, what @@ -266,8 +266,8 @@ void VirtualMachineImpl::set_physical_host(s4u::Host* destination) /* Update vcpu's action for the new pm */ /* create a cpu action bound to the pm model at the destination. */ - surf::CpuAction* new_cpu_action = - static_cast(destination->pimpl_cpu->execution_start(0, this->core_amount_)); + kernel::resource::CpuAction* new_cpu_action = + static_cast(destination->pimpl_cpu->execution_start(0, this->core_amount_)); if (action_->get_remains_no_update() > 0) XBT_CRITICAL("FIXME: need copy the state(?), %f", action_->get_remains_no_update()); diff --git a/src/surf/cpu_cas01.cpp b/src/surf/cpu_cas01.cpp index 1508df741d..0301e4553c 100644 --- a/src/surf/cpu_cas01.cpp +++ b/src/surf/cpu_cas01.cpp @@ -56,19 +56,19 @@ void surf_cpu_model_init_Cas01() namespace simgrid { namespace surf { -CpuCas01Model::CpuCas01Model(kernel::resource::Model::UpdateAlgo algo) : simgrid::surf::CpuModel(algo) +CpuCas01Model::CpuCas01Model(kernel::resource::Model::UpdateAlgo algo) : kernel::resource::CpuModel(algo) { all_existing_models.push_back(this); - bool select = simgrid::config::get_value("cpu/maxmin-selective-update"); + bool select = config::get_value("cpu/maxmin-selective-update"); if (algo == Model::UpdateAlgo::LAZY) { - xbt_assert(select || simgrid::config::is_default("cpu/maxmin-selective-update"), + xbt_assert(select || config::is_default("cpu/maxmin-selective-update"), "You cannot disable cpu selective update when using the lazy update mechanism"); select = true; } - set_maxmin_system(new simgrid::kernel::lmm::System(select)); + set_maxmin_system(new kernel::lmm::System(select)); } CpuCas01Model::~CpuCas01Model() @@ -76,7 +76,7 @@ CpuCas01Model::~CpuCas01Model() surf_cpu_model_pm = nullptr; } -Cpu* CpuCas01Model::create_cpu(simgrid::s4u::Host* host, const std::vector& speed_per_pstate, int core) +kernel::resource::Cpu* CpuCas01Model::create_cpu(s4u::Host* host, const std::vector& speed_per_pstate, int core) { return new CpuCas01(this, host, speed_per_pstate, core); } @@ -84,8 +84,7 @@ Cpu* CpuCas01Model::create_cpu(simgrid::s4u::Host* host, const std::vector& speed_per_pstate, - int core) +CpuCas01::CpuCas01(CpuCas01Model* model, s4u::Host* host, const std::vector& speed_per_pstate, int core) : Cpu(model, host, model->get_maxmin_system()->constraint_new(this, core * speed_per_pstate.front()), speed_per_pstate, core) { @@ -162,18 +161,18 @@ void CpuCas01::apply_event(kernel::profile::Event* event, double value) } /** @brief Start a new execution on this CPU lasting @param size flops and using one core */ -CpuAction* CpuCas01::execution_start(double size) +kernel::resource::CpuAction* CpuCas01::execution_start(double size) { return new CpuCas01Action(get_model(), size, not is_on(), speed_.scale * speed_.peak, get_constraint()); } -CpuAction* CpuCas01::execution_start(double size, int requested_cores) +kernel::resource::CpuAction* CpuCas01::execution_start(double size, int requested_cores) { return new CpuCas01Action(get_model(), size, not is_on(), speed_.scale * speed_.peak, get_constraint(), requested_cores); } -CpuAction* CpuCas01::sleep(double duration) +kernel::resource::CpuAction* CpuCas01::sleep(double duration) { if (duration > 0) duration = std::max(duration, sg_surf_precision); diff --git a/src/surf/cpu_cas01.hpp b/src/surf/cpu_cas01.hpp index 67ed574834..0656d222d6 100644 --- a/src/surf/cpu_cas01.hpp +++ b/src/surf/cpu_cas01.hpp @@ -21,30 +21,30 @@ class XBT_PRIVATE CpuCas01Action; * Model * *********/ -class CpuCas01Model : public simgrid::surf::CpuModel { +class CpuCas01Model : public kernel::resource::CpuModel { public: explicit CpuCas01Model(kernel::resource::Model::UpdateAlgo algo); CpuCas01Model(const CpuCas01Model&) = delete; CpuCas01Model& operator=(const CpuCas01Model&) = delete; ~CpuCas01Model() override; - Cpu* create_cpu(simgrid::s4u::Host* host, const std::vector& speed_per_pstate, int core) override; + kernel::resource::Cpu* create_cpu(s4u::Host* host, const std::vector& speed_per_pstate, int core) override; }; /************ * Resource * ************/ -class CpuCas01 : public Cpu { +class CpuCas01 : public kernel::resource::Cpu { public: CpuCas01(CpuCas01Model* model, simgrid::s4u::Host* host, const std::vector& speed_per_pstate, int core); CpuCas01(const CpuCas01&) = delete; CpuCas01& operator=(const CpuCas01&) = delete; ~CpuCas01() override; void apply_event(simgrid::kernel::profile::Event* event, double value) override; - CpuAction* execution_start(double size) override; - CpuAction* execution_start(double size, int requested_cores) override; - CpuAction* sleep(double duration) override; + kernel::resource::CpuAction* execution_start(double size) override; + kernel::resource::CpuAction* execution_start(double size, int requested_cores) override; + kernel::resource::CpuAction* sleep(double duration) override; bool is_used() override; @@ -55,9 +55,10 @@ protected: /********** * Action * **********/ -class CpuCas01Action: public CpuAction { - friend CpuAction *CpuCas01::execution_start(double size); - friend CpuAction *CpuCas01::sleep(double duration); +class CpuCas01Action : public kernel::resource::CpuAction { + friend kernel::resource::CpuAction* CpuCas01::execution_start(double size); + friend kernel::resource::CpuAction* CpuCas01::sleep(double duration); + public: CpuCas01Action(kernel::resource::Model* model, double cost, bool failed, double speed, kernel::lmm::Constraint* constraint, int core_count); diff --git a/src/surf/cpu_interface.cpp b/src/surf/cpu_interface.cpp index 445243559f..8325194bbe 100644 --- a/src/surf/cpu_interface.cpp +++ b/src/surf/cpu_interface.cpp @@ -10,11 +10,12 @@ XBT_LOG_EXTERNAL_CATEGORY(surf_kernel); XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_cpu, surf, "Logging specific to the SURF cpu module"); -simgrid::surf::CpuModel *surf_cpu_model_pm; -simgrid::surf::CpuModel *surf_cpu_model_vm; +simgrid::kernel::resource::CpuModel* surf_cpu_model_pm; +simgrid::kernel::resource::CpuModel* surf_cpu_model_vm; namespace simgrid { -namespace surf { +namespace kernel { +namespace resource { /********* * Model * @@ -43,7 +44,7 @@ void CpuModel::update_actions_state_full(double /*now*/, double delta) if (((action.get_remains_no_update() <= 0) && (action.get_variable()->get_weight() > 0)) || ((action.get_max_duration() != NO_MAX_DURATION) && (action.get_max_duration() <= 0))) { - action.finish(kernel::resource::Action::State::FINISHED); + action.finish(Action::State::FINISHED); } } } @@ -51,14 +52,13 @@ void CpuModel::update_actions_state_full(double /*now*/, double delta) /************ * Resource * ************/ -Cpu::Cpu(kernel::resource::Model* model, simgrid::s4u::Host* host, const std::vector& speed_per_pstate, - int core) +Cpu::Cpu(Model* model, s4u::Host* host, const std::vector& speed_per_pstate, int core) : Cpu(model, host, nullptr /*constraint*/, speed_per_pstate, core) { } -Cpu::Cpu(kernel::resource::Model* model, simgrid::s4u::Host* host, kernel::lmm::Constraint* constraint, - const std::vector& speed_per_pstate, int core) +Cpu::Cpu(Model* model, s4u::Host* host, lmm::Constraint* constraint, const std::vector& speed_per_pstate, + int core) : Resource(model, host->get_cname(), constraint) , core_count_(core) , host_(host) @@ -157,7 +157,7 @@ void CpuAction::update_remains_lazy(double now) set_last_value(get_variable()->get_value()); } -simgrid::xbt::signal CpuAction::on_state_change; +xbt::signal CpuAction::on_state_change; void CpuAction::suspend(){ Action::State previous = get_state(); @@ -187,8 +187,7 @@ std::list CpuAction::cpus() const for (int i = 0; i < llen; i++) { /* Beware of composite actions: ptasks put links and cpus together */ // extra pb: we cannot dynamic_cast from void*... - kernel::resource::Resource* resource = - static_cast(get_variable()->get_constraint(i)->get_id()); + Resource* resource = static_cast(get_variable()->get_constraint(i)->get_id()); Cpu* cpu = dynamic_cast(resource); if (cpu != nullptr) retlist.push_back(cpu); @@ -196,6 +195,6 @@ std::list CpuAction::cpus() const return retlist; } - -} -} +} // namespace resource +} // namespace kernel +} // namespace simgrid diff --git a/src/surf/cpu_interface.hpp b/src/surf/cpu_interface.hpp index 7ae6e58c23..4b273c70a5 100644 --- a/src/surf/cpu_interface.hpp +++ b/src/surf/cpu_interface.hpp @@ -19,15 +19,16 @@ ***********/ namespace simgrid { -namespace surf { +namespace kernel { +namespace resource { - /** @ingroup SURF_cpu_interface +/** @ingroup SURF_cpu_interface * @brief SURF cpu model interface class * @details A model is an object which handle the interactions between its Resources and its Actions */ -class XBT_PUBLIC CpuModel : public kernel::resource::Model { +class XBT_PUBLIC CpuModel : public Model { public: - explicit CpuModel(kernel::resource::Model::UpdateAlgo algo) : Model(algo) {} + explicit CpuModel(Model::UpdateAlgo algo) : Model(algo) {} /** * @brief Create a Cpu @@ -37,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(simgrid::s4u::Host* host, const std::vector& speed_per_pstate, int core) = 0; + virtual Cpu* create_cpu(s4u::Host* host, const std::vector& speed_per_pstate, int core) = 0; void update_actions_state_lazy(double now, double delta) override; void update_actions_state_full(double now, double delta) override; @@ -51,7 +52,12 @@ public: * @brief SURF cpu resource interface class * @details A Cpu represent a cpu associated to a host */ -class XBT_PUBLIC Cpu : public simgrid::kernel::resource::Resource { +class XBT_PUBLIC Cpu : public Resource { + int core_count_ = 1; + s4u::Host* host_; + int pstate_ = 0; /*< Current pstate (index in the speed_per_pstate_)*/ + const std::vector speed_per_pstate_; /*< List of supported CPU capacities (pstate related) */ + public: /** * @brief Cpu constructor @@ -62,8 +68,8 @@ public: * @param speedPerPstate Processor speed (in flop per second) for each pstate * @param core The number of core of this Cpu */ - Cpu(simgrid::kernel::resource::Model* model, simgrid::s4u::Host* host, kernel::lmm::Constraint* constraint, - const std::vector& speed_per_pstate, int core); + Cpu(Model* model, s4u::Host* host, lmm::Constraint* constraint, const std::vector& speed_per_pstate, + int core); /** * @brief Cpu constructor @@ -73,8 +79,7 @@ public: * @param speedPerPstate Processor speed (in flop per second) for each pstate * @param core The number of core of this Cpu */ - Cpu(simgrid::kernel::resource::Model* model, simgrid::s4u::Host* host, const std::vector& speed_per_pstate, - int core); + Cpu(Model* model, s4u::Host* host, const std::vector& speed_per_pstate, int core); Cpu(const Cpu&) = delete; Cpu& operator=(const Cpu&) = delete; @@ -85,7 +90,7 @@ public: * @param size The value of the processing amount (in flop) needed to process * @return The CpuAction corresponding to the processing */ - virtual simgrid::kernel::resource::Action* execution_start(double size) = 0; + virtual Action* execution_start(double size) = 0; /** * @brief Execute some quantity of computation on more than one core @@ -94,7 +99,7 @@ public: * @param requested_cores The desired amount of cores. Must be >= 1 * @return The CpuAction corresponding to the processing */ - virtual simgrid::kernel::resource::Action* execution_start(double size, int requested_cores) = 0; + virtual Action* execution_start(double size, int requested_cores) = 0; /** * @brief Make a process sleep for duration (in seconds) @@ -102,7 +107,7 @@ public: * @param duration The number of seconds to sleep * @return The CpuAction corresponding to the sleeping */ - virtual simgrid::kernel::resource::Action* sleep(double duration) = 0; + virtual Action* sleep(double duration) = 0; /** @brief Get the amount of cores */ virtual int get_core_count(); @@ -136,20 +141,12 @@ public: virtual void set_pstate(int pstate_index); virtual int get_pstate() const; - simgrid::s4u::Host* get_host() { return host_; } + s4u::Host* get_host() { return host_; } -private: - int core_count_ = 1; - simgrid::s4u::Host* host_; - - int pstate_ = 0; /*< Current pstate (index in the speed_per_pstate_)*/ - const std::vector speed_per_pstate_; /*< List of supported CPU capacities (pstate related) */ - -public: /*< @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) */ - virtual void set_speed_profile(kernel::profile::Profile* profile); + virtual void set_speed_profile(profile::Profile* profile); protected: Metric speed_ = {1.0, 0, nullptr}; @@ -162,21 +159,17 @@ protected: /** @ingroup SURF_cpu_interface * @brief A CpuAction represents the execution of code on one or several Cpus */ -class XBT_PUBLIC CpuAction : public simgrid::kernel::resource::Action { +class XBT_PUBLIC CpuAction : public Action { public: /** @brief Signal emitted when the action state changes (ready/running/done, etc) * Signature: `void(CpuAction const& action, simgrid::kernel::resource::Action::State previous)` */ - static simgrid::xbt::signal - on_state_change; + static xbt::signal on_state_change; - CpuAction(simgrid::kernel::resource::Model * model, double cost, bool failed) : Action(model, cost, failed) {} - CpuAction(simgrid::kernel::resource::Model * model, double cost, bool failed, kernel::lmm::Variable* var) - : Action(model, cost, failed, var) - { - } + CpuAction(Model* model, double cost, bool failed) : Action(model, cost, failed) {} + CpuAction(Model* model, double cost, bool failed, lmm::Variable* var) : Action(model, cost, failed, var) {} - void set_state(simgrid::kernel::resource::Action::State state) override; + void set_state(Action::State state) override; void update_remains_lazy(double now) override; std::list cpus() const; @@ -184,8 +177,8 @@ public: void suspend() override; void resume() override; }; - -} -} +} // namespace resource +} // namespace kernel +} // namespace simgrid #endif /* SURF_CPU_INTERFACE_HPP_ */ diff --git a/src/surf/cpu_ti.cpp b/src/surf/cpu_ti.cpp index 05556af0a7..fe41d41ded 100644 --- a/src/surf/cpu_ti.cpp +++ b/src/surf/cpu_ti.cpp @@ -312,7 +312,7 @@ CpuTiModel::~CpuTiModel() surf_cpu_model_pm = nullptr; } -Cpu* CpuTiModel::create_cpu(simgrid::s4u::Host* host, const std::vector& speed_per_pstate, int core) +kernel::resource::Cpu* CpuTiModel::create_cpu(s4u::Host* host, const std::vector& speed_per_pstate, int core) { return new CpuTi(this, host, speed_per_pstate, core); } @@ -535,7 +535,7 @@ void CpuTi::update_remaining_amount(double now) last_update_ = now; } -CpuAction *CpuTi::execution_start(double size) +kernel::resource::CpuAction* CpuTi::execution_start(double size) { XBT_IN("(%s,%g)", get_cname(), size); CpuTiAction* action = new CpuTiAction(this, size); @@ -546,8 +546,7 @@ CpuAction *CpuTi::execution_start(double size) return action; } - -CpuAction *CpuTi::sleep(double duration) +kernel::resource::CpuAction* CpuTi::sleep(double duration) { if (duration > 0) duration = std::max(duration, sg_surf_precision); diff --git a/src/surf/cpu_ti.hpp b/src/surf/cpu_ti.hpp index f3cafa7a0f..845188984a 100644 --- a/src/surf/cpu_ti.hpp +++ b/src/surf/cpu_ti.hpp @@ -73,7 +73,7 @@ private: * Action * **********/ -class XBT_PRIVATE CpuTiAction : public CpuAction { +class XBT_PRIVATE CpuTiAction : public kernel::resource::CpuAction { friend class CpuTi; public: CpuTiAction(CpuTi* cpu, double cost); @@ -100,9 +100,9 @@ typedef boost::intrusive::list ActionTiList; /************ * Resource * ************/ -class CpuTi : public Cpu { +class CpuTi : public kernel::resource::Cpu { public: - CpuTi(CpuTiModel* model, simgrid::s4u::Host* host, const std::vector& speed_per_pstate, int core); + CpuTi(CpuTiModel* model, s4u::Host* host, const std::vector& speed_per_pstate, int core); CpuTi(const CpuTi&) = delete; CpuTi& operator&(const CpuTi&) = delete; ~CpuTi() override; @@ -114,13 +114,13 @@ public: void update_remaining_amount(double now); bool is_used() override; - CpuAction *execution_start(double size) override; + kernel::resource::CpuAction* execution_start(double size) override; kernel::resource::Action* execution_start(double, int) override { THROW_UNIMPLEMENTED; return nullptr; } - CpuAction *sleep(double duration) override; + kernel::resource::CpuAction* sleep(double duration) override; double get_speed_ratio() override; void set_modified(bool modified); @@ -139,7 +139,7 @@ typedef boost::intrusive::list CpuTiList; /********* * Model * *********/ -class CpuTiModel : public CpuModel { +class CpuTiModel : public kernel::resource::CpuModel { public: static void create_pm_vm_models(); // Make both models be TI models @@ -147,14 +147,14 @@ public: CpuTiModel(const CpuTiModel&) = delete; CpuTiModel& operator=(const CpuTiModel&) = delete; ~CpuTiModel() override; - Cpu* create_cpu(simgrid::s4u::Host* host, const std::vector& speed_per_pstate, int core) override; + kernel::resource::Cpu* create_cpu(s4u::Host* host, const std::vector& speed_per_pstate, int core) override; double next_occuring_event(double now) override; void update_actions_state(double now, double delta) override; CpuTiList modified_cpus_; }; -} -} +} // namespace surf +} // namespace simgrid #endif /* SURF_MODEL_CPUTI_H_ */ diff --git a/src/surf/ptask_L07.cpp b/src/surf/ptask_L07.cpp index 2be272c99a..19e985e3f1 100644 --- a/src/surf/ptask_L07.cpp +++ b/src/surf/ptask_L07.cpp @@ -218,7 +218,7 @@ kernel::resource::Action* NetworkL07Model::communicate(s4u::Host* src, s4u::Host return res; } -Cpu* CpuL07Model::create_cpu(simgrid::s4u::Host* host, const std::vector& speed_per_pstate, int core) +kernel::resource::Cpu* CpuL07Model::create_cpu(s4u::Host* host, const std::vector& speed_per_pstate, int core) { return new CpuL07(this, host, speed_per_pstate, core); } diff --git a/src/surf/ptask_L07.hpp b/src/surf/ptask_L07.hpp index edc2fb2c2e..568618a08d 100644 --- a/src/surf/ptask_L07.hpp +++ b/src/surf/ptask_L07.hpp @@ -46,14 +46,14 @@ public: const double* bytes_amount, double rate) override; }; -class CpuL07Model : public CpuModel { +class CpuL07Model : public kernel::resource::CpuModel { public: CpuL07Model(HostL07Model* hmodel, kernel::lmm::System* sys); CpuL07Model(const CpuL07Model&) = delete; CpuL07Model& operator=(const CpuL07Model&) = delete; ~CpuL07Model(); - Cpu* create_cpu(simgrid::s4u::Host* host, const std::vector& speed_per_pstate, int core) override; + kernel::resource::Cpu* create_cpu(s4u::Host* host, const std::vector& speed_per_pstate, int core) override; HostL07Model *hostModel_; }; @@ -75,7 +75,7 @@ public: * Resource * ************/ -class CpuL07 : public Cpu { +class CpuL07 : public kernel::resource::Cpu { public: CpuL07(CpuL07Model* model, s4u::Host* host, const std::vector& speed_per_pstate, int core); CpuL07(const CpuL07&) = delete; @@ -111,7 +111,7 @@ public: /********** * Action * **********/ -class L07Action : public CpuAction { +class L07Action : public kernel::resource::CpuAction { friend Action *CpuL07::execution_start(double size); friend Action *CpuL07::sleep(double duration); friend Action* HostL07Model::execute_parallel(const std::vector& host_list, const double* flops_amount, @@ -140,7 +140,7 @@ private: // exec and regular comms }; -} -} +} // namespace surf +} // namespace simgrid #endif /* HOST_L07_HPP_ */ diff --git a/src/surf/xml/surfxml_parseplatf.cpp b/src/surf/xml/surfxml_parseplatf.cpp index 8fb038afa6..f95634f31b 100644 --- a/src/surf/xml/surfxml_parseplatf.cpp +++ b/src/surf/xml/surfxml_parseplatf.cpp @@ -107,7 +107,7 @@ void parse_platform_file(const std::string& file) simgrid::s4u::Host* host = simgrid::s4u::Host::by_name_or_null(elm.second); xbt_assert(host, "Host %s undefined", elm.second.c_str()); - simgrid::surf::Cpu* cpu = host->pimpl_cpu; + simgrid::kernel::resource::Cpu* cpu = host->pimpl_cpu; cpu->set_state_profile(profile); } @@ -118,7 +118,7 @@ void parse_platform_file(const std::string& file) simgrid::s4u::Host* host = simgrid::s4u::Host::by_name_or_null(elm.second); xbt_assert(host, "Host %s undefined", elm.second.c_str()); - simgrid::surf::Cpu* cpu = host->pimpl_cpu; + simgrid::kernel::resource::Cpu* cpu = host->pimpl_cpu; cpu->set_speed_profile(profile); }