Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'mc.cores' > 1 is not supported on Windows #109

Closed
knausb opened this issue Nov 18, 2015 · 2 comments
Closed

'mc.cores' > 1 is not supported on Windows #109

knausb opened this issue Nov 18, 2015 · 2 comments

Comments

@knausb
Copy link
Contributor

knausb commented Nov 18, 2015

Hello,

I have a function 'vcfR2genelight' which I'm using to convert an object from a package I'm working on called vcfR to genlight objects. This function calls adegenet::as.genlight on a matrix of genotypes to create the genlight object. On Windows this currently throws an error:

>     x <- adegenet::as.genlight(t(x))
Error in mclapply(1:nrow(input$gen), function(i) new("SNPbin", as.integer(input$gen[i,  : 
  'mc.cores' > 1 is not supported on Windows

This appears to be because Windows does not support forking. In trying to find a solution I found:

http://lists.r-forge.r-project.org/pipermail/adegenet-forum/2013-July/000681.html

But that did not appear to resolve the issue. I've also made an attempt with:

x <- adegenet::as.genlight(t(x), n.cores=1)

With the hope I could pass that information on. But it generated the same error. I feel there should be a way for Windows users to set mc.cores to 1 but can't figure it out. Any suggestions? Or is there something I've overlooked?

If you want to handle this within adegenet perhaps something like:

if( .Platform$OS.type == "windows" ){
  n.cores = 1
}

might provide a solution?

Thank you for any help!
Brian

@thibautjombart
Copy link
Owner

Hi there,
I like the suggestion. Fork & pull request? ;)
Cheers
Thibaut

On Wed, Nov 18, 2015 at 2:13 PM, Brian Knaus notifications@github.com
wrote:

Hello,

I have a function 'vcfR2genelight' which I'm using to convert an object
from a package I'm working on called vcfR to genlight objects. This
function calls adegenet::as.genlight on a matrix of genotypes to create the
genlight object. On Windows this currently throws an error:

x <- adegenet::as.genlight(t(x))

Error in mclapply(1:nrow(input$gen), function(i) new("SNPbin", as.integer(input$gen[i, :
'mc.cores' > 1 is not supported on Windows

This appears to be because Windows does not support forking. In trying to
find a solution I found:

http://lists.r-forge.r-project.org/pipermail/adegenet-forum/2013-July/000681.html

But that did not appear to resolve the issue. I've also made an attempt
with:

x <- adegenet::as.genlight(t(x), n.cores=1)

With the hope I could pass that information on. But it generated the same
error. I feel there should be a way for Windows users to set mc.cores to 1
but can't figure it out. Any suggestions? Or is there something I've
overlooked?

If you want to handle this within adegenet perhaps something like:

if( .Platform$OS.type == "windows" ){
n.cores = 1
}

might provide a solution?

Thank you for any help!
Brian


Reply to this email directly or view it on GitHub
#109.

@thibautjombart
Copy link
Owner

Fixed at ad56026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants