필터 지우기
필터 지우기

Why does this code slow down?

조회 수: 1 (최근 30일)
Rosi Marungu
Rosi Marungu 2016년 8월 1일
댓글: Stefan Reich 2016년 8월 1일
I am trying to run a huge simulation experiment. parameters is a cell with a 5200x1 parameter matrix in each entry. estimatedParameters has the same format. SimData is created as a 100x100x10000 matrix. estimation employs a lot of matrix inversions on 100x100 matrices.
In the first parfor iteration each iteration is done in about 300 secs. After that computational time increases gradually for each iteration and stabilizes at around 1200 secs.
Why could that be? I am not a sophisticated programmer, but in my view it seems like each iteration should take the same time.
for combo=1:4
parfor rep=1:500
tic
SimData = simulation(parameters{combo,rep});
estimatedParameters{combo,rep} = estimation(SimData);
toc
end
end
  댓글 수: 1
Stefan Reich
Stefan Reich 2016년 8월 1일
My guess: After the first iterations your Working Memory(RAM) fills up and Matlab starts having to shift stuff to your hard drive and back, thus slowing down and increasing calculation time. Try monitoring your RAM with the task manager during calculation. But dont take my word for it.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Scan Parameter Ranges에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by