[Swift-commit] r7026 - branches/release-0.94/tests/stress/patterns/pi_diamond

wilde at ci.uchicago.edu wilde at ci.uchicago.edu
Tue Sep 3 13:19:10 CDT 2013


Author: wilde
Date: 2013-09-03 13:19:10 -0500 (Tue, 03 Sep 2013)
New Revision: 7026

Added:
   branches/release-0.94/tests/stress/patterns/pi_diamond/analyze.sh
   branches/release-0.94/tests/stress/patterns/pi_diamond/random_points.sh
Modified:
   branches/release-0.94/tests/stress/patterns/pi_diamond/analyse.sh
Log:
Proposed simpler versions of the apps. Suggest these be listed in apps rather than passed as scripts.

Modified: branches/release-0.94/tests/stress/patterns/pi_diamond/analyse.sh
===================================================================
--- branches/release-0.94/tests/stress/patterns/pi_diamond/analyse.sh	2013-09-03 16:01:05 UTC (rev 7025)
+++ branches/release-0.94/tests/stress/patterns/pi_diamond/analyse.sh	2013-09-03 18:19:10 UTC (rev 7026)
@@ -14,4 +14,4 @@
 echo "TOTAL OUT: $OUT"
 # PI = (IN * 4)/ (IN+OUT)
 echo -n "PI :"
-echo "scale=10; ($IN * 4)/($IN+$OUT)" | bc
\ No newline at end of file
+echo "scale=10; ($IN * 4)/($IN+$OUT)" | bc

Added: branches/release-0.94/tests/stress/patterns/pi_diamond/analyze.sh
===================================================================
--- branches/release-0.94/tests/stress/patterns/pi_diamond/analyze.sh	                        (rev 0)
+++ branches/release-0.94/tests/stress/patterns/pi_diamond/analyze.sh	2013-09-03 18:19:10 UTC (rev 7026)
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+awk '
+$3 < 1.0 { inCircle++; }
+         { n++ }
+END {
+  print inCircle * 4.0 / n
+}' $*


Property changes on: branches/release-0.94/tests/stress/patterns/pi_diamond/analyze.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: branches/release-0.94/tests/stress/patterns/pi_diamond/random_points.sh
===================================================================
--- branches/release-0.94/tests/stress/patterns/pi_diamond/random_points.sh	                        (rev 0)
+++ branches/release-0.94/tests/stress/patterns/pi_diamond/random_points.sh	2013-09-03 18:19:10 UTC (rev 7026)
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+NPOINTS=${1:-100}
+
+awk "
+BEGIN {
+  srand($RANDOM)
+  for (i=0;i<$NPOINTS;i++) {
+    x=rand()
+    y=rand()
+    radius=sqrt((x*x)+(y*y))
+    print x, y, radius
+  } 
+}"


Property changes on: branches/release-0.94/tests/stress/patterns/pi_diamond/random_points.sh
___________________________________________________________________
Added: svn:executable
   + *




More information about the Swift-commit mailing list