Try Sys.getenv('NUMBER_OF_PROCESSORS')

This function works on windows/linux (with multicore).
if ( require("multicore", quietly = TRUE, warn.conflicts = FALSE) ) {
cores <- multicore:::detectCores()
} else {
cores <- Sys.getenv('NUMBER_OF_PROCESSORS')
}


On Thu, Aug 4, 2011 at 12:38 PM, Megh Dal <megh700004@yahoo.com> wrote:

> Dear all, I am looking for some R function which will tell me how many
> cores I have in my machine. I am using Windows Vista and snowfall library
> for my parallel computations. However I need to automate the initializing
> the parallel computation using sfInit() function, for which number of cores
> is one input.
>
> I can personally see the core numbers from Windows Task Manager, however
> want to automate (in some extend) my calculation. Is there any function to
> determine that number?
>
>
> Thanks,
>
> _______________________________________________
> R-sig-hpc mailing list
> R-sig-hpc@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-hpc
>

	[[alternative HTML version deleted]]

