Accéder au contenu.
Menu Sympa

starpu-devel - Re: [Starpu-devel] Task which accesses multiple time the same handle with different access modes.

Objet : Developers list for StarPU

Archives de la liste

Re: [Starpu-devel] Task which accesses multiple time the same handle with different access modes.


Chronologique Discussions 
  • From: Jean-Marie Couteyen <jean-marie.couteyen@inria.fr>
  • To: starpu-devel@lists.gforge.inria.fr
  • Subject: Re: [Starpu-devel] Task which accesses multiple time the same handle with different access modes.
  • Date: Tue, 24 Feb 2015 10:58:49 +0100
  • List-archive: <http://lists.gforge.inria.fr/pipermail/starpu-devel/>
  • List-id: "Developers list. For discussion of new features, code changes, etc." <starpu-devel.lists.gforge.inria.fr>

Hello,

I made a patch for "implicit_data_depcs.c" to remove the circular dependency.  I used yesterday trunk version.

- In the case "severak predecessors, adding sync task", when a handle is used multiple time by the same task (RW after R), a dependency is added between the "post_sync_task" and the "sync_task" by "_starpu_add_sync_task". Then a dependency is added between the "sync_task" and the "post_sync_task" by "_starpu_add_accessor".
- In order to ignore the post_sync_task in "_starpu_add_sync_task", I added an argument to differentiate the task that must be ignored from the post_sync_task.
- Now, the dependencies between the post_sync_task and the sync_task is no longer added.

The MWE seems to work correctly now, although I did not check the interactions with the DSM.

Regards,
Jean-Marie Couteyen

Le 19/02/2015 17:31, Jean-Marie Couteyen a écrit :
54E60FEB.6090505@inria.fr">Hello,

I used to submit tasks with multiple time the same handles in StarPU 1.1.x without issues (mostly STARPU_R / STARPU_RW). I thought this to be valid code since I never had issues with it and nothing advertise against it in the manual.

I tried the branches/1.2 and the trunk with my code and I ran into issues doing this. A deadlock occurs with some kind of cyclic dependencies between tasks according to the macro _STARPU_DEP_DEBUG. It seems that the code to detect implicit dependencies have evolved heavily between 1.1 and 1.2.

I made a MWE which illustrate the issue. It works with 1.1.3, and deadlock with branches/1.2 (I did not try trunk with this one).

Is it possible to do something?

Regards.

Jean-Marie Couteyen




_______________________________________________
Starpu-devel mailing list
Starpu-devel@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/starpu-devel

--- implicit_data_deps.c 2015-02-24 10:41:12.386142000 +0100
+++ implicit_data_deps.c.jm 2015-02-24 10:41:01.016032000 +0100
@@ -100,7 +100,7 @@
}

/* This adds a new synchronization task which depends on all the previous
accessors */
-static void _starpu_add_sync_task(starpu_data_handle_t handle, struct
starpu_task *pre_sync_task, struct starpu_task *post_sync_task)
+static void _starpu_add_sync_task(starpu_data_handle_t handle, struct
starpu_task *pre_sync_task, struct starpu_task *post_sync_task, struct
starpu_task *ignored_task)
{
/* Count the existing accessors */
unsigned naccessors = 0;
@@ -108,7 +108,7 @@
l = handle->last_submitted_accessors.next;
while (l != &handle->last_submitted_accessors)
{
- if (l->task != post_sync_task)
+ if (l->task != ignored_task)
naccessors++;
l = l->next;
}
@@ -123,7 +123,7 @@
while (l != &handle->last_submitted_accessors)
{
STARPU_ASSERT(l->task);
- if (l->task != post_sync_task)
+ if (l->task != ignored_task)
{
task_array[i++] = l->task;
_starpu_add_dependency(handle, l->task, pre_sync_task);
@@ -251,7 +251,7 @@
* combine with others anyway, use it
* as synchronization task by making it
* wait for the previous ones. */
- _starpu_add_sync_task(handle, pre_sync_task, post_sync_task);
+ _starpu_add_sync_task(handle, pre_sync_task, post_sync_task,
post_sync_task);
} else {
_STARPU_DEP_DEBUG("several predecessors, adding sync task\n");
/* insert an empty synchronization task
@@ -269,7 +269,7 @@
sync_task->cl = NULL;

/* Make this task wait for the previous ones */
- _starpu_add_sync_task(handle, sync_task, sync_task);
+ _starpu_add_sync_task(handle, sync_task, sync_task, post_sync_task);
/* And the requested task wait for this one */
_starpu_add_accessor(handle, pre_sync_task, post_sync_task,
post_sync_task_dependency_slot);




Archives gérées par MHonArc 2.6.19+.

Haut de le page