simgrid::s4u::Storage &storage = *kv.second;
// Retrieve disk's information
- sg_size_t free_size = storage.size_free();
- sg_size_t used_size = storage.size_used();
+ sg_size_t free_size = storage.sizeFree();
+ sg_size_t used_size = storage.sizeUsed();
sg_size_t size = storage.size();
XBT_INFO(" %s (%s) Used: %llu; Free: %llu; Total: %llu.",
int main(int argc, char **argv) {
boost::unordered_map <std::string, simgrid::s4u::Storage *> const& mounts =
- simgrid::s4u::Host::current()->mounted_storages();
+ simgrid::s4u::Host::current()->mountedStorages();
show_info(mounts);
file->move(newpath);
// Test attaching some user data to the file
- file->set_userdata(xbt_strdup("777"));
+ file->setUserdata(xbt_strdup("777"));
XBT_INFO("User data attached to the file: %s", (char*)file->userdata());
// Close the file
XBT_INFO("Get/set data for storage element: %s",storage.name());
XBT_INFO(" Uninitialized storage data: '%s'", (char*)storage.userdata());
- storage.set_userdata(xbt_strdup("Some user data"));
+ storage.setUserdata(xbt_strdup("Some user data"));
XBT_INFO(" Set and get data: '%s'", (char*)storage.userdata());
/*
void wait(double timeout) override;
private:
- double p_rate=-1;
+ double rate_=-1;
public:
/** Sets the maximal communication rate (in byte/sec). Must be done before start */
void setRate(double rate);
private:
- void *p_dstBuff = NULL;
- size_t p_dstBuffSize = 0;
- void *p_srcBuff = NULL;
- size_t p_srcBuffSize = sizeof(void*);
+ void *dstBuff_ = NULL;
+ size_t dstBuffSize_ = 0;
+ void *srcBuff_ = NULL;
+ size_t srcBuffSize_ = sizeof(void*);
public:
/** Specify the data to send */
void setSrcData(void * buff);
private: /* FIXME: expose these elements in the API */
- int p_detached = 0;
- int (*p_matchFunction)(void *, void *, smx_synchro_t) = NULL;
- void (*p_cleanFunction)(void *) = NULL;
- void (*p_copyDataFunction)(smx_synchro_t, void*, size_t) = NULL;
+ int detached_ = 0;
+ int (*matchFunction_)(void *, void *, smx_synchro_t) = NULL;
+ void (*cleanFunction_)(void *) = NULL;
+ void (*copyDataFunction_)(smx_synchro_t, void*, size_t) = NULL;
private:
- Actor *p_sender = NULL;
- Actor *p_receiver = NULL;
- Mailbox *p_mailbox = NULL;
+ Actor *sender_ = NULL;
+ Actor *receiver_ = NULL;
+ Mailbox *mailbox_ = NULL;
};
}} // namespace simgrid::s4u
void loadPlatform(const char *platf);
/** Registers the main function of an actor that will be launched from the deployment file */
- void register_function(const char*name, int (*code)(int,char**));
+ void registerFunction(const char*name, int (*code)(int,char**));
/** Registers a function as the default main function of actors
*
* It will be used as fallback when the function requested from the deployment file was not registered.
* It is used for trace-based simulations (see examples/msg/actions).
*/
- void register_default(int (*code)(int,char**));
+ void registerDefault(int (*code)(int,char**));
/** @brief Load a deployment file and launch the actors that it contains */
void loadDeployment(const char *deploy);
File(const char *fullpath, void* userdata);
~File();
private:
- smx_file_t p_inferior;
- const char *p_path;
+ smx_file_t inferior_;
+ const char *path_;
public:
/** Retrieves the path to the file */
- const char *path() { return p_path;}
+ const char *path() { return path_;}
public:
/** Simulates a read action. Returns the size of data actually read
*
- * FIXME: reading from a remotely mounted disk is not implemented yet. Any storage is considered as local, and no network communication ever occur.
+ * FIXME: reading from a remotely mounted disk is not implemented yet.
+ * Any storage is considered as local, and no network communication ever occur.
*/
sg_size_t read(sg_size_t size);
/** Simulates a write action. Returns the size of data actually written.
*
- * FIXME: reading from a remotely mounted disk is not implemented yet. Any storage is considered as local, and no network communication ever occur.
+ * FIXME: reading from a remotely mounted disk is not implemented yet.
+ * Any storage is considered as local, and no network communication ever occur.
*/
sg_size_t write(sg_size_t size);
/** Allows to store user data on that host */
- void set_userdata(void *data) {p_userdata = data;}
+ void setUserdata(void *data) {userdata_ = data;}
/** Retrieves the previously stored data */
- void* userdata() {return p_userdata;}
+ void* userdata() {return userdata_;}
private:
- void *p_userdata=NULL;
+ void *userdata_=NULL;
public:
/** Retrieve the datasize */
* All actors on that host which were marked autorestart will be restarted automatically.
* This call does nothing if the host is already on.
*/
- void turn_on();
+ void turnOn();
/** Turns that host off. All actors are forcefully stopped. */
- void turn_off();
+ void turnOff();
/** Returns if that host is currently up and running */
- bool is_on();
- bool is_off() { return !is_on(); }
+ bool isOn();
+ bool isOff() { return !isOn(); }
double speed();
int core_count();
xbt_dict_t properties();
xbt_swag_t processes();
- double current_power_peak();
- double power_peak_at(int pstate_index);
- void set_pstate(int pstate_index);
- int pstates_count() const;
+ double currentPowerPeak();
+ double powerPeakAt(int pstate_index);
+ int pstatesCount() const;
+ void setPstate(int pstate_index);
int pstate();
- void get_parameters(vm_params_t params);
- void set_parameters(vm_params_t params);
- xbt_dict_t mounted_storages_as_dict(); // HACK
- xbt_dynar_t attached_storages();
+ void parameters(vm_params_t params);
+ void setParameters(vm_params_t params);
+ xbt_dict_t mountedStoragesAsDict(); // HACK
+ xbt_dynar_t attachedStorages();
/** Get an associative list [mount point]->[Storage] off all local mount points.
*
* This is defined in the platform file, and cannot be modified programatically (yet).
*/
- boost::unordered_map<std::string, Storage*> const &mounted_storages();
+ boost::unordered_map<std::string, Storage*> const &mountedStorages();
private:
simgrid::xbt::string name_ = "noname";
~Mailbox();
protected:
- smx_rdv_t getInferior() { return p_inferior; }
+ smx_rdv_t getInferior() { return inferior_; }
public:
/** Get the name of that mailbox */
static Mailbox *byName(const char *name);
private:
- std::string p_name;
- smx_rdv_t p_inferior;
+ std::string name_;
+ smx_rdv_t inferior_;
static boost::unordered_map<std::string, Mailbox *> *mailboxes;
};
}} // namespace simgrid::s4u
/** Retrieve a Storage by its name. It must exist in the platform file */
static Storage &byName(const char* name);
const char *name();
- sg_size_t size_free();
- sg_size_t size_used();
+ sg_size_t sizeFree();
+ sg_size_t sizeUsed();
/** Retrieve the total amount of space of this storage element */
sg_size_t size();
protected:
smx_storage_t inferior();
private:
- static boost::unordered_map<std::string, Storage *> *storages;
- std::string p_name;
- smx_storage_t p_inferior;
+ static boost::unordered_map<std::string, Storage *> *storages_;
+ std::string name_;
+ smx_storage_t inferior_;
public:
- void set_userdata(void *data) {p_userdata = data;}
- void *userdata() {return p_userdata;}
+ void setUserdata(void *data) {userdata_ = data;}
+ void *userdata() {return userdata_;}
private:
- void *p_userdata = NULL;
+ void *userdata_ = NULL;
};
*/
void MSG_host_on(msg_host_t host)
{
- host->turn_on();
+ host->turnOn();
}
/** \ingroup m_host_management
*/
void MSG_host_off(msg_host_t host)
{
- host->turn_off();
+ host->turnOff();
}
/*
*/
void MSG_host_set_params(msg_host_t host, vm_params_t params)
{
- host->set_parameters(params);
+ host->setParameters(params);
}
/** \ingroup m_host_management
*/
void MSG_host_get_params(msg_host_t host, vm_params_t params)
{
- host->get_parameters(params);
+ host->parameters(params);
}
/** \ingroup m_host_management
*/
double MSG_host_get_power_peak_at(msg_host_t host, int pstate_index) {
xbt_assert((host != NULL), "Invalid parameters (host is NULL)");
- return host->power_peak_at(pstate_index);
+ return host->powerPeakAt(pstate_index);
}
/** \ingroup m_host_management
*/
double MSG_host_get_current_power_peak(msg_host_t host) {
xbt_assert((host != NULL), "Invalid parameters (host is NULL)");
- return host->current_power_peak();
+ return host->currentPowerPeak();
}
/** \ingroup m_host_management
xbt_dict_t MSG_host_get_mounted_storage_list(msg_host_t host)
{
xbt_assert((host != NULL), "Invalid parameters");
- return host->mounted_storages_as_dict();
+ return host->mountedStoragesAsDict();
}
/** \ingroup m_host_management
xbt_dynar_t MSG_host_get_attached_storage_list(msg_host_t host)
{
xbt_assert((host != NULL), "Invalid parameters");
- return host->attached_storages();
+ return host->attachedStorages();
}
/** \ingroup m_host_management
char* mount_name;
xbt_dict_cursor_t cursor = NULL;
- xbt_dict_t storage_list = host->mounted_storages_as_dict();
+ xbt_dict_t storage_list = host->mountedStoragesAsDict();
xbt_dict_foreach(storage_list,cursor,mount_name,storage_name){
storage = (msg_storage_t)xbt_lib_get_elm_or_null(storage_lib,storage_name);
msg_host_t host_dest;
size_t longest_prefix_length = 0;
- xbt_dict_t storage_list = host->mounted_storages_as_dict();
+ xbt_dict_t storage_list = host->mountedStoragesAsDict();
xbt_dict_foreach(storage_list,cursor,mount_name,storage_name){
file_mount_name = (char *) xbt_malloc ((strlen(mount_name)+1));
strncpy(file_mount_name,fullpath,strlen(mount_name)+1);
params.mig_speed = (double)mig_netspeed * 1024 * 1024; // mig_speed
//XBT_INFO("dp rate %f migspeed : %f intensity mem : %d, updatespeed %f, hostspeed %f",params.dp_rate, params.mig_speed, dp_intensity, update_speed, host_speed);
- vm->set_parameters(¶ms);
+ vm->setParameters(¶ms);
return vm;
}
struct migration_session *ms = (migration_session *) MSG_process_get_data(MSG_process_self());
s_vm_params_t params;
- ms->vm->get_parameters(¶ms);
+ ms->vm->parameters(¶ms);
int need_exit = 0;
(migration_session *) MSG_process_get_data(MSG_process_self());
s_vm_params_t params;
- ms->vm->get_parameters(¶ms);
+ ms->vm->parameters(¶ms);
const sg_size_t ramsize = params.ramsize;
const sg_size_t devsize = params.devsize;
const int skip_stage1 = params.skip_stage1;
s4u::Comm &s4u::Comm::send_init(s4u::Actor *sender, s4u::Mailbox &chan) {
s4u::Comm *res = new s4u::Comm();
- res->p_sender = sender;
- res->p_mailbox = &chan;
+ res->sender_ = sender;
+ res->mailbox_ = &chan;
return *res;
}
s4u::Comm &s4u::Comm::recv_init(s4u::Actor *receiver, s4u::Mailbox &chan) {
s4u::Comm *res = new s4u::Comm();
- res->p_receiver = receiver;
- res->p_mailbox = &chan;
+ res->receiver_ = receiver;
+ res->mailbox_ = &chan;
return *res;
}
void s4u::Comm::setRate(double rate) {
xbt_assert(p_state==inited);
- p_rate = rate;
+ rate_ = rate;
}
void s4u::Comm::setSrcData(void * buff) {
xbt_assert(p_state==inited);
- xbt_assert(p_dstBuff == NULL, "Cannot set the src and dst buffers at the same time");
- p_srcBuff = buff;
+ xbt_assert(dstBuff_ == NULL, "Cannot set the src and dst buffers at the same time");
+ srcBuff_ = buff;
}
void s4u::Comm::setSrcDataSize(size_t size){
xbt_assert(p_state==inited);
- p_srcBuffSize = size;
+ srcBuffSize_ = size;
}
void s4u::Comm::setSrcData(void * buff, size_t size) {
xbt_assert(p_state==inited);
- xbt_assert(p_dstBuff == NULL, "Cannot set the src and dst buffers at the same time");
- p_srcBuff = buff;
- p_srcBuffSize = size;
+ xbt_assert(dstBuff_ == NULL, "Cannot set the src and dst buffers at the same time");
+ srcBuff_ = buff;
+ srcBuffSize_ = size;
}
void s4u::Comm::setDstData(void ** buff) {
xbt_assert(p_state==inited);
- xbt_assert(p_srcBuff == NULL, "Cannot set the src and dst buffers at the same time");
- p_dstBuff = buff;
+ xbt_assert(srcBuff_ == NULL, "Cannot set the src and dst buffers at the same time");
+ dstBuff_ = buff;
}
size_t s4u::Comm::getDstDataSize(){
xbt_assert(p_state==finished);
- return p_dstBuffSize;
+ return dstBuffSize_;
}
void s4u::Comm::setDstData(void ** buff, size_t size) {
xbt_assert(p_state==inited);
- xbt_assert(p_srcBuff == NULL, "Cannot set the src and dst buffers at the same time");
- p_dstBuff = buff;
- p_dstBuffSize = size;
+ xbt_assert(srcBuff_ == NULL, "Cannot set the src and dst buffers at the same time");
+ dstBuff_ = buff;
+ dstBuffSize_ = size;
}
void s4u::Comm::start() {
xbt_assert(p_state == inited);
- if (p_srcBuff != NULL) { // Sender side
- p_inferior = simcall_comm_isend(p_sender->getInferior(), p_mailbox->getInferior(), p_remains, p_rate,
- p_srcBuff, p_srcBuffSize,
- p_matchFunction, p_cleanFunction, p_copyDataFunction,
- p_userData, p_detached);
- } else if (p_dstBuff != NULL) { // Receiver side
- p_inferior = simcall_comm_irecv(p_receiver->getInferior(), p_mailbox->getInferior(), p_dstBuff, &p_dstBuffSize,
- p_matchFunction, p_copyDataFunction,
- p_userData, p_rate);
+ if (srcBuff_ != NULL) { // Sender side
+ p_inferior = simcall_comm_isend(sender_->getInferior(), mailbox_->getInferior(), p_remains, rate_,
+ srcBuff_, srcBuffSize_,
+ matchFunction_, cleanFunction_, copyDataFunction_,
+ p_userData, detached_);
+ } else if (dstBuff_ != NULL) { // Receiver side
+ p_inferior = simcall_comm_irecv(receiver_->getInferior(), mailbox_->getInferior(), dstBuff_, &dstBuffSize_,
+ matchFunction_, copyDataFunction_,
+ p_userData, rate_);
} else {
xbt_die("Cannot start a communication before specifying whether we are the sender or the receiver");
if (p_state == started)
simcall_comm_wait(p_inferior, -1/*timeout*/);
else {// p_state == inited. Save a simcall and do directly a blocking send/recv
- if (p_srcBuff != NULL) {
- simcall_comm_send(p_sender->getInferior(), p_mailbox->getInferior(), p_remains, p_rate,
- p_srcBuff, p_srcBuffSize,
- p_matchFunction, p_copyDataFunction,
+ if (srcBuff_ != NULL) {
+ simcall_comm_send(sender_->getInferior(), mailbox_->getInferior(), p_remains, rate_,
+ srcBuff_, srcBuffSize_,
+ matchFunction_, copyDataFunction_,
p_userData, -1 /*timeout*/);
} else {
- simcall_comm_recv(p_receiver->getInferior(), p_mailbox->getInferior(), p_dstBuff, &p_dstBuffSize,
- p_matchFunction, p_copyDataFunction,
- p_userData, -1/*timeout*/, p_rate);
+ simcall_comm_recv(receiver_->getInferior(), mailbox_->getInferior(), dstBuff_, &dstBuffSize_,
+ matchFunction_, copyDataFunction_,
+ p_userData, -1/*timeout*/, rate_);
}
}
p_state = finished;
}
// It's not started yet. Do it in one simcall
- if (p_srcBuff != NULL) {
- simcall_comm_send(p_sender->getInferior(), p_mailbox->getInferior(), p_remains, p_rate,
- p_srcBuff, p_srcBuffSize,
- p_matchFunction, p_copyDataFunction,
+ if (srcBuff_ != NULL) {
+ simcall_comm_send(sender_->getInferior(), mailbox_->getInferior(), p_remains, rate_,
+ srcBuff_, srcBuffSize_,
+ matchFunction_, copyDataFunction_,
p_userData, timeout);
} else { // Receiver
- simcall_comm_recv(p_receiver->getInferior(), p_mailbox->getInferior(), p_dstBuff, &p_dstBuffSize,
- p_matchFunction, p_copyDataFunction,
- p_userData, timeout, p_rate);
+ simcall_comm_recv(receiver_->getInferior(), mailbox_->getInferior(), dstBuff_, &dstBuffSize_,
+ matchFunction_, copyDataFunction_,
+ p_userData, timeout, rate_);
}
p_state = finished;
}
s4u::Comm &res = s4u::Comm::send_init(sender, dest);
res.setRemains(simulatedSize);
- res.p_srcBuff = data;
- res.p_srcBuffSize = sizeof(void*);
+ res.srcBuff_ = data;
+ res.srcBuffSize_ = sizeof(void*);
res.start();
return res;
SIMIX_create_environment(platf);
}
-void s4u::Engine::register_function(const char*name, int (*code)(int,char**)) {
+void s4u::Engine::registerFunction(const char*name, int (*code)(int,char**)) {
SIMIX_function_register(name,code);
}
-void s4u::Engine::register_default(int (*code)(int,char**)) {
+void s4u::Engine::registerDefault(int (*code)(int,char**)) {
SIMIX_function_register_default(code);
}
void s4u::Engine::loadDeployment(const char *deploy) {
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());
- p_path = fullpath;
+ inferior_ = simcall_file_open(fullpath, Host::current());
+ path_ = fullpath;
}
File::~File() {
- simcall_file_close(p_inferior, Host::current());
+ simcall_file_close(inferior_, Host::current());
}
sg_size_t File::read(sg_size_t size) {
- return simcall_file_read(p_inferior, size, Host::current());
+ return simcall_file_read(inferior_, size, Host::current());
}
sg_size_t File::write(sg_size_t size) {
- return simcall_file_write(p_inferior,size, Host::current());
+ return simcall_file_write(inferior_,size, Host::current());
}
sg_size_t File::size() {
- return simcall_file_get_size(p_inferior);
+ return simcall_file_get_size(inferior_);
}
void File::seek(sg_size_t pos) {
- simcall_file_seek(p_inferior,pos,SEEK_SET);
+ simcall_file_seek(inferior_,pos,SEEK_SET);
}
sg_size_t File::tell() {
- return simcall_file_tell(p_inferior);
+ return simcall_file_tell(inferior_);
}
void File::move(const char*fullpath) {
- simcall_file_move(p_inferior,fullpath);
+ simcall_file_move(inferior_,fullpath);
}
void File::unlink() {
sg_host_t attached = Host::current(); // FIXME: we should check where this file is attached
- simcall_file_unlink(p_inferior,attached);
+ simcall_file_unlink(inferior_,attached);
}
}} // namespace simgrid::s4u
return SIMIX_process_get_host(smx_proc);
}
-void Host::turn_on() {
+void Host::turnOn() {
simgrid::simix::kernel(std::bind(SIMIX_host_on, this));
}
-void Host::turn_off() {
+void Host::turnOff() {
simgrid::simix::kernel(std::bind(SIMIX_host_off, this, SIMIX_process_self()));
}
-bool Host::is_on() {
+bool Host::isOn() {
return this->pimpl_cpu->isOn();
}
-int Host::pstates_count() const {
+int Host::pstatesCount() const {
return this->pimpl_cpu->getNbPStates();
}
-boost::unordered_map<std::string, Storage*> const& Host::mounted_storages() {
+boost::unordered_map<std::string, Storage*> const& Host::mountedStorages() {
if (mounts == NULL) {
mounts = new boost::unordered_map<std::string, Storage*> ();
- xbt_dict_t dict = this->mounted_storages_as_dict();
+ xbt_dict_t dict = this->mountedStoragesAsDict();
xbt_dict_cursor_t cursor;
char *mountname;
}
/** Get the peak power of a host */
-double Host::current_power_peak()
+double Host::currentPowerPeak()
{
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::power_peak_at(int pstate_index)
+double Host::powerPeakAt(int pstate_index)
{
return simgrid::simix::kernel([&] {
return this->pimpl_cpu->getPowerPeakAt(pstate_index);
}
/** @brief Set the pstate at which the host should run */
-void Host::set_pstate(int pstate_index)
+void Host::setPstate(int pstate_index)
{
simgrid::simix::kernel(std::bind(
&simgrid::surf::Cpu::setPState, pimpl_cpu, pstate_index
return pimpl_cpu->getPState();
}
-void Host::get_parameters(vm_params_t params)
+void Host::parameters(vm_params_t params)
{
simgrid::simix::kernel([&]() {
this->extension<simgrid::surf::Host>()->getParams(params);
});
}
-void Host::set_parameters(vm_params_t params)
+void Host::setParameters(vm_params_t params)
{
simgrid::simix::kernel([&]() {
this->extension<simgrid::surf::Host>()->setParams(params);
* \brief Returns the list of storages mounted on an host.
* \return a dict containing all storages mounted on the host
*/
-xbt_dict_t Host::mounted_storages_as_dict()
+xbt_dict_t Host::mountedStoragesAsDict()
{
return simgrid::simix::kernel([&] {
return this->extension<simgrid::surf::Host>()->getMountedStorageList();
* \brief Returns the list of storages attached to an host.
* \return a dict containing all storages attached to the host
*/
-xbt_dynar_t Host::attached_storages()
+xbt_dynar_t Host::attachedStorages()
{
return simgrid::simix::kernel([&] {
return this->extension<simgrid::surf::Host>()->getAttachedStorageList();
s4u::Mailbox::Mailbox(const char*name, smx_rdv_t inferior) {
- p_inferior = inferior;
- p_name = name;
+ inferior_ = inferior;
+ name_ = name;
mailboxes->insert({name, this});
}
const char *s4u::Mailbox::getName() {
- return p_name.c_str();
+ return name_.c_str();
}
s4u::Mailbox *s4u::Mailbox::byName(const char*name) {
s4u::Mailbox *res;
namespace simgrid {
namespace s4u {
-boost::unordered_map <std::string, Storage *> *Storage::storages = new boost::unordered_map<std::string, Storage*> ();
+boost::unordered_map <std::string, Storage *> *Storage::storages_ = new boost::unordered_map<std::string, Storage*> ();
Storage::Storage(std::string name, smx_storage_t inferior) {
- p_name = name;
- p_inferior = inferior;
+ name_ = name;
+ inferior_ = inferior;
- storages->insert({name, this});
+ storages_->insert({name, this});
}
Storage::~Storage() {
}
smx_storage_t Storage::inferior() {
- return p_inferior;
+ return inferior_;
}
Storage &Storage::byName(const char*name) {
s4u::Storage *res = NULL;
try {
- res = storages->at(name);
+ res = storages_->at(name);
} catch (std::out_of_range& e) {
smx_storage_t inferior = xbt_lib_get_elm_or_null(storage_lib,name);
if (inferior == NULL)
}
const char*Storage::name() {
- return p_name.c_str();
+ return name_.c_str();
}
-sg_size_t Storage::size_free() {
- return simcall_storage_get_free_size(p_inferior);
+sg_size_t Storage::sizeFree() {
+ return simcall_storage_get_free_size(inferior_);
}
-sg_size_t Storage::size_used() {
- return simcall_storage_get_used_size(p_inferior);
+sg_size_t Storage::sizeUsed() {
+ return simcall_storage_get_used_size(inferior_);
}
sg_size_t Storage::size() {
- return SIMIX_storage_get_size(p_inferior);
+ return SIMIX_storage_get_size(inferior_);
}
} /* namespace s4u */
* @return 1 if the host is active or 0 if it has crashed.
*/
int sg_host_is_on(sg_host_t host) {
- return host->is_on();
+ 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->pstates_count();
+ return host->pstatesCount();
}
/** @brief Gets the pstate at which that host currently runs.
* See also @ref SURF_plugin_energy.
*/
void sg_host_set_pstate(sg_host_t host,int pstate) {
- host->set_pstate(pstate);
+ host->setPstate(pstate);
}
/** @brief Get the properties of an host */
* \deprecated */
double simcall_host_get_current_power_peak(sg_host_t host)
{
- return host->current_power_peak();
+ return host->currentPowerPeak();
}
/** \ingroup simix_host_management
* \deprecated */
double simcall_host_get_power_peak_at(sg_host_t host, int pstate_index)
{
- return host->power_peak_at(pstate_index);
+ return host->powerPeakAt(pstate_index);
}
/** \deprecated */
void simcall_host_get_params(sg_host_t vm, vm_params_t params)
{
- vm->get_parameters(params);
+ vm->parameters(params);
}
/** \deprecated */
void simcall_host_set_params(sg_host_t vm, vm_params_t params)
{
- vm->set_parameters(params);
+ vm->setParameters(params);
}
/** \ingroup simix_storage_management
* \deprecated */
xbt_dict_t simcall_host_get_mounted_storage_list(sg_host_t host)
{
- return host->mounted_storages_as_dict();
+ return host->mountedStoragesAsDict();
}
/** \ingroup simix_storage_management
* \deprecated */
xbt_dynar_t simcall_host_get_attached_storage_list(sg_host_t host)
{
- return host->attached_storages();
+ return host->attachedStorages();
}
// ***** Other simcalls
xbt_assert((host != NULL), "Invalid parameters");
- if (h->is_off()) {
+ if (h->isOff()) {
simgrid::surf::Host* surf_host = h->extension<simgrid::surf::Host>();
surf_host->turnOn();
xbt_assert((host != NULL), "Invalid parameters");
- if (h->is_on()) {
+ if (h->isOn()) {
simgrid::surf::Host* surf_host = h->extension<simgrid::surf::Host>();
surf_host->turnOff();
(int)synchro->state);
}
/* check if the host is down */
- if (simcall->issuer->host->is_off()) {
+ if (simcall->issuer->host->isOff()) {
simcall->issuer->context->iwannadie = 1;
}
{
if (synchro->type == SIMIX_SYNC_EXECUTE && /* FIMXE: handle resource failure
* for parallel tasks too */
- synchro->execution.host->is_off()) {
+ synchro->execution.host->isOff()) {
/* If the host running the synchro failed, notice it so that the asking
* process can be killed if it runs on that host itself */
synchro->state = SIMIX_FAILED;
smx_synchro_t synchro;
/* check if the host is active */
- if (host->is_off()) {
+ if (host->isOff()) {
THROWF(host_error, 0, "Host %s failed, you cannot call this function",
sg_host_get_name(host));
}
smx_synchro_t synchro;
/* check if the host is active */
- if (host->is_off()) {
+ if (host->isOff()) {
THROWF(host_error, 0, "Host %s failed, you cannot call this function",
sg_host_get_name(host));
}
smx_synchro_t synchro;
/* check if the host is active */
- if (host->is_off()) {
+ if (host->isOff()) {
THROWF(host_error, 0, "Host %s failed, you cannot call this function",
sg_host_get_name(host));
}
smx_synchro_t synchro;
/* check if the host is active */
- if (host->is_off()) {
+ if (host->isOff()) {
THROWF(host_error, 0, "Host %s failed, you cannot call this function",
sg_host_get_name(host));
}
int SIMIX_file_unlink(smx_file_t fd, sg_host_t host)
{
/* check if the host is active */
- if (host->is_off()) {
+ if (host->isOff()) {
THROWF(host_error, 0, "Host %s failed, you cannot call this function",
sg_host_get_name(host));
}
(int)synchro->state);
}
- if (simcall->issuer->host->is_off()) {
+ if (simcall->issuer->host->isOff()) {
simcall->issuer->context->iwannadie = 1;
}
/* Check out for errors */
- if (simcall->issuer->host->is_off()) {
+ if (simcall->issuer->host->isOff()) {
simcall->issuer->context->iwannadie = 1;
SMX_EXCEPTION(simcall->issuer, host_error, 0, "Host failed");
} else
}
}
- if (simcall->issuer->host->is_off()) {
+ if (simcall->issuer->host->isOff()) {
simcall->issuer->context->iwannadie = 1;
}
/* execute the on_exit functions */
SIMIX_process_on_exit_runall(arg);
/* Add the process to the list of process to restart, only if the host is down */
- if (arg->auto_restart && arg->host->is_off()) {
+ if (arg->auto_restart && arg->host->isOff()) {
SIMIX_host_add_auto_restart_process(arg->host,arg->name,arg->code, arg->data,
sg_host_get_name(arg->host),
SIMIX_timer_get_date(arg->kill_timer),
XBT_DEBUG("Start process %s on host '%s'", name, hostname);
- if (host->is_off()) {
+ if (host->isOff()) {
int i;
XBT_WARN("Cannot launch process '%s' on failed host '%s'", name,
hostname);
sg_host_t host = sg_host_by_name(hostname);
XBT_DEBUG("Attach process %s on host '%s'", name, hostname);
- if (host->is_off()) {
+ if (host->isOff()) {
XBT_WARN("Cannot launch process '%s' on failed host '%s'",
name, hostname);
return nullptr;
sg_host_t host = process->host;
/* check if the host is active */
- if (host->is_off()) {
+ if (host->isOff()) {
THROWF(host_error, 0, "Host %s failed, you cannot call this function",
sg_host_get_name(host));
}
THROW_IMPOSSIBLE;
break;
}
- if (simcall->issuer->host->is_off()) {
+ if (simcall->issuer->host->isOff()) {
simcall->issuer->context->iwannadie = 1;
}
simcall_process_sleep__set__result(simcall, state);
double previous_energy = this->total_energy;
double instantaneous_consumption;
- if (host->is_off())
+ if (host->isOff())
instantaneous_consumption = this->watts_off;
else
instantaneous_consumption = this->getCurrentWattsValue(cpu_load);