public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgomp/35881] New: OMP atypical results for omp_get_max_threads
@ 2008-04-09 7:48 jv244 at cam dot ac dot uk
2008-04-09 8:08 ` [Bug libgomp/35881] " jv244 at cam dot ac dot uk
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: jv244 at cam dot ac dot uk @ 2008-04-09 7:48 UTC (permalink / raw)
To: gcc-bugs
The following test program returns 1 for omp_get_max_threads in a parallel
region. This is different from what I get with three other compilers, and hence
somewhat unexpected. Is this correct, and if so, should it be the default?
> gfortran -v
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: /data03/vondele/gcc_4_3_0_release/gcc-4.3.0/configure
--prefix=/ext/software/64/gfortran-suite/gcc-4.3.0
--enable-languages=c,c++,fortran
Thread model: posix
gcc version 4.3.0 (GCC)
SUBROUTINE TEST()
IMPLICIT NONE
INTEGER :: ithread,nthread,mthread
!$ INTEGER :: omp_get_thread_num, omp_get_max_threads, omp_get_num_threads
ithread=0
nthread=1
mthread=1
!$ nthread=omp_get_max_threads()
write(6,*) ithread,nthread,mthread
!$OMP PARALLEL PRIVATE(ithread,nthread,mthread)
!$ nthread=omp_get_max_threads()
!$ mthread=omp_get_num_threads()
!$ ithread=omp_get_thread_num()
!$OMP CRITICAL
write(6,*) ithread,nthread,mthread
!$OMP END CRITICAL
!$OMP END PARALLEL
END SUBROUTINE TEST
CALL TEST()
END
IBM:
vondele@blanc161:~> xlf90_r -qsuffix=f=f90 -O3 -qsmp=omp test.f90
** test === End of Compilation 1 ===
** _main === End of Compilation 2 ===
1501-510 Compilation successful for file test.f90.
vondele@blanc161:~> ./a.out
0 4 1
0 4 4
1 4 4
3 4 4
2 4 4
vondele@pcihopt3:/data03/vondele/openmp> pgf90 -openmp test.f90
vondele@pcihopt3:/data03/vondele/openmp> ./a.out
0 4 1
0 4 4
1 4 4
2 4 4
3 4 4
vondele@pcihopt3:/data03/vondele/openmp> ifort -O0 -openmp test.f90
test.f90(13): (col. 7) remark: OpenMP DEFINED REGION WAS PARALLELIZED.
vondele@pcihopt3:/data03/vondele/openmp> ./a.out
0 4 1
0 4 4
1 4 4
2 4 4
3 4 4
vondele@pcihopt3:/data03/vondele/openmp> gfortran -O0 -fopenmp test.f90
vondele@pcihopt3:/data03/vondele/openmp> ./a.out
0 4 1
0 1 4
1 1 4
2 1 4
3 1 4
--
Summary: OMP atypical results for omp_get_max_threads
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libgomp
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jv244 at cam dot ac dot uk
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35881
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug libgomp/35881] OMP atypical results for omp_get_max_threads
2008-04-09 7:48 [Bug libgomp/35881] New: OMP atypical results for omp_get_max_threads jv244 at cam dot ac dot uk
@ 2008-04-09 8:08 ` jv244 at cam dot ac dot uk
2008-04-09 10:59 ` [Bug libgomp/35881] OMP wrong " jv244 at cam dot ac dot uk
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: jv244 at cam dot ac dot uk @ 2008-04-09 8:08 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from jv244 at cam dot ac dot uk 2008-04-09 08:07 -------
reading a bit more, this seems a real bug.
Can this be fixed for 4.3, pretty please ?
--
jv244 at cam dot ac dot uk changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |wrong-code
Summary|OMP atypical results for |OMP atypical results for
|omp_get_max_threads |omp_get_max_threads
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35881
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug libgomp/35881] OMP wrong results for omp_get_max_threads
2008-04-09 7:48 [Bug libgomp/35881] New: OMP atypical results for omp_get_max_threads jv244 at cam dot ac dot uk
2008-04-09 8:08 ` [Bug libgomp/35881] " jv244 at cam dot ac dot uk
@ 2008-04-09 10:59 ` jv244 at cam dot ac dot uk
2008-04-09 13:32 ` jv244 at cam dot ac dot uk
2008-06-11 6:49 ` jakub at gcc dot gnu dot org
3 siblings, 0 replies; 5+ messages in thread
From: jv244 at cam dot ac dot uk @ 2008-04-09 10:59 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from jv244 at cam dot ac dot uk 2008-04-09 10:58 -------
also confirmed for trunk
--
jv244 at cam dot ac dot uk changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to fail|4.2.3 4.3.0 |4.2.3 4.3.0 4.4.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35881
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug libgomp/35881] OMP wrong results for omp_get_max_threads
2008-04-09 7:48 [Bug libgomp/35881] New: OMP atypical results for omp_get_max_threads jv244 at cam dot ac dot uk
2008-04-09 8:08 ` [Bug libgomp/35881] " jv244 at cam dot ac dot uk
2008-04-09 10:59 ` [Bug libgomp/35881] OMP wrong " jv244 at cam dot ac dot uk
@ 2008-04-09 13:32 ` jv244 at cam dot ac dot uk
2008-06-11 6:49 ` jakub at gcc dot gnu dot org
3 siblings, 0 replies; 5+ messages in thread
From: jv244 at cam dot ac dot uk @ 2008-04-09 13:32 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from jv244 at cam dot ac dot uk 2008-04-09 13:31 -------
I decided to ask, and maybe it is correct anyway, even though I have not fully
followed the bit on 'nthreads-var'
http://www.openmp.org/forum/viewtopic.php?f=3&t=100
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35881
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug libgomp/35881] OMP wrong results for omp_get_max_threads
2008-04-09 7:48 [Bug libgomp/35881] New: OMP atypical results for omp_get_max_threads jv244 at cam dot ac dot uk
` (2 preceding siblings ...)
2008-04-09 13:32 ` jv244 at cam dot ac dot uk
@ 2008-06-11 6:49 ` jakub at gcc dot gnu dot org
3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-06-11 6:49 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from jakub at gcc dot gnu dot org 2008-06-11 06:48 -------
Fixed on the trunk as part of the OpenMP 3.0 support.
--
jakub at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35881
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-06-11 6:49 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-09 7:48 [Bug libgomp/35881] New: OMP atypical results for omp_get_max_threads jv244 at cam dot ac dot uk
2008-04-09 8:08 ` [Bug libgomp/35881] " jv244 at cam dot ac dot uk
2008-04-09 10:59 ` [Bug libgomp/35881] OMP wrong " jv244 at cam dot ac dot uk
2008-04-09 13:32 ` jv244 at cam dot ac dot uk
2008-06-11 6:49 ` jakub at gcc dot gnu dot org
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).