3
$\begingroup$

I have one processor with 2 cores on my local computer.

CloseKernels[];LaunchKernels[]
(* {"KernelObject"[1, "local"], "KernelObject"[2, "local"]} *)

I can't understand how it can launch 4 local subkernels on a computer with 2 cores and give the next result:

Table[CloseKernels[]; LaunchKernels[n];
   {n, AbsoluteTiming[ParallelDo[Pause[0.1], {20}]][[1]]}, {n, 1, 4}]
(* {{1, 2.0276}, {2, 1.02217}, {3, 0.725411}, {4, 0.508692}} *)

When I try to test it on 8 subkernels it takes 0.3 sec for evaluation. What does parallel subkernel mean and how many of them can I launch?

$\endgroup$
  • $\begingroup$ Welcome to Mathematica.SE! 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Take the tour and check the faqs! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! $\endgroup$ – user9660 Dec 10 '15 at 18:46
  • $\begingroup$ Se 54533. $\endgroup$ – bbgodfrey Sep 14 '16 at 20:00
1
$\begingroup$

The following is my observation. However, I couldn't find a document confirming it.

The kernels are independent on the number of cores as per my observations. You can have several kernels depending on your Mathematica license. The distribution of kernels in the cores depends on your OS. Intel processors may also have hyper threading, e.g. 2 cores capable of running 4 threads in parallel. You can check the CPU usage of your system to see if the resources are used efficiently. Generally we try to run one less than the maximum number of parallel threads available.

$\endgroup$

Your Answer

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

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