Quellcode durchsuchen

Add starpu_data_idle_prefetch_on_node

Samuel Thibault vor 10 Jahren
Ursprung
Commit
4c6de74837

+ 2 - 0
ChangeLog

@@ -83,6 +83,8 @@ New features:
   * New performance model format to better represent parallel tasks.
     Used to provide estimations for the execution times of the
     parallel tasks on scheduling contexts or combined workers.
+  * starpu_data_idle_prefetch_on_node allows to queue prefetches to be done
+    only when the bus is idle.
 
 Small features:
   * Tasks can now have a name (via the field const char *name of

+ 1 - 0
doc/devel/replicate_refcnt

@@ -57,6 +57,7 @@ Function detail
   - _starpu_allocate_interface()
   - _starpu_prefetch_data_on_node_with_mode(), when produced by the call to _starpu_fetch_data_on_node (!detached)
   - starpu_data_prefetch_on_node(), 
+  - starpu_data_idle_prefetch_on_node(), 
   - starpu_data_invalidate()
   - _starpu_data_unregister()
   - _starpu_benchmark_ping_pong()

+ 4 - 2
doc/doxygen/chapters/07data_management.doxy

@@ -104,8 +104,10 @@ setting up an initial statically-computed data distribution on the machine
 before submitting tasks, which will thus guide StarPU toward an initial task
 distribution (since StarPU will try to avoid further transfers).
 
-This can be achieved by giving the function starpu_data_prefetch_on_node()
-the handle and the desired target memory node.
+This can be achieved by giving the function starpu_data_prefetch_on_node() the
+handle and the desired target memory node. The
+starpu_data_idle_prefetch_on_node() variant can be used to issue the transfer
+only when the bus is idle.
 
 \section PartitioningData Partitioning Data
 

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

@@ -177,6 +177,15 @@ 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_idle_prefetch_on_node(starpu_data_handle_t handle, unsigned node, unsigned async)
+\ingroup API_Data_Management
+Issue an idle prefetch request for a given data to a given node, i.e.
+requests that the data be replicated to the given node, so that it is
+available there for tasks, but only when the bus is really idle. If the \p async parameter is 0, the call will
+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 starpu_data_handle_t starpu_data_lookup(const void *ptr)
 \ingroup API_Data_Management
 Return the handle corresponding to the data pointed to by the \p ptr host pointer.

+ 1 - 0
include/starpu_data.h

@@ -89,6 +89,7 @@ void starpu_data_display_memory_stats();
 int starpu_data_request_allocation(starpu_data_handle_t handle, unsigned node);
 
 int starpu_data_prefetch_on_node(starpu_data_handle_t handle, unsigned node, unsigned async);
+int starpu_data_idle_prefetch_on_node(starpu_data_handle_t handle, unsigned node, unsigned async);
 
 #define STARPU_MAIN_RAM 0
 

+ 5 - 5
src/datawizard/coherency.c

@@ -407,7 +407,7 @@ static struct _starpu_data_request *_starpu_search_existing_data_request(struct
 
                 /* perhaps we need to "upgrade" the request */
 		if (is_prefetch < r->prefetch)
-			_starpu_update_prefetch_status(r);
+			_starpu_update_prefetch_status(r, is_prefetch);
 
 		if (mode & STARPU_R)
 		{
@@ -622,7 +622,7 @@ struct _starpu_data_request *_starpu_create_request_to_fetch_data(starpu_data_ha
 }
 
 int _starpu_fetch_data_on_node(starpu_data_handle_t handle, struct _starpu_data_replicate *dst_replicate,
-			       enum starpu_data_access_mode mode, unsigned detached, unsigned async,
+			       enum starpu_data_access_mode mode, unsigned detached, unsigned is_prefetch, unsigned async,
 			       void (*callback_func)(void *), void *callback_arg)
 {
 	unsigned local_node = _starpu_memory_node_get_local_key();
@@ -646,7 +646,7 @@ int _starpu_fetch_data_on_node(starpu_data_handle_t handle, struct _starpu_data_
 
 	struct _starpu_data_request *r;
 	r = _starpu_create_request_to_fetch_data(handle, dst_replicate, mode,
-						 detached, async, callback_func, callback_arg);
+						 is_prefetch, async, callback_func, callback_arg);
 
 	/* If no request was created, the handle was already up-to-date on the
 	 * node. In this case, _starpu_create_request_to_fetch_data has already
@@ -663,12 +663,12 @@ int _starpu_fetch_data_on_node(starpu_data_handle_t handle, struct _starpu_data_
 
 static int prefetch_data_on_node(starpu_data_handle_t handle, struct _starpu_data_replicate *replicate, enum starpu_data_access_mode mode)
 {
-	return _starpu_fetch_data_on_node(handle, replicate, mode, 1, 1, NULL, NULL);
+	return _starpu_fetch_data_on_node(handle, replicate, mode, 1, 1, 1, NULL, NULL);
 }
 
 static int fetch_data(starpu_data_handle_t handle, struct _starpu_data_replicate *replicate, enum starpu_data_access_mode mode)
 {
-	return _starpu_fetch_data_on_node(handle, replicate, mode, 0, 0, NULL, NULL);
+	return _starpu_fetch_data_on_node(handle, replicate, mode, 0, 0, 0, NULL, NULL);
 }
 
 uint32_t _starpu_get_data_refcnt(starpu_data_handle_t handle, unsigned node)

+ 1 - 1
src/datawizard/coherency.h

@@ -242,7 +242,7 @@ void _starpu_display_msi_stats(void);
  * async means that _starpu_fetch_data_on_node will wait for completion of the request
  */
 int _starpu_fetch_data_on_node(starpu_data_handle_t handle, struct _starpu_data_replicate *replicate,
-			       enum starpu_data_access_mode mode, unsigned detached, unsigned async,
+			       enum starpu_data_access_mode mode, unsigned detached, unsigned is_prefetch, unsigned async,
 			       void (*callback_func)(void *), void *callback_arg);
 /* This releases a reference on the handle */
 void _starpu_release_data_on_node(struct _starpu_data_state *state, uint32_t default_wt_mask,

+ 50 - 10
src/datawizard/data_request.c

@@ -27,10 +27,12 @@
  */
 #define MAX_PENDING_REQUESTS_PER_NODE 20
 #define MAX_PENDING_PREFETCH_REQUESTS_PER_NODE 10
+#define MAX_PENDING_IDLE_REQUESTS_PER_NODE 1
 
 /* requests that have not been treated at all */
 static struct _starpu_data_request_list *data_requests[STARPU_MAXNODES];
 static struct _starpu_data_request_list *prefetch_requests[STARPU_MAXNODES];
+static struct _starpu_data_request_list *idle_requests[STARPU_MAXNODES];
 static starpu_pthread_mutex_t data_requests_list_mutex[STARPU_MAXNODES];
 
 /* requests that are not terminated (eg. async transfers) */
@@ -45,6 +47,7 @@ void _starpu_init_data_request_lists(void)
 	{
 		data_requests[i] = _starpu_data_request_list_new();
 		prefetch_requests[i] = _starpu_data_request_list_new();
+		idle_requests[i] = _starpu_data_request_list_new();
 
 		/* Tell helgrind that we are fine with checking for list_empty
 		 * in _starpu_handle_node_data_requests, we will call it
@@ -53,6 +56,8 @@ void _starpu_init_data_request_lists(void)
 		STARPU_HG_DISABLE_CHECKING(data_requests[i]->_head);
 		STARPU_HG_DISABLE_CHECKING(prefetch_requests[i]);
 		STARPU_HG_DISABLE_CHECKING(prefetch_requests[i]->_head);
+		STARPU_HG_DISABLE_CHECKING(idle_requests[i]);
+		STARPU_HG_DISABLE_CHECKING(idle_requests[i]->_head);
 
 		STARPU_PTHREAD_MUTEX_INIT(&data_requests_list_mutex[i], NULL);
 
@@ -74,6 +79,7 @@ void _starpu_deinit_data_request_lists(void)
 		STARPU_PTHREAD_MUTEX_DESTROY(&data_requests_list_mutex[i]);
 		_starpu_data_request_list_delete(data_requests[i]);
 		_starpu_data_request_list_delete(prefetch_requests[i]);
+		_starpu_data_request_list_delete(idle_requests[i]);
 	}
 }
 
@@ -235,7 +241,9 @@ void _starpu_post_data_request(struct _starpu_data_request *r, unsigned handling
 
 	/* insert the request in the proper list */
 	STARPU_PTHREAD_MUTEX_LOCK(&data_requests_list_mutex[handling_node]);
-	if (r->prefetch)
+	if (r->prefetch == 2)
+		_starpu_data_request_list_push_back(idle_requests[handling_node], r);
+	else if (r->prefetch)
 		_starpu_data_request_list_push_back(prefetch_requests[handling_node], r);
 	else
 		_starpu_data_request_list_push_back(data_requests[handling_node], r);
@@ -539,8 +547,10 @@ int __starpu_handle_node_data_requests(struct _starpu_data_request_list **reqlis
 		STARPU_PTHREAD_MUTEX_LOCK(&data_requests_list_mutex[src_node]);
 		if (!(_starpu_data_request_list_empty(new_data_requests[0])))
 			_starpu_data_request_list_push_list_front(new_data_requests[0], data_requests[src_node]);
-		if (prefetch == 1 && !(_starpu_data_request_list_empty(new_data_requests[1])))
+		if (prefetch >= 1 && !(_starpu_data_request_list_empty(new_data_requests[1])))
 			_starpu_data_request_list_push_list_front(new_data_requests[1], prefetch_requests[src_node]);
+		if (prefetch >= 2 && !(_starpu_data_request_list_empty(new_data_requests[2])))
+			_starpu_data_request_list_push_list_front(new_data_requests[2], idle_requests[src_node]);
 		STARPU_PTHREAD_MUTEX_UNLOCK(&data_requests_list_mutex[src_node]);
 
 #ifndef STARPU_NON_BLOCKING_DRIVERS
@@ -566,6 +576,11 @@ int _starpu_handle_node_prefetch_requests(unsigned src_node, unsigned may_alloc,
 	return __starpu_handle_node_data_requests(prefetch_requests, src_node, may_alloc, MAX_PENDING_PREFETCH_REQUESTS_PER_NODE, pushed, 1);
 }
 
+int _starpu_handle_node_idle_requests(unsigned src_node, unsigned may_alloc, unsigned *pushed)
+{
+	return __starpu_handle_node_data_requests(idle_requests, src_node, may_alloc, MAX_PENDING_IDLE_REQUESTS_PER_NODE, pushed, 2);
+}
+
 static int _handle_pending_node_data_requests(unsigned src_node, unsigned force)
 {
 //	_STARPU_DEBUG("_starpu_handle_pending_node_data_requests ...\n");
@@ -693,15 +708,17 @@ int _starpu_handle_all_pending_node_data_requests(unsigned src_node)
 	return _handle_pending_node_data_requests(src_node, 1);
 }
 
+/* Note: the returned value will be outdated since the locks are not taken at
+ * entry/exit */
 int _starpu_check_that_no_data_request_exists(unsigned node)
 {
-	/* XXX lock that !!! that's a quick'n'dirty test */
 	int no_request;
 	int no_pending;
 
 	STARPU_PTHREAD_MUTEX_LOCK(&data_requests_list_mutex[node]);
 	no_request = _starpu_data_request_list_empty(data_requests[node])
-	          && _starpu_data_request_list_empty(prefetch_requests[node]);
+	          && _starpu_data_request_list_empty(prefetch_requests[node])
+		  && _starpu_data_request_list_empty(idle_requests[node]);
 	STARPU_PTHREAD_MUTEX_UNLOCK(&data_requests_list_mutex[node]);
 	STARPU_PTHREAD_MUTEX_LOCK(&data_requests_pending_list_mutex[node]);
 	no_pending = !data_requests_npending[node];
@@ -710,19 +727,26 @@ int _starpu_check_that_no_data_request_exists(unsigned node)
 	return (no_request && no_pending);
 }
 
+/* Note: the returned value will be outdated since the locks are not taken at
+ * entry/exit */
+int _starpu_check_that_no_data_request_is_pending(unsigned node)
+{
+	return !data_requests_npending[node];
+}
 
-void _starpu_update_prefetch_status(struct _starpu_data_request *r)
+
+void _starpu_update_prefetch_status(struct _starpu_data_request *r, unsigned prefetch)
 {
-	STARPU_ASSERT(r->prefetch > 0);
-	r->prefetch=0;
+	STARPU_ASSERT(r->prefetch > prefetch);
+	r->prefetch=prefetch;
 
 	/* We have to promote chained_request too! */
 	unsigned chained_req;
 	for (chained_req = 0; chained_req < r->next_req_count; chained_req++)
 	{
 		struct _starpu_data_request *next_req = r->next_req[chained_req];
-		if (next_req->prefetch)
-			_starpu_update_prefetch_status(next_req);
+		if (next_req->prefetch > prefetch)
+			_starpu_update_prefetch_status(next_req, prefetch);
 	}
 
 	STARPU_PTHREAD_MUTEX_LOCK(&data_requests_list_mutex[r->handling_node]);
@@ -739,9 +763,25 @@ void _starpu_update_prefetch_status(struct _starpu_data_request *r)
 		{
 			_starpu_data_request_list_erase(prefetch_requests[r->handling_node],r);
 			_starpu_data_request_list_push_front(data_requests[r->handling_node],r);
-			break;
+			goto found;
+		}
+	}
+
+	/* The request can be in a different list (handling request or the temp list)
+	 * we have to check that it is really in the idle list. */
+	for (r_iter = _starpu_data_request_list_begin(idle_requests[r->handling_node]);
+	     r_iter != _starpu_data_request_list_end(idle_requests[r->handling_node]);
+	     r_iter = _starpu_data_request_list_next(r_iter))
+	{
+
+		if (r==r_iter)
+		{
+			_starpu_data_request_list_erase(idle_requests[r->handling_node],r);
+			_starpu_data_request_list_push_front(data_requests[r->handling_node],r);
+			goto found;
 		}
 	}
+found:
 	STARPU_PTHREAD_MUTEX_UNLOCK(&data_requests_list_mutex[r->handling_node]);
 
 #ifndef STARPU_NON_BLOCKING_DRIVERS

+ 8 - 2
src/datawizard/data_request.h

@@ -65,7 +65,11 @@ LIST_TYPE(_starpu_data_request,
 	/* Whether the transfer is completed. */
 	unsigned completed;
 
-	/* Whether this is just a prefetch request */
+	/* Whether this is just a prefetch request:
+	 * 0 for fetch,
+	 * 1 for prefetch (dependencies have just been released)
+	 * 2 for idle (a good idea to do it some time, but no hurry at all)
+	 */
 	unsigned prefetch;
 
 	/* The value returned by the transfer function */
@@ -112,11 +116,13 @@ void _starpu_post_data_request(struct _starpu_data_request *r, unsigned handling
 /* returns 0 if we have pushed all requests, -EBUSY or -ENOMEM otherwise */
 int _starpu_handle_node_data_requests(unsigned src_node, unsigned may_alloc, unsigned *pushed);
 int _starpu_handle_node_prefetch_requests(unsigned src_node, unsigned may_alloc, unsigned *pushed);
+int _starpu_handle_node_idle_requests(unsigned src_node, unsigned may_alloc, unsigned *pushed);
 
 int _starpu_handle_pending_node_data_requests(unsigned src_node);
 int _starpu_handle_all_pending_node_data_requests(unsigned src_node);
 
 int _starpu_check_that_no_data_request_exists(unsigned node);
+int _starpu_check_that_no_data_request_is_pending(unsigned node);
 
 struct _starpu_data_request *_starpu_create_data_request(starpu_data_handle_t handle,
 							 struct _starpu_data_replicate *src_replicate,
@@ -132,5 +138,5 @@ void _starpu_data_request_append_callback(struct _starpu_data_request *r,
 					  void (*callback_func)(void *),
 					  void *callback_arg);
 
-void _starpu_update_prefetch_status(struct _starpu_data_request *r);
+void _starpu_update_prefetch_status(struct _starpu_data_request *r, unsigned prefetch);
 #endif // __DATA_REQUEST_H__

+ 3 - 0
src/datawizard/datawizard.c

@@ -51,6 +51,9 @@ int __starpu_datawizard_progress(unsigned memory_node, unsigned may_alloc, unsig
 			/* We pushed all pending requests, we can afford pushing
 			 * prefetch requests */
 			_starpu_handle_node_prefetch_requests(memory_node, may_alloc, &pushed);
+			if (_starpu_check_that_no_data_request_is_pending(memory_node))
+				/* No pending transfer, push some idle transfer */
+				_starpu_handle_node_idle_requests(memory_node, may_alloc, &pushed);
 		}
 		if (pushed)
 			ret = 1;

+ 2 - 2
src/datawizard/filters.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2010-2014  Université de Bordeaux
+ * Copyright (C) 2010-2015  Université de Bordeaux
  * Copyright (C) 2010  Mehdi Juhoor <mjuhoor@gmail.com>
  * Copyright (C) 2010, 2011, 2012, 2013, 2015  Centre National de la Recherche Scientifique
  * Copyright (C) 2012 INRIA
@@ -338,7 +338,7 @@ void starpu_data_unpartition(starpu_data_handle_t root_handle, unsigned gatherin
 		} else
 		{
 			/* Simply transfer any pending data */
-			ret = _starpu_fetch_data_on_node(child_handle, &child_handle->per_node[gathering_node], STARPU_R, 0, 0, NULL, NULL);
+			ret = _starpu_fetch_data_on_node(child_handle, &child_handle->per_node[gathering_node], STARPU_R, 0, 0, 0, NULL, NULL);
 		}
 		STARPU_ASSERT(ret == 0);
 

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

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2009-2014  Université de Bordeaux
+ * Copyright (C) 2009-2015  Université de Bordeaux
  * Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015  Centre National de la Recherche Scientifique
  * Copyright (C) 2014  Inria
  *
@@ -589,7 +589,7 @@ void _starpu_check_if_valid_and_fetch_data_on_node(starpu_data_handle_t handle,
 	}
 	if (valid)
 	{
-		int ret = _starpu_fetch_data_on_node(handle, replicate, STARPU_R, 0, 0, NULL, NULL);
+		int ret = _starpu_fetch_data_on_node(handle, replicate, STARPU_R, 0, 0, 0, NULL, NULL);
 		STARPU_ASSERT(!ret);
 		_starpu_release_data_on_node(handle, 0, &handle->per_node[handle->home_node]);
 	}

+ 15 - 8
src/datawizard/user_interactions.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2009-2014  Université de Bordeaux
+ * Copyright (C) 2009-2015  Université de Bordeaux
  * Copyright (C) 2010, 2011, 2012, 2013  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -55,6 +55,7 @@ struct user_interaction_wrapper
 	starpu_pthread_mutex_t lock;
 	unsigned finished;
 	unsigned async;
+	unsigned prefetch;
 	void (*callback)(void *);
 	void (*callback_fetch_data)(void *); // called after fetch_data
 	void *callback_arg;
@@ -96,7 +97,7 @@ static void _starpu_data_acquire_continuation_non_blocking(void *arg)
 	{
 		struct _starpu_data_replicate *replicate = &handle->per_node[wrapper->node];
 
-		ret = _starpu_fetch_data_on_node(handle, replicate, wrapper->mode, 0, 1,
+		ret = _starpu_fetch_data_on_node(handle, replicate, wrapper->mode, 0, 0, 1,
 						 _starpu_data_acquire_fetch_data_callback, wrapper);
 		STARPU_ASSERT(!ret);
 	}
@@ -216,7 +217,7 @@ static inline void _starpu_data_acquire_continuation(void *arg)
 		int ret;
 		struct _starpu_data_replicate *replicate = &handle->per_node[wrapper->node];
 
-		ret = _starpu_fetch_data_on_node(handle, replicate, wrapper->mode, 0, 0, NULL, NULL);
+		ret = _starpu_fetch_data_on_node(handle, replicate, wrapper->mode, 0, 0, 0, NULL, NULL);
 		STARPU_ASSERT(!ret);
 	}
 
@@ -304,7 +305,7 @@ int starpu_data_acquire_on_node(starpu_data_handle_t handle, int node, enum star
 		{
 			/* no one has locked this data yet, so we proceed immediately */
 			struct _starpu_data_replicate *replicate = &handle->per_node[node];
-			int ret = _starpu_fetch_data_on_node(handle, replicate, mode, 0, 0, NULL, NULL);
+			int ret = _starpu_fetch_data_on_node(handle, replicate, mode, 0, 0, 0, NULL, NULL);
 			STARPU_ASSERT(!ret);
 		}
 	}
@@ -366,7 +367,7 @@ static void _prefetch_data_on_node(void *arg)
         int ret;
 
 	struct _starpu_data_replicate *replicate = &handle->per_node[wrapper->node];
-	ret = _starpu_fetch_data_on_node(handle, replicate, STARPU_R, wrapper->async, wrapper->async, NULL, NULL);
+	ret = _starpu_fetch_data_on_node(handle, replicate, STARPU_R, wrapper->async, wrapper->prefetch, wrapper->async, NULL, NULL);
         STARPU_ASSERT(!ret);
 
 	if (wrapper->async)
@@ -385,7 +386,7 @@ static void _prefetch_data_on_node(void *arg)
 }
 
 static
-int _starpu_prefetch_data_on_node_with_mode(starpu_data_handle_t handle, unsigned node, unsigned async, enum starpu_data_access_mode mode)
+int _starpu_prefetch_data_on_node_with_mode(starpu_data_handle_t handle, unsigned node, unsigned async, enum starpu_data_access_mode mode, unsigned prefetch)
 {
 	STARPU_ASSERT(handle);
 
@@ -397,6 +398,7 @@ int _starpu_prefetch_data_on_node_with_mode(starpu_data_handle_t handle, unsigne
 	wrapper->handle = handle;
 	wrapper->node = node;
 	wrapper->async = async;
+	wrapper->prefetch = prefetch;
 	STARPU_PTHREAD_COND_INIT(&wrapper->cond, NULL);
 	STARPU_PTHREAD_MUTEX_INIT(&wrapper->lock, NULL);
 	wrapper->finished = 0;
@@ -410,7 +412,7 @@ int _starpu_prefetch_data_on_node_with_mode(starpu_data_handle_t handle, unsigne
 		STARPU_PTHREAD_MUTEX_DESTROY(&wrapper->lock);
 		free(wrapper);
 
-		_starpu_fetch_data_on_node(handle, replicate, mode, async, async, NULL, NULL);
+		_starpu_fetch_data_on_node(handle, replicate, mode, async, prefetch, async, NULL, NULL);
 
 		/* remove the "lock"/reference */
 
@@ -447,7 +449,12 @@ int _starpu_prefetch_data_on_node_with_mode(starpu_data_handle_t handle, unsigne
 
 int starpu_data_prefetch_on_node(starpu_data_handle_t handle, unsigned node, unsigned async)
 {
-	return _starpu_prefetch_data_on_node_with_mode(handle, node, async, STARPU_R);
+	return _starpu_prefetch_data_on_node_with_mode(handle, node, async, STARPU_R, 1);
+}
+
+int starpu_data_idle_prefetch_on_node(starpu_data_handle_t handle, unsigned node, unsigned async)
+{
+	return _starpu_prefetch_data_on_node_with_mode(handle, node, async, STARPU_R, 2);
 }
 
 /*

+ 2 - 2
src/datawizard/write_back.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2009-2012  Université de Bordeaux
+ * Copyright (C) 2009-2012, 2015  Université de Bordeaux
  * Copyright (C) 2010, 2011, 2012, 2013  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -64,7 +64,7 @@ void _starpu_write_through_data(starpu_data_handle_t handle, unsigned requesting
 
 				struct _starpu_data_request *r;
 				r = _starpu_create_request_to_fetch_data(handle, &handle->per_node[node],
-									 STARPU_R, 1, 1, wt_callback, handle);
+									 STARPU_R, 2, 1, wt_callback, handle);
 
 			        /* If no request was created, the handle was already up-to-date on the
 			         * node */

+ 3 - 3
src/debug/latency.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2010-2012  Université de Bordeaux
+ * Copyright (C) 2010-2012, 2015  Université de Bordeaux
  * Copyright (C) 2010, 2011  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -35,7 +35,7 @@ void _starpu_benchmark_ping_pong(starpu_data_handle_t handle,
 		_starpu_spin_unlock(&handle->header_lock);
 
 		struct _starpu_data_replicate *replicate_0 = &handle->per_node[node0];
-		ret = _starpu_fetch_data_on_node(handle, replicate_0, STARPU_RW, 0, 0, NULL, NULL);
+		ret = _starpu_fetch_data_on_node(handle, replicate_0, STARPU_RW, 0, 0, 0, NULL, NULL);
 		STARPU_ASSERT(!ret);
 		_starpu_release_data_on_node(handle, 0, replicate_0);
 
@@ -45,7 +45,7 @@ void _starpu_benchmark_ping_pong(starpu_data_handle_t handle,
 		_starpu_spin_unlock(&handle->header_lock);
 
 		struct _starpu_data_replicate *replicate_1 = &handle->per_node[node1];
-		ret = _starpu_fetch_data_on_node(handle, replicate_1, STARPU_RW, 0, 0, NULL, NULL);
+		ret = _starpu_fetch_data_on_node(handle, replicate_1, STARPU_RW, 0, 0, 0, NULL, NULL);
 		STARPU_ASSERT(!ret);
 		_starpu_release_data_on_node(handle, 0, replicate_1);
 	}