本地集群怎么设置 MATLAB 的 worker数量呢?

65 次查看(过去 30 天)
海盈
海盈 2024-2-29
回答: R 2024-3-6
目前本地集群默认 MATLAB 的 worker数量太少,需要把worker数量改大,不知道怎么配置

回答(1 个)

R
R 2024-3-6
Hi,
I understand that you want to increase the default number of workers in the local cluster. Here's a step-by-step guide to help you achieve that:
1. Open Cluster Profile Manager:
  • Navigate to the Home tab.
  • From the bottom left, select the Parallel menu, which appears as four parallel bars.
  • Click on it to select Parallel Preferences.
  • A new window titled Parallel Computing Toolbox Preferenceswill open.
  • Click on the "Cluster Profile Manager" link to open Cluster Profile Manager.
2. Select and Edit Your Local Cluster Profile:
  • You can create a new local profile by clicking on “Add Cluster Profile.
  • Edit the newly created or existing cluster profile.
  • Set the number of workers according to your requirement.
3. Adjust NumWorkers and NumThreads:
  • Locate the "NumWorkers" setting to change the maximum number of workers.
  • Find the "NumThreads" setting to specify the number of computational threads per worker.
4. Save Your Adjustments:
  • After making the necessary changes, save your updated profile settings.
5. Validate Your Configuration:
  • Optionally, validate your local cluster configuration by clicking on "Validate" to ensure optimal performance and compatibility.
For more detailed information on adding, modifying, importing, or exporting cluster profiles, please refer to the documentation:
It’s important to note while configuring NumWorkers and NumThreads, it's crucial to ensure that the total number of threads across all workers does not exceed the number of physical cores on your machine. Specifically, maintain the condition that:
NumWorkers×NumThreads number of physical cores
Failing to adhere to this guideline may lead to reduced performance due to oversubscription of physical resources, causing unnecessary context switching and CPU contention.

类别

Help CenterFile Exchange 中查找有关 Big Data Processing 的更多信息

产品


版本

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!