Scientific workflows on clouds with heterogeneous and preemptible instances