Explorar o código

Obvious fixes to example sources to compile as strict c89.

From: Jonathan Adamczewski <jadamcze@utas.edu.au>
Samuel Thibault %!s(int64=14) %!d(string=hai) anos
pai
achega
2efb9fb40d

+ 1 - 1
examples/basic_examples/block.c

@@ -109,7 +109,7 @@ int main(int argc, char **argv)
         if (!ret) multiplier *= 3.0;
 #endif
 
-        // Check result is correct
+        /* Check result is correct */
         ret=1;
         for(i=0 ; i<nx*ny*nz ; i++) {
           if (block[i] != (i+1) * multiplier) {

+ 13 - 12
examples/basic_examples/hello_world.c

@@ -57,19 +57,13 @@ void cpu_func(void *buffers[], void *cl_arg)
 	FPRINTF(stdout, "Hello world (params = {%i, %f} )\n", params->i, params->f);
 }
 
-starpu_codelet cl =
-{
-	/* this codelet may only be executed on a CPU, and its cpu
- 	 * implementation is function "cpu_func" */
-	.where = STARPU_CPU,
-	.cpu_func = cpu_func,
-	/* the codelet does not manipulate any data that is managed
-	 * by our DSM */
-	.nbuffers = 0
-};
+starpu_codelet cl;
 
 int main(int argc, char **argv)
 {
+	struct starpu_task *task;
+	struct params params = {1, 2.0f};
+
 	/* initialize StarPU : passing a NULL argument means that we use
  	* default configuration for the scheduling policies and the number of
 	* processors/accelerators */
@@ -78,7 +72,15 @@ int main(int argc, char **argv)
 	/* create a new task that is non-blocking by default : the task is not
 	 * submitted to the scheduler until the starpu_task_submit function is
 	 * called */
-	struct starpu_task *task = starpu_task_create();
+	task = starpu_task_create();
+
+	/* this codelet may only be executed on a CPU, and its cpu
+ 	 * implementation is function "cpu_func" */
+	cl.where = STARPU_CPU;
+	cl.cpu_func = cpu_func;
+	/* the codelet does not manipulate any data that is managed
+	 * by our DSM */
+	cl.nbuffers = 0;
 
 	/* the task uses codelet "cl" */
 	task->cl = &cl;
@@ -91,7 +93,6 @@ int main(int argc, char **argv)
 	 * is read-only so that any modification is not passed to other copies
 	 * of the buffer.  For this reason, a buffer passed as a codelet
 	 * argument (cl_arg) is NOT a valid synchronization medium! */
-	struct params params = { 1, 2.0f };
 	task->cl_arg = &params;
 	task->cl_arg_size = sizeof(params);
 		

+ 13 - 13
examples/mandelbrot/mandelbrot.c

@@ -35,8 +35,8 @@ int demo = 0;
 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 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 double leftX = -0.745;
@@ -233,7 +233,7 @@ static void compute_block_opencl(void *descr[], void *cl_arg)
 {
 	int iby, block_size;
 	double stepX, stepY;
-	int *pcnt; // unused for CUDA tasks
+	int *pcnt; /* unused for CUDA tasks */
 	starpu_unpack_cl_args(cl_arg, &iby, &block_size, &stepX, &stepY, &pcnt);
 
 	cl_mem data = (cl_mem)STARPU_VECTOR_GET_PTR(descr[0]);
@@ -278,7 +278,7 @@ static void compute_block(void *descr[], void *cl_arg)
 
 	int iby, block_size;
 	double stepX, stepY;
-	int *pcnt; // unused for sequential tasks
+	int *pcnt; /* unused for sequential tasks */
 	starpu_unpack_cl_args(cl_arg, &iby, &block_size, &stepX, &stepY, &pcnt);
 
 	unsigned *data = (unsigned *)STARPU_VECTOR_GET_PTR(descr[0]);
@@ -291,7 +291,7 @@ static void compute_block(void *descr[], void *cl_arg)
 		{
 			double cx = leftX + ix * stepX;
 			double cy = topY - iy * stepY;
-			// Z = X+I*Y
+			/* Z = X+I*Y */
 			double x = 0;
 			double y = 0;
 			int it;
@@ -300,13 +300,13 @@ static void compute_block(void *descr[], void *cl_arg)
 				double x2 = x*x;
 				double y2 = y*y;
 
-				// Stop iterations when |Z| > 2
+				/* Stop iterations when |Z| > 2 */
 				if (x2 + y2 > 4.0)
 					break;
 
 				double twoxy = 2.0*x*y;
 
-				// Z = Z^2 + C
+				/* Z = Z^2 + C */
 				x = x2 - y2 + cx;
 				y = twoxy + cy;
 			}
@@ -327,8 +327,8 @@ static void compute_block_spmd(void *descr[], void *cl_arg)
 
 	unsigned *data = (unsigned *)STARPU_VECTOR_GET_PTR(descr[0]);
 
-	int ix, iy; // global coordinates
-	int local_iy; // current line
+	int ix, iy; /* global coordinates */
+	int local_iy; /* current line */
 
 	while (1)
 	{
@@ -342,7 +342,7 @@ static void compute_block_spmd(void *descr[], void *cl_arg)
 		{
 			double cx = leftX + ix * stepX;
 			double cy = topY - iy * stepY;
-			// Z = X+I*Y
+			/* Z = X+I*Y */
 			double x = 0;
 			double y = 0;
 			int it;
@@ -351,13 +351,13 @@ static void compute_block_spmd(void *descr[], void *cl_arg)
 				double x2 = x*x;
 				double y2 = y*y;
 
-				// Stop iterations when |Z| > 2
+				/* Stop iterations when |Z| > 2 */
 				if (x2 + y2 > 4.0)
 					break;
 
 				double twoxy = 2.0*x*y;
 
-				// Z = Z^2 + C
+				/* Z = Z^2 + C */
 				x = x2 - y2 + cx;
 				y = twoxy + cy;
 			}
@@ -583,7 +583,7 @@ int main(int argc, char **argv)
 	for (iby = 0; iby < nblocks; iby++)
 		starpu_data_unregister(block_handles[iby]);
 
-//	starpu_data_free_pinned_if_possible(buffer);
+/*	starpu_data_free_pinned_if_possible(buffer); */
 
 	starpu_shutdown();
 

+ 1 - 1
examples/pi/SobolQRNG/sobol.h

@@ -54,7 +54,7 @@
 #ifndef SOBOL_H
 #define SOBOL_H
 
-// Number of direction vectors is fixed to 32
+/* Number of direction vectors is fixed to 32 */
 #define n_directions 32
 
 #endif

+ 11 - 11
examples/pi/SobolQRNG/sobol_primitives.c

@@ -54,18 +54,18 @@
 
 #include "sobol_primitives.h"
 
-// Each primitive is stored as a struct where
-//  dimension is the dimension number of the polynomial (unused)
-//  degree is the degree of the polynomial
-//  a is a binary word representing the coefficients 
-//  m is the array of m values
+/* Each primitive is stored as a struct where
+   dimension is the dimension number of the polynomial (unused)
+   degree is the degree of the polynomial
+   a is a binary word representing the coefficients 
+   m is the array of m values
 
-// The primitives are based on those generated by Stephen Joe and
-// Frances Kuo in the joe-kuo-6.10200 set.
-// c.f. http://web.maths.unsw.edu.au/~fkuo/sobol/index.html
+   The primitives are based on those generated by Stephen Joe and
+   Frances Kuo in the joe-kuo-6.10200 set.
+   c.f. http://web.maths.unsw.edu.au/~fkuo/sobol/index.html */
 const struct primitive sobol_primitives[] =
 {
-    // First dimension is a special case so this entry is actually ignored
+    /* First dimension is a special case so this entry is actually ignored */
     {1, 0, 0, {}},
     {2, 1, 0, {1}},
     {3, 2, 1, {1, 3}},
@@ -10266,6 +10266,6 @@ const struct primitive sobol_primitives[] =
     {10198, 17, 38018, {1, 3, 7, 13, 5, 49, 61, 123, 443, 769, 1669, 2741, 6881, 5965, 9365, 43051, 2979}},
     {10199, 17, 38020, {1, 1, 1, 7, 7, 25, 41, 179, 419, 225, 1827, 613, 4711, 1671, 14459, 33951, 56751}},
     {10200, 17, 38038, {1, 3, 5, 7, 9, 61, 35, 205, 243, 49, 803, 2653, 4101, 4435, 29697, 45441, 124841}}
-    // Extending this table?
-    // Ensure that the max_m defined in sobol_primitives.h is sufficient for all the m values
+    /* Extending this table?
+       Ensure that the max_m defined in sobol_primitives.h is sufficient for all the m values */
 };

+ 5 - 5
examples/pi/SobolQRNG/sobol_primitives.h

@@ -57,11 +57,11 @@
 
 #define max_m 17
 
-// Each primitive is stored as a struct where
-//  dimension is the dimension number of the polynomial (unused)
-//  degree is the degree of the polynomial
-//  a is a binary word representing the coefficients 
-//  m is the array of m values
+/* Each primitive is stored as a struct where
+   dimension is the dimension number of the polynomial (unused)
+   degree is the degree of the polynomial
+   a is a binary word representing the coefficients 
+   m is the array of m values */
 struct primitive
 {
     unsigned int dimension;

+ 2 - 2
examples/pi/pi.h

@@ -26,8 +26,8 @@
 
 #define TYPE	float
 
-//extern "C" void cuda_kernel(void *descr[], void *cl_arg);
+/* extern "C" void cuda_kernel(void *descr[], void *cl_arg); */
 
 static int n_dimensions = 100;
 
-#endif // __PI_H__
+#endif /* __PI_H__ */

+ 3 - 3
examples/ppm_downscaler/ppm_downscaler.c

@@ -76,7 +76,7 @@ struct ppm_image *file_to_ppm(char *filename)
 	unsigned i;
 	for (i = 0; i < ppm->ncols*ppm->nlines; i++)
 	{
-//		fprintf(stderr, "READ (index %d) -> r %d g %d b %d\n", i, ppm->data[i].r, ppm->data[i].g, ppm->data[i].b);
+/*		fprintf(stderr, "READ (index %d) -> r %d g %d b %d\n", i, ppm->data[i].r, ppm->data[i].g, ppm->data[i].b); */
 	}
 
 	fclose(file);
@@ -136,7 +136,7 @@ void dummy_downscale(struct ppm_image *input_ppm, struct ppm_image *output_ppm)
 				{
 					unsigned index = (big_col + i)+(big_line + j)*input_ppm->ncols;
 
-//					fprintf(stderr, "(col %d, line %d) i %d j %d index %d -> r %d g %d b %d\n", col, line, i, j, index, in[index].r, in[index].g, in[index].b);
+/*					fprintf(stderr, "(col %d, line %d) i %d j %d index %d -> r %d g %d b %d\n", col, line, i, j, index, in[index].r, in[index].g, in[index].b); */
 
 					sum_r += (unsigned)in[index].r;
 					sum_g += (unsigned)in[index].g;
@@ -148,7 +148,7 @@ void dummy_downscale(struct ppm_image *input_ppm, struct ppm_image *output_ppm)
 			out[col + line*output_ppm->ncols].g = (unsigned char)(sum_g/(FACTOR*FACTOR));
 			out[col + line*output_ppm->ncols].b = (unsigned char)(sum_b/(FACTOR*FACTOR));
 
-//			fprintf(stderr, "col %d line %d -> sum_r = %d out -> %d\n", col, line, sum_r, out[col + line*FACTOR].r);
+/*			fprintf(stderr, "col %d line %d -> sum_r = %d out -> %d\n", col, line, sum_r, out[col + line*FACTOR].r); */
 	
 		}
 	}

+ 3 - 3
examples/ppm_downscaler/yuv_downscaler.c

@@ -111,7 +111,7 @@ int main(int argc, char **argv)
 	
 	parse_args(argc, argv);
 
-//	fprintf(stderr, "Reading input file ...\n");
+/*	fprintf(stderr, "Reading input file ...\n"); */
 
 	/* how many frames ? */
 	struct stat stbuf;
@@ -120,7 +120,7 @@ int main(int argc, char **argv)
 
 	unsigned nframes = filesize/FRAMESIZE; 
 
-//	fprintf(stderr, "filesize %lx (FRAME SIZE %lx NEW SIZE %lx); nframes %d\n", filesize, FRAMESIZE, NEW_FRAMESIZE, nframes);
+/*	fprintf(stderr, "filesize %lx (FRAME SIZE %lx NEW SIZE %lx); nframes %d\n", filesize, FRAMESIZE, NEW_FRAMESIZE, nframes); */
 	assert((filesize % sizeof(struct yuv_frame)) == 0);
 
 	/* fetch input data */
@@ -134,7 +134,7 @@ int main(int argc, char **argv)
 	FILE *f_out = fopen(filename_out, "w+");
 	assert(f_out);
 
-//	fprintf(stderr, "Alloc output file ...\n");
+/*	fprintf(stderr, "Alloc output file ...\n"); */
 	struct yuv_new_frame *yuv_out_buffer = calloc(nframes, NEW_FRAMESIZE);
 	assert(yuv_out_buffer);
 

+ 1 - 1
examples/spmv/dw_spmv.h

@@ -29,4 +29,4 @@
 
 #include <starpu.h>
 
-#endif // __DW_SPARSE_CG_H__
+#endif /* __DW_SPARSE_CG_H__ */

+ 8 - 8
examples/starpufft/starpufftx1d.c

@@ -166,7 +166,7 @@ STARPUFFT(twist1_1d_kernel_cpu)(void *descr[], void *_args)
 	STARPUFFT(complex) * restrict in = (STARPUFFT(complex) *)STARPU_VECTOR_GET_PTR(descr[0]);
 	STARPUFFT(complex) * restrict twisted1 = (STARPUFFT(complex) *)STARPU_VECTOR_GET_PTR(descr[1]);
 
-	//printf("twist1 %d %g\n", i, (double) cabs(plan->in[i]));
+	/* printf("twist1 %d %g\n", i, (double) cabs(plan->in[i])); */
 
 	for (j = 0; j < n2; j++)
 		twisted1[j] = in[i+j*n1];
@@ -194,7 +194,7 @@ STARPUFFT(fft1_1d_kernel_cpu)(void *descr[], void *_args)
 	_fftw_complex * restrict worker_in1 = (STARPUFFT(complex) *)plan->plans[workerid].in1;
 	_fftw_complex * restrict worker_out1 = (STARPUFFT(complex) *)plan->plans[workerid].out1;
 
-	//printf("fft1 %d %g\n", i, (double) cabs(twisted1[0]));
+	/* printf("fft1 %d %g\n", i, (double) cabs(twisted1[0])); */
 
 	memcpy(worker_in1, twisted1, plan->totsize2 * sizeof(*worker_in1));
 	_FFTW(execute)(plan->plans[workerid].plan1_cpu);
@@ -223,7 +223,7 @@ STARPUFFT(twist2_1d_kernel_cpu)(void *descr[], void *_args)
 
 	STARPUFFT(complex) * restrict twisted2 = (STARPUFFT(complex) *)STARPU_VECTOR_GET_PTR(descr[0]);
 
-	//printf("twist2 %d %g\n", jj, (double) cabs(plan->fft1[jj]));
+	/* printf("twist2 %d %g\n", jj, (double) cabs(plan->fft1[jj])); */
 
 	for (jjj = 0; jjj < n3; jjj++) {
 		int j = jj * n3 + jjj;
@@ -241,7 +241,7 @@ STARPUFFT(fft2_1d_kernel_cpu)(void *descr[], void *_args)
 {
 	struct STARPUFFT(args) *args = _args;
 	STARPUFFT(plan) plan = args->plan;
-	//int jj = args->jj;
+	/* int jj = args->jj; */
 	int workerid = starpu_worker_get_id();
 
 	task_per_worker[workerid]++;
@@ -249,7 +249,7 @@ STARPUFFT(fft2_1d_kernel_cpu)(void *descr[], void *_args)
 	const STARPUFFT(complex) * restrict twisted2 = (STARPUFFT(complex) *)STARPU_VECTOR_GET_PTR(descr[0]);
 	STARPUFFT(complex) * restrict fft2 = (STARPUFFT(complex) *)STARPU_VECTOR_GET_PTR(descr[1]);
 
-	//printf("fft2 %d %g\n", jj, (double) cabs(twisted2[plan->totsize4-1]));
+	/* printf("fft2 %d %g\n", jj, (double) cabs(twisted2[plan->totsize4-1])); */
 
 	_fftw_complex * restrict worker_in2 = (STARPUFFT(complex) *)plan->plans[workerid].in2;
 	_fftw_complex * restrict worker_out2 = (STARPUFFT(complex) *)plan->plans[workerid].out2;
@@ -278,7 +278,7 @@ STARPUFFT(twist3_1d_kernel_cpu)(void *descr[], void *_args)
 
 	const STARPUFFT(complex) * restrict fft2 = (STARPUFFT(complex) *)STARPU_VECTOR_GET_PTR(descr[0]);
 
-	//printf("twist3 %d %g\n", jj, (double) cabs(fft2[0]));
+	/* printf("twist3 %d %g\n", jj, (double) cabs(fft2[0])); */
 
 	for (jjj = 0; jjj < n3; jjj++) {
 		int j = jj * n3 + jjj;
@@ -541,8 +541,8 @@ STARPUFFT(plan_dft_1d)(int n, int sign, unsigned flags)
 		/* Create twist1 task */
 		plan->twist1_tasks[z] = task = starpu_task_create();
 		task->cl = &STARPUFFT(twist1_1d_codelet);
-		//task->buffers[0].handle = to be filled at execution to point
-		//to the application input.
+		/* task->buffers[0].handle = to be filled at execution to point
+		   to the application input. */
 		task->buffers[0].mode = STARPU_R;
 		task->buffers[1].handle = plan->twisted1_handle[z];
 		task->buffers[1].mode = STARPU_W;

+ 8 - 8
examples/starpufft/starpufftx2d.c

@@ -140,7 +140,7 @@ STARPUFFT(twist1_2d_kernel_cpu)(void *descr[], void *_args)
 	STARPUFFT(complex) * restrict in = (STARPUFFT(complex) *)STARPU_VECTOR_GET_PTR(descr[0]);
 	STARPUFFT(complex) * restrict twisted1 = (STARPUFFT(complex) *)STARPU_VECTOR_GET_PTR(descr[1]);
 
-	//printf("twist1 %d %d %g\n", i, j, (double) cabs(plan->in[i+j]));
+	/* printf("twist1 %d %d %g\n", i, j, (double) cabs(plan->in[i+j])); */
 
 	for (k = 0; k < n2; k++)
 		for (l = 0; l < m2; l++)
@@ -169,7 +169,7 @@ STARPUFFT(fft1_2d_kernel_cpu)(void *descr[], void *_args)
 	_fftw_complex * restrict worker_in1 = (STARPUFFT(complex) *)plan->plans[workerid].in1;
 	_fftw_complex * restrict worker_out1 = (STARPUFFT(complex) *)plan->plans[workerid].out1;
 
-	//printf("fft1 %d %d %g\n", i, j, (double) cabs(twisted1[0]));
+	/* printf("fft1 %d %d %g\n", i, j, (double) cabs(twisted1[0])); */
 
 	memcpy(worker_in1, twisted1, plan->totsize2 * sizeof(*worker_in1));
 	_FFTW(execute)(plan->plans[workerid].plan1_cpu);
@@ -198,7 +198,7 @@ STARPUFFT(twist2_2d_kernel_cpu)(void *descr[], void *_args)
 
 	STARPUFFT(complex) * restrict twisted2 = (STARPUFFT(complex) *)STARPU_VECTOR_GET_PTR(descr[0]);
 
-	//printf("twist2 %d %d %g\n", kk, ll, (double) cabs(plan->fft1[kk+ll]));
+	/* printf("twist2 %d %d %g\n", kk, ll, (double) cabs(plan->fft1[kk+ll])); */
 
 	for (kkk = 0; kkk < n3; kkk++) {
 		int k = kk * n3 + kkk;
@@ -218,8 +218,8 @@ STARPUFFT(fft2_2d_kernel_cpu)(void *descr[], void *_args)
 {
 	struct STARPUFFT(args) *args = _args;
 	STARPUFFT(plan) plan = args->plan;
-	//int kk = args->kk;
-	//int ll = args->ll;
+	/* int kk = args->kk; */
+	/* int ll = args->ll; */
 	int workerid = starpu_worker_get_id();
 
 	task_per_worker[workerid]++;
@@ -227,7 +227,7 @@ STARPUFFT(fft2_2d_kernel_cpu)(void *descr[], void *_args)
 	const STARPUFFT(complex) *twisted2 = (STARPUFFT(complex) *)STARPU_VECTOR_GET_PTR(descr[0]);
 	STARPUFFT(complex) *fft2 = (STARPUFFT(complex) *)STARPU_VECTOR_GET_PTR(descr[1]);
 
-	//printf("fft2 %d %d %g\n", kk, ll, (double) cabs(twisted2[plan->totsize4-1]));
+	/* printf("fft2 %d %d %g\n", kk, ll, (double) cabs(twisted2[plan->totsize4-1])); */
 
 	_fftw_complex * restrict worker_in2 = (STARPUFFT(complex) *)plan->plans[workerid].in2;
 	_fftw_complex * restrict worker_out2 = (STARPUFFT(complex) *)plan->plans[workerid].out2;
@@ -259,7 +259,7 @@ STARPUFFT(twist3_2d_kernel_cpu)(void *descr[], void *_args)
 
 	const STARPUFFT(complex) * restrict fft2 = (STARPUFFT(complex) *)STARPU_VECTOR_GET_PTR(descr[0]);
 
-	//printf("twist3 %d %d %g\n", kk, ll, (double) cabs(fft2[0]));
+	/* printf("twist3 %d %d %g\n", kk, ll, (double) cabs(fft2[0])); */
 
 	for (kkk = 0; kkk < n3; kkk++) {
 		int k = kk * n3 + kkk;
@@ -530,7 +530,7 @@ STARPUFFT(plan_dft_2d)(int n, int m, int sign, unsigned flags)
 		/* Create twist1 task */
 		plan->twist1_tasks[z] = task = starpu_task_create();
 		task->cl = &STARPUFFT(twist1_2d_codelet);
-		//task->buffers[0].handle = to be filled at execution
+		/* task->buffers[0].handle = to be filled at execution */
 		task->buffers[0].mode = STARPU_R;
 		task->buffers[1].handle = plan->twisted1_handle[z];
 		task->buffers[1].mode = STARPU_W;

+ 1 - 1
examples/stencil/life_opencl.c

@@ -16,7 +16,7 @@
 
 /* Heart of the stencil computation: compute a new state from an old one. */
 
-//#define _externC extern "C"
+/* #define _externC extern "C" */
 
 #include <stencil.h>
 #include <CL/cl.h>

+ 4 - 4
examples/stencil/stencil-blocks.c

@@ -168,7 +168,7 @@ void assign_blocks_to_workers(int rank)
 	/* NB: perhaps we could count a GPU as multiple workers */
 
 	/* how many workers are there ? */
-	//unsigned nworkers = starpu_worker_get_count();
+	/*unsigned nworkers = starpu_worker_get_count();*/
 
 	/* how many blocks are on that MPI node ? */
 	unsigned nblocks = 0;
@@ -182,7 +182,7 @@ void assign_blocks_to_workers(int rank)
 	}
 
 	/* how many blocks per worker ? */
-	//	unsigned nblocks_per_worker = (nblocks + nworkers - 1)/nworkers;
+	/*unsigned nblocks_per_worker = (nblocks + nworkers - 1)/nworkers;*/
 
 	/* we now attribute up to nblocks_per_worker blocks per workers */
 	unsigned attributed = 0;
@@ -215,7 +215,7 @@ void assign_blocks_to_workers(int rank)
 			/* Only GPUS */
 			workerid = (attributed / 21) % 3;
 		#endif
-			//= attributed/nblocks_per_worker;
+			/*= attributed/nblocks_per_worker;*/
 
 			block->preferred_worker = workerid;
 
@@ -294,7 +294,7 @@ void allocate_memory_on_node(int rank)
 					for (z = 0; z < size_bz; z++)
 						/* Just random data */
 						sum += block->layers[0][(K+x)+(K+y)*(sizex + 2*K)+(K+z)*(sizex+2*K)*(sizey+2*K)] = (int)((x/7.+y/13.+(bz*size_bz + z)/17.) * 10.) % 2;
-//			printf("block %d starts with %d/%d alive\n", bz, sum, sizex*sizey*size_bz);
+/*			printf("block %d starts with %d/%d alive\n", bz, sum, sizex*sizey*size_bz);*/
 #endif
 			allocate_block_on_node(&block->layers_handle[1], &block->layers[1],
 						(sizex + 2*K), (sizey + 2*K), (size_bz + 2*K));

+ 8 - 8
examples/stencil/stencil-tasks.c

@@ -125,7 +125,7 @@ static void create_task_save_mpi_recv(unsigned iter, unsigned z, int dir, unsign
 	starpu_mpi_irecv_detached(handle0, source, MPI_TAG0(z, iter, dir), MPI_COMM_WORLD, recv_done, (void*)(uintptr_t)z);
 	starpu_mpi_irecv_detached(handle1, source, MPI_TAG1(z, iter, dir), MPI_COMM_WORLD, recv_done, (void*)(uintptr_t)z);
 }
-#endif // STARPU_USE_MPI
+#endif /* STARPU_USE_MPI */
 
 /*
  * Schedule saving boundaries of blocks to communication buffers
@@ -141,26 +141,26 @@ void create_task_save(unsigned iter, unsigned z, int dir, unsigned local_rank)
 		/* Save data from update */
 		create_task_save_local(iter, z, dir, local_rank);
 		if (node_z_and_d != local_rank)
-		{ // R(z) = local & R(z+d) != local, We have to send the data
+		{ /* R(z) = local & R(z+d) != local, We have to send the data */
 			create_task_save_mpi_send(iter, z, dir, local_rank);
 		}
 
 	}
-	else {	// node_z != local_rank, this MPI node doesn't have the saved data
+	else {	/* node_z != local_rank, this MPI node doesn't have the saved data */
 		if (node_z_and_d == local_rank)
 		{
 			create_task_save_mpi_recv(iter, z, dir, local_rank);
 		}
-		else {  // R(z) != local & R(z+d) != local We don't have
-			// the saved data and don't need it, we shouldn't
-			// even have been called!
+		else { /* R(z) != local & R(z+d) != local We don't have
+			      the saved data and don't need it, we shouldn't
+			      even have been called! */
 			STARPU_ASSERT(0);
 		}
 	}
-#else // !STARPU_USE_MPI
+#else /* !STARPU_USE_MPI */
 	STARPU_ASSERT((node_z == local_rank) && (node_z_and_d == local_rank));
 	create_task_save_local(iter, z, dir, local_rank);
-#endif // STARPU_USE_MPI
+#endif /* STARPU_USE_MPI */
 }
 
 /*

+ 1 - 1
examples/stencil/stencil.c

@@ -230,7 +230,7 @@ int main(int argc, char **argv)
 	check(rank);
 #endif
 
-	//display_debug(nbz, niter, rank);
+	/*display_debug(nbz, niter, rank);*/
 
 #ifdef STARPU_USE_MPI
 	starpu_mpi_shutdown();

+ 1 - 1
examples/stencil/stencil.h

@@ -137,4 +137,4 @@ extern struct timeval *last_tick;
 _externC void cuda_life_update_host(int bz, const TYPE *old, TYPE *newp, int nx, int ny, int nz, int ldy, int ldz, int iter);
 _externC void cuda_shadow_host(int bz, TYPE *ptr, int nx, int ny, int nz, int ldy, int ldz, int i);
 
-#endif // __STENCIL_H__
+#endif /* __STENCIL_H__ */

+ 5 - 5
examples/tag_example/tag_example.c

@@ -85,7 +85,7 @@ static void create_task_grid(unsigned iter)
 {
 	unsigned i, j;
 
-//	FPRINTF(stderr, "start iter %d...\n", iter);
+/*	FPRINTF(stderr, "start iter %d...\n", iter); */
 	callback_cnt = (ni*nj);
 
 	/* create non-entry tasks */
@@ -95,16 +95,16 @@ static void create_task_grid(unsigned iter)
 		/* create a new task */
 		struct starpu_task *task = starpu_task_create();
 		task->callback_func = callback_cpu;
-		//jb->argcb = &coords[i][j];
+		/* jb->argcb = &coords[i][j]; */
 		task->cl = &cl;
 		task->cl_arg = NULL;
 
 		task->use_tag = 1;
 		task->tag_id = TAG(i, j, iter);
 
-		/* express deps : (i,j) depends on (i-1, j-1) & (i-1, j+1) */		
+		/* express deps : (i,j) depends on (i-1, j-1) & (i-1, j+1) */
 		express_deps(i, j, iter);
-		
+
 		starpu_task_submit(task);
 	}
 
@@ -148,7 +148,7 @@ void callback_cpu(void *argcb __attribute__ ((unused)))
 void cpu_codelet(void *descr[] __attribute__((unused)),
 			void *_args __attribute__ ((unused)))
 {
-//	printf("execute task\n");
+/*	printf("execute task\n"); */
 }
 
 static void express_deps(unsigned i, unsigned j, unsigned iter)

+ 1 - 1
examples/tag_example/tag_example2.c

@@ -70,7 +70,7 @@ static void create_task_grid(unsigned it)
 {
 	unsigned i;
 
-//	FPRINTF(stderr, "start iter %d ni %d...\n", it, ni);
+/*	FPRINTF(stderr, "start iter %d ni %d...\n", it, ni); */
 
 	for (i = 0; i < ni; i++)
 	{

+ 1 - 1
examples/tag_example/tag_example3.c

@@ -76,7 +76,7 @@ static void create_task_grid(unsigned iter)
 {
 	int i;
 
-//	FPRINTF(stderr, "start iter %d ni %d...\n", iter, ni);
+/*	FPRINTF(stderr, "start iter %d ni %d...\n", iter, ni); */
 
 	callback_cnt = (ni);
 

+ 6 - 5
examples/tag_example/tag_restartable.c

@@ -98,7 +98,7 @@ static void start_task_grid(unsigned iter)
 {
 	unsigned i;
 
-	//FPRINTF(stderr, "start grid %d ni %d...\n", iter, ni);
+	/* FPRINTF(stderr, "start grid %d ni %d...\n", iter, ni); */
 
 	for (i = 0; i < ni; i++)
 		starpu_task_submit(tasks[iter][i]);
@@ -106,10 +106,11 @@ static void start_task_grid(unsigned iter)
 
 void cpu_codelet(void *descr[], void *_args __attribute__((unused)))
 {
-	//int i = (uintptr_t) _args;
-	//printf("doing %x\n", i);
-	//usleep(SLEEP);
-	//printf("done %x\n", i);
+/*	int i = (uintptr_t) _args;
+	printf("doing %x\n", i);
+	usleep(SLEEP);
+	printf("done %x\n", i);
+*/
 }
 
 int main(int argc __attribute__((unused)) , char **argv __attribute__((unused)))