[Swift-commit] r3657 - in SwiftApps/SwiftR: . Swift/R Swift/exec Swift/tests

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Mon Oct 4 19:10:54 CDT 2010


Author: wilde
Date: 2010-10-04 19:10:54 -0500 (Mon, 04 Oct 2010)
New Revision: 3657

Added:
   SwiftApps/SwiftR/install.sh
Modified:
   SwiftApps/SwiftR/Swift/R/Swift.R
   SwiftApps/SwiftR/Swift/exec/EvalRBatchPersistent.sh
   SwiftApps/SwiftR/Swift/exec/configure-site-local
   SwiftApps/SwiftR/Swift/exec/configure-site-pbs
   SwiftApps/SwiftR/Swift/exec/rserver.swift
   SwiftApps/SwiftR/Swift/exec/start-swift
   SwiftApps/SwiftR/Swift/tests/TestSwift.R
   SwiftApps/SwiftR/TODO
Log:
Added SWIFTR_TMP to allow tmp dir to be set for different systems; initial working code for configure-ite-pbs.

Modified: SwiftApps/SwiftR/Swift/R/Swift.R
===================================================================
--- SwiftApps/SwiftR/Swift/R/Swift.R	2010-10-02 01:51:49 UTC (rev 3656)
+++ SwiftApps/SwiftR/Swift/R/Swift.R	2010-10-05 00:10:54 UTC (rev 3657)
@@ -1,4 +1,4 @@
-swiftapply <- function( func, arglists, swiftserver=NULL, callsperbatch=NULL, runmode=NULL, initialize=NULL, workerhosts=NULL, keepwork=NULL )
+swiftapply <- function( func, arglists, swiftserver=NULL, callsperbatch=NULL, runmode=NULL, initialize=NULL, workerhosts=NULL, keepwork=NULL, tmpdir=NULL )
 {
   # Set Swift default options if not passed as keyword paramets or pre-set by user
 
@@ -35,6 +35,13 @@
   if(is.null(keepwork))
     keepwork <- FALSE;
 
+  if(is.null(tmpdir))
+    tmpdir <- getOption("swift.tmpdir")
+  if(is.null(tmpdir))
+    tmpdir <- Sys.getenv("SWIFTR_TMP");
+  if(tmpdir=="")
+    tmpdir <- "/tmp";
+
   cat("\nSwift properties:\n")
   cat("  swiftserver =", swiftserver,"\n");
   cat("  callsperbatch =", callsperbatch,"\n")
@@ -49,7 +56,7 @@
 
   requestdirbase = mget("swift.requestdirbase",envir=globalenv(),ifnotfound=list(NULL))[[1]] # FIXME: state more elegantly?
   if(is.null(requestdirbase)) {
-    requestdirbase = sprintf("/tmp/%s/SwiftR/requests.P%.5d",user,Sys.getpid())
+    requestdirbase = sprintf("%s/%s/SwiftR/requests.P%.5d",tmpdir,user,Sys.getpid())
     dir.create(requestdirbase,recursive=TRUE,showWarnings=FALSE)
     assign("swift.requestdirbase",requestdirbase,globalenv())
     requestid = 0;
@@ -112,7 +119,7 @@
 
     # Send request to service
 
-    swiftServerDir = paste("/tmp/",user,"/SwiftR/swift.",swiftserver,sep="")
+    swiftServerDir = paste(tmpdir,"/",user,"/SwiftR/swift.",swiftserver,sep="")
 
 cat(initialize,file=paste(swiftServerDir,"/initialize.R",sep="")) # FIXME
 

Modified: SwiftApps/SwiftR/Swift/exec/EvalRBatchPersistent.sh
===================================================================
--- SwiftApps/SwiftR/Swift/exec/EvalRBatchPersistent.sh	2010-10-02 01:51:49 UTC (rev 3656)
+++ SwiftApps/SwiftR/Swift/exec/EvalRBatchPersistent.sh	2010-10-05 00:10:54 UTC (rev 3657)
@@ -8,6 +8,10 @@
   exit 1
 fi
 
+# tmp=/tmp # FIXME: allow this to change eg for sites with main tmp dir elsewhere
+# tmp=/scratch/local # FIXME: allow this to change eg for sites with main tmp dir elsewhere
+tmp=${SWIFTR_TMP:-/tmp}
+
 initRScript=$1
 RServerScript=$2
 callFile=$3
@@ -60,7 +64,7 @@
 
 # Ensure that the dir for this slot exists. 
 
-BASEDIR=/tmp/$(id -nu)/SwiftR/Rworkers
+BASEDIR=$tmp/$(id -nu)/SwiftR/Rworkers
 WORKERDIR=$BASEDIR/worker.$SWIFT_WORKER_PID
 SLOTDIR=$WORKERDIR/${SWIFT_JOB_SLOT}
 

Modified: SwiftApps/SwiftR/Swift/exec/configure-site-local
===================================================================
--- SwiftApps/SwiftR/Swift/exec/configure-site-local	2010-10-02 01:51:49 UTC (rev 3656)
+++ SwiftApps/SwiftR/Swift/exec/configure-site-local	2010-10-05 00:10:54 UTC (rev 3657)
@@ -1,6 +1,7 @@
 #! /bin/bash
 
 throttleOneCore="-0.001"
+throttleOneCore="0.00"  # FIXME: test if new swft fix makes zero OK rather than -0.001
 localcores=5 # FIXME: parameterize: localthreads=N
 
 #### DBDBDBDB vvvvvv

Modified: SwiftApps/SwiftR/Swift/exec/configure-site-pbs
===================================================================
--- SwiftApps/SwiftR/Swift/exec/configure-site-pbs	2010-10-02 01:51:49 UTC (rev 3656)
+++ SwiftApps/SwiftR/Swift/exec/configure-site-pbs	2010-10-05 00:10:54 UTC (rev 3657)
@@ -4,7 +4,7 @@
 
 cat >tc <<END
 fork      bashlocal /bin/bash null null null
-pbscoast  bash      /bin/bash null null ENV::PATH="$PATH";ENV::SWIFT_JOB_SLOT="${i}";ENV::SWIFT_WORKER_PID="$$"
+pbscoast  bash      /bin/bash null null ENV::PATH="$PATH";GLOBUS::maxwalltime="00:10:00"
 END
 
 cat >sites.xml <<END
@@ -29,11 +29,9 @@
 
   <pool handle="pbscoast">
     <execution provider="coaster" url="none" jobmanager="local:pbs"/>
-
-    <profile namespace="globus" key="queue">fast</profile>
-    <profile namespace="globus" key="maxTime">3500</profile>
-    <profile namespace="globus" key="maxWallTime">00:00:01</profile>
-    <profile namespace="globus" key="slots">1</profile>
+    <profile namespace="globus" key="queue">short</profile>
+    <profile namespace="globus" key="maxTime">12000</profile>
+    <profile namespace="globus" key="slots">32</profile>
     <profile namespace="globus" key="nodeGranularity">1</profile>
     <profile namespace="globus" key="maxNodes">1</profile>
     <profile namespace="globus" key="workersPerNode">1</profile>
@@ -41,11 +39,14 @@
     <profile namespace="karajan" key="initialScore">10000</profile>
 
     <filesystem provider="local" url="none"/>
-    <workdirectory>/home/wilde/swiftwork</workdirectory>
+    <workdirectory>$HOME/swiftwork</workdirectory>
   </pool>
 </config>
 END
 
+#     <profile namespace="globus" key="maxWallTime">00:00:01</profile>
+#     <profile namespace="globus" key="queue">fast</profile>
+
 cat >cf <<END
 wrapperlog.always.transfer=true
 sitedir.keep=true
@@ -54,7 +55,7 @@
 status.mode=provider
 use.provider.staging=false
 provider.staging.pin.swiftfiles=false
-throttle.host.submit=1
+#throttle.host.submit=1
 END
 
 

Modified: SwiftApps/SwiftR/Swift/exec/rserver.swift
===================================================================
--- SwiftApps/SwiftR/Swift/exec/rserver.swift	2010-10-02 01:51:49 UTC (rev 3656)
+++ SwiftApps/SwiftR/Swift/exec/rserver.swift	2010-10-05 00:10:54 UTC (rev 3657)
@@ -13,7 +13,7 @@
 app ack (external e[])
 {
 #  bash "-c" "echo SIGNAL DONE >/dev/tty; echo done > /tmp/SwiftR/swiftserver/resultpipe";
-   bash "-c" @strcat("echo done > ",resultPipeName);
+   bashlocal "-c" @strcat("echo done > ",resultPipeName);
 }
 
 (external e[]) apply (string runDir)

Modified: SwiftApps/SwiftR/Swift/exec/start-swift
===================================================================
--- SwiftApps/SwiftR/Swift/exec/start-swift	2010-10-02 01:51:49 UTC (rev 3656)
+++ SwiftApps/SwiftR/Swift/exec/start-swift	2010-10-05 00:10:54 UTC (rev 3657)
@@ -5,6 +5,10 @@
 # FIXME: check args and use better arg parsing
 
 tmp=/tmp # FIXME: allow this to change eg for sites with main tmp dir elsewhere
+tmp=/scratch/local # FIXME: allow this to change eg for sites with main tmp dir elsewhere
+
+tmp=${SWIFTR_TMP:-/tmp}
+
 throttleOneCore="-0.001"
 localcores=5 # FIXME: parameterize: localthreads=N
 

Modified: SwiftApps/SwiftR/Swift/tests/TestSwift.R
===================================================================
--- SwiftApps/SwiftR/Swift/tests/TestSwift.R	2010-10-02 01:51:49 UTC (rev 3656)
+++ SwiftApps/SwiftR/Swift/tests/TestSwift.R	2010-10-05 00:10:54 UTC (rev 3657)
@@ -200,7 +200,8 @@
 swiftres = swiftapply(matfunc,arglist,callsperbatch=9)
 
 diffs <- 0
-for(i in 1:length(swiftres) ) {
+#for(i in 1:length(swiftres) ) {
+for(i in c(seq(1,100,10),100)) {
   if( !all.equal(swiftres[[i]],localres) ) { 
     diffs <- diffs + 1
     if( diffs < 10 ) cat(sprintf("res[%d]=%s\n",i,format(swiftres[[i]])))
@@ -230,7 +231,9 @@
 swiftres = swiftapply(matfunc,arglist,callsperbatch=7)
 
 diffs <- 0
-for(i in 1:length(swiftres) ) {
+#for(i in 1:length(swiftres) ) {
+for(i in c(seq(1,length(swiftres),10),length(swiftres))) {
+
   if( !all.equal(swiftres[[i]],localres) ) { 
     diffs <- diffs + 1
     if( diffs < 10 ) cat(sprintf("res[%d]=%s\n",i,format(swiftres[[i]])))

Modified: SwiftApps/SwiftR/TODO
===================================================================
--- SwiftApps/SwiftR/TODO	2010-10-02 01:51:49 UTC (rev 3656)
+++ SwiftApps/SwiftR/TODO	2010-10-05 00:10:54 UTC (rev 3657)
@@ -1,15 +1,22 @@
 *** TO DO LIST:
 
 MAIN
+
+- complete change for envvars like SWIFTR_TMP
+- add sourcing of $HOME/.SwiftR.init: pick up variables for the configure_ scripts from here; maybe one file in this dir for each site supported? maybe configure scripts go here?
+
+- try coasters to communicado-bridled: use simple script for passive coasters: ala swift/lab/mcsswift.sh?
+- try tests of coasters provider staging
+
 - coaster provider data mover
 - tracef to replace job
 - interrupt a pipe read in R
 - develop the common config-site-$SITE scripts
 - finalize() method to clean up request dir?
 - test with swift logging turned way down
+- make tmpdir a param; for start-nnn scripts use SWIFTR_TMP, ~/.SwiftR
+- make ports flexible and non-conflicting
 
-
-
 See if we can get Swift to just shut down the channel and start it again?
 - no extended idle timer
 - start new swift worker

Added: SwiftApps/SwiftR/install.sh
===================================================================
--- SwiftApps/SwiftR/install.sh	                        (rev 0)
+++ SwiftApps/SwiftR/install.sh	2010-10-05 00:10:54 UTC (rev 3657)
@@ -0,0 +1,4 @@
+ver=0.1
+R CMD build Swift
+R CMD INSTALL Swift_${ver}.tar.gz
+cp Swift_${ver}.tar.gz ~/public_html


Property changes on: SwiftApps/SwiftR/install.sh
___________________________________________________________________
Name: svn:executable
   + *




More information about the Swift-commit mailing list