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
Various cleanups in the Host signals
[simgrid.git]
/
src
/
kernel
/
resource
/
CpuImpl.cpp
diff --git
a/src/kernel/resource/CpuImpl.cpp
b/src/kernel/resource/CpuImpl.cpp
index
c69d23a
..
313b3fc
100644
(file)
--- a/
src/kernel/resource/CpuImpl.cpp
+++ b/
src/kernel/resource/CpuImpl.cpp
@@
-67,9
+67,9
@@
CpuImpl* CpuImpl::set_pstate(unsigned long pstate_index)
{
xbt_assert(
pstate_index < speed_per_pstate_.size(),
- "Invalid parameters for CPU %s (pstate %lu >= length of pstates %
d
). Please fix your platform file, or your "
+ "Invalid parameters for CPU %s (pstate %lu >= length of pstates %
zu
). Please fix your platform file, or your "
"call to change the pstate.",
- get_cname(), pstate_index, s
tatic_cast<int>(speed_per_pstate_.size()
));
+ get_cname(), pstate_index, s
peed_per_pstate_.size(
));
double new_peak_speed = speed_per_pstate_[pstate_index];
pstate_ = pstate_index;
@@
-90,14
+90,15
@@
CpuImpl* CpuImpl::set_pstate_speed(const std::vector<double>& speed_per_state)
double CpuImpl::get_pstate_peak_speed(unsigned long pstate_index) const
{
- xbt_assert(
(pstate_index <= speed_per_pstate_.size()), "Invalid parameters (pstate index out of bounds)");
-
+ xbt_assert(
pstate_index < speed_per_pstate_.size(), "Invalid parameters (pstate index %lu out of bounds %zu)",
+ pstate_index, speed_per_pstate_.size());
return speed_per_pstate_[pstate_index];
}
void CpuImpl::on_speed_change()
{
s4u::Host::on_speed_change(*piface_);
+ piface_->on_this_speed_change(*piface_);
}
CpuImpl* CpuImpl::set_core_count(int core_count)
@@
-193,27
+194,11
@@
void CpuAction::update_remains_lazy(double now)
set_last_value(get_rate());
}
-xbt::signal<void(CpuAction const&, Action::State)> CpuAction::on_state_change;
-
-void CpuAction::suspend()
-{
- Action::State previous = get_state();
- on_state_change(*this, previous);
- Action::suspend();
-}
-
-void CpuAction::resume()
-{
- Action::State previous = get_state();
- on_state_change(*this, previous);
- Action::resume();
-}
-
void CpuAction::set_state(Action::State state)
{
Action::State previous = get_state();
Action::set_state(state);
-
on
_state_change(*this, previous);
+
s4u::Host::on_exec
_state_change(*this, previous);
}
/** @brief returns a list of all CPUs that this action is using */