-/* Copyright (c) 2007-2010, 2013-2014. The SimGrid Team.
+/* Copyright (c) 2007-2010, 2013-2015. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
{
msg_host_t host = NULL;
msg_task_t task1 = NULL;
- host = MSG_get_host_by_name("MyHost1");
+ host = MSG_host_by_name("MyHost1");
XBT_INFO("Energetic profile: %s",
task1 = MSG_task_create ("t1", 100E6, 0, NULL);
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",
+ 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), MSG_host_get_consumed_energy(host));
+ MSG_host_get_current_power_peak(host), MSG_host_get_wattmin_at(host,MSG_host_get_pstate(host)),
+ MSG_host_get_wattmax_at(host,MSG_host_get_pstate(host)),
+ MSG_host_get_consumed_energy(host));
// ========= Change power peak =========
int pstate=2;
// =========== Turn the other host off ==========
XBT_INFO("Turning MyHost2 off, and sleeping another 10 seconds. MyHost2 dissipated %.0f J so far.",
- MSG_host_get_consumed_energy(MSG_get_host_by_name("MyHost2")) );
- MSG_host_off(MSG_get_host_by_name("MyHost2"));
+ MSG_host_get_consumed_energy(MSG_host_by_name("MyHost2")) );
+ MSG_host_off(MSG_host_by_name("MyHost2"));
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",