public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/49159] New: OpenMP compilation errors
@ 2011-05-25 13:45 Jose.Pascual-Gutierr@1-ACT.com
  2011-05-25 14:11 ` [Bug fortran/49159] " burnus at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Jose.Pascual-Gutierr@1-ACT.com @ 2011-05-25 13:45 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: OpenMP compilation errors
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: Jose.Pascual-Gutierr@1-ACT.com


I have the following OpenMP Fortran95 test program called test.f90. 

PROGRAM test
USE OMP_LIB, ONLY: OMP_SET_NUM_THREADS
IMPLICIT NONE

  INTEGER, PARAMETER :: numthreds = 4
  INTEGER, PARAMETER :: maxnumber = 12
  INTEGER :: totalsum, add, number

  CALL OMP_SET_NUM_THREADS (numthreads)
  totalsum = 0
  add = 1

  !$OMP PARALLEL DO  &
  !$OMP SCHEDULE(DYNAMIC,1) &
  !$OMP DEFAULT(SHARED)     &
  !$OMP PRIVATE(number1,    &
                number2)    &
  !$OMP REDUCTION(+:totalsum)
  DO nunmber = 1, maxnumber
    totalsum = add + totalsum + number
  END DO
  !$OMP END PARALLEL DO
  WRITE (*,*) totalsum

END PROGRAM test

I try to compile it with the command "gfortran -fopenmp test.f90". The compiler
returns with the following error message:

test.f90:16.24:

  !$OMP PRIVATE(number1,  &
                        1 
Error: Syntax error in OpenMP variable list at (1)
test.f90:17.16:

                number2)  &
                1
Error: Unclassifiable statement at (1)
test.f90:18.8:

  !$OMP REDUCTION(+:totalsum)
        1
Error: Unclassifiable OpenMP directive at (1)
test.f90:24.23:

  !$OMP END PARALLEL DO
                       1
Error: Unexpectged !$OMP END PARALLEL DO statement at (1)

It is clear that the erros are caused by the !$OMP PRIVATE line. It seems that
a list of variables cannot be broken in two lines. Had I had 
  !$OMP PRIVATE(number1,number2) &
instead of the two lines connected with the & sign, I would have not had any
compilation errors. I wanted to try breaking the line, though, because in my
codes I have very long lists of private variables. In the previous compiler I
used, namely Intel's ifort, I had no issues. Do you have any suggestions when
it comes to long lists of private variables? Should I simply have several
 !$OMP PRIVATE ([var1],[var2],...,[varn])
lines each opening and closing the bracket?

Thank you very much


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

* [Bug fortran/49159] OpenMP compilation errors
  2011-05-25 13:45 [Bug fortran/49159] New: OpenMP compilation errors Jose.Pascual-Gutierr@1-ACT.com
@ 2011-05-25 14:11 ` burnus at gcc dot gnu.org
  2011-05-25 14:32 ` burnus at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-05-25 14:11 UTC (permalink / raw)
  To: gcc-bugs

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

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |burnus at gcc dot gnu.org

--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-05-25 14:10:06 UTC ---
(In reply to comment #0)
>   !$OMP PRIVATE(number1,    &
>                 number2)    &

> The compiler returns with the following error message:
>   !$OMP PRIVATE(number1,  &
>                         1 
> Error: Syntax error in OpenMP variable list at (1)

How about adding a  !$OMP  at the beginning of the continuation line? Thus,
try:

   !$OMP PRIVATE(number1,    &
   !$OMP         number2)    &


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

* [Bug fortran/49159] OpenMP compilation errors
  2011-05-25 13:45 [Bug fortran/49159] New: OpenMP compilation errors Jose.Pascual-Gutierr@1-ACT.com
  2011-05-25 14:11 ` [Bug fortran/49159] " burnus at gcc dot gnu.org
@ 2011-05-25 14:32 ` burnus at gcc dot gnu.org
  2011-05-25 19:45 ` Jose.Pascual-Gutierr@1-ACT.com
  2011-05-26  7:51 ` jakub at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-05-25 14:32 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-05-25 14:23:53 UTC ---
I just tested with some other compilers:

ifort accepts the invalid code, PathScale and Open64 show a similar syntax
error as gfortran, and PGI has a somewhat more legible error message:

  PGF90-S-0155-Illegal continuation  (test.f90: 17)

For the correct syntax, cf. OpenMP spec at
http://openmp.org/wp/openmp-specifications/


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

* [Bug fortran/49159] OpenMP compilation errors
  2011-05-25 13:45 [Bug fortran/49159] New: OpenMP compilation errors Jose.Pascual-Gutierr@1-ACT.com
  2011-05-25 14:11 ` [Bug fortran/49159] " burnus at gcc dot gnu.org
  2011-05-25 14:32 ` burnus at gcc dot gnu.org
@ 2011-05-25 19:45 ` Jose.Pascual-Gutierr@1-ACT.com
  2011-05-26  7:51 ` jakub at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: Jose.Pascual-Gutierr@1-ACT.com @ 2011-05-25 19:45 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jose <Jose.Pascual-Gutierr@1-ACT.com> 2011-05-25 19:37:08 UTC ---
>   !$OMP PRIVATE(number1,    &
>   !$OMP         number2)    &

It seems to work this way. thank you very much.


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

* [Bug fortran/49159] OpenMP compilation errors
  2011-05-25 13:45 [Bug fortran/49159] New: OpenMP compilation errors Jose.Pascual-Gutierr@1-ACT.com
                   ` (2 preceding siblings ...)
  2011-05-25 19:45 ` Jose.Pascual-Gutierr@1-ACT.com
@ 2011-05-26  7:51 ` jakub at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-05-26  7:51 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |jakub at gcc dot gnu.org
         Resolution|                            |INVALID

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-05-26 07:47:15 UTC ---
Yeah, see OpenMP 3.0, section 2.1.2 for details how OpenMP Fortran free form
directives and their continuations look like.


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

end of thread, other threads:[~2011-05-26  7:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-25 13:45 [Bug fortran/49159] New: OpenMP compilation errors Jose.Pascual-Gutierr@1-ACT.com
2011-05-25 14:11 ` [Bug fortran/49159] " burnus at gcc dot gnu.org
2011-05-25 14:32 ` burnus at gcc dot gnu.org
2011-05-25 19:45 ` Jose.Pascual-Gutierr@1-ACT.com
2011-05-26  7:51 ` jakub at gcc dot gnu.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).