From mtmorgan at fhcrc.org  Tue Aug 21 15:50:51 2012
From: mtmorgan at fhcrc.org (Martin Morgan)
Date: Tue, 21 Aug 2012 06:50:51 -0700
Subject: [Rd] parLapply fails to detect default cluster?
Message-ID: <5033923B.1050107@fhcrc.org>

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>


[Rd] parLapply fails to detect default cluster?
Martin Morgan