.. autodoxymethod:: sg_host_core_count(const_sg_host_t host)
.. autodoxymethod:: sg_host_dump(const_sg_host_t ws)
.. autodoxymethod:: sg_host_get_name(const_sg_host_t host)
- .. autodoxymethod:: sg_host_load(const_sg_host_t host)
- .. autodoxymethod:: sg_host_speed(const_sg_host_t host)
+ .. autodoxymethod:: sg_host_get_load(const_sg_host_t host)
+ .. autodoxymethod:: sg_host_get_speed(const_sg_host_t host)
User data and properties
------------------------
.. group-tab:: C
- .. autodoxymethod:: sg_host_route(const_sg_host_t from, const_sg_host_t to, xbt_dynar_t links)
- .. autodoxymethod:: sg_host_route_bandwidth(const_sg_host_t from, const_sg_host_t to)
- .. autodoxymethod:: sg_host_route_latency(const_sg_host_t from, const_sg_host_t to)
+ .. autodoxymethod:: sg_host_get_route(const_sg_host_t from, const_sg_host_t to, xbt_dynar_t links)
+ .. autodoxymethod:: sg_host_get_route_bandwidth(const_sg_host_t from, const_sg_host_t to)
+ .. autodoxymethod:: sg_host_get_route_latency(const_sg_host_t from, const_sg_host_t to)
.. autodoxymethod:: sg_host_sendto(sg_host_t from, sg_host_t to, double byte_amount)
Signals
sg_host_t first = sg_host_by_name(argv[1]);
const_sg_host_t second = sg_host_by_name(argv[2]);
- double flopAmount = sg_host_speed(first) * 5 + sg_host_speed(second) * 5;
+ double flopAmount = sg_host_get_speed(first) * 5 + sg_host_get_speed(second) * 5;
XBT_INFO("Let's move to %s to execute %.2f Mflops (5sec on %s and 5sec on %s)", argv[1], flopAmount / 1e6, argv[1],
argv[2]);
const char* w0_argv[] = {"worker0", "Task0", "-1.0", NULL};
sg_actor_create("worker0", (sg_host_t)vm0, worker_busy_loop, 3, w0_argv);
- char* speed = bprintf("%f", sg_host_speed(pm0));
+ char* speed = bprintf("%f", sg_host_get_speed(pm0));
const char* w1_argv[] = {"worker1", "Task1", speed, NULL};
sg_actor_create("worker1", (sg_host_t)vm1, worker_busy_loop, 3, w1_argv);
static void test_one_task(sg_host_t hostA)
{
- const double cpu_speed = sg_host_speed(hostA);
+ const double cpu_speed = sg_host_get_speed(hostA);
const double computation_amount = cpu_speed * 10;
const char* hostA_name = sg_host_get_name(hostA);
static void test_two_tasks(sg_host_t hostA, sg_host_t hostB)
{
- const double cpu_speed = sg_host_speed(hostA);
- xbt_assert(cpu_speed == sg_host_speed(hostB));
+ const double cpu_speed = sg_host_get_speed(hostA);
+ xbt_assert(cpu_speed == sg_host_get_speed(hostB));
const double computation_amount = cpu_speed * 10;
const char* hostA_name = sg_host_get_name(hostA);
const char* hostB_name = sg_host_get_name(hostB);
sg_vm_destroy(vm0);
vm0 = sg_vm_create_core(pm0, "VM0");
- double cpu_speed = sg_host_speed(pm0);
+ double cpu_speed = sg_host_get_speed(pm0);
sg_vm_set_bound(vm0, cpu_speed / 10);
sg_vm_start(vm0);
sg_vm_set_ramsize(vm0, 1e9); // 1GB
sg_vm_start(vm0);
- cpu_speed = sg_host_speed(pm0);
+ cpu_speed = sg_host_get_speed(pm0);
sg_vm_start(vm0);
XBT_INFO("# 10. Test migration");
sg_host_t host = sg_host_by_name("MyHost1");
XBT_INFO("Energetic profile: %s", sg_host_get_property_value(host, "wattage_per_state"));
- XBT_INFO("Initial peak speed=%.0E flop/s; Energy dissipated =%.0E J", sg_host_speed(host),
+ XBT_INFO("Initial peak speed=%.0E flop/s; Energy dissipated =%.0E J", sg_host_get_speed(host),
sg_host_get_consumed_energy(host));
double start = simgrid_get_clock();
XBT_INFO("Sleep for 10 seconds");
sg_actor_sleep_for(10);
XBT_INFO("Done sleeping (duration: %.2f s). Current peak speed=%.0E; Energy dissipated=%.2f J",
- simgrid_get_clock() - start, sg_host_speed(host), sg_host_get_consumed_energy(host));
+ simgrid_get_clock() - start, sg_host_get_speed(host), sg_host_get_consumed_energy(host));
// Run a task
start = simgrid_get_clock();
sg_actor_execute(100E6);
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_get_clock() - start, sg_host_speed(host), sg_host_get_wattmin_at(host, sg_host_get_pstate(host)),
+ simgrid_get_clock() - start, sg_host_get_speed(host), sg_host_get_wattmin_at(host, sg_host_get_pstate(host)),
sg_host_get_wattmax_at(host, sg_host_get_pstate(host)), sg_host_get_consumed_energy(host));
// ========= Change power peak =========
int pstate = 2;
sg_host_set_pstate(host, pstate);
XBT_INFO("========= Requesting pstate %d (speed should be of %.0E flop/s and is of %.0E flop/s)", pstate,
- sg_host_get_pstate_speed(host, pstate), sg_host_speed(host));
+ sg_host_get_pstate_speed(host, pstate), sg_host_get_speed(host));
// Run a second task
start = simgrid_get_clock();
XBT_INFO("Run a task of %.0E flops", 100E6);
sg_actor_execute(100E6);
XBT_INFO("Task done (duration: %.2f s). Current peak speed=%.0E flop/s; Energy dissipated=%.0f J",
- simgrid_get_clock() - start, sg_host_speed(host), sg_host_get_consumed_energy(host));
+ simgrid_get_clock() - start, sg_host_get_speed(host), sg_host_get_consumed_energy(host));
start = simgrid_get_clock();
XBT_INFO("Sleep for 4 seconds");
sg_actor_sleep_for(4);
XBT_INFO("Done sleeping (duration: %.2f s). Current peak speed=%.0E flop/s; Energy dissipated=%.0f J",
- simgrid_get_clock() - start, sg_host_speed(host), sg_host_get_consumed_energy(host));
+ simgrid_get_clock() - start, sg_host_get_speed(host), sg_host_get_consumed_energy(host));
// =========== Turn the other host off ==========
XBT_INFO("Turning MyHost2 off, and sleeping another 10 seconds. MyHost2 dissipated %.0f J so far.",
start = simgrid_get_clock();
sg_actor_sleep_for(10);
XBT_INFO("Done sleeping (duration: %.2f s). Current peak speed=%.0E flop/s; Energy dissipated=%.0f J",
- simgrid_get_clock() - start, sg_host_speed(host), sg_host_get_consumed_energy(host));
+ simgrid_get_clock() - start, sg_host_get_speed(host), sg_host_get_consumed_energy(host));
}
int main(int argc, char* argv[])
* That's exactly equivalent to synchronous execution. */
static void waiter(int argc, char* argv[])
{
- double computation_amount = sg_host_speed(sg_host_self());
+ double computation_amount = sg_host_get_speed(sg_host_self());
XBT_INFO("Execute %g flops, should take 1 second.", computation_amount);
sg_exec_t activity = sg_actor_exec_init(computation_amount);
sg_exec_start(activity);
/* This actor tests the ongoing execution until its completion, and don't wait before it's terminated. */
static void monitor(int argc, char* argv[])
{
- double computation_amount = sg_host_speed(sg_host_self());
+ double computation_amount = sg_host_get_speed(sg_host_self());
XBT_INFO("Execute %g flops, should take 1 second.", computation_amount);
sg_exec_t activity = sg_actor_exec_init(computation_amount);
sg_exec_start(activity);
/* This actor cancels the ongoing execution after a while. */
static void canceller(int argc, char* argv[])
{
- double computation_amount = sg_host_speed(sg_host_self());
+ double computation_amount = sg_host_get_speed(sg_host_self());
XBT_INFO("Execute %g flops, should take 1 second.", computation_amount);
sg_exec_t activity = sg_actor_exec_init(computation_amount);
int nb = sg_host_get_nb_pstates(host);
XBT_INFO("Count of Processor states=%d", nb);
- double current_peak = sg_host_speed(host);
+ double current_peak = sg_host_get_speed(host);
XBT_INFO("Current power peak=%f", current_peak);
sg_actor_execute(100E6);
sg_host_set_pstate(host, new_pstate);
- current_peak = sg_host_speed(host);
+ current_peak = sg_host_get_speed(host);
XBT_INFO("Current power peak=%f", current_peak);
sg_actor_execute(100E6);
int nb2 = sg_host_get_nb_pstates(host);
XBT_INFO("Count of Processor states=%d", nb2);
- double current_peak2 = sg_host_speed(host);
+ double current_peak2 = sg_host_get_speed(host);
XBT_INFO("Current power peak=%f", current_peak2);
}
XBT_INFO("It started. Running 48.492Mf takes exactly one second on Ginette (but not on Fafard).");
sg_actor_sleep_for(0.1);
- XBT_INFO("Loads in flops/s: Boivin=%.0f; Fafard=%.0f; Ginette=%.0f", sg_host_load(boivin), sg_host_load(fafard),
- sg_host_load(ginette));
+ XBT_INFO("Loads in flops/s: Boivin=%.0f; Fafard=%.0f; Ginette=%.0f", sg_host_get_load(boivin),
+ sg_host_get_load(fafard), sg_host_get_load(ginette));
sg_exec_wait(exec);
sg_exec_start(exec);
sg_actor_sleep_for(0.5);
- XBT_INFO("Loads before the move: Boivin=%.0f; Fafard=%.0f; Ginette=%.0f", sg_host_load(boivin), sg_host_load(fafard),
- sg_host_load(ginette));
+ XBT_INFO("Loads before the move: Boivin=%.0f; Fafard=%.0f; Ginette=%.0f", sg_host_get_load(boivin),
+ sg_host_get_load(fafard), sg_host_get_load(ginette));
sg_exec_set_host(exec, boivin);
sg_actor_sleep_for(0.1);
- XBT_INFO("Loads after the move: Boivin=%.0f; Fafard=%.0f; Ginette=%.0f", sg_host_load(boivin), sg_host_load(fafard),
- sg_host_load(ginette));
+ XBT_INFO("Loads after the move: Boivin=%.0f; Fafard=%.0f; Ginette=%.0f", sg_host_get_load(boivin),
+ sg_host_get_load(fafard), sg_host_get_load(ginette));
sg_exec_wait(exec);
XBT_INFO("Done!");
for (int i = 0; i < 3; i++) {
char* name = bprintf("Exec-%d", i);
- double amount = (6 * (i % 2) + i + 1) * sg_host_speed(sg_host_self());
+ double amount = (6 * (i % 2) + i + 1) * sg_host_get_speed(sg_host_self());
sg_exec_t exec = sg_actor_exec_init(amount);
sg_exec_set_name(exec, name);
pending_execs[pending_execs_count++] = exec;
sg_exec_start(exec);
- XBT_INFO("Activity %s has started for %.0f seconds", name, amount / sg_host_speed(sg_host_self()));
+ XBT_INFO("Activity %s has started for %.0f seconds", name, amount / sg_host_get_speed(sg_host_self()));
free(name);
}
/* - Retrieve all disks from current host */
unsigned int disk_count;
sg_disk_t* disk_list;
- sg_host_disks(sg_host_self(), &disk_count, &disk_list);
+ sg_host_get_disks(sg_host_self(), &disk_count, &disk_list);
for (unsigned int i = 0; i < disk_count; i++)
XBT_INFO("Disk name: %s (read: %.0f B/s -- write: %.0f B/s ", sg_disk_get_name(disk_list[i]),
for (long i = 0; i < host_count; i++) {
unsigned int disk_count;
sg_disk_t* disks;
- sg_host_disks(hosts[i], &disk_count, &disks);
+ sg_host_get_disks(hosts[i], &disk_count, &disks);
for (unsigned int j = 0; j < disk_count; j++)
XBT_INFO("Init: %s: %llu/%llu MiB used/free on '%s@%s'", sg_host_get_name(hosts[i]),
sg_disk_get_size_used(disks[j]) / INMEGA, sg_disk_get_size_free(disks[j]) / INMEGA,
for (long i = 0; i < host_count; i++) {
unsigned int disk_count;
sg_disk_t* disks;
- sg_host_disks(hosts[i], &disk_count, &disks);
+ sg_host_get_disks(hosts[i], &disk_count, &disks);
for (unsigned int j = 0; j < disk_count; j++)
XBT_INFO("End: %llu/%llu MiB used/free on '%s@%s'", sg_disk_get_size_used(disks[j]) / INMEGA,
sg_disk_get_size_free(disks[j]) / INMEGA, sg_disk_get_name(disks[j]), sg_host_get_name(hosts[i]));
{
unsigned int disk_count;
sg_disk_t* disks;
- sg_host_disks(sg_host_self(), &disk_count, &disks);
+ sg_host_get_disks(sg_host_self(), &disk_count, &disks);
show_info(disk_count, disks);
sg_host_t* hosts = sg_host_list();
for (size_t i = 0; i < host_count; i++)
- XBT_INFO("Host '%s' runs at %.0f flops/s", sg_host_get_name(hosts[i]), sg_host_speed(hosts[i]));
+ XBT_INFO("Host '%s' runs at %.0f flops/s", sg_host_get_name(hosts[i]), sg_host_get_speed(hosts[i]));
free(hosts);
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)",
- sg_host_speed(host), sg_host_get_computed_flops(host), sg_host_get_avg_load(host));
+ sg_host_get_speed(host), sg_host_get_computed_flops(host), sg_host_get_avg_load(host));
double start = simgrid_get_clock();
XBT_INFO("Sleep for 10 seconds");
sg_actor_sleep_for(10);
- double speed = sg_host_speed(host);
+ double speed = sg_host_get_speed(host);
XBT_INFO("Done sleeping %.2fs; peak speed: %.0E flop/s; number of flops computed so far: %.0E (nothing should have "
"changed)",
- simgrid_get_clock() - start, sg_host_speed(host), sg_host_get_computed_flops(host));
+ simgrid_get_clock() - start, sg_host_get_speed(host), sg_host_get_computed_flops(host));
// Run a task
start = simgrid_get_clock();
- XBT_INFO("Run a task of %.0E flops at current speed of %.0E flop/s", 200e6, sg_host_speed(host));
+ XBT_INFO("Run a task of %.0E flops at current speed of %.0E flop/s", 200e6, sg_host_get_speed(host));
sg_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_get_clock() - start, sg_host_speed(host), speed, sg_host_get_computed_flops(host),
+ simgrid_get_clock() - start, sg_host_get_speed(host), speed, sg_host_get_computed_flops(host),
sg_host_get_avg_load(host),
200E6 / (10.5 * speed * sg_host_core_count(host) +
- (simgrid_get_clock() - start - 0.5) * sg_host_speed(host) * sg_host_core_count(host)));
+ (simgrid_get_clock() - start - 0.5) * sg_host_get_speed(host) * sg_host_core_count(host)));
// ========= Change power peak =========
int pstate = 1;
sg_host_set_pstate(host, pstate);
XBT_INFO(
"========= Requesting pstate %d (speed should be of %.0E flop/s and is of %.0E flop/s, average load is %.5f)",
- pstate, sg_host_get_pstate_speed(host, pstate), sg_host_speed(host), sg_host_get_avg_load(host));
+ pstate, sg_host_get_pstate_speed(host, pstate), sg_host_get_speed(host), sg_host_get_avg_load(host));
// Run a second task
start = simgrid_get_clock();
sg_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_get_clock() - start, sg_host_speed(host), sg_host_get_computed_flops(host));
+ simgrid_get_clock() - start, sg_host_get_speed(host), sg_host_get_computed_flops(host));
start = simgrid_get_clock();
XBT_INFO("========= Requesting a reset of the computation and load counters");
XBT_INFO("Sleep for 4 seconds");
sg_actor_sleep_for(4);
XBT_INFO("Done sleeping %.2f s; peak speed: %.0E flop/s; number of flops computed so far: %.0E",
- simgrid_get_clock() - start, sg_host_speed(host), sg_host_get_computed_flops(host));
+ simgrid_get_clock() - start, sg_host_get_speed(host), sg_host_get_computed_flops(host));
// =========== Turn the other host off ==========
XBT_INFO("Turning MyHost2 off, and sleeping another 10 seconds. MyHost2 computed %.0f flops so far and has an "
start = simgrid_get_clock();
sg_actor_sleep_for(10);
XBT_INFO("Done sleeping %.2f s; peak speed: %.0E flop/s; number of flops computed so far: %.0E",
- simgrid_get_clock() - start, sg_host_speed(host), sg_host_get_computed_flops(host));
+ simgrid_get_clock() - start, sg_host_get_speed(host), sg_host_get_computed_flops(host));
}
static void change_speed(int argc, char* argv[])
if (SD_task_get_amount(parent) <= 1e-6){
redist_time= 0;
} else {
- redist_time = sg_host_route_latency(parent_host[0], host) +
- SD_task_get_amount(parent) / sg_host_route_bandwidth(parent_host[0], host);
+ redist_time = sg_host_get_route_latency(parent_host[0], host) +
+ SD_task_get_amount(parent) / sg_host_get_route_bandwidth(parent_host[0], host);
}
data_available = SD_task_get_start_time(parent) + redist_time;
}
xbt_dynar_free_container(&parents);
- result = fmax(sg_host_get_available_at(host), last_data_available) + SD_task_get_amount(task) / sg_host_speed(host);
+ result =
+ fmax(sg_host_get_available_at(host), last_data_available) + SD_task_get_amount(task) / sg_host_get_speed(host);
} else {
xbt_dynar_free_container(&parents);
- result = sg_host_get_available_at(host) + SD_task_get_amount(task)/sg_host_speed(host);
+ result = sg_host_get_available_at(host) + SD_task_get_amount(task) / sg_host_get_speed(host);
}
return result;
}
XBT_INFO(" Link %s: latency = %f, bandwidth = %f", sg_link_get_name(link), sg_link_get_latency(link),
sg_link_get_bandwidth(link));
- XBT_INFO("Route latency = %f, route bandwidth = %f", latency, sg_host_route_bandwidth(h1, h2));
+ XBT_INFO("Route latency = %f, route bandwidth = %f", latency, sg_host_get_route_bandwidth(h1, h2));
XBT_INFO("Communication time for %f bytes between %s and %s: %f", comm_amount12, h1->get_cname(), h2->get_cname(),
- sg_host_route_latency(h1, h2) + comm_amount12 / sg_host_route_bandwidth(h1, h2));
+ sg_host_get_route_latency(h1, h2) + comm_amount12 / sg_host_get_route_bandwidth(h1, h2));
XBT_INFO("Communication time for %f bytes between %s and %s: %f", comm_amount21, h2->get_cname(), h1->get_cname(),
- sg_host_route_latency(h2, h1) + comm_amount21 / sg_host_route_bandwidth(h2, h1));
+ sg_host_get_route_latency(h2, h1) + comm_amount21 / sg_host_get_route_bandwidth(h2, h1));
/* creation of the tasks and their dependencies */
SD_task_t taskA = SD_task_create("Task A", nullptr, 10.0);
for (i = 0; i < pstates; i++) {
sg_host_set_pstate(sg_host_self(), i);
- fprintf(stderr, "[%.6f] [rank %d] Current pstate: %d; Current power: %.0f\n",
- MPI_Wtime(), rank, i, sg_host_speed(sg_host_self()));
+ fprintf(stderr, "[%.6f] [rank %d] Current pstate: %d; Current power: %.0f\n", MPI_Wtime(), rank, i,
+ sg_host_get_speed(sg_host_self()));
SMPI_SAMPLE_FLOPS(1e9) {
/* imagine here some code running for 1e9 flops... */
* @return a dynar containing all storages (name) attached to the host
*/
XBT_PUBLIC xbt_dynar_t sg_host_get_attached_storage_list(const_sg_host_t host);
-XBT_PUBLIC void sg_host_disks(const_sg_host_t host, unsigned int* disk_count, sg_disk_t** disks);
+XBT_PUBLIC void sg_host_get_disks(const_sg_host_t host, unsigned int* disk_count, sg_disk_t** disks);
+XBT_ATTRIB_DEPRECATED_v330("Please use sg_host_get_disks()") XBT_PUBLIC
+ void sg_host_disks(const_sg_host_t host, unsigned int* disk_count, sg_disk_t** disks);
// =========== user-level functions ===============
/** @brief Return the speed of the processor (in flop/s), regardless of the current load on the machine. */
-XBT_PUBLIC double sg_host_speed(const_sg_host_t host);
+XBT_PUBLIC double sg_host_get_speed(const_sg_host_t host);
+XBT_ATTRIB_DEPRECATED_v330("Please use sg_host_get_speed()") XBT_PUBLIC double sg_host_speed(const_sg_host_t host);
XBT_PUBLIC double sg_host_get_pstate_speed(const_sg_host_t host, int pstate_index);
XBT_PUBLIC double sg_host_get_available_speed(const_sg_host_t host);
/** @brief Returns the current computation load (in flops per second).
* @param host a host
*/
-XBT_PUBLIC double sg_host_load(const_sg_host_t host);
+XBT_PUBLIC double sg_host_get_load(const_sg_host_t host);
+XBT_ATTRIB_DEPRECATED_v330("Please use sg_host_get_load()") XBT_PUBLIC double sg_host_load(const_sg_host_t host);
/** @brief Return the location on which the current process is running. */
XBT_PUBLIC sg_host_t sg_host_self();
*/
XBT_PUBLIC void sg_host_set_property_value(sg_host_t host, const char* name, const char* value);
-XBT_PUBLIC void sg_host_route(const_sg_host_t from, const_sg_host_t to, xbt_dynar_t links);
-XBT_PUBLIC double sg_host_route_latency(const_sg_host_t from, const_sg_host_t to);
-XBT_PUBLIC double sg_host_route_bandwidth(const_sg_host_t from, const_sg_host_t to);
+XBT_PUBLIC void sg_host_get_route(const_sg_host_t from, const_sg_host_t to, xbt_dynar_t links);
+XBT_PUBLIC double sg_host_get_route_latency(const_sg_host_t from, const_sg_host_t to);
+XBT_PUBLIC double sg_host_get_route_bandwidth(const_sg_host_t from, const_sg_host_t to);
+XBT_ATTRIB_DEPRECATED_v330("Please use sg_host_get_route()") XBT_PUBLIC
+ void sg_host_route(const_sg_host_t from, const_sg_host_t to, xbt_dynar_t links);
+XBT_ATTRIB_DEPRECATED_v330("Please use sg_host_get_route_latency()") XBT_PUBLIC
+ double sg_host_route_latency(const_sg_host_t from, const_sg_host_t to);
+XBT_ATTRIB_DEPRECATED_v330("Please use sg_host_get_route_bandwidth()") XBT_PUBLIC
+ double sg_host_route_bandwidth(const_sg_host_t from, const_sg_host_t to);
XBT_PUBLIC void sg_host_sendto(sg_host_t from, sg_host_t to, double byte_amount);
#ifndef DOXYGEN
#define SD_workstation_get_name sg_host_get_name
#define SD_workstation_get_by_name sg_host_by_name
#define SD_workstation_dump sg_host_dump
-#define SD_workstation_get_data sg_host_user
-#define SD_workstation_set_data sg_host_user_set
+#define SD_workstation_get_data sg_host_get_data
+#define SD_workstation_set_data sg_host_set_data
#define SD_workstation_get_properties sg_host_get_properties
#define SD_workstation_get_property_value sg_host_get_property_value
-#define SD_workstation_get_power sg_host_speed
+#define SD_workstation_get_power sg_host_get_speed
#define SD_workstation_get_available_power sg_host_get_available_speed
-#define SD_route_get_latency sg_host_route_latency
-#define SD_route_get_bandwidth sg_host_route_bandwidth
+#define SD_route_get_latency sg_host_get_route_latency
+#define SD_route_get_bandwidth sg_host_get_route_bandwidth
#define SD_workstation_get_mounted_storage_list sg_host_get_mounted_storage_list // XBT_ATTRIB_DEPRECATED_v330
// Lost functions
//SD_workstation_get_access_mode
//SD_workstation_set_access_mode
//SD_workstation_get_current_task
-//SD_route_get_communication_time => SG_route_get_latency() + amount / SD_route_get_bandwidth()
-//SD_workstation_get_computation_time => amount / sg_host_speed()
+//SD_route_get_communication_time => SD_route_get_latency() + amount / SD_route_get_bandwidth()
+//SD_workstation_get_computation_time => amount / sg_host_get_speed()
//SD_route_get_size
//SD_route_get_list
//TRACE_sd_set_task_category
return -1;
}
- return (jdouble)sg_host_speed(host);
+ return (jdouble)sg_host_get_speed(host);
}
JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Host_getCoreNumber(JNIEnv * env, jobject jhost) {
JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Host_getCurrentPowerPeak(JNIEnv* env, jobject jhost)
{
const_sg_host_t host = jhost_get_native(env, jhost);
- return sg_host_speed(host);
+ return sg_host_get_speed(host);
}
JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Host_getPowerPeakAt(JNIEnv* env, jobject jhost, jint pstate)
{
JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Host_getLoad(JNIEnv* env, jobject jhost)
{
const_sg_host_t host = jhost_get_native(env, jhost);
- return sg_host_load(host);
+ return sg_host_get_load(host);
}
JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Host_getCurrentLoad (JNIEnv *env, jobject jhost)
}
double MSG_host_get_speed(const_sg_host_t host)
{
- return sg_host_speed(host);
+ return sg_host_get_speed(host);
}
double MSG_host_get_power_peak_at(const_sg_host_t host, int pstate_index)
{
double MSG_host_get_load(const_sg_host_t host)
{
- return sg_host_load(host);
+ return sg_host_get_load(host);
}
/* ************************** Virtual Machines *************************** */
sg_vm_t MSG_vm_create_core(sg_host_t pm, const char* name)
}
// ========= storage related functions ============
-void sg_host_disks(const_sg_host_t host, unsigned int* disk_count, sg_disk_t** disks)
+void sg_host_get_disks(const_sg_host_t host, unsigned int* disk_count, sg_disk_t** disks)
{
std::vector<sg_disk_t> list = host->get_disks();
*disk_count = list.size();
(*disks)[i] = list[i];
}
+void sg_host_disks(const_sg_host_t host, unsigned int* disk_count, sg_disk_t** disks) // XBT_ATTRIB_DEPRECATED_v330
+{
+ sg_host_get_disks(host, disk_count, disks);
+}
+
xbt_dict_t sg_host_get_mounted_storage_list(sg_host_t host) // XBT_ATTRIB_DEPRECATED_v330
{
xbt_assert((host != nullptr), "Invalid parameters");
// =========== user-level functions ===============
// ================================================
/** @brief Returns the total speed of a host */
-double sg_host_speed(const_sg_host_t host)
+double sg_host_get_speed(const_sg_host_t host)
{
return host->get_speed();
}
+double sg_host_speed(const_sg_host_t host) // XBT_ATTRIB_DEPRECATED_v330
+{
+ return sg_host_get_speed(host);
+}
+
/** @brief Return the speed of the processor (in flop/s) at a given pstate. See also @ref plugin_energy.
*
* @param host host to test
* @param to where to
* @param links [OUT] where to store the list of links (must exist, cannot be nullptr).
*/
-void sg_host_route(const_sg_host_t from, const_sg_host_t to, xbt_dynar_t links)
+void sg_host_get_route(const_sg_host_t from, const_sg_host_t to, xbt_dynar_t links)
{
std::vector<simgrid::s4u::Link*> vlinks;
from->route_to(to, vlinks, nullptr);
* @param from where from
* @param to where to
*/
-double sg_host_route_latency(const_sg_host_t from, const_sg_host_t to)
+double sg_host_get_route_latency(const_sg_host_t from, const_sg_host_t to)
{
std::vector<simgrid::s4u::Link*> vlinks;
double res = 0;
* @param from where from
* @param to where to
*/
-double sg_host_route_bandwidth(const_sg_host_t from, const_sg_host_t to)
+double sg_host_get_route_bandwidth(const_sg_host_t from, const_sg_host_t to)
{
double min_bandwidth = -1.0;
return min_bandwidth;
}
+void sg_host_route(const_sg_host_t from, const_sg_host_t to, xbt_dynar_t links) // XBT_ATTRIB_DEPRECATED_v330
+{
+ sg_host_get_route(from, to, links);
+}
+
+double sg_host_route_latency(const_sg_host_t from, const_sg_host_t to) // XBT_ATTRIB_DEPRECATED_v330
+{
+ return sg_host_get_route_latency(from, to);
+}
+
+double sg_host_route_bandwidth(const_sg_host_t from, const_sg_host_t to) // XBT_ATTRIB_DEPRECATED_v330
+{
+ return sg_host_get_route_bandwidth(from, to);
+}
+
void sg_host_sendto(sg_host_t from, sg_host_t to, double byte_amount)
{
from->sendto(to, byte_amount);
return res;
}
-double sg_host_load(const_sg_host_t host)
+double sg_host_get_load(const_sg_host_t host)
{
return host->get_load();
}
+
+double sg_host_load(const_sg_host_t host) // XBT_ATTRIB_DEPRECATED_v330
+{
+ return sg_host_get_load(host);
+}
if (bytes_amount != nullptr)
for (int j = 0; j < host_count; j++)
if (bytes_amount[i * host_count + j] != 0)
- time += (sg_host_route_latency(host_list[i], host_list[j]) +
- bytes_amount[i * host_count + j] / sg_host_route_bandwidth(host_list[i], host_list[j]));
+ time += (sg_host_get_route_latency(host_list[i], host_list[j]) +
+ bytes_amount[i * host_count + j] / sg_host_get_route_bandwidth(host_list[i], host_list[j]));
if (time > max_time)
max_time = time;
void smpi_execute_benched(double duration)
{
smpi_bench_end();
- double speed = sg_host_speed(sg_host_self());
+ double speed = sg_host_get_speed(sg_host_self());
smpi_execute_flops(duration*speed);
smpi_bench_begin();
}
fprintf(stderr, "Route between %s and %s\n", name1, name2);
xbt_dynar_t route = xbt_dynar_new(sizeof(SD_link_t), NULL);
- sg_host_route(h1, h2, route);
+ sg_host_get_route(h1, h2, route);
fprintf(stderr, "Route size %lu\n", xbt_dynar_length(route));
unsigned int i;
SD_link_t link;
xbt_dynar_foreach(route, i, link)
fprintf(stderr, " Link %s: latency = %f, bandwidth = %f\n", sg_link_get_name(link), sg_link_get_latency(link),
sg_link_get_bandwidth(link));
- fprintf(stderr, "Route latency = %f, route bandwidth = %f\n",
- sg_host_route_latency(h1, h2), sg_host_route_bandwidth(h1, h2));
+ fprintf(stderr, "Route latency = %f, route bandwidth = %f\n", sg_host_get_route_latency(h1, h2),
+ sg_host_get_route_bandwidth(h1, h2));
xbt_dynar_free_container(&route);
}
if (!strcmp(argv[2], "FULL_LINK")) {
const char *name2 = sg_host_get_name(h2);
fprintf(stderr, "Route between %s and %s\n", name1, name2);
xbt_dynar_t route = xbt_dynar_new(sizeof(SD_link_t), NULL);
- sg_host_route(h1, h2, route);
+ sg_host_get_route(h1, h2, route);
fprintf(stderr, " Route size %lu\n", xbt_dynar_length(route));
unsigned int k;
SD_link_t link;
xbt_dynar_foreach(route, k, link)
fprintf(stderr, " Link %s: latency = %f, bandwidth = %f\n", sg_link_get_name(link),
sg_link_get_latency(link), sg_link_get_bandwidth(link));
- fprintf(stderr, " Route latency = %f, route bandwidth = %f\n",
- sg_host_route_latency(h1, h2), sg_host_route_bandwidth(h1, h2));
+ fprintf(stderr, " Route latency = %f, route bandwidth = %f\n", sg_host_get_route_latency(h1, h2),
+ sg_host_get_route_bandwidth(h1, h2));
xbt_dynar_free_container(&route);
}
}
[](const_sg_host_t a, const_sg_host_t b) { return strcmp(sg_host_get_name(a), sg_host_get_name(b)) < 0; });
for (size_t i = 0; i < totalHosts; i++) {
- std::printf(" <host id=\"%s\" speed=\"%.0f\"", hosts[i]->get_cname(), sg_host_speed(hosts[i]));
+ std::printf(" <host id=\"%s\" speed=\"%.0f\"", hosts[i]->get_cname(), sg_host_get_speed(hosts[i]));
const std::unordered_map<std::string, std::string>* props = hosts[i]->get_properties();
if (hosts[i]->get_core_count() > 1) {
std::printf(" core=\"%d\"", hosts[i]->get_core_count());