How to use -singleCompThread with MATLAB Builder JA ?

10 ビュー (過去 30 日間)
Damien
Damien 2014 年 10 月 17 日
コメント済み: Abhiram Bhanuprakash 2014 年 10 月 28 日
I want to limit the MCR to only one thread. "maxNumCompThreads" function is working but is deprecated, and mcc does not accept "-R singleCompThread" option when building a java library.

採用された回答

Damien
Damien 2014 年 10 月 28 日
Solved by initialising the MCR on the java side this way:
MWApplication.initialize(new MWMCROption() {
@Override
public String[] toStringArray() {
return new String[] { "-singleCompThread" };
}
});
  1 件のコメント
Abhiram Bhanuprakash
Abhiram Bhanuprakash 2014 年 10 月 28 日
Great! Thanks for sharing!

サインインしてコメントする。

その他の回答 (1 件)

Abhiram Bhanuprakash
Abhiram Bhanuprakash 2014 年 10 月 28 日
編集済み: Abhiram Bhanuprakash 2014 年 10 月 28 日
Hi Damien,
I think the MCR is by default single-threaded. The same is mentioned in this post.
Thus, I think you need not worry about limiting the number of threads to one.
The above mentioned post also explains how to run multiple MCRs, one per process, if you would like to do that.
Hope this helps,
Cheers!
Abhiram.
  1 件のコメント
Damien
Damien 2014 年 10 月 28 日
Thank you for the answer.
The MCR is single-threaded, but some computations inside the MCR are multi-threaded. This causes contention problems when running several MCR instances on machine with high CPU core number. (which are solved by calling the deprecated "maxNumCompThreads" function at the beginning of the MATLAB script)

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeIntroduction to Installation and Licensing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by