[BioC] 'parallel' vs 'multicore'

Martin Morgan mtmorgan at fhcrc.org
Thu Oct 6 21:09:03 CEST 2011


On 10/06/2011 10:21 AM, Tim Triche, Jr. wrote:
> I have a lot of methods in methylumi (the revised version) that will happily
> parallelize themselves for (e.g.) loading hundreds of IDAT files, background
> correcting and normalizing anything in sight, etc.  Sometimes it's easier to
> parallelize things until I can find time to make them properly efficient
> (boooo!).
> When I compiled HEAD for R-2.14 the other day, after installing it, I typed
>
> library(parallel)
>
> And all the handy bits of snow and multicore were in there!  If I switch to
> the 'parallel' package, by default, will I now be OK and not screw Windows
> users? Everything works great on Linux/Unix, and has done so for months,
> with 'multicore'.  It seems like there aren't any substantial differences
> other than things "just work" for a base installation -- do other package
> authors anticipate moving over now that this is slated to be in the stable
> release?

Yes you and other developers should switch to parallel; it seems to be 
the wave of the future.

Likely your DESCRIPTION file should have

   Imports: parallel

and your NAMESPACE

   import(parallel)

Importing all of parallel seems to be the best solution, because the 
available symbols depend on platform, e.g., mclapply on Linux / Mac but 
not Windows.

It's still the case that mclapply, for instance, is not supported on 
Windows so your code needs to have some conditional evaluation -- 
exists("mclapply", "package:parallel").

If memory weren't an issue, then the 'sockets' interface from SNOW are 
the most portable.

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

Location: M1-B861
Telephone: 206 667-2793



More information about the Bioconductor mailing list