[R] Programmaticly finding number of processors by R code

2010-10-03 Thread Ajay Ohri
Dear List Sorry if this question seems very basic. Is there a function to pro grammatically find number of processors in my system _ I want to pass this as a parameter to snow in some serial code to parallel code functions Regards Ajay Websites- http://decisionstats.com

Re: [R] Programmaticly finding number of processors by R code

2010-10-03 Thread Prof Brian Ripley
Without knowing your OS, there is no way anyone can tell you. And you probably want to know 'cores' rather than CPUs. And for some specific OSes, you will find answers in the archives. Beware that this is not a well-defined question: are these physical or virtual cores?, and having them in

Re: [R] Programmaticly finding number of processors by R code

2010-10-03 Thread Ajay Ohri
windows and ubuntu linux are my OS intent is to use them in the snow makecluster statement so I am not sure what I need cores,cpus,real,virtual basically the max amount of clusters i can create on my machine 2) if I have a workgroup on windows - can i detect cores/cpus on the network using the

Re: [R] Programmaticly finding number of processors by R code

2010-10-03 Thread Peter Langfelder
If no-one replies with a better way, here's a way: under POSIX-compliant systems, you can write a small C function and wrap it in an R function. The C program would be something like #include unistd.h void nProcessors(int n) { #ifdef _SC_NPROCESSORS_ONLN long nProcessorsOnline =

Re: [R] Programmaticly finding number of processors by R code

2010-10-03 Thread Henrique Dallazuanna
In windows try this: Sys.getenv('NUMBER_OF_PROCESSORS') On Sun, Oct 3, 2010 at 2:03 PM, Ajay Ohri ohri2...@gmail.com wrote: Dear List Sorry if this question seems very basic. Is there a function to pro grammatically find number of processors in my system _ I want to pass this as a

Re: [R] Programmaticly finding number of processors by R code

2010-10-03 Thread Abhijit Dasgupta, PhD
If you have installed multicore (for unix/mac), you can find the number of cores by /*multicore:::detectCores()*/ On 10/3/10 1:03 PM, Ajay Ohri wrote: Dear List Sorry if this question seems very basic. Is there a function to pro grammatically find number of processors in my system _ I