[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: OpenMP in oct files
From: |
Daniel Kraft |
Subject: |
Re: OpenMP in oct files |
Date: |
Mon, 23 Sep 2013 11:17:20 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0 |
Hi Mike,
On 2013-09-23 05:01, Mike Puglia wrote:
> I don't remember that I had exactly the error you're having below, but I
> had a few problems getting OpenMP to work in oct files as well, even
> after trying some of the same posts. I use the mingw build. Ultimately
> I had to compile all the OpenMP functionality into a static library
> using gcc directly (with -fopenmp flag in the command line). Then I
> wrote an octfile wrapper around the exposed library function, so that
> mkoctfile was more or less blind to the OpenMP functionality. At the
> mkoctfile command line, I just included the static library and -lgomp
> during linking and everything worked fine from there.
thanks for your tips! I indeed managed to fix my error by compiling the
OpenMP code directly with g++ instead of mkoctfile and linking it as a
shared library. (The same approach also worked fine for me when I
played around with CUDA in oct-files.)
Unfortunately, the parallel code sometimes crashes or is at least not
any faster than the single-threaded version. My code, also the one that
is in a parallel OpenMP loop, uses liboctave's Matrix and vector classes
-- I presume my problems arise because Octave is not thread-safe. Is
this a likely explanation, even when I don't need any of the
higher-level things (files, symbol table, ...) in Octave but just the
basic octave_value classes? Is there a way to make it work, or do I
have to use re-implement the parallel code without relying on liboctave
at all?
Yours,
Daniel
--
http://www.domob.eu/
--
Done: Arc-Bar-Cav-Hea-Kni-Ran-Rog-Sam-Tou-Val-Wiz
To go: Mon-Pri