Forráskód Böngészése

examples: check return values of starpu functions

Nathalie Furmento 13 éve
szülő
commit
4e84b0ce42

+ 4 - 2
examples/audio/starpu_audio_processing.c

@@ -2,7 +2,7 @@
  *
  * Copyright (C) 2010-2011  Université de Bordeaux 1
  * Copyright (C) 2010  Mehdi Juhoor <mjuhoor@gmail.com>
- * Copyright (C) 2010, 2011  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -390,6 +390,7 @@ static void parse_args(int argc, char **argv)
 int main(int argc, char **argv)
 {
 	unsigned iter;
+	int ret;
 
 	parse_args(argc, argv);
 
@@ -402,7 +403,8 @@ int main(int argc, char **argv)
 	fprintf(stderr, "input: %s\noutput: %s\n#chunks %d\n", inputfilename, outputfilename, niter);
 
 	/* launch StarPU */
-	starpu_init(NULL);
+	ret = starpu_init(NULL);
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
 	starpu_vector_data_register(&A_handle, 0, (uintptr_t)A, niter*nsamples, sizeof(float));
 

+ 4 - 1
examples/axpy/axpy.c

@@ -88,8 +88,11 @@ static struct starpu_codelet axpy_cl =
 
 int main(int argc, char **argv)
 {
+	int ret;
+
 	/* Initialize StarPU */
-	starpu_init(NULL);
+	ret = starpu_init(NULL);
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
 	starpu_helper_cublas_init();
 

+ 4 - 1
examples/basic_examples/mult.c

@@ -335,8 +335,11 @@ static void launch_tasks(void)
 int main(__attribute__ ((unused)) int argc, 
 	 __attribute__ ((unused)) char **argv)
 {
+	int ret;
+
 	/* start the runtime */
-	starpu_init(NULL);
+	ret = starpu_init(NULL);
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
 	/* initialize matrices A, B and C and register them to StarPU */
 	init_problem_data();

+ 5 - 2
examples/callback/callback.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009, 2010  Université de Bordeaux 1
- * Copyright (C) 2010, 2011  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -49,8 +49,11 @@ void callback_func(void *callback_arg)
 int main(int argc, char **argv)
 {
 	int v=40;
+	int ret;
+
+	ret = starpu_init(NULL);
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
-	starpu_init(NULL);
 	starpu_variable_data_register(&handle, 0, (uintptr_t)&v, sizeof(int));
 
 	struct starpu_task *task = starpu_task_create();

+ 3 - 1
examples/cg/cg.c

@@ -384,7 +384,9 @@ int main(int argc, char **argv)
 
 	parse_args(argc, argv);
 
-	starpu_init(NULL);
+	ret = starpu_init(NULL);
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
+
 	starpu_helper_cublas_init();
 
 	generate_random_problem();

+ 5 - 2
examples/cholesky/cholesky_grain_tag.c

@@ -2,7 +2,7 @@
  *
  * Copyright (C) 2009, 2010, 2011  Université de Bordeaux 1
  * Copyright (C) 2010  Mehdi Juhoor <mjuhoor@gmail.com>
- * Copyright (C) 2010, 2011  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -262,7 +262,10 @@ static void cholesky_grain_rec(float *matA, unsigned size, unsigned ld, unsigned
 
 static void initialize_system(float **A, unsigned dim, unsigned pinned)
 {
-	starpu_init(NULL);
+	int ret;
+
+	ret = starpu_init(NULL);
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
 	starpu_helper_cublas_init();
 

+ 4 - 1
examples/cholesky/cholesky_implicit.c

@@ -177,6 +177,8 @@ static void cholesky(float *matA, unsigned size, unsigned ld, unsigned nblocks)
 
 int main(int argc, char **argv)
 {
+	int ret;
+
 	/* create a simple definite positive symetric matrix example
 	 *
 	 *	Hilbert matrix : h(i,j) = 1/(i+j+1)
@@ -184,7 +186,8 @@ int main(int argc, char **argv)
 
 	parse_args(argc, argv);
 
-	starpu_init(NULL);
+	ret = starpu_init(NULL);
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
 	starpu_helper_cublas_init();
 

+ 6 - 3
examples/cholesky/cholesky_tag.c

@@ -2,7 +2,7 @@
  *
  * Copyright (C) 2009, 2010, 2011  Université de Bordeaux 1
  * Copyright (C) 2010  Mehdi Juhoor <mjuhoor@gmail.com>
- * Copyright (C) 2010, 2011  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -245,8 +245,11 @@ static void _cholesky(starpu_data_handle_t dataA, unsigned nblocks)
 
 static void initialize_system(float **A, unsigned dim, unsigned pinned)
 {
-	starpu_init(NULL);
-	
+	int ret;
+
+	ret = starpu_init(NULL);
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
+
 	starpu_helper_cublas_init();
 
 	if (pinned)

+ 4 - 2
examples/cholesky/cholesky_tile_tag.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009, 2010, 2011  Université de Bordeaux 1
- * Copyright (C) 2010, 2011  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -241,13 +241,15 @@ int main(int argc, char **argv)
 {
 	unsigned x, y;
 	unsigned i, j;
+	int ret;
 
 	parse_args(argc, argv);
 	assert(nblocks <= NMAXBLOCKS);
 
 	FPRINTF(stderr, "BLOCK SIZE = %d\n", size / nblocks);
 
-	starpu_init(NULL);
+	ret = starpu_init(NULL);
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
 	/* Disable sequential consistency */
 	starpu_data_set_default_sequential_consistency_flag(0);

+ 6 - 2
examples/filters/fblock.c

@@ -74,6 +74,7 @@ int main(int argc, char **argv)
 {
         int *block,n=0;
         int i, j, k;
+	int ret;
 
         block = (int*)malloc(NX*NY*NZ*sizeof(block[0]));
         assert(block);
@@ -102,10 +103,13 @@ int main(int argc, char **argv)
 		.nbuffers = 1,
                 .modes = {STARPU_RW}
 	};
-        starpu_init(NULL);
+
+        ret = starpu_init(NULL);
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
 #ifdef STARPU_USE_OPENCL
-        starpu_opencl_load_opencl_from_file("examples/filters/fblock_opencl_kernel.cl", &opencl_program, NULL);
+        ret = starpu_opencl_load_opencl_from_file("examples/filters/fblock_opencl_kernel.cl", &opencl_program, NULL);
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_opencl_load_opencl_from_file");
 #endif
 
         /* Declare data to StarPU */

+ 4 - 1
examples/filters/fmatrix.c

@@ -45,6 +45,7 @@ int main(int argc, char **argv)
 {
 	unsigned i, j, n=1;
         int matrix[NX*NY];
+	int ret;
 
         FPRINTF(stderr,"IN  Matrix: \n");
         for(j=0 ; j<NY ; j++)
@@ -66,7 +67,9 @@ int main(int argc, char **argv)
                 .nbuffers = 1,
 		.modes = {STARPU_RW}
         };
-        starpu_init(NULL);
+
+        ret = starpu_init(NULL);
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
 	/* Declare data to StarPU */
 	starpu_matrix_data_register(&handle, 0, (uintptr_t)matrix, NX, NX, NY, sizeof(matrix[0]));

+ 3 - 1
examples/filters/fvector.c

@@ -41,6 +41,7 @@ int main(int argc, char **argv)
         int vector[NX];
         starpu_data_handle_t handle;
         int factor=1;
+	int ret;
 
         struct starpu_codelet cl =
 	{
@@ -55,7 +56,8 @@ int main(int argc, char **argv)
         for(i=0 ; i<NX ; i++) FPRINTF(stderr, "%5d ", vector[i]);
         FPRINTF(stderr,"\n");
 
-	starpu_init(NULL);
+	ret = starpu_init(NULL);
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
 	/* Declare data to StarPU */
 	starpu_vector_data_register(&handle, 0, (uintptr_t)vector, NX, sizeof(vector[0]));

+ 4 - 1
examples/heat/dw_factolu.c

@@ -673,7 +673,10 @@ void dw_codelet_facto_v2(starpu_data_handle_t dataA, unsigned nblocks)
 
 void initialize_system(float **A, float **B, unsigned dim, unsigned pinned)
 {
-	starpu_init(NULL);
+	int ret;
+
+	ret = starpu_init(NULL);
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
 	starpu_helper_cublas_init();
 

+ 4 - 1
examples/heat/dw_sparse_cg.c

@@ -411,7 +411,10 @@ void do_conjugate_gradient(float *nzvalA, float *vecb, float *vecx, uint32_t nnz
 			unsigned nrow, uint32_t *colind, uint32_t *rowptr)
 {
 	/* start the runtime */
-	starpu_init(NULL);
+	int ret;
+
+	ret = starpu_init(NULL);
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
 	starpu_helper_cublas_init();
 

+ 4 - 2
examples/incrementer/incrementer.c

@@ -43,7 +43,8 @@ int main(int argc, char **argv)
 {
 	int ret = 0;
 
-	starpu_init(NULL);
+	ret = starpu_init(NULL);
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
 #ifdef STARPU_SLOW_MACHINE
 	niter /= 100;
@@ -58,7 +59,8 @@ int main(int argc, char **argv)
 			(uintptr_t)&float_array, 4, sizeof(float));
 
 #ifdef STARPU_USE_OPENCL
-        starpu_opencl_load_opencl_from_file("examples/incrementer/incrementer_kernels_opencl_kernel.cl", &opencl_program, NULL);
+        ret = starpu_opencl_load_opencl_from_file("examples/incrementer/incrementer_kernels_opencl_kernel.cl", &opencl_program, NULL);
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_opencl_load_opencl_from_file");
 #endif
 
 	struct starpu_codelet cl =

+ 5 - 2
examples/lu/lu_example.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009, 2010-2011  Université de Bordeaux 1
- * Copyright (C) 2010, 2011  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -289,9 +289,12 @@ static void check_result(void)
 
 int main(int argc, char **argv)
 {
+	int ret;
+
 	parse_args(argc, argv);
 
-	starpu_init(NULL);
+	ret = starpu_init(NULL);
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
 	starpu_helper_cublas_init();
 

+ 5 - 2
examples/mandelbrot/mandelbrot.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010, 2011  Université de Bordeaux 1
- * Copyright (C) 2010, 2011  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -470,6 +470,8 @@ static void parse_args(int argc, char **argv)
 
 int main(int argc, char **argv)
 {
+	int ret;
+
 	parse_args(argc, argv);
 
 	/* We don't use CUDA in that example */
@@ -480,7 +482,8 @@ int main(int argc, char **argv)
 	if (use_spmd)
 		conf.sched_policy_name = "pgreedy";
 
-	starpu_init(&conf);
+	ret = starpu_init(&conf);
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
 	unsigned *buffer;
 	starpu_malloc((void **)&buffer, height*width*sizeof(unsigned));

+ 2 - 1
examples/matvecmult/matvecmult.c

@@ -176,7 +176,8 @@ int main(int argc, char **argv)
 	starpu_vector_data_register(&mult_handle, 0, (uintptr_t)mult, height, sizeof(float));
 
 #ifdef STARPU_USE_OPENCL
-        starpu_opencl_load_opencl_from_file("examples/matvecmult/matvecmult_kernel.cl", &opencl_code, NULL);
+        ret = starpu_opencl_load_opencl_from_file("examples/matvecmult/matvecmult_kernel.cl", &opencl_code, NULL);
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_opencl_load_opencl_from_file");
 #endif
 
 	cl.where = STARPU_OPENCL;

+ 4 - 1
examples/mult/xgemm.c

@@ -271,10 +271,13 @@ int main(int argc, char **argv)
 {
 	struct timeval start;
 	struct timeval end;
+	int ret;
 
 	parse_args(argc, argv);
 
-	starpu_init(NULL);
+	ret = ret = starpu_init(NULL);
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
+
 	starpu_helper_cublas_init();
 
 	init_problem_data();

+ 5 - 2
examples/openmp/vector_scal.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2010, 2011  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
  * Copyright (C) 2010, 2011  Université de Bordeaux 1
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -65,6 +65,8 @@ int main(int argc, char **argv)
 	struct starpu_conf conf;
 	float vector[NX];
 	unsigned i;
+	int ret;
+
 	for (i = 0; i < NX; i++)
                 vector[i] = (i+1.0f);
 
@@ -77,7 +79,8 @@ int main(int argc, char **argv)
 	 * sections, so only create one big worker */
 	conf.single_combined_worker = 1;
 
-	starpu_init(&conf);
+	ret = starpu_init(&conf);
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
 	starpu_data_handle_t vector_handle;
 	starpu_vector_data_register(&vector_handle, 0, (uintptr_t)vector, NX, sizeof(vector[0]));

+ 3 - 1
examples/opt/pi/pi.c

@@ -83,10 +83,12 @@ static void parse_args(int argc, char **argv)
 int main(int argc, char **argv)
 {
 	unsigned i;
+	int ret;
 
 	parse_args(argc, argv);
 
-	starpu_init(NULL);
+	ret = starpu_init(NULL);
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
 	/* Initialize the random number generator */
 	unsigned *sobol_qrng_directions = malloc(n_dimensions*n_directions*sizeof(unsigned));

+ 3 - 1
examples/opt/pi/pi_redux.c

@@ -314,10 +314,12 @@ static struct starpu_codelet redux_codelet =
 int main(int argc, char **argv)
 {
 	unsigned i;
+	int ret;
 
 	parse_args(argc, argv);
 
-	starpu_init(NULL);
+	ret = starpu_init(NULL);
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
 	/* Launch a Random Number Generator (RNG) on each worker */
 	starpu_execute_on_each_worker(init_rng, NULL, STARPU_CPU|STARPU_CUDA);

+ 4 - 1
examples/ppm_downscaler/yuv_downscaler.c

@@ -108,6 +108,8 @@ static struct starpu_data_filter filter_uv =
 
 int main(int argc, char **argv)
 {
+	int ret;
+
 	assert(HEIGHT % (2*BLOCK_HEIGHT) == 0);
 	assert(HEIGHT % FACTOR == 0);
 	
@@ -150,7 +152,8 @@ int main(int argc, char **argv)
 	starpu_data_handle_t *new_frame_u_handle = (starpu_data_handle_t *)  calloc(nframes, sizeof(starpu_data_handle_t));
 	starpu_data_handle_t *new_frame_v_handle = (starpu_data_handle_t *)  calloc(nframes, sizeof(starpu_data_handle_t));
 
-	starpu_init(NULL);
+	ret = starpu_init(NULL);
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
 	/* register and partition all layers */
 	unsigned frame;

+ 5 - 2
examples/profiling/profiling.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010, 2011  Université de Bordeaux 1
- * Copyright (C) 2010, 2011  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -32,10 +32,13 @@ void sleep_codelet(__attribute__ ((unused)) void *descr[],
 
 int main(int argc, char **argv)
 {
+	int ret;
+
 	if (argc == 2)
 		niter = atoi(argv[1]);
 
-	starpu_init(NULL);
+	ret = starpu_init(NULL);
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
 	/* Enable profiling */
 	starpu_profiling_status_set(STARPU_PROFILING_ENABLE);

+ 4 - 1
examples/reductions/dot_product.c

@@ -181,7 +181,10 @@ static struct starpu_codelet dot_codelet =
 
 int main(int argc, char **argv)
 {
-	starpu_init(NULL);
+	int ret;
+
+	ret = starpu_init(NULL);
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
 	starpu_helper_cublas_init();
 

+ 3 - 1
examples/reductions/minmax_reduction.c

@@ -127,8 +127,10 @@ static struct starpu_codelet minmax_codelet =
 int main(int argc, char **argv)
 {
 	unsigned long i;
+	int ret;
 
-	starpu_init(NULL);
+	ret = starpu_init(NULL);
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
 	unsigned long nelems = nblocks*entries_per_bock;
 	size_t size = nelems*sizeof(TYPE);

+ 4 - 2
examples/scheduler/dummy_sched.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010-2011  Université de Bordeaux 1
- * Copyright (C) 2010-2011  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010-2012  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -121,8 +121,10 @@ static struct starpu_codelet dummy_codelet =
 int main(int argc, char **argv)
 {
 	int ntasks = NTASKS;
+	int ret;
 
-	starpu_init(&conf);
+	ret = starpu_init(&conf);
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
 #ifdef STARPU_SLOW_MACHINE
 	ntasks /= 100;

+ 4 - 1
examples/spmv/dw_block_spmv.c

@@ -274,6 +274,8 @@ void print_results(void)
 int main(__attribute__ ((unused)) int argc,
 	__attribute__ ((unused)) char **argv)
 {
+	int ret;
+
 	if (argc < 2)
 	{
 		FPRINTF(stderr, "usage : %s filename [tile size]\n", argv[0]);
@@ -291,7 +293,8 @@ int main(__attribute__ ((unused)) int argc,
 	inputfile = argv[1];
 
 	/* start the runtime */
-	starpu_init(NULL);
+	ret = starpu_init(NULL);
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
 	sem_init(&sem, 0, 0U);
 

+ 2 - 1
examples/spmv/spmv.c

@@ -135,7 +135,8 @@ int main(int argc, char **argv)
 	/*
 	 *	Launch StarPU
 	 */
-	starpu_init(NULL);
+	ret = starpu_init(NULL);
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
 	/*
 	 *	Create a 3-band sparse matrix as input example

+ 4 - 3
examples/starpufft/testx.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009, 2010-2011  Université de Bordeaux 1
- * Copyright (C) 2010, 2011  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -103,7 +103,7 @@ static void check_cuda(STARPUFFT(complex) *out, STARPUFFT(complex) *out_fftw, in
 
 int main(int argc, char *argv[])
 {
-	int i;
+	int i, ret;
 	struct timeval begin, end;
 	int size;
 	size_t bytes;
@@ -125,7 +125,8 @@ int main(int argc, char *argv[])
 		exit(EXIT_FAILURE);
 	}
 
-	starpu_init(NULL);
+	ret = starpu_init(NULL);
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
 	if (argc == 2)
 	{

+ 4 - 2
examples/stencil/stencil.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2010, 2011  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
  * Copyright (C) 2010-2011  Université de Bordeaux 1
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -190,6 +190,7 @@ int main(int argc, char **argv)
 {
 	int rank;
 	int world_size;
+	int ret;
 
 #ifdef STARPU_USE_MPI
 	int thread_support;
@@ -214,7 +215,8 @@ int main(int argc, char **argv)
 		fflush(stderr);
 	}
 
-	starpu_init(NULL);
+	ret = starpu_init(NULL);
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
 #ifdef STARPU_USE_MPI
 	starpu_mpi_initialize();

+ 5 - 2
examples/tag_example/tag_example.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009, 2010  Université de Bordeaux 1
- * Copyright (C) 2010, 2011  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -190,7 +190,10 @@ static void express_deps(unsigned i, unsigned j, unsigned iter)
 
 int main(int argc __attribute__((unused)) , char **argv __attribute__((unused)))
 {
-	starpu_init(NULL);
+	int ret;
+
+	ret = starpu_init(NULL);
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
 #ifdef STARPU_USE_GORDON
 	/* load an empty kernel and get its identifier */

+ 4 - 2
examples/tag_example/tag_example2.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009, 2010  Université de Bordeaux 1
- * Copyright (C) 2010, 2011  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -103,8 +103,10 @@ void cpu_codelet(void *descr[] __attribute__ ((unused)),
 int main(int argc __attribute__((unused)) , char **argv __attribute__((unused)))
 {
 	unsigned i;
+	int ret;
 
-	starpu_init(NULL);
+	ret = starpu_init(NULL);
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
 #ifdef STARPU_USE_GORDON
 	/* load an empty kernel and get its identifier */

+ 4 - 2
examples/tag_example/tag_example3.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009, 2010  Université de Bordeaux 1
- * Copyright (C) 2010, 2011  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -107,8 +107,10 @@ void cpu_codelet(void *descr[], void *_args __attribute__ ((unused)))
 int main(int argc __attribute__((unused)) , char **argv __attribute__((unused)))
 {
 	unsigned i;
+	int ret;
 
-	starpu_init(NULL);
+	ret = starpu_init(NULL);
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
 #ifdef STARPU_USE_GORDON
 	/* load an empty kernel and get its identifier */

+ 4 - 2
examples/tag_example/tag_restartable.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009, 2010  Université de Bordeaux 1
- * Copyright (C) 2010, 2011  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -117,8 +117,10 @@ void cpu_codelet(void *descr[], void *_args __attribute__((unused)))
 int main(int argc __attribute__((unused)) , char **argv __attribute__((unused)))
 {
 	unsigned i;
+	int ret;
 
-	starpu_init(NULL);
+	ret = starpu_init(NULL);
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
 #ifdef STARPU_USE_GORDON
 	/* load an empty kernel and get its identifier */

+ 5 - 3
examples/top/hello_world_top.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010  Université de Bordeaux 1
- * Copyright (C) 2010, 2011  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -110,12 +110,14 @@ struct starpu_codelet cl =
 
 int main(int argc, char **argv)
 {
+	int ret;
+
 	srand ( time(NULL) );
 	/* initialize StarPU : passing a NULL argument means that we use
  	* default configuration for the scheduling policies and the number of
 	* processors/accelerators */
-	starpu_init(NULL);
-
+	ret = starpu_init(NULL);
+	STARPU_CHECK_RETURN_VALUE(ret, "starpu_init");
 
 	/*init starpu_top*/
 	struct starpu_top_data * loop_count =