Browse Source

turn function _starpu_display_memory_stats public

Nathalie Furmento 12 years ago
parent
commit
b98e629137

+ 6 - 0
doc/chapters/basic-api.texi

@@ -2416,6 +2416,12 @@ variable @code{STARPU_WORKER_STATS} is defined. The function is called
 automatically by @code{starpu_shutdown()}.
 automatically by @code{starpu_shutdown()}.
 @end deftypefun
 @end deftypefun
 
 
+@deftypefun void starpu_display_memory_stats ()
+Display statistics about the current data handles registered within
+StarPU. StarPU must have been configured with the option
+@code{----enable-memory-stats} (@pxref{Memory feedback}).
+@end deftypefun
+
 @node CUDA extensions
 @node CUDA extensions
 @section CUDA extensions
 @section CUDA extensions
 
 

+ 3 - 1
doc/chapters/perf-feedback.texi

@@ -440,7 +440,9 @@ correct), and relaxed solving (which provides an approximate solution).
 @section Memory feedback
 @section Memory feedback
 
 
 It is possible to enable memory statistics. To do so, you need to pass the option
 It is possible to enable memory statistics. To do so, you need to pass the option
-@code{--enable-memory-stats} when running configure.
+@code{--enable-memory-stats} when running configure. It is then
+possible to call the function @code{starpu_display_memory_stats()} to
+display statistics about the current data handles registered within StarPU.
 
 
 Moreover, when setting the environment variable @code{STARPU_MEMORY_STATUS}, statistics will be displayed at the end
 Moreover, when setting the environment variable @code{STARPU_MEMORY_STATUS}, statistics will be displayed at the end
 of the execution on data handles which have not been cleared out.
 of the execution on data handles which have not been cleared out.

+ 1 - 0
include/starpu_data.h

@@ -87,6 +87,7 @@ void starpu_data_release_on_node(starpu_data_handle_t handle, unsigned node);
 
 
 int starpu_malloc(void **A, size_t dim);
 int starpu_malloc(void **A, size_t dim);
 int starpu_free(void *A);
 int starpu_free(void *A);
+void starpu_display_memory_stats();
 
 
 /* XXX These macros are provided to avoid breaking old codes. But consider
 /* XXX These macros are provided to avoid breaking old codes. But consider
  * these function names as deprecated. */
  * these function names as deprecated. */

+ 1 - 1
src/core/workers.c

@@ -884,7 +884,7 @@ void starpu_shutdown(void)
 	_starpu_display_alloc_cache_stats();
 	_starpu_display_alloc_cache_stats();
 	_starpu_display_comm_amounts();
 	_starpu_display_comm_amounts();
 
 
-	_starpu_display_memory_stats();
+	starpu_display_memory_stats();
 
 
 	starpu_bus_profiling_helper_display_summary();
 	starpu_bus_profiling_helper_display_summary();
 	starpu_worker_profiling_helper_display_summary();
 	starpu_worker_profiling_helper_display_summary();

+ 1 - 1
src/datawizard/memalloc.c

@@ -956,7 +956,7 @@ void _starpu_display_memory_stats_by_node(int node)
 }
 }
 #endif
 #endif
 
 
-void _starpu_display_memory_stats(void)
+void starpu_display_memory_stats(void)
 {
 {
 #ifdef STARPU_MEMORY_STATS
 #ifdef STARPU_MEMORY_STATS
 	unsigned node;
 	unsigned node;

+ 0 - 1
src/datawizard/memalloc.h

@@ -64,7 +64,6 @@ size_t _starpu_free_all_automatically_allocated_buffers(uint32_t node);
 void _starpu_memchunk_recently_used(struct _starpu_mem_chunk *mc, unsigned node);
 void _starpu_memchunk_recently_used(struct _starpu_mem_chunk *mc, unsigned node);
 
 
 void _starpu_display_memory_stats_by_node(int node);
 void _starpu_display_memory_stats_by_node(int node);
-void _starpu_display_memory_stats();
 void _starpu_display_memory_handle_stats(starpu_data_handle_t handle);
 void _starpu_display_memory_handle_stats(starpu_data_handle_t handle);
 
 
 void _starpu_handle_stats_cache_hit(starpu_data_handle_t handle, unsigned node);
 void _starpu_handle_stats_cache_hit(starpu_data_handle_t handle, unsigned node);