matlabpool open n; doesn't work.
이전 댓글 표시
Hi,
I'd like to open matlabpool with a variable number of cores, to use the maximum number of cores available. So n would equal features('numCores') here.
But matlabpool open n, matlabpool open features('numCores'), matlabpool open maxNumCompThreads don't work here. matlabpool open seems to accept only numbers and not variables.
I could do something stupid like
if features('numCores') == 4
matlabpool open 4;
elseif features('numCores') == 2
matlabpool open 2;
end
but I'd like to know if something more elegant exists.
Thanks!
채택된 답변
추가 답변 (2개)
If you have R2013b or later, you shouldn't be using matlabpool . You should be using parpool , which does take a variable as input directly,
parpool(n)
댓글 수: 3
Martin
2014년 5월 7일
Haseeb Hassan
2018년 10월 7일
Thank you Matt for your useful hint.
Bruno Silva
2020년 1월 17일
Thanks!
Malshikho
2018년 5월 25일
0 개 추천
Unfortunately I have Matlab R2010b
댓글 수: 1
Steven Lord
2018년 5월 25일
Then use matlabpool using the syntax described in the accepted answer by Niklas Nylén.
카테고리
도움말 센터 및 File Exchange에서 Parallel Computing Fundamentals에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!