Maximum number of threads in Polyester.jl

Hi,

I set the number of threads before I start up Julia by using the command: $env:JULIA_NUM_THREADS=16 before I start Julia. Then, I use the macro @batch from Polyester.jl, which evaluates a for-loop on multiple threads. Can I choose any number of threads or is there a maximum that I should choose?
Thanks!

any number is fine, in the sense of what CPU you are using. Each cpu has physical cores and threads (x2 usually). Theoretically you will get the best performance if you use the number of threads equal to the physical cores, or to the threads specified by your cpu.
You can check your cpu info on a linux machine with lscpu.

I am no expert in computer architecture nor threading, so if I said something wrong, correct me.

1 Like