title: How could I run Open MPI under Slurm
body: <p>I am unable to run <code>Open MPI</code> under <code>Slurm</code> through a <code>Slurm-script</code>.</p>
  
  <p>In general, I am able to obtain the hostname and run <code>Open MPI</code> on my machine.</p>
  
  <pre><code>$ mpirun hostname
  myHost
  $ cd NPB3.3-SER/ &amp;&amp; make ua CLASS=B &amp;&amp; mpirun -n 1 bin/ua.B.x inputua.data # Works
  </code></pre>
  
  <hr>
  
  <p>But if I do the same operation through the slurm-script <code>mpirun hostname</code> returns empty string and consequently I am unable to run <code>mpirun -n 1 bin/ua.B.x inputua.data</code>.</p>
  
  <p><em>slurm-script.sh:</em></p>
  
  <pre><code>#!/bin/bash
  #SBATCH -o slurm.out        # STDOUT
  #SBATCH -e slurm.err        # STDERR
  #SBATCH --mail-type=ALL
  
  export LD_LIBRARY_PATH="/usr/lib/openmpi/lib"
  mpirun hostname &gt; output.txt # Returns empty
  cd NPB3.3-SER/ 
  make ua CLASS=B 
  mpirun --host myHost -n 1 bin/ua.B.x inputua.data
  </code></pre>
  
  <pre><code>$ sbatch -N1 slurm-script.sh
  Submitted batch job 1
  </code></pre>
  
  <hr>
  
  <p>The error I am receiving:</p>
  
  <pre><code>There are no allocated resources for the application
    bin/ua.B.x
  that match the requested mapping:    
  ------------------------------------------------------------------
  Verify that you have mapped the allocated resources properly using the
  --host or --hostfile specification.
  
  A daemon (pid unknown) died unexpectedly with status 1 while attempting
  to launch so we are aborting.
  
  There may be more information reported by the environment (see above).
  
  This may be because the daemon was unable to find all the needed shared
  libraries on the remote node. You may set your LD_LIBRARY_PATH to have the
  location of the shared libraries on the remote nodes and this will
  automatically be forwarded to the remote nodes.
  ------------------------------------------------------------------
  mpirun noticed that the job aborted, but has no info as to the process
  that caused that situation.
  ------------------------------------------------------------------
  An ORTE daemon has unexpectedly failed after launch and before
  communicating back to mpirun. This could be caused by a number
  of factors, including an inability to create a connection back
  to mpirun due to a lack of common network interfaces and/or no
  route found between them. Please check network connectivity
  (including firewalls and network routing requirements).
  ------------------------------------------------------------------
  </code></pre>