MATLAB Answers

Performance of Parfor Loops

조회 수: 14(최근 30일)
Lokesh Marisetty
Lokesh Marisetty 12 Jan 2021
답변: Matt J 12 Jan 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

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

채택된 답변

Matt J
Matt J 12 Jan 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

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

추가 답변(0개)

Community Treasure Hunt

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

Start Hunting!

Translated by