Explorar o código

Call starpu_profiling_init automatically during starpu_init

Cédric Augonnet %!s(int64=14) %!d(string=hai) anos
pai
achega
18d2a219cc

+ 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++)