-/* Copyright (c) 2013-2017. The SimGrid Team.
- * All rights reserved. */
+/* Copyright (c) 2013-2018. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
action->getLastUpdate(), now - action->getLastUpdate());
}
- action->finish(Action::State::done);
+ action->finish(kernel::resource::Action::State::done);
XBT_CDEBUG(surf_kernel, "Action %p finished", action);
/* set the remains to 0 due to precision problems when updating the remaining amount */
//defining the last timestamp that we can safely dump to trace file
//without losing the event ascending order (considering all CPU's)
double smaller = -1;
- for (Action const& action : *getRunningActionSet()) {
+ for (kernel::resource::Action const& action : *getRunningActionSet()) {
if (smaller < 0 || action.getLastUpdate() < smaller)
smaller = action.getLastUpdate();
}
if (((action.getRemainsNoUpdate() <= 0) && (action.getVariable()->get_weight() > 0)) ||
((action.getMaxDuration() != NO_MAX_DURATION) && (action.getMaxDuration() <= 0))) {
- action.finish(Action::State::done);
+ action.finish(kernel::resource::Action::State::done);
}
}
}
/************
* Resource *
************/
-Cpu::Cpu(Model *model, simgrid::s4u::Host *host, std::vector<double> *speedPerPstate, int core)
- : Cpu(model, host, nullptr/*constraint*/, speedPerPstate, core)
+Cpu::Cpu(kernel::resource::Model* model, simgrid::s4u::Host* host, std::vector<double>* speedPerPstate, int core)
+ : Cpu(model, host, nullptr /*constraint*/, speedPerPstate, core)
{
}
-Cpu::Cpu(Model* model, simgrid::s4u::Host* host, kernel::lmm::Constraint* constraint,
+Cpu::Cpu(kernel::resource::Model* model, simgrid::s4u::Host* host, kernel::lmm::Constraint* constraint,
std::vector<double>* speedPerPstate, int core)
: Resource(model, host->getCname(), constraint), coresAmount_(core), host_(host)
{
setLastValue(getVariable()->get_value());
}
-simgrid::xbt::signal<void(simgrid::surf::CpuAction*, Action::State)> CpuAction::onStateChange;
+simgrid::xbt::signal<void(simgrid::surf::CpuAction*, kernel::resource::Action::State)> CpuAction::onStateChange;
void CpuAction::suspend(){
Action::State previous = getState();
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*...
- Resource* resource = static_cast<Resource*>(getVariable()->get_constraint(i)->get_id());
+ kernel::resource::Resource* resource =
+ static_cast<kernel::resource::Resource*>(getVariable()->get_constraint(i)->get_id());
Cpu* cpu = dynamic_cast<Cpu*>(resource);
if (cpu != nullptr)
retlist.push_back(cpu);