Просмотр исходного кода

task_deinit after starpu_shutdown should be fine

Samuel Thibault лет назад: 13
Родитель
Сommit
4d56ac8307

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

@@ -1475,9 +1475,9 @@ by the task have to be freed by calling
 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).
+has to be called only after explicitly waiting for the task or after
+@code{starpu_shutdown} (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})

+ 3 - 4
tests/core/regenerate.c

@@ -118,12 +118,11 @@ 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();
 
+	/* Cleanup the statically allocated tasks after shutdown, as StarPU is still working on it after the callback */
+	starpu_task_deinit(&task);
+
 	return EXIT_SUCCESS;
 
 enodev:

+ 3 - 5
tests/core/static_restartable_tag.c

@@ -96,11 +96,6 @@ int main(int argc, char **argv)
 		STARPU_CHECK_RETURN_VALUE(ret, "starpu_tag_wait");
 	}
 
-	/* Do not cleanup the statically allocated tasks, as StarPU is still working on it after releasing the tag */
-#if 0
-	starpu_task_deinit(&task);
-#endif
-
 	gettimeofday(&end, NULL);
 
 	timing = (double)((end.tv_sec - start.tv_sec)*1000000
@@ -111,6 +106,9 @@ int main(int argc, char **argv)
 
 	starpu_shutdown();
 
+	/* Cleanup the statically allocated tasks after shutdown, as StarPU is still working on it after the callback */
+	starpu_task_deinit(&task);
+
 	return EXIT_SUCCESS;
 
 enodev:

+ 3 - 5
tests/core/subgraph_repeat.c

@@ -132,15 +132,13 @@ int main(int argc, char **argv)
 
 	STARPU_ASSERT(check_cnt == (4*loop_cnt));
 
-	/* Do not cleanup the statically allocated tasks, as StarPU is still working on it after the callback */
-#if 0
+	starpu_shutdown();
+
+	/* Cleanup the statically allocated tasks after shutdown, as StarPU is still working on it after the callback */
 	starpu_task_deinit(&taskA);
 	starpu_task_deinit(&taskB);
 	starpu_task_deinit(&taskC);
 	starpu_task_deinit(&taskD);
-#endif
-
-	starpu_shutdown();
 
 	return EXIT_SUCCESS;
 

+ 3 - 5
tests/core/subgraph_repeat_regenerate.c

@@ -137,15 +137,13 @@ int main(int argc, char **argv)
 
 	STARPU_ASSERT(check_cnt == (4*loop_cnt));
 
-	/* Do not cleanup the statically allocated tasks, as StarPU is still working on it after the callback */
-#if 0
+	starpu_shutdown();
+
+	/* Cleanup the statically allocated tasks after shutdown, as StarPU is still working on it after the callback */
 	starpu_task_deinit(&taskA);
 	starpu_task_deinit(&taskB);
 	starpu_task_deinit(&taskC);
 	starpu_task_deinit(&taskD);
-#endif
-
-	starpu_shutdown();
 
 	return EXIT_SUCCESS;