Here我读
If no value is provided for the number of copies to execute (i.e., neither the "-np" nor its synonyms are provided on the command line), Open MPI will automatically execute a copy of the program on each process slot (see below for description of a "process slot")
所以我会期待
mpirun program
运行程序的八个副本(实际上是一个简单的 hello world),因为我有一个 Intel® Core™ i7-2630QM CPU @ 2.00GHz × 8,但它没有:它只是运行一个进程。
最佳答案
如果不指定要使用的进程数,mpirun
尝试从(指定的或)默认主机文件中获取它们。来自 corresponding section of the man page you linked :
If the hostfile does not provide slots information, a default of 1 is assumed.
由于您没有修改此文件(我假设),
mpirun
将只使用一个插槽。在我的机器上,默认主机文件位于
/etc/openmpi-x86_64/openmpi-default-hostfile
关于parallel-processing - 不带选项的 mpirun 仅在一个进程上运行程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36252128/