From: Martin Quinson Date: Fri, 15 Dec 2017 08:43:16 +0000 (+0100) Subject: Document the exec-ptask example X-Git-Tag: v3.18~28^2~7 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/d30a98d6338dbd9b3d9dae088fe4467566bf2341?ds=sidebyside Document the exec-ptask example --- diff --git a/examples/s4u/README.doc b/examples/s4u/README.doc index 776b9b058e..8814a15de6 100644 --- a/examples/s4u/README.doc +++ b/examples/s4u/README.doc @@ -175,7 +175,10 @@ also the tesh files in the example directories for details. Show how define a set of pstatesfor a host in the XML, and how the current pstate can be accessed/changed with @ref simgrid::s4u::Host::getPstateSpeed and @ref simgrid::s4u::Host::setPstate. - TODO: add an example about parallel executions. + - Parallel tasks + @ref examples/s4u/exec-ptasks/s4u-exec-ptasks.cpp\n + These objects are convenient abstractions of parallel + computational kernels that span over several machines. @subsection s4u_ex_activity_io I/O on disks and files diff --git a/examples/s4u/exec-ptask/s4u-exec-ptask.cpp b/examples/s4u/exec-ptask/s4u-exec-ptask.cpp index 267be8c7db..90bb2a89c9 100644 --- a/examples/s4u/exec-ptask/s4u-exec-ptask.cpp +++ b/examples/s4u/exec-ptask/s4u-exec-ptask.cpp @@ -3,6 +3,21 @@ /* 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. */ +/* Parallel tasks are convenient abstractions of parallel computational kernels that span over several machines. + * To create a new one, you have to provide several things: + * - a vector of hosts on which the task will execute + * - a vector of values, the amount of computation for each of the hosts (in flops) + * - a matrix of values, the amount of communication between each pair of hosts (in bytes) + * + * Each of these operation will be processed at the same relative speed. + * This means that at some point in time, all sub-executions and all sub-communications will be at 20% of completion. + * Also, they will all complete at the exact same time. + * + * This is obviously a simplistic abstraction, but this is very handful in a large amount of situations. + * + * Please note that you must have the LV07 platform model enabled to use such constructs. + */ + #include "simgrid/plugins/energy.h" #include #include