Bag-of-tasks in the cloud