# How to force an evaluation to use only one core?

There are some evaluations which are automatically parallelized or multithread if there are cores available.( for example, Eigenvalues)

But I don't want the evaluation to be automatically multithreaded, I want it to use only one core. How can I do it?

-
Notice that you can run 2 threads on one core too, only if you have multithreaded processor. But it is not the same thing as parallel computing. – Kuba Aug 30 '13 at 13:35
@Kuba Yeah! I always noticed this. Sometimes, my parallel evaluations automatically became several 50% cpu running, If there are other people running their calculation on the same remote computer – matheorem Aug 30 '13 at 13:38

For EigenValues this will work:

SetSystemOptions["ParallelOptions" -> "ParallelThreadNumber" -> 1]


For functions which are using MKL libraries you can also use:

SetSystemOptions["MKLThreads" -> 1]


Source

It is wrriten there that you can reset it to the defaults by "ParallelThreadNumber" -> $ProcessorCount. But if you have cores that can be multithreaded then this number can be greater than $ProcessorCount.

• Somewhere in documentation center is example with "MKLThreads" (I know it from there) but I can't find it :) I appreciate link if someone knows it :).
-
MKL libraries? I don't have an idea about "MKL libraries". What is this? – matheorem Aug 30 '13 at 13:40
Math kernel library is used by for example Solve. – Kuba Aug 30 '13 at 13:43
Its kind of an all in one math antibiotic for your Intel processor kernel ;) – PlatoManiac Aug 30 '13 at 13:44
@Kuba It seems that it is undocumented? If I set it to one, After I restart the mathematica, can the value be back to one? – matheorem Aug 30 '13 at 13:45
@Kuba Oh, SetSystemOptions["MKLThreads" -> 1] actually works for the NIntegrate. My fault. Thank you for your help! But I still wish you could look at the post I mentioned, there are peculiarities which I can't understand. – matheorem Aug 30 '13 at 13:57