alakazam::getnproc can sometimes return NA because of parallel::detectCores() which can be problematic for functions that use this command e.g. groupBaseline

Issue #80 resolved
Roy Jiang created an issue

In certain situations parallel::detectCores() can return NA (https://www.rdocumentation.org/packages/parallel/versions/3.6.1/topics/detectCores) when there definitely are cores (future::availableCores() returns a value). Since the docstring states “@return The number of cores available. Returns 1 if undeterminable”. It’s use in groupBaseline (line 847 in Baseline.R) does not account for possible NA return from this function.

Replicating this error is tricky but seems to be quite common (https://github.com/uptake/uptasticsearch/issues/79, https://github.com/rqtl/qtl2geno/issues/120).

I would recommend implementing an NA check in alakazam::getnproc i.e. if(is.na(nproc)){nproc ← 1}

Comments (5)

  1. Roy Jiang reporter

    ** Since the docstring states “@return The number of cores available. Returns 1 if undeterminable”, I would recommend implementing an NA check in alakazam::getnproc i.e. if(is.na(nproc)){nproc ← 1}.

  2. Log in to comment