X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/53dd673a07059d04f7ee5c280470958856fdf8d8..bbf8aab8704722fb68397b9b1c15251e79efac6a:/src/s4u/s4u_host.cpp diff --git a/src/s4u/s4u_host.cpp b/src/s4u/s4u_host.cpp index 6dc1000459..8d5788d0ec 100644 --- a/src/s4u/s4u_host.cpp +++ b/src/s4u/s4u_host.cpp @@ -10,22 +10,18 @@ #include -#include - +#include "simgrid/simix.hpp" +#include "src/surf/HostImpl.hpp" #include "xbt/log.h" #include "src/msg/msg_private.h" #include "src/simix/smx_process_private.h" #include "src/simix/smx_private.hpp" #include "src/surf/cpu_interface.hpp" -#include "src/surf/host_interface.hpp" - #include "simgrid/s4u/host.hpp" #include "simgrid/s4u/storage.hpp" int MSG_HOST_LEVEL; -int SD_HOST_LEVEL; int SIMIX_HOST_LEVEL; -int ROUTING_HOST_LEVEL; int USER_HOST_LEVEL; namespace simgrid { @@ -47,6 +43,7 @@ Host::Host(const char* name) Host::~Host() { delete pimpl_cpu; + delete pimpl_netcard; delete mounts; } @@ -115,11 +112,23 @@ boost::unordered_map const& Host::mountedStorages() { /** Get the properties assigned to a host */ xbt_dict_t Host::properties() { return simgrid::simix::kernel([&] { - simgrid::surf::Host* surf_host = this->extension(); + simgrid::surf::HostImpl* surf_host = this->extension(); return surf_host->getProperties(); }); } +/** Retrieve the property value (or NULL if not set) */ +const char*Host::property(const char*key) { + simgrid::surf::HostImpl* surf_host = this->extension(); + return surf_host->getProperty(key); +} +void Host::setProperty(const char*key, const char *value){ + simgrid::simix::kernel([&] { + simgrid::surf::HostImpl* surf_host = this->extension(); + surf_host->setProperty(key,value); + }); +} + /** Get the processes attached to the host */ xbt_swag_t Host::processes() { @@ -169,14 +178,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); }); } @@ -188,7 +197,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(); }); } @@ -200,7 +209,7 @@ xbt_dict_t Host::mountedStoragesAsDict() xbt_dynar_t Host::attachedStorages() { return simgrid::simix::kernel([&] { - return this->extension()->getAttachedStorageList(); + return this->extension()->getAttachedStorageList(); }); }