I think has a bug when is used with plot(obj,obj2) option and is utilized with 10 o more workers.
I fixed this problem with:
*Change (Line 592 and 593):
newlabels = char(zeros(length(ylabels),6));
newlabels(:,1) = ylabels;
serTex = 'Serial';
carSerTex = length(serTex);
carYLab = size(ylabels,2);
newlabels = char(zeros(length(ylabels),max(carSerTex,carYLab)));
newlabels(:,1:carYLab) = ylabels;
newlabels(1,1:carSerTex) = serTex;
Maybe I'm wrong, but I'll try to explain better. Generally in a parfor loop called several times I have two data types. A constantly changing and one that is fixed over a parfor loop cycle.
a = rand (x2, 1);
b = rand (x2, 1);
for i1 = 1: x1
parfor i2 = 1: x2
a (i2) = fun1 (a (i2), b (i2));
a = fun2 (a, b);
It would be interesting that the sliced variable "b" to be persistent and that the sliced variable "a" the drive automatically by the parfor.
It is now certain that the remaining portion of b stored in each worker corresponds to the part that is sent from "a" to the worker in each call to parfor loop?
That is my question.
Hi Matt J.
Good idea, but I think it is difficult in the parfor loop if it distributed the data in different way in each parfor call. As far as I know, in the parfor isn't defined what information receive each worker.
Hi Matt, calling "clear" inside SPMD is not necessary - that's not the problem. Because of the way Composites work, when they go out of scope the workers don't find out immediately, only on the next SPMD block. If you add an SPMD block to your function, that's not sufficient since that happens before the Composites are created during the WorkerObjWrapper deletion.
Next suggestion: try adding the following line
val = ; dtor = ; valdtor = ;
as the last line inside the SPMD block in workerDelete.
30 Oct 2013
Worker Object Wrapper
Simplifies managing resources such as large data within PARFOR loops and SPMD blocks
Hi Edric. An empty spmd block does clear them, but only from the command line. Putting it at the end of the function that created the wrapper object does no good. I also tried inserting an empty spmd block in the classdef where you recommended. That also didn't affect anything.
Is it desired behavior for an empty spmd block to clear the object? It is particular that sending no command to the workers forces a clear. Wouldn't it be better to enable
spmd, clear obj; end
Why wouldn't spmd