I'm no SGE expert. But don't you have a PE available that simply
allocates nodes and calls your script? Then you can specify in your
script any mpirun you want, and it all should still work.
Alternatively, can't you shut down the SGE-called mpirun as the first
thing you do, then continue on calling your own mpirun? All this
depends on exactly how your machine and SGE is set up.
I don't see how statically linking your app avoids this issue at all, if
you're still calling the wrong mpirun.
Thanks for your suggestions.