Skip to content
Prev 14166 / 15274 Next

Custom Indicator and apply.paramset problem

Thanks for the quick reply Brian,

The error reads as follows:

error calling combine function:
<simpleError in fun(result.1, result.2, result.3, result.4, result.5, result.6, ? ? result.7, result.8, result.9, result.10, result.11, result.12, ? ? result.13, result.14, result.15, result.16, result.17, result.18, ? ? result.19, result.20, result.21, result.22, result.23, result.24): attempt to select less than one element in OneIndex>


After switching to doParallel, the error message stays the same. How should I export my custom function to the cluster workers using .exports though? Just add it as an argument to apply.paramset()? Took a quick look at the apply.paramset() source code but couldn't figure out how to pass the .exports argument to it.

Thanks,

Atakan

The new parallel code (all other bits are the same):

#DoParallel on Windows - Does Not Work 
library(doParallel)
library(parallel)
paramsetenv <- new.env()
cl <- makeCluster(detectCores())
registerDoParallel(cl, cores=detectCores())                                      
results <- apply.paramset(strategy.st,
                          paramset.label=paramset.label.name,
                          portfolio=strategy.st, 
                          account=strategy.st,
                          nsamples=0,
                          verbose = TRUE,
                          audit=paramsetenv,
                          calc = "slave")
stopCluster(cl)
Message-ID: <VI1PR03MB1485C5611B4586ABCBBEC3F3C7550@VI1PR03MB1485.eurprd03.prod.outlook.com>
In-Reply-To: <AM4PR03MB14745D181782EE763277D0E0C7550@AM4PR03MB1474.eurprd03.prod.outlook.com>