[Swift-commit] r3611 - SwiftApps/SwiftR/Swift/R

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Tue Sep 7 20:03:05 CDT 2010


Author: wilde
Date: 2010-09-07 20:03:05 -0500 (Tue, 07 Sep 2010)
New Revision: 3611

Modified:
   SwiftApps/SwiftR/Swift/R/Swift.R
Log:
Added options for passive worker host list; removed fossil option code.

Modified: SwiftApps/SwiftR/Swift/R/Swift.R
===================================================================
--- SwiftApps/SwiftR/Swift/R/Swift.R	2010-09-08 01:01:21 UTC (rev 3610)
+++ SwiftApps/SwiftR/Swift/R/Swift.R	2010-09-08 01:03:05 UTC (rev 3611)
@@ -1,16 +1,7 @@
-swiftapply <- function( func, arglists, site=NULL, callsperbatch=NULL, manualmode=NULL, initialize=NULL )
+swiftapply <- function( func, arglists, site=NULL, callsperbatch=NULL, manualmode=NULL, initialize=NULL, workerhosts=NULL )
 {
   # Set Swift default options if not passed as keyword paramets or pre-set by user
 
-if(FALSE){
-  if (is.null(getOption("swift.callsperbatch")))
-    options(swift.callsperbatch=1)
-  if (is.null(getOption("swift.manualmode")))
-    options(swift.manualmode = FALSE)
-  if (is.null(getOption("swift.initialize")))
-    options(swift.initialize = "")
-} # FALSE
-
   if(is.null(site))
     site <- getOption("swift.site")
   if(is.null(site))
@@ -31,11 +22,17 @@
   if(is.null(initialize))
     initialize <- "";
 
+  if(is.null(workerhosts))
+    workerhosts <- getOption("swift.workerhosts")
+  if(is.null(workerhosts))
+    workerhosts <- "localhost";
+
   cat("\nSwift properties:\n")
   cat("  site =",site,"\n");
   cat("  callsperbatch =", callsperbatch,"\n")
   cat("  manualmode =", manualmode,"\n")
   cat("  initialize =", initialize,"\n")
+  cat("  workerhosts =", workerhosts,"\n")
   cat("\nCurrent dir: ",getwd(),"\n");
 
   # Execute the calls in batches
@@ -81,7 +78,7 @@
     readLines(n=1)
   }
   else {
-    system(paste(RunSwiftScript,rundir,site,swiftapplyScript))
+    system(paste(RunSwiftScript,rundir,site,swiftapplyScript,"\"",workerhosts,"\""))
 #    system(paste(RunSwiftScript,rundir,site,swiftapplyScript,RunRScript))
 #    system(paste(RunSwiftScript,rundir,site,swiftapplyScript,RunRScript,sep=" "))
   }




More information about the Swift-commit mailing list