This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libgomp/25162] New: Issue with OpenMP COPYIN and gfortran


export OMP_NUM_THREADS=2

gfortran-gomp -v Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/usr/local/gomp
--program-suffix=-gomp --enable-threads=posix --enable-languages=c,c++,fortran
Thread model: posix
gcc version 4.2.0-gomp-20050608-branch 20051126 (experimental) (merged
20051124)

It seems as if the COPYIN statement is never executed in this test-program.

      PROGRAM TEST4
C
      CALL TEST1
C
      CALL TEST2
C
      END
C
      SUBROUTINE TEST1
C
      DOUBLE PRECISION BPRIM
      COMMON /TESTCOM/ BPRIM(100)
C$OMP THREADPRIVATE(/TESTCOM/)
C
      INTEGER I
C
      DO I = 1, 100
         BPRIM( I ) = DBLE( I )
      END DO
C
      RETURN
      END
C
      SUBROUTINE TEST2
C
      DOUBLE PRECISION BPRIM
      COMMON /TESTCOM/ BPRIM(100)
C$OMP THREADPRIVATE(/TESTCOM/)
C
      INTEGER I, IDUM(50)
C
      DO I = 1, 50
         IDUM(I) = I
      END DO
C
C$OMP PARALLEL COPYIN(/TESTCOM/)
C
      CALL TEST3
C$OMP END PARALLEL
C
      RETURN
      END
C
      SUBROUTINE TEST3
C
      DOUBLE PRECISION BPRIM
      COMMON /TESTCOM/ BPRIM(100)
C$OMP THREADPRIVATE(/TESTCOM/)
C
      INTEGER K
C
      DO K = 1, 10
         PRINT *,K,BPRIM(K)
      END DO
C
      RETURN
      END

Running it produces the following results:
           1   0.00000000000000
           2   0.00000000000000
           3   0.00000000000000
           4   0.00000000000000
           5   0.00000000000000
           6   0.00000000000000
           7   0.00000000000000
           8   0.00000000000000
           9   0.00000000000000
          10   0.00000000000000
           1   1.00000000000000
           2   2.00000000000000
           3   3.00000000000000
           4   4.00000000000000
           5   5.00000000000000
           6   6.00000000000000
           7   7.00000000000000
           8   8.00000000000000
           9   9.00000000000000
          10   10.0000000000000

Running it on Intel FORTRAN 9 produces more expected results:
           1   1.00000000000000
           2   2.00000000000000
           3   3.00000000000000
           4   4.00000000000000
           5   5.00000000000000
           6   6.00000000000000
           7   7.00000000000000
           8   8.00000000000000
           9   9.00000000000000
          10   10.0000000000000
           1   1.00000000000000
           2   2.00000000000000
           3   3.00000000000000
           4   4.00000000000000
           5   5.00000000000000
           6   6.00000000000000
           7   7.00000000000000
           8   8.00000000000000
           9   9.00000000000000
          10   10.0000000000000


-- 
           Summary: Issue with OpenMP COPYIN and gfortran
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libgomp
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: magnus_os at yahoo dot se


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]