From: Jean-Paul Pelteret Date: Fri, 22 May 2020 21:11:16 +0000 (+0200) Subject: Fix test warnings and output X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dc7c4a0f1c41a43d9b3b3d9fffdef9581f100300;p=code-gallery.git Fix test warnings and output --- diff --git a/parallel_in_time/test/test_braid.cc b/parallel_in_time/test/test_braid.cc index 61e006a..dffb6d7 100644 --- a/parallel_in_time/test/test_braid.cc +++ b/parallel_in_time/test/test_braid.cc @@ -25,6 +25,7 @@ int main(int argc, char** argv) my_Init, my_Access, my_Free); + (void)init_access_result; braid_Int clone_result = braid_TestClone(app, comm, @@ -34,6 +35,7 @@ int main(int argc, char** argv) my_Access, my_Free, my_Clone); + (void)clone_result; braid_Int sum_result = braid_TestSum(app, comm, @@ -44,6 +46,7 @@ int main(int argc, char** argv) my_Free, my_Clone, my_Sum); + (void)sum_result; braid_Int norm_result = braid_TestSpatialNorm(app, comm, @@ -54,6 +57,7 @@ int main(int argc, char** argv) my_Clone, my_Sum, my_SpatialNorm); + (void)norm_result; braid_Int buf_result = braid_TestBuf(app, comm, @@ -66,6 +70,8 @@ int main(int argc, char** argv) my_BufSize, my_BufPack, my_BufUnpack); + (void)buf_result; + // /* Create spatial communicator for wrapper-tests */ // braid_SplitCommworld(&comm, 1, &comm_x, &comm_t); // diff --git a/parallel_in_time/test/test_braid.output b/parallel_in_time/test/test_braid.output index 1ae28ca..e1b73fc 100644 --- a/parallel_in_time/test/test_braid.output +++ b/parallel_in_time/test/test_braid.output @@ -4,6 +4,9 @@ Starting braid_TestInitAccess braid_TestInitAccess: Starting Test 1 braid_TestInitAccess: u = init(t=2.00e-01) braid_TestInitAccess: access(u) + +cycle cells dofs L2 H1 Linfty + 0 12288 12545 8.657e-01 7.696e+00 1.001e+00 braid_TestInitAccess: check output: wrote u for initial condition at t=2.00e-01. braid_TestInitAccess: free(u) @@ -15,7 +18,16 @@ Starting braid_TestClone braid_TestClone: u = init(t=2.00e-01) braid_TestClone: v = clone(u) braid_TestClone: access(u) + +cycle cells dofs L2 H1 Linfty + 0 12288 12545 8.657e-01 7.696e+00 1.001e+00 + 0 12288 12545 8.657e-01 7.696e+00 1.001e+00 braid_TestClone: access(v) + +cycle cells dofs L2 H1 Linfty + 0 12288 12545 8.657e-01 7.696e+00 1.001e+00 + 0 12288 12545 8.657e-01 7.696e+00 1.001e+00 + 0 12288 12545 8.657e-01 7.696e+00 1.001e+00 braid_TestClone: check output: wrote u and v for initial condition at t=2.00e-01. braid_TestClone: free(u) @@ -29,12 +41,33 @@ Starting braid_TestSum braid_TestSum: v = clone(u) braid_TestSum: v = u - v braid_TestSum: access(v) + +cycle cells dofs L2 H1 Linfty + 0 12288 12545 8.657e-01 7.696e+00 1.001e+00 + 0 12288 12545 8.657e-01 7.696e+00 1.001e+00 + 0 12288 12545 8.657e-01 7.696e+00 1.001e+00 + 0 12288 12545 3.225e-04 2.865e-03 3.723e-04 braid_TestSum: check output: v should equal the zero vector braid_TestSum: Starting Test 2 braid_TestSum: v = 2*u + v braid_TestSum: access(v) + +cycle cells dofs L2 H1 Linfty + 0 12288 12545 8.657e-01 7.696e+00 1.001e+00 + 0 12288 12545 8.657e-01 7.696e+00 1.001e+00 + 0 12288 12545 8.657e-01 7.696e+00 1.001e+00 + 0 12288 12545 3.225e-04 2.865e-03 3.723e-04 + 0 12288 12545 1.732e+00 1.539e+01 2.003e+00 braid_TestSum: access(u) + +cycle cells dofs L2 H1 Linfty + 0 12288 12545 8.657e-01 7.696e+00 1.001e+00 + 0 12288 12545 8.657e-01 7.696e+00 1.001e+00 + 0 12288 12545 8.657e-01 7.696e+00 1.001e+00 + 0 12288 12545 3.225e-04 2.865e-03 3.723e-04 + 0 12288 12545 1.732e+00 1.539e+01 2.003e+00 + 0 12288 12545 8.657e-01 7.696e+00 1.001e+00 braid_TestSum: check output: v should equal 2*u braid_TestSum: free(u) @@ -46,7 +79,6 @@ Starting braid_TestSpatialNorm braid_TestSpatialNorm: Starting Test 1 braid_TestSpatialNorm: u = init(t=2.00e-01) braid_TestSpatialNorm: spatialnorm(u) - braid_TestSpatialNorm: Warning: spatialnorm(u) = 0.0 braid_TestSpatialNorm: v = clone(u) braid_TestSpatialNorm: v = u - v braid_TestSpatialNorm: spatialnorm(v) @@ -59,8 +91,8 @@ Starting braid_TestSpatialNorm braid_TestSpatialNorm: w = u + w braid_TestSpatialNorm: spatialnorm(u) braid_TestSpatialNorm: spatialnorm(w) - braid_TestSpatialNorm: Test 2 Failed, Likely due to u = 0 - braid_TestSpatialNorm: actual output: spatialnorm(w) / spatialnorm(u) = 0.00e+00 / 0.00e+00 = -nan + braid_TestSpatialNorm: Test 2 Passed + braid_TestSpatialNorm: actual output: spatialnorm(w) / spatialnorm(u) = 1.13e+02 / 5.67e+01 = 2.00e+00 braid_TestSpatialNorm: expected output: spatialnorm(w) / spatialnorm(u) = 2.0 braid_TestSpatialNorm: Starting Test 3 @@ -69,21 +101,20 @@ Starting braid_TestSpatialNorm braid_TestSpatialNorm: w = 0.0*u + 0.5*w braid_TestSpatialNorm: spatialnorm(u) braid_TestSpatialNorm: spatialnorm(w) - braid_TestSpatialNorm: Test 3 Failed, Likely due to u = 0 - braid_TestSpatialNorm: actual output: spatialnorm(w) / spatialnorm(u) = 0.00e+00 / 0.00e+00 = -nan + braid_TestSpatialNorm: Test 3 Passed + braid_TestSpatialNorm: actual output: spatialnorm(w) / spatialnorm(u) = 2.83e+01 / 5.67e+01 = 5.00e-01 braid_TestSpatialNorm: expected output: spatialnorm(w) / spatialnorm(u) = 0.5 braid_TestSpatialNorm: free(u) braid_TestSpatialNorm: free(v) braid_TestSpatialNorm: free(w) -Finished braid_TestSpatialNorm: some tests failed, possibly due to u = 0 +Finished braid_TestSpatialNorm: all tests passed successfully Starting braid_TestBuf braid_TestBuf: Starting Test 1 braid_TestBuf: u = init(t=2.00e-01) braid_TestBuf: spatialnorm(u) - braid_TestBuf: Warning: spatialnorm(u) = 0.0 braid_TestBuf: size = bufsize() braid_TestBuf: buffer = malloc(size) braid_TestBuf: buffer = bufpack(u, buffer))