group together nodes on same rank