Session Ready
Exercise

Scheduling

Now we compare the results from the previous exercise with ones generated using parSapply(), which represents here an implementation that groups tasks into as many chunks as there are workers available. You first explore its cluster usage plot, using the function plot_parSapply() we defined for you. We generated a version of the tasktime vector, called bias_tasktime that generates very uneven load. Your job is to compare the run times of parSapply() with clusterApplyLB() applied to bias_tasktime.

All objects from the previous exercise are in your workspace.

Instructions
100 XP
  • Create a usage plot using plot_parSapply() passing the same arguments as before, that is cl, tasktime and Sys.sleep. Can you see the difference between the plots from the previous exercise? It should be faster than both of the previous functions.
  • Benchmark clusterApplyLB() and parSapply() similarly to the previous exercise, now using bias_tasktime instead of tasktime.
  • Repeat step 1, now with bias_tasktime. Compare it to plot_cluster_applyLB() with the same arguments.