Browse Source

Fix computing Cholesky relative error instead of an absolute error

Samuel Thibault 5 years ago
parent
commit
464bdb2d77

+ 2 - 2
mpi/examples/matrix_decomposition/mpi_cholesky.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010-2013,2015-2017,2020                 CNRS
- * Copyright (C) 2009-2012,2014,2015,2018                 Université de Bordeaux
+ * Copyright (C) 2009-2012,2014,2015,2018,2020            Université de Bordeaux
  * Copyright (C) 2012                                     Inria
  * Copyright (C) 2010                                     Mehdi Juhoor
  *
@@ -63,7 +63,7 @@ int main(int argc, char **argv)
 #ifndef STARPU_SIMGRID
 	matrix_display(bmat, rank);
 
-	dw_cholesky_check_computation(bmat, rank, nodes, &correctness, &flops, 1.0);
+	dw_cholesky_check_computation(bmat, rank, nodes, &correctness, &flops, 0.00001);
 #endif
 
 	matrix_free(&bmat, rank, nodes, 1);

+ 2 - 2
mpi/examples/matrix_decomposition/mpi_cholesky_codelets.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010-2015,2017,2018,2020                 CNRS
- * Copyright (C) 2009,2010,2014,2015,2017,2018            Université de Bordeaux
+ * Copyright (C) 2009,2010,2014,2015,2017,2018,2020       Université de Bordeaux
  * Copyright (C) 2013                                     Inria
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -255,7 +255,7 @@ void dw_cholesky_check_computation(float ***matA, int rank, int nodes, int *corr
 						if (i <= j)
 						{
 							float orig = (1.0f/(1.0f+i+j)) + ((i == j)?1.0f*size:0.0f);
-							float err = fabsf(test_mat[j +i*size] - orig);
+							float err = fabsf(test_mat[j +i*size] - orig) / orig;
 							if (err > epsilon)
 							{
 								FPRINTF(stderr, "[%d] Error[%u, %u] --> %2.20f != %2.20f (err %2.20f)\n", rank, i, j, test_mat[j +i*size], orig, err);

+ 2 - 2
mpi/examples/matrix_decomposition/mpi_cholesky_distributed.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2010-2013,2015,2017,2020                 CNRS
- * Copyright (C) 2009-2011,2014,2015,2017,2018            Université de Bordeaux
+ * Copyright (C) 2009-2011,2014,2015,2017,2018, 2020            Université de Bordeaux
  * Copyright (C) 2012                                     Inria
  * Copyright (C) 2010                                     Mehdi Juhoor
  *
@@ -57,7 +57,7 @@ int main(int argc, char **argv)
 	{
 		matrix_display(bmat, rank);
 
-		dw_cholesky_check_computation(bmat, rank, nodes, &correctness, &flops, 1e-3);
+		dw_cholesky_check_computation(bmat, rank, nodes, &correctness, &flops, 0.00001);
 	}
 #endif
 	matrix_free(&bmat, rank, nodes, 0);