开发者

Open MPI: how to run exactly 1 process per host

Actually I have 3 questions. Any input is appreciated. Thank you!

1) How to run exactly 1 process on each host? My application uses TBB for multi-threading. Does it mean that I should run exactly 1 process on each host for best performance?

2) My cluster has heterogeneous hosts. Some hosts have better CPUs and more memory than the others. How to map process ranks to real hosts for work distribution purposes? I am thi开发者_如何学Gonking to use hostname.Is there a better to do it?

3) How process ranks are assigned? What process gets 0?


1) TBB splits loops into several threads of a thread pool to utilize all processors of one machine. So you should only run one process per machine. More processes would fight with each other for processor time. The number of processes per machine is given by options in your hostfile:

# my_hostfile 
192.168.0.208 slots=1 max_slots=1
...

2) To give each machine an appropriate amount of work according to its performance is not trivial. The easiest approach is to split the workload into small pieces of work, send them to the slaves, collect their answers, and give them new pieces of work, until you are done. There is an example on my website (in German). You can also find some references to manuals and tutorials there.

3) Each process gets a number (processID) in your program by

MPI_Comm_rank(MPI_COMM_WORLD, &processID);  

The master has processID == 0. Maybe the other are given the slots in the order of your hostfile. Another possibility is they are assigned in the order the connections to slaves are established. I don't know that.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜