DPU tree sorting. Closes #1010.