X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/7d28d93b90eedd2a49da8b9b990296669e46d05c..01e2c00cfea470a9ddb77a0712888969a530eccd:/examples/c/exec-dvfs/exec-dvfs.c diff --git a/examples/c/exec-dvfs/exec-dvfs.c b/examples/c/exec-dvfs/exec-dvfs.c index fb5db642a2..c9cd32aa98 100644 --- a/examples/c/exec-dvfs/exec-dvfs.c +++ b/examples/c/exec-dvfs/exec-dvfs.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2007-2020. The SimGrid Team. +/* Copyright (c) 2007-2023. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -17,8 +17,8 @@ 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_get_speed(host); XBT_INFO("Current power peak=%f", current_peak); @@ -29,12 +29,12 @@ static void dvfs(int argc, char* argv[]) 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); @@ -48,8 +48,8 @@ static void dvfs(int argc, char* argv[]) // 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_get_speed(host); XBT_INFO("Current power peak=%f", current_peak2); @@ -59,7 +59,7 @@ int main(int argc, char* argv[]) { 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]);