瀏覽代碼

Fix papi memleak with parallel tasks

Samuel Thibault 4 年之前
父節點
當前提交
ab2095045a
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      src/drivers/cpu/driver_cpu.c

+ 4 - 2
src/drivers/cpu/driver_cpu.c

@@ -114,11 +114,13 @@ static int execute_job_on_cpu(struct _starpu_job *j, struct starpu_task *worker_
 			}
 #else
 #  ifdef STARPU_PAPI
-			_starpu_profiling_papi_task_start_counters(task);
+			if (rank == 0)
+				_starpu_profiling_papi_task_start_counters(task);
 #  endif
 			func(_STARPU_TASK_GET_INTERFACES(task), task->cl_arg);
 #  ifdef STARPU_PAPI
-			_starpu_profiling_papi_task_stop_counters(task);
+			if (rank == 0)
+				_starpu_profiling_papi_task_stop_counters(task);
 #  endif
 #endif
 			_STARPU_TRACE_END_EXECUTING();