Not a good answer to your question but you could look for the child processes and look at /proc/$pid/cmdline and cwd
Or just use pgrep -P $pidofmpirun This is not a good answer. I'm sitting at lunch - so an expert will be along in a minute with a good answer.