- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I've got a small piece of test code which seems to manifest a bug in the optimization routines. If I compile the code with -O0 it will run fine but -O2 gives the wrong answer. I've looked at the assembly of both and it clearly is just ommiting assigning the value to the register.
I've uploaded my test code:
- The problem is in the file build_mpi.f90.
- By uncommenting any of the commented lines the code works properly by printing the value of 0
- If you leave the code as is and build with -O2 the code will print 1 instead of 0.
I'll post the subroutine inline here so the curious can look without having to download the whole test:
!------------------------------------------------------------------------------
subroutine build_mpi(mpi0)
use mpi_schedule_typedef
implicit none
type(mpi_schedule) :: mpi0
mpi0%nproc_recv = 1
allocate(mpi0%ipntr_recv(2))
mpi0%ipntr_recv(mpi0%nproc_recv+1) = 0
! mpi0%ipntr_recv( 2) = 0
!--Build iproc and ipntr arrays for mpi communication
! mpi0%nproc_recv = 0
mpi0%nproc_send = 0
mpi0%nproc_recv = 0
! write(6,*) 'mpi0%nproc_recv: ',mpi0%nproc_recv
mpi0%nbuff_send = 0
mpi0%nbuff_recv = 0
write(6,*) 'mpi0%nproc_recv: ',mpi0%nproc_recv
stop
end subroutine build_mpi
!------------------------------------------------------------------------------
You can build both version by building with:
makeit_broke
makeit_work
Then run the exec ./test1
I've tried this on 3 different version of the intel compiler:
10.1 Works as expected
11.1 Does NOT Work
12.0.3 Does NOT Work
Thanks,
Bryan
I've uploaded my test code:
- The problem is in the file build_mpi.f90.
- By uncommenting any of the commented lines the code works properly by printing the value of 0
- If you leave the code as is and build with -O2 the code will print 1 instead of 0.
I'll post the subroutine inline here so the curious can look without having to download the whole test:
!------------------------------------------------------------------------------
subroutine build_mpi(mpi0)
use mpi_schedule_typedef
implicit none
type(mpi_schedule) :: mpi0
mpi0%nproc_recv = 1
allocate(mpi0%ipntr_recv(2))
mpi0%ipntr_recv(mpi0%nproc_recv+1) = 0
! mpi0%ipntr_recv( 2) = 0
!--Build iproc and ipntr arrays for mpi communication
! mpi0%nproc_recv = 0
mpi0%nproc_send = 0
mpi0%nproc_recv = 0
! write(6,*) 'mpi0%nproc_recv: ',mpi0%nproc_recv
mpi0%nbuff_send = 0
mpi0%nbuff_recv = 0
write(6,*) 'mpi0%nproc_recv: ',mpi0%nproc_recv
stop
end subroutine build_mpi
!------------------------------------------------------------------------------
You can build both version by building with:
makeit_broke
makeit_work
Then run the exec ./test1
I've tried this on 3 different version of the intel compiler:
10.1 Works as expected
11.1 Does NOT Work
12.0.3 Does NOT Work
Thanks,
Bryan
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I posted a pared down version of your code in a new thread, and the Intel people are going to file a bug report:
Optimizer bug .
Optimizer bug .

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