瀏覽代碼

Make starpu_data_is_on_node public

Samuel Thibault 6 年之前
父節點
當前提交
97d7c6d464

+ 1 - 1
doc/doxygen/chapters/350_scheduling_policy_definition.doxy

@@ -83,7 +83,7 @@ starpu_task_expected_length(), for the required data transfers with
 starpu_task_expected_data_transfer_time_for(), for the required energy with
 starpu_task_expected_energy(), etc. Other
 useful functions include starpu_transfer_bandwidth(), starpu_transfer_latency(),
-starpu_transfer_predict(), ...
+starpu_transfer_predict(), ... One can also directly the presence of a data handle with starpu_data_is_on_node().
 
 Usual functions can be used on tasks, for instance one can use the following to
 get the data size for a task.

+ 5 - 0
doc/doxygen/chapters/api/data_management.doxy

@@ -243,6 +243,11 @@ block until the transfer is achieved, else the call will return immediately,
 after having just queued the request. In the latter case, the request will
 asynchronously wait for the completion of any task writing on the data.
 
+\fn int starpu_data_is_on_node(starpu_data_handle_t handle, int node)
+\ingroup API_Data_Management
+Check whether a valid copy of \p handle is currently available on memory node \p
+node .
+
 \fn void starpu_data_wont_use(starpu_data_handle_t handle)
 \ingroup API_Data_Management
 Advise StarPU that \p handle will not be used in the close future, and is

+ 2 - 0
include/starpu_data.h

@@ -113,6 +113,8 @@ int starpu_data_prefetch_on_node_prio(starpu_data_handle_t handle, unsigned node
 int starpu_data_idle_prefetch_on_node(starpu_data_handle_t handle, unsigned node, unsigned async);
 int starpu_data_idle_prefetch_on_node_prio(starpu_data_handle_t handle, unsigned node, unsigned async, int prio);
 
+unsigned starpu_data_is_on_node(starpu_data_handle_t handle, unsigned node);
+
 void starpu_data_wont_use(starpu_data_handle_t handle);
 
 #define STARPU_MAIN_RAM 0

+ 2 - 2
src/core/perfmodel/perfmodel.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2011,2012,2014,2016,2017                 Inria
- * Copyright (C) 2008-2018                                Université de Bordeaux
+ * Copyright (C) 2008-2019                                Université de Bordeaux
  * Copyright (C) 2010-2017                                CNRS
  * Copyright (C) 2013                                     Thibaut Lambert
  * Copyright (C) 2011                                     Télécom-SudParis
@@ -311,7 +311,7 @@ double starpu_data_expected_transfer_time(starpu_data_handle_t handle, unsigned
 	if (!(mode & STARPU_R))
 		return 0.0;
 
-	if (_starpu_is_data_present_or_requested(handle, memory_node))
+	if (starpu_data_is_on_node(handle, memory_node))
 		return 0.0;
 
 	size_t size = _starpu_data_get_size(handle);

+ 2 - 2
src/datawizard/coherency.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2011-2014,2016,2017                      Inria
- * Copyright (C) 2008-2018                                Université de Bordeaux
+ * Copyright (C) 2008-2019                                Université de Bordeaux
  * Copyright (C) 2018                                     Federal University of Rio Grande do Sul (UFRGS)
  * Copyright (C) 2010-2018                                CNRS
  *
@@ -1422,7 +1422,7 @@ static void _starpu_fetch_nowhere_task_input_cb(void *arg)
 
 /* NB : this value can only be an indication of the status of a data
 	at some point, but there is no strong garantee ! */
-unsigned _starpu_is_data_present_or_requested(starpu_data_handle_t handle, unsigned node)
+unsigned starpu_data_is_on_node(starpu_data_handle_t handle, unsigned node)
 {
 	unsigned ret = 0;
 

+ 0 - 2
src/datawizard/coherency.h

@@ -321,8 +321,6 @@ int _starpu_fetch_task_input(struct starpu_task *task, struct _starpu_job *j, in
 void _starpu_fetch_task_input_tail(struct starpu_task *task, struct _starpu_job *j, struct _starpu_worker *worker);
 void _starpu_fetch_nowhere_task_input(struct _starpu_job *j);
 
-unsigned _starpu_is_data_present_or_requested(struct _starpu_data_state *state, unsigned node);
-
 int _starpu_select_src_node(struct _starpu_data_state *state, unsigned destination);
 
 /* is_prefetch is whether the DSM may drop the request (when there is not enough memory for instance