X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/c8997e63383c66e43ffde29d356fdddb65d65d81..a511865336e83ac3654632265ed00b8f0bf0eccc:/src/s4u/s4u_host.cpp diff --git a/src/s4u/s4u_host.cpp b/src/s4u/s4u_host.cpp index 642671a0c0..5020d7dc8b 100644 --- a/src/s4u/s4u_host.cpp +++ b/src/s4u/s4u_host.cpp @@ -11,19 +11,17 @@ #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" -#include "src/simix/smx_private.hpp" +#include "src/simix/smx_private.h" #include "src/surf/cpu_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 { @@ -45,6 +43,7 @@ Host::Host(const char* name) Host::~Host() { delete pimpl_cpu; + delete pimpl_netcard; delete mounts; } @@ -113,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::HostImplem* 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() { @@ -167,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); }); } @@ -186,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(); }); } @@ -198,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(); }); }