ParallelAccelerator.jl icon indicating copy to clipboard operation
ParallelAccelerator.jl copied to clipboard

How to add Threads to ParallelAccelerator.jl

Open alirezamecheng opened this issue 8 years ago • 2 comments

I was reading the documentations. but I never fond "By which command I can add threads for ParallelAccelerator.jl?" is that export JULIA_NUM_THREADS=4 or export OMP_NUM_THREADS=4? And how can I get number of threads in the code? by Threads.nthread() am I able to get number of threads? Thank you.

alirezamecheng avatar Jul 10 '17 21:07 alirezamecheng

I guess we have a situation here that could be improved. If you are in cgen mode then you control threads with OMP_NUM_THREADS. If you are using native mode, then you use JULIA_NUM_THREADS. If you use JULIA_NUM_THREADS then you should be able to use Threads.nthread() to get that number from within the program. If you are in cgen mode, you can use ENV['OMP_NUM_THREADS']. However, we've never found the need for a benchmark to find out how many threads there are. Can you elaborate on why you have the need to do that?

DrTodd13 avatar Jul 12 '17 16:07 DrTodd13

Thank you.

Can you elaborate on why you have the need to do that?

Not an important thing. just for some performance calculations.

alirezamecheng avatar Jul 13 '17 16:07 alirezamecheng