Using multiple cores but the speed doesn't increase

The simplest way is multithreading: start Julia with multiple threads

julia -t auto

and then put @threads in front of the for loops you want to parallelize, assuming they have no race conditions (i.e. no threads competing to write at the same memory location). If you suspect race conditions, you will need to use distributed computing instead, which is also fairly easy to setup.

Even then, it might be that the code is not sped up by multiple threads, in which case you need to optimise it first before parallelizing.

1 Like

Thanks a lot.

1 Like