Bläddra i källkod

Regenerated task structures can not be deinitialized, as waiting for the callback is not enough to wait for starpu to be done with it, and some of these regenerated tasks are actually re-scheduled so starpu can't know how to properly wait for them

Samuel Thibault 13 år sedan
förälder
incheckning
61599d233e

+ 6 - 3
doc/chapters/basic-api.texi

@@ -1472,9 +1472,12 @@ by the task have to be freed by calling
 @end deftypefun
 
 @deftypefun void starpu_task_deinit ({struct starpu_task} *@var{task})
-Release all the structures automatically allocated to execute @var{task}. This is
-called automatically by @code{starpu_task_destroy}, but the task structure itself is not
-freed. This should be used for statically allocated tasks for instance.
+Release all the structures automatically allocated to execute @var{task}, but
+not the task structure itself. It is thus useful for statically allocated tasks
+for instance.  It is called automatically by @code{starpu_task_destroy}.  It
+has to be called only after explicitly waiting for the task (waiting for the
+callback is not enough, since starpu still manipulates the task after calling
+the callback).
 @end deftypefun
 
 @deftypefun void starpu_task_destroy ({struct starpu_task} *@var{task})

+ 4 - 1
tests/core/regenerate.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2010-2011  Université de Bordeaux 1
+ * Copyright (C) 2010-2012  Université de Bordeaux 1
  * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -118,7 +118,10 @@ int main(int argc, char **argv)
 	FPRINTF(stderr, "Total: %f secs\n", timing/1000000);
 	FPRINTF(stderr, "Per task: %f usecs\n", timing/ntasks);
 
+	/* Do not cleanup the statically allocated tasks, as StarPU is still working on it after the callback */
+#if 0
 	starpu_task_deinit(&task);
+#endif
 	starpu_shutdown();
 
 	return EXIT_SUCCESS;

+ 4 - 2
tests/core/subgraph_repeat.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2010  Université de Bordeaux 1
+ * Copyright (C) 2010, 2012  Université de Bordeaux 1
  * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -132,11 +132,13 @@ int main(int argc, char **argv)
 
 	STARPU_ASSERT(check_cnt == (4*loop_cnt));
 
-	/* Cleanup the statically allocated tasks */
+	/* Do not cleanup the statically allocated tasks, as StarPU is still working on it after the callback */
+#if 0
 	starpu_task_deinit(&taskA);
 	starpu_task_deinit(&taskB);
 	starpu_task_deinit(&taskC);
 	starpu_task_deinit(&taskD);
+#endif
 
 	starpu_shutdown();
 

+ 4 - 2
tests/core/subgraph_repeat_regenerate.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2010-2011  Université de Bordeaux 1
+ * Copyright (C) 2010-2012  Université de Bordeaux 1
  * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -137,11 +137,13 @@ int main(int argc, char **argv)
 
 	STARPU_ASSERT(check_cnt == (4*loop_cnt));
 
-	/* Cleanup the statically allocated tasks */
+	/* Do not cleanup the statically allocated tasks, as StarPU is still working on it after the callback */
+#if 0
 	starpu_task_deinit(&taskA);
 	starpu_task_deinit(&taskB);
 	starpu_task_deinit(&taskC);
 	starpu_task_deinit(&taskD);
+#endif
 
 	starpu_shutdown();