gives the number of processor cores available on the computer system on which the Wolfram System is being run.
- $ProcessorCount is used by Parallelize and other parallel functions.
Examplesopen allclose all
Basic Examples (1)
By default, as many parallel kernels are launched as there are processor cores:
You can change $ProcessorCount in a new session to simulate a multicore computer:
Possible Issues (2)
No kernels are launched by default on a single-core computer:
Specify the number of desired kernels to launch them anyway:
Changing $ProcessorCount takes effect only if it happens before using any parallel commands:
You can always launch the desired number of kernels explicitly:
Wolfram Research (2008), $ProcessorCount, Wolfram Language function, https://reference.wolfram.com/language/ref/$ProcessorCount.html.
Wolfram Language. 2008. "$ProcessorCount." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/$ProcessorCount.html.
Wolfram Language. (2008). $ProcessorCount. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/$ProcessorCount.html