Fixes are available
APAR status
Closed as program error.
Error description
The following Fortran program gives out incorrect result for the imaginary part if compiled with xlf. xlf90 -o f_mass testmass.f90 -lmass ** test === End of Compilation 1 === 1501-510 Compilation successful for file testmass.f90. -bash-4.1$ ./f_mass baseline 0.707372016677029064E-01 0.997494986604054446 cmplx1 -0.499791196558983131 0.354839677501255478E-03 cmplx2 -0.499791196558983131 0.354839677501255478E-03 sn, cs 0.997494986604054446 0.707372016677029064E-01 cat testmass.f90 program test use, intrinsic :: iso_c_binding implicit none include 'mass.include' real(c_double) :: ThreeHalf = 1.5d0 real(c_double), target :: sn, cs complex(c_double_complex) :: cmplx1, cmplx2 cmplx1 = cmplx(-111,-222) cmplx2 = cmplx1 sn = -111 cs = -222 write(*,*) " baseline ", cos(ThreeHalf), " ", sin(ThreeHalf) cmplx1 = cosisin(ThreeHalf) write(*,*) " cmplx1 ", real(cmplx1), " ", aimag(cmplx1) cmplx2 = cosisin(1.5d0) write(*,*) " cmplx2 ", real(cmplx2), " ", aimag(cmplx2) call sincos(ThreeHalf, sn, cs); write(*,*) " sn, cs ", sn, " ", cs end program test
Local fix
Use -qcomplexgcc
Problem summary
PROBLEM DESCRIPTION: MASS cosisin function does not work correctly when called from Fortran due to linkage mismatch. USERS AFFECTED: Fortran calls to MASS cosisin on Linux or BG/Q-LoP in 32-bit mode.
Problem conclusion
Linux and BG/Q-LoP MASS cosisin is compiled with xlc and default option -qcomplexgcc. This causes it to return the complex result in GPRs(General Purpose Registers) rather than FPRs (Floating Point Registers) for 32-bit mode. xlf by default uses -qnocomplexgcc, which expects complex results in FPRs. In order to make the xlf linkage compatible with MASS, without breaking MASS compatibility with xlc, we changed the xlf Front End to turn cosisin into a BIF, and removed the cosisin prototype from mass.include.
Temporary fix
Comments
APAR Information
APAR number
LI77525
Reported component name
XL FORTRAN LINU
Reported component ID
5725C7500
Reported release
E10
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt
Submitted date
2013-07-29
Closed date
2013-10-28
Last modified date
2013-10-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 LINU
Fixed component ID
5725C7500
Applicable component levels
RE10 PSY
UP
[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSAT4T","label":"XL Fortran for Linux"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"14.1","Line of Business":{"code":"LOB57","label":"Power"}}]
Document Information
Modified date:
13 October 2021