Task partitioning