Multithreading does not work for external programs called by the 'system' command

2 views (last 30 days)
I am using Matlab R2010a on a Windows Server 2003 computer in combination with an external program. The external program is called by the 'system' command. The external program does not use multithreading. If you run the external program outside Matlab (by running it from the DOS-prompt) it uses multithreading. Is there a possibility to use multithreading for programs called by the 'system' command?

Accepted Answer

Sarah Wait Zaranek
Sarah Wait Zaranek on 13 Apr 2011
I have seen this before. I think this is how we resolved it.
Basically, MATLAB and Windows may use different environment variables.
If your application is using the OMP_NUM_THREADS environment variable, you can set this directly in MATLAB.
setenv('OMP_NUM_THREADS',numOfThreads);

More Answers (0)

Categories

Find more on Application Deployment in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!