Questions about getting started with parallel computing

Hi,
the corresponding (multithreaded) recipe in Julia is to use Threads.@threads in front of your external loop:
Threads.@threads for i=0:8

Under the conditions that the body of the loop is

  • parallel (no dependencies)
  • long enough to amortize the thread machinery
  • not already memory bound

it should give you some speed-up :wink: (if it works with openMP it should work too)

As a usual advice, make sure that you sequential program is already well optimized (type stable, vectorized,…) before entering // business.

2 Likes