[Bioc-devel] Progress Message Order in bplapply

Dan Tenenbaum dtenenba at fredhutch.org
Mon Dec 28 18:26:15 CET 2015



----- Original Message -----
> From: "Dario Strbenac" <dstr7320 at uni.sydney.edu.au>
> To: "bioc-devel" <bioc-devel at r-project.org>
> Sent: Sunday, December 27, 2015 4:00:10 PM
> Subject: [Bioc-devel] Progress Message Order in bplapply

> Hello,
> 
> I am experiencing some new and unexpected behaviour of mclapply.
> 
> Previously, progress messages were displayed in almost the expected order. Now,
> they are unlike the original order. My test case is :
> 
> bplapply(1:100, function(x) {if(x %% 10 == 0) message(x); Sys.sleep(30)},
> BPPARAM = MulticoreParam(workers = 25))
> 
> The resulting progress message aren't displayed until the end of the process,
> whereas before they appeared immediately. I would expect 10 and 20 to appear
> before 30 did.
> 
> 30
> 40
> 50
> 10
> 20
> 60
> 70
> 80
> 90
> 100

I can't speak to why the messages come at the end whereas they used to come earlier, but as far as the messages being "out of sequence"
I think the problem might be in what you are expecting. This is not new nor unexpected. You are after all explicitly using multiple cores and there is no guarantee that the tasks will execute "in order". Here's a more trivial example that doesn't use BiocParallel at all:

> library(parallel)
> x <- mclapply(1:5, message)
1
3
5
2
4


Dan


> 
> --------------------------------------
> Dario Strbenac
> PhD Student
> University of Sydney
> Camperdown NSW 2050
> Australia
> _______________________________________________
> Bioc-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/bioc-devel



More information about the Bioc-devel mailing list