Distributed Programming on Google Cloud Engine using Python (mpi4py)

大憨熊 提交于 2019-12-04 19:02:38
Lodrik

So, I figured out what I got wrong, and I think I should post the answer for someone who might has a similar question.

Turns out, I should have read the documentation of mpi4py better :D

The command mpirun -np 5 python 5_test.py is for running the program an a single, multi-core host on different processes.

However, I wanted to distribute the task across various host. Therefore I needed the command mpirun --hostfile <hostfile> python 5_test.py. And <hostfile> must be a file looking like this:

-- hostfile --

host1   slots=4

host2   slots=4

host3   slots=4

'--------------


.

Useful Link: https://github.com/jbornschein/mpi4py-examples

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!