Przeglądaj źródła

Deprecate handle_to_pointer interface operation

in favor of new to_pointer operation.
Samuel Thibault 6 lat temu
rodzic
commit
89fa50d97a

+ 2 - 0
ChangeLog

@@ -103,6 +103,8 @@ Changes:
   * Vastly improve simgrid simulation time.
   * Switch default scheduler to lws.
   * Add "to" parameter to pull_task and can_push methods of components.
+  * Deprecate handle_to_pointer interface operation in favor of new to_pointer
+  operation.
 
 Small changes:
   * Use asynchronous transfers for task data fetches with were not prefetched.

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

@@ -43,8 +43,13 @@ Per-interface data transfer methods.
     This provides a series of methods for performing ram/cuda/opencl synchronous and asynchronous transfers.
 
 \var void *(*starpu_data_interface_ops::handle_to_pointer)(starpu_data_handle_t handle, unsigned node)
+    Deprecated, use starpu_data_interface_ops::to_pointer instead.
     Return the current pointer (if any) for the handle on the given node.
 
+\var void *(*starpu_data_interface_ops::to_pointer)(void *data_interface, unsigned node)
+    Deprecated.
+    Return the current pointer (if any) for the given interface on the given node.
+
 \var size_t (*starpu_data_interface_ops::get_size)(starpu_data_handle_t handle)
     Return an estimation of the size of data, for performance models.
 

+ 7 - 9
examples/cpp/add_vectors_interface.cpp

@@ -2,7 +2,7 @@
  *
  * Copyright (C) 2010-2014,2016-2017                      CNRS
  * Copyright (C) 2012,2017                                Inria
- * Copyright (C) 2009-2011,2013-2015,2017                 Université de Bordeaux
+ * Copyright (C) 2009-2011,2013-2015,2017-2018                 Université de Bordeaux
  *
  * 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
@@ -259,7 +259,7 @@ static const struct starpu_data_copy_methods vector_cpp_copy_data_methods_s =
 
 static void register_vector_cpp_handle(starpu_data_handle_t handle, unsigned home_node, void *data_interface);
 static starpu_ssize_t allocate_vector_cpp_buffer_on_node(void *data_interface_, unsigned dst_node);
-static void *vector_cpp_handle_to_pointer(starpu_data_handle_t handle, unsigned node);
+static void *vector_cpp_to_pointer(void *data_interface, unsigned node);
 static void free_vector_cpp_buffer_on_node(void *data_interface, unsigned node);
 static void free_vector_cpp_buffer_on_node(void *data_interface, unsigned node);
 static size_t vector_cpp_interface_get_size(starpu_data_handle_t handle);
@@ -277,7 +277,7 @@ static struct starpu_data_interface_ops interface_vector_cpp_ops =
 	.allocate_data_on_node = allocate_vector_cpp_buffer_on_node,
 	.free_data_on_node = free_vector_cpp_buffer_on_node,
 	.copy_methods = &vector_cpp_copy_data_methods_s,
-	.handle_to_pointer = vector_cpp_handle_to_pointer,
+	.to_pointer = vector_cpp_to_pointer,
 	.get_size = vector_cpp_interface_get_size,
 	.footprint = footprint_vector_cpp_interface_crc32,
 	.compare = vector_cpp_compare,
@@ -299,7 +299,7 @@ static struct starpu_data_interface_ops interface_vector_cpp_ops =
 	allocate_vector_cpp_buffer_on_node,
 	free_vector_cpp_buffer_on_node,
 	&vector_cpp_copy_data_methods_s,
-	vector_cpp_handle_to_pointer,
+	vector_cpp_to_pointer,
 	vector_cpp_interface_get_size,
 	footprint_vector_cpp_interface_crc32,
 	vector_cpp_compare,
@@ -316,12 +316,10 @@ static struct starpu_data_interface_ops interface_vector_cpp_ops =
 };
 #endif
 
-static void *vector_cpp_handle_to_pointer(starpu_data_handle_t handle, unsigned node)
+static void *vector_cpp_to_pointer(void *data_interface, unsigned node)
 {
-	STARPU_ASSERT(starpu_data_test_if_allocated_on_node(handle, node));
-
-	struct vector_cpp_interface *vector_interface = (struct vector_cpp_interface *)
-		starpu_data_get_interface_on_node(handle, node);
+	(void) node;
+	struct vector_cpp_interface *vector_interface = (struct vector_cpp_interface *) data_interface;
 
 	return (void*) vector_interface->ptr;
 }

+ 5 - 7
examples/filters/custom_mf/custom_interface.c

@@ -2,7 +2,7 @@
  *
  * Copyright (C) 2012-2013                                Inria
  * Copyright (C) 2012-2013,2015-2017                      CNRS
- * Copyright (C) 2012-2014                                Université de Bordeaux
+ * Copyright (C) 2012-2014, 2018                                Université de Bordeaux
  *
  * 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
@@ -73,8 +73,7 @@ static void     register_custom_handle(starpu_data_handle_t handle,
 				       void *data_interface);
 static starpu_ssize_t  allocate_custom_buffer_on_node(void *data_interface_,
 					       unsigned dst_node);
-static void*    custom_handle_to_pointer(starpu_data_handle_t data_handle,
-					 unsigned node);
+static void*    custom_to_pointer(void *data_interface, unsigned node);
 static void     free_custom_buffer_on_node(void *data_interface, unsigned node);
 static size_t   custom_interface_get_size(starpu_data_handle_t handle);
 static uint32_t footprint_custom_interface_crc32(starpu_data_handle_t handle);
@@ -94,7 +93,7 @@ static struct starpu_data_interface_ops interface_custom_ops =
 {
 	.register_data_handle  = register_custom_handle,
 	.allocate_data_on_node = allocate_custom_buffer_on_node,
-	.handle_to_pointer     = custom_handle_to_pointer,
+	.to_pointer            = custom_to_pointer,
 	.free_data_on_node     = free_custom_buffer_on_node,
 	.copy_methods          = &custom_copy_data_methods_s,
 	.get_size              = custom_interface_get_size,
@@ -203,10 +202,9 @@ static void free_custom_buffer_on_node(void *data_interface, unsigned node)
 }
 
 static void*
-custom_handle_to_pointer(starpu_data_handle_t handle, unsigned node)
+custom_to_pointer(void *data, unsigned node)
 {
-	struct custom_data_interface *data_interface =
-		(struct custom_data_interface *) starpu_data_get_interface_on_node(handle, node);
+	struct custom_data_interface *data_interface = data;
 
 
 	switch(starpu_node_get_kind(node))

+ 2 - 2
examples/interface/complex_interface.c

@@ -2,7 +2,7 @@
  *
  * Copyright (C) 2012-2013                                Inria
  * Copyright (C) 2012-2015,2017                           CNRS
- * Copyright (C) 2013-2015                                Université de Bordeaux
+ * Copyright (C) 2013-2015, 2018                                Université de Bordeaux
  *
  * 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
@@ -195,7 +195,7 @@ static struct starpu_data_interface_ops interface_complex_ops =
 	.footprint = complex_footprint,
 	.interfaceid = STARPU_UNKNOWN_INTERFACE_ID,
 	.interface_size = sizeof(struct starpu_complex_interface),
-	.handle_to_pointer = NULL,
+	.to_pointer = NULL,
 	.pack_data = complex_pack_data,
 	.unpack_data = complex_unpack_data,
 	.describe = complex_describe

+ 2 - 1
include/starpu_data_interfaces.h

@@ -124,7 +124,8 @@ struct starpu_data_interface_ops
 	starpu_ssize_t	 (*allocate_data_on_node)	(void *data_interface, unsigned node);
 	void 		 (*free_data_on_node)		(void *data_interface, unsigned node);
 	const struct starpu_data_copy_methods *copy_methods;
-	void * 		 (*handle_to_pointer)		(starpu_data_handle_t handle, unsigned node);
+	void * 		 (*handle_to_pointer)		(starpu_data_handle_t handle, unsigned node); /* deprecated */
+	void * 		 (*to_pointer)			(void *data_interface, unsigned node);
 	size_t 		 (*get_size)			(starpu_data_handle_t handle);
 	uint32_t 	 (*footprint)			(starpu_data_handle_t handle);
 	int 		 (*compare)			(void *data_interface_a, void *data_interface_b);

+ 4 - 5
mpi/examples/user_datatype/my_interface.c

@@ -167,11 +167,10 @@ static starpu_ssize_t data_describe(void *data_interface, char *buf, size_t size
 	return snprintf(buf, size, "Data%d-%c", my_interface->d, my_interface->c);
 }
 
-static void *data_handle_to_pointer(starpu_data_handle_t handle, unsigned node)
+static void *data_to_pointer(void *data_interface, unsigned node)
 {
-	STARPU_ASSERT(starpu_data_test_if_allocated_on_node(handle, node));
-
-	struct starpu_my_interface *my_interface = (struct starpu_my_interface *) starpu_data_get_interface_on_node(handle, node);
+	(void) node;
+	struct starpu_my_interface *my_interface = data_interface;
 
 	return (void*) &my_interface->d;
 }
@@ -211,7 +210,7 @@ static struct starpu_data_interface_ops interface_data_ops =
 	.footprint = data_footprint,
 	.interfaceid = STARPU_UNKNOWN_INTERFACE_ID,
 	.interface_size = sizeof(struct starpu_my_interface),
-	.handle_to_pointer = data_handle_to_pointer,
+	.to_pointer = data_to_pointer,
 	.pack_data = data_pack_data,
 	.unpack_data = data_unpack_data,
 	.describe = data_describe

+ 1 - 1
mpi/src/load_balancer/policy/data_movements_interface.c

@@ -260,7 +260,7 @@ static struct starpu_data_interface_ops interface_data_movements_ops =
 	.footprint = data_movements_footprint,
 	.interfaceid = STARPU_UNKNOWN_INTERFACE_ID,
 	.interface_size = sizeof(struct data_movements_interface),
-	.handle_to_pointer = NULL,
+	.to_pointer = NULL,
 	.pack_data = data_movements_pack_data,
 	.unpack_data = data_movements_unpack_data,
 	.describe = NULL

+ 1 - 1
mpi/src/load_balancer/policy/load_data_interface.c

@@ -243,7 +243,7 @@ static struct starpu_data_interface_ops interface_load_data_ops =
 	.footprint = load_data_footprint,
 	.interfaceid = STARPU_UNKNOWN_INTERFACE_ID,
 	.interface_size = sizeof(struct load_data_interface),
-	.handle_to_pointer = NULL,
+	.to_pointer = NULL,
 	.pack_data = load_data_pack_data,
 	.unpack_data = load_data_unpack_data,
 	.describe = NULL

+ 2 - 2
mpi/src/starpu_mpi_datatype.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2011-2012,2015                           Inria
- * Copyright (C) 2009-2011,2014-2015                      Université de Bordeaux
+ * Copyright (C) 2009-2011,2014-2015, 2018                      Université de Bordeaux
  * Copyright (C) 2010-2017                                CNRS
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -301,7 +301,7 @@ int starpu_mpi_datatype_register(starpu_data_handle_t handle, starpu_mpi_datatyp
 		table->free_datatype_func = free_datatype_func;
 		HASH_ADD_INT(_starpu_mpi_datatype_funcs_table, id, table);
 	}
-	STARPU_ASSERT_MSG(handle->ops->handle_to_pointer, "The data interface must define the operation 'handle_to_pointer'\n");
+	STARPU_ASSERT_MSG(handle->ops->handle_to_pointer || handle->ops->to_pointer, "The data interface must define the operation 'to_pointer'\n");
 	STARPU_PTHREAD_MUTEX_UNLOCK(&_starpu_mpi_datatype_funcs_table_mutex);
 	return 0;
 }

+ 5 - 7
mpi/tests/user_defined_datatype_value.h

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2013-2015,2017,2018                      CNRS
- * Copyright (C) 2014                                     Université de Bordeaux
+ * Copyright (C) 2014, 2018                                     Université de Bordeaux
  *
  * 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
@@ -81,12 +81,10 @@ static uint32_t value_footprint(starpu_data_handle_t handle)
 	return starpu_hash_crc32c_be(value_get_size(handle), 0);
 }
 
-static void *value_handle_to_pointer(starpu_data_handle_t handle, unsigned node)
+static void *value_to_pointer(void *data_interface, unsigned node)
 {
-	STARPU_ASSERT(starpu_data_test_if_allocated_on_node(handle, node));
-
-	struct starpu_value_interface *value_interface = (struct starpu_value_interface *)
-		starpu_data_get_interface_on_node(handle, node);
+	(void) node;
+	struct starpu_value_interface *value_interface = data_interface;
 
 	return (void*) value_interface->value;
 }
@@ -151,7 +149,7 @@ static struct starpu_data_interface_ops interface_value_ops =
 	.footprint = value_footprint,
 	.interfaceid = STARPU_UNKNOWN_INTERFACE_ID,
 	.interface_size = sizeof(struct starpu_value_interface),
-	.handle_to_pointer = value_handle_to_pointer,
+	.to_pointer = value_to_pointer,
 	.pack_data = value_pack_data,
 	.unpack_data = value_unpack_data
 };

+ 6 - 8
src/datawizard/interfaces/bcsr_interface.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2011-2012,2017                           Inria
- * Copyright (C) 2008-2017                                Université de Bordeaux
+ * Copyright (C) 2008-2018                                Université de Bordeaux
  * Copyright (C) 2010-2015,2017                           CNRS
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -42,7 +42,7 @@ static const struct starpu_data_copy_methods bcsr_copy_data_methods_s =
 };
 
 static void register_bcsr_handle(starpu_data_handle_t handle, unsigned home_node, void *data_interface);
-static void *bcsr_handle_to_pointer(starpu_data_handle_t data_handle, unsigned node);
+static void *bcsr_to_pointer(void *data_interface, unsigned node);
 static starpu_ssize_t allocate_bcsr_buffer_on_node(void *data_interface, unsigned dst_node);
 static void free_bcsr_buffer_on_node(void *data_interface, unsigned node);
 static size_t bcsr_interface_get_size(starpu_data_handle_t handle);
@@ -64,18 +64,16 @@ struct starpu_data_interface_ops starpu_interface_bcsr_ops =
 	.footprint = footprint_bcsr_interface_crc32,
 	.compare = bcsr_compare,
 	.describe = describe,
-	.handle_to_pointer = bcsr_handle_to_pointer,
+	.to_pointer = bcsr_to_pointer,
 	.name = "STARPU_BCSR_INTERFACE",
 	.pack_data = pack_data,
 	.unpack_data = unpack_data
 };
 
-static void *bcsr_handle_to_pointer(starpu_data_handle_t data_handle, unsigned node)
+static void *bcsr_to_pointer(void *data_interface, unsigned node)
 {
-	STARPU_ASSERT(starpu_data_test_if_allocated_on_node(data_handle, node));
-
-	struct starpu_bcsr_interface *bcsr_interface = (struct starpu_bcsr_interface *)
-		starpu_data_get_interface_on_node(data_handle, node);
+	(void) node;
+	struct starpu_bcsr_interface *bcsr_interface = data_interface;
 
 	return (void*) bcsr_interface->nzval;
 }

+ 5 - 7
src/datawizard/interfaces/block_interface.c

@@ -71,7 +71,7 @@ static const struct starpu_data_copy_methods block_copy_data_methods_s =
 
 
 static void register_block_handle(starpu_data_handle_t handle, unsigned home_node, void *data_interface);
-static void *block_handle_to_pointer(starpu_data_handle_t data_handle, unsigned node);
+static void *block_to_pointer(void *data_interface, unsigned node);
 static starpu_ssize_t allocate_block_buffer_on_node(void *data_interface_, unsigned dst_node);
 static void free_block_buffer_on_node(void *data_interface, unsigned node);
 static size_t block_interface_get_size(starpu_data_handle_t handle);
@@ -86,7 +86,7 @@ struct starpu_data_interface_ops starpu_interface_block_ops =
 {
 	.register_data_handle = register_block_handle,
 	.allocate_data_on_node = allocate_block_buffer_on_node,
-	.handle_to_pointer = block_handle_to_pointer,
+	.to_pointer = block_to_pointer,
 	.free_data_on_node = free_block_buffer_on_node,
 	.copy_methods = &block_copy_data_methods_s,
 	.get_size = block_interface_get_size,
@@ -101,12 +101,10 @@ struct starpu_data_interface_ops starpu_interface_block_ops =
 	.name = "STARPU_BLOCK_INTERFACE"
 };
 
-static void *block_handle_to_pointer(starpu_data_handle_t handle, unsigned node)
+static void *block_to_pointer(void *data_interface, unsigned node)
 {
-	STARPU_ASSERT(starpu_data_test_if_allocated_on_node(handle, node));
-
-	struct starpu_block_interface *block_interface = (struct starpu_block_interface *)
-		starpu_data_get_interface_on_node(handle, node);
+	(void) node;
+	struct starpu_block_interface *block_interface = data_interface;
 
 	return (void*) block_interface->ptr;
 }

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

@@ -2,7 +2,7 @@
  *
  * Copyright (C) 2012,2017                                Inria
  * Copyright (C) 2012-2015,2017                           CNRS
- * Copyright (C) 2012-2017                                Université de Bordeaux
+ * Copyright (C) 2012-2018                                Université de Bordeaux
  *
  * 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
@@ -207,7 +207,7 @@ struct starpu_data_interface_ops starpu_interface_coo_ops =
 {
 	.register_data_handle  = register_coo_handle,
 	.allocate_data_on_node = allocate_coo_buffer_on_node,
-	.handle_to_pointer     = NULL,
+	.to_pointer            = NULL,
 	.free_data_on_node     = free_coo_buffer_on_node,
 	.copy_methods          = &coo_copy_data_methods,
 	.get_size              = coo_interface_get_size,

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

@@ -507,8 +507,15 @@ void *starpu_data_handle_to_pointer(starpu_data_handle_t handle, unsigned node)
 {
 	/* Check whether the operation is supported and the node has actually
 	 * been allocated.  */
-	if (handle->ops->handle_to_pointer
-	    && starpu_data_test_if_allocated_on_node(handle, node))
+	if (!starpu_data_test_if_allocated_on_node(handle, node))
+		return NULL;
+	if (handle->ops->to_pointer)
+	{
+		return handle->ops->to_pointer(starpu_data_get_interface_on_node(handle, node), node);
+	}
+
+	/* Deprecated */
+	if (handle->ops->handle_to_pointer)
 	{
 		return handle->ops->handle_to_pointer(handle, node);
 	}

+ 5 - 7
src/datawizard/interfaces/matrix_interface.c

@@ -86,7 +86,7 @@ static const struct starpu_data_copy_methods matrix_copy_data_methods_s =
 };
 
 static void register_matrix_handle(starpu_data_handle_t handle, unsigned home_node, void *data_interface);
-static void *matrix_handle_to_pointer(starpu_data_handle_t data_handle, unsigned node);
+static void *matrix_to_pointer(void *data_interface, unsigned node);
 static starpu_ssize_t allocate_matrix_buffer_on_node(void *data_interface_, unsigned dst_node);
 static void free_matrix_buffer_on_node(void *data_interface, unsigned node);
 static size_t matrix_interface_get_size(starpu_data_handle_t handle);
@@ -101,7 +101,7 @@ struct starpu_data_interface_ops starpu_interface_matrix_ops =
 {
 	.register_data_handle = register_matrix_handle,
 	.allocate_data_on_node = allocate_matrix_buffer_on_node,
-	.handle_to_pointer = matrix_handle_to_pointer,
+	.to_pointer = matrix_to_pointer,
 	.free_data_on_node = free_matrix_buffer_on_node,
 	.copy_methods = &matrix_copy_data_methods_s,
 	.get_size = matrix_interface_get_size,
@@ -148,12 +148,10 @@ static void register_matrix_handle(starpu_data_handle_t handle, unsigned home_no
 	}
 }
 
-static void *matrix_handle_to_pointer(starpu_data_handle_t handle, unsigned node)
+static void *matrix_to_pointer(void *data_interface, unsigned node)
 {
-	STARPU_ASSERT(starpu_data_test_if_allocated_on_node(handle, node));
-
-	struct starpu_matrix_interface *matrix_interface = (struct starpu_matrix_interface *)
-		starpu_data_get_interface_on_node(handle, node);
+	(void) node;
+	struct starpu_matrix_interface *matrix_interface = data_interface;
 
 	return (void*) matrix_interface->ptr;
 }

+ 4 - 6
src/datawizard/interfaces/multiformat_interface.c

@@ -84,7 +84,7 @@ static const struct starpu_data_copy_methods multiformat_copy_data_methods_s =
 
 static void register_multiformat_handle(starpu_data_handle_t handle, unsigned home_node, void *data_interface);
 static starpu_ssize_t allocate_multiformat_buffer_on_node(void *data_interface_, unsigned dst_node);
-static void *multiformat_handle_to_pointer(starpu_data_handle_t data_handle, unsigned node);
+static void *multiformat_to_pointer(void *data_interface, unsigned node);
 static void free_multiformat_buffer_on_node(void *data_interface, unsigned node);
 static size_t multiformat_interface_get_size(starpu_data_handle_t handle);
 static uint32_t footprint_multiformat_interface_crc32(starpu_data_handle_t handle);
@@ -105,7 +105,7 @@ struct starpu_data_interface_ops starpu_interface_multiformat_ops =
 {
 	.register_data_handle  = register_multiformat_handle,
 	.allocate_data_on_node = allocate_multiformat_buffer_on_node,
-	.handle_to_pointer     = multiformat_handle_to_pointer,
+	.to_pointer            = multiformat_to_pointer,
 	.free_data_on_node     = free_multiformat_buffer_on_node,
 	.copy_methods          = &multiformat_copy_data_methods_s,
 	.get_size              = multiformat_interface_get_size,
@@ -118,11 +118,9 @@ struct starpu_data_interface_ops starpu_interface_multiformat_ops =
 	.get_mf_ops            = get_mf_ops
 };
 
-static void *multiformat_handle_to_pointer(starpu_data_handle_t handle, unsigned node)
+static void *multiformat_to_pointer(void *data_interface, unsigned node)
 {
-	STARPU_ASSERT(starpu_data_test_if_allocated_on_node(handle, node));
-	struct starpu_multiformat_interface *multiformat_interface =
-		(struct starpu_multiformat_interface *) starpu_data_get_interface_on_node(handle, node);
+	struct starpu_multiformat_interface *multiformat_interface = data_interface;
 
 	switch(starpu_node_get_kind(node))
 	{

+ 6 - 7
src/datawizard/interfaces/variable_interface.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2011-2012,2017                           Inria
- * Copyright (C) 2010-2017                                Université de Bordeaux
+ * Copyright (C) 2010-2018                                Université de Bordeaux
  * Copyright (C) 2010-2015,2017                           CNRS
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -39,7 +39,7 @@ static const struct starpu_data_copy_methods variable_copy_data_methods_s =
 
 static void register_variable_handle(starpu_data_handle_t handle, unsigned home_node, void *data_interface);
 static starpu_ssize_t allocate_variable_buffer_on_node(void *data_interface_, unsigned dst_node);
-static void *variable_handle_to_pointer(starpu_data_handle_t data_handle, unsigned node);
+static void *variable_to_pointer(void *data_interface, unsigned node);
 static void free_variable_buffer_on_node(void *data_interface, unsigned node);
 static size_t variable_interface_get_size(starpu_data_handle_t handle);
 static uint32_t footprint_variable_interface_crc32(starpu_data_handle_t handle);
@@ -53,7 +53,7 @@ struct starpu_data_interface_ops starpu_interface_variable_ops =
 {
 	.register_data_handle = register_variable_handle,
 	.allocate_data_on_node = allocate_variable_buffer_on_node,
-	.handle_to_pointer = variable_handle_to_pointer,
+	.to_pointer = variable_to_pointer,
 	.free_data_on_node = free_variable_buffer_on_node,
 	.copy_methods = &variable_copy_data_methods_s,
 	.get_size = variable_interface_get_size,
@@ -68,11 +68,10 @@ struct starpu_data_interface_ops starpu_interface_variable_ops =
 	.name = "STARPU_VARIABLE_INTERFACE"
 };
 
-static void *variable_handle_to_pointer(starpu_data_handle_t handle, unsigned node)
+static void *variable_to_pointer(void *data_interface, unsigned node)
 {
-	STARPU_ASSERT(starpu_data_test_if_allocated_on_node(handle, node));
-
-	return (void*) STARPU_VARIABLE_GET_PTR(starpu_data_get_interface_on_node(handle, node));
+	(void) node;
+	return (void*) STARPU_VARIABLE_GET_PTR(data_interface);
 }
 
 static void register_variable_handle(starpu_data_handle_t handle, unsigned home_node, void *data_interface)

+ 6 - 8
src/datawizard/interfaces/vector_interface.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2011-2012,2014,2017                      Inria
- * Copyright (C) 2008-2017                                Université de Bordeaux
+ * Copyright (C) 2008-2018                                Université de Bordeaux
  * Copyright (C) 2010-2015,2017                           CNRS
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -39,7 +39,7 @@ static const struct starpu_data_copy_methods vector_copy_data_methods_s =
 
 static void register_vector_handle(starpu_data_handle_t handle, unsigned home_node, void *data_interface);
 static starpu_ssize_t allocate_vector_buffer_on_node(void *data_interface_, unsigned dst_node);
-static void *vector_handle_to_pointer(starpu_data_handle_t data_handle, unsigned node);
+static void *vector_to_pointer(void *data_interface, unsigned node);
 static void free_vector_buffer_on_node(void *data_interface, unsigned node);
 static size_t vector_interface_get_size(starpu_data_handle_t handle);
 static uint32_t footprint_vector_interface_crc32(starpu_data_handle_t handle);
@@ -53,7 +53,7 @@ struct starpu_data_interface_ops starpu_interface_vector_ops =
 {
 	.register_data_handle = register_vector_handle,
 	.allocate_data_on_node = allocate_vector_buffer_on_node,
-	.handle_to_pointer = vector_handle_to_pointer,
+	.to_pointer = vector_to_pointer,
 	.free_data_on_node = free_vector_buffer_on_node,
 	.copy_methods = &vector_copy_data_methods_s,
 	.get_size = vector_interface_get_size,
@@ -68,12 +68,10 @@ struct starpu_data_interface_ops starpu_interface_vector_ops =
 	.name = "STARPU_VECTOR_INTERFACE"
 };
 
-static void *vector_handle_to_pointer(starpu_data_handle_t handle, unsigned node)
+static void *vector_to_pointer(void *data_interface, unsigned node)
 {
-	STARPU_ASSERT(starpu_data_test_if_allocated_on_node(handle, node));
-
-	struct starpu_vector_interface *vector_interface = (struct starpu_vector_interface *)
-		starpu_data_get_interface_on_node(handle, node);
+	(void) node;
+	struct starpu_vector_interface *vector_interface = data_interface;
 
 	return (void*) vector_interface->ptr;
 }

+ 13 - 11
tests/datawizard/interfaces/test_interfaces.c

@@ -2,7 +2,7 @@
  *
  * Copyright (C) 2011-2013,2017                           Inria
  * Copyright (C) 2012-2015,2017                           CNRS
- * Copyright (C) 2013,2015                                Université de Bordeaux
+ * Copyright (C) 2013,2015, 2018                                Université de Bordeaux
  *
  * 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
@@ -87,7 +87,7 @@ struct data_interface_test_summary
 	/* Other stuff */
 	int compare;
 #ifdef STARPU_USE_CPU
-	int handle_to_pointer;
+	int to_pointer;
 #endif
 };
 
@@ -145,8 +145,8 @@ void data_interface_test_summary_print(FILE *f,
 #ifdef STARPU_USE_CPU
 	FPRINTF(f, "CPU    -> CPU    : %s\n",
 		enum_to_string(s->cpu_to_cpu));
-	FPRINTF(f, "handle_to_pointer() : %s\n",
-		enum_to_string(s->handle_to_pointer));
+	FPRINTF(f, "to_pointer() : %s\n",
+		enum_to_string(s->to_pointer));
 #endif /* !STARPU_USE_CPU */
 	FPRINTF(f, "compare()        : %s\n",
 		enum_to_string(s->compare));
@@ -267,7 +267,7 @@ static struct data_interface_test_summary summary =
 	.mic_to_cpu_async      = UNTESTED,
 #endif
 #ifdef STARPU_USE_CPU
-	.handle_to_pointer     = UNTESTED,
+	.to_pointer            = UNTESTED,
 #endif
 	.success               = SUCCESS
 };
@@ -780,15 +780,16 @@ compare(void)
 
 #ifdef STARPU_USE_CPU
 static void
-handle_to_pointer(void)
+to_pointer(void)
 {
 	void *ptr;
 	unsigned int node;
 	unsigned int tests = 0;
 	starpu_data_handle_t handle;
+	void * data_interface;
 
 	handle = *current_config->handle;
-	if (!handle->ops->handle_to_pointer)
+	if (!handle->ops->to_pointer)
 		return;
 
 	for (node = 0; node < STARPU_MAXNODES; node++)
@@ -798,17 +799,18 @@ handle_to_pointer(void)
 		if (!starpu_data_test_if_allocated_on_node(handle, node))
 			continue;
 
-		ptr = handle->ops->handle_to_pointer(handle, node);
+		data_interface = starpu_data_get_interface_on_node(handle, node);
+		ptr = handle->ops->to_pointer(data_interface, node);
 		if (starpu_data_lookup(ptr) != handle)
 		{
-			summary.handle_to_pointer = FAILURE;
+			summary.to_pointer = FAILURE;
 			return;
 		}
 		tests++;
 	}
 
 	if (tests > 0)
-		summary.handle_to_pointer = SUCCESS;
+		summary.to_pointer = SUCCESS;
 }
 #endif /* !STARPU_USE_CPU */
 
@@ -853,7 +855,7 @@ run_tests(struct test_config *conf)
 #ifdef STARPU_USE_CPU
 	ram_to_ram();
 	compare();
-	handle_to_pointer();
+	to_pointer();
 #endif
 
 	return &summary;