A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sed -i -e 's/\t/ /g' [sources] Please people, stop using tabs
[simgrid.git]
/
examples
/
msg
/
energy
/
onoff
/
onoff.c
diff --git
a/examples/msg/energy/onoff/onoff.c
b/examples/msg/energy/onoff/onoff.c
index
f06d512
..
4f0b927
100644
(file)
--- a/
examples/msg/energy/onoff/onoff.c
+++ b/
examples/msg/energy/onoff/onoff.c
@@
-15,7
+15,7
@@
#include "xbt/asserts.h"
XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test,
#include "xbt/asserts.h"
XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test,
-
"Messages specific for this msg example");
+ "Messages specific for this msg example");
static void simulate_bootup(msg_host_t host) {
static void simulate_bootup(msg_host_t host) {
@@
-68,27
+68,27
@@
static int onoff(int argc, char *argv[]) {
msg_host_t host1 = MSG_host_by_name("MyHost1");
XBT_INFO("Energetic profile: %s",
msg_host_t host1 = MSG_host_by_name("MyHost1");
XBT_INFO("Energetic profile: %s",
-
MSG_host_get_property_value(host1,"watt_per_state"));
+ MSG_host_get_property_value(host1,"watt_per_state"));
XBT_INFO("Initial peak speed=%.0E flop/s; Energy dissipated =%.0E J",
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));
+ MSG_host_get_current_power_peak(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",
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));
+ MSG_host_get_current_power_peak(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",
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));
+ MSG_host_get_current_power_peak(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",
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));
+ MSG_host_get_current_power_peak(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",
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));
+ MSG_host_get_current_power_peak(host1), sg_host_get_consumed_energy(host1));
return 0;
return 0;
@@
-101,8
+101,8
@@
int main(int argc, char *argv[])
MSG_init(&argc, argv);
xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
MSG_init(&argc, argv);
xbt_assert(argc > 2, "Usage: %s platform_file deployment_file\n"
-
"\tExample: %s msg_platform.xml msg_deployment.xml\n",
-
argv[0], argv[0]);
+ "\tExample: %s msg_platform.xml msg_deployment.xml\n",
+ argv[0], argv[0]);
MSG_create_environment(argv[1]);
MSG_create_environment(argv[1]);