Parfor Execution time variation
古いコメントを表示
Hi,
I am using parfor for reading 600 .raw files.
c=zeros(1536,1536,600,'uint16');
parpool('threads',4);
parfor i=1:600
fileName=[folder,'/',fileList(i).name];
a=fopen(fileName,'r');
Z=fread(a,[1536 1536],'uint16');
fclose(a);
c(:,:,i)=Z;
end
However, I am observing significant variability in the execution time, which ranges from 14 seconds to 110 seconds across different runs.
Why is this discrepancy occurring? Is there a way to achieve more consistent execution times?
4 件のコメント
Christopher Mirfin
2024 年 6 月 7 日
Can I ask for a little more information for clarification:
- Are you timing the entire parfor block? e.g. tic, parfor ... end, toc
- What is the spread of timings? Is it usually 14 seconds, and occasionally up to 110 seconds?
- Machine information (operating system), and MATLAB Release.
Anshika Goel
2024 年 6 月 10 日
Christopher Mirfin
2024 年 6 月 12 日
Do you observe the same variability when running with a standard for-loop, or a process-based pool parpool("Processes",4) ?
Also, are you reading from your local hard drive or a network location?
Anshika Goel
2024 年 6 月 13 日
編集済み: Anshika Goel
2024 年 6 月 13 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!