Explorar o código

port r11297 from 1.1: Avoid looking through all data for not_important data if the application did not set any data as not_important.

Samuel Thibault %!s(int64=12) %!d(string=hai) anos
pai
achega
01aa31bde8

+ 2 - 0
src/datawizard/coherency.h

@@ -98,6 +98,8 @@ struct _starpu_task_wrapper_list
 	struct _starpu_task_wrapper_list *next;
 };
 
+extern int _starpu_has_not_important_data;
+
 struct _starpu_data_state
 {
 	struct _starpu_data_requester_list *req_list;

+ 3 - 0
src/datawizard/memalloc.c

@@ -515,6 +515,9 @@ static unsigned try_to_find_reusable_mem_chunk(unsigned node, starpu_data_handle
 		return 1;
 	}
 
+	if (!_starpu_has_not_important_data)
+		return 0;
+
 	/* now look for some non essential data in the active list */
 	for (mc = _starpu_mem_chunk_list_begin(mc_list[node]);
 	     mc != _starpu_mem_chunk_list_end(mc_list[node]);

+ 4 - 0
src/datawizard/user_interactions.c

@@ -444,8 +444,12 @@ int starpu_data_prefetch_on_node(starpu_data_handle_t handle, unsigned node, uns
  *	It is possible to specify that a piece of data can be discarded without
  *	impacting the application.
  */
+int _starpu_has_not_important_data;
 void starpu_data_advise_as_important(starpu_data_handle_t handle, unsigned is_important)
 {
+	if (!is_important)
+		_starpu_has_not_important_data = 1;
+
 	_starpu_spin_lock(&handle->header_lock);
 
 	/* first take all the children lock (in order !) */