static void worker(simgrid::s4u::Host* first, simgrid::s4u::Host* second)
{
- double flopAmount = first->getSpeed() * 5 + second->getSpeed() * 5;
+ double flopAmount = first->get_speed() * 5 + second->get_speed() * 5;
XBT_INFO("Let's move to %s to execute %.2f Mflops (5sec on %s and 5sec on %s)", first->get_cname(), flopAmount / 1e6,
first->get_cname(), second->get_cname());
vm1->start();
simgrid::s4u::Actor::create("worker0", vm0, worker_busy_loop, "Task0", -1);
- simgrid::s4u::Actor::create("worker1", vm1, worker_busy_loop, "Task1", pm0->getSpeed());
+ simgrid::s4u::Actor::create("worker1", vm1, worker_busy_loop, "Task1", pm0->get_speed());
simgrid::s4u::this_actor::sleep_for(3000); // let the tasks end
vm0->destroy();
static void test_one_task(simgrid::s4u::Host* host)
{
- const double cpu_speed = host->getSpeed();
+ const double cpu_speed = host->get_speed();
const double computation_amount = cpu_speed * 10;
XBT_INFO("### Test: with/without task set_bound");
static void test_two_tasks(simgrid::s4u::Host* hostA, simgrid::s4u::Host* hostB)
{
- const double cpu_speed = hostA->getSpeed();
- xbt_assert(cpu_speed == hostB->getSpeed());
+ const double cpu_speed = hostA->get_speed();
+ xbt_assert(cpu_speed == hostB->get_speed());
const double computation_amount = cpu_speed * 10;
const char* hostA_name = hostA->get_cname();
const char* hostB_name = hostB->get_cname();
vm0->destroy();
vm0 = new simgrid::s4u::VirtualMachine("VM0", pm0, 1);
- vm0->set_bound(pm0->getSpeed() / 10);
+ vm0->set_bound(pm0->get_speed() / 10);
vm0->start();
XBT_INFO("# 7. Put a single task on the VM capped by 10%%.");
vm0->set_ramsize(1e9); // 1GB
vm0->start();
- double cpu_speed = pm0->getSpeed();
+ double cpu_speed = pm0->get_speed();
XBT_INFO("# 10. Test migration");
const double computation_amount = cpu_speed * 10;
simgrid::s4u::Host* host2 = simgrid::s4u::Host::by_name("MyHost2");
XBT_INFO("Energetic profile: %s", host1->get_property("watt_per_state"));
- XBT_INFO("Initial peak speed=%.0E flop/s; Energy dissipated =%.0E J", host1->getSpeed(),
+ XBT_INFO("Initial peak speed=%.0E flop/s; Energy dissipated =%.0E J", host1->get_speed(),
sg_host_get_consumed_energy(host1));
double start = simgrid::s4u::Engine::get_clock();
XBT_INFO("Sleep for 10 seconds");
simgrid::s4u::this_actor::sleep_for(10);
XBT_INFO("Done sleeping (duration: %.2f s). Current peak speed=%.0E; Energy dissipated=%.2f J",
- simgrid::s4u::Engine::get_clock() - start, host1->getSpeed(), sg_host_get_consumed_energy(host1));
+ simgrid::s4u::Engine::get_clock() - start, host1->get_speed(), sg_host_get_consumed_energy(host1));
// Execute something
start = simgrid::s4u::Engine::get_clock();
simgrid::s4u::this_actor::execute(flopAmount);
XBT_INFO("Task done (duration: %.2f s). Current peak speed=%.0E flop/s; Current consumption: from %.0fW to %.0fW"
" depending on load; Energy dissipated=%.0f J",
- simgrid::s4u::Engine::get_clock() - start, host1->getSpeed(),
+ simgrid::s4u::Engine::get_clock() - start, host1->get_speed(),
sg_host_get_wattmin_at(host1, host1->get_pstate()), sg_host_get_wattmax_at(host1, host1->get_pstate()),
sg_host_get_consumed_energy(host1));
int pstate = 2;
host1->set_pstate(pstate);
XBT_INFO("========= Requesting pstate %d (speed should be of %.0E flop/s and is of %.0E flop/s)", pstate,
- host1->getPstateSpeed(pstate), host1->getSpeed());
+ host1->get_pstate_speed(pstate), host1->get_speed());
// Run another task
start = simgrid::s4u::Engine::get_clock();
XBT_INFO("Run a task of %.0E flops", flopAmount);
simgrid::s4u::this_actor::execute(flopAmount);
XBT_INFO("Task done (duration: %.2f s). Current peak speed=%.0E flop/s; Energy dissipated=%.0f J",
- simgrid::s4u::Engine::get_clock() - start, host1->getSpeed(), sg_host_get_consumed_energy(host1));
+ simgrid::s4u::Engine::get_clock() - start, host1->get_speed(), sg_host_get_consumed_energy(host1));
start = simgrid::s4u::Engine::get_clock();
XBT_INFO("Sleep for 4 seconds");
simgrid::s4u::this_actor::sleep_for(4);
XBT_INFO("Done sleeping (duration: %.2f s). Current peak speed=%.0E flop/s; Energy dissipated=%.0f J",
- simgrid::s4u::Engine::get_clock() - start, host1->getSpeed(), sg_host_get_consumed_energy(host1));
+ simgrid::s4u::Engine::get_clock() - start, host1->get_speed(), sg_host_get_consumed_energy(host1));
// =========== Turn the other host off ==========
XBT_INFO("Turning MyHost2 off, and sleeping another 10 seconds. MyHost2 dissipated %.0f J so far.",
start = simgrid::s4u::Engine::get_clock();
simgrid::s4u::this_actor::sleep_for(10);
XBT_INFO("Done sleeping (duration: %.2f s). Current peak speed=%.0E flop/s; Energy dissipated=%.0f J",
- simgrid::s4u::Engine::get_clock() - start, host1->getSpeed(), sg_host_get_consumed_energy(host1));
+ simgrid::s4u::Engine::get_clock() - start, host1->get_speed(), sg_host_get_consumed_energy(host1));
}
int main(int argc, char* argv[])
/* First example of thing that we can use as a filtering criteria: a simple boolean function */
static bool filter_speed_more_than_50Mf(simgrid::s4u::Host* host)
{
- return host->getSpeed() > 50E6;
+ return host->get_speed() > 50E6;
}
/* Second kind of thing that we can use as a filtering criteria: a functor (=function object).
list = e.get_filtered_hosts(filter);
for (auto& host : list)
- XBT_INFO("The following hosts changed their frequency: %s (from %.1ff to %.1ff)", host->get_cname(), host->getPstateSpeed(filter.get_old_speed(host)), host->getSpeed());
+ XBT_INFO("The following hosts changed their frequency: %s (from %.1ff to %.1ff)", host->get_cname(),
+ host->get_pstate_speed(filter.get_old_speed(host)), host->get_speed());
/* You can also just use any regular function (namespaced on need) to filter */
list = e.get_filtered_hosts(filter::filter_speed_more_than_50Mf);
int nb = host->get_pstate_count();
XBT_INFO("Count of Processor states=%d", nb);
- XBT_INFO("Current power peak=%f", host->getSpeed());
+ XBT_INFO("Current power peak=%f", host->get_speed());
// Run a task
simgrid::s4u::this_actor::execute(workload);
// Change power peak
int new_pstate = 2;
- XBT_INFO("Changing power peak value to %f (at index %d)", host->getPstateSpeed(new_pstate), new_pstate);
+ XBT_INFO("Changing power peak value to %f (at index %d)", host->get_pstate_speed(new_pstate), new_pstate);
host->set_pstate(new_pstate);
- XBT_INFO("Current power peak=%f", host->getSpeed());
+ XBT_INFO("Current power peak=%f", host->get_speed());
// Run a second task
simgrid::s4u::this_actor::execute(workload);
host = simgrid::s4u::Host::by_name_or_null("MyHost2");
XBT_INFO("Count of Processor states=%d", host->get_pstate_count());
- XBT_INFO("Current power peak=%f", host->getSpeed());
+ XBT_INFO("Current power peak=%f", host->get_speed());
return 0;
}
XBT_INFO("It started. Running 48.492Mf takes exactly one second on Ginette (but not on Fafard).");
simgrid::s4u::this_actor::sleep_for(0.1);
- XBT_INFO("Loads in flops/s: Boivin=%.0f; Fafard=%.0f; Ginette=%.0f",
- boivin->getLoad(), fafard->getLoad(), ginette->getLoad());
+ XBT_INFO("Loads in flops/s: Boivin=%.0f; Fafard=%.0f; Ginette=%.0f", boivin->get_load(), fafard->get_load(),
+ ginette->get_load());
exec->wait();
exec->start();
simgrid::s4u::this_actor::sleep_for(0.5);
- XBT_INFO("Loads before the move: Boivin=%.0f; Fafard=%.0f; Ginette=%.0f",
- boivin->getLoad(), fafard->getLoad(), ginette->getLoad());
+ XBT_INFO("Loads before the move: Boivin=%.0f; Fafard=%.0f; Ginette=%.0f", boivin->get_load(), fafard->get_load(),
+ ginette->get_load());
exec->set_host(boivin);
simgrid::s4u::this_actor::sleep_for(0.1);
- XBT_INFO("Loads after the move: Boivin=%.0f; Fafard=%.0f; Ginette=%.0f",
- boivin->getLoad(), fafard->getLoad(), ginette->getLoad());
+ XBT_INFO("Loads after the move: Boivin=%.0f; Fafard=%.0f; Ginette=%.0f", boivin->get_load(), fafard->get_load(),
+ ginette->get_load());
exec->wait();
XBT_INFO("Done!");
void operator()()
{
std::unordered_map<std::string, simgrid::s4u::Storage*> const& mounts =
- simgrid::s4u::Host::current()->getMountedStorages();
+ simgrid::s4u::Host::current()->get_mounted_storages();
show_info(mounts);
/* - Retrieve all mount points of current host */
std::unordered_map<std::string, simgrid::s4u::Storage*> const& storage_list =
- simgrid::s4u::Host::current()->getMountedStorages();
+ simgrid::s4u::Host::current()->get_mounted_storages();
/* - For each disk mounted on host, display disk name and mount point */
for (auto const& kv : storage_list)
XBT_INFO("There are %zu hosts in the environment", totalHosts);
std::vector<simgrid::s4u::Host*> hosts = e.get_all_hosts();
for (unsigned int i = 0; i < hosts.size(); i++)
- XBT_INFO("Host '%s' runs at %.0f flops/s", hosts[i]->get_cname(), hosts[i]->getSpeed());
+ XBT_INFO("Host '%s' runs at %.0f flops/s", hosts[i]->get_cname(), hosts[i]->get_speed());
e.load_deployment(argv[2]);
e.run();
{
s4u_Host* host = simgrid::s4u::Host::by_name("MyHost1");
- XBT_INFO("Initial peak speed: %.0E flop/s; number of flops computed so far: %.0E (should be 0) and current average load: %.5f (should be 0)", host->getSpeed(),
- sg_host_get_computed_flops(host), sg_host_get_avg_load(host));
+ XBT_INFO("Initial peak speed: %.0E flop/s; number of flops computed so far: %.0E (should be 0) and current average "
+ "load: %.5f (should be 0)",
+ host->get_speed(), sg_host_get_computed_flops(host), sg_host_get_avg_load(host));
double start = simgrid::s4u::Engine::get_clock();
XBT_INFO("Sleep for 10 seconds");
simgrid::s4u::this_actor::sleep_for(10);
- double speed = host->getSpeed();
+ double speed = host->get_speed();
XBT_INFO("Done sleeping %.2fs; peak speed: %.0E flop/s; number of flops computed so far: %.0E (nothing should have "
"changed)",
- simgrid::s4u::Engine::get_clock() - start, host->getSpeed(), sg_host_get_computed_flops(host));
+ simgrid::s4u::Engine::get_clock() - start, host->get_speed(), sg_host_get_computed_flops(host));
// Run a task
start = simgrid::s4u::Engine::get_clock();
- XBT_INFO("Run a task of %.0E flops at current speed of %.0E flop/s", 200E6, host->getSpeed());
+ XBT_INFO("Run a task of %.0E flops at current speed of %.0E flop/s", 200E6, host->get_speed());
simgrid::s4u::this_actor::execute(200E6);
XBT_INFO("Done working on my task; this took %.2fs; current peak speed: %.0E flop/s (when I started the computation, "
"the speed was set to %.0E flop/s); number of flops computed so "
"far: %.2E, average load as reported by the HostLoad plugin: %.5f (should be %.5f)",
- simgrid::s4u::Engine::get_clock() - start, host->getSpeed(), speed, sg_host_get_computed_flops(host),
+ simgrid::s4u::Engine::get_clock() - start, host->get_speed(), speed, sg_host_get_computed_flops(host),
sg_host_get_avg_load(host),
static_cast<double>(200E6) /
(10.5 * speed * host->get_core_count() +
- (simgrid::s4u::Engine::get_clock() - start - 0.5) * host->getSpeed() * host->get_core_count()));
+ (simgrid::s4u::Engine::get_clock() - start - 0.5) * host->get_speed() * host->get_core_count()));
// ========= Change power peak =========
int pstate = 1;
host->set_pstate(pstate);
- XBT_INFO("========= Requesting pstate %d (speed should be of %.0E flop/s and is of %.0E flop/s, average load is %.5f)", pstate,
- host->getPstateSpeed(pstate), host->getSpeed(), sg_host_get_avg_load(host));
+ XBT_INFO(
+ "========= Requesting pstate %d (speed should be of %.0E flop/s and is of %.0E flop/s, average load is %.5f)",
+ pstate, host->get_pstate_speed(pstate), host->get_speed(), sg_host_get_avg_load(host));
// Run a second task
start = simgrid::s4u::Engine::get_clock();
simgrid::s4u::this_actor::execute(100E6);
XBT_INFO("Done working on my task; this took %.2fs; current peak speed: %.0E flop/s; number of flops computed so "
"far: %.2E",
- simgrid::s4u::Engine::get_clock() - start, host->getSpeed(), sg_host_get_computed_flops(host));
+ simgrid::s4u::Engine::get_clock() - start, host->get_speed(), sg_host_get_computed_flops(host));
start = simgrid::s4u::Engine::get_clock();
XBT_INFO("========= Requesting a reset of the computation and load counters");
XBT_INFO("Sleep for 4 seconds");
simgrid::s4u::this_actor::sleep_for(4);
XBT_INFO("Done sleeping %.2f s; peak speed: %.0E flop/s; number of flops computed so far: %.0E",
- simgrid::s4u::Engine::get_clock() - start, host->getSpeed(), sg_host_get_computed_flops(host));
+ simgrid::s4u::Engine::get_clock() - start, host->get_speed(), sg_host_get_computed_flops(host));
// =========== Turn the other host off ==========
s4u_Host* host2 = simgrid::s4u::Host::by_name("MyHost2");
start = simgrid::s4u::Engine::get_clock();
simgrid::s4u::this_actor::sleep_for(10);
XBT_INFO("Done sleeping %.2f s; peak speed: %.0E flop/s; number of flops computed so far: %.0E",
- simgrid::s4u::Engine::get_clock() - start, host->getSpeed(), sg_host_get_computed_flops(host));
+ simgrid::s4u::Engine::get_clock() - start, host->get_speed(), sg_host_get_computed_flops(host));
}
static void change_speed()
double comp_amount2 = 1000000;
double comm_amount12 = 2000000;
double comm_amount21 = 3000000;
- XBT_INFO("Computation time for %f flops on %s: %f", comp_amount1, h1->get_cname(), comp_amount1 / h1->getSpeed());
- XBT_INFO("Computation time for %f flops on %s: %f", comp_amount2, h2->get_cname(), comp_amount2 / h2->getSpeed());
+ XBT_INFO("Computation time for %f flops on %s: %f", comp_amount1, h1->get_cname(), comp_amount1 / h1->get_speed());
+ XBT_INFO("Computation time for %f flops on %s: %f", comp_amount2, h2->get_cname(), comp_amount2 / h2->get_speed());
XBT_INFO("Route between %s and %s:", h1->get_cname(), h2->get_cname());
std::vector<sg_link_t> route;
return res;
}
- double getSpeed();
+ double get_speed();
double get_available_speed();
int get_core_count();
+ double get_load();
- double getPstateSpeed(int pstate_index);
+ double get_pstate_speed(int pstate_index);
int get_pstate_count() const;
void set_pstate(int pstate_index);
int get_pstate();
+ XBT_ATTRIB_DEPRECATED_v323("Please use Host::get_speed() instead.") double getSpeed() { return get_speed(); }
+ XBT_ATTRIB_DEPRECATED_v323("Please use Host::get_pstate_speed() instead.") double getPstateSpeed(int pstate_index)
+ {
+ return get_pstate_speed(pstate_index);
+ }
+
std::vector<const char*> get_attached_storages();
XBT_ATTRIB_DEPRECATED_v323("Please use Host::get_attached_storages() instead.") void getAttachedStorages(
std::vector<const char*>* storages);
*
* This is defined in the platform file, and cannot be modified programatically (yet).
*/
- std::unordered_map<std::string, Storage*> const& getMountedStorages();
+ std::unordered_map<std::string, Storage*> const& get_mounted_storages();
+ XBT_ATTRIB_DEPRECATED_v323("Please use Host::get_mounted_storages() instead.") std::unordered_map<std::string, Storage*> const& getMountedStorages()
+ {
+ return get_mounted_storages();
+ }
void route_to(Host* dest, std::vector<Link*>& links, double* latency);
void route_to(Host* dest, std::vector<kernel::resource::LinkImpl*>& links, double* latency);
/** Block the calling actor on an execution located on the called host (with explicit priority) */
void execute(double flops, double priority);
- /** @brief Returns the current computation load (in flops per second)
- * The external load (coming from an availability trace) is not taken in account.
- *
- * @return The number of activities currently running on a host (an activity at priority 2 is counted twice).
- */
- double getLoad();
-
// Deprecated functions
XBT_ATTRIB_DEPRECATED_v323("Please use Host::get_name()") simgrid::xbt::string const& getName() const
{
int index = 0;
jobjectArray jtable;
- std::unordered_map<std::string, msg_storage_t> mounted_storages = host->getMountedStorages();
+ std::unordered_map<std::string, msg_storage_t> mounted_storages = host->get_mounted_storages();
int count = mounted_storages.size();
jclass cls = env->FindClass("org/simgrid/msg/Storage");
if ((TRACE_categorized() || TRACE_uncategorized() || TRACE_platform()) && (not TRACE_disable_speed())) {
simgrid::instr::VariableType* power = container->type_->by_name_or_create("power", "");
power->set_calling_container(container);
- power->set_event(0, host.getSpeed());
+ power->set_event(0, host.get_speed());
}
if (TRACE_uncategorized())
/**
* Returns resource load (in flop per second, or byte per second, or similar)
*
- * If the resource is shared (the default case), the load is sum of resource usage made by every variables located on
- * this resource.
+ * If the resource is shared (the default case), the load is sum of resource usage made by
+ * every variables located on this resource.
*
- * If the resource is not shared (ie in FATPIPE mode), then the load is the max (not the sum) of all resource usages
- * located on this resource.
+ * If the resource is not shared (ie in FATPIPE mode), then the load is the max (not the sum)
+ * of all resource usages located on this resource.
*/
double Constraint::get_usage() const
{
size_t longest_prefix_length = 0;
XBT_DEBUG("Search for storage name for '%s' on '%s'", fullpath.c_str(), host->get_cname());
- for (auto const& mnt : host->getMountedStorages()) {
+ for (auto const& mnt : host->get_mounted_storages()) {
XBT_DEBUG("See '%s'", mnt.first.c_str());
mount_point_ = fullpath.substr(0, mnt.first.length());
Host* dst_host;
size_t longest_prefix_length = 0;
- for (auto const& elm : host->getMountedStorages()) {
+ for (auto const& elm : host->get_mounted_storages()) {
std::string mount_point = std::string(fullpath).substr(0, elm.first.size());
if (mount_point == elm.first && elm.first.length() > longest_prefix_length) {
/* The current mount name is found in the full path and is bigger than the previous*/
{
xbt_assert((host != nullptr), "Invalid parameters");
xbt_dict_t contents = xbt_dict_new_homogeneous(nullptr);
- for (auto const& elm : host->getMountedStorages())
+ for (auto const& elm : host->get_mounted_storages())
xbt_dict_set(contents, elm.first.c_str(), sg_storage_get_content(elm.second), nullptr);
return contents;
if (this->pstate_ == pstate_off_) // The host is off (or was off at the beginning of this time interval)
return this->watts_off_;
- double current_speed = host_->getSpeed();
+ double current_speed = host_->get_speed();
double cpu_load;
// We may have start == finish if the past consumption was updated since the simcall was started
: host_(ptr)
, last_updated_(surf_get_clock())
, last_reset_(surf_get_clock())
- , current_speed_(host_->getSpeed())
+ , current_speed_(host_->get_speed())
, current_flops_(host_->pimpl_cpu->get_constraint()->get_usage())
, theor_max_flops_(0)
, was_prev_idle_(current_flops_ == 0)
}
theor_max_flops_ += current_speed_ * host_->get_core_count() * (now - last_updated_);
- current_speed_ = host_->getSpeed();
+ current_speed_ = host_->get_speed();
last_updated_ = now;
was_prev_idle_ = (current_flops_ == 0);
}
{
// We don't need to call update() here because it is called every time an action terminates or starts
// FIXME: Can this happen at the same time? stop -> call to getCurrentLoad, load = 0 -> next action starts?
- return current_flops_ / static_cast<double>(host_->getSpeed() * host_->get_core_count());
+ return current_flops_ / static_cast<double>(host_->get_speed() * host_->get_core_count());
}
/*
computed_flops_ = 0;
theor_max_flops_ = 0;
current_flops_ = host_->pimpl_cpu->get_constraint()->get_usage();
- current_speed_ = host_->getSpeed();
+ current_speed_ = host_->get_speed();
was_prev_idle_ = (current_flops_ == 0);
}
} // namespace plugin
{
XBT_DEBUG("mig: tx_start");
- double host_speed = vm_->get_pm()->getSpeed();
+ double host_speed = vm_->get_pm()->get_speed();
const sg_size_t ramsize = vm_->get_ramsize();
const double dp_rate =
host_speed ? (sg_vm_get_migration_speed(vm_) * sg_vm_get_dirty_page_intensity(vm_)) / host_speed : 1;
// Create a VCPU for this VM
std::vector<double> speeds;
for (int i = 0; i < physical_host->get_pstate_count(); i++)
- speeds.push_back(physical_host->getPstateSpeed(i));
+ speeds.push_back(physical_host->get_pstate_speed(i));
surf_cpu_model_vm->create_cpu(this, &speeds, physical_host->get_core_count());
if (physical_host->get_pstate() != 0)
}
/** @brief Get the peak processor speed (in flops/s), at the specified pstate */
-double Host::getPstateSpeed(int pstate_index)
+double Host::get_pstate_speed(int pstate_index)
{
return simgrid::simix::simcall([this, pstate_index] { return this->pimpl_cpu->get_pstate_peak_speed(pstate_index); });
}
-/** @brief Get the peak processor speed in flops/s, (under full load (=1.0), at the current pstate)
+/** @brief Get the peak computing speed in flops/s at the current pstate, taking the external load into account.
*
- * The result also takes the external load into account.
+ * The amount of flops per second available for computing depends on several things:
+ * - The current pstate determines the maximal peak computing speed (use @ref get_pstate_speed() to retrieve the
+ * computing speed you would get at another pstate)
+ * - If you declared an external load, then this reduces the available computing speed (see @ref set_speed_trace())
+ *
+ * The remaining speed is then shared between the executions located on this host.
+ * You can retrieve the amount of tasks currently running on this host with @ref get_load().
+ *
+ * The host may have multiple cores, and your executions may be able to use more than a single core.
+ *
+ * Finally, executions of priority 2 get twice the amount of flops than executions of priority 1.
*/
-double Host::getSpeed()
+double Host::get_speed()
{
return this->pimpl_cpu->get_speed(1.0);
}
+/** @brief Returns the current computation load (in flops per second)
+ * The external load (coming from an availability trace) is not taken in account.
+ */
+double Host::get_load()
+{
+ return this->pimpl_cpu->get_load();
+}
/** @brief Get the available speed ratio, between 0 and 1.
*
* This accounts for external load (see @ref set_speed_trace()).
storages->push_back(elm);
}
-std::unordered_map<std::string, Storage*> const& Host::getMountedStorages()
+std::unordered_map<std::string, Storage*> const& Host::get_mounted_storages()
{
if (mounts_ == nullptr) {
mounts_ = new std::unordered_map<std::string, Storage*>();
simcall_execution_wait(s);
}
-double Host::getLoad()
-{
- return this->pimpl_cpu->get_load();
-}
-
} // namespace s4u
} // namespace simgrid
{
xbt_assert((host != nullptr), "Invalid parameters");
xbt_dict_t res = xbt_dict_new_homogeneous(nullptr);
- for (auto const& elm : host->getMountedStorages()) {
+ for (auto const& elm : host->get_mounted_storages()) {
const char* mount_name = elm.first.c_str();
sg_storage_t storage = elm.second;
xbt_dict_set(res, mount_name, (void*)storage->get_cname(), nullptr);
/** @brief Returns the total speed of a host */
double sg_host_speed(sg_host_t host)
{
- return host->getSpeed();
+ return host->get_speed();
}
/** \brief Return the speed of the processor (in flop/s) at a given pstate. See also @ref plugin_energy.
*/
double sg_host_get_pstate_speed(sg_host_t host, int pstate_index)
{
- return host->getPstateSpeed(pstate_index);
+ return host->get_pstate_speed(pstate_index);
}
/** \ingroup m_host_management
void sg_host_dump(sg_host_t host)
{
XBT_INFO("Displaying host %s", host->get_cname());
- XBT_INFO(" - speed: %.0f", host->getSpeed());
+ XBT_INFO(" - speed: %.0f", host->get_speed());
XBT_INFO(" - available speed: %.2f", sg_host_get_available_speed(host));
std::unordered_map<std::string, std::string>* props = host->get_properties();
for (int i = 0; i < host_count; i++) {
double time = 0.0;
if (flops_amount != nullptr)
- time = flops_amount[i] / host_list[i]->getSpeed();
+ time = flops_amount[i] / host_list[i]->get_speed();
if (bytes_amount != nullptr)
for (int j = 0; j < host_count; j++)
*/
double smpi_get_host_power_peak_at(int pstate_index)
{
- return sg_host_self()->getPstateSpeed(pstate_index);
+ return sg_host_self()->get_pstate_speed(pstate_index);
}
/**
*/
double smpi_get_host_current_power_peak()
{
- return sg_host_self()->getSpeed();
+ return sg_host_self()->get_speed();
}
/**
// nsleeps is a multiplier to the sleeptime, to increase speed of execution, each failed iprobe will increase it
// This can speed up the execution of certain applications by an order of magnitude, such as HPL
static int nsleeps = 1;
- double speed = simgrid::s4u::Actor::self()->get_host()->getSpeed();
+ double speed = simgrid::s4u::Actor::self()->get_host()->get_speed();
double maxrate = simgrid::config::get_value<double>("smpi/iprobe-cpu-usage");
MPI_Request request = new Request(nullptr, 0, MPI_CHAR,
source == MPI_ANY_SOURCE ? MPI_ANY_SOURCE : comm->group()->actor(source)->get_pid(),
{
XBT_INFO("*** Storage info on %s ***", host->get_cname());
- for (auto const& elm : host->getMountedStorages()) {
+ for (auto const& elm : host->get_mounted_storages()) {
const std::string& mount_name = elm.first;
simgrid::s4u::Storage* storage = elm.second;
XBT_INFO("\tStorage name: %s, mount name: %s", storage->get_cname(), mount_name.c_str());