IBM Support

LI77473: XLF INCORRECT OUTPUT FROM LIBMASS

Subscribe

You can track all active APARs for this component.

 

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

    LI77473

  • Reported component name

    XL C/C++ FOR BG

  • Reported component ID

    5799AG100

  • Reported release

    E10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2013-06-20

  • Closed date

    2013-09-11

  • Last modified date

    2013-09-11

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

    LI77525 IV49617

Fix information

  • Fixed component name

    XL FORTRAN FOR

  • Fixed component ID

    5799AH100

Applicable component levels

  • RE10 PSY

       UP

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SS2MB5","label":"XL Fortran for Blue Gene\/Q"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"ALL VERSIONS","Edition":"","Line of Business":{"code":"LOB57","label":"Power"}}]

Document Information

Modified date:
11 September 2013