1. Learn
  2. /
  3. Courses
  4. /
  5. Parallel Programming in R

Connected

Exercise

Running code on the cluster

You work for a data consultancy and your company uses a lot of parallel R code. But lately, the results have been erratic, and sometimes the code gives varying results for the same input. Before any further troubleshooting, you have decided to run a basic check on each cluster.

You have created a variable test_var and calculated the sum of all its elements, test_sum. You want to check if each cluster can sum this variable accurately. The parallel package has been loaded for you.

Instructions

100 XP
  • Generate a cluster of four cores.
  • Export test_var and test_sum to the cluster.
  • Print "Accuracy OK" if the sum of test_var equals test_sum, else print "Errors".
  • Stop the cluster.