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

Change the amout of threads used for a computation

Open David-Berghaus opened this issue 4 years ago • 4 comments

It seems like IVM is using all threads available on a machine per default. When sharing resources on a cluster with multiple users this is not something that you want, because different jobs would have to fight for the same cores.

Is there a way to change this behavior? The amount of threads used does not seem to be related to julia-multithreading or blas.

David-Berghaus avatar Nov 23 '20 20:11 David-Berghaus

This is a very good point, I had not noticed this yet. I will run a few tests to see of something can be done by setting environment flags.

I expect that there will be differences between OSs, but I think Linux is probably the most pressing under the circumstances you describe.

Crown421 avatar Nov 25 '20 11:11 Crown421

Yes, indeed, our cluster is running Linux (and probably most clusters too, although I often get surprised how many windows-clusters exist).

David-Berghaus avatar Nov 25 '20 12:11 David-Berghaus

I think I found the env-var that determines the amount of threads used: https://stackoverflow.com/a/60298394

Maybe you want to add this wrapper to the package

David-Berghaus avatar Nov 28 '20 11:11 David-Berghaus

I think these are the same functions as BLAS.set_num_threads(n) will call, if BLAS.vendor() is MKL. For get_num_threads you need Julia 1.6 or Compat.jl.

mcabbott avatar Jan 04 '21 23:01 mcabbott