Преглед изворни кода

This is a first step toward the merge of the data replicatate and mem_chunk
data structures. The per_node array of the handle is now an array of pointers
to replicate instead of an array of replicates.

Cédric Augonnet пре 15 година
родитељ
комит
e344b2b6cc

+ 1 - 1
src/core/dependencies/data_concurrency.c

@@ -49,7 +49,7 @@ static unsigned may_unlock_data_req_list_head(starpu_data_handle handle)
 	{
 		int i;
 		for (i = 0; i < STARPU_MAXNODES; i++)
-			STARPU_ASSERT(!handle->per_node[i].request);
+			STARPU_ASSERT(!handle->per_node[i]->request);
 		return 1;
 	}
 

+ 12 - 12
src/datawizard/coherency.c

@@ -56,7 +56,7 @@ uint32_t _starpu_select_src_node(starpu_data_handle handle)
 	uint32_t src_node_mask = 0;
 	for (node = 0; node < nnodes; node++)
 	{
-		if (handle->per_node[node].state != STARPU_INVALID) {
+		if (handle->per_node[node]->state != STARPU_INVALID) {
 			/* we found a copy ! */
 			src_node_mask |= (1<<node);
 		}
@@ -102,7 +102,7 @@ void _starpu_update_data_state(starpu_data_handle handle,
 		/* the requesting node now has the only valid copy */
 		uint32_t node;
 		for (node = 0; node < nnodes; node++)
-			handle->per_node[node].state = STARPU_INVALID;
+			handle->per_node[node]->state = STARPU_INVALID;
 
 		requesting_replicate->state = STARPU_OWNER;
 	}
@@ -113,7 +113,7 @@ void _starpu_update_data_state(starpu_data_handle handle,
 			uint32_t node;
 			for (node = 0; node < nnodes; node++)
 			{
-				struct starpu_data_replicate_s *replicate = &handle->per_node[node];
+				struct starpu_data_replicate_s *replicate = handle->per_node[node];
 				if (replicate->state != STARPU_INVALID)
 					replicate->state = STARPU_SHARED;
 			}
@@ -197,7 +197,7 @@ int _starpu_fetch_data_on_node(starpu_data_handle handle, struct starpu_data_rep
 		unsigned src_is_a_gpu = (_starpu_get_node_kind(src_node) == STARPU_CUDA_RAM || _starpu_get_node_kind(src_node) == STARPU_OPENCL_RAM);
 		unsigned dst_is_a_gpu = (_starpu_get_node_kind(requesting_node) == STARPU_CUDA_RAM || _starpu_get_node_kind(requesting_node) == STARPU_OPENCL_RAM);
 
-		struct starpu_data_replicate_s *src_replicate = &handle->per_node[src_node];
+		struct starpu_data_replicate_s *src_replicate = handle->per_node[src_node];
 
 		/* we have to perform 2 successive requests for GPU->GPU transfers */
 		if ((mode & STARPU_R) && (src_is_a_gpu && dst_is_a_gpu)) {
@@ -205,7 +205,7 @@ int _starpu_fetch_data_on_node(starpu_data_handle handle, struct starpu_data_rep
 			starpu_data_request_t r_src_to_ram;
 			starpu_data_request_t r_ram_to_dst;
 
-			struct starpu_data_replicate_s *ram_replicate = &handle->per_node[0];
+			struct starpu_data_replicate_s *ram_replicate = handle->per_node[0];
 
 			/* XXX we hardcore 0 as the RAM node ... */
 			r_ram_to_dst = _starpu_create_data_request(handle, ram_replicate,
@@ -311,7 +311,7 @@ static int fetch_data(starpu_data_handle handle, struct starpu_data_replicate_s
 
 inline uint32_t _starpu_get_data_refcnt(starpu_data_handle handle, uint32_t node)
 {
-	return handle->per_node[node].refcnt;
+	return handle->per_node[node]->refcnt;
 }
 
 size_t _starpu_data_get_size(starpu_data_handle handle)
@@ -359,7 +359,7 @@ inline void _starpu_set_data_requested_flag_if_needed(starpu_data_handle handle,
 // XXX : this is just a hint, so we don't take the lock ...
 //	pthread_spin_lock(&handle->header_lock);
 
-	struct starpu_data_replicate_s *replicate = &handle->per_node[node];
+	struct starpu_data_replicate_s *replicate = handle->per_node[node];
 
 	if (replicate->state == STARPU_INVALID) 
 		replicate->requested = 1;
@@ -381,7 +381,7 @@ int _starpu_prefetch_task_input_on_node(struct starpu_task *task, uint32_t node)
 		if (mode & STARPU_SCRATCH)
 			continue;
 
-		struct starpu_data_replicate_s *replicate = &handle->per_node[node];
+		struct starpu_data_replicate_s *replicate = handle->per_node[node];
 		prefetch_data_on_node(handle, replicate, mode);
 
 		_starpu_set_data_requested_flag_if_needed(handle, node);
@@ -439,7 +439,7 @@ int _starpu_fetch_task_input(struct starpu_task *task, uint32_t mask)
 		else {
 			/* That's a "normal" buffer (R/W) */
 			struct starpu_data_replicate_s *local_replicate;
-			local_replicate = &handle->per_node[local_memory_node];
+			local_replicate = handle->per_node[local_memory_node];
 			ret = fetch_data(handle, local_replicate, mode);
 			if (STARPU_UNLIKELY(ret))
 				goto enomem;
@@ -485,7 +485,7 @@ void _starpu_push_task_output(struct starpu_task *task, uint32_t mask)
 			_starpu_memchunk_cache_insert(local_node, j->scratch_memchunks[index]);
 		}
 		else {
-			struct starpu_data_replicate_s *replicate = &handle->per_node[local_node];
+			struct starpu_data_replicate_s *replicate = handle->per_node[local_node];
 			_starpu_release_data_on_node(handle, mask, replicate);
 			_starpu_release_data_enforce_sequential_consistency(task, handle);
 		}
@@ -503,8 +503,8 @@ unsigned _starpu_is_data_present_or_requested(starpu_data_handle handle, uint32_
 // XXX : this is just a hint, so we don't take the lock ...
 //	pthread_spin_lock(&handle->header_lock);
 
-	if (handle->per_node[node].state != STARPU_INVALID 
-		|| handle->per_node[node].requested || handle->per_node[node].request)
+	if (handle->per_node[node]->state != STARPU_INVALID 
+		|| handle->per_node[node]->requested || handle->per_node[node]->request)
 		ret = 1;
 
 //	pthread_spin_unlock(&handle->header_lock);

+ 5 - 3
src/datawizard/coherency.h

@@ -37,7 +37,9 @@ typedef enum {
 } starpu_cache_state;
 
 /* this should contain the information relative to a given data replicate  */
-struct starpu_data_replicate_s {
+LIST_TYPE(starpu_data_replicate,
+	starpu_data_handle handle;
+
 	/* describe the actual data layout */
 	void *interface;
 
@@ -65,7 +67,7 @@ struct starpu_data_replicate_s {
 	 */
 	uint8_t requested;
 	struct starpu_data_request_s *request;
-};
+);
 
 struct starpu_data_requester_list_s;
 
@@ -99,7 +101,7 @@ struct starpu_data_state_t {
 	unsigned nchildren;
 
 	/* describe the state of the data in term of coherency */
-	struct starpu_data_replicate_s per_node[STARPU_MAXNODES];
+	struct starpu_data_replicate_s *per_node[STARPU_MAXNODES];
 
 	struct starpu_data_interface_ops_t *ops;
 

+ 21 - 12
src/datawizard/filters.c

@@ -143,13 +143,15 @@ void starpu_data_partition(starpu_data_handle initial_handle, struct starpu_data
 		unsigned node;
 		for (node = 0; node < STARPU_MAXNODES; node++)
 		{
-			child->per_node[node].state = 
-				initial_handle->per_node[node].state;
-			child->per_node[node].allocated = 
-				initial_handle->per_node[node].allocated;
-			child->per_node[node].automatically_allocated = initial_handle->per_node[node].automatically_allocated;
-			child->per_node[node].refcnt = 0;
-			child->per_node[node].memory_node = node;
+			struct starpu_data_replicate_s *initial_replicate = initial_handle->per_node[node];
+			struct starpu_data_replicate_s *child_replicate;
+			child_replicate = child->per_node[node];
+
+			child_replicate->state = initial_replicate->state;
+			child_replicate->allocated = initial_replicate->allocated;
+			child_replicate->automatically_allocated = initial_replicate->automatically_allocated;
+			child_replicate->refcnt = 0;
+			child_replicate->memory_node = node;
 			
 			/* update the interface */
 			void *initial_interface = starpu_data_get_interface_on_node(initial_handle, node);
@@ -186,7 +188,7 @@ void starpu_data_unpartition(starpu_data_handle root_handle, uint32_t gathering_
 			starpu_data_unpartition(child_handle, gathering_node);
 
 		int ret;
-		ret = _starpu_fetch_data_on_node(child_handle, &child_handle->per_node[gathering_node], STARPU_R, 0, NULL, NULL);
+		ret = _starpu_fetch_data_on_node(child_handle, child_handle->per_node[gathering_node], STARPU_R, 0, NULL, NULL);
 		/* for now we pretend that the RAM is almost unlimited and that gathering 
 		 * data should be possible from the node that does the unpartionning ... we
 		 * don't want to have the programming deal with memory shortage at that time,
@@ -218,7 +220,7 @@ void starpu_data_unpartition(starpu_data_handle root_handle, uint32_t gathering_
 
 		for (child = 0; child < root_handle->nchildren; child++)
 		{
-			struct starpu_data_replicate_s *local = &root_handle->children[child].per_node[node];
+			struct starpu_data_replicate_s *local = root_handle->children[child].per_node[node];
 
 			if (local->state == STARPU_INVALID) {
 				isvalid = 0; 
@@ -229,6 +231,8 @@ void starpu_data_unpartition(starpu_data_handle root_handle, uint32_t gathering_
 				_starpu_request_mem_chunk_removal(root_handle, node);
 				isvalid = 0; 
 			}
+#warning free the data replicate if needed
+
 		}
 
 		/* no problem was found so the node still has a valid copy */
@@ -243,7 +247,7 @@ void starpu_data_unpartition(starpu_data_handle root_handle, uint32_t gathering_
 
 	for (node = 0; node < STARPU_MAXNODES; node++)
 	{
-		root_handle->per_node[node].state = 
+		root_handle->per_node[node]->state = 
 			still_valid[node]?newstate:STARPU_INVALID;
 	}
 
@@ -281,8 +285,13 @@ static void starpu_data_create_children(starpu_data_handle handle, unsigned nchi
 
 		for (node = 0; node < STARPU_MAXNODES; node++)
 		{
-			handle_child->per_node[node].interface = calloc(1, interfacesize);
-			STARPU_ASSERT(handle_child->per_node[node].interface);
+			handle_child->per_node[node] = calloc(1, sizeof(struct starpu_data_replicate_s));
+			STARPU_ASSERT(handle_child->per_node[node]);
+
+			handle_child->per_node[node]->handle = handle_child;
+
+			handle_child->per_node[node]->interface = calloc(1, interfacesize);
+			STARPU_ASSERT(handle_child->per_node[node]->interface);
 		}
 	}
 	

+ 31 - 16
src/datawizard/interfaces/data_interface.c

@@ -73,20 +73,23 @@ static void _starpu_register_new_data(starpu_data_handle handle,
 	unsigned node;
 	for (node = 0; node < STARPU_MAXNODES; node++)
 	{
-		handle->per_node[node].memory_node = node;
+		struct starpu_data_replicate_s *replicate;
+		replicate = handle->per_node[node];
+		
+		replicate->memory_node = node;
 
 		if (node == home_node) {
 			/* this is the home node with the only valid copy */
-			handle->per_node[node].state = STARPU_OWNER;
-			handle->per_node[node].allocated = 1;
-			handle->per_node[node].automatically_allocated = 0;
-			handle->per_node[node].refcnt = 0;
+			replicate->state = STARPU_OWNER;
+			replicate->allocated = 1;
+			replicate->automatically_allocated = 0;
+			replicate->refcnt = 0;
 		}
 		else {
 			/* the value is not available here yet */
-			handle->per_node[node].state = STARPU_INVALID;
-			handle->per_node[node].allocated = 0;
-			handle->per_node[node].refcnt = 0;
+			replicate->state = STARPU_INVALID;
+			replicate->allocated = 0;
+			replicate->refcnt = 0;
 		}
 	}
 
@@ -108,8 +111,16 @@ static starpu_data_handle _starpu_data_handle_allocate(struct starpu_data_interf
 	unsigned node;
 	for (node = 0; node < STARPU_MAXNODES; node++)
 	{
-		handle->per_node[node].interface = calloc(1, interfacesize);
-		STARPU_ASSERT(handle->per_node[node].interface);
+		struct starpu_data_replicate_s *replicate;
+
+		replicate = calloc(1, sizeof(struct starpu_data_replicate_s));
+		STARPU_ASSERT(replicate);
+		handle->per_node[node] = replicate;
+
+		replicate->handle = handle;
+
+		replicate->interface = calloc(1, interfacesize);
+		STARPU_ASSERT(replicate->interface);
 	}
 
 	return handle;
@@ -125,6 +136,7 @@ void starpu_data_register(starpu_data_handle *handleptr, uint32_t home_node,
 	STARPU_ASSERT(handleptr);
 	*handleptr = handle;
 
+
 	/* fill the interface fields with the appropriate method */
 	ops->register_data_handle(handle, home_node, interface);
 
@@ -139,7 +151,7 @@ void _starpu_data_free_interfaces(starpu_data_handle handle)
 {
 	unsigned node;
 	for (node = 0; node < STARPU_MAXNODES; node++)
-		free(handle->per_node[node].interface);
+		free(handle->per_node[node]->interface);
 }
 
 struct unregister_callback_arg {
@@ -159,7 +171,7 @@ static void _starpu_data_unregister_fetch_data_callback(void *_arg)
 
 	STARPU_ASSERT(handle);
 
-	struct starpu_data_replicate_s *replicate = &handle->per_node[arg->memory_node];
+	struct starpu_data_replicate_s *replicate = handle->per_node[arg->memory_node];
 
 	ret = _starpu_fetch_data_on_node(handle, replicate, STARPU_R, 0, NULL, NULL);
 	STARPU_ASSERT(!ret);
@@ -195,7 +207,7 @@ void starpu_data_unregister(starpu_data_handle handle)
 				_starpu_data_unregister_fetch_data_callback, &arg))
 		{
 			/* no one has locked this data yet, so we proceed immediately */
-			struct starpu_data_replicate_s *home_replicate = &handle->per_node[home_node];
+			struct starpu_data_replicate_s *home_replicate = handle->per_node[home_node];
 			int ret = _starpu_fetch_data_on_node(handle, home_replicate, STARPU_R, 0, NULL, NULL);
 			STARPU_ASSERT(!ret);
 		}
@@ -211,12 +223,15 @@ void starpu_data_unregister(starpu_data_handle handle)
 	unsigned node;
 	for (node = 0; node < STARPU_MAXNODES; node++)
 	{
-		struct starpu_data_replicate_s *local = &handle->per_node[node];
+		struct starpu_data_replicate_s *local = handle->per_node[node];
 
 		if (local->allocated && local->automatically_allocated){
 			/* free the data copy in a lazy fashion */
 			_starpu_request_mem_chunk_removal(handle, node);
 		}
+		else {
+			free(local);
+		}
 	}
 
 	starpu_data_requester_list_delete(handle->req_list);
@@ -237,7 +252,7 @@ void starpu_data_invalidate(starpu_data_handle handle)
 	unsigned node;
 	for (node = 0; node < STARPU_MAXNODES; node++)
 	{
-		struct starpu_data_replicate_s *local = &handle->per_node[node];
+		struct starpu_data_replicate_s *local = handle->per_node[node];
 
 		if (local->allocated && local->automatically_allocated){
 			/* free the data copy in a lazy fashion */
@@ -259,5 +274,5 @@ unsigned starpu_get_handle_interface_id(starpu_data_handle handle)
 
 void *starpu_data_get_interface_on_node(starpu_data_handle handle, unsigned memory_node)
 {
-	return handle->per_node[memory_node].interface;
+	return handle->per_node[memory_node]->interface;
 }

+ 18 - 18
src/datawizard/memalloc.c

@@ -131,8 +131,8 @@ static void transfer_subtree_to_node(starpu_data_handle handle, unsigned src_nod
 
 	if (handle->nchildren == 0)
 	{
-		struct starpu_data_replicate_s *src_replicate = &handle->per_node[src_node];
-		struct starpu_data_replicate_s *dst_replicate = &handle->per_node[dst_node];
+		struct starpu_data_replicate_s *src_replicate = handle->per_node[src_node];
+		struct starpu_data_replicate_s *dst_replicate = handle->per_node[dst_node];
 
 		/* this is a leaf */
 		switch(src_replicate->state) {
@@ -147,7 +147,7 @@ static void transfer_subtree_to_node(starpu_data_handle handle, unsigned src_nod
 			src_replicate->refcnt++;
 			dst_replicate->refcnt++;
 
-			ret = _starpu_driver_copy_data_1_to_1(handle, &handle->per_node[src_node], &handle->per_node[dst_node], 0, NULL, 1);
+			ret = _starpu_driver_copy_data_1_to_1(handle, handle->per_node[src_node], handle->per_node[dst_node], 0, NULL, 1);
 			STARPU_ASSERT(ret == 0);
 
 			src_replicate->refcnt--;
@@ -162,14 +162,14 @@ static void transfer_subtree_to_node(starpu_data_handle handle, unsigned src_nod
 			cnt = 0;
 			for (i = 0; i < STARPU_MAXNODES; i++)
 			{
-				if (handle->per_node[i].state == STARPU_SHARED) {
+				if (handle->per_node[i]->state == STARPU_SHARED) {
 					cnt++; 
 					last = i;
 				}
 			}
 
 			if (cnt == 1)
-				handle->per_node[last].state = STARPU_OWNER;
+				handle->per_node[last]->state = STARPU_OWNER;
 
 			break;
 		case STARPU_INVALID:
@@ -207,13 +207,13 @@ static size_t try_to_free_mem_chunk(starpu_mem_chunk_t mc, unsigned node)
 	/* check if they are all "free" */
 	if (may_free_subtree(handle, node))
 	{
-		STARPU_ASSERT(handle->per_node[node].refcnt == 0);
+		STARPU_ASSERT(handle->per_node[node]->refcnt == 0);
 
 		/* in case there was nobody using that buffer, throw it 
 		 * away after writing it back to main memory */
 		transfer_subtree_to_node(handle, node, 0);
 
-		STARPU_ASSERT(handle->per_node[node].refcnt == 0);
+		STARPU_ASSERT(handle->per_node[node]->refcnt == 0);
 
 		/* now the actual buffer may be freed */
 		freed = do_free_mem_chunk(mc, node);
@@ -243,12 +243,12 @@ static void reuse_mem_chunk(unsigned node, starpu_data_handle new_data, starpu_m
 
 	if (!mc->data_was_deleted)
 	{
-		struct starpu_data_replicate_s *old_replicate = &old_data->per_node[node];
+		struct starpu_data_replicate_s *old_replicate = old_data->per_node[node];
 		old_replicate->allocated = 0;
 		old_replicate->automatically_allocated = 0;
 	}
 
-	struct starpu_data_replicate_s *new_replicate = &new_data->per_node[node];
+	struct starpu_data_replicate_s *new_replicate = new_data->per_node[node];
 	new_replicate->allocated = 1;
 	new_replicate->automatically_allocated = 1;
 
@@ -318,8 +318,8 @@ static unsigned try_to_find_reusable_mem_chunk(unsigned node, starpu_data_handle
 			starpu_data_handle old_data;
 			old_data = mc->data;
 
-			if (old_data->per_node[node].allocated &&
-					old_data->per_node[node].automatically_allocated)
+			if (old_data->per_node[node]->allocated &&
+					old_data->per_node[node]->automatically_allocated)
 			{
 				reuse_mem_chunk(node, data, mc, 0);
 
@@ -383,7 +383,7 @@ starpu_mem_chunk_t _starpu_memchunk_cache_lookup(uint32_t node, starpu_data_hand
 		if (mc->footprint == footprint)
 		{
 			/* Is that a false hit ? (this is _very_ unlikely) */
-			if (_starpu_data_interface_compare(handle->per_node[node].interface, handle->ops, mc->interface, mc->ops))
+			if (_starpu_data_interface_compare(handle->per_node[node]->interface, handle->ops, mc->interface, mc->ops))
 				continue;
 
 			/* Cache hit */
@@ -625,25 +625,25 @@ static size_t free_memory_on_node(starpu_mem_chunk_t mc, uint32_t node)
 //	_starpu_spin_lock(&handle->header_lock);
 
 	if (mc->automatically_allocated && 
-		(!handle || data_was_deleted || handle->per_node[node].refcnt == 0))
+		(!handle || data_was_deleted || handle->per_node[node]->refcnt == 0))
 	{
 		if (handle && !data_was_deleted)
-			STARPU_ASSERT(handle->per_node[node].allocated);
+			STARPU_ASSERT(handle->per_node[node]->allocated);
 
 		mc->ops->free_data_on_node(mc->interface, node);
 
 		if (handle && !data_was_deleted)
 		{
-			handle->per_node[node].allocated = 0;
+			handle->per_node[node]->allocated = 0;
 
 			/* XXX why do we need that ? */
-			handle->per_node[node].automatically_allocated = 0;
+			handle->per_node[node]->automatically_allocated = 0;
 		}
 
 		freed = mc->size;
 
 		if (handle && !data_was_deleted)
-			STARPU_ASSERT(handle->per_node[node].refcnt == 0);
+			STARPU_ASSERT(handle->per_node[node]->refcnt == 0);
 	}
 
 //	_starpu_spin_unlock(&handle->header_lock);
@@ -734,5 +734,5 @@ int _starpu_allocate_memory_on_node(starpu_data_handle handle, struct starpu_dat
 
 unsigned starpu_data_test_if_allocated_on_node(starpu_data_handle handle, uint32_t memory_node)
 {
-	return handle->per_node[memory_node].allocated;
+	return handle->per_node[memory_node]->allocated;
 }

+ 11 - 11
src/datawizard/user_interactions.c

@@ -30,7 +30,7 @@ int starpu_data_request_allocation(starpu_data_handle handle, uint32_t node)
 
 	STARPU_ASSERT(handle);
 
-	r = _starpu_create_data_request(handle, NULL, &handle->per_node[node], node, 0, 1);
+	r = _starpu_create_data_request(handle, NULL, handle->per_node[node], node, 0, 1);
 
 	/* we do not increase the refcnt associated to the request since we are
 	 * not waiting for its termination */
@@ -82,7 +82,7 @@ static void _starpu_data_acquire_continuation_non_blocking(void *arg)
 
 	STARPU_ASSERT(handle);
 
-	struct starpu_data_replicate_s *ram_replicate = &handle->per_node[0];
+	struct starpu_data_replicate_s *ram_replicate = handle->per_node[0];
 
 	ret = _starpu_fetch_data_on_node(handle, ram_replicate, wrapper->mode, 1,
 			_starpu_data_acquire_fetch_data_callback, wrapper);
@@ -124,7 +124,7 @@ int starpu_data_acquire_cb(starpu_data_handle handle,
 
 #warning TODO instead of having the is_prefetch argument, _starpu_fetch_data shoud consider two flags: async and detached
 	_starpu_spin_lock(&handle->header_lock);
-	handle->per_node[0].refcnt++;
+	handle->per_node[0]->refcnt++;
 	_starpu_spin_unlock(&handle->header_lock);
 
 	PTHREAD_MUTEX_LOCK(&handle->sequential_consistency_mutex);
@@ -174,7 +174,7 @@ static inline void _starpu_data_acquire_continuation(void *arg)
 
 	STARPU_ASSERT(handle);
 
-	struct starpu_data_replicate_s *ram_replicate = &handle->per_node[0];
+	struct starpu_data_replicate_s *ram_replicate = handle->per_node[0];
 
 	_starpu_fetch_data_on_node(handle, ram_replicate, wrapper->mode, 0, NULL, NULL);
 	
@@ -244,7 +244,7 @@ int starpu_data_acquire(starpu_data_handle handle, starpu_access_mode mode)
 	if (!_starpu_attempt_to_submit_data_request_from_apps(handle, mode, _starpu_data_acquire_continuation, &wrapper))
 	{
 		/* no one has locked this data yet, so we proceed immediately */
-		struct starpu_data_replicate_s *ram_replicate = &handle->per_node[0];
+		struct starpu_data_replicate_s *ram_replicate = handle->per_node[0];
 		int ret = _starpu_fetch_data_on_node(handle, ram_replicate, mode, 0, NULL, NULL);
 		STARPU_ASSERT(!ret);
 	}
@@ -272,7 +272,7 @@ void starpu_data_release(starpu_data_handle handle)
 	STARPU_ASSERT(handle);
 
 	/* The application can now release the rw-lock */
-	_starpu_release_data_on_node(handle, 0, &handle->per_node[0]);
+	_starpu_release_data_on_node(handle, 0, handle->per_node[0]);
 
 	/* In case there are some implicit dependencies, unlock the "post sync" tasks */
 	_starpu_unlock_post_sync_tasks(handle);
@@ -284,7 +284,7 @@ static void _prefetch_data_on_node(void *arg)
 	starpu_data_handle handle = wrapper->handle;
         int ret;
 
-	struct starpu_data_replicate_s *replicate = &handle->per_node[wrapper->node];
+	struct starpu_data_replicate_s *replicate = handle->per_node[wrapper->node];
 	ret = _starpu_fetch_data_on_node(handle, replicate, STARPU_R, wrapper->async, NULL, NULL);
         STARPU_ASSERT(!ret);
 
@@ -323,7 +323,7 @@ int _starpu_prefetch_data_on_node_with_mode(starpu_data_handle handle, unsigned
 	if (!_starpu_attempt_to_submit_data_request_from_apps(handle, mode, _prefetch_data_on_node, &wrapper))
 	{
 		/* we can immediately proceed */
-		struct starpu_data_replicate_s *replicate = &handle->per_node[node];
+		struct starpu_data_replicate_s *replicate = handle->per_node[node];
 		_starpu_fetch_data_on_node(handle, replicate, mode, async, NULL, NULL);
 
 		/* remove the "lock"/reference */
@@ -414,13 +414,13 @@ void starpu_data_query_status(starpu_data_handle handle, int memory_node, int *i
 //	_starpu_spin_lock(&handle->header_lock);
 
 	if (is_allocated)
-		*is_allocated = handle->per_node[memory_node].allocated;
+		*is_allocated = handle->per_node[memory_node]->allocated;
 
 	if (is_valid)
-		*is_valid = (handle->per_node[memory_node].state != STARPU_INVALID);
+		*is_valid = (handle->per_node[memory_node]->state != STARPU_INVALID);
 
 	if (is_requested)
-		*is_requested = handle->per_node[memory_node].requested;
+		*is_requested = handle->per_node[memory_node]->requested;
 
 //	_starpu_spin_unlock(&handle->header_lock);
 }

+ 3 - 3
src/datawizard/write_back.c

@@ -42,11 +42,11 @@ void _starpu_write_through_data(starpu_data_handle handle, uint32_t requesting_n
 
 				/* check that there is not already a similar
 				 * request that we should reuse */
-				r = _starpu_search_existing_data_request(&handle->per_node[node], STARPU_R);
+				r = _starpu_search_existing_data_request(handle->per_node[node], STARPU_R);
 				if (!r) {
 					/* there was no existing request so we create one now */
-					r = _starpu_create_data_request(handle, &handle->per_node[requesting_node],
-							&handle->per_node[node], handling_node, STARPU_R, 1);
+					r = _starpu_create_data_request(handle, handle->per_node[requesting_node],
+							handle->per_node[node], handling_node, STARPU_R, 1);
 					_starpu_post_data_request(r, handling_node);
 				}
 				else {

+ 2 - 2
src/debug/latency.c

@@ -27,11 +27,11 @@ void _starpu_benchmark_ping_pong(starpu_data_handle handle,
 	{
 		int ret;
 
-		struct starpu_data_replicate_s *replicate_0 = &handle->per_node[node0];
+		struct starpu_data_replicate_s *replicate_0 = handle->per_node[node0];
 		ret = _starpu_fetch_data_on_node(handle, replicate_0, STARPU_RW, 0, NULL, NULL);
 		STARPU_ASSERT(!ret);
 
-		struct starpu_data_replicate_s *replicate_1 = &handle->per_node[node1];
+		struct starpu_data_replicate_s *replicate_1 = handle->per_node[node1];
 		ret = _starpu_fetch_data_on_node(handle, replicate_1, STARPU_RW, 0, NULL, NULL);
 		STARPU_ASSERT(!ret);
 	}