Parallel Computing Maximize CPU Usage
Show older comments
Hi,
I am relatively new to working with parallel codes and am utilizing a super computer insitute to bear the grunt of the CPU and RAM load. I am running this code and am having a difficult time maximizing my CPU efficiency. After running with 36 cores, the CPU efficiency was 30%. I then dropped it to 10 cores (~30* of 36) and only noted a CPU efficiency of 70%.
I would love to maximize this script to 100% at 36 cores as that would greatly speed up this processing, but am at a lost as to why it isn't automatically maximizing my CPU efficiency.
Cheers,
JM
parpool('local', maxNumCompThreads);
function cohSquare = cohAllReg(regions, fd)
%Create empty matrix for cohSquare
cohSquare = cell(size(regions, 2)+1, size(regions, 2)+1);
%Create x and y labels corresponding to ROIs
yLabel = horzcat(' ', regions(1, :));
xLabel = horzcat(' ', regions(1, :))';
%Define length of index
range = (size(regions, 2)+1);
%Create coherence value upper triangle matrix for left sided stroke
if fd.lesion_side =='l'
parfor i = 2:range
for j = 2:range
if i <= j
cohSquare{i, j} = getCoh(regions{2, i-1}, regions{2, j-1}, fd);
end
end
end
%Create coherence value upper triangle matrix for right sided stroke
else fd.lesion_side == 'r'
parfor i = 2:range
for j = 2:range
if i <= j
cohSquare{i, j} = getCoh(regions{5, i-1}, regions{5, j-1}, fd);
end
end
end
end
cohSquare(1, :) = xLabel;
cohSquare(:, 1) = yLabel;
end
delete(gcp('nocreate'));
Accepted Answer
More Answers (0)
Categories
Find more on Parallel Computing Fundamentals in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!