help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Run and interface external program compiled with ICC (NOT mkoctfile!


From: Przemek Klosowski
Subject: Re: Run and interface external program compiled with ICC (NOT mkoctfile!)
Date: Tue, 29 Jun 2010 12:24:00 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.10) Gecko/20100621 Fedora/3.0.5-1.fc13 Lightning/1.0b1 Thunderbird/3.0.5

On 06/29/2010 11:52 AM, Carlos222 wrote:


Well, the matrix operations in Octave are usually as fast or faster than
matlab. You have to make sure that you use an optimized BLAS library, of
course. Octave lags when your .m code uses explicit loops
(for, while...), accessing the data element-by-element. The usual cure
for that is rewriting the .m code to vectorize it. If you can't
vectorize, only then you'd rewrite it in compiled language.

You should run some speed tests for your code; use tic/toc and/or
cputime functions to measure the speed of operations that matter to you.

Dear Przemek,
Thank you for your suggestion. I have a good experience in programing for
Matlab. For sure all my code is already vectorized.

OK, great then---I didn't know what level of experience you have. Still, it may be a good idea to show your code to this mailing list: people here keep coming up with non-obvious tricks for speedups that
I would certainly miss.


Octave has excellent library interface, so you can write your
computational kernel and compile it into an Octave-loadable native
binary module (an .oct file); you'd then write the I/O and
pre/post-processing in the interpreted language (.m files), and then
call out your binary computation code, passing the data into and out of it
using Octave data API. There have been good examples of that on this
l>ist, even quite recently.

By the other hand, I dont have the same experience with compiled languages.
I am afraid that if I use the mocktave I will not be able to use some
features like the automatic parallelization present in the intel compilers.
So what is your opinion ?

Jaroslav's idea is probably the best: recompile Octave with ICC/MKL,
write your kernel in octave API and compile it in the same environment, so that it works with the main Octave.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]