[Swift-commit] r3605 - SwiftApps/SwiftR/Swift/exec

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Tue Sep 7 11:54:44 CDT 2010


Author: wilde
Date: 2010-09-07 11:54:44 -0500 (Tue, 07 Sep 2010)
New Revision: 3605

Added:
   SwiftApps/SwiftR/Swift/exec/RunAllR.sh
Log:
Add script to manually execute Swift call batches for manualmode processing.

Added: SwiftApps/SwiftR/Swift/exec/RunAllR.sh
===================================================================
--- SwiftApps/SwiftR/Swift/exec/RunAllR.sh	                        (rev 0)
+++ SwiftApps/SwiftR/Swift/exec/RunAllR.sh	2010-09-07 16:54:44 UTC (rev 3605)
@@ -0,0 +1,24 @@
+#! /usr/bin/env Rscript
+
+# Use this script to run batches manually for testing. See "manualmode" notes in R/Swift.R.
+
+require(OpenMx)
+
+argv = commandArgs(TRUE)
+
+# load(argv[1]);
+
+for(infile in argv) {
+  cat("Processing file: ", infile, "\n")
+  rcall <- NULL # Needed?
+  load(infile)
+  ofile <- sub('^c','r',infile)
+  result <- list()
+  cat("Number of calls: ", length(rcall$arglistbatch),"\n")
+  for(c in 1:length(rcall$arglistbatch)) {
+      # FIXME: run this under try/catch and save error status in results object (need to make it a list: rval + error status)
+      cat("Running call # ", c, "\n");
+      result[[c]] <- do.call( rcall$func, rcall$arglistbatch[[c]] )
+  }
+  save(result,file=ofile)
+}


Property changes on: SwiftApps/SwiftR/Swift/exec/RunAllR.sh
___________________________________________________________________
Name: svn:executable
   + *




More information about the Swift-commit mailing list