How to make MATLAB instance use specific CPU for parallel computing

Hi, I am using Windows MATLAB R2024b on dual-Xeon CPU setup. I notice that the performance increment by dual CPU is minimal possibly due to communication load and overhead. I often find ~67% CPU utilization. I am using "Processes" option (not threads; my function involves fitting and it doesn't run in thread-based workers) and Hyperthreading is enabled.
I thought about ways to overcome this: Is there any way I can limit the speciific MATLAB instance to use only CPU #0 or #1? So that I can launch two MATLAB instances, and minimizing overhead.

답변 (1개)

Walter Roberson
Walter Roberson 2025년 7월 20일

0 개 추천

https://www.how2shout.com/how-to/how-to-permanently-set-cpu-affinity-for-a-program-in-windows-11-or-10.html shows how to create a Windows shortcut that sets the processor affinity for a particular command. You could create one to start matlab on CPU 0 and another to start matlab on CPU 1.

It would not surprise me if there is a taskmgr command that could alter the affinity of a running process.

카테고리

도움말 센터File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

제품

릴리스

R2024b

질문:

2025년 7월 20일

답변:

2025년 7월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by