msg_host_t host = MSG_host_by_name("MyHost1");
XBT_INFO("Energetic profile: %s",MSG_host_get_property_value(host,"watt_per_state"));
- XBT_INFO("Initial peak speed=%.0E flop/s; Energy dissipated =%.0E J", MSG_host_get_current_power_peak(host),
+ XBT_INFO("Initial peak speed=%.0E flop/s; Energy dissipated =%.0E J", MSG_host_get_speed(host),
sg_host_get_consumed_energy(host));
double start = MSG_get_clock();
XBT_INFO("Sleep for 10 seconds");
MSG_process_sleep(10);
- XBT_INFO("Done sleeping (duration: %.2f s). Current peak speed=%.0E; Energy dissipated=%.2f J", MSG_get_clock()-start,
- MSG_host_get_current_power_peak(host), sg_host_get_consumed_energy(host));
+ XBT_INFO("Done sleeping (duration: %.2f s). Current peak speed=%.0E; Energy dissipated=%.2f J",
+ MSG_get_clock() - start, MSG_host_get_speed(host), sg_host_get_consumed_energy(host));
// Run a task
start = MSG_get_clock();
MSG_task_execute (task1);
MSG_task_destroy(task1);
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", MSG_get_clock()-start,
- MSG_host_get_current_power_peak(host), sg_host_get_wattmin_at(host,MSG_host_get_pstate(host)),
- sg_host_get_wattmax_at(host,MSG_host_get_pstate(host)), sg_host_get_consumed_energy(host));
+ " depending on load; Energy dissipated=%.0f J",
+ MSG_get_clock() - start, MSG_host_get_speed(host), sg_host_get_wattmin_at(host, MSG_host_get_pstate(host)),
+ sg_host_get_wattmax_at(host, MSG_host_get_pstate(host)), sg_host_get_consumed_energy(host));
// ========= Change power peak =========
int pstate=2;
MSG_host_set_pstate(host, pstate);
- XBT_INFO("========= Requesting pstate %d (speed should be of %.0E flop/s and is of %.0E flop/s)",
- pstate, MSG_host_get_power_peak_at(host, pstate), MSG_host_get_current_power_peak(host));
+ XBT_INFO("========= Requesting pstate %d (speed should be of %.0E flop/s and is of %.0E flop/s)", pstate,
+ MSG_host_get_power_peak_at(host, pstate), MSG_host_get_speed(host));
// Run a second task
start = MSG_get_clock();
MSG_task_execute (task1);
MSG_task_destroy(task1);
XBT_INFO("Task done (duration: %.2f s). Current peak speed=%.0E flop/s; Energy dissipated=%.0f J",
- MSG_get_clock()-start, MSG_host_get_current_power_peak(host), sg_host_get_consumed_energy(host));
+ MSG_get_clock() - start, MSG_host_get_speed(host), sg_host_get_consumed_energy(host));
start = MSG_get_clock();
XBT_INFO("Sleep for 4 seconds");
MSG_process_sleep(4);
XBT_INFO("Done sleeping (duration: %.2f s). Current peak speed=%.0E flop/s; Energy dissipated=%.0f J",
- MSG_get_clock()-start, MSG_host_get_current_power_peak(host), sg_host_get_consumed_energy(host));
+ MSG_get_clock() - start, MSG_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 = MSG_get_clock();
MSG_process_sleep(10);
XBT_INFO("Done sleeping (duration: %.2f s). Current peak speed=%.0E flop/s; Energy dissipated=%.0f J",
- MSG_get_clock()-start, MSG_host_get_current_power_peak(host), sg_host_get_consumed_energy(host));
+ MSG_get_clock() - start, MSG_host_get_speed(host), sg_host_get_consumed_energy(host));
return 0;
}
msg_host_t host1 = MSG_host_by_name("MyHost1");
XBT_INFO("Energetic profile: %s", MSG_host_get_property_value(host1,"watt_per_state"));
- XBT_INFO("Initial peak speed=%.0E flop/s; Energy dissipated =%.0E J",
- MSG_host_get_current_power_peak(host1), sg_host_get_consumed_energy(host1));
+ XBT_INFO("Initial peak speed=%.0E flop/s; Energy dissipated =%.0E J", MSG_host_get_speed(host1),
+ sg_host_get_consumed_energy(host1));
XBT_INFO("Sleep for 10 seconds");
MSG_process_sleep(10);
- XBT_INFO("Done sleeping. Current peak speed=%.0E; Energy dissipated=%.2f J",
- MSG_host_get_current_power_peak(host1), sg_host_get_consumed_energy(host1));
+ XBT_INFO("Done sleeping. Current peak speed=%.0E; Energy dissipated=%.2f J", MSG_host_get_speed(host1),
+ sg_host_get_consumed_energy(host1));
simulate_shutdown(host1);
- XBT_INFO("Host1 is now OFF. Current peak speed=%.0E flop/s; Energy dissipated=%.0f J",
- MSG_host_get_current_power_peak(host1), sg_host_get_consumed_energy(host1));
+ XBT_INFO("Host1 is now OFF. Current peak speed=%.0E flop/s; Energy dissipated=%.0f J", MSG_host_get_speed(host1),
+ sg_host_get_consumed_energy(host1));
XBT_INFO("Sleep for 10 seconds");
MSG_process_sleep(10);
- XBT_INFO("Done sleeping. Current peak speed=%.0E; Energy dissipated=%.2f J",
- MSG_host_get_current_power_peak(host1), sg_host_get_consumed_energy(host1));
+ XBT_INFO("Done sleeping. Current peak speed=%.0E; Energy dissipated=%.2f J", MSG_host_get_speed(host1),
+ sg_host_get_consumed_energy(host1));
simulate_bootup(host1);
- XBT_INFO("Host1 is now ON again. Current peak speed=%.0E flop/s; Energy dissipated=%.0f J",
- MSG_host_get_current_power_peak(host1), sg_host_get_consumed_energy(host1));
+ XBT_INFO("Host1 is now ON again. Current peak speed=%.0E flop/s; Energy dissipated=%.0f J", MSG_host_get_speed(host1),
+ sg_host_get_consumed_energy(host1));
return 0;
}
int nb = MSG_host_get_nb_pstates(host);
XBT_INFO("Count of Processor states=%d", nb);
- double current_peak = MSG_host_get_current_power_peak(host);
+ double current_peak = MSG_host_get_speed(host);
XBT_INFO("Current power peak=%f", current_peak);
// Run a task
MSG_host_set_pstate(host, new_pstate);
- current_peak = MSG_host_get_current_power_peak(host);
+ current_peak = MSG_host_get_speed(host);
XBT_INFO("Current power peak=%f", current_peak);
// Run a second task
int nb2 = MSG_host_get_nb_pstates(host);
XBT_INFO("Count of Processor states=%d", nb2);
- double current_peak2 = MSG_host_get_current_power_peak(host);
+ double current_peak2 = MSG_host_get_speed(host);
XBT_INFO("Current power peak=%f", current_peak2);
return 0;
}
XBT_PUBLIC(void) MSG_zone_set_property_value(msg_netzone_t netzone, const char* name, char* value);
XBT_PUBLIC(void) MSG_zone_get_hosts(msg_netzone_t zone, xbt_dynar_t whereto);
-/* Deprecated forms of the previous functions */
static inline XBT_ATTRIB_DEPRECATED_v319(
"Use MSG_zone_get_root() instead: v3.19 will remove MSG_environment_get_routing_root() completely.") msg_netzone_t
MSG_environment_get_routing_root()
{
return MSG_host_get_speed(host);
}
+static inline double XBT_ATTRIB_DEPRECATED_v320(
+ "Use MSG_host_get_speed(): v3.20 will drop MSG_host_get_current_power_peak() completely.")
+ MSG_host_get_current_power_peak(msg_host_t host)
+{
+ return MSG_host_get_speed(host);
+}
XBT_PUBLIC(double) MSG_host_get_power_peak_at(msg_host_t h, int pstate);
-#define MSG_host_get_current_power_peak(h) MSG_host_get_speed(h) /* deprecated */
XBT_PUBLIC(int) MSG_host_get_nb_pstates(msg_host_t h);
-#define MSG_host_get_pstate(h) sg_host_get_pstate(h) /* deprecated */
-#define MSG_host_set_pstate(h, pstate) sg_host_set_pstate(h, pstate) /* deprecated */
+#define MSG_host_get_pstate(h) sg_host_get_pstate(h) /* users don't know that MSG is the C version of SimGrid */
+#define MSG_host_set_pstate(h, pstate) sg_host_set_pstate(h, pstate) /* (same here) */
XBT_PUBLIC(xbt_dynar_t) MSG_hosts_as_dynar();
XBT_PUBLIC(int) MSG_get_host_number();
XBT_PUBLIC(xbt_dict_t) MSG_host_get_mounted_storage_list(msg_host_t host);