[SCM] Gerris Flow Solver branch, upstream, updated. b3aa46814a06c9cb2912790b23916ffb44f1f203

Stephane Popinet popinet at users.sf.net
Fri May 15 02:53:28 UTC 2009


The following commit has been merged in the upstream branch:
commit 9f2a0fd24161a6cf53b60a7d1dd69e852b7369ec
Author: Stephane Popinet <popinet at users.sf.net>
Date:   Thu Feb 15 09:23:02 2007 +1100

    Poisson test cases were not reliable due to race conditions in command pipes
    
    darcs-hash:20070214222302-d4795-29262c44bff274edab7c123c498d1baa35f59ba3.gz

diff --git a/test/circle/circle.gfs b/test/circle/circle.gfs
index 5cae3b3..a5b3af0 100644
--- a/test/circle/circle.gfs
+++ b/test/circle/circle.gfs
@@ -68,14 +68,13 @@
     }
   }
   OutputTime { istep = 1 } {
-    awk '{printf ("%g ", $8); fflush (stdout)}'
+    awk '{print n++, $8}' > time
   }
   OutputProjectionStats { istep = 1 } {
     awk '{
       if ($1 == "niter:") printf ("%d ", $2);
       if ($1 == "residual.infty:") print $3 " " $4;
-      fflush (stdout);
-    }'
+    }' > proj
   }
   OutputSimulation { start = end } sim-LEVEL { variables = P }
 }
diff --git a/test/circle/circle.sh b/test/circle/circle.sh
index 918f9e5..41d2b61 100644
--- a/test/circle/circle.sh
+++ b/test/circle/circle.sh
@@ -1,7 +1,6 @@
 if ! $donotrun; then
     for level in 3 4 5 6 7 8 9; do
-	if sed "s/LEVEL/$level/g" < $1 | \
-	    gerris2D - > res-$level; then :
+	if ( sed "s/LEVEL/$level/g" < $1 | gerris2D - ) && join time proj > res-$level; then :
 	else
 	    exit 1
 	fi
@@ -43,12 +42,12 @@ if cat <<EOF | gnuplot ; then :
     set xlabel 'CPU time'
     set ylabel 'Maximum residual'
     set logscale y
-    plot 'res-7.ref' u 1:3 t 'ref' w lp, 'res-7' u 1:3 t '' w lp
+    plot 'res-7.ref' u 2:3 t 'ref' w lp, 'res-7' u 2:3 t '' w lp
     set output 'rate.eps'
     set xlabel 'V-cycle'
     set ylabel 'Cumulative residual reduction factor'
     unset logscale
-    plot 'res-7.ref' u 2:4 t 'ref' w lp, 'res-7' u 2:4 t '' w lp
+    plot 'res-7.ref' u 1:4 t 'ref' w lp, 'res-7' u 1:4 t '' w lp
     set output 'error.eps'
     set xlabel 'Level'
     set ylabel 'Error norms'
@@ -83,9 +82,9 @@ if cat <<EOF | python ; then :
 from check import *
 from sys import *
 c = Curve()
-for p in Curve('res-7.ref',1,3).l:
+for p in Curve('res-7.ref',2,3).l:
     c.l.append((p[0]+0.1, p[1]))
-if (Curve('res-7',1,3) - c).max() > 1e-8 or\
+if (Curve('res-7',2,3) - c).max() > 1e-8 or\
    (Curve('error',1,4) - Curve('error.ref',1,4)).max() > 1e-6:
     exit(1)
 EOF
diff --git a/test/circle/refined/refined.gfs b/test/circle/refined/refined.gfs
index f7f80c1..646af14 100644
--- a/test/circle/refined/refined.gfs
+++ b/test/circle/refined/refined.gfs
@@ -64,14 +64,13 @@
     }
   }
   OutputTime { istep = 1 } {
-    awk '{printf ("%g ", $8); fflush (stdout)}'
+    awk '{print n++, $8}' > time
   }
   OutputProjectionStats { istep = 1 } {
     awk '{
       if ($1 == "niter:") printf ("%d ", $2);
       if ($1 == "residual.infty:") print $3 " " $4;
-      fflush (stdout);
-    }'
+    }' > proj
   }
   OutputSimulation { start = end } sim-LEVEL { variables = P }
 }
diff --git a/test/circle/refined/res-7.ref b/test/circle/refined/res-7.ref
index fffe034..eb5c465 100644
--- a/test/circle/refined/res-7.ref
+++ b/test/circle/refined/res-7.ref
@@ -1,11 +1,11 @@
 0 0 1.775e+02 0
-0.13 1 8.330e+01 2.1
-0.24 2 3.183e+01 2.4
-0.36 3 3.970e+00 3.5
-0.47 4 9.730e-01 3.7
-0.59 5 2.931e-01 3.6
-0.7 6 8.678e-02 3.6
-0.81 7 2.365e-02 3.6
-0.93 8 7.231e-03 3.5
-1.04 9 1.930e-03 3.6
-1.15 10 5.995e-04 3.5
+1 0.13 8.330e+01 2.1
+2 0.24 3.183e+01 2.4
+3 0.36 3.970e+00 3.5
+4 0.47 9.730e-01 3.7
+5 0.59 2.931e-01 3.6
+6 0.7 8.678e-02 3.6
+7 0.81 2.365e-02 3.6
+8 0.93 7.231e-03 3.5
+9 1.04 1.930e-03 3.6
+10 1.15 5.995e-04 3.5
diff --git a/test/circle/res-7.ref b/test/circle/res-7.ref
index d576fc8..52b2fbf 100644
--- a/test/circle/res-7.ref
+++ b/test/circle/res-7.ref
@@ -1,11 +1,11 @@
 0 0 1.775e+02 0
-0.08 1 4.906e+00 36
-0.15 2 1.515e-01 34
-0.21 3 5.785e-03 31
-0.28 4 2.185e-04 30
-0.35 5 7.225e-06 30
-0.41 6 2.313e-07 30
-0.48 7 7.186e-09 31
-0.54 8 2.910e-10 30
-0.61 9 1.998e-11 27
-0.67 10 1.921e-11 20
+1 0.08 4.906e+00 36
+2 0.15 1.515e-01 34
+3 0.21 5.785e-03 31
+4 0.28 2.185e-04 30
+5 0.35 7.225e-06 30
+6 0.41 2.313e-07 30
+7 0.48 7.186e-09 31
+8 0.54 2.910e-10 30
+9 0.61 1.998e-11 27
+10 0.67 1.921e-11 20
diff --git a/test/circle/star/res-7.ref b/test/circle/star/res-7.ref
index 304758e..222170e 100644
--- a/test/circle/star/res-7.ref
+++ b/test/circle/star/res-7.ref
@@ -1,11 +1,11 @@
 0 0 1.775e+02 0
-0.07 1 2.218e+01 8
-0.13 2 7.919e-01 15
-0.19 3 2.018e-02 21
-0.26 4 9.980e-04 21
-0.32 5 3.118e-05 22
-0.38 6 1.312e-06 23
-0.44 7 6.377e-08 22
-0.51 8 2.324e-09 23
-0.57 9 1.358e-10 22
-0.63 10 1.950e-11 20
+1 0.07 2.218e+01 8
+2 0.13 7.919e-01 15
+3 0.19 2.018e-02 21
+4 0.26 9.980e-04 21
+5 0.32 3.118e-05 22
+6 0.38 1.312e-06 23
+7 0.44 6.377e-08 22
+8 0.51 2.324e-09 23
+9 0.57 1.358e-10 22
+10 0.63 1.950e-11 20
diff --git a/test/circle/star/star.gfs b/test/circle/star/star.gfs
index d2c76f2..ca533e4 100644
--- a/test/circle/star/star.gfs
+++ b/test/circle/star/star.gfs
@@ -70,14 +70,13 @@
     }
   }
   OutputTime { istep = 1 } {
-    awk '{printf ("%g ", $8); fflush (stdout)}'
+    awk '{print n++, $8}' > time
   }
   OutputProjectionStats { istep = 1 } {
     awk '{
       if ($1 == "niter:") printf ("%d ", $2);
       if ($1 == "residual.infty:") print $3 " " $4;
-      fflush (stdout);
-    }'
+    }' > proj
   }
   OutputSimulation { start = end } sim-LEVEL { variables = P }
 }
diff --git a/test/circle/thin/res-7.ref b/test/circle/thin/res-7.ref
index 7808fff..19c7d9f 100644
--- a/test/circle/thin/res-7.ref
+++ b/test/circle/thin/res-7.ref
@@ -1,10 +1,10 @@
-0.4 1 2.895e+02 0.61
-0.73 2 8.132e+01 1.5
-1.07 3 2.256e+01 2
-1.39 4 6.258e+00 2.3
-1.7 5 1.736e+00 2.5
-2.03 6 4.814e-01 2.7
-2.36 7 1.335e-01 2.8
-2.68 8 3.703e-02 2.9
-3.05 9 1.027e-02 3
-3.36 10 2.848e-03 3
+1 0.4 2.895e+02 0.61
+2 0.73 8.132e+01 1.5
+3 1.07 2.256e+01 2
+4 1.39 6.258e+00 2.3
+5 1.7 1.736e+00 2.5
+6 2.03 4.814e-01 2.7
+7 2.36 1.335e-01 2.8
+8 2.68 3.703e-02 2.9
+9 3.05 1.027e-02 3
+10 3.36 2.848e-03 3
diff --git a/test/circle/thin/thin.gfs b/test/circle/thin/thin.gfs
index 0d61764..cb9f729 100644
--- a/test/circle/thin/thin.gfs
+++ b/test/circle/thin/thin.gfs
@@ -64,14 +64,13 @@
     }
   }
   OutputTime { istep = 1 } {
-    awk '{printf ("%g ", $8); fflush (stdout)}'
+    awk '{print n++, $8}' > time
   }
   OutputProjectionStats { istep = 1 } {
     awk '{
       if ($1 == "niter:") printf ("%d ", $2);
       if ($1 == "residual.infty:") print $3 " " $4;
-      fflush (stdout);
-    }'
+    }' > proj
   }
   OutputSimulation { start = end } sim-LEVEL { variables = P }
 }
diff --git a/test/poisson/circle/circle.gfs b/test/poisson/circle/circle.gfs
index 1f37e59..c7e55e2 100644
--- a/test/poisson/circle/circle.gfs
+++ b/test/poisson/circle/circle.gfs
@@ -58,14 +58,13 @@
     }
   }
   OutputTime { istep = 1 } {
-    awk '{printf ("%g ", $8); fflush (stdout)}'
+      awk '{print n++, $8}' > time
   }
   OutputProjectionStats { istep = 1 } {
     awk '{
       if ($1 == "niter:") printf ("%d ", $2);
       if ($1 == "residual.infty:") print $3 " " $4;
-      fflush (stdout);
-    }'
+    }' > proj
   }
   OutputErrorNorm { start = end } {
     awk '{print LEVEL " " $5 " " $7 " " $9}' >> error 
diff --git a/test/poisson/circle/res-7.ref b/test/poisson/circle/res-7.ref
index b005ad3..5c8b124 100644
--- a/test/poisson/circle/res-7.ref
+++ b/test/poisson/circle/res-7.ref
@@ -1,11 +1,11 @@
 0 0 1.777e+02 0
-0.35 1 1.836e+01 9.7
-0.65 2 8.453e-01 14
-0.94 3 3.974e-02 16
-1.24 4 2.355e-03 17
-1.53 5 1.797e-04 16
-1.83 6 1.422e-05 15
-2.12 7 1.145e-06 15
-2.42 8 9.394e-08 14
-2.71 9 7.838e-09 14
-2.99 10 6.923e-10 14
+1 0.35 1.836e+01 9.7
+2 0.65 8.453e-01 14
+3 0.94 3.974e-02 16
+4 1.24 2.355e-03 17
+5 1.53 1.797e-04 16
+6 1.83 1.422e-05 15
+7 2.12 1.145e-06 15
+8 2.42 9.394e-08 14
+9 2.71 7.838e-09 14
+10 2.99 6.923e-10 14
diff --git a/test/poisson/poisson.gfs b/test/poisson/poisson.gfs
index d884982..ebb432e 100644
--- a/test/poisson/poisson.gfs
+++ b/test/poisson/poisson.gfs
@@ -69,14 +69,13 @@
     }
   }
   OutputTime { istep = 1 } {
-    awk '{printf ("%g ", $8); fflush (stdout)}'
+    awk '{print n++, $8}' > time
   }
   OutputProjectionStats { istep = 1 } {
     awk '{
       if ($1 == "niter:") printf ("%d ", $2);
       if ($1 == "residual.infty:") print $3 " " $4;
-      fflush (stdout);
-    }'
+    }' > proj
   }
   OutputErrorNorm { start = end } {
     awk '{print LEVEL " " $5 " " $7 " " $9}' >> error 
diff --git a/test/poisson/poisson.sh b/test/poisson/poisson.sh
index 29ee508..e33c74f 100644
--- a/test/poisson/poisson.sh
+++ b/test/poisson/poisson.sh
@@ -1,9 +1,7 @@
 if ! $donotrun; then
     rm -f error
     for level in 3 4 5 6 7 8; do
-	rm -f res-$level
-	if sed "s/LEVEL/$level/g" < $1 | \
-	    gerris2D - >> res-$level; then :
+	if ( sed "s/LEVEL/$level/g" < $1 | gerris2D - ) && join time proj > res-$level; then :
 	else
 	    exit 1
 	fi
@@ -29,12 +27,12 @@ if cat <<EOF | gnuplot ; then :
     set xlabel 'CPU time'
     set ylabel 'Maximum residual'
     set logscale y
-    plot 'res-7.ref' u 1:3 t 'ref' w lp, 'res-7' u 1:3 t '' w lp
+    plot 'res-7.ref' u 2:3 t 'ref' w lp, 'res-7' u 2:3 t '' w lp
     set output 'rate.eps'
     set xlabel 'V-cycle'
     set ylabel 'Cumulative residual reduction factor'
     unset logscale
-    plot 'res-7.ref' u 2:4 t 'ref' w lp, 'res-7' u 2:4 t '' w lp
+    plot 'res-7.ref' u 1:4 t 'ref' w lp, 'res-7' u 1:4 t '' w lp
     set output 'error.eps'
     set xlabel 'Level'
     set ylabel 'Error norms'
@@ -69,9 +67,9 @@ if cat <<EOF | python ; then :
 from check import *
 from sys import *
 c = Curve()
-for p in Curve('res-7.ref',1,3).l:
+for p in Curve('res-7.ref',2,3).l:
     c.l.append((p[0]+0.1, p[1]))
-if (Curve('res-7',1,3) - c).max() > 1e-8 or\
+if (Curve('res-7',2,3) - c).max() > 1e-8 or\
    (Curve('error',1,4) - Curve('error.ref',1,4)).max() > 1e-6:
     exit(1)
 EOF
diff --git a/test/poisson/res-7.ref b/test/poisson/res-7.ref
index 4335136..1e1e821 100644
--- a/test/poisson/res-7.ref
+++ b/test/poisson/res-7.ref
@@ -1,11 +1,11 @@
 0 0 1.776e+02 0
-0.08 1 5.934e+00 30
-0.14 2 2.353e-01 27
-0.2 3 1.285e-02 24
-0.26 4 9.224e-04 21
-0.32 5 6.235e-05 20
-0.38 6 4.108e-06 19
-0.44 7 2.652e-07 18
-0.5 8 1.677e-08 18
-0.56 9 1.041e-09 18
-0.62 10 6.753e-11 17
+1 0.08 5.934e+00 30
+2 0.14 2.353e-01 27
+3 0.2 1.285e-02 24
+4 0.26 9.224e-04 21
+5 0.32 6.235e-05 20
+6 0.38 4.108e-06 19
+7 0.44 2.652e-07 18
+8 0.5 1.677e-08 18
+9 0.56 1.041e-09 18
+10 0.62 6.753e-11 17

-- 
Gerris Flow Solver



More information about the debian-science-commits mailing list