title: How do you specify nodes on `mpirun`'s command line?
body: <p>How do I use <code>mpirun</code>'s <code>-machine</code> flag?</p>
  
  <p>To select which cluster node to execute on, I figured out to use <code>mpirun</code>'s <code>-machinefile</code> option like this</p>
  
  <pre><code>&gt; mpirun -machinefile $HOME/utils/Host_file -np &lt;integer&gt; &lt;executable-filename&gt;
  </code></pre>
  
  <p><code>Host_file</code> contains a list of the nodes, one on each line.</p>
  
  <p>But I want to submit a whole bunch of processes with different arguments and I don't want them running on the same node. That is, I want to do something like</p>
  
  <pre><code>&gt; mpirun -machinefile $HOME/utils/Host_file -np 1 filename 1
  nano Host_file % change the first node name
  &gt; mpirun -machinefile $HOME/utils/Host_file -np 1 filename 2
  nano Host_file
  &gt; mpirun -machinefile $HOME/utils/Host_file -np 1 filename 3
  nano Host_file
  ...
  </code></pre>
  
  <p>I could use the <code>-machine</code> flag and then just type a different node for each execution. But I can't get it to work.  For example</p>
  
  <pre><code>&gt; mpirun -machine node21-ib -np 1 FPU
  &gt; mpirun -machine node21 -np 1 FPU
  </code></pre>
  
  <p>always executes on the master node.</p>
  
  <p>I also tried the <code>-nodes</code> option</p>
  
  <pre><code>&gt; mpirun -nodes node21-ib -np 1 FPU
  &gt; mpirun -nodes node21 -np 1 FPU
  </code></pre>
  
  <p>But that just executes on my current node.</p>
  
  <p>Similarly, I've tried the <code>-nolocal</code> and <code>-exclude</code> options without success.</p>
  
  <p>So I have a simple question: <em>How do I use the <code>-machine</code> option? Or is there a better way to do this (for a Linux newbie)?</em></p>
  
  <p>I'm using the following version of MPI, which seems to have surprisingly little documentation on the web (so far, the entirety of the documentation I have comes from <code>&gt; mpirun --help</code>).</p>
  
  <pre><code>&gt; mpichversion
  MPICH Version:          1.2.7
  MPICH Release date:     $Date: 2005/06/22 16:33:49$
  MPICH Patches applied:  none
  MPICH configure:        --with-device=ch_gen2 --with-arch=LINUX -prefix=/usr/local/mvapich-gcc --with-romio --without-mpe -lib=-L/usr/lib64 -Wl,-rpath=/usr/lib64 -libverbs -libumad -lpthread
  MPICH Device:           ch_gen2
  </code></pre>
  
  <p>Thanks for your help.</p>