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:
problem with my function using distributed computing server

Subject: problem with my function using distributed computing server

From: Jose

Date: 18 Mar, 2010 17:58:04

Message: 1 of 5

Hello everyone,
I am trying to tun an simple example to run in my cluster: bm-cluster1.sl.ac.ud that
just has been installed MATLAB Distributed computing Server 4.

Running the intrinsic function @rand, is fine, it works well:
a=dfeval(@rand,{1,2,3,4,5},'lookupURL','bm-cluster1.sl.ac.ud')

But, if I want to run another function, created by myself, with three imputs
and 1 output:
function meanx=averages(ini1,ini2,ini3)
meanx=mean([ini1,ini2,ini3]);

I try to run 4 task in the cluster as :

[A B]=dfeval(@averages,{1 10 100 1000},{2 20 200 2000},{6 60 600 6000},'lookupURL','bm-cluster1.sl.ac.ud')

and I got the next message error:

"Warning: Errors occurred during execution of task 1. Results may be incorrect."
Undefined function or method 'averages' for input arguments of type 'double'.

It looks like to me that the cluster do not recognize my new function...anyone can help me with it...I don't have experience with Distributed Computer Server.

Thnaks in advance,

Jose.

Subject: problem with my function using distributed computing server

From: Raymond Norris

Date: 19 Mar, 2010 12:50:22

Message: 2 of 5

Jose,

You need to specifiy to dfeval that you have a file dependency on the file averages.m. Remember, the file is local to your MATLAB path, but the cluster knows nothing about the files on your client machine.

When calling dfeval, use the FileDependencies argument.

Raymond

"Jose " <jose.l.vega@gmail.com> wrote in message <hntpjc$d24$1@fred.mathworks.com>...
> Hello everyone,
> I am trying to tun an simple example to run in my cluster: bm-cluster1.sl.ac.ud that
> just has been installed MATLAB Distributed computing Server 4.
>
> Running the intrinsic function @rand, is fine, it works well:
> a=dfeval(@rand,{1,2,3,4,5},'lookupURL','bm-cluster1.sl.ac.ud')
>
> But, if I want to run another function, created by myself, with three imputs
> and 1 output:
> function meanx=averages(ini1,ini2,ini3)
> meanx=mean([ini1,ini2,ini3]);
>
> I try to run 4 task in the cluster as :
>
> [A B]=dfeval(@averages,{1 10 100 1000},{2 20 200 2000},{6 60 600 6000},'lookupURL','bm-cluster1.sl.ac.ud')
>
> and I got the next message error:
>
> "Warning: Errors occurred during execution of task 1. Results may be incorrect."
> Undefined function or method 'averages' for input arguments of type 'double'.
>
> It looks like to me that the cluster do not recognize my new function...anyone can help me with it...I don't have experience with Distributed Computer Server.
>
> Thnaks in advance,
>
> Jose.

Subject: problem with my function using distributed computing server

From: Jose

Date: 19 Mar, 2010 13:04:06

Message: 3 of 5

Ok, Raymond...I was thinking something like that...the problem is that the main program that I want to run in the cluster use 10 functions (created by myself)...and then I suppose I have to create an script to the cluster recognize all the 10 functions.
We will see.
Thanks a lot.
Jose.


"Raymond Norris" <raymond.norris@mathworks.com> wrote in message <hnvrue$1ol$1@fred.mathworks.com>...
> Jose,
>
> You need to specifiy to dfeval that you have a file dependency on the file averages.m. Remember, the file is local to your MATLAB path, but the cluster knows nothing about the files on your client machine.
>
> When calling dfeval, use the FileDependencies argument.
>
> Raymond
>
> "Jose " <jose.l.vega@gmail.com> wrote in message <hntpjc$d24$1@fred.mathworks.com>...
> > Hello everyone,
> > I am trying to tun an simple example to run in my cluster: bm-cluster1.sl.ac.ud that
> > just has been installed MATLAB Distributed computing Server 4.
> >
> > Running the intrinsic function @rand, is fine, it works well:
> > a=dfeval(@rand,{1,2,3,4,5},'lookupURL','bm-cluster1.sl.ac.ud')
> >
> > But, if I want to run another function, created by myself, with three imputs
> > and 1 output:
> > function meanx=averages(ini1,ini2,ini3)
> > meanx=mean([ini1,ini2,ini3]);
> >
> > I try to run 4 task in the cluster as :
> >
> > [A B]=dfeval(@averages,{1 10 100 1000},{2 20 200 2000},{6 60 600 6000},'lookupURL','bm-cluster1.sl.ac.ud')
> >
> > and I got the next message error:
> >
> > "Warning: Errors occurred during execution of task 1. Results may be incorrect."
> > Undefined function or method 'averages' for input arguments of type 'double'.
> >
> > It looks like to me that the cluster do not recognize my new function...anyone can help me with it...I don't have experience with Distributed Computer Server.
> >
> > Thnaks in advance,
> >
> > Jose.

Subject: problem with my function using distributed computing server

From: Raymond Norris

Date: 19 Mar, 2010 17:36:04

Message: 4 of 5

Jose,

Here's an example using FD

 [A B]=dfeval(@averages, ...
   {1 10 100 1000},{2 20 200 2000},{6 60 600 6000}, ...
   'lookupURL','bm-cluster1.sl.ac.ud', ...
   'FileDependencies',{'averages.m','file2.m','file3.m','file4.m'});

Raymond

"Jose " <jose.l.vega@gmail.com> wrote in message <hntpjc$d24$1@fred.mathworks.com>...
> Hello everyone,
> I am trying to tun an simple example to run in my cluster: bm-cluster1.sl.ac.ud that
> just has been installed MATLAB Distributed computing Server 4.
>
> Running the intrinsic function @rand, is fine, it works well:
> a=dfeval(@rand,{1,2,3,4,5},'lookupURL','bm-cluster1.sl.ac.ud')
>
> But, if I want to run another function, created by myself, with three imputs
> and 1 output:
> function meanx=averages(ini1,ini2,ini3)
> meanx=mean([ini1,ini2,ini3]);
>
> I try to run 4 task in the cluster as :
>
> [A B]=dfeval(@averages,{1 10 100 1000},{2 20 200 2000},{6 60 600 6000},'lookupURL','bm-cluster1.sl.ac.ud')
>
> and I got the next message error:
>
> "Warning: Errors occurred during execution of task 1. Results may be incorrect."
> Undefined function or method 'averages' for input arguments of type 'double'.
>
> It looks like to me that the cluster do not recognize my new function...anyone can help me with it...I don't have experience with Distributed Computer Server.
>
> Thnaks in advance,
>
> Jose.

Subject: problem with my function using distributed computing server

From: Jose

Date: 19 Mar, 2010 18:11:04

Message: 5 of 5

Many thanks Raymond, but now I need to use a function that use a file library.mat in all the workers.

To do it, I uploaded this file library.mat from my client machine into all the workers of my cluster via SSH client, in a directory called bm/home/jose.mat..I did it 8 times. My cluster have 16 processors.
But now, I need the right sentence I have to use in your
example...i am sure is load...but I do not know how I can get the right directory bm/home/jose.mat in the cluster from my client machine: Can you help me with that?

Thanks in adavance.






"Raymond Norris" <raymond.norris@mathworks.com> wrote in message <ho0cm4$isu$1@fred.mathworks.com>...
> Jose,
>
> Here's an example using FD
>
> [A B]=dfeval(@averages, ...
> {1 10 100 1000},{2 20 200 2000},{6 60 600 6000}, ...
> 'lookupURL','bm-cluster1.sl.ac.ud', ...
> 'FileDependencies',{'averages.m','file2.m','file3.m','file4.m'});
>
> Raymond
>
> "Jose " <jose.l.vega@gmail.com> wrote in message <hntpjc$d24$1@fred.mathworks.com>...
> > Hello everyone,
> > I am trying to tun an simple example to run in my cluster: bm-cluster1.sl.ac.ud that
> > just has been installed MATLAB Distributed computing Server 4.
> >
> > Running the intrinsic function @rand, is fine, it works well:
> > a=dfeval(@rand,{1,2,3,4,5},'lookupURL','bm-cluster1.sl.ac.ud')
> >
> > But, if I want to run another function, created by myself, with three imputs
> > and 1 output:
> > function meanx=averages(ini1,ini2,ini3)
> > meanx=mean([ini1,ini2,ini3]);
> >
> > I try to run 4 task in the cluster as :
> >
> > [A B]=dfeval(@averages,{1 10 100 1000},{2 20 200 2000},{6 60 600 6000},'lookupURL','bm-cluster1.sl.ac.ud')
> >
> > and I got the next message error:
> >
> > "Warning: Errors occurred during execution of task 1. Results may be incorrect."
> > Undefined function or method 'averages' for input arguments of type 'double'.
> >
> > It looks like to me that the cluster do not recognize my new function...anyone can help me with it...I don't have experience with Distributed Computer Server.
> >
> > Thnaks in advance,
> >
> > Jose.

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