public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rth at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/26943] [gomp] firstprivate not working properly with non-POD
Date: Mon, 01 May 2006 17:58:00 -0000	[thread overview]
Message-ID: <20060501175810.12463.qmail@sourceware.org> (raw)
In-Reply-To: <bug-26943-119@http.gcc.gnu.org/bugzilla/>



------- Comment #7 from rth at gcc dot gnu dot org  2006-05-01 17:58 -------
(In reply to comment #5)
> 1) if we prove the structured block has at least one barrier in between the
> firstprivate and lastprivate code chunks (doesn't matter if explicit #pragma
> omp barrier or some other OMP stuff that acts similarly)
> 2) if the variable is not passed by reference (i.e. scalar put directly into
> .omp_data_*) and we use 2 fields for it rather than one - sender initializes
> first field and firstprivate uses that, then lastprivate sets the second field
> and sender copies from the second field.

Both of these are fairly valuable.

But for when optimization fails, I think adding a specialized construct
for this in libgomp would also be helpful.  Something akin to a semaphore
initialized to -thread_count, such that a wait on the semaphore before the
lastprivate is assured that all the firstprivates are done.  One would expect
that the common case is that they will be done, and the semaphore will take
the unlocked fast-path.

I'll look into adding this.  Since we've already shipped this library in fc5,
do you think it's worthwhile adding it to a new version tag?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26943


  parent reply	other threads:[~2006-05-01 17:58 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-30 15:55 [Bug c++/26943] New: " rth at gcc dot gnu dot org
2006-03-30 15:56 ` [Bug c++/26943] " rth at gcc dot gnu dot org
2006-04-28 15:07 ` jakub at gcc dot gnu dot org
2006-04-29  4:55 ` dnovillo at gcc dot gnu dot org
2006-05-01 12:39 ` dnovillo at gcc dot gnu dot org
2006-05-01 15:15 ` dnovillo at gcc dot gnu dot org
2006-05-01 16:08 ` jakub at gcc dot gnu dot org
2006-05-01 16:11 ` dnovillo at redhat dot com
2006-05-01 17:58 ` rth at gcc dot gnu dot org [this message]
2006-05-02 20:03 ` jakub at gcc dot gnu dot org
2006-05-03 12:23 ` jakub at gcc dot gnu dot org
2006-05-03 12:31 ` jakub at gcc dot gnu dot org
2006-12-05  2:07 ` bergner at vnet dot ibm dot com
2006-12-11  0:37 ` pinskia at gcc dot gnu dot org
2007-03-21 15:43 ` [Bug c++/26943] [gomp] firstprivate + lastprivate uses inefficient barrier rth at gcc dot gnu dot org
2009-09-14 20:39 ` rth at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060501175810.12463.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).