Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Host is not null here (for scan-build).
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 27 Feb 2020 08:13:03 +0000 (09:13 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 27 Feb 2020 08:13:03 +0000 (09:13 +0100)
src/plugins/host_energy.cpp

index b68edc8..0b1ed29 100644 (file)
@@ -515,7 +515,7 @@ static void on_simulation_end()
   double total_energy      = 0.0; // Total energy consumption (whole platform)
   double used_hosts_energy = 0.0; // Energy consumed by hosts that computed something
   for (simgrid::s4u::Host const* host : simgrid::s4u::Engine::get_instance()->get_all_hosts()) {
-    if (dynamic_cast<const simgrid::s4u::VirtualMachine*>(host) == nullptr) { // Ignore virtual machines
+    if (host && dynamic_cast<const simgrid::s4u::VirtualMachine*>(host) == nullptr) { // Ignore virtual machines
       double energy = host->extension<HostEnergy>()->get_consumed_energy();
       total_energy += energy;
       if (host->extension<HostEnergy>()->host_was_used_)