偶然看到se版help parallel:Setting more clusters than physical cores the user's computer has it is not recommended (see the WARNING in description).不禁大为佩服楼主所得结论:“综上所述,Stata运行速度最佳的条件是设置使用核心数目等于CPU物理核心数目(举例:4核8线程CPU,设置set processor 4速度最快)。”
刚才仔细研究了下statamp 的说明。有这样一句话,验证了楼主的结论是对的。On multiprocessor computers where each CPU is hyperthreaded, the current recommendation is to set Stata/MP to use the number of real CPUs, not the number of virtual processors. Under such architectures, each CPU appears to Stata/MP and the operating system as two processors, and Stata/MP would by default try to use all the (virtual) processors. On these computers, users should type
. set processors #
where # is the number of CPUs on the computer. Here we use “CPU” to mean a physical core on the computer and not a virtual core created by hyperthreading. So, we could equivalently say, where # is the number of physical cores on the computer.