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

CV freeze on MacOS due to parallel::makeCluster() issue in gbmCluster() #53

Open
albertbuchard opened this issue Jul 11, 2020 · 1 comment

Comments

@albertbuchard
Copy link

albertbuchard commented Jul 11, 2020

Hi, there is a new issue with parallell:makeCluster() that apparently only affects new version of R on MacOS. (see here)

It causes gbm to freeze when using CV. A quick fix is to pass setup_strategy="sequential" to makeCluster in gbmCluster().

Add in your code before calling gbm:

gbmCluster = function (n) 
{
  if (is.null(n)) {
    n <- parallel::detectCores()
  }
  parallel::makeCluster(n, setup_strategy = "sequential")
}

assignInNamespace("gbmCluster", gbmCluster, ns="gbm")

Hope it is useful to someone ! :)

@albertbuchard albertbuchard changed the title Hotfix: Parallel::MakeCluster() issue in gbmCluster() Hotfix: CV freeze on MacOS. Parallel::MakeCluster() issue in gbmCluster() Jul 11, 2020
@albertbuchard albertbuchard changed the title Hotfix: CV freeze on MacOS. Parallel::MakeCluster() issue in gbmCluster() Hotfix: CV freeze on MacOS due to parallel::makeCluster() issue in gbmCluster() Jul 11, 2020
@albertbuchard albertbuchard changed the title Hotfix: CV freeze on MacOS due to parallel::makeCluster() issue in gbmCluster() CV freeze on MacOS due to parallel::makeCluster() issue in gbmCluster() Jul 11, 2020
@bgreenwell
Copy link
Contributor

Thanks @albertbuchard, I'm aware of the problem, but not sure what the best solution is at the moment. Thanks for the suggestion as well!

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