SCM

Forum: help

Monitor Forum | Start New Thread Start New Thread
RE: parallel engine on Windows [ Reply ]
By: Joshua Ulrich on 2014-11-18 21:41
[forum:41659]
I personally do not want to spend too much time trying to make the current parallelization code "smarter". I would prefer to move all the blotter/quantstrat code to a more suitable data structure (e.g. reference classes, proto objects, or R6 classes). You can find an example of basic blotter functionality using R6 classes in the sandbox/ directory.

RE: parallel engine on Windows [ Reply ]
By: Offer Markovich on 2014-11-18 21:37
[forum:41658]
Thank you both for responding.

doRedis is working for me with no issues.
Now, after using clusterExport the doParallel package is also working fine.

Only one suggestion - the function that I needed to export is a osFUN. This is part of the strategy definition which is available to the quantstrat code.
Since this is available the code can export such functions by itself.
While not critical it can help new comers.

Thanks again

Offer

RE: parallel engine on Windows [ Reply ]
By: Brian Peterson on 2014-11-18 17:09
[forum:41655]
Another option in Windows may be doRedis. quantstrat has been tested extensively using doRedis across both single and multiple-machine clusters (also on linux though).

The doRedis engine does a better job of exporting the crrent environment to the workers than the socket SNOW engine used in parallel on Windows.

Brian

RE: parallel engine on Windows [ Reply ]
By: Joshua Ulrich on 2014-11-18 02:07
[forum:41651]
doParallel uses the parallel package, which uses a socket cluster on Windows. The nodes of socket clusters are not initialized with any values. This presents problems for many (all?) of the parallel functions in quantstrat. You need to explicitly export objects you want to use to all of the nodes using clusterExport. You might also need to create .blotter and/or .strategy environments on each node.

All of this code was initially written and tested on linux machines, which use fork clusters, so the master environment is copied to all the nodes and values on the nodes are only duplicated if changed.

parallel engine on Windows [ Reply ]
By: Offer Markovich on 2014-11-14 09:59
[forum:41641]
I'm trying to use parallel apply.paramset on Windows with doParallel.

Everything works OK when using registerDoSEQ() but with doParallel I'm getting an error:

results <- apply.paramset(strategy.st,
paramset.label='EMA',
portfolio.st=portfolio.st,
account.st=account.st,
#mktdata=mktdata[1:500],
#nsamples = 80,
audit = NULL,
verbose=!TRUE,
nsamples=1,
user.func=f,user.args=list(account.st=account.st))
> results
<simpleError in get(as.character(FUN), mode = "function", envir = envir): object 'posSize' of mode 'function' was not found>

the posSize function is used to decide the order size by the entry rule.

So, how can I export this function to the slaves?

Is doParallel supported as a backend for Windows?
If not, what should I use?

Many thanks

Offer


Thanks to:
Vienna University of Economics and Business Powered By FusionForge