Can you please help me? My CPU usage remains consistently low when using parallel processing.
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’));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’)); 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’)); parallel computing toolbox, parallel computing MATLAB Answers — New Questions