Can you please help me? My CPU usage remains consistently low when using parallel processing.
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
阳 刘
el 17 de Jul. de 2024
Comentada: 阳 刘
el 17 de Jul. de 2024
I investigated multiple reasons and discovered that the command matlab --prefersoftwareopengl is causing high I/O usage. How can I resolve this I/O hogging issue?
T1=20001;
T2=29000;
% Start the parallel pool
parpool('Threads', 64);
N=T2-T1+1; % 数据点数
dmix = zeros(nx-start1-end1,ny-start2-end2,N);
parfor k = 1:N
i = T1 + k - 1;
fileName = sprintf('./left.out/m%06d.ovf', i-1);
fid = fopen(fileName, 'r');
datam = textscan(fid, '%f%f%f', 'headerlines', 28, 'collectoutput', 1);
fclose(fid);
datam = datam{1};
mix111 = reshape(datam(:,2), [nx, ny, nz]); % select x component
mix111 = permute(mix111, [2 1 3]); % x-y transform
mix11 = mix111(start1+1:nx-end1, start2+1:ny-end2, 2) - mix111(start1+1:nx-end1, start2+1:ny-end2, 1);
mix1 = squeeze(mix11);
% Compute the difference and store in dmix
dmix(:,:,k) = mix1;
end
delete(gcp('nocreate'));
0 comentarios
Respuesta aceptada
Sivsankar
el 17 de Jul. de 2024
Editada: Sivsankar
el 17 de Jul. de 2024
Hi,
I believe that the high I/O usage is maybe because of the simultaneous load of software rendering of OpenGL and parallel computation on the CPU. Subsequently when your system runs out of available RAM due to the combined load of software rendering and parallel computations, it may start using swap space on the disk, leading to high disk I/O usage.
So, you can maybe shift from software OpenGL to hardware-accelerated OpenGL so that the rendering tasks would be taken up by the GPU allotting the CPU for the parallel worker threads. Refer to the following MathWorks documentation to implement it
You could also make use of the ‘profile’ tool available in MATLAB to pinpoint if the high I/O usage is due to the software OpenGL or the parallel worker threads.
Here is the documentation on ‘profile’ tool
Let me know if these steps work. Thanks!
Más respuestas (0)
Ver también
Categorías
Más información sobre Graphics Performance 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!