Fixes are available
APAR status
Closed as program error.
Error description
When the following test case is compiled with the following compile line, an incorrect output is obtained at execution time. Compile Line: mpxlf_r -I/usr/local/include -O4 -qnosave -qfixed mpitest.f ===== TESTCASE: <<<<<<<<<<<<< Start of mpitest.f >>>>>>>>>>>>>>>>>>>>>>>> PROGRAM testmain ! This program shows an MPI bug on jump, ! if compiled with "mpxlf_r -O4 -qnosave" and ! executed on one processor. IMPLICIT NONE INCLUDE 'mpif.h' INTEGER :: ierr(3),stt(MPI_STATUS_SIZE) CALL MPI_INIT(ierr) CALL testmpi(1) CALL MPI_FINALIZE(ierr) END PROGRAM !=============================================================== SUBROUTINE testmpi(n) IMPLICIT NONE ! The bug does not appear, if the dimension of y ! is specified within this subroutine (i.e. "y(1)"). INTEGER, INTENT (IN) :: n INTEGER :: j, x, y(n) ! INCLUDE 'mpif.h' INTEGER :: ierr(3),irank,isize DO j= 1,n y(j)= 1 ENDDO ! At first, x is set to 3. Then it is changed to 4. x = 3 DO j= 1,n x = max( x, 4 ) END DO CALL MPI_COMM_RANK (MPI_COMM_WORLD,irank,ierr) CALL MPI_COMM_SIZE (MPI_COMM_WORLD,isize,ierr) ! Here, x is 4. WRITE(*,fmt='(2(A,i2),A)') & 'irank =',irank,': x =',x,' before MPI_BCAST' ! The bug appears, if the following IF-block is not ! executed. ! It does not apper, if MPI_BCAST is uncommented IF ( isize > 1 ) THEN WRITE(*,fmt='(A,i2,A)') 'irank =',irank,': isize > 1' CALL MPI_BCAST(x,1,MPI_INTEGER,0,MPI_COMM_WORLD,ierr) ENDIF ! Now, x has changed from 4 back to 3. WRITE(*,fmt='(2(A,i2),A)') & 'irank =',irank,': x =',x,' after MPI_BCAST' END SUBROUTINE testmpi <<<<<<<<<<<<<<<< end of mpitest.f >>>>>>>>>>>>>>>>>>>>>> ===== ACTUAL OUTPUT: $ ./a.out irank = 0: x = 4 before MPI_BCAST irank = 0: x = 3 after MPI_BCAST ===== EXPECTED OUTPUT: $ ./a.out irank = 0: x = 4 before MPI_BCAST irank = 0: x = 4 after MPI_BCAST
Local fix
A workaround to this problem is statically allocate y in the subroutine.
Problem summary
This specific problem was found in MPI code, but it has the potential to effect any code containing loops compiled with loop opts enabled. The compiler was performing an address-taken optimzation and placing statements between the latch directive and the latch branch of the loop. This has been corrected.
Problem conclusion
When searching for the location to place the statement, the compiler checks whether it is in the latch block of a region. If it is, it walks up past the latch directive to ensure the statement is inserted in the loop body.
Temporary fix
Comments
APAR Information
APAR number
LI74482
Reported component name
XL FORTRAN AE B
Reported component ID
5799HJG00
Reported release
B10
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt
Submitted date
2009-04-28
Closed date
2009-04-28
Last modified date
2009-04-28
APAR is sysrouted FROM one or more of the following:
APAR is sysrouted TO one or more of the following:
Fix information
Fixed component name
XL FORTRAN AE B
Fixed component ID
5799HJG00
Applicable component levels
RB10 PSN IZ38370
UP06/09/13
[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSB259","label":"XL Fortran Advanced Edition for Linux"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"B.1","Line of Business":{"code":"LOB57","label":"Power"}}]
Document Information
Modified date:
24 February 2022