X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/18baa3a0ab674a7402319d489a05e5b5d8b6fa36..7415b6acc6794b420f8884de0f73fcb3e020d9c0:/src/plugins/host_energy.cpp diff --git a/src/plugins/host_energy.cpp b/src/plugins/host_energy.cpp index 763b905c67..3a81ebee01 100644 --- a/src/plugins/host_energy.cpp +++ b/src/plugins/host_energy.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2010-2018. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2010-2019. 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. */ @@ -497,8 +497,9 @@ void sg_host_energy_plugin_init() simgrid::kernel::activity::ExecImpl::on_creation.connect([](simgrid::kernel::activity::ExecImplPtr activity){ if (activity->host_ != nullptr) { // We only run on one host simgrid::s4u::Host* host = activity->host_; - if (dynamic_cast(activity->host_)) - host = dynamic_cast(activity->host_)->get_pm(); + simgrid::s4u::VirtualMachine* vm = dynamic_cast(host); + if (vm != nullptr) + host = vm->get_pm(); host->extension()->update(); }