[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Run and interface external program compiled with ICC (NOT mkoctfile
Re: Run and interface external program compiled with ICC (NOT mkoctfile!)
Tue, 29 Jun 2010 07:34:38 +0200
On Mon, Jun 28, 2010 at 6:31 PM, Carlos222 <address@hidden> wrote:
> Dear colleagues.
> I need your help. I have a code in matlab that now I implement in the
> Octave. As you should know the octave for many operations using matrix is
> much slower than matlab.
No, this is not true in general. For linear algebra, the speed of
Octave operations is a matter of BLAS/LAPACK speed. In fact, Octave
(3.3.51+) makes better use of BLAS than Matlab in certain cases.
> Anyway, I am intend to take the slowest part of my
> code and compile using the intel compiler and the intel MKL (math kernel
> libraries) using all the advantageous of the parallelization in my core i7
A possibly better approach is to compile Octave (the development
sources, if you want top speed) with icc and link it against MKL. I'm
using this configuration regularly (with multithreaded MKL) and the
results are very good.
> The compile program should receive a vector as input and gives
> another longer vector as output. My first idea was using files in the hard
> disk to interface the program with octave. Something like :
> "save input_file.txt"
> "wait sometime or check the output_file.txt"
> "load the output_file.txt"
> The problem is that this part of the program that I want to compile will run
> thousand of times and this read/write in disk can make everything slower...
> My question is: Is there some more intelligent (and hopefully easy) way to
> do this interface without write/read in the disk?
If you work on a UNIX-like OS, use popen2 + binary fread/fwrite, that
is generally the fastest way to IPC from Octave. Another approach is
to create a compiled function, so that data need not be transferred
But, as I said, if this is about speed of matrix ops, linking Octave
with MKL will give you much more power.
RNDr. Jaroslav Hajek, PhD
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic