This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/32467] structure containing allocatable array is accepted in COPYIN clause
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Jun 2007 21:06:59 -0000
- Subject: [Bug fortran/32467] structure containing allocatable array is accepted in COPYIN clause
- References: <bug-32467-14710@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from burnus at gcc dot gnu dot org 2007-06-22 21:06 -------
Thanks for the report.
(By the way, ifort does accept the program and gives the right result whereas
sunf95 has the same problem as gfortran.)
There are actually two problems:
a) "Allocatable arrays may not appear in a copyin clause."
This is violated for copyin(struc1)
One should at least print a warning with -Wall, but I'm not sure
whether one need to reject it as GCC seems to do the right thing (cf. (b))
b) If one replaces the "allocatable :: a(:)" by "a(2)" this constrain is met,
but the number of threads is still (one thread per CPU core online) instead
of being omp_set_num_threads(4).
Reading and re-reading 2.4.1 I fail to find the place which says that with
omp_set_dynamic(.true.)
omp_set_num_threads(4)
the number of threads is guaranteed to be 4. Using omp_set_dynamic(.false.) the
situation is clear and gfortran (and sunf95) produce the same result.
I have the feeling that the result of gfortran is perfectly valid.
ifort seems to default for dyn-var = true to the specified number number of
processors whereas sunf95 and gfortran seem to use min(CPU cores online,
specified num_threads).
--
burnus at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu dot org
URL| |http://www.openmp.org/drupal
| |/mp-documents/spec25.pdf
Keywords|accepts-invalid |wrong-code
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32467