X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/dd96d5146134f3ff468a7835db49556c8e6225a5..721ce3a9bda40b178bb97e61f831056bb050ac51:/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(); }