[Rd] parLapply fails to detect default cluster?

Martin Morgan mtmorgan at fhcrc.org
Tue Aug 21 15:50:51 CEST 2012


invoking parLapply without a cluster fails to find a previously 
registered cluster

 > library(parallel)
 > setDefaultCluster(makePSOCKcluster(2))
 > parLapply(X=1:2, fun=function(...) {})
Error in cut.default(i, breaks) : invalid number of intervals

This is because in parLapply length(cl) is determined before 
defaultCluster(cl) is called. By inspection, this appears to be true of 
other high-level functions, but ironically not of parApply.

In defaultCluster, t would also be helpful to check that the detected 
cluster, user-supplied or other, is a valid cluster.

diff attached.

Martin
-- 
Computational Biology / Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N.
PO Box 19024 Seattle, WA 98109

Location: Arnold Building M1 B861
Phone: (206) 667-2793
-------------- next part --------------
A non-text attachment was scrubbed...
Name: defaultCluster.diff
Type: text/x-patch
Size: 2190 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-devel/attachments/20120821/50679d0b/attachment.bin>


More information about the R-devel mailing list