public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgomp/40494]  New: omp for loop with guided schedule fails to terminate in certain cases
@ 2009-06-19 16:47 per at bitempire dot com
  2009-07-10 10:43 ` [Bug libgomp/40494] " jakub at gcc dot gnu dot org
  2009-07-28 11:23 ` per at bitempire dot com
  0 siblings, 2 replies; 3+ messages in thread
From: per at bitempire dot com @ 2009-06-19 16:47 UTC (permalink / raw)
  To: gcc-bugs

The following loop, which seems valid according to the OpenMP specification
v2.5 and 3.0 fails to terminate:

int x;
#pragma omp parallel for schedule(guided)
for(x = 3; x < 478; x += 2) {
  ...
}

I've tested with two and eight threads and different chunksizes, with the same
non-termination result. Changing the upper bound to 477, however, makes the
loop terminate, which leads me to belive this is an issue in the GNU OpenMP
runtime library.

I have confirmed that the problems exists in 4.2, 4.3 and 4.5 (trunk,
19-06-09). To me,  bug 35625 seems somewhat similar but was supposedly fixed in
4.3.

/Per


-- 
           Summary: omp for loop with guided schedule fails to terminate in
                    certain cases
           Product: gcc
           Version: 4.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libgomp
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: per at bitempire dot com
 GCC build triplet: i686-pc-linux
  GCC host triplet: i686-pc-linux
GCC target triplet: i686-pc-linux


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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug libgomp/40494] omp for loop with guided schedule fails to terminate in certain cases
  2009-06-19 16:47 [Bug libgomp/40494] New: omp for loop with guided schedule fails to terminate in certain cases per at bitempire dot com
@ 2009-07-10 10:43 ` jakub at gcc dot gnu dot org
  2009-07-28 11:23 ` per at bitempire dot com
  1 sibling, 0 replies; 3+ messages in thread
From: jakub at gcc dot gnu dot org @ 2009-07-10 10:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from jakub at gcc dot gnu dot org  2009-07-10 10:43 -------
Sorry, can't reproduce this.

extern void abort (void);

int
main (void)
{
  int x, y = 0;
  #pragma omp parallel for schedule(guided) reduction(+:y)
  for (x = 3; x < 478; x += 2)
    y++;
  if (y != 238)
    abort ();
  return 0;
}

works just fine with current 4.4 or trunk, both x86_64-linux -m32 and -m64,
OMP_NUM_THREADS={1,2,4,8,16,32,64}.  Are you sure you were not testing
everything against gcc 4.2 libgomp.so?


-- 


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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug libgomp/40494] omp for loop with guided schedule fails to terminate in certain cases
  2009-06-19 16:47 [Bug libgomp/40494] New: omp for loop with guided schedule fails to terminate in certain cases per at bitempire dot com
  2009-07-10 10:43 ` [Bug libgomp/40494] " jakub at gcc dot gnu dot org
@ 2009-07-28 11:23 ` per at bitempire dot com
  1 sibling, 0 replies; 3+ messages in thread
From: per at bitempire dot com @ 2009-07-28 11:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from per at bitempire dot com  2009-07-28 11:23 -------
Sorry, you're right - it works fine with gcc 4.3 and later. I must have
accidentally linked to libgomp 4.2 which is a part of llvm-gcc.

I apologize for the inconvenience.


-- 

per at bitempire dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-07-28 11:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-19 16:47 [Bug libgomp/40494] New: omp for loop with guided schedule fails to terminate in certain cases per at bitempire dot com
2009-07-10 10:43 ` [Bug libgomp/40494] " jakub at gcc dot gnu dot org
2009-07-28 11:23 ` per at bitempire dot com

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).