Rank: 476784 based on 0 downloads (last 30 days) and 0 file submitted


California Institute of Technology
34.13667, -118.12476

Personal Profile:


Watch this Author's files


Comments and Ratings by Joe
Updated File Comments Rating
18 Sep 2013 Worker Object Wrapper Simplifies managing resources such as large data within PARFOR loops and SPMD blocks Author: Parallel Computing Team

Great file! It's improved the speed of the parfor loop in a simulation I've written by 30%.

One issue: the first time I run this in my program, I get the following error:

Error using WorkerObjWrapper>(spmd body) (line 161)
You cannot get the 'Map' property of 'WorkerObjWrapper'.
You cannot get the 'Map' property of 'WorkerObjWrapper'.

This error occurs once for every worker I have, and aborts my script. When I then run my script again (no changes), WorkerObjWrapper works wonderfully and no errors occur. I'm calling it in this form (simplified):

tsteps = 1:10000;
xpoints = 1:100;
for jj = tsteps
% omitting stuff here that generates a large matrix of kk=6 different quantities ("bigMatrix(ii,kk)") that evolves in time and needs to be checked for each time step at each x point.

bigMatrixWrapped = WorkerObjWrapper(bigMatrix);

parfor ii = xpoints
bigMatrixW = bigMatrixWrapped.Value;
results(ii,jj) = processResults(bigMatrixW(ii));

The error occurs on the line "bigMatrixWrapped = WorkerObjWrapper(bigMatrix);" so I'm not even sure that the structure of my parfor loop matters, unless for some reason WorkerObjWrapper doesn't like being called repeatedly. But then running the whole script a second time works, with no "Map" error (I'm not even sure what that means) and the expected results collected in the "results(ii,jj)" matrix.

Any ideas?

Contact us