- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here is a strange behavior when I compile my code with OpenMP.
My code is:
-------------------
PROGRAM test02
IMPLICIT NONE
INTEGER,PARAMETER ::n1=1, n2=100
REAL :: a(n1-1:n2+1)
INTEGER :: i
DO i = n1, n2
a(i) = 2+i
END DO
CALL sub02(a,n1,n2)
END PROGRAM
-----------------------
SUBROUTINE sub02(a,n1,n2)
IMPLICIT NONE
INTEGER :: n1,n2
REAL :: a(n1-1:n2+1)
INTEGER :: i
DO i = n1, n2
WRITE(*,*) i, a(i)
END DO
WRITE(*,*) "------"
!$OMP PARALLEL DO
DO i = n1, n2
WRITE(*,*) i, a(i)
END DO
END SUBROUTINE
-------------------------
When compiling with "ifort -fpp -openmp", the value of a(i) out of the parallel region is 2+i (that is, a(1) = 3, a(2) = 4,...). But the value of a(i) in the parallel region is 3+i (that is, a(1) = 4, a(2) = 5,...). The values out of parallel region are not consistent with that in the parallel region.
If I compile with "ifort -fpp -openmp -check bounds", they are the same.
The code can work well on the Alpha workstation with Compaq's compiler, without any bounds checking. I turned check bounds on with my actually working code, and it cost so much time and resources to build the code (even the message "Optimization suppressed due to excessive resource requirements; contact Intel Premier Support" occurred).
How can I do with this behavior?
System: RedHat Enterprise Linux 3 for ia64
Compiler: l_fc_pc_8.1.019
Shi-ming Chen
My code is:
-------------------
PROGRAM test02
IMPLICIT NONE
INTEGER,PARAMETER ::n1=1, n2=100
REAL :: a(n1-1:n2+1)
INTEGER :: i
DO i = n1, n2
a(i) = 2+i
END DO
CALL sub02(a,n1,n2)
END PROGRAM
-----------------------
SUBROUTINE sub02(a,n1,n2)
IMPLICIT NONE
INTEGER :: n1,n2
REAL :: a(n1-1:n2+1)
INTEGER :: i
DO i = n1, n2
WRITE(*,*) i, a(i)
END DO
WRITE(*,*) "------"
!$OMP PARALLEL DO
DO i = n1, n2
WRITE(*,*) i, a(i)
END DO
END SUBROUTINE
-------------------------
When compiling with "ifort -fpp -openmp", the value of a(i) out of the parallel region is 2+i (that is, a(1) = 3, a(2) = 4,...). But the value of a(i) in the parallel region is 3+i (that is, a(1) = 4, a(2) = 5,...). The values out of parallel region are not consistent with that in the parallel region.
If I compile with "ifort -fpp -openmp -check bounds", they are the same.
The code can work well on the Alpha workstation with Compaq's compiler, without any bounds checking. I turned check bounds on with my actually working code, and it cost so much time and resources to build the code (even the message "Optimization suppressed due to excessive resource requirements; contact Intel Premier Support" occurred).
How can I do with this behavior?
System: RedHat Enterprise Linux 3 for ia64
Compiler: l_fc_pc_8.1.019
Shi-ming Chen
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Shi-Ming,
Unfortunately, that compiler update has a bad reputation. If a problem persists in the next update, due out shortly, please file an issue on premier.intel.com.
Unfortunately, that compiler update has a bad reputation. If a problem persists in the next update, due out shortly, please file an issue on premier.intel.com.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page