How to specify number of threads a matlab session can use

4 ビュー (過去 30 日間)
Christopher
Christopher 2014 年 11 月 5 日
回答済み: Sean de Wolski 2014 年 11 月 5 日
I have read many other 'answers' on this matter, but I am not succeeding.
I have a heavily vectorized code that I want to run, but I want to limit the number of cores that a matlab session can use because I want to run the same code many times at once (using multiple simultaneously running matlab sessions). This should prevent any bottlenecking of cpu power which I expect to increase efficiency.
Anyways, I've tried:
parpool(1)
and
maxNumCompThreads=1
but both fail as task manager indicates that many cores continue to be used.
How do I do this?
  1 件のコメント
Adam
Adam 2014 年 11 月 5 日
parpool(1) works fine for me.

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

回答 (1 件)

Sean de Wolski
Sean de Wolski 2014 年 11 月 5 日
Start MATLAB from the system command prompt with -singleCompThread flag.
Or use the Parallel Computing Toolbox and parfor or spmd to run on multiple MATLAB workers in Parallel.

カテゴリ

Help Center および File ExchangeParallel Computing Fundamentals についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by