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

WISH: Environment varaible to set the default cluster type for parallel:::getClusterOption("type") #4

Open
HenrikBengtsson opened this issue Oct 20, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@HenrikBengtsson
Copy link
Collaborator

(Adopted from an old 2017-09-05 note of mine)

When loaded, have the package set parallel:::defaultClusterOptions$type from (new) environment R_PARALLELLY_CLUSTER_TYPE, if available. This will then allow users to switch the default cluster type used by parallel:::makeCluster().

> parallel:::makeCluster
function (spec, type = getClusterOption("type"), ...) 
{
    switch(type, PSOCK = makePSOCKcluster(spec, ...), FORK = makeForkCluster(spec, 
        ...), SOCK = snow::makeSOCKcluster(spec, ...), MPI = snow::makeMPIcluster(spec, 
        ...), NWS = snow::makeNWScluster(spec, ...), stop("unknown cluster type"))
}
<bytecode: 0x5316668>
<environment: namespace:parallel>

What about snow::makeCluster(), which works the same as parallel::makeCluster() but uses a different default? Contrary to parallel, the parallelly package does not depend/import snow, which means we cannot set ditto for snow. We could add a hook function that does it when / iff the snow package is loaded, but is that good?

Source

@HenrikBengtsson HenrikBengtsson added the enhancement New feature or request label Oct 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant