MPI:内核还是处理器? [英] MPI: cores or processors?
问题描述
您好,我是MPI菜鸟,所以请耐心等待这一点. :)
Hi I am kind of MPI noob so please bear with me on this one. :)
说我有一个名为foo.c的MPI程序,我用
Say I have an MPI program called foo.c and I run the executable with
mpirun -np 3 ./foo
mpirun -np 3 ./foo
现在,这意味着程序将使用3个处理器(每个处理器1个 process )并行运行.但是,由于当今大多数处理器具有一个以上的内核,(每个处理器要占用2个内核),这是否意味着该程序将在3个内核或3个处理器上运行?
Now this means the program will be run in parallel using 3 processors (1 process per processor). But since most processors today have more than one core, (take 2 cores per processor say) does this mean the program will be run on 3 cores or 3 processors?
这可能与我对内核和处理器之间的真正差异的理解不充分有关,因此,如果您还可以解释一下,那将是有帮助的.
Probably this has to do with my poor understanding of what the difference between a core and a processor really is so if you could also explain a little more that would be helpful.
谢谢.
推荐答案
mpirun将在计算机上执行许多进程".执行这些进程的CPU或内核取决于操作系统. 在每个CPU上具有M个内核的N个cpu机器上,您有空间可以全速运行N * M个进程.
mpirun will execute a number of "processes" on the machine. The cpu or core where these processes are executed is operating-system dependent. On a N cpu machines with M cores on each cpu, you have room for N*M processes running at full speed.
但是,通常:
- 如果您有多个核心,则每个进程将在单独的核心上运行
- 如果您要求的进程数比可用的core * cpus多,那么所有内容都将运行,但是效率较低(是的,您可以在单CPU单核计算机上运行多进程作业...)
- 如果您使用的是排队系统或预先配置的MPI系统(对于该系统而言,存在远程计算机的列表),则分配将分配在远程计算机上.
(取决于mpi的实现,可能有一些选项可以强制使用特定的cpu或内核,但您不必为此担心).
(Depending of the mpi implementation, there might be some options to force a specific cpu or core, but you should not need to worry about that).
这篇关于MPI:内核还是处理器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!