public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/45430] New: segfault in OMP code with threadprivate and copyin
@ 2010-08-27 18:29 longb at cray dot com
2010-08-27 18:32 ` [Bug fortran/45430] " longb at cray dot com
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: longb at cray dot com @ 2010-08-27 18:29 UTC (permalink / raw)
To: gcc-bugs
For this version:
> gfortran -v
Using built-in specs.
COLLECT_GCC=/opt/gcc/4.5.0/bin/../snos/bin/gfortran
COLLECT_LTO_WRAPPER=/opt/gcc/4.5.0/snos/libexec/gcc/x86_64-suse-linux/4.5.0/lto-wrapper
Target: x86_64-suse-linux
Configured with: ../xt-gcc-4.5.0/configure --prefix=/opt/gcc/4.5.0/snos
--disable-nls --libdir=/opt/gcc/4.5.0/snos/lib --enable-languages=c,c++,fortran
--with-gxx-include-dir=/opt/gcc/4.5.0/snos/include/g++
--with-slibdir=/opt/gcc/4.5.0/snos/lib --with-system-zlib --enable-shared
--enable-__cxa_atexit x86_64-suse-linux --with-mpc=/opt/gcc/mpc/0.8.1
--with-mpfr=/opt/gcc/mpfr/2.4.2 --with-gmp=/opt/gcc/gmp/4.3.2 --with-sysroot=
Thread model: posix
gcc version 4.5.0 20100414 (Cray Inc.) (GCC)
And this compile script:
> cat compile.gnu
ftn -fopenmp -c mod_init_openmp.f90
ftn -fopenmp -c mod_globals.f90
ftn -fopenmp -c mod_mysubs.f90
ftn -fopenmp -c mod_display_arrays.f90
ftn -fopenmp mod_init_openmp.o mod_globals.o mod_mysubs.o mod_display_arrays.o
test_loop1.f90
> ./a.out.gnu
Running on 2 threads
Iteration = 0
After sub1:
Array = pb
2.000 2.000 2.000 2.000
2.000
2.000 2.000 2.000 2.000
2.000
2.000 2.000 2.000 2.000
2.000
2.000 2.000 2.000 2.000
2.000
......
After sub2:
Array = out2
68.000 68.000 68.000 68.000
68.000
68.000 68.000 68.000 68.000
68.000
68.000 68.000 68.000 68.000
68.000
68.000 68.000 68.000 68.000
68.000
Iteration = 6
Segmentation fault
--
Summary: segfault in OMP code with threadprivate and copyin
Product: gcc
Version: 4.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: longb at cray dot com
GCC build triplet: x86_64-suse-linux
GCC host triplet: x86_64-suse-linux
GCC target triplet: x86_64-suse-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45430
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug fortran/45430] segfault in OMP code with threadprivate and copyin
2010-08-27 18:29 [Bug fortran/45430] New: segfault in OMP code with threadprivate and copyin longb at cray dot com
@ 2010-08-27 18:32 ` longb at cray dot com
2010-08-27 18:36 ` longb at cray dot com
2010-08-28 10:02 ` jakub at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: longb at cray dot com @ 2010-08-27 18:32 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from longb at cray dot com 2010-08-27 18:31 -------
Comments from original submitter:
A [deleted] user has given me the following code which fails with gcc/4.5.0.
The
code is OK with PGI and CCE. The problem seems to come about from the use of
threadprivate in mod_globals.f90 and using the loop with the copyin clause in
test_loop1.f90. If the threadprivate is commented out, and the copyin replaced
with a private clause, all is well.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45430
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug fortran/45430] segfault in OMP code with threadprivate and copyin
2010-08-27 18:29 [Bug fortran/45430] New: segfault in OMP code with threadprivate and copyin longb at cray dot com
2010-08-27 18:32 ` [Bug fortran/45430] " longb at cray dot com
@ 2010-08-27 18:36 ` longb at cray dot com
2010-08-28 10:02 ` jakub at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: longb at cray dot com @ 2010-08-27 18:36 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from longb at cray dot com 2010-08-27 18:36 -------
Created an attachment (id=21579)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21579&action=view)
Test case, including source files and compile script
Attached tar.gz file contains the source files and the compile.gnu script.
Compilation completes, but execution of the a.out results in segfault.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45430
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug fortran/45430] segfault in OMP code with threadprivate and copyin
2010-08-27 18:29 [Bug fortran/45430] New: segfault in OMP code with threadprivate and copyin longb at cray dot com
2010-08-27 18:32 ` [Bug fortran/45430] " longb at cray dot com
2010-08-27 18:36 ` longb at cray dot com
@ 2010-08-28 10:02 ` jakub at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: jakub at gcc dot gnu dot org @ 2010-08-28 10:02 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from jakub at gcc dot gnu dot org 2010-08-28 10:02 -------
This is invalid.
See OpenMP 3.0, 2.9.4.1, COPYIN restrictions on page 102, lines 17-18:
An array with the ALLOCATABLE attribute must be in the allocated state. Each
thread's copy of that array must be allocated with the same bounds.
In the testcase pb isn't in allocated state.
See also http://openmp.org/forum/viewtopic.php?f=5&t=7&start=10#p292
for more details.
I hope this is going to be changed for OpenMP 3.1, when its draft is released,
we'll implement it the way it is written there.
--
jakub at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45430
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-08-28 10:02 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-27 18:29 [Bug fortran/45430] New: segfault in OMP code with threadprivate and copyin longb at cray dot com
2010-08-27 18:32 ` [Bug fortran/45430] " longb at cray dot com
2010-08-27 18:36 ` longb at cray dot com
2010-08-28 10:02 ` 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).