11
$\begingroup$

I am using a Windows machine with 8 cores. No other process than Mathematica 8 is using CPU time right now - still the MathKernel.exe CPU usage does not go beyond 13%. My current computation takes forever and I feel that might be the reason. How can I adjust the CPU usage of Mathematica to use, say, up to 90% of CPU?

$\endgroup$
7
  • 5
    $\begingroup$ It sounds like you're using 1 processor. Try things with Parallelize to see if you can use all cores. $\endgroup$ Apr 22, 2013 at 10:27
  • 11
    $\begingroup$ 13% means that it uses the 100% of one of your 8 cores (or one of the thread in case of hyperthreding). Some core functions of Mathematica might use more than one core but if you want actively to use more cores you might need to enable this functionality and use commands that can parallelize. Look at the manual for parallelize for more. There is a tab at Mathematica's options panel dedicated to parallelization look there too. $\endgroup$
    – Spawn1701D
    Apr 22, 2013 at 10:28
  • $\begingroup$ Might look up functions like ParallelTable or ParallelDo. $\endgroup$ Apr 22, 2013 at 15:30
  • 4
    $\begingroup$ Although the previous commentators are undoubtedly correct, you also need to know that efficient parallelization is not simply a matter of adjusting some option setting, and the fact that Mathematica is attacking a problem serially is a good indication that parallelization may be a highly non-trivial undertaking in this case. In general, you might have to use different algorithms, explicitly decompose the problem into multiple concurrent tasks, or even rewrite your code completely according to an entirely different approach. But without further details it's difficult to make recommendations. $\endgroup$ Apr 22, 2013 at 15:31
  • $\begingroup$ The problem at hand was a really big expression involving trigonometric functions which had to be FullSimplified. Probably, in such a case one has to look for workarounds... $\endgroup$
    – Kagaratsch
    Apr 22, 2013 at 21:23

1 Answer 1

6
$\begingroup$

"% of CPU" represents the entire capacity of your system. If you have N cores and a process uses only one core, then it will use 100/N % of the capacity of your system --- you obviously have 8 cores.

Unless a problem is explicitly parallelised, it won't run on more than one core.

You should be able to parallelise Simplify / FullSimplify:

Simplify[ParallelMap[Simplify, a + b + c]]

It may or may not save you any time.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.