Wolfram Computation Meets Knowledge

Why doesn’t Mathematica automatically launch as many local subkernels as I expected?

Local subkernels launch automatically when either the first parallel function or the LaunchKernels[] function is evaluated. Any issues with how many local subkernels automatically launch can be investigated in the Parallel Kernel Configuration menu.

To access the Parallel Kernel Configuration menu, select the menu item EvaluationParallel Kernel Configuration. The menu item opens the Preferences window with the Parallel tab selected. Within this selection, click the Local Kernels tab, shown below.

Automatic Setting

Number of processor cores

By design, Mathematica automatically launches subkernels equal to the number of physical CPU cores. Mathematica does not detect logical CPU cores, such as those coming from hyperthreading technology. The “4” here indicates that four physical CPU cores are detected. To override this setting, either use the LaunchKernels[n] function, where n is an integer indicating the number of local subkernels to launch, or switch to the manual setting.

Limit by license availability

Mathematica can never launch more subkernels than the number of available subkernel license seats. The total number of subkernel license seats is indicated in parentheses; the example above shows eight license seats.

If there are more CPU cores than subkernel license seats, then a warning message appears for each automatic subkernel that tries to launch beyond this limit. Enabling the “Limit by license availability” option avoids this.

If there are more CPU cores than subkernel license seats, then you may wish to purchase a Mathematica Core Extension license that provides more subkernel license seats.

Some license seats may be taken up by subkernels that did not shut down properly. Ending these processes returns the held license seats.

Use hard limit

A hard limit is used to manually restrict the number of automatically launched subkernels, even if additional physical CPU cores and license seats are available. Such a limit may be recommended for certain memory-intensive calculations. For example, if each calculation requires a large amount of memory, then reducing the number of simultaneously running subkernels can maintain a lower combined system memory usage.

Manual Setting

The manual setting is used to manually set the number of automatically launched subkernels. This setting is often used to match the number of automatically launched subkernels with the total number of physical and logical CPU cores.

In this example, the manual setting is 8 in order to take advantage of four logical CPU cores beyond the four physical CPU cores that Mathematica discovered. Alternatively, evaluating LaunchKernels[n] launches n local subkernels.

Even with a large manual setting, Mathematica can never launch more subkernels than the number of available subkernel license seats. Moreover, it is inefficient to launch more subkernels than CPU cores because the subkernel processes will compete for resources.

Была ли эта статья для вас полезной?

Хотите оставить комментарий?

Спасибо за ваш отзыв.


Обратиться в службу поддержки

Если у вас есть вопросы о ценах и оплате, активации или сомнения по техническим темам, мы готовы вам помочь.

1-800-WOLFRAM (+1-217-398-0700 для международных звонков)

Служба поддержки

с 08:00 до 17:00 по центральному времени США

  • Регистрация или активация продукта
  • Предпродажная информация и заказ
  • Помощь в установке и первом запуске

Расширенная техническая поддержка (для правомочных клиентов)

с 08:00 до 19:00 по центральному времени США

с 08:30 до 10:00 и с 11:00 до 17:00 по центральному времени США

  • Приоритетная техническая поддержка
  • Поддержка по продуктам от экспертов Wolfram
  • Помощь специалистов по программированию на Wolfram Language
  • Расширенная поддержка установки