[Swift-commit] r8386 - in www/Swift-T: . downloads
wozniak at ci.uchicago.edu
wozniak at ci.uchicago.edu
Thu Mar 5 13:45:44 CST 2015
Author: wozniak
Date: 2015-03-05 13:45:44 -0600 (Thu, 05 Mar 2015)
New Revision: 8386
Added:
www/Swift-T/downloads/gallery.tar.gz
Modified:
www/Swift-T/gallery.html
Log:
Gallery downloads
Added: www/Swift-T/downloads/gallery.tar.gz
===================================================================
(Binary files differ)
Property changes on: www/Swift-T/downloads/gallery.tar.gz
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: www/Swift-T/gallery.html
===================================================================
--- www/Swift-T/gallery.html 2015-03-05 19:23:39 UTC (rev 8385)
+++ www/Swift-T/gallery.html 2015-03-05 19:45:44 UTC (rev 8386)
@@ -761,9 +761,18 @@
<a href="swift.html">General documentation for Swift/T</a>
</p>
</li>
+<li>
+<p>
+Post to <a href="http://lists.mcs.anl.gov/mailman/listinfo/exm-user">the ExM
+ user list</a> with questions about these examples.
+</p>
+</li>
+<li>
+<p>
+These example scripts may be <a href="gallery.tar.gz">downloaded here</a>.
+</p>
+</li>
</ul></div>
-<div class="paragraph"><p>Post to <a href="http://lists.mcs.anl.gov/mailman/listinfo/exm-user">the ExM
-user list</a> with questions about these examples.</p></div>
</div>
</div>
<div class="sect1">
@@ -779,7 +788,7 @@
</div>
</div>
<div class="sect1">
-<h2 id="_running_shell_commands">2. Running shell commands</h2>
+<h2 id="_swift_t_for_shell_users">2. Swift/T for shell users</h2>
<div class="sectionbody">
<div class="paragraph"><p>This script converts itself to octal in <code>mtc.octal</code>.</p></div>
<div class="paragraph"><p><strong>File:</strong> <code>mtc/mtc1.swift</code></p></div>
@@ -819,7 +828,7 @@
</div>
</div>
<div class="sect1">
-<h2 id="_running_many_tasks_on_a_cluster">3. Running many tasks on a cluster</h2>
+<h2 id="_swift_t_for_cluster_users">3. Swift/T for cluster users</h2>
<div class="sectionbody">
<div class="paragraph"><p>It’s easy to launch these kinds of workloads on a cluster.</p></div>
<div class="paragraph"><p>If using a plain host list:</p></div>
@@ -853,7 +862,7 @@
</div>
</div>
<div class="sect1">
-<h2 id="_reductions">4. Reductions</h2>
+<h2 id="_swift_t_for_mapreduce_users">4. Swift/T for MapReduce users</h2>
<div class="sectionbody">
<div class="paragraph"><p>A simplified version of the MapReduce model is to just compute many
things and assemble them together at the end.</p></div>
@@ -885,7 +894,7 @@
</div>
</div>
<div class="sect1">
-<h2 id="_recursion">5. Recursion</h2>
+<h2 id="_swift_t_for_recursive_algorithms">5. Swift/T for recursive algorithms</h2>
<div class="sectionbody">
<div class="paragraph"><p>This script computes the given
<a href="https://en.wikipedia.org/wiki/Fibonacci_number">Fibonacci number</a>:</p></div>
@@ -965,15 +974,65 @@
</div>
</div>
<div class="sect1">
-<h2 id="_python_and_numpy">6. Python and Numpy</h2>
+<h2 id="_swift_t_for_python_and_numpy_users">6. Swift/T for Python and Numpy users</h2>
<div class="sectionbody">
+<div class="paragraph"><p>Swift/T can run Python as an ordinary external program or via a
+bundled interpreter! You can load Python packages, including
+Python-wrapped native code- just set <code>PYTHONPATH</code> and <code>import</code> what
+you need.</p></div>
<div class="paragraph"><p>See this section for information about calling Python or Numpy:
<a href="guide.html#_external_scripting_support">Swift/T Guide: Python</a></p></div>
</div>
</div>
<div class="sect1">
-<h2 id="_static_executables">7. Static executables</h2>
+<h2 id="swift_tcl">7. Swift/T for Tcl users</h2>
<div class="sectionbody">
+<div class="paragraph"><p>Swift/T is a great way to parallelize Tcl applications. You can run
+<code>tclsh</code> as an ordinary external program, or use the bundled Tcl
+interpreter! (Swift/T always has a Tcl interpreter for basic
+operation.) You can load Tcl packages, including Tcl-wrapped native
+code- just set <code>SWIFT_PATH</code> and <code>package require</code> what you need.</p></div>
+<div class="paragraph"><p><strong>File:</strong> <code>swift-tcl/tcl.swift</code></p></div>
+<div class="listingblock">
+<div class="content">
+<pre><code>import io;
+
+(int o) add(int i, int j) "turbine" "0.0"
+[
+"""
+set i <<i>>
+set j <<j>>
+set o [ expr $i + $j ]
+puts "tcl: o=$o"
+set <<o>> $o
+"""
+];
+
+i = 3;
+j = 4;
+o = add(i,j);
+printf("o should be: %i", i+j);
+printf("o is: %i", o);</code></pre>
+</div></div>
+<div class="paragraph"><p>Run this with:</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><code>swift-t -p gallery/swift-tcl/tcl.swift</code></pre>
+</div></div>
+<div class="paragraph"><p>(<code>swift-t -p</code> turns off the C preprocessor and allows the triple-quote
+syntax.)</p></div>
+<div class="paragraph"><p>It outputs:</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><code>o should be: 7
+tcl: o=7
+o is: 7</code></pre>
+</div></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_static_executables">8. Static executables</h2>
+<div class="sectionbody">
<div class="paragraph"><p>This section demonstrates a complete, concrete example of the
<a href="guide.html#mkstatic">static executable</a> feature. First, compose a
Swift script.</p></div>
@@ -1020,7 +1079,7 @@
<div id="footnotes"><hr /></div>
<div id="footer">
<div id="footer-text">
-Last updated 2015-03-05 13:19:55 CST
+Last updated 2015-03-05 13:43:36 CST
</div>
</div>
</body>
More information about the Swift-commit
mailing list