MATLAB runtime Windows multiple MCRs

3 views (last 30 days)
"MATLAB runtime run in parallel if it's loaded on separate processes" How do you run multiple MCRs and make them use a separate process in windows......Please don't tell me to read the manual...Looking for precise instructions....Thanks
[Merged information from Duplicate Question]
When I run two executables concurrently they take double amount of time to run. The MCR is single threaded so running the compiled exe in another shell (command prompt call with &) doesn't help. This is running on a very fast 6 core i7 machine with 64 GB of ram. Is this a problem with JVM contention ?
How do I make two executable programs in Matlab run faster in Windows Server ?
Is this a limitation when you multiple compiled executables?
I'm hoping someone at Mathworks can answer this very simple question.

Accepted Answer

Sunny Gupta
Sunny Gupta on 8 Dec 2012
Thanks for that...However, when I run both executables concurrently they take double amount of time to run. The MCR is single threaded so running the compiled exe in another shell doesn't help. How do you run multiple MCR's ? I know different versions of the MCR can be installed and this provides concurrency to each compiled version.
  3 Comments
Sunny Gupta
Sunny Gupta on 10 Dec 2012
Edited: Sunny Gupta on 10 Dec 2012
Hi Walter, is the best way to solve this concurrent scaling problem with a compiled MCR dependant app is to limit the number of threads to less than the number of available CPU's?
So say you have a 6 core machine, setting the maximum number of computational threads using maxNumCompThreads to two for example would allow three concurrent instances to avoid competing for same resources.
Walter Roberson
Walter Roberson on 10 Dec 2012
I do not know about the best way, but Yes, you need to avoid having all processes content for all cores.
Note for this that even if you do not use the Parallel Computing Toolbox, that over the years automatic parallelization (especially of mathematics functions) has gotten better, especially when large array sizes are involved. For example, sum() of a large array might get handled off to parallel routines, and that would happen even without the Parallel Computing Toolbox. But unless you are using PCT and a scheduler, the executables do not have any idea that they might be stepping on each other's toes by trying to use resources that another executable is already using. Restricting the number of threads should help in these situations.

Sign in to comment.

More Answers (1)

Walter Roberson
Walter Roberson on 8 Dec 2012
Invoke the executable from different command shells, or invoke the executable from the command shell but use & at the end of the command to run the executable in the background.
The opposite of this would be having a driver program (e.g., Visual C++) that invoked the engine from multiple threads in the same executable.

Categories

Find more on MATLAB Compiler 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!