#include <xbt/dynar.h>
#include "cpu_interface.hpp"
-#include "plugins/energy.hpp"
#include "src/instr/instr_private.h" // TRACE_is_enabled(). FIXME: remove by subscribing tracing to the surf signals
XBT_LOG_EXTERNAL_CATEGORY(surf_kernel);
//without losing the event ascending order (considering all CPU's)
double smaller = -1;
ActionList *actionSet = getRunningActionSet();
- for(ActionList::iterator it(actionSet->begin()), itend(actionSet->end())
- ; it != itend ; ++it) {
+ ActionList::iterator it(actionSet->begin());
+ ActionList::iterator itend(actionSet->end());
+ for (; it != itend; ++it) {
CpuAction *action = static_cast<CpuAction*>(&*it);
- if (smaller < 0) {
- smaller = action->getLastUpdate();
- continue;
- }
- if (action->getLastUpdate() < smaller) {
- smaller = action->getLastUpdate();
- }
+ if (smaller < 0 || action->getLastUpdate() < smaller)
+ smaller = action->getLastUpdate();
}
if (smaller > 0) {
TRACE_last_timestamp_to_dump = smaller;
{
CpuAction *action = nullptr;
ActionList *running_actions = getRunningActionSet();
-
- for(ActionList::iterator it(running_actions->begin()), itNext=it, itend(running_actions->end())
- ; it != itend ; it=itNext) {
+ ActionList::iterator it(running_actions->begin());
+ ActionList::iterator itNext = it;
+ ActionList::iterator itend(running_actions->end());
+ for (; it != itend; it = itNext) {
++itNext;
action = static_cast<CpuAction*>(&*it);
if (TRACE_is_enabled()) {
void Cpu::onSpeedChange() {
TRACE_surf_host_set_speed(surf_get_clock(), cname(), coresAmount_ * speed_.scale * speed_.peak);
+ s4u::Host::onSpeedChange(*host_);
}
int Cpu::coreCount()