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:
using matlabpool in the cluster

Subject: using matlabpool in the cluster

From: Jose

Date: 5 Aug, 2010 20:36:04

Message: 1 of 5

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;

Subject: using matlabpool in the cluster

From: Jose

Date: 5 Aug, 2010 21:36:04

Message: 2 of 5

"Jose " <jose.l.vega@gmail.com> wrote in message <i3f7bk$ft6$1@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?

Subject: using matlabpool in the cluster

From: Edric M Ellis

Date: 6 Aug, 2010 06:49:30

Message: 3 of 5

"Jose " <jose.l.vega@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.

Subject: using matlabpool in the cluster

From: Jose

Date: 10 Aug, 2010 13:23:04

Message: 4 of 5

Edric M Ellis <eellis@mathworks.com> wrote in message <ytwk4o49qx1.fsf@uk-eellis-deb5-64.mathworks.co.uk>...
> "Jose " <jose.l.vega@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?

Subject: using matlabpool in the cluster

From: Edric M Ellis

Date: 16 Aug, 2010 07:45:40

Message: 5 of 5

"Jose " <jose.l.vega@gmail.com> writes:

> Edric M Ellis <eellis@mathworks.com> wrote in message <ytwk4o49qx1.fsf@uk-eellis-deb5-64.mathworks.co.uk>...
>> "Jose " <jose.l.vega@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?

Oops, that's not the output I was hoping for, sorry. Perhaps the output
from

mpj.get

and

mpj.Task.get

might shed more light.

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