parallel-processing - 不带选项的 mpirun 仅在一个进程上运行程序

标签 parallel-processing fortran mpi gfortran openmpi

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/

相关文章:

MPI不能通过MPI_Send和MPI_Recv向自己发送数据

performance - Haskell 并行性能

multithreading - Powershell 可以并行运行命令吗?

c - MPI_Gather() 将中心元素放入全局矩阵中

fortran - MPI 组未分配正确的处理器等级

c++ - 与多对多处理器通信时出现 MPI 错误

c++ - 使用 par_unseq 时,我仍然可以依赖输出元素的顺序吗?

directory - 在 Fortran 中打印目录列表

netbeans - 更改 NetBeans 8 中的 fortran 编译顺序

c - mpirun 不传递命令行参数