Batch sounds slower than interactive parallel jobs
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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;
0 comentarios
Respuesta aceptada
Sean de Wolski
el 9 de Jul. de 2013
Editada: Sean de Wolski
el 9 de Jul. de 2013
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 comentarios
Más respuestas (1)
Sylvain Rousseau
el 10 de Jul. de 2013
Editada: Sylvain Rousseau
el 10 de Jul. de 2013
0 comentarios
Ver también
Categorías
Más información sobre Parallel Computing Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!