[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Using OpenMP in Octave
From: |
Søren Hauberg |
Subject: |
Re: Using OpenMP in Octave |
Date: |
Sun, 28 Mar 2010 22:56:29 -0700 |
man, 29 03 2010 kl. 01:37 +0200, skrev David Bateman:
> I've had a short discussion with Jaroslav and John off list about
> implementing OpenMP multi-threading in Octave and want to bring it back
> to the list. The use of OpenMP with Octave 3.4 will still be too
> experimental and so if we include the code now I propose to make it off
> by default and the changeset I committed on Saturday adds the autoconf
> code to probe for OpenMP support, but only if the "--enable-openmp"
> configure option is used. Currently it only probes for OpenMP support
> for gcc and msvc (though the msvc code is untested).
Interesting.
> However, the value 1000 is arbitrary and a little benchmarking is
> needed. I attach a first experimental changeset for those who want to
> experiment. Configured with "--enable-openmp" and a recent tip this code
> sucessfully run through "make check", but I don't know if the choice of
> array size to switch between single and multithread code is optimal.
>
> A couple of interesting tests might be
>
> n = 300; a = ones(n,n,n);
> tic; sum(a,1); toc
> tic; sum(a,2); toc
> tic; sum(a,3); toc
> n = 999; a = (1+1i)*ones (n,n); tic; a = real(a); toc
> n = 1001; a = (1+1i)*ones (n,n); tic; a = real(a); toc
>
> before and after the change. Unfortunately I'm developing on a atom and
> so I won't personally see much gain from this multi-threading
I tried your changeset and ran the above test with no noticeable
difference in speed (0.0114329 seconds for n = 999 and 0.013583 seconds
for n = 1001) on a dual core laptop.
I tried to increase n to 10000 and still saw no noticeable difference
between using my ordinary 3.3.51+ installation and the OpenMP version.
Do I need to do anything to activate OpenMP when running Octave?
Soren
- Using OpenMP in Octave, David Bateman, 2010/03/28
- Re: Using OpenMP in Octave,
Søren Hauberg <=
- Re: Using OpenMP in Octave, Jaroslav Hajek, 2010/03/29
- Re: Using OpenMP in Octave, Michael D Godfrey, 2010/03/29
- Re: Using OpenMP in Octave, David Bateman, 2010/03/29
- Re: Using OpenMP in Octave, Jaroslav Hajek, 2010/03/30
- Re: Using OpenMP in Octave, David Bateman, 2010/03/30
- Re: Using OpenMP in Octave, Jaroslav Hajek, 2010/03/31
- Re: Using OpenMP in Octave, Kai Habel, 2010/03/29
Re: Using OpenMP in Octave, Michael Goffioul, 2010/03/29