浏览代码

use STARPU_MAIN_RAM instead of 0 to design main memory

Nathalie Furmento 12 年之前
父节点
当前提交
579be68c99
共有 35 个文件被更改,包括 80 次插入80 次删除
  1. 1 1
      doc/doxygen/chapters/code/multiformat.c
  2. 2 2
      doc/doxygen/chapters/mpi_support.doxy
  3. 3 3
      doc/texinfo/chapters/advanced-examples.texi
  4. 4 4
      doc/texinfo/chapters/api.texi
  5. 2 2
      doc/texinfo/chapters/basic-examples.texi
  6. 3 3
      doc/texinfo/chapters/mpi-support.texi
  7. 3 3
      doc/texinfo/chapters/vector_scal_c.texi
  8. 2 2
      doc/tutorial/vector_scal.c
  9. 1 1
      examples/basic_examples/vector_scal.c
  10. 3 3
      examples/basic_examples/vector_scal_c.c
  11. 1 1
      examples/cpp/incrementer_cpp.cpp
  12. 2 2
      examples/heat/dw_factolu_tag.c
  13. 1 1
      gcc-plugin/tests/output-pointer.c
  14. 2 2
      gcc-plugin/tests/pointers.c
  15. 1 1
      mpi/examples/complex/mpi_complex.c
  16. 1 1
      mpi/examples/matrix_decomposition/mpi_cholesky_codelets.c
  17. 7 7
      mpi/examples/mpi_lu/plu_example.c
  18. 1 1
      mpi/examples/stencil/stencil5.c
  19. 1 1
      mpi/tests/insert_task_owner2.c
  20. 1 1
      mpi/tests/insert_task_owner_data.c
  21. 1 1
      mpi/tests/mpi_earlyrecv.c
  22. 1 1
      mpi/tests/mpi_earlyrecv2.c
  23. 3 3
      mpi/tests/mpi_redux.c
  24. 2 2
      sc_hypervisor/examples/cholesky/cholesky_grain_tag.c
  25. 2 2
      sc_hypervisor/examples/cholesky/cholesky_implicit.c
  26. 2 2
      sc_hypervisor/examples/cholesky/cholesky_tag.c
  27. 1 1
      sc_hypervisor/examples/cholesky/cholesky_tile_tag.c
  28. 1 1
      socl/src/cl_createbuffer.c
  29. 1 1
      src/datawizard/interfaces/void_interface.c
  30. 2 2
      starpufft/examples/testx.c
  31. 6 6
      starpufft/starpufftx.c
  32. 4 4
      starpufft/starpufftx1d.c
  33. 4 4
      starpufft/starpufftx2d.c
  34. 2 2
      tests/datawizard/double_parameter.c
  35. 6 6
      tests/main/combined_workers/bfs/bfs.cpp

+ 1 - 1
doc/doxygen/chapters/code/multiformat.c

@@ -57,5 +57,5 @@ struct starpu_multiformat_data_interface_ops format_ops = {
     ...
 };
 
-starpu_multiformat_data_register(handle, 0, &array_of_structs, NX, &format_ops);
+starpu_multiformat_data_register(handle, STARPU_MAIN_RAM, &array_of_structs, NX, &format_ops);
 //! [To be included]

+ 2 - 2
doc/doxygen/chapters/mpi_support.doxy

@@ -273,7 +273,7 @@ data which will be needed by the tasks that we will execute.
             int mpi_rank = my_distrib(x, y, size);
              if (mpi_rank == my_rank)
                 /* Owning data */
-                starpu_variable_data_register(&data_handles[x][y], 0,
+                starpu_variable_data_register(&data_handles[x][y], STARPU_MAIN_RAM,
                                               (uintptr_t)&(matrix[x][y]), sizeof(unsigned));
             else if (my_rank == my_distrib(x+1, y, size) || my_rank == my_distrib(x-1, y, size)
                   || my_rank == my_distrib(x, y+1, size) || my_rank == my_distrib(x, y-1, size))
@@ -339,7 +339,7 @@ for(x = 0; x < nblocks ;  x++)
 {
     int mpi_rank = my_distrib(x, nodes);
     if (rank == root) {
-        starpu_vector_data_register(&data_handles[x], 0, (uintptr_t)vector[x],
+        starpu_vector_data_register(&data_handles[x], STARPU_MAIN_RAM, (uintptr_t)vector[x],
                                     blocks_size, sizeof(float));
     }
     else if ((mpi_rank == rank) || ((rank == mpi_rank+1 || rank == mpi_rank-1))) {

+ 3 - 3
doc/texinfo/chapters/advanced-examples.texi

@@ -235,7 +235,7 @@ int vector[NX];
 starpu_data_handle_t handle;
 
 /* Declare data to StarPU */
-starpu_vector_data_register(&handle, 0, (uintptr_t)vector,
+starpu_vector_data_register(&handle, STARPU_MAIN_RAM, (uintptr_t)vector,
                             NX, sizeof(vector[0]));
 
 /* Partition the vector in PARTS sub-vectors */
@@ -1002,7 +1002,7 @@ struct starpu_multiformat_data_interface_ops format_ops = @{
     .cpu_elemsize = 2 * sizeof(float),
     ...
 @};
-starpu_multiformat_data_register(handle, 0, &array_of_structs, NX, &format_ops);
+starpu_multiformat_data_register(handle, STARPU_MAIN_RAM, &array_of_structs, NX, &format_ops);
 @end smallexample
 @end cartouche
 
@@ -1248,7 +1248,7 @@ Complex data interfaces can then be registered to StarPU.
 @smallexample
 double real = 45.0;
 double imaginary = 12.0;
-starpu_complex_data_register(&handle1, 0, &real, &imaginary, 1);
+starpu_complex_data_register(&handle1, STARPU_MAIN_RAM, &real, &imaginary, 1);
 starpu_insert_task(&cl_display, STARPU_R, handle1, 0);
 @end smallexample
 @end cartouche

+ 4 - 4
doc/texinfo/chapters/api.texi

@@ -783,7 +783,7 @@ item.
 @smallexample
 float var;
 starpu_data_handle_t var_handle;
-starpu_variable_data_register(&var_handle, 0, (uintptr_t)&var, sizeof(var));
+starpu_variable_data_register(&var_handle, STARPU_MAIN_RAM, (uintptr_t)&var, sizeof(var));
 @end smallexample
 @end cartouche
 @end deftypefun
@@ -796,7 +796,7 @@ Register the @var{nx} @var{elemsize}-byte elements pointed to by
 @smallexample
 float vector[NX];
 starpu_data_handle_t vector_handle;
-starpu_vector_data_register(&vector_handle, 0, (uintptr_t)vector, NX,
+starpu_vector_data_register(&vector_handle, STARPU_MAIN_RAM, (uintptr_t)vector, NX,
                             sizeof(vector[0]));
 @end smallexample
 @end cartouche
@@ -814,7 +814,7 @@ alignment purposes.
 float *matrix;
 starpu_data_handle_t matrix_handle;
 matrix = (float*)malloc(width * height * sizeof(float));
-starpu_matrix_data_register(&matrix_handle, 0, (uintptr_t)matrix,
+starpu_matrix_data_register(&matrix_handle, STARPU_MAIN_RAM, (uintptr_t)matrix,
                             width, width, height, sizeof(float));
 @end smallexample
 @end cartouche
@@ -831,7 +831,7 @@ between rows and between z planes.
 float *block;
 starpu_data_handle_t block_handle;
 block = (float*)malloc(nx*ny*nz*sizeof(float));
-starpu_block_data_register(&block_handle, 0, (uintptr_t)block,
+starpu_block_data_register(&block_handle, STARPU_MAIN_RAM, (uintptr_t)block,
                            nx, nx*ny, nx, ny, nz, sizeof(float));
 @end smallexample
 @end cartouche

+ 2 - 2
doc/texinfo/chapters/basic-examples.texi

@@ -584,7 +584,7 @@ The following lines show how to declare an array of @code{NX} elements of type
 float vector[NX];
 
 starpu_data_handle_t vector_handle;
-starpu_vector_data_register(&vector_handle, 0, (uintptr_t)vector, NX,
+starpu_vector_data_register(&vector_handle, STARPU_MAIN_RAM, (uintptr_t)vector, NX,
                             sizeof(vector[0]));
 @end smallexample
 @end cartouche
@@ -860,7 +860,7 @@ int main(int argc, char **argv)
 @cartouche
 @smallexample
     /* @b{Registering data within StarPU} */
-    starpu_vector_data_register(&vector_handle, 0, (uintptr_t)vector,
+    starpu_vector_data_register(&vector_handle, STARPU_MAIN_RAM, (uintptr_t)vector,
                                 NX, sizeof(vector[0]));
 
     /* @b{Definition of the task} */

+ 3 - 3
doc/texinfo/chapters/mpi-support.texi

@@ -64,7 +64,7 @@ int main(int argc, char **argv)
     starpu_init(NULL);
     starpu_mpi_initialize_extended(&rank, &size);
 
-    starpu_vector_data_register(&token_handle, 0, (uintptr_t)&token, 1, sizeof(unsigned));
+    starpu_vector_data_register(&token_handle, STARPU_MAIN_RAM, (uintptr_t)&token, 1, sizeof(unsigned));
 
     unsigned nloops = NITER;
     unsigned loop;
@@ -310,7 +310,7 @@ data which will be needed by the tasks that we will execute.
             int mpi_rank = my_distrib(x, y, size);
              if (mpi_rank == my_rank)
                 /* Owning data */
-                starpu_variable_data_register(&data_handles[x][y], 0,
+                starpu_variable_data_register(&data_handles[x][y], STARPU_MAIN_RAM,
                                               (uintptr_t)&(matrix[x][y]), sizeof(unsigned));
             else if (my_rank == my_distrib(x+1, y, size) || my_rank == my_distrib(x-1, y, size)
                   || my_rank == my_distrib(x, y+1, size) || my_rank == my_distrib(x, y-1, size))
@@ -381,7 +381,7 @@ for(x = 0; x < nblocks ;  x++)
 @{
     int mpi_rank = my_distrib(x, nodes);
     if (rank == root) @{
-        starpu_vector_data_register(&data_handles[x], 0, (uintptr_t)vector[x],
+        starpu_vector_data_register(&data_handles[x], STARPU_MAIN_RAM, (uintptr_t)vector[x],
                                     blocks_size, sizeof(float));
     @}
     else if ((mpi_rank == rank) || ((rank == mpi_rank+1 || rank == mpi_rank-1))) @{

+ 3 - 3
doc/texinfo/chapters/vector_scal_c.texi

@@ -2,7 +2,7 @@
 
 @c This file is part of the StarPU Handbook.
 @c Copyright (C) 2009-2011, 2013  Université de Bordeaux 1
-@c Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
+@c Copyright (C) 2010, 2011, 2012, 2013  Centre National de la Recherche Scientifique
 @c See the file starpu.texi for copying conditions.
 
 @smallexample
@@ -69,14 +69,14 @@ int main(int argc, char **argv)
      *  - the first argument of the registration method is a pointer to the
      *    handle that should describe the data
      *  - the second argument is the memory node where the data (ie. "vector")
-     *    resides initially: 0 stands for an address in main memory, as
+     *    resides initially: STARPU_MAIN_RAM stands for an address in main memory, as
      *    opposed to an adress on a GPU for instance.
      *  - the third argument is the adress of the vector in RAM
      *  - the fourth argument is the number of elements in the vector
      *  - the fifth argument is the size of each element.
      */
     starpu_data_handle_t vector_handle;
-    starpu_vector_data_register(&vector_handle, 0, (uintptr_t)vector,
+    starpu_vector_data_register(&vector_handle, STARPU_MAIN_RAM, (uintptr_t)vector,
                                 NX, sizeof(vector[0]));
 
     float factor = 3.14;

+ 2 - 2
doc/tutorial/vector_scal.c

@@ -75,14 +75,14 @@ int main(int argc, char **argv)
 	 *  - the first argument of the registration method is a pointer to the
 	 *    handle that should describe the data
 	 *  - the second argument is the memory node where the data (ie. "vector")
-	 *    resides initially: 0 stands for an address in main memory, as
+	 *    resides initially: STARPU_MAIN_RAM stands for an address in main memory, as
 	 *    opposed to an adress on a GPU for instance.
 	 *  - the third argument is the adress of the vector in RAM
 	 *  - the fourth argument is the number of elements in the vector
 	 *  - the fifth argument is the size of each element.
 	 */
 	starpu_data_handle_t vector_handle;
-	starpu_vector_data_register(&vector_handle, 0, (uintptr_t)vector,
+	starpu_vector_data_register(&vector_handle, STARPU_MAIN_RAM, (uintptr_t)vector,
 				    NX, sizeof(vector[0]));
 
 	float factor = 3.14;

+ 1 - 1
examples/basic_examples/vector_scal.c

@@ -141,7 +141,7 @@ int main(int argc, char **argv)
 	 *  - the first argument of the registration method is a pointer to the
 	 *    handle that should describe the data
 	 *  - the second argument is the memory node where the data (ie. "vector")
-	 *    resides initially: 0 stands for an address in main memory, as
+	 *    resides initially: STARPU_MAIN_RAM stands for an address in main memory, as
 	 *    opposed to an adress on a GPU for instance.
 	 *  - the third argument is the adress of the vector in RAM
 	 *  - the fourth argument is the number of elements in the vector

+ 3 - 3
examples/basic_examples/vector_scal_c.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013  Centre National de la Recherche Scientifique
  * Copyright (C) 2011, 2013  Université de Bordeaux 1
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -69,14 +69,14 @@ int compute_(int *F_NX, float *vector)
 	 *  - the first argument of the registration method is a pointer to the
 	 *    handle that should describe the data
 	 *  - the second argument is the memory node where the data (ie. "vector")
-	 *    resides initially: 0 stands for an address in main memory, as
+	 *    resides initially: STARPU_MAIN_RAM stands for an address in main memory, as
 	 *    opposed to an adress on a GPU for instance.
 	 *  - the third argument is the adress of the vector in RAM
 	 *  - the fourth argument is the number of elements in the vector
 	 *  - the fifth argument is the size of each element.
 	 */
 	starpu_data_handle_t vector_handle;
-	starpu_vector_data_register(&vector_handle, 0, (uintptr_t)vector, NX, sizeof(vector[0]));
+	starpu_vector_data_register(&vector_handle, STARPU_MAIN_RAM, (uintptr_t)vector, NX, sizeof(vector[0]));
 
 	float factor = 3.14;
 

+ 1 - 1
examples/cpp/incrementer_cpp.cpp

@@ -50,7 +50,7 @@ int main(int argc, char **argv)
 	if (ret == -ENODEV) return 77;
 	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
-	starpu_vector_data_register(&float_array_handle, 0, (uintptr_t)&float_array, 4, sizeof(float));
+	starpu_vector_data_register(&float_array_handle, STARPU_MAIN_RAM, (uintptr_t)&float_array, 4, sizeof(float));
 
 #ifdef STARPU_USE_OPENCL
         ret = starpu_opencl_load_opencl_from_file("examples/incrementer/incrementer_kernels_opencl_kernel.cl", &opencl_program, NULL);

+ 2 - 2
examples/heat/dw_factolu_tag.c

@@ -2,7 +2,7 @@
  *
  * Copyright (C) 2009, 2010-2011  Université de Bordeaux 1
  * Copyright (C) 2010  Mehdi Juhoor <mjuhoor@gmail.com>
- * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013  Centre National de la Recherche Scientifique
  *
  * 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
@@ -297,7 +297,7 @@ void dw_factoLU_tag(float *matA, unsigned size, unsigned ld, unsigned nblocks, u
 
 	/* monitor and partition the A matrix into blocks :
 	 * one block is now determined by 2 unsigned (i,j) */
-	starpu_matrix_data_register(&dataA, 0, (uintptr_t)matA, ld, size, size, sizeof(float));
+	starpu_matrix_data_register(&dataA, STARPU_MAIN_RAM, (uintptr_t)matA, ld, size, size, sizeof(float));
 
 	struct starpu_data_filter f =
 	{

+ 1 - 1
gcc-plugin/tests/output-pointer.c

@@ -82,7 +82,7 @@ main (int argc, char *argv[])
   expected_register_arguments.pointer = x;
   expected_register_arguments.elements = 42;
   expected_register_arguments.element_size = sizeof x[0];
-  starpu_vector_data_register (&handle, 0, (uintptr_t) x, 42, sizeof x[0]);
+  starpu_vector_data_register (&handle, STARPU_MAIN_RAM, (uintptr_t) x, 42, sizeof x[0]);
 
   struct insert_task_argument expected[] =
     {

+ 2 - 2
gcc-plugin/tests/pointers.c

@@ -85,12 +85,12 @@ main (int argc, char *argv[])
   expected_register_arguments.pointer = x;
   expected_register_arguments.elements = 1;
   expected_register_arguments.element_size = sizeof x[0];
-  starpu_vector_data_register (&handle, 0, (uintptr_t) x, 1, sizeof x[0]);
+  starpu_vector_data_register (&handle, STARPU_MAIN_RAM, (uintptr_t) x, 1, sizeof x[0]);
 
   expected_register_arguments.pointer = y;
   expected_register_arguments.elements = 1;
   expected_register_arguments.element_size = sizeof *y;
-  starpu_vector_data_register (&handle, 0, (uintptr_t) y, 1, sizeof *y);
+  starpu_vector_data_register (&handle, STARPU_MAIN_RAM, (uintptr_t) y, 1, sizeof *y);
 
   struct insert_task_argument expected_pointer_task[] =
     {

+ 1 - 1
mpi/examples/complex/mpi_complex.c

@@ -68,7 +68,7 @@ int main(int argc, char **argv)
 			imaginary[1] = 0.0;
 		}
 
-		starpu_complex_data_register(&handle, 0, real, imaginary, 2);
+		starpu_complex_data_register(&handle, STARPU_MAIN_RAM, real, imaginary, 2);
 		starpu_complex_data_register(&handle2, -1, real2, imaginary2, 2);
 
 		if (rank == 0)

+ 1 - 1
mpi/examples/matrix_decomposition/mpi_cholesky_codelets.c

@@ -85,7 +85,7 @@ void dw_cholesky(float ***matA, unsigned ld, int rank, int nodes, double *timing
 			if (mpi_rank == rank)
 			{
 				//fprintf(stderr, "[%d] Owning data[%d][%d]\n", rank, x, y);
-				starpu_matrix_data_register(&data_handles[x][y], 0, (uintptr_t)matA[x][y],
+				starpu_matrix_data_register(&data_handles[x][y], STARPU_MAIN_RAM, (uintptr_t)matA[x][y],
 						ld, size/nblocks, size/nblocks, sizeof(float));
 			}
 #warning TODO: make better test to only register what is needed

+ 7 - 7
mpi/examples/mpi_lu/plu_example.c

@@ -242,7 +242,7 @@ static void init_matrix(int rank)
 				}
 
 				/* Register it to StarPU */
-				starpu_matrix_data_register(handleptr, 0,
+				starpu_matrix_data_register(handleptr, STARPU_MAIN_RAM,
 					(uintptr_t)*blockptr, size/nblocks,
 					size/nblocks, size/nblocks, sizeof(TYPE));
 			}
@@ -261,7 +261,7 @@ static void init_matrix(int rank)
 #ifdef SINGLE_TMP11
 	starpu_malloc((void **)&tmp_11_block, blocksize);
 	allocated_memory_extra += blocksize;
-	starpu_matrix_data_register(&tmp_11_block_handle, 0, (uintptr_t)tmp_11_block,
+	starpu_matrix_data_register(&tmp_11_block_handle, STARPU_MAIN_RAM, (uintptr_t)tmp_11_block,
 			size/nblocks, size/nblocks, size/nblocks, sizeof(TYPE));
 #else
 	tmp_11_block_handles = calloc(nblocks, sizeof(starpu_data_handle_t));
@@ -276,7 +276,7 @@ static void init_matrix(int rank)
 			allocated_memory_extra += blocksize;
 			STARPU_ASSERT(tmp_11_block[k]);
 
-			starpu_matrix_data_register(&tmp_11_block_handles[k], 0,
+			starpu_matrix_data_register(&tmp_11_block_handles[k], STARPU_MAIN_RAM,
 				(uintptr_t)tmp_11_block[k],
 				size/nblocks, size/nblocks, size/nblocks, sizeof(TYPE));
 		}
@@ -311,7 +311,7 @@ static void init_matrix(int rank)
 			allocated_memory_extra += blocksize;
 			STARPU_ASSERT(tmp_12_block[k]);
 
-			starpu_matrix_data_register(&tmp_12_block_handles[k], 0,
+			starpu_matrix_data_register(&tmp_12_block_handles[k], STARPU_MAIN_RAM,
 				(uintptr_t)tmp_12_block[k],
 				size/nblocks, size/nblocks, size/nblocks, sizeof(TYPE));
 		}
@@ -322,7 +322,7 @@ static void init_matrix(int rank)
 			allocated_memory_extra += blocksize;
 			STARPU_ASSERT(tmp_21_block[k]);
 
-			starpu_matrix_data_register(&tmp_21_block_handles[k], 0,
+			starpu_matrix_data_register(&tmp_21_block_handles[k], STARPU_MAIN_RAM,
 				(uintptr_t)tmp_21_block[k],
 				size/nblocks, size/nblocks, size/nblocks, sizeof(TYPE));
 		}
@@ -334,7 +334,7 @@ static void init_matrix(int rank)
 			allocated_memory_extra += blocksize;
 			STARPU_ASSERT(tmp_12_block[i][k]);
 
-			starpu_matrix_data_register(&tmp_12_block_handles[i][k], 0,
+			starpu_matrix_data_register(&tmp_12_block_handles[i][k], STARPU_MAIN_RAM,
 				(uintptr_t)tmp_12_block[i][k],
 				size/nblocks, size/nblocks, size/nblocks, sizeof(TYPE));
 		}
@@ -345,7 +345,7 @@ static void init_matrix(int rank)
 			allocated_memory_extra += blocksize;
 			STARPU_ASSERT(tmp_21_block[i][k]);
 
-			starpu_matrix_data_register(&tmp_21_block_handles[i][k], 0,
+			starpu_matrix_data_register(&tmp_21_block_handles[i][k], STARPU_MAIN_RAM,
 				(uintptr_t)tmp_21_block[i][k],
 				size/nblocks, size/nblocks, size/nblocks, sizeof(TYPE));
 		}

+ 1 - 1
mpi/examples/stencil/stencil5.c

@@ -108,7 +108,7 @@ int main(int argc, char **argv)
 			if (mpi_rank == my_rank)
 			{
 				//fprintf(stderr, "[%d] Owning data[%d][%d]\n", my_rank, x, y);
-				starpu_variable_data_register(&data_handles[x][y], 0, (uintptr_t)&(matrix[x][y]), sizeof(unsigned));
+				starpu_variable_data_register(&data_handles[x][y], STARPU_MAIN_RAM, (uintptr_t)&(matrix[x][y]), sizeof(unsigned));
 			}
 			else if (my_rank == my_distrib(x+1, y, size) || my_rank == my_distrib(x-1, y, size)
 				 || my_rank == my_distrib(x, y+1, size) || my_rank == my_distrib(x, y-1, size))

+ 1 - 1
mpi/tests/insert_task_owner2.c

@@ -76,7 +76,7 @@ int main(int argc, char **argv)
 			starpu_variable_data_register(&data_handles[i], -1, (uintptr_t)NULL, sizeof(int));
 		}
 		y=200;
-		starpu_variable_data_register(&data_handles[3], 0, (uintptr_t)&y, sizeof(int));
+		starpu_variable_data_register(&data_handles[3], STARPU_MAIN_RAM, (uintptr_t)&y, sizeof(int));
 	}
 	else
 	{

+ 1 - 1
mpi/tests/insert_task_owner_data.c

@@ -59,7 +59,7 @@ int main(int argc, char **argv)
 	{
 		x[1] = 12;
 		starpu_variable_data_register(&data_handles[0], -1, (uintptr_t)NULL, sizeof(x[0]));
-		starpu_variable_data_register(&data_handles[1], 0, (uintptr_t)&x[1], sizeof(x[1]));
+		starpu_variable_data_register(&data_handles[1], STARPU_MAIN_RAM, (uintptr_t)&x[1], sizeof(x[1]));
 	}
 	else
 	{

+ 1 - 1
mpi/tests/mpi_earlyrecv.c

@@ -48,7 +48,7 @@ int main(int argc, char **argv)
 
 	for(i=0 ; i<NB ; i++)
 	{
-		starpu_variable_data_register(&tab_handle[i], 0, (uintptr_t)&rank, sizeof(int));
+		starpu_variable_data_register(&tab_handle[i], STARPU_MAIN_RAM, (uintptr_t)&rank, sizeof(int));
 		starpu_data_set_tag(tab_handle[i], i);
 		request[i] = NULL;
 	}

+ 1 - 1
mpi/tests/mpi_earlyrecv2.c

@@ -47,7 +47,7 @@ int main(int argc, char **argv)
 
 	for(i=0 ; i<NB ; i++)
 	{
-		starpu_variable_data_register(&tab_handle[i], 0, (uintptr_t)&rank, sizeof(int));
+		starpu_variable_data_register(&tab_handle[i], STARPU_MAIN_RAM, (uintptr_t)&rank, sizeof(int));
 		starpu_data_set_tag(tab_handle[i], i);
 	}
 

+ 3 - 3
mpi/tests/mpi_redux.c

@@ -75,7 +75,7 @@ int main(int argc, char **argv)
 
 		for(src=1 ; src<size ; src++)
 		{
-			starpu_variable_data_register(&handles[src], 0, (uintptr_t)&sum, sizeof(int));
+			starpu_variable_data_register(&handles[src], STARPU_MAIN_RAM, (uintptr_t)&sum, sizeof(int));
 			starpu_mpi_send(handles[src], src, 12+src, MPI_COMM_WORLD);
 			starpu_data_unregister(handles[src]);
 		}
@@ -84,11 +84,11 @@ int main(int argc, char **argv)
 	{
 		value = rank;
 		handles = malloc(sizeof(starpu_data_handle_t));
-		starpu_variable_data_register(&handles[0], 0, (uintptr_t)&value, sizeof(int));
+		starpu_variable_data_register(&handles[0], STARPU_MAIN_RAM, (uintptr_t)&value, sizeof(int));
 		starpu_mpi_send(handles[0], 0, 12+rank, MPI_COMM_WORLD);
 		starpu_data_unregister_submit(handles[0]);
 
-		starpu_variable_data_register(&handles[0], 0, (uintptr_t)&value, sizeof(int));
+		starpu_variable_data_register(&handles[0], STARPU_MAIN_RAM, (uintptr_t)&value, sizeof(int));
 		starpu_mpi_recv(handles[0], 0, 12+rank, MPI_COMM_WORLD, NULL);
 		starpu_data_unregister(handles[0]);
 	}

+ 2 - 2
sc_hypervisor/examples/cholesky/cholesky_grain_tag.c

@@ -2,7 +2,7 @@
  *
  * Copyright (C) 2009-2012  Université de Bordeaux 1
  * Copyright (C) 2010  Mehdi Juhoor <mjuhoor@gmail.com>
- * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013  Centre National de la Recherche Scientifique
  *
  * 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
@@ -178,7 +178,7 @@ static void cholesky_grain_rec(float *matA, unsigned size, unsigned ld, unsigned
 
 	/* monitor and partition the A matrix into blocks :
 	 * one block is now determined by 2 unsigned (i,j) */
-	starpu_matrix_data_register(&dataA, 0, (uintptr_t)matA, ld, size, size, sizeof(float));
+	starpu_matrix_data_register(&dataA, STARPU_MAIN_RAM, (uintptr_t)matA, ld, size, size, sizeof(float));
 
 	starpu_data_set_sequential_consistency_flag(dataA, 0);
 

+ 2 - 2
sc_hypervisor/examples/cholesky/cholesky_implicit.c

@@ -2,7 +2,7 @@
  *
  * Copyright (C) 2009-2012  Université de Bordeaux 1
  * Copyright (C) 2010  Mehdi Juhoor <mjuhoor@gmail.com>
- * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013  Centre National de la Recherche Scientifique
  * Copyright (C) 2011, 2012  INRIA
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -190,7 +190,7 @@ static void cholesky(float *matA, unsigned size, unsigned ld, unsigned nblocks)
 
 	/* monitor and partition the A matrix into blocks :
 	 * one block is now determined by 2 unsigned (i,j) */
-	starpu_matrix_data_register(&dataA, 0, (uintptr_t)matA, ld, size, size, sizeof(float));
+	starpu_matrix_data_register(&dataA, STARPU_MAIN_RAM, (uintptr_t)matA, ld, size, size, sizeof(float));
 
 	struct starpu_data_filter f =
 	{

+ 2 - 2
sc_hypervisor/examples/cholesky/cholesky_tag.c

@@ -2,7 +2,7 @@
  *
  * Copyright (C) 2009-2012  Université de Bordeaux 1
  * Copyright (C) 2010  Mehdi Juhoor <mjuhoor@gmail.com>
- * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013  Centre National de la Recherche Scientifique
  *
  * 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
@@ -268,7 +268,7 @@ static void cholesky(float *matA, unsigned size, unsigned ld, unsigned nblocks)
 
 	/* monitor and partition the A matrix into blocks :
 	 * one block is now determined by 2 unsigned (i,j) */
-	starpu_matrix_data_register(&dataA, 0, (uintptr_t)matA, ld, size, size, sizeof(float));
+	starpu_matrix_data_register(&dataA, STARPU_MAIN_RAM, (uintptr_t)matA, ld, size, size, sizeof(float));
 
 	starpu_data_set_sequential_consistency_flag(dataA, 0);
 

+ 1 - 1
sc_hypervisor/examples/cholesky/cholesky_tile_tag.c

@@ -283,7 +283,7 @@ int main(int argc, char **argv)
 	{
 		if (x <= y)
 		{
-			starpu_matrix_data_register(&A_state[y][x], 0, (uintptr_t)A[y][x], 
+			starpu_matrix_data_register(&A_state[y][x], STARPU_MAIN_RAM, (uintptr_t)A[y][x], 
 				BLOCKSIZE, BLOCKSIZE, BLOCKSIZE, sizeof(float));
 		}
 	}

+ 1 - 1
socl/src/cl_createbuffer.c

@@ -135,7 +135,7 @@ soclCreateBuffer(cl_context   context,
       memcpy(mem->ptr, host_ptr, size);
    
    // Create StarPU buffer (on home node? what's this?)
-   starpu_variable_data_register(&mem->handle, 0, (uintptr_t)mem->ptr, size); 
+   starpu_variable_data_register(&mem->handle, STARPU_MAIN_RAM, (uintptr_t)mem->ptr, size); 
 
    DEBUG_MSG("[Buffer %d] Initialized (cl_mem %p handle %p)\n", mem->id, mem, mem->handle);
    

+ 1 - 1
src/datawizard/interfaces/void_interface.c

@@ -64,7 +64,7 @@ static void register_void_handle(starpu_data_handle_t handle STARPU_ATTRIBUTE_UN
 /* declare a new data with the void interface */
 void starpu_void_data_register(starpu_data_handle_t *handleptr)
 {
-	starpu_data_register(handleptr, 0, NULL, &starpu_interface_void_ops);
+	starpu_data_register(handleptr, STARPU_MAIN_RAM, NULL, &starpu_interface_void_ops);
 }
 
 

+ 2 - 2
starpufft/examples/testx.c

@@ -234,8 +234,8 @@ int main(int argc, char *argv[])
 #endif
 
 #if 1
-	starpu_vector_data_register(&in_handle, 0, (uintptr_t) in, size, sizeof(*in));
-	starpu_vector_data_register(&out_handle, 0, (uintptr_t) out, size, sizeof(*out));
+	starpu_vector_data_register(&in_handle, STARPU_MAIN_RAM, (uintptr_t) in, size, sizeof(*in));
+	starpu_vector_data_register(&out_handle, STARPU_MAIN_RAM, (uintptr_t) out, size, sizeof(*out));
 
 	ret = STARPUFFT(execute_handle)(plan, in_handle, out_handle);
 	if (ret == -1) return 77;

+ 6 - 6
starpufft/starpufftx.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009-2012  Université de Bordeaux 1
- * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013  Centre National de la Recherche Scientifique
  *
  * 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
@@ -154,7 +154,7 @@ compute_roots(STARPUFFT(plan) plan)
 		plan->roots[dim] = malloc(plan->n[dim] * sizeof(**plan->roots));
 		for (k = 0; k < plan->n[dim]; k++)
 			plan->roots[dim][k] = cexp(exp*k);
-		starpu_vector_data_register(&plan->roots_handle[dim], 0, (uintptr_t) plan->roots[dim], plan->n[dim], sizeof(**plan->roots));
+		starpu_vector_data_register(&plan->roots_handle[dim], STARPU_MAIN_RAM, (uintptr_t) plan->roots[dim], plan->n[dim], sizeof(**plan->roots));
 
 #ifdef STARPU_USE_CUDA
 		if (plan->n[dim] > 100000)
@@ -216,9 +216,9 @@ STARPUFFT(start)(STARPUFFT(plan) plan, void *_in, void *_out)
 			switch (plan->type)
 			{
 			case C2C:
-				starpu_vector_data_register(&plan->in_handle, 0, (uintptr_t) plan->in, plan->totsize, sizeof(STARPUFFT(complex)));
+				starpu_vector_data_register(&plan->in_handle, STARPU_MAIN_RAM, (uintptr_t) plan->in, plan->totsize, sizeof(STARPUFFT(complex)));
 				if (!PARALLEL)
-					starpu_vector_data_register(&plan->out_handle, 0, (uintptr_t) plan->out, plan->totsize, sizeof(STARPUFFT(complex)));
+					starpu_vector_data_register(&plan->out_handle, STARPU_MAIN_RAM, (uintptr_t) plan->out, plan->totsize, sizeof(STARPUFFT(complex)));
 				if (PARALLEL)
 				{
 					for (z = 0; z < plan->totsize1; z++)
@@ -233,9 +233,9 @@ STARPUFFT(start)(STARPUFFT(plan) plan, void *_in, void *_out)
 			break;
 		}
 		case 2:
-			starpu_vector_data_register(&plan->in_handle, 0, (uintptr_t) plan->in, plan->totsize, sizeof(STARPUFFT(complex)));
+			starpu_vector_data_register(&plan->in_handle, STARPU_MAIN_RAM, (uintptr_t) plan->in, plan->totsize, sizeof(STARPUFFT(complex)));
 			if (!PARALLEL)
-				starpu_vector_data_register(&plan->out_handle, 0, (uintptr_t) plan->out, plan->totsize, sizeof(STARPUFFT(complex)));
+				starpu_vector_data_register(&plan->out_handle, STARPU_MAIN_RAM, (uintptr_t) plan->out, plan->totsize, sizeof(STARPUFFT(complex)));
 			if (PARALLEL)
 			{
 				for (z = 0; z < plan->totsize1; z++)

+ 4 - 4
starpufft/starpufftx1d.c

@@ -658,9 +658,9 @@ if (PARALLEL) {
 		plan->fft1_args[z].i = i;
 
 		/* Register the twisted1 buffer of size n2. */
-		starpu_vector_data_register(&plan->twisted1_handle[z], 0, (uintptr_t) &plan->twisted1[z*plan->totsize2], plan->totsize2, sizeof(*plan->twisted1));
+		starpu_vector_data_register(&plan->twisted1_handle[z], STARPU_MAIN_RAM, (uintptr_t) &plan->twisted1[z*plan->totsize2], plan->totsize2, sizeof(*plan->twisted1));
 		/* Register the fft1 buffer of size n2. */
-		starpu_vector_data_register(&plan->fft1_handle[z], 0, (uintptr_t) &plan->fft1[z*plan->totsize2], plan->totsize2, sizeof(*plan->fft1));
+		starpu_vector_data_register(&plan->fft1_handle[z], STARPU_MAIN_RAM, (uintptr_t) &plan->fft1[z*plan->totsize2], plan->totsize2, sizeof(*plan->fft1));
 
 		/* We'll need the result of fft1 on the CPU for the second
 		 * twist anyway, so tell starpu to not keep the fft1 buffer in
@@ -717,8 +717,8 @@ if (PARALLEL) {
 		plan->fft2_args[z].jj = jj;
 
 		/* Register n3 twisted2 buffers of size n1 */
-		starpu_vector_data_register(&plan->twisted2_handle[z], 0, (uintptr_t) &plan->twisted2[z*plan->totsize4], plan->totsize4, sizeof(*plan->twisted2));
-		starpu_vector_data_register(&plan->fft2_handle[z], 0, (uintptr_t) &plan->fft2[z*plan->totsize4], plan->totsize4, sizeof(*plan->fft2));
+		starpu_vector_data_register(&plan->twisted2_handle[z], STARPU_MAIN_RAM, (uintptr_t) &plan->twisted2[z*plan->totsize4], plan->totsize4, sizeof(*plan->twisted2));
+		starpu_vector_data_register(&plan->fft2_handle[z], STARPU_MAIN_RAM, (uintptr_t) &plan->fft2[z*plan->totsize4], plan->totsize4, sizeof(*plan->fft2));
 
 		/* We'll need the result of fft2 on the CPU for the third
 		 * twist anyway, so tell starpu to not keep the fft2 buffer in

+ 4 - 4
starpufft/starpufftx2d.c

@@ -661,8 +661,8 @@ if (PARALLEL) {
 		plan->fft1_args[z].j = j;
 
 		/* Register (n2,m2) chunks */
-		starpu_vector_data_register(&plan->twisted1_handle[z], 0, (uintptr_t) &plan->twisted1[z*plan->totsize2], plan->totsize2, sizeof(*plan->twisted1));
-		starpu_vector_data_register(&plan->fft1_handle[z], 0, (uintptr_t) &plan->fft1[z*plan->totsize2], plan->totsize2, sizeof(*plan->fft1));
+		starpu_vector_data_register(&plan->twisted1_handle[z], STARPU_MAIN_RAM, (uintptr_t) &plan->twisted1[z*plan->totsize2], plan->totsize2, sizeof(*plan->twisted1));
+		starpu_vector_data_register(&plan->fft1_handle[z], STARPU_MAIN_RAM, (uintptr_t) &plan->fft1[z*plan->totsize2], plan->totsize2, sizeof(*plan->fft1));
 
 		/* We'll need it on the CPU for the second twist anyway */
 		starpu_data_set_wt_mask(plan->fft1_handle[z], 1<<0);
@@ -717,8 +717,8 @@ if (PARALLEL) {
 		plan->fft2_args[z].ll = ll;
 
 		/* Register n3*m3 (n1,m1) chunks */
-		starpu_vector_data_register(&plan->twisted2_handle[z], 0, (uintptr_t) &plan->twisted2[z*plan->totsize4], plan->totsize4, sizeof(*plan->twisted2));
-		starpu_vector_data_register(&plan->fft2_handle[z], 0, (uintptr_t) &plan->fft2[z*plan->totsize4], plan->totsize4, sizeof(*plan->fft2));
+		starpu_vector_data_register(&plan->twisted2_handle[z], STARPU_MAIN_RAM, (uintptr_t) &plan->twisted2[z*plan->totsize4], plan->totsize4, sizeof(*plan->twisted2));
+		starpu_vector_data_register(&plan->fft2_handle[z], STARPU_MAIN_RAM, (uintptr_t) &plan->fft2[z*plan->totsize4], plan->totsize4, sizeof(*plan->fft2));
 
 		/* We'll need it on the CPU for the last twist anyway */
 		starpu_data_set_wt_mask(plan->fft2_handle[z], 1<<0);

+ 2 - 2
tests/datawizard/double_parameter.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2011  Université de Bordeaux 1
- * Copyright (C) 2012  Centre National de la Recherche Scientifique
+ * Copyright (C) 2012, 2013  Centre National de la Recherche Scientifique
  *
  * 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
@@ -114,7 +114,7 @@ int main(int argc, char **argv)
 	if (ret == -ENODEV) return STARPU_TEST_SKIPPED;
 	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
-	starpu_variable_data_register(&handle, 0, (uintptr_t)&foo, sizeof(foo));
+	starpu_variable_data_register(&handle, STARPU_MAIN_RAM, (uintptr_t)&foo, sizeof(foo));
 
 #define SUBMIT(mode0, mode1) \
 	{ \

+ 6 - 6
tests/main/combined_workers/bfs/bfs.cpp

@@ -153,23 +153,23 @@ int main( int argc, char** argv)
 	ret = starpu_init(NULL);
 	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 	
-	starpu_vector_data_register(&graph_nodes_handle, 0,
+	starpu_vector_data_register(&graph_nodes_handle, STARPU_MAIN_RAM,
 				    (uintptr_t) graph_nodes, nb_nodes,
 				    sizeof(graph_nodes[0] ));
-	starpu_vector_data_register(&graph_edges_handle, 0,
+	starpu_vector_data_register(&graph_edges_handle, STARPU_MAIN_RAM,
 				    (uintptr_t)graph_edges, nb_edges,
 				    sizeof(graph_edges[0]));
-	starpu_vector_data_register(&graph_mask_handle, 0,
+	starpu_vector_data_register(&graph_mask_handle, STARPU_MAIN_RAM,
 				    (uintptr_t)graph_mask, nb_nodes,
 				    sizeof(graph_mask[0] ));
-	starpu_vector_data_register(&updating_graph_mask_handle, 0,
+	starpu_vector_data_register(&updating_graph_mask_handle, STARPU_MAIN_RAM,
 				    (uintptr_t)updating_graph_mask,
 				    nb_nodes,
 				    sizeof(updating_graph_mask[0]));
-	starpu_vector_data_register(&graph_visited_handle, 0,
+	starpu_vector_data_register(&graph_visited_handle, STARPU_MAIN_RAM,
 				    (uintptr_t)graph_visited, nb_nodes,
 				    sizeof(graph_visited[0]));
-	starpu_vector_data_register(&cost_handle, 0, (uintptr_t)cost,
+	starpu_vector_data_register(&cost_handle, STARPU_MAIN_RAM, (uintptr_t)cost,
 				    nb_nodes, sizeof(cost[0]));
 	
 	for(int it=0; it < NB_ITERATION; it++)