Environment variable list shouldn't be longer than 2049 chars
If a program execution aborts with the error message
Environment variable list for the job is .... characters
It shouldn't be longer than 2049 chars - Aborting.
Instead of mpirun -env_all use:
mpirun -exp_env VARNAME1 [ -exp_env VARNAME2 ]
to export the needed environment variables.