olegario olegario - 20 days ago 5
R Question

How I can create a hostfile using MPI?

I'm have been using the MPI for the last weeks. Now I need to run the code on a huge computer. On this computer I have 8 nodes each one with 16 CPU's. I search a lot about the hostfile, but I still not understanding how it works. I'm using R with the doMPI and Rmpi libraries.

EDIT: Until now, what I understand is:

I have a hostfile, for examply "my-hosts". So, in my example the file would be:

node1 slots=16
node2 slots=16
.
.
.


But, Can I simply call the nodes by "nodex"? How I can get the name of the node? Is there some getNodeName()? How it would be my command line? Something like:

mpirun -np 1 -host my_host ....
? Is necessary to have the file on all nodes?

Answer

The name of the nodes has to be either their IP address or their DNS hostname. You can get the name of the node, if you know the IP address, by querying the DNS server (depends on your system: Windows, Linux, etc.).

Example:

localhost
192.168.1.2
host01.clusterdomain

I suggest you to check if the system you are working with uses any kind of job scheduler. If it does, you won't need to care about specifying the hostfile, as the job scheduler will take care of that (you just specify the amount of resource -i.e. nodes- that you want).