use openmp cannot reach 100% cpu usage

3 views (last 30 days)
Ping Gao
Ping Gao on 16 Jan 2020
Commented: James Tursa on 17 Jan 2020
I call a mex function that using openmp for parallel computing. My CPU has 8 physical cores, so I set the openmp parallel thread number to 8. But when I run the mex function, the CPU usage is just 50%. I change the thread number to 4, run the mex function from 2 different matlab processes simultaneously or use parfor with 2 workers, then the CPU usage reaches 100%. Is there any way to make the CPU reach 100% usage in one process?
  1 Comment
James Tursa
James Tursa on 17 Jan 2020
Can you post a small subset of your source code that reproduces the problem?

Sign in to comment.

Answers (0)

Categories

Find more on Execution Speed 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!