[Swift-commit] r3254 - SwiftApps/SwiftR

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Thu Feb 25 22:16:47 CST 2010


Author: wilde
Date: 2010-02-25 22:16:47 -0600 (Thu, 25 Feb 2010)
New Revision: 3254

Modified:
   SwiftApps/SwiftR/RunSwiftScript.sh
   SwiftApps/SwiftR/Swift.R
   SwiftApps/SwiftR/bootstrapdemo.R
Log:
Adjust Swift.R for packaging; adjust bootstrapdemo for updates to boot package.

Modified: SwiftApps/SwiftR/RunSwiftScript.sh
===================================================================
--- SwiftApps/SwiftR/RunSwiftScript.sh	2010-02-23 18:32:38 UTC (rev 3253)
+++ SwiftApps/SwiftR/RunSwiftScript.sh	2010-02-26 04:16:47 UTC (rev 3254)
@@ -12,7 +12,7 @@
   <pool handle="local">
     <execution provider="local" url="none" />
     <profile namespace="karajan" key="initialScore">10000</profile>
-    <profile namespace="karajan" key="jobThrottle">.03</profile>
+    <profile namespace="karajan" key="jobThrottle">.11</profile>
     <filesystem provider="local"/>
     <workdirectory>$(pwd)</workdirectory>
   </pool>
@@ -20,7 +20,7 @@
     <profile namespace="globus" key="maxwalltime">00:00:10</profile>
     <profile namespace="globus" key="maxtime">1800</profile>
     <execution provider="coaster" url="none" jobManager="local:pbs"/>
-    <profile namespace="globus" key="workersPerNode">8</profile>
+    <profile namespace="globus" key="workersPerNode">1</profile>
     <profile namespace="karajan" key="initialScore">10000</profile>
     <profile namespace="karajan" key="jobThrottle">5.99</profile>
     <filesystem provider="local"/>

Modified: SwiftApps/SwiftR/Swift.R
===================================================================
--- SwiftApps/SwiftR/Swift.R	2010-02-23 18:32:38 UTC (rev 3253)
+++ SwiftApps/SwiftR/Swift.R	2010-02-26 04:16:47 UTC (rev 3254)
@@ -1,10 +1,13 @@
-if(is.null(swiftprops)) {
-  swiftprops.site <- "local"
-  swiftprops$callsperbatch <- 1
-}
-
 swiftapply <- function( func, arglists, site=NULL, callsperbatch=NULL )
 {
+  # Move swiftprops into a Swift namespace
+
+  if(!exists("swiftprops")) {
+    swiftprops <<-list()
+    swiftprops$site <<- "local"
+    swiftprops$callsperbatch <<- 1
+  }
+
   # Set Swift properties
 
   if(is.null(site))
@@ -62,40 +65,3 @@
   }
   return(rlist)
 }
-
-TODO="
-
-x n args
-x batch
-x into svn
-x unique dirs
-_ select sites and swift args (throttles etc)
-  R docs
-  R package (SwiftR)
-  Swift docs
-  async exec
-  clean up boot: fix all calls to statistics; update boot package w/ pboot() or swiftboot()
-  error handling and null and missing values: ensure res#s correspond to arg#s
-  status
-  specify swift scripts
-  run async and grab status (track 'runs' in R)
-  increm result collect
-  pass the func as val
-  pass extra funcs and packages required
-  pass extra vals
-  pass extra files
-  specifiy unique swift scritps ala Dirk's tools
-  setup the R envs (???)
-  coasters for persistent R Servers
-  test suites
-  use littleR
-  args as alists vs args as list
-  runids, output logging
-  select exec sites and swift  params etc
-  make polymorphic to *apply and snow
-  stream results back to R (so use can inspect as they arrive)
-  (pull them in with a Swift.poll() func)
-  handle discontiguous results
-  return good error messages including messages from R eval and from Swift
-
-END"

Modified: SwiftApps/SwiftR/bootstrapdemo.R
===================================================================
--- SwiftApps/SwiftR/bootstrapdemo.R	2010-02-23 18:32:38 UTC (rev 3253)
+++ SwiftApps/SwiftR/bootstrapdemo.R	2010-02-26 04:16:47 UTC (rev 3254)
@@ -8,20 +8,14 @@
 require(OpenMx)
 require(boot)
 
-# Update the boot() function to call swiftapply() for parallel execution.
+bootdemo <- function(swift=FALSE,R=100) {
 
-if(FALSE) {
-  source("pboot.R")
-  assignInNamespace("boot",boot,"boot")
-}
-
 # Define a function called mles which will return maximum likelihood estimates
 # It uses the demoOneFactor dataset and one factor model on the OpenMx homepage
 # http://openmx.psyc.virginia.edu
 
 
 mles<-function(dataset,wt){
-cat("in mles=");
 require(OpenMx)
         manifests <- names(dataset)
         latents <- c("G")
@@ -37,15 +31,14 @@
             numObs=500)))
         return(as.vector(mlevals at output$estimate))}
     
-# Run 100 bootstraps (a smallish number)
+# Run R bootstraps
 
-system.time(boot(demoOneFactor,mles,R=10000))
+boottime = system.time(boot(demoOneFactor,mles,R=R,swift=swift))
+cat("done booting - system.time is:\n")
+print(boottime)
 
-print("done booting - boot.out is:")
-print(boot.out)
-print("end of boot.out")
-
 # For comparison, take a look at the SE output from running the homepage job once
+
 data(demoOneFactor)
 manifests <- names(demoOneFactor)
 latents <- c("G")
@@ -71,4 +64,6 @@
 
 # The above should indicate that the results are close enough.
 
+} # function bootdemo
 
+




More information about the Swift-commit mailing list