How to make sure matlab uses all the cores on a remote cluster ?

조회 수: 1 (최근 30일)
Stéphane
Stéphane 2014년 11월 24일
답변: Stéphane 2014년 12월 3일
Hi
I'm trying to run a code on a remote cluster and I would like to check that matlab uses all the cores I've requested (up to 12). From the time it takes to run, I think only one is used.
Does anybody have a simple script that I could run on the cluster (without hpc module) to check if the problem comes from my script itself or something else ?
Thanks
Stéphane

채택된 답변

Raymond Norris
Raymond Norris 2014년 12월 2일
Try running the following code. Set N to the number of cores you want to run on. This should take ~4 seconds to run.
N = 12;
parpool(N)
tic
parfor idx = 1:2*N
pause(2)
end
toc

추가 답변 (1개)

Stéphane
Stéphane 2014년 12월 3일
Thanks :-)

카테고리

Help CenterFile Exchange에서 Parallel for-Loops (parfor)에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by