From: Martin Kronbichler Date: Thu, 18 Jul 2019 12:41:48 +0000 (+0200) Subject: Avoid output of roundoff-sensitive data. Print correct/wrong instead. X-Git-Tag: v9.2.0-rc1~1373^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F8391%2Fhead;p=dealii.git Avoid output of roundoff-sensitive data. Print correct/wrong instead. --- diff --git a/tests/lac/la_parallel_vector_add_and_dot_complex.cc b/tests/lac/la_parallel_vector_add_and_dot_complex.cc index 5cf58b26f1..5b5f21631b 100644 --- a/tests/lac/la_parallel_vector_add_and_dot_complex.cc +++ b/tests/lac/la_parallel_vector_add_and_dot_complex.cc @@ -60,8 +60,15 @@ check() deallog << std::endl; } - deallog << "Add and dot should be " << prod / static_cast(size) - << ", is " << prod_check / static_cast(size) << std::endl; + deallog << "Add and dot is "; + if (std::abs(prod - prod_check) < + 4. * std::numeric_limits::epsilon() * + std::sqrt(static_cast(size)) * size) + deallog << "correct" << std::endl; + else + deallog << "wrong; should be " << prod / static_cast(size) + << ", is " << prod_check / static_cast(size) + << std::endl; } } diff --git a/tests/lac/la_parallel_vector_add_and_dot_complex.with_complex_values=on.output b/tests/lac/la_parallel_vector_add_and_dot_complex.with_complex_values=on.output index 30ac12364b..094c70de90 100644 --- a/tests/lac/la_parallel_vector_add_and_dot_complex.with_complex_values=on.output +++ b/tests/lac/la_parallel_vector_add_and_dot_complex.with_complex_values=on.output @@ -1,9 +1,9 @@ -DEAL::Add and dot should be (1334.7905,349.71042), is (1334.7905,349.71042) -DEAL::Add and dot should be (91530.086,22094.701), is (91530.086,22094.701) -DEAL::Add and dot should be (181725.41,43834.066), is (181725.41,43834.066) -DEAL::Add and dot should be (271920.69,65573.367), is (271920.69,65573.367) -DEAL::Add and dot should be (362116.03,87312.656), is (362116.03,87312.656) +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct Process #0 Local range: [0, 17), global size: 17 Vector data: @@ -14,9 +14,9 @@ Local range: [0, 17), global size: 17 Vector data: (2.554e-02,1.842e+00) (3.311e-02,1.444e+01) (4.069e-02,2.704e+01) (4.827e-02,3.965e+01) (5.585e-02,5.225e+01) (6.342e-02,6.485e+01) (7.100e-02,7.745e+01) (7.858e-02,9.005e+01) (8.616e-02,1.027e+02) (9.373e-02,1.153e+02) (1.013e-01,1.279e+02) (1.089e-01,1.405e+02) (1.165e-01,1.531e+02) (1.240e-01,1.657e+02) (1.316e-01,1.783e+02) (1.392e-01,1.909e+02) (1.468e-01,2.035e+02) DEAL::Vector check reference: -DEAL::Add and dot should be (1334.7906,349.71041), is (1334.7906,349.71041) -DEAL::Add and dot should be (91530.091,22094.701), is (91530.091,22094.701) -DEAL::Add and dot should be (181725.40,43834.063), is (181725.40,43834.063) -DEAL::Add and dot should be (271920.71,65573.368), is (271920.71,65573.368) -DEAL::Add and dot should be (362116.02,87312.657), is (362116.02,87312.657) +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct DEAL::OK diff --git a/tests/lac/la_parallel_vector_add_and_dot_complex.with_complex_values=on.output.DEAL_II_MAX_THREADS2 b/tests/lac/la_parallel_vector_add_and_dot_complex.with_complex_values=on.output.DEAL_II_MAX_THREADS2 deleted file mode 100644 index 30e0cc1fa5..0000000000 --- a/tests/lac/la_parallel_vector_add_and_dot_complex.with_complex_values=on.output.DEAL_II_MAX_THREADS2 +++ /dev/null @@ -1,22 +0,0 @@ - -DEAL::Add and dot should be (1334.7905,349.71042), is (1334.7905,349.71042) -DEAL::Add and dot should be (91530.094,22094.703), is (91530.094,22094.703) -DEAL::Add and dot should be (181725.41,43834.062), is (181725.41,43834.062) -DEAL::Add and dot should be (271920.72,65573.367), is (271920.72,65573.367) -DEAL::Add and dot should be (362116.00,87312.664), is (362116.00,87312.664) -Process #0 -Local range: [0, 17), global size: 17 -Vector data: -(2.554e-02,1.842e+00) (3.311e-02,1.444e+01) (4.069e-02,2.704e+01) (4.827e-02,3.965e+01) (5.585e-02,5.225e+01) (6.342e-02,6.485e+01) (7.100e-02,7.745e+01) (7.858e-02,9.005e+01) (8.616e-02,1.027e+02) (9.373e-02,1.153e+02) (1.013e-01,1.279e+02) (1.089e-01,1.405e+02) (1.165e-01,1.531e+02) (1.240e-01,1.657e+02) (1.316e-01,1.783e+02) (1.392e-01,1.909e+02) (1.468e-01,2.035e+02) -DEAL::Vector add reference: -Process #0 -Local range: [0, 17), global size: 17 -Vector data: -(2.554e-02,1.842e+00) (3.311e-02,1.444e+01) (4.069e-02,2.704e+01) (4.827e-02,3.965e+01) (5.585e-02,5.225e+01) (6.342e-02,6.485e+01) (7.100e-02,7.745e+01) (7.858e-02,9.005e+01) (8.616e-02,1.027e+02) (9.373e-02,1.153e+02) (1.013e-01,1.279e+02) (1.089e-01,1.405e+02) (1.165e-01,1.531e+02) (1.240e-01,1.657e+02) (1.316e-01,1.783e+02) (1.392e-01,1.909e+02) (1.468e-01,2.035e+02) -DEAL::Vector check reference: -DEAL::Add and dot should be (1334.7906,349.71041), is (1334.7906,349.71041) -DEAL::Add and dot should be (91530.091,22094.701), is (91530.091,22094.701) -DEAL::Add and dot should be (181725.40,43834.063), is (181725.40,43834.063) -DEAL::Add and dot should be (271920.71,65573.368), is (271920.71,65573.368) -DEAL::Add and dot should be (362116.02,87312.657), is (362116.02,87312.657) -DEAL::OK diff --git a/tests/lac/la_parallel_vector_add_and_dot_complex.with_complex_values=on.output.no_threads b/tests/lac/la_parallel_vector_add_and_dot_complex.with_complex_values=on.output.no_threads deleted file mode 100644 index e45c25e529..0000000000 --- a/tests/lac/la_parallel_vector_add_and_dot_complex.with_complex_values=on.output.no_threads +++ /dev/null @@ -1,22 +0,0 @@ - -DEAL::Add and dot should be (1334.7905,349.71042), is (1334.7905,349.71042) -DEAL::Add and dot should be (91530.094,22094.701), is (91530.094,22094.701) -DEAL::Add and dot should be (181725.41,43834.062), is (181725.41,43834.062) -DEAL::Add and dot should be (271920.72,65573.367), is (271920.72,65573.367) -DEAL::Add and dot should be (362116.03,87312.656), is (362116.03,87312.656) -Process #0 -Local range: [0, 17), global size: 17 -Vector data: -(2.554e-02,1.842e+00) (3.311e-02,1.444e+01) (4.069e-02,2.704e+01) (4.827e-02,3.965e+01) (5.585e-02,5.225e+01) (6.342e-02,6.485e+01) (7.100e-02,7.745e+01) (7.858e-02,9.005e+01) (8.616e-02,1.027e+02) (9.373e-02,1.153e+02) (1.013e-01,1.279e+02) (1.089e-01,1.405e+02) (1.165e-01,1.531e+02) (1.240e-01,1.657e+02) (1.316e-01,1.783e+02) (1.392e-01,1.909e+02) (1.468e-01,2.035e+02) -DEAL::Vector add reference: -Process #0 -Local range: [0, 17), global size: 17 -Vector data: -(2.554e-02,1.842e+00) (3.311e-02,1.444e+01) (4.069e-02,2.704e+01) (4.827e-02,3.965e+01) (5.585e-02,5.225e+01) (6.342e-02,6.485e+01) (7.100e-02,7.745e+01) (7.858e-02,9.005e+01) (8.616e-02,1.027e+02) (9.373e-02,1.153e+02) (1.013e-01,1.279e+02) (1.089e-01,1.405e+02) (1.165e-01,1.531e+02) (1.240e-01,1.657e+02) (1.316e-01,1.783e+02) (1.392e-01,1.909e+02) (1.468e-01,2.035e+02) -DEAL::Vector check reference: -DEAL::Add and dot should be (1334.7906,349.71041), is (1334.7906,349.71041) -DEAL::Add and dot should be (91530.091,22094.701), is (91530.091,22094.701) -DEAL::Add and dot should be (181725.40,43834.063), is (181725.40,43834.063) -DEAL::Add and dot should be (271920.71,65573.368), is (271920.71,65573.368) -DEAL::Add and dot should be (362116.02,87312.657), is (362116.02,87312.657) -DEAL::OK diff --git a/tests/lac/la_vector_add_and_dot.cc b/tests/lac/la_vector_add_and_dot.cc index d9c32f8317..4154efc728 100644 --- a/tests/lac/la_vector_add_and_dot.cc +++ b/tests/lac/la_vector_add_and_dot.cc @@ -63,8 +63,18 @@ check() deallog << std::endl; } - deallog << "Add and dot should be " << prod / static_cast(size) - << ", is " << prod_check / static_cast(size) << std::endl; + deallog << "Add and dot is "; + if (std::abs(prod - prod_check) < + 4. * + std::abs( + std::numeric_limits< + typename numbers::NumberTraits::real_type>::epsilon()) * + std::sqrt(static_cast(size)) * size) + deallog << "correct" << std::endl; + else + deallog << "wrong; should be " << prod / static_cast(size) + << ", is " << prod_check / static_cast(size) + << std::endl; } } @@ -74,7 +84,7 @@ main() { std::ofstream logfile("output"); deallog << std::fixed; - deallog << std::setprecision(2); + deallog << std::setprecision(10); deallog.attach(logfile); check(); diff --git a/tests/lac/la_vector_add_and_dot.with_complex_values=false.output b/tests/lac/la_vector_add_and_dot.with_complex_values=false.output index d70ce10ee8..00200f3fa0 100644 --- a/tests/lac/la_vector_add_and_dot.with_complex_values=false.output +++ b/tests/lac/la_vector_add_and_dot.with_complex_values=false.output @@ -1,15 +1,15 @@ -DEAL::Add and dot should be 0.30, is 0.30 -DEAL::Add and dot should be 13.40, is 13.40 -DEAL::Add and dot should be 26.50, is 26.50 -DEAL::Add and dot should be 39.61, is 39.61 -DEAL::Add and dot should be 52.71, is 52.71 -DEAL::Vector add reference: 0.03 0.03 0.04 0.05 0.06 0.06 0.07 0.08 0.09 0.09 0.10 0.11 0.12 0.12 0.13 0.14 0.15 -DEAL::Vector check reference: 0.03 0.03 0.04 0.05 0.06 0.06 0.07 0.08 0.09 0.09 0.10 0.11 0.12 0.12 0.13 0.14 0.15 -DEAL::Vector add constant: 1.03 1.03 1.04 1.05 1.06 1.06 1.07 1.08 1.09 1.09 1.10 1.11 1.12 1.12 1.13 1.14 1.15 -DEAL::Add and dot should be 0.30, is 0.30 -DEAL::Add and dot should be 13.40, is 13.40 -DEAL::Add and dot should be 26.50, is 26.50 -DEAL::Add and dot should be 39.61, is 39.61 -DEAL::Add and dot should be 52.71, is 52.71 +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Vector add reference: 0.0255360000 0.0331136000 0.0406912000 0.0482688000 0.0558464000 0.0634240000 0.0710016000 0.0785792000 0.0861568000 0.0937344000 0.1013120000 0.1088896000 0.1164672000 0.1240448000 0.1316224000 0.1392000000 0.1467776000 +DEAL::Vector check reference: 0.0255360000 0.0331136000 0.0406912000 0.0482688000 0.0558464000 0.0634240000 0.0710016000 0.0785792000 0.0861568000 0.0937344000 0.1013120000 0.1088896000 0.1164672000 0.1240448000 0.1316224000 0.1392000000 0.1467776000 +DEAL::Vector add constant: 1.0255360000 1.0331136000 1.0406912000 1.0482688000 1.0558464000 1.0634240000 1.0710016000 1.0785792000 1.0861568000 1.0937344000 1.1013120000 1.1088896000 1.1164672000 1.1240448000 1.1316224000 1.1392000000 1.1467776000 +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct DEAL::OK diff --git a/tests/lac/la_vector_add_and_dot.with_complex_values=true.output b/tests/lac/la_vector_add_and_dot.with_complex_values=true.output index c732258cab..8ae2aba758 100644 --- a/tests/lac/la_vector_add_and_dot.with_complex_values=true.output +++ b/tests/lac/la_vector_add_and_dot.with_complex_values=true.output @@ -1,20 +1,20 @@ -DEAL::Add and dot should be 0.30, is 0.30 -DEAL::Add and dot should be 13.40, is 13.40 -DEAL::Add and dot should be 26.50, is 26.50 -DEAL::Add and dot should be 39.61, is 39.61 -DEAL::Add and dot should be 52.71, is 52.71 -DEAL::Vector add reference: 0.03 0.03 0.04 0.05 0.06 0.06 0.07 0.08 0.09 0.09 0.10 0.11 0.12 0.12 0.13 0.14 0.15 -DEAL::Vector check reference: 0.03 0.03 0.04 0.05 0.06 0.06 0.07 0.08 0.09 0.09 0.10 0.11 0.12 0.12 0.13 0.14 0.15 -DEAL::Vector add constant: 1.03 1.03 1.04 1.05 1.06 1.06 1.07 1.08 1.09 1.09 1.10 1.11 1.12 1.12 1.13 1.14 1.15 -DEAL::Add and dot should be 0.30, is 0.30 -DEAL::Add and dot should be 13.40, is 13.40 -DEAL::Add and dot should be 26.50, is 26.50 -DEAL::Add and dot should be 39.61, is 39.61 -DEAL::Add and dot should be 52.71, is 52.71 -DEAL::Add and dot should be (0.30,0.00), is (0.30,0.00) -DEAL::Add and dot should be (13.40,0.00), is (13.40,0.00) -DEAL::Add and dot should be (26.50,0.00), is (26.50,0.00) -DEAL::Add and dot should be (39.61,0.00), is (39.61,0.00) -DEAL::Add and dot should be (52.71,0.00), is (52.71,0.00) +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Vector add reference: 0.0255360000 0.0331136000 0.0406912000 0.0482688000 0.0558464000 0.0634240000 0.0710016000 0.0785792000 0.0861568000 0.0937344000 0.1013120000 0.1088896000 0.1164672000 0.1240448000 0.1316224000 0.1392000000 0.1467776000 +DEAL::Vector check reference: 0.0255360000 0.0331136000 0.0406912000 0.0482688000 0.0558464000 0.0634240000 0.0710016000 0.0785792000 0.0861568000 0.0937344000 0.1013120000 0.1088896000 0.1164672000 0.1240448000 0.1316224000 0.1392000000 0.1467776000 +DEAL::Vector add constant: 1.0255360000 1.0331136000 1.0406912000 1.0482688000 1.0558464000 1.0634240000 1.0710016000 1.0785792000 1.0861568000 1.0937344000 1.1013120000 1.1088896000 1.1164672000 1.1240448000 1.1316224000 1.1392000000 1.1467776000 +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct DEAL::OK diff --git a/tests/lac/la_vector_add_and_dot_complex.cc b/tests/lac/la_vector_add_and_dot_complex.cc index e396febe5f..f86fd6453e 100644 --- a/tests/lac/la_vector_add_and_dot_complex.cc +++ b/tests/lac/la_vector_add_and_dot_complex.cc @@ -57,8 +57,15 @@ check() deallog << std::endl; } - deallog << "Add and dot should be " << prod / static_cast(size) - << ", is " << prod_check / static_cast(size) << std::endl; + deallog << "Add and dot is "; + if (std::abs(prod - prod_check) < + 4. * std::numeric_limits::epsilon() * + std::sqrt(static_cast(size)) * size) + deallog << "correct" << std::endl; + else + deallog << "wrong; should be " << prod / static_cast(size) + << ", is " << prod_check / static_cast(size) + << std::endl; } } diff --git a/tests/lac/la_vector_add_and_dot_complex.with_complex_values=on.output b/tests/lac/la_vector_add_and_dot_complex.with_complex_values=on.output index 47298b4e6f..4ce9557a2e 100644 --- a/tests/lac/la_vector_add_and_dot_complex.with_complex_values=on.output +++ b/tests/lac/la_vector_add_and_dot_complex.with_complex_values=on.output @@ -1,9 +1,9 @@ -DEAL::Add and dot should be (1334.7905,349.71042), is (1334.7905,349.71042) -DEAL::Add and dot should be (91530.086,22094.701), is (91530.086,22094.701) -DEAL::Add and dot should be (181725.41,43834.066), is (181725.41,43834.066) -DEAL::Add and dot should be (271920.69,65573.367), is (271920.69,65573.367) -DEAL::Add and dot should be (362116.03,87312.656), is (362116.03,87312.656) +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct IndexSet: {[0,16]} [0]: (2.554e-02,1.842e+00) @@ -44,9 +44,9 @@ IndexSet: {[0,16]} [15]: (1.392e-01,1.909e+02) [16]: (1.468e-01,2.035e+02) DEAL::Vector check reference: -DEAL::Add and dot should be (1334.7906,349.71041), is (1334.7906,349.71041) -DEAL::Add and dot should be (91530.091,22094.701), is (91530.091,22094.701) -DEAL::Add and dot should be (181725.40,43834.063), is (181725.40,43834.063) -DEAL::Add and dot should be (271920.71,65573.368), is (271920.71,65573.368) -DEAL::Add and dot should be (362116.02,87312.657), is (362116.02,87312.657) +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct DEAL::OK diff --git a/tests/lac/la_vector_add_and_dot_complex.with_complex_values=on.output.DEAL_II_MAX_THREADS2 b/tests/lac/la_vector_add_and_dot_complex.with_complex_values=on.output.DEAL_II_MAX_THREADS2 deleted file mode 100644 index 7cc4b3feff..0000000000 --- a/tests/lac/la_vector_add_and_dot_complex.with_complex_values=on.output.DEAL_II_MAX_THREADS2 +++ /dev/null @@ -1,52 +0,0 @@ - -DEAL::Add and dot should be (1334.7905,349.71042), is (1334.7905,349.71042) -DEAL::Add and dot should be (91530.094,22094.703), is (91530.094,22094.703) -DEAL::Add and dot should be (181725.41,43834.062), is (181725.41,43834.062) -DEAL::Add and dot should be (271920.72,65573.367), is (271920.72,65573.367) -DEAL::Add and dot should be (362116.00,87312.664), is (362116.00,87312.664) -IndexSet: {[0,16]} - -[0]: (2.554e-02,1.842e+00) -[1]: (3.311e-02,1.444e+01) -[2]: (4.069e-02,2.704e+01) -[3]: (4.827e-02,3.965e+01) -[4]: (5.585e-02,5.225e+01) -[5]: (6.342e-02,6.485e+01) -[6]: (7.100e-02,7.745e+01) -[7]: (7.858e-02,9.005e+01) -[8]: (8.616e-02,1.027e+02) -[9]: (9.373e-02,1.153e+02) -[10]: (1.013e-01,1.279e+02) -[11]: (1.089e-01,1.405e+02) -[12]: (1.165e-01,1.531e+02) -[13]: (1.240e-01,1.657e+02) -[14]: (1.316e-01,1.783e+02) -[15]: (1.392e-01,1.909e+02) -[16]: (1.468e-01,2.035e+02) -DEAL::Vector add reference: -IndexSet: {[0,16]} - -[0]: (2.554e-02,1.842e+00) -[1]: (3.311e-02,1.444e+01) -[2]: (4.069e-02,2.704e+01) -[3]: (4.827e-02,3.965e+01) -[4]: (5.585e-02,5.225e+01) -[5]: (6.342e-02,6.485e+01) -[6]: (7.100e-02,7.745e+01) -[7]: (7.858e-02,9.005e+01) -[8]: (8.616e-02,1.027e+02) -[9]: (9.373e-02,1.153e+02) -[10]: (1.013e-01,1.279e+02) -[11]: (1.089e-01,1.405e+02) -[12]: (1.165e-01,1.531e+02) -[13]: (1.240e-01,1.657e+02) -[14]: (1.316e-01,1.783e+02) -[15]: (1.392e-01,1.909e+02) -[16]: (1.468e-01,2.035e+02) -DEAL::Vector check reference: -DEAL::Add and dot should be (1334.7906,349.71041), is (1334.7906,349.71041) -DEAL::Add and dot should be (91530.091,22094.701), is (91530.091,22094.701) -DEAL::Add and dot should be (181725.40,43834.063), is (181725.40,43834.063) -DEAL::Add and dot should be (271920.71,65573.368), is (271920.71,65573.368) -DEAL::Add and dot should be (362116.02,87312.657), is (362116.02,87312.657) -DEAL::OK diff --git a/tests/lac/la_vector_add_and_dot_complex.with_complex_values=on.output.no_threads b/tests/lac/la_vector_add_and_dot_complex.with_complex_values=on.output.no_threads deleted file mode 100644 index 3549a178b1..0000000000 --- a/tests/lac/la_vector_add_and_dot_complex.with_complex_values=on.output.no_threads +++ /dev/null @@ -1,52 +0,0 @@ - -DEAL::Add and dot should be (1334.7905,349.71042), is (1334.7905,349.71042) -DEAL::Add and dot should be (91530.094,22094.701), is (91530.094,22094.701) -DEAL::Add and dot should be (181725.41,43834.062), is (181725.41,43834.062) -DEAL::Add and dot should be (271920.72,65573.367), is (271920.72,65573.367) -DEAL::Add and dot should be (362116.03,87312.656), is (362116.03,87312.656) -IndexSet: {[0,16]} - -[0]: (2.554e-02,1.842e+00) -[1]: (3.311e-02,1.444e+01) -[2]: (4.069e-02,2.704e+01) -[3]: (4.827e-02,3.965e+01) -[4]: (5.585e-02,5.225e+01) -[5]: (6.342e-02,6.485e+01) -[6]: (7.100e-02,7.745e+01) -[7]: (7.858e-02,9.005e+01) -[8]: (8.616e-02,1.027e+02) -[9]: (9.373e-02,1.153e+02) -[10]: (1.013e-01,1.279e+02) -[11]: (1.089e-01,1.405e+02) -[12]: (1.165e-01,1.531e+02) -[13]: (1.240e-01,1.657e+02) -[14]: (1.316e-01,1.783e+02) -[15]: (1.392e-01,1.909e+02) -[16]: (1.468e-01,2.035e+02) -DEAL::Vector add reference: -IndexSet: {[0,16]} - -[0]: (2.554e-02,1.842e+00) -[1]: (3.311e-02,1.444e+01) -[2]: (4.069e-02,2.704e+01) -[3]: (4.827e-02,3.965e+01) -[4]: (5.585e-02,5.225e+01) -[5]: (6.342e-02,6.485e+01) -[6]: (7.100e-02,7.745e+01) -[7]: (7.858e-02,9.005e+01) -[8]: (8.616e-02,1.027e+02) -[9]: (9.373e-02,1.153e+02) -[10]: (1.013e-01,1.279e+02) -[11]: (1.089e-01,1.405e+02) -[12]: (1.165e-01,1.531e+02) -[13]: (1.240e-01,1.657e+02) -[14]: (1.316e-01,1.783e+02) -[15]: (1.392e-01,1.909e+02) -[16]: (1.468e-01,2.035e+02) -DEAL::Vector check reference: -DEAL::Add and dot should be (1334.7906,349.71041), is (1334.7906,349.71041) -DEAL::Add and dot should be (91530.091,22094.701), is (91530.091,22094.701) -DEAL::Add and dot should be (181725.40,43834.063), is (181725.40,43834.063) -DEAL::Add and dot should be (271920.71,65573.368), is (271920.71,65573.368) -DEAL::Add and dot should be (362116.02,87312.657), is (362116.02,87312.657) -DEAL::OK diff --git a/tests/lac/vector_add_and_dot.cc b/tests/lac/vector_add_and_dot.cc index 814940b222..7a295de999 100644 --- a/tests/lac/vector_add_and_dot.cc +++ b/tests/lac/vector_add_and_dot.cc @@ -53,8 +53,18 @@ check() check.print(deallog); } - deallog << "Add and dot should be " << prod / static_cast(size) - << ", is " << prod_check / static_cast(size) << std::endl; + deallog << "Add and dot is "; + if (std::abs(prod - prod_check) < + 4. * + std::abs( + std::numeric_limits< + typename numbers::NumberTraits::real_type>::epsilon()) * + std::sqrt(static_cast(size)) * size) + deallog << "correct" << std::endl; + else + deallog << "wrong; should be " << prod / static_cast(size) + << ", is " << prod_check / static_cast(size) + << std::endl; } } @@ -64,7 +74,7 @@ main() { std::ofstream logfile("output"); deallog << std::fixed; - deallog << std::setprecision(2); + deallog << std::setprecision(10); deallog.attach(logfile); check(); diff --git a/tests/lac/vector_add_and_dot.with_complex_values=false.output b/tests/lac/vector_add_and_dot.with_complex_values=false.output index dc764c0dd4..3364e9398b 100644 --- a/tests/lac/vector_add_and_dot.with_complex_values=false.output +++ b/tests/lac/vector_add_and_dot.with_complex_values=false.output @@ -1,19 +1,19 @@ -DEAL::Add and dot should be 0.30, is 0.30 -DEAL::Add and dot should be 13.40, is 13.40 -DEAL::Add and dot should be 26.50, is 26.50 -DEAL::Add and dot should be 39.61, is 39.61 -DEAL::Add and dot should be 52.71, is 52.71 -DEAL::Vector add reference: 0.03 0.03 0.04 0.05 0.06 0.06 0.07 0.08 0.09 0.09 0.10 0.11 0.12 0.12 0.13 0.14 0.15 -DEAL::Vector check reference: 0.03 0.03 0.04 0.05 0.06 0.06 0.07 0.08 0.09 0.09 0.10 0.11 0.12 0.12 0.13 0.14 0.15 -DEAL::Add and dot should be 0.30, is 0.30 -DEAL::Add and dot should be 13.40, is 13.40 -DEAL::Add and dot should be 26.50, is 26.50 -DEAL::Add and dot should be 39.61, is 39.61 -DEAL::Add and dot should be 52.71, is 52.71 -DEAL::Add and dot should be 0.30, is 0.30 -DEAL::Add and dot should be 13.40, is 13.40 -DEAL::Add and dot should be 26.50, is 26.50 -DEAL::Add and dot should be 39.61, is 39.61 -DEAL::Add and dot should be 52.71, is 52.71 +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Vector add reference: 0.0255360000 0.0331136000 0.0406912000 0.0482688000 0.0558464000 0.0634240000 0.0710016000 0.0785792000 0.0861568000 0.0937344000 0.1013120000 0.1088896000 0.1164672000 0.1240448000 0.1316224000 0.1392000000 0.1467776000 +DEAL::Vector check reference: 0.0255360000 0.0331136000 0.0406912000 0.0482688000 0.0558464000 0.0634240000 0.0710016000 0.0785792000 0.0861568000 0.0937344000 0.1013120000 0.1088896000 0.1164672000 0.1240448000 0.1316224000 0.1392000000 0.1467776000 +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct DEAL::OK diff --git a/tests/lac/vector_add_and_dot.with_complex_values=true.output b/tests/lac/vector_add_and_dot.with_complex_values=true.output index 329e9f8d54..d5ac782a07 100644 --- a/tests/lac/vector_add_and_dot.with_complex_values=true.output +++ b/tests/lac/vector_add_and_dot.with_complex_values=true.output @@ -1,24 +1,24 @@ -DEAL::Add and dot should be 0.30, is 0.30 -DEAL::Add and dot should be 13.40, is 13.40 -DEAL::Add and dot should be 26.50, is 26.50 -DEAL::Add and dot should be 39.61, is 39.61 -DEAL::Add and dot should be 52.71, is 52.71 -DEAL::Vector add reference: 0.03 0.03 0.04 0.05 0.06 0.06 0.07 0.08 0.09 0.09 0.10 0.11 0.12 0.12 0.13 0.14 0.15 -DEAL::Vector check reference: 0.03 0.03 0.04 0.05 0.06 0.06 0.07 0.08 0.09 0.09 0.10 0.11 0.12 0.12 0.13 0.14 0.15 -DEAL::Add and dot should be 0.30, is 0.30 -DEAL::Add and dot should be 13.40, is 13.40 -DEAL::Add and dot should be 26.50, is 26.50 -DEAL::Add and dot should be 39.61, is 39.61 -DEAL::Add and dot should be 52.71, is 52.71 -DEAL::Add and dot should be 0.30, is 0.30 -DEAL::Add and dot should be 13.40, is 13.40 -DEAL::Add and dot should be 26.50, is 26.50 -DEAL::Add and dot should be 39.61, is 39.61 -DEAL::Add and dot should be 52.71, is 52.71 -DEAL::Add and dot should be (0.30,0.00), is (0.30,0.00) -DEAL::Add and dot should be (13.40,0.00), is (13.40,0.00) -DEAL::Add and dot should be (26.50,0.00), is (26.50,0.00) -DEAL::Add and dot should be (39.61,0.00), is (39.61,0.00) -DEAL::Add and dot should be (52.71,0.00), is (52.71,0.00) +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Vector add reference: 0.0255360000 0.0331136000 0.0406912000 0.0482688000 0.0558464000 0.0634240000 0.0710016000 0.0785792000 0.0861568000 0.0937344000 0.1013120000 0.1088896000 0.1164672000 0.1240448000 0.1316224000 0.1392000000 0.1467776000 +DEAL::Vector check reference: 0.0255360000 0.0331136000 0.0406912000 0.0482688000 0.0558464000 0.0634240000 0.0710016000 0.0785792000 0.0861568000 0.0937344000 0.1013120000 0.1088896000 0.1164672000 0.1240448000 0.1316224000 0.1392000000 0.1467776000 +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct DEAL::OK diff --git a/tests/lac/vector_add_and_dot_complex.cc b/tests/lac/vector_add_and_dot_complex.cc index 050b0c37ff..20396444de 100644 --- a/tests/lac/vector_add_and_dot_complex.cc +++ b/tests/lac/vector_add_and_dot_complex.cc @@ -54,8 +54,15 @@ check() check.print(deallog); } - deallog << "Add and dot should be " << prod / static_cast(size) - << ", is " << prod_check / static_cast(size) << std::endl; + deallog << "Add and dot is "; + if (std::abs(prod - prod_check) < + 4. * std::abs(std::numeric_limits::epsilon()) * + std::sqrt(static_cast(size)) * size) + deallog << "correct" << std::endl; + else + deallog << "wrong; should be " << prod / static_cast(size) + << ", is " << prod_check / static_cast(size) + << std::endl; } } diff --git a/tests/lac/vector_add_and_dot_complex.with_complex_values=on.output b/tests/lac/vector_add_and_dot_complex.with_complex_values=on.output index 0a4e5e5e28..71c7dd41aa 100644 --- a/tests/lac/vector_add_and_dot_complex.with_complex_values=on.output +++ b/tests/lac/vector_add_and_dot_complex.with_complex_values=on.output @@ -1,14 +1,14 @@ -DEAL::Add and dot should be (1334.7905,349.71042), is (1334.7905,349.71042) -DEAL::Add and dot should be (91530.086,22094.701), is (91530.086,22094.701) -DEAL::Add and dot should be (181725.41,43834.066), is (181725.41,43834.066) -DEAL::Add and dot should be (271920.69,65573.367), is (271920.69,65573.367) -DEAL::Add and dot should be (362116.03,87312.656), is (362116.03,87312.656) +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct DEAL::Vector add reference: (0.025536000,1.8415145) (0.033113600,14.442955) (0.040691200,27.044395) (0.048268800,39.645835) (0.055846400,52.247275) (0.063424000,64.848715) (0.071001600,77.450155) (0.078579200,90.051595) (0.086156800,102.65303) (0.093734400,115.25447) (0.10131200,127.85591) (0.10888960,140.45735) (0.11646720,153.05879) (0.12404480,165.66023) (0.13162240,178.26167) (0.13920000,190.86311) (0.14677760,203.46455) DEAL::Vector check reference: (0.025536000,1.8415145) (0.033113600,14.442955) (0.040691200,27.044395) (0.048268800,39.645835) (0.055846400,52.247275) (0.063424000,64.848715) (0.071001600,77.450155) (0.078579200,90.051595) (0.086156800,102.65303) (0.093734400,115.25447) (0.10131200,127.85591) (0.10888960,140.45735) (0.11646720,153.05879) (0.12404480,165.66023) (0.13162240,178.26167) (0.13920000,190.86311) (0.14677760,203.46455) -DEAL::Add and dot should be (1334.7906,349.71041), is (1334.7906,349.71041) -DEAL::Add and dot should be (91530.091,22094.701), is (91530.091,22094.701) -DEAL::Add and dot should be (181725.40,43834.063), is (181725.40,43834.063) -DEAL::Add and dot should be (271920.71,65573.368), is (271920.71,65573.368) -DEAL::Add and dot should be (362116.02,87312.657), is (362116.02,87312.657) +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct +DEAL::Add and dot is correct DEAL::OK diff --git a/tests/lac/vector_add_and_dot_complex.with_complex_values=on.output.avx512 b/tests/lac/vector_add_and_dot_complex.with_complex_values=on.output.avx512 new file mode 100644 index 0000000000..6515de9192 --- /dev/null +++ b/tests/lac/vector_add_and_dot_complex.with_complex_values=on.output.avx512 @@ -0,0 +1,14 @@ + +DEAL::Add and dot should be (1334.7905,349.71042), is (1334.7905,349.71042) +DEAL::Add and dot should be (91530.086,22094.701), is (91530.086,22094.701) +DEAL::Add and dot should be (181725.41,43834.066), is (181725.41,43834.066) +DEAL::Add and dot should be (271920.69,65573.367), is (271920.69,65573.367) +DEAL::Add and dot should be (362116.03,87312.664), is (362116.03,87312.656) +DEAL::Vector add reference: (0.025536000,1.8415145) (0.033113600,14.442955) (0.040691200,27.044395) (0.048268800,39.645835) (0.055846400,52.247275) (0.063424000,64.848715) (0.071001600,77.450155) (0.078579200,90.051595) (0.086156800,102.65303) (0.093734400,115.25447) (0.10131200,127.85591) (0.10888960,140.45735) (0.11646720,153.05879) (0.12404480,165.66023) (0.13162240,178.26167) (0.13920000,190.86311) (0.14677760,203.46455) +DEAL::Vector check reference: (0.025536000,1.8415145) (0.033113600,14.442955) (0.040691200,27.044395) (0.048268800,39.645835) (0.055846400,52.247275) (0.063424000,64.848715) (0.071001600,77.450155) (0.078579200,90.051595) (0.086156800,102.65303) (0.093734400,115.25447) (0.10131200,127.85591) (0.10888960,140.45735) (0.11646720,153.05879) (0.12404480,165.66023) (0.13162240,178.26167) (0.13920000,190.86311) (0.14677760,203.46455) +DEAL::Add and dot should be (1334.7906,349.71041), is (1334.7906,349.71041) +DEAL::Add and dot should be (91530.091,22094.701), is (91530.091,22094.701) +DEAL::Add and dot should be (181725.40,43834.063), is (181725.40,43834.063) +DEAL::Add and dot should be (271920.71,65573.368), is (271920.71,65573.368) +DEAL::Add and dot should be (362116.02,87312.657), is (362116.02,87312.657) +DEAL::OK