[Swift-commit] r8096 - SwiftTutorials/ATPESC_2014-08-14/swift-t/examples/02-loop

wozniak at ci.uchicago.edu wozniak at ci.uchicago.edu
Tue Aug 12 10:55:33 CDT 2014


Author: wozniak
Date: 2014-08-12 10:55:32 -0500 (Tue, 12 Aug 2014)
New Revision: 8096

Added:
   SwiftTutorials/ATPESC_2014-08-14/swift-t/examples/02-loop/loop.swift
   SwiftTutorials/ATPESC_2014-08-14/swift-t/examples/02-loop/run-local.sh
Log:
2nd example


Added: SwiftTutorials/ATPESC_2014-08-14/swift-t/examples/02-loop/loop.swift
===================================================================
--- SwiftTutorials/ATPESC_2014-08-14/swift-t/examples/02-loop/loop.swift	                        (rev 0)
+++ SwiftTutorials/ATPESC_2014-08-14/swift-t/examples/02-loop/loop.swift	2014-08-12 15:55:32 UTC (rev 8096)
@@ -0,0 +1,22 @@
+
+import io;
+
+ at dispatch=WORKER
+(int j) compute(int i) "turbine" "0.0"
+[
+----  
+  after [ expr <<i>> * 1000 ]
+  puts "compute: <<i>> [ expr [clock seconds] % 1000]"        
+  set <<j>> [ expr <<i>> * 2 ]
+----
+];        
+  
+main
+{
+  printf("Running loop...");
+  foreach i in [0:9]
+  {
+    j = compute(i);
+    printf("compute(%i) = %i", i, j);
+  }
+}

Copied: SwiftTutorials/ATPESC_2014-08-14/swift-t/examples/02-loop/run-local.sh (from rev 8095, SwiftTutorials/ATPESC_2014-08-14/swift-t/examples/01-hello/run-local.sh)
===================================================================
--- SwiftTutorials/ATPESC_2014-08-14/swift-t/examples/02-loop/run-local.sh	                        (rev 0)
+++ SwiftTutorials/ATPESC_2014-08-14/swift-t/examples/02-loop/run-local.sh	2014-08-12 15:55:32 UTC (rev 8096)
@@ -0,0 +1,7 @@
+#!/bin/sh -eu
+
+source ../../cfg/setup-local.sh
+
+PROGRAM=loop
+stc     ${PROGRAM}.swift
+turbine ${*} ${PROGRAM}.tcl




More information about the Swift-commit mailing list