Matlab internal parallelization not working (?) under linux
5 views (last 30 days)
Show older comments
Hello,
I have a piece of code which use a lot the QR decomposition function which does support some parallelization internally. However it seems on the computation server at my workplace, this parallelization does not work. Running this code on my laptop with windows, it runs about 3 times faster than on the computation server under linux.
I got to the conclusion that it comes from the parallelization as when looking at the ressource monitor during the computation with windows, all the 4 physical cores in my laptop are about 80% busy while in the server running the same data, there is only 1 core (out of 28 physical core) functionning at 100%.
My question is twofold:
1°) is there a way in matlab to check if the parallelization of internal functions such as qr() is working properly ?
2°) how to make matlab uses this parallelization if it is not working ?
For the second part, my guess is that the BLAS parallelization which is mostly based on OpenMP is not detecting the necessary env vars but I am really not sure of that and/or how to solve it if so.
Thanks for any help !
0 Comments
Answers (2)
Christine Tobler
on 14 May 2018
You can use the function maxNumCompThreads to see the maximum amount of threads MATLAB uses.
Christine Tobler
on 30 May 2018
You can also use maxNumCompThreads to set the maximum number of computational threads you want MATLAB to use. So for example, you could call
maxNumCompThreads(1)
on both machines, and see how their performance compares if only one node is used. Note this is just the maximal number of threads, any specific function may use fewer threads if it is not threaded, or if the matrix is too small so that using all threads may not be worth it.
I'm not sure how easily the QR decomposition can be threaded, so possibly using many cores will not give a very noticeable speedup.
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!