Clear Filters
Clear Filters

MatLab Compiled Executable uses one Processor only in a Windows 10 Dual Processor Xeon CPU E5-2699v4 Configuration

5 views (last 30 days)
I am running MatLab compiled executables (R2017a) on a Windows 10 dual Processor (E5-2699v4) System, i.e. 2 x 22 physical cores. This executable (WORKER) internally uses 8 core parallelization due to compilation under utilization of the parallel toolbox). If I start the WORKER several times in order to utilize the full power of all available cores, I always have only one of the processors working - i.e. the system stays with 50% CPU usage all the time, whatever I do. What do I need to do in order to have both processors working instead of only one?
  1 Comment
Vincent Randal
Vincent Randal on 3 Apr 2019
Edited: Vincent Randal on 3 Apr 2019
I have the same concern, and I have a more general question: How can the MATLAB compiler be forced to maximize the CPU utilization during compilation (compile time) and afterwards (runtime)? When our license was current I asked this question to MATLAB technical support. I am not sure if they understood the problem. I showed them Windows Task Manager with a plot of CPU utilization versus time always being less than 50% utilization for all processors. I explained I would like the CPU utilization to be more than 50% and asked how to make it more the 50% for compile time and runtime (compiled program execution). But still my support request went unaddressed perhaps because increasing CPU utilization risked overheating the system.
Now I am revisiting this problem because we have acquired ten (10) dual Xeon workstations that run prime95 and mprime torture test indefinitely without shutting down nor overheating. What that means is these workstations are stable even at 100% CPU utilization. So then in a manner similar to how prime95/mprime achieves 100% CPU utilization we would like to learn how to make the MATLAB Compiler do the same at compile time and runtime. To be clear we are hoping to achieve 100% CPU utilization for the MATLAB Compiler during compile time and during compiled program execution (which is your concern in this thread). We want both.
We think everyone would like both (faster compile times and faster compiled program execution). Imagine being able to compile your MATLAB project in a fraction of the time it currently takes to compile the project. For us that would be a paradigm shift. It would change how we develop projects because we could compile and run our programs much more quickly. With the very low CPU utilization that we see in the MATLAB Compiler we are expecting about an order of magnitude increase in compiler speed if we are successful this time.

Sign in to comment.

Answers (1)

Alison Eele
Alison Eele on 15 Aug 2017
I think the problem you are seeing might be an issue with how some of our matrix math libraries are affinitizing to your machine's process groups.
Can you try setting an environment variable on that Windows machine please:
Name of Environment Variable: KMP_AFFINITY
Value to set to: respect,none
  1 Comment
Everett Wang
Everett Wang on 17 Feb 2023
Even after I set the environment Variable as instructed, I am using matlab 2018B on dell 7920 with dual CPU. It still uses only one CPU mostly. While the first CPU runs 100% with all the cores, the second CPU has 0-22% load on its cores. But it seems better than not set this Variable.

Sign in to comment.


Find more on MATLAB Compiler in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!