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 952b3b35 authored by Nathalie Furmento's avatar Nathalie Furmento
Browse files

tutorials: fix error due to simgrid

parent 38eaaa65
......@@ -24,7 +24,8 @@
*/
#include <starpu.h>
#define NX 2048
#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);
......@@ -88,7 +89,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;
memset(&filter, 0, sizeof(filter));
filter.filter_func = starpu_vector_filter_block;
......@@ -98,25 +98,25 @@ int main(int argc, char **argv)
float factor = 3.14;
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();
/* StarPU does not need to manipulate the array anymore so we can stop
* monitoring it */
starpu_data_unpartition(vector_handle, 0);
starpu_data_unpartition(vector_handle, STARPU_MAIN_RAM);
starpu_data_unregister(vector_handle);
#ifdef STARPU_USE_OPENCL
......
......@@ -516,8 +516,29 @@ 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>
......
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