nambar12 / matlab_netbatch_scheduler

0 stars 0 forks source link

Odd Results from Parfor Loop #20

Closed pasafier closed 2 years ago

pasafier commented 2 years ago

Raymond, I agree this might be a poor way of writing the parfor loop, however it ran well when I used all the cores (36) on a single machine. When I used 192 cores across multiple machines in the Netbatch network, the csv file had some odd results. I will also try and repeat the test. Here's the short code:

% Run a parametric study

pRPMs = (-60:5:60)'; dRPMs = (-110:5:110)'; SweepRs = (3.5:1:18.5)';

% Remove zero entries since their usage is unlikely pRPMs(pRPMs == 0) = []; dRPMs(dRPMs == 0) = []; SweepRs(SweepRs == 0) = [];

NS = length(pRPMs)length(dRPMs)length(SweepRs);

desMat = {dRPMs,pRPMs,SweepRs}; [desMat{:}]=ndgrid(desMat{:}); n=length(desMat); desMat = reshape(cat(n+1,desMat{:}),[],n);

if exist('./Results.csv', 'file')==2 delete('./Results.csv'); end

parfor kk = 1:NS

dRPM = desMat(kk,1); pRPM = desMat(kk,2); SweepRate = desMat(kk,3);
[sigN,numZeros] = Function_Pad_Cond(dRPM,pRPM,SweepRate);

dlmwrite('./Results.csv',[dRPM pRPM SweepRate sigN numZeros],'delimiter',',','-append')

end