Performance of Parfor Loops
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Lokesh Marisetty
el 12 de En. de 2021
Respondida: Matt J
el 12 de En. de 2021
I am performing Monte-calro simulations to evaluate performance of a communication system. I have used parfor loop for 'n' interations. I am providing the pseudo code below. Each of the loop is completely independent.
[config] = config_init();
parfor i = 1: no_iterations
[tx_sig] = transmit(config);
[rx_sig] = channel(tx_sig);
[detect] = recieve(rx_sig);
end
I am using a computer with 8-core processor to run the simulations. I see that the execution speed goes up by only 2 to 3 times when parfor is used.
Why is that the speed doesn't go up by 8 times when 8 workers are used. I greatly appreciate if someone can explain necessary changes required in the code to achieve approximately 8 times ( number of cores) improvement in the speed.
Thanks,
Lokesh
0 comentarios
Respuesta aceptada
Matt J
el 12 de En. de 2021
Because even when you use just 1 worker, the Matlab code will to some degree be able to use all 8 cores that you have. To see if the scale up makes sense, you should monitor the usage of the cores in both cases, e.g. with the Task Manager if in Windows.
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Startup and Shutdown 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!