Browse Source

tests: add -Wall when compiling and fix warnings

Nathalie Furmento 14 years ago
parent
commit
2a695cd08f

+ 1 - 1
tests/Makefile.am

@@ -15,7 +15,7 @@
 #
 # See the GNU Lesser General Public License in COPYING.LGPL for more details.
 
-AM_CFLAGS = $(HWLOC_CFLAGS)
+AM_CFLAGS = $(HWLOC_CFLAGS) -Wall
 LIBS = $(top_builddir)/src/libstarpu.la $(HWLOC_LIBS) @LIBS@
 AM_CPPFLAGS = -I$(top_srcdir)/include/ -I$(top_srcdir)/src/
 

+ 2 - 2
tests/core/declare_deps_in_callback.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010  Université de Bordeaux 1
- * Copyright (C) 2010  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011  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
@@ -59,7 +59,7 @@ static struct starpu_task *create_dummy_task(void)
 
 int main(int argc, char **argv)
 {
-	int ret;
+	//	int ret;
 	unsigned loop;
 
 	starpu_init(NULL);

+ 2 - 1
tests/core/execute_on_a_specific_worker.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009, 2010  Université de Bordeaux 1
- * Copyright (C) 2010  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011  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
@@ -69,6 +69,7 @@ static starpu_access_mode select_random_mode(void)
 		case 2:
 			return STARPU_RW;
 	};
+	return STARPU_RW;
 }
 
 

+ 4 - 4
tests/core/get_current_task.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010  Université de Bordeaux 1
- * Copyright (C) 2010  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011  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
@@ -46,9 +46,9 @@ static struct starpu_codelet_t dummy_cl = {
 
 int main(int argc, char **argv)
 {
-	double timing;
-	struct timeval start;
-	struct timeval end;
+//	double timing;
+//	struct timeval start;
+//	struct timeval end;
 
 	starpu_init(NULL);
 

+ 1 - 1
tests/core/insert_task.c

@@ -81,7 +81,7 @@ int main(int argc, char **argv)
 			    0);
 	task->cl_arg = arg_buffer;
 	task->cl_arg_size = arg_buffer_size;
-	int ret = starpu_task_submit(task);
+	starpu_task_submit(task);
         starpu_task_wait_for_all();
         for(i=0 ; i<2 ; i++) {
                 starpu_data_acquire(data_handles[i], STARPU_R);

+ 2 - 2
tests/core/multithreaded.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009, 2010  Université de Bordeaux 1
- * Copyright (C) 2010  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011  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
@@ -88,7 +88,7 @@ static void parse_args(int argc, char **argv)
 
 int main(int argc, char **argv)
 {
-	unsigned i;
+	//	unsigned i;
 	double timing;
 	struct timeval start;
 	struct timeval end;

+ 2 - 2
tests/core/regenerate.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010  Université de Bordeaux 1
- * Copyright (C) 2010  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011  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
@@ -73,7 +73,7 @@ static void parse_args(int argc, char **argv)
 
 int main(int argc, char **argv)
 {
-	unsigned i;
+	//	unsigned i;
 	double timing;
 	struct timeval start;
 	struct timeval end;

+ 5 - 5
tests/core/subgraph_repeat.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010  Université de Bordeaux 1
- * Copyright (C) 2010  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011  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
@@ -80,10 +80,10 @@ static void callback_task_D(void *arg __attribute__((unused)))
 
 int main(int argc, char **argv)
 {
-	unsigned i;
-	double timing;
-	struct timeval start;
-	struct timeval end;
+//	unsigned i;
+//	double timing;
+//	struct timeval start;
+//	struct timeval end;
 
 	starpu_init(NULL);
 

+ 5 - 5
tests/core/subgraph_repeat_regenerate.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010  Université de Bordeaux 1
- * Copyright (C) 2010  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011  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
@@ -77,10 +77,10 @@ static void callback_task_D(void *arg __attribute__((unused)))
 
 int main(int argc, char **argv)
 {
-	unsigned i;
-	double timing;
-	struct timeval start;
-	struct timeval end;
+//	unsigned i;
+//	double timing;
+//	struct timeval start;
+//	struct timeval end;
 
 	starpu_init(NULL);
 

+ 2 - 2
tests/datawizard/dining_philosophers.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009, 2010  Université de Bordeaux 1
- * Copyright (C) 2010  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011  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
@@ -53,7 +53,7 @@ void submit_one_task(unsigned p)
 	STARPU_ASSERT(!ret);
 }
 
-int main(int argc, int argv)
+int main(int argc, char **argv)
 {
 	starpu_init(NULL);
 

+ 2 - 1
tests/datawizard/dsm_stress.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010  Université de Bordeaux 1
- * Copyright (C) 2010  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011  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
@@ -76,6 +76,7 @@ static starpu_access_mode select_random_mode(void)
 		case 2:
 			return STARPU_RW;
 	};
+	return STARPU_RW;
 }
 
 

+ 3 - 3
tests/datawizard/mpi_like.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010  Université de Bordeaux 1
- * Copyright (C) 2010  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011  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
@@ -22,8 +22,8 @@
 #define NTHREADS	4
 #define NITER		128
 
-static pthread_cond_t cond;
-static pthread_mutex_t mutex;
+//static pthread_cond_t cond;
+//static pthread_mutex_t mutex;
 
 struct thread_data {
 	unsigned index;

+ 3 - 3
tests/datawizard/mpi_like_async.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010  Université de Bordeaux 1
- * Copyright (C) 2010  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011  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
@@ -23,8 +23,8 @@
 
 //#define DEBUG_MESSAGES	1
 
-static pthread_cond_t cond;
-static pthread_mutex_t mutex;
+//static pthread_cond_t cond;
+//static pthread_mutex_t mutex;
 
 struct thread_data {
 	unsigned index;

+ 2 - 2
tests/datawizard/scratch.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010  Université de Bordeaux 1
- * Copyright (C) 2010  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011  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
@@ -27,7 +27,7 @@
 static unsigned *A;
 starpu_data_handle A_handle, B_handle;
 
-static unsigned var = 0;
+//static unsigned var = 0;
 
 #ifdef STARPU_USE_CUDA
 extern void cuda_f(void *descr[], __attribute__ ((unused)) void *_args);

+ 2 - 2
tests/helper/cublas_init.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009, 2010  Université de Bordeaux 1
- * Copyright (C) 2010  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011  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
@@ -25,7 +25,7 @@
 struct timeval start;
 struct timeval end;
 
-static float *data = NULL;
+//static float *data = NULL;
 
 int main(int argc, char **argv)
 {

+ 2 - 2
tests/helper/starpu_create_sync_task.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010  Université de Bordeaux 1
- * Copyright (C) 2010  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011  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
@@ -33,7 +33,7 @@ static starpu_codelet dummy_codelet =
 	.nbuffers = 0
 };
 
-static create_dummy_task(starpu_tag_t tag)
+static void create_dummy_task(starpu_tag_t tag)
 {
 	struct starpu_task *task = starpu_task_create();
 

+ 13 - 13
tests/microbenchs/async_tasks_overhead.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010  Université de Bordeaux 1
- * Copyright (C) 2010  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011  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
@@ -26,7 +26,7 @@
 static unsigned ntasks = 65536;
 static unsigned cnt;
 
-static unsigned finished = 0;
+//static unsigned finished = 0;
 
 static double cumulated = 0.0;
 static double cumulated_push = 0.0;
@@ -64,17 +64,17 @@ static void init_gordon_kernel(void)
 #endif
 }
 
-static void inject_one_task(void)
-{
-	struct starpu_task *task = starpu_task_create();
-
-	task->cl = &dummy_codelet;
-	task->cl_arg = NULL;
-	task->detach = 0;
-
-	int ret = starpu_task_submit(task);
-	STARPU_ASSERT(!ret);
-}
+//static void inject_one_task(void)
+//{
+//	struct starpu_task *task = starpu_task_create();
+//
+//	task->cl = &dummy_codelet;
+//	task->cl_arg = NULL;
+//	task->detach = 0;
+//
+//	int ret = starpu_task_submit(task);
+//	STARPU_ASSERT(!ret);
+//}
 
 static struct starpu_conf conf = {
 	.sched_policy_name = NULL,

+ 6 - 5
tests/microbenchs/local_pingpong.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010  Université de Bordeaux 1
- * Copyright (C) 2010  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011  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
@@ -21,13 +21,14 @@
 #include <errno.h>
 #include <starpu.h>
 #include <stdlib.h>
+#include <debug/starpu_debug_helpers.h>
 
 static size_t vector_size = 1;
 
 static int niter = 1000;
-static unsigned cnt;
+//static unsigned cnt;
 
-static unsigned finished = 0;
+//static unsigned finished = 0;
 
 starpu_data_handle v_handle;
 static unsigned *v;
@@ -79,10 +80,10 @@ int main(int argc, char **argv)
 					worker_0_name, memory_node_0, worker_1_name, memory_node_1);
 	}
 
-	unsigned iter;
+	//	unsigned iter;
 
 	/* warm up */
-	unsigned nwarmupiter = 128;
+	//	unsigned nwarmupiter = 128;
 	_starpu_benchmark_ping_pong(v_handle, memory_node_0, memory_node_1, 128);
 
 	gettimeofday(&start, NULL);

+ 2 - 1
tests/microbenchs/prefetch_data_on_node.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009, 2010  Université de Bordeaux 1
- * Copyright (C) 2010  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011  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
@@ -73,6 +73,7 @@ static starpu_access_mode select_random_mode(void)
 		case 2:
 			return STARPU_RW;
 	};
+	return STARPU_RW;
 }
 
 

+ 2 - 2
tests/overlap/overlap.c

@@ -2,7 +2,7 @@
  *
  * Copyright (C) 2009, 2010  Université de Bordeaux 1
  * Copyright (C) 2010  Mehdi Juhoor <mjuhoor@gmail.com>
- * Copyright (C) 2010  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011  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
@@ -74,7 +74,7 @@ static char symbolname[128];
 
 int main(int argc, char **argv)
 {
-	unsigned i;
+	//	unsigned i;
 
 	starpu_init(NULL);
 

+ 15 - 16
tests/parallel_tasks/explicit_combined_worker.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010  Université de Bordeaux 1
- * Copyright (C) 2010  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011  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
@@ -21,10 +21,9 @@
 #define N	1000
 #define VECTORSIZE	1024
 
-static pthread_mutex_t mutex;
-static pthread_cond_t cond;
-
-static unsigned finished = 0;
+//static pthread_mutex_t mutex;
+//static pthread_cond_t cond;
+//static unsigned finished = 0;
 
 static unsigned cnt;
 
@@ -56,17 +55,17 @@ static starpu_codelet cl = {
 
 int main(int argc, char **argv)
 {
-        struct starpu_conf conf = {
-                .sched_policy_name = "pheft",
-                .ncpus = -1,
-                .ncuda = -1,
-                .nopencl = -1,
-                .nspus = -1,
-                .use_explicit_workers_bindid = 0,
-                .use_explicit_workers_cuda_gpuid = 0,
-                .use_explicit_workers_opencl_gpuid = 0,
-                .calibrate = -1
-        };
+//        struct starpu_conf conf = {
+//                .sched_policy_name = "pheft",
+//                .ncpus = -1,
+//                .ncuda = -1,
+//                .nopencl = -1,
+//                .nspus = -1,
+//                .use_explicit_workers_bindid = 0,
+//                .use_explicit_workers_cuda_gpuid = 0,
+//                .use_explicit_workers_opencl_gpuid = 0,
+//                .calibrate = -1
+//        };
 
 	starpu_init(NULL);
 

+ 4 - 5
tests/parallel_tasks/parallel_kernels.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010  Université de Bordeaux 1
- * Copyright (C) 2010  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011  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
@@ -21,10 +21,9 @@
 #define N	1000
 #define VECTORSIZE	1024
 
-static pthread_mutex_t mutex;
-static pthread_cond_t cond;
-
-static unsigned finished = 0;
+//static pthread_mutex_t mutex;
+//static pthread_cond_t cond;
+//static unsigned finished = 0;
 
 static unsigned cnt;
 

+ 4 - 5
tests/parallel_tasks/parallel_kernels_spmd.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010  Université de Bordeaux 1
- * Copyright (C) 2010  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011  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
@@ -21,10 +21,9 @@
 #define N	1000
 #define VECTORSIZE	1024
 
-static pthread_mutex_t mutex;
-static pthread_cond_t cond;
-
-static unsigned finished = 0;
+//static pthread_mutex_t mutex;
+//static pthread_cond_t cond;
+//static unsigned finished = 0;
 
 static unsigned cnt;
 

+ 1 - 1
tests/parallel_tasks/spmd_pgreedy.c

@@ -61,7 +61,7 @@ int main(int argc, char **argv)
 	starpu_data_malloc_pinned_if_possible((void **)&v, VECTORSIZE*sizeof(unsigned));
 	starpu_vector_data_register(&v_handle, 0, (uintptr_t)v, VECTORSIZE, sizeof(unsigned));
 
-	unsigned iter, worker;
+	unsigned iter;//, worker;
 	for (iter = 0; iter < N; iter++)
 	{
 		/* execute a task on that worker */