Improving Processor Usage In InterpolateSolution from the PDE Toolbox Via Parallel Computing?

1 visualizzazione (ultimi 30 giorni)
I have a set of ~50 saved results structures from the PDE Toolbox, at roughly 7GB each, on which I need to interpolate to different coordinates. Keeping the code simple, this looks something like:
for index = 1:50
filename=([f1(index),f2,'.mat']);
presaved_results = load(filename,'results');
A = interpolateSolution(presaved_results.results,X,Y,Z,[1,2,3]);
A = reshape(A,size(X,1),size(X,2),3);
end
The aim is to integrate this into an optimisation proceedure using MATLAB's GA, meaning this interpolation step is called many times.
This function seems to just use just 1/4 cores available on my processer, sitting at roughly 30% cpu usage for around 60 seconds per file, so I wondered if it's possible to use the Parallel Computing Toolbox, or anything similar to use more of my processor to speed this up? If not, I assume hardware improvements maybe my only option?
Happy to look into undocumentated solutions, this is currently the biggest bottleneck in my code by some significant margin, it's only a factor of 2 slower to solve the whole FEM model from scatch vs just interpolating to the points of interest because the actual solver utilises my CPU(s) better.

Risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by