mdrun segfaults for npme > np
Currently, Gromacs 4.5.4 gives a segfault if one runs mpirun -np 8 mdrun_mpi -npme 120 with no warning of the source of the problem. Obviously npme>nnodes is a bad setup, but a check would be nice.
The cause for this behavior is:
cr->npmenodes is set in mdrun.c right after the command line args are parsed, and in the code there is also a comment that npme>nnodes should not
cause a problem at that point.
However, if npme>nnodes, in init_domain_decomposition / dd_choose_grid / optimize_ncells the number of pp nodes = nnodes-npme turns out to be negative such that in factorize the memory allocation does not work.