Comments (14)
It's good. And the double branch is probably also what we need to set options properly. No need to get too cute.
One type as you use two hyphens: --n
where it should be one -n
. I will clean that up.
from littler.
That sounds like a great idea, and should be pretty simple. Both -n
are -p
are open. Preferences?
from littler.
My preference would be for -n
. What do you think about having a slight tweak to the input? I quite often set Ncpus equal to the number of cores. This would translate to:
- Default:
n = 1
-> (Ncpus = 1) n = X
-> (Ncpus = X)n = 0
->Ncpus = max(1, parallel::detectCores())
from littler.
I like the option of 'maxing out' but I am not sure I like zero for that special value. Hm. Minus one? NA? NULL?
I am indifferent between -n
or -p
(for "proceses") or even -c
(for "cores"). All suitable.
from littler.
I quite like the -c
and -1
combination.
Do you have a preference for the default? Either Ncpus = 1
or Ncpus = getOption("Ncpus", 1L)
to match install.packages()
from littler.
I like Ncpus = getOption("Ncpus", 1L)
as we can sail with the wind of that existing option.
from littler.
Main question now if we call it -c
for cores or cpus when we both know it processes. Maybe coroutines ;-)
from littler.
That just occurred to me as I wrote the doc string. Back to -n
?
Also, I'll go for NULL
as that matches (sort of) the repo logic
from littler.
Sure.
from littler.
Looks good. Thanks for catching the rogue =
which is definitely bad style :)
I am wondering if we should fold the two branches into one. Ie detect "getOption" as you do but then default to detect the system cores as a fallback, ie
if (opt$ncpus == "getOption") {
# parallel comes with R 2.14+
opt$ncpus <- getOption("Ncpus", max(1L, parallel::detectCores()))
}
Thoughts? It may well be too aggressive as it would hog all cores unless told otherwise...
Similarly, two lines in the --help
text is one more than every other option gets and something I'll probably clean up. Installing Rcpp
as an illustration is also weird as that one does not have that many dependencies (ie: none) to benefit from Ncpus
which after all only benefits multiple packages at once. Maybe ggplot2
or lme4
or ... ?
from littler.
-
Rcpp
: I didn't check the number of dep'. Just assumed it was > 1. Changing to ggplot2 makes sense. -
If we fold the branches, we will change the default behaviour of install.packages() and also the current behaviour of install2.r (as you note). I'm happy with this change, and can't imagine why it's bad. To make it less aggressive, we could use max(1, parallel::detectCores() - 1)
-
Two lines in help: Yep I didn't like that either, but it's a side effect of having a "special" option.
from littler.
I think that is still too much. We share a big box at work with 36 hyperthreaded cores. If someone uses it there... For example mclapply()
does a simple getOption("mc.cores", 2L)
giving us 2. install.packages()
defaults to 1 unless told otherwise.
We'll make it one line in --help
but describe it in the main help body.
from littler.
Updated the PR:
- Rcpp -> ggplot2
- Removed one of the examples in help
from littler.
Also four space indent not two but all minor -- taken care of now.
Thanks again for this. Very nice enhancement.
from littler.
Related Issues (20)
- Support for packages installation from renv.lock file HOT 4
- Update RNG seeding HOT 1
- The best approach to include the package version in install2.r function HOT 9
- installBioc.r fails when using options "--ncpus -1" or "--error" HOT 1
- install2.r requires RCurl as a dependency HOT 3
- Is littler compatible with argparser? HOT 2
- Add install2.r to PATH HOT 3
- Old installBioc.r version in rocker/r-base HOT 4
- [Question]: How to supply Github Personal Access Token with installGithub.r HOT 11
- add an 'echo' option? HOT 7
- change the second example code HOT 4
- clang: error: unsupported option '-fopenmp' HOT 4
- A question and possibly feature request HOT 2
- dylib error with littler HOT 2
- installGithub.r cache files? HOT 14
- Order of multiple `--repositories` flags for `install2.r` affects outcome HOT 7
- install2.r does not install dependencies from BioConductor HOT 5
- install2.r deps typo HOT 1
- Print error messages to stderr by default HOT 7
- runtime "error while loading shared libraries: libRblas.so ...." HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from littler.