TriscatteredInterp on a multi-core computer

2 visualizaciones (últimos 30 días)
Alex
Alex el 3 de Jun. de 2011
Respondida: John D'Errico el 7 de Feb. de 2023
Hello,
I'm using TriscatteredInterp to interpolate 3D data. I noticed that my computer is using only one core out 4 (my machine is a MacbookPro, Intel 2720qm). I can see this in the Activity monitor. Sometimes, the interpolation takes forever (more than 3 hours!!).
So my question is simple: can I use the power of my four cores to speed up the process? And how?
Thanks a lot!
  2 comentarios
Bruce Raine
Bruce Raine el 30 de Mayo de 2012
Hello Alex,
Assuming you have 4 physical cores in your mac in order to use all 4 cores in parallel you will need to use the Parallel Computing Toolbox. You obviously may need to tweak your MATLAB -code a bit to make use of the Parallel Computing Toolbox features. You may need to change any for loops to parfor etc. Also use the matlabpool command
to make use of all 4 cores in a local sense. A good link: http://www.mathworks.com/products/parallel-computing/description1.html
Walter Roberson
Walter Roberson el 30 de Mayo de 2012
Bruce, is MATLAB's TriscatteredInterp parallel? If one is already submitting all of the points one needs to interpolate at into the routine then in order to create a parallel version, one would have to "unzip" the scattered points into smaller subsets and submit to each subset only the portion of the output locations appropriate for that subset.
There is no MATLAB routine that I know of that will analyze scattered points in order to break them up into sector subsets (carefully keeping just enough of the surrounding points for all of the points on the edges of the sectors to be interpolated properly), so the "tweak your MATLAB -code a bit" starts to sound like "rewrite the whole algorithm to use octrees and not TriscatteredInterp at all".
Did you have a different strategy in mind?

Iniciar sesión para comentar.

Respuestas (1)

John D'Errico
John D'Errico el 7 de Feb. de 2023
A long dead question. But even today, you won't easily find tools like triscatteredinterp, or griddeInterpolant, that will work in parallel.
These tools need to decide where each point lies in a triangulation. Even today, that is true. And that means a parallelized version will not be an easy thing to write.
I tested both TriscatteredInterp, and scatteredInterpolant on a large set of data, interpolating 1e7 points through a random surface compiosed of 10000 points in 2-dimensions. There is no use of multiple cores, even today, using R2022b.
Any code would need to be written completely from scratch, splitting the processing between the multiple cores. While doable, it still does not exist.
If you really need it, one could submit a feature request. Better, if you have the parallel processing toolbox, is to write it yourself, as the best way to make it work. I don't have that toolbox, so I won't write the code.

Categorías

Más información sobre Interpolation en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by