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

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Fri Sep 24 13:44:00 CDT 2010


Author: wilde
Date: 2010-09-24 13:44:00 -0500 (Fri, 24 Sep 2010)
New Revision: 3641

Modified:
   SwiftApps/SwiftR/README
   SwiftApps/SwiftR/Swift/R/Swift.R
   SwiftApps/SwiftR/Swift/exec/start-swift-Rserver
   SwiftApps/SwiftR/Swift/exec/start-swift-workers
   SwiftApps/SwiftR/TODO
Log:
Revisions to configuration and cleanup logic. Additional misc fixes.

Modified: SwiftApps/SwiftR/README
===================================================================
--- SwiftApps/SwiftR/README	2010-09-22 22:33:52 UTC (rev 3640)
+++ SwiftApps/SwiftR/README	2010-09-24 18:44:00 UTC (rev 3641)
@@ -21,8 +21,14 @@
 Need to put the right R in the PATH for building and testing.
 Using R 2.11 as of 2010.0903
 
-OpenMx source tree checked out under: ~/SwiftR/OpenMx
+OpenMx source tree checked out under: ~/OpenMx
+working in .../trunk
+~/SwiftR/OpenMx is a fossil and should be moved and then removed (when certain)
 
+test under: trunk/demo
+source("ParallelBootrapDemo")
+...  FIXME ^^^
+
 Repo is: https://svn.ci.uchicago.edu/svn/vdl2/SwiftApps/SwiftR
 
 R packages are installed under: ~/RPackages
@@ -128,5 +134,29 @@
 in swiftapply the remote calls are batched
 
 option processing:
+# describe here: func kw args; def vals mostly NULL; options() values override if kw not specified.
 
+Processing mode selects a set of  sites, a cf, and a tc.
 
+Site selects a site within a tc for a secific exec.
+
+rserver.swift runs an app() whose name encodes the site (eg: bashservice, bashlocal)
+
+Provider staging is a problem: its all or none. How to do provider staging for local? I think thats OK: hopefully its fast.
+
+Probem: would like to do multiple sites fomr the internal coaster service rather than an external coaster service
+
+---
+
+cd ~/SwiftR
+R CMD INSTALL Swift
+R CMD check Swift
+R CMD build Swift # produces ./Swift_0.1.tar.gz
+
+wget http://www.ci.uchicago.edu/~wilde/Swift_0.1.tar.hz
+R CMD INSTALL -l ~/RLibrary Swift_0.1.tar.gz
+export R_LIBS=~/RLibrary
+R
+require(Swift)
+
+

Modified: SwiftApps/SwiftR/Swift/R/Swift.R
===================================================================
--- SwiftApps/SwiftR/Swift/R/Swift.R	2010-09-22 22:33:52 UTC (rev 3640)
+++ SwiftApps/SwiftR/Swift/R/Swift.R	2010-09-24 18:44:00 UTC (rev 3641)
@@ -123,6 +123,9 @@
     nresults <- length(result)
     for(r in 1:nresults) {
       rlist[[rno]] <- result[[r]]
+if(class(result[[r]]) == "try-error") {
+cat("ERROR in eval: ", result[[r]], "\n");
+}
       #DB cat("swiftapply: result rno=",rno,":\n") # FIXME: for logging
       #DB cat(rlist[[rno]]@output$gradient,"\n")
       rno <- rno + 1

Modified: SwiftApps/SwiftR/Swift/exec/start-swift-Rserver
===================================================================
--- SwiftApps/SwiftR/Swift/exec/start-swift-Rserver	2010-09-22 22:33:52 UTC (rev 3640)
+++ SwiftApps/SwiftR/Swift/exec/start-swift-Rserver	2010-09-24 18:44:00 UTC (rev 3641)
@@ -55,7 +55,7 @@
     <profile key="jobThrottle" namespace="karajan">.03</profile>
     <profile namespace="karajan" key="initialScore">10000</profile>
     <filesystem provider="local" url="none" />
-    <workdirectory>$rundir/swiftwork</workdirectory>
+    <workdirectory>$HOME/swiftwork</workdirectory>
   </pool>
 
   <pool handle="local">
@@ -83,7 +83,7 @@
     <profile key="jobThrottle" namespace="karajan">.07</profile>
     <profile namespace="karajan" key="initialScore">10000</profile>
     <filesystem provider="local" url="none" />
-    <workdirectory>/home/wilde/swiftwork</workdirectory>
+    <workdirectory>/$HOME/swiftwork</workdirectory>
   </pool>
 
   <pool handle="service">
@@ -93,7 +93,7 @@
     <profile key="jobThrottle" namespace="karajan">.03</profile>
     <profile namespace="karajan" key="initialScore">10000</profile>
     <filesystem provider="local" url="none" />
-    <workdirectory>/home/wilde/swiftwork</workdirectory>
+    <workdirectory>/$HOME/swiftwork</workdirectory>
   </pool>
 
   <pool handle="pbs">
@@ -104,7 +104,7 @@
     <profile namespace="karajan" key="initialScore">10000</profile>
     <profile namespace="karajan" key="jobThrottle">5.99</profile>
     <filesystem provider="local"/>
-    <workdirectory>$(pwd)</workdirectory>
+    <workdirectory>/$HOME/swiftwork</workdirectory>
   </pool>
 
 </config>
@@ -168,7 +168,7 @@
     <profile key="jobThrottle" namespace="karajan">.07</profile>
     <profile namespace="karajan" key="initialScore">10000</profile>
     <filesystem provider="local" url="none" />
-    <workdirectory>/home/wilde/swiftwork</workdirectory>
+    <workdirectory>$HOME/swiftwork</workdirectory>
   </pool>
 
   <pool handle="service">
@@ -178,7 +178,7 @@
     <profile key="jobThrottle" namespace="karajan">.03</profile>
     <profile namespace="karajan" key="initialScore">10000</profile>
     <profile namespace="swift" key="stagingMethod">proxy</profile>
-    <workdirectory>/tmp/wilde/SwiftR/swiftwork</workdirectory>
+    <workdirectory>/tmp/$USER/SwiftR/swiftwork</workdirectory>
   </pool>
 
   <pool handle="OLDservice">
@@ -188,7 +188,7 @@
     <profile key="jobThrottle" namespace="karajan">.03</profile>
     <profile namespace="karajan" key="initialScore">10000</profile>
     <filesystem provider="local" url="none" />
-    <workdirectory>/home/wilde/swiftwork</workdirectory>
+    <workdirectory>/$HOME/swiftwork</workdirectory>
   </pool>
 
   <pool handle="pbs">
@@ -199,7 +199,7 @@
     <profile namespace="karajan" key="initialScore">10000</profile>
     <profile namespace="karajan" key="jobThrottle">5.99</profile>
     <filesystem provider="local"/>
-    <workdirectory>$(pwd)</workdirectory>
+    <workdirectory>$HOME/swiftwork</workdirectory>
   </pool>
 
 </config>

Modified: SwiftApps/SwiftR/Swift/exec/start-swift-workers
===================================================================
--- SwiftApps/SwiftR/Swift/exec/start-swift-workers	2010-09-22 22:33:52 UTC (rev 3640)
+++ SwiftApps/SwiftR/Swift/exec/start-swift-workers	2010-09-24 18:44:00 UTC (rev 3641)
@@ -1,19 +1,47 @@
 #! /bin/bash
 
+Usage()
+{
+  echo $0: 'Usage: start-swift-workers [-ls|--local-staging|-ps|--provider-staging|-sp|--service-port portnum] site1 ... siteN'
+}
+
 # Command arguments
 
-STAGINGMETHOD=${1:-local-staging}
-COMPUTEHOSTS=${2:-localhost}
+STAGINGMETHOD=local-staging
+COMPUTEHOSTS=localhost
+SERVICEPORT=1985
 
-#  COMPUTEHOSTS='crush thwomp stomp crank steamroller grind churn trounce thrash vanquish'
-#  COMPUTEHOSTS='communicado'
+while [ $# -gt 0 -a $(expr "$1" : -) = 1 ]; do
+  case "$1" in
+    -ls|--local-staging) STAGINGMETHOD=local-staging; shift ;;
+    -ps|--provider-staging) STAGINGMETHOD=provider-staging; shift ;;
+    -sp|--service-port) shift; SERVICEPORT=$1; shift ;;
+    *) echo $0: Invalid argument "$1"; Usage; exit 1
+  esac
+done
 
-# Parameters # FIXME: Add to command line options
+if [ $# -gt 0 ]; then
+  COMPUTEHOSTS=$*
+fi
 
-SERVICEPORT=1985
+if [ $(expr "$SERVICEPORT" : '[0-9]*' ) = 0 ]; then
+  echo $0: Error: invalid service port $SERVICEPORT; Usage; exit 1
+fi
 
-# shift # FIXME: Why? Fossil?
+echo Staging method: $STAGINGMETHOD
+echo Service port: $SERVICEPORT
+for h in $COMPUTEHOSTS; do
+  echo Host: $h
+  if [ $(expr $h : -) != 0 ]; then
+    echo $0: Error: invalid argument or host name: $h
+    Usage
+    exit 1
+  fi
+done
 
+#  COMPUTEHOSTS='crush thwomp stomp crank steamroller grind churn trounce thrash vanquish'
+#  COMPUTEHOSTS='communicado'
+
 SWIFTRBIN=$(cd $(dirname $0); pwd) # Find our bin dir (to use for running utility scripts)
 SWIFTBIN=$SWIFTRBIN/../swift/bin
 
@@ -58,13 +86,17 @@
   echo $sshpids > $sshpidfile
 }
 
+# make swiftworkers.XXXX temp dir and link swiftworkers/ to it
+
 rundir=/tmp/$USER/SwiftR/swiftworkers
-
+mkdir -p $(basename $rundir)
 trundir=$(mktemp -d $rundir.XXXX)
 mkdir -p $trundir
 rm -rf $rundir
 ln -s $trundir $rundir
 
+echo "Logging to $trundir"
+
 servicedir=service
 cd $rundir
 out=swift.stdouterr
@@ -87,7 +119,7 @@
     <profile key="jobThrottle" namespace="karajan">.03</profile>
     <profile namespace="karajan" key="initialScore">10000</profile>
     <filesystem provider="local" url="none" />
-    <workdirectory>/home/wilde/swiftwork</workdirectory>
+    <workdirectory>$HOME/swiftwork</workdirectory>
   </pool>
 </config>
 END
@@ -158,7 +190,7 @@
     rpid=$(grep PID= $rpfile | sed -e 's/PID=//')
     rhost=$(echo $rpfile | sed -e 's/remotepid.//')
     echo Based on $rpfile: terminating process group of process $rpid on $rhost
-    ssh $rhost sh -c \'kill -s TERM -- '-$(' ps -p $rpid -o pgid --no-headers ')'\'
+    ssh $rhost sh -c \''PGID=$(ps -p '$rpid' -o pgid --no-headers|sed -e "s/ //g"); kill -s TERM -- -$PGID'\'
   done
   if [ "_$sshpids$starterpid$coasterservicepid" != _ ]; then
     echo kill $sshpids $starterpid $coasterservicepid >& /dev/null

Modified: SwiftApps/SwiftR/TODO
===================================================================
--- SwiftApps/SwiftR/TODO	2010-09-22 22:33:52 UTC (rev 3640)
+++ SwiftApps/SwiftR/TODO	2010-09-24 18:44:00 UTC (rev 3641)
@@ -29,8 +29,41 @@
 
   Get traces into R vars of swiftapply performance
 
+Init perf #s (from Crush)
+11 runs, ~17 secs real time each. CPU times are below:
 
+wilde     5804  5794  5804  5804  0 09:15 pts/12   00:00:00         bash
+wilde     7182  5804  7182  5804  0 09:23 pts/12   00:00:00           /bin/bash /homes/wilde/RLibrary/Swift/exec/start-swift-workers
+wilde     7193  7182  7182  5804  0 09:23 pts/12   00:00:00             /bin/sh /homes/wilde/RLibrary/Swift/exec/../swift/bin/coaster
+wilde     7219  7193  7182  5804  0 09:23 pts/12   00:00:07               java -Djava.endorsed.dirs=/homes/wilde/RLibrary/Swift/exec/
+wilde     7625  7182  7182  5804  0 09:23 pts/12   00:00:00             /bin/bash /homes/wilde/RLibrary/Swift/exec/start-swift-Rserve
+wilde     7643  7625  7182  5804  0 09:23 pts/12   00:00:00               /bin/sh /homes/wilde/RLibrary/Swift/exec/../swift/bin/swift
+wilde     7706  7643  7182  5804  3 09:23 pts/12   00:00:34                 java -Xmx256M -Djava.endorsed.dirs=/homes/wilde/RLibrary/
+wilde     8268  5804  8268  5804  9 09:29 pts/12   00:01:01           /usr/lib64/R/bin/exec/R
+wilde    15581  5804 15581  5804  0 09:40 pts/12   00:00:00           ps -fjH -u wilde
+wilde    28836 28769 28769 28769  0 Sep20 ?        00:00:00 sshd: wilde at pts/1
+wilde    28837 28836 28837 28837  0 Sep20 pts/1    00:00:00   -bash
+wilde     7581  7513  7513  7513  0 09:23 ?        00:00:00 sshd: wilde at notty
+wilde     8926     1  7582  7582  2 09:34 ?        00:00:07 /usr/lib64/R/bin/exec/R --slave --no-restore --file=./SwiftRServer.sh --a
+wilde     8924     1  7582  7582  1 09:34 ?        00:00:06 /usr/lib64/R/bin/exec/R --slave --no-restore --file=./SwiftRServer.sh --a
+wilde     8918     1  7582  7582  1 09:34 ?        00:00:07 /usr/lib64/R/bin/exec/R --slave --no-restore --file=./SwiftRServer.sh --a
+wilde     8758     1  7582  7582  2 09:34 ?        00:00:07 /usr/lib64/R/bin/exec/R --slave --no-restore --file=./SwiftRServer.sh --a
+wilde     7587     1  7582  7582  1 09:23 ?        00:00:16 /usr/bin/perl /tmp/wilde/SwiftR/swiftworkerlogs/worker.pl http://140.221.
+wilde     7510     1  7182  5804  0 09:23 pts/12   00:00:00 ssh localhost /bin/sh -c 'WORKER_LOGGING_ENABLED=true /tmp/wilde/SwiftR/s
 
+7s   coaster service
+34s  swift
+1:01 R
+27s  R servers
+16   worker.pl
+
+R cli may have some overhead for processing answer each time.
+
+187 secs total real time.
+
+
+
+
 See if swift can write to pipe without using an app()
 
 Bundle start-swift-workers and RunRServer into one command;




More information about the Swift-commit mailing list