Question: BiocParallel 1.4.3: Error following example 4.2.1 - "Error in 0.4 * nx/tasks : non-numeric argument to binary operator"
gravatar for lee.tibbert
3.4 years ago by
lee.tibbert20 wrote:

Prompted by Feligernon Bit's recent post on Rbloggers, I tried to check out BiocParallel.

Whilst trying the example in section 4.2.1 ("Ad-hoc clusters of multiple machines,  sockets" of the "Introduction to BiocParallel" (May 6, 2015, December 15, 2015), I am encountering an error: "Error in 0.4 * nx/tasks : non-numeric argument to binary operator".

The only change that I make to the example is to use one "localhost" instead of the three "rhinoN" entries. I get the same failure with one "localhost" & second host "foobar".  I can "ssh localhost" no problem.

The code, error, & systemInfo are below.  I believe that I am using the most up-to-date software, etc.

Seems to me that the issue is probably that "tasks" is zero, causing a divide by zero resulting in a non-numeric Infinity. 

Can some kind soul point out what I am doing wrong?

A big Thank You to the BioConductor & BiocParallel developers.

Thank you,


> library("BiocParallel", lib.loc="~/R/i686-pc-linux-gnu-library/3.2")
> hosts <- c("localhost")
> param <- SnowParam(workers = hosts, type = "SOCK")
> FUN <- function(i) system("hostname", intern=TRUE)
> bplapply(1:4, FUN, BPPARAM = param)
Error in 0.4 * nx/tasks : non-numeric argument to binary operator

> sessionInfo()
R version 3.2.3 (2015-12-10)
Platform: i686-pc-linux-gnu (32-bit)
Running under: Ubuntu 15.10

 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8    LC_PAPER=en_US.UTF-8       LC_NAME=C                 

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] BiocParallel_1.4.3

loaded via a namespace (and not attached):
[1] parallel_3.2.3       futile.logger_1.4.1  tools_3.2.3          lambda.r_1.1.7       futile.options_1.0.0


biocparallel • 729 views
ADD COMMENTlink modified 3.4 years ago • written 3.4 years ago by lee.tibbert20

As a workaround specify workers as a numeric value; SnowParam(workers=1); a fix is in development. Thanks for the report.

ADD REPLYlink written 3.4 years ago by Martin Morgan ♦♦ 23k

Thank you for the timely workaround suggestion.  If I understand correctly SnowParam(workers=1) will put all workers on my local node?  I have been using the workers=numeric (I used 3) & making believe that I was running on remotes to help me learn BiocParallel.  When the fullness of time brings the next version of BiocParallel, I will try again with remote nodes.



ADD REPLYlink written 3.4 years ago by lee.tibbert20

Yep, all the workers on a local node; obviously not particularly satisfactory, but I expect a better solution withing the week.

ADD REPLYlink written 3.4 years ago by Martin Morgan ♦♦ 23k

Thank you. I was testing my understanding.  I have plenty enough right now to help me understand BiocParallel & understand entirely that good fixes take time. I am more than happy to find out that I did not miss something obvious in attempting to duplicate the example.  If the examples where not so good & extensive, I never would have gone down that path ;-)


ADD REPLYlink written 3.4 years ago by lee.tibbert20
Please log in to add an answer.


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