Gentoo Archives: gentoo-user

From: Peter Weilbacher <newsspam@××××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] openmp flag
Date: Fri, 28 Sep 2012 10:22:28
Message-Id: 38ae79bf10ba715689ceb4aabb34d1f1@weilbacher.org
In Reply to: Re: [gentoo-user] openmp flag by Florian Philipp
1 On 2012-09-26 20:25, Florian Philipp wrote:
2 > Am 25.09.2012 17:01, schrieb Michael Mol:
3 >> On Tue, Sep 25, 2012 at 10:42 AM, James <wireless@×××××××××××.com>
4 >> wrote:
5 >>> OH, anyone is encouraged to "chime in" about openmp
6 >>> and your thoughts as to it's viability and usefulness.
7 >>> Do you believe it will become a core technology,
8 >>> embedded into GCC? Used widely?
9
10 I didn't understand this statement. It is a core "technology" and has
11 been
12 part of GCC since 4.2 or so. I certainly have used it since several
13 years
14 in some of my projects. But it certainly needs some little
15 modifications
16 to the code to work.
17
18 >> If you can use it, use it. OpenMP is little more than a set of
19 >> extensions to C (and C++) which allows the normally-scalar language
20 >> to
21 >> do some things in a parallel fashion without resorting to the costs
22 >> of
23 >> multithreading. This is good, because vector instructions have been
24 >> available in x86 since MMX came out, and improvements to the vector
25 >> instructions available to x86 still goes on.
26 >
27 > I guess this is just poorly phrased but to clarify: OpenMP *does* use
28 > multithreading and nothing else. It does not, in any way, make more
29 > use
30 > of vector instructions than GCC without -fopenmp. I guess what you
31 > mean
32 > is avoiding the costs of *manual* multithreading using POSIX threads
33 > and
34 > the like.
35
36 To get GCC to try and use vectorization pass -ftree-vectorize.
37 (You can see what loops it optimized using vectorization with
38 -ftree-vectorizer-verbose=1).
39
40 Cheers,
41 Peter.