Session Ready
Exercise

Non-reproducible results in parallel

Now we know that we can make results reproducible, so let's look at a situation when we cannot do so. We will run the previous example on clusters of different sizes, once on a cluster with two workers and on a cluster with four workers. Again, the parallel package, mean_of_rnorm(), and n_vec, are in your workspace.

Instructions 1/2
undefined XP
  • 1
    • Make a cluster with 2 nodes.
    • Set the cluster's RNG stream seed to 1234.
    • Use clusterApply() to apply mean_of_rnorm() to n_vec in parallel. Results are converted to a vector.
    • 2
      • Do the same again with a 4 node cluster.
      • Compare the output. Which numbers are the same and which are different?