title: How to set environment variables on compute nodes in an MPI job
body: <p>I don't understand how the environment is set on compute nodes when running with MPI under a scheduler.</p>
  
  <p>I do:</p>
  
  <pre><code>mpirun -np 1 --hostfile ./hostfile foo.sh
  </code></pre>
  
  <p>with <code>foo.sh</code>:</p>
  
  <pre><code>#!/usr/bin/env zsh                                                                                                  
  echo $LD_LIBRARY_PATH
  </code></pre>
  
  <p>Then I do not recover the LD_LIBRARY_PATH I have got in an interactive shell... What are the initialization files that are executed/sourced at connection with MPI?</p>
  
  <p>note: I am under zsh, and I tried to put things in .zprofile or .zshenv instead of .zshrc, but it doesn't seem to make a change... My LD_LIBRARY_PATH is set in a .profile which is sourced by a .bashrc which is sourced by the .zshrc.</p>