From: Jose on
Hello guys, iIneed to run matlabpool in a cluster and this is the way I found to create a Matlab pool job, but it does not work and I do not know why...any help?
Thanks in advance.

jm=findresource('jobmanager','LookupURL','bl-cluster.nsl.as.ul') ;

move=createMatlabPoolJob(jm);
set(move,'FileDependencies',{'parfordemo.m'});
set(move,'Name',('Jose joint info'));
set(move, 'MaximumNumberOfWorkers',4);



obj=cell(1,1);

for n=1:1
obj{n}=createTask(move,'parfordemo',2,{55});
end

submit(move);
waitForState(move);

out=getAllOutputArguments(move)

destroy(move)

hist(out{1,2})

*******************************
This is the function:

function [a,b]=parfordemo(sz)
iter=5000;
%sz=55;
a=zeros(1, iter);

%% Montecarlo Simulation
disp('computing...');drawnow;
tic;
parfor simNum = 1:iter
max(svd(rand(sz)));

end
b=toc;
From: Jose on
"Jose " <jose.l.vega(a)gmail.com> wrote in message <i3f7bk$ft6$1(a)fred.mathworks.com>...
> Hello guys, iIneed to run matlabpool in a cluster and this is the way I found to create a Matlab pool job, but it does not work and I do not know why...any help?
> Thanks in advance.
>
> jm=findresource('jobmanager','LookupURL','bl-cluster.nsl.as.ul') ;
>
> move=createMatlabPoolJob(jm);
> set(move,'FileDependencies',{'parfordemo.m'});
> set(move,'Name',('Jose joint info'));
> set(move, 'MaximumNumberOfWorkers',4);
>
>
>
> obj=cell(1,1);
>
> for n=1:1
> obj{n}=createTask(move,'parfordemo',2,{55});
> end
>
> submit(move);
> waitForState(move);
>
> out=getAllOutputArguments(move)
>
> destroy(move)
>
> hist(out{1,2})
>
> *******************************
> This is the function:
>
> function [a,b]=parfordemo(sz)
> iter=5000;
> %sz=55;
> a=zeros(1, iter);
>
> %% Montecarlo Simulation
> disp('computing...');drawnow;
> tic;
> parfor simNum = 1:iter
> max(svd(rand(sz)));
>
> end
> b=toc;

I got for a website the next structure and it works from them:
http://www.oerc.ox.ac.uk/resources/wcc/support/documentation/sub-documentation/parallel-matlab-usage
********************************************
mpj = createMatlabPoolJob('configuration', 'YourJobManagerName');
createTask(mpj, @sum, 1, {[1 1]});
set(mpj, 'MaximumNumberOfWorkers', 3);
set(mpj, 'MinimumNumberOfWorkers', 3);
submit(mpj)
waitForState(mpj, 'finished', 60)
results = getAllOutputArguments(mpj)

results for them = [2]..then is ok.



Now, when I tun the same code in my cluster with
'MaximumNumberOfWorkers', 2
'MinimumNumberOfWorkers', 2
:
and it works, obtaining: results = [2]....it is ok...but when I change to more workes: 3 3, as in the example, I get some error:

Empty cell array: 1-by-0

anybody can explain me why?
From: Edric M Ellis on
"Jose " <jose.l.vega(a)gmail.com> writes:

> I got for a website the next structure and it works from them:
> http://www.oerc.ox.ac.uk/resources/wcc/support/documentation/sub-documentation/parallel-matlab-usage
> ********************************************
> mpj = createMatlabPoolJob('configuration', 'YourJobManagerName');
> createTask(mpj, @sum, 1, {[1 1]});
> set(mpj, 'MaximumNumberOfWorkers', 3);
> set(mpj, 'MinimumNumberOfWorkers', 3);
> submit(mpj)
> waitForState(mpj, 'finished', 60)
> results = getAllOutputArguments(mpj)
>
> results for them = [2]..then is ok.
>
>
>
> Now, when I tun the same code in my cluster with
> 'MaximumNumberOfWorkers', 2
> 'MinimumNumberOfWorkers', 2
> :
> and it works, obtaining: results = [2]....it is ok...but when I change to more
> workes: 3 3, as in the example, I get some error:
>
> Empty cell array: 1-by-0

The job may well have more information about what went wrong. What's the
output from running:

disp(mpj)
disp(mpj.Task)


Cheers,

Edric.
From: Jose on
Edric M Ellis <eellis(a)mathworks.com> wrote in message <ytwk4o49qx1.fsf(a)uk-eellis-deb5-64.mathworks.co.uk>...
> "Jose " <jose.l.vega(a)gmail.com> writes:
>
> > I got for a website the next structure and it works from them:
> > http://www.oerc.ox.ac.uk/resources/wcc/support/documentation/sub-documentation/parallel-matlab-usage
> > ********************************************
> > mpj = createMatlabPoolJob('configuration', 'YourJobManagerName');
> > createTask(mpj, @sum, 1, {[1 1]});
> > set(mpj, 'MaximumNumberOfWorkers', 3);
> > set(mpj, 'MinimumNumberOfWorkers', 3);
> > submit(mpj)
> > waitForState(mpj, 'finished', 60)
> > results = getAllOutputArguments(mpj)
> >
> > results for them = [2]..then is ok.
> >
> >
> >
> > Now, when I tun the same code in my cluster with
> > 'MaximumNumberOfWorkers', 2
> > 'MinimumNumberOfWorkers', 2
> > :
> > and it works, obtaining: results = [2]....it is ok...but when I change to more
> > workes: 3 3, as in the example, I get some error:
> >
> > Empty cell array: 1-by-0
>
> The job may well have more information about what went wrong. What's the
> output from running:
>
> disp(mpj)
> disp(mpj.Task)
>
>
> Cheers,
>
> Edric.


Hello Edric, sorry for my delay, this command does not help at all:

This is my output:

results =

Empty cell array: 1-by-0

distcomp.matlabpooljob

distcomp.task

Any help?