瀏覽代碼

Call starpu_profiling_init automatically during starpu_init

Cédric Augonnet 14 年之前
父節點
當前提交
18d2a219cc
共有 5 個文件被更改,包括 4 次插入8 次删除
  1. 1 3
      examples/lu/lu_example.c
  2. 0 1
      examples/profiling/profiling.c
  3. 0 3
      include/starpu_profiling.h
  4. 2 0
      src/core/workers.c
  5. 1 1
      src/profiling/profiling.c

+ 1 - 3
examples/lu/lu_example.c

@@ -280,10 +280,8 @@ int main(int argc, char **argv)
 	if (bound)
 		starpu_bound_start(bounddeps, boundprio);
 
-	if (profile) {
-		starpu_profiling_init();
+	if (profile)
 		starpu_profiling_status_set(STARPU_PROFILING_ENABLE);
-	}
 
 	/* Factorize the matrix (in place) */
 	if (pivot)

+ 0 - 1
examples/profiling/profiling.c

@@ -34,7 +34,6 @@ int main(int argc, char **argv)
 	starpu_init(NULL);
 
 	/* Enable profiling */
-	starpu_profiling_init();
 	starpu_profiling_status_set(STARPU_PROFILING_ENABLE);
 
 	/* We should observe at least 500ms in the sleep time reported by every

+ 0 - 3
include/starpu_profiling.h

@@ -75,9 +75,6 @@ struct starpu_bus_profiling_info {
 	int transfer_count;
 };
 
-/* This function needs to be called before other starpu_profile_* functions */
-int starpu_profiling_init(void);
-
 /* This function sets the profiling status:
  * - enable with STARPU_PROFILING_ENABLE
  * - disable with STARPU_PROFILING_DISABLE 

+ 2 - 0
src/core/workers.c

@@ -257,6 +257,8 @@ int starpu_init(struct starpu_conf *user_conf)
 
 	_starpu_timing_init();
 
+	_starpu_profiling_init();
+
 	_starpu_load_bus_performance_files();
 
 	/* store the pointer to the user explicit configuration during the

+ 1 - 1
src/profiling/profiling.c

@@ -91,7 +91,7 @@ int starpu_profiling_status_get(void)
 	return profiling;
 }
 
-void starpu_profiling_init(void)
+void _starpu_profiling_init(void)
 {
 	int worker;
 	for (worker = 0; worker < STARPU_NMAXWORKERS; worker++)