소스 검색

merge trunk@6751:6800

Nathalie Furmento 12 년 전
부모
커밋
5fed887a43

+ 11 - 0
doc/chapters/advanced-api.texi

@@ -359,6 +359,17 @@ This function mustn't be called if @var{bundle} is already closed and/or @var{ta
 Inform the runtime that the user won't modify @var{bundle} anymore, it means no more inserting or removing task. Thus the runtime can destroy it when possible.
 Inform the runtime that the user won't modify @var{bundle} anymore, it means no more inserting or removing task. Thus the runtime can destroy it when possible.
 @end deftypefun
 @end deftypefun
 
 
+@deftypefun double starpu_task_bundle_expected_length (starpu_task_bundle_t @var{bundle}, {enum starpu_perf_archtype} @var{arch}, unsigned @var{nimpl})
+Return the expected duration of the entire task bundle in µs.
+@end deftypefun
+
+@deftypefun double starpu_task_bundle_expected_power (starpu_task_bundle_t @var{bundle}, enum starpu_perf_archtype @var{arch}, unsigned @var{nimpl})
+Return the expected power consumption of the entire task bundle in J.
+@end deftypefun
+
+@deftypefun double starpu_task_bundle_expected_data_transfer_time (starpu_task_bundle_t @var{bundle}, unsigned @var{memory_node})
+Return the time (in µs) expected to transfer all data used within the bundle.
+@end deftypefun
 
 
 @node Task Lists
 @node Task Lists
 @section Task Lists
 @section Task Lists

+ 2 - 2
examples/lu/clu.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  *
  * Copyright (C) 2009, 2010  Université de Bordeaux 1
  * Copyright (C) 2009, 2010  Université de Bordeaux 1
- * Copyright (C) 2010  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2012  Centre National de la Recherche Scientifique
  *
  *
  * StarPU is free software; you can redistribute it and/or modify
  * 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
  * it under the terms of the GNU Lesser General Public License as published by
@@ -15,5 +15,5 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
  */
 
 
-#include "complex_-float.h"
+#include "complex_float.h"
 #include "xlu.c"
 #include "xlu.c"

+ 2 - 2
examples/lu/clu_implicit.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  *
  * Copyright (C) 2010  Université de Bordeaux 1
  * Copyright (C) 2010  Université de Bordeaux 1
- * Copyright (C) 2010  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2012  Centre National de la Recherche Scientifique
  *
  *
  * StarPU is free software; you can redistribute it and/or modify
  * 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
  * it under the terms of the GNU Lesser General Public License as published by
@@ -15,5 +15,5 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
  */
 
 
-#include "complex_-float.h"
+#include "complex_float.h"
 #include "xlu_implicit.c"
 #include "xlu_implicit.c"

+ 2 - 2
examples/lu/clu_implicit_pivot.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  *
  * Copyright (C) 2010  Université de Bordeaux 1
  * Copyright (C) 2010  Université de Bordeaux 1
- * Copyright (C) 2010  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2012  Centre National de la Recherche Scientifique
  *
  *
  * StarPU is free software; you can redistribute it and/or modify
  * 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
  * it under the terms of the GNU Lesser General Public License as published by
@@ -15,5 +15,5 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
  */
 
 
-#include "complex_-float.h"
+#include "complex_float.h"
 #include "xlu_implicit_pivot.c"
 #include "xlu_implicit_pivot.c"

+ 2 - 2
examples/lu/clu_kernels.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  *
  * Copyright (C) 2009, 2010  Université de Bordeaux 1
  * Copyright (C) 2009, 2010  Université de Bordeaux 1
- * Copyright (C) 2010  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2012  Centre National de la Recherche Scientifique
  *
  *
  * StarPU is free software; you can redistribute it and/or modify
  * 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
  * it under the terms of the GNU Lesser General Public License as published by
@@ -15,5 +15,5 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
  */
 
 
-#include "complex_-float.h"
+#include "complex_float.h"
 #include "xlu_kernels.c"
 #include "xlu_kernels.c"

+ 2 - 2
examples/lu/clu_pivot.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  *
  * Copyright (C) 2009, 2010  Université de Bordeaux 1
  * Copyright (C) 2009, 2010  Université de Bordeaux 1
- * Copyright (C) 2010  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2012  Centre National de la Recherche Scientifique
  *
  *
  * StarPU is free software; you can redistribute it and/or modify
  * 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
  * it under the terms of the GNU Lesser General Public License as published by
@@ -15,5 +15,5 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
  */
 
 
-#include "complex_-float.h"
+#include "complex_float.h"
 #include "xlu_pivot.c"
 #include "xlu_pivot.c"

+ 2 - 2
examples/lu/lu_example_complex_double.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  *
  * Copyright (C) 2009, 2010  Université de Bordeaux 1
  * Copyright (C) 2009, 2010  Université de Bordeaux 1
- * Copyright (C) 2010  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2012  Centre National de la Recherche Scientifique
  *
  *
  * StarPU is free software; you can redistribute it and/or modify
  * 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
  * it under the terms of the GNU Lesser General Public License as published by
@@ -15,5 +15,5 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
  */
 
 
-#include "complex_-double.h"
+#include "complex_double.h"
 #include "lu_example.c"
 #include "lu_example.c"

+ 2 - 2
examples/lu/lu_example_complex_float.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  *
  * Copyright (C) 2009, 2010  Université de Bordeaux 1
  * Copyright (C) 2009, 2010  Université de Bordeaux 1
- * Copyright (C) 2010  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2012  Centre National de la Recherche Scientifique
  *
  *
  * StarPU is free software; you can redistribute it and/or modify
  * 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
  * it under the terms of the GNU Lesser General Public License as published by
@@ -15,5 +15,5 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
  */
 
 
-#include "complex_-float.h"
+#include "complex_float.h"
 #include "lu_example.c"
 #include "lu_example.c"

+ 2 - 2
examples/lu/zlu.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  *
  * Copyright (C) 2009, 2010  Université de Bordeaux 1
  * Copyright (C) 2009, 2010  Université de Bordeaux 1
- * Copyright (C) 2010  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2012  Centre National de la Recherche Scientifique
  *
  *
  * StarPU is free software; you can redistribute it and/or modify
  * 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
  * it under the terms of the GNU Lesser General Public License as published by
@@ -15,5 +15,5 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
  */
 
 
-#include "complex_-double.h"
+#include "complex_double.h"
 #include "xlu.c"
 #include "xlu.c"

+ 2 - 2
examples/lu/zlu_implicit.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  *
  * Copyright (C) 2010  Université de Bordeaux 1
  * Copyright (C) 2010  Université de Bordeaux 1
- * Copyright (C) 2010  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2012  Centre National de la Recherche Scientifique
  *
  *
  * StarPU is free software; you can redistribute it and/or modify
  * 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
  * it under the terms of the GNU Lesser General Public License as published by
@@ -15,5 +15,5 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
  */
 
 
-#include "complex_-double.h"
+#include "complex_double.h"
 #include "xlu_implicit.c"
 #include "xlu_implicit.c"

+ 2 - 2
examples/lu/zlu_implicit_pivot.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  *
  * Copyright (C) 2010  Université de Bordeaux 1
  * Copyright (C) 2010  Université de Bordeaux 1
- * Copyright (C) 2010  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2012  Centre National de la Recherche Scientifique
  *
  *
  * StarPU is free software; you can redistribute it and/or modify
  * 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
  * it under the terms of the GNU Lesser General Public License as published by
@@ -15,5 +15,5 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
  */
 
 
-#include "complex_-double.h"
+#include "complex_double.h"
 #include "xlu_implicit_pivot.c"
 #include "xlu_implicit_pivot.c"

+ 2 - 2
examples/lu/zlu_kernels.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  *
  * Copyright (C) 2009, 2010  Université de Bordeaux 1
  * Copyright (C) 2009, 2010  Université de Bordeaux 1
- * Copyright (C) 2010  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2012  Centre National de la Recherche Scientifique
  *
  *
  * StarPU is free software; you can redistribute it and/or modify
  * 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
  * it under the terms of the GNU Lesser General Public License as published by
@@ -15,5 +15,5 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
  */
 
 
-#include "complex_-double.h"
+#include "complex_double.h"
 #include "xlu_kernels.c"
 #include "xlu_kernels.c"

+ 2 - 2
examples/lu/zlu_pivot.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  *
  * Copyright (C) 2009, 2010  Université de Bordeaux 1
  * Copyright (C) 2009, 2010  Université de Bordeaux 1
- * Copyright (C) 2010  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2012  Centre National de la Recherche Scientifique
  *
  *
  * StarPU is free software; you can redistribute it and/or modify
  * 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
  * it under the terms of the GNU Lesser General Public License as published by
@@ -15,5 +15,5 @@
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  * See the GNU Lesser General Public License in COPYING.LGPL for more details.
  */
  */
 
 
-#include "complex_-double.h"
+#include "complex_double.h"
 #include "xlu_pivot.c"
 #include "xlu_pivot.c"

+ 4 - 4
gcc-plugin/src/starpu.c

@@ -1095,10 +1095,10 @@ build_variable_from_file_contents (location_t loc,
 	  err = fstatat (dir_fd, file, &st, 0);
 	  err = fstatat (dir_fd, file, &st, 0);
 	  if (err != 0)
 	  if (err != 0)
 	    close (dir_fd);
 	    close (dir_fd);
-
-	  /* Leave DIRS unchanged so it can be referred to in diagnostics
-	     below.  */
-	  break;
+	  else
+	    /* Leave DIRS unchanged so it can be referred to in diagnostics
+	       below.  */
+	    break;
 	}
 	}
     }
     }
 
 

+ 1 - 1
socl/examples/matmul/matmul.c

@@ -98,7 +98,7 @@ static char * code =  CODE;
 
 
 int check = 0;
 int check = 0;
 
 
-static void __attribute__((unused)) parse_args(int argc, char **argv)
+static void __attribute__((unused)) parse_args(int argc, const char **argv)
 {
 {
 	int i;
 	int i;
 	for (i = 1; i < argc; i++)
 	for (i = 1; i < argc; i++)

+ 0 - 5
socl/src/cl_enqueuendrangekernel.c

@@ -117,11 +117,6 @@ static void cleaning_task_callback(void *args) {
 
 
 }
 }
 
 
-static struct starpu_perfmodel perf_model = {
-	.type = STARPU_HISTORY_BASED,
-	.symbol = "perf_model"
-};
-
 /**
 /**
  * Real kernel enqueuing command
  * Real kernel enqueuing command
  */
  */

+ 1 - 1
socl/src/gc.c

@@ -112,7 +112,7 @@ int gc_entity_release_ex(entity e) {
   if (refs != 0)
   if (refs != 0)
     return 0;
     return 0;
 
 
-  DEBUG_MSG("Releasing entity %lx\n", e);
+  DEBUG_MSG("Releasing entity %p\n", e);
 
 
   GC_LOCK;
   GC_LOCK;
 
 

+ 1 - 1
src/common/starpu_spinlock.c

@@ -26,7 +26,7 @@ int _starpu_spin_init(struct _starpu_spinlock *lock)
 //	memcpy(&lock->errcheck_lock, PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP, sizeof(PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP));
 //	memcpy(&lock->errcheck_lock, PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP, sizeof(PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP));
 	int ret;
 	int ret;
 	ret = pthread_mutexattr_init(&lock->errcheck_attr);
 	ret = pthread_mutexattr_init(&lock->errcheck_attr);
-	STARPU_ASSERT(!ret);
+	STARPU_CHECK_RETURN_VALUE(ret, "pthread_mutexattr_init");
 
 
 	ret = pthread_mutexattr_settype(&lock->errcheck_attr, PTHREAD_MUTEX_ERRORCHECK);
 	ret = pthread_mutexattr_settype(&lock->errcheck_attr, PTHREAD_MUTEX_ERRORCHECK);
 	STARPU_ASSERT(!ret);
 	STARPU_ASSERT(!ret);

+ 5 - 2
src/datawizard/interfaces/bcsr_interface.c

@@ -544,13 +544,16 @@ static int copy_ram_to_ram(void *src_interface, unsigned src_node STARPU_ATTRIBU
 	uint32_t nrow = src_bcsr->nrow;
 	uint32_t nrow = src_bcsr->nrow;
 	size_t elemsize = src_bcsr->elemsize;
 	size_t elemsize = src_bcsr->elemsize;
 
 
-	memcpy((void *)dst_bcsr->nzval, (void *)src_bcsr->nzval, nnz*elemsize);
+	uint32_t r = src_bcsr->r;
+	uint32_t c = src_bcsr->c;
+
+	memcpy((void *)dst_bcsr->nzval, (void *)src_bcsr->nzval, nnz*elemsize*r*c);
 
 
 	memcpy((void *)dst_bcsr->colind, (void *)src_bcsr->colind, nnz*sizeof(uint32_t));
 	memcpy((void *)dst_bcsr->colind, (void *)src_bcsr->colind, nnz*sizeof(uint32_t));
 
 
 	memcpy((void *)dst_bcsr->rowptr, (void *)src_bcsr->rowptr, (nrow+1)*sizeof(uint32_t));
 	memcpy((void *)dst_bcsr->rowptr, (void *)src_bcsr->rowptr, (nrow+1)*sizeof(uint32_t));
 
 
-	_STARPU_TRACE_DATA_COPY(src_node, dst_node, nnz*elemsize + (nnz+nrow+1)*sizeof(uint32_t));
+	_STARPU_TRACE_DATA_COPY(src_node, dst_node, nnz*elemsize*r*c + (nnz+nrow+1)*sizeof(uint32_t));
 
 
 	return 0;
 	return 0;
 }
 }

+ 4 - 2
tests/datawizard/interfaces/bcsr/bcsr_cuda.cu

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  *
- * Copyright (C) 2011  Institut National de Recherche en Informatique et Automatique
+ * Copyright (C) 2011, 2012 inria
  *
  *
  * StarPU is free software; you can redistribute it and/or modify
  * 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
  * it under the terms of the GNU Lesser General Public License as published by
@@ -39,11 +39,13 @@ extern "C" void test_bcsr_cuda_func(void *buffers[], void *args)
 	int *val;
 	int *val;
 	cudaError_t error;
 	cudaError_t error;
 	uint32_t nnz = STARPU_BCSR_GET_NNZ(buffers[0]);
 	uint32_t nnz = STARPU_BCSR_GET_NNZ(buffers[0]);
+ 	uint32_t r   = ((struct starpu_bcsr_interface *)buffers[0])->r;
+ 	uint32_t c   = ((struct starpu_bcsr_interface *)buffers[0])->c;
+	nnz *= (r*c);
 	unsigned threads_per_block = 64;
 	unsigned threads_per_block = 64;
 	unsigned nblocks = (nnz + threads_per_block-1) / threads_per_block;
 	unsigned nblocks = (nnz + threads_per_block-1) / threads_per_block;
 
 
 	factor = *(int *) args;
 	factor = *(int *) args;
-	//val = (int *) starpu_bcsr_get_local_nzval((starpu_data_handle_t)buffers[0]);
 	val = (int *) STARPU_BCSR_GET_NZVAL(buffers[0]);
 	val = (int *) STARPU_BCSR_GET_NZVAL(buffers[0]);
 
 
 	error = cudaMalloc(&ret, sizeof(int));
 	error = cudaMalloc(&ret, sizeof(int));

+ 43 - 41
tests/datawizard/interfaces/bcsr/bcsr_interface.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  *
  * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
  * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
- * Copyright (C) 2011  Institut National de Recherche en Informatique et Automatique
+ * Copyright (C) 2011, 2012  inria
  *
  *
  * StarPU is free software; you can redistribute it and/or modify
  * 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
  * it under the terms of the GNU Lesser General Public License as published by
@@ -20,46 +20,51 @@
 #include "../../../helper.h"
 #include "../../../helper.h"
 
 
 /*
 /*
- * XXX : These values should not be changed. If you really understand all that
- * BCSR stuff, feel free to write a better example :)
+ * In this test, we use the following matrix: 
+ *
+ *   +----------------+
+ *   |  0   1   0   0 |
+ *   |  2   3   0   0 |
+ *   |  4   5   8   9 |
+ *   |  6   7  10  11 |
+ *   +----------------+
+ *
+ * nzval  = [0, 1, 2, 3] ++ [4, 5, 6, 7] ++ [8, 9, 10, 11]
+ * colind = [0, 0, 1]
+ * rowptr = [0, 1 ]
+ * r = c = 2
  */
  */
 
 
-/* Size of the matrix */
-#define WIDTH          4
-#define HEIGHT         4
-#define SIZE           (WIDTH * HEIGHT)
-
 /* Size of the blocks */
 /* Size of the blocks */
 #define R              2
 #define R              2
 #define C              2
 #define C              2
-#define BLOCK_SIZE     (R*C)
-
-/* The matrix is simply 0 1 2... There are SIZE-1 non zero values... */
-#define NNZ            (SIZE-1)
-
-/* ... and SIZE/BLOCK_SIZE non zero blocks */
-#define NNZ_BLOCKS     (SIZE/BLOCK_SIZE)
 
 
+#define NNZ_BLOCKS     3   /* out of 4 */
+#define NZVAL_SIZE     (R*C*NNZ_BLOCKS)
 
 
 #ifdef STARPU_USE_CPU
 #ifdef STARPU_USE_CPU
 static void test_bcsr_cpu_func(void *buffers[], void *args);
 static void test_bcsr_cpu_func(void *buffers[], void *args);
 #endif /* !STARPU_USE_CPU */
 #endif /* !STARPU_USE_CPU */
 #ifdef STARPU_USE_CUDA
 #ifdef STARPU_USE_CUDA
 extern void test_bcsr_cuda_func(void *buffers[], void *_args);
 extern void test_bcsr_cuda_func(void *buffers[], void *_args);
-#endif
+#endif /* !STARPU_USE_CUDA */
 #ifdef STARPU_USE_OPENCL
 #ifdef STARPU_USE_OPENCL
 extern void test_bcsr_opencl_func(void *buffers[], void *args);
 extern void test_bcsr_opencl_func(void *buffers[], void *args);
-#endif
+#endif /* !STARPU_USE_OPENCL */
 
 
 
 
-static int nzval[NNZ];
-static int nzval2[NNZ];
+static int nzval[NZVAL_SIZE]  = {
+	0, 1, 2, 3,    /* Fisrt block  */
+	4, 5, 6, 7,    /* Second block */
+	8, 9, 10, 11   /* Third block  */
+};
+static int nzval2[NZVAL_SIZE];
 
 
-static uint32_t colind[NNZ_BLOCKS];
+static uint32_t colind[NNZ_BLOCKS] = { 0, 0, 2 };
 static uint32_t colind2[NNZ_BLOCKS];
 static uint32_t colind2[NNZ_BLOCKS];
 
 
-static uint32_t rowptr[1+WIDTH/R];
-static uint32_t rowptr2[1+WIDTH/R];
+static uint32_t rowptr[2] = { 0, 1 };
+static uint32_t rowptr2[2];
 
 
 static starpu_data_handle_t bcsr_handle;
 static starpu_data_handle_t bcsr_handle;
 static starpu_data_handle_t bcsr2_handle;
 static starpu_data_handle_t bcsr2_handle;
@@ -85,28 +90,14 @@ struct test_config bcsr_config =
 static void
 static void
 register_data(void)
 register_data(void)
 {
 {
-	int i;
-
-	for (i = 0; i < NNZ; i++)
-		nzval[i] = i;
-
-	colind[0] = 0;
-	colind[1] = 2;
-	colind[2] = 0;
-	colind[3] = 2;
-
-	rowptr[0] = 0;
-	rowptr[1] = 2;
-	rowptr[2] = 4;
-	
 	starpu_bcsr_data_register(&bcsr_handle,
 	starpu_bcsr_data_register(&bcsr_handle,
 				  0,
 				  0,
 				  NNZ_BLOCKS,
 				  NNZ_BLOCKS,
-				  HEIGHT/R,
+				  1, /* nrow */
 				  (uintptr_t) nzval,
 				  (uintptr_t) nzval,
 				  colind,
 				  colind,
 				  rowptr,
 				  rowptr,
-				  0,
+				  0, /* firstentry */
 				  R,
 				  R,
 				  C,
 				  C,
 				  sizeof(nzval[0]));
 				  sizeof(nzval[0]));
@@ -114,11 +105,11 @@ register_data(void)
 	starpu_bcsr_data_register(&bcsr2_handle,
 	starpu_bcsr_data_register(&bcsr2_handle,
 				  0,
 				  0,
 				  NNZ_BLOCKS,
 				  NNZ_BLOCKS,
-				  HEIGHT/R,
+				  1, /* nrow */
 				  (uintptr_t) nzval2,
 				  (uintptr_t) nzval2,
 				  colind2,
 				  colind2,
 				  rowptr2,
 				  rowptr2,
-				  0,
+				  0, /* firstentry */
 				  R,
 				  R,
 				  C,
 				  C,
 				  sizeof(nzval2[0]));
 				  sizeof(nzval2[0]));
@@ -141,6 +132,15 @@ test_bcsr_cpu_func(void *buffers[], void *args)
 	int i;
 	int i;
 
 
 	uint32_t nnz = STARPU_BCSR_GET_NNZ(buffers[0]);
 	uint32_t nnz = STARPU_BCSR_GET_NNZ(buffers[0]);
+ 	uint32_t r   = ((struct starpu_bcsr_interface *)buffers[0])->r;
+ 	uint32_t c   = ((struct starpu_bcsr_interface *)buffers[0])->c;
+	if (r != R || c != C)
+	{
+		bcsr_config.copy_failed = 1;
+		return;
+	}
+	nnz *= (r*c);
+
 	val = (int *) STARPU_BCSR_GET_NZVAL(buffers[0]);
 	val = (int *) STARPU_BCSR_GET_NZVAL(buffers[0]);
 	factor = *(int *) args;
 	factor = *(int *) args;
 
 
@@ -154,6 +154,8 @@ test_bcsr_cpu_func(void *buffers[], void *args)
 		val[i] *= -1;
 		val[i] *= -1;
 	}
 	}
 
 
+#if 0
+	/* TODO */
 	/* Check colind */
 	/* Check colind */
 	uint32_t *col = STARPU_BCSR_GET_COLIND(buffers[0]);
 	uint32_t *col = STARPU_BCSR_GET_COLIND(buffers[0]);
 	for (i = 0; i < NNZ_BLOCKS; i++)
 	for (i = 0; i < NNZ_BLOCKS; i++)
@@ -165,6 +167,7 @@ test_bcsr_cpu_func(void *buffers[], void *args)
 	for (i = 0; i < 1 + WIDTH/R; i++)
 	for (i = 0; i < 1 + WIDTH/R; i++)
 		if (row[i] != rowptr[i])
 		if (row[i] != rowptr[i])
 			bcsr_config.copy_failed = 1;
 			bcsr_config.copy_failed = 1;
+#endif
 }
 }
 
 
 int
 int
@@ -194,4 +197,3 @@ main(void)
 
 
 	return data_interface_test_summary_success(summary);
 	return data_interface_test_summary_success(summary);
 }
 }
-

+ 4 - 1
tests/datawizard/interfaces/bcsr/bcsr_opencl.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  *
- * Copyright (C) 2011  Institut National de Recherche en Informatique et Automatique
+ * Copyright (C) 2011, 2012 inria
  *
  *
  * StarPU is free software; you can redistribute it and/or modify
  * 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
  * it under the terms of the GNU Lesser General Public License as published by
@@ -39,6 +39,9 @@ test_bcsr_opencl_func(void *buffers[], void *args)
 	STARPU_CHECK_RETURN_VALUE(ret, "starpu_opencl_load_opencl_from_file");
 	STARPU_CHECK_RETURN_VALUE(ret, "starpu_opencl_load_opencl_from_file");
 
 
 	uint32_t nnz = STARPU_BCSR_GET_NNZ(buffers[0]);
 	uint32_t nnz = STARPU_BCSR_GET_NNZ(buffers[0]);
+ 	uint32_t r   = ((struct starpu_bcsr_interface *)buffers[0])->r;
+ 	uint32_t c   = ((struct starpu_bcsr_interface *)buffers[0])->c;
+	nnz *= (r*c);
 	cl_mem nzval = (cl_mem)STARPU_BCSR_GET_NZVAL(buffers[0]);
 	cl_mem nzval = (cl_mem)STARPU_BCSR_GET_NZVAL(buffers[0]);
 
 
 	cl_context context;
 	cl_context context;

+ 15 - 0
tools/valgrind/libnuma.suppr

@@ -0,0 +1,15 @@
+{
+   libnuma error
+   Memcheck:Cond
+   ...
+   fun:numa_node_size64
+   ...
+}
+
+{
+   libnuma error
+   Memcheck:Value8
+   ...
+   fun:numa_node_size64
+   ...
+}

+ 9 - 0
tools/valgrind/starpu.suppr

@@ -47,3 +47,12 @@
    ...
    ...
 }
 }
 
 
+{
+   fscanf error
+   Memcheck:Cond
+   ...
+   fun:fscanf
+   fun:_starpu_load_bus_performance_files
+   ...
+}
+