Some refactoring of dof re-ordering in parallel.