Borrar filtros
Borrar filtros

Why does this code slow down?

1 visualización (últimos 30 días)
Rosi Marungu
Rosi Marungu el 1 de Ag. de 2016
Comentada: Stefan Reich el 1 de Ag. de 2016
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 comentario
Stefan Reich
Stefan Reich el 1 de Ag. de 2016
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.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Scan Parameter Ranges 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!

Translated by