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

Exercise

Funding social sciences with futures

You work for a philanthropic foundation. The foundation awards research grants to universities with a social sciences research rating among the top one percent in their country. Therefore, each year a cutoff value for the research rating is calculated.

You have a list, rating_list, in your workspace. Each element contains research ratings for universities in a country. You also have generate_cutoff_future() available. This function creates a future for the calculation of the cutoff value. However, your manager is not so sure about the advantage of futures over other parallelization methods. You have to demonstrate that futures enable sequential and parallel execution without making changes to the actual code. The future package has been loaded for you.

Instructions

100 XP
  • Generate sequential futures by applying generate_cutoff_future() to rating_list using lapply() under a sequential plan.
  • Extract the values of the sequential futures.
  • Generate parallel futures under a parallel plan.
  • Extract values of the parallel futures.