X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/cc24be11966d17b35002353538b1eb5efda40f9f..288609da2372bbddd029141b616af67e6160e714:/examples/c/exec-async/exec-async.c diff --git a/examples/c/exec-async/exec-async.c b/examples/c/exec-async/exec-async.c index c1d42ec0bd..fab0ebc30c 100644 --- a/examples/c/exec-async/exec-async.c +++ b/examples/c/exec-async/exec-async.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2007-2020. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2007-2023. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -17,7 +17,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(exec_async, "Messages specific for this example"); * That's exactly equivalent to synchronous execution. */ static void waiter(int argc, char* argv[]) { - double computation_amount = sg_host_speed(sg_host_self()); + double computation_amount = sg_host_get_speed(sg_host_self()); XBT_INFO("Execute %g flops, should take 1 second.", computation_amount); sg_exec_t activity = sg_actor_exec_init(computation_amount); sg_exec_start(activity); @@ -29,7 +29,7 @@ static void waiter(int argc, char* argv[]) /* This actor tests the ongoing execution until its completion, and don't wait before it's terminated. */ static void monitor(int argc, char* argv[]) { - double computation_amount = sg_host_speed(sg_host_self()); + double computation_amount = sg_host_get_speed(sg_host_self()); XBT_INFO("Execute %g flops, should take 1 second.", computation_amount); sg_exec_t activity = sg_actor_exec_init(computation_amount); sg_exec_start(activity); @@ -46,11 +46,10 @@ static void monitor(int argc, char* argv[]) /* This actor cancels the ongoing execution after a while. */ static void canceller(int argc, char* argv[]) { - double computation_amount = sg_host_speed(sg_host_self()); + double computation_amount = sg_host_get_speed(sg_host_self()); XBT_INFO("Execute %g flops, should take 1 second.", computation_amount); - sg_exec_t activity = sg_actor_exec_init(computation_amount); - sg_exec_start(activity); + sg_exec_t activity = sg_actor_exec_async(computation_amount); sg_actor_sleep_for(0.5); XBT_INFO("I changed my mind, cancel!"); sg_exec_cancel(activity);