I am using Eigenvalues a large number of times on a machine with 8 cores. When I run Eigenvalues one time without any parallel implementation, the CPU usage hovers around 50%. I suppose there is some parallelization built into the function.

Ideally, if I had enough memory, I would launch 8 cores and use ParallelMap: this gives 100% CPU usage. However, I quickly run out of memory.

I do have enough memory to launch two cores and run in parallel. However, now the CPU usage is 25%, so this is slower than simple sequential evaluation. It seems using ParallelMap has excluded the in-built parallelization of Eigenvalues.

Is there any way I can get 2 parallel cores to run Eigenvalues, each one taking advantage of the parallelization already built into the function? i.e. any way I can use the extra memory I have to get 100% out of my CPUs?

  • 4
    $\begingroup$ See this answer, in particular you may need to adjust MKLThreadNumber on the slave kernels. This may or may not result in any performance gain, note that Intel does not recommend the use of more threads than the number of physical cores. $\endgroup$ – ilian Sep 16 '15 at 14:54
  • $\begingroup$ The most effective technique I found is to open another kernel in the front end. Then I am at 100% cpu usage. $\endgroup$ – user16316 Sep 16 '15 at 23:34
  • 1
    $\begingroup$ For Eigenvalues to use 8 hyperthreads, just set SetSystemOptions["ParallelOptions" -> "MKLThreadNumber" -> 8]; and that will increase the reported CPU utilization. Similarly, If you want to use two kernels in parallel, LaunchKernels[2]; ParallelEvaluate[ SetSystemOptions["ParallelOptions" -> "MKLThreadNumber" -> 4]]; will override the default behavior where each slave kernel is single-threaded. $\endgroup$ – ilian Sep 17 '15 at 1:05
  • $\begingroup$ Your question reflects a common misconception about what SMT does and the mistaken idea that scheduler time corresponds to execution unit utilization. To put it briefly: Eigenvalues is working perfectly well without your additional attempts to parallelize it. If you measure the time taken to perform equivalent work, at best you will notice no difference, and more likely the attempt to use "100%" of the CPU will accomplish the task more slowly (i.e., less efficiently) than otherwise. $\endgroup$ – Oleksandr R. Sep 17 '15 at 1:05
  • $\begingroup$ I did as instructed: diagonalize 4 matrices around dimensions 500,000. In series required 1300 seconds. In parallel (2 for each kernel) 1050. I do not understand how having more cores in general would not make it more efficient to parallelize. $\endgroup$ – user16316 Sep 18 '15 at 14:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.