ソースを参照

mpi/examples: minor fixes

Nathalie Furmento 13 年 前
コミット
dd08dfbb3e
共有3 個のファイルを変更した7 個の追加4 個の削除を含む
  1. 5 2
      mpi/examples/mpi_lu/plu_example.c
  2. 1 1
      mpi/examples/reduction/mpi_reduction.c
  3. 1 1
      mpi/examples/reduction/mpi_reduction_kernels.c

+ 5 - 2
mpi/examples/mpi_lu/plu_example.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010-2011  Université de Bordeaux 1
- * Copyright (C) 2010, 2011  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012  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
@@ -35,7 +35,10 @@ static unsigned check = 0;
 static unsigned p = 1;
 static unsigned q = 1;
 static unsigned display = 0;
+
+#ifdef STARPU_HAVE_LIBNUMA
 static unsigned numa = 0;
+#endif
 
 static size_t allocated_memory = 0;
 static size_t allocated_memory_extra = 0;
@@ -449,7 +452,7 @@ int main(int argc, char **argv)
 
 	display_grid(rank, nblocks);
 
-	TYPE *a_r;
+	TYPE *a_r = NULL;
 //	STARPU_PLU(display_data_content)(a_r, size);
 
 	TYPE *x, *y;

+ 1 - 1
mpi/examples/reduction/mpi_reduction.c

@@ -56,7 +56,7 @@ int main(int argc, char **argv)
 {
         int my_rank, size, x, y;
         long int *vector;
-	long int dot, sum;
+	long int dot, sum=0;
         starpu_data_handle_t *handles;
 	starpu_data_handle_t dot_handle;
 

+ 1 - 1
mpi/examples/reduction/mpi_reduction_kernels.c

@@ -52,7 +52,7 @@ void dot_cpu_func(void *descr[], void *cl_arg)
 	long int *local_x = (long int *)STARPU_VECTOR_GET_PTR(descr[0]);
 	unsigned n = STARPU_VECTOR_GET_NX(descr[0]);
 
-	long int *dot = (int *)STARPU_VARIABLE_GET_PTR(descr[1]);
+	long int *dot = (long int *)STARPU_VARIABLE_GET_PTR(descr[1]);
 
 //	_DISPLAY("Before dot=%ld (adding %d elements...)\n", *dot, n);
 	unsigned i;