Skip to main content
Topic: runParallel slot in xsAnnotate (Read 5936 times) previous topic - next topic

runParallel slot in xsAnnotate

Hi CAMERA developers,

I would like to ask about the purpose of runParallel slot in the xsAnnotate object of CAMERA. As I am processing a rather large dataset, I would like to know if I can take advantage of the mutliple cores of the machine I am working. Thank you in advance!

Panos

Re: runParallel slot in xsAnnotate

Reply #1
Hi Panos,

the runParallel slot is more or less a flag, where CAMERA stores if it is in parallel or single core mode and if it uses MPI or snow.

To use CAMERA in parallel mode you create your xsAnnotate object with parameter nslaves >= 2, but not higher than the number of available cores
#With object as xcms-object
xsa <- xsAnnotate(object, nslaves=2)

You can use the parallel mode with MPI/Rmpi or on a multi core machine with an installed snow package.

Hope this helps!

Carsten

Re: runParallel slot in xsAnnotate

Reply #2
Thank you Carsten,

While trying to initialize the xsAnnotate objects with multiple cores, I discovered that the "snow" part in the code was missing (CAMERA 1.6.0). There is no problem with this, I added it it myself (the chunk below), but is it supposed to be like this or there is a minor bug there? In addition, are the CAMERA functions parallelized or not yet implemented? I am asking because groupCorr is not really running faster and there isn't any core activity beyond usual. From a fast look at the source they don't seem to be implemented for parallel calculations. Is it so or am I missing something?  :)

The missing part for the initialization with "snow" (taken from the initialization of xcmsSet object):

Code: [Select]
...
else
{
snow = "snow"
if (try(require(snow, character.only = TRUE, quietly = TRUE)))
{
cat("Starting snow cluster with", nSlaves, "local sockets.n")
snowclust <- makeCluster(nSlaves, type = "SOCK")
runParallel <- 1
parMode <- "SOCK"
}
}
...

Thank you in advance!

Panos

Re: runParallel slot in xsAnnotate

Reply #3
The snow functionality was added recently, so you are right, in v1.6 only the MPI part was implemented.

Your code snippet is fine, it is not much different than the actual implementation,
but I would strongly recommend to update CAMERA to a newer version (http://http://bioconductor.org/packages/2.9/bioc/html/CAMERA.html),
because the were quite some bugfixes/improvements.

The parallel mode is currently only used in findAdducts, since it is the most time consuming step.
After the last speed ups the groupCorr function should be approx. as fast as the peak picker and was fine for our experiment sizes. So parallelization of this part had
lower priority in the to-do list.

If it is still a bottleneck, we could tackle it after the next BioC Release.