[Swift-commit] r8033 - www/Swift-T

wozniak at ci.uchicago.edu wozniak at ci.uchicago.edu
Wed Jul 16 17:33:31 CDT 2014


Author: wozniak
Date: 2014-07-16 17:41:06 -0500 (Wed, 16 Jul 2014)
New Revision: 8033

Added:
   www/Swift-T/downloads.html
   www/Swift-T/swift.html
Log:
Adding Swift-T/downloads.html Swift-T/swift.html

Added: www/Swift-T/downloads.html
===================================================================
--- www/Swift-T/downloads.html	                        (rev 0)
+++ www/Swift-T/downloads.html	2014-07-16 22:41:06 UTC (rev 8033)
@@ -0,0 +1,1123 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
+    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+<head>
+<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
+<meta name="generator" content="AsciiDoc 8.6.7" />
+<title>Swift/T Downloads</title>
+<style type="text/css">
+/* Shared CSS for AsciiDoc xhtml11 and html5 backends */
+
+/* Default font. */
+body {
+  font-family: Georgia,serif;
+}
+
+/* Title font. */
+h1, h2, h3, h4, h5, h6,
+div.title, caption.title,
+thead, p.table.header,
+#toctitle,
+#author, #revnumber, #revdate, #revremark,
+#footer {
+  font-family: Arial,Helvetica,sans-serif;
+}
+
+body {
+  margin: 1em 5% 1em 5%;
+}
+
+a {
+  color: blue;
+  text-decoration: underline;
+}
+a:visited {
+  color: fuchsia;
+}
+
+em {
+  font-style: italic;
+  color: navy;
+}
+
+strong {
+  font-weight: bold;
+  color: #083194;
+}
+
+h1, h2, h3, h4, h5, h6 {
+  color: #527bbd;
+  margin-top: 1.2em;
+  margin-bottom: 0.5em;
+  line-height: 1.3;
+}
+
+h1, h2, h3 {
+  border-bottom: 2px solid silver;
+}
+h2 {
+  padding-top: 0.5em;
+}
+h3 {
+  float: left;
+}
+h3 + * {
+  clear: left;
+}
+h5 {
+  font-size: 1.0em;
+}
+
+div.sectionbody {
+  margin-left: 0;
+}
+
+hr {
+  border: 1px solid silver;
+}
+
+p {
+  margin-top: 0.5em;
+  margin-bottom: 0.5em;
+}
+
+ul, ol, li > p {
+  margin-top: 0;
+}
+ul > li     { color: #aaa; }
+ul > li > * { color: black; }
+
+pre {
+  padding: 0;
+  margin: 0;
+}
+
+#author {
+  color: #527bbd;
+  font-weight: bold;
+  font-size: 1.1em;
+}
+#email {
+}
+#revnumber, #revdate, #revremark {
+}
+
+#footer {
+  font-size: small;
+  border-top: 2px solid silver;
+  padding-top: 0.5em;
+  margin-top: 4.0em;
+}
+#footer-text {
+  float: left;
+  padding-bottom: 0.5em;
+}
+#footer-badges {
+  float: right;
+  padding-bottom: 0.5em;
+}
+
+#preamble {
+  margin-top: 1.5em;
+  margin-bottom: 1.5em;
+}
+div.imageblock, div.exampleblock, div.verseblock,
+div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
+div.admonitionblock {
+  margin-top: 1.0em;
+  margin-bottom: 1.5em;
+}
+div.admonitionblock {
+  margin-top: 2.0em;
+  margin-bottom: 2.0em;
+  margin-right: 10%;
+  color: #606060;
+}
+
+div.content { /* Block element content. */
+  padding: 0;
+}
+
+/* Block element titles. */
+div.title, caption.title {
+  color: #527bbd;
+  font-weight: bold;
+  text-align: left;
+  margin-top: 1.0em;
+  margin-bottom: 0.5em;
+}
+div.title + * {
+  margin-top: 0;
+}
+
+td div.title:first-child {
+  margin-top: 0.0em;
+}
+div.content div.title:first-child {
+  margin-top: 0.0em;
+}
+div.content + div.title {
+  margin-top: 0.0em;
+}
+
+div.sidebarblock > div.content {
+  background: #ffffee;
+  border: 1px solid #dddddd;
+  border-left: 4px solid #f0f0f0;
+  padding: 0.5em;
+}
+
+div.listingblock > div.content {
+  border: 1px solid #dddddd;
+  border-left: 5px solid #f0f0f0;
+  background: #f8f8f8;
+  padding: 0.5em;
+}
+
+div.quoteblock, div.verseblock {
+  padding-left: 1.0em;
+  margin-left: 1.0em;
+  margin-right: 10%;
+  border-left: 5px solid #f0f0f0;
+  color: #888;
+}
+
+div.quoteblock > div.attribution {
+  padding-top: 0.5em;
+  text-align: right;
+}
+
+div.verseblock > pre.content {
+  font-family: inherit;
+  font-size: inherit;
+}
+div.verseblock > div.attribution {
+  padding-top: 0.75em;
+  text-align: left;
+}
+/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
+div.verseblock + div.attribution {
+  text-align: left;
+}
+
+div.admonitionblock .icon {
+  vertical-align: top;
+  font-size: 1.1em;
+  font-weight: bold;
+  text-decoration: underline;
+  color: #527bbd;
+  padding-right: 0.5em;
+}
+div.admonitionblock td.content {
+  padding-left: 0.5em;
+  border-left: 3px solid #dddddd;
+}
+
+div.exampleblock > div.content {
+  border-left: 3px solid #dddddd;
+  padding-left: 0.5em;
+}
+
+div.imageblock div.content { padding-left: 0; }
+span.image img { border-style: none; }
+a.image:visited { color: white; }
+
+dl {
+  margin-top: 0.8em;
+  margin-bottom: 0.8em;
+}
+dt {
+  margin-top: 0.5em;
+  margin-bottom: 0;
+  font-style: normal;
+  color: navy;
+}
+dd > *:first-child {
+  margin-top: 0.1em;
+}
+
+ul, ol {
+    list-style-position: outside;
+}
+ol.arabic {
+  list-style-type: decimal;
+}
+ol.loweralpha {
+  list-style-type: lower-alpha;
+}
+ol.upperalpha {
+  list-style-type: upper-alpha;
+}
+ol.lowerroman {
+  list-style-type: lower-roman;
+}
+ol.upperroman {
+  list-style-type: upper-roman;
+}
+
+div.compact ul, div.compact ol,
+div.compact p, div.compact p,
+div.compact div, div.compact div {
+  margin-top: 0.1em;
+  margin-bottom: 0.1em;
+}
+
+tfoot {
+  font-weight: bold;
+}
+td > div.verse {
+  white-space: pre;
+}
+
+div.hdlist {
+  margin-top: 0.8em;
+  margin-bottom: 0.8em;
+}
+div.hdlist tr {
+  padding-bottom: 15px;
+}
+dt.hdlist1.strong, td.hdlist1.strong {
+  font-weight: bold;
+}
+td.hdlist1 {
+  vertical-align: top;
+  font-style: normal;
+  padding-right: 0.8em;
+  color: navy;
+}
+td.hdlist2 {
+  vertical-align: top;
+}
+div.hdlist.compact tr {
+  margin: 0;
+  padding-bottom: 0;
+}
+
+.comment {
+  background: yellow;
+}
+
+.footnote, .footnoteref {
+  font-size: 0.8em;
+}
+
+span.footnote, span.footnoteref {
+  vertical-align: super;
+}
+
+#footnotes {
+  margin: 20px 0 20px 0;
+  padding: 7px 0 0 0;
+}
+
+#footnotes div.footnote {
+  margin: 0 0 5px 0;
+}
+
+#footnotes hr {
+  border: none;
+  border-top: 1px solid silver;
+  height: 1px;
+  text-align: left;
+  margin-left: 0;
+  width: 20%;
+  min-width: 100px;
+}
+
+div.colist td {
+  padding-right: 0.5em;
+  padding-bottom: 0.3em;
+  vertical-align: top;
+}
+div.colist td img {
+  margin-top: 0.3em;
+}
+
+ at media print {
+  #footer-badges { display: none; }
+}
+
+#toc {
+  margin-bottom: 2.5em;
+}
+
+#toctitle {
+  color: #527bbd;
+  font-size: 1.1em;
+  font-weight: bold;
+  margin-top: 1.0em;
+  margin-bottom: 0.1em;
+}
+
+div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
+  margin-top: 0;
+  margin-bottom: 0;
+}
+div.toclevel2 {
+  margin-left: 2em;
+  font-size: 0.9em;
+}
+div.toclevel3 {
+  margin-left: 4em;
+  font-size: 0.9em;
+}
+div.toclevel4 {
+  margin-left: 6em;
+  font-size: 0.9em;
+}
+
+span.aqua { color: aqua; }
+span.black { color: black; }
+span.blue { color: blue; }
+span.fuchsia { color: fuchsia; }
+span.gray { color: gray; }
+span.green { color: green; }
+span.lime { color: lime; }
+span.maroon { color: maroon; }
+span.navy { color: navy; }
+span.olive { color: olive; }
+span.purple { color: purple; }
+span.red { color: red; }
+span.silver { color: silver; }
+span.teal { color: teal; }
+span.white { color: white; }
+span.yellow { color: yellow; }
+
+span.aqua-background { background: aqua; }
+span.black-background { background: black; }
+span.blue-background { background: blue; }
+span.fuchsia-background { background: fuchsia; }
+span.gray-background { background: gray; }
+span.green-background { background: green; }
+span.lime-background { background: lime; }
+span.maroon-background { background: maroon; }
+span.navy-background { background: navy; }
+span.olive-background { background: olive; }
+span.purple-background { background: purple; }
+span.red-background { background: red; }
+span.silver-background { background: silver; }
+span.teal-background { background: teal; }
+span.white-background { background: white; }
+span.yellow-background { background: yellow; }
+
+span.big { font-size: 2em; }
+span.small { font-size: 0.6em; }
+
+span.underline { text-decoration: underline; }
+span.overline { text-decoration: overline; }
+span.line-through { text-decoration: line-through; }
+
+div.unbreakable { page-break-inside: avoid; }
+
+
+/*
+ * xhtml11 specific
+ *
+ * */
+
+tt {
+  font-family: "Courier New", Courier, monospace;
+  font-size: inherit;
+  color: navy;
+}
+
+div.tableblock {
+  margin-top: 1.0em;
+  margin-bottom: 1.5em;
+}
+div.tableblock > table {
+  border: 3px solid #527bbd;
+}
+thead, p.table.header {
+  font-weight: bold;
+  color: #527bbd;
+}
+p.table {
+  margin-top: 0;
+}
+/* Because the table frame attribute is overriden by CSS in most browsers. */
+div.tableblock > table[frame="void"] {
+  border-style: none;
+}
+div.tableblock > table[frame="hsides"] {
+  border-left-style: none;
+  border-right-style: none;
+}
+div.tableblock > table[frame="vsides"] {
+  border-top-style: none;
+  border-bottom-style: none;
+}
+
+
+/*
+ * html5 specific
+ *
+ * */
+
+.monospaced {
+  font-family: "Courier New", Courier, monospace;
+  font-size: inherit;
+  color: navy;
+}
+
+table.tableblock {
+  margin-top: 1.0em;
+  margin-bottom: 1.5em;
+}
+thead, p.tableblock.header {
+  font-weight: bold;
+  color: #527bbd;
+}
+p.tableblock {
+  margin-top: 0;
+}
+table.tableblock {
+  border-width: 3px;
+  border-spacing: 0px;
+  border-style: solid;
+  border-color: #527bbd;
+  border-collapse: collapse;
+}
+th.tableblock, td.tableblock {
+  border-width: 1px;
+  padding: 4px;
+  border-style: solid;
+  border-color: #527bbd;
+}
+
+table.tableblock.frame-topbot {
+  border-left-style: hidden;
+  border-right-style: hidden;
+}
+table.tableblock.frame-sides {
+  border-top-style: hidden;
+  border-bottom-style: hidden;
+}
+table.tableblock.frame-none {
+  border-style: hidden;
+}
+
+th.tableblock.halign-left, td.tableblock.halign-left {
+  text-align: left;
+}
+th.tableblock.halign-center, td.tableblock.halign-center {
+  text-align: center;
+}
+th.tableblock.halign-right, td.tableblock.halign-right {
+  text-align: right;
+}
+
+th.tableblock.valign-top, td.tableblock.valign-top {
+  vertical-align: top;
+}
+th.tableblock.valign-middle, td.tableblock.valign-middle {
+  vertical-align: middle;
+}
+th.tableblock.valign-bottom, td.tableblock.valign-bottom {
+  vertical-align: bottom;
+}
+
+
+/*
+ * manpage specific
+ *
+ * */
+
+body.manpage h1 {
+  padding-top: 0.5em;
+  padding-bottom: 0.5em;
+  border-top: 2px solid silver;
+  border-bottom: 2px solid silver;
+}
+body.manpage h2 {
+  border-style: none;
+}
+body.manpage div.sectionbody {
+  margin-left: 3em;
+}
+
+ at media print {
+  body.manpage div#toc { display: none; }
+}
+</style>
+<script type="text/javascript">
+/*<![CDATA[*/
+var asciidoc = {  // Namespace.
+
+/////////////////////////////////////////////////////////////////////
+// Table Of Contents generator
+/////////////////////////////////////////////////////////////////////
+
+/* Author: Mihai Bazon, September 2002
+ * http://students.infoiasi.ro/~mishoo
+ *
+ * Table Of Content generator
+ * Version: 0.4
+ *
+ * Feel free to use this script under the terms of the GNU General Public
+ * License, as long as you do not remove or alter this notice.
+ */
+
+ /* modified by Troy D. Hanson, September 2006. License: GPL */
+ /* modified by Stuart Rackham, 2006, 2009. License: GPL */
+
+// toclevels = 1..4.
+toc: function (toclevels) {
+
+  function getText(el) {
+    var text = "";
+    for (var i = el.firstChild; i != null; i = i.nextSibling) {
+      if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
+        text += i.data;
+      else if (i.firstChild != null)
+        text += getText(i);
+    }
+    return text;
+  }
+
+  function TocEntry(el, text, toclevel) {
+    this.element = el;
+    this.text = text;
+    this.toclevel = toclevel;
+  }
+
+  function tocEntries(el, toclevels) {
+    var result = new Array;
+    var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');
+    // Function that scans the DOM tree for header elements (the DOM2
+    // nodeIterator API would be a better technique but not supported by all
+    // browsers).
+    var iterate = function (el) {
+      for (var i = el.firstChild; i != null; i = i.nextSibling) {
+        if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
+          var mo = re.exec(i.tagName);
+          if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
+            result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
+          }
+          iterate(i);
+        }
+      }
+    }
+    iterate(el);
+    return result;
+  }
+
+  var toc = document.getElementById("toc");
+  if (!toc) {
+    return;
+  }
+
+  // Delete existing TOC entries in case we're reloading the TOC.
+  var tocEntriesToRemove = [];
+  var i;
+  for (i = 0; i < toc.childNodes.length; i++) {
+    var entry = toc.childNodes[i];
+    if (entry.nodeName.toLowerCase() == 'div'
+     && entry.getAttribute("class")
+     && entry.getAttribute("class").match(/^toclevel/))
+      tocEntriesToRemove.push(entry);
+  }
+  for (i = 0; i < tocEntriesToRemove.length; i++) {
+    toc.removeChild(tocEntriesToRemove[i]);
+  }
+
+  // Rebuild TOC entries.
+  var entries = tocEntries(document.getElementById("content"), toclevels);
+  for (var i = 0; i < entries.length; ++i) {
+    var entry = entries[i];
+    if (entry.element.id == "")
+      entry.element.id = "_toc_" + i;
+    var a = document.createElement("a");
+    a.href = "#" + entry.element.id;
+    a.appendChild(document.createTextNode(entry.text));
+    var div = document.createElement("div");
+    div.appendChild(a);
+    div.className = "toclevel" + entry.toclevel;
+    toc.appendChild(div);
+  }
+  if (entries.length == 0)
+    toc.parentNode.removeChild(toc);
+},
+
+
+/////////////////////////////////////////////////////////////////////
+// Footnotes generator
+/////////////////////////////////////////////////////////////////////
+
+/* Based on footnote generation code from:
+ * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
+ */
+
+footnotes: function () {
+  // Delete existing footnote entries in case we're reloading the footnodes.
+  var i;
+  var noteholder = document.getElementById("footnotes");
+  if (!noteholder) {
+    return;
+  }
+  var entriesToRemove = [];
+  for (i = 0; i < noteholder.childNodes.length; i++) {
+    var entry = noteholder.childNodes[i];
+    if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
+      entriesToRemove.push(entry);
+  }
+  for (i = 0; i < entriesToRemove.length; i++) {
+    noteholder.removeChild(entriesToRemove[i]);
+  }
+
+  // Rebuild footnote entries.
+  var cont = document.getElementById("content");
+  var spans = cont.getElementsByTagName("span");
+  var refs = {};
+  var n = 0;
+  for (i=0; i<spans.length; i++) {
+    if (spans[i].className == "footnote") {
+      n++;
+      var note = spans[i].getAttribute("data-note");
+      if (!note) {
+        // Use [\s\S] in place of . so multi-line matches work.
+        // Because JavaScript has no s (dotall) regex flag.
+        note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
+        spans[i].innerHTML =
+          "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
+          "' title='View footnote' class='footnote'>" + n + "</a>]";
+        spans[i].setAttribute("data-note", note);
+      }
+      noteholder.innerHTML +=
+        "<div class='footnote' id='_footnote_" + n + "'>" +
+        "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
+        n + "</a>. " + note + "</div>";
+      var id =spans[i].getAttribute("id");
+      if (id != null) refs["#"+id] = n;
+    }
+  }
+  if (n == 0)
+    noteholder.parentNode.removeChild(noteholder);
+  else {
+    // Process footnoterefs.
+    for (i=0; i<spans.length; i++) {
+      if (spans[i].className == "footnoteref") {
+        var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
+        href = href.match(/#.*/)[0];  // Because IE return full URL.
+        n = refs[href];
+        spans[i].innerHTML =
+          "[<a href='#_footnote_" + n +
+          "' title='View footnote' class='footnote'>" + n + "</a>]";
+      }
+    }
+  }
+},
+
+install: function(toclevels) {
+  var timerId;
+
+  function reinstall() {
+    asciidoc.footnotes();
+    if (toclevels) {
+      asciidoc.toc(toclevels);
+    }
+  }
+
+  function reinstallAndRemoveTimer() {
+    clearInterval(timerId);
+    reinstall();
+  }
+
+  timerId = setInterval(reinstall, 500);
+  if (document.addEventListener)
+    document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);
+  else
+    window.onload = reinstallAndRemoveTimer;
+}
+
+}
+asciidoc.install();
+/*]]>*/
+</script>
+</head>
+<body class="article">
+<div id="header">
+<h1>Swift/T Downloads</h1>
+</div>
+<div id="content">
+<div class="sect1">
+<h2 id="_overview">Overview</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>This page has information regarding the current and historical Swift/T
+releases.</p></div>
+<div class="paragraph"><p>Swift/T consists of multiple components which have their own version
+numbers.  The release numbers are formatted as <tt>major.minor.bugfix</tt>.</p></div>
+<div class="paragraph"><p>Swift/T will make feature releases on a monthly basis, which increment
+the <tt>minor</tt> version number.</p></div>
+<div class="paragraph"><p>Downloadable packages based on SVN <tt>trunk</tt> and/or SVN access may be
+made available to certain users as necessary.</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_series_0_5">Series 0.5</h2>
+<div class="sectionbody">
+<div class="sect2">
+<h3 id="_current_stable_0_5_0">Current/Stable: 0.5.0</h3>
+<div class="ulist"><ul>
+<li>
+<p>
+Release 0.5.0 [<a href="http://www.mcs.anl.gov/exm/local/downloads/exm-0.5.0.tar.gz">exm-0.5.0.tar.gz</a>] (6.5 MB)
+</p>
+</li>
+<li>
+<p>
+10/9/2013
+</p>
+</li>
+</ul></div>
+<div class="paragraph"><p><strong>Changes:</strong></p></div>
+<div class="ulist"><ul>
+<li>
+<p>
+Full implementation of garbage collection
+</p>
+</li>
+<li>
+<p>
+Improved Cobalt support
+</p>
+</li>
+<li>
+<p>
+Improved Python, R support
+</p>
+</li>
+<li>
+<p>
+Support for additional array key types (string, float, boolean, etc)
+</p>
+</li>
+<li>
+<p>
+New Turbine worker service feature-
+  allows launching a user-specified service on a Swift worker node
+</p>
+</li>
+<li>
+<p>
+Full support for <tt>@location</tt> feature-
+  allows sending a Swift task to a specific rank or hostname
+</p>
+</li>
+<li>
+<p>
+New miscellaneous builtin functions
+</p>
+</li>
+</ul></div>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_series_0_4">Series 0.4</h2>
+<div class="sectionbody">
+<div class="sect2">
+<h3 id="_0_4_0">0.4.0</h3>
+<div class="ulist"><ul>
+<li>
+<p>
+Release 0.4.0 [<a href="http://www.mcs.anl.gov/exm/local/downloads/exm-0.4.0.tar.gz">exm-0.4.0.tar.gz</a>] (6.4 MB)
+</p>
+</li>
+<li>
+<p>
+7/15/2013
+</p>
+</li>
+</ul></div>
+<div class="paragraph"><p><strong>Changes:</strong></p></div>
+<div class="ulist"><ul>
+<li>
+<p>
+Built-in support for Python and R
+</p>
+</li>
+<li>
+<p>
+New directory concatenation operator
+</p>
+</li>
+<li>
+<p>
+Renamed I/O functions: new names: <tt>read()</tt>, <tt>write()</tt>
+</p>
+</li>
+<li>
+<p>
+Support for Tcl 8.6
+</p>
+</li>
+<li>
+<p>
+STC provides a default output file name
+</p>
+</li>
+<li>
+<p>
+New Swift syntax for multiline strings
+</p>
+</li>
+</ul></div>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_series_0_3">Series 0.3</h2>
+<div class="sectionbody">
+<div class="sect2">
+<h3 id="_0_3_0">0.3.0</h3>
+<div class="ulist"><ul>
+<li>
+<p>
+Release 0.3.0 [<a href="http://www.mcs.anl.gov/exm/local/downloads/exm-0.3.0.tar.gz">exm-0.3.0.tar.gz</a>] (6.4 MB)
+</p>
+</li>
+<li>
+<p>
+5/12/2013
+</p>
+</li>
+</ul></div>
+<div class="paragraph"><p><strong>Changes:</strong></p></div>
+<div class="ulist"><ul>
+<li>
+<p>
+Many new builtin functions, including:
+</p>
+<div class="ulist"><ul>
+<li>
+<p>
+File operations
+</p>
+</li>
+<li>
+<p>
+Functions to deal with Fortran data
+</p>
+</li>
+</ul></div>
+</li>
+<li>
+<p>
+Parallel tasks available at the Swift level (<tt>@par</tt>)
+</p>
+</li>
+<li>
+<p>
+Task location targeting available at the Swift level (<tt>@location</tt>)
+</p>
+</li>
+<li>
+<p>
+Ability to call Swift as a library from a larger MPI program
+</p>
+</li>
+<li>
+<p>
+Statement sequencing syntax (<tt>=></tt>)
+</p>
+</li>
+<li>
+<p>
+Syntax for scientific notation
+</p>
+</li>
+<li>
+<p>
+New Swift module framework based on <tt>import</tt> statement
+</p>
+</li>
+<li>
+<p>
+Compile-time constants available from STC command line (with optimization)
+</p>
+</li>
+<li>
+<p>
+Many improvements to STC optimizations
+</p>
+</li>
+</ul></div>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_series_0_2">Series 0.2</h2>
+<div class="sectionbody">
+<div class="sect2">
+<h3 id="_0_2_1">0.2.1</h3>
+<div class="ulist"><ul>
+<li>
+<p>
+Release 0.2.1 [<a href="http://www.mcs.anl.gov/exm/local/downloads/exm-0.2.1.tar.gz">exm-0.2.1.tar.gz</a>] (5.8 MB)
+</p>
+</li>
+<li>
+<p>
+2/18/2013
+</p>
+</li>
+</ul></div>
+<div class="paragraph"><p><strong>Changes:</strong></p></div>
+<div class="ulist"><ul>
+<li>
+<p>
+Build fixes for the Mac- thanks to Yongyang Cai for interaction
+</p>
+</li>
+<li>
+<p>
+Build fix for <tt>strnlen()</tt> on some machines
+</p>
+</li>
+<li>
+<p>
+Installation fix for SLURM
+</p>
+</li>
+</ul></div>
+</div>
+<div class="sect2">
+<h3 id="_0_2_0">0.2.0</h3>
+<div class="ulist"><ul>
+<li>
+<p>
+Release 0.2.0 [<a href="http://www.mcs.anl.gov/exm/local/downloads/exm-0.2.0.tar.gz">exm-0.2.0.tar.gz</a>] (5.8 MB)
+</p>
+</li>
+<li>
+<p>
+2/6/2013
+</p>
+</li>
+</ul></div>
+<div class="paragraph"><p><strong>Changes:</strong></p></div>
+<div class="ulist"><ul>
+<li>
+<p>
+Many new builtin functions
+</p>
+</li>
+<li>
+<p>
+Many STC optimization improvements
+</p>
+</li>
+<li>
+<p>
+Improved app function support, including output redirection
+</p>
+</li>
+<li>
+<p>
+Experimental support for garbage collection
+</p>
+</li>
+<li>
+<p>
+Limited type inference
+</p>
+</li>
+<li>
+<p>
+<tt>type</tt> and <tt>typedef</tt> statements
+</p>
+</li>
+<li>
+<p>
+Parallel task support in ADLB: not yet available from Swift
+</p>
+</li>
+</ul></div>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_series_0_1">Series 0.1</h2>
+<div class="sectionbody">
+<div class="sect2">
+<h3 id="_0_1_1">0.1.1</h3>
+<div class="ulist"><ul>
+<li>
+<p>
+Release 0.1.1 [<a href="http://www.mcs.anl.gov/exm/local/downloads/exm-0.1.0.tar.gz">exm-0.1.1.tar.gz</a>] (5.8 MB)
+</p>
+</li>
+<li>
+<p>
+11/20/2012
+</p>
+</li>
+</ul></div>
+<div class="paragraph"><p><strong>Changes:</strong></p></div>
+<div class="ulist"><ul>
+<li>
+<p>
+New string functions
+</p>
+</li>
+<li>
+<p>
+New I/O functions
+</p>
+</li>
+<li>
+<p>
+Significant runtime local performance improvements
+</p>
+</li>
+<li>
+<p>
+STC loop hoisting optimization - improves performance significantly
+  for some patterns such as accessing multidimensional array in loop
+</p>
+</li>
+<li>
+<p>
+Miscellaneous bug fixes in STC
+</p>
+</li>
+<li>
+<p>
+Experimental support for automatically generating Tcl wrappers
+  for user extension functions
+</p>
+</li>
+<li>
+<p>
+Swift/T syntax change: replace <tt>@x@</tt> with <tt>@prio=x</tt> for priority annotation
+</p>
+</li>
+</ul></div>
+</div>
+<div class="sect2">
+<h3 id="_0_1_0">0.1.0</h3>
+<div class="ulist"><ul>
+<li>
+<p>
+Release 0.1.0 [<a href="http://www.mcs.anl.gov/exm/local/downloads/exm-0.1.0.tar.gz">exm-0.1.0.tar.gz</a>] (5.7 MB)
+</p>
+</li>
+<li>
+<p>
+10/15/2012
+</p>
+</li>
+</ul></div>
+</div>
+</div>
+</div>
+</div>
+<div id="footnotes"><hr /></div>
+<div id="footer">
+<div id="footer-text">
+Last updated 2013-10-09 10:58:41 CDT
+</div>
+</div>
+</body>
+</html>

Added: www/Swift-T/swift.html
===================================================================
--- www/Swift-T/swift.html	                        (rev 0)
+++ www/Swift-T/swift.html	2014-07-16 22:41:06 UTC (rev 8033)
@@ -0,0 +1,3738 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
+    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+<head>
+<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
+<meta name="generator" content="AsciiDoc 8.6.7" />
+<title>Swift/T Guide</title>
+<style type="text/css">
+/* Shared CSS for AsciiDoc xhtml11 and html5 backends */
+
+/* Default font. */
+body {
+  font-family: Georgia,serif;
+}
+
+/* Title font. */
+h1, h2, h3, h4, h5, h6,
+div.title, caption.title,
+thead, p.table.header,
+#toctitle,
+#author, #revnumber, #revdate, #revremark,
+#footer {
+  font-family: Arial,Helvetica,sans-serif;
+}
+
+body {
+  margin: 1em 5% 1em 5%;
+}
+
+a {
+  color: blue;
+  text-decoration: underline;
+}
+a:visited {
+  color: fuchsia;
+}
+
+em {
+  font-style: italic;
+  color: navy;
+}
+
+strong {
+  font-weight: bold;
+  color: #083194;
+}
+
+h1, h2, h3, h4, h5, h6 {
+  color: #527bbd;
+  margin-top: 1.2em;
+  margin-bottom: 0.5em;
+  line-height: 1.3;
+}
+
+h1, h2, h3 {
+  border-bottom: 2px solid silver;
+}
+h2 {
+  padding-top: 0.5em;
+}
+h3 {
+  float: left;
+}
+h3 + * {
+  clear: left;
+}
+h5 {
+  font-size: 1.0em;
+}
+
+div.sectionbody {
+  margin-left: 0;
+}
+
+hr {
+  border: 1px solid silver;
+}
+
+p {
+  margin-top: 0.5em;
+  margin-bottom: 0.5em;
+}
+
+ul, ol, li > p {
+  margin-top: 0;
+}
+ul > li     { color: #aaa; }
+ul > li > * { color: black; }
+
+pre {
+  padding: 0;
+  margin: 0;
+}
+
+#author {
+  color: #527bbd;
+  font-weight: bold;
+  font-size: 1.1em;
+}
+#email {
+}
+#revnumber, #revdate, #revremark {
+}
+
+#footer {
+  font-size: small;
+  border-top: 2px solid silver;
+  padding-top: 0.5em;
+  margin-top: 4.0em;
+}
+#footer-text {
+  float: left;
+  padding-bottom: 0.5em;
+}
+#footer-badges {
+  float: right;
+  padding-bottom: 0.5em;
+}
+
+#preamble {
+  margin-top: 1.5em;
+  margin-bottom: 1.5em;
+}
+div.imageblock, div.exampleblock, div.verseblock,
+div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
+div.admonitionblock {
+  margin-top: 1.0em;
+  margin-bottom: 1.5em;
+}
+div.admonitionblock {
+  margin-top: 2.0em;
+  margin-bottom: 2.0em;
+  margin-right: 10%;
+  color: #606060;
+}
+
+div.content { /* Block element content. */
+  padding: 0;
+}
+
+/* Block element titles. */
+div.title, caption.title {
+  color: #527bbd;
+  font-weight: bold;
+  text-align: left;
+  margin-top: 1.0em;
+  margin-bottom: 0.5em;
+}
+div.title + * {
+  margin-top: 0;
+}
+
+td div.title:first-child {
+  margin-top: 0.0em;
+}
+div.content div.title:first-child {
+  margin-top: 0.0em;
+}
+div.content + div.title {
+  margin-top: 0.0em;
+}
+
+div.sidebarblock > div.content {
+  background: #ffffee;
+  border: 1px solid #dddddd;
+  border-left: 4px solid #f0f0f0;
+  padding: 0.5em;
+}
+
+div.listingblock > div.content {
+  border: 1px solid #dddddd;
+  border-left: 5px solid #f0f0f0;
+  background: #f8f8f8;
+  padding: 0.5em;
+}
+
+div.quoteblock, div.verseblock {
+  padding-left: 1.0em;
+  margin-left: 1.0em;
+  margin-right: 10%;
+  border-left: 5px solid #f0f0f0;
+  color: #888;
+}
+
+div.quoteblock > div.attribution {
+  padding-top: 0.5em;
+  text-align: right;
+}
+
+div.verseblock > pre.content {
+  font-family: inherit;
+  font-size: inherit;
+}
+div.verseblock > div.attribution {
+  padding-top: 0.75em;
+  text-align: left;
+}
+/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
+div.verseblock + div.attribution {
+  text-align: left;
+}
+
+div.admonitionblock .icon {
+  vertical-align: top;
+  font-size: 1.1em;
+  font-weight: bold;
+  text-decoration: underline;
+  color: #527bbd;
+  padding-right: 0.5em;
+}
+div.admonitionblock td.content {
+  padding-left: 0.5em;
+  border-left: 3px solid #dddddd;
+}
+
+div.exampleblock > div.content {
+  border-left: 3px solid #dddddd;
+  padding-left: 0.5em;
+}
+
+div.imageblock div.content { padding-left: 0; }
+span.image img { border-style: none; }
+a.image:visited { color: white; }
+
+dl {
+  margin-top: 0.8em;
+  margin-bottom: 0.8em;
+}
+dt {
+  margin-top: 0.5em;
+  margin-bottom: 0;
+  font-style: normal;
+  color: navy;
+}
+dd > *:first-child {
+  margin-top: 0.1em;
+}
+
+ul, ol {
+    list-style-position: outside;
+}
+ol.arabic {
+  list-style-type: decimal;
+}
+ol.loweralpha {
+  list-style-type: lower-alpha;
+}
+ol.upperalpha {
+  list-style-type: upper-alpha;
+}
+ol.lowerroman {
+  list-style-type: lower-roman;
+}
+ol.upperroman {
+  list-style-type: upper-roman;
+}
+
+div.compact ul, div.compact ol,
+div.compact p, div.compact p,
+div.compact div, div.compact div {
+  margin-top: 0.1em;
+  margin-bottom: 0.1em;
+}
+
+tfoot {
+  font-weight: bold;
+}
+td > div.verse {
+  white-space: pre;
+}
+
+div.hdlist {
+  margin-top: 0.8em;
+  margin-bottom: 0.8em;
+}
+div.hdlist tr {
+  padding-bottom: 15px;
+}
+dt.hdlist1.strong, td.hdlist1.strong {
+  font-weight: bold;
+}
+td.hdlist1 {
+  vertical-align: top;
+  font-style: normal;
+  padding-right: 0.8em;
+  color: navy;
+}
+td.hdlist2 {
+  vertical-align: top;
+}
+div.hdlist.compact tr {
+  margin: 0;
+  padding-bottom: 0;
+}
+
+.comment {
+  background: yellow;
+}
+
+.footnote, .footnoteref {
+  font-size: 0.8em;
+}
+
+span.footnote, span.footnoteref {
+  vertical-align: super;
+}
+
+#footnotes {
+  margin: 20px 0 20px 0;
+  padding: 7px 0 0 0;
+}
+
+#footnotes div.footnote {
+  margin: 0 0 5px 0;
+}
+
+#footnotes hr {
+  border: none;
+  border-top: 1px solid silver;
+  height: 1px;
+  text-align: left;
+  margin-left: 0;
+  width: 20%;
+  min-width: 100px;
+}
+
+div.colist td {
+  padding-right: 0.5em;
+  padding-bottom: 0.3em;
+  vertical-align: top;
+}
+div.colist td img {
+  margin-top: 0.3em;
+}
+
+ at media print {
+  #footer-badges { display: none; }
+}
+
+#toc {
+  margin-bottom: 2.5em;
+}
+
+#toctitle {
+  color: #527bbd;
+  font-size: 1.1em;
+  font-weight: bold;
+  margin-top: 1.0em;
+  margin-bottom: 0.1em;
+}
+
+div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
+  margin-top: 0;
+  margin-bottom: 0;
+}
+div.toclevel2 {
+  margin-left: 2em;
+  font-size: 0.9em;
+}
+div.toclevel3 {
+  margin-left: 4em;
+  font-size: 0.9em;
+}
+div.toclevel4 {
+  margin-left: 6em;
+  font-size: 0.9em;
+}
+
+span.aqua { color: aqua; }
+span.black { color: black; }
+span.blue { color: blue; }
+span.fuchsia { color: fuchsia; }
+span.gray { color: gray; }
+span.green { color: green; }
+span.lime { color: lime; }
+span.maroon { color: maroon; }
+span.navy { color: navy; }
+span.olive { color: olive; }
+span.purple { color: purple; }
+span.red { color: red; }
+span.silver { color: silver; }
+span.teal { color: teal; }
+span.white { color: white; }
+span.yellow { color: yellow; }
+
+span.aqua-background { background: aqua; }
+span.black-background { background: black; }
+span.blue-background { background: blue; }
+span.fuchsia-background { background: fuchsia; }
+span.gray-background { background: gray; }
+span.green-background { background: green; }
+span.lime-background { background: lime; }
+span.maroon-background { background: maroon; }
+span.navy-background { background: navy; }
+span.olive-background { background: olive; }
+span.purple-background { background: purple; }
+span.red-background { background: red; }
+span.silver-background { background: silver; }
+span.teal-background { background: teal; }
+span.white-background { background: white; }
+span.yellow-background { background: yellow; }
+
+span.big { font-size: 2em; }
+span.small { font-size: 0.6em; }
+
+span.underline { text-decoration: underline; }
+span.overline { text-decoration: overline; }
+span.line-through { text-decoration: line-through; }
+
+div.unbreakable { page-break-inside: avoid; }
+
+
+/*
+ * xhtml11 specific
+ *
+ * */
+
+tt {
+  font-family: "Courier New", Courier, monospace;
+  font-size: inherit;
+  color: navy;
+}
+
+div.tableblock {
+  margin-top: 1.0em;
+  margin-bottom: 1.5em;
+}
+div.tableblock > table {
+  border: 3px solid #527bbd;
+}
+thead, p.table.header {
+  font-weight: bold;
+  color: #527bbd;
+}
+p.table {
+  margin-top: 0;
+}
+/* Because the table frame attribute is overriden by CSS in most browsers. */
+div.tableblock > table[frame="void"] {
+  border-style: none;
+}
+div.tableblock > table[frame="hsides"] {
+  border-left-style: none;
+  border-right-style: none;
+}
+div.tableblock > table[frame="vsides"] {
+  border-top-style: none;
+  border-bottom-style: none;
+}
+
+
+/*
+ * html5 specific
+ *
+ * */
+
+.monospaced {
+  font-family: "Courier New", Courier, monospace;
+  font-size: inherit;
+  color: navy;
+}
+
+table.tableblock {
+  margin-top: 1.0em;
+  margin-bottom: 1.5em;
+}
+thead, p.tableblock.header {
+  font-weight: bold;
+  color: #527bbd;
+}
+p.tableblock {
+  margin-top: 0;
+}
+table.tableblock {
+  border-width: 3px;
+  border-spacing: 0px;
+  border-style: solid;
+  border-color: #527bbd;
+  border-collapse: collapse;
+}
+th.tableblock, td.tableblock {
+  border-width: 1px;
+  padding: 4px;
+  border-style: solid;
+  border-color: #527bbd;
+}
+
+table.tableblock.frame-topbot {
+  border-left-style: hidden;
+  border-right-style: hidden;
+}
+table.tableblock.frame-sides {
+  border-top-style: hidden;
+  border-bottom-style: hidden;
+}
+table.tableblock.frame-none {
+  border-style: hidden;
+}
+
+th.tableblock.halign-left, td.tableblock.halign-left {
+  text-align: left;
+}
+th.tableblock.halign-center, td.tableblock.halign-center {
+  text-align: center;
+}
+th.tableblock.halign-right, td.tableblock.halign-right {
+  text-align: right;
+}
+
+th.tableblock.valign-top, td.tableblock.valign-top {
+  vertical-align: top;
+}
+th.tableblock.valign-middle, td.tableblock.valign-middle {
+  vertical-align: middle;
+}
+th.tableblock.valign-bottom, td.tableblock.valign-bottom {
+  vertical-align: bottom;
+}
+
+
+/*
+ * manpage specific
+ *
+ * */
+
+body.manpage h1 {
+  padding-top: 0.5em;
+  padding-bottom: 0.5em;
+  border-top: 2px solid silver;
+  border-bottom: 2px solid silver;
+}
+body.manpage h2 {
+  border-style: none;
+}
+body.manpage div.sectionbody {
+  margin-left: 3em;
+}
+
+ at media print {
+  body.manpage div#toc { display: none; }
+}
+
+/* SWIFT/T GUIDE CUSTOMIZATIONS */
+
+a:visited {
+  color: gray;
+}
+h5 {
+  font-size: 0.8em;
+}
+
+</style>
+<script type="text/javascript">
+/*<![CDATA[*/
+var asciidoc = {  // Namespace.
+
+/////////////////////////////////////////////////////////////////////
+// Table Of Contents generator
+/////////////////////////////////////////////////////////////////////
+
+/* Author: Mihai Bazon, September 2002
+ * http://students.infoiasi.ro/~mishoo
+ *
+ * Table Of Content generator
+ * Version: 0.4
+ *
+ * Feel free to use this script under the terms of the GNU General Public
+ * License, as long as you do not remove or alter this notice.
+ */
+
+ /* modified by Troy D. Hanson, September 2006. License: GPL */
+ /* modified by Stuart Rackham, 2006, 2009. License: GPL */
+
+// toclevels = 1..4.
+toc: function (toclevels) {
+
+  function getText(el) {
+    var text = "";
+    for (var i = el.firstChild; i != null; i = i.nextSibling) {
+      if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
+        text += i.data;
+      else if (i.firstChild != null)
+        text += getText(i);
+    }
+    return text;
+  }
+
+  function TocEntry(el, text, toclevel) {
+    this.element = el;
+    this.text = text;
+    this.toclevel = toclevel;
+  }
+
+  function tocEntries(el, toclevels) {
+    var result = new Array;
+    var re = new RegExp('[hH]([1-'+(toclevels+1)+'])');
+    // Function that scans the DOM tree for header elements (the DOM2
+    // nodeIterator API would be a better technique but not supported by all
+    // browsers).
+    var iterate = function (el) {
+      for (var i = el.firstChild; i != null; i = i.nextSibling) {
+        if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
+          var mo = re.exec(i.tagName);
+          if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
+            result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
+          }
+          iterate(i);
+        }
+      }
+    }
+    iterate(el);
+    return result;
+  }
+
+  var toc = document.getElementById("toc");
+  if (!toc) {
+    return;
+  }
+
+  // Delete existing TOC entries in case we're reloading the TOC.
+  var tocEntriesToRemove = [];
+  var i;
+  for (i = 0; i < toc.childNodes.length; i++) {
+    var entry = toc.childNodes[i];
+    if (entry.nodeName.toLowerCase() == 'div'
+     && entry.getAttribute("class")
+     && entry.getAttribute("class").match(/^toclevel/))
+      tocEntriesToRemove.push(entry);
+  }
+  for (i = 0; i < tocEntriesToRemove.length; i++) {
+    toc.removeChild(tocEntriesToRemove[i]);
+  }
+
+  // Rebuild TOC entries.
+  var entries = tocEntries(document.getElementById("content"), toclevels);
+  for (var i = 0; i < entries.length; ++i) {
+    var entry = entries[i];
+    if (entry.element.id == "")
+      entry.element.id = "_toc_" + i;
+    var a = document.createElement("a");
+    a.href = "#" + entry.element.id;
+    a.appendChild(document.createTextNode(entry.text));
+    var div = document.createElement("div");
+    div.appendChild(a);
+    div.className = "toclevel" + entry.toclevel;
+    toc.appendChild(div);
+  }
+  if (entries.length == 0)
+    toc.parentNode.removeChild(toc);
+},
+
+
+/////////////////////////////////////////////////////////////////////
+// Footnotes generator
+/////////////////////////////////////////////////////////////////////
+
+/* Based on footnote generation code from:
+ * http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
+ */
+
+footnotes: function () {
+  // Delete existing footnote entries in case we're reloading the footnodes.
+  var i;
+  var noteholder = document.getElementById("footnotes");
+  if (!noteholder) {
+    return;
+  }
+  var entriesToRemove = [];
+  for (i = 0; i < noteholder.childNodes.length; i++) {
+    var entry = noteholder.childNodes[i];
+    if (entry.nodeName.toLowerCase() == 'div' && entry.getAttribute("class") == "footnote")
+      entriesToRemove.push(entry);
+  }
+  for (i = 0; i < entriesToRemove.length; i++) {
+    noteholder.removeChild(entriesToRemove[i]);
+  }
+
+  // Rebuild footnote entries.
+  var cont = document.getElementById("content");
+  var spans = cont.getElementsByTagName("span");
+  var refs = {};
+  var n = 0;
+  for (i=0; i<spans.length; i++) {
+    if (spans[i].className == "footnote") {
+      n++;
+      var note = spans[i].getAttribute("data-note");
+      if (!note) {
+        // Use [\s\S] in place of . so multi-line matches work.
+        // Because JavaScript has no s (dotall) regex flag.
+        note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
+        spans[i].innerHTML =
+          "[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
+          "' title='View footnote' class='footnote'>" + n + "</a>]";
+        spans[i].setAttribute("data-note", note);
+      }
+      noteholder.innerHTML +=
+        "<div class='footnote' id='_footnote_" + n + "'>" +
+        "<a href='#_footnoteref_" + n + "' title='Return to text'>" +
+        n + "</a>. " + note + "</div>";
+      var id =spans[i].getAttribute("id");
+      if (id != null) refs["#"+id] = n;
+    }
+  }
+  if (n == 0)
+    noteholder.parentNode.removeChild(noteholder);
+  else {
+    // Process footnoterefs.
+    for (i=0; i<spans.length; i++) {
+      if (spans[i].className == "footnoteref") {
+        var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
+        href = href.match(/#.*/)[0];  // Because IE return full URL.
+        n = refs[href];
+        spans[i].innerHTML =
+          "[<a href='#_footnote_" + n +
+          "' title='View footnote' class='footnote'>" + n + "</a>]";
+      }
+    }
+  }
+},
+
+install: function(toclevels) {
+  var timerId;
+
+  function reinstall() {
+    asciidoc.footnotes();
+    if (toclevels) {
+      asciidoc.toc(toclevels);
+    }
+  }
+
+  function reinstallAndRemoveTimer() {
+    clearInterval(timerId);
+    reinstall();
+  }
+
+  timerId = setInterval(reinstall, 500);
+  if (document.addEventListener)
+    document.addEventListener("DOMContentLoaded", reinstallAndRemoveTimer, false);
+  else
+    window.onload = reinstallAndRemoveTimer;
+}
+
+}
+asciidoc.install(2);
+/*]]>*/
+</script>
+</head>
+<body class="article" style="max-width:750px">
+<div id="header">
+<h1>Swift/T Guide</h1>
+<span id="author">v0.5.0, April 2014</span><br />
+<div id="toc">
+  <div id="toctitle">Table of Contents</div>
+  <noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
+</div>
+</div>
+<div id="content">
+<div id="preamble">
+<div class="sectionbody">
+<div class="paragraph"><p>The Swift/Turbine Compiler (STC) allows you to write Swift programs
+and run them using Turbine.</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_support">1. Support</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>An overview of Swift/T may be found at the ExM project site:</p></div>
+<div class="paragraph"><p><a href="https://sites.google.com/site/exmcomputing">https://sites.google.com/site/exmcomputing</a></p></div>
+<div class="paragraph"><p>The Swift/T user discussion mailing list is found here:</p></div>
+<div class="paragraph"><p><a href="http://lists.mcs.anl.gov/mailman/listinfo/exm-user">http://lists.mcs.anl.gov/mailman/listinfo/exm-user</a></p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_installation">2. Installation</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>Writing and running Swift/Turbine programs requires multiple packages.
+This section provides generic instructions for installing Swift/T
+on a range of systems.  We first cover locating and/or installing
+prerequisite software packages, then we cover building Swift/T
+from a source package.</p></div>
+<div class="paragraph"><p>The <a href="http://www.mcs.anl.gov/exm/local/guides/turbine-sites.html">Turbine Sites Guide</a>
+is a accompanying resource for configuration settings and preinstalled software
+for specific systems.</p></div>
+<div class="sect2">
+<h3 id="_installation_of_prerequisites">2.1. Installation of Prerequisites</h3>
+<div class="olist arabic"><ol class="arabic">
+<li>
+<p>
+Install or locate MPI implementation (MPICH, OpenMPI, etc.)
+</p>
+<div class="ulist"><ul>
+<li>
+<p>
+On compute clusters, an MPI will almost certainly be pre-installed
+</p>
+</li>
+<li>
+<p>
+Many operating systems provide packages with MPI implementations
+  that are usable, but often outdated.
+  E.g. the <tt>mpich2</tt> package on Debian/Ubuntu.
+</p>
+</li>
+<li>
+<p>
+See <a href="http://www.mpich.org">MPICH Guides</a> for information on installing the
+  latest version of MPICH.
+</p>
+</li>
+<li>
+<p>
+Other MPI implementations are <a href="#Build_configuration">supported</a> as well.
+</p>
+<div class="paragraph"><p>Swift/T attempts to use MPI 3.0 functionality by default.  If you
+are using an MPI implementation that does not support the MPI 3.0 standard,
+you must set <tt>MPI_VERSION=2</tt> (if using the <tt>exm-setup.zsh</tt> build process),
+or provide the <tt>--enable-mpi-2</tt> configure option (if using
+the manual build process).</p></div>
+</li>
+</ul></div>
+</li>
+<li>
+<p>
+Install or locate Tcl 8.6.
+</p>
+<div class="ulist"><ul>
+<li>
+<p>
+Tcl is available through the package manager on many systems.
+   You may need to install an additional Tcl development package
+   in addition to the standard tcl package,
+   e.g. <tt>tcl8.6</tt> plus <tt>tcl8.6-dev</tt> on Debian/Ubuntu systems.
+</p>
+</li>
+<li>
+<p>
+Source distributions are available at the <a href="http://www.tcl.tk">Tcl web site</a>
+</p>
+</li>
+</ul></div>
+</li>
+<li>
+<p>
+Install or locate SWIG
+</p>
+<div class="ulist"><ul>
+<li>
+<p>
+You can check if SWIG is installed by running <tt>swig -version</tt>
+</p>
+</li>
+<li>
+<p>
+SWIG is available through the package manager on many systems.
+</p>
+</li>
+<li>
+<p>
+Source distributions are available at
+   the <a href="http://swig.org">SWIG web site</a>
+</p>
+</li>
+</ul></div>
+</li>
+</ol></div>
+</div>
+<div class="sect2">
+<h3 id="_installation_of_swift_t_from_source">2.2. Installation of Swift/T from Source</h3>
+<div class="paragraph"><p>Once you have found all prerequisites, we can continue with building
+Swift/T from source.</p></div>
+<div class="olist arabic"><ol class="arabic">
+<li>
+<p>
+Obtain the Swift/T source package
+</p>
+<div class="listingblock">
+<div class="content">
+<pre><tt>wget http://www.mcs.anl.gov/exm/local/downloads/exm-0.5.0.tar.gz</tt></pre>
+</div></div>
+<div class="paragraph"><p>Cf. <a href="http://www.mcs.anl.gov/exm/local/downloads/downloads.html">Swift/T Downloads</a>
+for other packages</p></div>
+</li>
+<li>
+<p>
+Unpack and enter package directory
+</p>
+<div class="listingblock">
+<div class="content">
+<pre><tt>tar xfz exm-trunk.tar.gz
+cd exm-trunk</tt></pre>
+</div></div>
+</li>
+<li>
+<p>
+Edit the settings file: <tt>exm-settings.sh</tt>
+</p>
+<div class="paragraph"><p>At a minimum, you must set the install directory with <tt>EXM_PREFIX</tt>.
+On a standard system, no further configuration may be needed.
+In many cases, however, you will need to modify additional
+configuration settings so that all prerequisites can
+be correctly located and configured (see Section
+<a href="#Build_configuration">Build configuration</a>).</p></div>
+<div class="paragraph"><p>A range of other settings are also available here:
+enabling/disabling features, debug or optimized builds, etc.</p></div>
+<div class="admonitionblock">
+<table><tr>
+<td class="icon">
+<div class="title">Tip</div>
+</td>
+<td class="content">Save your <tt>exm-settings.sh</tt> when you download a new package</td>
+</tr></table>
+</div>
+</li>
+<li>
+<p>
+Run the setup script
+</p>
+<div class="listingblock">
+<div class="content">
+<pre><tt>./exm-setup.zsh</tt></pre>
+</div></div>
+<div class="paragraph"><p>If <tt>exm-setup.zsh</tt> does not succeed on your system, see Section
+<a href="#Build_configuration">Build configuration</a> below.</p></div>
+<div class="admonitionblock">
+<table><tr>
+<td class="icon">
+<div class="title">Tip</div>
+</td>
+<td class="content">if you want more control than <tt>exm-setup.zsh</tt> provides, you can
+    build Swift/T with the
+    <a href="#Manual_build_configuration">manual configure/make workflow</a>.</td>
+</tr></table>
+</div>
+</li>
+<li>
+<p>
+Add Turbine and STC to your paths
+</p>
+<div class="listingblock">
+<div class="content">
+<pre><tt>PATH=${PATH}:/path/to/exm-install/turbine/bin
+PATH=${PATH}:/path/to/exm-install/stc/bin</tt></pre>
+</div></div>
+</li>
+</ol></div>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_usage">3. Usage</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>Swift code is conventionally written in <tt>*.swift</tt> files.  Turbine
+code is stored in Tcl files <tt>*.tcl</tt>.  After writing the Swift program
+<tt>program.swift</tt>, run:</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>stc program.swift</tt></pre>
+</div></div>
+<div class="paragraph"><p>This will compile the program to <tt>program.tcl</tt>.  A second, optional
+argument may be given as an alternate output file name.</p></div>
+<div class="paragraph"><p>Then, to run the program, use Turbine:</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>turbine -n 4 program.tcl</tt></pre>
+</div></div>
+<div class="paragraph"><p>See the <a href="#Turbine">Turbine section</a> for more information about
+running the program.</p></div>
+<div class="paragraph" id="stc_arguments"><p>STC accepts the following arguments:</p></div>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+<tt>-A <em>name</em>=<em>value</em></tt>
+</dt>
+<dd>
+<p>
+Set a command-line argument at
+compile-time. This may be found at runtime using the Swift
+<a href="#argv">argument processing</a> library. This option enables these
+arguments to be treated as compile-time constants for optimization.
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>-D <em>macro</em>=<em>value</em></tt>
+</dt>
+<dd>
+<p>
+Define a C preprocessor macro.
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>-E</tt>
+</dt>
+<dd>
+<p>
+Just run the C preprocessor: do not compile the program.  The
+output goes into the STC output file (the second file name argument).
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>-I</tt>
+</dt>
+<dd>
+<p>
+Add a directory to the import and include search path.
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>-O</tt>
+</dt>
+<dd>
+<p>
+Set optimization level: 0, 1, 2, or 3.  See <a href="#Optimizations">[Optimizations]</a>.
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>-j</tt>
+</dt>
+<dd>
+<p>
+Set the location of the <tt>java</tt> executable.
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>-p</tt>
+</dt>
+<dd>
+<p>
+Disable the C preprocessor.
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>-u</tt>
+</dt>
+<dd>
+<p>
+Only compile if output file is not up-to-date.
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>-v</tt>
+</dt>
+<dd>
+<p>
+Output version number and exit.
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>-V</tt>
+</dt>
+<dd>
+<p>
+Verbose output.
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>STC runs as a Java program.  You may use <tt>-j</tt> to set the Java VM
+executable.  This Java VM must be compatible with the <tt>javac</tt> used to
+compile STC.</p></div>
+<div class="paragraph"><p>By default, STC runs the user script through the C preprocessor
+(<tt>cpp</tt>), enabling arbitrary macro processing, etc.  The <tt>-D</tt>, <tt>-E</tt>,
+<tt>-I</tt>, and <tt>-p</tt> options are relevant to this feature.</p></div>
+<div class="paragraph"><p>Additional arguments for advanced users/developers:</p></div>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+<tt>-C</tt>
+</dt>
+<dd>
+<p>
+Specify an output file for STC internal representation
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>-l</tt>
+</dt>
+<dd>
+<p>
+Specify log file for STC debug log
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>-L</tt>
+</dt>
+<dd>
+<p>
+Specify log file for more verbose STC debug log
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>-T</tt>
+</dt>
+<dd>
+<p>
+Enable a specific optimization.  See <a href="#Optimizations">[Optimizations]</a>
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>-t</tt>
+</dt>
+<dd>
+<p>
+Disable a specific compiler optimization.  See <a href="#Optimizations">[Optimizations]</a>
+</p>
+</dd>
+</dl></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_program_structure">4. Program structure</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>Swift programs are composed of <em>composite</em> functions.  These
+share syntax with C-like languages.  The program starts in <tt>main()</tt>.
+The following is a complete Swift program:</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>main
+{}</tt></pre>
+</div></div>
+<div class="paragraph"><p>STC input is preprocessed by <tt>cpp</tt>, the C preprocessor.</p></div>
+<div class="paragraph"><p>Hello world is written as:</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>import io;
+main
+{
+  printf("Hello world");
+}</tt></pre>
+</div></div>
+<div class="paragraph"><p>The newline is supplied by <tt>printf()</tt>.</p></div>
+<div class="paragraph"><p>Swift programs eventually call <em>leaf</em> functions, which are the primary
+way to do work.  From the perspective of the Swift script, they are
+atomic operations that wait for input variables and set output
+variables.  They may be implemented as native code functions or
+external application programs.</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_comments">5. Comments</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>Swift supports C/C++-style comments:</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>// This is a comment
+/* This is a
+comment */
+/** Also a
+comment */</tt></pre>
+</div></div>
+<div class="paragraph"><p>Additionally, if the preprocessor is disabled, single-line comments
+starting with # are supported:</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt># This will work if source file is not preprocessed</tt></pre>
+</div></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_modules">6. Modules</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>Swift has a module system that allows you to import function and variable
+definitions into your source file.  Importing a module will import all
+function and variable definitions from that module into your program.</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>import io;
+import mypackage.mymodule;</tt></pre>
+</div></div>
+<div class="paragraph"><p>The mechanisms for locating source files is as follows:</p></div>
+<div class="ulist"><ul>
+<li>
+<p>
+STC searches a list of directories in order to find a Swift source
+  file in the correct directory with the correct name.
+</p>
+</li>
+<li>
+<p>
+The standard library is always first on the search path,
+    and the current working directory is last.
+</p>
+</li>
+<li>
+<p>
+Additional directories can be added with the <tt>-I</tt> option to STC.
+</p>
+</li>
+<li>
+<p>
+Swift source files must have a <tt>.swift</tt> suffix.  E.g. <tt>import io;</tt>
+  looks for a file called <tt>io.swift</tt>.
+</p>
+</li>
+<li>
+<p>
+In the case of a multi-part import name, E.g. <tt>import mypackage.mymodule</tt>,
+  then, it looks for <tt>mymodule.swift</tt> in subdirectory <tt>mypackage</tt>.
+</p>
+</li>
+</ul></div>
+<div class="paragraph"><p>The alternative <tt>#include</tt> statement textually includes an entire
+file using the C preprocessor at the point of the statement.
+Note that <tt>#include</tt> will only work if the preprocessor is enabled
+on the current file.  In contrast to <tt>import</tt>, <tt>#include</tt> will run the
+C preprocessor on any included modules.  <tt>import</tt> is recommended over
+<tt>#include</tt> unless the imported module requires preprocessing.</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>#include <mypackage/mymodule.swift></tt></pre>
+</div></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_dataflow_evaluation">7. Dataflow evaluation</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>Swift expressions are evaluated in <em>dataflow</em> order:</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>int z1,z2;
+int y;
+int x = f(y);
+y = g(2);
+z1 = h(x,y,1);
+z2 = h(x,y,2);
+int output = r(z1,z2);</tt></pre>
+</div></div>
+<div class="paragraph"><p>This allows code to execute as concurrently as possible, limited
+only by data availability.  In this example, <tt>g()</tt> runs first, because it
+is dependent only on a literal.  When <tt>y</tt> is set, <tt>f()</tt> runs, setting
+<tt>x</tt>.  Then, two invocations of <tt>h()</tt> execute.  Finally, <tt>z1</tt> and <tt>z2</tt>
+are set, allowing <tt>r()</tt> to run.</p></div>
+<div class="paragraph"><p>Variables may be assigned only once.  Multiple assignment is often
+detected at compile time, and will always be detected at run time,
+resulting in a run time error.  If variable is not assigned,
+expressions that depend on the variable cannot execute.  If the variable
+is never assigned during the course of program execution, these
+expressions will never execute.  Upon program completion, Swift/T will
+report the error and print debug information about any unexecuted
+expressions and identifiers of corresponding unassigned variables.</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_composite_functions">8. Composite functions</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>Swift code is written in composite functions.  The composite function
+<tt>main</tt> is required.</p></div>
+<div class="paragraph"><p>Composite functions have the form:</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>[(<output list>)] function_name [(<input list>)]
+{
+  statement;
+  statement;
+  ...
+}</tt></pre>
+</div></div>
+<div class="paragraph"><p>An empty input or output list may be omitted or written as <tt>()</tt>.</p></div>
+<div class="paragraph"><p>The output list may have more than one entry.  Thus, assignments
+may be written as:</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>x1, x2 = f(i1, i2);
+// or equivalently:
+(x1, x2) = f(i1, i2);</tt></pre>
+</div></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_types">9. Types</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>Swift provides a similar range of primitive types to many other
+programming languages.  Files are a primitive type in Swift, unlike
+in many other languages, and have a number of special characteristics
+that merit special mention.
+Two basic kinds of data structure are provided: arrays and structs.</p></div>
+<div class="sect2">
+<h3 id="_primitive_types">9.1. Primitive types</h3>
+<div class="paragraph"><p>Swift has the conventional types:</p></div>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+<tt>string</tt>
+</dt>
+<dd>
+<p>
+A complete string (not an array of characters).
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>int</tt>
+</dt>
+<dd>
+<p>
+A 64-bit integer.
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>float</tt>
+</dt>
+<dd>
+<p>
+A 64-bit (double-precision) floating point number.
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>boolean</tt>
+</dt>
+<dd>
+<p>
+A boolean (true/false).
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>file</tt>
+</dt>
+<dd>
+<p>
+A file (see Section Files).
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>blob</tt>
+</dt>
+<dd>
+<p>
+External byte data (see Section Blobs).
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>Literals for these types use conventional syntax:</p></div>
+<div class="ulist"><ul>
+<li>
+<p>
+<tt>int</tt> literals are written as decimal numbers, e.g. <tt>-1234</tt>
+</p>
+</li>
+<li>
+<p>
+<tt>float</tt> literals are written as decimal numbers with a decimal point,
+    e.g <tt>5493.352</tt> or <tt>1.0</tt>.
+    Scientific notation may be used,
+    as in <tt>2.3e-2</tt> which is equivalent to <tt>0.023</tt>.
+    The literals <tt>NaN</tt> and <tt>inf</tt> may be used.  In some contexts <tt>int</tt>
+    literals are promoted automatically to <tt>float</tt>.
+</p>
+</li>
+<li>
+<p>
+<tt>boolean</tt> literals <tt>true</tt> and <tt>false</tt> may be used.
+</p>
+</li>
+<li>
+<p>
+<tt>string</tt> literals are enclosed in double quotes, with a range of escape
+    sequences supported:
+</p>
+<div class="ulist"><ul>
+<li>
+<p>
+<tt>\\</tt> for a single backslash
+</p>
+</li>
+<li>
+<p>
+<tt>\"</tt> for a quote
+</p>
+</li>
+<li>
+<p>
+<tt>\n</tt> for newline
+</p>
+</li>
+<li>
+<p>
+<tt>\t</tt> for tab
+</p>
+</li>
+<li>
+<p>
+<tt>\a</tt> (alarm)
+</p>
+</li>
+<li>
+<p>
+<tt>\b</tt> (backspace)
+</p>
+</li>
+<li>
+<p>
+<tt>\f</tt> (form feed)
+</p>
+</li>
+<li>
+<p>
+<tt>\r</tt> (carriage return)
+</p>
+</li>
+<li>
+<p>
+<tt>\v</tt> (vertical tab)
+</p>
+</li>
+<li>
+<p>
+octal escape codes, e.g. <tt>\001</tt>
+</p>
+</li>
+<li>
+<p>
+hexadecimal escape codes, e.g. <tt>\xf2</tt>
+</p>
+</li>
+<li>
+<p>
+For more information: <a href="http://en.wikipedia.org/wiki/US-ASCII#ASCII_control_code_chart">ASCII control codes</a>.
+</p>
+</li>
+</ul></div>
+</li>
+<li>
+<p>
+Multi-line strings may be used in two syntaxes:
+</p>
+<div class="ulist"><ul>
+<li>
+<p>
+Python-style:
+</p>
+<div class="listingblock">
+<div class="content">
+<pre><tt>string s =
+"""
+line data 1
+line data 2
+""";</tt></pre>
+</div></div>
+</li>
+<li>
+<p>
+Asciidoc-style: like Python-style but use 4 dashes instead of 3 quotes.
+</p>
+</li>
+<li>
+<p>
+<strong>Note:</strong> Multi-line strings are somewhat incompatible with the C preprocessor:
+            if you try to compile a Swift program using multi-line strings with
+            the preprocessor enabled, you will likely see warnings or strange
+            behavior.  To disable the C preprocessor, use the <tt>-p</tt> option
+            to STC.
+</p>
+</li>
+</ul></div>
+</li>
+</ul></div>
+</div>
+<div class="sect2">
+<h3 id="_files">9.2. Files</h3>
+<div class="paragraph"><p>A file is a first-class entity in Swift that in many ways can be treated
+as any other variable.  The main difference is that a file can be
+<strong>mapped</strong> to path in a filesystem.  Assigning to a mapped file variable
+results in a file being created in the file system at the specified path.
+File paths can be arbitrary Swift expressions of type <tt>string</tt>.  Absolute
+paths or relative paths are specified, with relative paths interpreted
+relative to the path in which turbine was run.
+File variables can also be initialized with data from a pre-existing
+file using the <tt>input_file</tt> function.  File paths are relative to the
+working directory for Turbine.</p></div>
+<div class="paragraph"><p>For example, if <tt>/home/user/in.txt</tt> is a file with some data in it,
+the following Swift program will copy the file to <tt>/home/user/out.txt</tt>.</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>main
+{
+  file x = input_file("/home/user/in.txt");
+  file y <"/home/user/out.txt">; // Declare a mapped file
+  y = x; // Do the copy
+}</tt></pre>
+</div></div>
+<div class="paragraph"><p>A range of functions to work with files are provided in the
+<tt>files</tt> library module.</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>// Initialize an array of files from a range of files on disk with glob
+file f[] = glob("directory/*.txt");
+
+// Read the contents of a file with read
+string filename = "in.txt";
+string contents = read(input_file(filename));
+trace("Contents of " + filename + ":\n" + contents);
+
+// Write directly to a file with write
+file tmp = write("first line\nsecond line");
+
+// Find the name of a file with filename
+trace("Temporary filename is: " + filename(tmp));</tt></pre>
+</div></div>
+<div class="paragraph"><p>Temporary files are created as necessary if unmapped files are
+written to.  For example, the file <tt>tmp</tt> in the above code snippet.
+This feature is implemented by calling GNU <tt>mktemp</tt> with suffix
+<tt>.turbine</tt>; thus, the directory is set with environment variable
+<tt>TMPDIR</tt> which defaults to <tt>/tmp</tt>.</p></div>
+<div class="paragraph"><p>Currently Swift/T assumes that the file system is shared among
+all nodes.</p></div>
+<div class="admonitionblock">
+<table><tr>
+<td class="icon">
+<div class="title">Note</div>
+</td>
+<td class="content">
+<div class="paragraph"><p>The syntax</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>file f<"f.txt"> = g();</tt></pre>
+</div></div>
+<div class="paragraph"><p>is allowed but</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>file f<"f.txt">=g();</tt></pre>
+</div></div>
+<div class="paragraph"><p>results in a parse error: the <tt>>=</tt> sequence is tokenized as
+<em>greater-than-or-equal-to</em>.</p></div>
+</td>
+</tr></table>
+</div>
+</div>
+<div class="sect2">
+<h3 id="_blobs">9.3. Blobs</h3>
+<div class="paragraph"><p>Blobs represent raw byte data.  They are primarily used to pass
+data to and from native code libraries callable from Swift.  They are
+like Swift strings but may contain arbitrary data.</p></div>
+<div class="paragraph"><p>Swift provides multiple builtin functions to create blobs, convert
+blobs to and from Swift types, and pass blobs to leaf functions.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_arrays">9.4. Arrays</h3>
+<div class="paragraph"><p>Arrays can be declared with empty square brackets:</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>int A[];</tt></pre>
+</div></div>
+<div class="paragraph"><p>Arrays with empty square brackets have integer indices.  It is
+also possible to declare integers with other index types, such as
+strings:</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>string dict[string];</tt></pre>
+</div></div>
+<div class="paragraph"><p>They are dynamically sized, expanding each time an item is inserted at
+a new index.  Arrays are indexed using square brackets.</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>int A[string];
+int B[];
+B = function_returning_array();
+A["zero"] = B[0];
+A["one"] = B[1];</tt></pre>
+</div></div>
+<div class="paragraph"><p>Each array index can only be assigned to once.</p></div>
+<div class="paragraph"><p>A given array variable must be assigned either <em>in toto</em> (as a whole)
+or <em>in partes</em> (piece by piece).  In this example, <tt>B</tt> is assigned in toto
+and <tt>A</tt> is assigned in partes.  Code that attempts to do both is in error.</p></div>
+<div class="paragraph"><p>Arrays may be used as inputs or outputs of functions.</p></div>
+<div class="paragraph"><p>Arrays are part of Swift dataflow semantics. An array is closed
+when all possible insertions to it are complete.</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>(int B[]) f(int j)
+{
+  int A[];
+  A = subroutine_function(1);
+
+  // Error: A has already been assigned in toto:
+  A[3] = 4;
+
+  // OK: assigning to output variable
+  B = subroutine_function(2);
+}</tt></pre>
+</div></div>
+<div class="paragraph"><p>Array literals may be expressed using the range operator:</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>int start = 0;
+int stop = 10;
+int step = 2;
+// Array of length 10:
+int A[] = [start:stop];
+// Array of length 5, containing only even numbers:
+int B[] = [start:stop:step];</tt></pre>
+</div></div>
+<div class="paragraph"><p>Array literals may also be expressed with list syntax:</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>int C[] = [4,5,6];</tt></pre>
+</div></div>
+</div>
+<div class="sect2">
+<h3 id="_nested_arrays">9.5. Nested arrays</h3>
+<div class="paragraph"><p>Swift allows arrays of arrays: nested arrays.  They can be declared and
+assigned as follows:</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>// An array of arrays of files with string keys
+file A[string][string];
+A["foo"]["bar"] = input_file("test.txt");
+A["foo"]["qux"] = input_file("test2.txt");</tt></pre>
+</div></div>
+<div class="paragraph"><p><strong>Note:</strong> there is currently a limitation in assignment of nested arrays
+that a given array can only be assigned at a single "index level".  If
+<tt>A</tt> is a 2D array, for example, then you cannot mix assignments specifying
+one index (e.g. <tt>A[i] = …</tt>) with assignments specifying three indices
+(e.g. <tt>A[i][j] = …</tt>).</p></div>
+</div>
+<div class="sect2">
+<h3 id="_structs">9.6. Structs</h3>
+<div class="paragraph"><p>In Swift, structs are defined with the <tt>type</tt> keyword.  They define
+a new type.</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>type person
+{
+  string name;
+  int age;
+  int events[];
+}</tt></pre>
+</div></div>
+<div class="paragraph"><p>Structs are accessed with the <tt>.</tt> syntax:</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>person p;
+p.name = "Abe";
+p.age = 90;</tt></pre>
+</div></div>
+<div class="paragraph"><p>It is possible to have arrays of structs, with some restriction on
+how they can be assigned.  Each struct in the array must be assigned
+<em>in toto</em> (as a whole).  For example, the following code is valid:</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>person people[], p1, p2;
+
+p1.name = "Thelma";
+p1.age = 31;
+
+p2.name = "Louise";
+p2.age = 29;
+
+people[0] = p1;
+people[1] = p2;</tt></pre>
+</div></div>
+<div class="paragraph"><p>However, attempting to assign the structs in the following way is
+currently unsupported:</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>people[2].name = "Abe";  // Not supported!
+people[2].age = 90;      // Not supported!</tt></pre>
+</div></div>
+</div>
+<div class="sect2">
+<h3 id="_defining_new_types">9.7. Defining new types</h3>
+<div class="paragraph"><p>Swift has two ways to define new types based on existing types.</p></div>
+<div class="paragraph"><p>The first is <tt>typedef</tt>, which creates a new name for the type.
+The new type and the existing type will be completely interchangeable,
+since they are simply different names for the same underlying type.
+The new type name simply serves to improve readability or documentation.</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>typedef newint int;
+
+main {
+  // We can freely convert between int and newint
+  newint x = 1;
+  int y = x;
+  newint z = y;
+}</tt></pre>
+</div></div>
+<div class="paragraph"><p>The second is with <tt>type</tt>, which creates a new type that is a
+specialization of an existing type.  That is, it is a distinct
+type that is not interchangeable.  A specialized type can be
+converted into the original type, but the reverse transformation is
+not possible.  This means that you can write functions that are more
+strictly typechecked, for example, only accepted particular types of
+file.</p></div>
+<div class="paragraph"><p><strong>Note:</strong> This feature is immature, so you will have a higher probability
+of encountering compiler bugs or limitations.</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>typedef sorted_file file;
+app (sorted_file out) sort (file i) {
+  "/usr/bin/sort" "-o" out i
+}
+
+// uniq utility requires sorted input
+app (file o) unique (sorted_file i) {
+  "/usr/bin/uniq" i @stdout=o
+}
+
+main {
+  file unsorted = input_file("input.txt");
+  sorted_file sorted <"sorted.txt"> = sort(unsorted);
+  file u <"unique.txt"> = unique(sorted);
+
+  // Can convert from sorted_file to file
+  file result2 = sort(unsorted);
+
+  // This would cause a type error
+  // sorted_file not_sorted = unsorted;
+}</tt></pre>
+</div></div>
+</div>
+<div class="sect2">
+<h3 id="_global_constants">9.8. Global Constants</h3>
+<div class="paragraph"><p>Swift supports a basic feature for defining globally visible constants.  You
+can use the <tt>global const</tt> statement at the top level of the program.  The
+syntax only supports literals of scalar types: e.g. integer literals, floating
+point literals and string literals.</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>global const string hello = "Hello World";
+global const float pi_approx = 3.142;
+global const int ONE = 1;
+
+main () {
+  trace(hello, pi_approx, ONE);
+}</tt></pre>
+</div></div>
+<div class="paragraph"><p><strong>Note:</strong> global constants provide no performance benefit compared with
+variables initialized to constant values at optimization levels <tt>O1</tt>
+or greater.</p></div>
+<div class="paragraph"><p><strong>Note:</strong> better support is planned in future for more flexible support for
+global variables and code.</p></div>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_control_structures">10. Control structures</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>Swift provides control structures that may be placed as statements
+inside a composite function.</p></div>
+<div class="sect2">
+<h3 id="_conditionals">10.1. Conditionals</h3>
+<div class="sect3">
+<h4 id="_if_statement">10.1.1. If statement</h4>
+<div class="paragraph"><p>If statements have the form:</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>if (<condition>)
+{
+  statement;
+  ...
+}
+else
+{
+  statement;
+  ...
+}</tt></pre>
+</div></div>
+<div class="paragraph"><p>As required by dataflow processing, neither branch of the conditional can
+execute until the value of the condition expression is available.</p></div>
+</div>
+<div class="sect3">
+<h4 id="_switch_statement">10.1.2. Switch statement</h4>
+<div class="listingblock">
+<div class="content">
+<pre><tt>int a = 20;
+switch (a)
+{
+  case 1:
+    int c;
+    c = a + a;
+    b = a + 1;
+  case 20:
+    b = 1;
+  case 2000:
+    b = 2;
+  default:
+    b = 2102 + 2420;
+}
+printf("b: %i\n", b);</tt></pre>
+</div></div>
+<div class="paragraph"><p><strong>Note:</strong> there is no fall-through between cases in switch statements.</p></div>
+</div>
+</div>
+<div class="sect2">
+<h3 id="_iteration">10.2. Iteration</h3>
+<div class="paragraph"><p>Iteration is performed with the <tt>foreach</tt> and <tt>for</tt> statements.</p></div>
+<div class="sect3">
+<h4 id="_foreach_loop">10.2.1. Foreach loop</h4>
+<div class="paragraph"><p>The <tt>foreach</tt> loop allows for parallel iteration over an array:</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>string A[];
+foreach value, index in A
+{
+  printf("A[%i] = %s\n", index, value);
+}</tt></pre>
+</div></div>
+<div class="paragraph"><p>The <tt>index</tt> and <tt>value</tt> variables are automatically declared.  The
+<tt>index</tt> variable may be omitted from the syntax.</p></div>
+<div class="paragraph"><p>A special case of the foreach loop occurs when combined with the
+array range operator.  This is the idiomatic way to iterate over
+a range of integer values in Swift. The STC compiler has special
+handling for this case that avoids constructing an array.</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>foreach i in [start:stop:step] {
+    ...
+}</tt></pre>
+</div></div>
+</div>
+<div class="sect3">
+<h4 id="_for_loop">10.2.2. For loop</h4>
+<div class="paragraph"><p>The <tt>for</tt> loop allows for sequential iteration.  This example
+implements a counter based on the return values of a function that
+accepts integers:</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>int N = 100;
+int count = 0;
+for (int i = 0; i < N; i = i+1, count = count+c)
+{
+  int c;
+  if (condition_function(i))
+  {
+    c = 1;
+  }
+  else
+  {
+    c = 0;
+  }
+}</tt></pre>
+</div></div>
+<div class="paragraph"><p>The general form is:</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>for ( <initializer> ; <condition> ; <updates> )
+{
+  statement;
+  ...
+}</tt></pre>
+</div></div>
+<div class="paragraph"><p>The initializer is executed first, once.  The initializer is a
+comma-separated list of statements.  The body statements are then
+executed.  Then, the assignments are performed, formatted as a
+comma-separated list.  Each is a special assignment in which the
+left-hand-side is the variable in the <em>next</em> iteration of the loop,
+while the right-hand-side is the variable in the <em>previous</em> loop
+iteration.  Then, the condition is checked for loop exit.  If the loop
+continues, the body is executed again, etc.</p></div>
+<div class="paragraph"><p><strong>Performance Tip:</strong> use the <tt>foreach</tt> loop instead of <tt>for</tt> if your
+loop iterations are independent and can be executed in parallel.</p></div>
+</div>
+</div>
+<div class="sect2">
+<h3 id="_explicit_data_dependent_execution">10.3. Explicit data-dependent execution</h3>
+<div class="paragraph"><p>In general, execution ordering in Swift/T is implicit and driven by
+data dependencies.  In some cases it is useful to add explicit data
+dependencies, for example if you want to print a message to indicate
+that variable was assigned.  It is possible for the programmer to
+express additional execution ordering using two constructs: the <tt>wait</tt>
+statement and the <tt>=></tt> chaining operator.</p></div>
+<div class="paragraph"><p>In a wait statement, a block of code is executed after
+one or more variables are closed.</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>x = f();
+y = g();
+wait (x) {
+  trace("x is closed!");
+}
+wait(x, y) {
+  trace("x and y are closed!");
+}</tt></pre>
+</div></div>
+<div class="paragraph"><p>The chaining operator chains statements together so that a
+statement only executes after the previous statement’s output
+value is closed.  This is
+a more concise way to express dependencies than the <tt>wait</tt> statement.</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>sleep(1) =>
+  x = f() =>
+  int y = g() =>
+  trace("DONE!");</tt></pre>
+</div></div>
+<div class="paragraph"><p>Chaining is based on the <strong>output values</strong>
+of a statement.  In the simple case of a function call <tt>f() => …</tt>,
+the output values are the output values of the function.  In the
+case of and assignment <tt>x = f() => …</tt> or a declaration,
+<tt>int y = g() => …</tt>, then the next statement is dependent on
+the assigned values, or the declared values.  Some functions such
+as <tt>sleep</tt> have <tt>void</tt> output values so that they can be used
+in this fashion.</p></div>
+</div>
+<div class="sect2">
+<h3 id="_scoping_blocks">10.4. Scoping blocks</h3>
+<div class="paragraph"><p>Arbitrary scoping blocks may be used.  In this example, two different
+variables, both represented by <tt>b</tt>, are assigned different values.</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>{
+  int b;
+  b = 1;
+}
+{
+  int b;
+  b = 2;
+}</tt></pre>
+</div></div>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_operators">11. Operators</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>The following binary arithmetic operators on numbers are defined:</p></div>
+<div class="paragraph"><p><tt>+</tt> (plus), <tt>-</tt> (minus), <tt>*</tt> (times), <tt>/</tt> (divide),
+<tt>%/</tt> (integer divide), <tt>%%</tt> (modulus), <tt>**</tt> (power)</p></div>
+<div class="paragraph"><p><tt>&&</tt> (boolean and), <tt>||</tt> (boolean or),
+<tt>==</tt> (equals), <tt>!=</tt> (not equals), <tt>></tt> (greater than), <tt><</tt> (less than),
+<tt>>=</tt> (greater than or equal to), <tt><=</tt> (less than or equal to)</p></div>
+<div class="paragraph"><p><tt>xor()</tt> is a builtin function.</p></div>
+<div class="paragraph"><p>Swift boolean operators are not short-circuited (to allow maximal
+concurrency).  For conditional execution, use an <tt>if</tt> statement.</p></div>
+<div class="paragraph"><p>The following unary operators are defined:</p></div>
+<div class="paragraph"><p><tt>-</tt> (negate), <tt>!</tt> (boolean not)</p></div>
+<div class="paragraph"><p>String concatenation is also performed with <tt>+</tt> (plus).  <tt>==</tt> and
+<tt>!=</tt> may also be used on strings.  Operator <tt>s1/s2</tt> is equivalent to
+<tt>s1+"/"+s2</tt>.</p></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_standard_library">12. Standard library</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>Each category of function is shown with the required import
+statement, if necessary.</p></div>
+<div class="paragraph"><p>Functions that accept an input of any type are denoted <tt>anything</tt>.
+Functions that accept variable numbers of arguments are denoted with
+ellipsis <tt>…</tt>.</p></div>
+<div class="paragraph"><p>A function that accepts more than one type is denoted as <tt>f(int|string)</tt>.</p></div>
+<div class="paragraph"><p>If a function is described below an <strong>Import:</strong> label, be sure to
+<tt>import</tt> that package.</p></div>
+<div class="sect2">
+<h3 id="_general">12.1. General</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+<tt>xor(boolean,boolean) → boolean</tt>
+</dt>
+<dd>
+<p>
+Exclusive logical or
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>make_void() → void</tt>
+</dt>
+<dd>
+<p>
+Create a void value
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>size(A[]) → int</tt>
+</dt>
+<dd>
+<p>
+Obtain the size of array <tt>A</tt>
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>contains(A[], key) → boolean</tt>
+</dt>
+<dd>
+<p>
+Test that future <tt>A[key]</tt> exists.
+This function blocks until <tt>A</tt> is closed.  Consumers of <tt>A[key]</tt> may
+block again until <tt>A[key]</tt> is stored.
+</p>
+</dd>
+</dl></div>
+</div>
+<div class="sect2">
+<h3 id="_type_conversion">12.2. Type conversion</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+<tt>fromint(int)     → string</tt>
+</dt>
+<dd>
+<p>
+Convert integer to string
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>toint(string)    → int</tt>
+</dt>
+<dd>
+<p>
+Convert string to integer
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>fromfloat(float) → string</tt>
+</dt>
+<dd>
+<p>
+Convert float to string
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>tofloat(string)  → float</tt>
+</dt>
+<dd>
+<p>
+Convert string to float
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>itof(int)        → float</tt>
+</dt>
+<dd>
+<p>
+Convert integer to float
+</p>
+</dd>
+</dl></div>
+</div>
+<div class="sect2">
+<h3 id="_output">12.3. Output</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+<tt>trace(anything, anything, …)</tt>
+</dt>
+<dd>
+<p>
+Report the value of any variable
+</p>
+<div class="literalblock">
+<div class="content">
+<pre><tt>import io;</tt></pre>
+</div></div>
+</dd>
+<dt class="hdlist1">
+<tt>printf(string format, int|float|string|boolean…)</tt>
+</dt>
+<dd>
+<p>
+As <tt>printf()</tt> in C
+</p>
+</dd>
+</dl></div>
+</div>
+<div class="sect2">
+<h3 id="_string_functions">12.4. String functions</h3>
+<div class="paragraph"><p><tt>strcat(string,string)</tt>: Concatenation</p></div>
+<div class="paragraph"><p><strong>Import:</strong> <tt>string</tt></p></div>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+<tt>substring(string s, int start, int length) → string</tt>
+</dt>
+<dd>
+<p>
+Obtain substring of given string <tt>s</tt> starting at character <tt>start</tt> and of
+length <tt>length</tt>
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>find(string s, string substring, int start_index, int end_index) → int</tt>
+</dt>
+<dd>
+<p>
+Find the index of the first occurence of the string <tt>substring</tt> within
+the string <tt>s</tt> between the indices <tt>start_index</tt> and <tt>end_index</tt>. Here
+an index of <tt>-1</tt> passed to <tt>end_index</tt> results in <tt>end_index</tt> being
+treated as the length of the string <tt>s</tt>. <tt>find</tt> returns <tt>-1</tt> in case
+there is no occurence of <tt>substring</tt> in <tt>s</tt> in the specified range.
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>string_count(string s, string substring, int start_index, int end_index) → int</tt>
+</dt>
+<dd>
+<p>
+Counts the occurences of the string <tt>substring</tt> within the string <tt>s</tt>
+between the indices <tt>start_index</tt> and <tt>end_index</tt>. Here an index of
+<tt>-1</tt> passed to <tt>end_index</tt> results in <tt>end_index</tt> being treated as the
+length of the string <tt>s</tt>
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>is_int(string s) → boolean</tt>
+</dt>
+<dd>
+<p>
+Returns true if string <tt>s</tt> is a number, else false.
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>replace(string s, string substring, string rep_string, int start_index) → string</tt>
+</dt>
+<dd>
+<p>
+Obtain the string created by replacing the first occurence of the
+string <tt>substring</tt> within string <tt>s</tt>, after the index <tt>start_index</tt>,
+with the string <tt>rep_string</tt>. In case there is no such occurence of
+the string <tt>substring</tt> in string <tt>s</tt>, the original string <tt>s</tt> is
+returned unmodified.
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>replace_all(string s, string substring, string rep_string, int start_index) → string</tt>
+</dt>
+<dd>
+<p>
+Obtain the string created by replacing all the occurences of the
+string <tt>substring</tt> within string <tt>s</tt>, after the index <tt>start_index</tt>,
+with the string <tt>rep_string</tt>. In case no such occurence of <tt>substring</tt>
+exists in <tt>s</tt>, the original string <tt>s</tt> is returned unmodified.
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>split(string s, string delimiter) → string[]</tt>
+</dt>
+<dd>
+<p>
+Tokenize string <tt>s</tt> with given delimiter
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>trim(string s) → string</tt>
+</dt>
+<dd>
+<p>
+Remove leading and trailing whitespace from <tt>s</tt>
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>strlen(string) → int</tt>
+</dt>
+<dd>
+<p>
+Obtain the length of the given string
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>hash(string) → int</tt>
+</dt>
+<dd>
+<p>
+Hash the string to a 32-bit integer
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>sprintf(string format, int|float|string|boolean…)</tt>
+</dt>
+<dd>
+<p>
+As <tt>sprintf()</tt> in C
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>string_join(string A[], string separator) → string</tt>
+</dt>
+<dd>
+<p>
+Join strings in <tt>A</tt> with given separator.  The separator may be the
+empty string
+</p>
+</dd>
+</dl></div>
+</div>
+<div class="sect2">
+<h3 id="_math">12.5. Math</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+<tt>max|min_integer(int,int) → int</tt>
+</dt>
+<dd>
+<p>
+Obtain maximum or minimum integer,
+respectively
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>max|min_float(float,float) → float</tt>
+</dt>
+<dd>
+<p>
+Obtain maximum or minimum float,
+respectively
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>pow_integer(int b,int x)</tt>
+</dt>
+<dd>
+<p>
+Obtain b<sup>x</sup>
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>pow_float(float b,float x)</tt>
+</dt>
+<dd>
+<p>
+Obtain b<sup>x</sup>
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p><strong>Import:</strong> <tt>math</tt></p></div>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+<tt>floor(float) → int</tt>
+</dt>
+<dd>
+<p>
+Round down
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>ceil(float) → int</tt>
+</dt>
+<dd>
+<p>
+Round up
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>round(float) → int</tt>
+</dt>
+<dd>
+<p>
+Round nearest
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>log(float) → float</tt>
+</dt>
+<dd>
+<p>
+Natural logarithm
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>exp(float) → float</tt>
+</dt>
+<dd>
+<p>
+Natural exponentiation: e<sup>i</sup>
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>sqrt(float) → float</tt>
+</dt>
+<dd>
+<p>
+Square root
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>is_nan(float) → boolean</tt>
+</dt>
+<dd>
+<p>
+Check for NaN
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>abs_integer(int) → int</tt>
+</dt>
+<dd>
+<p>
+Absolute value
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>abs_float(float) → float</tt>
+</dt>
+<dd>
+<p>
+Absolute value
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p><strong>Import:</strong> <tt>random</tt></p></div>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+<tt>random() → float</tt>
+</dt>
+<dd>
+<p>
+Obtain random number
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>randint(int start, int end)</tt>
+</dt>
+<dd>
+<p>
+Obtain random integer from <tt>start</tt>, inclusive, to <tt>end</tt>, exclusive
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p><strong>Import:</strong> stats</p></div>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+<tt>sum_integer(int[]) → int</tt>
+</dt>
+<dd>
+<p>
+Sum
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>avg(int|float[]) → float</tt>
+</dt>
+<dd>
+<p>
+Average
+</p>
+</dd>
+</dl></div>
+</div>
+<div class="sect2">
+<h3 id="_system">12.6. System</h3>
+<div class="paragraph"><p><strong>Import:</strong> <tt>sys</tt></p></div>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+<tt>getenv(string) → string</tt>
+</dt>
+<dd>
+<p>
+Obtain an environment variable
+</p>
+</dd>
+</dl></div>
+<div class="sect3">
+<h4 id="argv">12.6.1. Command line</h4>
+<div class="paragraph"><p>Consider this command line:</p></div>
+<div class="literalblock">
+<div class="content">
+<pre><tt>turbine -l -n 3 program.tcl -v -a=file1.txt file2.txt --exec="prog thing1 thing2" --help file4.txt</tt></pre>
+</div></div>
+<div class="paragraph"><p>The arguments to <tt>program.tcl</tt> are just the tokens after <tt>program.tcl</tt></p></div>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+<tt>args() → string</tt>
+</dt>
+<dd>
+<p>
+Obtain all arguments as single string
+</p>
+<div class="paragraph"><p>E.g., <tt>"-v -a=file1.txt file2.txt --exec="prog thing1 thing2" --help file4.txt"</tt></p></div>
+</dd>
+</dl></div>
+<div class="paragraph"><p>The remaining functions are convenience functions oriented around
+Swift conventions.  Under these conventions, the example command above
+has <em>flagged</em> arguments <tt>v</tt>, <tt>a=file.txt</tt>, <tt>exec="prog thing1
+thing2"</tt>, and <tt>help</tt>. The command has <em>unflagged</em> arguments
+<tt>file2.txt</tt> and <tt>file4.txt</tt></p></div>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+<tt>argc()</tt>
+</dt>
+<dd>
+<p>
+Get count of unflagged arguments
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>argv(string)</tt>
+</dt>
+<dd>
+<p>
+<em>(argument-value)</em>
+Given a string, returns the flagged argument with that key:
+</p>
+<div class="paragraph"><p><tt>argv("a") → file1.txt</tt></p></div>
+<div class="paragraph"><p>In addition to regular run-time arguments, the STC <em>compile-time
+arguments</em> feature allows <tt>argv()</tt> arguments to be provided at compile
+time.  This allows a specialized, optimized version of code to be
+compiled for a particular set of arguments.  See the <tt>-A
+<em>name</em>=<em>value</em></tt> <a href="#stc_arguments">argument</a> to <tt>stc</tt>.  Note that if the
+argument is re-specified at run-time, an error will occur.</p></div>
+</dd>
+<dt class="hdlist1">
+<tt>argp(int)</tt>
+</dt>
+<dd>
+<p>
+<em>(argument-positional)</em>
+Given an integer, returns the unflagged argument at that index:
+</p>
+<div class="paragraph"><p><tt>argp(2) → file4.txt</tt></p></div>
+<div class="paragraph"><p>Given 0, returns the program name,</p></div>
+<div class="paragraph"><p><tt>argp(0) → /path/to/program.tcl</tt></p></div>
+</dd>
+<dt class="hdlist1">
+<tt>argv_accept(string…)</tt>
+</dt>
+<dd>
+<p>
+If program is given flagged command line arguments not contained in given
+list, abort.
+E.g., <tt>argv_accept("x")</tt> would cause program failure at run time
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>argv_contains(string) → boolean</tt>
+</dt>
+<dd>
+<p>
+Test if the command line contains the given flagged argument:
+</p>
+<div class="paragraph"><p><tt>argv_contains("v") → true</tt></p></div>
+</dd>
+</dl></div>
+</div>
+<div class="sect3">
+<h4 id="_debugging">12.6.2. Debugging</h4>
+<div class="paragraph"><p><strong>Import:</strong> <tt>assert</tt></p></div>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+<tt>assert(boolean condition, string message)</tt>
+</dt>
+<dd>
+<p>
+If condition is false, report <tt>message</tt> and exit immediately.
+</p>
+</dd>
+</dl></div>
+</div>
+<div class="sect3">
+<h4 id="Turbine_information">12.6.3. Turbine information</h4>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+<tt>adlb_servers()    → int</tt>
+</dt>
+<dd>
+<p>
+Number of ADLB servers
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>turbine_engines() → int</tt>
+</dt>
+<dd>
+<p>
+Number of Turbine engines
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>turbine_workers() → int</tt>
+</dt>
+<dd>
+<p>
+Number of Turbine workers
+</p>
+</dd>
+</dl></div>
+</div>
+</div>
+<div class="sect2">
+<h3 id="_files_2">12.7. Files</h3>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+<tt>filename(file) → string</tt>
+</dt>
+<dd>
+<p>
+Obtain the name of a file
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>input(string) → file</tt>
+</dt>
+<dd>
+<p>
+Obtain a <tt>file</tt>.  At run time, the
+filesystem is checked for the given file name
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>input_file(string) → file</tt>
+</dt>
+<dd>
+<p>
+Alias for <tt>input()</tt>
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>input_url(string) → file</tt>
+</dt>
+<dd>
+<p>
+Obtain a <tt>file</tt>.  Some
+automatic operations and optimizations are disabled
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>urlname(file) → string</tt>
+</dt>
+<dd>
+<p>
+Obtain the name of a file created with
+<tt>input_url()</tt>
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p><strong>Import:</strong> <tt>files</tt></p></div>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+<tt>read(file) → string</tt>
+</dt>
+<dd>
+<p>
+Read file as a string
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>write(string) → file</tt>
+</dt>
+<dd>
+<p>
+Write string to file
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>glob(string) → file[]</tt>
+</dt>
+<dd>
+<p>
+Perform glob operation, returning files
+that match.  Available glob symbols include:
+</p>
+<div class="ulist"><ul>
+<li>
+<p>
+<tt>*</tt>: any character sequence (including the zero-length sequence)
+</p>
+</li>
+<li>
+<p>
+<tt>?</tt>: any character
+</p>
+</li>
+<li>
+<p>
+<tt>[chars]</tt>: any of the given characters
+</p>
+</li>
+<li>
+<p>
+<tt>\x</tt>: character <tt>x</tt>
+</p>
+</li>
+<li>
+<p>
+<tt>{a,b,c,…}</tt> any of <tt>a</tt>, <tt>b</tt>, <tt>c</tt>, etc.
+</p>
+</li>
+</ul></div>
+</dd>
+</dl></div>
+</div>
+<div class="sect2">
+<h3 id="_blobs_2">12.8. Blobs</h3>
+<div class="paragraph"><p><strong>Import:</strong> <tt>blob</tt></p></div>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+<tt>blob_size(blob) → int</tt>
+</dt>
+<dd>
+<p>
+Obtain the size of a blob in bytes.
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>blob_null() → blob</tt>
+</dt>
+<dd>
+<p>
+Obtain an empty blob of size 0.
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>blob_from_string(string) → blob</tt>
+</dt>
+<dd>
+<p>
+Convert a string into a blob.
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>string_from_blob(blob) → string</tt>
+</dt>
+<dd>
+<p>
+Convert a blob into a string.  If
+the blob is not NULL-terminated, this function appends the
+NULL-terminator.
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>blob_from_floats(float[]) → blob</tt>
+</dt>
+<dd>
+<p>
+Convert an array of Swift floats
+(implemented as doubles) to blob containing the C-formatted array of
+doubles .
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>blob_from_floats(blob) → float[]</tt>
+</dt>
+<dd>
+<p>
+Convert blob containing the
+C-formatted array of doubles to an array of Swift floats
+(implemented as doubles).
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>blob_from_ints(int i[]) → blob</tt>
+</dt>
+<dd>
+<p>
+Convert blob containing the
+C-formatted array of ints to an array of Swift ints (implemented
+as 64-bit integers).
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>blob_from_file(file) → blob</tt>
+</dt>
+<dd>
+<p>
+Reads whole file, returning it as a
+blob.
+</p>
+</dd>
+</dl></div>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_defining_leaf_functions">13. Defining leaf functions</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>In typical Swift applications, the computationally intensive parts of
+the application are not written in the Swift language.  Rather, the
+work is done by <em>leaf functions</em> that are <em>composed</em> together with
+Swift code.  Leaf functions may be extension or app functions.</p></div>
+<div class="paragraph"><p>The Swift runtime, Turbine, is built on Tcl, a language which intends
+to makes it easy to call C/C++/Fortran functions.  The builtin
+functions mentioned above are implemented as extension functions in
+Tcl, which may wrap C/C++/Fortran functions.</p></div>
+<div class="sect2">
+<h3 id="_swift_extension_functions">13.1. Swift extension functions</h3>
+<div class="paragraph"><p>Currently we support Tcl extension functions, where a function is
+implemented as a Tcl function.  Tcl has good support for wrapping
+native C/C++ functions, so this provides an indirect way to call
+C/C++ functions from Swift.</p></div>
+<div class="paragraph"><p>Several components are required to implement a Swift native code function:</p></div>
+<div class="ulist"><ul>
+<li>
+<p>
+Tcl bindings to your function.
+</p>
+</li>
+<li>
+<p>
+For complex types such as structures, arrays and files, you may need
+   additional logic to marshal inputs and outputs to/from the global
+   data store.
+</p>
+</li>
+<li>
+<p>
+The requisite files required to build a Tcl package
+   (e.g <tt>pkgIndex.tcl</tt>)
+</p>
+</li>
+<li>
+<p>
+Swift declarations for the function that specify the type of the
+   function and the Tcl implementation.
+</p>
+</li>
+</ul></div>
+<div class="sect3">
+<h4 id="_simple_tcl_fragment_example">13.1.1. Simple Tcl fragment example</h4>
+<div class="paragraph"><p>In this example, the Swift program will simply use Tcl to output a
+string:</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>() my_output (string s) "turbine" "0.0" [
+  "puts <<s>>"
+];
+
+main {
+  my_output("HELLO");
+}</tt></pre>
+</div></div>
+<div class="paragraph"><p><tt>puts</tt> is the Tcl builtin for screen output, like <tt>puts()</tt> in C.</p></div>
+<div class="paragraph"><p>The above definition has, from left to right, the output arguments
+(none), the name of the new Swift function, input arguments, the name
+of the Tcl package containing the file (here, none, so we use
+<tt>turbine</tt>), and the minimum version of that package (here, 0.0).</p></div>
+<div class="paragraph"><p>We tell the compiler how to call our Tcl function using inline
+Tcl code as a template with variable names surrounded by <tt><< >></tt>
+indicating where variables should be substituted.</p></div>
+</div>
+<div class="sect3">
+<h4 id="_simple_tcl_package_example">13.1.2. Simple Tcl package example</h4>
+<div class="paragraph"><p>In this first example we will implement a trivial Tcl extension function
+that doubles an integer.  Here is the Tcl code that will go in
+<tt>myextension.tcl</tt>:</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>namespace eval myextension {
+  proc double { x } {
+    return [ expr $x * 2 ]
+  }
+}</tt></pre>
+</div></div>
+<div class="paragraph"><p>Here is the Swift function definition that will go in <tt>myextension.swift</tt>:</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>@pure
+(int o) double (int i) "myextension" "0.0.1" [
+  "set <<o>> [ myextension::double <<i>> ]"
+];</tt></pre>
+</div></div>
+<div class="paragraph"><p>We can also tell the Swift compiler a little about the function so
+that it can better optimize your programs.  For example, <tt>double</tt> has
+no side-effects and produces the same result each time for the same
+arguments (i.e. is deterministic), so we can annotate it as a <tt>@pure</tt>
+function.</p></div>
+<div class="paragraph"><p>If your function has a long running time and should be dispatched to a
+worker process for execution, then you need to label the function as a
+leaf function, for example:</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>@dispatch=LEAF
+(int o) process (int i) "pkg" "0.0.1" [
+  "set <<o>> [ pkg::process <<i>> ]"
+];</tt></pre>
+</div></div>
+<div class="paragraph"><p>Tcl code is conventionally placed into <em>packages</em>.  In this example,
+<tt>myextension.tcl</tt> would be part of the package.</p></div>
+<div class="paragraph"><p>More information about building Tcl packages may be found
+<a href="http://www.tcl.tk/man/tcl8.5/TclCmd/pkgMkIndex.htm">here</a>.  Ultimately,
+you produce a <tt>pkgIndex.tcl</tt> file that contains necessary information
+about the package.</p></div>
+<div class="paragraph"><p>To ensure that Swift can find your package, use</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>stc -r <package directory> ...</tt></pre>
+</div></div>
+<div class="paragraph"><p>or set <tt>TURBINE_USER_LIB</tt> at run time.</p></div>
+<div class="ulist"><ul>
+<li>
+<p>
+<strong>Tip:</strong> advanced users can also create <a href="#mkstatic">standalone executables</a>
+     with compiled code and Tcl code for the extension directly linked in.
+</p>
+</li>
+</ul></div>
+</div>
+<div class="sect3">
+<h4 id="_swift_tcl_data_type_mapping">13.1.3. Swift/Tcl data type mapping</h4>
+<div class="paragraph"><p>If you are defining Tcl functions in the way above with inline
+Tcl code, Swift types are mapped to Tcl types in the following way:</p></div>
+<div class="ulist"><ul>
+<li>
+<p>
+<tt>int</tt>/<tt>float</tt>/<tt>string</tt>/<tt>bool</tt> are converted to the standard
+  Tcl representations
+</p>
+</li>
+<li>
+<p>
+blobs are represented as a Tcl list with first element a pointer
+  to the data, the second element the length of the data, and if
+  the blob was loaded from the ADLB data store, a third element
+  which is the ADLB ID of the blob
+</p>
+</li>
+<li>
+<p>
+files are represented as a list, with the first element the
+  file path, and the second element a reference count
+</p>
+</li>
+</ul></div>
+</div>
+<div class="sect3">
+<h4 id="_calling_native_libraries_from_swift">13.1.4. Calling native libraries from Swift</h4>
+<div class="paragraph"><p>The first step is to test that you can successfully call your
+C/C++/Fortran function from a test Tcl script.  If so, you will then
+be able to use the Swift→Tcl techniques to call it from Swift.</p></div>
+<div class="paragraph"><p>A popular tool to automate Tcl→C bindings is
+<a href="http://www.swig.org">SWIG</a>, which will wrap your C/C++ functions and
+help you produce a Tcl package suitable for use by Swift.</p></div>
+<div class="paragraph"><p>To call Fortran functions, first wrap your code with
+<a href="http://fortwrap.sourceforge.net">FortWrap</a>.  Then, use SWIG to produce
+Tcl bindings.</p></div>
+</div>
+<div class="sect3">
+<h4 id="_writing_custom_tcl_interfaces">13.1.5. Writing custom Tcl interfaces</h4>
+<div class="paragraph"><p>For Tcl functions that take complex argument types, such as arrays or
+structures, you may need to write a Tcl wrapper function that is
+directly passed references to data in Swift’s global data store.  In
+this case your function must manually retrieve/store data from/to the
+global distributed data store.  In this case, you do not use the STC
+Tcl argument substitution syntax (<tt><<<tt>i</tt>>></tt>).</p></div>
+<div class="paragraph"><p>Consider this custom Swift→Tcl binding:</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>(int o) complex_function (int arr[]) "pkg" "0.0.1" "complex";</tt></pre>
+</div></div>
+<div class="paragraph"><p>This function jumps into Tcl function <tt>complex</tt>, which must
+perform its own data dependency management.</p></div>
+<div class="paragraph"><p>See the <a href="leaf.html">Swift/T Leaf Function Guide</a> for more
+information about this process.</p></div>
+</div>
+</div>
+<div class="sect2">
+<h3 id="app_functions">13.2. App functions</h3>
+<div class="paragraph"><p>App functions are functions that are implemented as command-line
+programs.  These command-line programs can be brought into a Swift
+program as functions with typed inputs and outputs.
+An app function definition comprises:</p></div>
+<div class="ulist"><ul>
+<li>
+<p>
+The standard components of a Swift function declaration: input and
+    output arguments and the function name.  Note that the output
+    variable types are restricted to individual <tt>file</tt>s.
+</p>
+</li>
+<li>
+<p>
+The command line, which comprises an initial string which is the
+    executable to run, and then a series of arguments which are
+    the command-line arguments to pass to the program.
+</p>
+</li>
+</ul></div>
+<div class="paragraph"><p>App arguments can be:</p></div>
+<div class="ulist"><ul>
+<li>
+<p>
+Literals such as numbers or strings.
+</p>
+</li>
+<li>
+<p>
+File variables (passed as file paths).
+</p>
+</li>
+<li>
+<p>
+Other variables, which are converted to string arguments.
+    Arrays (including multi-dimensional arrays) are expanded to
+    multiple arguments.
+</p>
+</li>
+<li>
+<p>
+Arbitrary expressions surrounded by parentheses.
+</p>
+</li>
+</ul></div>
+<div class="paragraph"><p>Standard input, output and error can be redirected to files via
+<tt>@stdin=</tt>, <tt>@stdout=</tt>, and <tt>@stderr=</tt> expressions.  If used, these should point
+to a <tt>file</tt>.</p></div>
+<div class="paragraph"><p>Here is an example of an app function that joins multiple files
+with the <tt>cat</tt> utility:</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>import files;
+
+app (file out) cat (file inputs[]) {
+  "/bin/cat" inputs @stdout=out
+}
+
+main {
+  file joined <"joined.txt"> = cat(glob("*.txt"));
+}</tt></pre>
+</div></div>
+<div class="paragraph"><p>Here is an example of an app function that sleeps for an arbitrary
+amount of time:</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>app (void signal) sleep (int secs) {
+  "/bin/sleep" secs
+}
+
+main {
+  foreach time in [1:5] {
+    void signal = sleep(time);
+    // Wait on output signal so that trace occurs after sleep
+    wait(signal) {
+      trace("Slept " + fromint(time));
+    }
+  }
+}</tt></pre>
+</div></div>
+</div>
+<div class="sect2">
+<h3 id="_external_scripting_support">13.3. External scripting support</h3>
+<div class="sect3">
+<h4 id="_calling_python">13.3.1. Calling Python</h4>
+<div class="paragraph"><p>You can evaluate arbitrary Python code from within Swift/T.  For
+example, you can perform processing with a Python library.
+Once you have that working, you can use Swift/T to coordinate
+concurrent calls to that library.</p></div>
+<div class="paragraph"><p>Consider the following Swift script:</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>import io;
+import python;
+
+main {
+  i = python("print(\"python works\")\n2+2");
+  printf("i: %s", i);
+}</tt></pre>
+</div></div>
+<div class="paragraph"><p>This simply evaluates the Python code line by line. The last line must
+return a Python string to Swift, in this case, the Python string
+<tt>'4'</tt>.  The expected output is shown below:</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>python works
+i: 4</tt></pre>
+</div></div>
+<div class="paragraph"><p>Swift multi-line strings may be used to enter more complex Python code
+without the explicit use of <tt>\n</tt>.</p></div>
+<div class="paragraph"><p>Additionally, you can call Python libraries such as
+<a href="http://www.numpy.org">Numpy</a> if available on your system.  The
+following code adds matrices <em>I</em><sub>3</sub> + <em>I</em><sub>3</sub> using Numpy arrays.</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>import io;
+import python;
+import string;
+
+global const string numpy = "from numpy import *\n\n";
+
+typedef matrix string;
+
+(matrix A) eye(int n)
+{
+  string command = sprintf("repr(eye(%i))", n);
+  string code = numpy+command;
+  matrix t = python(code);
+  A = replace_all(t, "\n", "", 0);
+}
+
+(matrix R) add(matrix A1, matrix A2)
+{
+  string command = sprintf("repr(%s+%s)", A1, A2);
+  string code = numpy+command;
+  matrix t = python(code);
+  R = replace_all(t, "\n", "", 0);
+}
+
+main
+{
+  matrix A1 = eye(3);
+  matrix A2 = eye(3);
+  matrix sum = add(A1, A2);
+  printf("2*eye(3)=%s", sum);
+}</tt></pre>
+</div></div>
+<div class="paragraph"><p>An Python script template is created that imports Numpy and performs
+some simple calculations.  This code is represented in a Swift string.
+The template is filled in by the Swift call to <tt>sprintf()</tt>.  Then, the
+code is passed to Python for evaluation.  The output is:</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>2*eye(3)=array([[ 2.,  0.,  0.],
+                [ 0.,  2.,  0.],
+                [ 0.,  0.,  2.]])</tt></pre>
+</div></div>
+<div class="admonitionblock">
+<table><tr>
+<td class="icon">
+<div class="title">Note</div>
+</td>
+<td class="content">To use this, Turbine must be configured with Python enabled
+ before compiling, by setting <tt>ENABLE_PYTHON=1</tt>
+ in <tt>exm-settings.sh</tt>, or by providing the <tt>--enable-python</tt> argument
+ to <tt>configure</tt>.  This feature is implemented by linking to Python
+ as a shared library, enabling better performance than calling the
+ <tt>python</tt> program (which may be done by using a normal Swift
+ <a href="#app_functions">app function</a>).  Error messages for minor coding
+ mistakes may be badly mangled and refer to missing Python symbols-
+ refer to the first error in the Python stack trace.</td>
+</tr></table>
+</div>
+</div>
+<div class="sect3">
+<h4 id="_calling_r">13.3.2. Calling R</h4>
+<div class="paragraph"><p>Consider the following Swift script:</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>import io;
+import string;
+import R;
+
+global const string template =
+"""
+  x <- %i
+  a <- x+100
+  cat("the answer is: ", a, "\\n")
+  a
+""";
+
+main
+{
+  code = sprintf(template, 4);
+  s = R(code);
+  printf("the answer was: %i", s);
+}</tt></pre>
+</div></div>
+<div class="paragraph"><p>An <a href="http://www.r-project.org">R language</a> script template is placed in a
+Swift string.  The template is filled in with the value 4 by the Swift
+call to <tt>sprintf()</tt> (note the <tt>%i</tt> conversion specifier).  Then, the
+code is passed to R for evaluation.  The output is:</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>the answer is:  104
+the answer was: 104</tt></pre>
+</div></div>
+<div class="paragraph"><p>As coded here, both R and Swift report the value of <tt>a</tt>.</p></div>
+<div class="admonitionblock">
+<table><tr>
+<td class="icon">
+<div class="title">Note</div>
+</td>
+<td class="content">To use this, Turbine must be configured with R enabled
+ before compiling, by setting <tt>ENABLE_R=1</tt>
+ in <tt>exm-settings.sh</tt>, or by providing the <tt>--enable-r</tt> argument
+ to <tt>configure</tt>.  This feature is implemented by linking to R as a shared
+ library, enabling better performance than calling the <tt>R</tt> program
+ (which may be done by using a normal Swift <a href="#app_functions">app  function</a>).  When installing R, be sure to include the <tt>devel</tt>
+ package.  When installing R from source, configure with
+ <tt>--enable-R-shlib</tt>. You may need to set the environment variable
+ <tt>R_HOME</tt> to the directory containing the R installation.  For the APT
+ package, this is <tt>/usr/lib/R</tt>.</td>
+</tr></table>
+</div>
+</div>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="Optimizations">14. Optimizations</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>STC performs a range of compiler optimizations that can significantly
+speed up most Swift programs.  The optimization level can be controlled
+by the <tt>-O</tt> command line option.  The default optimization
+level <tt>-O2</tt>, or the increased optimization level <tt>-O3</tt> are usually
+the best choices.  Some applications benefit markedly from <tt>-O3</tt>,
+while others do not, and compile times can increase slightly.</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt># No optimizations at all (not recommended)
+stc -O0 example.swift example.tcl
+
+# Basic optimizations (not recommended)
+stc -O1 example.swift example.tcl
+
+# Standard optimizations (recommended)
+stc example.swift example.tcl
+# OR
+stc -O2 example.swift example.tcl
+
+# All optimizations (also recommended)
+stc -O3 example.swift example.tcl</tt></pre>
+</div></div>
+<div class="paragraph"><p>Individual optimizations can be toggled on using <tt>-T <opt name></tt>
+or off with <tt>-t <opt name></tt>, but this typically is only useful for
+debugging.  You can find an up-to-date list of optimizations in
+the stc command-line help:</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>stc -h</tt></pre>
+</div></div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="Turbine">15. Running in Turbine</h2>
+<div class="sectionbody">
+<div class="paragraph"><p>The following describes how to run Turbine programs.</p></div>
+<div class="sect2">
+<h3 id="_architecture">15.1. Architecture</h3>
+<div class="paragraph"><p>Turbine runs as an MPI program consisting of many processes.  Turbine
+programs are ADLB programs.  Thus, they produce and execute discrete
+tasks that are distributed and load balanced at run time.</p></div>
+<div class="paragraph"><p>Each process runs in a <em>mode</em>: <em>engine</em>, <em>worker</em>, or <em>server</em>.</p></div>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+Engines
+</dt>
+<dd>
+<p>
+Evaluate the Swift logic.  Produces tasks
+</p>
+</dd>
+<dt class="hdlist1">
+Workers
+</dt>
+<dd>
+<p>
+Performs tasks
+</p>
+</dd>
+<dt class="hdlist1">
+Servers
+</dt>
+<dd>
+<p>
+Distributes tasks
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>Typical Swift programs perform compute-intensive work in leaf
+functions.  These always execute on workers.</p></div>
+<div class="paragraph"><p>Engines split up the control logic work among themselves.  This
+results in the generation of calls to extension functions.</p></div>
+<div class="paragraph"><p>Servers distribute tasks in a scalable, load balanced manner.  They
+also store Swift data (integers, strings, etc.).</p></div>
+</div>
+<div class="sect2">
+<h3 id="_concurrency">15.2. Concurrency</h3>
+<div class="paragraph"><p>The available concurrency and efficiency in your Swift script is
+limited by the following factors:</p></div>
+<div class="ulist"><ul>
+<li>
+<p>
+The available concurrency in the Swift logic.  Sequential
+  dependencies will be evaluated sequentially.  <tt>foreach</tt> loops and
+  branching function calls may be evaluated concurrently
+</p>
+</li>
+<li>
+<p>
+The number of workers available to process leaf functions
+  concurrently
+</p>
+</li>
+<li>
+<p>
+The number of engines and servers available to control the Turbine
+  run.  Adding more engines and servers usually improves performance
+  but costs processes
+</p>
+</li>
+</ul></div>
+</div>
+<div class="sect2">
+<h3 id="_invocation">15.3. Invocation</h3>
+<div class="paragraph"><p>The form of a Turbine invocation for STC-generated
+<tt>program.tcl</tt> is:</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>turbine <turbine arguments> <program.tcl> <program arguments></tt></pre>
+</div></div>
+<div class="paragraph"><p>The program arguments are available to Swift (<a href="#argv">[argv]</a>).</p></div>
+<div class="paragraph"><p>Turbine accepts the following arguments:</p></div>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+<tt>-f <file></tt>
+</dt>
+<dd>
+<p>
+Provide a machine file to <tt>mpiexec</tt>
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>-h</tt>
+</dt>
+<dd>
+<p>
+Print a help message
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>-l</tt>
+</dt>
+<dd>
+<p>
+Enable <tt>mpiexec -l</tt> ranked output formatting
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>-n <procs></tt>
+</dt>
+<dd>
+<p>
+The total number of Turbine MPI processes
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>-v</tt>
+</dt>
+<dd>
+<p>
+Report the Turbine version number
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>-V</tt>
+</dt>
+<dd>
+<p>
+Make the Turbine launch script verbose
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>-x</tt>
+</dt>
+<dd>
+<p>
+Use turbine_sh launcher with compiled-in libraries instead of tclsh
+       (reduces number of files that must be read from file system)
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>-X</tt>
+</dt>
+<dd>
+<p>
+In place of of program.tcl, run standalone Turbine executable
+        (e.g. created by <a href="#mkstatic">mkstatic.tcl</a>)
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>The user controls the Turbine run time configuration through
+environment variables:</p></div>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+<tt>TURBINE_ENGINES</tt>
+</dt>
+<dd>
+<p>
+Number of Turbine engines
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>ADLB_SERVERS</tt>
+</dt>
+<dd>
+<p>
+Number of ADLB servers
+</p>
+</dd>
+</dl></div>
+<div class="paragraph"><p>The remaining processes are workers.  These values are available to
+Swift (<a href="#Turbine_information">Turbine information</a>).</p></div>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+<tt>TURBINE_LOG=0</tt>
+</dt>
+<dd>
+<p>
+Disable logging. <tt>TURBINE_LOG=1</tt> or unset enables
+logging, assuming logging was not disabled at configure time.  Logging
+goes to tandard output by default.
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>TURBINE_LOG_FILE=<file></tt>
+</dt>
+<dd>
+<p>
+Set log file location.  Defaults to
+standard output.
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>TURBINE_LOG_RANKS=1</tt>
+</dt>
+<dd>
+<p>
+Using <tt>turbine -l</tt> or equivalent prepend the
+MPI rank number to each output line.  This works with typical MPICH or
+OpenMPI systems, however, this is not available on some systems, so
+set this to emulate the rank output on such systems.
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>ADLB_PRINT_TIME=1</tt>
+</dt>
+<dd>
+<p>
+Enable a short report of total elapsed time (via
+<tt>MPI_Wtime()</tt>)
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>ADLB_PERF_COUNTERS=1</tt>
+</dt>
+<dd>
+<p>
+Enable performance counters (printed at end of execution).  The
+<a href="internals.html">Swift/T internals guide</a> has information
+about interpreting the output.
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>ADLB_EXHAUST_TIME</tt>
+</dt>
+<dd>
+<p>
+Time in seconds taken by ADLB task servers to shut down.  May include
+a decimal point.  Default 0.1 .  Setting this lower will reduce
+delay in detection exhaustion.  Setting this higher will reduce
+overhead due to failed exhaust checks.  The default setting is
+almost always adequate.
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>ADLB_REPORT_LEAKS=1</tt>
+</dt>
+<dd>
+<p>
+Enable reporting of any unfreed data in ADLB data store at end of
+execution.
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>ADLB_TRACE=true</tt>
+</dt>
+<dt class="hdlist1">
+<tt>ADLB_DEBUG=true</tt>
+</dt>
+<dd>
+<p>
+To print DEBUG/TRACE level information for ADLB (if ADLB was compiled
+with it enabled)
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>TURBINE_LAUNCH_OPTIONS</tt>
+</dt>
+<dd>
+<p>
+Provide other arguments to <tt>mpiexec</tt>, such as a machine file, etc.
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>TURBINE_SRAND</tt>
+</dt>
+<dd>
+<p>
+If unset or empty, the random number generator seed will be set to the
+process rank for each process, giving reproducible results.  If set to
+an integer <tt>seed</tt>, the random number generator seed for each process
+will be set to <tt>seed</tt> + <tt>rank</tt>.
+</p>
+<div class="paragraph"><p>For non-reproducible random results, use the following shell commands:</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>export TURBINE_SRAND=$( date +%s )
+turbine ...</tt></pre>
+</div></div>
+<div class="paragraph"><p>The seed is recorded in the log.</p></div>
+</dd>
+<dt class="hdlist1">
+<tt>ADLB_DEBUG_RANKS=1</tt>
+</dt>
+<dd>
+<p>
+Enable a report showing the rank and hostname
+of each process.  This allows you to determine whether your process
+layout on a given machine is as intended.
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>ADLB_DEBUG_HOSTMAP=1</tt>
+</dt>
+<dd>
+<p>
+Enable a report showing the hostmap, which
+maps hostnames to ranks for use with the location functionality.
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>ADLB_DISABLE_HOSTMAP=1</tt>
+</dt>
+<dd>
+<p>
+Prevent the hostmap from being constructed.
+</p>
+</dd>
+</dl></div>
+</div>
+<div class="sect2">
+<h3 id="Build_configuration">15.4. Build configuration</h3>
+<div class="paragraph"><p>The following describes how to turn Swift/T programs in Turbine
+on more complex systems.</p></div>
+<div class="sect3">
+<h4 id="_build_troubleshooting">15.4.1. Build troubleshooting</h4>
+<div class="paragraph"><p>If <tt>exm-setup.zsh</tt> does not succeed, you may need to change how it
+tries to configure and compile Swift/T.</p></div>
+<div class="paragraph"><p>Troubleshooting a build problem can require a few steps.  The first
+step is to determine why the build failed.  <tt>exm-setup.zsh</tt> will usually
+report the step at which configuration failed.  For example, if it was unable
+to locate a valid Tcl install, it will report this.  Then  you can try
+these steps to resolve the problem:</p></div>
+<div class="olist arabic"><ol class="arabic">
+<li>
+<p>
+If your system is covered by the <a href="turbine-sites.html">Sites Guide</a>,
+   check to see if the problem and solution are described there.
+</p>
+</li>
+<li>
+<p>
+Inspect <tt>exm-settings.sh</tt> settings related to the reported problem.
+  For example, if locating a Tcl install failed, setting
+  the <tt>TCL_INSTALL</tt> and <tt>TCL_VERSION</tt> variables to the correct location
+  and version may help.
+</p>
+</li>
+<li>
+<p>
+If the options in <tt>exm-settings.sh</tt> do not give sufficient control to
+  fix the problem, you may need to manually configure some components
+  of Swift/T, as described in the next section.
+</p>
+</li>
+</ol></div>
+</div>
+<div class="sect3">
+<h4 id="Manual_build_configuration">15.4.2. Manual configuration</h4>
+<div class="paragraph"><p><tt>exm-setup.zsh</tt> and <tt>exm-settings.sh</tt> provide a convenient way to install
+Swift/T. However, this method does not allow full control over
+the configuration.  Swift/T is built with standard Ant (Java) and
+Autotools/Makefile (C,Tcl) techniques.  You can more directly control
+the configuration when building through the arguments to <tt>ant</tt> or
+<tt>configure</tt>.</p></div>
+<div class="paragraph"><p>To perform the installation using <tt>configure</tt>/<tt>make</tt>, simply untar the
+distribution package and do:</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>cd c-utils
+./configure ...
+make install
+
+cd ../lb
+./configure ...
+make install
+
+cd ../turbine
+./configure ...
+make install
+
+cd ../stc
+ant install -Ddist.dir=... -Dturbine.home=...</tt></pre>
+</div></div>
+<div class="ulist"><ul>
+<li>
+<p>
+You may use <tt>./configure --help</tt> and the
+  <a href="turbine-sites.html">Sites Guide</a> for further options.
+</p>
+</li>
+</ul></div>
+</div>
+<div class="sect3">
+<h4 id="_non_standard_mpi_locations">15.4.3. Non-standard MPI locations</h4>
+<div class="paragraph"><p>Sometimes simply specifying the MPI directory is not enough to
+configure Swift/T.</p></div>
+<div class="paragraph"><p>You can modify these settings in <tt>exm-settings.sh</tt> to more precisely
+define locations of MPI resources</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt>EXM_CUSTOM_MPI=1
+MPI_INCLUDE=/path/to/mpi.h/include
+MPI_LIB_DIR=/path/to/mpi_lib/lib
+MPI_LIB_NAME=funny.mpi.a</tt></pre>
+</div></div>
+<div class="paragraph"><p>If you are following the manual build process, configure Turbine with:</p></div>
+<div class="listingblock">
+<div class="content">
+<pre><tt> --enable-custom --with-mpi-include=/path/to/mpi.h/include
+                 --with-mpi-lib-dir=/path/to/mpi_lib/lib
+                 --with-mpi-lib-name=funny.mpi.a</tt></pre>
+</div></div>
+</div>
+</div>
+<div class="sect2">
+<h3 id="_performance_enhancements">15.5. Performance enhancements</h3>
+<div class="olist arabic"><ol class="arabic">
+<li>
+<p>
+Disable logging/debugging via environment
+</p>
+</li>
+<li>
+<p>
+Disable logging/debugging at configure/compile time
+</p>
+<div class="ulist"><ul>
+<li>
+<p>
+Configure c-utils with <tt>--disable-log</tt>
+</p>
+</li>
+</ul></div>
+</li>
+<li>
+<p>
+Specify <tt>EXM_OPT_BUILD=1</tt> in <tt>exm-settings.sh</tt> or configure everything
+    with <tt>--enable-fast</tt>.  This disables assertions and other checks
+</p>
+</li>
+<li>
+<p>
+When making performance measurements, always subtract 0.1 seconds
+   (or the value of <tt>ADLB_EXHAUST_TIME</tt>) from the Turbine run time
+   due to the ADLB shutdown protocol, which does not start until the
+   system is idle for that amount of time.
+</p>
+</li>
+<li>
+<p>
+Reduce the number of program files that must be read off the
+   filesystem.  This is particularly useful for parallel file systems
+   and large scale applications.  In increasing order of effectiveness,
+   you can:
+</p>
+<div class="ulist"><ul>
+<li>
+<p>
+use the turbine_sh launcher in place of tclsh in submit script,
+   or by specifying the <tt>-x</tt> argument to <tt>turbine</tt>
+</p>
+</li>
+<li>
+<p>
+Use <a href="#mkstatic">mkstatic.tcl</a> to create a standalone executable with
+   the Tcl main script and Tcl library code compiled in, and compiled
+   code statically linked.
+</p>
+</li>
+</ul></div>
+</li>
+</ol></div>
+</div>
+<div class="sect2">
+<h3 id="mkstatic">15.6. Building standalone executables with mkstatic.tcl</h3>
+<div class="paragraph"><p>It is possible to build a fully self-contained executable, including
+all Tcl scripts and compiled code, provided that all dependencies support
+static linking.  If not, it is also possible to build an executable with
+a subset of Tcl scripts and code linked in, providing some performance
+benefits.</p></div>
+<div class="admonitionblock">
+<table><tr>
+<td class="icon">
+<div class="title">Note</div>
+</td>
+<td class="content">Ensure that static versions of the <tt>c-utils</tt>, <tt>lb</tt>, and <tt>turbine</tt> libraries
+   were built, typically with a <tt>.a</tt> suffix, e.g. <tt>libadlb.a</tt>.  These
+   are created by default, unless you specified <tt>DISABLE_STATIC=0</tt> or
+   <tt>--disable-static</tt>.  To build a fully standalone
+   executable, you will also need to build a static version of Tcl
+   (with the <tt>--disable-shared</tt> configure option), and static versions
+   of any other libraries your own code needs to link with, such
+   as your MPI distribution or application code.</td>
+</tr></table>
+</div>
+<div class="olist arabic"><ol class="arabic">
+<li>
+<p>
+Compile your Swift script
+</p>
+<div class="listingblock">
+<div class="content">
+<pre><tt>stc my.swift</tt></pre>
+</div></div>
+<div class="paragraph"><p>producing the Turbine Tcl script <tt>my.tcl</tt>.</p></div>
+</li>
+<li>
+<p>
+Create a manifest file, e.g. <tt>my.manifest</tt>.  This file describes the
+   resources to be bundled, including the STC-generated code and any
+   user libraries.
+</p>
+<div class="paragraph"><p>To do this, make a copy of <tt>scripts/mkstatic/example.manifest</tt> from
+the Turbine installation directory.  This file contains examples and
+descriptions of all the the possible settings.  Note that an empty
+manifest file corresponds to the <tt>turbine_sh</tt> utility, which is a
+replacement for <tt>tclsh</tt> with required Turbine libraries statically
+linked in.</p></div>
+</li>
+<li>
+<p>
+Invoke <tt>mkstatic.tcl</tt> (found under <tt>scripts/mkstatic/mkstatic.tcl</tt> in
+   the Turbine installation) to translate your Tcl script to a C main
+   program (e.g., <tt>my_main.c</tt>) with Tcl source code included.
+   The minimal invocation is
+</p>
+<div class="listingblock">
+<div class="content">
+<pre><tt>mkstatic.tcl my.manifest -c my_main.c</tt></pre>
+</div></div>
+<div class="paragraph"><p>You will likely wish to include Tcl system libraries with
+<tt>--include-sys-lib /home/example/tcl-install/lib --tcl-version 8.6</tt>.
+The Tcl system library directory can be identified by the fact that
+it contains the file <tt>init.tcl</tt>.  This directory must be specified
+with a special flag so that <tt>mkstatic.tcl</tt> can correctly replace
+the regular Tcl initialization process.</p></div>
+<div class="paragraph"><p>You can include additional libraries and packages with
+<tt>--include-lib /home/example/tcl-lib/</tt>.  Any <tt>.tcl</tt> or <tt>.tm</tt> source files
+in the directory will be included.  Source-only packages can
+generally be completely linked into the executable, but if a package
+loads shared libraries, only the <tt>pkgIndex.tcl</tt> file will be linked
+into the executable.  A package with compiled code can be converted to
+support static linking by specifying a package init function, plus
+static library or object files in the manifest file.</p></div>
+</li>
+<li>
+<p>
+Link together the compiled C main program with user libraries and
+  Swift/T libraries to produce a final executable.
+  The details vary depending on the compiler:
+  we assume GCC.  <tt>mkstatic.tcl</tt> may be used to obtain the required
+  linker flags, for example:
+</p>
+<div class="listingblock">
+<div class="content">
+<pre><tt>mkstatic.tcl my.manifest --link-objs --link-flags</tt></pre>
+</div></div>
+<div class="paragraph"><p>produces the necessary linker flags for your manifest.</p></div>
+<div class="paragraph"><p>The Turbine distribution includes a helper script,
+<tt>turbine-build-config.sh</tt>, that can be sourced to obtain linker flags
+for Swift/T dependencies.</p></div>
+<div class="ulist"><ul>
+<li>
+<p>
+Note that, in the case of static linking, if <strong>libA</strong> depends on <strong>libB</strong>,
+  then the <tt>-lA</tt> flag must precede <tt>-lB</tt> on the command line.  To
+  actually do the linking, there are two further cases to consider:
+</p>
+<div class="ulist"><ul>
+<li>
+<p>
+If building a fully static executable, you can
+  provide the <tt>-static</tt> flag, plus all object files, plus <tt>-L</tt>
+  and <tt>-l</tt> flags for all required library directories and libraries.
+</p>
+<div class="listingblock">
+<div class="content">
+<pre><tt>gcc -static script_main.c file1.o file2.o -L/path/to/lib/dir -lsomething ...</tt></pre>
+</div></div>
+</li>
+<li>
+<p>
+If you are building an executable that depends on one or more shared
+  libraries, you will need to provide the <tt>-dynamic</tt> flag, and then
+  ensure that static libraries are linked statically.  If a shared
+  version of a library is available, <tt>gcc</tt> will use that in preference
+  to a static version.  You can override this behaviour by specifying
+  <tt>-Wl,-Bstatic</tt> on the command line before the flags for the libraries
+  you wish to statically link, then <tt>-Wl,-Bdynamic</tt> to reset to
+  dynamic linking for any libraries after those.
+</p>
+</li>
+</ul></div>
+</li>
+</ul></div>
+</li>
+</ol></div>
+<div class="paragraph"><p>We have described the most commonly-used options.  A full list of options
+and descriptions can be obtained by invoking <tt>mkstatic.tcl -h</tt>.
+Additional options include:</p></div>
+<div class="dlist"><dl>
+<dt class="hdlist1">
+<tt>--main-script</tt>
+</dt>
+<dd>
+<p>
+Specify Tcl main script (overrides manifest file)
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>-r</tt>
+</dt>
+<dd>
+<p>
+Specify non-standard variable prefix for C code
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>-v</tt>
+</dt>
+<dd>
+<p>
+Print verbose messages
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>--deps</tt>
+</dt>
+<dd>
+<p>
+Generate Makefile include for generating C file
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>--link-deps</tt>
+</dt>
+<dd>
+<p>
+Generate Makefile include for linking executable
+</p>
+</dd>
+<dt class="hdlist1">
+<tt>--ignore-no-manifest</tt>
+</dt>
+<dd>
+<p>
+Pretend empty manifest present
+</p>
+</dd>
+</dl></div>
+</div>
+</div>
+</div>
+</div>
+<div id="footnotes"><hr /></div>
+<div id="footer">
+<div id="footer-text">
+Last updated 2014-05-06 12:09:00 CDT
+</div>
+</div>
+</body>
+</html>




More information about the Swift-commit mailing list