ihadanny
ihadanny

Reputation: 4483

Why isn't openmp parallel speeding up my randomForestSRC?

I'm using R's randomForestSRC library Version: 2.2.0 Date: 2016-05-17, which specifically says The package runs in both serial and parallel (OpenMP) in its description, and I'm sure it's loaded, as sessionInfo() says: randomForestSRC_2.2.0. I've followed the instructions for installing the openMP enabled version and downloaded it from Ishwaran's site.

Yet, I'm trying to speed up the building of a puny forest of 8 trees, and its not speeding at all :(

Serial:

options(rf.cores=1, mc.cores=1)
system.time(my.rfsrc <- rfsrc(Surv(score_years_before_label, status) ~ ., data = m, nsplit=10, ntree = 8, na.action = "na.impute", tree.err=TRUE, importance = TRUE))
user  system elapsed 
359.42    0.06  359.58 

Parallel:

print(detectCores())
[1] 8
options(rf.cores=8, mc.cores=8)
system.time(my.rfsrc <- rfsrc(Surv(score_years_before_label, status) ~ ., data = m, nsplit=10, ntree = 8, na.action = "na.impute", tree.err=TRUE, importance = TRUE))
user  system elapsed 
378.07    0.05  314.67 

I'm using Windows 10 Pro, 64-bit and my machine has 4 cores and 8 logical processors, and my data isn't that big:

print(nrow(m))
23070
print(ncol(m))
67

What am I doing wrong? Thanks!

Upvotes: 0

Views: 464

Answers (1)

Udaya Kogalur
Udaya Kogalur

Reputation: 161

Indeed, the package does support serial and OpenMP parallel processing. However, the default CRAN build protocol and binaries do not enable this functionality out of the box. Please see Page Two of the documentation, the section titled "OpenMP Parallel Processing – Installation", for additional details specific to your platform.

Upvotes: 2

Related Questions