Explorar o código

memory stats: rename memory_status objects to memory_stats objects as what is displayed are statistics

Nathalie Furmento %!s(int64=12) %!d(string=hai) anos
pai
achega
4ba3bb5eab

+ 7 - 7
configure.ac

@@ -919,13 +919,13 @@ if test x$enable_stats = xyes; then
         AC_DEFINE(STARPU_ENABLE_STATS, [1], [enable statistics])
 fi
 
-AC_MSG_CHECKING(whether memory status should be displayed)
-AC_ARG_ENABLE(memory-status, [AS_HELP_STRING([--enable-memory-status],
-			     [display memory status at the end of execution])],
-			     enable_memory_status=$enableval, enable_memory_status=no)
-AC_MSG_RESULT($enable_memory_status)
-if test x$enable_memory_status = xyes; then
-        AC_DEFINE(STARPU_MEMORY_STATUS, [1], [display memory status])
+AC_MSG_CHECKING(whether memory stats should be displayed)
+AC_ARG_ENABLE(memory-stats, [AS_HELP_STRING([--enable-memory-stats],
+			     [enable memory stats])],
+			     enable_memory_stats=$enableval, enable_memory_stats=no)
+AC_MSG_RESULT($enable_memory_stats)
+if test x$enable_memory_stats = xyes; then
+        AC_DEFINE(STARPU_MEMORY_STATS, [1], [enable memory stats])
 fi
 
 AC_CHECK_HEADERS([glpk.h])

+ 3 - 3
src/core/workers.c

@@ -650,8 +650,8 @@ int starpu_init(struct starpu_conf *user_conf)
 	_STARPU_DISP("Warning: StarPU was configured without --enable-fast\n");
 #endif
 #endif
-#ifdef STARPU_MEMORY_STATUS
-	_STARPU_DISP("Warning: StarPU was configured with --enable-memory-status, which slows down a bit\n");
+#ifdef STARPU_MEMORY_STATS
+	_STARPU_DISP("Warning: StarPU was configured with --enable-memory-stats, which slows down a bit\n");
 #endif
 #ifdef STARPU_VERBOSE
 	_STARPU_DISP("Warning: StarPU was configured with --enable-verbose, which slows down a bit\n");
@@ -884,7 +884,7 @@ void starpu_shutdown(void)
 	_starpu_display_alloc_cache_stats();
 	_starpu_display_comm_amounts();
 
-	_starpu_display_memory_status();
+	_starpu_display_memory_stats();
 
 	starpu_bus_profiling_helper_display_summary();
 	starpu_worker_profiling_helper_display_summary();

+ 2 - 2
src/datawizard/coherency.c

@@ -349,14 +349,14 @@ struct _starpu_data_request *_starpu_create_request_to_fetch_data(starpu_data_ha
 
 	if (dst_replicate->state != STARPU_INVALID)
 	{
-#ifdef STARPU_MEMORY_STATUS
+#ifdef STARPU_MEMORY_STATS
 		enum _starpu_cache_state old_state = dst_replicate->state;
 #endif
 		/* the data is already available so we can stop */
 		_starpu_update_data_state(handle, dst_replicate, mode);
 		_starpu_msi_cache_hit(requesting_node);
 
-#ifdef STARPU_MEMORY_STATUS
+#ifdef STARPU_MEMORY_STATS
 		_starpu_handle_stats_cache_hit(handle, requesting_node);
 
 		/* XXX Broken ? */

+ 2 - 2
src/datawizard/coherency.h

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009-2012  Université de Bordeaux 1
- * Copyright (C) 2010, 2011  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
  *
  * 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
@@ -210,7 +210,7 @@ struct _starpu_data_state
         int rank;
 	int tag;
 
-#ifdef STARPU_MEMORY_STATUS
+#ifdef STARPU_MEMORY_STATS
 	/* Handle access stats per node */
 	unsigned stats_direct_access[STARPU_MAXNODES];
 	unsigned stats_loaded_shared[STARPU_MAXNODES];

+ 3 - 3
src/datawizard/data_request.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009-2012  Université de Bordeaux 1
- * Copyright (C) 2010, 2011  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
  *
  * 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
@@ -234,14 +234,14 @@ static void starpu_handle_data_request_completion(struct _starpu_data_request *r
 	struct _starpu_data_replicate *dst_replicate = r->dst_replicate;
 
 
-#ifdef STARPU_MEMORY_STATUS
+#ifdef STARPU_MEMORY_STATS
 	enum _starpu_cache_state old_src_replicate_state = src_replicate->state;
 #endif
 
 	_starpu_spin_checklocked(&handle->header_lock);
 	_starpu_update_data_state(handle, r->dst_replicate, mode);
 
-#ifdef STARPU_MEMORY_STATUS
+#ifdef STARPU_MEMORY_STATS
 	if (src_replicate->state == STARPU_INVALID)
 	{
 		if (old_src_replicate_state == STARPU_OWNER)

+ 1 - 1
src/datawizard/interfaces/data_interface.c

@@ -242,7 +242,7 @@ static starpu_data_handle_t _starpu_data_handle_allocate(struct starpu_data_inte
 	unsigned node;
 	for (node = 0; node < STARPU_MAXNODES; node++)
 	{
-#ifdef STARPU_MEMORY_STATUS
+#ifdef STARPU_MEMORY_STATS
 		/* Stats initilization */
 		handle->stats_direct_access[node]=0;
 		handle->stats_loaded_shared[node]=0;

+ 13 - 13
src/datawizard/memalloc.c

@@ -344,7 +344,7 @@ static size_t try_to_free_mem_chunk(struct _starpu_mem_chunk *mc, unsigned node)
 		{
 			STARPU_ASSERT(handle->per_node[node].refcnt == 0);
 
-#ifdef STARPU_MEMORY_STATUS
+#ifdef STARPU_MEMORY_STATS
 			if (handle->per_node[node].state == STARPU_OWNER)
 				_starpu_handle_stats_invalidated(handle, node);
 			/* else XXX Considering only owner to invalidate */
@@ -354,7 +354,7 @@ static size_t try_to_free_mem_chunk(struct _starpu_mem_chunk *mc, unsigned node)
 			 * away after writing it back to main memory */
 			transfer_subtree_to_node(handle, node, 0);
 
-#ifdef STARPU_MEMORY_STATUS
+#ifdef STARPU_MEMORY_STATS
 			_starpu_handle_stats_loaded_owner(handle, 0);
 #endif
 			STARPU_ASSERT(handle->per_node[node].refcnt == 0);
@@ -931,8 +931,8 @@ static void starpu_lru(unsigned node)
 }
 
 
-#ifdef STARPU_MEMORY_STATUS
-void _starpu_display_memory_status_by_node(int node)
+#ifdef STARPU_MEMORY_STATS
+void _starpu_display_memory_stats_by_node(int node)
 {
 	_STARPU_PTHREAD_RWLOCK_WRLOCK(&mc_rwlock[node]);
 
@@ -947,7 +947,7 @@ void _starpu_display_memory_status_by_node(int node)
 		     mc != _starpu_mem_chunk_list_end(mc_list[node]);
 		     mc = _starpu_mem_chunk_list_next(mc))
 		{
-			_starpu_display_memory_handle_status(mc->data);
+			_starpu_display_memory_handle_stats(mc->data);
 		}
 
 	}
@@ -956,27 +956,27 @@ void _starpu_display_memory_status_by_node(int node)
 }
 #endif
 
-void _starpu_display_memory_status(void)
+void _starpu_display_memory_stats(void)
 {
-#ifdef STARPU_MEMORY_STATUS
+#ifdef STARPU_MEMORY_STATS
 	unsigned node;
-	const char *status;
+	const char *stats;
 
-	if ((status = getenv("STARPU_MEMORY_STATUS")) && atoi(status))
+	if ((stats = getenv("STARPU_MEMORY_STATS")) && atoi(stats))
 	{
 		fprintf(stderr, "\n#---------------------\n");
-		fprintf(stderr, "Memory status :\n");
+		fprintf(stderr, "Memory stats :\n");
 		for (node = 0; node < STARPU_MAXNODES; node++)
 		{
-			_starpu_display_memory_status_by_node(node);
+			_starpu_display_memory_stats_by_node(node);
 		}
 		fprintf(stderr, "\n#---------------------\n");
 	}
 #endif
 }
 
-#ifdef STARPU_MEMORY_STATUS
-void _starpu_display_memory_handle_status(starpu_data_handle_t handle)
+#ifdef STARPU_MEMORY_STATS
+void _starpu_display_memory_handle_stats(starpu_data_handle_t handle)
 {
 	unsigned node;
 

+ 3 - 3
src/datawizard/memalloc.h

@@ -63,9 +63,9 @@ int _starpu_allocate_memory_on_node(starpu_data_handle_t handle, struct _starpu_
 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_display_memory_status_by_node(int node);
-void _starpu_display_memory_status();
-void _starpu_display_memory_handle_status(starpu_data_handle_t handle);
+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_handle_stats_cache_hit(starpu_data_handle_t handle, unsigned node);
 void _starpu_handle_stats_loaded_shared(starpu_data_handle_t handle, unsigned node);