Browse Source

datastats: fix use of STARPU_ENABLE_STATS

Nathalie Furmento 9 years ago
parent
commit
1bc5278778
3 changed files with 12 additions and 2 deletions
  1. 2 0
      src/core/topology.c
  2. 7 1
      src/datawizard/datastats.c
  3. 3 1
      src/datawizard/datastats.h

+ 2 - 0
src/core/topology.c

@@ -28,6 +28,7 @@
 #include <drivers/mp_common/source_common.h>
 #include <drivers/opencl/driver_opencl.h>
 #include <profiling/profiling.h>
+#include <datawizard/datastats.h>
 #include <datawizard/memory_nodes.h>
 #include <common/uthash.h>
 
@@ -1675,6 +1676,7 @@ _starpu_build_topology (struct _starpu_machine_config *config, int no_mp_config)
 
 	/* for the data management library */
 	_starpu_memory_nodes_init();
+	_starpu_datastats_init();
 
 	_starpu_init_workers_binding(config, no_mp_config);
 

+ 7 - 1
src/datawizard/datastats.c

@@ -20,9 +20,15 @@
 #include <datawizard/coherency.h>
 #include <common/config.h>
 
+static int _enable_stats = 0;
+
+void _starpu_datastats_init()
+{
+	_enable_stats = !!starpu_getenv("STARPU_ENABLE_STATS");
+}
+
 static inline int starpu_enable_stats(void)
 {
-	static int _enable_stats = !!starpu_getenv("STARPU_ENABLE_STATS");
 	return _enable_stats;
 }
 

+ 3 - 1
src/datawizard/datastats.h

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009, 2010  Université de Bordeaux
- * Copyright (C) 2010, 2011, 2012  CNRS
+ * Copyright (C) 2010, 2011, 2012, 2015  CNRS
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -23,6 +23,8 @@
 #include <stdint.h>
 #include <stdlib.h>
 
+void _starpu_datastats_init();
+
 void _starpu_msi_cache_hit(unsigned node);
 void _starpu_msi_cache_miss(unsigned node);