Przeglądaj źródła

mpi/tests/insert_task_compute.c: only nodes 0 and 1 take part in the computation

Nathalie Furmento 11 lat temu
rodzic
commit
695a505c71
1 zmienionych plików z 7 dodań i 4 usunięć
  1. 7 4
      mpi/tests/insert_task_compute.c

+ 7 - 4
mpi/tests/insert_task_compute.c

@@ -88,12 +88,15 @@ enodev:
 	}
 
 	ok = 1;
-	for(i=0; i<2; i++)
+	if (rank <= 1)
 	{
-		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]);
+		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("result is %s\n", ok?"CORRECT":"NOT CORRECT");
 	}
-	FPRINTF_MPI("result is %s\n", ok?"CORRECT":"NOT CORRECT");
 
 nodata:
 	starpu_mpi_shutdown();