Session Ready
Exercise

Benchmarking setup

In this exercise, you will take the simple embarrassingly parallel application for computing mean of random numbers (mean_of_rnorm()) from the first chapter, and implement two functions: One that runs the application sequentially, mean_of_rnorm_sequentially(), and one that runs it in parallel, mean_of_rnorm_in_parallel(). We will then benchmark these two functions in the next exercise.

mean_of_rnorm() and a cluster object, cl, are defined.

Instructions 1/2
undefined XP
  • 1
    • Turn the script to call mean_of_rnorm() sequentially into a function named mean_of_rnorm_sequentially.
      • The function takes two arguments: n_numbers_per_replicate and n_replicates.
      • The first two lines of code provided constitute the function body.
    • 2
      • Turn the script to call mean_of_rnorm() in parallel into a function named mean_of_rnorm_in_parallel.