Browse Source

Avoid multiple profiling_info allocation for restarted tasks

Samuel Thibault 4 years ago
parent
commit
45cac47b0a
1 changed files with 6 additions and 3 deletions
  1. 6 3
      src/core/task.c

+ 6 - 3
src/core/task.c

@@ -948,10 +948,13 @@ int _starpu_task_submit(struct starpu_task *task, int nodeps)
 
 	/* If profiling is activated, we allocate a structure to store the
 	 * appropriate info. */
-	struct starpu_profiling_task_info *info;
+	struct starpu_profiling_task_info *info = task->profiling_info;
 	int profiling = starpu_profiling_status_get();
-	info = _starpu_allocate_profiling_info_if_needed(task);
-	task->profiling_info = info;
+	if (!info)
+	{
+		info = _starpu_allocate_profiling_info_if_needed(task);
+		task->profiling_info = info;
+	}
 
 	/* The task is considered as block until we are sure there remains not
 	 * dependency. */