Hi Mark,
Have you tried adding -l to the #! line?
#!/bin/bash
#$ <some GE directives>
module load ompi
mpiexec
when the mpiexec is run, we'll see the following errors
bash: module: line 1: syntax error: unexpected end of file
bash: error importing function definition for `module'