[Swift-commit] r5251 - in SwiftApps/SwiftR/Swift: src tests tests/OpenMx tests/perf

tga at ci.uchicago.edu tga at ci.uchicago.edu
Thu Oct 20 18:32:32 CDT 2011


Author: tga
Date: 2011-10-20 18:32:32 -0500 (Thu, 20 Oct 2011)
New Revision: 5251

Added:
   SwiftApps/SwiftR/Swift/tests/perf/perfutils.R
Removed:
   SwiftApps/SwiftR/Swift/tests/perf_tests.R
Modified:
   SwiftApps/SwiftR/Swift/src/Makefile
   SwiftApps/SwiftR/Swift/tests/OpenMx/BootstrapParallelBigger.R
   SwiftApps/SwiftR/Swift/tests/OpenMx/RAM-3Factor-96Indicators-covdata-a.R
   SwiftApps/SwiftR/Swift/tests/perf/param_size.R
   SwiftApps/SwiftR/Swift/tests/perf/serialisation_overhead.R
Log:
Working on R check errors

* Delete Swift/inst directory for CRAN package
* Move perf_tests.R so it isn't automatically run by check script

Modified: SwiftApps/SwiftR/Swift/src/Makefile
===================================================================
--- SwiftApps/SwiftR/Swift/src/Makefile	2011-10-20 23:32:20 UTC (rev 5250)
+++ SwiftApps/SwiftR/Swift/src/Makefile	2011-10-20 23:32:32 UTC (rev 5251)
@@ -53,6 +53,7 @@
 
 removeall: removebuild
 	rm -rf ./$(SWIFT_INST)
+	rm -rf ../inst
 
 
 removebuild:

Modified: SwiftApps/SwiftR/Swift/tests/OpenMx/BootstrapParallelBigger.R
===================================================================
--- SwiftApps/SwiftR/Swift/tests/OpenMx/BootstrapParallelBigger.R	2011-10-20 23:32:20 UTC (rev 5250)
+++ SwiftApps/SwiftR/Swift/tests/OpenMx/BootstrapParallelBigger.R	2011-10-20 23:32:32 UTC (rev 5251)
@@ -26,7 +26,7 @@
 
 require(OpenMx)
 require(Swift)
-source("Swift/tests/perf_tests.R")
+source("Swift/tests/perf/perfutils.R")
 
 
 

Modified: SwiftApps/SwiftR/Swift/tests/OpenMx/RAM-3Factor-96Indicators-covdata-a.R
===================================================================
--- SwiftApps/SwiftR/Swift/tests/OpenMx/RAM-3Factor-96Indicators-covdata-a.R	2011-10-20 23:32:20 UTC (rev 5250)
+++ SwiftApps/SwiftR/Swift/tests/OpenMx/RAM-3Factor-96Indicators-covdata-a.R	2011-10-20 23:32:32 UTC (rev 5251)
@@ -26,7 +26,7 @@
 
 library(OpenMx)
 library(Swift)
-source("Swift/tests/perf_tests.R")
+source("Swift/tests/perf/perfutils.R")
 
 # ---------------------------------------------------------------------
 # Data for factor model.

Modified: SwiftApps/SwiftR/Swift/tests/perf/param_size.R
===================================================================
--- SwiftApps/SwiftR/Swift/tests/perf/param_size.R	2011-10-20 23:32:20 UTC (rev 5250)
+++ SwiftApps/SwiftR/Swift/tests/perf/param_size.R	2011-10-20 23:32:32 UTC (rev 5251)
@@ -1,5 +1,5 @@
 require(Swift)
-source("Swift/tests/perf_tests.R")
+source("Swift/tests/perf/perfutils.R")
 
 cores <- 4
 intsize <- 4

Copied: SwiftApps/SwiftR/Swift/tests/perf/perfutils.R (from rev 5250, SwiftApps/SwiftR/Swift/tests/perf_tests.R)
===================================================================
--- SwiftApps/SwiftR/Swift/tests/perf/perfutils.R	                        (rev 0)
+++ SwiftApps/SwiftR/Swift/tests/perf/perfutils.R	2011-10-20 23:32:32 UTC (rev 5251)
@@ -0,0 +1,105 @@
+# Helper functions for building performance tests suites that don't quite fit in the
+# main SwiftR code because they can detach the Swift package..
+
+
+swiftSetup <- function (...) {
+    libraries <- search()
+    if ("package:Swift" %in% libraries) {
+        library(Swift)
+        options(.swift.detach=T)
+    }
+    library(Swift)
+    swiftSess <- swiftInit(...)
+    options(.swift.printtiming=getOption("swift.printtiming"))
+    options(swift.printtiming=TRUE)
+    # Wait to start
+    Sys.sleep(10)
+    # Run some small jobs to ensure workers are started and warmed up
+    swiftapply(function (x) { x }, 
+            rep(1, swiftSess$cores * swiftSess$nodes * 2),
+            callsperbatch=1)
+    return (swiftSess)
+}
+
+swiftTearDown <- function (...) {
+    swiftShutdown()
+    options(swift.printtiming=getOption(".swift.printtiming"))
+    dt <- getOption(".swift.detach")
+    options(.swift.detach=NULL)
+    if (!is.null(dt) && dt) {
+        detach(package:Swift)
+    }
+}
+
+sfSetup <- function(..., cpus=ncpus) {
+    libraries <- search()
+    if (!("package:snowfall" %in% libraries)) {
+        library(snowfall)
+        options(.snowfall.detach=T)
+    }
+    # Swift needs to be detached
+    if ("package:Swift" %in% libraries) {
+        detach(package:Swift)
+        options(.swift.reattach=T)
+    }
+
+    sfInit(..., cpus=ncpus)
+    # warmup
+    sfLapply(rep(1, ncpus * 2), 
+                function (x) { x })
+
+}
+
+sfTearDown <- function (...) {
+    sfStop()
+    dt <- getOption(".snowfall.detach")
+    options(.snowfall.detach=NULL)
+    if (!is.null(dt) && dt) {
+        detach(package:snowfall)
+    }
+    rt <- getOption(".swift.reattach")
+    options(.swift.reattach=NULL)
+    if (!is.null(rt) && rt) {
+        library(Swift)
+    }
+}
+
+
+
+makePerfTestGroup <- function (mode, name, f, allargs, prep=NULL, ...) {
+    params <- list(...)
+    paramstr <- paste(names(params),
+                rep("=", length(params)), 
+                lapply(params, deparse), 
+                sep="", collapse=", ")
+    if (mode == "swift") {
+        tg <- Swift:::makeParamTestGroup(name=paste("swift_",name, " ", paramstr,sep=""),
+            f=f, prep=prep,
+            allargs=allargs,
+            perfparams = params,
+            setup=function() {swiftSetup(...)},
+            teardown = swiftTearDown)
+    }
+    else if (mode == "snowfall") {
+        tg <- Swift:::makeParamTestGroup(name=paste("sf_",name, paramstr, sep=""),
+            f=f,prep=prep,
+            allargs=allargs,
+            perfparams = params,
+            setup=function() {sfSetup(...)},
+            teardown = sfTearDown)
+
+    }
+    else {
+        print("Making serial test")
+        tg <- Swift:::makeParamTestGroup(name=paste("serial_",name, paramstr, sep=""),
+            f=f,prep=prep,
+            allargs=allargs,
+            perfparams = list(),
+            setup=function() 
+                {try(detach(package:Swift)); try(detach(package:Snowfall))} )
+    }
+    return (tg)
+}
+
+
+

Modified: SwiftApps/SwiftR/Swift/tests/perf/serialisation_overhead.R
===================================================================
--- SwiftApps/SwiftR/Swift/tests/perf/serialisation_overhead.R	2011-10-20 23:32:20 UTC (rev 5250)
+++ SwiftApps/SwiftR/Swift/tests/perf/serialisation_overhead.R	2011-10-20 23:32:32 UTC (rev 5251)
@@ -1,6 +1,6 @@
 
 require(Swift)
-source("Swift/tests/perf_tests.R")
+source("Swift/tests/perf/perfutils.R")
 source("Swift/tests/OpenMx/BootstrapParallelBigger.R")
 
 args = 128

Deleted: SwiftApps/SwiftR/Swift/tests/perf_tests.R
===================================================================
--- SwiftApps/SwiftR/Swift/tests/perf_tests.R	2011-10-20 23:32:20 UTC (rev 5250)
+++ SwiftApps/SwiftR/Swift/tests/perf_tests.R	2011-10-20 23:32:32 UTC (rev 5251)
@@ -1,105 +0,0 @@
-# Helper functions for building performance tests suites that don't quite fit in the
-# main SwiftR code because they can detach the Swift package..
-
-
-swiftSetup <- function (...) {
-    libraries <- search()
-    if ("package:Swift" %in% libraries) {
-        library(Swift)
-        options(.swift.detach=T)
-    }
-    library(Swift)
-    swiftSess <- swiftInit(...)
-    options(.swift.printtiming=getOption("swift.printtiming"))
-    options(swift.printtiming=TRUE)
-    # Wait to start
-    Sys.sleep(10)
-    # Run some small jobs to ensure workers are started and warmed up
-    swiftapply(function (x) { x }, 
-            rep(1, swiftSess$cores * swiftSess$nodes * 2),
-            callsperbatch=1)
-    return (swiftSess)
-}
-
-swiftTearDown <- function (...) {
-    swiftShutdown()
-    options(swift.printtiming=getOption(".swift.printtiming"))
-    dt <- getOption(".swift.detach")
-    options(.swift.detach=NULL)
-    if (!is.null(dt) && dt) {
-        detach(package:Swift)
-    }
-}
-
-sfSetup <- function(..., cpus=ncpus) {
-    libraries <- search()
-    if (!("package:snowfall" %in% libraries)) {
-        library(snowfall)
-        options(.snowfall.detach=T)
-    }
-    # Swift needs to be detached
-    if ("package:Swift" %in% libraries) {
-        detach(package:Swift)
-        options(.swift.reattach=T)
-    }
-
-    sfInit(..., cpus=ncpus)
-    # warmup
-    sfLapply(rep(1, ncpus * 2), 
-                function (x) { x })
-
-}
-
-sfTearDown <- function (...) {
-    sfStop()
-    dt <- getOption(".snowfall.detach")
-    options(.snowfall.detach=NULL)
-    if (!is.null(dt) && dt) {
-        detach(package:snowfall)
-    }
-    rt <- getOption(".swift.reattach")
-    options(.swift.reattach=NULL)
-    if (!is.null(rt) && rt) {
-        library(Swift)
-    }
-}
-
-
-
-makePerfTestGroup <- function (mode, name, f, allargs, prep=NULL, ...) {
-    params <- list(...)
-    paramstr <- paste(names(params),
-                rep("=", length(params)), 
-                lapply(params, deparse), 
-                sep="", collapse=", ")
-    if (mode == "swift") {
-        tg <- Swift:::makeParamTestGroup(name=paste("swift_",name, " ", paramstr,sep=""),
-            f=f, prep=prep,
-            allargs=allargs,
-            perfparams = params,
-            setup=function() {swiftSetup(...)},
-            teardown = swiftTearDown)
-    }
-    else if (mode == "snowfall") {
-        tg <- Swift:::makeParamTestGroup(name=paste("sf_",name, paramstr, sep=""),
-            f=f,prep=prep,
-            allargs=allargs,
-            perfparams = params,
-            setup=function() {sfSetup(...)},
-            teardown = sfTearDown)
-
-    }
-    else {
-        print("Making serial test")
-        tg <- Swift:::makeParamTestGroup(name=paste("serial_",name, paramstr, sep=""),
-            f=f,prep=prep,
-            allargs=allargs,
-            perfparams = list(),
-            setup=function() 
-                {try(detach(package:Swift)); try(detach(package:Snowfall))} )
-    }
-    return (tg)
-}
-
-
-




More information about the Swift-commit mailing list