[Swift-commit] r3252 - SwiftApps/SwiftR

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Mon Feb 22 22:36:05 CST 2010


Author: wilde
Date: 2010-02-22 22:36:05 -0600 (Mon, 22 Feb 2010)
New Revision: 3252

Modified:
   SwiftApps/SwiftR/Swift.R
   SwiftApps/SwiftR/TestSwift.R
Log:
Set site correctly; add tests.

Modified: SwiftApps/SwiftR/Swift.R
===================================================================
--- SwiftApps/SwiftR/Swift.R	2010-02-23 03:06:07 UTC (rev 3251)
+++ SwiftApps/SwiftR/Swift.R	2010-02-23 04:36:05 UTC (rev 3252)
@@ -23,7 +23,7 @@
     batch = batch + 1;
   }
   nbatches = batch - 1
-  system(paste("./RunSwiftScript.sh",rundir,"local",sep=" "))
+  system(paste("./RunSwiftScript.sh",rundir,site,sep=" "))
 
   rno = 1
   rlist = list()

Modified: SwiftApps/SwiftR/TestSwift.R
===================================================================
--- SwiftApps/SwiftR/TestSwift.R	2010-02-23 03:06:07 UTC (rev 3251)
+++ SwiftApps/SwiftR/TestSwift.R	2010-02-23 04:36:05 UTC (rev 3252)
@@ -1,14 +1,18 @@
 require(boot)
 source("Swift.R")
+SKIP=FALSE
 
+sumcrits <- function(duckdata,dogdata) { sum( duckdata$plumage, dogdata$mvo ) }
+
 args=list(ducks,dogs)
-sumcrits <- function(duckdata,dogdata) { sum( duckdata$plumage, dogdata$mvo ) }
+arglist = rep(list(args),9)
+
+if(SKIP) {
+
 res = do.call(sumcrits,args)
 cat("Test of do.call(sumcrits)\n")
 print(res)
 
-arglist = rep(list(args),9)
-
 cat("\nTest of swiftapply(sumcrits,arglist)\n")
 res = swiftapply(sumcrits,arglist)
 print(res)
@@ -29,3 +33,10 @@
 res = swiftapply(sumcrits,arglist,callsperbatch=20)
 print(res)
 
+} # END SKIP
+
+cat("\nTest of swiftapply(sumcrits,arglist[1000],callsperbatch=1)\n")
+arglist = rep(list(args),1000)
+res = swiftapply(sumcrits,arglist,callsperbatch=2,site="pbs")
+print(res[[1]])
+print(res[[1000]])




More information about the Swift-commit mailing list