- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The following code crashes the compiler. Of course, the code has a bug, but the compiler apparently too. The compiler is Intel Fortran Compiler for applications running on Intel 64, Version 10.1 Build 20080602 Package ID: l_fc_p_10.1.017. Host is 64 bit 8xAMD on linux. Compile command:
ifort -openmp -openmp-report1 -fpp -O3 -o /tmp/BUG.o -c BUG.F90.
MODULE USER
IMPLICIT NONE
CONTAINS
SUBROUTINE TEST(UFIX)
DOUBLE PRECISION, DIMENSION(:,:), ALLOCATABLE, INTENT(INOUT) :: UFIX
INTEGER :: NFIXU
INTEGER, DIMENSION(:), ALLOCATABLE, SAVE :: PMARKER
NFIXU = COUNT(PMARKER==1 .OR. PMARKER==2 .OR. PMARKER==4)
WRITE(*,*) 'NFIXU = ', NFIXU
CALL RESIZE(UFIX,(/NFIXU,3/))
UFIX = 0D0
END SUBROUTINE
END MODULE
ifort -openmp -openmp-report1 -fpp -O3 -o /tmp/BUG.o -c BUG.F90.
MODULE USER
IMPLICIT NONE
CONTAINS
SUBROUTINE TEST(UFIX)
DOUBLE PRECISION, DIMENSION(:,:), ALLOCATABLE, INTENT(INOUT) :: UFIX
INTEGER :: NFIXU
INTEGER, DIMENSION(:), ALLOCATABLE, SAVE :: PMARKER
NFIXU = COUNT(PMARKER==1 .OR. PMARKER==2 .OR. PMARKER==4)
WRITE(*,*) 'NFIXU = ', NFIXU
CALL RESIZE(UFIX,(/NFIXU,3/))
UFIX = 0D0
END SUBROUTINE
END MODULE
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I can reproduce this - I will pass it on to the developers. Thanks.
If I find a workaround, other than omitting -openmp from this source, I'll let you know.
If I find a workaround, other than omitting -openmp from this source, I'll let you know.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The problem is not the bug in the code I find but the SAVE attribute of PMARKER.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You are correct, that the SAVE attribute would be an error if the module were USEd in a parallel region. The compiler should give a clear message to that effect, and should permit it to work in serial regions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This portion of the code is not called from within a parallel region in my actual program. Compiled with -openmp just as all the project files. --DS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
A fix for this problem is expected in the next 10.1 update, planned for late October.

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