|
|
Intel Fortran OpenMP bug
The following simple program demonstrates a very simple bug
I find in Intel "ifort" version 11: two critical sections
of the same name in a separately-compiled subroutine cause
the program to crash. The program demonstrates a realistic
case: you might want to protect multiple calls to routines
in a non-threadsafe library this way.
The docs from openmp.org say, "Different critical sections using
the same name are considered as one common critical section."
Works fine with pre-11 Intel compilers, gfortran, sunf95/Linux,
xlf/AIX, f90 and f77 for IRIX, pathf90/linux, Portland compilers
for linux (various versions), f90 for HPUX (i.e., everywhere
else I've tried.
[For whatever reason, my company log-in to Intel support is
failing ;-(
And I need this fixed for Nehalem/Gulftown machines now, and
SandyBridge etc. in the future...]
-- Carlie Coats
----------------------------------------------------------------
PROGRAM CRITICAL2
INTEGER :: I
REAL :: QUX
!$OMP PARALLEL DO DEFAULT( NONE ),
!$OMP& SHARED( QUX ),
!$OMP& PRIVATE( I )
DO I = 1, 1000
CALL BAR
END DO
PRINT *, QUX
STOP
END PROGRAM CRITICAL2
SUBROUTINE BAR( I, Q )
INTEGER, INTENT(IN ) :: I
REAL , INTENT( OUT) :: Q
!$OMP CRITICAL( foo )
Q = 0.0
!$OMP END CRITICAL( foo )
!$OMP CRITICAL( foo )
Q = FLOAT( I )
!$OMP END CRITICAL( foo )
RETURN
END SUBROUTINE BAR
|
|
0
|
|
|
|
Reply
|
carlie (79)
|
1/25/2011 7:58:07 PM |
|
On 1/25/2011 2:58 PM, Carlie Coats wrote:
> The following simple program demonstrates a very simple bug
> I find in Intel "ifort" version 11: two critical sections
> of the same name in a separately-compiled subroutine cause
> the program to crash. The program demonstrates a realistic
> case: you might want to protect multiple calls to routines
> in a non-threadsafe library this way.
>
> [For whatever reason, my company log-in to Intel support is
> failing ;-(
Post this in
http://software.intel.com/en-us/forums/intel-fortran-compiler-for-linux-and-mac-os-x/,
and one of our support engineers will take a look. You can also ask
about your log-in there.
--
Steve Lionel
Developer Products Division
Intel Corporation
Merrimack, NH
For email address, replace "invalid" with "com"
User communities for Intel Software Development Products
http://software.intel.com/en-us/forums/
Intel Software Development Products Support
http://software.intel.com/sites/support/
My Fortran blog
http://www.intel.com/software/drfortran
Refer to http://software.intel.com/en-us/articles/optimization-notice
for more information regarding performance and optimization choices in
Intel software products.
|
|
0
|
|
|
|
Reply
|
Steve.Lionel5921 (403)
|
1/25/2011 9:04:31 PM
|
|
|
1 Replies
78 Views
(page loaded in 0.043 seconds)
|
|
|
|
|
|
|
|
|