Attention une mise à jour du service Gitlab va être effectuée le mardi 30 novembre entre 17h30 et 18h00. Cette mise à jour va générer une interruption du service dont nous ne maîtrisons pas complètement la durée mais qui ne devrait pas excéder quelques minutes. Cette mise à jour intermédiaire en version 14.0.12 nous permettra de rapidement pouvoir mettre à votre disposition une version plus récente.

Commit 0d2f3bc9 authored by THIBAULT Samuel's avatar THIBAULT Samuel
Browse files
parents d0ca9644 81993890
......@@ -6,7 +6,7 @@ make vector_scal_task_insert
STARPU_WORKER_STATS=1 ./vector_scal_task_insert
# to force the implementation on a GPU device, by default, it will enable CUDA
STARPU_WORKER_STATS=1 STARPU_NCPUS=0 ./vector_scal_task_insert
STARPU_WORKER_STATS=1 STARPU_NCPU=0 ./vector_scal_task_insert
# to force the implementation on a OpenCL device
STARPU_WORKER_STATS=1 STARPU_NCPUS=0 STARPU_NCUDA=0 ./vector_scal_task_insert
STARPU_WORKER_STATS=1 STARPU_NCPU=0 STARPU_NCUDA=0 ./vector_scal_task_insert
......@@ -24,7 +24,8 @@
*/
#include <starpu.h>
#define NX 20480
#define N 10
#define NX 2048*N
extern void vector_scal_cpu(void *buffers[], void *_args);
extern void vector_scal_cuda(void *buffers[], void *_args);
......@@ -102,7 +103,6 @@ int main(int argc, char **argv)
starpu_vector_data_register(&vector_handle, 0, (uintptr_t)vector,
NX, sizeof(vector[0]));
#define N 10
struct starpu_data_filter filter = {
.filter_func = starpu_vector_filter_block,
.nchildren = N,
......@@ -113,24 +113,25 @@ int main(int argc, char **argv)
float factor = 3.14;
start_time = starpu_timing_now();
for (i = 0; i < N; i++)
{
ret = starpu_insert_task(&cl,
/* an argument is passed to the codelet, beware that this is a
* READ-ONLY buffer and that the codelet may be given a pointer to a
* COPY of the argument */
STARPU_VALUE, &factor, sizeof(factor),
/* the codelet manipulates one buffer in RW mode */
STARPU_RW, starpu_data_get_sub_data(vector_handle, 1, i),
0);
STARPU_CHECK_RETURN_VALUE(ret, "starpu_insert_task");
}
for (i = 0; i < N; i++)
{
ret = starpu_insert_task(&cl,
/* an argument is passed to the codelet, beware that this is a
* READ-ONLY buffer and that the codelet may be given a pointer to a
* COPY of the argument */
STARPU_VALUE, &factor, sizeof(factor),
/* the codelet manipulates one buffer in RW mode */
STARPU_RW, starpu_data_get_sub_data(vector_handle, 1, i),
0);
STARPU_CHECK_RETURN_VALUE(ret, "starpu_insert_task");
}
/* Wait for tasks completion */
starpu_task_wait_for_all();
/* Collect the pieces */
starpu_data_unpartition(vector_handle, 0);
starpu_data_unpartition(vector_handle, STARPU_MAIN_RAM);
fprintf(stderr, "computation took %fµs\n", starpu_timing_now() - start_time);
/* StarPU does not need to manipulate the array anymore so we can stop
......
......@@ -188,6 +188,24 @@ You can then to go a compute node
$ srun -p hpc -N 1 --pty bash -i
</pre></tt>
<p>
<tt>srun</tt> will not allow you to lauch X applications from the
compute node. To do so, you should use <tt>salloc</tt>
</p>
<tt></pre>
$ salloc -p hpc -N 1
$ squeue -u $USER
JOBID PARTITION NAME USER ST TIME NODES NODELIST(REASON)
427522 hpc bash hpcs-fur R INVALID 1 miriel002
$ ssh -X miriel002
</pre></tt>
<p>
where <tt>miriel002</tt> should be replaced by the name of the
machine which has been allocated to you.
</p>
</div>
<div class="section">
......@@ -203,7 +221,7 @@ $ srun -p hpc -N 1 --pty bash -i
environment
</p>
<tt><pre>
$ guix environment --pure starpu-simgrid --ad-hoc starpu-simgrid grep coreutils emacs vim less openssh inetutils -- /bin/bash --norc
$ guix environment --pure starpu-simgrid --ad-hoc starpu-simgrid grep coreutils emacs vim less openssh inetutils gv -- /bin/bash --norc
</pre></tt>
<p>
......@@ -329,10 +347,10 @@ running your application, e.g.:
<tt>
<pre>
# to force the implementation on a GPU device, by default, it will enable CUDA
STARPU_NCPUS=0 ./vector_scal_task_insert
STARPU_NCPU=0 ./vector_scal_task_insert
# to force the implementation on a OpenCL device
STARPU_NCPUS=0 STARPU_NCUDA=0 ./vector_scal_task_insert
STARPU_NCPU=0 STARPU_NCUDA=0 ./vector_scal_task_insert
</pre>
</tt>
-->
......@@ -349,10 +367,10 @@ variables <a href="http://starpu.gforge.inria.fr/doc/html/ExecutionConfiguration
$ STARPU_WORKER_STATS=1 ./vector_scal_task_insert
# to force the implementation on a GPU device, by default, it will enable CUDA
$ STARPU_WORKER_STATS=1 STARPU_NCPUS=0 ./vector_scal_task_insert
$ STARPU_WORKER_STATS=1 STARPU_NCPU=0 ./vector_scal_task_insert
# to force the implementation on a OpenCL device
$ STARPU_WORKER_STATS=1 STARPU_NCPUS=0 STARPU_NCUDA=0 ./vector_scal_task_insert
$ STARPU_WORKER_STATS=1 STARPU_NCPU=0 STARPU_NCUDA=0 ./vector_scal_task_insert
</pre>
</tt>
......@@ -516,8 +534,30 @@ matrix-matrix multiplication as an example. Here we will use the
<a href="http://starpu.gforge.inria.fr/doc/html/group__API__Data__Partition.html#ga212189d3b83dfa4e225609b5f2bf8461"><tt>starpu_vector_filter_block()</tt></a> filter function. You can see the list of
predefined filters provided by
StarPU <a href="http://starpu.gforge.inria.fr/doc/html/starpu__data__filters_8h.html">here</a>.
Try to run it with various numbers of tasks.
</p>
<p>
By using the SimGrid version of StarPU, you may when running a
partitioned version of <tt>vector_scal_task_insert</tt> get the following error
</p>
<tt>
<pre>
[starpu][_starpu_simgrid_submit_job][assert failure] Codelet vector_scal does not have a perfmodel, \
or is not calibrated enough, please re-run in non-simgrid mode until it is calibrated
</pre>
</tt>
<p>
this is because the performance model we are providing for this
tutorial is only calibrated for vectors with 2048 elements, to avoid
the issue, you can just multiply the number of elements (<tt>NX</tt>)
by the number of sub-data you defined in <tt>struct
starpu_data_filter</tt>, and so each sub-data will be a vector of
2048 elements.
</p>
<p>
We provide a solution for the
exercice <a href="files/vector_scal_task_insert_filter.c">here</a>.
</p>
</div>
</div>
......@@ -568,11 +608,25 @@ whole graph of tasks, and wait for termination.
Performance prediction is essential for proper scheduling decisions, the
performance models thus have to be calibrated. This is done automatically by
StarPU when a codelet is executed for the first time. Once this is done, the
result is saved to a file in <tt>$STARPU_HOME</tt> for later re-use. The
result is saved to a file in <tt>$STARPU_PERF_MODEL_DIR</tt> for later re-use. The
<tt>starpu_perfmodel_display</tt> tool can be used to check the resulting
performance model.
</p>
<p>
<tt>STARPU_PERF_MODEL_DIR</tt> specifies the main directory in which
StarPU stores its performance model files. The default is
<tt>$STARPU_HOME/.starpu/sampling</tt>.
<br/>
<tt>STARPU_HOME</tt> specifies the main directory in which StarPU
stores its configuration files. The default is <tt>$HOME</tt> on Unix
environments, and <tt>$USERPROFILE</tt> on Windows environments.
<br/>
In this tutorial which is using the Simgrid version of StarPU, we are
setting <tt>STARPU_PERF_MODEL_DIR</tt> to a specific
directory <a href="files/perfmodels"><tt>perfmodels</tt></a> available in the archive.
</p>
<tt>
<pre>
$ starpu_perfmodel_display -l
......@@ -640,6 +694,11 @@ $ gnuplot starpu_vector_scal.gp
$ gv starpu_vector_scal.eps
</pre></tt>
<p>
The <tt>gv</tt> command will not work if you have not
specified <tt>-X</tt> when you ran <tt>ssh</tt>.
</p>
<p>
If the code of a computation kernel is modified, the performance changes, the
performance model thus has to be recalibrated from start. To do so, use
......@@ -823,8 +882,7 @@ Homepage of the Klang-Omp OpenMP compiler: <a href="http://kstar.gforge.inria.fr
<div class="section">
<h2>More Performance Optimizations</h2>
<p>
The StarPU
documentation chapter<a href="http://starpu.gforge.inria.fr/doc/html/OfflinePerformanceTools.html">performance
The StarPU <a href="http://starpu.gforge.inria.fr/doc/html/OfflinePerformanceTools.html">performance
feedback chapter</a> provides more optimization tips for further
reading after this tutorial.
</p>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment