title: How to get rank in aprun
body: <p>I am trying to run a multi-node jobs with aprun. However, I couldn't figure out how to get the rank (or whatever that serves as the ID of each job) in bash environment. Like this simple job:</p>
  
  <pre><code>aprun -n 8 -N 2 ./examplebashscript.sh
  </code></pre>
  
  <p>How can I get the rank in each spawned jobs?
  Without something like a rank or any unique job ID, this aprun line will only run the exact same program 16 times, which is undesirable.</p>
  
  <p>I've been reading on the documentation, surprisingly I couldn't find anything that even explains the default variables provided by aprun.</p>
  
  <p>I've worked with mpirun before, which I know how to get the rank values of each jobs using C and Python programs, but not in Bash. aprun is even less documented. </p>