필터 지우기
필터 지우기

Batch sounds slower than interactive parallel jobs

조회 수: 3 (최근 30일)
Sylvain Rousseau
Sylvain Rousseau 2013년 7월 9일
Hi !
I use Matlab 7.10.0 and Parallel Toolbox on a 8 cores blade.
Issuing that command :
tic;job=batch('birthdayscript','matlabpool',4);wait(job);ovrHead=toc;
I obtain ovrHead = 10.42 seconds
Issuing that command :
matlabpool open 4;tic;p = prunbirthday(2e4, 30), ovrHead=toc;matlabpool close
I obtain ovrHead = 1.39 seconds
May I ask you why batch method is so ineffective ?
Sylvain
PS : here the code of birthdayscript :
numtrials = 2e4;
groupsize = 30;
% Preallocate some memory for the matches
matches = zeros(1, numtrials);
parfor trial = 1:numtrials
% Run a simulation for a group
matches(trial) = birthday(groupsize);
end
% Probability is the sum of matches divided by number of trials
prob = sum(matches)/numtrials;

채택된 답변

Sean de Wolski
Sean de Wolski 2013년 7월 9일
편집: Sean de Wolski 2013년 7월 9일
batch is opening its own MATLAB pool of four workers so this is included in the timing of the first snippet and not the second.
  댓글 수: 2
Sylvain Rousseau
Sylvain Rousseau 2013년 7월 10일
Many thanks Sean, it's crystal clear now !
Sean de Wolski
Sean de Wolski 2013년 7월 10일
Glad to hear. Good question too!

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Sylvain Rousseau
Sylvain Rousseau 2013년 7월 10일
편집: Sylvain Rousseau 2013년 7월 10일
Dear Sean,
Thanks for your answer.
That's what I thought at first sight, but the task overhead is the same when I move the tic after the batch() statement :
job=batch('birthdayscript','matlabpool',4);tic;wait(job);ovrHead=toc;
Here again, I obtain ovrHead = 10.42 seconds
Moreover, if I increase workers number up to seven (findResource gives a clusterSize of 8) , the overhead stays the same although I'am the only user of the computer.
Cheers.
sylvain

카테고리

Help CenterFile Exchange에서 Parallel Computing Fundamentals에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by