0.94RC4 current version
2013/02/22
+
0.94 current version
2013/03/01
-
Read our Quick Start Guide
+
Read our Quick Start Guide
and start using Swift today!
From davidk at ci.uchicago.edu Sat Mar 2 15:30:49 2013
From: davidk at ci.uchicago.edu (davidk at ci.uchicago.edu)
Date: Sat, 2 Mar 2013 15:30:49 -0600 (CST)
Subject: [Swift-commit] r6323 - branches/release-0.94/bin
Message-ID: <20130302213049.308959CD06@svn.ci.uchicago.edu>
Author: davidk
Date: 2013-03-02 15:30:48 -0600 (Sat, 02 Mar 2013)
New Revision: 6323
Modified:
branches/release-0.94/bin/gensites
Log:
Fix the order in which gensites searches for templates: full pathname, $HOME/.swift, then etc/sites
Modified: branches/release-0.94/bin/gensites
===================================================================
--- branches/release-0.94/bin/gensites 2013-03-01 12:48:13 UTC (rev 6322)
+++ branches/release-0.94/bin/gensites 2013-03-02 21:30:48 UTC (rev 6323)
@@ -123,10 +123,10 @@
if [ ! -f "$TEMPLATE_PATH" ]; then
if [ -f "$TEMPLATE" ]; then
TEMPLATE_PATH=$TEMPLATE
+ elif [ -f "$HOME/.swift/sites/$TEMPLATE" ]; then
+ TEMPLATE_PATH=$HOME/.swift/sites/$TEMPLATE
elif [ -f "$SWIFT_HOME/$TEMPLATE" ]; then
TEMPLATE_PATH=$SWIFT_HOME/$TEMPLATE
- elif [ -f "$HOME/.swift/sites/$TEMPLATE" ]; then
- TEMPLATE_PATH=$HOME/.swift/sites/$TEMPLATE
fi
if [ ! -f "$TEMPLATE_PATH" ]; then
crash "Cannot find template for $TEMPLATE"
From davidk at ci.uchicago.edu Sat Mar 2 15:31:23 2013
From: davidk at ci.uchicago.edu (davidk at ci.uchicago.edu)
Date: Sat, 2 Mar 2013 15:31:23 -0600 (CST)
Subject: [Swift-commit] r6324 - trunk/bin
Message-ID: <20130302213123.A1A5F9CD06@svn.ci.uchicago.edu>
Author: davidk
Date: 2013-03-02 15:31:23 -0600 (Sat, 02 Mar 2013)
New Revision: 6324
Modified:
trunk/bin/gensites
Log:
Update to gensites search paths
Modified: trunk/bin/gensites
===================================================================
--- trunk/bin/gensites 2013-03-02 21:30:48 UTC (rev 6323)
+++ trunk/bin/gensites 2013-03-02 21:31:23 UTC (rev 6324)
@@ -123,10 +123,10 @@
if [ ! -f "$TEMPLATE_PATH" ]; then
if [ -f "$TEMPLATE" ]; then
TEMPLATE_PATH=$TEMPLATE
+ elif [ -f "$HOME/.swift/sites/$TEMPLATE" ]; then
+ TEMPLATE_PATH=$HOME/.swift/sites/$TEMPLATE
elif [ -f "$SWIFT_HOME/$TEMPLATE" ]; then
TEMPLATE_PATH=$SWIFT_HOME/$TEMPLATE
- elif [ -f "$HOME/.swift/sites/$TEMPLATE" ]; then
- TEMPLATE_PATH=$HOME/.swift/sites/$TEMPLATE
fi
if [ ! -f "$TEMPLATE_PATH" ]; then
crash "Cannot find template for $TEMPLATE"
From davidk at ci.uchicago.edu Sat Mar 2 18:21:48 2013
From: davidk at ci.uchicago.edu (davidk at ci.uchicago.edu)
Date: Sat, 2 Mar 2013 18:21:48 -0600 (CST)
Subject: [Swift-commit] r6325 - branches/release-0.94/bin
Message-ID: <20130303002148.E4E7B9D5A3@svn.ci.uchicago.edu>
Author: davidk
Date: 2013-03-02 18:21:48 -0600 (Sat, 02 Mar 2013)
New Revision: 6325
Modified:
branches/release-0.94/bin/stop-coaster-service
Log:
Fix for stopping coaster jobs locally
Modified: branches/release-0.94/bin/stop-coaster-service
===================================================================
--- branches/release-0.94/bin/stop-coaster-service 2013-03-02 21:31:23 UTC (rev 6324)
+++ branches/release-0.94/bin/stop-coaster-service 2013-03-03 00:21:48 UTC (rev 6325)
@@ -86,7 +86,7 @@
if [ -n "$WORKER_RELAY_HOST" ]; then
ssh $WORKER_USERNAME@$WORKER_RELAY_HOST "condor_rm $WORKER_USERNAME"
else
- condor_rm $CONDOR_USERNAME
+ condor_rm $WORKER_USERNAME
fi
fi
From hategan at ci.uchicago.edu Sun Mar 3 01:06:00 2013
From: hategan at ci.uchicago.edu (hategan at ci.uchicago.edu)
Date: Sun, 3 Mar 2013 01:06:00 -0600 (CST)
Subject: [Swift-commit] r6326 - in branches/release-0.94: resources
src/org/griphyn/vdl/engine src/org/griphyn/vdl/karajan/lib
Message-ID: <20130303070600.A07319CCA1@svn.ci.uchicago.edu>
Author: hategan
Date: 2013-03-03 01:06:00 -0600 (Sun, 03 Mar 2013)
New Revision: 6326
Added:
branches/release-0.94/src/org/griphyn/vdl/karajan/lib/RefCount.java
branches/release-0.94/src/org/griphyn/vdl/karajan/lib/StaticRefCount.java
Modified:
branches/release-0.94/resources/Karajan.stg
branches/release-0.94/src/org/griphyn/vdl/engine/Karajan.java
branches/release-0.94/src/org/griphyn/vdl/karajan/lib/InfiniteCountingWhile.java
branches/release-0.94/src/org/griphyn/vdl/karajan/lib/ThrottledParallelFor.java
Log:
fixed array writing in iterate bug reported by Yadu (see http://lists.ci.uchicago.edu/pipermail/swift-devel/2013-March/010100.html)
Modified: branches/release-0.94/resources/Karajan.stg
===================================================================
--- branches/release-0.94/resources/Karajan.stg 2013-03-03 00:21:48 UTC (rev 6325)
+++ branches/release-0.94/resources/Karajan.stg 2013-03-03 07:06:00 UTC (rev 6326)
@@ -219,9 +219,8 @@
>>
-iterate(declarations,statements,cond,var,cleanups,trace,line) ::= <<
-
-
+iterate(declarations, statements, cond, var, refs, cleanups, trace, line) ::= <<
+
$sub_comp(declarations=declarations, statements=statements, cleanups=cleanups)$
$cond$
Modified: branches/release-0.94/src/org/griphyn/vdl/engine/Karajan.java
===================================================================
--- branches/release-0.94/src/org/griphyn/vdl/engine/Karajan.java 2013-03-03 00:21:48 UTC (rev 6325)
+++ branches/release-0.94/src/org/griphyn/vdl/engine/Karajan.java 2013-03-03 07:06:00 UTC (rev 6326)
@@ -908,7 +908,7 @@
}
public void iterateStat(Iterate iterate, VariableScope scope) throws CompilationException {
- VariableScope loopScope = new VariableScope(this, scope, EnclosureType.LOOP, iterate);
+ VariableScope loopScope = new VariableScope(this, scope, EnclosureType.ALL, iterate);
VariableScope innerScope = new VariableScope(this, loopScope, EnclosureType.LOOP, iterate);
loopScope.addVariable(iterate.getVar(), "int", "Iteration variable", iterate);
@@ -1531,8 +1531,6 @@
throw new CompilationException("Procedure " + name + " must have exactly one " +
"return value to be used in an expression.");
}
-
- Warnings.warn(c, "Procedure " + name + " is deprecated");
StringTemplate call = template("callexpr");
Modified: branches/release-0.94/src/org/griphyn/vdl/karajan/lib/InfiniteCountingWhile.java
===================================================================
--- branches/release-0.94/src/org/griphyn/vdl/karajan/lib/InfiniteCountingWhile.java 2013-03-03 00:21:48 UTC (rev 6325)
+++ branches/release-0.94/src/org/griphyn/vdl/karajan/lib/InfiniteCountingWhile.java 2013-03-03 07:06:00 UTC (rev 6326)
@@ -34,8 +34,10 @@
public static final String COUNTER_NAME = "$";
public static final Arg.Positional VAR = new Arg.Positional("var");
+ public static final Arg O_REFS = new Arg.Optional("refs", null);
private Tracer tracer;
+ private List srefs;
public InfiniteCountingWhile() {
setOptimize(false);
@@ -45,18 +47,21 @@
protected void initializeStatic() {
super.initializeStatic();
tracer = Tracer.getTracer(this);
+ srefs = StaticRefCount.build((String) O_REFS.getStatic(this));
}
public void pre(VariableStack stack) throws ExecutionException {
ThreadingContext tc = (ThreadingContext)stack.getVar("#thread");
stack.setVar("#iteratethread", tc);
stack.setVar("#thread", tc.split(0));
+ stack.setVar("#refs", RefCount.build(srefs, stack));
stack.setVar(COUNTER_NAME, Collections.singletonList(0));
String var = (String) VAR.getStatic(this);
if (tracer.isEnabled()) {
tracer.trace(tc.toString(), var + " = 0");
}
stack.setVar(var, new RootDataNode(Types.INT, 0));
+ incRefs(stack);
super.pre(stack);
}
@@ -89,6 +94,7 @@
tracer.trace(ntc.toString(), var + " = " + i);
}
stack.setVar(var, new RootDataNode(Types.INT, i));
+ incRefs(stack);
}
if (index >= elementCount()) {
// starting new iteration
@@ -102,6 +108,16 @@
startElement(fn, stack);
}
+ private void incRefs(VariableStack stack) {
+ @SuppressWarnings("unchecked")
+ List rcs = (List) stack.currentFrame().getVar("#refs");
+ if (rcs != null) {
+ for (RefCount rc : rcs) {
+ rc.var.updateWriteRefCount(rc.count);
+ }
+ }
+ }
+
public void failed(VariableStack stack, ExecutionException e)
throws ExecutionException {
if (e instanceof While.Break) {
Added: branches/release-0.94/src/org/griphyn/vdl/karajan/lib/RefCount.java
===================================================================
--- branches/release-0.94/src/org/griphyn/vdl/karajan/lib/RefCount.java (rev 0)
+++ branches/release-0.94/src/org/griphyn/vdl/karajan/lib/RefCount.java 2013-03-03 07:06:00 UTC (rev 6326)
@@ -0,0 +1,38 @@
+//----------------------------------------------------------------------
+//This code is developed as part of the Java CoG Kit project
+//The terms of the license can be found at http://www.cogkit.org/license
+//This message may not be removed or altered.
+//----------------------------------------------------------------------
+
+/*
+ * Created on Mar 2, 2013
+ */
+package org.griphyn.vdl.karajan.lib;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.globus.cog.karajan.stack.VariableNotFoundException;
+import org.globus.cog.karajan.stack.VariableStack;
+import org.griphyn.vdl.mapping.DSHandle;
+
+public class RefCount {
+ public final DSHandle var;
+ public final int count;
+
+ public RefCount(DSHandle var, int count) {
+ this.var = var;
+ this.count = count;
+ }
+
+ public static List build(List srefs, VariableStack stack) throws VariableNotFoundException {
+ if (srefs == null) {
+ return null;
+ }
+ List l = new ArrayList(srefs.size());
+ for (StaticRefCount s : srefs) {
+ l.add(new RefCount((DSHandle) stack.getVar(s.name), s.count));
+ }
+ return l;
+ }
+}
\ No newline at end of file
Added: branches/release-0.94/src/org/griphyn/vdl/karajan/lib/StaticRefCount.java
===================================================================
--- branches/release-0.94/src/org/griphyn/vdl/karajan/lib/StaticRefCount.java (rev 0)
+++ branches/release-0.94/src/org/griphyn/vdl/karajan/lib/StaticRefCount.java 2013-03-03 07:06:00 UTC (rev 6326)
@@ -0,0 +1,45 @@
+//----------------------------------------------------------------------
+//This code is developed as part of the Java CoG Kit project
+//The terms of the license can be found at http://www.cogkit.org/license
+//This message may not be removed or altered.
+//----------------------------------------------------------------------
+
+/*
+ * Created on Mar 2, 2013
+ */
+package org.griphyn.vdl.karajan.lib;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.StringTokenizer;
+
+public class StaticRefCount {
+ public final String name;
+ public final int count;
+
+ public StaticRefCount(String name, int count) {
+ this.name = name;
+ this.count = count;
+ }
+
+ public static List build(String refs) {
+ if (refs == null) {
+ return null;
+ }
+ List l = new ArrayList();
+ String name = null;
+ boolean flip = true;
+ StringTokenizer st = new StringTokenizer(refs);
+ while (st.hasMoreTokens()) {
+ if (flip) {
+ name = st.nextToken();
+ }
+ else {
+ int count = Integer.parseInt(st.nextToken());
+ l.add(new StaticRefCount(name.toLowerCase(), count));
+ }
+ flip = !flip;
+ }
+ return l;
+ }
+}
\ No newline at end of file
Modified: branches/release-0.94/src/org/griphyn/vdl/karajan/lib/ThrottledParallelFor.java
===================================================================
--- branches/release-0.94/src/org/griphyn/vdl/karajan/lib/ThrottledParallelFor.java 2013-03-03 00:21:48 UTC (rev 6325)
+++ branches/release-0.94/src/org/griphyn/vdl/karajan/lib/ThrottledParallelFor.java 2013-03-03 07:06:00 UTC (rev 6326)
@@ -21,7 +21,6 @@
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
-import java.util.StringTokenizer;
import org.apache.log4j.Logger;
import org.globus.cog.karajan.arguments.Arg;
@@ -40,7 +39,6 @@
import org.globus.cog.karajan.workflow.futures.ListenerStackPair;
import org.globus.cog.karajan.workflow.nodes.AbstractParallelIterator;
import org.griphyn.vdl.karajan.Pair;
-import org.griphyn.vdl.mapping.DSHandle;
import org.griphyn.vdl.util.VDL2Config;
public class ThrottledParallelFor extends AbstractParallelIterator {
@@ -64,77 +62,16 @@
private String kvar, vvar;
private List srefs;
- private static class StaticRefCount {
- public final String name;
- public final int count;
-
- public StaticRefCount(String name, int count) {
- this.name = name;
- this.count = count;
- }
- }
-
- private static class RefCount {
- public final DSHandle var;
- public final int count;
-
- public RefCount(DSHandle var, int count) {
- this.var = var;
- this.count = count;
- }
-
- public void inc() {
-
- }
-
- public void dec() {
-
- }
- }
-
- @Override
+ @Override
protected void initializeStatic() {
super.initializeStatic();
forTracer = Tracer.getTracer(this, "FOREACH");
iterationTracer = Tracer.getTracer(this, "ITERATION");
kvar = (String) getProperty("_kvar");
vvar = (String) getProperty("_vvar");
- srefs = buildStaticRefs();
+ srefs = StaticRefCount.build((String) O_REFS.getStatic(this));
}
- private List buildStaticRefs() {
- String refs = (String) O_REFS.getStatic(this);
- if (refs == null) {
- return null;
- }
- List l = new ArrayList();
- String name = null;
- boolean flip = true;
- StringTokenizer st = new StringTokenizer(refs);
- while (st.hasMoreTokens()) {
- if (flip) {
- name = st.nextToken();
- }
- else {
- int count = Integer.parseInt(st.nextToken());
- l.add(new StaticRefCount(name.toLowerCase(), count));
- }
- flip = !flip;
- }
- return l;
- }
-
- private List buildRefs(VariableStack stack) throws VariableNotFoundException {
- if (srefs == null) {
- return null;
- }
- List l = new ArrayList(srefs.size());
- for (StaticRefCount s : srefs) {
- l.add(new RefCount((DSHandle) stack.getVar(s.name), s.count));
- }
- return l;
- }
-
protected void partialArgumentsEvaluated(VariableStack stack)
throws ExecutionException {
if (forTracer.isEnabled()) {
@@ -313,7 +250,7 @@
maxThreadCount = DEFAULT_MAX_THREADS;
}
}
- stack.setVar(THREAD_COUNT, new ThreadCount(maxThreadCount, selfClose, i, buildRefs(stack)));
+ stack.setVar(THREAD_COUNT, new ThreadCount(maxThreadCount, selfClose, i, RefCount.build(srefs, stack)));
}
private ThreadCount getThreadCount(VariableStack stack)
From hategan at ci.uchicago.edu Sun Mar 3 14:26:14 2013
From: hategan at ci.uchicago.edu (hategan at ci.uchicago.edu)
Date: Sun, 3 Mar 2013 14:26:14 -0600 (CST)
Subject: [Swift-commit] r6327 -
branches/release-0.94/src/org/griphyn/vdl/engine
Message-ID: <20130303202614.CC5D19D015@svn.ci.uchicago.edu>
Author: hategan
Date: 2013-03-03 14:26:13 -0600 (Sun, 03 Mar 2013)
New Revision: 6327
Modified:
branches/release-0.94/src/org/griphyn/vdl/engine/Karajan.java
Log:
some change I had locally which I assume is in line with pre-second-copy 0.94
Modified: branches/release-0.94/src/org/griphyn/vdl/engine/Karajan.java
===================================================================
--- branches/release-0.94/src/org/griphyn/vdl/engine/Karajan.java 2013-03-03 07:06:00 UTC (rev 6326)
+++ branches/release-0.94/src/org/griphyn/vdl/engine/Karajan.java 2013-03-03 20:26:13 UTC (rev 6327)
@@ -694,7 +694,7 @@
ProcedureSignature proc = proceduresMap.get(procName);
if (proc.isDeprecated()) {
- /* warn(call, "Procedure " + procName + " is deprecated"); */
+ Warnings.warn(call, "Procedure " + procName + " is deprecated");
}
StringTemplate callST;
From swift at ci.uchicago.edu Sun Mar 3 15:25:05 2013
From: swift at ci.uchicago.edu (swift at ci.uchicago.edu)
Date: Sun, 3 Mar 2013 15:25:05 -0600 (CST)
Subject: [Swift-commit] cog r3616
Message-ID: <20130303212505.764518D000A2@bridled.ci.uchicago.edu>
------------------------------------------------------------------------
r3616 | hategan | 2013-03-03 15:24:15 -0600 (Sun, 03 Mar 2013) | 1 line
use a sorted map to sort blocks by their time left since a comparator cannot guaranteed to be correct because calls to block.sizeLeft() are dependent on the time when the call is made
------------------------------------------------------------------------
Index: modules/provider-coaster/src/org/globus/cog/abstraction/coaster/service/job/manager/BlockQueueProcessor.java
===================================================================
--- modules/provider-coaster/src/org/globus/cog/abstraction/coaster/service/job/manager/BlockQueueProcessor.java (revision 3615)
+++ modules/provider-coaster/src/org/globus/cog/abstraction/coaster/service/job/manager/BlockQueueProcessor.java (working copy)
@@ -6,14 +6,13 @@
import java.text.NumberFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.SortedMap;
import java.util.TreeMap;
import org.apache.log4j.Logger;
@@ -429,31 +428,18 @@
*
*/
protected void removeIdleBlocks() {
- ArrayList sorted;
-
+ SortedMap sorted = new TreeMap();
+
synchronized (blocks) {
- sorted = new ArrayList(blocks.values());
- Collections.sort(sorted, new Comparator() {
- public int compare(Block b1, Block b2) {
- double s1 = b1.sizeLeft();
- double s2 = b2.sizeLeft();
- if (s1 == s2) {
- return 0;
- }
- else if (s1 < s2) {
- return -1;
- }
- else {
- return 1;
- }
- }
- });
+ for (Block b : blocks.values()) {
+ sorted.put(b.sizeLeft(), b);
+ }
}
double needed = queued.getJSize() + running.getSize();
double sum = 0;
- for (Block b : sorted) {
+ for (Block b : sorted.values()) {
if (sum >= needed
&& !b.isSuspended()
&& (System.currentTimeMillis() - b.getLastUsed()) > Block.SUSPEND_SHUTDOWN_DELAY) {
From ketan at ci.uchicago.edu Sun Mar 3 23:53:21 2013
From: ketan at ci.uchicago.edu (ketan at ci.uchicago.edu)
Date: Sun, 3 Mar 2013 23:53:21 -0600 (CST)
Subject: [Swift-commit] r6328 - trunk/docs/userguide
Message-ID: <20130304055321.90FC39CCA1@svn.ci.uchicago.edu>
Author: ketan
Date: 2013-03-03 23:53:21 -0600 (Sun, 03 Mar 2013)
New Revision: 6328
Modified:
trunk/docs/userguide/coasters
Log:
adding subsections to coasters
Modified: trunk/docs/userguide/coasters
===================================================================
--- trunk/docs/userguide/coasters 2013-03-03 20:26:13 UTC (rev 6327)
+++ trunk/docs/userguide/coasters 2013-03-04 05:53:21 UTC (rev 6328)
@@ -90,3 +90,13 @@
|remoteMonitorEnabled|If true, show a graphical display of the status of
the coaster service
|==================
+
+Submitting to a specific job queue
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+In order to submit to a specific job schedular queue, the +queue+ parameter of coasters sites file should be used. For example, submitting to the +normal+ queue of a PBS schedular, one would use the following sites line:
+
+----
+normal
+----
+
From ketan at ci.uchicago.edu Mon Mar 4 21:25:51 2013
From: ketan at ci.uchicago.edu (ketan at ci.uchicago.edu)
Date: Mon, 4 Mar 2013 21:25:51 -0600 (CST)
Subject: [Swift-commit] r6329 - trunk/docs/userguide
Message-ID: <20130305032551.E70519CD1D@svn.ci.uchicago.edu>
Author: ketan
Date: 2013-03-04 21:25:51 -0600 (Mon, 04 Mar 2013)
New Revision: 6329
Added:
trunk/docs/userguide/swift_monitor.png
Modified:
trunk/docs/userguide/configuration_properties
Log:
formatting, tui and monitor
Modified: trunk/docs/userguide/configuration_properties
===================================================================
--- trunk/docs/userguide/configuration_properties 2013-03-04 05:53:21 UTC (rev 6328)
+++ trunk/docs/userguide/configuration_properties 2013-03-05 03:25:51 UTC (rev 6329)
@@ -1,17 +1,16 @@
Swift configuration properties
------------------------------
-Various aspects of the behavior of the Swift Engine can be configured
-through properties. The Swift Engine recognizes a global, per
-installation properties file which can found in etc/swift.properties
-in the Swift installation directory and a user properties file which can
-be created by each user in ~/.swift/swift.properties. The Swift Engine
-will first load the global properties file. It will then try to load the
-user properties file. If a user properties file is found, individual
-properties explicitly set in that file will override the respective
-properties in the global properties file. Furthermore, some of the
-properties can be overridden directly using command line arguments to
-the *swift* command.
+Various aspects of the behavior of Swift can be configured through properties.
+Swift recognizes a global, per installation properties file which can found in
+etc/swift.properties in the Swift installation directory and a user properties
+file which can be created by each user in ~/.swift/swift.properties.
+Swift will first load the global properties file. It will then try to load the
+user properties file. If a user properties file is found, individual properties
+explicitly set in that file will override the respective properties in the
+global properties file. Furthermore, some of the properties can be overridden
+directly using command line arguments to the *swift* command.
+
Swift properties are specified in the following format:
=
@@ -452,3 +451,43 @@
ip.address=192.168.0.1
----
+Monitoring Swift
+~~~~~~~~~~~~~~~~
+
+A Swift run can be monitored for progress and resource usage. To monitor the resource usage, use the +-monitor+ option with the Swift commandline. For example:
+
+----
+swift -tc.file tc -sites.file sites.xml -config cf modis04.swift -monitor
+----
+
+This will produce a gui/X window consisting of the following quantities:
+
+* Allocated memory
+* Heap Size
+* Total Threads
+* Total Workers
+
+.Figure 4. Resource Monitor
+image:swift_monitor.png[]
+
+Figure 4 shows a snapshot of a Swift resource monitor.
+
+
+The progress of a Swift run can be monitored using the +-tui+ option. For example:
+
+----
+swift -tc.file tc -sites.file sites.xml -config cf modis04.swift -tui
+----
+
+This will produce a textual user interface with multiple tabs, each showing the following features of the current Swift run:
+
+* A summary view showing task status
+* An apps tab
+* A jobs tab
+* A transfer tab
+* A scheduler tab
+* A Tast statistics tab
+* A customized tab called 'Ben's View'
+
+Navigation between these tabs can be done using the function keys f2 through f8.
+
Added: trunk/docs/userguide/swift_monitor.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/userguide/swift_monitor.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
From davidk at ci.uchicago.edu Tue Mar 5 10:29:26 2013
From: davidk at ci.uchicago.edu (davidk at ci.uchicago.edu)
Date: Tue, 5 Mar 2013 10:29:26 -0600 (CST)
Subject: [Swift-commit] r6330 - SwiftTutorials/IO
Message-ID: <20130305162926.73D5B9CC97@svn.ci.uchicago.edu>
Author: davidk
Date: 2013-03-05 10:29:26 -0600 (Tue, 05 Mar 2013)
New Revision: 6330
Added:
SwiftTutorials/IO/TODO
Log:
TODO
Added: SwiftTutorials/IO/TODO
===================================================================
--- SwiftTutorials/IO/TODO (rev 0)
+++ SwiftTutorials/IO/TODO 2013-03-05 16:29:26 UTC (rev 6330)
@@ -0,0 +1,32 @@
+lets desribe all the sources of file management and IO overhead that we know of, and how to eliminate them.
+1. strings to prevent staging
+2. use of scratch to reduce the effect of small-block IO (iff it applies: it might not apply here if the files are tiny)
+3. workdir overhead pushed to local node filesystem
+4. reduce/elim overhead of swift files like info and the .d dir
+
+You can do the same analysis/tests for CDM
+The trick there is ensuring that a) CDM files match as expected and (b) that CDM itself doesnt add unacceptable overhead
+ANd we have never stress tested the CDM file caching option that we always turn of in the cf file
+
+First one, just do a simplified test version of what you did for dssat on stampede?
+ie a version of that that strips out the "noise" and lists the things that made the improvement
+I think those things are the things I mentioned above
+SO, lets say for the app, you use a shell script that does 3 dd statements: the stagein dd, the "app" dd (using a small block size like 8KB) and the stageout dd ?
+one file in, ine file out, for starters.
+Later we can parameterize these tests and demonstrate the overhead of different aspects changing (ie add more in and/or out files) ?
+
+So this User Guide setion needs to start out very simple, but cover all the cases in a well-structured manner that makes it no more complex than is necessary.
+So I would structure this as a set of directories, where each dir has one test case/example and a README saying what it shows and how its used.
+You can just number the dirs, or give them longish names like "local_scratch+full_pathnames/"
+Each should have a cf and a sites.xml
+and save its workdirectory below it,
+and run an app that returns a detailed ls/find dummary of its cwd and arg list.
+because the added complexity is not just how the jobdir gets set, but also what gets passed to the app on its command line
+So, now, I *think* we have laidout out here all the issues:
+ - where is jobdir
+ - what is copied where
+ - what is linked where
+ - what is passed to command
+ - what is copied out after command
+ - what is cleaned up (under what options)
+
From davidk at ci.uchicago.edu Tue Mar 5 21:03:15 2013
From: davidk at ci.uchicago.edu (davidk at ci.uchicago.edu)
Date: Tue, 5 Mar 2013 21:03:15 -0600 (CST)
Subject: [Swift-commit] r6331 - trunk/libexec
Message-ID: <20130306030315.C894A9CCA1@svn.ci.uchicago.edu>
Author: davidk
Date: 2013-03-05 21:03:15 -0600 (Tue, 05 Mar 2013)
New Revision: 6331
Modified:
trunk/libexec/_swiftwrap.wrapperstaging
Log:
A few fixes for local copying
Modified: trunk/libexec/_swiftwrap.wrapperstaging
===================================================================
--- trunk/libexec/_swiftwrap.wrapperstaging 2013-03-05 16:29:26 UTC (rev 6330)
+++ trunk/libexec/_swiftwrap.wrapperstaging 2013-03-06 03:03:15 UTC (rev 6331)
@@ -58,6 +58,8 @@
localPath() {
# remove protocol://
PATH="${1#*://}"
+ # Remove hostname
+ PATH="${PATH#*/}"
# remove leading "/" if present
PATH="${PATH#/}"
log "Transformed $1 to $PATH"
@@ -67,7 +69,7 @@
stagein() {
SRC=$1
DST=$2
-
+
case $SRC in
*://*)
;;
@@ -85,7 +87,7 @@
if [ ! -f $SRC ]; then
fail 254 "Cannot stage in $SRC. File not found."
fi
- cp $SRC $DST 2>&1 >& "$INFO"
+ dd if=$SRC of=$DST bs=16M 2>&1 >& "$INFO"
;;
http://*)
log "Fetching $SRC using wget"
@@ -453,8 +455,10 @@
eval cdm_action $DIR "INPUT" $L $CDM_POLICY
continue
fi
-
- stagein $L "$DIR/`localPath $L`"
+
+ SRC=$( localPath $L )
+ DST=$DIR/$( localPath $L )
+ stagein $SRC $DST
done
if [[ $CDM_FILE != "" ]]; then
From ketan at ci.uchicago.edu Tue Mar 5 22:25:34 2013
From: ketan at ci.uchicago.edu (ketan at ci.uchicago.edu)
Date: Tue, 5 Mar 2013 22:25:34 -0600 (CST)
Subject: [Swift-commit] r6332 - trunk/docs/userguide
Message-ID: <20130306042534.E3F9E9CCA1@svn.ci.uchicago.edu>
Author: ketan
Date: 2013-03-05 22:25:34 -0600 (Tue, 05 Mar 2013)
New Revision: 6332
Modified:
trunk/docs/userguide/site_catalog
Log:
scratch tag
Modified: trunk/docs/userguide/site_catalog
===================================================================
--- trunk/docs/userguide/site_catalog 2013-03-06 03:03:15 UTC (rev 6331)
+++ trunk/docs/userguide/site_catalog 2013-03-06 04:25:34 UTC (rev 6332)
@@ -11,7 +11,6 @@
The sites file is formatted as XML. It consists of elements,
one for each site that Swift will use.
-
Pool element
~~~~~~~~~~~~
Each pool element must have a handle attribute, giving a symbolic
@@ -25,7 +24,6 @@
a remote working directory. Optionally, profile settings can
be specified.
-
File transfer method
~~~~~~~~~~~~~~~~~~~~
Transfer methods are specified with either the element or
@@ -158,6 +156,20 @@
be used for execution. A shared cluster scratch filesystem is
appropriate for this.
+Scratch
+~~~~~~~
+
+The scratch element takes in a value of a directory on a shared filesystem. For example:
+
+----
+/work/01739/ketan/lab/swift/myscratch
+----
+
+The scratch element specifies that the underlying Swift wrapper will copy the
+input files into the scratch directory and the job will be run from that
+directory. In the absence of scratch tag, Swift will run the job from
+workdirectory by creating symlinks to input files in a shared directory.
+
Profiles
~~~~~~~~
Profile keys can be specified using the element.
From hategan at ci.uchicago.edu Wed Mar 6 01:22:48 2013
From: hategan at ci.uchicago.edu (hategan at ci.uchicago.edu)
Date: Wed, 6 Mar 2013 01:22:48 -0600 (CST)
Subject: [Swift-commit] r6333 -
branches/faster/src/org/griphyn/vdl/karajan/lib
Message-ID: <20130306072248.20B979CCA1@svn.ci.uchicago.edu>
Author: hategan
Date: 2013-03-06 01:22:47 -0600 (Wed, 06 Mar 2013)
New Revision: 6333
Modified:
branches/faster/src/org/griphyn/vdl/karajan/lib/RuntimeStats.java
Log:
faster runtime stats
Modified: branches/faster/src/org/griphyn/vdl/karajan/lib/RuntimeStats.java
===================================================================
--- branches/faster/src/org/griphyn/vdl/karajan/lib/RuntimeStats.java 2013-03-06 04:25:34 UTC (rev 6332)
+++ branches/faster/src/org/griphyn/vdl/karajan/lib/RuntimeStats.java 2013-03-06 07:22:47 UTC (rev 6333)
@@ -159,6 +159,33 @@
}
}
+ private static class MutableInt {
+ private int value;
+
+ public MutableInt() {
+ value = 0;
+ }
+
+ public MutableInt(int value) {
+ this.value = value;
+ }
+
+ public int getValue() {
+ return value;
+ }
+
+ public void setValue(int value) {
+ this.value = value;
+ }
+
+ public void inc() {
+ value++;
+ }
+
+ public String toString() {
+ return String.valueOf(value);
+ }
+ }
public static class StopProgressTicker extends Node {
private VarRef context;
@@ -265,13 +292,13 @@
printStates("Final status:");
}
- private Map getSummary() {
+ private Map getSummary() {
List states;
synchronized(this.states) {
states = new ArrayList(this.states);
}
- Map m = new HashMap();
+ Map m = new HashMap();
for (ProgressState s : states) {
inc(m, s);
@@ -279,20 +306,19 @@
return m;
}
- private void inc(Map m, ProgressState s) {
+ private void inc(Map m, ProgressState s) {
String v = s.crt;
- Integer i = m.get(v);
+ MutableInt i = m.get(v);
if (i == null) {
- i = 1;
+ i = new MutableInt();
+ m.put(v, i);
}
- else {
- i = i + 1;
- }
- m.put(v, i);
+
+ i.inc();
}
synchronized void printStates(String prefix) {
- Map summary = getSummary();
+ Map summary = getSummary();
StringBuilder sb = new StringBuilder();
@@ -305,7 +331,7 @@
for (int pos = 0; pos < preferredOutputOrder.length; pos++) {
String key = preferredOutputOrder[pos];
- Integer value = summary.get(key);
+ MutableInt value = summary.get(key);
if(value != null) {
sb.append(" ");
sb.append(key);
@@ -315,7 +341,7 @@
summary.remove(key);
}
- for (Map.Entry s : summary.entrySet()) {
+ for (Map.Entry s : summary.entrySet()) {
sb.append(" ");
sb.append(s.getKey());
sb.append(":");
From hategan at ci.uchicago.edu Wed Mar 6 01:23:15 2013
From: hategan at ci.uchicago.edu (hategan at ci.uchicago.edu)
Date: Wed, 6 Mar 2013 01:23:15 -0600 (CST)
Subject: [Swift-commit] r6334 -
branches/faster/src/org/griphyn/vdl/karajan/lib
Message-ID: <20130306072315.A011F9D670@svn.ci.uchicago.edu>
Author: hategan
Date: 2013-03-06 01:23:14 -0600 (Wed, 06 Mar 2013)
New Revision: 6334
Modified:
branches/faster/src/org/griphyn/vdl/karajan/lib/ExpandArguments.java
Log:
avoid creating arrays when not necessary
Modified: branches/faster/src/org/griphyn/vdl/karajan/lib/ExpandArguments.java
===================================================================
--- branches/faster/src/org/griphyn/vdl/karajan/lib/ExpandArguments.java 2013-03-06 07:22:47 UTC (rev 6333)
+++ branches/faster/src/org/griphyn/vdl/karajan/lib/ExpandArguments.java 2013-03-06 07:23:14 UTC (rev 6334)
@@ -24,6 +24,7 @@
import java.util.TreeMap;
import k.rt.Channel;
+import k.rt.ExecutionException;
import k.rt.Stack;
import org.apache.log4j.Logger;
@@ -44,40 +45,60 @@
}
public Object function(Stack stack) {
- ArrayList l = new ArrayList();
- Channel items = c_vargs.get(stack);
- for (Object item : items) {
- if(!(item instanceof DSHandle)) {
- throw new RuntimeException("Cannot handle argument implemented by " + item.getClass());
- }
-
- if (item instanceof ArrayDataNode) {
- ArrayDataNode array = (ArrayDataNode) item;
- Map, DSHandle> m = array.getArrayValue();
- SortedMap, DSHandle> sorted = new TreeMap, DSHandle>(new PathElementComparator());
- sorted.putAll(m);
- l.addAll(m.values());
- }
- else {
- l.add((DSHandle) item);
- }
- // TODO this does not correctly handle structs or
- // externals - at the moment, probably neither of
- // those should be usable as a string. It also
- // does not handle nested arrays. However, none of
- // those should get here in normal operation due
- // to static type-checking
- }
- return l;
+ Channel items = c_vargs.get(stack);
+ // prefer lower memory usage over speed here
+ // although the penalty is only there if there are arrays in the arguments
+ if (hasArrays(items)) {
+ return expandArrays(items);
+ }
+ else {
+ return items.getAll();
+ }
}
- class StringsAsIntegersComparator implements Comparator {
+ private Object expandArrays(Channel items) {
+ ArrayList l = new ArrayList();
+ for (Object item : items) {
+ if (item instanceof ArrayDataNode) {
+ ArrayDataNode array = (ArrayDataNode) item;
+ Map, DSHandle> m = array.getArrayValue();
+ SortedMap, DSHandle> sorted = new TreeMap, DSHandle>(new PathElementComparator());
+ sorted.putAll(m);
+ l.addAll(m.values());
+ }
+ else {
+ l.add((DSHandle) item);
+ }
+ // TODO this does not correctly handle structs or
+ // externals - at the moment, probably neither of
+ // those should be usable as a string. It also
+ // does not handle nested arrays. However, none of
+ // those should get here in normal operation due
+ // to static type-checking
+ }
+ return l;
+ }
+
+ private boolean hasArrays(Channel items) {
+ boolean arraySeen = false;
+ for (Object item : items) {
+ if(!(item instanceof DSHandle)) {
+ throw new ExecutionException(this, "Cannot handle argument implemented by " + item.getClass());
+ }
+
+ if (item instanceof ArrayDataNode) {
+ arraySeen = true;
+ }
+ }
+ return arraySeen;
+ }
+
+ class StringsAsIntegersComparator implements Comparator {
public int compare(Object l, Object r) {
Integer lnum = new Integer((String)l);
Integer rnum = new Integer((String)r);
return lnum.compareTo(rnum);
}
}
-
}
From hategan at ci.uchicago.edu Wed Mar 6 01:24:14 2013
From: hategan at ci.uchicago.edu (hategan at ci.uchicago.edu)
Date: Wed, 6 Mar 2013 01:24:14 -0600 (CST)
Subject: [Swift-commit] r6335 - in branches/faster: libexec
src/org/griphyn/vdl/karajan/lib
Message-ID: <20130306072414.5065D9CCA1@svn.ci.uchicago.edu>
Author: hategan
Date: 2013-03-06 01:24:13 -0600 (Wed, 06 Mar 2013)
New Revision: 6335
Modified:
branches/faster/libexec/swift.k
branches/faster/src/org/griphyn/vdl/karajan/lib/Execute.java
Log:
when replication is disabled, don't use the mechanism used by replication to start jobs, but run directly
Modified: branches/faster/libexec/swift.k
===================================================================
--- branches/faster/libexec/swift.k 2013-03-06 07:23:14 UTC (rev 6334)
+++ branches/faster/libexec/swift.k 2013-03-06 07:24:13 UTC (rev 6335)
@@ -199,17 +199,37 @@
throttled {
setProgress(progress, "Selecting site")
restartOnError(number(swift:configProperty("execution.retries"))) {
- replicationChannel := channel:new()
- //trigger the first job
- discard(append(replicationChannel, true))
- replicationGroup := UID()
- parallelFor(i, replicationChannel) {
+ if (swift:configProperty("replication.enabled") == "true") {
+ replicationChannel := channel:new()
+ //trigger the first job
+ discard(append(replicationChannel, true))
+ replicationGroup := UID()
+ parallelFor(i, replicationChannel) {
+ try {
+ execute2(
+ progress,
+ tr, if(arguments != null, arguments = unwrapClosedList(arguments)),
+ stdin=stdin, stdout=stdout, stderr=stderr, attributes=attributes,
+ stagein, stageout, restartout, replicationGroup, replicationChannel
+ )
+ }
+ else catch(exception) {
+ if (matches(exception, "^Abort$")) {
+ // ignored
+ }
+ else {
+ throw(exception)
+ }
+ }
+ }
+ }
+ else {
try {
execute2(
progress,
tr, if(arguments != null, arguments = unwrapClosedList(arguments)),
stdin=stdin, stdout=stdout, stderr=stderr, attributes=attributes,
- stagein, stageout, restartout, replicationGroup, replicationChannel
+ stagein, stageout, restartout, null, null
)
}
else catch(exception) {
Modified: branches/faster/src/org/griphyn/vdl/karajan/lib/Execute.java
===================================================================
--- branches/faster/src/org/griphyn/vdl/karajan/lib/Execute.java 2013-03-06 07:23:14 UTC (rev 6334)
+++ branches/faster/src/org/griphyn/vdl/karajan/lib/Execute.java 2013-03-06 07:24:13 UTC (rev 6335)
@@ -42,6 +42,7 @@
import org.griphyn.vdl.karajan.lib.RuntimeStats.ProgressState;
import org.griphyn.vdl.karajan.lib.replication.CanceledReplicaException;
import org.griphyn.vdl.karajan.lib.replication.ReplicationManager;
+import org.griphyn.vdl.util.VDL2Config;
public class Execute extends GridExec {
public static final Logger logger = Logger.getLogger(Execute.class);
@@ -53,6 +54,8 @@
private VarRef context;
+ private boolean replicationEnabled;
+
@Override
protected Signature getSignature() {
Signature sig = super.getSignature();
@@ -67,12 +70,17 @@
protected void addLocals(Scope scope) {
super.addLocals(scope);
context = scope.getVarRef("#context");
+ VDL2Config config = (VDL2Config) context.getValue().getAttribute("SWIFT:CONFIG");
+ replicationEnabled = "true".equals(config.getProperty("replication.enabled"));
}
@Override
public void submitScheduled(Scheduler scheduler, Task task, Stack stack, Object constraints) {
try {
- registerReplica(stack, task);
+ setTaskIdentity(stack, task);
+ if (replicationEnabled) {
+ registerReplica(stack, task);
+ }
log(task, stack);
TaskStateFuture tsf = new SwiftTaskStateFuture(stack, task, false);
@@ -99,8 +107,6 @@
}
protected void registerReplica(Stack stack, Task task) throws CanceledReplicaException {
- setTaskIdentity(stack, task);
-
String rg = this.replicationGroup.getValue(stack);
if (rg != null) {
getReplicationManager(stack).register(rg, task);
@@ -122,7 +128,9 @@
ProgressState ps = progress.getValue(stack);
if (c == Status.SUBMITTED) {
ps.setState("Submitted");
- getReplicationManager(stack).submitted(task, e.getStatus().getTime());
+ if (replicationEnabled) {
+ getReplicationManager(stack).submitted(task, e.getStatus().getTime());
+ }
}
else if (c == Status.STAGE_IN) {
ps.setState("Stage in");
@@ -132,11 +140,15 @@
}
else if (c == Status.ACTIVE) {
ps.setState("Active");
- getReplicationManager(stack).active(task, e.getStatus().getTime());
- Execute.this.replicationChannel.getValue(stack).close();
+ if (replicationEnabled) {
+ getReplicationManager(stack).active(task, e.getStatus().getTime());
+ Execute.this.replicationChannel.getValue(stack).close();
+ }
}
else if (e.getStatus().isTerminal()) {
- getReplicationManager(stack).terminated(task);
+ if (replicationEnabled) {
+ getReplicationManager(stack).terminated(task);
+ }
}
else if (c == ReplicationManager.STATUS_NEEDS_REPLICATION) {
ps.setState("Replicating");
From davidk at ci.uchicago.edu Wed Mar 6 07:50:14 2013
From: davidk at ci.uchicago.edu (davidk at ci.uchicago.edu)
Date: Wed, 6 Mar 2013 07:50:14 -0600 (CST)
Subject: [Swift-commit] r6336 - trunk/libexec
Message-ID: <20130306135015.042789CCA1@svn.ci.uchicago.edu>
Author: davidk
Date: 2013-03-06 07:50:13 -0600 (Wed, 06 Mar 2013)
New Revision: 6336
Modified:
trunk/libexec/_swiftwrap.wrapperstaging
Log:
Use dd for stageouts
Modified: trunk/libexec/_swiftwrap.wrapperstaging
===================================================================
--- trunk/libexec/_swiftwrap.wrapperstaging 2013-03-06 07:24:13 UTC (rev 6335)
+++ trunk/libexec/_swiftwrap.wrapperstaging 2013-03-06 13:50:13 UTC (rev 6336)
@@ -69,7 +69,6 @@
stagein() {
SRC=$1
DST=$2
-
case $SRC in
*://*)
;;
@@ -82,7 +81,7 @@
case $SRC in
file://*)
- SRC=${SRC#file://}
+ SRC=${SRC#file://*/}
log "Copying $SRC to $DST"
if [ ! -f $SRC ]; then
fail 254 "Cannot stage in $SRC. File not found."
@@ -123,7 +122,7 @@
DIR=`dirname $DST`
mkdir -p $DIR
log "Copying $SRC to $DST"
- cp $SRC $DST 2>&1 >& "$INFO"
+ dd if=$SRC of=$DST bs=16M 2>&1 >& "$INFO"
;;
*://*)
fail 254 "Cannot handle protocol ${DST%%://*}"
@@ -427,6 +426,7 @@
log "CDM_FILE=$CDM_FILE"
log "ARGS=$@"
log "ARGC=$#"
+
[ -n $MPI_RANK ] && log "MPI_RANK=$MPI_RANK" && log "PMI_RANK=$PMI_RANK"
IFS="|"
@@ -456,9 +456,7 @@
continue
fi
- SRC=$( localPath $L )
- DST=$DIR/$( localPath $L )
- stagein $SRC $DST
+ stagein $L "$DIR/`localPath $L`"
done
if [[ $CDM_FILE != "" ]]; then
From davidk at ci.uchicago.edu Wed Mar 6 10:59:48 2013
From: davidk at ci.uchicago.edu (davidk at ci.uchicago.edu)
Date: Wed, 6 Mar 2013 10:59:48 -0600 (CST)
Subject: [Swift-commit] r6337 - in SwiftTutorials/IO: . staging-normal
Message-ID: <20130306165948.A63A39CD1A@svn.ci.uchicago.edu>
Author: davidk
Date: 2013-03-06 10:59:48 -0600 (Wed, 06 Mar 2013)
New Revision: 6337
Added:
SwiftTutorials/IO/staging-normal/
SwiftTutorials/IO/staging-normal/catsn-absolute.swift
SwiftTutorials/IO/staging-normal/catsn-random.swift
SwiftTutorials/IO/staging-normal/cf
SwiftTutorials/IO/staging-normal/gendata.pl
SwiftTutorials/IO/staging-normal/setup.sh
SwiftTutorials/IO/staging-normal/sites.xml
Log:
staging-normal scripts
Added: SwiftTutorials/IO/staging-normal/catsn-absolute.swift
===================================================================
--- SwiftTutorials/IO/staging-normal/catsn-absolute.swift (rev 0)
+++ SwiftTutorials/IO/staging-normal/catsn-absolute.swift 2013-03-06 16:59:48 UTC (rev 6337)
@@ -0,0 +1,12 @@
+type file;
+
+app (file o) cat (file i)
+{
+ cat @i stdout=@o;
+}
+
+file out[];
+foreach j in [1:@toInt(@arg("n","10"))] {
+ file data <"file:///home/davidk/test4/data/data.txt">;
+ out[j] = cat(data);
+}
Added: SwiftTutorials/IO/staging-normal/catsn-random.swift
===================================================================
--- SwiftTutorials/IO/staging-normal/catsn-random.swift (rev 0)
+++ SwiftTutorials/IO/staging-normal/catsn-random.swift 2013-03-06 16:59:48 UTC (rev 6337)
@@ -0,0 +1,13 @@
+type file;
+
+app (file o) cat (file i)
+{
+ cat @i stdout=@o;
+}
+
+file input_files[];
+
+foreach j in input_files {
+ file output;
+ output = cat(j);
+}
Added: SwiftTutorials/IO/staging-normal/cf
===================================================================
--- SwiftTutorials/IO/staging-normal/cf (rev 0)
+++ SwiftTutorials/IO/staging-normal/cf 2013-03-06 16:59:48 UTC (rev 6337)
@@ -0,0 +1,8 @@
+wrapperlog.always.transfer=true
+sitedir.keep=true
+execution.retries=0
+lazy.errors=true
+status.mode=provider
+use.provider.staging=false
+provider.staging.pin.swiftfiles=false
+use.wrapper.staging=false
Added: SwiftTutorials/IO/staging-normal/gendata.pl
===================================================================
--- SwiftTutorials/IO/staging-normal/gendata.pl (rev 0)
+++ SwiftTutorials/IO/staging-normal/gendata.pl 2013-03-06 16:59:48 UTC (rev 6337)
@@ -0,0 +1,22 @@
+#!/usr/bin/perl
+
+use strict;
+
+my @characters=('a'..'z', 'A'..'Z', '0'..'9');
+my $string="";
+my $length = $ARGV[0];
+my $width_count=0;
+
+foreach (1..$length)
+{
+ if($width_count == 80) {
+ $string .= "\n";
+ $width_count=0;
+ next;
+ }
+ $string .= $characters[rand @characters];
+ $width_count++;
+}
+
+print $string;
+
Property changes on: SwiftTutorials/IO/staging-normal/gendata.pl
___________________________________________________________________
Added: svn:executable
+ *
Added: SwiftTutorials/IO/staging-normal/setup.sh
===================================================================
--- SwiftTutorials/IO/staging-normal/setup.sh (rev 0)
+++ SwiftTutorials/IO/staging-normal/setup.sh 2013-03-06 16:59:48 UTC (rev 6337)
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+NUMFILES=500
+FILESIZE=10
+FILESIZE=$(($FILESIZE*1000000))
+
+if [ -n "$GROUP" ]; then
+ cp $RUNDIR/* .
+fi
+
+mkdir -p data
+for count in `seq 1 $NUMFILES`
+do
+ FILENAME=`mktemp -p data`
+ ./gendata.pl $FILESIZE > $FILENAME
+done
+
Property changes on: SwiftTutorials/IO/staging-normal/setup.sh
___________________________________________________________________
Added: svn:executable
+ *
Added: SwiftTutorials/IO/staging-normal/sites.xml
===================================================================
--- SwiftTutorials/IO/staging-normal/sites.xml (rev 0)
+++ SwiftTutorials/IO/staging-normal/sites.xml 2013-03-06 16:59:48 UTC (rev 6337)
@@ -0,0 +1,10 @@
+
+
+
+ 0
+ 10000
+
+ /home/davidk/swiftwork
+ /scratch/local/davidk/swiftwork
+
+
From davidk at ci.uchicago.edu Wed Mar 6 11:49:11 2013
From: davidk at ci.uchicago.edu (davidk at ci.uchicago.edu)
Date: Wed, 6 Mar 2013 11:49:11 -0600 (CST)
Subject: [Swift-commit] r6338 - in SwiftTutorials/IO/staging-normal: . conf
Message-ID: <20130306174911.C91AD9CCA1@svn.ci.uchicago.edu>
Author: davidk
Date: 2013-03-06 11:49:11 -0600 (Wed, 06 Mar 2013)
New Revision: 6338
Added:
SwiftTutorials/IO/staging-normal/clean.sh
SwiftTutorials/IO/staging-normal/conf/
SwiftTutorials/IO/staging-normal/conf/local-coasters.cf
SwiftTutorials/IO/staging-normal/data/
Removed:
SwiftTutorials/IO/staging-normal/catsn-absolute.swift
SwiftTutorials/IO/staging-normal/cf
SwiftTutorials/IO/staging-normal/sites.xml
Modified:
SwiftTutorials/IO/staging-normal/catsn-random.swift
SwiftTutorials/IO/staging-normal/setup.sh
Log:
Make it work with swiftrun
Deleted: SwiftTutorials/IO/staging-normal/catsn-absolute.swift
===================================================================
--- SwiftTutorials/IO/staging-normal/catsn-absolute.swift 2013-03-06 16:59:48 UTC (rev 6337)
+++ SwiftTutorials/IO/staging-normal/catsn-absolute.swift 2013-03-06 17:49:11 UTC (rev 6338)
@@ -1,12 +0,0 @@
-type file;
-
-app (file o) cat (file i)
-{
- cat @i stdout=@o;
-}
-
-file out[];
-foreach j in [1:@toInt(@arg("n","10"))] {
- file data <"file:///home/davidk/test4/data/data.txt">;
- out[j] = cat(data);
-}
Modified: SwiftTutorials/IO/staging-normal/catsn-random.swift
===================================================================
--- SwiftTutorials/IO/staging-normal/catsn-random.swift 2013-03-06 16:59:48 UTC (rev 6337)
+++ SwiftTutorials/IO/staging-normal/catsn-random.swift 2013-03-06 17:49:11 UTC (rev 6338)
@@ -5,9 +5,9 @@
cat @i stdout=@o;
}
-file input_files[];
+file input_files[];
foreach j in input_files {
- file output;
+ file output;
output = cat(j);
}
Deleted: SwiftTutorials/IO/staging-normal/cf
===================================================================
--- SwiftTutorials/IO/staging-normal/cf 2013-03-06 16:59:48 UTC (rev 6337)
+++ SwiftTutorials/IO/staging-normal/cf 2013-03-06 17:49:11 UTC (rev 6338)
@@ -1,8 +0,0 @@
-wrapperlog.always.transfer=true
-sitedir.keep=true
-execution.retries=0
-lazy.errors=true
-status.mode=provider
-use.provider.staging=false
-provider.staging.pin.swiftfiles=false
-use.wrapper.staging=false
Added: SwiftTutorials/IO/staging-normal/clean.sh
===================================================================
--- SwiftTutorials/IO/staging-normal/clean.sh (rev 0)
+++ SwiftTutorials/IO/staging-normal/clean.sh 2013-03-06 17:49:11 UTC (rev 6338)
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+rm -rf run*
Property changes on: SwiftTutorials/IO/staging-normal/clean.sh
___________________________________________________________________
Added: svn:executable
+ *
Added: SwiftTutorials/IO/staging-normal/conf/local-coasters.cf
===================================================================
--- SwiftTutorials/IO/staging-normal/conf/local-coasters.cf (rev 0)
+++ SwiftTutorials/IO/staging-normal/conf/local-coasters.cf 2013-03-06 17:49:11 UTC (rev 6338)
@@ -0,0 +1,12 @@
+wrapperlog.always.transfer=true
+sitedir.keep=true
+execution.retries=0
+lazy.errors=true
+status.mode=provider
+use.provider.staging=false
+provider.staging.pin.swiftfiles=false
+use.wrapper.staging=false
+
+#site local-coasters WORK=$HOME/swiftwork
+#site local-coasters SCRATCH=/scratch/local/$USER/swiftwork
+#app cat=/bin/cat
Modified: SwiftTutorials/IO/staging-normal/setup.sh
===================================================================
--- SwiftTutorials/IO/staging-normal/setup.sh 2013-03-06 16:59:48 UTC (rev 6337)
+++ SwiftTutorials/IO/staging-normal/setup.sh 2013-03-06 17:49:11 UTC (rev 6338)
@@ -1,6 +1,6 @@
#!/bin/bash
-NUMFILES=500
+NUMFILES=10
FILESIZE=10
FILESIZE=$(($FILESIZE*1000000))
Deleted: SwiftTutorials/IO/staging-normal/sites.xml
===================================================================
--- SwiftTutorials/IO/staging-normal/sites.xml 2013-03-06 16:59:48 UTC (rev 6337)
+++ SwiftTutorials/IO/staging-normal/sites.xml 2013-03-06 17:49:11 UTC (rev 6338)
@@ -1,10 +0,0 @@
-
-
-
- 0
- 10000
-
- /home/davidk/swiftwork
- /scratch/local/davidk/swiftwork
-
-
From davidk at ci.uchicago.edu Wed Mar 6 11:49:36 2013
From: davidk at ci.uchicago.edu (davidk at ci.uchicago.edu)
Date: Wed, 6 Mar 2013 11:49:36 -0600 (CST)
Subject: [Swift-commit] r6339 - trunk/etc/sites
Message-ID: <20130306174936.AEA879CCA1@svn.ci.uchicago.edu>
Author: davidk
Date: 2013-03-06 11:49:36 -0600 (Wed, 06 Mar 2013)
New Revision: 6339
Added:
trunk/etc/sites/local-coasters
Log:
local-coasters template
Added: trunk/etc/sites/local-coasters
===================================================================
--- trunk/etc/sites/local-coasters (rev 0)
+++ trunk/etc/sites/local-coasters 2013-03-06 17:49:36 UTC (rev 6339)
@@ -0,0 +1,12 @@
+
+
+
+
+ 0
+ 10000
+ 1000
+ 1
+ _WORK_
+ _SCRATCH_
+
+
From davidk at ci.uchicago.edu Wed Mar 6 13:25:15 2013
From: davidk at ci.uchicago.edu (davidk at ci.uchicago.edu)
Date: Wed, 6 Mar 2013 13:25:15 -0600 (CST)
Subject: [Swift-commit] r6340 - in SwiftTutorials/IO: . staging-normal
staging-provider staging-provider/conf
Message-ID: <20130306192515.F36A59CD1A@svn.ci.uchicago.edu>
Author: davidk
Date: 2013-03-06 13:25:15 -0600 (Wed, 06 Mar 2013)
New Revision: 6340
Added:
SwiftTutorials/IO/staging-normal/catsn.swift
SwiftTutorials/IO/staging-provider/
SwiftTutorials/IO/staging-provider/catsn.swift
SwiftTutorials/IO/staging-provider/clean.sh
SwiftTutorials/IO/staging-provider/conf/
SwiftTutorials/IO/staging-provider/conf/local-coasters.cf
SwiftTutorials/IO/staging-provider/data/
SwiftTutorials/IO/staging-provider/gendata.pl
SwiftTutorials/IO/staging-provider/setup.sh
Removed:
SwiftTutorials/IO/staging-normal/catsn-random.swift
Log:
Provider staging group
Deleted: SwiftTutorials/IO/staging-normal/catsn-random.swift
===================================================================
--- SwiftTutorials/IO/staging-normal/catsn-random.swift 2013-03-06 17:49:36 UTC (rev 6339)
+++ SwiftTutorials/IO/staging-normal/catsn-random.swift 2013-03-06 19:25:15 UTC (rev 6340)
@@ -1,13 +0,0 @@
-type file;
-
-app (file o) cat (file i)
-{
- cat @i stdout=@o;
-}
-
-file input_files[];
-
-foreach j in input_files {
- file output;
- output = cat(j);
-}
Copied: SwiftTutorials/IO/staging-normal/catsn.swift (from rev 6338, SwiftTutorials/IO/staging-normal/catsn-random.swift)
===================================================================
--- SwiftTutorials/IO/staging-normal/catsn.swift (rev 0)
+++ SwiftTutorials/IO/staging-normal/catsn.swift 2013-03-06 19:25:15 UTC (rev 6340)
@@ -0,0 +1,13 @@
+type file;
+
+app (file o) cat (file i)
+{
+ cat @i stdout=@o;
+}
+
+file input_files[];
+
+foreach j,i in input_files {
+ file output;
+ output = cat(j);
+}
Added: SwiftTutorials/IO/staging-provider/catsn.swift
===================================================================
--- SwiftTutorials/IO/staging-provider/catsn.swift (rev 0)
+++ SwiftTutorials/IO/staging-provider/catsn.swift 2013-03-06 19:25:15 UTC (rev 6340)
@@ -0,0 +1,13 @@
+type file;
+
+app (file o) cat (file i)
+{
+ cat @i stdout=@o;
+}
+
+file input_files[];
+
+foreach j,i in input_files {
+ file output;
+ output = cat(j);
+}
Added: SwiftTutorials/IO/staging-provider/clean.sh
===================================================================
--- SwiftTutorials/IO/staging-provider/clean.sh (rev 0)
+++ SwiftTutorials/IO/staging-provider/clean.sh 2013-03-06 19:25:15 UTC (rev 6340)
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+rm -rf run*
Property changes on: SwiftTutorials/IO/staging-provider/clean.sh
___________________________________________________________________
Added: svn:executable
+ *
Added: SwiftTutorials/IO/staging-provider/conf/local-coasters.cf
===================================================================
--- SwiftTutorials/IO/staging-provider/conf/local-coasters.cf (rev 0)
+++ SwiftTutorials/IO/staging-provider/conf/local-coasters.cf 2013-03-06 19:25:15 UTC (rev 6340)
@@ -0,0 +1,12 @@
+wrapperlog.always.transfer=true
+sitedir.keep=true
+execution.retries=0
+lazy.errors=true
+status.mode=provider
+use.provider.staging=true
+provider.staging.pin.swiftfiles=false
+use.wrapper.staging=false
+
+#site local-coasters WORK=$HOME/swiftwork
+#site local-coasters SCRATCH=/scratch/local/$USER/swiftwork
+#app cat=/bin/cat
Added: SwiftTutorials/IO/staging-provider/gendata.pl
===================================================================
--- SwiftTutorials/IO/staging-provider/gendata.pl (rev 0)
+++ SwiftTutorials/IO/staging-provider/gendata.pl 2013-03-06 19:25:15 UTC (rev 6340)
@@ -0,0 +1,22 @@
+#!/usr/bin/perl
+
+use strict;
+
+my @characters=('a'..'z', 'A'..'Z', '0'..'9');
+my $string="";
+my $length = $ARGV[0];
+my $width_count=0;
+
+foreach (1..$length)
+{
+ if($width_count == 80) {
+ $string .= "\n";
+ $width_count=0;
+ next;
+ }
+ $string .= $characters[rand @characters];
+ $width_count++;
+}
+
+print $string;
+
Property changes on: SwiftTutorials/IO/staging-provider/gendata.pl
___________________________________________________________________
Added: svn:executable
+ *
Added: SwiftTutorials/IO/staging-provider/setup.sh
===================================================================
--- SwiftTutorials/IO/staging-provider/setup.sh (rev 0)
+++ SwiftTutorials/IO/staging-provider/setup.sh 2013-03-06 19:25:15 UTC (rev 6340)
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+NUMFILES=10
+FILESIZE=10
+FILESIZE=$(($FILESIZE*1000000))
+
+if [ -n "$GROUP" ]; then
+ cp $RUNDIR/* .
+fi
+
+mkdir -p data
+for count in `seq 1 $NUMFILES`
+do
+ FILENAME=`mktemp -p data`
+ ./gendata.pl $FILESIZE > $FILENAME
+done
+
Property changes on: SwiftTutorials/IO/staging-provider/setup.sh
___________________________________________________________________
Added: svn:executable
+ *
From ketan at ci.uchicago.edu Thu Mar 7 15:28:05 2013
From: ketan at ci.uchicago.edu (ketan at ci.uchicago.edu)
Date: Thu, 7 Mar 2013 15:28:05 -0600 (CST)
Subject: [Swift-commit] r6341 - trunk/etc/sites
Message-ID: <20130307212805.07BA09CCB3@svn.ci.uchicago.edu>
Author: ketan
Date: 2013-03-07 15:28:04 -0600 (Thu, 07 Mar 2013)
New Revision: 6341
Added:
trunk/etc/sites/stampede
trunk/etc/sites/stampede-ssh
Removed:
trunk/etc/sites/stampede
Log:
separate stampede and stampede-ssh
Deleted: trunk/etc/sites/stampede
===================================================================
--- trunk/etc/sites/stampede 2013-03-06 19:25:15 UTC (rev 6340)
+++ trunk/etc/sites/stampede 2013-03-07 21:28:04 UTC (rev 6341)
@@ -1,18 +0,0 @@
-
-
-
-
- 16
- 16
- 43200
- 00:05:00
- 100
- 100
- normal
- 1
- TG-ASC090068
- 100
- 10000
- {env.SCRATCH}
-
-
Added: trunk/etc/sites/stampede
===================================================================
--- trunk/etc/sites/stampede (rev 0)
+++ trunk/etc/sites/stampede 2013-03-07 21:28:04 UTC (rev 6341)
@@ -0,0 +1,17 @@
+
+
+
+ TG-EAR130015
+ 1
+ 00:05:00
+ 43200
+ 100
+ 100
+ development
+ ketancmaheshwari at gmail.com
+ ALL
+ 10000
+
+ {env.SCRATCH}
+
+
Copied: trunk/etc/sites/stampede-ssh (from rev 6290, trunk/etc/sites/stampede)
===================================================================
--- trunk/etc/sites/stampede-ssh (rev 0)
+++ trunk/etc/sites/stampede-ssh 2013-03-07 21:28:04 UTC (rev 6341)
@@ -0,0 +1,18 @@
+
+
+
+
+ 16
+ 16
+ 43200
+ 00:05:00
+ 100
+ 100
+ normal
+ 1
+ TG-ASC090068
+ 100
+ 10000
+ {env.SCRATCH}
+
+
From ketan at ci.uchicago.edu Thu Mar 7 22:11:45 2013
From: ketan at ci.uchicago.edu (ketan at ci.uchicago.edu)
Date: Thu, 7 Mar 2013 22:11:45 -0600 (CST)
Subject: [Swift-commit] r6342 - in SwiftApps/modis: . conf
Message-ID: <20130308041145.4D1B19CC97@svn.ci.uchicago.edu>
Author: ketan
Date: 2013-03-07 22:11:45 -0600 (Thu, 07 Mar 2013)
New Revision: 6342
Added:
SwiftApps/modis/conf/stampede.cf
Modified:
SwiftApps/modis/clean.sh
Log:
adding stampede
Modified: SwiftApps/modis/clean.sh
===================================================================
--- SwiftApps/modis/clean.sh 2013-03-07 21:28:04 UTC (rev 6341)
+++ SwiftApps/modis/clean.sh 2013-03-08 04:11:45 UTC (rev 6342)
@@ -1,3 +1,4 @@
#!/bin/bash
rm -rf run*
+rm -rf swift.work
Added: SwiftApps/modis/conf/stampede.cf
===================================================================
--- SwiftApps/modis/conf/stampede.cf (rev 0)
+++ SwiftApps/modis/conf/stampede.cf 2013-03-08 04:11:45 UTC (rev 6342)
@@ -0,0 +1,17 @@
+wrapperlog.always.transfer=true
+sitedir.keep=true
+execution.retries=0
+lazy.errors=false
+status.mode=provider
+use.provider.staging=false
+provider.staging.pin.swiftfiles=false
+
+#site stampede WALLTIME=00:15:00
+
+#app getlanduse=$PWD/../bin/getlanduse.sh
+#app analyzelanduse=$PWD/../bin/analyzelanduse.sh
+#app colormodis=$PWD/../bin/colormodis.sh
+#app assemble=$PWD/../bin/assemble.sh
+#app markmap=$PWD/../bin/markmap.sh
+#app echo=/bin/echo
+
From ketan at ci.uchicago.edu Thu Mar 7 22:16:58 2013
From: ketan at ci.uchicago.edu (ketan at ci.uchicago.edu)
Date: Thu, 7 Mar 2013 22:16:58 -0600 (CST)
Subject: [Swift-commit] r6343 - trunk/etc/sites
Message-ID: <20130308041658.55EFE9CC97@svn.ci.uchicago.edu>
Author: ketan
Date: 2013-03-07 22:16:58 -0600 (Thu, 07 Mar 2013)
New Revision: 6343
Modified:
trunk/etc/sites/stampede
Log:
small fix on sites template
Modified: trunk/etc/sites/stampede
===================================================================
--- trunk/etc/sites/stampede 2013-03-08 04:11:45 UTC (rev 6342)
+++ trunk/etc/sites/stampede 2013-03-08 04:16:58 UTC (rev 6343)
@@ -1,4 +1,3 @@
-
TG-EAR130015
@@ -14,4 +13,3 @@
{env.SCRATCH}
-
From ketan at ci.uchicago.edu Thu Mar 7 22:37:25 2013
From: ketan at ci.uchicago.edu (ketan at ci.uchicago.edu)
Date: Thu, 7 Mar 2013 22:37:25 -0600 (CST)
Subject: [Swift-commit] r6344 - trunk/etc/sites
Message-ID: <20130308043725.B42729CC97@svn.ci.uchicago.edu>
Author: ketan
Date: 2013-03-07 22:37:25 -0600 (Thu, 07 Mar 2013)
New Revision: 6344
Modified:
trunk/etc/sites/stampede
Log:
Modified: trunk/etc/sites/stampede
===================================================================
--- trunk/etc/sites/stampede 2013-03-08 04:16:58 UTC (rev 6343)
+++ trunk/etc/sites/stampede 2013-03-08 04:37:25 UTC (rev 6344)
@@ -2,8 +2,8 @@
TG-EAR130015
1
- 00:05:00
- 43200
+ 01:00:00
+ 3700
100
100
development
From ketan at ci.uchicago.edu Thu Mar 7 22:50:52 2013
From: ketan at ci.uchicago.edu (ketan at ci.uchicago.edu)
Date: Thu, 7 Mar 2013 22:50:52 -0600 (CST)
Subject: [Swift-commit] r6345 - trunk/etc/sites
Message-ID: <20130308045052.B59289CC97@svn.ci.uchicago.edu>
Author: ketan
Date: 2013-03-07 22:50:52 -0600 (Thu, 07 Mar 2013)
New Revision: 6345
Modified:
trunk/etc/sites/stampede
Log:
jobspernode
Modified: trunk/etc/sites/stampede
===================================================================
--- trunk/etc/sites/stampede 2013-03-08 04:37:25 UTC (rev 6344)
+++ trunk/etc/sites/stampede 2013-03-08 04:50:52 UTC (rev 6345)
@@ -1,7 +1,7 @@
TG-EAR130015
- 1
+ 16
01:00:00
3700
100
From ketan at ci.uchicago.edu Thu Mar 7 23:21:00 2013
From: ketan at ci.uchicago.edu (ketan at ci.uchicago.edu)
Date: Thu, 7 Mar 2013 23:21:00 -0600 (CST)
Subject: [Swift-commit] r6346 - SwiftApps/modis/conf
Message-ID: <20130308052100.AFBF19CCB3@svn.ci.uchicago.edu>
Author: ketan
Date: 2013-03-07 23:21:00 -0600 (Thu, 07 Mar 2013)
New Revision: 6346
Modified:
SwiftApps/modis/conf/stampede.cf
Log:
Modified: SwiftApps/modis/conf/stampede.cf
===================================================================
--- SwiftApps/modis/conf/stampede.cf 2013-03-08 04:50:52 UTC (rev 6345)
+++ SwiftApps/modis/conf/stampede.cf 2013-03-08 05:21:00 UTC (rev 6346)
@@ -1,7 +1,7 @@
wrapperlog.always.transfer=true
sitedir.keep=true
-execution.retries=0
-lazy.errors=false
+execution.retries=1
+lazy.errors=true
status.mode=provider
use.provider.staging=false
provider.staging.pin.swiftfiles=false
From ketan at ci.uchicago.edu Thu Mar 7 23:23:36 2013
From: ketan at ci.uchicago.edu (ketan at ci.uchicago.edu)
Date: Thu, 7 Mar 2013 23:23:36 -0600 (CST)
Subject: [Swift-commit] r6347 - trunk/etc/sites
Message-ID: <20130308052336.BF93C9CCB3@svn.ci.uchicago.edu>
Author: ketan
Date: 2013-03-07 23:23:36 -0600 (Thu, 07 Mar 2013)
New Revision: 6347
Modified:
trunk/etc/sites/stampede
Log:
Modified: trunk/etc/sites/stampede
===================================================================
--- trunk/etc/sites/stampede 2013-03-08 05:21:00 UTC (rev 6346)
+++ trunk/etc/sites/stampede 2013-03-08 05:23:36 UTC (rev 6347)
@@ -1,7 +1,9 @@
TG-EAR130015
+ 1
16
+ 16
01:00:00
3700
100
From ketan at ci.uchicago.edu Fri Mar 8 01:01:04 2013
From: ketan at ci.uchicago.edu (ketan at ci.uchicago.edu)
Date: Fri, 8 Mar 2013 01:01:04 -0600 (CST)
Subject: [Swift-commit] r6348 - trunk/docs/userguide
Message-ID: <20130308070104.300B79CCA1@svn.ci.uchicago.edu>
Author: ketan
Date: 2013-03-08 01:01:03 -0600 (Fri, 08 Mar 2013)
New Revision: 6348
Modified:
trunk/docs/userguide/mappers
Log:
fixing the example on regexp and struct regexp mappers
Modified: trunk/docs/userguide/mappers
===================================================================
--- trunk/docs/userguide/mappers 2013-03-08 05:23:36 UTC (rev 6347)
+++ trunk/docs/userguide/mappers 2013-03-08 07:01:03 UTC (rev 6348)
@@ -631,14 +631,12 @@
Example:
----
-string s = "picture.gif";
-file f ;
+file s <"picture.gif">;
+file f ;
----
-This example transforms a string ending gif into one ending jpg and
+This example transforms a file ending gif into one ending jpg and
maps that to a file.
[options="header, autowidth"]
@@ -649,9 +647,10 @@
structured regular expression mapper
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-The structured_regexp_mapper is similar to the regexp_mapper. The
-structured_regexp_mapper can be applied to lists while the regexp_mapper cannot.
+The structured_regexp_mapper is similar to the regexp_mapper with the only
+difference that it can be applied to arrays while the regexp_mapper cannot.
+
[options="header, autowidth"]
|==========
|parameter|meaning
@@ -667,14 +666,13 @@
Example:
----
-string s[] = ["picture.gif", "hello.gif", "world.gif"];
-file f[] ;
+file s[] ;
+
+file f[] ;
----
-This example transforms all strings in a list that end in gif to end in jpg and maps
+This example transforms all files in a list that end in gif to end in jpg and maps
the list to those files.
csv mapper
From hategan at ci.uchicago.edu Fri Mar 8 12:48:03 2013
From: hategan at ci.uchicago.edu (hategan at ci.uchicago.edu)
Date: Fri, 8 Mar 2013 12:48:03 -0600 (CST)
Subject: [Swift-commit] r6349 -
branches/release-0.94/src/org/griphyn/vdl/engine
Message-ID: <20130308184803.1E8D29CCA1@svn.ci.uchicago.edu>
Author: hategan
Date: 2013-03-08 12:48:02 -0600 (Fri, 08 Mar 2013)
New Revision: 6349
Modified:
branches/release-0.94/src/org/griphyn/vdl/engine/VariableScope.java
Log:
properly handle inhibitClosing in else branch if a close was added to match what is in the then branch
Modified: branches/release-0.94/src/org/griphyn/vdl/engine/VariableScope.java
===================================================================
--- branches/release-0.94/src/org/griphyn/vdl/engine/VariableScope.java 2013-03-08 07:01:03 UTC (rev 6348)
+++ branches/release-0.94/src/org/griphyn/vdl/engine/VariableScope.java 2013-03-08 18:48:02 UTC (rev 6349)
@@ -308,6 +308,9 @@
inhibitClosing = new HashSet();
}
inhibitClosing.add(name);
+ if (thenScope != null) {
+ setPreClose(name, 0);
+ }
}
public void addVariable(String name, String type, String context, boolean global, XmlObject src) throws CompilationException {
@@ -650,7 +653,7 @@
}
private void setPreClose(String name, int count) {
- if (inhibitClosing != null && inhibitClosing.contains(name)) {
+ if (inhibitClosing != null && inhibitClosing.contains(name) && count != 0) {
return;
}
setCount("preClose", name, count,
From hategan at ci.uchicago.edu Fri Mar 8 12:48:31 2013
From: hategan at ci.uchicago.edu (hategan at ci.uchicago.edu)
Date: Fri, 8 Mar 2013 12:48:31 -0600 (CST)
Subject: [Swift-commit] r6350 - branches/faster/src/org/griphyn/vdl/mapping
Message-ID: <20130308184831.C8EA99CCA1@svn.ci.uchicago.edu>
Author: hategan
Date: 2013-03-08 12:48:31 -0600 (Fri, 08 Mar 2013)
New Revision: 6350
Modified:
branches/faster/src/org/griphyn/vdl/mapping/AbstractDataNode.java
Log:
removed debug statement
Modified: branches/faster/src/org/griphyn/vdl/mapping/AbstractDataNode.java
===================================================================
--- branches/faster/src/org/griphyn/vdl/mapping/AbstractDataNode.java 2013-03-08 18:48:02 UTC (rev 6349)
+++ branches/faster/src/org/griphyn/vdl/mapping/AbstractDataNode.java 2013-03-08 18:48:31 UTC (rev 6350)
@@ -629,7 +629,6 @@
logger.debug("Waiting for " + this);
}
- System.out.println("Wait");
Yield y = new FutureNotYetAvailable(this);
y.getState().addTraceElement(who);
throw y;
From hategan at ci.uchicago.edu Fri Mar 8 12:53:41 2013
From: hategan at ci.uchicago.edu (hategan at ci.uchicago.edu)
Date: Fri, 8 Mar 2013 12:53:41 -0600 (CST)
Subject: [Swift-commit] r6351 - branches/faster/resources
Message-ID: <20130308185341.CA0709CCA1@svn.ci.uchicago.edu>
Author: hategan
Date: 2013-03-08 12:53:41 -0600 (Fri, 08 Mar 2013)
New Revision: 6351
Modified:
branches/faster/resources/Karajan.stg
Log:
use uparallel to avoid unnecessary buffering when possible
Modified: branches/faster/resources/Karajan.stg
===================================================================
--- branches/faster/resources/Karajan.stg 2013-03-08 18:48:31 UTC (rev 6350)
+++ branches/faster/resources/Karajan.stg 2013-03-08 18:53:41 UTC (rev 6351)
@@ -178,7 +178,7 @@
parallel(statements) ::= <<
$if(rest(statements))$
-parallel(
+uparallel(
$statements;separator="\n"$
)
$else$
From hategan at ci.uchicago.edu Fri Mar 8 12:54:51 2013
From: hategan at ci.uchicago.edu (hategan at ci.uchicago.edu)
Date: Fri, 8 Mar 2013 12:54:51 -0600 (CST)
Subject: [Swift-commit] r6352 - branches/faster/src/org/griphyn/vdl/engine
Message-ID: <20130308185451.AC8539CCA1@svn.ci.uchicago.edu>
Author: hategan
Date: 2013-03-08 12:54:51 -0600 (Fri, 08 Mar 2013)
New Revision: 6352
Modified:
branches/faster/src/org/griphyn/vdl/engine/Karajan.java
Log:
allow recursive procedures
Modified: branches/faster/src/org/griphyn/vdl/engine/Karajan.java
===================================================================
--- branches/faster/src/org/griphyn/vdl/engine/Karajan.java 2013-03-08 18:53:41 UTC (rev 6351)
+++ branches/faster/src/org/griphyn/vdl/engine/Karajan.java 2013-03-08 18:54:51 UTC (rev 6352)
@@ -293,7 +293,7 @@
while (!unmarked.isEmpty()) {
Set tmp = new HashSet();
- visit(unmarked.iterator().next(), unmarked, sorted, tmp, names);
+ visit(null, unmarked.iterator().next(), unmarked, sorted, tmp, names);
}
for (Procedure proc : sorted) {
@@ -302,10 +302,16 @@
}
- private void visit(Procedure proc, Set unmarked,
+ private void visit(Procedure self, Procedure proc, Set unmarked,
List sorted, Set tmp, Map names) throws CompilationException {
if (tmp.contains(proc)) {
- throw new CompilationException("Circular procedure dependency detected");
+ if (proc == self) {
+ // immediate recursion allowed
+ return;
+ }
+ else {
+ throw new CompilationException("Circular procedure dependency detected");
+ }
}
if (unmarked.contains(proc)) {
tmp.add(proc);
@@ -317,7 +323,7 @@
}
dupes.add(name);
if (names.containsKey(name)) {
- visit(names.get(name), unmarked, sorted, tmp, names);
+ visit(proc, names.get(name), unmarked, sorted, tmp, names);
}
else {
// handled later
@@ -696,7 +702,7 @@
ProcedureSignature proc = proceduresMap.get(procName);
if (proc.isDeprecated()) {
- /* warn(call, "Procedure " + procName + " is deprecated"); */
+ Warnings.warn(call, "Procedure " + procName + " is deprecated");
}
StringTemplate callST;
@@ -1534,8 +1540,6 @@
"return value to be used in an expression.");
}
- Warnings.warn(c, "Procedure " + name + " is deprecated");
-
StringTemplate call = template("callexpr");
String type = funcSignature.getOutputArray(0).getType();
From hategan at ci.uchicago.edu Fri Mar 8 12:55:37 2013
From: hategan at ci.uchicago.edu (hategan at ci.uchicago.edu)
Date: Fri, 8 Mar 2013 12:55:37 -0600 (CST)
Subject: [Swift-commit] r6353 -
branches/faster/src/org/griphyn/vdl/karajan/lib
Message-ID: <20130308185537.259889CCA1@svn.ci.uchicago.edu>
Author: hategan
Date: 2013-03-08 12:55:36 -0600 (Fri, 08 Mar 2013)
New Revision: 6353
Modified:
branches/faster/src/org/griphyn/vdl/karajan/lib/Range.java
branches/faster/src/org/griphyn/vdl/karajan/lib/SwiftFunction.java
Log:
properly wait for parameters in range()
Modified: branches/faster/src/org/griphyn/vdl/karajan/lib/Range.java
===================================================================
--- branches/faster/src/org/griphyn/vdl/karajan/lib/Range.java 2013-03-08 18:54:51 UTC (rev 6352)
+++ branches/faster/src/org/griphyn/vdl/karajan/lib/Range.java 2013-03-08 18:55:36 UTC (rev 6353)
@@ -58,6 +58,10 @@
DSHandle from = this.from.getValue(stack);
DSHandle to = this.to.getValue(stack);
DSHandle step = this.step.getValue(stack);
+
+ waitFor(this, from);
+ waitFor(this, to);
+ waitFor(this, step);
final Type type = from.getType();
final double start = ((Number) from.getValue()).doubleValue();
final double stop = ((Number) to.getValue()).doubleValue();
Modified: branches/faster/src/org/griphyn/vdl/karajan/lib/SwiftFunction.java
===================================================================
--- branches/faster/src/org/griphyn/vdl/karajan/lib/SwiftFunction.java 2013-03-08 18:54:51 UTC (rev 6352)
+++ branches/faster/src/org/griphyn/vdl/karajan/lib/SwiftFunction.java 2013-03-08 18:55:36 UTC (rev 6353)
@@ -354,6 +354,10 @@
return v;
}
+ protected static void waitFor(Node n, DSHandle h) {
+ ((AbstractDataNode) h).waitFor(n);
+ }
+
public static Channel unwrapAll(Node who, Channel vargs) throws ExecutionException {
waitForAll(who, vargs);
MemoryChannel mc = new MemoryChannel();
From hategan at ci.uchicago.edu Fri Mar 8 12:56:01 2013
From: hategan at ci.uchicago.edu (hategan at ci.uchicago.edu)
Date: Fri, 8 Mar 2013 12:56:01 -0600 (CST)
Subject: [Swift-commit] r6354 - branches/faster/src/org/griphyn/vdl/engine
Message-ID: <20130308185601.7655F9CCA1@svn.ci.uchicago.edu>
Author: hategan
Date: 2013-03-08 12:56:01 -0600 (Fri, 08 Mar 2013)
New Revision: 6354
Modified:
branches/faster/src/org/griphyn/vdl/engine/VariableScope.java
Log:
fixed inhibitClosing in else branch
Modified: branches/faster/src/org/griphyn/vdl/engine/VariableScope.java
===================================================================
--- branches/faster/src/org/griphyn/vdl/engine/VariableScope.java 2013-03-08 18:55:36 UTC (rev 6353)
+++ branches/faster/src/org/griphyn/vdl/engine/VariableScope.java 2013-03-08 18:56:01 UTC (rev 6354)
@@ -308,6 +308,9 @@
inhibitClosing = new HashSet();
}
inhibitClosing.add(name);
+ if (thenScope != null) {
+ setPreClose(name, 0);
+ }
}
public void addVariable(String name, String type, String context, boolean global, XmlObject src) throws CompilationException {
From hategan at ci.uchicago.edu Fri Mar 8 12:58:55 2013
From: hategan at ci.uchicago.edu (hategan at ci.uchicago.edu)
Date: Fri, 8 Mar 2013 12:58:55 -0600 (CST)
Subject: [Swift-commit] r6355 - in
branches/faster/src/org/griphyn/vdl/karajan: . lib
Message-ID: <20130308185855.3A0589CCA1@svn.ci.uchicago.edu>
Author: hategan
Date: 2013-03-08 12:58:55 -0600 (Fri, 08 Mar 2013)
New Revision: 6355
Modified:
branches/faster/src/org/griphyn/vdl/karajan/Pair.java
branches/faster/src/org/griphyn/vdl/karajan/lib/AppStageouts.java
Log:
slightly more memory efficient appStageouts()
Modified: branches/faster/src/org/griphyn/vdl/karajan/Pair.java
===================================================================
--- branches/faster/src/org/griphyn/vdl/karajan/Pair.java 2013-03-08 18:56:01 UTC (rev 6354)
+++ branches/faster/src/org/griphyn/vdl/karajan/Pair.java 2013-03-08 18:58:55 UTC (rev 6355)
@@ -22,16 +22,23 @@
import java.util.AbstractList;
-public class Pair extends AbstractList {
- private Object[] elements = new Object[2];
+public class Pair extends AbstractList {
+ private T o1, o2;
- public Pair(Object o1, Object o2) {
- elements[0] = o1;
- elements[1] = o2;
+ public Pair(T o1, T o2) {
+ this.o1 = o1;
+ this.o2 = o2;
}
- public Object get(int index) {
- return elements[index];
+ public T get(int index) {
+ switch (index) {
+ case 0:
+ return o1;
+ case 1:
+ return o2;
+ default:
+ throw new IndexOutOfBoundsException();
+ }
}
public int size() {
Modified: branches/faster/src/org/griphyn/vdl/karajan/lib/AppStageouts.java
===================================================================
--- branches/faster/src/org/griphyn/vdl/karajan/lib/AppStageouts.java 2013-03-08 18:56:01 UTC (rev 6354)
+++ branches/faster/src/org/griphyn/vdl/karajan/lib/AppStageouts.java 2013-03-08 18:58:55 UTC (rev 6355)
@@ -31,6 +31,7 @@
import org.globus.cog.karajan.analyzer.ChannelRef;
import org.globus.cog.karajan.analyzer.Signature;
import org.globus.cog.karajan.compiled.nodes.InternalFunction;
+import org.griphyn.vdl.karajan.Pair;
import org.griphyn.vdl.mapping.AbsFile;
import org.griphyn.vdl.mapping.DSHandle;
import org.griphyn.vdl.mapping.Path;
@@ -76,9 +77,6 @@
}
private List makeList(String s1, String s2) {
- List l = new LinkedList();
- l.add(s1);
- l.add(s2);
- return l;
+ return new Pair(s1, s2);
}
}
From ketan at ci.uchicago.edu Fri Mar 8 21:03:32 2013
From: ketan at ci.uchicago.edu (ketan at ci.uchicago.edu)
Date: Fri, 8 Mar 2013 21:03:32 -0600 (CST)
Subject: [Swift-commit] r6356 - trunk/tests
Message-ID: <20130309030332.E68B69CCB3@svn.ci.uchicago.edu>
Author: ketan
Date: 2013-03-08 21:03:32 -0600 (Fri, 08 Mar 2013)
New Revision: 6356
Modified:
trunk/tests/USAGENOTES.txt
Log:
small fix
Modified: trunk/tests/USAGENOTES.txt
===================================================================
--- trunk/tests/USAGENOTES.txt 2013-03-08 18:58:55 UTC (rev 6355)
+++ trunk/tests/USAGENOTES.txt 2013-03-09 03:03:32 UTC (rev 6356)
@@ -36,7 +36,7 @@
have the conventional *_cog/modules/swift_* configuration,
and you have done an *ant dist*, you can run
*********************************************************
- suite.sh -t -o /tmp $PWD/tests/groups/group-all-local.sh
+ suite.sh -t -o /tmp $PWD/groups/group-all-local.sh
*********************************************************
or *cd* into */tmp* and run
**************************************************************
From ketan at ci.uchicago.edu Fri Mar 8 23:46:40 2013
From: ketan at ci.uchicago.edu (ketan at ci.uchicago.edu)
Date: Fri, 8 Mar 2013 23:46:40 -0600 (CST)
Subject: [Swift-commit] r6357 -
branches/release-0.93/tests/language-behaviour/mappers
Message-ID: <20130309054640.6C05E9CCA1@svn.ci.uchicago.edu>
Author: ketan
Date: 2013-03-08 23:46:40 -0600 (Fri, 08 Mar 2013)
New Revision: 6357
Added:
branches/release-0.93/tests/language-behaviour/mappers/077-regexpmapper-input.in
Modified:
branches/release-0.93/tests/language-behaviour/mappers/077-regexp-mapper.swift
Log:
improve regexp mapper test
Modified: branches/release-0.93/tests/language-behaviour/mappers/077-regexp-mapper.swift
===================================================================
--- branches/release-0.93/tests/language-behaviour/mappers/077-regexp-mapper.swift 2013-03-09 03:03:32 UTC (rev 6356)
+++ branches/release-0.93/tests/language-behaviour/mappers/077-regexp-mapper.swift 2013-03-09 05:46:40 UTC (rev 6357)
@@ -6,10 +6,10 @@
}
}
-messagefile outfile ;
+messagefile infile <"077-regexpmapper-input.in">;
+messagefile outfile ;
+
outfile = greeting();
Added: branches/release-0.93/tests/language-behaviour/mappers/077-regexpmapper-input.in
===================================================================
--- branches/release-0.93/tests/language-behaviour/mappers/077-regexpmapper-input.in (rev 0)
+++ branches/release-0.93/tests/language-behaviour/mappers/077-regexpmapper-input.in 2013-03-09 05:46:40 UTC (rev 6357)
@@ -0,0 +1 @@
+garuda
From ketan at ci.uchicago.edu Sat Mar 9 00:23:31 2013
From: ketan at ci.uchicago.edu (ketan at ci.uchicago.edu)
Date: Sat, 9 Mar 2013 00:23:31 -0600 (CST)
Subject: [Swift-commit] r6358 - trunk/tests/language-behaviour/mappers
Message-ID: <20130309062331.E14669CCA1@svn.ci.uchicago.edu>
Author: ketan
Date: 2013-03-09 00:23:31 -0600 (Sat, 09 Mar 2013)
New Revision: 6358
Added:
trunk/tests/language-behaviour/mappers/077-regexpmapper-input.in
Modified:
trunk/tests/language-behaviour/mappers/077-regexp-mapper.swift
Log:
regexp test update in trunk
Modified: trunk/tests/language-behaviour/mappers/077-regexp-mapper.swift
===================================================================
--- trunk/tests/language-behaviour/mappers/077-regexp-mapper.swift 2013-03-09 05:46:40 UTC (rev 6357)
+++ trunk/tests/language-behaviour/mappers/077-regexp-mapper.swift 2013-03-09 06:23:31 UTC (rev 6358)
@@ -6,10 +6,10 @@
}
}
-messagefile outfile ;
+messagefile infile <"077-regexpmapper-input.in">;
+messagefile outfile ;
+
outfile = greeting();
Added: trunk/tests/language-behaviour/mappers/077-regexpmapper-input.in
===================================================================
--- trunk/tests/language-behaviour/mappers/077-regexpmapper-input.in (rev 0)
+++ trunk/tests/language-behaviour/mappers/077-regexpmapper-input.in 2013-03-09 06:23:31 UTC (rev 6358)
@@ -0,0 +1 @@
+garuda
From ketan at ci.uchicago.edu Sat Mar 9 14:48:15 2013
From: ketan at ci.uchicago.edu (ketan at ci.uchicago.edu)
Date: Sat, 9 Mar 2013 14:48:15 -0600 (CST)
Subject: [Swift-commit] r6359 - in SwiftApps/modis: . tutorial
Message-ID: <20130309204815.EAEB89CC97@svn.ci.uchicago.edu>
Author: ketan
Date: 2013-03-09 14:48:14 -0600 (Sat, 09 Mar 2013)
New Revision: 6359
Added:
SwiftApps/modis/modis-characterization.dia
SwiftApps/modis/modis-characterization.png
Modified:
SwiftApps/modis/tutorial/modis05.swift
Log:
modis characterization
Added: SwiftApps/modis/modis-characterization.dia
===================================================================
(Binary files differ)
Property changes on: SwiftApps/modis/modis-characterization.dia
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: SwiftApps/modis/modis-characterization.png
===================================================================
(Binary files differ)
Property changes on: SwiftApps/modis/modis-characterization.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: SwiftApps/modis/tutorial/modis05.swift
===================================================================
--- SwiftApps/modis/tutorial/modis05.swift 2013-03-09 06:23:31 UTC (rev 6358)
+++ SwiftApps/modis/tutorial/modis05.swift 2013-03-09 20:48:14 UTC (rev 6359)
@@ -32,7 +32,7 @@
imagefile geos[] ;
# Compute the land use summary of each MODIS tile
-landuse land[] ;
+landuse land[] ;
foreach g,i in geos {
land[i] = getLandUse(g);
From davidk at ci.uchicago.edu Sat Mar 9 15:29:32 2013
From: davidk at ci.uchicago.edu (davidk at ci.uchicago.edu)
Date: Sat, 9 Mar 2013 15:29:32 -0600 (CST)
Subject: [Swift-commit] r6360 - trunk/etc/sites
Message-ID: <20130309212932.E616B9CC97@svn.ci.uchicago.edu>
Author: davidk
Date: 2013-03-09 15:29:32 -0600 (Sat, 09 Mar 2013)
New Revision: 6360
Modified:
trunk/etc/sites/beagle-ssh
Log:
Fix for beagle-ssh tempalte
Modified: trunk/etc/sites/beagle-ssh
===================================================================
--- trunk/etc/sites/beagle-ssh 2013-03-09 20:48:14 UTC (rev 6359)
+++ trunk/etc/sites/beagle-ssh 2013-03-09 21:29:32 UTC (rev 6360)
@@ -1,5 +1,5 @@
-
+
24
100
100
From ketan at ci.uchicago.edu Sat Mar 9 16:04:21 2013
From: ketan at ci.uchicago.edu (ketan at ci.uchicago.edu)
Date: Sat, 9 Mar 2013 16:04:21 -0600 (CST)
Subject: [Swift-commit] r6361 - trunk/tests/language-behaviour/mappers
Message-ID: <20130309220421.B7E849CC97@svn.ci.uchicago.edu>
Author: ketan
Date: 2013-03-09 16:04:21 -0600 (Sat, 09 Mar 2013)
New Revision: 6361
Added:
trunk/tests/language-behaviour/mappers/076-structured-regexp-mapper.b0.out.expected
trunk/tests/language-behaviour/mappers/076-structured-regexp-mapper.b1.out.expected
Removed:
trunk/tests/language-behaviour/mappers/076-structured-regexp-mapper.b.out.expected
Modified:
trunk/tests/language-behaviour/mappers/076-structured-regexp-mapper.swift
Log:
update structured regexp mapper test
Deleted: trunk/tests/language-behaviour/mappers/076-structured-regexp-mapper.b.out.expected
===================================================================
--- trunk/tests/language-behaviour/mappers/076-structured-regexp-mapper.b.out.expected 2013-03-09 21:29:32 UTC (rev 6360)
+++ trunk/tests/language-behaviour/mappers/076-structured-regexp-mapper.b.out.expected 2013-03-09 22:04:21 UTC (rev 6361)
@@ -1 +0,0 @@
-Hello, world!
Added: trunk/tests/language-behaviour/mappers/076-structured-regexp-mapper.b0.out.expected
===================================================================
--- trunk/tests/language-behaviour/mappers/076-structured-regexp-mapper.b0.out.expected (rev 0)
+++ trunk/tests/language-behaviour/mappers/076-structured-regexp-mapper.b0.out.expected 2013-03-09 22:04:21 UTC (rev 6361)
@@ -0,0 +1 @@
+Hello, world!
Added: trunk/tests/language-behaviour/mappers/076-structured-regexp-mapper.b1.out.expected
===================================================================
--- trunk/tests/language-behaviour/mappers/076-structured-regexp-mapper.b1.out.expected (rev 0)
+++ trunk/tests/language-behaviour/mappers/076-structured-regexp-mapper.b1.out.expected 2013-03-09 22:04:21 UTC (rev 6361)
@@ -0,0 +1 @@
+Hello, world!
Modified: trunk/tests/language-behaviour/mappers/076-structured-regexp-mapper.swift
===================================================================
--- trunk/tests/language-behaviour/mappers/076-structured-regexp-mapper.swift 2013-03-09 21:29:32 UTC (rev 6360)
+++ trunk/tests/language-behaviour/mappers/076-structured-regexp-mapper.swift 2013-03-09 22:04:21 UTC (rev 6361)
@@ -12,14 +12,14 @@
}
}
+messagefile outfile[] ;
-messagefile outfile <"076-structured-regexp-mapper.a.out">;
-messagefile outfile2 ;
+messagefile outfile2[] ;
-outfile = greeting();
+foreach i in [0:1]{
+ outfile[i] = greeting();
+ outfile2[i] = greeting2(outfile[i]);
+}
-outfile2 = greeting2(outfile);
From swift at ci.uchicago.edu Sat Mar 9 19:55:04 2013
From: swift at ci.uchicago.edu (swift at ci.uchicago.edu)
Date: Sat, 9 Mar 2013 19:55:04 -0600 (CST)
Subject: [Swift-commit] cog r3632
Message-ID: <20130310015505.590D98D000A2@bridled.ci.uchicago.edu>
------------------------------------------------------------------------
r3632 | hategan | 2013-03-09 19:51:28 -0600 (Sat, 09 Mar 2013) | 1 line
fixed globus dir in ssh-cl proxy forwarding
------------------------------------------------------------------------
Index: modules/provider-ssh/src/org/globus/cog/abstraction/impl/sshcl/execution/SSHCLProxyForwarder.java
===================================================================
--- modules/provider-ssh/src/org/globus/cog/abstraction/impl/sshcl/execution/SSHCLProxyForwarder.java (revision 3631)
+++ modules/provider-ssh/src/org/globus/cog/abstraction/impl/sshcl/execution/SSHCLProxyForwarder.java (working copy)
@@ -175,7 +175,7 @@
private String makeGlobusDir() throws IOException {
String h = runSSH(new String[] {"mkdir", "-p", "~/.globus", ";", "ls", "-d", "~"});
- return h.trim();
+ return h.trim() + "/.globus";
}
private String runSSH(String[] args) throws IOException {
From swift at ci.uchicago.edu Sat Mar 9 20:40:08 2013
From: swift at ci.uchicago.edu (swift at ci.uchicago.edu)
Date: Sat, 9 Mar 2013 20:40:08 -0600 (CST)
Subject: [Swift-commit] cog r3633
Message-ID: <20130310024009.22C4A8D000A2@bridled.ci.uchicago.edu>
------------------------------------------------------------------------
r3633 | hategan | 2013-03-09 20:35:42 -0600 (Sat, 09 Mar 2013) | 1 line
give the jvm 512M instead of 256M on 64 bit systems
------------------------------------------------------------------------
Index: modules/provider-coaster/src/org/globus/cog/abstraction/impl/execution/coaster/bootstrap/Bootstrap.java
===================================================================
--- modules/provider-coaster/src/org/globus/cog/abstraction/impl/execution/coaster/bootstrap/Bootstrap.java (revision 3632)
+++ modules/provider-coaster/src/org/globus/cog/abstraction/impl/execution/coaster/bootstrap/Bootstrap.java (working copy)
@@ -185,7 +185,14 @@
args.add("2");
args.add(java);
addDebuggingOptions(args);
- args.add("-Xmx256M");
+ String arch = System.getProperty("os.arch");
+ if (arch != null && arch.indexOf("64") != -1) {
+ // give the JVM more memory on 64 bit systems
+ args.add("-Xmx512M");
+ }
+ else {
+ args.add("-Xmx256M");
+ }
args.add("-Dtcp.channel.log.io.performance=true");
//pass user home override to service
args.add("-Duser.home=" + System.getProperty("user.home"));
From swift at ci.uchicago.edu Sun Mar 10 00:05:03 2013
From: swift at ci.uchicago.edu (swift at ci.uchicago.edu)
Date: Sun, 10 Mar 2013 00:05:03 -0600 (CST)
Subject: [Swift-commit] cog r3635
Message-ID: <20130310060504.4728F8D000A2@bridled.ci.uchicago.edu>
------------------------------------------------------------------------
r3635 | hategan | 2013-03-10 00:02:22 -0600 (Sun, 10 Mar 2013) | 1 line
aah
------------------------------------------------------------------------
Index: modules/karajan/src/org/globus/cog/karajan/workflow/service/channels/AbstractKarajanChannel.java
===================================================================
--- modules/karajan/src/org/globus/cog/karajan/workflow/service/channels/AbstractKarajanChannel.java (revision 3634)
+++ modules/karajan/src/org/globus/cog/karajan/workflow/service/channels/AbstractKarajanChannel.java (working copy)
@@ -129,6 +129,8 @@
long lastTime = getLastTime();
if (now - lastTime > TIMEOUT * 1000) {
TimeoutException e = new TimeoutException(this, "Channel timed out", lastTime);
+ // prevent further timeouts
+ lastTime = Long.MAX_VALUE;
context.notifyRegisteredCommandsAndHandlers(e);
handleChannelException(e);
timeoutCheckTask.cancel();
From swift at ci.uchicago.edu Sun Mar 10 01:20:06 2013
From: swift at ci.uchicago.edu (swift at ci.uchicago.edu)
Date: Sun, 10 Mar 2013 01:20:06 -0600 (CST)
Subject: [Swift-commit] cog r3636
Message-ID: <20130310072006.8BDD58D000A2@bridled.ci.uchicago.edu>
------------------------------------------------------------------------
r3636 | hategan | 2013-03-10 01:18:42 -0600 (Sun, 10 Mar 2013) | 1 line
only compare host name when looking up channels
------------------------------------------------------------------------
Index: modules/karajan/src/org/globus/cog/karajan/workflow/service/channels/ChannelManager.java
===================================================================
--- modules/karajan/src/org/globus/cog/karajan/workflow/service/channels/ChannelManager.java (revision 3635)
+++ modules/karajan/src/org/globus/cog/karajan/workflow/service/channels/ChannelManager.java (working copy)
@@ -501,14 +501,13 @@
public boolean equals(Object obj) {
if (obj instanceof HostCredentialPair) {
HostCredentialPair other = (HostCredentialPair) obj;
- return host.equals(other.host)
- && ((DN == null && other.DN == null) || ((DN != null) && DN.equals(other.DN)));
+ return host.equals(other.host);
}
return false;
}
public int hashCode() {
- return host.hashCode() + ((DN == null) ? 0 : DN.hashCode());
+ return host.hashCode();
}
public String toString() {
From swift at ci.uchicago.edu Sun Mar 10 01:30:05 2013
From: swift at ci.uchicago.edu (swift at ci.uchicago.edu)
Date: Sun, 10 Mar 2013 01:30:05 -0600 (CST)
Subject: [Swift-commit] cog r3637
Message-ID: <20130310073006.A9D808D000A2@bridled.ci.uchicago.edu>
------------------------------------------------------------------------
r3637 | hategan | 2013-03-10 01:29:31 -0600 (Sun, 10 Mar 2013) | 1 line
start coaster service in a login shell to pick up all user settings
------------------------------------------------------------------------
Index: modules/provider-coaster/src/org/globus/cog/abstraction/impl/execution/coaster/ServiceManager.java
===================================================================
--- modules/provider-coaster/src/org/globus/cog/abstraction/impl/execution/coaster/ServiceManager.java (revision 3636)
+++ modules/provider-coaster/src/org/globus/cog/abstraction/impl/execution/coaster/ServiceManager.java (working copy)
@@ -301,6 +301,7 @@
t.setType(Task.JOB_SUBMISSION);
JobSpecification js = new JobSpecificationImpl();
js.setExecutable("/bin/bash");
+ js.addArgument("-l");
js.addArgument("-c");
String id = getRandomID();
t.setAttribute(TASK_ATTR_ID, id);
From ketan at ci.uchicago.edu Sun Mar 10 14:35:04 2013
From: ketan at ci.uchicago.edu (ketan at ci.uchicago.edu)
Date: Sun, 10 Mar 2013 14:35:04 -0500 (CDT)
Subject: [Swift-commit] r6362 - trunk/docs/siteguide
Message-ID: <20130310193504.0DD239CC97@svn.ci.uchicago.edu>
Author: ketan
Date: 2013-03-10 14:35:03 -0500 (Sun, 10 Mar 2013)
New Revision: 6362
Modified:
trunk/docs/siteguide/beagle
Log:
updating Swift Beagle docs
Modified: trunk/docs/siteguide/beagle
===================================================================
--- trunk/docs/siteguide/beagle 2013-03-09 22:04:21 UTC (rev 6361)
+++ trunk/docs/siteguide/beagle 2013-03-10 19:35:03 UTC (rev 6362)
@@ -3,24 +3,34 @@
Beagle is a Cray XE6 supercomputer at UChicago. It employs a batch-oriented
computational model where-in a PBS schedular accepts user's jobs and queues
-them in the queueing system for execution. The computational model requires
-a user to prepare the submit files, track job submissions, chackpointing,
-managing input/output data and handling exceptional conditions manually.
-Running Swift under Beagle can accomplish the above tasks with least manual
-user intervention and maximal oppurtunistic computation time on Beagle
-queues. In the following sections, we discuss more about specifics of
-running Swift on Beagle. A more detailed information about Swift and its
+them in the queueing system for execution.
+
+The computational model requires a user to prepare the submit files, track job
+submissions, chackpointing, managing input/output data and handling exceptional
+conditions manually. Running Swift under Beagle can accomplish the above tasks
+with least manual user intervention and maximal oppurtunistic computation time
+on Beagle queues. In the following sections, we discuss more about specifics
+of running Swift on Beagle. A more detailed information about Swift and its
workings can be found on Swift documentation page here:
+
+----
http://www.ci.uchicago.edu/swift/wwwdev/docs/index.php
+----
+
More information on Beagle can be found on UChicago Beagle website here:
+
+----
http://beagle.ci.uchicago.edu
+----
Requesting Access
~~~~~~~~~~~~~~~~~
-If you do not already have a Computation Institute account, you can request
-one at https://www.ci.uchicago.edu/accounts/. This page will give you a list
-of resources you can request access to.
-You already have an existing CI account, but do not have access to Beagle,
+
+If you do not already have a Computation Institute (CI) account, you can
+request one at https://www.ci.uchicago.edu/accounts/. This page will give you a
+list of resources you can request access to.
+
+If you already have an existing CI account, but do not have access to Beagle,
send an email to support at ci.uchicago.edu to request access.
Connecting to a login node
@@ -32,9 +42,11 @@
ssh yourusername at login.beagle.ci.uchicago.edu
-----
+Getting Started with Swift
+~~~~~~~~~~~~~~~~~~~~~~~~~~
Follow the steps outlined below to get started with Swift on Beagle:
-*step 1.* Load the Swift module on Beagle as follows: +module load swift+
+*step 1.* Load the Swift and Sun-java module on Beagle as follows: +module load swift sun-java+
*step 2.* Create and change to a directory where your Swift related work will
stay. (say, +mkdir swift-lab+, followed by, +cd swift-lab+)
@@ -45,7 +57,7 @@
-----
type file;
-/* App definitio */
+/* App definition */
app (file o) cat (file i)
{
cat @i stdout=@o;
@@ -190,8 +202,9 @@
The most likely cause is the module is not loaded. Do the following to load the Swift module:
-----
-$ module load swift
-Swift version swift-0.93RC5 loaded
+$ module load swift sun-java
+Swift version swift-0.93 loaded
+sun-java version jdk1.7.0_02 loaded
-----
* Failed to transfer wrapperlog for job cat-nmobtbkk and/or Job failed with an exit code of 254. Check the element on the sites.xml file.
From davidk at ci.uchicago.edu Mon Mar 11 06:07:19 2013
From: davidk at ci.uchicago.edu (davidk at ci.uchicago.edu)
Date: Mon, 11 Mar 2013 06:07:19 -0500 (CDT)
Subject: [Swift-commit] r6363 - trunk/bin
Message-ID: <20130311110719.259339CC97@svn.ci.uchicago.edu>
Author: davidk
Date: 2013-03-11 06:07:17 -0500 (Mon, 11 Mar 2013)
New Revision: 6363
Modified:
trunk/bin/gensites
trunk/bin/swiftrun
Log:
Make swiftrun work with multiple sites
Modified: trunk/bin/gensites
===================================================================
--- trunk/bin/gensites 2013-03-10 19:35:03 UTC (rev 6362)
+++ trunk/bin/gensites 2013-03-11 11:07:17 UTC (rev 6363)
@@ -151,9 +151,9 @@
# Setup for creating a TC file
if [ -f "$PROPERTIES_FILE" ]; then
if [ -n "`grep -e app $PROPERTIES_FILE`" ]; then
- if [ -f "tc.data" ]; then
- mv tc.data tc.data.old
- fi
+ #if [ -f "tc.data" ]; then
+ # mv tc.data tc.data.old
+ #fi
HOSTS=`grep -i "pool handle" $TEMPLATE_PATH|grep -v "^[[:space:]]*#"|cut -d'"' -f2`
fi
fi
Modified: trunk/bin/swiftrun
===================================================================
--- trunk/bin/swiftrun 2013-03-10 19:35:03 UTC (rev 6362)
+++ trunk/bin/swiftrun 2013-03-11 11:07:17 UTC (rev 6363)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/bash -x
# Verify an argument is not null
verify_not_null()
@@ -77,14 +77,17 @@
echo "" > sites.xml
for site in $SITES
do
+ echo SITE IS $site
+ echo FILE IS ../conf/$site.cf
# If config is not defined, but there is a config in conf/ that matches, use that
if [ -z "$CONFIG" ] && [ -f "../conf/$site.cf" ]; then
cp ../conf/$site.cf .
- CONFIG=$site.cf
- fi
+ config=$site.cf
+ echo config IS $config
+ fi
- if [ -f "$CONFIG" ]; then
- gensites -p $CONFIG $site >> sites.xml
+ if [ -f "$config" ]; then
+ gensites -p $config $site >> sites.xml
else
gensites $site >> sites.xml
fi
@@ -92,6 +95,9 @@
done
echo " " >> sites.xml
+if [ -z "$CONFIG" ]; then
+ CONFIG=$config
+fi
# Run
timestamp=$( date +%s )
From davidk at ci.uchicago.edu Mon Mar 11 06:11:52 2013
From: davidk at ci.uchicago.edu (davidk at ci.uchicago.edu)
Date: Mon, 11 Mar 2013 06:11:52 -0500 (CDT)
Subject: [Swift-commit] r6364 - branches/release-0.94/bin
Message-ID: <20130311111152.AAA9D9CC97@svn.ci.uchicago.edu>
Author: davidk
Date: 2013-03-11 06:11:52 -0500 (Mon, 11 Mar 2013)
New Revision: 6364
Modified:
branches/release-0.94/bin/gensites
branches/release-0.94/bin/swiftrun
Log:
swiftrun for combining multiple sites
Modified: branches/release-0.94/bin/gensites
===================================================================
--- branches/release-0.94/bin/gensites 2013-03-11 11:07:17 UTC (rev 6363)
+++ branches/release-0.94/bin/gensites 2013-03-11 11:11:52 UTC (rev 6364)
@@ -151,9 +151,9 @@
# Setup for creating a TC file
if [ -f "$PROPERTIES_FILE" ]; then
if [ -n "`grep -e app $PROPERTIES_FILE`" ]; then
- if [ -f "tc.data" ]; then
- mv tc.data tc.data.old
- fi
+ #if [ -f "tc.data" ]; then
+ # mv tc.data tc.data.old
+ #fi
HOSTS=`grep -i "pool handle" $TEMPLATE_PATH|grep -v "^[[:space:]]*#"|cut -d'"' -f2`
fi
fi
Modified: branches/release-0.94/bin/swiftrun
===================================================================
--- branches/release-0.94/bin/swiftrun 2013-03-11 11:07:17 UTC (rev 6363)
+++ branches/release-0.94/bin/swiftrun 2013-03-11 11:11:52 UTC (rev 6364)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/bash
# Verify an argument is not null
verify_not_null()
@@ -80,11 +80,11 @@
# If config is not defined, but there is a config in conf/ that matches, use that
if [ -z "$CONFIG" ] && [ -f "../conf/$site.cf" ]; then
cp ../conf/$site.cf .
- CONFIG=$site.cf
- fi
+ config=$site.cf
+ fi
- if [ -f "$CONFIG" ]; then
- gensites -p $CONFIG $site >> sites.xml
+ if [ -f "$config" ]; then
+ gensites -p $config $site >> sites.xml
else
gensites $site >> sites.xml
fi
@@ -92,6 +92,9 @@
done
echo "" >> sites.xml
+if [ -z "$CONFIG" ]; then
+ CONFIG=$config
+fi
# Run
timestamp=$( date +%s )
From davidk at ci.uchicago.edu Mon Mar 11 10:16:06 2013
From: davidk at ci.uchicago.edu (davidk at ci.uchicago.edu)
Date: Mon, 11 Mar 2013 10:16:06 -0500 (CDT)
Subject: [Swift-commit] r6365 - SwiftTutorials
Message-ID: <20130311151606.A5E919CCB3@svn.ci.uchicago.edu>
Author: davidk
Date: 2013-03-11 10:16:05 -0500 (Mon, 11 Mar 2013)
New Revision: 6365
Added:
SwiftTutorials/OSG_2013-03-11/
Log:
Workspace for osg talk
From davidk at ci.uchicago.edu Mon Mar 11 11:02:31 2013
From: davidk at ci.uchicago.edu (davidk at ci.uchicago.edu)
Date: Mon, 11 Mar 2013 11:02:31 -0500 (CDT)
Subject: [Swift-commit] r6366 - in SwiftTutorials/OSG_2013-03-11: . GS
GS/conf
Message-ID: <20130311160231.0FEA09CCB3@svn.ci.uchicago.edu>
Author: davidk
Date: 2013-03-11 11:02:30 -0500 (Mon, 11 Mar 2013)
New Revision: 6366
Added:
SwiftTutorials/OSG_2013-03-11/GS/
SwiftTutorials/OSG_2013-03-11/GS/GS.swift
SwiftTutorials/OSG_2013-03-11/GS/Group_Simulation
SwiftTutorials/OSG_2013-03-11/GS/clean.sh
SwiftTutorials/OSG_2013-03-11/GS/conf/
SwiftTutorials/OSG_2013-03-11/GS/conf/beagle-ssh.cf
SwiftTutorials/OSG_2013-03-11/GS/conf/beagle.cf
SwiftTutorials/OSG_2013-03-11/GS/conf/fusion.cf
SwiftTutorials/OSG_2013-03-11/GS/conf/local-coasters.cf
SwiftTutorials/OSG_2013-03-11/GS/conf/local.cf
SwiftTutorials/OSG_2013-03-11/GS/conf/midway.cf
SwiftTutorials/OSG_2013-03-11/GS/conf/raven.cf
SwiftTutorials/OSG_2013-03-11/GS/conf/stampede.cf
SwiftTutorials/OSG_2013-03-11/GS/run_GS.sh
Log:
GS example with script and executable staged in
Added: SwiftTutorials/OSG_2013-03-11/GS/GS.swift
===================================================================
--- SwiftTutorials/OSG_2013-03-11/GS/GS.swift (rev 0)
+++ SwiftTutorials/OSG_2013-03-11/GS/GS.swift 2013-03-11 16:02:30 UTC (rev 6366)
@@ -0,0 +1,26 @@
+type file;
+
+app (file output) GS (float Tolerance_Ratio, int Dimensions, int Nagents, int RunNumber, file gs_binary, file gs_script)
+{
+ bash @filename(gs_script) Tolerance_Ratio Dimensions Nagents RunNumber @filename(gs_binary) stdout=@filename(output);
+}
+
+float [] tol_ratio=[0.40];
+int [] Dim=[1];
+int [] NA=[10];
+int [] repetitions = [1:1];
+
+file simulation_binary <"/scratch/midway/davidkelly999/GS/Group_Simulation">;
+file simulation_script <"/scratch/midway/davidkelly999/GS/run_GS.sh">;
+
+foreach Tol in tol_ratio {
+ foreach D in Dim {
+ foreach na in NA {
+ foreach rep in repetitions {
+ file outfile ;
+ outfile = GS (Tol, D, na, rep, simulation_binary, simulation_script);
+ }
+ }
+ }
+}
+
Added: SwiftTutorials/OSG_2013-03-11/GS/Group_Simulation
===================================================================
(Binary files differ)
Property changes on: SwiftTutorials/OSG_2013-03-11/GS/Group_Simulation
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mime-type
+ application/octet-stream
Added: SwiftTutorials/OSG_2013-03-11/GS/clean.sh
===================================================================
--- SwiftTutorials/OSG_2013-03-11/GS/clean.sh (rev 0)
+++ SwiftTutorials/OSG_2013-03-11/GS/clean.sh 2013-03-11 16:02:30 UTC (rev 6366)
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+rm -rf run*/
Property changes on: SwiftTutorials/OSG_2013-03-11/GS/clean.sh
___________________________________________________________________
Added: svn:executable
+ *
Added: SwiftTutorials/OSG_2013-03-11/GS/conf/beagle-ssh.cf
===================================================================
--- SwiftTutorials/OSG_2013-03-11/GS/conf/beagle-ssh.cf (rev 0)
+++ SwiftTutorials/OSG_2013-03-11/GS/conf/beagle-ssh.cf 2013-03-11 16:02:30 UTC (rev 6366)
@@ -0,0 +1,16 @@
+wrapperlog.always.transfer=true
+sitedir.keep=true
+execution.retries=0
+status.mode=provider
+use.provider.staging=true
+provider.staging.pin.swiftfiles=false
+
+#site beagle-ssh WALLTIME=00:05:00
+
+#app getlanduse=/lustre/beagle/davidk/modis/bin/getlanduse.sh
+#app analyzelanduse=/lustre/beagle/davidk/modis/bin/analyzelanduse.sh
+#app colormodis=/lustre/beagle/davidk/modis/bin/colormodis.sh
+#app assemble=/lustre/beagle/davidk/modis/bin/assemble.sh
+#app markmap=/lustre/beagle/davidk/modis/bin/markmap.sh
+#app echo=/bin/echo
+#app perl=/usr/bin/perl
Added: SwiftTutorials/OSG_2013-03-11/GS/conf/beagle.cf
===================================================================
--- SwiftTutorials/OSG_2013-03-11/GS/conf/beagle.cf (rev 0)
+++ SwiftTutorials/OSG_2013-03-11/GS/conf/beagle.cf 2013-03-11 16:02:30 UTC (rev 6366)
@@ -0,0 +1,15 @@
+wrapperlog.always.transfer=true
+sitedir.keep=true
+execution.retries=0
+status.mode=provider
+use.provider.staging=false
+provider.staging.pin.swiftfiles=false
+
+#site beagle WALLTIME=00:05:00
+
+#app getlanduse=$PWD/../bin/getlanduse.sh
+#app analyzelanduse=$PWD/../bin/analyzelanduse.sh
+#app colormodis=$PWD/../bin/colormodis.sh
+#app assemble=$PWD/../bin/assemble.sh
+#app markmap=$PWD/../bin/markmap.sh
+#app echo=/bin/echo
Added: SwiftTutorials/OSG_2013-03-11/GS/conf/fusion.cf
===================================================================
--- SwiftTutorials/OSG_2013-03-11/GS/conf/fusion.cf (rev 0)
+++ SwiftTutorials/OSG_2013-03-11/GS/conf/fusion.cf 2013-03-11 16:02:30 UTC (rev 6366)
@@ -0,0 +1,14 @@
+wrapperlog.always.transfer=true
+sitedir.keep=true
+execution.retries=0
+lazy.errors=false
+status.mode=provider
+use.provider.staging=false
+provider.staging.pin.swiftfiles=false
+
+#app getlanduse=$PWD/../bin/getlanduse.sh
+#app analyzelanduse=$PWD/../bin/analyzelanduse.sh
+#app colormodis=$PWD/../bin/colormodis.sh
+#app assemble=$PWD/../bin/assemble.sh
+#app markmap=$PWD/../bin/markmap.sh
+#app echo=/bin/echo
Added: SwiftTutorials/OSG_2013-03-11/GS/conf/local-coasters.cf
===================================================================
--- SwiftTutorials/OSG_2013-03-11/GS/conf/local-coasters.cf (rev 0)
+++ SwiftTutorials/OSG_2013-03-11/GS/conf/local-coasters.cf 2013-03-11 16:02:30 UTC (rev 6366)
@@ -0,0 +1,15 @@
+wrapperlog.always.transfer=true
+sitedir.keep=true
+execution.retries=0
+lazy.errors=false
+status.mode=provider
+use.provider.staging=false
+provider.staging.pin.swiftfiles=false
+#site local-coasters JOBTHROTTLE=0.038
+
+#app getlanduse=$PWD/../bin/getlanduse.sh
+#app analyzelanduse=$PWD/../bin/analyzelanduse.sh
+#app colormodis=$PWD/../bin/colormodis.sh
+#app assemble=$PWD/../bin/assemble.sh
+#app markmap=$PWD/../bin/markmap.sh
+#app echo=/bin/echo
Added: SwiftTutorials/OSG_2013-03-11/GS/conf/local.cf
===================================================================
--- SwiftTutorials/OSG_2013-03-11/GS/conf/local.cf (rev 0)
+++ SwiftTutorials/OSG_2013-03-11/GS/conf/local.cf 2013-03-11 16:02:30 UTC (rev 6366)
@@ -0,0 +1,10 @@
+wrapperlog.always.transfer=true
+sitedir.keep=true
+execution.retries=5
+lazy.errors=false
+status.mode=provider
+use.provider.staging=false
+provider.staging.pin.swiftfiles=false
+
+#site local JOBTHROTTLE=0.038
+#app bash=/bin/bash
Added: SwiftTutorials/OSG_2013-03-11/GS/conf/midway.cf
===================================================================
--- SwiftTutorials/OSG_2013-03-11/GS/conf/midway.cf (rev 0)
+++ SwiftTutorials/OSG_2013-03-11/GS/conf/midway.cf 2013-03-11 16:02:30 UTC (rev 6366)
@@ -0,0 +1,13 @@
+wrapperlog.always.transfer=true
+sitedir.keep=true
+execution.retries=0
+lazy.errors=false
+status.mode=provider
+use.provider.staging=false
+provider.staging.pin.swiftfiles=false
+
+#site midway WALLTIME=00:05:00
+
+#app bash=/bin/bash
+#app perl=/usr/bin/perl
+
Added: SwiftTutorials/OSG_2013-03-11/GS/conf/raven.cf
===================================================================
--- SwiftTutorials/OSG_2013-03-11/GS/conf/raven.cf (rev 0)
+++ SwiftTutorials/OSG_2013-03-11/GS/conf/raven.cf 2013-03-11 16:02:30 UTC (rev 6366)
@@ -0,0 +1,15 @@
+wrapperlog.always.transfer=true
+sitedir.keep=true
+execution.retries=0
+status.mode=provider
+use.provider.staging=false
+provider.staging.pin.swiftfiles=false
+
+#site raven PROJECT=CI-SES000031
+
+#app getlanduse=$PWD/../bin/getlanduse.sh
+#app analyzelanduse=$PWD/../bin/analyzelanduse.sh
+#app colormodis=$PWD/../bin/colormodis.sh
+#app assemble=$PWD/../bin/assemble.sh
+#app markmap=$PWD/../bin/markmap.sh
+#app echo=/bin/echo
Added: SwiftTutorials/OSG_2013-03-11/GS/conf/stampede.cf
===================================================================
--- SwiftTutorials/OSG_2013-03-11/GS/conf/stampede.cf (rev 0)
+++ SwiftTutorials/OSG_2013-03-11/GS/conf/stampede.cf 2013-03-11 16:02:30 UTC (rev 6366)
@@ -0,0 +1,17 @@
+wrapperlog.always.transfer=true
+sitedir.keep=true
+execution.retries=1
+lazy.errors=true
+status.mode=provider
+use.provider.staging=false
+provider.staging.pin.swiftfiles=false
+
+#site stampede WALLTIME=00:15:00
+
+#app getlanduse=$PWD/../bin/getlanduse.sh
+#app analyzelanduse=$PWD/../bin/analyzelanduse.sh
+#app colormodis=$PWD/../bin/colormodis.sh
+#app assemble=$PWD/../bin/assemble.sh
+#app markmap=$PWD/../bin/markmap.sh
+#app echo=/bin/echo
+
Added: SwiftTutorials/OSG_2013-03-11/GS/run_GS.sh
===================================================================
--- SwiftTutorials/OSG_2013-03-11/GS/run_GS.sh (rev 0)
+++ SwiftTutorials/OSG_2013-03-11/GS/run_GS.sh 2013-03-11 16:02:30 UTC (rev 6366)
@@ -0,0 +1,19 @@
+#!/bin/bash
+Tolerance_Ratio=$1
+Dimensions=$2
+Nagents=$3
+Run_Number=$4
+executable=$5
+
+#define rarely changing variables
+Groups=0
+debug=0
+Output="grouping"
+stopAt=1000
+
+rundirname="Tolerance_Ratio_"${Tolerance_Ratio}/"Dim_"${Dimensions}/"NAgents_"$Nagents
+chmod +x $executable
+
+START=$SECONDS
+$executable $Tolerance_Ratio $Dimensions $Nagents $stopAt $Groups $Run_Number $debug $Output 2>&1
+echo $(( $SECONDS - $START )) 1>&2
Property changes on: SwiftTutorials/OSG_2013-03-11/GS/run_GS.sh
___________________________________________________________________
Added: svn:executable
+ *
From ketan at ci.uchicago.edu Mon Mar 11 11:21:08 2013
From: ketan at ci.uchicago.edu (ketan at ci.uchicago.edu)
Date: Mon, 11 Mar 2013 11:21:08 -0500 (CDT)
Subject: [Swift-commit] r6367 - trunk/docs/userguide
Message-ID: <20130311162108.C3F099CC97@svn.ci.uchicago.edu>
Author: ketan
Date: 2013-03-11 11:21:08 -0500 (Mon, 11 Mar 2013)
New Revision: 6367
Modified:
trunk/docs/userguide/overview
Log:
link fix
Modified: trunk/docs/userguide/overview
===================================================================
--- trunk/docs/userguide/overview 2013-03-11 16:02:30 UTC (rev 6366)
+++ trunk/docs/userguide/overview 2013-03-11 16:21:08 UTC (rev 6367)
@@ -3,18 +3,17 @@
This manual provides reference material for Swift: the Swift
language and the Swift runtime system. For introductory material,
consult the Swift tutorial
-.
+http://www.ci.uchicago.edu/swift/guides/trunk/tutorial/tutorial.html
-Swift is a data-oriented coarse grained scripting language that supports
+Swift is a data-flow oriented coarse grained scripting language that supports
dataset typing and mapping, dataset iteration, conditional branching,
and procedural composition.
Swift programs (or workflows) are written in a language called
-Swift scripts.
+Swift script.
-Swift scripts are dataflow oriented - they are primarily
-concerned with processing (possibly large) collections of data files, by
-invoking programs to do that processing. Swift handles execution of such
-programs on remote sites by choosing sites, handling the staging of
-input and output files to and from the chosen sites and remote execution
-of program code.
+Swift scripts are primarily concerned with processing (possibly large)
+collections of data files, by invoking programs to do that processing. Swift
+handles execution of such programs on remote sites by choosing sites, handling
+the staging of input and output files to and from the chosen sites and remote
+execution of program code.
From ketan at ci.uchicago.edu Mon Mar 11 11:41:59 2013
From: ketan at ci.uchicago.edu (ketan at ci.uchicago.edu)
Date: Mon, 11 Mar 2013 11:41:59 -0500 (CDT)
Subject: [Swift-commit] r6368 - SwiftApps/modis
Message-ID: <20130311164159.5A67B9CC97@svn.ci.uchicago.edu>
Author: ketan
Date: 2013-03-11 11:41:59 -0500 (Mon, 11 Mar 2013)
New Revision: 6368
Modified:
SwiftApps/modis/README
Log:
update README
Modified: SwiftApps/modis/README
===================================================================
--- SwiftApps/modis/README 2013-03-11 16:21:08 UTC (rev 6367)
+++ SwiftApps/modis/README 2013-03-11 16:41:59 UTC (rev 6368)
@@ -8,8 +8,8 @@
To download the image data, run:
$ cd modis/data/modis/2002
-$ wget http://www.ci.uchicago.edu/swift/modis/modis-2002.tar
-$ tar xf modis-2002.tar
+$ wget http://www.ci.uchicago.edu/swift/modis/modis-2002.tar.gz
+$ tar -zxf modis-2002.tar.gz
Hello world
-----------
From davidk at ci.uchicago.edu Mon Mar 11 11:59:37 2013
From: davidk at ci.uchicago.edu (davidk at ci.uchicago.edu)
Date: Mon, 11 Mar 2013 11:59:37 -0500 (CDT)
Subject: [Swift-commit] r6369 - SwiftTutorials/OSG_2013-03-11/GS
Message-ID: <20130311165937.17C039CC97@svn.ci.uchicago.edu>
Author: davidk
Date: 2013-03-11 11:59:36 -0500 (Mon, 11 Mar 2013)
New Revision: 6369
Modified:
SwiftTutorials/OSG_2013-03-11/GS/GS.swift
SwiftTutorials/OSG_2013-03-11/GS/run_GS.sh
Log:
22k tasks per invocation, make sure time goes to stdout
Modified: SwiftTutorials/OSG_2013-03-11/GS/GS.swift
===================================================================
--- SwiftTutorials/OSG_2013-03-11/GS/GS.swift 2013-03-11 16:41:59 UTC (rev 6368)
+++ SwiftTutorials/OSG_2013-03-11/GS/GS.swift 2013-03-11 16:59:36 UTC (rev 6369)
@@ -5,10 +5,10 @@
bash @filename(gs_script) Tolerance_Ratio Dimensions Nagents RunNumber @filename(gs_binary) stdout=@filename(output);
}
-float [] tol_ratio=[0.40];
-int [] Dim=[1];
-int [] NA=[10];
-int [] repetitions = [1:1];
+float [] tol_ratio=[0.40,0.41,0.42,0.43,0.44,0.45,0.46,0.47,0.48,0.49,0.50];
+int [] Dim=[1,2,3,4,5];
+int [] NA=[10, 100, 1000, 10000];
+int [] repetitions = [1:100];
file simulation_binary <"/scratch/midway/davidkelly999/GS/Group_Simulation">;
file simulation_script <"/scratch/midway/davidkelly999/GS/run_GS.sh">;
Modified: SwiftTutorials/OSG_2013-03-11/GS/run_GS.sh
===================================================================
--- SwiftTutorials/OSG_2013-03-11/GS/run_GS.sh 2013-03-11 16:41:59 UTC (rev 6368)
+++ SwiftTutorials/OSG_2013-03-11/GS/run_GS.sh 2013-03-11 16:59:36 UTC (rev 6369)
@@ -16,4 +16,4 @@
START=$SECONDS
$executable $Tolerance_Ratio $Dimensions $Nagents $stopAt $Groups $Run_Number $debug $Output 2>&1
-echo $(( $SECONDS - $START )) 1>&2
+echo $(( $SECONDS - $START )) 2>&1
From hategan at ci.uchicago.edu Mon Mar 11 14:58:59 2013
From: hategan at ci.uchicago.edu (hategan at ci.uchicago.edu)
Date: Mon, 11 Mar 2013 14:58:59 -0500 (CDT)
Subject: [Swift-commit] r6370 - in branches/faster: libexec resources
src/org/griphyn/vdl/engine src/org/griphyn/vdl/karajan/lib
Message-ID: <20130311195859.D6DA29CC97@svn.ci.uchicago.edu>
Author: hategan
Date: 2013-03-11 14:58:59 -0500 (Mon, 11 Mar 2013)
New Revision: 6370
Added:
branches/faster/src/org/griphyn/vdl/karajan/lib/RefCount.java
branches/faster/src/org/griphyn/vdl/karajan/lib/StaticRefCount.java
branches/faster/src/org/griphyn/vdl/karajan/lib/While.java
Modified:
branches/faster/libexec/swift-lib.k
branches/faster/libexec/swift-operators.k
branches/faster/resources/Karajan.stg
branches/faster/src/org/griphyn/vdl/engine/Karajan.java
branches/faster/src/org/griphyn/vdl/karajan/lib/Operators.java
branches/faster/src/org/griphyn/vdl/karajan/lib/ThrottledParallelFor.java
Log:
fixed iterate
Modified: branches/faster/libexec/swift-lib.k
===================================================================
--- branches/faster/libexec/swift-lib.k 2013-03-11 16:59:36 UTC (rev 6369)
+++ branches/faster/libexec/swift-lib.k 2013-03-11 19:58:59 UTC (rev 6370)
@@ -119,6 +119,7 @@
export(tParallelFor, def("org.griphyn.vdl.karajan.lib.ThrottledParallelFor"))
export(throttled, def("org.griphyn.vdl.karajan.lib.Throttled"))
+ export(while, def("org.griphyn.vdl.karajan.lib.While"))
export(appStageins, def("org.griphyn.vdl.karajan.lib.AppStageins"))
export(appStageouts, def("org.griphyn.vdl.karajan.lib.AppStageouts"))
Modified: branches/faster/libexec/swift-operators.k
===================================================================
--- branches/faster/libexec/swift-operators.k 2013-03-11 16:59:36 UTC (rev 6369)
+++ branches/faster/libexec/swift-operators.k 2013-03-11 19:58:59 UTC (rev 6370)
@@ -14,4 +14,6 @@
export(and, def("org.griphyn.vdl.karajan.lib.Operators$And"))
export(or, def("org.griphyn.vdl.karajan.lib.Operators$Or"))
export(not, def("org.griphyn.vdl.karajan.lib.Operators$Not"))
+
+ export(inc, def("org.griphyn.vdl.karajan.lib.Operators$Inc"))
}
\ No newline at end of file
Modified: branches/faster/resources/Karajan.stg
===================================================================
--- branches/faster/resources/Karajan.stg 2013-03-11 16:59:36 UTC (rev 6369)
+++ branches/faster/resources/Karajan.stg 2013-03-11 19:58:59 UTC (rev 6370)
@@ -196,17 +196,17 @@
)
>>
-iterate(declarations,statements,cond,var,cleanups,trace,line) ::= <<
-sys:while($var$, 0) {
+iterate(declarations, statements, cond, var, refs, cleanups, trace, line) ::= <<
+swift:while($var$$if(trace)$, _traceline="$line$"$endif$$if(refs)$, refs="$refs;separator=" "$"$endif$) {
if (swift:getFieldValue($cond$)) {
$sub_comp(declarations=declarations, statements=statements, cleanups=cleanups)$
- next($var$ + 1)
+ next(swiftop:inc($var$))
}
}
>>
foreach(var, in, indexVar, indexVarType, declarations, statements, line, refs, selfClose, cleanups, trace) ::= <<
-swift:tParallelFor(\$, _traceline="$line$"$if(indexVar)$, _kvar="$indexVar$"$endif$, _vvar="$var$"$if(selfClose)$, selfClose=true$endif$$if(refs)$, refs="$refs;separator=" "$"$endif$,
+swift:tParallelFor(\$$if(trace)$, _traceline="$line$"$endif$$if(indexVar)$, _kvar="$indexVar$"$endif$, _vvar="$var$"$if(selfClose)$, selfClose=true$endif$$if(refs)$, refs="$refs;separator=" "$"$endif$,
$! The iterator !$
getArrayIterator($in$)) {
(\$\$, $var$) := each(\$)
Modified: branches/faster/src/org/griphyn/vdl/engine/Karajan.java
===================================================================
--- branches/faster/src/org/griphyn/vdl/engine/Karajan.java 2013-03-11 16:59:36 UTC (rev 6369)
+++ branches/faster/src/org/griphyn/vdl/engine/Karajan.java 2013-03-11 19:58:59 UTC (rev 6370)
@@ -916,7 +916,7 @@
}
public void iterateStat(Iterate iterate, VariableScope scope) throws CompilationException {
- VariableScope loopScope = new VariableScope(this, scope, EnclosureType.LOOP, iterate);
+ VariableScope loopScope = new VariableScope(this, scope, EnclosureType.ALL, iterate);
VariableScope innerScope = new VariableScope(this, loopScope, EnclosureType.LOOP, iterate);
loopScope.addVariable(iterate.getVar(), "int", "Iteration variable", iterate);
Modified: branches/faster/src/org/griphyn/vdl/karajan/lib/Operators.java
===================================================================
--- branches/faster/src/org/griphyn/vdl/karajan/lib/Operators.java 2013-03-11 16:59:36 UTC (rev 6369)
+++ branches/faster/src/org/griphyn/vdl/karajan/lib/Operators.java 2013-03-11 19:58:59 UTC (rev 6370)
@@ -67,7 +67,7 @@
return ((Integer) v).intValue();
}
else {
- throw new ExecutionException(n, "Internal error. Expected an int: " + h);
+ throw new ExecutionException(n, "Internal error. Expected an int: " + v + " (" + h + ")");
}
}
@@ -265,6 +265,14 @@
return r;
}
}
+
+ public static class Inc extends SwiftUnaryOp {
+ @Override
+ protected DSHandle value(AbstractDataNode v) {
+ DSHandle r = new RootDataNode(Types.INT, getInt(this, v) + 1);
+ return r;
+ }
+ }
private static void logBinaryProvenance(String name, DSHandle v1, DSHandle v2, DSHandle result) throws ExecutionException {
if (PROVENANCE_ENABLED) {
Added: branches/faster/src/org/griphyn/vdl/karajan/lib/RefCount.java
===================================================================
--- branches/faster/src/org/griphyn/vdl/karajan/lib/RefCount.java (rev 0)
+++ branches/faster/src/org/griphyn/vdl/karajan/lib/RefCount.java 2013-03-11 19:58:59 UTC (rev 6370)
@@ -0,0 +1,55 @@
+//----------------------------------------------------------------------
+//This code is developed as part of the Java CoG Kit project
+//The terms of the license can be found at http://www.cogkit.org/license
+//This message may not be removed or altered.
+//----------------------------------------------------------------------
+
+/*
+ * Created on Mar 11, 2013
+ */
+package org.griphyn.vdl.karajan.lib;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import k.rt.ExecutionException;
+import k.rt.Stack;
+
+import org.griphyn.vdl.mapping.DSHandle;
+
+class RefCount {
+ public final DSHandle var;
+ public final int count;
+
+ public RefCount(DSHandle var, int count) {
+ this.var = var;
+ this.count = count;
+ }
+
+ public static List build(Stack stack, List srefs) {
+ if (srefs == null) {
+ return null;
+ }
+ List l = new ArrayList(srefs.size());
+ for (StaticRefCount s : srefs) {
+ l.add(new RefCount((DSHandle) s.ref.getValue(stack), s.count));
+ }
+ return l;
+ }
+
+ public static void decRefs(List rcs) throws ExecutionException {
+ if (rcs != null) {
+ for (RefCount rc : rcs) {
+ rc.var.updateWriteRefCount(-rc.count);
+ }
+ }
+ }
+
+ public static void incRefs(List rcs) throws ExecutionException {
+ if (rcs != null) {
+ for (RefCount rc : rcs) {
+ rc.var.updateWriteRefCount(rc.count);
+ }
+ }
+ }
+}
\ No newline at end of file
Added: branches/faster/src/org/griphyn/vdl/karajan/lib/StaticRefCount.java
===================================================================
--- branches/faster/src/org/griphyn/vdl/karajan/lib/StaticRefCount.java (rev 0)
+++ branches/faster/src/org/griphyn/vdl/karajan/lib/StaticRefCount.java 2013-03-11 19:58:59 UTC (rev 6370)
@@ -0,0 +1,48 @@
+//----------------------------------------------------------------------
+//This code is developed as part of the Java CoG Kit project
+//The terms of the license can be found at http://www.cogkit.org/license
+//This message may not be removed or altered.
+//----------------------------------------------------------------------
+
+/*
+ * Created on Mar 11, 2013
+ */
+package org.griphyn.vdl.karajan.lib;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.StringTokenizer;
+
+import org.globus.cog.karajan.analyzer.Scope;
+import org.globus.cog.karajan.analyzer.VarRef;
+
+class StaticRefCount {
+ public final VarRef> ref;
+ public final int count;
+
+ public StaticRefCount(VarRef> ref, int count) {
+ this.ref = ref;
+ this.count = count;
+ }
+
+ public static List build(Scope scope, String refs) {
+ if (refs == null) {
+ return null;
+ }
+ List l = new ArrayList();
+ String name = null;
+ boolean flip = true;
+ StringTokenizer st = new StringTokenizer(refs);
+ while (st.hasMoreTokens()) {
+ if (flip) {
+ name = st.nextToken();
+ }
+ else {
+ int count = Integer.parseInt(st.nextToken());
+ l.add(new StaticRefCount(scope.getVarRef(name), count));
+ }
+ flip = !flip;
+ }
+ return l;
+ }
+}
\ No newline at end of file
Modified: branches/faster/src/org/griphyn/vdl/karajan/lib/ThrottledParallelFor.java
===================================================================
--- branches/faster/src/org/griphyn/vdl/karajan/lib/ThrottledParallelFor.java 2013-03-11 16:59:36 UTC (rev 6369)
+++ branches/faster/src/org/griphyn/vdl/karajan/lib/ThrottledParallelFor.java 2013-03-11 19:58:59 UTC (rev 6370)
@@ -18,10 +18,8 @@
package org.griphyn.vdl.karajan.lib;
import java.io.IOException;
-import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
-import java.util.StringTokenizer;
import k.rt.ConditionalYield;
import k.rt.ExecutionException;
@@ -40,13 +38,11 @@
import org.globus.cog.karajan.analyzer.CompilerSettings;
import org.globus.cog.karajan.analyzer.Scope;
import org.globus.cog.karajan.analyzer.Signature;
-import org.globus.cog.karajan.analyzer.VarRef;
import org.globus.cog.karajan.compiled.nodes.Node;
import org.globus.cog.karajan.compiled.nodes.UParallelFor;
import org.globus.cog.karajan.parser.WrapperNode;
import org.globus.cog.karajan.util.TypeUtil;
import org.griphyn.vdl.karajan.Pair;
-import org.griphyn.vdl.mapping.DSHandle;
import org.griphyn.vdl.util.VDL2Config;
public class ThrottledParallelFor extends UParallelFor {
@@ -79,38 +75,10 @@
private Tracer forTracer, iterationTracer;
private List srefs;
- private static class StaticRefCount {
- public final VarRef> ref;
- public final int count;
-
- public StaticRefCount(VarRef> ref, int count) {
- this.ref = ref;
- this.count = count;
- }
- }
-
- private static class RefCount {
- public final DSHandle var;
- public final int count;
-
- public RefCount(DSHandle var, int count) {
- this.var = var;
- this.count = count;
- }
-
- public void inc() {
-
- }
-
- public void dec() {
-
- }
- }
-
@Override
protected Node compileBody(WrapperNode w, Scope argScope, Scope scope)
throws CompilationException {
- srefs = buildStaticRefs(scope);
+ srefs = StaticRefCount.build(scope, this.refs.getValue());
if (_traceline.getValue() != null) {
setLine(Integer.parseInt(_traceline.getValue()));
}
@@ -119,40 +87,7 @@
sc = selfClose.getValue();
return super.compileBody(w, argScope, scope);
}
-
- private List buildStaticRefs(Scope scope) {
- String refs = this.refs.getValue();
- if (refs == null) {
- return null;
- }
- List l = new ArrayList();
- String name = null;
- boolean flip = true;
- StringTokenizer st = new StringTokenizer(refs);
- while (st.hasMoreTokens()) {
- if (flip) {
- name = st.nextToken();
- }
- else {
- int count = Integer.parseInt(st.nextToken());
- l.add(new StaticRefCount(scope.getVarRef(name), count));
- }
- flip = !flip;
- }
- return l;
- }
- private List buildRefs(Stack stack) {
- if (srefs == null) {
- return null;
- }
- List l = new ArrayList(srefs.size());
- for (StaticRefCount s : srefs) {
- l.add(new RefCount((DSHandle) s.ref.getValue(stack), s.count));
- }
- return l;
- }
-
@SuppressWarnings("unchecked")
@Override
protected void runBody(final LWThread thr) {
@@ -173,7 +108,7 @@
ts = new TPFThreadSet(it, getMaxThreads());
}
- drefs = buildRefs(stack);
+ drefs = RefCount.build(stack, srefs);
ts.lock();
fc = stack.frameCount() + 1;
@@ -191,7 +126,7 @@
startRest(thr, ts, fc, drefs);
ts.unlock();
- decRefs(drefs);
+ RefCount.decRefs(drefs);
i++;
case 2:
ts.waitFor();
@@ -242,7 +177,7 @@
}
private boolean startOne(final LWThread thr, final ThreadSet ts, final Object value, final int fcf, List refs) {
- incRefs(refs);
+ RefCount.incRefs(refs);
LWThread ct = thr.fork(new KRunnable() {
@Override
public void run(LWThread thr2) {
@@ -281,23 +216,7 @@
ct.start();
return false;
}
-
- private void decRefs(List rcs) throws ExecutionException {
- if (rcs != null) {
- for (RefCount rc : rcs) {
- rc.var.updateWriteRefCount(-rc.count);
- }
- }
- }
- private void incRefs(List rcs) throws ExecutionException {
- if (rcs != null) {
- for (RefCount rc : rcs) {
- rc.var.updateWriteRefCount(rc.count);
- }
- }
- }
-
private int getMaxThreads() {
if (maxThreadCount < 0) {
@@ -314,7 +233,7 @@
protected Object unwrap(Object value) {
if (value instanceof Pair) {
- Pair p = (Pair) value;
+ Pair> p = (Pair>) value;
if (_kvar.getValue() != null) {
return _kvar.getValue() + "=" + p.get(0) + ", " + _vvar.getValue() + "=" + Tracer.unwrapHandle(p.get(1));
}
Added: branches/faster/src/org/griphyn/vdl/karajan/lib/While.java
===================================================================
--- branches/faster/src/org/griphyn/vdl/karajan/lib/While.java (rev 0)
+++ branches/faster/src/org/griphyn/vdl/karajan/lib/While.java 2013-03-11 19:58:59 UTC (rev 6370)
@@ -0,0 +1,118 @@
+//----------------------------------------------------------------------
+//This code is developed as part of the Java CoG Kit project
+//The terms of the license can be found at http://www.cogkit.org/license
+//This message may not be removed or altered.
+//----------------------------------------------------------------------
+
+/*
+ * Created on Mar 11, 2013
+ */
+package org.griphyn.vdl.karajan.lib;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import k.rt.SingleValueChannel;
+import k.rt.Stack;
+import k.thr.LWThread;
+import k.thr.Yield;
+
+import org.globus.cog.karajan.analyzer.ArgRef;
+import org.globus.cog.karajan.analyzer.ChannelRef;
+import org.globus.cog.karajan.analyzer.CompilationException;
+import org.globus.cog.karajan.analyzer.DynamicScope;
+import org.globus.cog.karajan.analyzer.Scope;
+import org.globus.cog.karajan.analyzer.Signature;
+import org.globus.cog.karajan.analyzer.Var;
+import org.globus.cog.karajan.analyzer.VarRef;
+import org.globus.cog.karajan.compiled.nodes.InternalFunction;
+import org.globus.cog.karajan.compiled.nodes.Node;
+import org.globus.cog.karajan.parser.WrapperNode;
+import org.griphyn.vdl.mapping.RootDataNode;
+import org.griphyn.vdl.type.Types;
+
+public class While extends InternalFunction {
+
+ private String name;
+ private Node body;
+ private ChannelRef.DynamicSingleValued c_next;
+
+ private VarRef var;
+
+ private ArgRef _traceline;
+ private List srefs;
+ private Tracer tracer;
+ private ArgRef refs;
+
+ @Override
+ protected Signature getSignature() {
+ return new Signature(params(identifier("name"), optional("refs", null), optional("_traceline", null), block("body")));
+ }
+
+ protected Node compileBody(WrapperNode w, Scope argScope, Scope scope)
+ throws CompilationException {
+ srefs = StaticRefCount.build(scope, this.refs.getValue());
+ if (_traceline.getValue() != null) {
+ setLine(Integer.parseInt(_traceline.getValue()));
+ }
+ tracer = Tracer.getTracer(this);
+ return super.compileBody(w, argScope, scope);
+ }
+
+ @Override
+ protected void compileBlocks(WrapperNode w, Signature sig, LinkedList blocks,
+ Scope scope) throws CompilationException {
+ Var v = scope.addVar(name);
+ var = scope.getVarRef(v);
+ Var.Channel next = scope.addChannel("next");
+ c_next = new ChannelRef.DynamicSingleValued("next", next.getIndex());
+ DynamicScope ds = new DynamicScope(w, scope);
+ super.compileBlocks(w, sig, blocks, ds);
+ ds.close();
+ }
+
+ @Override
+ @SuppressWarnings("unchecked")
+ public void runBody(LWThread thr) {
+ if (body == null) {
+ return;
+ }
+ int i = thr.checkSliceAndPopState();
+ SingleValueChannel next = (SingleValueChannel) thr.popState();
+ List drefs = (List) thr.popState();
+ Stack stack = thr.getStack();
+ try {
+ switch(i) {
+ case 0:
+ drefs = RefCount.build(stack, srefs);
+ var.setValue(stack, new RootDataNode(Types.INT, 0));
+ c_next.create(stack);
+ RefCount.incRefs(drefs);
+ next = (SingleValueChannel) c_next.get(stack);
+ if (tracer.isEnabled()) {
+ tracer.trace(thr, unwrap(next));
+ }
+ i++;
+ case 1:
+ while (true) {
+ body.run(thr);
+ if (next.isEmpty()) {
+ RefCount.decRefs(drefs);
+ break;
+ }
+ Object val = next.removeFirst();
+ if (tracer.isEnabled()) {
+ tracer.trace(thr, unwrap(next));
+ }
+ var.setValue(stack, val);
+ }
+ }
+ }
+ catch (Yield y) {
+ y.getState().push(drefs);
+ y.getState().push(next);
+ y.getState().push(i);
+ throw y;
+ }
+ }
+}
From ketan at ci.uchicago.edu Mon Mar 11 16:45:32 2013
From: ketan at ci.uchicago.edu (ketan at ci.uchicago.edu)
Date: Mon, 11 Mar 2013 16:45:32 -0500 (CDT)
Subject: [Swift-commit] r6371 - trunk/docs/userguide
Message-ID: <20130311214532.ADEEC9CCB3@svn.ci.uchicago.edu>
Author: ketan
Date: 2013-03-11 16:45:32 -0500 (Mon, 11 Mar 2013)
New Revision: 6371
Modified:
trunk/docs/userguide/mappers
Log:
add example of iterate
Modified: trunk/docs/userguide/mappers
===================================================================
--- trunk/docs/userguide/mappers 2013-03-11 19:58:59 UTC (rev 6370)
+++ trunk/docs/userguide/mappers 2013-03-11 21:45:32 UTC (rev 6371)
@@ -263,6 +263,14 @@
iteration. That variable is in scope in the statements block and when
evaluating the termination expression.
+For example, the following block will iterate over the +months+ variable 12 times:
+
+----
+iterate month {
+ tracef("%i\n", month);
+ } until (month==12);
+----
+
Operators
~~~~~~~~~
The following infix operators are available for use in Swift script
From ketan at ci.uchicago.edu Mon Mar 11 17:14:26 2013
From: ketan at ci.uchicago.edu (ketan at ci.uchicago.edu)
Date: Mon, 11 Mar 2013 17:14:26 -0500 (CDT)
Subject: [Swift-commit] r6372 - trunk/docs/merged/refmanual
Message-ID: <20130311221426.051289CCB3@svn.ci.uchicago.edu>
Author: ketan
Date: 2013-03-11 17:14:25 -0500 (Mon, 11 Mar 2013)
New Revision: 6372
Added:
trunk/docs/merged/refmanual/swiftlang
Log:
Swift language reference manual draft
Added: trunk/docs/merged/refmanual/swiftlang
===================================================================
--- trunk/docs/merged/refmanual/swiftlang (rev 0)
+++ trunk/docs/merged/refmanual/swiftlang 2013-03-11 22:14:25 UTC (rev 6372)
@@ -0,0 +1,842 @@
+
+////
+Swift Language Reference Manual, asciidoc format
+////
+
+:toc:
+:numbered:
+
+////
+Settings:
+////
+:miscellaneous.newline: \n
+
+= Swift Language Referance Manual
+This reference manual semi-formally outlines the Swift language conventions
+
+== Support
+
+An overview of Swift may be found at:
+
+http://www.ci.uchicago.edu/swift/guides/trunk/userguide/userguide.html
+
+The Swift user discussion mailing list is found here:
+
+https://lists.ci.uchicago.edu/cgi-bin/mailman/listinfo/swift-user
+
+== Usage
+
+Swift code is conventionally written in +\*.swift+ files.
+After writing the Swift program
++program.swift+, run:
+
+----
+swift -sites.file sites.xml -config cf -tc.file tc program.swift
+----
+
+Swift accepts many commandline arguments. Following are the most frequently used:
+
++-config +:: The config file
+
+== Program Structure
+
+Swift programs are composed of declaration of and calls to _composite_
+functions. These share syntax with C-like languages. The following is a
+complete Swift program:
+
+----
+tracef("%s: %i\n", "The answer is", 42);
+----
+
+== Comments
+
+Swift supports C/C++ comments:
+
+----
+# This is a comment
+// This is a comment
+/* This is a
+comment */
+/** Also a
+comment */
+----
+
+== Dataflow Evaluation
+
+Swift expressions are evaluated in _dataflow_ order:
+
+----
+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);
+----
+
+This allows code to execute as concurrently as possible, limited
+only by data availability. In this example, +g()+ runs first, because it
+is dependent only on a literal. When +y+ is set, +f()+ runs, setting
++x+. Then, two invocations of +h()+ execute. Finally, +z1+ and +z2+
+are set, allowing +r()+ to run.
+
+Variables may be assigned only once. Multiple assignment is typically
+detected at compile time, although in some cases it will result in a
+run time error. Unassigned variables that are inputs to functions
+will lead to a stall in progress.
+
+== App functions
+
+Swift code is written in composite functions.
+
+Composite functions have the form:
+
+----
+[()] app function_name [( )]
+{
+ statement;
+}
+----
+
+An empty input or output list may be omitted or written as +()+.
+
+The output list may have more than one entry. Thus, assignments
+may be written as:
+----
+x1, x2 = f(i1, i2);
+// or equivalently:
+(x1, x2) = f(i1, i2);
+----
+
+== Types
+
+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.
+
+=== Primitive Types
+
+Swift has the conventional types:
+
++string+:: A complete string (not an array of characters).
++int+:: A 64-bit integer.
++float+:: A 64-bit (double-precision) floating point number.
++boolean+:: A boolean (true/false).
++file+:: A file (see Section Files).
+
+Literals for these types use conventional syntax:
+
+* +int+ literals are written as decimal numbers, e.g. +-1234+
+* +float+ literals are written as decimal numbers with a decimal point,
+ e.g +5493.352+ or +1.0+.
+ The literals +NaN+ and +inf+ may be used. In some contexts +int+
+ literals are promoted automatically to +float+.
+* +boolean+ literals
+* +string+ literals are enclosed in double quotes, with a range of escape
+ sequences supported:
+** \\ for a single backslash
+** \" for a quote
+** \n for newline
+** \t for tab
+** \a
+** \b
+** \f
+** \r
+** \v
+** hexadecimal escape codes, e.g. \xf2
+
+
+The literals +true+ and +false+ may be used for boolean.
+
+----
+int four = 2+2;
+string s = "hello ";
+string hw = s + "world";
+----
+
+=== Files
+
+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
+*mapped* 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 variables can also be initialized with data from a pre-existing
+file using the +input_file+ function. File paths are relative to the
+working directory for Turbine.
+
+For example, if +/home/user/in.txt+ is a file with some data in it,
+the following Swift program will copy the file to +/home/user/out.txt+.
+----
+ type file;
+
+ app (file o) cp_app(file i){
+ cp @i @o;
+ }
+
+ file x <"/home/user/in.txt">;
+ file y <"/home/user/out.txt">;
+
+ y = cp_app(x);
+
+
+=== Arrays
+
+Arrays are declared with empty square brackets:
+
+----
+int A[];
+----
+
+Arrays are indexed using square brackets.
+
+Each array index can only be assigned to once.
+
+Arrays may be used as inputs or outputs of functions.
+
+Arrays are part of Swift dataflow semantics. An array is closed
+when all possible insertions to it are complete.
+
+----
+int A[];
+
+foreach i in [1:10] {
+ A[i] = i;
+ tracef("Element %i is %i\n", i, A[i]);
+}
+----
+
+Array literals may be expressed with list syntax:
+----
+int C[] = [4,5,6];
+----
+
+=== Structs
+
+In Swift, structs are defined with the +type+ keyword. They define
+a new type.
+
+----
+type person
+{
+ string name;
+ int age;
+ int events[];
+}
+----
+
+Structs are accessed with the +.+ syntax:
+
+----
+person p;
+p.name = "Abe";
+p.age = 90;
+----
+
+=== Defining new types
+
+New types can be defined with +type+, which creates a new type that is a
+specialization of an existing type. That is, it is a distinct type that is not
+interchangeable.
+
+----
+type messagefile;
+----
+
+== Control structures
+
+Swift provides control structures that may be placed as statements
+inside a composite function.
+
+=== Conditionals
+
+==== If statement
+
+If statements have the form:
+
+----
+if ()
+{
+ statement;
+ ...
+}
+else
+{
+ statement;
+ ...
+}
+----
+
+As required by dataflow processing, progress blocks on the availability
+of the condition value.
+
+==== Switch statement
+
+----
+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;
+}
+tracef("b: %i\n", b);
+----
+
+=== Iteration
+
+Iteration is performed with the +foreach+ and +iterate+ statement.
+
+==== Foreach loop
+
+The +foreach+ loop allows for parallel iteration over an array:
+
+----
+string A[];
+foreach value, index in A
+{
+ tracef("A[%i] = %s\n", index, value);
+}
+----
+
+The +index+ and +value+ variables are automatically declared. The
++index+ variable may be omitted from the syntax.
+
+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 Swift compiler has special
+handling for this case that avoids constructing an array.
+
+----
+foreach i in [start:stop:step] {
+ ...
+}
+----
+
+==== Iterate loop
+
+The +iterate+ loop allows for sequential iteration.
+
+----
+iterate months {
+ tracef("%i\n", months);
+ } until (months==12);
+----
+
+The general form is:
+----
+iterate var
+{
+ statement;
+ ...
+} until (expression);
+----
+
+*Performance Tip:* use the +foreach+ loop instead of +iterate+ if your
+loop iterations are independent and can be executed in parallel.
+
+== Operators
+
+The following binary arithmetic operators on numbers are defined:
+
++++ (plus), +-+ (minus), +\*+ (times), +/+ (divide),
++%/+ (integer divide), +%%+ (modulus), +**+ (power)
+
++&&+ (boolean and), +||+ (boolean or),
++==+ (equals), +!=+ (not equals), +>+ (greater than), +<+ (less than),
++>=+ (greater than or equal to), +<=+ (less than or equal to)
+
+The following unary operators are defined:
+
++-+ (negate), +!+ (boolean not)
+
+String concatenation is also performed with +++ (plus).
++==+ and +!=+ may also be used on strings.
+
+=== Output
+
++trace(anything, anything, ...)+:: Report the value of any variable
++tracef("anything %format", anything, ...)+:: Report the value of any variable
+
+
+=== String functions
+
++ at strcat(string,string)+: Concatenation
+
+///////////////////////////////////////////////////
+
+=== Math
+
+ #include
+
++floor(float i) -> int+:: Round down
++ceil(float i) -> int+:: Round up
++round(float i) -> int+:: Round nearest
++log(float i) -> float+:: Natural logarithm
++exp(float i) -> float+:: Natural exponentiation: e^i^
++sqrt(float i) -> float+:: Square root
++is_nan(float i) -> boolean+:: Check for NaN
++abs_integer(int) -> int+:: Absolute value
++abs_float(float) -> float+:: Absolute value
+
+ #include
+
++random() -> float+:: Obtain random number
+
++randint(int start, int end)+::
+Obtain random integer from +start+, inclusive, to +end+, exclusive
+
+ #include
+
++sum_integer(int[]) -> int+:: Sum
++avg(int|float[]) -> float+:: Average
+
+=== System
+
+ #include
+
++getenv(string) -> string+:: Obtain an environment variable
+
+[[argv]]
+==== Command line
+
+Consider this command line:
+
+ turbine -l -n 3 program.tcl -v -a=file1.txt file2.txt --exec="prog thing1 thing2" --help file4.txt
+
+The arguments to +program.tcl+ are just the tokens after +program.tcl+
+
++args() -> string+::
+
+Obtain all arguments as single string
++
+E.g., +"-v -a=file1.txt file2.txt --exec="prog thing1 thing2" --help file4.txt"+
+
+The remaining functions are convenience functions oriented around
+Swift conventions. Under these conventions, the example command above
+has _flagged_ arguments +v+, +a=file.txt+, +exec="prog thing1
+thing2"+, and +help+. The command has _unflagged_ arguments
++file2.txt+ and +file4.txt+
+
++argc()+::
+Get count of unflagged arguments
+
++argv(string)+::
+_(argument-value)_
+Given a string, returns the flagged argument with that key:
++
++argv("a") -> file1.txt+
+
++argp(int)+::
+_(argument-positional)_
+Given an integer, returns the unflagged argument at that index:
++
++argp(2) -> file4.txt+
++
+Given 0, returns the program name,
++
++argp(0) -> /path/to/program.tcl+
+
++argv_accept(string...)+::
+
+If program is given command line arguments not contained in given list,
+abort.
+E.g., +argv_accept("x")+ would cause program failure at run time
+
++argv_contains(string) -> boolean+::
+
+Test if the command line contains the given flagged argument:
++
++argv_contains("v") -> true+
+
+==== Debugging
+
+ #include
+
++assert(boolean condition, string message)+::
+If condition is false, report +message+ and exit immediately.
+
+[[Turbine_information]]
+==== Turbine information
+
++adlb_servers() -> int+:: Number of ADLB servers
++turbine_engines() -> int+:: Number of Turbine engines
++turbine_workers() -> int+:: Number of Turbine workers
+
+=== Files
+
++filename(file) -> string+:: Obtain the name of a file
++input_file(string) -> file+:: Obtain a +file+. At run time, the
+filesystem is checked for the given file name
++readFile(file) -> string+:: Read file as a string
++writeFile(string) -> file+:: Write string to file
++glob(string) -> file[]+:: Perform glob operation, returning files
+that match. Available glob symbols include:
++
+* +*+: any character sequence (including the zero-length sequence)
+* +?+: any character
+* +[chars]+: any of the given characters
+* +\x+: character +x+
+* +{a,b,c,...}+ any of +a+, +b+, +c+, etc.
+
+== Defining Leaf functions
+
+In typical Swift applications, the computationally intensive parts of the
+application are not written in the Swift language. Rather,
+the work is done by _leaf functions_ that are _composed_ together with
+Swift code. Leaf functions may be extension or app functions.
+The builtin functions mentioned above are implemented as extension
+functions in Tcl.
+
+=== Swift extension functions
+
+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.
+
+Several components are required to implement a Tcl extension:
+
+- Tcl bindings to your function.
+- 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.
+- The requisite files required to build a Tcl package (e.g pkgIndex.tcl)
+- Swift declarations for the function that specify the type of the function
+ and the Tcl implementation.
+
+==== Simple Tcl Function Example
+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
++myextension.tcl+:
+
+----
+namespace eval myextension {
+ proc double { x } {
+ return [ expr $x * 2 ]
+ }
+}
+----
+
+* TODO: info on how to create Tcl package, e.g. pkgIndex.tcl
+
+Here is the Swift function definition that will go in +myextension.swift+:
+----
+ at pure
+(int o) double (int i) "myextension" "0.0.1" [
+ "set <> [ myextension::double <> ]"
+];
+----
+
+The above definition has, from left to right, the output arguments,
+the name of the new Swift function, input arguments, the name
+of the Tcl package containing the file, and the minimum version
+of that package.
+
+We tell the compiler how to call our Tcl function using inline
+Tcl code as a template with variable names surrounded by +<< >>+
+indicating where variables should be substituted.
+
+We can also tell the Swift compiler a little about the function so
+that it can better optimize your programs.
+For example, +double+ has no side-effects and produces the same result each
+time for the same arguments (i.e. is deterministic), so we can flag
+it as a + at pure+ function.
+
+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:
+
+----
+ at dispatch=LEAF
+(int o) process (int i) "pkg" "0.0.1" [
+ "set <> [ pkg::process <> ]"
+];
+----
+
+==== Swift/Tcl Data Type Mapping
+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:
+
+* int/float/string/bool are converted to the standard
+ Tcl representations
+* blobs are represented as a Tcl list with first element a pointer
+ to the data, and the second element the length of the data
+
+==== Writing Custom Tcl interfaces
+For Tcl functions that take complex argument types, such as arrays
+or structures, you currently 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.
+
+----
+(int o) complex (int arr[]) "pkg" "0.0.1" "complex";
+----
+
+* TODO: guide to do this. Can look in turbine/lib for examples
+
+
+=== App functions
+
+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:
+
+* 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 +file+#s#.
+* 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.
+
+App arguments can be:
+
+* Literals such as numbers or strings.
+* File variables (passed as file paths).
+* Other variables, which are converted to string arguments.
+ Arrays (including multi-dimensional arrays) are expanded to
+ multiple arguments.
+* Arbitrary expressions surrounded by parentheses.
+
+Standard input, output and error can be redirected to files.
+
+Join files together:
+----
+#include
+
+app (file out) cat (file inputs[]) {
+ "/bin/cat" inputs @stdout=out
+}
+
+main {
+ file joined <"joined.txt"> = cat(glob("*.txt"));
+}
+----
+
+Sleep an arbitrary amount of time:
+----
+
+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));
+ }
+ }
+}
+----
+
+
+[[Optimizations]]
+== Optimizations
+STC performs a range of compiler optimizations that can significantly
+speed up most Swift programs. The optimization level can be controlled
+by the +-O+ command line option. Almost always the default optimization
+level +-O2+ is your best choice.
+
+----
+# 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 (including ones that sometimes hurt performance)
+stc -O3 example.swift example.tcl
+----
+
+Individual optimizations can be toggled on using +-T +
+or off with +-t +, but this typically is only useful for
+debugging.
+
+[[Turbine]]
+== Running in Turbine
+
+The following describes how to run Turbine programs.
+
+=== Architecture
+
+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.
+
+Each process runs in a _mode_: _engine_, _worker_, or _server_.
+
+Engines:: Evaluate the Swift logic. Produces tasks
+Workers:: Performs tasks
+Servers:: Distributes tasks
+
+Typical Swift programs perform compute-intensive work in extension
+functions. These always execute on workers.
+
+Engines split up the control logic work among themselves. This
+results in the generation of calls to extension functions.
+
+Servers distribute tasks in a scalable, load balanced manner. They
+also store Swift data (integers, strings, etc.).
+
+=== Concurrency
+
+The available concurrency and efficiency in your Swift script is
+limited by the following factors:
+
+* The available concurrency in the Swift logic. Sequential
+ dependencies will be evaluated sequentially. +foreach+ loops and
+ branching function calls may be evaluated concurrently
+* The number of workers available to process leaf functions
+ concurrently
+* The number of engines and servers available to control the Turbine
+ run. Adding more engines and servers usually improves performance
+ but costs processes
+
+=== Invocation
+
+The general form of a Turbine invocation for STC-generated
++program.tcl+ is:
+
+----
+turbine
+----
+
+The program arguments are available to Swift (<>).
+
+Turbine accepts the following arguments:
+
++-l+:: Enable +mpiexec -l+ ranked output formatting
++-n+:: The total number of Turbine MPI processes
+
+The user controls the Turbine run time configuration through
+environment variables:
+
++TURBINE_ENGINES+:: Number of Turbine engines
+
++ADLB_SERVERS+:: Number of ADLB servers
+
+The remaining processes are workers. These values are available to
+Swift (<>).
+
++TURBINE_LOG=0+:: Disable logging
+
++ADLB_EXHAUST_TIME+::
+Time in seconds taken by ADLB task servers to shut down. May include
+a decimal point. Default +0.1+ . In very large runs, this may be set to
+5 to ensure correctness.
+
++TURBINE_LAUNCH_OPTS+::
+Provide other arguments to +mpiexec+, such as a machine file, etc.
+
++TURBINE_SRAND+::
+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 +seed+, the random number generator seed for each process
+will be set to +seed+ + +rank+.
++
+For non-reproducible random results, use the following shell commands:
++
+----
+export TURBINE_SRAND=$( date +%s )
+turbine ...
+----
++
+The seed is recorded in the log.
+
+=== Configuration
+
+The following describes how to turn Swift/T programs in Turbine
+on more complex systems.
+
+[[Build_settings]]
+==== Build settings
+
+If +exm-setup.zsh+ does not succeed, you may need to change how it
+tries to configure and compile Swift/T.
+
+Swift/T is built with standard Ant (Java) and Autotools/Makefile
+(C,Tcl) techniques. The primary control is thus the arguments to
++ant+ or +configure+.
+
+==== Manual configuration
+
+You do not need to use +exm-setup.zsh+ to install Swift/T. To perform
+the installation using +configure+/+make+, simply untar the
+distribution package and do:
+
+----
+cd c-utils
+./configure ...
+make install
+
+cd ../lb
+./configure ...
+make install
+
+cd ../turbine
+./configure ...
+make install
+
+cd ../stc
+ant -Ddist.dir=... -Dturbine.home=...
+----
+
+* You may use +./configure --help+ and the
+ link:turbine-sites.html[Sites Guide] for further options.
+* You can use +exm-setup.zsh+ as a guide to this process, as it is a
+ simple linear shell script that automates the +configure+/+make+
+ process.
+
+==== Non-standard MPI locations
+
+Configure Turbine with:
+
+----
+ --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
+----
+
+==== Known systems
+
+See the
+http://www.mcs.anl.gov/exm/local/guides/turbine-sites.html[Turbine Sites Guide]
+for information about specific systems with Turbine installations.
+
+=== Performance enhancements
+
+1. Disable logging/debugging via environment
+2. Disable logging/debugging at configure/compile time
++
+** Configure c-utils with +--disable-log+
++
+3. Configure everything with +--enable-fast+. This disables assertions
+ and other checks
+4. When making performance measurements, always subtract 1 second
+ (or the value of +ADLB_EXHAUST_TIME+) 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.
+
+////
+Local Variables:
+mode: doc
+End:
+////
From ketan at ci.uchicago.edu Mon Mar 11 17:22:48 2013
From: ketan at ci.uchicago.edu (ketan at ci.uchicago.edu)
Date: Mon, 11 Mar 2013 17:22:48 -0500 (CDT)
Subject: [Swift-commit] r6373 - trunk/docs/merged/refmanual
Message-ID: <20130311222248.184E19CC97@svn.ci.uchicago.edu>
Author: ketan
Date: 2013-03-11 17:22:47 -0500 (Mon, 11 Mar 2013)
New Revision: 6373
Added:
trunk/docs/merged/refmanual/swift.css
Log:
adding swift css from exm/stc
Added: trunk/docs/merged/refmanual/swift.css
===================================================================
--- trunk/docs/merged/refmanual/swift.css (rev 0)
+++ trunk/docs/merged/refmanual/swift.css 2013-03-11 22:22:47 UTC (rev 6373)
@@ -0,0 +1,6 @@
+
+/* SWIFT/T GUIDE CUSTOMIZATIONS */
+
+a:visited {
+ color: black;
+}
From ketan at ci.uchicago.edu Tue Mar 12 14:20:37 2013
From: ketan at ci.uchicago.edu (ketan at ci.uchicago.edu)
Date: Tue, 12 Mar 2013 14:20:37 -0500 (CDT)
Subject: [Swift-commit] r6374 - trunk/docs/merged/refmanual
Message-ID: <20130312192037.A0D64178884@svn.ci.uchicago.edu>
Author: ketan
Date: 2013-03-12 14:20:37 -0500 (Tue, 12 Mar 2013)
New Revision: 6374
Modified:
trunk/docs/merged/refmanual/swiftlang
Log:
updates
Modified: trunk/docs/merged/refmanual/swiftlang
===================================================================
--- trunk/docs/merged/refmanual/swiftlang 2013-03-11 22:22:47 UTC (rev 6373)
+++ trunk/docs/merged/refmanual/swiftlang 2013-03-12 19:20:37 UTC (rev 6374)
@@ -160,12 +160,12 @@
=== Files
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
-*mapped* to path in a filesystem. Assigning to a mapped file variable
+as any other variable. The main difference is that a file can be
+*mapped* 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 variables can also be initialized with data from a pre-existing
file using the +input_file+ function. File paths are relative to the
-working directory for Turbine.
+working directory.
For example, if +/home/user/in.txt+ is a file with some data in it,
the following Swift program will copy the file to +/home/user/out.txt+.
@@ -180,8 +180,8 @@
file y <"/home/user/out.txt">;
y = cp_app(x);
+----
-
=== Arrays
Arrays are declared with empty square brackets:
@@ -372,34 +372,6 @@
+ at strcat(string,string)+: Concatenation
-///////////////////////////////////////////////////
-
-=== Math
-
- #include
-
-+floor(float i) -> int+:: Round down
-+ceil(float i) -> int+:: Round up
-+round(float i) -> int+:: Round nearest
-+log(float i) -> float+:: Natural logarithm
-+exp(float i) -> float+:: Natural exponentiation: e^i^
-+sqrt(float i) -> float+:: Square root
-+is_nan(float i) -> boolean+:: Check for NaN
-+abs_integer(int) -> int+:: Absolute value
-+abs_float(float) -> float+:: Absolute value
-
- #include
-
-+random() -> float+:: Obtain random number
-
-+randint(int start, int end)+::
-Obtain random integer from +start+, inclusive, to +end+, exclusive
-
- #include
-
-+sum_integer(int[]) -> int+:: Sum
-+avg(int|float[]) -> float+:: Average
-
=== System
#include
@@ -562,33 +534,10 @@
];
----
-==== Swift/Tcl Data Type Mapping
-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:
-
-* int/float/string/bool are converted to the standard
- Tcl representations
-* blobs are represented as a Tcl list with first element a pointer
- to the data, and the second element the length of the data
-
-==== Writing Custom Tcl interfaces
-For Tcl functions that take complex argument types, such as arrays
-or structures, you currently 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.
-
-----
-(int o) complex (int arr[]) "pkg" "0.0.1" "complex";
-----
-
-* TODO: guide to do this. Can look in turbine/lib for examples
-
-
=== App functions
App functions are functions that are implemented as command-line
-programs. These command-line programs can be brought into a Swift
+programs. These command-line programs can be brought into a Swift
program as functions with typed inputs and outputs.
An app function definition comprises:
@@ -613,7 +562,7 @@
Join files together:
----
-#include
+type file;
app (file out) cat (file inputs[]) {
"/bin/cat" inputs @stdout=out
@@ -625,13 +574,12 @@
----
Sleep an arbitrary amount of time:
-----
+----
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
@@ -639,202 +587,8 @@
trace("Slept " + fromint(time));
}
}
-}
----
-
-[[Optimizations]]
-== Optimizations
-STC performs a range of compiler optimizations that can significantly
-speed up most Swift programs. The optimization level can be controlled
-by the +-O+ command line option. Almost always the default optimization
-level +-O2+ is your best choice.
-
-----
-# 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 (including ones that sometimes hurt performance)
-stc -O3 example.swift example.tcl
-----
-
-Individual optimizations can be toggled on using +-T +
-or off with +-t +, but this typically is only useful for
-debugging.
-
-[[Turbine]]
-== Running in Turbine
-
-The following describes how to run Turbine programs.
-
-=== Architecture
-
-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.
-
-Each process runs in a _mode_: _engine_, _worker_, or _server_.
-
-Engines:: Evaluate the Swift logic. Produces tasks
-Workers:: Performs tasks
-Servers:: Distributes tasks
-
-Typical Swift programs perform compute-intensive work in extension
-functions. These always execute on workers.
-
-Engines split up the control logic work among themselves. This
-results in the generation of calls to extension functions.
-
-Servers distribute tasks in a scalable, load balanced manner. They
-also store Swift data (integers, strings, etc.).
-
-=== Concurrency
-
-The available concurrency and efficiency in your Swift script is
-limited by the following factors:
-
-* The available concurrency in the Swift logic. Sequential
- dependencies will be evaluated sequentially. +foreach+ loops and
- branching function calls may be evaluated concurrently
-* The number of workers available to process leaf functions
- concurrently
-* The number of engines and servers available to control the Turbine
- run. Adding more engines and servers usually improves performance
- but costs processes
-
-=== Invocation
-
-The general form of a Turbine invocation for STC-generated
-+program.tcl+ is:
-
-----
-turbine
-----
-
-The program arguments are available to Swift (<>).
-
-Turbine accepts the following arguments:
-
-+-l+:: Enable +mpiexec -l+ ranked output formatting
-+-n+:: The total number of Turbine MPI processes
-
-The user controls the Turbine run time configuration through
-environment variables:
-
-+TURBINE_ENGINES+:: Number of Turbine engines
-
-+ADLB_SERVERS+:: Number of ADLB servers
-
-The remaining processes are workers. These values are available to
-Swift (<>).
-
-+TURBINE_LOG=0+:: Disable logging
-
-+ADLB_EXHAUST_TIME+::
-Time in seconds taken by ADLB task servers to shut down. May include
-a decimal point. Default +0.1+ . In very large runs, this may be set to
-5 to ensure correctness.
-
-+TURBINE_LAUNCH_OPTS+::
-Provide other arguments to +mpiexec+, such as a machine file, etc.
-
-+TURBINE_SRAND+::
-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 +seed+, the random number generator seed for each process
-will be set to +seed+ + +rank+.
-+
-For non-reproducible random results, use the following shell commands:
-+
-----
-export TURBINE_SRAND=$( date +%s )
-turbine ...
-----
-+
-The seed is recorded in the log.
-
-=== Configuration
-
-The following describes how to turn Swift/T programs in Turbine
-on more complex systems.
-
-[[Build_settings]]
-==== Build settings
-
-If +exm-setup.zsh+ does not succeed, you may need to change how it
-tries to configure and compile Swift/T.
-
-Swift/T is built with standard Ant (Java) and Autotools/Makefile
-(C,Tcl) techniques. The primary control is thus the arguments to
-+ant+ or +configure+.
-
-==== Manual configuration
-
-You do not need to use +exm-setup.zsh+ to install Swift/T. To perform
-the installation using +configure+/+make+, simply untar the
-distribution package and do:
-
-----
-cd c-utils
-./configure ...
-make install
-
-cd ../lb
-./configure ...
-make install
-
-cd ../turbine
-./configure ...
-make install
-
-cd ../stc
-ant -Ddist.dir=... -Dturbine.home=...
-----
-
-* You may use +./configure --help+ and the
- link:turbine-sites.html[Sites Guide] for further options.
-* You can use +exm-setup.zsh+ as a guide to this process, as it is a
- simple linear shell script that automates the +configure+/+make+
- process.
-
-==== Non-standard MPI locations
-
-Configure Turbine with:
-
-----
- --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
-----
-
-==== Known systems
-
-See the
-http://www.mcs.anl.gov/exm/local/guides/turbine-sites.html[Turbine Sites Guide]
-for information about specific systems with Turbine installations.
-
-=== Performance enhancements
-
-1. Disable logging/debugging via environment
-2. Disable logging/debugging at configure/compile time
-+
-** Configure c-utils with +--disable-log+
-+
-3. Configure everything with +--enable-fast+. This disables assertions
- and other checks
-4. When making performance measurements, always subtract 1 second
- (or the value of +ADLB_EXHAUST_TIME+) 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.
-
////
Local Variables:
mode: doc
From ketan at ci.uchicago.edu Tue Mar 12 15:32:38 2013
From: ketan at ci.uchicago.edu (ketan at ci.uchicago.edu)
Date: Tue, 12 Mar 2013 15:32:38 -0500 (CDT)
Subject: [Swift-commit] r6375 - in trunk/docs: merged/refmanual userguide
Message-ID: <20130312203238.2B442178884@svn.ci.uchicago.edu>
Author: ketan
Date: 2013-03-12 15:32:37 -0500 (Tue, 12 Mar 2013)
New Revision: 6375
Added:
trunk/docs/merged/refmanual/build.sh
Modified:
trunk/docs/merged/refmanual/swiftlang
trunk/docs/userguide/mappers
Log:
switch case example
Added: trunk/docs/merged/refmanual/build.sh
===================================================================
--- trunk/docs/merged/refmanual/build.sh (rev 0)
+++ trunk/docs/merged/refmanual/build.sh 2013-03-12 20:32:37 UTC (rev 6375)
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+asciidoc --attribute stylesheet=${PWD}/swift.css swiftlang
Property changes on: trunk/docs/merged/refmanual/build.sh
___________________________________________________________________
Added: svn:executable
+ *
Modified: trunk/docs/merged/refmanual/swiftlang
===================================================================
--- trunk/docs/merged/refmanual/swiftlang 2013-03-12 19:20:37 UTC (rev 6374)
+++ trunk/docs/merged/refmanual/swiftlang 2013-03-12 20:32:37 UTC (rev 6375)
@@ -31,13 +31,22 @@
+program.swift+, run:
----
-swift -sites.file sites.xml -config cf -tc.file tc program.swift
+swift -sites.file -config -tc.file
----
Swift accepts many commandline arguments. Following are the most frequently used:
-+-config +:: The config file
++-config + :: Indicates the Swift configuration file to be used for this
+run. Properties in this configuration file will override the default
+properties. If individual command line arguments are used for properties, they
+will override the contents of this file.
++-sites.file + :: Points to the location of the sites.xml file
+
++-tc.file + :: Points to the location of the tc.data file
+
++-resume + :: Resumes the execution using a log file
+
== Program Structure
Swift programs are composed of declaration of and calls to _composite_
@@ -148,7 +157,6 @@
** \v
** hexadecimal escape codes, e.g. \xf2
-
The literals +true+ and +false+ may be used for boolean.
----
@@ -381,55 +389,8 @@
[[argv]]
==== Command line
-Consider this command line:
+Swift accepts commandline arguments in the form of -var .
- turbine -l -n 3 program.tcl -v -a=file1.txt file2.txt --exec="prog thing1 thing2" --help file4.txt
-
-The arguments to +program.tcl+ are just the tokens after +program.tcl+
-
-+args() -> string+::
-
-Obtain all arguments as single string
-+
-E.g., +"-v -a=file1.txt file2.txt --exec="prog thing1 thing2" --help file4.txt"+
-
-The remaining functions are convenience functions oriented around
-Swift conventions. Under these conventions, the example command above
-has _flagged_ arguments +v+, +a=file.txt+, +exec="prog thing1
-thing2"+, and +help+. The command has _unflagged_ arguments
-+file2.txt+ and +file4.txt+
-
-+argc()+::
-Get count of unflagged arguments
-
-+argv(string)+::
-_(argument-value)_
-Given a string, returns the flagged argument with that key:
-+
-+argv("a") -> file1.txt+
-
-+argp(int)+::
-_(argument-positional)_
-Given an integer, returns the unflagged argument at that index:
-+
-+argp(2) -> file4.txt+
-+
-Given 0, returns the program name,
-+
-+argp(0) -> /path/to/program.tcl+
-
-+argv_accept(string...)+::
-
-If program is given command line arguments not contained in given list,
-abort.
-E.g., +argv_accept("x")+ would cause program failure at run time
-
-+argv_contains(string) -> boolean+::
-
-Test if the command line contains the given flagged argument:
-+
-+argv_contains("v") -> true+
-
==== Debugging
#include
@@ -437,13 +398,6 @@
+assert(boolean condition, string message)+::
If condition is false, report +message+ and exit immediately.
-[[Turbine_information]]
-==== Turbine information
-
-+adlb_servers() -> int+:: Number of ADLB servers
-+turbine_engines() -> int+:: Number of Turbine engines
-+turbine_workers() -> int+:: Number of Turbine workers
-
=== Files
+filename(file) -> string+:: Obtain the name of a file
@@ -469,71 +423,6 @@
The builtin functions mentioned above are implemented as extension
functions in Tcl.
-=== Swift extension functions
-
-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.
-
-Several components are required to implement a Tcl extension:
-
-- Tcl bindings to your function.
-- 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.
-- The requisite files required to build a Tcl package (e.g pkgIndex.tcl)
-- Swift declarations for the function that specify the type of the function
- and the Tcl implementation.
-
-==== Simple Tcl Function Example
-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
-+myextension.tcl+:
-
-----
-namespace eval myextension {
- proc double { x } {
- return [ expr $x * 2 ]
- }
-}
-----
-
-* TODO: info on how to create Tcl package, e.g. pkgIndex.tcl
-
-Here is the Swift function definition that will go in +myextension.swift+:
-----
- at pure
-(int o) double (int i) "myextension" "0.0.1" [
- "set <> [ myextension::double <> ]"
-];
-----
-
-The above definition has, from left to right, the output arguments,
-the name of the new Swift function, input arguments, the name
-of the Tcl package containing the file, and the minimum version
-of that package.
-
-We tell the compiler how to call our Tcl function using inline
-Tcl code as a template with variable names surrounded by +<< >>+
-indicating where variables should be substituted.
-
-We can also tell the Swift compiler a little about the function so
-that it can better optimize your programs.
-For example, +double+ has no side-effects and produces the same result each
-time for the same arguments (i.e. is deterministic), so we can flag
-it as a + at pure+ function.
-
-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:
-
-----
- at dispatch=LEAF
-(int o) process (int i) "pkg" "0.0.1" [
- "set <> [ pkg::process <> ]"
-];
-----
-
=== App functions
App functions are functions that are implemented as command-line
Modified: trunk/docs/userguide/mappers
===================================================================
--- trunk/docs/userguide/mappers 2013-03-12 19:20:37 UTC (rev 6374)
+++ trunk/docs/userguide/mappers 2013-03-12 20:32:37 UTC (rev 6375)
@@ -244,7 +244,24 @@
subsequent case blocks, and no break statement is necessary at the
end of each block.
+Following is an example of a switch expression in Swift:
+----
+int score=60;
+switch (score){
+case 100:
+ tracef("%s\n", "Bravo!");
+case 90:
+ tracef("%s\n", "very good");
+case 80:
+ tracef("%s\n", "good");
+case 70:
+ tracef("%s\n", "fair");
+default:
+ tracef("%s\n", "unknown grade");
+ }
+----
+
iterate
^^^^^^^
iterate expressions allow a block of code to be evaluated repeatedly,
From ketan at ci.uchicago.edu Wed Mar 13 11:07:19 2013
From: ketan at ci.uchicago.edu (ketan at ci.uchicago.edu)
Date: Wed, 13 Mar 2013 11:07:19 -0500 (CDT)
Subject: [Swift-commit] r6376 - trunk/docs/merged/refmanual
Message-ID: <20130313160719.CE2FF9CCED@svn.ci.uchicago.edu>
Author: ketan
Date: 2013-03-13 11:07:19 -0500 (Wed, 13 Mar 2013)
New Revision: 6376
Modified:
trunk/docs/merged/refmanual/swiftlang
Log:
app and composite functions
Modified: trunk/docs/merged/refmanual/swiftlang
===================================================================
--- trunk/docs/merged/refmanual/swiftlang 2013-03-12 20:32:37 UTC (rev 6375)
+++ trunk/docs/merged/refmanual/swiftlang 2013-03-13 16:07:19 UTC (rev 6376)
@@ -95,19 +95,51 @@
run time error. Unassigned variables that are inputs to functions
will lead to a stall in progress.
-== App functions
+== Composite functions
Swift code is written in composite functions.
-Composite functions have the form:
+----
+[()] function_name [( )]
+{
+ statement;
+ statement;
+ ...
+}
+----
+An example of a Swift composite function is shown below:
+
----
+(Station _stat) get_site(int _run_id) {
+ StationFile file<"/tmp/site_tmp">;
+ file = getsite_file(_run_id);
+ _stat = readData(file);
+}
+----
+
+== App functions
+Swift app functions are used to integrate external apps into Swift and made
+callable as Swift functions. App functions have the form:
+
+----
[()] app function_name [( )]
{
statement;
}
----
+An example of an app function definition is as follows:
+
+----
+(RuptureFile _rup) app getrupture_file(int _run_id) {
+ getrupture _run_id stdout=@filename(_rup);
+}
+----
+
+Note that an app function may have only one commandline statement while a
+composite function may have multiple statements.
+
An empty input or output list may be omitted or written as +()+.
The output list may have more than one entry. Thus, assignments
@@ -118,6 +150,7 @@
(x1, x2) = f(i1, i2);
----
+
== Types
Swift provides a similar range of primitive types to many other
@@ -370,6 +403,8 @@
String concatenation is also performed with +++ (plus).
+==+ and +!=+ may also be used on strings.
+== Standard Library
+
=== Output
+trace(anything, anything, ...)+:: Report the value of any variable
@@ -414,13 +449,12 @@
* +\x+: character +x+
* +{a,b,c,...}+ any of +a+, +b+, +c+, etc.
-== Defining Leaf functions
+== Defining Apps
In typical Swift applications, the computationally intensive parts of the
application are not written in the Swift language. Rather,
-the work is done by _leaf functions_ that are _composed_ together with
-Swift code. Leaf functions may be extension or app functions.
-The builtin functions mentioned above are implemented as extension
+the work is done by _app functions_ that are _composed_ together with
+Swift code. The builtin functions mentioned above are implemented as extension
functions in Tcl.
=== App functions
From wilde at ci.uchicago.edu Wed Mar 13 16:33:08 2013
From: wilde at ci.uchicago.edu (wilde at ci.uchicago.edu)
Date: Wed, 13 Mar 2013 16:33:08 -0500 (CDT)
Subject: [Swift-commit] r6377 - SwiftTutorials/OSG_2013-03-11
Message-ID: <20130313213308.DAF6C9CC97@svn.ci.uchicago.edu>
Author: wilde
Date: 2013-03-13 16:33:08 -0500 (Wed, 13 Mar 2013)
New Revision: 6377
Added:
SwiftTutorials/OSG_2013-03-11/MODIS/
Log:
For simplified demos based on modis02.swift
From wilde at ci.uchicago.edu Wed Mar 13 17:39:15 2013
From: wilde at ci.uchicago.edu (wilde at ci.uchicago.edu)
Date: Wed, 13 Mar 2013 17:39:15 -0500 (CDT)
Subject: [Swift-commit] r6379 - SwiftTutorials/OSG_2013-03-11/MODIS
Message-ID: <20130313223915.ED9EB9CCED@svn.ci.uchicago.edu>
Author: wilde
Date: 2013-03-13 17:39:15 -0500 (Wed, 13 Mar 2013)
New Revision: 6379
Modified:
SwiftTutorials/OSG_2013-03-11/MODIS/README
Log:
minor fix in README
Modified: SwiftTutorials/OSG_2013-03-11/MODIS/README
===================================================================
--- SwiftTutorials/OSG_2013-03-11/MODIS/README 2013-03-13 22:37:52 UTC (rev 6378)
+++ SwiftTutorials/OSG_2013-03-11/MODIS/README 2013-03-13 22:39:15 UTC (rev 6379)
@@ -4,7 +4,7 @@
tar xf swiftdemo.vNN.tgz
cd swiftdemo
source setup.sh # <======== Be sure to *source* it!
- # setup.sh sets PATH with swift, $PWD, and "."
+ # setup.sh sets PATH with swift, $PWD/bin, and "."
# and creates input files
To run:
From wilde at ci.uchicago.edu Wed Mar 13 17:43:17 2013
From: wilde at ci.uchicago.edu (wilde at ci.uchicago.edu)
Date: Wed, 13 Mar 2013 17:43:17 -0500 (CDT)
Subject: [Swift-commit] r6380 - SwiftTutorials/OSG_2013-03-11/MODIS
Message-ID: <20130313224317.8181D9CCED@svn.ci.uchicago.edu>
Author: wilde
Date: 2013-03-13 17:43:17 -0500 (Wed, 13 Mar 2013)
New Revision: 6380
Added:
SwiftTutorials/OSG_2013-03-11/MODIS/Swift-OSG.2013.0312.pdf
SwiftTutorials/OSG_2013-03-11/MODIS/Swift-OSG.2013.0312.pptx
Log:
Added presentation to accompany this demo.
Added: SwiftTutorials/OSG_2013-03-11/MODIS/Swift-OSG.2013.0312.pdf
===================================================================
(Binary files differ)
Property changes on: SwiftTutorials/OSG_2013-03-11/MODIS/Swift-OSG.2013.0312.pdf
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: SwiftTutorials/OSG_2013-03-11/MODIS/Swift-OSG.2013.0312.pptx
===================================================================
(Binary files differ)
Property changes on: SwiftTutorials/OSG_2013-03-11/MODIS/Swift-OSG.2013.0312.pptx
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
From ketan at ci.uchicago.edu Thu Mar 14 09:53:11 2013
From: ketan at ci.uchicago.edu (ketan at ci.uchicago.edu)
Date: Thu, 14 Mar 2013 09:53:11 -0500 (CDT)
Subject: [Swift-commit] r6381 - in trunk/docs: merged/refmanual userguide
Message-ID: <20130314145311.4F29D9CC99@svn.ci.uchicago.edu>
Author: ketan
Date: 2013-03-14 09:53:10 -0500 (Thu, 14 Mar 2013)
New Revision: 6381
Modified:
trunk/docs/merged/refmanual/swiftlang
trunk/docs/userguide/site_catalog
Log:
site catalog work directory
Modified: trunk/docs/merged/refmanual/swiftlang
===================================================================
--- trunk/docs/merged/refmanual/swiftlang 2013-03-13 22:43:17 UTC (rev 6380)
+++ trunk/docs/merged/refmanual/swiftlang 2013-03-14 14:53:10 UTC (rev 6381)
@@ -150,14 +150,20 @@
(x1, x2) = f(i1, i2);
----
+=== Swift keywords
+Following is a list of Swift keywords:
+
+ app type float int boolean string global
+ foreach if else iterate switch case default
+ file while import
+
== Types
-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.
+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.
=== Primitive Types
@@ -335,17 +341,17 @@
=== Iteration
-Iteration is performed with the +foreach+ and +iterate+ statement.
+Iteration in parallel is performed with the +foreach+ and +iterate+ statement.
==== Foreach loop
The +foreach+ loop allows for parallel iteration over an array:
----
-string A[];
-foreach value, index in A
-{
- tracef("A[%i] = %s\n", index, value);
+foreach value[, index] in [expression]{
+ statement;
+ statement;
+ ...
}
----
@@ -363,6 +369,23 @@
}
----
+Examples of +foreach+ loop are as follows:
+
+----
+string A[];
+foreach value, index in A
+{
+ tracef("A[%i] = %s\n", index, value);
+}
+----
+
+----
+trace(" First five odd numbers");
+foreach idx in [1:10:2]{
+ tracef("%i\n",idx);
+}
+----
+
==== Iterate loop
The +iterate+ loop allows for sequential iteration.
Modified: trunk/docs/userguide/site_catalog
===================================================================
--- trunk/docs/userguide/site_catalog 2013-03-13 22:43:17 UTC (rev 6380)
+++ trunk/docs/userguide/site_catalog 2013-03-14 14:53:10 UTC (rev 6381)
@@ -148,14 +148,15 @@
stored.
----
-/home/benc
+/tmp/swift.workdir
----
-This file must be accessible through the transfer mechanism specified in
-the element and also mounted on all worker nodes that will
-be used for execution. A shared cluster scratch filesystem is
-appropriate for this.
+This directory must be accessible through the specified transfer mechanism and
+also mounted on all worker nodes that will be used for execution. A shared
+cluster scratch filesystem is appropriate for this. Note that you need to
+specify _absolute pathname_ for this field.
+
Scratch
~~~~~~~
From wozniak at ci.uchicago.edu Thu Mar 14 16:23:49 2013
From: wozniak at ci.uchicago.edu (wozniak at ci.uchicago.edu)
Date: Thu, 14 Mar 2013 16:23:49 -0500 (CDT)
Subject: [Swift-commit] r6382 - trunk/docs/userguide
Message-ID: <20130314212349.42A5C9CC97@svn.ci.uchicago.edu>
Author: wozniak
Date: 2013-03-14 16:23:48 -0500 (Thu, 14 Mar 2013)
New Revision: 6382
Modified:
trunk/docs/userguide/commands
Log:
Document SWIFT_HEAP_MAX
Modified: trunk/docs/userguide/commands
===================================================================
--- trunk/docs/userguide/commands 2013-03-14 14:53:10 UTC (rev 6381)
+++ trunk/docs/userguide/commands 2013-03-14 21:23:48 UTC (rev 6382)
@@ -80,28 +80,28 @@
-recompile
- Forces Swift to re-compile the invoked Swift script. While Swift
- is meant to detect when recompilation is necessary, in some
- special cases it fails to do so. This flag helps with those
+ Forces Swift to re-compile the invoked Swift script. While Swift
+ is meant to detect when recompilation is necessary, in some
+ special cases it fails to do so. This flag helps with those
special cases.
-cdm.file
-
+
Specifies a CDM policy file.
-reduced.logging
- Makes logging more terse by disabling provenance information and
+ Makes logging more terse by disabling provenance information and
low-level task messages
-minimal.logging
- Makes logging much more terse: reports warnings only
+ Makes logging much more terse: reports warnings only
-tui
Displays an interactive text mode monitor during a run. (since Swift
- 0.9)
+ 0.9)
In addition, the following Swift properties can be set on the command line:
@@ -142,12 +142,18 @@
The swift is influenced by the following environment variables:
-GLOBUS_HOSTNAME, GLOBUS_TCP_PORT_RANGE
+GLOBUS_HOSTNAME, GLOBUS_TCP_PORT_RANGE
Set in the environment before running Swift. These can be set to inform Swift
of the configuration of your local firewall. More information can be found in
the Globus firewall How-to .
+SWIFT_HEAP_MAX
+
+ Sets the java heap size. Use this if Swift runs out of memory.
+ Uses the format set by java -Xmx, which is how this is implemented.
+ The default setting is 1024M.
+
COG_OPTS
Set in the environment before running Swift. Options set in
@@ -155,7 +161,7 @@
which will run Swift. The parameters vary between virtual machine
imlementations, but can usually be used to alter settings such as
maximum heap size. Typing 'java -help' will sometimes give a list of
- commands.
+ commands.
swift-osg-ress-site-catalog
From davidk at ci.uchicago.edu Fri Mar 15 10:02:01 2013
From: davidk at ci.uchicago.edu (davidk at ci.uchicago.edu)
Date: Fri, 15 Mar 2013 10:02:01 -0500 (CDT)
Subject: [Swift-commit] r6383 - trunk/bin
Message-ID: <20130315150201.D053C9CC97@svn.ci.uchicago.edu>
Author: davidk
Date: 2013-03-15 10:02:00 -0500 (Fri, 15 Mar 2013)
New Revision: 6383
Modified:
trunk/bin/swiftrun
Log:
Link input_files
Modified: trunk/bin/swiftrun
===================================================================
--- trunk/bin/swiftrun 2013-03-14 21:23:48 UTC (rev 6382)
+++ trunk/bin/swiftrun 2013-03-15 15:02:00 UTC (rev 6383)
@@ -1,4 +1,4 @@
-#!/bin/bash -x
+#!/bin/bash
# Verify an argument is not null
verify_not_null()
@@ -60,6 +60,14 @@
rundir=$( echo run??? | sed -e 's/^.*run//' | awk '{ printf("run%03d\n", $1+1)}' )
mkdir $rundir
+# Link input_files
+if [ -d "input_files" ]; then
+ for input_file in input_files/*
+ do
+ ln -s $PWD/$input_file $rundir
+ done
+fi
+
# Swift script
if [ -f "$script" ]; then
cp $script $rundir
@@ -77,13 +85,10 @@
echo "" > sites.xml
for site in $SITES
do
- echo SITE IS $site
- echo FILE IS ../conf/$site.cf
# If config is not defined, but there is a config in conf/ that matches, use that
if [ -z "$CONFIG" ] && [ -f "../conf/$site.cf" ]; then
cp ../conf/$site.cf .
config=$site.cf
- echo config IS $config
fi
if [ -f "$config" ]; then
From ketan at ci.uchicago.edu Fri Mar 15 16:53:56 2013
From: ketan at ci.uchicago.edu (ketan at ci.uchicago.edu)
Date: Fri, 15 Mar 2013 16:53:56 -0500 (CDT)
Subject: [Swift-commit] r6384 - trunk/docs/merged/refmanual
Message-ID: <20130315215356.9569A9CC97@svn.ci.uchicago.edu>
Author: ketan
Date: 2013-03-15 16:53:56 -0500 (Fri, 15 Mar 2013)
New Revision: 6384
Added:
trunk/docs/merged/refmanual/grammar
Modified:
trunk/docs/merged/refmanual/build.sh
trunk/docs/merged/refmanual/swiftlang
Log:
first cut at swift grammar, needs refinement, and crystallization
Modified: trunk/docs/merged/refmanual/build.sh
===================================================================
--- trunk/docs/merged/refmanual/build.sh 2013-03-15 15:02:00 UTC (rev 6383)
+++ trunk/docs/merged/refmanual/build.sh 2013-03-15 21:53:56 UTC (rev 6384)
@@ -1,3 +1,3 @@
#!/bin/sh
-asciidoc --attribute stylesheet=${PWD}/swift.css swiftlang
+asciidoc --attribute stylesheet=${PWD}/swift.css refmanual.txt
Added: trunk/docs/merged/refmanual/grammar
===================================================================
--- trunk/docs/merged/refmanual/grammar (rev 0)
+++ trunk/docs/merged/refmanual/grammar 2013-03-15 21:53:56 UTC (rev 6384)
@@ -0,0 +1,1381 @@
+== Swift Language Grammar
+
+The specification for a SwiftScript program
+----
+program:
+ (namespace_dec[code])*
+ (importStatement[code])*
+ (topLevelStatement[code])*
+ EOF
+ ;
+----
+
+Namespace Declaration
+----
+namespace_dec [StringTemplate code]
+{StringTemplate ns=template("nsDef");}:
+"namespace" (prefix:ID{ns.setAttribute("prefix", prefix.getText());})? uri:STRING_LITERAL SEMI {
+ ns.setAttribute("uri", uri.getText());
+ code.setAttribute("namespaces", ns);
+ if (ns.getAttribute("prefix") == null)
+ code.setAttribute("targetNS", ns.getAttribute("uri"));
+ }
+ ;
+----
+
+
+Import statement
+----
+importStatement [StringTemplate code] :
+"import" name:STRING_LITERAL SEMI {
+ StringTemplate i = template("import");
+ i.setAttribute("target", name.getText());
+ code.setAttribute("imports", i);
+ }
+ ;
+----
+
+Type Declaration
+----
+typedecl [StringTemplate code]
+{StringTemplate r=template("typeDef");
+ StringTemplate t=null;} :
+ "type" id:ID {
+ r.setAttribute("name", id.getText()); }
+ (
+ SEMI
+ |
+ (t=type
+ {
+ r.setAttribute("type", t);
+ }
+ SEMI
+ )
+ | structdecl[r]
+ )
+ {code.setAttribute("types", r);}
+ ;
+----
+
+Structure declaration
+----
+structdecl [StringTemplate code]
+{StringTemplate e=null, e1=null, t=null; String thisType = null;} :
+ LCURLY
+ (t=type id:ID
+ {
+ thisType = (String) t.getAttribute("name");
+ e=template("memberdefinition");
+ e.setAttribute("name", id.getText());
+ }
+ (LBRACK RBRACK { thisType = thisType + "[]"; })*
+ {
+ StringTemplate thisTypeTemplate;
+ thisTypeTemplate=template("type");
+ thisTypeTemplate.setAttribute("name", thisType);
+ e.setAttribute("type", thisTypeTemplate);
+ code.setAttribute("members", e);
+ }
+ (
+ COMMA
+ id1:ID
+ {
+ thisType = (String) t.getAttribute("name");
+ e1=template("memberdefinition");
+ e1.setAttribute("name", id1.getText());
+ }
+ (LBRACK RBRACK { thisType = thisType + "[]"; })*
+ {
+ StringTemplate thisTypeTemplate;
+ thisTypeTemplate=template("type");
+ thisTypeTemplate.setAttribute("name", thisType);
+ e1.setAttribute("type", thisTypeTemplate);
+ code.setAttribute("members", e1);
+ }
+ )*
+ SEMI
+ )*
+ RCURLY
+ (options {
+ warnWhenFollowAmbig = false;
+ }
+ :SEMI
+ )?
+ ;
+----
+
+Top level statement
+----
+topLevelStatement[StringTemplate code]
+{StringTemplate d=null; } :
+
+// these are ll(1) and easy to predict
+
+ typedecl[code]
+ | d=ll1statement
+ {
+ code.setAttribute("statements",d);
+ }
+
+// these are non-declaration assign-like statements
+
+ | (predictAssignStat) => d=assignStat
+ {
+ code.setAttribute("statements",d);
+ }
+
+// these are non-declaration append-associative array statements
+
+ | (predictAppendStat) => d=appendStat
+ {
+ code.setAttribute("statements",d);
+ }
+
+// they all begin with (id name)
+ | (predictDeclaration) => declaration[code]
+
+// more complicated function invocations
+// note that function invocations can happen in above statements too
+// this section is just the remaining more specialised invocations
+
+ | (procedurecallCode) => d=procedurecallCode
+ {
+ code.setAttribute("statements",d);
+ }
+
+ | (procedurecallStatAssignManyReturnParam[code]) => procedurecallStatAssignManyReturnParam[code]
+
+// this is a declaration, but not sorted out the predications yet to
+// group it into a decl block
+ | ("app") => d=appproceduredecl {code.setAttribute("functions",d);}
+ | (predictProceduredecl) => d=proceduredecl {code.setAttribute("functions", d);}
+ ;
+----
+
+
+Predicate Declaration
+----
+predictDeclaration {StringTemplate x,y;} : ("global") | (x=type y=declarator) ;
+
+declaration [StringTemplate code]
+{StringTemplate t=null;
+ boolean isGlobal = false;}
+ : ("global" {isGlobal = true;})?
+ t=type
+ declpart[code, t, isGlobal]
+ (COMMA declpart[code, t, isGlobal])*
+ SEMI
+ ;
+----
+
+Declaration part
+----
+declpart [StringTemplate code, StringTemplate t, boolean isGlobal]
+ {
+ StringTemplate n=null;
+ StringTemplate thisTypeTemplate=null;
+ String thisType = (String) t.getAttribute("name");
+ StringTemplate variable=null;
+ StringTemplate m = null;
+ StringTemplate sTemp = null;
+ String sType = "";
+ } :
+ n=declarator
+ (LBRACK
+ (sTemp=type {sType = (String) sTemp.getAttribute("name") ;} )?
+ RBRACK {thisType = thisType + "[" + sType + "]" ; sType = ""; } )*
+ {
+ thisTypeTemplate=template("type");
+ thisTypeTemplate.setAttribute("name", thisType);
+ variable = template("variable");
+ variable.setAttribute("name", n);
+ variable.setAttribute("type", thisTypeTemplate);
+ variable.setAttribute("global", ""+isGlobal);
+ code.setAttribute("statements", variable);
+ }
+
+ (LT (m=mappingdecl | f:STRING_LITERAL) GT
+ {
+ if (m!=null)
+ variable.setAttribute("mapping", m);
+ else
+ variable.setAttribute("lfn", quote(f.getText()));
+ })?
+
+// TODO: mapping does here...
+// which means construction of the variable template goes here, rather than
+// in procedurecallDecl/variableDecl
+
+ (
+ (predictProcedurecallDecl) => procedurecallDecl[code, thisTypeTemplate, n, variable]
+ | variableDecl[code, thisTypeTemplate, n, variable]
+// nice to lose this distinction entirely...
+// | (predictDatasetdecl) => datasetdecl[code, thisTypeTemplate, n]
+// TODO can shorten variableDecl predictor now we dont' need to
+// distinguish it from datasetdecl?
+ )
+ ;
+----
+
+Variable Declarator
+----
+variableDecl [StringTemplate code, StringTemplate t, StringTemplate d, StringTemplate v1]
+{StringTemplate i1=null, m=null;
+
+} :
+ (i1=varInitializer
+ {
+ if (i1 != null) {
+ StringTemplate valueAssignment = template("assign");
+ StringTemplate vr = template("variableReference");
+ vr.setAttribute("name",d);
+ valueAssignment.setAttribute("lhs",vr);
+ valueAssignment.setAttribute("rhs",i1);
+ code.setAttribute("statements", valueAssignment);
+ }
+ })?
+ ;
+----
+
+Declarator
+----
+declarator returns [StringTemplate code=null] :
+id:ID {code=text(id.getText());}
+ ;
+----
+
+
+Variable initializer
+----
+varInitializer returns [StringTemplate code=null] :
+ASSIGN code=expression
+ ;
+----
+
+This is an initializer used to set up an array.
+ currently does not support nested array.
+----
+arrayInitializer returns [StringTemplate code=template("arrayInit")]
+{StringTemplate e=null,from=null,to=null,step=null;} :
+LBRACK
+ (
+ (expression COLON) =>
+ (
+ from=expression COLON to=expression (COLON step=expression)?
+ {
+ StringTemplate range=template("range");
+ range.setAttribute("from", from);
+ range.setAttribute("to", to);
+ if (step != null)
+ range.setAttribute("step", step);
+ code.setAttribute("range", range);
+ }
+ )
+ |
+ (
+ e=expression {code.setAttribute("elements", e);}
+ (
+ // CONFLICT: does a COMMA after an initializer start a new
+ // initializer or start the option ',' at end?
+ // ANTLR generates proper code by matching
+ // the comma as soon as possible.
+ options {
+ warnWhenFollowAmbig = false;
+ } : COMMA e=expression {code.setAttribute("elements", e);}
+ )*
+ (COMMA)?
+ )
+ )?
+ RBRACK
+ ;
+----
+
+Mapping Declaration
+----
+mappingdecl returns [StringTemplate code=template("mapping")]
+{StringTemplate p=null, d=null;}
+ : d=declarator {code.setAttribute("descriptor",d);} SEMI
+ mapparamdecl[code]
+ ;
+----
+
+Mapping parameters declaration
+----
+mapparamdecl [StringTemplate code]
+{StringTemplate p=null;} :
+( p=mapparam {code.setAttribute("params", p);}
+ ( COMMA p=mapparam {code.setAttribute("params", p);} )*
+ )?
+ ;
+
+mapparam returns [StringTemplate code=template("mapParam")]
+{StringTemplate n=null, v=null;} :
+n=declarator ASSIGN v=mappingExpr
+ {
+ code.setAttribute("name", n);
+ code.setAttribute("value", v);
+ }
+ ;
+----
+
+This predicts in two different ways.
+The first choice is procedures with no return parameters. For these,
+we must predict as far as the opening { in order to distinguish
+from procedure calls to procedures with no return parameters.
+The second choice is for procedures with return parameters. Here we
+predict as far as the bracket after the procedure name. We have to
+predict on the return parameters, which means we won't get good
+error reporting when there is a syntax error in there.
+
+----
+predictProceduredecl
+{StringTemplate f=null;} :
+( id:ID LPAREN
+ ( f=formalParameter (COMMA f=formalParameter)* )?
+ RPAREN
+ LCURLY
+ )
+ |
+ (
+ LPAREN
+ f=formalParameter
+ ( COMMA f=formalParameter
+ )*
+ RPAREN ID LPAREN
+ )
+ ;
+----
+
+Procedure declaration
+----
+proceduredecl returns [StringTemplate code=template("function")]
+{StringTemplate f=null;} :
+( LPAREN
+ f=formalParameter
+ {
+ f.setAttribute("outlink", "true");
+ code.setAttribute("outputs", f);
+ }
+ ( COMMA f=formalParameter
+ {
+ f.setAttribute("outlink", "true");
+ code.setAttribute("outputs", f);
+ }
+ )*
+ RPAREN )?
+ id:ID {currentFunctionName=id.getText();} LPAREN
+ ( f=formalParameter
+ {
+ code.setAttribute("inputs", f);
+ }
+ ( COMMA f=formalParameter
+ {
+ code.setAttribute("inputs", f);
+ }
+ )*
+ )?
+ RPAREN
+ LCURLY
+ (
+ atomicBody[code]
+ |
+ compoundBody[code]
+ )
+ RCURLY
+ {
+ code.setAttribute("name", id.getText());
+ currentFunctionName=null;
+ }
+ ;
+----
+
+App procedure declaration
+----
+appproceduredecl returns [StringTemplate code=template("function")]
+{StringTemplate f=null;
+ StringTemplate app=template("app");
+ StringTemplate exec=null; } :
+ "app"
+ ( LPAREN
+ f=formalParameter
+ {
+ f.setAttribute("outlink", "true");
+ code.setAttribute("outputs", f);
+ }
+ ( COMMA f=formalParameter
+ {
+ f.setAttribute("outlink", "true");
+ code.setAttribute("outputs", f);
+ }
+ )*
+ RPAREN )?
+ id:ID {currentFunctionName=id.getText();} LPAREN
+ ( f=formalParameter
+ {
+ code.setAttribute("inputs", f);
+ }
+ ( COMMA f=formalParameter
+ {
+ code.setAttribute("inputs", f);
+ }
+ )*
+ )?
+ RPAREN
+ LCURLY
+ ( appProfile[app] )*
+ exec=declarator
+ {app.setAttribute("exec",exec);}
+ ( appArg[app] )* SEMI
+ {code.setAttribute("config",app);}
+ RCURLY
+ {
+ code.setAttribute("name", id.getText());
+ currentFunctionName=null;
+ }
+ ;
+----
+
+App profile
+----
+appProfile [StringTemplate code]
+{ StringTemplate p=null;
+ StringTemplate k=null;
+ StringTemplate v=null;} :
+ "profile" k=expression ASSIGN v=expression SEMI {
+ p=template("app_profile");
+ p.setAttribute("key", k);
+ p.setAttribute("value", v);
+ code.setAttribute("profiles", p);
+ }
+ ;
+----
+
+TODO in here, why do we have an | between LBRACKBRACK and ASSIGN?
+does this mean that we don't have array initialisation in formal
+params? this wouldn't surprise me given the previous treatment
+of arrays. investigate this and fix...
+
+----
+formalParameter returns [StringTemplate code=template("parameter")]
+{StringTemplate t=null,d=null,v=null; String thisType = null; } :
+(t=type d=declarator
+ {
+ thisType = (String) t.getAttribute("name");
+ code.setAttribute("name", d);
+ }
+ (LBRACK RBRACK {thisType = thisType + "[]"; })*
+ (ASSIGN v=constant
+ {
+ String value = (String)v.getAttribute("value");
+ if (v.getName().equals("sConst")) {
+ v.removeAttribute("value");
+ v.setAttribute("value", quote(value));
+ }
+ code.setAttribute("defaultv", v);
+ }
+ )?) {
+ StringTemplate thisTypeTemplate;
+ thisTypeTemplate=template("type");
+ thisTypeTemplate.setAttribute("name", thisType);
+ code.setAttribute("type", thisTypeTemplate);
+ }
+ ;
+----
+
+Type declaration
+----
+type returns [ StringTemplate code = null ]
+ { StringBuilder buf = new StringBuilder(); } :
+ id:ID {
+ code = template("type");
+ buf.append(id.getText());
+ }
+ (typeSubscript[buf]) * {
+ code.setAttribute("name", buf.toString());
+ }
+;
+----
+
+Type Subscript
+----
+typeSubscript[StringBuilder buf] :
+ LBRACK { buf.append('['); }
+ (id:ID { buf.append(id.getText()); })?
+ RBRACK { buf.append(']'); }
+;
+----
+
+Compound Statement
+----
+compoundStat[StringTemplate code]
+ : LCURLY
+ ( innerStatement[code] )*
+ RCURLY
+ ;
+----
+
+Compound body
+----
+compoundBody[StringTemplate code]
+ : ( innerStatement[code] )*
+ ;
+
+innerStatement[StringTemplate code]
+{StringTemplate s=null;}
+ : (predictDeclaration) => declaration[code]
+ |
+ ((
+ s=ll1statement
+ | (procedurecallCode) => s=procedurecallCode
+ | (predictAssignStat) => s=assignStat
+ | (predictAppendStat) => s=appendStat
+ )
+ {
+ code.setAttribute("statements",s);
+ })
+ | (procedurecallStatAssignManyReturnParam[code]) => procedurecallStatAssignManyReturnParam[code]
+ ;
+----
+
+Case Inner Statement
+----
+caseInnerStatement [StringTemplate statements]
+{ StringTemplate code = null; }
+ :
+ ( code=ll1statement
+ | (procedurecallCode) => code=procedurecallCode
+ | (predictAssignStat) => code=assignStat
+ | (predictAppendStat) => code=appendStat
+ ) {statements.setAttribute("statements",code);}
+ | (procedurecallStatAssignManyReturnParam[statements]) => procedurecallStatAssignManyReturnParam[statements]
+ ;
+----
+
+These are the statements that we can predict with ll(1) grammer
+i.e. with one token of lookahead
+
+----
+ll1statement returns [StringTemplate code=null]
+ :
+ code=ifStat
+ | code=foreachStat
+ | code=switchStat
+ | code=iterateStat
+ ;
+----
+If statement
+----
+ifStat returns [StringTemplate code=template("if")]
+{
+ StringTemplate cond=null;
+ StringTemplate body=template("statementList");
+ StringTemplate els=template("statementList");
+}
+ : "if" LPAREN cond=expression RPAREN {
+ code.setAttribute("cond", cond);
+ }
+ compoundStat[body] {code.setAttribute("body", body);}
+ (
+ options {
+ warnWhenFollowAmbig = false;
+ }
+ : "else"
+ compoundStat[els] {code.setAttribute("els", els);}
+ )?
+ ;
+----
+
+Foreach statement
+----
+foreachStat returns [StringTemplate code=template("foreach")] {
+ StringTemplate ds=null;
+ StringTemplate body=template("statementList");
+}
+ : "foreach" id:ID (COMMA indexId:ID)? "in" ds=expression {
+ code.setAttribute("var", id.getText());
+ code.setAttribute("in", ds);
+ if (indexId != null) {
+ code.setAttribute("index", indexId.getText());
+ }
+ }
+ compoundStat[body] {code.setAttribute("body", body);}
+ ;
+----
+
+Iterate statement
+----
+iterateStat returns [StringTemplate code=template("iterate")]
+{
+ StringTemplate cond=null;
+ StringTemplate body=template("statementList");
+}
+ : "iterate" id:ID
+ compoundStat[body] {code.setAttribute("body", body);}
+ "until" LPAREN cond=expression RPAREN SEMI
+ {
+ code.setAttribute("var", id.getText());
+ code.setAttribute("cond", cond);
+ }
+ ;
+----
+
+Switch statement
+
+----
+switchStat returns [StringTemplate code=template("switch")]
+{
+ StringTemplate cond=null, b=null;
+}
+ : "switch" LPAREN cond=expression RPAREN
+ {code.setAttribute("cond", cond);}
+ LCURLY
+ ( b = casesGroup {code.setAttribute("cases", b);} )*
+ RCURLY
+ ;
+----
+
+Cases Group
+----
+casesGroup returns [StringTemplate code=template("case")]
+{StringTemplate b=null;}
+ : ( // CONFLICT: to which case group do the statements bind?
+ // ANTLR generates proper code: it groups the
+ // many "case"/"default" labels together then
+ // follows them with the statements
+ options {
+ greedy = true;
+ }
+ :
+ aCase[code]
+ )
+ caseSList[code]
+ ;
+
+aCase [StringTemplate code]
+{StringTemplate v=null;}
+ : (
+ "case" v=expression {code.setAttribute("value", v);}
+ | "default"
+ )
+ COLON
+ ;
+----
+
+Case Slist
+----
+caseSList [StringTemplate code]
+{StringTemplate s=null;}
+ : ( caseInnerStatement[code] )*
+ ;
+----
+
+Predict assignment statement
+----
+predictAssignStat
+{StringTemplate x=null;}
+ : x=identifier ASSIGN ;
+----
+
+Predict append statement
+----
+predictAppendStat
+{StringTemplate x=null;}
+ : x=identifier APPEND ;
+----
+
+Assignment statement
+----
+assignStat returns [StringTemplate code=null]
+{StringTemplate id=null;}
+ :
+ id=identifier
+ ASSIGN
+ (
+ (predictProcedurecallAssign) => code=procedurecallCode
+ { StringTemplate o = template("returnParam");
+ o.setAttribute("name",id);
+ code.setAttribute("outputs",o);
+ }
+ |
+ code=variableAssign
+ {
+ code.setAttribute("lhs",id);
+ }
+ )
+ ;
+----
+
+Append statement
+----
+appendStat returns [ StringTemplate code = null ]
+ { StringTemplate id=null; }
+:
+ id=identifier
+ APPEND
+ (
+ (predictProcedurecallAssign) => code=procedurecallCode {
+ StringTemplate o = template("returnParam");
+ o.setAttribute("name",id);
+ code.setAttribute("outputs",o);
+ }
+ |
+ code=arrayAppend {
+ code.setAttribute("array", id);
+ }
+ )
+;
+----
+
+Array append statement
+----
+arrayAppend returns [ StringTemplate code = null ]
+ { StringTemplate a = null, e = null, id = null; }
+:
+ e = expression SEMI {
+ code = template("append");
+ code.setAttribute("value", e);
+ }
+;
+----
+
+Variable Assign statement
+----
+variableAssign returns [StringTemplate code=null]
+{StringTemplate a=null, e=null, id=null;}
+ :
+ e=expression SEMI {
+ code=template("assign");
+ code.setAttribute("rhs", e);
+ }
+ ;
+----
+
+Procedure call
+----
+procedurecallCode returns [StringTemplate code=template("call")]
+{StringTemplate f=null;}
+ :
+ procedureInvocation[code]
+ ;
+----
+
+procedure invocation
+----
+procedureInvocation [StringTemplate code]
+ :
+ procedureInvocationWithoutSemi[code]
+ SEMI
+ ;
+----
+
+procedure invocation without semicolon
+----
+procedureInvocationWithoutSemi [StringTemplate code]
+{StringTemplate f=null;}
+ :
+ id:ID {code.setAttribute("func", id.getText());}
+ LPAREN
+ ( f=actualParameter {
+ code.setAttribute("inputs", f);
+ }
+ ( COMMA f=actualParameter {
+ code.setAttribute("inputs", f);
+ }
+ )*
+ )?
+ RPAREN
+ ;
+----
+
+procedure invocation expression
+----
+procedureInvocationExpr [StringTemplate code]
+{StringTemplate f=null;}
+ :
+ id:ID {code.setAttribute("func", id.getText());}
+ LPAREN (
+ f=actualParameter {
+ code.setAttribute("inputs", f);
+ }
+ (
+ COMMA f=actualParameter {
+ code.setAttribute("inputs", f);
+ }
+ )*
+ )?
+ RPAREN
+ ;
+----
+
+procedure call expression
+----
+procedureCallExpr returns [StringTemplate code=template("call")]
+{StringTemplate f=null;}
+ :
+ procedureInvocationExpr[code]
+ ;
+----
+
+
+----
+predictProcedurecallDecl : ASSIGN ID LPAREN ;
+
+procedurecallDecl [StringTemplate container, StringTemplate type, StringTemplate decl, StringTemplate var]
+{
+StringTemplate code=template("call");
+StringTemplate f=template("returnParam");
+
+StringTemplate declref=template("variableReference");
+declref.setAttribute("name",decl);
+f.setAttribute("name", declref);
+code.setAttribute("outputs", f);
+container.setAttribute("statements",code);
+
+}
+ :
+ ASSIGN
+ procedureInvocationWithoutSemi[code]
+ ;
+----
+
+----
+procedurecallStatAssignManyReturnParam [StringTemplate s]
+{ StringTemplate code=template("call"); }
+ :
+ LPAREN
+ procedurecallStatAssignManyReturnOutput[s,code]
+ ( COMMA procedurecallStatAssignManyReturnOutput[s,code] )*
+ RPAREN
+ ASSIGN
+ procedureInvocation[code]
+ {
+ s.setAttribute("statements",code);
+ }
+ ;
+----
+
+----
+procedurecallStatAssignManyReturnOutput [StringTemplate s, StringTemplate code]
+{StringTemplate var = null, f = null; }
+ :
+ f=returnParameter
+ {
+ code.setAttribute("outputs", f);
+ var = template("variable");
+ if(f.getAttribute("type") != null) {
+ StringTemplate nameST = (StringTemplate)f.getAttribute("name");
+ var.setAttribute("name",nameST.getAttribute("name"));
+ var.setAttribute("type",f.getAttribute("type"));
+ var.setAttribute("global", Boolean.FALSE);
+
+ s.setAttribute("statements",var);
+ }
+ }
+ ;
+----
+
+----
+returnParameter returns [ StringTemplate code = template("returnParam") ]
+ { StringTemplate t = null, id = null, d = null; StringBuilder buf = new StringBuilder(); }
+:
+ t = identifier { buf.append(t.getAttribute("name")); }
+ (typeSubscript[buf])*
+ ( id = identifier )?
+ {
+ if (id == null) {
+ code.setAttribute("name", t);
+ }
+ else {
+ t = template("type");
+ t.setAttribute("name", buf.toString());
+ code.setAttribute("name", id);
+ code.setAttribute("type", t);
+ }
+ }
+ ((ASSIGN declarator) => (ASSIGN d=declarator) {
+ code.setAttribute("bind", d);
+ })?
+;
+----
+
+----
+actualParameter returns [StringTemplate code=template("actualParam")]
+{StringTemplate d=null, id=null, ai=null;}
+ :
+ (
+ (declarator ASSIGN)=> (d=declarator ASSIGN)
+ {
+ code.setAttribute("bind", d);
+ }
+ )?
+ id=expression {
+ code.setAttribute("value", id);
+ }
+ ;
+----
+
+----
+atomicBody [StringTemplate code]
+{StringTemplate app=null, svc=null;}
+ : app=appSpec
+ {code.setAttribute("config",app);}
+ ;
+----
+
+/* This is the deprecated format for app { } blocks */
+----
+appSpec returns [StringTemplate code=template("app")]
+{StringTemplate exec=null;}
+ : "app" LCURLY
+ exec=declarator
+ { code.setAttribute("exec", exec);}
+ (
+ appArg[code]
+ )*
+ SEMI RCURLY
+ ;
+----
+
+----
+appArg [StringTemplate code]
+{StringTemplate arg=null;}
+ : arg=mappingExpr
+ {code.setAttribute("arguments", arg);}
+ |
+ stdioArg[code]
+ ;
+----
+
+----
+mappingExpr returns [StringTemplate code=null]
+{StringTemplate e=null;}
+ :
+ e = expression
+ {
+ code=template("mappingExpr");
+ code.setAttribute("expr", e);
+ }
+ ;
+----
+
+----
+functionInvocation returns [StringTemplate code=template("functionInvocation")]
+{StringTemplate func=null, e=null;}
+ : AT (
+ (declarator LPAREN) =>
+ (func=declarator
+ {
+ code.setAttribute("name", func);
+ }
+ LPAREN
+ (
+ functionInvocationArgument[code]
+ (
+ COMMA
+ functionInvocationArgument[code]
+ )*)?
+ RPAREN
+ )
+ |
+ (e=identifier | (LPAREN e=identifier RPAREN) )
+ {
+ code.setAttribute("name", "filename");
+ code.setAttribute("args", e);
+ })
+ ;
+----
+
+----
+functionInvocationArgument [StringTemplate code]
+{StringTemplate e = null;}
+ :
+ e=expression
+ {
+ code.setAttribute("args", e);
+ }
+ ;
+----
+
+----
+stdioArg [StringTemplate code]
+{StringTemplate t=null,m=null; String name=null;}
+ : ("stdin" {t=template("stdin"); name="stdin";}
+ |
+ "stdout" {t=template("stdout"); name="stdout";}
+ |
+ "stderr" {t=template("stderr"); name="stderr";}
+ )
+ ASSIGN
+ m=mappingExpr
+ {
+ t.setAttribute("content", m);
+ code.setAttribute(name, t);
+ }
+ ;
+----
+
+----
+expression returns [StringTemplate code=null]
+ : code=orExpr
+ ;
+----
+
+----
+orExpr returns [StringTemplate code=null]
+{StringTemplate a,b;}
+ : code=andExpr
+ ( OR b=andExpr
+ {
+ a = code;
+ code=template("or");
+ code.setAttribute("left", a);
+ code.setAttribute("right", b);
+ }
+ )*
+ ;
+----
+
+----
+andExpr returns [StringTemplate code=null]
+{StringTemplate a,b;}
+ : code=equalExpr
+ ( AND b=equalExpr
+ {
+ a = code;
+ code=template("and");
+ code.setAttribute("left", a);
+ code.setAttribute("right", b);
+ }
+ )*
+ ;
+----
+
+----
+equalExpr returns [StringTemplate code=null]
+{
+StringTemplate a,b=null;
+Token op=null;
+}
+ : code=condExpr
+ (
+ {op=LT(1);}
+ ( EQ | NE ) b=condExpr
+ {
+ a = code;
+ code=template("cond");
+ code.setAttribute("op", escape(op.getText()));
+ code.setAttribute("left", a);
+ code.setAttribute("right", b);
+ }
+ )?
+ ;
+----
+
+----
+condExpr returns [StringTemplate code=null] {
+StringTemplate a,b=null;
+Token op=null;
+} : code=additiveExpr
+ (
+ options {
+ greedy = true;
+ //warnWhenFollowAmbig = false;
+ }
+ :
+ {op=LT(1);}
+ ( LT | LE | GT | GE ) b=additiveExpr
+ {
+ a = code;
+ code=template("cond");
+ code.setAttribute("op", escape(op.getText()));
+ code.setAttribute("left", a);
+ code.setAttribute("right", b);
+ }
+ )?
+ ;
+----
+
+
+----
+additiveExpr returns [StringTemplate code=null]
+{
+StringTemplate a,b=null;
+Token op=null;
+}
+ : code=multiExpr
+ (
+ options {
+ greedy = true;
+ //warnWhenFollowAmbig = false;
+ }
+ :
+ {op=LT(1);}
+ ( PLUS | MINUS ) b=multiExpr
+ {
+ a = code;
+ code=template("arith");
+ code.setAttribute("op", escape(op.getText()));
+ code.setAttribute("left", a);
+ code.setAttribute("right", b);
+ }
+ )*
+ ;
+----
+
+----
+multiExpr returns [StringTemplate code=null]
+{
+StringTemplate a,b=null;
+Token op=null;
+}
+ : code=unaryExpr
+ (
+ options {
+ greedy = true;
+ //warnWhenFollowAmbig = false;
+ }
+ :
+ {op=LT(1);}
+ ( STAR | IDIV | FDIV | MOD ) b=unaryExpr
+ {
+ a = code;
+ code=template("arith");
+ code.setAttribute("op", escape(op.getText()));
+ code.setAttribute("left", a);
+ code.setAttribute("right", b);
+ }
+ )*
+ ;
+----
+
+----
+unaryExpr returns [StringTemplate code=null]
+{StringTemplate u=null;}
+ : MINUS u=unaryExpr
+ {code=template("unaryNegation"); code.setAttribute("exp", u);}
+ | PLUS u=unaryExpr // unary plus has no effect
+ {code=u;}
+ | NOT u=unaryExpr
+ {code=template("not"); code.setAttribute("exp", u);}
+ | code=primExpr
+ ;
+----
+
+----
+primExpr returns [StringTemplate code=null]
+{StringTemplate id=null, exp=null;}
+ : (predictProcedureCallExpr) => code=procedureCallExpr
+ | code=identifier
+ | LPAREN exp=orExpr RPAREN { code=template("paren");
+ code.setAttribute("exp", exp);}
+ | code=constant
+ | code=functionInvocation
+ ;
+----
+
+----
+predictProcedureCallExpr
+ : ID LPAREN ;
+
+----
+// TODO - redo identifier parsing to fit in with the XML style
+// that this patch introduces
+
+// specifically, need the base ID to be distinct from all the
+// other IDs
+
+----
+identifier returns [StringTemplate code=null]
+{
+ StringTemplate c=null;
+ code=template("variableReference");
+}
+ :
+ base:ID {code.setAttribute("name",base.getText());}
+
+ ( ( c=arrayIndex { c.setAttribute("array",code); code=c; } )
+ |
+ ( c=memberName {c.setAttribute("structure",code); code=c;} )
+ )*
+ ;
+----
+
+
+----
+arrayIndex returns [StringTemplate code=null]
+{StringTemplate e=null;}
+ :
+ LBRACK
+ (e=expression | s:STAR)
+ RBRACK
+ {
+ code=template("arraySubscript");
+ if(e != null) code.setAttribute("subscript",e);
+ if(s != null) {
+ StringTemplate st = template("sConst");
+ st.setAttribute("value","*");
+ code.setAttribute("subscript",st);
+ }
+ }
+ ;
+----
+
+----
+memberName returns [StringTemplate code=null]
+ :
+ d:DOT (member:ID | s:STAR)
+ {
+ code=template("memberAccess");
+ if(member != null) code.setAttribute("name",member.getText());
+ if(s != null) code.setAttribute("name","*");
+ }
+ ;
+----
+
+----
+constant returns [StringTemplate code=null]
+ : i:INT_LITERAL
+ {
+ code=template("iConst");
+ code.setAttribute("value",i.getText());
+ }
+ | d:FLOAT_LITERAL
+ {
+ code=template("fConst");
+ code.setAttribute("value",d.getText());
+ }
+ | s:STRING_LITERAL
+ {
+ code=template("sConst");
+ code.setAttribute("value",quote(escape(s.getText())));
+ }
+ | t:"true"
+ {
+ code=template("bConst");
+ code.setAttribute("value", t.getText());
+ }
+ | f:"false"
+ {
+ code=template("bConst");
+ code.setAttribute("value", f.getText());
+ }
+ | code=arrayInitializer
+ ;
+----
+
+// TODO ^^^^^^ array literal -- rename and rearrange the methods
+
+
+----
+AT : "@" ;
+PLUS : "+" ;
+MINUS : '-' ;
+FDIV : '/' ;
+IDIV : "%/" ;
+MOD : "%%" ;
+EQ : "==" ;
+NE : "!=" ;
+LT : '<' ;
+LE : "<=" ;
+GT : ">" ;
+GE : ">=";
+APPEND : "<<";
+ASSIGN : '=' ;
+AND : "&&";
+OR : "||";
+NOT : "!";
+LBRACK options { paraphrase = "'['"; } : '[' ;
+RBRACK options { paraphrase = "']'"; } : ']' ;
+LPAREN options { paraphrase = "'('"; } : '(' ;
+RPAREN options { paraphrase = "')'"; } : ')' ;
+LCURLY options { paraphrase = "'{'"; } : '{' ;
+RCURLY options { paraphrase = "'}'"; } : '}' ;
+SEMI options { paraphrase = "a semicolon"; } : ';' ;
+
+----
+
+Id
+
+----
+ID options
+ {
+ paraphrase = "an identifier";
+ testLiterals = true;
+ }
+ :
+ ('a'..'z'|'A'..'Z'|'_') ('a'..'z'|'A'..'Z'|'0'..'9'|'_')*
+ ;
+----
+
+----
+// string literals
+STRING_LITERAL
+// : '"'! (~('"'|'\n'|'\r'))* '"'!
+ : '"'! (escape_sequence|~('"'|'\\'|'\n'|'\r'))* '"'!
+ ;
+
+NUMBER
+ :
+ ( INTPART {_ttype=INT_LITERAL; }
+ ('.' FLOATPART {_ttype=FLOAT_LITERAL; })?
+ (EXPONENT {_ttype=FLOAT_LITERAL; })?
+ )
+ |
+ ( '.' { _ttype=DOT; }
+ ((FLOATPART {_ttype=FLOAT_LITERAL; })
+ (EXPONENT)?)?
+ )
+ ;
+
+
+whitespace : ( ' '
+ | '\t'
+ | '\r'
+ | '\n' {newline();}
+ )+
+ { $setType(Token.SKIP); }
+ ;
+
+singleline_ccomment:
+ "//"
+ (~('\n'|'\r'))* ('\n'|'\r'('\n')?)
+ {$setType(Token.SKIP); newline();}
+ ;
+
+singleline_scomment:
+ "#"
+ (~('\n'|'\r'))* ('\n'|'\r'('\n')?)
+ {$setType(Token.SKIP); newline();}
+ ;
+
+multiline_comment :
+ "/*"
+ (
+ options {
+ generateAmbigWarnings=false;
+ }
+ :
+ { LA(2)!='/' }? '*'
+ | '\r' '\n' {newline();}
+ | '\r' {newline();}
+ | '\n' {newline();}
+ | ~('*'|'\n'|'\r')
+ )*
+ "*/"
+ {$setType(Token.SKIP);}
+ ;
+
+escape_sequence :
+ '\\'
+ ( 'n'
+ | 'r'
+ | 't'
+ | 'b'
+ | 'f'
+ | '"'
+ | '\''
+ | '\\'
+ )
+ ;
+
+----
Modified: trunk/docs/merged/refmanual/swiftlang
===================================================================
--- trunk/docs/merged/refmanual/swiftlang 2013-03-15 15:02:00 UTC (rev 6383)
+++ trunk/docs/merged/refmanual/swiftlang 2013-03-15 21:53:56 UTC (rev 6384)
@@ -1,17 +1,5 @@
-////
-Swift Language Reference Manual, asciidoc format
-////
-
-:toc:
-:numbered:
-
-////
-Settings:
-////
-:miscellaneous.newline: \n
-
-= Swift Language Referance Manual
+== Swift Language Reference Manual
This reference manual semi-formally outlines the Swift language conventions
== Support
From hategan at ci.uchicago.edu Sat Mar 16 17:48:12 2013
From: hategan at ci.uchicago.edu (hategan at ci.uchicago.edu)
Date: Sat, 16 Mar 2013 17:48:12 -0500 (CDT)
Subject: [Swift-commit] r6385 -
branches/release-0.94/src/org/griphyn/vdl/mapping
Message-ID: <20130316224812.29EBC9CC99@svn.ci.uchicago.edu>
Author: hategan
Date: 2013-03-16 17:48:10 -0500 (Sat, 16 Mar 2013)
New Revision: 6385
Added:
branches/release-0.94/src/org/griphyn/vdl/mapping/MappingException.java
Modified:
branches/release-0.94/src/org/griphyn/vdl/mapping/AbstractDataNode.java
branches/release-0.94/src/org/griphyn/vdl/mapping/DataDependentException.java
branches/release-0.94/src/org/griphyn/vdl/mapping/DependentException.java
branches/release-0.94/src/org/griphyn/vdl/mapping/MappingDependentException.java
branches/release-0.94/src/org/griphyn/vdl/mapping/RootArrayDataNode.java
branches/release-0.94/src/org/griphyn/vdl/mapping/RootDataNode.java
Log:
fixed mapping errors not being reported and causing a hang (bug 967)
Modified: branches/release-0.94/src/org/griphyn/vdl/mapping/AbstractDataNode.java
===================================================================
--- branches/release-0.94/src/org/griphyn/vdl/mapping/AbstractDataNode.java 2013-03-15 21:53:56 UTC (rev 6384)
+++ branches/release-0.94/src/org/griphyn/vdl/mapping/AbstractDataNode.java 2013-03-16 22:48:10 UTC (rev 6385)
@@ -29,7 +29,6 @@
import java.util.Map;
import org.apache.log4j.Logger;
-import org.globus.cog.karajan.workflow.ExecutionException;
import org.globus.cog.karajan.workflow.futures.Future;
import org.globus.cog.karajan.workflow.futures.FutureNotYetAvailable;
import org.griphyn.vdl.karajan.DSHandleFutureWrapper;
Modified: branches/release-0.94/src/org/griphyn/vdl/mapping/DataDependentException.java
===================================================================
--- branches/release-0.94/src/org/griphyn/vdl/mapping/DataDependentException.java 2013-03-15 21:53:56 UTC (rev 6384)
+++ branches/release-0.94/src/org/griphyn/vdl/mapping/DataDependentException.java 2013-03-16 22:48:10 UTC (rev 6385)
@@ -35,7 +35,7 @@
}
public String getMessage() {
- return getVariableName() + " not derived due to errors in data dependencies";
+ return getVariableInfo() + " not derived due to errors in data dependencies";
}
}
Modified: branches/release-0.94/src/org/griphyn/vdl/mapping/DependentException.java
===================================================================
--- branches/release-0.94/src/org/griphyn/vdl/mapping/DependentException.java 2013-03-15 21:53:56 UTC (rev 6384)
+++ branches/release-0.94/src/org/griphyn/vdl/mapping/DependentException.java 2013-03-16 22:48:10 UTC (rev 6385)
@@ -50,6 +50,16 @@
return handle.toString();
}
}
+
+ public String getVariableInfo() {
+ if (handle instanceof AbstractDataNode) {
+ AbstractDataNode n = (AbstractDataNode) handle;
+ return n.getDisplayableName() + ", line " + n.getDeclarationLine();
+ }
+ else {
+ return handle.toString();
+ }
+ }
public String toString() {
return getMessage();
Modified: branches/release-0.94/src/org/griphyn/vdl/mapping/MappingDependentException.java
===================================================================
--- branches/release-0.94/src/org/griphyn/vdl/mapping/MappingDependentException.java 2013-03-15 21:53:56 UTC (rev 6384)
+++ branches/release-0.94/src/org/griphyn/vdl/mapping/MappingDependentException.java 2013-03-16 22:48:10 UTC (rev 6385)
@@ -35,6 +35,6 @@
}
public String getMessage() {
- return getHandle() + " not mapped due to error in mapping dependencies";
+ return getVariableInfo() + " not mapped due to error in mapping dependencies";
}
}
Added: branches/release-0.94/src/org/griphyn/vdl/mapping/MappingException.java
===================================================================
--- branches/release-0.94/src/org/griphyn/vdl/mapping/MappingException.java (rev 0)
+++ branches/release-0.94/src/org/griphyn/vdl/mapping/MappingException.java 2013-03-16 22:48:10 UTC (rev 6385)
@@ -0,0 +1,27 @@
+//----------------------------------------------------------------------
+//This code is developed as part of the Java CoG Kit project
+//The terms of the license can be found at http://www.cogkit.org/license
+//This message may not be removed or altered.
+//----------------------------------------------------------------------
+
+/*
+ * Created on Mar 16, 2013
+ */
+package org.griphyn.vdl.mapping;
+
+public class MappingException extends DependentException {
+
+ public MappingException(DSHandle handle, Exception prev) {
+ super(handle, prev);
+ }
+
+ public MappingException(DSHandle handle) {
+ super(handle);
+ }
+
+ @Override
+ public String getMessage() {
+ return getVariableInfo() + " had mapping errors";
+ }
+
+}
Modified: branches/release-0.94/src/org/griphyn/vdl/mapping/RootArrayDataNode.java
===================================================================
--- branches/release-0.94/src/org/griphyn/vdl/mapping/RootArrayDataNode.java 2013-03-15 21:53:56 UTC (rev 6384)
+++ branches/release-0.94/src/org/griphyn/vdl/mapping/RootArrayDataNode.java 2013-03-16 22:48:10 UTC (rev 6385)
@@ -105,12 +105,16 @@
}
catch (DependentException e) {
setValue(new MappingDependentException(this, e));
- closeShallow();
}
}
- public void futureModified(Future f, VariableStack stack) {
- innerInit();
+ public void futureModified(Future f, VariableStack stack) {
+ try {
+ innerInit();
+ }
+ catch (Exception e) {
+ this.setValue(new MappingException(this, e));
+ }
}
public String getParam(MappingParam p) {
Modified: branches/release-0.94/src/org/griphyn/vdl/mapping/RootDataNode.java
===================================================================
--- branches/release-0.94/src/org/griphyn/vdl/mapping/RootDataNode.java 2013-03-15 21:53:56 UTC (rev 6384)
+++ branches/release-0.94/src/org/griphyn/vdl/mapping/RootDataNode.java 2013-03-16 22:48:10 UTC (rev 6385)
@@ -108,13 +108,16 @@
}
catch (DependentException e) {
setValue(new MappingDependentException(this, e));
- closeShallow();
- return;
}
}
public void futureModified(Future f, VariableStack stack) {
- innerInit();
+ try {
+ innerInit();
+ }
+ catch (Exception e) {
+ this.setValue(new MappingException(this, e));
+ }
}
From swift at ci.uchicago.edu Sat Mar 16 17:50:04 2013
From: swift at ci.uchicago.edu (swift at ci.uchicago.edu)
Date: Sat, 16 Mar 2013 17:50:04 -0500 (CDT)
Subject: [Swift-commit] cog r3640
Message-ID: <20130316225005.6EFAC8D000A2@bridled.ci.uchicago.edu>
------------------------------------------------------------------------
r3640 | hategan | 2013-03-16 17:46:51 -0500 (Sat, 16 Mar 2013) | 1 line
catch and report all exceptions
------------------------------------------------------------------------
Index: modules/karajan/src/org/globus/cog/karajan/workflow/nodes/AbstractParallelIterator.java
===================================================================
--- modules/karajan/src/org/globus/cog/karajan/workflow/nodes/AbstractParallelIterator.java (revision 3639)
+++ modules/karajan/src/org/globus/cog/karajan/workflow/nodes/AbstractParallelIterator.java (working copy)
@@ -31,6 +31,9 @@
catch (ExecutionException e) {
failImmediately(stack, e);
}
+ catch (Exception e) {
+ failImmediately(stack, e);
+ }
}
From hategan at ci.uchicago.edu Sun Mar 17 02:48:18 2013
From: hategan at ci.uchicago.edu (hategan at ci.uchicago.edu)
Date: Sun, 17 Mar 2013 02:48:18 -0500 (CDT)
Subject: [Swift-commit] r6386 -
branches/release-0.94/src/org/griphyn/vdl/karajan/lib
Message-ID: <20130317074819.343999D578@svn.ci.uchicago.edu>
Author: hategan
Date: 2013-03-17 02:47:59 -0500 (Sun, 17 Mar 2013)
New Revision: 6386
Modified:
branches/release-0.94/src/org/griphyn/vdl/karajan/lib/ThrottledParallelFor.java
Log:
fixed extra call to decRefs when self closing is enabled (bug 955)
Modified: branches/release-0.94/src/org/griphyn/vdl/karajan/lib/ThrottledParallelFor.java
===================================================================
--- branches/release-0.94/src/org/griphyn/vdl/karajan/lib/ThrottledParallelFor.java 2013-03-16 22:48:10 UTC (rev 6385)
+++ branches/release-0.94/src/org/griphyn/vdl/karajan/lib/ThrottledParallelFor.java 2013-03-17 07:47:59 UTC (rev 6386)
@@ -119,17 +119,36 @@
startIteration(tc, var, i.current(), tc.tryIncrement(), stack);
}
- decRefs(tc.rc);
+ if (!tc.selfClose) {
+ decRefs(tc.rc);
+ }
int left;
synchronized(tc) {
- // can only have closed and running = 0 in one place
+ // can only have closed and running = 0 in one of the two critical sections
+ // related to tc. One (CS1) is this and the other one (CS2) is:
+ // closed = tc.isClosed();
+ // running = tc.decrement();
+ //
+ // If on the last iteration CS1 runs before CS2, then:
+ // CS1 - (closed = true, left > 0), CS2 - (closed = true, --running == 0)
+ // If CS2 runs before CS1:
+ // CS2 - (closed = false, --running == 0), CS1 - (closed = true, left == 0).
tc.close();
left = tc.current();
}
if (left == 0) {
- complete(stack);
+ // i.e., no iteration running
+ if (!tc.selfClose) {
+ // when selfClose is on, decRefs() and complete() are called
+ // as part of the self closing logic, so don't invoke them again
+ complete(stack);
+ }
}
+ else {
+ // complete() will be called when
+ // the last iteration completes (in iterationCompleted).
+ }
}
catch (FutureIteratorIncomplete fii) {
synchronized (stack.currentFrame()) {
@@ -231,9 +250,11 @@
boolean done = false;
if (running == 0) {
if (closed) {
+ // write refs were decremented when the last
+ // iteration was started
complete(stack);
}
- if (tc.selfClose && !iteratorHasValues) {
+ else if (tc.selfClose && !iteratorHasValues) {
decRefs(tc.rc);
complete(stack);
}
From hategan at ci.uchicago.edu Sun Mar 17 02:49:58 2013
From: hategan at ci.uchicago.edu (hategan at ci.uchicago.edu)
Date: Sun, 17 Mar 2013 02:49:58 -0500 (CDT)
Subject: [Swift-commit] r6387 - in
branches/release-0.94/src/org/griphyn/vdl: engine mapping
mapping/file
Message-ID: <20130317074958.6F37A9D04B@svn.ci.uchicago.edu>
Author: hategan
Date: 2013-03-17 02:49:58 -0500 (Sun, 17 Mar 2013)
New Revision: 6387
Modified:
branches/release-0.94/src/org/griphyn/vdl/engine/Karajan.java
branches/release-0.94/src/org/griphyn/vdl/mapping/AbstractMapper.java
branches/release-0.94/src/org/griphyn/vdl/mapping/Mapper.java
branches/release-0.94/src/org/griphyn/vdl/mapping/MapperFactory.java
branches/release-0.94/src/org/griphyn/vdl/mapping/file/AbstractFileMapper.java
branches/release-0.94/src/org/griphyn/vdl/mapping/file/ArrayFileMapper.java
branches/release-0.94/src/org/griphyn/vdl/mapping/file/CSVMapper.java
branches/release-0.94/src/org/griphyn/vdl/mapping/file/ConcurrentMapper.java
branches/release-0.94/src/org/griphyn/vdl/mapping/file/ExternalMapper.java
branches/release-0.94/src/org/griphyn/vdl/mapping/file/FixedArrayFileMapper.java
branches/release-0.94/src/org/griphyn/vdl/mapping/file/RegularExpressionMapper.java
branches/release-0.94/src/org/griphyn/vdl/mapping/file/SimpleFileMapper.java
branches/release-0.94/src/org/griphyn/vdl/mapping/file/SingleFileMapper.java
branches/release-0.94/src/org/griphyn/vdl/mapping/file/StructuredRegularExpressionMapper.java
branches/release-0.94/src/org/griphyn/vdl/mapping/file/TestMapper.java
Log:
added compile-time validation of mapper parameters
Modified: branches/release-0.94/src/org/griphyn/vdl/engine/Karajan.java
===================================================================
--- branches/release-0.94/src/org/griphyn/vdl/engine/Karajan.java 2013-03-17 07:47:59 UTC (rev 6386)
+++ branches/release-0.94/src/org/griphyn/vdl/engine/Karajan.java 2013-03-17 07:49:58 UTC (rev 6387)
@@ -64,6 +64,7 @@
import org.griphyn.vdl.engine.VariableScope.WriteType;
import org.griphyn.vdl.karajan.CompilationException;
import org.griphyn.vdl.karajan.Loader;
+import org.griphyn.vdl.mapping.MapperFactory;
import org.griphyn.vdl.toolkit.VDLt2VDLx;
import org.griphyn.vdl.type.NoSuchTypeException;
import org.safehaus.uuid.UUIDGenerator;
@@ -465,7 +466,9 @@
if (mapping != null) {
StringTemplate mappingST = new StringTemplate("mapping");
- mappingST.setAttribute("descriptor", mapping.getDescriptor());
+ String mapperType = mapping.getDescriptor();
+ mappingST.setAttribute("descriptor", mapperType);
+ checkMapperParams(mapperType, mapping);
for (int i = 0; i < mapping.sizeOfParamArray(); i++) {
Param param = mapping.getParamArray(i);
mappingST.setAttribute("params", mappingParameter(param, scope));
@@ -491,6 +494,27 @@
scope.bodyTemplate.setAttribute("declarations", variableST);
}
+ private void checkMapperParams(String mapperType, Mapping mapping) throws CompilationException {
+ if (!MapperFactory.isValidMapperType(mapperType)) {
+ throw new CompilationException("Unknown mapper type: '" + mapperType + "'");
+ }
+
+ Set validParams = MapperFactory.getValidParams(mapperType);
+ if (validParams == null && mapping.sizeOfParamArray() > 0) {
+ throw new CompilationException(mapperType + " does not support any parameters");
+ }
+ if (validParams.contains("*")) {
+ // mapper accepts any parameter (e.g. external_mapper)
+ return;
+ }
+ for (int i = 0; i < mapping.sizeOfParamArray(); i++) {
+ Param param = mapping.getParamArray(i);
+ if (!validParams.contains(param.getName())) {
+ throw new CompilationException(mapperType + " does not support a '" + param.getName() + "' parameter");
+ }
+ }
+ }
+
private StringTemplate mappingParameter(Param param, VariableScope scope) throws CompilationException {
StringTemplate paramST = template("vdl_parameter");
paramST.setAttribute("name", param.getName());
Modified: branches/release-0.94/src/org/griphyn/vdl/mapping/AbstractMapper.java
===================================================================
--- branches/release-0.94/src/org/griphyn/vdl/mapping/AbstractMapper.java 2013-03-17 07:47:59 UTC (rev 6386)
+++ branches/release-0.94/src/org/griphyn/vdl/mapping/AbstractMapper.java 2013-03-17 07:49:58 UTC (rev 6387)
@@ -17,6 +17,9 @@
package org.griphyn.vdl.mapping;
+import java.util.HashSet;
+import java.util.Set;
+
import org.apache.log4j.Logger;
import org.griphyn.vdl.mapping.file.FileGarbageCollector;
@@ -30,8 +33,26 @@
public static final Logger logger = Logger.getLogger(AbstractMapper.class);
public static final MappingParam PARAM_INPUT = new MappingParam("input", Boolean.FALSE);
- protected MappingParamSet params;
+
+ protected void getValidMappingParams(Set s) {
+ addParams(s, PARAM_INPUT);
+ }
+
+ protected void addParams(Set s, MappingParam... params) {
+ for (MappingParam p : params) {
+ s.add(p.getName());
+ }
+ }
+
+ @Override
+ public final Set getSupportedParamNames() {
+ Set s = new HashSet();
+ getValidMappingParams(s);
+ return s;
+ }
+ protected MappingParamSet params;
+
public synchronized void setParam(MappingParam param, Object value) {
if (params == null) {
params = new MappingParamSet();
Modified: branches/release-0.94/src/org/griphyn/vdl/mapping/Mapper.java
===================================================================
--- branches/release-0.94/src/org/griphyn/vdl/mapping/Mapper.java 2013-03-17 07:47:59 UTC (rev 6386)
+++ branches/release-0.94/src/org/griphyn/vdl/mapping/Mapper.java 2013-03-17 07:49:58 UTC (rev 6387)
@@ -18,6 +18,7 @@
package org.griphyn.vdl.mapping;
import java.util.Collection;
+import java.util.Set;
/** This interface must be implemented by a Java class that represents
a Swift mapper between SwiftScript variables and external data
@@ -80,4 +81,6 @@
boolean isPersistent(Path path);
+
+ Set getSupportedParamNames();
}
Modified: branches/release-0.94/src/org/griphyn/vdl/mapping/MapperFactory.java
===================================================================
--- branches/release-0.94/src/org/griphyn/vdl/mapping/MapperFactory.java 2013-03-17 07:47:59 UTC (rev 6386)
+++ branches/release-0.94/src/org/griphyn/vdl/mapping/MapperFactory.java 2013-03-17 07:49:58 UTC (rev 6387)
@@ -22,6 +22,7 @@
import java.util.HashMap;
import java.util.Map;
+import java.util.Set;
import org.griphyn.vdl.mapping.file.AirsnMapper;
import org.griphyn.vdl.mapping.file.ArrayFileMapper;
@@ -38,11 +39,14 @@
import org.griphyn.vdl.mapping.file.TestMapper;
public class MapperFactory {
- private static Map> mappers =
- new HashMap>();
+ private static Map> mappers;
+
+ private static Map> validParams;
static {
-
+ mappers = new HashMap>();
+ validParams = new HashMap>();
+
// the following are general purpose file mappers
registerMapper("simple_mapper", SimpleFileMapper.class);
registerMapper("single_file_mapper", SingleFileMapper.class);
@@ -62,11 +66,10 @@
registerMapper("test_mapper", TestMapper.class);
}
- public synchronized static Mapper getMapper(String type, MappingParamSet params)
- throws InvalidMapperException {
- Class cls = mappers.get(type);
+ public synchronized static Mapper getMapper(String type, MappingParamSet params) throws InvalidMapperException {
+ Class extends Mapper> cls = mappers.get(type);
if (cls == null) {
- throw new InvalidMapperException("no such mapper: "+type);
+ throw new InvalidMapperException("No such mapper: "+type);
}
try {
Mapper mapper = cls.newInstance();
@@ -77,15 +80,29 @@
throw new InvalidMapperException(type + ": " + e.getMessage(), e);
}
}
+
+ public synchronized static boolean isValidMapperType(String type) {
+ return mappers.containsKey(type);
+ }
+
+ @SuppressWarnings("unchecked")
+ public static void registerMapper(String type, String cls) throws ClassNotFoundException {
+ registerMapper(type, (Class extends Mapper>) MapperFactory.class.getClassLoader().loadClass(cls));
+ }
- public static void registerMapper(String type, String cls)
- throws ClassNotFoundException {
- registerMapper(type, MapperFactory.class.getClassLoader().loadClass(cls));
+ public synchronized static void registerMapper(String type, Class extends Mapper> cls) {
+ mappers.put(type, cls);
+ try {
+ Mapper m = cls.newInstance();
+ validParams.put(type, m.getSupportedParamNames());
+ }
+ catch (Exception e) {
+ throw new RuntimeException("Cannot instantiate a '" + type + "'", e);
+ }
}
- @SuppressWarnings("unchecked")
- public synchronized static void registerMapper(String type,
- Class> cls) {
- mappers.put(type, (Class) cls);
- }
+
+ public static Set getValidParams(String type) {
+ return validParams.get(type);
+ }
}
Modified: branches/release-0.94/src/org/griphyn/vdl/mapping/file/AbstractFileMapper.java
===================================================================
--- branches/release-0.94/src/org/griphyn/vdl/mapping/file/AbstractFileMapper.java 2013-03-17 07:47:59 UTC (rev 6386)
+++ branches/release-0.94/src/org/griphyn/vdl/mapping/file/AbstractFileMapper.java 2013-03-17 07:49:58 UTC (rev 6387)
@@ -25,6 +25,7 @@
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
+import java.util.Set;
import org.apache.log4j.Logger;
import org.globus.cog.util.Base64;
@@ -71,6 +72,13 @@
public static final MappingParam PARAM_PATTERN = new MappingParam("pattern", null);
public static final MappingParam PARAM_LOCATION = new MappingParam("location", null);
public static final MappingParam PARAM_NOAUTO = new MappingParam("noauto", "false");
+
+
+ @Override
+ protected void getValidMappingParams(Set s) {
+ addParams(s, PARAM_PREFIX, PARAM_SUFFIX, PARAM_PATTERN, PARAM_LOCATION, PARAM_NOAUTO);
+ super.getValidMappingParams(s);
+ }
public static final Logger logger = Logger.getLogger(AbstractFileMapper.class);
Modified: branches/release-0.94/src/org/griphyn/vdl/mapping/file/ArrayFileMapper.java
===================================================================
--- branches/release-0.94/src/org/griphyn/vdl/mapping/file/ArrayFileMapper.java 2013-03-17 07:47:59 UTC (rev 6386)
+++ branches/release-0.94/src/org/griphyn/vdl/mapping/file/ArrayFileMapper.java 2013-03-17 07:49:58 UTC (rev 6387)
@@ -37,6 +37,12 @@
static Logger logger = Logger.getLogger(ArrayFileMapper.class);
public static final MappingParam PARAM_FILES = new MappingParam("files");
+
+ @Override
+ protected void getValidMappingParams(Set s) {
+ addParams(s, PARAM_FILES);
+ super.getValidMappingParams(s);
+ }
public Collection existing() {
List l = new ArrayList();
Modified: branches/release-0.94/src/org/griphyn/vdl/mapping/file/CSVMapper.java
===================================================================
--- branches/release-0.94/src/org/griphyn/vdl/mapping/file/CSVMapper.java 2013-03-17 07:47:59 UTC (rev 6386)
+++ branches/release-0.94/src/org/griphyn/vdl/mapping/file/CSVMapper.java 2013-03-17 07:49:58 UTC (rev 6387)
@@ -27,6 +27,7 @@
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import java.util.StringTokenizer;
import org.griphyn.vdl.mapping.AbsFile;
@@ -55,7 +56,14 @@
public static final MappingParam PARAM_HDELIMITER = new MappingParam("hdelim");
/** delimiters between content fields. default is space, tab, comma */
- public static final MappingParam PARAM_DELIMITER = new MappingParam("delim", " \t,");
+ public static final MappingParam PARAM_DELIMITER = new MappingParam("delim", " \t,");
+
+
+ @Override
+ protected void getValidMappingParams(Set s) {
+ addParams(s, PARAM_FILE, PARAM_HEADER, PARAM_SKIP, PARAM_HDELIMITER, PARAM_DELIMITER);
+ super.getValidMappingParams(s);
+ }
/** list of column names */
private List cols = new ArrayList();
Modified: branches/release-0.94/src/org/griphyn/vdl/mapping/file/ConcurrentMapper.java
===================================================================
--- branches/release-0.94/src/org/griphyn/vdl/mapping/file/ConcurrentMapper.java 2013-03-17 07:47:59 UTC (rev 6386)
+++ branches/release-0.94/src/org/griphyn/vdl/mapping/file/ConcurrentMapper.java 2013-03-17 07:49:58 UTC (rev 6387)
@@ -35,6 +35,13 @@
public class ConcurrentMapper extends AbstractFileMapper {
public static final MappingParam PARAM_THREAD_PREFIX = new MappingParam("thread_prefix", "");
+
+ @Override
+ protected void getValidMappingParams(Set s) {
+ addParams(s, PARAM_THREAD_PREFIX);
+ super.getValidMappingParams(s);
+ }
+
private Map remappedPaths;
public ConcurrentMapper() {
Modified: branches/release-0.94/src/org/griphyn/vdl/mapping/file/ExternalMapper.java
===================================================================
--- branches/release-0.94/src/org/griphyn/vdl/mapping/file/ExternalMapper.java 2013-03-17 07:47:59 UTC (rev 6386)
+++ branches/release-0.94/src/org/griphyn/vdl/mapping/file/ExternalMapper.java 2013-03-17 07:49:58 UTC (rev 6387)
@@ -25,7 +25,6 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
-import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -44,7 +43,15 @@
private Map map;
private Map rmap;
- public static final MappingParam PARAM_EXEC = new MappingParam("exec");
+ public static final MappingParam PARAM_EXEC = new MappingParam("exec");
+
+
+ @Override
+ protected void getValidMappingParams(Set s) {
+ addParams(s, PARAM_EXEC);
+ s.add("*");
+ super.getValidMappingParams(s);
+ }
private static final String[] STRING_ARRAY = new String[0];
Modified: branches/release-0.94/src/org/griphyn/vdl/mapping/file/FixedArrayFileMapper.java
===================================================================
--- branches/release-0.94/src/org/griphyn/vdl/mapping/file/FixedArrayFileMapper.java 2013-03-17 07:47:59 UTC (rev 6386)
+++ branches/release-0.94/src/org/griphyn/vdl/mapping/file/FixedArrayFileMapper.java 2013-03-17 07:49:58 UTC (rev 6387)
@@ -42,6 +42,14 @@
an array. */
public class FixedArrayFileMapper extends AbstractMapper {
public static final MappingParam PARAM_FILES = new MappingParam("files");
+
+
+ @Override
+ protected void getValidMappingParams(Set s) {
+ addParams(s, PARAM_FILES);
+ super.getValidMappingParams(s);
+ }
+
private List files;
public FixedArrayFileMapper() {
Modified: branches/release-0.94/src/org/griphyn/vdl/mapping/file/RegularExpressionMapper.java
===================================================================
--- branches/release-0.94/src/org/griphyn/vdl/mapping/file/RegularExpressionMapper.java 2013-03-17 07:47:59 UTC (rev 6386)
+++ branches/release-0.94/src/org/griphyn/vdl/mapping/file/RegularExpressionMapper.java 2013-03-17 07:49:58 UTC (rev 6387)
@@ -22,6 +22,7 @@
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
+import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -36,7 +37,14 @@
public class RegularExpressionMapper extends AbstractMapper {
public static final MappingParam PARAM_SOURCE = new MappingParam("source");
public static final MappingParam PARAM_MATCH = new MappingParam("match");
- public static final MappingParam PARAM_TRANSFORM = new MappingParam("transform");
+ public static final MappingParam PARAM_TRANSFORM = new MappingParam("transform");
+
+
+ @Override
+ protected void getValidMappingParams(Set s) {
+ addParams(s, PARAM_SOURCE, PARAM_MATCH, PARAM_TRANSFORM);
+ super.getValidMappingParams(s);
+ }
public RegularExpressionMapper() {
}
Modified: branches/release-0.94/src/org/griphyn/vdl/mapping/file/SimpleFileMapper.java
===================================================================
--- branches/release-0.94/src/org/griphyn/vdl/mapping/file/SimpleFileMapper.java 2013-03-17 07:47:59 UTC (rev 6386)
+++ branches/release-0.94/src/org/griphyn/vdl/mapping/file/SimpleFileMapper.java 2013-03-17 07:49:58 UTC (rev 6387)
@@ -20,11 +20,20 @@
*/
package org.griphyn.vdl.mapping.file;
+import java.util.Set;
+
import org.griphyn.vdl.mapping.MappingParam;
import org.griphyn.vdl.mapping.MappingParamSet;
public class SimpleFileMapper extends AbstractFileMapper {
public static final MappingParam PARAM_PADDING = new MappingParam("padding", new Integer(4));
+
+
+ @Override
+ protected void getValidMappingParams(Set s) {
+ addParams(s, PARAM_PADDING);
+ super.getValidMappingParams(s);
+ }
public SimpleFileMapper() {
super();
Modified: branches/release-0.94/src/org/griphyn/vdl/mapping/file/SingleFileMapper.java
===================================================================
--- branches/release-0.94/src/org/griphyn/vdl/mapping/file/SingleFileMapper.java 2013-03-17 07:47:59 UTC (rev 6386)
+++ branches/release-0.94/src/org/griphyn/vdl/mapping/file/SingleFileMapper.java 2013-03-17 07:49:58 UTC (rev 6387)
@@ -20,6 +20,7 @@
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
+import java.util.Set;
import org.griphyn.vdl.mapping.AbsFile;
import org.griphyn.vdl.mapping.AbstractMapper;
@@ -32,8 +33,14 @@
public class SingleFileMapper extends AbstractMapper {
public static final MappingParam PARAM_FILE = new MappingParam("file");
+
+ @Override
+ protected void getValidMappingParams(Set s) {
+ addParams(s, PARAM_FILE);
+ super.getValidMappingParams(s);
+ }
- public SingleFileMapper() {
+ public SingleFileMapper() {
super();
}
Modified: branches/release-0.94/src/org/griphyn/vdl/mapping/file/StructuredRegularExpressionMapper.java
===================================================================
--- branches/release-0.94/src/org/griphyn/vdl/mapping/file/StructuredRegularExpressionMapper.java 2013-03-17 07:47:59 UTC (rev 6386)
+++ branches/release-0.94/src/org/griphyn/vdl/mapping/file/StructuredRegularExpressionMapper.java 2013-03-17 07:49:58 UTC (rev 6387)
@@ -21,6 +21,7 @@
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
+import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -41,7 +42,14 @@
public static final MappingParam PARAM_SOURCE = new MappingParam("source");
public static final MappingParam PARAM_MATCH = new MappingParam("match");
- public static final MappingParam PARAM_TRANSFORM = new MappingParam("transform");
+ public static final MappingParam PARAM_TRANSFORM = new MappingParam("transform");
+
+
+ @Override
+ protected void getValidMappingParams(Set s) {
+ addParams(s, PARAM_SOURCE, PARAM_MATCH, PARAM_TRANSFORM);
+ super.getValidMappingParams(s);
+ }
public StructuredRegularExpressionMapper() {
}
Modified: branches/release-0.94/src/org/griphyn/vdl/mapping/file/TestMapper.java
===================================================================
--- branches/release-0.94/src/org/griphyn/vdl/mapping/file/TestMapper.java 2013-03-17 07:47:59 UTC (rev 6386)
+++ branches/release-0.94/src/org/griphyn/vdl/mapping/file/TestMapper.java 2013-03-17 07:49:58 UTC (rev 6387)
@@ -19,6 +19,7 @@
import java.util.Collection;
import java.util.Collections;
+import java.util.Set;
import org.griphyn.vdl.mapping.AbsFile;
import org.griphyn.vdl.mapping.AbstractMapper;
@@ -34,6 +35,12 @@
public static final MappingParam PARAM_REMAPPABLE = new MappingParam("remappable", false);
public static final MappingParam PARAM_STATIC = new MappingParam("static", true);
+ @Override
+ protected void getValidMappingParams(Set s) {
+ addParams(s, PARAM_FILE, PARAM_TEMP, PARAM_REMAPPABLE, PARAM_STATIC);
+ super.getValidMappingParams(s);
+ }
+
private PhysicalFormat remap, map;
@Override
From davidk at ci.uchicago.edu Sun Mar 17 09:25:33 2013
From: davidk at ci.uchicago.edu (davidk at ci.uchicago.edu)
Date: Sun, 17 Mar 2013 09:25:33 -0500 (CDT)
Subject: [Swift-commit] r6388 - trunk/bin
Message-ID: <20130317142533.E491A9D04B@svn.ci.uchicago.edu>
Author: davidk
Date: 2013-03-17 09:25:32 -0500 (Sun, 17 Mar 2013)
New Revision: 6388
Modified:
trunk/bin/gensites
trunk/bin/swiftrun
Log:
Add conf/ to list of directories to search for templates
Modified: trunk/bin/gensites
===================================================================
--- trunk/bin/gensites 2013-03-17 07:49:58 UTC (rev 6387)
+++ trunk/bin/gensites 2013-03-17 14:25:32 UTC (rev 6388)
@@ -125,6 +125,8 @@
TEMPLATE_PATH=$TEMPLATE
elif [ -f "$HOME/.swift/sites/$TEMPLATE" ]; then
TEMPLATE_PATH=$HOME/.swift/sites/$TEMPLATE
+ elif [ -f "$PWD/conf/$TEMPLATE" ]; then
+ TEMPLATE_PATH=$PWD/conf/$TEMPLATE
elif [ -f "$SWIFT_HOME/$TEMPLATE" ]; then
TEMPLATE_PATH=$SWIFT_HOME/$TEMPLATE
fi
Modified: trunk/bin/swiftrun
===================================================================
--- trunk/bin/swiftrun 2013-03-17 07:49:58 UTC (rev 6387)
+++ trunk/bin/swiftrun 2013-03-17 14:25:32 UTC (rev 6388)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/bash -x
# Verify an argument is not null
verify_not_null()
@@ -80,25 +80,26 @@
fi
# Create sites.xml
-cd $rundir
IFS=","
-echo "" > sites.xml
+echo "" > $rundir/sites.xml
for site in $SITES
do
# If config is not defined, but there is a config in conf/ that matches, use that
- if [ -z "$CONFIG" ] && [ -f "../conf/$site.cf" ]; then
- cp ../conf/$site.cf .
+ if [ -z "$CONFIG" ] && [ -f "conf/$site.cf" ]; then
+ cp conf/$site.cf $rundir
config=$site.cf
fi
- if [ -f "$config" ]; then
- gensites -p $config $site >> sites.xml
+ if [ -f "conf/$config" ]; then
+ gensites -p conf/$config $site >> $rundir/sites.xml
else
- gensites $site >> sites.xml
+ gensites $site >> $rundir/sites.xml
fi
done
-echo " " >> sites.xml
+echo " " >> $rundir/sites.xml
+mv tc.data $rundir
+cd $rundir
if [ -z "$CONFIG" ]; then
CONFIG=$config
From davidk at ci.uchicago.edu Sun Mar 17 09:29:44 2013
From: davidk at ci.uchicago.edu (davidk at ci.uchicago.edu)
Date: Sun, 17 Mar 2013 09:29:44 -0500 (CDT)
Subject: [Swift-commit] r6389 - trunk/bin
Message-ID: <20130317142944.950FB9D04B@svn.ci.uchicago.edu>
Author: davidk
Date: 2013-03-17 09:29:44 -0500 (Sun, 17 Mar 2013)
New Revision: 6389
Modified:
trunk/bin/swiftrun
Log:
Modified: trunk/bin/swiftrun
===================================================================
--- trunk/bin/swiftrun 2013-03-17 14:25:32 UTC (rev 6388)
+++ trunk/bin/swiftrun 2013-03-17 14:29:44 UTC (rev 6389)
@@ -1,4 +1,4 @@
-#!/bin/bash -x
+#!/bin/bash
# Verify an argument is not null
verify_not_null()
From hategan at ci.uchicago.edu Sun Mar 17 23:49:05 2013
From: hategan at ci.uchicago.edu (hategan at ci.uchicago.edu)
Date: Sun, 17 Mar 2013 23:49:05 -0500 (CDT)
Subject: [Swift-commit] r6390 - in branches/faster/src/org/griphyn/vdl:
engine mapping mapping/file
Message-ID: <20130318044905.CD1E49D04B@svn.ci.uchicago.edu>
Author: hategan
Date: 2013-03-17 23:49:05 -0500 (Sun, 17 Mar 2013)
New Revision: 6390
Added:
branches/faster/src/org/griphyn/vdl/mapping/file/DirectoryScanner.java
Modified:
branches/faster/src/org/griphyn/vdl/engine/Karajan.java
branches/faster/src/org/griphyn/vdl/mapping/AbsFile.java
branches/faster/src/org/griphyn/vdl/mapping/AbstractMapper.java
branches/faster/src/org/griphyn/vdl/mapping/Mapper.java
branches/faster/src/org/griphyn/vdl/mapping/MapperFactory.java
branches/faster/src/org/griphyn/vdl/mapping/file/AbstractFileMapper.java
branches/faster/src/org/griphyn/vdl/mapping/file/ArrayFileMapper.java
branches/faster/src/org/griphyn/vdl/mapping/file/CSVMapper.java
branches/faster/src/org/griphyn/vdl/mapping/file/ConcurrentMapper.java
branches/faster/src/org/griphyn/vdl/mapping/file/ExternalMapper.java
branches/faster/src/org/griphyn/vdl/mapping/file/FixedArrayFileMapper.java
branches/faster/src/org/griphyn/vdl/mapping/file/RegularExpressionMapper.java
branches/faster/src/org/griphyn/vdl/mapping/file/SimpleFileMapper.java
branches/faster/src/org/griphyn/vdl/mapping/file/SingleFileMapper.java
branches/faster/src/org/griphyn/vdl/mapping/file/StructuredRegularExpressionMapper.java
branches/faster/src/org/griphyn/vdl/mapping/file/TestMapper.java
Log:
merged mapper parameter checking from 0.94 and added deep globbing (including /**/ for arbitrary depth subdirs)
Modified: branches/faster/src/org/griphyn/vdl/engine/Karajan.java
===================================================================
--- branches/faster/src/org/griphyn/vdl/engine/Karajan.java 2013-03-17 14:29:44 UTC (rev 6389)
+++ branches/faster/src/org/griphyn/vdl/engine/Karajan.java 2013-03-18 04:49:05 UTC (rev 6390)
@@ -65,6 +65,7 @@
import org.griphyn.vdl.engine.VariableScope.WriteType;
import org.griphyn.vdl.karajan.CompilationException;
import org.griphyn.vdl.karajan.Loader;
+import org.griphyn.vdl.mapping.MapperFactory;
import org.griphyn.vdl.toolkit.VDLt2VDLx;
import org.griphyn.vdl.type.NoSuchTypeException;
import org.safehaus.uuid.UUIDGenerator;
@@ -473,7 +474,9 @@
if (mapping != null) {
StringTemplate mappingST = new StringTemplate("mapping");
- mappingST.setAttribute("descriptor", mapping.getDescriptor());
+ String mapperType = mapping.getDescriptor();
+ mappingST.setAttribute("descriptor", mapperType);
+ checkMapperParams(mapperType, mapping);
for (int i = 0; i < mapping.sizeOfParamArray(); i++) {
Param param = mapping.getParamArray(i);
mappingST.setAttribute("params", mappingParameter(param, scope));
@@ -499,6 +502,27 @@
scope.bodyTemplate.setAttribute("declarations", variableST);
}
+ private void checkMapperParams(String mapperType, Mapping mapping) throws CompilationException {
+ if (!MapperFactory.isValidMapperType(mapperType)) {
+ throw new CompilationException("Unknown mapper type: '" + mapperType + "'");
+ }
+
+ Set validParams = MapperFactory.getValidParams(mapperType);
+ if (validParams == null && mapping.sizeOfParamArray() > 0) {
+ throw new CompilationException(mapperType + " does not support any parameters");
+ }
+ if (validParams.contains("*")) {
+ // mapper accepts any parameter (e.g. external_mapper)
+ return;
+ }
+ for (int i = 0; i < mapping.sizeOfParamArray(); i++) {
+ Param param = mapping.getParamArray(i);
+ if (!validParams.contains(param.getName())) {
+ throw new CompilationException(mapperType + " does not support a '" + param.getName() + "' parameter");
+ }
+ }
+ }
+
private StringTemplate mappingParameter(Param param, VariableScope scope) throws CompilationException {
StringTemplate paramST = template("swift_parameter");
paramST.setAttribute("name", param.getName());
Modified: branches/faster/src/org/griphyn/vdl/mapping/AbsFile.java
===================================================================
--- branches/faster/src/org/griphyn/vdl/mapping/AbsFile.java 2013-03-17 14:29:44 UTC (rev 6389)
+++ branches/faster/src/org/griphyn/vdl/mapping/AbsFile.java 2013-03-18 04:49:05 UTC (rev 6390)
@@ -44,7 +44,7 @@
if (pi == -1) {
protocol = "file";
host = "localhost";
- path = url;
+ path = normalize(url);
}
else {
protocol = url.substring(0, pi);
@@ -54,7 +54,7 @@
if (rp.startsWith("localhost/")) {
rp = rp.substring("localhost/".length());
}
- path = rp;
+ path = normalize(rp);
}
else {
int si = url.indexOf('/', pi + 3);
@@ -64,13 +64,19 @@
}
else {
host = url.substring(pi + 3, si);
- path = url.substring(si + 1);
+ path = normalize(url.substring(si + 1));
}
}
}
initDirAndName();
}
+ private String normalize(String path) {
+ // there is a slight performance penalty here, but it makes things
+ // cleaner
+ return path.replace("/./", "/");
+ }
+
private void initDirAndName() {
int di = path.lastIndexOf('/');
if (di == 0) {
@@ -126,8 +132,31 @@
}
private static final AbsFile[] FILE_ARRAY = new AbsFile[0];
+
+ public List listDirectories(FilenameFilter filter) {
+ try {
+ FileResource fr = getFileResource();
+ try {
+ List l = new ArrayList();
+ for (GridFile gf : fr.list(path)) {
+ AbsFile f = new AbsFile(protocol, host, gf.getAbsolutePathName());
+ if (gf.isDirectory() && (filter == null || filter.accept(new File(f.getDir()), f.getName()))) {
+ l.add(f);
+ }
+ }
+ return l;
+ }
+ finally {
+ releaseResource(fr);
+ }
+ }
+ catch (Exception e) {
+ // TODO this should be a proper exception
+ throw new RuntimeException(e);
+ }
+ }
- public AbsFile[] listFiles(FilenameFilter filter) {
+ public List listFiles(FilenameFilter filter) {
try {
FileResource fr = getFileResource();
try {
@@ -138,7 +167,7 @@
l.add(f);
}
}
- return l.toArray(FILE_ARRAY);
+ return l;
}
finally {
releaseResource(fr);
@@ -149,7 +178,7 @@
throw new RuntimeException(e);
}
}
-
+
public String getName() {
return name;
}
Modified: branches/faster/src/org/griphyn/vdl/mapping/AbstractMapper.java
===================================================================
--- branches/faster/src/org/griphyn/vdl/mapping/AbstractMapper.java 2013-03-17 14:29:44 UTC (rev 6389)
+++ branches/faster/src/org/griphyn/vdl/mapping/AbstractMapper.java 2013-03-18 04:49:05 UTC (rev 6390)
@@ -17,6 +17,9 @@
package org.griphyn.vdl.mapping;
+import java.util.HashSet;
+import java.util.Set;
+
import org.apache.log4j.Logger;
import org.griphyn.vdl.mapping.file.FileGarbageCollector;
@@ -30,8 +33,26 @@
public static final Logger logger = Logger.getLogger(AbstractMapper.class);
public static final MappingParam PARAM_INPUT = new MappingParam("input", Boolean.FALSE);
- protected MappingParamSet params;
+
+ protected void getValidMappingParams(Set s) {
+ addParams(s, PARAM_INPUT);
+ }
+
+ protected void addParams(Set s, MappingParam... params) {
+ for (MappingParam p : params) {
+ s.add(p.getName());
+ }
+ }
+
+ @Override
+ public final Set getSupportedParamNames() {
+ Set s = new HashSet();
+ getValidMappingParams(s);
+ return s;
+ }
+ protected MappingParamSet params;
+
public synchronized void setParam(MappingParam param, Object value) {
if (params == null) {
params = new MappingParamSet();
Modified: branches/faster/src/org/griphyn/vdl/mapping/Mapper.java
===================================================================
--- branches/faster/src/org/griphyn/vdl/mapping/Mapper.java 2013-03-17 14:29:44 UTC (rev 6389)
+++ branches/faster/src/org/griphyn/vdl/mapping/Mapper.java 2013-03-18 04:49:05 UTC (rev 6390)
@@ -18,6 +18,7 @@
package org.griphyn.vdl.mapping;
import java.util.Collection;
+import java.util.Set;
/** This interface must be implemented by a Java class that represents
a Swift mapper between SwiftScript variables and external data
@@ -78,4 +79,6 @@
boolean isPersistent(Path path);
+
+ Set getSupportedParamNames();
}
Modified: branches/faster/src/org/griphyn/vdl/mapping/MapperFactory.java
===================================================================
--- branches/faster/src/org/griphyn/vdl/mapping/MapperFactory.java 2013-03-17 14:29:44 UTC (rev 6389)
+++ branches/faster/src/org/griphyn/vdl/mapping/MapperFactory.java 2013-03-18 04:49:05 UTC (rev 6390)
@@ -22,6 +22,7 @@
import java.util.HashMap;
import java.util.Map;
+import java.util.Set;
import org.griphyn.vdl.mapping.file.AirsnMapper;
import org.griphyn.vdl.mapping.file.ArrayFileMapper;
@@ -38,11 +39,14 @@
import org.griphyn.vdl.mapping.file.TestMapper;
public class MapperFactory {
- private static Map> mappers =
- new HashMap>();
+ private static Map> mappers;
+
+ private static Map> validParams;
static {
-
+ mappers = new HashMap>();
+ validParams = new HashMap