octave-maintainers
[Top][All Lists]
Advanced

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

Re: Enabling OpenMP by default


From: John W. Eaton
Subject: Re: Enabling OpenMP by default
Date: Sun, 10 Mar 2013 17:03:31 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.11) Gecko/20121122 Icedove/10.0.11

On 03/10/2013 04:50 PM, Júlio Hoffimann wrote:
Dear all,

Any complaints about enabling OpenMP by default? The current source tree
is free of associated #pragma directives.

I'm trying to add some (very local) parallel regions to see if we gain
any burst in performance. The first patch is almost done and it raises a
question on warning handling i've asked John and Jordi for their opinion:

For every occurrence (239 so far) of a parallel region we ideally want
the pragma to be wrapped by a #ifdef directive (e.g. #if
defined(_OPENMP) ... #endif), but this would cause an unacceptable
decrease in readability since 239*3 = 717 new lines of boilerplate. The
number of regions is that high because the array classes don't satisfy
the DRY principle, and probably can't.

DRY?

OpenMP pragmas are simply ignored by the compiler when the `-fopenmp'
flag is omitted and the code remains as if untouched. The only
consequence is a warning (e.g. warning: ignored #pragma omp). If we
enable OpenMP by default, people won't see these warnings unless they
explicitly disable the flag through configure similar to what is done
today (i.e. --enable-openmp).

It may be OK to enable it by default, but I would prefer to have
--enable-openmp also define a macro like OCTAVE_OPENMP_ENABLED and
then use

  #if defined (OCTAVE_OPENMP_ENABLED)
  #pragma whatever
  #endif

in the sources, even if this means more lines of code, becuase I'd
like for --disable-openmp to completely disable the feature and not
cause a lot of warnings to be generated.

jwe


reply via email to

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