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
fix example (bummer)
[simgrid.git]
/
src
/
surf
/
plugins
/
host_energy.cpp
diff --git
a/src/surf/plugins/host_energy.cpp
b/src/surf/plugins/host_energy.cpp
index
8d701b7
..
d64ed6f
100644
(file)
--- a/
src/surf/plugins/host_energy.cpp
+++ b/
src/surf/plugins/host_energy.cpp
@@
-282,19
+282,19
@@
static void onActionStateChange(simgrid::surf::CpuAction* action, simgrid::surf:
{
for (simgrid::surf::Cpu* cpu : action->cpus()) {
simgrid::s4u::Host* host = cpu->getHost();
- if (host == nullptr)
- continue;
+ if (host != nullptr) {
- // If it's a VM, take the corresponding PM
- simgrid::s4u::VirtualMachine* vm = dynamic_cast<simgrid::s4u::VirtualMachine*>(host);
- if (vm) // If it's a VM, take the corresponding PM
- host = vm->pimpl_vm_->getPm();
+
// If it's a VM, take the corresponding PM
+
simgrid::s4u::VirtualMachine* vm = dynamic_cast<simgrid::s4u::VirtualMachine*>(host);
+
if (vm) // If it's a VM, take the corresponding PM
+
host = vm->pimpl_vm_->getPm();
- // Get the host_energy extension for the relevant host
- HostEnergy* host_energy = host->extension<HostEnergy>();
+
// Get the host_energy extension for the relevant host
+
HostEnergy* host_energy = host->extension<HostEnergy>();
- if (host_energy->last_updated < surf_get_clock())
- host_energy->update();
+ if (host_energy->last_updated < surf_get_clock())
+ host_energy->update();
+ }
}
}