[Swift-commit] r4162 - in SwiftApps/SwiftR/Swift: R tests

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Wed Mar 2 16:29:29 CST 2011


Author: tga
Date: 2011-03-02 16:29:29 -0600 (Wed, 02 Mar 2011)
New Revision: 4162

Modified:
   SwiftApps/SwiftR/Swift/R/Workers.R
   SwiftApps/SwiftR/Swift/tests/batch_test.R
   SwiftApps/SwiftR/Swift/tests/pbs_test.sub
Log:
Fixes to pbs batch submission.
Fixed bug where hostnames were converted to factors.


Modified: SwiftApps/SwiftR/Swift/R/Workers.R
===================================================================
--- SwiftApps/SwiftR/Swift/R/Workers.R	2011-03-02 22:04:52 UTC (rev 4161)
+++ SwiftApps/SwiftR/Swift/R/Workers.R	2011-03-02 22:29:29 UTC (rev 4162)
@@ -15,7 +15,8 @@
         if (hostfile[[1]] != "") {
             hostnames <- read.table(hostfile, stringsAsFactors=FALSE)[[1]]
             summ <- rle(sort(hostnames))
-            hostinfo <- data.frame(hosts=summ[[2]], count=summ[[1]])
+            hostinfo <- data.frame(hosts=summ[[2]], count=summ[[1]],
+                         stringsAsFactors=FALSE)
         }
     }
 
@@ -24,7 +25,8 @@
         if (hostfile[[1]] != "") {
             hostnames <- read.table(hostfile, stringsAsFactors=FALSE)[[1]]
             summ <- rle(sort(hostnames))
-            hostinfo <- data.frame(hosts=summ[[2]], count=summ[[1]])
+            hostinfo <- data.frame(hosts=summ[[2]], count=summ[[1]],
+                        stringsAsFactors=FALSE)
         }
     }
     if (is.null(server) || server == "sge") {

Modified: SwiftApps/SwiftR/Swift/tests/batch_test.R
===================================================================
--- SwiftApps/SwiftR/Swift/tests/batch_test.R	2011-03-02 22:04:52 UTC (rev 4161)
+++ SwiftApps/SwiftR/Swift/tests/batch_test.R	2011-03-02 22:29:29 UTC (rev 4162)
@@ -31,5 +31,8 @@
     print(x3)
 }
 
+print ("Hosts:")
+print(x1[[1]])
+
 runAllSwiftTests(server="ssh", hosts=x1[[1]], cores=8)
 

Modified: SwiftApps/SwiftR/Swift/tests/pbs_test.sub
===================================================================
--- SwiftApps/SwiftR/Swift/tests/pbs_test.sub	2011-03-02 22:04:52 UTC (rev 4161)
+++ SwiftApps/SwiftR/Swift/tests/pbs_test.sub	2011-03-02 22:29:29 UTC (rev 4162)
@@ -14,5 +14,22 @@
 sort < $PBS_NODEFILE|uniq
 
 echo GLOBUS_HOSTNAME=$GLOBUS_HOSTNAME
-echo PATH=$PATH
-Rscript `dirname $0`/cobalt_script.R pbs
+#export PATH=/autonfs/home/tga/R-2.12.1/bin:$PATH
+
+if which Rscript; then
+    echo Rscript binary found!
+else
+    echo Rscript binary not found in:
+    echo PATH=$PATH
+    echo Maybe you need to set PATH in this sub file
+    exit 1
+fi
+
+
+#Rscript `dirname $0`/batch_test.R pbs
+if [ -f $PBS_O_WORKDIR/Swift/tests/batch_test.R ]; then
+    Rscript $PBS_O_WORKDIR/Swift/tests/batch_test.R pbs
+else
+    echo Could not find batch_test.R.  Maybe try modifying this .sub file with the absolute path of the script.
+    exit 1
+fi




More information about the Swift-commit mailing list