[Swift-commit] r2168 - in trunk: src/org/griphyn/vdl/karajan/lib tests/sites/wonky

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Fri Aug 1 10:25:14 CDT 2008


Author: benc
Date: 2008-08-01 10:25:13 -0500 (Fri, 01 Aug 2008)
New Revision: 2168

Modified:
   trunk/src/org/griphyn/vdl/karajan/lib/RuntimeStats.java
   trunk/tests/sites/wonky/wonky-80percent.xml
Log:
locking in progress meter

Modified: trunk/src/org/griphyn/vdl/karajan/lib/RuntimeStats.java
===================================================================
--- trunk/src/org/griphyn/vdl/karajan/lib/RuntimeStats.java	2008-07-31 22:38:27 UTC (rev 2167)
+++ trunk/src/org/griphyn/vdl/karajan/lib/RuntimeStats.java	2008-08-01 15:25:13 UTC (rev 2168)
@@ -58,7 +58,9 @@
 	public Object vdl_initprogressstate(VariableStack stack) throws ExecutionException {
 		RuntimeProgress rp = new RuntimeProgress();
 		ProgressTicker p = (ProgressTicker)stack.getVar("#swift-runtime-progress-ticker");
-		p.states.add(rp);
+		synchronized (p.states) {
+			p.states.add(rp);
+		}
 		stack.parentFrame().setVar("#swift-runtime-progress",rp);
 		p.dumpState();
 		return null;
@@ -108,18 +110,20 @@
 
 		void printStates(String header) {
 			Map summary = new HashMap();
-			Iterator stateIterator = states.iterator();
+			synchronized(states) {
+				Iterator stateIterator = states.iterator();
 
-			// summarize details of known states into summary, with
-			// one entry per state type, storing the number of
-			// jobs in that state.
-			while(stateIterator.hasNext()) {
-				String key = ((RuntimeProgress)stateIterator.next()).status;
-				Integer count = (Integer) summary.get(key);
-				if(count == null) {
-					summary.put(key,new Integer(1));
-				} else {
-					summary.put(key,new Integer(count.intValue()+1));
+				// summarize details of known states into summary, with
+				// one entry per state type, storing the number of
+				// jobs in that state.
+				while(stateIterator.hasNext()) {
+					String key = ((RuntimeProgress)stateIterator.next()).status;
+					Integer count = (Integer) summary.get(key);
+					if(count == null) {
+						summary.put(key,new Integer(1));
+					} else {
+						summary.put(key,new Integer(count.intValue()+1));
+					}
 				}
 			}
 

Modified: trunk/tests/sites/wonky/wonky-80percent.xml
===================================================================
--- trunk/tests/sites/wonky/wonky-80percent.xml	2008-07-31 22:38:27 UTC (rev 2167)
+++ trunk/tests/sites/wonky/wonky-80percent.xml	2008-08-01 15:25:13 UTC (rev 2168)
@@ -5,6 +5,7 @@
     <execution provider="wonky" url="good/activefail=0.2/activedelay=0" />
     <workdirectory >/var/tmp</workdirectory>
     <profile namespace="karajan" key="jobThrottle">0</profile>
+    <profile namespace="karajan" key="delayBase">0</profile>
   </pool>
 
 </config>




More information about the Swift-commit mailing list