A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
prefer automatic memory management
[simgrid.git]
/
src
/
surf
/
cpu_interface.cpp
diff --git
a/src/surf/cpu_interface.cpp
b/src/surf/cpu_interface.cpp
index
245c019
..
c4ef192
100644
(file)
--- a/
src/surf/cpu_interface.cpp
+++ b/
src/surf/cpu_interface.cpp
@@
-60,7
+60,7
@@
Cpu::Cpu(kernel::resource::Model* model, simgrid::s4u::Host* host, std::vector<d
Cpu::Cpu(kernel::resource::Model* model, simgrid::s4u::Host* host, kernel::lmm::Constraint* constraint,
std::vector<double>* speedPerPstate, int core)
Cpu::Cpu(kernel::resource::Model* model, simgrid::s4u::Host* host, kernel::lmm::Constraint* constraint,
std::vector<double>* speedPerPstate, int core)
- : Resource(model, host->get_cname(), constraint), core
s
_count_(core), host_(host)
+ : Resource(model, host->get_cname(), constraint), core_count_(core), host_(host)
{
xbt_assert(core > 0, "Host %s must have at least one core, not 0.", host->get_cname());
{
xbt_assert(core > 0, "Host %s must have at least one core, not 0.", host->get_cname());
@@
-81,7
+81,7
@@
Cpu::~Cpu()
speed_per_pstate_.clear();
}
speed_per_pstate_.clear();
}
-int Cpu::get_pstate
s
_count()
+int Cpu::get_pstate_count()
{
return speed_per_pstate_.size();
}
{
return speed_per_pstate_.size();
}
@@
-129,22
+129,16
@@
void Cpu::on_speed_change()
s4u::Host::on_speed_change(*host_);
}
s4u::Host::on_speed_change(*host_);
}
-int Cpu::get_core
s
_count()
+int Cpu::get_core_count()
{
{
- return core
s
_count_;
+ return core_count_;
}
}
-void Cpu::set_state_trace(tmgr_trace_t trace)
-{
- xbt_assert(state_event_ == nullptr, "Cannot set a second state trace to Host %s", host_->get_cname());
-
- state_event_ = future_evt_set->add_trace(trace, this);
-}
void Cpu::set_speed_trace(tmgr_trace_t trace)
{
xbt_assert(speed_.event == nullptr, "Cannot set a second speed trace to Host %s", host_->get_cname());
void Cpu::set_speed_trace(tmgr_trace_t trace)
{
xbt_assert(speed_.event == nullptr, "Cannot set a second speed trace to Host %s", host_->get_cname());
- speed_.event = future_evt_set
->
add_trace(trace, this);
+ speed_.event = future_evt_set
.
add_trace(trace, this);
}
}
@@
-172,17
+166,17
@@
void CpuAction::update_remains_lazy(double now)
set_last_value(get_variable()->get_value());
}
set_last_value(get_variable()->get_value());
}
-simgrid::xbt::signal<void(simgrid::surf::CpuAction*, kernel::resource::Action::State)> CpuAction::on
StateC
hange;
+simgrid::xbt::signal<void(simgrid::surf::CpuAction*, kernel::resource::Action::State)> CpuAction::on
_state_c
hange;
void CpuAction::suspend(){
Action::State previous = get_state();
void CpuAction::suspend(){
Action::State previous = get_state();
- on
StateC
hange(this, previous);
+ on
_state_c
hange(this, previous);
Action::suspend();
}
void CpuAction::resume(){
Action::State previous = get_state();
Action::suspend();
}
void CpuAction::resume(){
Action::State previous = get_state();
- on
StateC
hange(this, previous);
+ on
_state_c
hange(this, previous);
Action::resume();
}
Action::resume();
}
@@
-190,8
+184,9
@@
void CpuAction::set_state(Action::State state)
{
Action::State previous = get_state();
Action::set_state(state);
{
Action::State previous = get_state();
Action::set_state(state);
- on
StateC
hange(this, previous);
+ on
_state_c
hange(this, previous);
}
}
+
/** @brief returns a list of all CPUs that this action is using */
std::list<Cpu*> CpuAction::cpus() {
std::list<Cpu*> retlist;
/** @brief returns a list of all CPUs that this action is using */
std::list<Cpu*> CpuAction::cpus() {
std::list<Cpu*> retlist;