: simgrid::s4u::Actor(procname,host,argc,argv){}
void show_info(boost::unordered_map <std::string, simgrid::s4u::Storage &> &mounts) {
- XBT_INFO("Storage info on %s:", simgrid::s4u::Host::current()->name());
+ XBT_INFO("Storage info on %s:",
+ simgrid::s4u::Host::current()->name().c_str());
for (const auto&kv : mounts) {
const char* mountpoint = kv.first.c_str();
+++ /dev/null
-/* Copyright (c) 2015. 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. */
-
-#ifndef SIMGRID_HOST_HPP
-#define SIMGRID_HOST_HPP
-
-#include <cstddef>
-#include <memory>
-#include <string>
-#include <vector>
-
-#include <xbt/base.h>
-#include <xbt/dict.h>
-#include <xbt/swag.h>
-#include <xbt/string.hpp>
-#include <xbt/signal.hpp>
-#include <xbt/Extendable.hpp>
-
-#include <simgrid/datatypes.h>
-
-namespace simgrid {
-
-XBT_PUBLIC_CLASS Host :
-public simgrid::xbt::Extendable<Host> {
-
-public:
- double getSpeed();
- int getCoreAmount();
-
- /* FIXME: these should be protected, but it leads to many errors */
- surf::Cpu *pimpl_cpu = nullptr;
- surf::NetCard *pimpl_netcard = nullptr;
-private:
- simgrid::xbt::string name_ = "noname";
-public:
- Host(std::string const& name);
- ~Host();
- simgrid::xbt::string const& getName() const { return name_; }
- void turnOn();
- void turnOff();
- bool isOn();
- bool isOff();
- xbt_dict_t getProperties();
- xbt_swag_t getProcessList();
- double getCurrentPowerPeak();
- double getPowerPeakAt(int pstate_index);
- void setPState(int pstate_index);
- int getPState();
- void getParams(vm_params_t params);
- void setParams(vm_params_t params);
- xbt_dict_t getMountedStorageList();
- xbt_dynar_t getAttachedStorageList();
-
- static Host* by_name_or_null(const char* name);
- static Host* by_name_or_create(const char* name);
-
- /*** Called on each newly created object */
- static simgrid::xbt::signal<void(Host&)> onCreation;
- /*** Called just before destructing an object */
- static simgrid::xbt::signal<void(Host&)> onDestruction;
- /*** Called when the machine is turned on or off */
- static simgrid::xbt::signal<void(Host&)> onStateChange;
-};
-
-}
-
-#endif
#ifdef __cplusplus
namespace simgrid {
-class Host;
+ namespace s4u {
+ class Host;
+ }
+ namespace surf {
+ class Cpu;
+ class NetCard;
+ class As;
+ class Link;
+ }
}
namespace simgrid {
-namespace surf {
-class Cpu;
-class NetCard;
-class As;
-class Link;
-
-}
}
-typedef simgrid::Host simgrid_Host;
+typedef simgrid::s4u::Host simgrid_Host;
typedef simgrid::surf::Cpu surf_Cpu;
typedef simgrid::surf::NetCard surf_NetCard;
typedef simgrid::surf::As surf_As;
#include <simgrid/forward.h>
#ifdef __cplusplus
-#include <simgrid/Host.hpp>
+#include <simgrid/s4u/host.hpp>
#endif
SG_BEGIN_DECL()
#include <boost/unordered_map.hpp>
#include <vector>
-#include "xbt/base.h"
-#include "simgrid/simix.h"
+#include <xbt/base.h>
+#include <xbt/string.hpp>
+#include <xbt/signal.hpp>
+#include <xbt/Extendable.hpp>
+
+#include <simgrid/simix.h>
+#include <simgrid/datatypes.h>
namespace simgrid {
namespace s4u {
* You can retrieve a particular host using @link{simgrid::s4u::Host.byName()},
* and actors can retrieve the host on which they run using @link{simgrid::s4u::Host.current()}.
*/
-XBT_PUBLIC_CLASS Host {
- friend Actor;
- friend File;
+XBT_PUBLIC_CLASS Host :
+ public simgrid::xbt::Extendable<Host> {
+
+ // friend Actor;
+ // friend File;
private:
Host(const char *name);
-protected:
+public: // TODO, make me private
~Host();
public:
/** Retrieves an host from its name. */
/** Retrieves the host on which the current actor is running */
static s4u::Host *current();
- const char* name();
+ static Host* by_name_or_null(const char* name);
+ static Host* by_name_or_create(const char* name);
+
+ simgrid::xbt::string const& name() const { return name_; }
/** Turns that host on if it was previously off
*
void turnOff();
/** Returns if that host is currently up and running */
bool isOn();
-
+ bool isOff() { return !isOn(); }
+
+ double getSpeed();
+ int getCoreAmount();
+ xbt_dict_t getProperties();
+ xbt_swag_t getProcessList();
+ double getCurrentPowerPeak();
+ double getPowerPeakAt(int pstate_index);
+ void setPState(int pstate_index);
+ int getNbPStates() const;
+ int getPState();
+ void getParams(vm_params_t params);
+ void setParams(vm_params_t params);
+ xbt_dict_t getMountedStorageList();
+ xbt_dynar_t getAttachedStorageList();
/** Allows to store user data on that host */
+ // TODO, use the extension stuff instead
void set_userdata(void *data) {p_userdata = data;}
/** Retrieves the previously stored data */
void* userdata() {return p_userdata;}
*
* Do not change the returned value in any way.
*/
+ // TODO, do not use Storage&, this looks dangerous!
boost::unordered_map<std::string, Storage&> &mountedStorages();
+
private:
+ simgrid::xbt::string name_ = "noname";
boost::unordered_map<std::string, Storage&> *mounts = NULL; // caching
+ void* p_userdata = NULL;
-protected:
- sg_host_t inferior() {return p_inferior;}
-private:
- void*p_userdata=NULL;
- sg_host_t p_inferior;
+public:
+ // FIXME: these should be protected, but it leads to many errors
+ // Use the extensions stuff for this? Go through simgrid::surf::Host?
+ surf::Cpu *pimpl_cpu = nullptr;
+ surf::NetCard *pimpl_netcard = nullptr;
+
+public:
static boost::unordered_map<std::string, s4u::Host *> *hosts;
+
+ /*** Called on each newly created object */
+ static simgrid::xbt::signal<void(Host&)> onCreation;
+ /*** Called just before destructing an object */
+ static simgrid::xbt::signal<void(Host&)> onDestruction;
+ /*** Called when the machine is turned on or off */
+ static simgrid::xbt::signal<void(Host&)> onStateChange;
};
}} // namespace simgrid::s4u
+extern int MSG_HOST_LEVEL;
+extern int SD_HOST_LEVEL;
+extern int SIMIX_HOST_LEVEL;
+extern int ROUTING_HOST_LEVEL;
+extern int USER_HOST_LEVEL;
+
#endif /* SIMGRID_S4U_HOST_HPP */
#if 0
MSG_init(&argc, argv);
- JAVA_HOST_LEVEL = simgrid::Host::extension_create(__JAVA_host_priv_free);
+ JAVA_HOST_LEVEL = simgrid::s4u::Host::extension_create(__JAVA_host_priv_free);
JAVA_STORAGE_LEVEL = xbt_lib_add_level(storage_lib, __JAVA_storage_priv_free);
for (index = 0; index < argc; index++)
simgrid::mc::Process* process = &mc_model_checker->process();
- /* Horrible hack to find the offset of the id in the simgrid::Host.
+ /* Horrible hack to find the offset of the id in the simgrid::s4u::Host.
Offsetof is not supported for non-POD types but this should
work in pratice for the targets currently supported by the MC
(such as virtual base).
We are using a (C++11) unrestricted union in order to avoid
- any construction/destruction of the simgrid::Host.
+ any construction/destruction of the simgrid::s4u::Host.
*/
union fake_host {
- simgrid::Host host;
+ simgrid::s4u::Host host;
fake_host() {}
~fake_host() {}
};
SIMIX_function_register_process_cleanup(MSG_process_cleanup_from_SIMIX);
sg_platf_postparse_add_cb(MSG_post_create_environment);
- simgrid::Host::onCreation.connect([](simgrid::Host& host) {
+ simgrid::s4u::Host::onCreation.connect([](simgrid::s4u::Host& host) {
MSG_host_create_(&host);
});
}
#include "xbt/sysdep.h"
#include "xbt/log.h"
#include "simgrid/simix.h"
-#include "simgrid/Host.hpp"
+#include <simgrid/s4u/host.hpp>
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(msg);
*/
msg_host_t MSG_host_by_name(const char *name)
{
- return simgrid::Host::by_name_or_null(name);
+ return simgrid::s4u::Host::by_name_or_null(name);
}
/** \ingroup m_host_management
xbt_lib_cursor_t cursor;
const char *id;
- simgrid::Host* host;
+ simgrid::s4u::Host* host;
xbt_dict_foreach(host_list, cursor, id, host)
if(routing_get_network_element_type(key) == SURF_NETWORK_ELEMENT_HOST)
array[i++] = host->facet(MSG_HOST_LEVEL);
{
/* make sure the VM of the same name does not exit */
{
- simgrid::Host* ind_host_tmp =
- (simgrid::Host*) xbt_dict_get_or_null(host_list, name);
+ simgrid::s4u::Host* ind_host_tmp =
+ (simgrid::s4u::Host*) xbt_dict_get_or_null(host_list, name);
if (ind_host_tmp != nullptr && sg_host_simix(ind_host_tmp) != nullptr) {
XBT_ERROR("host %s already exits", name);
return nullptr;
: s4u::Actor::Actor(name,host, argc,argv, -1) {
}
s4u::Actor::Actor(const char *name, s4u::Host *host, int argc, char **argv, double killTime) {
- p_smx_process = simcall_process_create(name, s4u_actor_runner, this, host->name(), killTime, argc, argv, NULL/*properties*/,0);
+ p_smx_process = simcall_process_create(name, s4u_actor_runner, this, host->name().c_str(), killTime, argc, argv, NULL/*properties*/,0);
xbt_assert(p_smx_process,"Cannot create the actor");
// TRACE_msg_process_create(procname, simcall_process_get_PID(p_smx_process), host->getInferior());
File::File(const char*fullpath, void *userdata) {
// this cannot fail because we get a xbt_die if the mountpoint does not exist
- p_inferior = simcall_file_open(fullpath, Host::current()->inferior());
+ p_inferior = simcall_file_open(fullpath, Host::current());
p_path = fullpath;
}
File::~File() {
- simcall_file_close(p_inferior, Host::current()->inferior());
+ simcall_file_close(p_inferior, Host::current());
}
sg_size_t File::read(sg_size_t size) {
- return simcall_file_read(p_inferior, size, Host::current()->inferior());
+ return simcall_file_read(p_inferior, size, Host::current());
}
sg_size_t File::write(sg_size_t size) {
- return simcall_file_write(p_inferior,size, Host::current()->inferior());
+ return simcall_file_write(p_inferior,size, Host::current());
}
sg_size_t File::size() {
return simcall_file_get_size(p_inferior);
simcall_file_move(p_inferior,fullpath);
}
void File::unlink() {
- sg_host_t attached = Host::current()->inferior(); // FIXME: we should check where this file is attached
+ sg_host_t attached = Host::current(); // FIXME: we should check where this file is attached
simcall_file_unlink(p_inferior,attached);
}
/* 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 <string>
+#include <functional>
+#include <stdexcept>
+
+#include <unordered_map>
+
+#include <simgrid/simix.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 {
namespace s4u {
boost::unordered_map<std::string, Host*> *Host::hosts
= new boost::unordered_map<std::string, Host*>();
-Host::Host(const char*name)
+simgrid::xbt::signal<void(Host&)> Host::onCreation;
+simgrid::xbt::signal<void(Host&)> Host::onDestruction;
+simgrid::xbt::signal<void(Host&)> Host::onStateChange;
+
+Host::Host(const char* name)
+ : name_(name)
{
- p_inferior = sg_host_by_name(name);
- if (p_inferior==NULL)
- xbt_die("No such host: %s",name); //FIXME: raise an exception
}
+
Host::~Host() {
if (mounts != NULL)
delete mounts;
}
Host *Host::byName(std::string name) {
- Host * res = NULL;
- try {
- res = hosts->at(name);
- } catch (std::out_of_range& e) {}
-
- if (res==NULL) {
- res = new Host(name.c_str());
- hosts->insert({name,res});
- }
- return res;
+ Host* host = Host::by_name_or_null(name.c_str());
+ // TODO, raise an exception instead?
+ if (host == nullptr)
+ xbt_die("No such host: %s", name.c_str());
+ return host;
}
+
Host *Host::current(){
smx_process_t smx_proc = SIMIX_process_self();
if (smx_proc == NULL)
xbt_die("Cannot call Host::current() from the maestro context");
-
- return Host::byName(sg_host_get_name(SIMIX_process_get_host(smx_proc)));
-}
-
-const char* Host::name() {
- return sg_host_get_name(p_inferior);
+ return SIMIX_process_get_host(smx_proc);
}
void Host::turnOn() {
- p_inferior->turnOn();
+ simgrid::simix::kernel(std::bind(SIMIX_host_on, this));
}
+
void Host::turnOff() {
- p_inferior->turnOff();
+ simgrid::simix::simcall<void>(SIMCALL_HOST_OFF, this);
}
+
bool Host::isOn() {
- return sg_host_is_on(p_inferior);
+ return this->pimpl_cpu->isOn();
+}
+
+int Host::getNbPStates() const {
+ return this->pimpl_cpu->getNbPStates();
}
boost::unordered_map<std::string, Storage&> &Host::mountedStorages() {
if (mounts == NULL) {
mounts = new boost::unordered_map<std::string, Storage&> ();
- xbt_dict_t dict = p_inferior->getMountedStorageList();
+ xbt_dict_t dict = this->getMountedStorageList();
xbt_dict_cursor_t cursor;
char *mountname;
return *mounts;
}
+/** Get the properties assigned to a host */
+xbt_dict_t Host::getProperties() {
+ return simgrid::simix::kernel([&] {
+ simgrid::surf::Host* surf_host = this->extension<simgrid::surf::Host>();
+ return surf_host->getProperties();
+ });
+}
+
+/** Get the processes attached to the host */
+xbt_swag_t Host::getProcessList()
+{
+ return simgrid::simix::kernel([&]() {
+ return ((smx_host_priv_t)this->extension(SIMIX_HOST_LEVEL))->process_list;
+ });
+}
+
+/** Get the peak power of a host */
+double Host::getCurrentPowerPeak()
+{
+ return simgrid::simix::kernel([&] {
+ return this->pimpl_cpu->getCurrentPowerPeak();
+ });
+}
+
+/** Get one power peak (in flops/s) of a host at a given pstate */
+double Host::getPowerPeakAt(int pstate_index)
+{
+ return simgrid::simix::kernel([&] {
+ return this->pimpl_cpu->getPowerPeakAt(pstate_index);
+ });
+}
+
+/** @brief Get the speed of the cpu associated to a host */
+double Host::getSpeed() {
+ return pimpl_cpu->getSpeed(1.0);
+}
+/** @brief Returns the number of core of the processor. */
+int Host::getCoreAmount() {
+ return pimpl_cpu->getCore();
+}
+
+Host* Host::by_name_or_null(const char* name)
+{
+ return (Host*) xbt_dict_get_or_null(host_list, name);
+}
+
+Host* Host::by_name_or_create(const char* name)
+{
+ Host* host = by_name_or_null(name);
+ if (host == nullptr) {
+ host = new Host(name);
+ xbt_dict_set(host_list, name, host, NULL);
+ }
+ return host;
+}
+
+/** @brief Set the pstate at which the host should run */
+void Host::setPState(int pstate_index)
+{
+ simgrid::simix::kernel(std::bind(
+ &simgrid::surf::Cpu::setPState, pimpl_cpu, pstate_index
+ ));
+}
+/** @brief Retrieve the pstate at which the host is currently running */
+int Host::getPState()
+{
+ return pimpl_cpu->getPState();
+}
+
+void Host::getParams(vm_params_t params)
+{
+ simgrid::simix::kernel([&]() {
+ this->extension<simgrid::surf::Host>()->getParams(params);
+ });
+}
+
+void Host::setParams(vm_params_t params)
+{
+ simgrid::simix::kernel([&]() {
+ this->extension<simgrid::surf::Host>()->setParams(params);
+ });
+}
+
+/**
+ * \ingroup simix_storage_management
+ * \brief Returns the list of storages mounted on an host.
+ * \return a dict containing all storages mounted on the host
+ */
+xbt_dict_t Host::getMountedStorageList()
+{
+ return simgrid::simix::kernel([&] {
+ return this->extension<simgrid::surf::Host>()->getMountedStorageList();
+ });
+}
+
+/**
+ * \ingroup simix_storage_management
+ * \brief Returns the list of storages attached to an host.
+ * \return a dict containing all storages attached to the host
+ */
+xbt_dynar_t Host::getAttachedStorageList()
+{
+ return simgrid::simix::kernel([&] {
+ return this->extension<simgrid::surf::Host>()->getAttachedStorageList();
+ });
+}
} // namespace simgrid
} // namespace s4u
#include "src/surf/host_interface.hpp"
#include "src/simdag/simdag_private.h"
#include "simgrid/simdag.h"
-#include "simgrid/Host.hpp"
+#include <simgrid/s4u/host.hpp>
#include "xbt/dict.h"
#include "xbt/lib.h"
#include "xbt/sysdep.h"
/* 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 <simgrid/simix.hpp>
-
#include "xbt/dict.h"
#include "simgrid/host.h"
-#include "simgrid/Host.hpp"
+#include <xbt/Extendable.hpp>
+#include <simgrid/s4u/host.hpp>
#include "surf/surf.h" // routing_get_network_element_type FIXME:killme
#include "src/simix/smx_private.hpp"
const char *sg_host_get_name(sg_host_t host)
{
- return host->getName().c_str();
+ return host->name().c_str();
}
void* sg_host_extension_get(sg_host_t host, size_t ext)
size_t sg_host_extension_create(void(*deleter)(void*))
{
- return simgrid::Host::extension_create(deleter);
+ return simgrid::s4u::Host::extension_create(deleter);
}
sg_host_t sg_host_by_name(const char *name)
{
- return simgrid::Host::by_name_or_null(name);
+ return simgrid::s4u::Host::by_name_or_null(name);
}
sg_host_t sg_host_by_name_or_create(const char *name)
{
- return simgrid::Host::by_name_or_create(name);
+ return simgrid::s4u::Host::by_name_or_create(name);
}
xbt_dynar_t sg_hosts_as_dynar(void)
xbt_dict_cursor_t cursor = nullptr;
const char* name = nullptr;
- simgrid::Host* host = nullptr;
+ simgrid::s4u::Host* host = nullptr;
xbt_dict_foreach(host_list, cursor, name, host)
if(routing_get_network_element_type(name) == SURF_NETWORK_ELEMENT_HOST)
xbt_dynar_push(res, &host);
return res;
}
-// ========= Layering madness ==============
-
-int MSG_HOST_LEVEL;
-int SD_HOST_LEVEL;
-int SIMIX_HOST_LEVEL;
-int ROUTING_HOST_LEVEL;
-int USER_HOST_LEVEL;
+// ========= Layering madness ==============*
#include "src/msg/msg_private.h" // MSG_host_priv_free. FIXME: killme by initializing that level in msg when used
#include "src/simdag/simdag_private.h" // __SD_workstation_destroy. FIXME: killme by initializing that level in simdag when used
void sg_host_init()
{
- MSG_HOST_LEVEL = simgrid::Host::extension_create([](void *p) {
+ MSG_HOST_LEVEL = simgrid::s4u::Host::extension_create([](void *p) {
__MSG_host_priv_free((msg_host_priv_t) p);
});
- ROUTING_HOST_LEVEL = simgrid::Host::extension_create([](void *p) {
+ ROUTING_HOST_LEVEL = simgrid::s4u::Host::extension_create([](void *p) {
delete static_cast<simgrid::surf::NetCard*>(p);
});
- SD_HOST_LEVEL = simgrid::Host::extension_create(__SD_workstation_destroy);
- SIMIX_HOST_LEVEL = simgrid::Host::extension_create(SIMIX_host_destroy);
- USER_HOST_LEVEL = simgrid::Host::extension_create(NULL);
+ SD_HOST_LEVEL = simgrid::s4u::Host::extension_create(__SD_workstation_destroy);
+ SIMIX_HOST_LEVEL = simgrid::s4u::Host::extension_create(SIMIX_host_destroy);
+ USER_HOST_LEVEL = simgrid::s4u::Host::extension_create(NULL);
}
// ========== User data Layer ==========
* @return 1 if the host is active or 0 if it has crashed.
*/
int sg_host_is_on(sg_host_t host) {
- return host->pimpl_cpu->isOn();
+ return host->isOn();
}
/** @brief Returns the number of power states for a host.
* See also @ref SURF_plugin_energy.
*/
int sg_host_get_nb_pstates(sg_host_t host) {
- return host->pimpl_cpu->getNbPStates();
+ return host->getNbPStates();
}
/** @brief Gets the pstate at which that host currently runs.
return host->getProperties();
}
-
-namespace simgrid {
-
-simgrid::xbt::signal<void(Host&)> Host::onCreation;
-simgrid::xbt::signal<void(Host&)> Host::onDestruction;
-simgrid::xbt::signal<void(Host&)> Host::onStateChange;
-
-Host::Host(std::string const& id)
- : name_(id)
-{
-}
-
-Host::~Host()
-{
-}
-
-/** Start the host if it is off */
-void Host::turnOn()
-{
- simgrid::simix::kernel(std::bind(SIMIX_host_on, this));
-}
-
-/** Stop the host if it is on */
-void Host::turnOff()
-{
- simgrid::simix::simcall<void>(SIMCALL_HOST_OFF, this);
-}
-
-bool Host::isOn() {
- return pimpl_cpu->isOn();
-}
-bool Host::isOff() {
- return ! pimpl_cpu->isOn();
-}
-
-
-/** Get the properties assigned to a host */
-xbt_dict_t Host::getProperties()
-{
- return simgrid::simix::kernel(std::bind(&simgrid::surf::Host::getProperties, this->extension(simgrid::surf::Host::EXTENSION_ID)));
-}
-
-/** Get the processes attached to the host */
-xbt_swag_t Host::getProcessList()
-{
- return simgrid::simix::kernel([&]() {
- return ((smx_host_priv_t)this->extension(SIMIX_HOST_LEVEL))->process_list;
- });
-}
-
-/** Get the peak power of a host */
-double Host::getCurrentPowerPeak()
-{
- return simgrid::simix::kernel([&] {
- return this->pimpl_cpu->getCurrentPowerPeak();
- });
-}
-
-/** Get one power peak (in flops/s) of a host at a given pstate */
-double Host::getPowerPeakAt(int pstate_index)
-{
- return simgrid::simix::kernel([&] {
- return this->pimpl_cpu->getPowerPeakAt(pstate_index);
- });
-}
-
-/** @brief Get the speed of the cpu associated to a host */
-double Host::getSpeed() {
- return pimpl_cpu->getSpeed(1.0);
-}
-/** @brief Returns the number of core of the processor. */
-int Host::getCoreAmount() {
- return pimpl_cpu->getCore();
-}
-
-Host* Host::by_name_or_null(const char* name)
-{
- return (Host*) xbt_dict_get_or_null(host_list, name);
-}
-
-Host* Host::by_name_or_create(const char* name)
-{
- Host* host = by_name_or_null(name);
- if (host == nullptr) {
- host = new Host(name);
- xbt_dict_set(host_list, name, host, NULL);
- }
- return host;
-}
-
-/** @brief Set the pstate at which the host should run */
-void Host::setPState(int pstate_index)
-{
- simgrid::simix::kernel(std::bind(
- &simgrid::surf::Cpu::setPState, pimpl_cpu, pstate_index
- ));
-}
-/** @brief Retrieve the pstate at which the host is currently running */
-int Host::getPState()
-{
- return pimpl_cpu->getPState();
-}
-
-void Host::getParams(vm_params_t params)
-{
- simgrid::simix::kernel([&]() {
- this->extension<simgrid::surf::Host>()->getParams(params);
- });
-}
-
-void Host::setParams(vm_params_t params)
-{
- simgrid::simix::kernel([&]() {
- this->extension<simgrid::surf::Host>()->setParams(params);
- });
-}
-
-/**
- * \ingroup simix_storage_management
- * \brief Returns the list of storages mounted on an host.
- * \return a dict containing all storages mounted on the host
- */
-xbt_dict_t Host::getMountedStorageList()
-{
- return simgrid::simix::kernel([&] {
- return this->extension<simgrid::surf::Host>()->getMountedStorageList();
- });
-}
-
-/**
- * \ingroup simix_storage_management
- * \brief Returns the list of storages attached to an host.
- * \return a dict containing all storages attached to the host
- */
-xbt_dynar_t Host::getAttachedStorageList()
-{
- return simgrid::simix::kernel([&] {
- return this->extension<simgrid::surf::Host>()->getAttachedStorageList();
- });
-}
-
-}
/* register a function to be called by SURF after the environment creation */
sg_platf_init();
sg_platf_postparse_add_cb(SIMIX_post_create_environment);
- simgrid::Host::onCreation.connect([](simgrid::Host& host) {
+ simgrid::s4u::Host::onCreation.connect([](simgrid::s4u::Host& host) {
SIMIX_host_create(&host);
});
surf_on_storage_created(SIMIX_storage_create_);
}
}
} else {
- XBT_INFO("Host %s is already off",h->getName().c_str());
+ XBT_INFO("Host %s is already off",h->name().c_str());
}
}
delete p_cpuRunningActionSetThatDoesNotNeedBeingChecked;
}
-Cpu *CpuCas01Model::createCpu(simgrid::Host *host, xbt_dynar_t speedPeak,
+Cpu *CpuCas01Model::createCpu(simgrid::s4u::Host *host, xbt_dynar_t speedPeak,
int pstate, double speedScale,
tmgr_trace_t speedTrace, int core,
int initiallyOn,
/************
* Resource *
************/
-CpuCas01::CpuCas01(CpuCas01Model *model, simgrid::Host *host, xbt_dynar_t speedPeak,
+CpuCas01::CpuCas01(CpuCas01Model *model, simgrid::s4u::Host *host, xbt_dynar_t speedPeak,
int pstate, double speedScale, tmgr_trace_t speedTrace, int core,
int initiallyOn, tmgr_trace_t stateTrace)
: Cpu(model, host,
CpuCas01Model();
~CpuCas01Model();
- Cpu *createCpu(simgrid::Host *host, xbt_dynar_t speedPeak, int pstate,
+ Cpu *createCpu(simgrid::s4u::Host *host, xbt_dynar_t speedPeak, int pstate,
double speedScale,
tmgr_trace_t speedTrace, int core,
int initiallyOn,
class CpuCas01 : public Cpu {
public:
- CpuCas01(CpuCas01Model *model, simgrid::Host *host, xbt_dynar_t speedPeak,
+ CpuCas01(CpuCas01Model *model, simgrid::s4u::Host *host, xbt_dynar_t speedPeak,
int pstate, double speedScale, tmgr_trace_t speedTrace, int core,
int initiallyOn, tmgr_trace_t stateTrace) ;
~CpuCas01();
/************
* Resource *
************/
-Cpu::Cpu(Model *model, simgrid::Host *host,
+Cpu::Cpu(Model *model, simgrid::s4u::Host *host,
xbt_dynar_t speedPeakList, int pstate,
int core, double speedPeak, double speedScale,
int initiallyOn)
{
}
-Cpu::Cpu(Model *model, simgrid::Host *host, lmm_constraint_t constraint,
+Cpu::Cpu(Model *model, simgrid::s4u::Host *host, lmm_constraint_t constraint,
xbt_dynar_t speedPeakList, int pstate,
int core, double speedPeak,
double speedScale, int initiallyOn)
- : Resource(model, host->getName().c_str(), constraint, initiallyOn)
+ : Resource(model, host->name().c_str(), constraint, initiallyOn)
, m_core(core)
, m_speedPeak(speedPeak)
, m_speedScale(speedScale)
int i;
for (i = 0; i < core; i++) {
/* just for a unique id, never used as a string. */
- p_constraintCoreId[i] = bprintf("%s:%i", host->getName().c_str(), i);
+ p_constraintCoreId[i] = bprintf("%s:%i", host->name().c_str(), i);
p_constraintCore[i] = lmm_constraint_new(model->getMaxminSystem(), p_constraintCoreId[i], m_speedScale * m_speedPeak);
}
}
* @param state_initial [TODO]
* @param state_trace [TODO]
*/
- virtual Cpu *createCpu(simgrid::Host *host, xbt_dynar_t speedPeak,
- int pstate, double speedScale,
+ virtual Cpu *createCpu(simgrid::s4u::Host *host, xbt_dynar_t speedPeak,
+ int pstate, double speedScale,
tmgr_trace_t speedTrace, int core,
int initiallyOn,
tmgr_trace_t state_trace)=0;
* @param speedScale The speed scale of this Cpu in [0;1] (available amount)
* @param stateInitial whether it is created running or crashed
*/
- Cpu(simgrid::surf::Model *model, simgrid::Host *host, lmm_constraint_t constraint,
+ Cpu(simgrid::surf::Model *model, simgrid::s4u::Host *host,
+ lmm_constraint_t constraint,
xbt_dynar_t speedPeakList, int pstate,
int core, double speedPeak, double speedScale,
int initiallyOn);
* @param speedScale The speed scale of this Cpu in [0;1] (available amount)
* @param stateInitial whether it is created running or crashed
*/
- Cpu(simgrid::surf::Model *model, simgrid::Host *host,
+ Cpu(simgrid::surf::Model *model, simgrid::s4u::Host *host,
xbt_dynar_t speedPeakList, int pstate,
int core, double speedPeak, double speedScale,
int initiallyOn);
virtual int getPState();
void addTraces(void);
- simgrid::Host* getHost() { return m_host; }
+ simgrid::s4u::Host* getHost() { return m_host; }
public:
int m_core = 1; /* Amount of cores */
double m_speedPeak; /*< CPU speed peak, ie max value */
double m_speedScale; /*< Percentage of CPU available according to the trace, in [O,1] */
- simgrid::Host* m_host;
+ simgrid::s4u::Host* m_host;
xbt_dynar_t p_speedPeakList = NULL; /*< List of supported CPU capacities (pstate related) */
int m_pstate = 0; /*< Current pstate (index in the speedPeakList)*/
xbt_heap_free(p_tiActionHeap);
}
-Cpu *CpuTiModel::createCpu(simgrid::Host *host,
+Cpu *CpuTiModel::createCpu(simgrid::s4u::Host *host,
xbt_dynar_t speedPeak,
int pstate,
double speedScale,
/************
* Resource *
************/
-CpuTi::CpuTi(CpuTiModel *model, simgrid::Host *host, xbt_dynar_t speedPeak,
+CpuTi::CpuTi(CpuTiModel *model, simgrid::s4u::Host *host, xbt_dynar_t speedPeak,
int pstate, double speedScale, tmgr_trace_t speedTrace, int core,
int initiallyOn, tmgr_trace_t stateTrace)
: Cpu(model, host, NULL, pstate, core, 0, speedScale, initiallyOn)
************/
class CpuTi : public Cpu {
public:
- CpuTi(CpuTiModel *model, simgrid::Host *host, xbt_dynar_t speedPeak,
+ CpuTi(CpuTiModel *model, simgrid::s4u::Host *host, xbt_dynar_t speedPeak,
int pstate, double speedScale, tmgr_trace_t speedTrace, int core,
int initiallyOn, tmgr_trace_t stateTrace) ;
~CpuTi();
public:
CpuTiModel();
~CpuTiModel();
- Cpu *createCpu(simgrid::Host *host, xbt_dynar_t speedPeak,
+ Cpu *createCpu(simgrid::s4u::Host *host, xbt_dynar_t speedPeak,
int pstate, double speedScale,
tmgr_trace_t speedTrace, int core,
int initiallyOn,
#include "host_interface.hpp"
-#include <simgrid/Host.hpp>
+#include <simgrid/s4u/host.hpp>
#include "src/simix/smx_private.h"
#include "cpu_cas01.hpp"
namespace simgrid {
namespace surf {
-simgrid::xbt::Extension<simgrid::Host, Host> Host::EXTENSION_ID;
+simgrid::xbt::Extension<simgrid::s4u::Host, Host> Host::EXTENSION_ID;
/*********
* Model *
void Host::classInit()
{
if (!EXTENSION_ID.valid()) {
- EXTENSION_ID = simgrid::Host::extension_create<simgrid::surf::Host>();
+ EXTENSION_ID = simgrid::s4u::Host::extension_create<simgrid::surf::Host>();
}
}
{
}
-void Host::attach(simgrid::Host* host)
+void Host::attach(simgrid::s4u::Host* host)
{
if (p_host != nullptr)
- xbt_die("Already attached to host %s", host->getName().c_str());
+ xbt_die("Already attached to host %s", host->name().c_str());
host->extension_set(this);
p_host = host;
}
void Host::turnOn(){
if (isOff()) {
p_cpu->turnOn();
- simgrid::Host::onStateChange(*this->p_host);
+ simgrid::s4u::Host::onStateChange(*this->p_host);
}
}
void Host::turnOff(){
if (isOn()) {
p_cpu->turnOff();
- simgrid::Host::onStateChange(*this->p_host);
+ simgrid::s4u::Host::onStateChange(*this->p_host);
}
}
public simgrid::surf::Resource,
public simgrid::surf::PropertyHolder {
public:
- static simgrid::xbt::Extension<simgrid::Host, Host> EXTENSION_ID;
+ static simgrid::xbt::Extension<simgrid::s4u::Host, Host> EXTENSION_ID;
public:
static void classInit(); // must be called before the first use of that class
{
return static_cast<HostModel*>(Resource::getModel());
}
- void attach(simgrid::Host* host);
+ void attach(simgrid::s4u::Host* host);
bool isOn() override;
bool isOff() override;
public:
xbt_dynar_t p_storage;
Cpu *p_cpu;
- simgrid::Host* p_host = nullptr;
+ simgrid::s4u::Host* p_host = nullptr;
/** @brief Get the list of virtual machines on the current Host */
xbt_dynar_t getVms();
void getParams(vm_params_t params);
/** @brief Sets the params of that VM/PM */
void setParams(vm_params_t params);
- simgrid::Host* getHost() { return p_host; }
+ simgrid::s4u::Host* getHost() { return p_host; }
private:
s_vm_params_t p_params;
};
return res;
}
-Cpu *CpuL07Model::createCpu(simgrid::Host *host, xbt_dynar_t powerPeakList,
+Cpu *CpuL07Model::createCpu(simgrid::s4u::Host *host, xbt_dynar_t powerPeakList,
int pstate, double power_scale,
tmgr_trace_t power_trace, int core,
int initiallyOn,
* Resource *
************/
-CpuL07::CpuL07(CpuL07Model *model, simgrid::Host *host,
+CpuL07::CpuL07(CpuL07Model *model, simgrid::s4u::Host *host,
xbt_dynar_t speedPeakList, int pstate,
double speedScale, tmgr_trace_t speedTrace,
int core, int initiallyOn, tmgr_trace_t state_trace)
CpuL07Model(HostL07Model *hmodel,lmm_system_t sys);
~CpuL07Model();
- Cpu *createCpu(simgrid::Host *host, xbt_dynar_t speedPeakList,
+ Cpu *createCpu(simgrid::s4u::Host *host, xbt_dynar_t speedPeakList,
int pstate, double speedScale,
tmgr_trace_t speedTrace, int core,
int initiallyOn,
tmgr_trace_event_t p_stateEvent;
tmgr_trace_event_t p_speedEvent;
public:
- CpuL07(CpuL07Model *model, simgrid::Host *host, xbt_dynar_t speedPeakList, int pstate,
+ CpuL07(CpuL07Model *model, simgrid::s4u::Host *host, xbt_dynar_t speedPeakList, int pstate,
double power_scale, tmgr_trace_t power_trace,
int core, int initiallyOn, tmgr_trace_t state_trace);
~CpuL07();
routing_model_create(NULL);
- simgrid::Host::onCreation.connect([](simgrid::Host&) {
+ simgrid::s4u::Host::onCreation.connect([](simgrid::s4u::Host&) {
host_number_int++;
});
sg_platf_link_add_cb(netcste_parse_nolink);
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(surf_network);
-static void IB_create_host_callback(simgrid::Host& host){
+static void IB_create_host_callback(simgrid::s4u::Host& host){
using namespace simgrid::surf;
static int id=0;
id++;
xbt_dict_set(((NetworkIBModel*)surf_network_model)->active_nodes,
- host.getName().c_str(), act, NULL);
+ host.name().c_str(), act, NULL);
}
xbt_dynar_push(all_existing_models, &surf_network_model);
networkActionStateChangedCallbacks.connect(IB_action_state_changed_callback);
networkCommunicateCallbacks.connect(IB_action_init_callback);
- simgrid::Host::onCreation.connect(IB_create_host_callback);
+ simgrid::s4u::Host::onCreation.connect(IB_create_host_callback);
xbt_cfg_setdefault_double(_sg_cfg_set, "network/weight_S", 8775);
}
start = surf_parse_get_int(xbt_dynar_get_as(radical_ends, 0, char *));
xbt_dynar_push_as(tab_elements_num, int, start);
router_id = bprintf("ns3_%s%d%s", cluster_prefix, start, cluster_suffix);
- simgrid::Host::by_name_or_create(router_id)
+ simgrid::s4u::Host::by_name_or_create(router_id)
->extension_set(NS3_EXTENSION_ID, ns3_add_host_cluster(router_id));
XBT_DEBUG("NS3_ADD_ROUTER '%s'",router_id);
free(router_id);
for (i = start; i <= end; i++){
xbt_dynar_push_as(tab_elements_num, int, i);
router_id = bprintf("ns3_%s%d%s", cluster_prefix, i, cluster_suffix);
- simgrid::Host::by_name_or_create(router_id)
+ simgrid::s4u::Host::by_name_or_create(router_id)
->extension_set(NS3_EXTENSION_ID, ns3_add_host_cluster(router_id));
XBT_DEBUG("NS3_ADD_ROUTER '%s'",router_id);
free(router_id);
routing_model_create(NULL);
define_callbacks_ns3();
- NS3_EXTENSION_ID = simgrid::Host::extension_create(free_ns3_host);
+ NS3_EXTENSION_ID = simgrid::s4u::Host::extension_create(free_ns3_host);
NS3_ASR_LEVEL = xbt_lib_add_level(as_router_lib, free_ns3_host);
}
#include "xbt/sysdep.h"
#include <xbt/Extendable.hpp>
-#include <simgrid/Host.hpp>
+#include <simgrid/s4u/host.hpp>
#include <surf/surf_routing.h>
typedef enum {
namespace simgrid {
namespace energy {
-simgrid::xbt::Extension<simgrid::Host, HostEnergy> HostEnergy::EXTENSION_ID;
+simgrid::xbt::Extension<simgrid::s4u::Host, HostEnergy> HostEnergy::EXTENSION_ID;
/* Computes the consumption so far. Called lazily on need. */
void HostEnergy::update()
surf_host->getName(), start_time, finish_time, surf_host->p_cpu->m_speedPeak, previous_energy, energy_this_step);
}
-HostEnergy::HostEnergy(simgrid::Host *ptr) :
+HostEnergy::HostEnergy(simgrid::s4u::Host *ptr) :
host(ptr), last_updated(surf_get_clock())
{
initWattsRangeList();
double HostEnergy::getWattMinAt(int pstate)
{
xbt_assert(!power_range_watts_list.empty(),
- "No power range properties specified for host %s", host->getName().c_str());
+ "No power range properties specified for host %s", host->name().c_str());
return power_range_watts_list[pstate].first;
}
double HostEnergy::getWattMaxAt(int pstate)
{
xbt_assert(!power_range_watts_list.empty(),
- "No power range properties specified for host %s", host->getName().c_str());
+ "No power range properties specified for host %s", host->name().c_str());
return power_range_watts_list[pstate].second;
}
double HostEnergy::getCurrentWattsValue(double cpu_load)
{
xbt_assert(!power_range_watts_list.empty(),
- "No power range properties specified for host %s", host->getName().c_str());
+ "No power range properties specified for host %s", host->name().c_str());
/* min_power corresponds to the idle power (cpu load = 0) */
/* max_power is the power consumed at 100% cpu load */
xbt_assert(xbt_dynar_length(current_power_values) > 1,
"Power properties incorrectly defined - "
"could not retrieve min and max power values for host %s",
- host->getName().c_str());
+ host->name().c_str());
/* min_power corresponds to the idle power (cpu load = 0) */
/* max_power is the power consumed at 100% cpu load */
}
/* **************************** events callback *************************** */
-static void onCreation(simgrid::Host& host) {
+static void onCreation(simgrid::s4u::Host& host) {
simgrid::surf::Host* surf_host = host.extension<simgrid::surf::Host>();
if (dynamic_cast<simgrid::surf::VirtualMachine*>(surf_host)) // Ignore virtual machines
return;
host_energy->update();
}
-static void onHostStateChange(simgrid::Host &host) {
+static void onHostStateChange(simgrid::s4u::Host &host) {
simgrid::surf::Host* surf_host = host.extension<simgrid::surf::Host>();
if (dynamic_cast<simgrid::surf::VirtualMachine*>(surf_host)) // Ignore virtual machines
return;
host_energy->update();
}
-static void onHostDestruction(simgrid::Host& host) {
+static void onHostDestruction(simgrid::s4u::Host& host) {
// Ignore virtual machines
simgrid::surf::Host* surf_host = host.extension<simgrid::surf::Host>();
if (dynamic_cast<simgrid::surf::VirtualMachine*>(surf_host))
HostEnergy *host_energy = host.extension<HostEnergy>();
host_energy->update();
XBT_INFO("Total energy of host %s: %f Joules",
- host.getName().c_str(), host_energy->getConsumedEnergy());
+ host.name().c_str(), host_energy->getConsumedEnergy());
}
/* **************************** Public interface *************************** */
if (HostEnergy::EXTENSION_ID.valid())
return;
- HostEnergy::EXTENSION_ID = simgrid::Host::extension_create<HostEnergy>();
+ HostEnergy::EXTENSION_ID = simgrid::s4u::Host::extension_create<HostEnergy>();
- simgrid::Host::onCreation.connect(&onCreation);
- simgrid::Host::onStateChange.connect(&onHostStateChange);
- simgrid::Host::onDestruction.connect(&onHostDestruction);
+ simgrid::s4u::Host::onCreation.connect(&onCreation);
+ simgrid::s4u::Host::onStateChange.connect(&onHostStateChange);
+ simgrid::s4u::Host::onDestruction.connect(&onHostDestruction);
simgrid::surf::CpuAction::onStateChange.connect(&onActionStateChange);
}
class HostEnergy {
public:
- static simgrid::xbt::Extension<simgrid::Host, HostEnergy> EXTENSION_ID;
+ static simgrid::xbt::Extension<simgrid::s4u::Host, HostEnergy> EXTENSION_ID;
typedef std::pair<double,double> power_range;
- HostEnergy(simgrid::Host *ptr);
+ HostEnergy(simgrid::s4u::Host *ptr);
~HostEnergy();
double getCurrentWattsValue(double cpu_load);
private:
void initWattsRangeList();
- simgrid::Host *host = nullptr;
+ simgrid::s4u::Host *host = nullptr;
std::vector<power_range> power_range_watts_list; /*< List of (min_power,max_power) pairs corresponding to each cpu pstate */
public:
double watts_off = 0.0; /*< Consumption when the machine is turned off (shutdown) */
if (current_routing)
net = routing_add_host(current_routing, host);
- sg_host_t h = simgrid::Host::by_name_or_create(host->id);
+ sg_host_t h = simgrid::s4u::Host::by_name_or_create(host->id);
simgrid::surf::Cpu *cpu = surf_cpu_model_pm->createCpu(
h,
host->speed_peak,
host->initiallyOn,
host->state_trace);
surf_host_model->createHost(host->id, net, cpu, host->properties)->attach(h);
- simgrid::Host::onCreation(*h);
+ simgrid::s4u::Host::onCreation(*h);
if (TRACE_is_enabled() && TRACE_needs_platform())
sg_instr_new_host(host);
unsigned int cpt;
simgrid::surf::VirtualMachine *vm;
xbt_dynar_foreach(vms, cpt, vm) {
- // TODO, use a backlink from simgrid::surf::Host to simgrid::Host
+ // TODO, use a backlink from simgrid::surf::Host to simgrid::s4u::Host
sg_host_t vm_ = (sg_host_t) xbt_dict_get_elm_or_null(host_list, vm->getName());
xbt_dynar_push(vms_, &vm_);
}
{
XBT_DEBUG("Create all Libs");
host_list = xbt_dict_new_homogeneous([](void*p) {
- simgrid::Host* host = static_cast<simgrid::Host*>(p);
- simgrid::Host::onDestruction(*host);
+ simgrid::s4u::Host* host = static_cast<simgrid::s4u::Host*>(p);
+ simgrid::s4u::Host::onDestruction(*host);
delete host;
});
as_router_lib = xbt_lib_new();
for (int index = 0; index < count; index++) {
sg_netcard_t relm =
xbt_dynar_get_as(elms, index, simgrid::surf::NetCard*);
- sg_host_t delm = simgrid::Host::by_name_or_null(relm->getName());
+ sg_host_t delm = simgrid::s4u::Host::by_name_or_null(relm->getName());
if (delm!=NULL) {
xbt_dynar_push(res, &delm);
}
*lat += static_cast<Link*>(info.link_up)->getLatency();
}
}
- src_ctn = (xbt_dynar_t) simgrid::Host::by_name_or_create(tmp_src_name)->extension(COORD_HOST_LEVEL);
+ src_ctn = (xbt_dynar_t) simgrid::s4u::Host::by_name_or_create(tmp_src_name)->extension(COORD_HOST_LEVEL);
if (src_ctn == nullptr)
- src_ctn = (xbt_dynar_t) simgrid::Host::by_name_or_create(src->getName())->extension(COORD_HOST_LEVEL);
+ src_ctn = (xbt_dynar_t) simgrid::s4u::Host::by_name_or_create(src->getName())->extension(COORD_HOST_LEVEL);
}
else if(src->getRcType() == SURF_NETWORK_ELEMENT_ROUTER || src->getRcType() == SURF_NETWORK_ELEMENT_AS){
tmp_src_name = ROUTER_PEER(src->getName());
*lat += static_cast<Link*>(info.link_down)->getLatency();
}
}
- dst_ctn = (xbt_dynar_t) simgrid::Host::by_name_or_create(tmp_dst_name)
+ dst_ctn = (xbt_dynar_t) simgrid::s4u::Host::by_name_or_create(tmp_dst_name)
->extension(COORD_HOST_LEVEL);
if (dst_ctn == nullptr)
- dst_ctn = (xbt_dynar_t) simgrid::Host::by_name_or_create(dst->getName())
+ dst_ctn = (xbt_dynar_t) simgrid::s4u::Host::by_name_or_create(dst->getName())
->extension(COORD_HOST_LEVEL);
}
else if(dst->getRcType() == SURF_NETWORK_ELEMENT_ROUTER || dst->getRcType() == SURF_NETWORK_ELEMENT_AS){
* Resource *
************/
-VirtualMachine::VirtualMachine(HostModel *model, const char *name, xbt_dict_t props, simgrid::Host *hostPM)
+VirtualMachine::VirtualMachine(HostModel *model, const char *name, xbt_dict_t props, simgrid::s4u::Host *hostPM)
: Host(model, name, props, NULL, NULL, NULL)
, p_hostPM(hostPM)
{
VMModel::ws_vms.push_back(*this);
- simgrid::Host::by_name_or_create(name)->extension_set<simgrid::surf::Host>(this);
+ simgrid::s4u::Host::by_name_or_create(name)->extension_set<simgrid::surf::Host>(this);
}
/*
* @param cpu The Cpu associated to this VM
*/
VirtualMachine(simgrid::surf::HostModel *model, const char *name, xbt_dict_t props,
- simgrid::Host *host);
+ simgrid::s4u::Host *host);
/** @brief Destructor */
~VirtualMachine();
/* The vm object of the lower layer */
CpuAction *p_action;
- simgrid::Host *p_hostPM;
+ simgrid::s4u::Host *p_hostPM;
void turnOn() override;
void turnOff() override;
double solved_value = get_solved_value(ws_vm->p_action);
XBT_DEBUG("assign %f to vm %s @ pm %s", solved_value,
- ws_vm->getName(), ws_vm->p_hostPM->getName().c_str());
+ ws_vm->getName(), ws_vm->p_hostPM->name().c_str());
// TODO: check lmm_update_constraint_bound() works fine instead of the below manual substitution.
// cpu_cas01->constraint->bound = solved_value;
// vm_ws->cpu_action = surf_cpu_model_pm->extension.cpu.execute(host_PM, GUESTOS_NOISE);
p_action = sub_cpu->execute(0);
- XBT_INFO("Create VM(%s)@PM(%s) with %ld mounted disks", name, p_hostPM->getName().c_str(), xbt_dynar_length(p_storage));
+ XBT_INFO("Create VM(%s)@PM(%s) with %ld mounted disks",
+ name, p_hostPM->name().c_str(), xbt_dynar_length(p_storage));
}
void VMHL13::suspend()
{
Host *surfHost_dst = host_dest->extension<Host>();
const char *vm_name = getName();
- const char *pm_name_src = p_hostPM->getName().c_str();
+ const char *pm_name_src = p_hostPM->name().c_str();
const char *pm_name_dst = surfHost_dst->getName();
/* update net_elm with that of the destination physical host */
include/simgrid/s4u/storage.hpp
include/simgrid/s4u.h
include/simgrid/plugins/energy.h
- include/simgrid/Host.hpp
include/smpi/mpi.h
include/smpi/smpi.h
include/smpi/smpi_cocci.h