-/* Copyright (c) 2007-2020. The SimGrid Team.
+/* Copyright (c) 2007-2022. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
XBT_LOG_NEW_DEFAULT_CATEGORY(test, "Pstate properties test");
-static void dvfs(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[])
+static void dvfs(int argc, char* argv[])
{
sg_host_t host = sg_host_self();
- int nb = sg_host_get_nb_pstates(host);
- XBT_INFO("Count of Processor states=%d", nb);
+ unsigned long nb = sg_host_get_nb_pstates(host);
+ XBT_INFO("Count of Processor states=%lu", 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);
XBT_INFO("Task1 simulation time: %e", task_time);
// Change power peak
- int new_pstate = 2;
- xbt_assert(new_pstate < nb, "Cannot set the host %s at pstate %d because it only provides %d pstates.",
+ unsigned long new_pstate = 2;
+ xbt_assert(new_pstate < nb, "Cannot set the host %s at pstate %lu because it only provides %lu pstates.",
sg_host_get_name(host), new_pstate, nb);
double peak_at = sg_host_get_pstate_speed(host, new_pstate);
- XBT_INFO("Changing power peak value to %f (at index %d)", peak_at, new_pstate);
+ XBT_INFO("Changing power peak value to %f (at index %lu)", peak_at, new_pstate);
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);
// Verify the default pstate is set to 0
host = sg_host_by_name("MyHost2");
- int nb2 = sg_host_get_nb_pstates(host);
- XBT_INFO("Count of Processor states=%d", nb2);
+ unsigned long nb2 = sg_host_get_nb_pstates(host);
+ XBT_INFO("Count of Processor states=%lu", nb2);
- double current_peak2 = sg_host_speed(host);
+ double current_peak2 = sg_host_get_speed(host);
XBT_INFO("Current power peak=%f", current_peak2);
}
{
simgrid_init(&argc, argv);
- xbt_assert(argc == 2, "Usage: %s platform_file\n\tExample: %s msg_platform.xml\n", argv[0], argv[0]);
+ xbt_assert(argc == 2, "Usage: %s platform_file\n\tExample: %s platform.xml\n", argv[0], argv[0]);
simgrid_load_platform(argv[1]);