Problem with spmd when data sizes increase
Mostra commenti meno recenti
Hello,
Ive run into a problem with a script that im working on where when the matrices reach the size of 130x130 the script doesnt run (effectively hangs). With the "size" variable set to 100, the script runs fine. Change it to 130 and it doesnt run at all. The "disp" commands do not print, nothing happens.
Can anybody help with this issue?
Heres the code:
clear
close all
clc
%initialize input data
size = 100;
a = eye(size);
b = eye(size);
%check and make sure pool is closed (cant open multiple pools!)
if(matlabpool('size') > 0)
matlabpool close
end
matlabpool open
tic;
%concurrent environment
spmd
if(labindex == 1)
disp('lab1 start');
comp4 = labReceive('any',4);
comp3 = labReceive('any',3);
disp('lab1:comp6');
comp6 = comp4;
labSend(comp6,2,6);
comp5 = labReceive('any',5);
disp('lab1:comp9');
comp9 = comp6;
labSend(comp9,2,9);
disp('lab1 done');
elseif(labindex == 2)
disp('lab2 start');
disp('lab2:comp0');
comp0 = a;
disp('lab2:comp1');
comp1 = comp0;
disp('lab2:comp2');
comp2 = comp1;
disp('lab2:comp3');
comp3 = comp2;
labSend(comp3,1,3);
labSend(comp3,3,3);
comp4 = labReceive('any',4);
disp('lab2:comp5');
comp5 = comp3;
labSend(comp5,1,5);
comp6 = labReceive('any',6);
disp('lab2:comp8');
comp8 = comp5;
disp('lab2:comp10');
comp10 = comp8;
disp('lab2:comp11');
comp11 = comp0;
comp9 = labReceive('any',9);
disp('lab2:comp12');
comp12 = comp11;
disp('lab2:comp13');
comp13 = comp12;
disp('lab2:comp15');
comp15 = comp13;
comp7 = labReceive('any',7);
disp('lab2:comp14');
comp14 = comp12;
disp('lab2 done');
elseif(labindex == 3)
disp('lab3 start');
disp('lab3:comp4');
comp4 = b;
labSend(comp4,2,4);
labSend(comp4,1,4);
comp3 = labReceive('any',3);
disp('lab3:comp7');
comp7 = comp3;
labSend(comp7,2,7);
disp('lab3 done');
end
end
time = toc;
fprintf('Execution time: %f ms\n',time*1e3);
matlabpool close
2 Commenti
Walter Roberson
il 26 Gen 2014
Which MATLAB version are you using? How much memory do you have on your system?
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Startup and Shutdown in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!