You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@systemds.apache.org by mb...@apache.org on 2020/09/19 20:22:34 UTC
[systemds] branch master updated: [SYSTEMDS-2641] Fix R slice
finding baseline (doMC dependency)
This is an automated email from the ASF dual-hosted git repository.
mboehm7 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/systemds.git
The following commit(s) were added to refs/heads/master by this push:
new 4b3e065 [SYSTEMDS-2641] Fix R slice finding baseline (doMC dependency)
4b3e065 is described below
commit 4b3e06516d6946b5557e8790297fb2d3dcf194e7
Author: Matthias Boehm <mb...@gmail.com>
AuthorDate: Sat Sep 19 22:22:00 2020 +0200
[SYSTEMDS-2641] Fix R slice finding baseline (doMC dependency)
This patch fixes the R baseline script, by removing the doMC dependency.
Apparently, the CRAN doMC package is not available for windows. It can
be forced installed via
install.packages("doMC", repos="http://R-Forge.R-project.org")
However, to avoid special cases in our automated install scripts, we
fallback to basic for loops instead. For performance comparisons, please
use the commented code with multi-threaded parfor loops for the main
slice evaluation loop.
---
src/test/scripts/functions/builtin/slicefinder.R | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/src/test/scripts/functions/builtin/slicefinder.R b/src/test/scripts/functions/builtin/slicefinder.R
index a84cd4a..394a01f 100644
--- a/src/test/scripts/functions/builtin/slicefinder.R
+++ b/src/test/scripts/functions/builtin/slicefinder.R
@@ -23,9 +23,9 @@ args<-commandArgs(TRUE)
options(digits=22)
library("Matrix")
library("matrixStats")
-library("doMC")
-registerDoMC(NULL) # physical cores
+# library("doMC")
+# registerDoMC(NULL) # physical cores
################################################################################
@@ -82,8 +82,12 @@ slicefinder = function(X, e,
# extract and evaluate candidate slices
if( tpEval ) { # task-parallel
- R = foreach( i=1:nrow(S), .combine=rbind) %dopar% {
- return (evalSlice(X2, e, eAvg, as.matrix(S[i,]), level, alpha))
+ #R = foreach( i=1:nrow(S), .combine=rbind) %dopar% {
+ # return (evalSlice(X2, e, eAvg, as.matrix(S[i,]), level, alpha))
+ #}
+ R = matrix(0, nrow(S), 4)
+ for(i in 1:nrow(S)) {
+ R[i,] = evalSlice(X2, e, eAvg, as.matrix(S[i,]), level, alpha)
}
}
else { # data-parallel