IntelLabs / ParallelAccelerator.jl

The ParallelAccelerator package, part of the High Performance Scripting project at Intel Labs
BSD 2-Clause "Simplified" License
294 stars 32 forks source link

How to add Threads to ParallelAccelerator.jl #149

Open alirezamecheng opened 7 years ago

alirezamecheng commented 7 years ago

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.

DrTodd13 commented 7 years ago

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?

alirezamecheng commented 7 years ago

Thank you.

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

Not an important thing. just for some performance calculations.