Bladeren bron

minor fixes for gcc warnings

Nathalie Furmento 8 jaren geleden
bovenliggende
commit
10ddd00907

+ 52 - 51
examples/cholesky/cholesky.h

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009-2017  Université de Bordeaux
- * Copyright (C) 2010, 2011, 2012, 2013, 2015, 2016  CNRS
+ * Copyright (C) 2010, 2011, 2012, 2013, 2015, 2016, 2017  CNRS
  *
  * 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
@@ -50,7 +50,7 @@
 					| ((unsigned long long)(i)<<16) 			\
 					| (unsigned long long)(j))))
 
-#define BLOCKSIZE	(size/nblocks)
+#define BLOCKSIZE	(size_p/nblocks_p)
 
 #define BLAS3_FLOP(n1,n2,n3)    \
         (2*((uint64_t)n1)*((uint64_t)n2)*((uint64_t)n3))
@@ -113,11 +113,12 @@
 
 /* End of magma code */
 
-static unsigned size;
-static unsigned nblocks;
-static unsigned nbigblocks;
+static unsigned size_p;
+static unsigned nblocks_p;
+static unsigned nbigblocks_p;
 
-static inline void init_sizes(void) {
+static inline void init_sizes(void)
+{
 	int power = starpu_cpu_worker_get_count() + 32 * starpu_cuda_worker_get_count();
 	int power_cbrt = cbrt(power);
 #ifndef STARPU_LONG_CHECK
@@ -128,33 +129,33 @@ static inline void init_sizes(void) {
 		power_cbrt = 1;
 
 #ifdef STARPU_QUICK_CHECK
-	if (!size)
-		size = 320*2*power_cbrt;
-	if (!nblocks)
-		nblocks = 2*power_cbrt;
-	if (!nbigblocks)
-		nbigblocks = power_cbrt;
+	if (!size_p)
+		size_p = 320*2*power_cbrt;
+	if (!nblocks_p)
+		nblocks_p = 2*power_cbrt;
+	if (!nbigblocks_p)
+		nbigblocks_p = power_cbrt;
 #else
-	if (!size)
-		size = 960*8*power_cbrt;
-	if (!nblocks)
-		nblocks = 8*power_cbrt;
-	if (!nbigblocks)
-		nbigblocks = 4*power_cbrt;
+	if (!size_p)
+		size_p = 960*8*power_cbrt;
+	if (!nblocks_p)
+		nblocks_p = 8*power_cbrt;
+	if (!nbigblocks_p)
+		nbigblocks_p = 4*power_cbrt;
 #endif
 }
 
-static unsigned pinned = 1;
-static unsigned noprio = 0;
-static unsigned check = 0;
-static unsigned bound = 0;
-static unsigned bound_deps = 0;
-static unsigned bound_lp = 0;
-static unsigned bound_mps = 0;
-static unsigned with_ctxs = 0;
-static unsigned with_noctxs = 0;
-static unsigned chole1 = 0;
-static unsigned chole2 = 0;
+static unsigned pinned_p = 1;
+static unsigned noprio_p = 0;
+static unsigned check_p = 0;
+static unsigned bound_p = 0;
+static unsigned bound_deps_p = 0;
+static unsigned bound_lp_p = 0;
+static unsigned bound_mps_p = 0;
+static unsigned with_ctxs_p = 0;
+static unsigned with_noctxs_p = 0;
+static unsigned chole1_p = 0;
+static unsigned chole2_p = 0;
 
 struct starpu_perfmodel chol_model_11;
 struct starpu_perfmodel chol_model_21;
@@ -182,57 +183,57 @@ double cuda_chol_task_21_cost(struct starpu_task *task, struct starpu_perfmodel_
 double cuda_chol_task_22_cost(struct starpu_task *task, struct starpu_perfmodel_arch* arch, unsigned nimpl);
 #endif
 
-void initialize_chol_model(struct starpu_perfmodel* model, char* symbol, 
-		double (*cpu_cost_function)(struct starpu_task *, struct starpu_perfmodel_arch*, unsigned), 
-		double (*cuda_cost_function)(struct starpu_task *, struct starpu_perfmodel_arch*, unsigned));
+void initialize_chol_model(struct starpu_perfmodel* model, char* symbol,
+			   double (*cpu_cost_function)(struct starpu_task *, struct starpu_perfmodel_arch*, unsigned),
+			   double (*cuda_cost_function)(struct starpu_task *, struct starpu_perfmodel_arch*, unsigned));
 
 static void STARPU_ATTRIBUTE_UNUSED parse_args(int argc, char **argv)
 {
 	int i;
 	for (i = 1; i < argc; i++)
 	{
-		if (strcmp(argv[i], "-with_ctxs") == 0) 
+		if (strcmp(argv[i], "-with_ctxs") == 0)
 		{
-			with_ctxs = 1;
+			with_ctxs_p = 1;
 			break;
 		}
-		else if (strcmp(argv[i], "-with_noctxs") == 0) 
+		else if (strcmp(argv[i], "-with_noctxs") == 0)
 		{
-			with_noctxs = 1;
+			with_noctxs_p = 1;
 			break;
 		}
-		else if (strcmp(argv[i], "-chole1") == 0) 
+		else if (strcmp(argv[i], "-chole1") == 0)
 		{
-			chole1 = 1;
+			chole1_p = 1;
 			break;
 		}
-		else if (strcmp(argv[i], "-chole2") == 0) 
+		else if (strcmp(argv[i], "-chole2") == 0)
 		{
-			chole2 = 1;
+			chole2_p = 1;
 			break;
 		}
 		else if (strcmp(argv[i], "-size") == 0)
 		{
 		        char *argptr;
-			size = strtol(argv[++i], &argptr, 10);
+			size_p = strtol(argv[++i], &argptr, 10);
 		}
 		else if (strcmp(argv[i], "-nblocks") == 0)
 		{
 		        char *argptr;
-			nblocks = strtol(argv[++i], &argptr, 10);
+			nblocks_p = strtol(argv[++i], &argptr, 10);
 		}
 		else if (strcmp(argv[i], "-nbigblocks") == 0)
 		{
 		        char *argptr;
-			nbigblocks = strtol(argv[++i], &argptr, 10);
+			nbigblocks_p = strtol(argv[++i], &argptr, 10);
 		}
 		else if (strcmp(argv[i], "-no-pin") == 0)
 		{
-			pinned = 0;
+			pinned_p = 0;
 		}
 		else if (strcmp(argv[i], "-no-prio") == 0)
 		{
-			noprio = 1;
+			noprio_p = 1;
 		}
 		else if (strcmp(argv[i], "-commute") == 0)
 		{
@@ -240,29 +241,29 @@ static void STARPU_ATTRIBUTE_UNUSED parse_args(int argc, char **argv)
 		}
 		else if (strcmp(argv[i], "-bound") == 0)
 		{
-			bound = 1;
+			bound_p = 1;
 		}
 		else if (strcmp(argv[i], "-bound-lp") == 0)
 		{
-			bound_lp = 1;
+			bound_lp_p = 1;
 		}
 		else if (strcmp(argv[i], "-bound-mps") == 0)
 		{
-			bound_mps = 1;
+			bound_mps_p = 1;
 		}
 		else if (strcmp(argv[i], "-bound-deps") == 0)
 		{
-			bound_deps = 1;
+			bound_deps_p = 1;
 		}
 		else if (strcmp(argv[i], "-check") == 0)
 		{
-			check = 1;
+			check_p = 1;
 		}
 		else
 		/* if (strcmp(argv[i], "-h") == 0 || strcmp(argv[i],"--help") == 0) */
 		{
 			fprintf(stderr,"usage : %s [-size size] [-nblocks nblocks] [-no-pin] [-no-prio] [-bound] [-bound-deps] [-bound-lp] [-check]\n", argv[0]);
-			fprintf(stderr,"Currently selected: %ux%u and %ux%u blocks\n", size, size, nblocks, nblocks);
+			fprintf(stderr,"Currently selected: %ux%u and %ux%u blocks\n", size_p, size_p, nblocks_p, nblocks_p);
 			exit(0);
 		}
 	}

+ 22 - 22
examples/cholesky/cholesky_grain_tag.c

@@ -2,7 +2,7 @@
  *
  * Copyright (C) 2009-2016  Université de Bordeaux
  * Copyright (C) 2010  Mehdi Juhoor <mjuhoor@gmail.com>
- * Copyright (C) 2010, 2011, 2012  CNRS
+ * Copyright (C) 2010, 2011, 2012, 2017  CNRS
  *
  * 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
@@ -296,7 +296,7 @@ static void initialize_system(int argc, char **argv, float **A, unsigned pinned)
 
 	if (pinned)
 		flags |= STARPU_MALLOC_PINNED;
-	starpu_malloc_flags((void **)A, size*size*sizeof(float), flags);
+	starpu_malloc_flags((void **)A, size_p*size_p*sizeof(float), flags);
 }
 
 int cholesky_grain(float *matA, unsigned size, unsigned ld, unsigned nblocks, unsigned nbigblocks, unsigned pinned)
@@ -343,16 +343,16 @@ int main(int argc, char **argv)
      	int ret;
 
 	float *mat = NULL;
-	initialize_system(argc, argv, &mat, pinned);
+	initialize_system(argc, argv, &mat, pinned_p);
 
 #ifndef STARPU_SIMGRID
 	unsigned i,j;
-	for (i = 0; i < size; i++)
+	for (i = 0; i < size_p; i++)
 	{
-		for (j = 0; j < size; j++)
+		for (j = 0; j < size_p; j++)
 		{
-			mat[j +i*size] = (1.0f/(1.0f+i+j)) + ((i == j)?1.0f*size:0.0f);
-			/* mat[j +i*size] = ((i == j)?1.0f*size:0.0f); */
+			mat[j +i*size_p] = (1.0f/(1.0f+i+j)) + ((i == j)?1.0f*size_p:0.0f);
+			/* mat[j +i*size_p] = ((i == j)?1.0f*size_p:0.0f); */
 		}
 	}
 #endif
@@ -361,13 +361,13 @@ int main(int argc, char **argv)
 #ifdef CHECK_OUTPUT
 	FPRINTF(stdout, "Input :\n");
 
-	for (j = 0; j < size; j++)
+	for (j = 0; j < size_p; j++)
 	{
-		for (i = 0; i < size; i++)
+		for (i = 0; i < size_p; i++)
 		{
 			if (i <= j)
 			{
-				FPRINTF(stdout, "%2.2f\t", mat[j +i*size]);
+				FPRINTF(stdout, "%2.2f\t", mat[j +i*size_p]);
 			}
 			else
 			{
@@ -378,43 +378,43 @@ int main(int argc, char **argv)
 	}
 #endif
 
-	ret = cholesky_grain(mat, size, size, nblocks, nbigblocks, pinned);
+	ret = cholesky_grain(mat, size_p, size_p, nblocks_p, nbigblocks_p, pinned_p);
 
 #ifdef CHECK_OUTPUT
 	FPRINTF(stdout, "Results :\n");
 
-	for (j = 0; j < size; j++)
+	for (j = 0; j < size_p; j++)
 	{
-		for (i = 0; i < size; i++)
+		for (i = 0; i < size_p; i++)
 		{
 			if (i <= j)
 			{
-				FPRINTF(stdout, "%2.2f\t", mat[j +i*size]);
+				FPRINTF(stdout, "%2.2f\t", mat[j +i*size_p]);
 			}
 			else
 			{
 				FPRINTF(stdout, ".\t");
-				mat[j+i*size] = 0.0f; /* debug */
+				mat[j+i*size_p] = 0.0f; /* debug */
 			}
 		}
 		FPRINTF(stdout, "\n");
 	}
 
 	FPRINTF(stderr, "compute explicit LLt ...\n");
-	float *test_mat = malloc(size*size*sizeof(float));
+	float *test_mat = malloc(size_p*size_p*sizeof(float));
 	STARPU_ASSERT(test_mat);
 
-	STARPU_SSYRK("L", "N", size, size, 1.0f,
-				mat, size, 0.0f, test_mat, size);
+	STARPU_SSYRK("L", "N", size_p, size_p, 1.0f,
+		     mat, size_p, 0.0f, test_mat, size_p);
 
 	FPRINTF(stderr, "comparing results ...\n");
-	for (j = 0; j < size; j++)
+	for (j = 0; j < size_p; j++)
 	{
-		for (i = 0; i < size; i++)
+		for (i = 0; i < size_p; i++)
 		{
 			if (i <= j)
 			{
-                                FPRINTF(stdout, "%2.2f\t", test_mat[j +i*size]);
+                                FPRINTF(stdout, "%2.2f\t", test_mat[j +i*size_p]);
 			}
 			else
 			{
@@ -426,6 +426,6 @@ int main(int argc, char **argv)
 	free(test_mat);
 #endif
 
-	shutdown_system(&mat, size, pinned);
+	shutdown_system(&mat, size_p, pinned_p);
 	return ret;
 }

+ 17 - 17
examples/cholesky/cholesky_implicit.c

@@ -2,7 +2,7 @@
  *
  * Copyright (C) 2009-2016  Université de Bordeaux
  * Copyright (C) 2010  Mehdi Juhoor <mjuhoor@gmail.com>
- * Copyright (C) 2010, 2011, 2012, 2013, 2016  CNRS
+ * Copyright (C) 2010, 2011, 2012, 2013, 2016, 2017  CNRS
  *
  * 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
@@ -47,10 +47,10 @@ static int _cholesky(starpu_data_handle_t dataA, unsigned nblocks)
 	unsigned long n = starpu_matrix_get_nx(dataA);
 	unsigned long nn = n/nblocks;
 
-	int prio_level = noprio?STARPU_DEFAULT_PRIO:STARPU_MAX_PRIO;
+	int prio_level = noprio_p?STARPU_DEFAULT_PRIO:STARPU_MAX_PRIO;
 
-	if (bound || bound_lp || bound_mps)
-		starpu_bound_start(bound_deps, 0);
+	if (bound_p || bound_lp_p || bound_mps_p)
+		starpu_bound_start(bound_deps_p, 0);
 	starpu_fxt_start_profiling();
 
 	start = starpu_timing_now();
@@ -118,34 +118,34 @@ static int _cholesky(starpu_data_handle_t dataA, unsigned nblocks)
 	end = starpu_timing_now();
 
 	starpu_fxt_stop_profiling();
-	if (bound || bound_lp || bound_mps)
+	if (bound_p || bound_lp_p || bound_mps_p)
 		starpu_bound_stop();
 
 	double timing = end - start;
 
 	double flop = FLOPS_SPOTRF(n);
 
-	if(with_ctxs || with_noctxs || chole1 || chole2)
+	if(with_ctxs_p || with_noctxs_p || chole1_p || chole2_p)
 		update_sched_ctx_timing_results((flop/timing/1000.0f), (timing/1000000.0f));
 	else
 	{
 		PRINTF("# size\tms\tGFlops");
-		if (bound)
+		if (bound_p)
 			PRINTF("\tTms\tTGFlops");
 		PRINTF("\n");
 
 		PRINTF("%lu\t%.0f\t%.1f", n, timing/1000, (flop/timing/1000.0f));
-		if (bound_lp)
+		if (bound_lp_p)
 		{
 			FILE *f = fopen("cholesky.lp", "w");
 			starpu_bound_print_lp(f);
 		}
-		if (bound_mps)
+		if (bound_mps_p)
 		{
 			FILE *f = fopen("cholesky.mps", "w");
 			starpu_bound_print_mps(f);
 		}
-		if (bound)
+		if (bound_p)
 		{
 			double res;
 			starpu_bound_compute(&res, NULL, 0);
@@ -246,7 +246,7 @@ static void execute_cholesky(unsigned size, unsigned nblocks)
 	}
 #endif
 
-	if (check)
+	if (check_p)
 	{
 		FPRINTF(stderr, "compute explicit LLt ...\n");
 		for (j = 0; j < size; j++)
@@ -327,7 +327,7 @@ int main(int argc, char **argv)
 
 	parse_args(argc, argv);
 
-	if(with_ctxs || with_noctxs || chole1 || chole2)
+	if(with_ctxs_p || with_noctxs_p || chole1_p || chole2_p)
 		parse_args_ctx(argc, argv);
 
 #ifdef STARPU_USE_CUDA
@@ -342,19 +342,19 @@ int main(int argc, char **argv)
 
 	starpu_cublas_init();
 
-	if(with_ctxs)
+	if(with_ctxs_p)
 	{
 		construct_contexts(execute_cholesky);
 		start_2benchs(execute_cholesky);
 	}
-	else if(with_noctxs)
+	else if(with_noctxs_p)
 		start_2benchs(execute_cholesky);
-	else if(chole1)
+	else if(chole1_p)
 		start_1stbench(execute_cholesky);
-	else if(chole2)
+	else if(chole2_p)
 		start_2ndbench(execute_cholesky);
 	else
-		execute_cholesky(size, nblocks);
+		execute_cholesky(size_p, nblocks_p);
 
 	starpu_cublas_shutdown();
 	starpu_shutdown();

+ 25 - 25
examples/cholesky/cholesky_tag.c

@@ -2,7 +2,7 @@
  *
  * Copyright (C) 2009-2016  Université de Bordeaux
  * Copyright (C) 2010  Mehdi Juhoor <mjuhoor@gmail.com>
- * Copyright (C) 2010, 2011, 2012, 2013  CNRS
+ * Copyright (C) 2010, 2011, 2012, 2013, 2017  CNRS
  *
  * 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_task_11(starpu_data_handle_t dataA, unsigned
 	task->handles[0] = starpu_data_get_sub_data(dataA, 2, k, k);
 
 	/* this is an important task */
-	if (!noprio)
+	if (!noprio_p)
 		task->priority = STARPU_MAX_PRIO;
 
 	/* enforce dependencies ... */
@@ -84,7 +84,7 @@ static void create_task_21(starpu_data_handle_t dataA, unsigned k, unsigned j)
 	task->handles[0] = starpu_data_get_sub_data(dataA, 2, k, k);
 	task->handles[1] = starpu_data_get_sub_data(dataA, 2, k, j);
 
-	if (!noprio && (j == k+1))
+	if (!noprio_p && (j == k+1))
 	{
 		task->priority = STARPU_MAX_PRIO;
 	}
@@ -124,7 +124,7 @@ static void create_task_22(starpu_data_handle_t dataA, unsigned k, unsigned i, u
 	task->handles[1] = starpu_data_get_sub_data(dataA, 2, k, j);
 	task->handles[2] = starpu_data_get_sub_data(dataA, 2, i, j);
 
-	if (!noprio && (i == k + 1) && (j == k +1) )
+	if (!noprio_p && (i == k + 1) && (j == k +1) )
 	{
 		task->priority = STARPU_MAX_PRIO;
 	}
@@ -259,7 +259,7 @@ static int initialize_system(int argc, char **argv, float **A, unsigned pinned)
 
 	if (pinned)
 		flags |= STARPU_MALLOC_PINNED;
-	starpu_malloc_flags((void **)A, size*size*sizeof(float), flags);
+	starpu_malloc_flags((void **)A, size_p*size_p*sizeof(float), flags);
 
 	return 0;
 }
@@ -313,17 +313,17 @@ int main(int argc, char **argv)
 	 * */
 
 	float *mat = NULL;
-	int ret = initialize_system(argc, argv, &mat, pinned);
+	int ret = initialize_system(argc, argv, &mat, pinned_p);
 	if (ret) return ret;
 
 #ifndef STARPU_SIMGRID
 	unsigned i,j;
-	for (i = 0; i < size; i++)
+	for (i = 0; i < size_p; i++)
 	{
-		for (j = 0; j < size; j++)
+		for (j = 0; j < size_p; j++)
 		{
-			mat[j +i*size] = (1.0f/(1.0f+i+j)) + ((i == j)?1.0f*size:0.0f);
-			/* mat[j +i*size] = ((i == j)?1.0f*size:0.0f); */
+			mat[j +i*size_p] = (1.0f/(1.0f+i+j)) + ((i == j)?1.0f*size_p:0.0f);
+			/* mat[j +i*size_p] = ((i == j)?1.0f*size_p:0.0f); */
 		}
 	}
 #endif
@@ -332,13 +332,13 @@ int main(int argc, char **argv)
 #ifdef CHECK_OUTPUT
 	FPRINTF(stdout, "Input :\n");
 
-	for (j = 0; j < size; j++)
+	for (j = 0; j < size_p; j++)
 	{
-		for (i = 0; i < size; i++)
+		for (i = 0; i < size_p; i++)
 		{
 			if (i <= j)
 			{
-				FPRINTF(stdout, "%2.2f\t", mat[j +i*size]);
+				FPRINTF(stdout, "%2.2f\t", mat[j +i*size_p]);
 			}
 			else
 			{
@@ -350,43 +350,43 @@ int main(int argc, char **argv)
 #endif
 
 
-	cholesky(mat, size, size, nblocks);
+	cholesky(mat, size_p, size_p, nblocks_p);
 
 #ifdef CHECK_OUTPUT
 	FPRINTF(stdout, "Results :\n");
 
-	for (j = 0; j < size; j++)
+	for (j = 0; j < size_p; j++)
 	{
-		for (i = 0; i < size; i++)
+		for (i = 0; i < size_p; i++)
 		{
 			if (i <= j)
 			{
-				FPRINTF(stdout, "%2.2f\t", mat[j +i*size]);
+				FPRINTF(stdout, "%2.2f\t", mat[j +i*size_p]);
 			}
 			else
 			{
 				FPRINTF(stdout, ".\t");
-				mat[j+i*size] = 0.0f; /* debug */
+				mat[j+i*size_p] = 0.0f; /* debug */
 			}
 		}
 		FPRINTF(stdout, "\n");
 	}
 
 	FPRINTF(stderr, "compute explicit LLt ...\n");
-	float *test_mat = malloc(size*size*sizeof(float));
+	float *test_mat = malloc(size_p*size_p*sizeof(float));
 	STARPU_ASSERT(test_mat);
 
-	STARPU_SSYRK("L", "N", size, size, 1.0f,
-				mat, size, 0.0f, test_mat, size);
+	STARPU_SSYRK("L", "N", size_p, size_p, 1.0f,
+		     mat, size_p, 0.0f, test_mat, size_p);
 
 	FPRINTF(stderr, "comparing results ...\n");
-	for (j = 0; j < size; j++)
+	for (j = 0; j < size_p; j++)
 	{
-		for (i = 0; i < size; i++)
+		for (i = 0; i < size_p; i++)
 		{
 			if (i <= j)
 			{
-				FPRINTF(stdout, "%2.2f\t", test_mat[j +i*size]);
+				FPRINTF(stdout, "%2.2f\t", test_mat[j +i*size_p]);
 			}
 			else
 			{
@@ -398,6 +398,6 @@ int main(int argc, char **argv)
 	free(test_mat);
 #endif
 
-	shutdown_system(&mat, size, pinned);
+	shutdown_system(&mat, size_p, pinned_p);
 	return 0;
 }

+ 26 - 28
examples/cholesky/cholesky_tile_tag.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009-2016  Université de Bordeaux
- * Copyright (C) 2010, 2011, 2012, 2013, 2016  CNRS
+ * Copyright (C) 2010, 2011, 2012, 2013, 2016, 2017  CNRS
  *
  * 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
@@ -54,7 +54,7 @@ static struct starpu_task * create_task_11(unsigned k, unsigned nblocks)
 /*	FPRINTF(stdout, "task 11 k = %d TAG = %llx\n", k, (TAG11(k))); */
 
 	struct starpu_task *task = create_task(TAG11(k));
-	
+
 	task->cl = &cl11;
 
 	/* which sub-data is manipulated ? */
@@ -81,7 +81,7 @@ static int create_task_21(unsigned k, unsigned j)
 
 	struct starpu_task *task = create_task(TAG21(k, j));
 
-	task->cl = &cl21;	
+	task->cl = &cl21;
 
 	/* which sub-data is manipulated ? */
 	task->handles[0] = A_state[k][k];
@@ -149,7 +149,7 @@ static int create_task_22(unsigned k, unsigned i, unsigned j)
 }
 
 /*
- *	code to bootstrap the factorization 
+ *	code to bootstrap the factorization
  *	and construct the DAG
  */
 
@@ -165,9 +165,9 @@ static int cholesky_no_stride(void)
 	/* create all the DAG nodes */
 	unsigned i,j,k;
 
-	for (k = 0; k < nblocks; k++)
+	for (k = 0; k < nblocks_p; k++)
 	{
-		struct starpu_task *task = create_task_11(k, nblocks);
+		struct starpu_task *task = create_task_11(k, nblocks_p);
 		/* we defer the launch of the first task */
 		if (k == 0)
 		{
@@ -178,13 +178,13 @@ static int cholesky_no_stride(void)
 			ret = starpu_task_submit(task);
 			STARPU_CHECK_RETURN_VALUE(ret, "starpu_task_submit");
 		}
-		
-		for (j = k+1; j<nblocks; j++)
+
+		for (j = k+1; j<nblocks_p; j++)
 		{
 			ret = create_task_21(k, j);
 			if (ret == -ENODEV) return 77;
 
-			for (i = k+1; i<nblocks; i++)
+			for (i = k+1; i<nblocks_p; i++)
 			{
 				if (i <= j)
 				{
@@ -202,15 +202,15 @@ static int cholesky_no_stride(void)
 	STARPU_CHECK_RETURN_VALUE(ret, "starpu_task_submit");
 
 	/* stall the application until the end of computations */
-	starpu_tag_wait(TAG11(nblocks-1));
+	starpu_tag_wait(TAG11(nblocks_p-1));
 
 	end = starpu_timing_now();
 
 	double timing = end - start;
 
-	double flop = (1.0f*size*size*size)/3.0f;
+	double flop = (1.0f*size_p*size_p*size_p)/3.0f;
 	PRINTF("# size\tms\tGFlops\n");
-	PRINTF("%u\t%.0f\t%.1f\n", size, timing/1000, (flop/timing/1000.0f));
+	PRINTF("%u\t%.0f\t%.1f\n", size_p, timing/1000, (flop/timing/1000.0f));
 
 	return 0;
 }
@@ -232,9 +232,9 @@ int main(int argc, char **argv)
 	init_sizes();
 
 	parse_args(argc, argv);
-	assert(nblocks <= NMAXBLOCKS);
+	assert(nblocks_p <= NMAXBLOCKS);
 
-	FPRINTF(stderr, "BLOCK SIZE = %u\n", size / nblocks);
+	FPRINTF(stderr, "BLOCK SIZE = %u\n", size_p / nblocks_p);
 
 #ifdef STARPU_USE_CUDA
 	initialize_chol_model(&chol_model_11,"chol_model_11",cpu_chol_task_11_cost,cuda_chol_task_11_cost);
@@ -251,8 +251,8 @@ int main(int argc, char **argv)
 
 	starpu_cublas_init();
 
-	for (y = 0; y < nblocks; y++)
-	for (x = 0; x < nblocks; x++)
+	for (y = 0; y < nblocks_p; y++)
+	for (x = 0; x < nblocks_p; x++)
 	{
 		if (x <= y)
 		{
@@ -264,10 +264,10 @@ int main(int argc, char **argv)
 #ifndef STARPU_SIMGRID
 	/* create a simple definite positive symetric matrix example
 	 *
-	 *	Hilbert matrix : h(i,j) = 1/(i+j+1) ( + n In to make is stable ) 
+	 *	Hilbert matrix : h(i,j) = 1/(i+j+1) ( + n In to make is stable )
 	 * */
-	for (y = 0; y < nblocks; y++)
-	for (x = 0; x < nblocks; x++)
+	for (y = 0; y < nblocks_p; y++)
+	for (x = 0; x < nblocks_p; x++)
 	if (x <= y)
 	{
 		unsigned i, j;
@@ -279,25 +279,25 @@ int main(int argc, char **argv)
 
 			/* make it a little more numerically stable ... ;) */
 			if ((x == y) && (i == j))
-				A[y][x][i*BLOCKSIZE + j] += (float)(2*size);
+				A[y][x][i*BLOCKSIZE + j] += (float)(2*size_p);
 		}
 	}
 #endif
 
-	for (y = 0; y < nblocks; y++)
-	for (x = 0; x < nblocks; x++)
+	for (y = 0; y < nblocks_p; y++)
+	for (x = 0; x < nblocks_p; x++)
 	{
 		if (x <= y)
 		{
-			starpu_matrix_data_register(&A_state[y][x], STARPU_MAIN_RAM, (uintptr_t)A[y][x], 
-				BLOCKSIZE, BLOCKSIZE, BLOCKSIZE, sizeof(float));
+			starpu_matrix_data_register(&A_state[y][x], STARPU_MAIN_RAM, (uintptr_t)A[y][x],
+						    BLOCKSIZE, BLOCKSIZE, BLOCKSIZE, sizeof(float));
 		}
 	}
 
 	ret = cholesky_no_stride();
 
-	for (y = 0; y < nblocks; y++)
-	for (x = 0; x < nblocks; x++)
+	for (y = 0; y < nblocks_p; y++)
+	for (x = 0; x < nblocks_p; x++)
 	{
 		if (x <= y)
 		{
@@ -311,5 +311,3 @@ int main(int argc, char **argv)
 	starpu_shutdown();
 	return ret;
 }
-
-

+ 5 - 5
examples/heat/dw_factolu.c

@@ -2,7 +2,7 @@
  *
  * Copyright (C) 2009-2015  Université de Bordeaux
  * Copyright (C) 2010  Mehdi Juhoor <mjuhoor@gmail.com>
- * Copyright (C) 2010, 2011, 2012, 2016  CNRS
+ * Copyright (C) 2010, 2011, 2012, 2016, 2017  CNRS
  *
  * 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
@@ -607,8 +607,8 @@ void dw_callback_codelet_update_u12_21(void *argcb)
 		unsigned nblocks = args->nblocks;
 
 		/* the number of tasks to be done */
-		unsigned *remaining = malloc(sizeof(unsigned));
-		*remaining = (nblocks - 1 - i)*(nblocks - 1 - i);
+		unsigned *remaining_tasks = malloc(sizeof(unsigned));
+		*remaining_tasks = (nblocks - 1 - i)*(nblocks - 1 - i);
 
 		unsigned slicey, slicex;
 		for (slicey = i+1; slicey < nblocks; slicey++)
@@ -632,7 +632,7 @@ void dw_callback_codelet_update_u12_21(void *argcb)
 				u22a->j = slicey;
 				u22a->dataA = args->dataA;
 				u22a->nblocks = nblocks;
-				u22a->remaining = remaining;
+				u22a->remaining = remaining_tasks;
 
 				task22->handles[0] = starpu_data_get_sub_data(args->dataA, 2, u22a->i, u22a->k);
 				task22->handles[1] = starpu_data_get_sub_data(args->dataA, 2, u22a->k, u22a->j);
@@ -644,7 +644,7 @@ void dw_callback_codelet_update_u12_21(void *argcb)
 			}
 		}
 
-		free(remaining);
+		free(remaining_tasks);
 	}
 }
 

+ 142 - 141
examples/mandelbrot/mandelbrot.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010, 2011, 2014-2015  Université de Bordeaux
- * Copyright (C) 2010, 2011, 2012, 2013, 2016  CNRS
+ * Copyright (C) 2010, 2011, 2012, 2013, 2016, 2017  CNRS
  *
  * 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 @@
 #ifdef STARPU_HAVE_X11
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
-int use_x11 = 1;
+int use_x11_p = 1;
 #endif
 
 #ifdef STARPU_HAVE_HELGRIND_H
@@ -40,22 +40,22 @@ int use_x11 = 1;
 #define ANNOTATE_HAPPENS_AFTER(obj) ((void)0)
 #endif
 
-int demo = 0;
-static double demozoom = 0.05;
+int demo_p = 0;
+static double demozoom_p = 0.05;
 
 /* NB: The X11 code is inspired from the http://locklessinc.com/articles/mandelbrot/ article */
 
-static int nblocks = 20;
-static int height = 400;
-static int width = 640;
-static int maxIt = 20000; /* max number of iteration in the Mandelbrot function */
-static int niter = -1; /* number of loops in case we don't use X11, -1 means infinite */
-static int use_spmd = 0;
+static int nblocks_p = 20;
+static int height_p = 400;
+static int width_p = 640;
+static int maxIt_p = 20000; /* max number of iteration in the Mandelbrot function */
+static int niter_p = -1; /* number of loops in case we don't use X11, -1 means infinite */
+static int use_spmd_p = 0;
 
-static double leftX = -0.745;
-static double rightX = -0.74375;
-static double topY = .15;
-static double bottomY = .14875;
+static double leftX_p = -0.745;
+static double rightX_p = -0.74375;
+static double topY_p = .15;
+static double bottomY_p = .14875;
 
 /*
  *	X11 window management
@@ -63,130 +63,130 @@ static double bottomY = .14875;
 
 #ifdef STARPU_HAVE_X11
 /* X11 data */
-static Display *dpy;
-static Window win;
-static XImage *bitmap;
-static GC gc;
-static KeySym Left=-1, Right, Down, Up, Alt ;
+static Display *dpy_p;
+static Window win_p;
+static XImage *bitmap_p;
+static GC gc_p;
+static KeySym Left_p=-1, Right_p, Down_p, Up_p, Alt_p;
 
 static void exit_x11(void)
 {
-	XDestroyImage(bitmap);
-	XDestroyWindow(dpy, win);
-	XCloseDisplay(dpy);
+	XDestroyImage(bitmap_p);
+	XDestroyWindow(dpy_p, win_p);
+	XCloseDisplay(dpy_p);
 }
 
 static void init_x11(int width, int height, unsigned *buffer)
 {
 	/* Attempt to open the display */
-	dpy = XOpenDisplay(NULL);
+	dpy_p = XOpenDisplay(NULL);
 
 	/* Failure */
-	if (!dpy)
+	if (!dpy_p)
 		exit(0);
 
-	unsigned long white = WhitePixel(dpy,DefaultScreen(dpy));
-	unsigned long black = BlackPixel(dpy,DefaultScreen(dpy));
+	unsigned long white = WhitePixel(dpy_p, DefaultScreen(dpy_p));
+	unsigned long black = BlackPixel(dpy_p, DefaultScreen(dpy_p));
 
-	win = XCreateSimpleWindow(dpy, DefaultRootWindow(dpy), 0, 0,
-					width, height, 0, black, white);
+	win_p = XCreateSimpleWindow(dpy_p, DefaultRootWindow(dpy_p), 0, 0,
+				    width, height, 0, black, white);
 
 	/* We want to be notified when the window appears */
-	XSelectInput(dpy, win, StructureNotifyMask);
+	XSelectInput(dpy_p, win_p, StructureNotifyMask);
 
 	/* Make it appear */
-	XMapWindow(dpy, win);
+	XMapWindow(dpy_p, win_p);
 
 	XTextProperty tp;
 	char name[128] = "Mandelbrot - StarPU";
 	char *n = name;
 	Status st = XStringListToTextProperty(&n, 1, &tp);
 	if (st)
-		XSetWMName(dpy, win, &tp);
+		XSetWMName(dpy_p, win_p, &tp);
 
 	/* Wait for the MapNotify event */
-	XFlush(dpy);
+	XFlush(dpy_p);
 
-	int depth = DefaultDepth(dpy, DefaultScreen(dpy));
-	Visual *visual = DefaultVisual(dpy, DefaultScreen(dpy));
+	int depth = DefaultDepth(dpy_p, DefaultScreen(dpy_p));
+	Visual *visual = DefaultVisual(dpy_p, DefaultScreen(dpy_p));
 
 	/* Make bitmap */
-	bitmap = XCreateImage(dpy, visual, depth,
-		ZPixmap, 0, (char *)buffer,
-		width, height, 32, 0);
+	bitmap_p = XCreateImage(dpy_p, visual, depth,
+				ZPixmap, 0, (char *)buffer,
+				width, height, 32, 0);
 
 	/* Init GC */
-	gc = XCreateGC(dpy, win, 0, NULL);
-	XSetForeground(dpy, gc, black);
+	gc_p = XCreateGC(dpy_p, win_p, 0, NULL);
+	XSetForeground(dpy_p, gc_p, black);
 
-	XSelectInput(dpy, win, ExposureMask | KeyPressMask | StructureNotifyMask);
+	XSelectInput(dpy_p, win_p, ExposureMask | KeyPressMask | StructureNotifyMask);
 
 	Atom wmDeleteMessage;
-	wmDeleteMessage = XInternAtom(dpy, "WM_DELETE_WINDOW", False);
-	XSetWMProtocols(dpy, win, &wmDeleteMessage, 1);
-
-        Left = XStringToKeysym ("Left");
-        Right = XStringToKeysym ("Right");
-        Up = XStringToKeysym ("Up");
-        Down = XStringToKeysym ("Down");
-        Alt = XStringToKeysym ("Alt");
+	wmDeleteMessage = XInternAtom(dpy_p, "WM_DELETE_WINDOW", False);
+	XSetWMProtocols(dpy_p, win_p, &wmDeleteMessage, 1);
+
+        Left_p = XStringToKeysym ("Left");
+        Right_p = XStringToKeysym ("Right");
+        Up_p = XStringToKeysym ("Up");
+        Down_p = XStringToKeysym ("Down");
+        Alt_p = XStringToKeysym ("Alt");
 }
 
 static int handle_events(void)
 {
 	XEvent event;
 
-	XNextEvent(dpy, &event);
+	XNextEvent(dpy_p, &event);
 	if (event.type == KeyPress)
 	{
 		KeySym key;
 		char text[255];
 
 		XLookupString(&event.xkey,text,255,&key,0);
-		if (key == Left)
+		if (key == Left_p)
 		{
-			double widthX = rightX - leftX;
-			leftX -= 0.25*widthX;
-			rightX -= 0.25*widthX;
+			double widthX = rightX_p - leftX_p;
+			leftX_p -= 0.25*widthX;
+			rightX_p -= 0.25*widthX;
 		}
-		else if (key == Right)
+		else if (key == Right_p)
 		{
-			double widthX = rightX - leftX;
-			leftX += 0.25*widthX;
-			rightX += 0.25*widthX;
+			double widthX = rightX_p - leftX_p;
+			leftX_p += 0.25*widthX;
+			rightX_p += 0.25*widthX;
 		}
-		else if (key == Up)
+		else if (key == Up_p)
 		{
-			double heightY = topY - bottomY;
-			topY += 0.25*heightY;
-			bottomY += 0.25*heightY;
+			double heightY = topY_p - bottomY_p;
+			topY_p += 0.25*heightY;
+			bottomY_p += 0.25*heightY;
 		}
-		else if (key == Down)
+		else if (key == Down_p)
 		{
-			double heightY = topY - bottomY;
-			topY -= 0.25*heightY;
-			bottomY -= 0.25*heightY;
+			double heightY = topY_p - bottomY_p;
+			topY_p -= 0.25*heightY;
+			bottomY_p -= 0.25*heightY;
 		}
 		else
 		{
-			double widthX = rightX - leftX;
-			double heightY = topY - bottomY;
+			double widthX = rightX_p - leftX_p;
+			double heightY = topY_p - bottomY_p;
 
 			if (text[0] == '-')
 			{
 				/* Zoom out */
-				leftX -= 0.125*widthX;
-				rightX += 0.125*widthX;
-				topY += 0.125*heightY;
-				bottomY -= 0.125*heightY;
+				leftX_p -= 0.125*widthX;
+				rightX_p += 0.125*widthX;
+				topY_p += 0.125*heightY;
+				bottomY_p -= 0.125*heightY;
 			}
 			else if (text[0] == '+')
 			{
 				/* Zoom in */
-				leftX += 0.125*widthX;
-				rightX -= 0.125*widthX;
-				topY -= 0.125*heightY;
-				bottomY += 0.125*heightY;
+				leftX_p += 0.125*widthX;
+				rightX_p -= 0.125*widthX;
+				topY_p -= 0.125*heightY;
+				bottomY_p += 0.125*heightY;
 			}
 		}
 
@@ -265,18 +265,18 @@ static void compute_block_opencl(void *descr[], void *cl_arg)
 	if (err != CL_SUCCESS) STARPU_OPENCL_REPORT_ERROR(err);
 
 	clSetKernelArg(kernel, 0, sizeof(data), &data);
-	clSetKernelArg(kernel, 1, sizeof(leftX), &leftX);
-	clSetKernelArg(kernel, 2, sizeof(topY), &topY);
+	clSetKernelArg(kernel, 1, sizeof(leftX_p), &leftX_p);
+	clSetKernelArg(kernel, 2, sizeof(topY_p), &topY_p);
 	clSetKernelArg(kernel, 3, sizeof(stepX), &stepX);
 	clSetKernelArg(kernel, 4, sizeof(stepY), &stepY);
-	clSetKernelArg(kernel, 5, sizeof(maxIt), &maxIt);
+	clSetKernelArg(kernel, 5, sizeof(maxIt_p), &maxIt_p);
 	clSetKernelArg(kernel, 6, sizeof(iby), &iby);
 	clSetKernelArg(kernel, 7, sizeof(block_size), &block_size);
-	clSetKernelArg(kernel, 8, sizeof(width), &width);
+	clSetKernelArg(kernel, 8, sizeof(width_p), &width_p);
 
 	unsigned dim = 16;
 	size_t local[2] = {dim, 1};
-	size_t global[2] = {width, block_size};
+	size_t global[2] = {width_p, block_size};
 	err = clEnqueueNDRangeKernel(queue, kernel, 2, NULL, global, local, 0, NULL, NULL);
 	if (err != CL_SUCCESS) STARPU_OPENCL_REPORT_ERROR(err);
 	starpu_opencl_release_kernel(kernel);
@@ -303,15 +303,15 @@ static void compute_block(void *descr[], void *cl_arg)
 		int ix, iy;
 
 		iy = iby*block_size + local_iy;
-		for (ix = 0; ix < width; ix++)
+		for (ix = 0; ix < width_p; ix++)
 		{
-			double cx = leftX + ix * stepX;
-			double cy = topY - iy * stepY;
+			double cx = leftX_p + ix * stepX;
+			double cy = topY_p - iy * stepY;
 			/* Z = X+I*Y */
 			double x = 0;
 			double y = 0;
 			int it;
-			for (it = 0; it < maxIt; it++)
+			for (it = 0; it < maxIt_p; it++)
 			{
 				double x2 = x*x;
 				double y2 = y*y;
@@ -328,7 +328,7 @@ static void compute_block(void *descr[], void *cl_arg)
 			}
 
 			unsigned int v = STARPU_MIN((1024*((float)(it)/(2000))), 256);
-			data[ix + local_iy*width] = (v<<16|(255-v)<<8);
+			data[ix + local_iy*width_p] = (v<<16|(255-v)<<8);
 		}
 	}
 }
@@ -358,15 +358,15 @@ static void compute_block_spmd(void *descr[], void *cl_arg)
 
 		iy = iby*block_size + local_iy;
 
-		for (ix = 0; ix < width; ix++)
+		for (ix = 0; ix < width_p; ix++)
 		{
-			double cx = leftX + ix * stepX;
-			double cy = topY - iy * stepY;
+			double cx = leftX_p + ix * stepX;
+			double cy = topY_p - iy * stepY;
 			/* Z = X+I*Y */
 			double x = 0;
 			double y = 0;
 			int it;
-			for (it = 0; it < maxIt; it++)
+			for (it = 0; it < maxIt_p; it++)
 			{
 				double x2 = x*x;
 				double y2 = y*y;
@@ -383,7 +383,7 @@ static void compute_block_spmd(void *descr[], void *cl_arg)
 			}
 
 			unsigned int v = STARPU_MIN((1024*((float)(it)/(2000))), 256);
-			data[ix + local_iy*width] = (v<<16|(255-v)<<8);
+			data[ix + local_iy*width_p] = (v<<16|(255-v)<<8);
 		}
 	}
 }
@@ -427,59 +427,60 @@ static void parse_args(int argc, char **argv)
 		if (strcmp(argv[i], "-width") == 0)
 		{
 			char *argptr;
-			width = strtol(argv[++i], &argptr, 10);
+			width_p = strtol(argv[++i], &argptr, 10);
 		}
 
 		if (strcmp(argv[i], "-height") == 0)
 		{
 			char *argptr;
-			height = strtol(argv[++i], &argptr, 10);
+			height_p = strtol(argv[++i], &argptr, 10);
 		}
 
 		if (strcmp(argv[i], "-nblocks") == 0)
 		{
 			char *argptr;
-			nblocks = strtol(argv[++i], &argptr, 10);
+			nblocks_p = strtol(argv[++i], &argptr, 10);
 		}
 
 		if (strcmp(argv[i], "-niter") == 0)
 		{
 			char *argptr;
-			niter = strtol(argv[++i], &argptr, 10);
+			niter_p = strtol(argv[++i], &argptr, 10);
 		}
 
 		if (strcmp(argv[i], "-pos") == 0)
 		{
-			int ret = sscanf(argv[++i], "%lf:%lf:%lf:%lf", &leftX, &rightX, &bottomY, &topY);
+			int ret = sscanf(argv[++i], "%lf:%lf:%lf:%lf", &leftX_p, &rightX_p,
+					 &bottomY_p, &topY_p);
 			assert(ret == 4);
 		}
 
 		if (strcmp(argv[i], "-demo") == 0)
 		{
-			demo = 1;
-			leftX = -50.22749575062760;
-			rightX = 48.73874621262927;
-			topY = -49.35016705749115;
-			bottomY = 49.64891691946615;
+			demo_p = 1;
+			leftX_p = -50.22749575062760;
+			rightX_p = 48.73874621262927;
+			topY_p = -49.35016705749115;
+			bottomY_p = 49.64891691946615;
 
 		}
 
 		if (strcmp(argv[i], "-demozoom") == 0)
 		{
 			char *argptr;
-			demozoom = strtof(argv[++i], &argptr);
+			demozoom_p = strtof(argv[++i], &argptr);
 		}
 
 		if (strcmp(argv[i], "-no-x11") == 0)
 		{
 #ifdef STARPU_HAVE_X11
-			use_x11 = 0;
+			use_x11_p = 0;
 #endif
 		}
 
 		if (strcmp(argv[i], "-spmd") == 0)
 		{
-			use_spmd = 1;
+			use_spmd_p = 1;
 		}
 	}
 }
@@ -495,35 +496,35 @@ int main(int argc, char **argv)
 	starpu_conf_init(&conf);
 	conf.ncuda = 0;
 
-	if (use_spmd)
+	if (use_spmd_p)
 		conf.sched_policy_name = "peager";
 
 	ret = starpu_init(&conf);
 	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
 	unsigned *buffer;
-	starpu_malloc((void **)&buffer, height*width*sizeof(unsigned));
+	starpu_malloc((void **)&buffer, height_p*width_p*sizeof(unsigned));
 
 #ifdef STARPU_HAVE_X11
-	if (use_x11)
-		init_x11(width, height, buffer);
+	if (use_x11_p)
+		init_x11(width_p, height_p, buffer);
 #endif
 
-	int block_size = height/nblocks;
-	STARPU_ASSERT((height % nblocks) == 0);
+	int block_size = height_p/nblocks_p;
+	STARPU_ASSERT((height_p % nblocks_p) == 0);
 
 #ifdef STARPU_USE_OPENCL
 	starpu_opencl_load_opencl_from_string(mandelbrot_opencl_src, &opencl_programs, NULL);
 #endif
 
-	starpu_data_handle_t block_handles[nblocks];
+	starpu_data_handle_t block_handles[nblocks_p];
 
 	int iby;
-	for (iby = 0; iby < nblocks; iby++)
+	for (iby = 0; iby < nblocks_p; iby++)
 	{
-		unsigned *data = &buffer[iby*block_size*width];
+		unsigned *data = &buffer[iby*block_size*width_p];
 		starpu_vector_data_register(&block_handles[iby], STARPU_MAIN_RAM,
-                        (uintptr_t)data, block_size*width, sizeof(unsigned));
+					    (uintptr_t)data, block_size*width_p, sizeof(unsigned));
 	}
 
 	unsigned iter = 0;
@@ -532,66 +533,66 @@ int main(int argc, char **argv)
 
 	start = starpu_timing_now();
 
-	while (niter-- != 0)
+	while (niter_p-- != 0)
 	{
-		double stepX = (rightX - leftX)/width;
-		double stepY = (topY - bottomY)/height;
+		double stepX = (rightX_p - leftX_p)/width_p;
+		double stepY = (topY_p - bottomY_p)/height_p;
 
 		/* In case we have a SPMD task, each worker will grab tasks in
 		 * a greedy and select which piece of image to compute by
 		 * incrementing a counter shared by all the workers within the
 		 * parallel task. */
-		int per_block_cnt[nblocks];
+		int per_block_cnt[nblocks_p];
 
-		for (iby = 0; iby < nblocks; iby++)
+		for (iby = 0; iby < nblocks_p; iby++)
 		{
 			per_block_cnt[iby] = 0;
 			int *pcnt = &per_block_cnt[iby];
 
-			ret = starpu_task_insert(use_spmd?&spmd_mandelbrot_cl:&mandelbrot_cl,
+			ret = starpu_task_insert(use_spmd_p?&spmd_mandelbrot_cl:&mandelbrot_cl,
 						 STARPU_VALUE, &iby, sizeof(iby),
 						 STARPU_VALUE, &block_size, sizeof(block_size),
 						 STARPU_VALUE, &stepX, sizeof(stepX),
 						 STARPU_VALUE, &stepY, sizeof(stepY),
 						 STARPU_W, block_handles[iby],
 						 STARPU_VALUE, &pcnt, sizeof(int *),
-						 STARPU_TAG_ONLY, ((starpu_tag_t)niter)*nblocks + iby,
+						 STARPU_TAG_ONLY, ((starpu_tag_t)niter_p)*nblocks_p + iby,
 						 0);
 			STARPU_CHECK_RETURN_VALUE(ret, "starpu_task_insert");
 		}
 
-		for (iby = 0; iby < nblocks; iby++)
+		for (iby = 0; iby < nblocks_p; iby++)
 		{
 #ifdef STARPU_HAVE_X11
-			if (use_x11)
+			if (use_x11_p)
 			{
 				starpu_data_acquire(block_handles[iby], STARPU_R);
-				XPutImage(dpy, win, gc, bitmap,
-					0, iby*block_size,
-					0, iby*block_size,
-					width, block_size);
+				XPutImage(dpy_p, win_p, gc_p, bitmap_p,
+					  0, iby*block_size,
+					  0, iby*block_size,
+					  width_p, block_size);
 				starpu_data_release(block_handles[iby]);
 			}
 #endif
 		}
 
 
-		if (demo)
+		if (demo_p)
 		{
 			/* Zoom in */
-			double zoom_factor = demozoom;
-			double widthX = rightX - leftX;
-			double heightY = topY - bottomY;
+			double zoom_factor = demozoom_p;
+			double widthX = rightX_p - leftX_p;
+			double heightY = topY_p - bottomY_p;
 
 			iter++;
 
 			/* If the window is too small, we reset the demo and display some statistics */
 			if ((fabs(widthX) < 1e-12) || (fabs(heightY) < 1e-12))
 			{
-				leftX = -50.22749575062760;
-				rightX = 48.73874621262927;
-				topY = -49.35016705749115;
-				bottomY = 49.64891691946615;
+				leftX_p = -50.22749575062760;
+				rightX_p = 48.73874621262927;
+				topY_p = -49.35016705749115;
+				bottomY_p = 49.64891691946615;
 
 				end = starpu_timing_now();
 				double timing = end - start;
@@ -605,25 +606,25 @@ int main(int argc, char **argv)
 			}
 			else
 			{
-				leftX += (zoom_factor/2)*widthX;
-				rightX -= (zoom_factor/2)*widthX;
-				topY -= (zoom_factor/2)*heightY;
-				bottomY += (zoom_factor/2)*heightY;
+				leftX_p += (zoom_factor/2)*widthX;
+				rightX_p -= (zoom_factor/2)*widthX;
+				topY_p -= (zoom_factor/2)*heightY;
+				bottomY_p += (zoom_factor/2)*heightY;
 			}
 
 		}
 #ifdef STARPU_HAVE_X11
-		else if (use_x11 && handle_events())
+		else if (use_x11_p && handle_events())
 			break;
 #endif
 	}
 
 #ifdef STARPU_HAVE_X11
-	if (use_x11)
+	if (use_x11_p)
 		exit_x11();
 #endif
 
-	for (iby = 0; iby < nblocks; iby++)
+	for (iby = 0; iby < nblocks_p; iby++)
 		starpu_data_unregister(block_handles[iby]);
 
 /*	starpu_data_free_pinned_if_possible(buffer); */

+ 3 - 3
examples/stencil/implicit-stencil-kernels.c

@@ -345,9 +345,9 @@ static void update_func_opencl(void *descr[], void *arg)
  */
 void update_func_cpu(void *descr[], void *arg)
 {
-    unsigned z;
-    starpu_codelet_unpack_args(arg, &z);
-	struct block_description *block = get_block_description(z);
+	unsigned zz;
+	starpu_codelet_unpack_args(arg, &zz);
+	struct block_description *block = get_block_description(zz);
 
 	int workerid = starpu_worker_get_id_check();
 	DEBUG( "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");

+ 5 - 5
include/starpu_util.h

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010-2016  Université de Bordeaux
- * Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015, 2016  CNRS
+ * Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017  CNRS
  *
  * 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
@@ -149,12 +149,12 @@ extern "C"
 
 #if defined(STARPU_HAVE_STRERROR_R)
 #  define STARPU_CHECK_RETURN_VALUE(err, message, ...) {if (STARPU_UNLIKELY(err != 0)) { \
-			char xmessage[256]; strerror_r(-err, xmessage, 256); \
-			fprintf(stderr, "[starpu] Unexpected value: <%d:%s> returned for " message "\n", err, xmessage, ## __VA_ARGS__); \
+			char xmessage[256]; char *_strerror = strerror_r(-err, xmessage, 256); \
+			fprintf(stderr, "[starpu] Unexpected value: <%d:%s> returned for " message "\n", err, _strerror==NULL?"":xmessage, ## __VA_ARGS__); \
 			STARPU_ABORT(); }}
 #  define STARPU_CHECK_RETURN_VALUE_IS(err, value, message, ...) {if (STARPU_UNLIKELY(err != value)) { \
-			char xmessage[256]; strerror_r(-err, xmessage, 256); \
-			fprintf(stderr, "[starpu] Unexpected value: <%d!=%d:%s> returned for " message "\n", err, value, xmessage, ## __VA_ARGS__); \
+			char xmessage[256]; char *_strerror=strerror_r(-err, xmessage, 256); \
+			fprintf(stderr, "[starpu] Unexpected value: <%d!=%d:%s> returned for " message "\n", err, value, _strerror==NULL?"":xmessage, ## __VA_ARGS__); \
 			STARPU_ABORT(); }}
 #else
 #  define STARPU_CHECK_RETURN_VALUE(err, message, ...) {if (STARPU_UNLIKELY(err != 0)) { \

+ 1 - 0
mpi/src/load_balancer/policy/load_data_interface.c

@@ -129,6 +129,7 @@ int load_data_wakeup_cond(starpu_data_handle_t handle)
 
 static void load_data_register_data_handle(starpu_data_handle_t handle, unsigned home_node, void *data_interface)
 {
+	(void) home_node;
 	struct load_data_interface *ld_interface = (struct load_data_interface *) data_interface;
 
 	unsigned node;

+ 2 - 1
src/util/starpu_clusters_create.c

@@ -2,7 +2,7 @@
  *
  * Copyright (C) 2015-2016  Université de Bordeaux
  * Copyright (C) 2015  INRIA
- * Copyright (C) 2015, 2016  CNRS
+ * Copyright (C) 2015, 2016, 2017  CNRS
  *
  * 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
@@ -47,6 +47,7 @@ starpu_binding_function _starpu_cluster_type_get_func(starpu_cluster_types type)
 
 void starpu_openmp_prologue(void* arg)
 {
+	(void) arg;
 	int workerid = starpu_worker_get_id_check();
 
 	if (starpu_worker_get_type(workerid) == STARPU_CPU_WORKER)

+ 3 - 2
starpu-top/abstractwidgetwindow.cpp

@@ -87,8 +87,9 @@ void AbstractWidgetWindow::mouseMoveEvent(QMouseEvent *event)
 
 void AbstractWidgetWindow::resizeEvent(QResizeEvent *event)
 {
-    _sizeGrip->move(width()-32,height()-32);
-    _sizeGrip->resize(32,32);
+	(void) event;
+	_sizeGrip->move(width()-32,height()-32);
+	_sizeGrip->resize(32,32);
 }
 
 /* -------------------------------------------------------------------------- */

+ 15 - 22
starpu-top/communicationmanager.cpp

@@ -1,7 +1,7 @@
 /*
 = StarPU-Top for StarPU =
 
-Copyright (C) 2011 
+Copyright (C) 2011
 William Braik
 Yann Courtois
 Jean-Marie Couteyen
@@ -37,6 +37,7 @@ CommunicationManager::CommunicationManager(QObject *parent) :
     Q_ASSERT_X(instanciated == false, "CommunicationManager's' constructor",
                "Singleton pattern violated - "
                "CommunicationManager instanciated more than once");
+    (void) instanciated;
 
     qDebug() << "CommunicationManager : initializing";
 
@@ -665,34 +666,26 @@ void CommunicationManager::parseInitDevMessage(QString messageString)
         Q_ASSERT_X(ok == true, "CommunicationManager::parseInitDevMessage()",
                    "Bogus message received in INIT DEV");
 
-        starpu_top_device_type deviceType;
-
-        Q_ASSERT_X(
-                deviceTypeString.compare(
-                        _inMessageStrings.key(COM_MSG_IN_DEV_CPU)) == 0
-                || deviceTypeString.compare(
-                        _inMessageStrings.key(COM_MSG_IN_DEV_CUDA))
-                == 0 || deviceTypeString.compare(
-                        _inMessageStrings.key(COM_MSG_IN_DEV_OPENCL)) == 0
-		,
-                "CommunicationManager::parseInitDevMessage()",
-                "Bogus message received in INIT DEV");
-
-        if (deviceTypeString.compare(_inMessageStrings.key(COM_MSG_IN_DEV_CPU))
-            == 0)
-            {
+        starpu_top_device_type deviceType = SERVERDEVICE_INVALID;
+
+        if (deviceTypeString.compare(_inMessageStrings.key(COM_MSG_IN_DEV_CPU)) == 0)
+	{
             deviceType = SERVERDEVICE_CPU;
         }
-        else if (deviceTypeString.compare(
-                _inMessageStrings.key(COM_MSG_IN_DEV_CUDA)) == 0)
+        else if (deviceTypeString.compare(_inMessageStrings.key(COM_MSG_IN_DEV_CUDA)) == 0)
         {
             deviceType = SERVERDEVICE_CUDA;
         }
-        else if (deviceTypeString.compare(
-                _inMessageStrings.key(COM_MSG_IN_DEV_OPENCL)) == 0)
+        else if (deviceTypeString.compare(_inMessageStrings.key(COM_MSG_IN_DEV_OPENCL)) == 0)
         {
             deviceType = SERVERDEVICE_OPENCL;
         }
+	else
+	{
+	    Q_ASSERT_X(false,
+		       "CommunicationManager::parseInitDevMessage()",
+		       "Bogus message received in INIT DEV");
+	}
 
         starpu_top_device device;
         device.id = deviceId;
@@ -1456,7 +1449,7 @@ DataDescription *CommunicationManager::dataDescriptionFromId(int dataId) const
     return 0;
 }
 
-ParamDescription 
+ParamDescription
         *CommunicationManager::paramDescriptionFromId(int paramId) const
 {
     for (int i = 0; i < _paramDescriptions->count(); i++)

+ 1 - 0
starpu-top/communicationthread.cpp

@@ -43,6 +43,7 @@ CommunicationThread::CommunicationThread(
     Q_ASSERT_X(instanciated == false, "CommunicationThread's' constructor",
                "Singleton pattern violated - "
                "CommunicationThread instanciated more than once");
+    (void) instanciated;
 
     _mainWindow = mainWindow;
     _configurationManager = configurationManager;

+ 1 - 0
starpu-top/configurationmanager.cpp

@@ -34,6 +34,7 @@ ConfigurationManager::ConfigurationManager()
     Q_ASSERT_X(instanciated == false, "ConfigurationManager's' constructor",
                "Singleton pattern violated - "
                "ConfigurationManager instanciated more than once");
+    (void) instanciated;
 
     qDebug() << "ConfigurationManager : initializing";
 

+ 2 - 0
starpu-top/ganttwidget.cpp

@@ -118,6 +118,8 @@ void GanttWidget::defaultScreen(QPainter *painter)
 // Called each time the window is resized
 void GanttWidget::resizeGL(int width, int height)
 {
+    (void) width;
+    (void) height;
     update();
 }
 

+ 7 - 4
starpu-top/mainwindow.cpp

@@ -334,6 +334,7 @@ void MainWindow::openSession()
     Q_ASSERT_X(ok == true,
                "MainWindow::openSession()",
                "Couldn't connect to the tasks database !");
+    (void) ok;
 
     // Init time references
     _lockedTime = 0;
@@ -440,8 +441,9 @@ void MainWindow::sessionMainWindowSetupLoaded(MainWindowSetup mainWindowSetup)
 void MainWindow::sessionParametersDockSetupLoaded(
         ParametersDockSetup parametersDockSetup)
 {
-    qDebug() << "MainWindow : "
-            "restoring parameters dock setup from another session";
+	(void) parametersDockSetup;
+	qDebug() << "MainWindow : "
+		"restoring parameters dock setup from another session";
 }
 
 void MainWindow::sessionWidgetWindowsSetupLoaded(
@@ -1362,8 +1364,9 @@ void MainWindow::updateTaskPrev(int taskId, int deviceId, qlonglong timestamp,
                                 qlonglong timestampStart,
                                 qlonglong timestampEnd)
 {
-    _taskManager->addTaskPrev(taskId, deviceId, timestampStart - _preGoTime,
-                              timestampEnd - _preGoTime);
+	(void) timestamp;
+	_taskManager->addTaskPrev(taskId, deviceId, timestampStart - _preGoTime,
+				  timestampEnd - _preGoTime);
 }
 
 void MainWindow::updateTaskStart(int taskId, int deviceId, qlonglong timestamp)

+ 3 - 3
starpu-top/preferencesdialog.cpp

@@ -151,7 +151,7 @@ void PreferencesDialog::displayWidgetPreferences()
         QList < DataWidgetType > dataWidgetPossibilities
                 = _dataWidgetPossibilities->value(dataType).values();
 
-        int currentDataWidgetIndex;
+        int currentDataWidgetIndex=-1;
         for (int j = 0; j < dataWidgetPossibilities.count(); j++)
         {
             DataWidgetType widget = dataWidgetPossibilities.at(j);
@@ -207,8 +207,8 @@ void PreferencesDialog::displayWidgetPreferences()
         QList < InteractiveWidgetType > interactiveWidgetPossibilities
                 = _interactiveWidgetPossibilities->value(paramType).values();
 
-        int currentInteractiveWidgetIndex;
-        for (int j = 0; j < interactiveWidgetPossibilities.count(); j++)
+        int currentInteractiveWidgetIndex=-1;
+	for (int j = 0; j < interactiveWidgetPossibilities.count(); j++)
         {
             InteractiveWidgetType widget = interactiveWidgetPossibilities.at(j);
             if (widget == paramDescription->widget)

+ 1 - 0
starpu-top/qledindicator/qledindicator.cpp

@@ -36,6 +36,7 @@ QLedIndicator::QLedIndicator(QWidget *parent) :
 
 void QLedIndicator::paintEvent(QPaintEvent *event)
 {
+	(void) event;
 	qreal realSize = qMin(width() / 1.3, height() / 1.3);
 
 	QRadialGradient gradient;

+ 1 - 0
starpu-top/sessionsetupmanager.cpp

@@ -41,6 +41,7 @@ SessionSetupManager::SessionSetupManager(MainWindow *mainWindow)
     Q_ASSERT_X(instanciated == false, "SessionSetupManager's' constructor",
                "Singleton pattern violated - "
                "SessionSetupManager instanciated more than once");
+    (void) instanciated;
 
     qDebug() << "SessionSetupManager : initializing";
 

+ 2 - 1
starpu-top/starpu_top_types.h

@@ -116,7 +116,8 @@ enum starpu_top_device_type
 {
     SERVERDEVICE_CPU = 0,
     SERVERDEVICE_CUDA = 1,
-    SERVERDEVICE_OPENCL = 2
+    SERVERDEVICE_OPENCL = 2,
+    SERVERDEVICE_INVALID = 3,
 };
 
 // Server devices

+ 1 - 0
starpu-top/taskmanager.cpp

@@ -35,6 +35,7 @@ TaskManager::TaskManager()
     Q_ASSERT_X(instanciated == false, "TaskManager's' constructor",
                "Singleton pattern violated - "
                "TaskManager instanciated more than once");
+    (void) instanciated;
 
     qDebug() << "TaskManager : initializing";
 

+ 1 - 0
starpu-top/widgetwindowsmanager.cpp

@@ -38,6 +38,7 @@ WidgetWindowsManager::WidgetWindowsManager(MainWindow *mainWindow,
     Q_ASSERT_X(instanciated == false, "WidgetWindowsManager's' constructor",
                "Singleton pattern violated - "
                "WidgetWindowsManager instanciated more than once");
+    (void) instanciated;
 
     qDebug() << "WindowsWidgetManager : initializing";
 

+ 1 - 1
starpufft/src/starpufftx1d.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009-2014  Université de Bordeaux
- * Copyright (C) 2010, 2011, 2012, 2013, 2016  CNRS
+ * Copyright (C) 2010, 2011, 2012, 2013, 2016, 2017  CNRS
  *
  * 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

+ 4 - 2
tests/datawizard/simgrid-locality.c

@@ -17,9 +17,11 @@
 /* Check that defining a main makes starpu use MSG_process_attach. */
 #include "locality.c"
 #include <config.h>
-#if defined(HAVE_MSG_PROCESS_ATTACH) && SIMGRID_VERSION_MAJOR > 3 || (SIMGRID_VERSION_MAJOR == 3 && SIMGRID_VERSION_MINOR >= 15)
+
+#if defined(SIMGRID_VERSION_MAJOR) && defined(SIMGRID_VERSION_MINOR) && (defined(HAVE_MSG_PROCESS_ATTACH) && SIMGRID_VERSION_MAJOR > 3 || (SIMGRID_VERSION_MAJOR == 3 && SIMGRID_VERSION_MINOR >= 15))
 #undef main
-int main(int argc, char *argv[]) {
+int main(int argc, char *argv[])
+{
 	return starpu_main(argc, argv);
 }
 #endif