From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-user+bounces-141644-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	by finch.gentoo.org (Postfix) with ESMTP id 7D7E9138010
	for <garchives@archives.gentoo.org>; Tue, 25 Sep 2012 15:04:04 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id B245121C0EF;
	Tue, 25 Sep 2012 15:03:40 +0000 (UTC)
Received: from mail-ee0-f53.google.com (mail-ee0-f53.google.com [74.125.83.53])
	by pigeon.gentoo.org (Postfix) with ESMTP id 4AA3821C04C
	for <gentoo-user@lists.gentoo.org>; Tue, 25 Sep 2012 15:01:52 +0000 (UTC)
Received: by eekd17 with SMTP id d17so1739722eek.40
        for <gentoo-user@lists.gentoo.org>; Tue, 25 Sep 2012 08:01:52 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=mime-version:in-reply-to:references:date:message-id:subject:from:to
         :content-type;
        bh=YsIn4CCHf974ALI0OkQGNUdajZtV25FcYOhCj8GZ/Dg=;
        b=UAeNRPmTa8p7tDNNiXja1IwrRssn7z65++qWF7JIP7Gas0rYvwOo60rhtAlwSBGHhD
         dcktji2sqk3JnnGc1h2M6dSuaJi7zm+K/sY9ewoKPbTCmp+GIEPCiM0hOzjF00S9odHa
         8souqGsZP+sJb6jNlHM6DXmQ4a8sQ+L1CA7JczRuHtGsHhDLqHep9yr1zfb+kCtQ032S
         efTtCfSPsv9lG6wq/SMXmAiGnWRNeOzXAwyAhuRcnqOtkwvAIlD9udo+7MdpmdqaokZ0
         h2NDDiwchE4aw167nKHFpKJQo3mLD/HyvF0RuorGfYmMjf9q2dv0IBO5pUvD/5Iyb/A7
         TnIw==
Precedence: bulk
List-Post: <mailto:gentoo-user@lists.gentoo.org>
List-Help: <mailto:gentoo-user+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-user+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-user+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-user.gentoo.org>
X-BeenThere: gentoo-user@lists.gentoo.org
Reply-to: gentoo-user@lists.gentoo.org
MIME-Version: 1.0
Received: by 10.14.221.197 with SMTP id r45mr20816575eep.41.1348585312469;
 Tue, 25 Sep 2012 08:01:52 -0700 (PDT)
Received: by 10.204.112.211 with HTTP; Tue, 25 Sep 2012 08:01:52 -0700 (PDT)
In-Reply-To: <loom.20120925T162813-941@post.gmane.org>
References: <loom.20120925T162813-941@post.gmane.org>
Date: Tue, 25 Sep 2012 11:01:52 -0400
Message-ID: <CA+czFiDTa6DSD0ho7znz3QzkTCfHpSxNWhDYtCDO6fc+unX7iQ@mail.gmail.com>
Subject: Re: [gentoo-user] openmp flag
From: Michael Mol <mikemol@gmail.com>
To: gentoo-user@lists.gentoo.org
Content-Type: text/plain; charset=UTF-8
X-Archives-Salt: 967f2bfb-d21a-49bf-a9ad-7f3901146a17
X-Archives-Hash: 52e17767bf81b0bc649d007121af046b

On Tue, Sep 25, 2012 at 10:42 AM, James <wireless@tampabay.rr.com> wrote:
> Hello,
>
> background:
> It seems there is a major push now to put openmp:
> [1,2] into  embedded systems [3].
>
> So I looked at these [4] packages to find something
> interesting to look deeper into related to openMP.
>
> Blender immediately jumped out at me as a good example,
> cause an old friend Ken Hughes is, imho, one of the
> world's most amazing C programmers, and a stalwart at
> the blender project.
>
>
> OK, here's the question, I went to emerge blender
> and found that the openmp flag is already set. {?}
> Yet I looked everywhere and did not see the openmp flag
> set (/etc/make.conf, /etc/portage/package.use)
> so where is it getting set on my AMD workstation?
>
> [ebuild  N     ] media-gfx/blender-2.49b-r2  USE="ffmpeg
>  nls ogg openmp -blender-game -openal -verse"
>
> I feel like I should know (profiles etc) but, I'm a little
> bit brain_dead this am, so any help is appreciated.

Packages can choose to have USE flags enabled or disabled for them by
default. So blender likely has openmp enabled by default, without that
affecting any other packages.

>
> OH, anyone is encouraged to "chime in" about openmp
> and your thoughts as to it's viability and usefulness.
> Do you believe it will become a core technology,
> embedded into GCC? Used widely?

If you can use it, use it. OpenMP is little more than a set of
extensions to C (and C++) which allows the normally-scalar language to
do some things in a parallel fashion without resorting to the costs of
multithreading. This is good, because vector instructions have been
available in x86 since MMX came out, and improvements to the vector
instructions available to x86 still goes on.

Related are CUDA and OpenCL, which are two other systems for
parallelizing code. CUDA assumes you have access to an nVidia GPU (and
have a CUDA-enabled driver installed). OpenCL is a big more generic,
and supports dispatching to CUDA, CPU vector instructions or even
thread pools.

Personally, my recommendation is to enable everything you can get
working (be it, OpenMP, CUDA or OpenCL); vector processing is going to
be generally more efficient than scalar processing. You don't need to
worry about which is better unless you're a software developer. (And
if you're a software developer, go study up on their differences;
tradeoffs happen.)

-- 
:wq