From: Frederic Suter Date: Fri, 13 Dec 2019 14:23:44 +0000 (+0100) Subject: document fixed issue GH#321 X-Git-Tag: v3.25~278 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/13992254eb26dc088b8f79ceaf7f099d5aace7b4 document fixed issue GH#321 extend the exec-ptask example with an asynhcronous one --- diff --git a/ChangeLog b/ChangeLog index b8acaf6e51..e80be3c7de 100644 --- a/ChangeLog +++ b/ChangeLog @@ -26,6 +26,7 @@ XBT: Fixed bugs (FG#.. -> framagit bugs; FG!.. -> framagit merge requests): - GH#31: [MC] please provide an option to make MPI_Send asynchronous - GH#305: Unscheduled tasks are still excuted + - GH#321: [S4U] Get task remaining work ratio - GH#323: Crash when an actor turn off his physical host - FG!19: Removing RngStream diff --git a/examples/s4u/exec-ptask/s4u-exec-ptask.cpp b/examples/s4u/exec-ptask/s4u-exec-ptask.cpp index 468c94e410..255fe458fd 100644 --- a/examples/s4u/exec-ptask/s4u-exec-ptask.cpp +++ b/examples/s4u/exec-ptask/s4u-exec-ptask.cpp @@ -61,7 +61,7 @@ static void runner() /* ------[ test 3 ]----------------- */ XBT_INFO("Then, build a parallel task involving only computations (of different amounts) and no communication"); - computation_amounts = {3e8, 6e8, 1e9}; // 300Mflop, 6Mflop, 1Gflop + computation_amounts = {3e8, 6e8, 1e9}; // 300Mflop, 600Mflop, 1Gflop communication_amounts.clear(); // no comm simgrid::s4u::this_actor::parallel_execute(hosts, computation_amounts, communication_amounts); @@ -71,6 +71,20 @@ static void runner() communication_amounts.clear(); simgrid::s4u::this_actor::parallel_execute(hosts, computation_amounts, communication_amounts); + /* ------[ test 5 ]----------------- */ + XBT_INFO("Then, Monitor the execution of a parallel task"); + computation_amounts.assign(hosts_count, 1e6 /*1Mflop*/); + communication_amounts = {0, 1e6, 0, 0, 0, 1e6, 1e6, 0, 0}; + simgrid::s4u::ExecPtr activity = + simgrid::s4u::this_actor::exec_init(hosts, computation_amounts, communication_amounts); + activity->start(); + + while (not activity->test()) { + XBT_INFO("Remaining flop ratio: %.0f%%", 100 * activity->get_remaining_ratio()); + simgrid::s4u::this_actor::sleep_for(5); + } + activity->wait(); + XBT_INFO("Goodbye now!"); } diff --git a/examples/s4u/exec-ptask/s4u-exec-ptask.tesh b/examples/s4u/exec-ptask/s4u-exec-ptask.tesh index d7cb538346..fbb3d4edd5 100644 --- a/examples/s4u/exec-ptask/s4u-exec-ptask.tesh +++ b/examples/s4u/exec-ptask/s4u-exec-ptask.tesh @@ -17,5 +17,16 @@ $ ${bindir:=.}/s4u-exec-ptask ${platfdir}/energy_platform.xml --cfg=host/model:p > [320.000000] (0:maestro@) UNCAT HOST [310.000000 - 320.000000] MyHost2 speed_used 60000000.000000 > [320.000000] (0:maestro@) UNCAT HOST [310.000000 - 320.000000] MyHost3 speed_used 100000000.000000 > [320.000000] (1:test@MyHost1) Then, build a parallel task with no computation nor communication (synchro only) -> [320.000000] (1:test@MyHost1) Goodbye now! -> [320.000000] (0:maestro@) Simulation done. +> [320.000000] (1:test@MyHost1) Then, Monitor the execution of a parallel task +> [320.000000] (1:test@MyHost1) Remaining flop ratio: 100% +> [325.000000] (1:test@MyHost1) Remaining flop ratio: 83% +> [330.000000] (1:test@MyHost1) Remaining flop ratio: 67% +> [335.000000] (1:test@MyHost1) Remaining flop ratio: 50% +> [340.000000] (1:test@MyHost1) Remaining flop ratio: 33% +> [345.000000] (1:test@MyHost1) Remaining flop ratio: 17% +> [350.000000] (0:maestro@) UNCAT HOST [320.000000 - 350.000000] MyHost1 speed_used 33333.333333 +> [350.000000] (0:maestro@) UNCAT HOST [320.000000 - 350.000000] MyHost2 speed_used 33333.333333 +> [350.000000] (0:maestro@) UNCAT HOST [320.000000 - 350.000000] MyHost3 speed_used 33333.333333 +> [350.000000] (0:maestro@) UNCAT LINK [320.000000 - 350.000000] bus bandwidth_used 100000.000000 +> [350.000000] (1:test@MyHost1) Goodbye now! +> [350.000000] (0:maestro@) Simulation done.