From 0f20fc561a88d0ef2218df796be8cc22f57feced Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Thu, 25 Feb 2016 13:15:24 +0100 Subject: [PATCH] Implem? I meant Impl, as in pimpl. Sorry for the noise --- src/include/surf/surf.h | 4 +- src/s4u/s4u_host.cpp | 12 ++--- src/simdag/sd_task.cpp | 2 +- src/simdag/sd_workstation.cpp | 4 +- src/simgrid/host.cpp | 6 +-- src/simix/smx_host.cpp | 10 ++-- src/simix/smx_vm.cpp | 12 ++--- src/surf/{HostImplem.cpp => HostImpl.cpp} | 63 +++++++++++------------ src/surf/{HostImplem.hpp => HostImpl.hpp} | 18 +++---- src/surf/host_clm03.hpp | 2 +- src/surf/network_ib.cpp | 2 +- src/surf/network_ns3.cpp | 2 +- src/surf/plugins/energy.cpp | 12 ++--- src/surf/plugins/energy.hpp | 2 +- src/surf/ptask_L07.cpp | 2 +- src/surf/ptask_L07.hpp | 2 +- src/surf/sg_platf.cpp | 2 +- src/surf/surf_c_bindings.cpp | 8 +-- src/surf/surf_interface.cpp | 4 +- src/surf/virtual_machine.cpp | 4 +- src/surf/virtual_machine.hpp | 4 +- src/surf/vm_hl13.cpp | 2 +- tools/cmake/DefinePackages.cmake | 4 +- 23 files changed, 91 insertions(+), 92 deletions(-) rename src/surf/{HostImplem.cpp => HostImpl.cpp} (87%) rename src/surf/{HostImplem.hpp => HostImpl.hpp} (93%) diff --git a/src/include/surf/surf.h b/src/include/surf/surf.h index 4aaeaff68e..4605e692f3 100644 --- a/src/include/surf/surf.h +++ b/src/include/surf/surf.h @@ -52,7 +52,7 @@ class NetworkModel; class StorageModel; class Resource; class ResourceLmm; -class HostImplem; +class HostImpl; class HostCLM03; class NetworkCm02Link; class Action; @@ -72,7 +72,7 @@ typedef simgrid::surf::NetworkModel surf_NetworkModel; typedef simgrid::surf::StorageModel surf_StorageModel; typedef simgrid::surf::Resource surf_Resource; typedef simgrid::surf::ResourceLmm surf_ResourceLmm; -typedef simgrid::surf::HostImplem surf_Host; +typedef simgrid::surf::HostImpl surf_Host; typedef simgrid::surf::HostCLM03 surf_HostCLM03; typedef simgrid::surf::NetworkCm02Link surf_NetworkCm02Link; typedef simgrid::surf::Action surf_Action; diff --git a/src/s4u/s4u_host.cpp b/src/s4u/s4u_host.cpp index 55402984d9..e1c5097573 100644 --- a/src/s4u/s4u_host.cpp +++ b/src/s4u/s4u_host.cpp @@ -11,7 +11,7 @@ #include #include "simgrid/simix.hpp" -#include "src/surf/HostImplem.hpp" +#include "src/surf/HostImpl.hpp" #include "xbt/log.h" #include "src/msg/msg_private.h" #include "src/simix/smx_process_private.h" @@ -112,7 +112,7 @@ boost::unordered_map const& Host::mountedStorages() { /** Get the properties assigned to a host */ xbt_dict_t Host::properties() { return simgrid::simix::kernel([&] { - simgrid::surf::HostImplem* surf_host = this->extension(); + simgrid::surf::HostImpl* surf_host = this->extension(); return surf_host->getProperties(); }); } @@ -166,14 +166,14 @@ int Host::pstate() void Host::parameters(vm_params_t params) { simgrid::simix::kernel([&]() { - this->extension()->getParams(params); + this->extension()->getParams(params); }); } void Host::setParameters(vm_params_t params) { simgrid::simix::kernel([&]() { - this->extension()->setParams(params); + this->extension()->setParams(params); }); } @@ -185,7 +185,7 @@ void Host::setParameters(vm_params_t params) xbt_dict_t Host::mountedStoragesAsDict() { return simgrid::simix::kernel([&] { - return this->extension()->getMountedStorageList(); + return this->extension()->getMountedStorageList(); }); } @@ -197,7 +197,7 @@ xbt_dict_t Host::mountedStoragesAsDict() xbt_dynar_t Host::attachedStorages() { return simgrid::simix::kernel([&] { - return this->extension()->getAttachedStorageList(); + return this->extension()->getAttachedStorageList(); }); } diff --git a/src/simdag/sd_task.cpp b/src/simdag/sd_task.cpp index abd82f6465..93c5ba2ac0 100644 --- a/src/simdag/sd_task.cpp +++ b/src/simdag/sd_task.cpp @@ -4,7 +4,7 @@ /* 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. */ -#include "src/surf/HostImplem.hpp" +#include "src/surf/HostImpl.hpp" #include "src/surf/surf_interface.hpp" #include "src/simdag/simdag_private.h" #include "simgrid/simdag.h" diff --git a/src/simdag/sd_workstation.cpp b/src/simdag/sd_workstation.cpp index 918b7697c2..e77d274f80 100644 --- a/src/simdag/sd_workstation.cpp +++ b/src/simdag/sd_workstation.cpp @@ -5,8 +5,8 @@ * under the terms of the license (GNU LGPL) which comes with this package. */ #include "src/simdag/simdag_private.h" -#include -#include "src/surf/HostImplem.hpp" +#include "simgrid/s4u/host.hpp" +#include "src/surf/HostImpl.hpp" #include "surf/surf.h" /** @brief Returns the route between two workstations diff --git a/src/simgrid/host.cpp b/src/simgrid/host.cpp index 3a02cca91f..da0f26d186 100644 --- a/src/simgrid/host.cpp +++ b/src/simgrid/host.cpp @@ -9,7 +9,7 @@ #include #include -#include "src/surf/HostImplem.hpp" +#include "src/surf/HostImpl.hpp" #include "surf/surf.h" // routing_get_network_element_type FIXME:killme #include "src/simix/smx_private.hpp" @@ -126,11 +126,11 @@ void sg_host_simix_destroy(sg_host_t host) { // ========= storage related functions ============ xbt_dict_t sg_host_get_mounted_storage_list(sg_host_t host){ - return host->extension()->getMountedStorageList(); + return host->extension()->getMountedStorageList(); } xbt_dynar_t sg_host_get_attached_storage_list(sg_host_t host){ - return host->extension()->getAttachedStorageList(); + return host->extension()->getAttachedStorageList(); } diff --git a/src/simix/smx_host.cpp b/src/simix/smx_host.cpp index 3a2bd4671b..91cb6c8649 100644 --- a/src/simix/smx_host.cpp +++ b/src/simix/smx_host.cpp @@ -9,7 +9,7 @@ #include "mc/mc.h" #include "src/mc/mc_replay.h" #include "src/surf/virtual_machine.hpp" -#include "src/surf/HostImplem.hpp" +#include "src/surf/HostImpl.hpp" XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_host, simix, "SIMIX hosts"); @@ -43,7 +43,7 @@ void SIMIX_host_on(sg_host_t h) xbt_assert((host != NULL), "Invalid parameters"); if (h->isOff()) { - simgrid::surf::HostImplem* surf_host = h->extension(); + simgrid::surf::HostImpl* surf_host = h->extension(); surf_host->turnOn(); unsigned int cpt; @@ -92,7 +92,7 @@ void SIMIX_host_off(sg_host_t h, smx_process_t issuer) xbt_assert((host != NULL), "Invalid parameters"); if (h->isOn()) { - simgrid::surf::HostImplem* surf_host = h->extension(); + simgrid::surf::HostImpl* surf_host = h->extension(); surf_host->turnOff(); /* Clean Simulator data */ @@ -322,10 +322,10 @@ smx_synchro_t SIMIX_execution_parallel_start(const char *name, host_list_cpy[i] = host_list[i]; /* Check that we are not mixing VMs and PMs in the parallel task */ - simgrid::surf::HostImplem *host = host_list[0]->extension(); + simgrid::surf::HostImpl *host = host_list[0]->extension(); bool is_a_vm = (nullptr != dynamic_cast(host)); for (i = 1; i < host_nb; i++) { - bool tmp_is_a_vm = (nullptr != dynamic_cast(host_list[i]->extension())); + bool tmp_is_a_vm = (nullptr != dynamic_cast(host_list[i]->extension())); xbt_assert(is_a_vm == tmp_is_a_vm, "parallel_execute: mixing VMs and PMs is not supported (yet)."); } diff --git a/src/simix/smx_vm.cpp b/src/simix/smx_vm.cpp index 93e4697180..1bf7c7aa43 100644 --- a/src/simix/smx_vm.cpp +++ b/src/simix/smx_vm.cpp @@ -7,7 +7,7 @@ #include "smx_private.h" #include "mc/mc.h" #include "src/surf/virtual_machine.hpp" -#include "src/surf/HostImplem.hpp" +#include "src/surf/HostImpl.hpp" //If you need to log some stuffs, just uncomment these two lines and uses XBT_DEBUG for instance XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_vm, simix, "Logging specific to SIMIX (vms)"); @@ -37,7 +37,7 @@ sg_host_t SIMIX_vm_create(const char *name, sg_host_t ind_phys_host) static long host_get_ramsize(sg_host_t vm, int *overcommit) { s_vm_params_t params; - vm->extension()->getParams(¶ms); + vm->extension()->getParams(¶ms); if (overcommit) *overcommit = params.overcommit; @@ -65,7 +65,7 @@ static int __can_be_started(sg_host_t vm) } long total_ramsize_of_vms = 0; - xbt_dynar_t dyn_vms = pm->extension()->getVms(); + xbt_dynar_t dyn_vms = pm->extension()->getVms(); { unsigned int cursor = 0; sg_host_t another_vm; @@ -90,7 +90,7 @@ void SIMIX_vm_start(sg_host_t ind_vm) { if (__can_be_started(ind_vm)) static_cast( - ind_vm->extension() + ind_vm->extension() )->setState(SURF_VM_STATE_RUNNING); else THROWF(vm_error, 0, "The VM %s cannot be started", sg_host_get_name(ind_vm)); @@ -100,7 +100,7 @@ void SIMIX_vm_start(sg_host_t ind_vm) e_surf_vm_state_t SIMIX_vm_get_state(sg_host_t ind_vm) { return static_cast( - ind_vm->extension() + ind_vm->extension() )->getState(); } @@ -345,7 +345,7 @@ void SIMIX_vm_shutdown(sg_host_t ind_vm, smx_process_t issuer) /* FIXME: we may have to do something at the surf layer, e.g., vcpu action */ static_cast( - ind_vm->extension() + ind_vm->extension() )->setState(SURF_VM_STATE_CREATED); } diff --git a/src/surf/HostImplem.cpp b/src/surf/HostImpl.cpp similarity index 87% rename from src/surf/HostImplem.cpp rename to src/surf/HostImpl.cpp index f549c9bd5d..df99dc0545 100644 --- a/src/surf/HostImplem.cpp +++ b/src/surf/HostImpl.cpp @@ -4,12 +4,11 @@ /* 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. */ -#include "HostImplem.hpp" - #include #include "src/simix/smx_private.h" #include "cpu_cas01.hpp" +#include "src/surf/HostImpl.hpp" #include "simgrid/sg_config.h" #include "network_interface.hpp" @@ -27,15 +26,15 @@ simgrid::surf::HostModel *surf_host_model = NULL; namespace simgrid { namespace surf { -simgrid::xbt::Extension HostImplem::EXTENSION_ID; +simgrid::xbt::Extension HostImpl::EXTENSION_ID; /********* * Model * *********/ -HostImplem *HostModel::createHost(const char *name,NetCard *netElm, Cpu *cpu, xbt_dict_t props){ +HostImpl *HostModel::createHost(const char *name,NetCard *netElm, Cpu *cpu, xbt_dict_t props){ xbt_dynar_t storageList = (xbt_dynar_t)xbt_lib_get_or_null(storage_lib, name, ROUTING_STORAGE_HOST_LEVEL); - HostImplem *host = new simgrid::surf::HostImplem(surf_host_model, name, props, storageList, cpu); + HostImpl *host = new simgrid::surf::HostImpl(surf_host_model, name, props, storageList, cpu); XBT_DEBUG("Create host %s with %ld mounted disks", name, xbt_dynar_length(host->p_storage)); return host; } @@ -117,14 +116,14 @@ Action *HostModel::executeParallelTask(int host_nb, ************/ -void HostImplem::classInit() +void HostImpl::classInit() { if (!EXTENSION_ID.valid()) { - EXTENSION_ID = simgrid::s4u::Host::extension_create(); + EXTENSION_ID = simgrid::s4u::Host::extension_create(); } } -HostImplem::HostImplem(simgrid::surf::HostModel *model, const char *name, xbt_dict_t props, +HostImpl::HostImpl(simgrid::surf::HostModel *model, const char *name, xbt_dict_t props, xbt_dynar_t storage, Cpu *cpu) : Resource(model, name) , PropertyHolder(props) @@ -133,7 +132,7 @@ HostImplem::HostImplem(simgrid::surf::HostModel *model, const char *name, xbt_di p_params.ramsize = 0; } -HostImplem::HostImplem(simgrid::surf::HostModel *model, const char *name, xbt_dict_t props, lmm_constraint_t constraint, +HostImpl::HostImpl(simgrid::surf::HostModel *model, const char *name, xbt_dict_t props, lmm_constraint_t constraint, xbt_dynar_t storage, Cpu *cpu) : Resource(model, name, constraint) , PropertyHolder(props) @@ -143,11 +142,11 @@ HostImplem::HostImplem(simgrid::surf::HostModel *model, const char *name, xbt_di } /** @brief use destroy() instead of this destructor */ -HostImplem::~HostImplem() +HostImpl::~HostImpl() { } -void HostImplem::attach(simgrid::s4u::Host* host) +void HostImpl::attach(simgrid::s4u::Host* host) { if (p_host != nullptr) xbt_die("Already attached to host %s", host->name().c_str()); @@ -155,26 +154,26 @@ void HostImplem::attach(simgrid::s4u::Host* host) p_host = host; } -bool HostImplem::isOn() { +bool HostImpl::isOn() { return p_cpu->isOn(); } -bool HostImplem::isOff() { +bool HostImpl::isOff() { return p_cpu->isOff(); } -void HostImplem::turnOn(){ +void HostImpl::turnOn(){ if (isOff()) { p_cpu->turnOn(); simgrid::s4u::Host::onStateChange(*this->p_host); } } -void HostImplem::turnOff(){ +void HostImpl::turnOff(){ if (isOn()) { p_cpu->turnOff(); simgrid::s4u::Host::onStateChange(*this->p_host); } } -simgrid::surf::Storage *HostImplem::findStorageOnMountList(const char* mount) +simgrid::surf::Storage *HostImpl::findStorageOnMountList(const char* mount) { simgrid::surf::Storage *st = NULL; s_mount_t mnt; @@ -193,7 +192,7 @@ simgrid::surf::Storage *HostImplem::findStorageOnMountList(const char* mount) return st; } -xbt_dict_t HostImplem::getMountedStorageList() +xbt_dict_t HostImpl::getMountedStorageList() { s_mount_t mnt; unsigned int i; @@ -207,7 +206,7 @@ xbt_dict_t HostImplem::getMountedStorageList() return storage_list; } -xbt_dynar_t HostImplem::getAttachedStorageList() +xbt_dynar_t HostImpl::getAttachedStorageList() { xbt_lib_cursor_t cursor; char *key; @@ -224,7 +223,7 @@ xbt_dynar_t HostImplem::getAttachedStorageList() return result; } -Action *HostImplem::open(const char* fullpath) { +Action *HostImpl::open(const char* fullpath) { simgrid::surf::Storage *st = NULL; s_mount_t mnt; @@ -268,25 +267,25 @@ Action *HostImplem::open(const char* fullpath) { return action; } -Action *HostImplem::close(surf_file_t fd) { +Action *HostImpl::close(surf_file_t fd) { simgrid::surf::Storage *st = findStorageOnMountList(fd->mount); XBT_DEBUG("CLOSE %s on disk '%s'",fd->name, st->getName()); return st->close(fd); } -Action *HostImplem::read(surf_file_t fd, sg_size_t size) { +Action *HostImpl::read(surf_file_t fd, sg_size_t size) { simgrid::surf::Storage *st = findStorageOnMountList(fd->mount); XBT_DEBUG("READ %s on disk '%s'",fd->name, st->getName()); return st->read(fd, size); } -Action *HostImplem::write(surf_file_t fd, sg_size_t size) { +Action *HostImpl::write(surf_file_t fd, sg_size_t size) { simgrid::surf::Storage *st = findStorageOnMountList(fd->mount); XBT_DEBUG("WRITE %s on disk '%s'",fd->name, st->getName()); return st->write(fd, size); } -int HostImplem::unlink(surf_file_t fd) { +int HostImpl::unlink(surf_file_t fd) { if (!fd){ XBT_WARN("No such file descriptor. Impossible to unlink"); return -1; @@ -313,11 +312,11 @@ int HostImplem::unlink(surf_file_t fd) { } } -sg_size_t HostImplem::getSize(surf_file_t fd){ +sg_size_t HostImpl::getSize(surf_file_t fd){ return fd->size; } -xbt_dynar_t HostImplem::getInfo( surf_file_t fd) +xbt_dynar_t HostImpl::getInfo( surf_file_t fd) { simgrid::surf::Storage *st = findStorageOnMountList(fd->mount); sg_size_t *psize = xbt_new(sg_size_t, 1); @@ -332,11 +331,11 @@ xbt_dynar_t HostImplem::getInfo( surf_file_t fd) return info; } -sg_size_t HostImplem::fileTell(surf_file_t fd){ +sg_size_t HostImpl::fileTell(surf_file_t fd){ return fd->current_position; } -int HostImplem::fileSeek(surf_file_t fd, sg_offset_t offset, int origin){ +int HostImpl::fileSeek(surf_file_t fd, sg_offset_t offset, int origin){ switch (origin) { case SEEK_SET: @@ -353,7 +352,7 @@ int HostImplem::fileSeek(surf_file_t fd, sg_offset_t offset, int origin){ } } -int HostImplem::fileMove(surf_file_t fd, const char* fullpath){ +int HostImpl::fileMove(surf_file_t fd, const char* fullpath){ /* Check if the new full path is on the same mount point */ if(!strncmp((const char*)fd->mount, fullpath, strlen(fd->mount))) { sg_size_t *psize, *new_psize; @@ -383,7 +382,7 @@ int HostImplem::fileMove(surf_file_t fd, const char* fullpath){ } } -xbt_dynar_t HostImplem::getVms() +xbt_dynar_t HostImpl::getVms() { xbt_dynar_t dyn = xbt_dynar_new(sizeof(simgrid::surf::VirtualMachine*), NULL); @@ -393,19 +392,19 @@ xbt_dynar_t HostImplem::getVms() iter != simgrid::surf::VMModel::ws_vms.end(); ++iter) { simgrid::surf::VirtualMachine *ws_vm = &*iter; - if (this == ws_vm->p_hostPM->extension(simgrid::surf::HostImplem::EXTENSION_ID)) + if (this == ws_vm->p_hostPM->extension(simgrid::surf::HostImpl::EXTENSION_ID)) xbt_dynar_push(dyn, &ws_vm); } return dyn; } -void HostImplem::getParams(vm_params_t params) +void HostImpl::getParams(vm_params_t params) { *params = p_params; } -void HostImplem::setParams(vm_params_t params) +void HostImpl::setParams(vm_params_t params) { /* may check something here. */ p_params = *params; diff --git a/src/surf/HostImplem.hpp b/src/surf/HostImpl.hpp similarity index 93% rename from src/surf/HostImplem.hpp rename to src/surf/HostImpl.hpp index d89f3cfe2e..69d0ce6a37 100644 --- a/src/surf/HostImplem.hpp +++ b/src/surf/HostImpl.hpp @@ -23,7 +23,7 @@ namespace simgrid { namespace surf { class XBT_PRIVATE HostModel; -class XBT_PRIVATE HostImplem; +class XBT_PRIVATE HostImpl; class XBT_PRIVATE HostAction; @@ -52,7 +52,7 @@ public: HostModel() : Model() {} ~HostModel() override {} - HostImplem *createHost(const char *name, NetCard *net, Cpu *cpu, xbt_dict_t props); + HostImpl *createHost(const char *name, NetCard *net, Cpu *cpu, xbt_dict_t props); virtual void adjustWeightOfDummyCpuActions(); virtual Action *executeParallelTask(int host_nb, @@ -71,11 +71,11 @@ public: * @brief SURF Host interface class * @details An host represents a machine with a aggregation of a Cpu, a RoutingEdge and a Storage */ -class HostImplem : - public simgrid::surf::Resource, - public simgrid::surf::PropertyHolder { +class HostImpl +: public simgrid::surf::Resource, + public simgrid::surf::PropertyHolder { public: - static simgrid::xbt::Extension EXTENSION_ID; + static simgrid::xbt::Extension EXTENSION_ID; public: static void classInit(); // must be called before the first use of that class @@ -88,7 +88,7 @@ public: * @param storage The Storage associated to this Host * @param cpu The Cpu associated to this Host */ - HostImplem(HostModel *model, const char *name, xbt_dict_t props, + HostImpl(HostModel *model, const char *name, xbt_dict_t props, xbt_dynar_t storage, Cpu *cpu); /** @@ -101,12 +101,12 @@ public: * @param storage The Storage associated to this Host * @param cpu The Cpu associated to this Host */ - HostImplem(HostModel *model, const char *name, xbt_dict_t props, + HostImpl(HostModel *model, const char *name, xbt_dict_t props, lmm_constraint_t constraint, xbt_dynar_t storage, Cpu *cpu); /* Host destruction logic */ /**************************/ - ~HostImplem(); + ~HostImpl(); public: HostModel *getModel() diff --git a/src/surf/host_clm03.hpp b/src/surf/host_clm03.hpp index e225fb436b..ac9b57dfe4 100644 --- a/src/surf/host_clm03.hpp +++ b/src/surf/host_clm03.hpp @@ -8,7 +8,7 @@ #include "storage_interface.hpp" #include "cpu_interface.hpp" -#include "src/surf/HostImplem.hpp" +#include "src/surf/HostImpl.hpp" #include "network_interface.hpp" #ifndef SURF_HOST_CLM03_HPP_ diff --git a/src/surf/network_ib.cpp b/src/surf/network_ib.cpp index 566e8f2fd6..ecc9e63597 100644 --- a/src/surf/network_ib.cpp +++ b/src/surf/network_ib.cpp @@ -9,7 +9,7 @@ #include "network_ib.hpp" -#include "src/surf/HostImplem.hpp" +#include "src/surf/HostImpl.hpp" #include "simgrid/sg_config.h" #include "maxmin_private.hpp" diff --git a/src/surf/network_ns3.cpp b/src/surf/network_ns3.cpp index 853d6c1196..491fa43437 100644 --- a/src/surf/network_ns3.cpp +++ b/src/surf/network_ns3.cpp @@ -6,7 +6,7 @@ #include "src/surf/network_ns3.hpp" -#include "src/surf/HostImplem.hpp" +#include "src/surf/HostImpl.hpp" #include "src/surf/surf_private.h" #include "simgrid/sg_config.h" #include "src/instr/instr_private.h" // TRACE_is_enabled(). FIXME: remove by subscribing tracing to the surf signals diff --git a/src/surf/plugins/energy.cpp b/src/surf/plugins/energy.cpp index 16100e8c07..c5c9f3aa4f 100644 --- a/src/surf/plugins/energy.cpp +++ b/src/surf/plugins/energy.cpp @@ -65,7 +65,7 @@ simgrid::xbt::Extension HostEnergy::EXTENSION_ID /* Computes the consumption so far. Called lazily on need. */ void HostEnergy::update() { - simgrid::surf::HostImplem* surf_host = host->extension(); + simgrid::surf::HostImpl* surf_host = host->extension(); double start_time = this->last_updated; double finish_time = surf_get_clock(); double cpu_load; @@ -199,7 +199,7 @@ void HostEnergy::initWattsRangeList() /* **************************** events callback *************************** */ static void onCreation(simgrid::s4u::Host& host) { - simgrid::surf::HostImplem* surf_host = host.extension(); + simgrid::surf::HostImpl* surf_host = host.extension(); if (dynamic_cast(surf_host)) // Ignore virtual machines return; host.extension_set(new HostEnergy(&host)); @@ -207,10 +207,10 @@ static void onCreation(simgrid::s4u::Host& host) { static void onActionStateChange(simgrid::surf::CpuAction *action, e_surf_action_state_t previous) { const char *name = getActionCpu(action)->getName(); - simgrid::surf::HostImplem *host = sg_host_by_name(name)->extension(); + simgrid::surf::HostImpl *host = sg_host_by_name(name)->extension(); simgrid::surf::VirtualMachine *vm = dynamic_cast(host); if (vm) // If it's a VM, take the corresponding PM - host = vm->getPm()->extension(); + host = vm->getPm()->extension(); HostEnergy *host_energy = host->p_host->extension(); @@ -219,7 +219,7 @@ static void onActionStateChange(simgrid::surf::CpuAction *action, e_surf_action_ } static void onHostStateChange(simgrid::s4u::Host &host) { - simgrid::surf::HostImplem* surf_host = host.extension(); + simgrid::surf::HostImpl* surf_host = host.extension(); if (dynamic_cast(surf_host)) // Ignore virtual machines return; @@ -231,7 +231,7 @@ static void onHostStateChange(simgrid::s4u::Host &host) { static void onHostDestruction(simgrid::s4u::Host& host) { // Ignore virtual machines - simgrid::surf::HostImplem* surf_host = host.extension(); + simgrid::surf::HostImpl* surf_host = host.extension(); if (dynamic_cast(surf_host)) return; HostEnergy *host_energy = host.extension(); diff --git a/src/surf/plugins/energy.hpp b/src/surf/plugins/energy.hpp index d1ec557d8f..b854921247 100644 --- a/src/surf/plugins/energy.hpp +++ b/src/surf/plugins/energy.hpp @@ -10,7 +10,7 @@ #include -#include "src/surf/HostImplem.hpp" +#include "src/surf/HostImpl.hpp" #ifndef ENERGY_CALLBACK_HPP_ #define ENERGY_CALLBACK_HPP_ diff --git a/src/surf/ptask_L07.cpp b/src/surf/ptask_L07.cpp index 44d6b0cb14..5d5e099766 100644 --- a/src/surf/ptask_L07.cpp +++ b/src/surf/ptask_L07.cpp @@ -167,7 +167,7 @@ void HostL07Model::updateActionsState(double /*now*/, double delta) { while ((cnst = lmm_get_cnst_from_var(p_maxminSystem, action->getVariable(), i++))) { void *constraint_id = lmm_constraint_id(cnst); - if (static_cast(constraint_id)->isOff()) { + if (static_cast(constraint_id)->isOff()) { XBT_DEBUG("Action (%p) Failed!!", action); action->finish(); action->setState(SURF_ACTION_FAILED); diff --git a/src/surf/ptask_L07.hpp b/src/surf/ptask_L07.hpp index c53a2dd42d..74209dfd48 100644 --- a/src/surf/ptask_L07.hpp +++ b/src/surf/ptask_L07.hpp @@ -10,7 +10,7 @@ #include -#include "HostImplem.hpp" +#include "src/surf/HostImpl.hpp" #ifndef HOST_L07_HPP_ #define HOST_L07_HPP_ diff --git a/src/surf/sg_platf.cpp b/src/surf/sg_platf.cpp index 4a7b09a625..e3f704fe40 100644 --- a/src/surf/sg_platf.cpp +++ b/src/surf/sg_platf.cpp @@ -10,7 +10,7 @@ #include "xbt/dict.h" #include "xbt/RngStream.h" #include -#include "HostImplem.hpp" +#include "src/surf/HostImpl.hpp" #include "surf/surf.h" #include "src/simix/smx_private.h" diff --git a/src/surf/surf_c_bindings.cpp b/src/surf/surf_c_bindings.cpp index 66effb92d2..803c9349b1 100644 --- a/src/surf/surf_c_bindings.cpp +++ b/src/surf/surf_c_bindings.cpp @@ -4,7 +4,7 @@ /* 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. */ -#include "HostImplem.hpp" +#include "src/surf/HostImpl.hpp" #include "surf_interface.hpp" #include "network_interface.hpp" #include "surf_routing_cluster.hpp" @@ -18,12 +18,12 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_kernel); * TOOLS * *********/ -static simgrid::surf::HostImplem *get_casted_host(sg_host_t host){ //FIXME: killme - return host->extension(); +static simgrid::surf::HostImpl *get_casted_host(sg_host_t host){ //FIXME: killme + return host->extension(); } static simgrid::surf::VirtualMachine *get_casted_vm(sg_host_t host){ - return static_cast(host->extension()); + return static_cast(host->extension()); } extern double NOW; diff --git a/src/surf/surf_interface.cpp b/src/surf/surf_interface.cpp index 4b8196be5d..4537df7b67 100644 --- a/src/surf/surf_interface.cpp +++ b/src/surf/surf_interface.cpp @@ -8,7 +8,7 @@ #include "surf_interface.hpp" #include "network_interface.hpp" #include "cpu_interface.hpp" -#include "HostImplem.hpp" +#include "src/surf/HostImpl.hpp" #include "src/simix/smx_host_private.h" #include "surf_routing.hpp" #include "simgrid/sg_config.h" @@ -321,7 +321,7 @@ void surf_init(int *argc, char **argv) ROUTING_PROP_ASR_LEVEL = xbt_lib_add_level(as_router_lib,routing_asr_prop_free); XBT_DEBUG("Add SURF levels"); - simgrid::surf::HostImplem::classInit(); + simgrid::surf::HostImpl::classInit(); SURF_STORAGE_LEVEL = xbt_lib_add_level(storage_lib,surf_storage_free); xbt_init(argc, argv); diff --git a/src/surf/virtual_machine.cpp b/src/surf/virtual_machine.cpp index de4df13235..2bf24a304e 100644 --- a/src/surf/virtual_machine.cpp +++ b/src/surf/virtual_machine.cpp @@ -34,11 +34,11 @@ VMModel::vm_list_t VMModel::ws_vms; ************/ VirtualMachine::VirtualMachine(HostModel *model, const char *name, xbt_dict_t props, simgrid::s4u::Host *hostPM) -: HostImplem(model, name, props, NULL, NULL, NULL) +: HostImpl(model, name, props, NULL, NULL, NULL) , p_hostPM(hostPM) { VMModel::ws_vms.push_back(*this); - simgrid::s4u::Host::by_name_or_create(name)->extension_set(this); + simgrid::s4u::Host::by_name_or_create(name)->extension_set(this); } /* diff --git a/src/surf/virtual_machine.hpp b/src/surf/virtual_machine.hpp index 0ec2101dda..40395aba17 100644 --- a/src/surf/virtual_machine.hpp +++ b/src/surf/virtual_machine.hpp @@ -6,7 +6,7 @@ #include -#include "HostImplem.hpp" +#include "src/surf/HostImpl.hpp" #ifndef VM_INTERFACE_HPP_ #define VM_INTERFACE_HPP_ @@ -51,7 +51,7 @@ extern XBT_PRIVATE simgrid::xbt::signal VM * @brief SURF VM interface class * @details A VM represent a virtual machine */ -class VirtualMachine : public HostImplem { +class VirtualMachine : public HostImpl { public: /** * @brief Constructor diff --git a/src/surf/vm_hl13.cpp b/src/surf/vm_hl13.cpp index 1b534b49a9..e453e8a6d1 100644 --- a/src/surf/vm_hl13.cpp +++ b/src/surf/vm_hl13.cpp @@ -181,7 +181,7 @@ void VMHL13::restore() */ void VMHL13::migrate(sg_host_t host_dest) { - HostImplem *surfHost_dst = host_dest->extension(); + HostImpl *surfHost_dst = host_dest->extension(); const char *vm_name = getName(); const char *pm_name_src = p_hostPM->name().c_str(); const char *pm_name_dst = surfHost_dst->getName(); diff --git a/tools/cmake/DefinePackages.cmake b/tools/cmake/DefinePackages.cmake index 3b714dedb1..5f512d4db8 100644 --- a/tools/cmake/DefinePackages.cmake +++ b/tools/cmake/DefinePackages.cmake @@ -81,7 +81,7 @@ set(EXTRA_DIST src/surf/PropertyHolder.hpp src/surf/virtual_machine.hpp src/surf/host_clm03.hpp - src/surf/HostImplem.hpp + src/surf/HostImpl.hpp src/surf/ptask_L07.hpp src/xbt/automaton/automaton_lexer.yy.c src/xbt/automaton/parserPromela.lex @@ -337,7 +337,7 @@ set(SURF_SRC src/surf/vm_hl13.cpp src/surf/virtual_machine.cpp src/surf/host_clm03.cpp - src/surf/HostImplem.cpp + src/surf/HostImpl.cpp src/surf/ptask_L07.cpp src/xbt/xbt_sg_stubs.c ) -- 2.20.1