From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16665 invoked by alias); 25 May 2011 13:36:42 -0000 Received: (qmail 16588 invoked by uid 22791); 25 May 2011 13:36:41 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 25 May 2011 13:36:27 +0000 From: "Jose.Pascual-Gutierr@1-ACT.com" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/49159] New: OpenMP compilation errors X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: X-Bugzilla-Severity: major X-Bugzilla-Who: Jose.Pascual-Gutierr@1-ACT.com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Wed, 25 May 2011 13:45:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-05/txt/msg02366.txt.bz2 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