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:
compiled standalone application vs parfor and vectorization

Subject: compiled standalone application vs parfor and vectorization

From: Jveer

Date: 10 Feb, 2009 17:45:04

Message: 1 of 6

can anyone please advise which is the best approach to large variable calculation intensive simulations?

the simulation engine is heavily vectorized but also contains for loops wherever vectorization was impossible. also parfor was used wherever possible.

will standalone application be faster? do standalone applications use multi cores? does it distribute the vectorized calc. among the cores like a parfor loop?

the only thing i know for sure is that for loops run faster on standalone applications

Subject: compiled standalone application vs parfor and vectorization

From: Bruno Luong

Date: 10 Feb, 2009 18:53:02

Message: 2 of 6

"Jveer " <jveer@jveer.com> wrote in message <gmsef0$fm6$1@fred.mathworks.com>...

>
> the only thing i know for sure is that for loops run faster on standalone applications

Strange; I know that it should not have any significant differences between a compiled code or not, unless if the memory starts to swap.

Bruno

Subject: compiled standalone application vs parfor and vectorization

From: Peter Webb

Date: 11 Feb, 2009 15:44:18

Message: 3 of 6

Standalone applications (created with MCC) run at the same speed as
MATLAB-based applications. A long time ago (like in the mid-1990s) loops did
run faster in compiled applications, but that's no longer the case. (MATLAB
got lots faster.)

FYI, applications created with PCT can be compiled. So can PARFOR.
Standalone applications will make use of multiple cores in the same way that
MATLAB does (mostly via the multithreaded math libraries).

"Jveer " <jveer@jveer.com> wrote in message
news:gmsef0$fm6$1@fred.mathworks.com...
> can anyone please advise which is the best approach to large variable
> calculation intensive simulations?
>
> the simulation engine is heavily vectorized but also contains for loops
> wherever vectorization was impossible. also parfor was used wherever
> possible.
>
> will standalone application be faster? do standalone applications use
> multi cores? does it distribute the vectorized calc. among the cores like
> a parfor loop?
>
> the only thing i know for sure is that for loops run faster on standalone
> applications

Subject: compiled standalone application vs parfor and vectorization

From: Jveer

Date: 11 Feb, 2009 22:58:02

Message: 4 of 6

thank you guys. all this is very informative. the reason that i expected for loops to be faster in compiled standalone applications is because of matlab's hopelessly slow interpreter. but i'll take your word for it.

i havent been able to compile parfor, i must be doing something wrong. i guess it must the use of matlabpool.

does anyone know if combining several computers via linux in a beowulf way will work with matlab code without modifying it? i mean in terms of vectorization for e.g. will it split it over all the processors as efficiently as it does on a single machine with multiple cores?

Subject: compiled standalone application vs parfor and vectorization

From: Marcus M. Edvall

Date: 11 Feb, 2009 23:12:20

Message: 5 of 6

Hello,

You might want to take a look at the Star-P platform. Then you can run
your loops in cluster environments.

Best wishes, Marcus
Tomlab Optimization Inc.
http://tomdyn.com/
http://tomsym.com/

Subject: compiled standalone application vs parfor and vectorization

From: Jveer

Date: 12 Feb, 2009 16:59:01

Message: 6 of 6

i've been considering that. in the mean time i'm looking for cheaper alternatives

Tags for this Thread

No tags are associated with 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