Преглед изворни кода

mpi/tests: FPRINTF takes file descripor as parameter

Nathalie Furmento пре 10 година
родитељ
комит
592f72fbab

+ 4 - 4
mpi/tests/callback.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2013, 2014  Centre National de la Recherche Scientifique
+ * Copyright (C) 2013, 2014, 2015  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
@@ -24,7 +24,7 @@ int expected_y=12;
 
 void my_func(STARPU_ATTRIBUTE_UNUSED void *descr[], STARPU_ATTRIBUTE_UNUSED void *_args)
 {
-	FPRINTF_MPI("i am here\n");
+	FPRINTF_MPI(stderr, "i am here\n");
 }
 
 struct starpu_codelet my_codelet =
@@ -38,7 +38,7 @@ static
 void callback(void *ptr)
 {
 	int *x = (int *)ptr;
-	FPRINTF_MPI("x=%d\n", *x);
+	FPRINTF_MPI(stderr, "x=%d\n", *x);
 	STARPU_ASSERT_MSG(*x == expected_x, "%d != %d\n", *x, expected_x);
 	(*x)++;
 }
@@ -47,7 +47,7 @@ static
 void prologue_callback(void *ptr)
 {
 	int *y = (int *)ptr;
-	FPRINTF_MPI("y=%d\n", *y);
+	FPRINTF_MPI(stderr, "y=%d\n", *y);
 	STARPU_ASSERT_MSG(*y == expected_y, "%d != %d\n", *y, expected_y);
 	(*y)++;
 }

+ 10 - 10
mpi/tests/datatypes.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2013, 2014  Centre National de la Recherche Scientifique
+ * Copyright (C) 2013, 2014, 2015  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -22,7 +22,7 @@ typedef void (*check_func)(starpu_data_handle_t handle_s, starpu_data_handle_t h
 
 void check_void(starpu_data_handle_t handle_s, starpu_data_handle_t handle_r, int *error)
 {
-	FPRINTF_MPI("Success with void value\n");
+	FPRINTF_MPI(stderr, "Success with void value\n");
 }
 
 void check_variable(starpu_data_handle_t handle_s, starpu_data_handle_t handle_r, int *error)
@@ -37,12 +37,12 @@ void check_variable(starpu_data_handle_t handle_s, starpu_data_handle_t handle_r
 
 	if (*v_s == *v_r)
 	{
-		FPRINTF_MPI("Success with variable value: %f == %f\n", *v_s, *v_r);
+		FPRINTF_MPI(stderr, "Success with variable value: %f == %f\n", *v_s, *v_r);
 	}
 	else
 	{
 		*error = 1;
-		FPRINTF_MPI("Error with variable value: %f != %f\n", *v_s, *v_r);
+		FPRINTF_MPI(stderr, "Error with variable value: %f != %f\n", *v_s, *v_r);
 	}
 }
 
@@ -63,12 +63,12 @@ void check_vector(starpu_data_handle_t handle_s, starpu_data_handle_t handle_r,
 	{
 		if (v_s[i] == v_r[i])
 		{
-			FPRINTF_MPI("Success with vector[%d] value: %d == %d\n", i, v_s[i], v_r[i]);
+			FPRINTF_MPI(stderr, "Success with vector[%d] value: %d == %d\n", i, v_s[i], v_r[i]);
 		}
 		else
 		{
 			*error = 1;
-			FPRINTF_MPI("Error with vector[%d] value: %d != %d\n", i, v_s[i], v_r[i]);
+			FPRINTF_MPI(stderr, "Error with vector[%d] value: %d != %d\n", i, v_s[i], v_r[i]);
 		}
 	}
 }
@@ -95,12 +95,12 @@ void check_matrix(starpu_data_handle_t handle_s, starpu_data_handle_t handle_r,
 			int index=(y*ldy)+x;
 			if (matrix_s[index] == matrix_r[index])
 			{
-				FPRINTF_MPI("Success with matrix[%d,%d --> %d] value: %c == %c\n", x, y, index, matrix_s[index], matrix_r[index]);
+				FPRINTF_MPI(stderr, "Success with matrix[%d,%d --> %d] value: %c == %c\n", x, y, index, matrix_s[index], matrix_r[index]);
 			}
 			else
 			{
 				*error = 1;
-				FPRINTF_MPI("Error with matrix[%d,%d --> %d] value: %c != %c\n", x, y, index, matrix_s[index], matrix_r[index]);
+				FPRINTF_MPI(stderr, "Error with matrix[%d,%d --> %d] value: %c != %c\n", x, y, index, matrix_s[index], matrix_r[index]);
 			}
 		}
 }
@@ -133,12 +133,12 @@ void check_block(starpu_data_handle_t handle_s, starpu_data_handle_t handle_r, i
 				int index=(z*ldz)+(y*ldy)+x;
 				if (block_s[index] == block_r[index])
 				{
-					FPRINTF_MPI("Success with block[%d,%d,%d --> %d] value: %f == %f\n", x, y, z, index, block_s[index], block_r[index]);
+					FPRINTF_MPI(stderr, "Success with block[%d,%d,%d --> %d] value: %f == %f\n", x, y, z, index, block_s[index], block_r[index]);
 				}
 				else
 				{
 					*error = 1;
-					FPRINTF_MPI("Error with block[%d,%d,%d --> %d] value: %f != %f\n", x, y, z, index, block_s[index], block_r[index]);
+					FPRINTF_MPI(stderr, "Error with block[%d,%d,%d --> %d] value: %f != %f\n", x, y, z, index, block_s[index], block_r[index]);
 				}
 			}
 }

+ 4 - 4
mpi/tests/gather.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2013  Centre National de la Recherche Scientifique
+ * Copyright (C) 2013, 2015  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
@@ -48,19 +48,19 @@ int main(int argc, char **argv)
 		{
 			MPI_Status status;
 
-			FPRINTF_MPI("receiving from node %d\n", n);
+			FPRINTF_MPI(stderr, "receiving from node %d\n", n);
 			starpu_variable_data_register(&handle, STARPU_MAIN_RAM, (uintptr_t)&var, sizeof(var));
 			starpu_mpi_recv(handle, n, 42, MPI_COMM_WORLD, &status);
 			starpu_data_acquire(handle, STARPU_R);
 			STARPU_ASSERT_MSG(var == n, "Received incorrect value <%d> from node <%d>\n", var, n);
-			FPRINTF_MPI("received <%d> from node %d\n", var, n);
+			FPRINTF_MPI(stderr, "received <%d> from node %d\n", var, n);
 			starpu_data_release(handle);
 			starpu_data_unregister(handle);
 		}
 	}
 	else
 	{
-		FPRINTF_MPI("sending to node %d\n", 0);
+		FPRINTF_MPI(stderr, "sending to node %d\n", 0);
 		var = rank;
 		starpu_variable_data_register(&handle, STARPU_MAIN_RAM, (uintptr_t)&var, sizeof(var));
 		starpu_mpi_send(handle, 0, 42, MPI_COMM_WORLD);

+ 5 - 5
mpi/tests/gather2.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2013  Centre National de la Recherche Scientifique
+ * Copyright (C) 2013, 2015  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
@@ -48,14 +48,14 @@ int main(int argc, char **argv)
 			MPI_Status status[3];
 			starpu_data_handle_t handle[2];
 
-			FPRINTF_MPI("receiving from node %d\n", n);
+			FPRINTF_MPI(stderr, "receiving from node %d\n", n);
 			for(i=0 ; i<2 ; i++)
 				starpu_variable_data_register(&handle[i], STARPU_MAIN_RAM, (uintptr_t)&var[i], sizeof(var[i]));
 
 			starpu_mpi_recv(handle[0], n, 42, MPI_COMM_WORLD, &status[0]);
 			starpu_data_acquire(handle[0], STARPU_R);
 			STARPU_ASSERT_MSG(var[0] == n, "Received incorrect value <%d> from node <%d>\n", var[0], n);
-			FPRINTF_MPI("received <%d> from node %d\n", var[0], n);
+			FPRINTF_MPI(stderr, "received <%d> from node %d\n", var[0], n);
 			starpu_data_release(handle[0]);
 
 			starpu_mpi_recv(handle[0], n, 42, MPI_COMM_WORLD, &status[1]);
@@ -64,7 +64,7 @@ int main(int argc, char **argv)
 				starpu_data_acquire(handle[i], STARPU_R);
 			STARPU_ASSERT_MSG(var[0] == n*2, "Received incorrect value <%d> from node <%d>\n", var[0], n);
 			STARPU_ASSERT_MSG(var[1] == n*4, "Received incorrect value <%d> from node <%d>\n", var[0], n);
-			FPRINTF_MPI("received <%d> and <%d> from node %d\n", var[0], var[1], n);
+			FPRINTF_MPI(stderr, "received <%d> and <%d> from node %d\n", var[0], var[1], n);
 			for(i=0 ; i<2 ; i++)
 				starpu_data_release(handle[i]);
 			for(i=0 ; i<2 ; i++)
@@ -76,7 +76,7 @@ int main(int argc, char **argv)
 		int i, var[3];
 		starpu_data_handle_t handle[3];
 
-		FPRINTF_MPI("sending to node %d\n", 0);
+		FPRINTF_MPI(stderr, "sending to node %d\n", 0);
 		var[0] = rank;
 		var[1] = var[0] * 2;
 		var[2] = var[0] * 4;

+ 4 - 4
mpi/tests/helper.h

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2011, 2012, 2013  Centre National de la Recherche Scientifique
+ * Copyright (C) 2011, 2012, 2013, 2015  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
@@ -19,8 +19,8 @@
 #define STARPU_TEST_SKIPPED 77
 
 #define FPRINTF(ofile, fmt, ...) do { if (!getenv("STARPU_SSILENT")) {fprintf(ofile, fmt, ## __VA_ARGS__); }} while(0)
-#define FPRINTF_MPI(fmt, ...) do { if (!getenv("STARPU_SSILENT")) { \
+#define FPRINTF_MPI(ofile, fmt, ...) do { if (!getenv("STARPU_SSILENT")) { \
     						int _disp_rank; MPI_Comm_rank(MPI_COMM_WORLD, &_disp_rank);       \
-                                                fprintf(stderr, "[%d][starpu_mpi][%s] " fmt , _disp_rank, __starpu_func__ ,## __VA_ARGS__); \
-                                                fflush(stderr); }} while(0);
+                                                fprintf(ofile, "[%d][starpu_mpi][%s] " fmt , _disp_rank, __starpu_func__ ,## __VA_ARGS__); \
+                                                fflush(ofile); }} while(0);
 

+ 5 - 5
mpi/tests/insert_task_compute.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2013, 2014  Centre National de la Recherche Scientifique
+ * Copyright (C) 2013, 2014, 2015  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
@@ -51,13 +51,13 @@ int test(int rank, int node, int *before, int *after, int task_insert, int data_
 		goto nodata;
 	}
 
-	FPRINTF_MPI("Testing with task_insert=%d - data_array=%d\n", task_insert, data_array);
+	FPRINTF_MPI(stderr, "Testing with task_insert=%d - data_array=%d\n", task_insert, data_array);
 
 	for(i=0 ; i<2 ; i++)
 	{
 		x[i] = before[rank*2+i];
 		if (rank <= 1)
-			FPRINTF_MPI("before computation x[%d] = %d\n", i, x[i]);
+			FPRINTF_MPI(stderr, "before computation x[%d] = %d\n", i, x[i]);
 		starpu_variable_data_register(&data_handles[i], STARPU_MAIN_RAM, (uintptr_t)&x[i], sizeof(int));
 		starpu_mpi_data_register(data_handles[i], i, i);
 		descrs[i].handle = data_handles[i];
@@ -174,9 +174,9 @@ enodev:
 		for(i=0; i<2; i++)
 		{
 			ok = ok && (x[i] == after[rank*2+i]);
-			FPRINTF_MPI("after computation x[%d] = %d, should be %d\n", i, x[i], after[rank*2+i]);
+			FPRINTF_MPI(stderr, "after computation x[%d] = %d, should be %d\n", i, x[i], after[rank*2+i]);
 		}
-		FPRINTF_MPI("result is %s\n", ok?"CORRECT":"NOT CORRECT");
+		FPRINTF_MPI(stderr, "result is %s\n", ok?"CORRECT":"NOT CORRECT");
 	}
 
 nodata:

+ 3 - 3
mpi/tests/insert_task_count.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009, 2010, 2014  Université de Bordeaux 1
- * Copyright (C) 2010, 2011, 2012, 2013, 2014  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -77,7 +77,7 @@ int main(int argc, char **argv)
 	int nloops = NITER;
 	int loop;
 
-	FPRINTF_MPI("Start with token value %d\n", token);
+	FPRINTF_MPI(stderr, "Start with token value %d\n", token);
 
 	for (loop = 0; loop < nloops; loop++)
 	{
@@ -98,7 +98,7 @@ int main(int argc, char **argv)
 	starpu_mpi_shutdown();
 	starpu_shutdown();
 
-	FPRINTF_MPI("Final value for token %d\n", token);
+	FPRINTF_MPI(stderr, "Final value for token %d\n", token);
 
 	MPI_Finalize();
 

+ 5 - 5
mpi/tests/insert_task_dyn_handles.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2011, 2012, 2013, 2014  Centre National de la Recherche Scientifique
+ * Copyright (C) 2011, 2012, 2013, 2014, 2015  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,7 +121,7 @@ enodev:
 		{
 			if (x[i] != nloops * FFACTOR * 2)
 			{
-				FPRINTF_MPI("[end loop] value[%d] = %d != Expected value %d\n", i, x[i], nloops*2);
+				FPRINTF_MPI(stderr, "[end loop] value[%d] = %d != Expected value %d\n", i, x[i], nloops*2);
 				ret = 1;
 			}
 		}
@@ -129,19 +129,19 @@ enodev:
 		{
 			if (x[i] != nloops * FFACTOR)
 			{
-				FPRINTF_MPI("[end loop] value[%d] = %d != Expected value %d\n", i, x[i], nloops);
+				FPRINTF_MPI(stderr, "[end loop] value[%d] = %d != Expected value %d\n", i, x[i], nloops);
 				ret = 1;
 			}
 		}
 		if (ret == 0)
 		{
-			FPRINTF_MPI("[end of loop] all values are correct\n");
+			FPRINTF_MPI(stderr, "[end of loop] all values are correct\n");
 		}
 		free(x);
 	}
 	else
 	{
-		FPRINTF_MPI("[end of loop] no computation on this node\n");
+		FPRINTF_MPI(stderr, "[end of loop] no computation on this node\n");
 		ret = 0;
 	}
 

+ 3 - 3
mpi/tests/insert_task_node_choice.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2011, 2012, 2013, 2014  Centre National de la Recherche Scientifique
+ * Copyright (C) 2011, 2012, 2013, 2014, 2015  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -25,7 +25,7 @@ void func_cpu(void *descr[], STARPU_ATTRIBUTE_UNUSED void *_args)
 
 	starpu_codelet_unpack_args(_args, &node);
 	MPI_Comm_rank(MPI_COMM_WORLD, &rank);
-	FPRINTF_MPI("Expected node: %d - Actual node: %d\n", node, rank);
+	FPRINTF_MPI(stderr, "Expected node: %d - Actual node: %d\n", node, rank);
 
 	assert(node == rank);
 }
@@ -91,7 +91,7 @@ int main(int argc, char **argv)
 				     0);
 	assert(err == 0);
 
-	FPRINTF_MPI("Waiting ...\n");
+	FPRINTF_MPI(stderr, "Waiting ...\n");
 	starpu_task_wait_for_all();
 	starpu_data_unregister(data_handlesx0);
 	starpu_data_unregister(data_handlesx1);

+ 3 - 3
mpi/tests/insert_task_owner.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2011, 2012, 2013, 2014  Centre National de la Recherche Scientifique
+ * Copyright (C) 2011, 2012, 2013, 2014, 2015  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -25,7 +25,7 @@ void func_cpu(void *descr[], STARPU_ATTRIBUTE_UNUSED void *_args)
 
 	starpu_codelet_unpack_args(_args, &node);
 	MPI_Comm_rank(MPI_COMM_WORLD, &rank);
-	FPRINTF_MPI("Expected node: %d - Actual node: %d\n", node, rank);
+	FPRINTF_MPI(stderr, "Expected node: %d - Actual node: %d\n", node, rank);
 
 	assert(node == rank);
 }
@@ -158,7 +158,7 @@ int main(int argc, char **argv)
 				     0);
 	assert(err == 0);
 
-	FPRINTF_MPI("Waiting ...\n");
+	FPRINTF_MPI(stderr, "Waiting ...\n");
 	starpu_task_wait_for_all();
 	starpu_data_unregister(data_handlesx0);
 	starpu_data_unregister(data_handlesx1);

+ 3 - 3
mpi/tests/insert_task_recv_cache.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2011, 2012, 2013, 2014  Centre National de la Recherche Scientifique
+ * Copyright (C) 2011, 2012, 2013, 2014, 2015  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
@@ -54,7 +54,7 @@ void test_cache(int rank, char *enabled, size_t *comm_amount)
 	unsigned v[2][N];
 	starpu_data_handle_t data_handles[2];
 
-	FPRINTF_MPI("Testing with STARPU_MPI_CACHE=%s\n", enabled);
+	FPRINTF_MPI(stderr, "Testing with STARPU_MPI_CACHE=%s\n", enabled);
 	setenv("STARPU_MPI_CACHE", enabled, 1);
 
 	ret = starpu_init(NULL);
@@ -130,7 +130,7 @@ int main(int argc, char **argv)
 	if (rank == 1)
 	{
 		result = (comm_amount_with_cache[0] == comm_amount_without_cache[0] * 2);
-		FPRINTF_MPI("Communication cache mechanism is %sworking (with cache: %ld) (without cache: %ld)\n", result?"":"NOT ", comm_amount_with_cache[0], comm_amount_without_cache[0]);
+		FPRINTF_MPI(stderr, "Communication cache mechanism is %sworking (with cache: %ld) (without cache: %ld)\n", result?"":"NOT ", comm_amount_with_cache[0], comm_amount_without_cache[0]);
 	}
 	else
 	{

+ 2 - 2
mpi/tests/insert_task_sent_cache.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2011, 2012, 2013, 2014  Centre National de la Recherche Scientifique
+ * Copyright (C) 2011, 2012, 2013, 2014, 2015  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
@@ -136,7 +136,7 @@ int main(int argc, char **argv)
 	{
 		dst = (rank == 0) ? 1 : 0;
 		result = (comm_amount_with_cache[dst] == comm_amount_without_cache[dst] * 5);
-		FPRINTF_MPI("Communication cache mechanism is %sworking\n", result?"":"NOT ");
+		FPRINTF_MPI(stderr, "Communication cache mechanism is %sworking\n", result?"":"NOT ");
 	}
 	else
 	{

+ 3 - 3
mpi/tests/mpi_earlyrecv.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009, 2010, 2014  Université de Bordeaux
- * Copyright (C) 2010, 2011, 2012, 2013, 2014  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015  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
@@ -55,7 +55,7 @@ int main(int argc, char **argv)
 
 	int other_rank = rank%2 == 0 ? rank+1 : rank-1;
 
-	FPRINTF_MPI("rank %d exchanging with rank %d\n", rank, other_rank);
+	FPRINTF_MPI(stderr, "rank %d exchanging with rank %d\n", rank, other_rank);
 
 	if (rank%2)
 	{
@@ -90,7 +90,7 @@ int main(int argc, char **argv)
 				MPI_Status status;
 				starpu_mpi_test(&request[i], &flag, &status);
 				if (flag)
-					FPRINTF_MPI("request[%d] = %d %p\n", i, flag, request[i]);
+					FPRINTF_MPI(stderr, "request[%d] = %d %p\n", i, flag, request[i]);
 			}
 		}
 		finished = request[0] == NULL && request[1] == NULL;

+ 8 - 8
mpi/tests/mpi_earlyrecv2.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009, 2010, 2014  Université de Bordeaux
- * Copyright (C) 2010, 2011, 2012, 2013  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013, 2015  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
@@ -31,7 +31,7 @@ void callback(void *arg)
 
 	STARPU_PTHREAD_MUTEX_LOCK(&mutex);
 	*received = *received + 1;
-	FPRINTF_MPI("Requests %d received\n", *received);
+	FPRINTF_MPI(stderr, "Requests %d received\n", *received);
 	STARPU_PTHREAD_COND_SIGNAL(&cond);
 	STARPU_PTHREAD_MUTEX_UNLOCK(&mutex);
 }
@@ -90,7 +90,7 @@ int exchange(int rank, starpu_data_handle_t *handles, check_func func, int detac
 			STARPU_PTHREAD_MUTEX_LOCK(&mutex);
 			while (received != NB)
 			{
-			     FPRINTF_MPI("Received %d messages\n", received);
+			     FPRINTF_MPI(stderr, "Received %d messages\n", received);
 			     STARPU_PTHREAD_COND_WAIT(&cond, &mutex);
 			}
 			STARPU_PTHREAD_MUTEX_UNLOCK(&mutex);
@@ -114,7 +114,7 @@ void check_variable(starpu_data_handle_t handle, int i, int rank, int *error)
 	int *rvalue = (int *)starpu_data_get_local_ptr(handle);
 	if (*rvalue != i*other_rank)
 	{
-		FPRINTF_MPI("Incorrect received value: %d != %d\n", *rvalue, i*other_rank);
+		FPRINTF_MPI(stderr, "Incorrect received value: %d != %d\n", *rvalue, i*other_rank);
 		*error = 1;
 	}
 }
@@ -125,7 +125,7 @@ int exchange_variable(int rank, int detached)
 	starpu_data_handle_t tab_handle[NB];
 	int value[NB];
 
-	FPRINTF_MPI("Exchanging variable data with detached=%d\n", detached);
+	FPRINTF_MPI(stderr, "Exchanging variable data with detached=%d\n", detached);
 
 	for(i=0 ; i<NB ; i++)
 	{
@@ -149,7 +149,7 @@ int exchange_void(int rank, int detached)
 	int ret, i;
 	starpu_data_handle_t tab_handle[NB];
 
-	FPRINTF_MPI("Exchanging void data with detached=%d\n", detached);
+	FPRINTF_MPI(stderr, "Exchanging void data with detached=%d\n", detached);
 
 	for(i=0 ; i<NB ; i++)
 	{
@@ -172,7 +172,7 @@ void check_complex(starpu_data_handle_t handle, int i, int rank, int *error)
 
 	if ((*real != ((i*other_rank)+12)) || (*imaginary != ((i*other_rank)+45)))
 	{
-		FPRINTF_MPI("Incorrect received value: %f != %d || %f != %d\n", *real, ((i*other_rank)+12), *imaginary, ((i*other_rank)+45));
+		FPRINTF_MPI(stderr, "Incorrect received value: %f != %d || %f != %d\n", *real, ((i*other_rank)+12), *imaginary, ((i*other_rank)+45));
 		*error = 1;
 	}
 }
@@ -184,7 +184,7 @@ int exchange_complex(int rank, int detached)
 	double real[NB];
 	double imaginary[NB];
 
-	FPRINTF_MPI("Exchanging complex data with detached=%d\n", detached);
+	FPRINTF_MPI(stderr, "Exchanging complex data with detached=%d\n", detached);
 
 	for(i=0 ; i<NB ; i++)
 	{

+ 2 - 2
mpi/tests/mpi_reduction.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2013  Université de Bordeaux
- * Copyright (C) 2012, 2013, 2014  Centre National de la Recherche Scientifique
+ * Copyright (C) 2012, 2013, 2014, 2015  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
@@ -146,7 +146,7 @@ int main(int argc, char **argv)
 		starpu_mpi_task_insert(MPI_COMM_WORLD, &display_codelet, STARPU_R, dot_handle, 0);
 	}
 
-	FPRINTF_MPI("Waiting ...\n");
+	FPRINTF_MPI(stderr, "Waiting ...\n");
 	starpu_task_wait_for_all();
 
 	for(x = 0; x < nb_elements; x+=step)

+ 7 - 7
mpi/tests/mpi_reduction_kernels.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2012, 2013  Centre National de la Recherche Scientifique
+ * Copyright (C) 2012, 2013, 2015  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -26,7 +26,7 @@ void init_cpu_func(void *descr[], void *cl_arg)
 {
 	long int *dot = (long int *)STARPU_VARIABLE_GET_PTR(descr[0]);
 	*dot = 0;
-	FPRINTF_MPI("Init dot\n");
+	FPRINTF_MPI(stderr, "Init dot\n");
 }
 
 /*
@@ -38,7 +38,7 @@ void redux_cpu_func(void *descr[], void *cl_arg)
 	long int *dotb = (long int *)STARPU_VARIABLE_GET_PTR(descr[1]);
 
 	*dota = *dota + *dotb;
-	FPRINTF_MPI("Calling redux %ld=%ld+%ld\n", *dota, *dota-*dotb, *dotb);
+	FPRINTF_MPI(stderr, "Calling redux %ld=%ld+%ld\n", *dota, *dota-*dotb, *dotb);
 }
 
 /*
@@ -51,14 +51,14 @@ void dot_cpu_func(void *descr[], void *cl_arg)
 
 	long int *dot = (long int *)STARPU_VARIABLE_GET_PTR(descr[1]);
 
-	//FPRINTF_MPI("Before dot=%ld (adding %d elements...)\n", *dot, n);
+	//FPRINTF_MPI(stderr, "Before dot=%ld (adding %d elements...)\n", *dot, n);
 	unsigned i;
 	for (i = 0; i < n; i++)
 	{
-		//FPRINTF_MPI("Adding %ld\n", local_x[i]);
+		//FPRINTF_MPI(stderr, "Adding %ld\n", local_x[i]);
 		*dot += local_x[i];
 	}
-	//FPRINTF_MPI("After dot=%ld\n", *dot);
+	//FPRINTF_MPI(stderr, "After dot=%ld\n", *dot);
 }
 
 /*
@@ -68,6 +68,6 @@ void display_cpu_func(void *descr[], void *cl_arg)
 {
 	long int *local_x = (long int *)STARPU_VECTOR_GET_PTR(descr[0]);
 
-	FPRINTF_MPI("Local=%ld\n", *local_x);
+	FPRINTF_MPI(stderr, "Local=%ld\n", *local_x);
 }
 

+ 2 - 2
mpi/tests/mpi_redux.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2013  Centre National de la Recherche Scientifique
+ * Copyright (C) 2013, 2015  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -26,7 +26,7 @@ void callback(void *arg)
 
 	STARPU_PTHREAD_MUTEX_LOCK(&mutex);
 	*received = *received + 1;
-	FPRINTF_MPI("received = %d\n", *received);
+	FPRINTF_MPI(stderr, "received = %d\n", *received);
 	STARPU_PTHREAD_COND_SIGNAL(&cond);
 	STARPU_PTHREAD_MUTEX_UNLOCK(&mutex);
 }

+ 5 - 5
mpi/tests/mpi_scatter_gather.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2011, 2012, 2013, 2014  Centre National de la Recherche Scientifique
+ * Copyright (C) 2011, 2012, 2013, 2014, 2015  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
@@ -36,12 +36,12 @@ void cpu_codelet(void *descr[], void *_args)
 	starpu_codelet_unpack_args(_args, &rank);
 	factor = block[0];
 
-	//FPRINTF_MPI("rank %d factor %f\n", rank, factor);
+	//FPRINTF_MPI(stderr, "rank %d factor %f\n", rank, factor);
 	for (j = 0; j < nx; j++)
 	{
 		for (i = 0; i < nx; i++)
 		{
-			//FPRINTF_MPI("rank %d factor %f --> %f %f\n", rank, factor, block[j+i*ld], block[j+i*ld]*factor);
+			//FPRINTF_MPI(stderr, "rank %d factor %f --> %f %f\n", rank, factor, block[j+i*ld], block[j+i*ld]*factor);
 			block[j+i*ld] *= factor;
 		}
 	}
@@ -57,13 +57,13 @@ static struct starpu_codelet cl =
 void scallback(void *arg STARPU_ATTRIBUTE_UNUSED)
 {
 	char *msg = arg;
-	FPRINTF_MPI("Sending completed for <%s>\n", msg);
+	FPRINTF_MPI(stderr, "Sending completed for <%s>\n", msg);
 }
 
 void rcallback(void *arg STARPU_ATTRIBUTE_UNUSED)
 {
 	char *msg = arg;
-	FPRINTF_MPI("Reception completed for <%s>\n", msg);
+	FPRINTF_MPI(stderr, "Reception completed for <%s>\n", msg);
 }
 
 int main(int argc, char **argv)

+ 3 - 3
mpi/tests/pingpong.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009, 2010, 2014  Université de Bordeaux
- * Copyright (C) 2010, 2011, 2012, 2013  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013, 2015  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
@@ -63,13 +63,13 @@ int main(int argc, char **argv)
 	{
 		if ((loop % 2) == (rank%2))
 		{
-			//FPRINTF_MPI("Sending to %d\n", other_rank);
+			//FPRINTF_MPI(stderr, "Sending to %d\n", other_rank);
 			starpu_mpi_send(tab_handle, other_rank, loop, MPI_COMM_WORLD);
 		}
 		else
 		{
 			MPI_Status status;
-			//FPRINTF_MPI("Receiving from %d\n", other_rank);
+			//FPRINTF_MPI(stderr, "Receiving from %d\n", other_rank);
 			starpu_mpi_recv(tab_handle, other_rank, loop, MPI_COMM_WORLD, &status);
 		}
 	}

+ 4 - 4
mpi/tests/ring_sync_detached.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009, 2010, 2014  Université de Bordeaux 1
- * Copyright (C) 2010, 2011, 2012, 2013, 2014  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011, 2012, 2013, 2014, 2015  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
@@ -108,7 +108,7 @@ int main(int argc, char **argv)
 		if (loop == 0 && rank == 0)
 		{
 			token = 0;
-			FPRINTF_MPI("Start with token value %d\n", token);
+			FPRINTF_MPI(stderr, "Start with token value %d\n", token);
 		}
 		else
 		{
@@ -121,7 +121,7 @@ int main(int argc, char **argv)
 		if (loop == last_loop && rank == last_rank)
 		{
 			starpu_data_acquire(token_handle, STARPU_R);
-			FPRINTF_MPI("Finished : token value %d\n", token);
+			FPRINTF_MPI(stderr, "Finished : token value %d\n", token);
 			starpu_data_release(token_handle);
 		}
 		else
@@ -140,7 +140,7 @@ int main(int argc, char **argv)
 	starpu_mpi_shutdown();
 	starpu_shutdown();
 
-	FPRINTF_MPI("Final value for token %d\n", token);
+	FPRINTF_MPI(stderr, "Final value for token %d\n", token);
 	MPI_Finalize();
 
 	if (rank == last_rank)

+ 6 - 6
mpi/tests/user_defined_datatype.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2012, 2013, 2014  Centre National de la Recherche Scientifique
+ * Copyright (C) 2012, 2013, 2014, 2015  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
@@ -100,7 +100,7 @@ int main(int argc, char **argv)
 			float foo_compare=42.0;
 			int value_compare=36;
 
-			FPRINTF_MPI("\nTesting with function %p\n", f);
+			FPRINTF_MPI(stderr, "\nTesting with function %p\n", f);
 
 			if (rank == 0)
 			{
@@ -153,13 +153,13 @@ int main(int argc, char **argv)
 					compare = (foo[i] == foo_compare);
 					if (compare == 0)
 					{
-						FPRINTF_MPI("ERROR. foo[%d] == %f != %f\n", i, foo[i], foo_compare);
+						FPRINTF_MPI(stderr, "ERROR. foo[%d] == %f != %f\n", i, foo[i], foo_compare);
 						goto end;
 					}
 					compare = (values[i] == value_compare);
 					if (compare == 0)
 					{
-						FPRINTF_MPI("ERROR. value[%d] == %d != %d\n", i, values[i], value_compare);
+						FPRINTF_MPI(stderr, "ERROR. value[%d] == %d != %d\n", i, values[i], value_compare);
 						goto end;
 					}
 					for(j=0 ; j<2 ; j++)
@@ -167,7 +167,7 @@ int main(int argc, char **argv)
 						compare = (real[i][j] == real_compare[j]);
 						if (compare == 0)
 						{
-							FPRINTF_MPI("ERROR. real[%d][%d] == %f != %f\n", i, j, real[i][j], real_compare[j]);
+							FPRINTF_MPI(stderr, "ERROR. real[%d][%d] == %f != %f\n", i, j, real[i][j], real_compare[j]);
 							goto end;
 						}
 					}
@@ -176,7 +176,7 @@ int main(int argc, char **argv)
 						compare = (imaginary[i][j] == imaginary_compare[j]);
 						if (compare == 0)
 						{
-							FPRINTF_MPI("ERROR. imaginary[%d][%d] == %f != %f\n", i, j, imaginary[i][j], imaginary_compare[j]);
+							FPRINTF_MPI(stderr, "ERROR. imaginary[%d][%d] == %f != %f\n", i, j, imaginary[i][j], imaginary_compare[j]);
 							goto end;
 						}
 					}