OpenMPI mpirun universe size

江枫思渺然 提交于 2020-01-04 15:16:09

问题


I do not know if I perhaps understand this incorrectly. But here is what I want to achieve with OpenMPI in particular just starting with mpirun:

  • I want to create a single process using the -np parameter that specifies the world size as 1
  • I then want to set the universe size to some arbitrary number (for argument sake 10), how do I do this?

The following two commands:

  • MPI_Comm_size(MPI_COMM_WORLD, &world_size);
  • MPI_Attr_get(MPI_COMM_WORLD, MPI_UNIVERSE_SIZE, &universe_size, &flag);

yield the output of world_size as 1 and universe_size as 1.


回答1:


Ok, so I found 2 ways of doing this:

  • Implicit: mpirun -np 1 -H localhost,localhost,...,localhost executable
  • Explicit: just assign a value to universe_size in the application itself, it will work fine.

Thank you for anyone that looked at this.



来源:https://stackoverflow.com/questions/25585838/openmpi-mpirun-universe-size

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