$ProcessorCount

$ProcessorCount 给出正在运行 Wolfram 系统的计算机系统上可用的处理器内核数量.

更多信息

范例

打开所有单元关闭所有单元

基本范例  (1)

应用  (2)

默认情况下,有多少个处理器,就有多少个并行内核启动:

在一个新的会话中,您可以通过改变 $ProcessorCount 来模拟一个多核计算机:

可能存在的问题  (2)

默认情况下,在单核计算机上不启动任何内核:

不管怎样,指定希望的内核数量并启动内核:

只有发生在使用任何并行命令之前,改变 $ProcessorCount 才有效:

您总是可以显式地启动预期的内核数目:

Wolfram Research (2008),$ProcessorCount,Wolfram 语言函数,https://reference.wolfram.com/language/ref/$ProcessorCount.html.

文本

Wolfram Research (2008),$ProcessorCount,Wolfram 语言函数,https://reference.wolfram.com/language/ref/$ProcessorCount.html.

CMS

Wolfram 语言. 2008. "$ProcessorCount." Wolfram 语言与系统参考资料中心. Wolfram Research. https://reference.wolfram.com/language/ref/$ProcessorCount.html.

APA

Wolfram 语言. (2008). $ProcessorCount. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/$ProcessorCount.html 年

BibTeX

@misc{reference.wolfram_2024_$processorcount, author="Wolfram Research", title="{$ProcessorCount}", year="2008", howpublished="\url{https://reference.wolfram.com/language/ref/$ProcessorCount.html}", note=[Accessed: 22-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_$processorcount, organization={Wolfram Research}, title={$ProcessorCount}, year={2008}, url={https://reference.wolfram.com/language/ref/$ProcessorCount.html}, note=[Accessed: 22-November-2024 ]}