Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
parfor and triscatteredinterp

Subject: parfor and triscatteredinterp

From: Kirk

Date: 10 May, 2012 13:14:07

Message: 1 of 2

I am running a large solar radiation interpolation job in 3 dimensions (longitude, latitude, and time) with triscatteredinterp. I thought I could apply parlor to this situation, but due to the length of job (25 hours so far). I am guessing that my application of parlor was either incorrect, or that there are more efficient ways to do the interpolation. The alternative hypothesis is... the job is just that big, and it takes this long to perform.

Below is the code I am runnings

matlabpool(8)
parfor i = 1:1680
    hadcm3_srad_point = cat(2,station_coords,hadcm3_data(i,3:171)'); % combine srad point data (1680 lines) with stations coords
    hadcm3_srad_point_nonan = hadcm3_srad_point(~any(isnan(hadcm3_srad_point),2),:); % remove point data lines with NaNs
    F = TriScatteredInterp(hadcm3_srad_point_nonan(:,2),hadcm3_srad_point_nonan(:,3),hadcm3_srad_point_nonan(:,4)); % Construct the interpolant
    hadcm3_srad_interp = F(lon,lat); % Evaluate the interpolant at the loactions (lon, lat)
    hadcm3_srad(:,:,i) = hadcm3_srad_interp; % build multidimensional matrix from inpolated arrays
    i
end


The computationally intensive bit it the line:


    F = TriScatteredInterp(hadcm3_srad_point_nonan(:,2),hadcm3_srad_point_nonan(:,3),hadcm3_srad_point_nonan(:,4)); % Construct the interpolant


Since I am going to have to perform this interpolation on sever other data sets, I am winding if any one has suggestions for improving efficiency?

Thanks in advance

Subject: parfor and triscatteredinterp

From: Edric M Ellis

Date: 10 May, 2012 15:28:31

Message: 2 of 2

"Kirk" <kwythers.nospam@umn.edu> writes:

> I am running a large solar radiation interpolation job in 3 dimensions
> (longitude, latitude, and time) with triscatteredinterp. I thought I could apply
> parlor to this situation, but due to the length of job (25 hours so far). I am
> guessing that my application of parlor was either incorrect, or that there are
> more efficient ways to do the interpolation.

How long were you expecting it to take? How long does it take to run in
a single MATLAB session?

Also, if the time-consuming part of your operation is already
multithreaded by MATLAB, using PARFOR will not speed things up.

Cheers,

Edric.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us