3

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?

mr.tarsa
  • 141
  • 4

1 Answers1

1

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.

Marvin
  • 584
  • 3
  • 11