Tasks need to be sorted to partition them