Skip to content
Prev 4353 / 21312 Next

[Bioc-devel] OpenMP error when using ShortRead::FastqStreamer with parallel::parLapply

On 05/26/2013 11:57 PM, Michael Stadler wrote:
Hi Michael --

Your diagnosis sounds on target. It is possible to set the number of openMP 
threads, which I think will address the problem. You'd like to not interfere 
with others' use of openMP, so reset the thread count when your function exits. 
Along the lines of

     nthreads <- .Call(ShortRead:::.set_omp_threads, 1L)
     on.exit(.Call(ShortRead:::.set_omp_threads, nthreads))

ShortRead's srapply function does this internally when it detects that the 
`parallel` package is in use (reasoning that mclapply and forked processes would 
be the common use case for single-machine parallel evaluation). I'll give some 
thought to more aggressively discovering when it is necessary to invoke 
FastqStreamer with this option set.

Sorry for the trouble,

Martin