Question: Run jobs asynchronously with BiocParellel
0
gravatar for Qiang
6 weeks ago by
Qiang70
Qiang70 wrote:

Hi,

Is it possible to run bplapply in the background to computing nodes (by batchtools) instead of blocking the R session?

I saw a related discussion about running a parallel job with the future.batchtools package. https://github.com/Bioconductor/BiocParallel/issues/64

This feature is what exactly I wished.

## submit job to nodes
f <- plan({ bplapply expr })
## check finshed or not
resolved(f)
## collect the results
v <- value(f)

Thanks, Qiang

ADD COMMENTlink modified 6 weeks ago by Martin Morgan ♦♦ 24k • written 6 weeks ago by Qiang70
Answer: Run jobs asynchronously with BiocParellel
0
gravatar for Martin Morgan
6 weeks ago by
Martin Morgan ♦♦ 24k
United States
Martin Morgan ♦♦ 24k wrote:

No, there are no plans to implement this functionality. A simple hack on non-Windows is

> res = mcparallel( bplapply(1:4, function(i) { Sys.sleep(i); i }) )
> 1 + 2
[1] 3
> str(mccollect(res))
List of 1
 $ 97731:List of 4
  ..$ : int 1
  ..$ : int 2
  ..$ : int 3
  ..$ : int 4
ADD COMMENTlink written 6 weeks ago by Martin Morgan ♦♦ 24k

Works perfectly. Thanks!

ADD REPLYlink written 6 weeks ago by Qiang70
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 322 users visited in the last hour