title: mpirun command showing strange behaviour in bash
body: <p>I have a quick question.</p>
  
  <p>I was recently trying to run an mpi program using my school's server and I run into the following 'weird' problem:</p>
  
  <p>In order to execute the 'mpirun' command I had to place its path into my default path in .bashrc which I did and then typed:</p>
  
  <pre><code>mpirun -n 16 ./myprogram
  </code></pre>
  
  <p>only to get an error about a missing library called: libmpi.so.0</p>
  
  <p>However if I tried to run a program using the full mpirun path like below</p>
  
  <pre><code>/usr/lib64/openmpi/bin/mpirun -n 16 ./myprogram
  </code></pre>
  
  <p>all was good.</p>
  
  <p>I checked openmpi's FAQ and it said that I needed to put the following line into my .bashrc</p>
  
  <pre><code>export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/openmpi/lib
  </code></pre>
  
  <p>which actually fixed things for me but my question still remains unresolved:</p>
  
  <p>Why was that happening?</p>
  
  <p>Thanks in advance for your time.</p>