Skip to Main Content Skip to Search
Login
File Exchange
MATLAB Newsgroup
Link Exchange
  Blogs  
 Contest 
MathWorks.com

Thread Subject: How to run an external application on a different computer from MATLAB

Subject: How to run an external application on a different computer from MATLAB

From: Hema

Date: 17 Jun, 2008 19:35:03

Message: 1 of 17

I am implementing a GA using MATLAB. My algorithm requires
me to call an external program to compute my objective
function value. Now in order to speed up, I would run this
external application simultaneously on multiple computers.
Right now for a single computer I use a dos command to call
and run the application. How can I modify this for multiple
computers.

Subject: How to run an external application on a different computer from MATLAB

From: Hema

Date: 18 Jun, 2008 12:19:01

Message: 2 of 17

"Hema " <tennisenlightened@gmail.com> wrote in message
<g393l6$mg0$1@fred.mathworks.com>...
> I am implementing a GA using MATLAB. My algorithm requires
> me to call an external program to compute my objective
> function value. Now in order to speed up, I would run this
> external application simultaneously on multiple computers.
> Right now for a single computer I use a dos command to call
> and run the application. How can I modify this for multiple
> computers.


I guess no one replied here. Can I ask another question. Is
there a dos command that will allow me to call a program and
run it on a different computer. I think this should solve my
problem

Subject: How to run an external application on a different computer from MATLAB

From: us

Date: 18 Jun, 2008 12:42:01

Message: 3 of 17

"Hema ":
<SNIP ML isn't good enough...

> Is there a dos command that will allow me to call a
program and run it on a different computer...

a hint:

     help system;
% note: these two run on either system despite their names
     help unix;
     help dos;
% -and-
     help punct; % then look for <!>

us

Subject: How to run an external application on a different computer from MATLAB

From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)

Date: 18 Jun, 2008 13:59:17

Message: 4 of 17

In article <g3aufl$l7g$1@fred.mathworks.com>,
Hema <tennisenlightened@gmail.com> wrote:

>Is there a dos command that will allow me to call a program and
>run it on a different computer.

There is no such command supplied with MS Windows.

If you load in MinGW or AT&T UWin then you would have enough of a
Unix-type environment to be able to use rsh and ssh .

--
  "MAMA: Oh--So now it's life. Money is life. Once upon a time freedom
   used to be life--now it's money. I guess the world really do change.
   WALTER: No--it was always money, Mama. We just didn't know about it."
                                              -- Lorraine Hansberry

Subject: How to run an external application on a different computer from MATLAB

From: Hema

Date: 18 Jun, 2008 17:04:02

Message: 5 of 17

roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in
message <g3b4bl$ef2$1@canopus.cc.umanitoba.ca>...
> In article <g3aufl$l7g$1@fred.mathworks.com>,
> Hema <tennisenlightened@gmail.com> wrote:
>
> >Is there a dos command that will allow me to call a
program and
> >run it on a different computer.
>
> There is no such command supplied with MS Windows.
>
> If you load in MinGW or AT&T UWin then you would have
enough of a
> Unix-type environment to be able to use rsh and ssh .

Thanks for your reply. I don't understand how MinGW and Uwin
work. I am not that much of a computer expert. Will there be
complications if I load either of these. Can you provide
some details.

Subject: How to run an external application on a different computer from MATLAB

From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)

Date: 18 Jun, 2008 17:34:24

Message: 6 of 17

In article <g3bf62$2ni$1@fred.mathworks.com>,
Hema <tennisenlightened@gmail.com> wrote:
>roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in
>message <g3b4bl$ef2$1@canopus.cc.umanitoba.ca>...

>> If you load in MinGW or AT&T UWin then you would have
>enough of a
>> Unix-type environment to be able to use rsh and ssh .

>Thanks for your reply. I don't understand how MinGW and Uwin
>work. I am not that much of a computer expert. Will there be
>complications if I load either of these.

MinGW and UWin are effectively versions of Unix that you can run within
MS Windows. If you are from a Unix-like background, your reaction to
them will likely be something along the lines of, "At last! Now I can
do real work! Now NOTHING can stop me! Bwahahahahaha!". But if you are
from an MS Windows background, then your reaction to them will likely
be more or less "Huh?? If the packet hits a pocket on a socket on a WHAT?"

--
   "Okay, buzzwords only. Two syllables, tops." -- Laurie Anderson

Subject: How to run an external application on a different computer from MATLAB

From: Hema

Date: 18 Jun, 2008 18:07:02

Message: 7 of 17

roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in
message <g3bgv0$2it$1@canopus.cc.umanitoba.ca>...
> In article <g3bf62$2ni$1@fred.mathworks.com>,
> Hema <tennisenlightened@gmail.com> wrote:
> >roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in
> >message <g3b4bl$ef2$1@canopus.cc.umanitoba.ca>...
>
> >> If you load in MinGW or AT&T UWin then you would have
> >enough of a
> >> Unix-type environment to be able to use rsh and ssh .
>
> >Thanks for your reply. I don't understand how MinGW and Uwin
> >work. I am not that much of a computer expert. Will there be
> >complications if I load either of these.
>
> MinGW and UWin are effectively versions of Unix that you
can run within
> MS Windows. If you are from a Unix-like background, your
reaction to
> them will likely be something along the lines of, "At
last! Now I can
> do real work! Now NOTHING can stop me! Bwahahahahaha!".
But if you are
> from an MS Windows background, then your reaction to them
will likely
> be more or less "Huh?? If the packet hits a pocket on a
socket on a WHAT?"

Ok I am from a Windows background and hence the latter
reaction:) But it seems like other than the method you
mentioned there is no other way to call a program on a
different machine from MATLAB. That's a little surprising to me.

Subject: How to run an external application on a different computer from MATLAB

From: us

Date: 18 Jun, 2008 18:22:02

Message: 8 of 17

"Hema ":
<SNIP still the same sermon...

> ...it seems like other than the method you
> mentioned there is no other way to call a program on a
> different machine from MATLAB. That's a little surprising
> to me...

did you look at what i told you earlier...
yes, then

% go here

http://technet.microsoft.com/en-
us/sysinternals/bb897553.aspx

% download psexec
% use it according to the nice help, eg,

     !psexec

% now try
     system('psexec \\thiscomputer matlab');
% which should open another ML session on your computer...

us

Subject: How to run an external application on a different computer from MATLAB

From: Hema

Date: 18 Jun, 2008 21:26:02

Message: 9 of 17

"us " <us@neurol.unizh.ch> wrote in message
<g3bjoa$nfn$1@fred.mathworks.com>...
> "Hema ":
> <SNIP still the same sermon...
>
> > ...it seems like other than the method you
> > mentioned there is no other way to call a program on a
> > different machine from MATLAB. That's a little surprising
> > to me...
>
> did you look at what i told you earlier...
> yes, then
>
> % go here
>
> http://technet.microsoft.com/en-
> us/sysinternals/bb897553.aspx
>
> % download psexec
> % use it according to the nice help, eg,
>
> !psexec
>
> % now try
> system('psexec \\thiscomputer matlab');
> % which should open another ML session on your computer...
>
> us
>

us sorry, I couldn't understand what you were trying to say
earlier. But I understood your new suggestion I think, so I
will try it tomorrow and let you know what the result is.

Thanks for your help
Hema

Subject: How to run an external application on a different computer from

From: reza

Date: 18 Jun, 2008 22:33:40

Message: 10 of 17

On Jun 18, 8:19 am, "Hema " <tennisenlighte...@gmail.com> wrote:
> "Hema " <tennisenlighte...@gmail.com> wrote in message
>
> <g393l6$mg...@fred.mathworks.com>...
>
> > I am implementing a GA using MATLAB. My algorithm requires
> > me to call an external program to compute my objective
> > function value. Now in order to speed up, I would run this
> > external application simultaneously on multiple computers.
> > Right now for a single computer I use a dos command to call
> > and run the application. How can I modify this for multiple
> > computers.
>
> I guess no one replied here. Can I ask another question. Is
> there a dos command that will allow me to call a program and
> run it on a different computer. I think this should solve my
> problem

you need psexec from the pstool set made by sysinternals (taken over
by microsoft)

see: http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx

good luck.

/reza

Subject: How to run an external application on a different computer from MATLAB

From: Steven Lord

Date: 19 Jun, 2008 03:05:03

Message: 11 of 17


"Hema " <tennisenlightened@gmail.com> wrote in message
news:g3aufl$l7g$1@fred.mathworks.com...
> "Hema " <tennisenlightened@gmail.com> wrote in message
> <g393l6$mg0$1@fred.mathworks.com>...
>> I am implementing a GA using MATLAB. My algorithm requires
>> me to call an external program to compute my objective
>> function value. Now in order to speed up, I would run this
>> external application simultaneously on multiple computers.
>> Right now for a single computer I use a dos command to call
>> and run the application. How can I modify this for multiple
>> computers.
>
>
> I guess no one replied here. Can I ask another question. Is
> there a dos command that will allow me to call a program and
> run it on a different computer. I think this should solve my
> problem

Depending on how parallelizable your function is, how many iterations you
need to run in your GA, and how many other computers you want to use to
compute your objective function, you might want to use Parallel Computing
Toolbox:

http://www.mathworks.com/products/parallel-computing/

You might find this demo from Genetic Algorithm and Direct Search Toolbox
interesting:

http://www.mathworks.com/products/gads/demos.html?file=/products/demos/shipping/gads/distributed_fitness.html

You may also be able to use the UseParallel option with the GA solver:

http://www.mathworks.com/access/helpdesk/help/toolbox/gads/f6174dfi10.html#brkgmk4-1

--
Steve Lord
slord@mathworks.com


Subject: How to run an external application on a different computer from MATLAB

From: us

Date: 19 Jun, 2008 08:50:18

Message: 12 of 17

"Steven Lord":
<SNIP down to ML intrinsic solution...

> >> Now in order to speed up, I would run this
> >> external application simultaneously on multiple
> >> computers.

> Depending on how parallelizable your function is, how
many iterations you need to run in your GA, and how many
other computers you want to use to compute your objective
function, you might want to use Parallel Computing
Toolbox...

steve
how would/could this tbx help the OP?
he wants to run an external app...
urs

Subject: How to run an external application on a different computer from MATLAB

From: Steven Lord

Date: 19 Jun, 2008 13:42:48

Message: 13 of 17


"us " <us@neurol.unizh.ch> wrote in message
news:g3d6k9$4i0$1@fred.mathworks.com...
> "Steven Lord":
> <SNIP down to ML intrinsic solution...
>
>> >> Now in order to speed up, I would run this
>> >> external application simultaneously on multiple
>> >> computers.
>
>> Depending on how parallelizable your function is, how
> many iterations you need to run in your GA, and how many
> other computers you want to use to compute your objective
> function, you might want to use Parallel Computing
> Toolbox...
>
> steve
> how would/could this tbx help the OP?
> he wants to run an external app...
> urs

My guess is that the OP's objective function uses SYSTEM or ! to invoke the
external application and retrieve the output from that application. If
that's the case, the OP could modify their objective function using the demo
to which I linked as a guide to use SYSTEM on each of the workers, running
the external application on each, and returning the results back to their
main MATLAB session; alternately, I don't know of any inherent reason the
UseParallel option shouldn't work with an objective function that calls
SYSTEM.

--
Steve Lord
slord@mathworks.com


Subject: How to run an external application on a different computer from MATLAB

From: Hema

Date: 19 Jun, 2008 14:49:02

Message: 14 of 17


> My guess is that the OP's objective function uses SYSTEM
or ! to invoke the
> external application and retrieve the output from that
application. If
> that's the case, the OP could modify their objective
function using the demo
> to which I linked as a guide to use SYSTEM on each of the
workers, running
> the external application on each, and returning the
results back to their
> main MATLAB session; alternately, I don't know of any
inherent reason the
> UseParallel option shouldn't work with an objective
function that calls
> SYSTEM.
>
> --
> Steve Lord
> slord@mathworks.com

Steve

I use the dos() command to call the external application.
The external application then generates an output file with
the evaluated objective function. So I guess you are
probably right. I downloaded psexec and it seems that I can
use that. I am yet to try it for the remote machine. But I
will also look into what you are suggesting.

Thanks
Hema
>
>

Subject: How to run an external application on a different computer from

From: Hema

Date: 24 Jun, 2008 14:19:02

Message: 15 of 17

reza <mjahanbin@gmail.com> wrote in message
<b5498a7c-3e4f-45f2-9d17-91177bacbc8a@w7g2000hsa.googlegroups.com>...
> On Jun 18, 8:19 am, "Hema " <tennisenlighte...@gmail.com>
wrote:
> > "Hema " <tennisenlighte...@gmail.com> wrote in message
> >
> > <g393l6$mg...@fred.mathworks.com>...
> >
> > > I am implementing a GA using MATLAB. My algorithm requires
> > > me to call an external program to compute my objective
> > > function value. Now in order to speed up, I would run this
> > > external application simultaneously on multiple computers.
> > > Right now for a single computer I use a dos command to
call
> > > and run the application. How can I modify this for
multiple
> > > computers.
> >
> > I guess no one replied here. Can I ask another question. Is
> > there a dos command that will allow me to call a program and
> > run it on a different computer. I think this should solve my
> > problem
>
> you need psexec from the pstool set made by sysinternals
(taken over
> by microsoft)
>
> see:
http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx
>
> good luck.
>
> /reza

Hi reza

I downloaded psexec and I used the following command to test
psexec dos('psexec \\remotecomputer cmd'). When I give the
same command at the command prompt it executes it but when I
use the above command it says cmd line exited with error
code 0. I am wondering if there are any changes needed to be
done when using psexec for MATLAB

Thanks
Hema

Subject: How to run an external application on a different computer from

From: reza

Date: 27 Jun, 2008 02:35:29

Message: 16 of 17

On Jun 24, 10:19 am, "Hema " <tennisenlighte...@gmail.com> wrote:
> reza <mjahan...@gmail.com> wrote in message
>
> <b5498a7c-3e4f-45f2-9d17-91177bacb...@w7g2000hsa.googlegroups.com>...
>
> > On Jun 18, 8:19 am, "Hema " <tennisenlighte...@gmail.com>
> wrote:
> > > "Hema " <tennisenlighte...@gmail.com> wrote in message
>
> > > <g393l6$mg...@fred.mathworks.com>...
>
> > > > I am implementing a GA using MATLAB. My algorithm requires
> > > > me to call an external program to compute my objective
> > > > function value. Now in order to speed up, I would run this
> > > > external application simultaneously on multiple computers.
> > > > Right now for a single computer I use a dos command to
> call
> > > > and run the application. How can I modify this for
> multiple
> > > > computers.
>
> > > I guess no one replied here. Can I ask another question. Is
> > > there a dos command that will allow me to call a program and
> > > run it on a different computer. I think this should solve my
> > > problem
>
> > you need psexec from the pstool set made by sysinternals
> (taken over
> > by microsoft)
>
> > see:
>
> http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx
>
>
>
> > good luck.
>
> > /reza
>
> Hi reza
>
> I downloaded psexec and I used the following commandtotest
> psexec dos('psexec \\remotecomputer cmd'). When I give the
> same command at the command prompt it executes it but when I
> use the above command it says cmd line exited with error
> code 0. I am wondering if there are any changes neededtobe
> done when using psexec for MATLAB
>
> Thanks
> Hema

That is the correct behaviour. What are you trying to run on the
remote machine?

/m

Subject: How to run an external application on a different computer from

From: Thomas Clark

Date: 2 Jul, 2008 22:28:01

Message: 17 of 17

Hema,

If the machines are networked (presumably!) and can have
access to a commonly shared directory, you might find it
informative to have a look at the following FEX submission:

http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=13775&objectType=file

(link might get broken)

... You may be able to either use this directly, or do
something similar.

Bit of a different approach to the above suggestions though!

Cheers

Tom Clark

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

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.

Tag Activity for This Thread
Tag Applied By Date/Time
code us 18 Jun, 2008 14:25:13
dos us 18 Jun, 2008 08:47:38
unix us 18 Jun, 2008 08:47:38
punct us 18 Jun, 2008 08:47:38
system us 18 Jun, 2008 08:47:38
reference us 18 Jun, 2008 08:47:38
different computer Hema 17 Jun, 2008 15:40:18
external application Hema 17 Jun, 2008 15:40:18
rssFeed for this Thread

envelope graphic E-mail this page to a colleague

Public Submission Policy
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.
Related Topics