Pārlūkot izejas kodu

fix test with NUMA

Samuel Thibault 8 gadi atpakaļ
vecāks
revīzija
6f1bd97220
1 mainītis faili ar 11 papildinājumiem un 1 dzēšanām
  1. 11 1
      tests/disk/mem_reclaim.c

+ 11 - 1
tests/disk/mem_reclaim.c

@@ -67,7 +67,16 @@ int main(int argc, char **argv)
 }
 #else
 
-const struct starpu_data_copy_methods my_vector_copy_data_methods_s;
+static int (*any_to_any)(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node, void *async_data);
+
+/* We need a ram-to-ram copy for NUMA machine, use any_to_any for that */
+static int ram_to_ram(void *src_interface, unsigned src_node, void *dst_interface, unsigned dst_node) {
+	return any_to_any(src_interface, src_node, dst_interface, dst_node, NULL);
+}
+
+const struct starpu_data_copy_methods my_vector_copy_data_methods_s = {
+	.ram_to_ram = ram_to_ram
+};
 struct starpu_data_interface_ops starpu_interface_my_vector_ops;
 
 void starpu_my_vector_data_register(starpu_data_handle_t *handleptr, int home_node,
@@ -219,6 +228,7 @@ int main(void)
 	setenv("STARPU_LIMIT_CPU_MEM", MEMSIZE_STR, 1);
 
 	/* Build an vector-like interface which doesn't have the any_to_any helper, to force making use of pack/unpack */
+	any_to_any = starpu_interface_vector_ops.copy_methods->any_to_any;
 	memcpy(&starpu_interface_my_vector_ops, &starpu_interface_vector_ops, sizeof(starpu_interface_my_vector_ops));
 	starpu_interface_my_vector_ops.copy_methods = &my_vector_copy_data_methods_s;