Added test to check whether or not currently in an MPI environment.
More resiliant window selection.