Generalize constraints on MPI rank counts for tests