X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/e08142f6b96c100165667fe1b647a28b6357b5ed..39c935d6d5ee86d153f6f7e6a10d723ae7c57f6f:/examples/c/exec-dvfs/exec-dvfs.c?ds=sidebyside diff --git a/examples/c/exec-dvfs/exec-dvfs.c b/examples/c/exec-dvfs/exec-dvfs.c index 0d14933733..405d494cbb 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-2021. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -13,17 +13,17 @@ 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); - 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_self_execute(100E6); + sg_actor_execute(100E6); double task_time = simgrid_get_clock(); XBT_INFO("Task1 simulation time: %e", task_time); @@ -38,10 +38,10 @@ static void dvfs(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[]) 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_self_execute(100E6); + sg_actor_execute(100E6); task_time = simgrid_get_clock() - task_time; XBT_INFO("Task2 simulation time: %e", task_time); @@ -51,7 +51,7 @@ static void dvfs(XBT_ATTRIB_UNUSED int argc, XBT_ATTRIB_UNUSED char* argv[]) int nb2 = sg_host_get_nb_pstates(host); XBT_INFO("Count of Processor states=%d", nb2); - double current_peak2 = sg_host_speed(host); + double current_peak2 = sg_host_get_speed(host); XBT_INFO("Current power peak=%f", current_peak2); } @@ -63,11 +63,8 @@ int main(int argc, char* argv[]) simgrid_load_platform(argv[1]); - sg_actor_t a1 = sg_actor_init("dvfs_test", sg_host_by_name("MyHost1")); - sg_actor_start(a1, dvfs, 0, NULL); - - sg_actor_t a2 = sg_actor_init("dvfs_test", sg_host_by_name("MyHost2")); - sg_actor_start(a2, dvfs, 0, NULL); + sg_actor_create("dvfs_test", sg_host_by_name("MyHost1"), dvfs, 0, NULL); + sg_actor_create("dvfs_test", sg_host_by_name("MyHost2"), dvfs, 0, NULL); simgrid_run();