title: How I can create a hostfile using MPI?
body: <p>I need to run a MPI application on 8 nodes, with 16 CPUs each.
  Even after some research, I still don't understand how hostfiles work. I'm using R with the doMPI and Rmpi libraries.</p>
  
  <p>This is what I understood so far:</p>
  
  <p>I have a hostfile <code>my-hosts</code> that looks like:</p>
  
  <pre><code>node1 slots=16
  node2 slots=16
  .
  .
  .
  </code></pre>
  
  <p>Can I simply call the nodes by <code>nodeX</code>?</p>
  
  <p>How can I get the name of the node?</p>
  
  <p>Is there any function such as <code>getNodeName()</code>?</p>
  
  <p>Is the following command line enough to launch the application?</p>
  
  <pre><code>mpirun -np 1 -host my_host ....
  </code></pre>
  
  <p>Is it necessary to have the hostfile on all nodes?</p>