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:
mpirun -np 1 -host my_host ....
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.).
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).