diff --git a/.github/workflows/compilers.yml b/.github/workflows/compilers.yml index c3747a56e..8309ba1c7 100644 --- a/.github/workflows/compilers.yml +++ b/.github/workflows/compilers.yml @@ -77,6 +77,7 @@ jobs: CC: ${{ matrix.toolchain.CC }} FFLAGS: ${{ matrix.toolchain.FFLAGS }} CFLAGS: ${{ matrix.toolchain.CFLAGS }} + JOB_ID: ${{ matrix.toolchain.os }}-${{ matrix.toolchain.FC }}-${{ matrix.lib_type }} strategy: fail-fast: false @@ -387,6 +388,7 @@ jobs: -D BUILD_TESTING:BOOL=ON \ -D LAPACKE_WITH_TMG:BOOL=ON \ -D BUILD_SHARED_LIBS:BOOL=${{ matrix.lib_type == 'shared' && 'ON' || 'OFF' }} \ + -D LAPACK_TESTING_JUNIT_JOB_ID="${JOB_ID}" \ "${extra[@]}" - name: Build @@ -416,7 +418,8 @@ jobs: -D LAPACKE:BOOL=ON ^ -D BUILD_TESTING:BOOL=ON ^ -D LAPACKE_WITH_TMG:BOOL=ON ^ - -D BUILD_SHARED_LIBS:BOOL=${{ matrix.lib_type == 'shared' && 'ON' || 'OFF' }} + -D BUILD_SHARED_LIBS:BOOL=${{ matrix.lib_type == 'shared' && 'ON' || 'OFF' }} ^ + -D LAPACK_TESTING_JUNIT_JOB_ID=%JOB_ID% - name: Build (Windows) if: ${{ runner.os == 'Windows' }} @@ -461,7 +464,7 @@ jobs: files: build/lapack_testing_junit.xml # The report is named above, so there is nothing to search the tree for. disable_search: true - flags: tests-${{ matrix.toolchain.os }}-${{ matrix.toolchain.FC }}-${{ matrix.lib_type }} + flags: tests-${{ env.JOB_ID }} name: ${{ matrix.toolchain.os }}-${{ matrix.toolchain.FC }} (${{ matrix.lib_type }}) fail_ci_if_error: true verbose: true diff --git a/.github/workflows/special.yml b/.github/workflows/special.yml index ae728ecdb..7d6a7e0f1 100644 --- a/.github/workflows/special.yml +++ b/.github/workflows/special.yml @@ -74,6 +74,7 @@ jobs: FFLAGS: "-Wall -Wno-unused-dummy-argument -Wno-unused-variable -Wno-unused-label -Werror=conversion -fimplicit-none -frecursive -fcheck=all -fopenmp" FC: ${{ matrix.toolchain.FC }} CC: ${{ matrix.toolchain.CC }} + JOB_ID: openmp-${{ matrix.toolchain.os }}-${{ matrix.lib_type }} strategy: fail-fast: false @@ -109,6 +110,8 @@ jobs: -D BUILD_TESTING:BOOL=ON -D LAPACKE_WITH_TMG:BOOL=ON -D BUILD_SHARED_LIBS:BOOL=${{ matrix.lib_type == 'shared' && 'ON' || 'OFF' }} + -D LAPACK_TESTING_JUNIT_JOB_ID="${JOB_ID}" + ${{ startsWith(matrix.toolchain.os, 'macos') && matrix.lib_type == 'shared' && '-D USE_FLAT_NAMESPACE:BOOL=ON' || '' }} - name: Build run: cmake --build build --parallel @@ -145,7 +148,7 @@ jobs: files: build/lapack_testing_junit.xml # The report is named above, so there is nothing to search the tree for. disable_search: true - flags: tests-openmp-${{ matrix.toolchain.os }}-${{ matrix.lib_type }} + flags: tests-${{ env.JOB_ID }} name: openmp-${{ matrix.toolchain.os }}-${{ matrix.toolchain.FC }} (${{ matrix.lib_type }}) fail_ci_if_error: true verbose: true @@ -177,6 +180,9 @@ jobs: name: codecov deployment: false + env: + JOB_ID: extended-api-${{ matrix.lib_type }} + strategy: fail-fast: false matrix: @@ -198,6 +204,7 @@ jobs: -D BUILD_SHARED_LIBS:BOOL=${{ matrix.lib_type == 'shared' && 'ON' || 'OFF' }} -D BUILD_DEFAULT_API:BOOL=OFF -D BUILD_INDEX64_EXT_API:BOOL=ON + -D LAPACK_TESTING_JUNIT_JOB_ID="${JOB_ID}" - name: Build run: cmake --build build --parallel @@ -232,7 +239,7 @@ jobs: files: build/lapack_testing_junit.xml # The report is named above, so there is nothing to search the tree for. disable_search: true - flags: tests-extended-api-${{ matrix.lib_type }} + flags: tests-${{ env.JOB_ID }} name: extended-api-only (${{ matrix.lib_type }}) fail_ci_if_error: true verbose: true diff --git a/BLAS/TESTING/CMakeLists.txt b/BLAS/TESTING/CMakeLists.txt index 7e27317c7..0241f2df5 100644 --- a/BLAS/TESTING/CMakeLists.txt +++ b/BLAS/TESTING/CMakeLists.txt @@ -2,24 +2,28 @@ function(_add_blas_test name src test_input test_output) add_executable(${name} ${src}) target_link_libraries(${name} PRIVATE ${BLASLIB}) lapack_add_coverage(${name}) + + # A driver that reads an input file takes the name of its summary file from + # it and opens that itself on unit 6, so redirecting stdout there as well + # would open the one file twice; xBLAT2 fails outright with "Cannot change + # STATUS parameter in OPEN statement". Only xBLAT1, which has no input and + # writes to stdout, needs the redirect. if(EXISTS "${test_input}") lapack_runtest_command(test_command ${name} INPUT "${test_input}") - add_test(NAME BLAS-${name} COMMAND ${test_command}) else() lapack_runtest_command(test_command ${name} OUTPUT "${test_output}") - add_test(NAME BLAS-${name} COMMAND ${test_command}) endif() + add_test(NAME BLAS-${name} COMMAND ${test_command}) - # Disable constant propagation for NAG compiler to avoid issues with - # special values (Inf, NaN) returned by SXVALS and DXVALS. - if(CMAKE_Fortran_COMPILER_ID STREQUAL "NAG") - target_compile_options(${name} PRIVATE "-Onopropagate") - endif() + # The special values (Inf, NaN) that SXVALS and DXVALS return do not + # survive nagfor folding the expressions that make them. + lapack_nag_disable_constant_propagation_target(${name}) endfunction() function(add_blas_test name source) get_filename_component(baseNAME ${source} NAME_WE) - set(test_input "${CMAKE_CURRENT_SOURCE_DIR}/${baseNAME}.in") + lapack_test_input(test_input + "${CMAKE_CURRENT_SOURCE_DIR}/${baseNAME}.in") if(BUILD_DEFAULT_API) _add_blas_test(${name} ${source} "${test_input}" diff --git a/BLAS/TESTING/cblat1.f b/BLAS/TESTING/cblat1.f index 5071ca6f2..f07e4e189 100644 --- a/BLAS/TESTING/cblat1.f +++ b/BLAS/TESTING/cblat1.f @@ -308,7 +308,7 @@ SUBROUTINE CHECK1(SFAC) CALL ITEST1(ICAMAX(N,CX,INCX),ITRUEC(NP1)) ELSE WRITE (NOUT,*) ' Shouldn''t be here in CHECK1' - STOP + STOP 1 END IF * 40 CONTINUE @@ -675,7 +675,7 @@ SUBROUTINE CHECK2(SFAC) CALL CTEST(LENY,CY,CT11(1,KN,KI),CSIZE2(1,KSIZE),SFAC) ELSE WRITE (NOUT,*) ' Shouldn''t be here in CHECK2' - STOP + STOP 1 END IF * 40 CONTINUE diff --git a/BLAS/TESTING/cblat2.f b/BLAS/TESTING/cblat2.f index 8d4fe6d71..e8657213d 100644 --- a/BLAS/TESTING/cblat2.f +++ b/BLAS/TESTING/cblat2.f @@ -277,7 +277,7 @@ PROGRAM CBLAT2 $ GO TO 70 60 CONTINUE WRITE( NOUT, FMT = 9986 )SNAMET - STOP + STOP 1 70 LTEST( I ) = LTESTT GO TO 50 * @@ -311,7 +311,7 @@ PROGRAM CBLAT2 SAME = LCE( YY, YT, N ) IF( .NOT.SAME.OR.ERR.NE.RZERO )THEN WRITE( NOUT, FMT = 9985 )TRANS, SAME, ERR - STOP + STOP 1 END IF TRANS = 'T' CALL CMVCH( TRANS, N, N, ONE, A, NMAX, X, -1, ZERO, Y, -1, YT, G, @@ -319,7 +319,7 @@ PROGRAM CBLAT2 SAME = LCE( YY, YT, N ) IF( .NOT.SAME.OR.ERR.NE.RZERO )THEN WRITE( NOUT, FMT = 9985 )TRANS, SAME, ERR - STOP + STOP 1 END IF * * Test each subroutine in turn. diff --git a/BLAS/TESTING/cblat3.f b/BLAS/TESTING/cblat3.f index 1e8f865bd..d3ff49c42 100644 --- a/BLAS/TESTING/cblat3.f +++ b/BLAS/TESTING/cblat3.f @@ -228,7 +228,7 @@ PROGRAM CBLAT3 $ GO TO 50 40 CONTINUE WRITE( NOUT, FMT = 9990 )SNAMET - STOP + STOP 1 50 LTEST( I ) = LTESTT GO TO 30 * @@ -265,7 +265,7 @@ PROGRAM CBLAT3 SAME = LCE( CC, CT, N ) IF( .NOT.SAME.OR.ERR.NE.RZERO )THEN WRITE( NOUT, FMT = 9989 )TRANSA, TRANSB, SAME, ERR - STOP + STOP 1 END IF TRANSB = 'C' CALL CMMCH( TRANSA, TRANSB, N, 1, N, ONE, AB, NMAX, @@ -274,7 +274,7 @@ PROGRAM CBLAT3 SAME = LCE( CC, CT, N ) IF( .NOT.SAME.OR.ERR.NE.RZERO )THEN WRITE( NOUT, FMT = 9989 )TRANSA, TRANSB, SAME, ERR - STOP + STOP 1 END IF DO 120 J = 1, N AB( J, NMAX + 1 ) = REAL( N - J + 1 ) @@ -292,7 +292,7 @@ PROGRAM CBLAT3 SAME = LCE( CC, CT, N ) IF( .NOT.SAME.OR.ERR.NE.RZERO )THEN WRITE( NOUT, FMT = 9989 )TRANSA, TRANSB, SAME, ERR - STOP + STOP 1 END IF TRANSB = 'C' CALL CMMCH( TRANSA, TRANSB, N, 1, N, ONE, AB, NMAX, @@ -301,7 +301,7 @@ PROGRAM CBLAT3 SAME = LCE( CC, CT, N ) IF( .NOT.SAME.OR.ERR.NE.RZERO )THEN WRITE( NOUT, FMT = 9989 )TRANSA, TRANSB, SAME, ERR - STOP + STOP 1 END IF * * Test each subroutine in turn. diff --git a/BLAS/TESTING/dblat1.f b/BLAS/TESTING/dblat1.f index 875dbf53e..43590bd23 100644 --- a/BLAS/TESTING/dblat1.f +++ b/BLAS/TESTING/dblat1.f @@ -266,7 +266,7 @@ SUBROUTINE CHECK0(SFAC) CALL STEST(9,DTEMP,DTRUE(1,K),DTRUE(1,K),SFAC) ELSE WRITE (NOUT,*) ' Shouldn''t be here in CHECK0' - STOP + STOP 1 END IF 20 CONTINUE 40 RETURN @@ -376,7 +376,7 @@ SUBROUTINE CHECK1(SFAC) CALL ITEST1(IDAMAX(N,SX,INCX),ITRUEC(NP1)) ELSE WRITE (NOUT,*) ' Shouldn''t be here in CHECK1' - STOP + STOP 1 END IF 60 CONTINUE IF (ICASE.EQ.10) THEN @@ -782,7 +782,7 @@ SUBROUTINE CHECK2(SFAC) $ REAL(DT7(KN,KI)),REAL(SSIZE1(KN)), .3125E-1) ELSE WRITE (NOUT,*) ' Shouldn''t be here in CHECK2' - STOP + STOP 1 END IF 100 CONTINUE 120 CONTINUE @@ -898,7 +898,7 @@ SUBROUTINE CHECK3(SFAC) CALL STEST(LENY,SY,STY,SSIZE2(1,KSIZE),SFAC) ELSE WRITE (NOUT,*) ' Shouldn''t be here in CHECK3' - STOP + STOP 1 END IF 40 CONTINUE 60 CONTINUE diff --git a/BLAS/TESTING/dblat2.f b/BLAS/TESTING/dblat2.f index 8092518a3..8fbc4ca3b 100644 --- a/BLAS/TESTING/dblat2.f +++ b/BLAS/TESTING/dblat2.f @@ -279,7 +279,7 @@ PROGRAM DBLAT2 $ GO TO 70 60 CONTINUE WRITE( NOUT, FMT = 9986 )SNAMET - STOP + STOP 1 70 LTEST( I ) = LTESTT GO TO 50 * @@ -312,7 +312,7 @@ PROGRAM DBLAT2 SAME = LDE( YY, YT, N ) IF( .NOT.SAME.OR.ERR.NE.ZERO )THEN WRITE( NOUT, FMT = 9985 )TRANS, SAME, ERR - STOP + STOP 1 END IF TRANS = 'T' CALL DMVCH( TRANS, N, N, ONE, A, NMAX, X, -1, ZERO, Y, -1, YT, G, @@ -320,7 +320,7 @@ PROGRAM DBLAT2 SAME = LDE( YY, YT, N ) IF( .NOT.SAME.OR.ERR.NE.ZERO )THEN WRITE( NOUT, FMT = 9985 )TRANS, SAME, ERR - STOP + STOP 1 END IF * * Test each subroutine in turn. diff --git a/BLAS/TESTING/dblat3.f b/BLAS/TESTING/dblat3.f index 757fb0ece..9449d7749 100644 --- a/BLAS/TESTING/dblat3.f +++ b/BLAS/TESTING/dblat3.f @@ -226,7 +226,7 @@ PROGRAM DBLAT3 $ GO TO 50 40 CONTINUE WRITE( NOUT, FMT = 9990 )SNAMET - STOP + STOP 1 50 LTEST( I ) = LTESTT GO TO 30 * @@ -262,7 +262,7 @@ PROGRAM DBLAT3 SAME = LDE( CC, CT, N ) IF( .NOT.SAME.OR.ERR.NE.ZERO )THEN WRITE( NOUT, FMT = 9989 )TRANSA, TRANSB, SAME, ERR - STOP + STOP 1 END IF TRANSB = 'T' CALL DMMCH( TRANSA, TRANSB, N, 1, N, ONE, AB, NMAX, @@ -271,7 +271,7 @@ PROGRAM DBLAT3 SAME = LDE( CC, CT, N ) IF( .NOT.SAME.OR.ERR.NE.ZERO )THEN WRITE( NOUT, FMT = 9989 )TRANSA, TRANSB, SAME, ERR - STOP + STOP 1 END IF DO 120 J = 1, N AB( J, NMAX + 1 ) = N - J + 1 @@ -289,7 +289,7 @@ PROGRAM DBLAT3 SAME = LDE( CC, CT, N ) IF( .NOT.SAME.OR.ERR.NE.ZERO )THEN WRITE( NOUT, FMT = 9989 )TRANSA, TRANSB, SAME, ERR - STOP + STOP 1 END IF TRANSB = 'T' CALL DMMCH( TRANSA, TRANSB, N, 1, N, ONE, AB, NMAX, @@ -298,7 +298,7 @@ PROGRAM DBLAT3 SAME = LDE( CC, CT, N ) IF( .NOT.SAME.OR.ERR.NE.ZERO )THEN WRITE( NOUT, FMT = 9989 )TRANSA, TRANSB, SAME, ERR - STOP + STOP 1 END IF * * Test each subroutine in turn. diff --git a/BLAS/TESTING/sblat1.f b/BLAS/TESTING/sblat1.f index 084e3f141..4ea895abb 100644 --- a/BLAS/TESTING/sblat1.f +++ b/BLAS/TESTING/sblat1.f @@ -265,7 +265,7 @@ SUBROUTINE CHECK0(SFAC) CALL STEST(9,DTEMP,DTRUE(1,K),DTRUE(1,K),SFAC) ELSE WRITE (NOUT,*) ' Shouldn''t be here in CHECK0' - STOP + STOP 1 END IF 20 CONTINUE 40 RETURN @@ -374,7 +374,7 @@ SUBROUTINE CHECK1(SFAC) CALL ITEST1(ISAMAX(N,SX,INCX),ITRUEC(NP1)) ELSE WRITE (NOUT,*) ' Shouldn''t be here in CHECK1' - STOP + STOP 1 END IF 60 CONTINUE IF (ICASE.EQ.10) THEN @@ -781,7 +781,7 @@ SUBROUTINE CHECK2(SFAC) $ ST7B(KN,KI),SSIZE3(KN),SFAC) ELSE WRITE (NOUT,*) ' Shouldn''t be here in CHECK2' - STOP + STOP 1 END IF 100 CONTINUE 120 CONTINUE @@ -896,7 +896,7 @@ SUBROUTINE CHECK3(SFAC) CALL STEST(LENY,SY,STY,SSIZE2(1,KSIZE),SFAC) ELSE WRITE (NOUT,*) ' Shouldn''t be here in CHECK3' - STOP + STOP 1 END IF 40 CONTINUE 60 CONTINUE diff --git a/BLAS/TESTING/sblat2.f b/BLAS/TESTING/sblat2.f index 22483a191..b8cbccc8a 100644 --- a/BLAS/TESTING/sblat2.f +++ b/BLAS/TESTING/sblat2.f @@ -279,7 +279,7 @@ PROGRAM SBLAT2 $ GO TO 70 60 CONTINUE WRITE( NOUT, FMT = 9986 )SNAMET - STOP + STOP 1 70 LTEST( I ) = LTESTT GO TO 50 * @@ -313,7 +313,7 @@ PROGRAM SBLAT2 SAME = LSE( YY, YT, N ) IF( .NOT.SAME.OR.ERR.NE.ZERO )THEN WRITE( NOUT, FMT = 9985 )TRANS, SAME, ERR - STOP + STOP 1 END IF TRANS = 'T' CALL SMVCH( TRANS, N, N, ONE, A, NMAX, X, -1, ZERO, Y, -1, YT, G, @@ -321,7 +321,7 @@ PROGRAM SBLAT2 SAME = LSE( YY, YT, N ) IF( .NOT.SAME.OR.ERR.NE.ZERO )THEN WRITE( NOUT, FMT = 9985 )TRANS, SAME, ERR - STOP + STOP 1 END IF * * Test each subroutine in turn. diff --git a/BLAS/TESTING/sblat3.f b/BLAS/TESTING/sblat3.f index 4f91b1796..d6ca9dce7 100644 --- a/BLAS/TESTING/sblat3.f +++ b/BLAS/TESTING/sblat3.f @@ -226,7 +226,7 @@ PROGRAM SBLAT3 $ GO TO 50 40 CONTINUE WRITE( NOUT, FMT = 9990 )SNAMET - STOP + STOP 1 50 LTEST( I ) = LTESTT GO TO 30 * @@ -263,7 +263,7 @@ PROGRAM SBLAT3 SAME = LSE( CC, CT, N ) IF( .NOT.SAME.OR.ERR.NE.ZERO )THEN WRITE( NOUT, FMT = 9989 )TRANSA, TRANSB, SAME, ERR - STOP + STOP 1 END IF TRANSB = 'T' CALL SMMCH( TRANSA, TRANSB, N, 1, N, ONE, AB, NMAX, @@ -272,7 +272,7 @@ PROGRAM SBLAT3 SAME = LSE( CC, CT, N ) IF( .NOT.SAME.OR.ERR.NE.ZERO )THEN WRITE( NOUT, FMT = 9989 )TRANSA, TRANSB, SAME, ERR - STOP + STOP 1 END IF DO 120 J = 1, N AB( J, NMAX + 1 ) = REAL( N - J + 1 ) @@ -290,7 +290,7 @@ PROGRAM SBLAT3 SAME = LSE( CC, CT, N ) IF( .NOT.SAME.OR.ERR.NE.ZERO )THEN WRITE( NOUT, FMT = 9989 )TRANSA, TRANSB, SAME, ERR - STOP + STOP 1 END IF TRANSB = 'T' CALL SMMCH( TRANSA, TRANSB, N, 1, N, ONE, AB, NMAX, @@ -299,7 +299,7 @@ PROGRAM SBLAT3 SAME = LSE( CC, CT, N ) IF( .NOT.SAME.OR.ERR.NE.ZERO )THEN WRITE( NOUT, FMT = 9989 )TRANSA, TRANSB, SAME, ERR - STOP + STOP 1 END IF * * Test each subroutine in turn. diff --git a/BLAS/TESTING/zblat1.f b/BLAS/TESTING/zblat1.f index 0c45936b8..7742590d7 100644 --- a/BLAS/TESTING/zblat1.f +++ b/BLAS/TESTING/zblat1.f @@ -307,7 +307,7 @@ SUBROUTINE CHECK1(SFAC) CALL ITEST1(IZAMAX(N,CX,INCX),ITRUEC(NP1)) ELSE WRITE (NOUT,*) ' Shouldn''t be here in CHECK1' - STOP + STOP 1 END IF * 40 CONTINUE @@ -675,7 +675,7 @@ SUBROUTINE CHECK2(SFAC) CALL CTEST(LENY,CY,CT11(1,KN,KI),CSIZE2(1,KSIZE),SFAC) ELSE WRITE (NOUT,*) ' Shouldn''t be here in CHECK2' - STOP + STOP 1 END IF * 40 CONTINUE diff --git a/BLAS/TESTING/zblat2.f b/BLAS/TESTING/zblat2.f index 7aa9e577d..d3fc1dca4 100644 --- a/BLAS/TESTING/zblat2.f +++ b/BLAS/TESTING/zblat2.f @@ -278,7 +278,7 @@ PROGRAM ZBLAT2 $ GO TO 70 60 CONTINUE WRITE( NOUT, FMT = 9986 )SNAMET - STOP + STOP 1 70 LTEST( I ) = LTESTT GO TO 50 * @@ -311,7 +311,7 @@ PROGRAM ZBLAT2 SAME = LZE( YY, YT, N ) IF( .NOT.SAME.OR.ERR.NE.RZERO )THEN WRITE( NOUT, FMT = 9985 )TRANS, SAME, ERR - STOP + STOP 1 END IF TRANS = 'T' CALL ZMVCH( TRANS, N, N, ONE, A, NMAX, X, -1, ZERO, Y, -1, YT, G, @@ -319,7 +319,7 @@ PROGRAM ZBLAT2 SAME = LZE( YY, YT, N ) IF( .NOT.SAME.OR.ERR.NE.RZERO )THEN WRITE( NOUT, FMT = 9985 )TRANS, SAME, ERR - STOP + STOP 1 END IF * * Test each subroutine in turn. diff --git a/BLAS/TESTING/zblat3.f b/BLAS/TESTING/zblat3.f index f9ecd7ec3..3ee340583 100644 --- a/BLAS/TESTING/zblat3.f +++ b/BLAS/TESTING/zblat3.f @@ -230,7 +230,7 @@ PROGRAM ZBLAT3 $ GO TO 50 40 CONTINUE WRITE( NOUT, FMT = 9990 )SNAMET - STOP + STOP 1 50 LTEST( I ) = LTESTT GO TO 30 * @@ -266,7 +266,7 @@ PROGRAM ZBLAT3 SAME = LZE( CC, CT, N ) IF( .NOT.SAME.OR.ERR.NE.RZERO )THEN WRITE( NOUT, FMT = 9989 )TRANSA, TRANSB, SAME, ERR - STOP + STOP 1 END IF TRANSB = 'C' CALL ZMMCH( TRANSA, TRANSB, N, 1, N, ONE, AB, NMAX, @@ -275,7 +275,7 @@ PROGRAM ZBLAT3 SAME = LZE( CC, CT, N ) IF( .NOT.SAME.OR.ERR.NE.RZERO )THEN WRITE( NOUT, FMT = 9989 )TRANSA, TRANSB, SAME, ERR - STOP + STOP 1 END IF DO 120 J = 1, N AB( J, NMAX + 1 ) = N - J + 1 @@ -293,7 +293,7 @@ PROGRAM ZBLAT3 SAME = LZE( CC, CT, N ) IF( .NOT.SAME.OR.ERR.NE.RZERO )THEN WRITE( NOUT, FMT = 9989 )TRANSA, TRANSB, SAME, ERR - STOP + STOP 1 END IF TRANSB = 'C' CALL ZMMCH( TRANSA, TRANSB, N, 1, N, ONE, AB, NMAX, @@ -302,7 +302,7 @@ PROGRAM ZBLAT3 SAME = LZE( CC, CT, N ) IF( .NOT.SAME.OR.ERR.NE.RZERO )THEN WRITE( NOUT, FMT = 9989 )TRANSA, TRANSB, SAME, ERR - STOP + STOP 1 END IF * * Test each subroutine in turn. diff --git a/CBLAS/testing/c_cblat1.f b/CBLAS/testing/c_cblat1.f index 930ccdbea..75b8ee8ed 100644 --- a/CBLAS/testing/c_cblat1.f +++ b/CBLAS/testing/c_cblat1.f @@ -255,7 +255,7 @@ SUBROUTINE CHECK1(SFAC) CALL ITEST1(ICAMAXTEST(N,CX,INCX),ITRUE3(NP1)) ELSE WRITE (NOUT,*) ' Shouldn''t be here in CHECK1' - STOP + STOP 1 END IF * 40 CONTINUE @@ -597,7 +597,7 @@ SUBROUTINE CHECK2(SFAC) CALL CTEST(LENY,CY,CT11(1,KN,KI),CSIZE2(1,KSIZE),SFAC) ELSE WRITE (NOUT,*) ' Shouldn''t be here in CHECK2' - STOP + STOP 1 END IF * 40 CONTINUE diff --git a/CBLAS/testing/c_cblat2.f b/CBLAS/testing/c_cblat2.f index 881580966..3d710868f 100644 --- a/CBLAS/testing/c_cblat2.f +++ b/CBLAS/testing/c_cblat2.f @@ -247,7 +247,7 @@ PROGRAM CBLAT2 $ GO TO 70 60 CONTINUE WRITE( NOUT, FMT = 9986 )SNAMET - STOP + STOP 1 70 LTEST( I ) = LTESTT GO TO 50 * @@ -288,7 +288,7 @@ PROGRAM CBLAT2 SAME = LCE( YY, YT, N ) IF( .NOT.SAME.OR.ERR.NE.RZERO )THEN WRITE( NOUT, FMT = 9985 )TRANS, SAME, ERR - STOP + STOP 1 END IF TRANS = 'T' CALL CMVCH( TRANS, N, N, ONE, A, NMAX, X, -1, ZERO, Y, -1, YT, G, @@ -296,7 +296,7 @@ PROGRAM CBLAT2 SAME = LCE( YY, YT, N ) IF( .NOT.SAME.OR.ERR.NE.RZERO )THEN WRITE( NOUT, FMT = 9985 )TRANS, SAME, ERR - STOP + STOP 1 END IF * * Test each subroutine in turn. diff --git a/CBLAS/testing/c_cblat3.f b/CBLAS/testing/c_cblat3.f index 3b6c4ba62..0580701e6 100644 --- a/CBLAS/testing/c_cblat3.f +++ b/CBLAS/testing/c_cblat3.f @@ -200,7 +200,7 @@ PROGRAM CBLAT3 $ GO TO 50 40 CONTINUE WRITE( NOUT, FMT = 9990 )SNAMET - STOP + STOP 1 50 LTEST( I ) = LTESTT GO TO 30 * @@ -244,7 +244,7 @@ PROGRAM CBLAT3 SAME = LCE( CC, CT, N ) IF( .NOT.SAME.OR.ERR.NE.RZERO )THEN WRITE( NOUT, FMT = 9989 )TRANSA, TRANSB, SAME, ERR - STOP + STOP 1 END IF TRANSB = 'C' CALL CMMCH( TRANSA, TRANSB, N, 1, N, ONE, AB, NMAX, @@ -253,7 +253,7 @@ PROGRAM CBLAT3 SAME = LCE( CC, CT, N ) IF( .NOT.SAME.OR.ERR.NE.RZERO )THEN WRITE( NOUT, FMT = 9989 )TRANSA, TRANSB, SAME, ERR - STOP + STOP 1 END IF DO 120 J = 1, N AB( J, NMAX + 1 ) = REAL( N - J + 1 ) @@ -271,7 +271,7 @@ PROGRAM CBLAT3 SAME = LCE( CC, CT, N ) IF( .NOT.SAME.OR.ERR.NE.RZERO )THEN WRITE( NOUT, FMT = 9989 )TRANSA, TRANSB, SAME, ERR - STOP + STOP 1 END IF TRANSB = 'C' CALL CMMCH( TRANSA, TRANSB, N, 1, N, ONE, AB, NMAX, @@ -280,7 +280,7 @@ PROGRAM CBLAT3 SAME = LCE( CC, CT, N ) IF( .NOT.SAME.OR.ERR.NE.RZERO )THEN WRITE( NOUT, FMT = 9989 )TRANSA, TRANSB, SAME, ERR - STOP + STOP 1 END IF * * Test each subroutine in turn. diff --git a/CBLAS/testing/c_dblat1.f b/CBLAS/testing/c_dblat1.f index c6f074465..6325e4476 100644 --- a/CBLAS/testing/c_dblat1.f +++ b/CBLAS/testing/c_dblat1.f @@ -163,7 +163,7 @@ SUBROUTINE CHECK0(SFAC) CALL STEST1(SS,DS1(K),DS1(K),SFAC) ELSE WRITE (NOUT,*) ' Shouldn''t be here in CHECK0' - STOP + STOP 1 END IF 20 CONTINUE 40 RETURN @@ -259,7 +259,7 @@ SUBROUTINE CHECK1(SFAC) CALL ITEST1(IDAMAXTEST(N,SX,INCX),ITRUE2(NP1)) ELSE WRITE (NOUT,*) ' Shouldn''t be here in CHECK1' - STOP + STOP 1 END IF 60 CONTINUE 80 CONTINUE @@ -448,7 +448,7 @@ SUBROUTINE CHECK2(SFAC) CALL STEST(LENY,SY,STY,SSIZE2(1,1),1.0D0) ELSE WRITE (NOUT,*) ' Shouldn''t be here in CHECK2' - STOP + STOP 1 END IF 100 CONTINUE 120 CONTINUE @@ -563,7 +563,7 @@ SUBROUTINE CHECK3(SFAC) CALL STEST(LENY,SY,STY,SSIZE2(1,KSIZE),SFAC) ELSE WRITE (NOUT,*) ' Shouldn''t be here in CHECK3' - STOP + STOP 1 END IF 40 CONTINUE 60 CONTINUE diff --git a/CBLAS/testing/c_dblat2.f b/CBLAS/testing/c_dblat2.f index 232f01f20..dd4ac6cf9 100644 --- a/CBLAS/testing/c_dblat2.f +++ b/CBLAS/testing/c_dblat2.f @@ -257,7 +257,7 @@ PROGRAM DBLAT2 $ GO TO 70 60 CONTINUE WRITE( NOUT, FMT = 9986 )SNAMET - STOP + STOP 1 70 LTEST( I ) = LTESTT GO TO 50 * @@ -297,7 +297,7 @@ PROGRAM DBLAT2 SAME = LDE( YY, YT, N ) IF( .NOT.SAME.OR.ERR.NE.ZERO )THEN WRITE( NOUT, FMT = 9985 )TRANS, SAME, ERR - STOP + STOP 1 END IF TRANS = 'T' CALL DMVCH( TRANS, N, N, ONE, A, NMAX, X, -1, ZERO, Y, -1, YT, G, @@ -305,7 +305,7 @@ PROGRAM DBLAT2 SAME = LDE( YY, YT, N ) IF( .NOT.SAME.OR.ERR.NE.ZERO )THEN WRITE( NOUT, FMT = 9985 )TRANS, SAME, ERR - STOP + STOP 1 END IF * * Test each subroutine in turn. diff --git a/CBLAS/testing/c_dblat3.f b/CBLAS/testing/c_dblat3.f index 87a6f69b9..73fc898ac 100644 --- a/CBLAS/testing/c_dblat3.f +++ b/CBLAS/testing/c_dblat3.f @@ -202,7 +202,7 @@ PROGRAM DBLAT3 $ GO TO 50 40 CONTINUE WRITE( NOUT, FMT = 9990 )SNAMET - STOP + STOP 1 50 LTEST( I ) = LTESTT GO TO 30 * @@ -245,7 +245,7 @@ PROGRAM DBLAT3 SAME = LDE( CC, CT, N ) IF( .NOT.SAME.OR.ERR.NE.ZERO )THEN WRITE( NOUT, FMT = 9989 )TRANSA, TRANSB, SAME, ERR - STOP + STOP 1 END IF TRANSB = 'T' CALL DMMCH( TRANSA, TRANSB, N, 1, N, ONE, AB, NMAX, @@ -254,7 +254,7 @@ PROGRAM DBLAT3 SAME = LDE( CC, CT, N ) IF( .NOT.SAME.OR.ERR.NE.ZERO )THEN WRITE( NOUT, FMT = 9989 )TRANSA, TRANSB, SAME, ERR - STOP + STOP 1 END IF DO 120 J = 1, N AB( J, NMAX + 1 ) = N - J + 1 @@ -272,7 +272,7 @@ PROGRAM DBLAT3 SAME = LDE( CC, CT, N ) IF( .NOT.SAME.OR.ERR.NE.ZERO )THEN WRITE( NOUT, FMT = 9989 )TRANSA, TRANSB, SAME, ERR - STOP + STOP 1 END IF TRANSB = 'T' CALL DMMCH( TRANSA, TRANSB, N, 1, N, ONE, AB, NMAX, @@ -281,7 +281,7 @@ PROGRAM DBLAT3 SAME = LDE( CC, CT, N ) IF( .NOT.SAME.OR.ERR.NE.ZERO )THEN WRITE( NOUT, FMT = 9989 )TRANSA, TRANSB, SAME, ERR - STOP + STOP 1 END IF * * Test each subroutine in turn. diff --git a/CBLAS/testing/c_sblat1.f b/CBLAS/testing/c_sblat1.f index d66f23a5c..a397f5d96 100644 --- a/CBLAS/testing/c_sblat1.f +++ b/CBLAS/testing/c_sblat1.f @@ -162,7 +162,7 @@ SUBROUTINE CHECK0(SFAC) CALL STEST1(SS,DS1(K),DS1(K),SFAC) ELSE WRITE (NOUT,*) ' Shouldn''t be here in CHECK0' - STOP + STOP 1 END IF 20 CONTINUE 40 RETURN @@ -258,7 +258,7 @@ SUBROUTINE CHECK1(SFAC) CALL ITEST1(ISAMAXTEST(N,SX,INCX),ITRUE2(NP1)) ELSE WRITE (NOUT,*) ' Shouldn''t be here in CHECK1' - STOP + STOP 1 END IF 60 CONTINUE 80 CONTINUE @@ -445,7 +445,7 @@ SUBROUTINE CHECK2(SFAC) CALL STEST(LENY,SY,STY,SSIZE2(1,1),1.0E0) ELSE WRITE (NOUT,*) ' Shouldn''t be here in CHECK2' - STOP + STOP 1 END IF 100 CONTINUE 120 CONTINUE @@ -560,7 +560,7 @@ SUBROUTINE CHECK3(SFAC) CALL STEST(LENY,SY,STY,SSIZE2(1,KSIZE),SFAC) ELSE WRITE (NOUT,*) ' Shouldn''t be here in CHECK3' - STOP + STOP 1 END IF 40 CONTINUE 60 CONTINUE diff --git a/CBLAS/testing/c_sblat2.f b/CBLAS/testing/c_sblat2.f index fbd32188b..3a7719ca7 100644 --- a/CBLAS/testing/c_sblat2.f +++ b/CBLAS/testing/c_sblat2.f @@ -257,7 +257,7 @@ PROGRAM SBLAT2 $ GO TO 70 60 CONTINUE WRITE( NOUT, FMT = 9986 )SNAMET - STOP + STOP 1 70 LTEST( I ) = LTESTT GO TO 50 * @@ -298,7 +298,7 @@ PROGRAM SBLAT2 SAME = LSE( YY, YT, N ) IF( .NOT.SAME.OR.ERR.NE.ZERO )THEN WRITE( NOUT, FMT = 9985 )TRANS, SAME, ERR - STOP + STOP 1 END IF TRANS = 'T' CALL SMVCH( TRANS, N, N, ONE, A, NMAX, X, -1, ZERO, Y, -1, YT, G, @@ -306,7 +306,7 @@ PROGRAM SBLAT2 SAME = LSE( YY, YT, N ) IF( .NOT.SAME.OR.ERR.NE.ZERO )THEN WRITE( NOUT, FMT = 9985 )TRANS, SAME, ERR - STOP + STOP 1 END IF * * Test each subroutine in turn. diff --git a/CBLAS/testing/c_sblat3.f b/CBLAS/testing/c_sblat3.f index e290bbbb3..750e7e252 100644 --- a/CBLAS/testing/c_sblat3.f +++ b/CBLAS/testing/c_sblat3.f @@ -201,7 +201,7 @@ PROGRAM SBLAT3 $ GO TO 50 40 CONTINUE WRITE( NOUT, FMT = 9990 )SNAMET - STOP + STOP 1 50 LTEST( I ) = LTESTT GO TO 30 * @@ -245,7 +245,7 @@ PROGRAM SBLAT3 SAME = LSE( CC, CT, N ) IF( .NOT.SAME.OR.ERR.NE.ZERO )THEN WRITE( NOUT, FMT = 9989 )TRANSA, TRANSB, SAME, ERR - STOP + STOP 1 END IF TRANSB = 'T' CALL SMMCH( TRANSA, TRANSB, N, 1, N, ONE, AB, NMAX, @@ -254,7 +254,7 @@ PROGRAM SBLAT3 SAME = LSE( CC, CT, N ) IF( .NOT.SAME.OR.ERR.NE.ZERO )THEN WRITE( NOUT, FMT = 9989 )TRANSA, TRANSB, SAME, ERR - STOP + STOP 1 END IF DO 120 J = 1, N AB( J, NMAX + 1 ) = REAL( N - J + 1 ) @@ -272,7 +272,7 @@ PROGRAM SBLAT3 SAME = LSE( CC, CT, N ) IF( .NOT.SAME.OR.ERR.NE.ZERO )THEN WRITE( NOUT, FMT = 9989 )TRANSA, TRANSB, SAME, ERR - STOP + STOP 1 END IF TRANSB = 'T' CALL SMMCH( TRANSA, TRANSB, N, 1, N, ONE, AB, NMAX, @@ -281,7 +281,7 @@ PROGRAM SBLAT3 SAME = LSE( CC, CT, N ) IF( .NOT.SAME.OR.ERR.NE.ZERO )THEN WRITE( NOUT, FMT = 9989 )TRANSA, TRANSB, SAME, ERR - STOP + STOP 1 END IF * * Test each subroutine in turn. diff --git a/CBLAS/testing/c_zblat1.f b/CBLAS/testing/c_zblat1.f index a4f6a0a67..5952546ce 100644 --- a/CBLAS/testing/c_zblat1.f +++ b/CBLAS/testing/c_zblat1.f @@ -255,7 +255,7 @@ SUBROUTINE CHECK1(SFAC) CALL ITEST1(IZAMAXTEST(N,CX,INCX),ITRUE3(NP1)) ELSE WRITE (NOUT,*) ' Shouldn''t be here in CHECK1' - STOP + STOP 1 END IF * 40 CONTINUE @@ -596,7 +596,7 @@ SUBROUTINE CHECK2(SFAC) CALL CTEST(LENY,CY,CT10Y(1,KN,KI),CSIZE3,1.0D0) ELSE WRITE (NOUT,*) ' Shouldn''t be here in CHECK2' - STOP + STOP 1 END IF * 40 CONTINUE diff --git a/CBLAS/testing/c_zblat2.f b/CBLAS/testing/c_zblat2.f index cda64d6ad..9de95e7e6 100644 --- a/CBLAS/testing/c_zblat2.f +++ b/CBLAS/testing/c_zblat2.f @@ -247,7 +247,7 @@ PROGRAM ZBLAT2 $ GO TO 70 60 CONTINUE WRITE( NOUT, FMT = 9986 )SNAMET - STOP + STOP 1 70 LTEST( I ) = LTESTT GO TO 50 * @@ -287,7 +287,7 @@ PROGRAM ZBLAT2 SAME = LZE( YY, YT, N ) IF( .NOT.SAME.OR.ERR.NE.RZERO )THEN WRITE( NOUT, FMT = 9985 )TRANS, SAME, ERR - STOP + STOP 1 END IF TRANS = 'T' CALL ZMVCH( TRANS, N, N, ONE, A, NMAX, X, -1, ZERO, Y, -1, YT, G, @@ -295,7 +295,7 @@ PROGRAM ZBLAT2 SAME = LZE( YY, YT, N ) IF( .NOT.SAME.OR.ERR.NE.RZERO )THEN WRITE( NOUT, FMT = 9985 )TRANS, SAME, ERR - STOP + STOP 1 END IF * * Test each subroutine in turn. diff --git a/CBLAS/testing/c_zblat3.f b/CBLAS/testing/c_zblat3.f index 6a94941a9..84e9d21dd 100644 --- a/CBLAS/testing/c_zblat3.f +++ b/CBLAS/testing/c_zblat3.f @@ -201,7 +201,7 @@ PROGRAM ZBLAT3 $ GO TO 50 40 CONTINUE WRITE( NOUT, FMT = 9990 )SNAMET - STOP + STOP 1 50 LTEST( I ) = LTESTT GO TO 30 * @@ -244,7 +244,7 @@ PROGRAM ZBLAT3 SAME = LZE( CC, CT, N ) IF( .NOT.SAME.OR.ERR.NE.RZERO )THEN WRITE( NOUT, FMT = 9989 )TRANSA, TRANSB, SAME, ERR - STOP + STOP 1 END IF TRANSB = 'C' CALL ZMMCH( TRANSA, TRANSB, N, 1, N, ONE, AB, NMAX, @@ -253,7 +253,7 @@ PROGRAM ZBLAT3 SAME = LZE( CC, CT, N ) IF( .NOT.SAME.OR.ERR.NE.RZERO )THEN WRITE( NOUT, FMT = 9989 )TRANSA, TRANSB, SAME, ERR - STOP + STOP 1 END IF DO 120 J = 1, N AB( J, NMAX + 1 ) = N - J + 1 @@ -271,7 +271,7 @@ PROGRAM ZBLAT3 SAME = LZE( CC, CT, N ) IF( .NOT.SAME.OR.ERR.NE.RZERO )THEN WRITE( NOUT, FMT = 9989 )TRANSA, TRANSB, SAME, ERR - STOP + STOP 1 END IF TRANSB = 'C' CALL ZMMCH( TRANSA, TRANSB, N, 1, N, ONE, AB, NMAX, @@ -280,7 +280,7 @@ PROGRAM ZBLAT3 SAME = LZE( CC, CT, N ) IF( .NOT.SAME.OR.ERR.NE.RZERO )THEN WRITE( NOUT, FMT = 9989 )TRANSA, TRANSB, SAME, ERR - STOP + STOP 1 END IF * * Test each subroutine in turn. diff --git a/CMAKE/LAPACKTestHelpers.cmake b/CMAKE/LAPACKTestHelpers.cmake new file mode 100644 index 000000000..609f32045 --- /dev/null +++ b/CMAKE/LAPACKTestHelpers.cmake @@ -0,0 +1,158 @@ +# The test drivers ship their own XERBLA, which records the expected INFO and +# returns, and rely on it replacing the one in the library, which prints and +# stops. A shared library on Windows always calls the XERBLA it was linked +# with, so the first deliberate illegal argument stops the driver before any +# test runs. CBLAS skips its xerbla tests for the same reason, see +# CBLAS/testing. macOS binds a shared library with a two-level namespace by +# default, which keeps the override from taking effect in the same way; +# USE_FLAT_NAMESPACE restores it, see the top-level CMakeLists.txt. +# +# Recomputed on every configure, so that toggling BUILD_SHARED_LIBS in an +# existing build tree is picked up, but left alone when it was asked for on +# the command line: -D puts it in the cache, which defines it here. +if(NOT DEFINED LAPACK_SKIP_ERROR_EXIT_TESTS) + if(WIN32 AND BUILD_SHARED_LIBS) + set(LAPACK_SKIP_ERROR_EXIT_TESTS ON) + message(STATUS + "Disabling the error-exit tests: the test suite's XERBLA cannot replace " + "the one in a shared library on Windows") + elseif(APPLE AND BUILD_SHARED_LIBS AND NOT USE_FLAT_NAMESPACE) + set(LAPACK_SKIP_ERROR_EXIT_TESTS ON) + message(STATUS + "Disabling the error-exit tests: the test suite's XERBLA cannot replace " + "the one in a shared library bound with the default two-level namespace; " + "configure with -D USE_FLAT_NAMESPACE=ON to run them") + else() + set(LAPACK_SKIP_ERROR_EXIT_TESTS OFF) + endif() +endif() + +# nagfor folds expressions that deliberately manufacture an Inf or a NaN +# and then rejects the result ("Invalid operand for intrinsic SQRT ... Errors +# found during constant propagation"), so the test drivers that do that are +# built with constant propagation disabled. The compiler id and the flag it +# takes live here only. +# +# Read when this is called rather than when the file is included: the top +# level enables Fortran well after that, so CMAKE_Fortran_COMPILER_ID is +# still empty at include time. +function(lapack_no_constant_propagation_flag out_var) + if(CMAKE_Fortran_COMPILER_ID STREQUAL "NAG") + set(${out_var} "-Onopropagate" PARENT_SCOPE) + else() + set(${out_var} "" PARENT_SCOPE) + endif() +endfunction() + +# Disable it for the ?errcxx drivers among ARGN, which manufacture their NaN +# with SQRT( -ONE ). Call this with every source list such a driver is built +# from: the generated _64 and _TEST copies need it as much as the originals. +function(lapack_nag_disable_constant_propagation) + lapack_no_constant_propagation_flag(flag) + if(NOT flag) + return() + endif() + foreach(source IN LISTS ARGN) + get_filename_component(name "${source}" NAME) + if(name MATCHES "^[scdz]errcxx(_[A-Za-z0-9]+)*\\.f$") + set_source_files_properties("${source}" + PROPERTIES COMPILE_OPTIONS "${flag}") + endif() + endforeach() +endfunction() + +# The same for a whole target: the BLAS drivers take the special values they +# test from SXVALS and DXVALS, so there is no one source file to pick out by +# name here. +function(lapack_nag_disable_constant_propagation_target target) + lapack_no_constant_propagation_flag(flag) + if(NOT flag) + return() + endif() + target_compile_options(${target} PRIVATE "${flag}") +endfunction() + +# Set ${out_var} to the test input to feed to a test driver. Every driver +# that tests error exits reads a TSTERR flag from its input, so where those +# tests cannot run, or where DISABLE_ERROR_EXIT_TESTS asks for it anyway, +# this is a copy with the flag turned off; everywhere else, and for the +# drivers that take no input, it is ${input} itself. +# +# The copy goes to OUTPUT, or to the name of ${input} in the current binary +# directory. Write it where lapack_testing.py looks for that input, which is +# the directory holding the .out files of the tests that read it, so that +# running the drivers from the script uses the same input ctest does. +function(lapack_test_input out_var input) + cmake_parse_arguments(ARG "DISABLE_ERROR_EXIT_TESTS" "OUTPUT" "" ${ARGN}) + + set(rewritten "${ARG_OUTPUT}") + if(NOT rewritten) + get_filename_component(name "${input}" NAME) + set(rewritten "${CMAKE_CURRENT_BINARY_DIR}/${name}") + endif() + + set(content "") + set(disabled "") + if(EXISTS "${input}" AND + (LAPACK_SKIP_ERROR_EXIT_TESTS OR ARG_DISABLE_ERROR_EXIT_TESTS)) + # The rewrite happens at configure time, so ask CMake to re-run when + # ${input} changes; otherwise the build tree goes on serving a copy + # made from a version of it that no longer exists. + set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${input}") + file(READ "${input}" content) + string(REGEX REPLACE + "\n[ \t]*T([ \t]+[^\n]*(Put T to test the error exits|LOGICAL FLAG, T TO TEST ERROR EXITS))" + "\nF\\1" disabled "${content}") + endif() + + # Only a copy that differs is worth having. Everywhere else -- a build + # that runs the error exits, an input with no flag to turn off -- uses + # ${input} itself, and any copy an earlier configure left behind goes: + # lapack_testing.py --run prefers the copy in the build tree, so a stale + # one would feed the drivers what ctest never sees. + if(disabled STREQUAL content) + file(REMOVE "${rewritten}") + set(${out_var} "${input}" PARENT_SCOPE) + else() + file(WRITE "${rewritten}" "${disabled}") + set(${out_var} "${rewritten}" PARENT_SCOPE) + endif() +endfunction() + +# Build the ctest COMMAND that runs ${target}, optionally reading standard +# input from INPUT and writing standard output to OUTPUT. +# +# Under LAPACK_MEMORY_CHECK on Unix the command execs the executable, so the +# test runs as a single process. The cmake wrapper used otherwise starts the +# executable with execute_process(), which leaves valgrind with two processes +# writing to the one --log-file it was given, corrupting their records; exec +# replaces the shell instead of forking, so only one process ever writes. +# +# Everything else keeps the cmake wrapper. It needs no shell, it handles the +# per-configuration directory of multi-config generators, and it echoes the +# output of a failing test, which a bare exec cannot do. +function(lapack_runtest_command out_var target) + cmake_parse_arguments(ARG "" "INPUT;OUTPUT" "" ${ARGN}) + + if(UNIX AND LAPACK_MEMORY_CHECK) + set(command "exec \"$\"") + if(ARG_INPUT AND EXISTS "${ARG_INPUT}") + string(APPEND command " < \"${ARG_INPUT}\"") + endif() + if(ARG_OUTPUT) + string(APPEND command " > \"${ARG_OUTPUT}\" 2> \"${ARG_OUTPUT}.err\"") + endif() + set(${out_var} sh -c "${command}" PARENT_SCOPE) + else() + set(command "${CMAKE_COMMAND}" -DTEST=$) + if(ARG_INPUT AND EXISTS "${ARG_INPUT}") + list(APPEND command -DINPUT=${ARG_INPUT}) + endif() + if(ARG_OUTPUT) + list(APPEND command -DOUTPUT=${ARG_OUTPUT}) + endif() + list(APPEND command -DINTDIR=${CMAKE_CFG_INTDIR} + -P "${LAPACK_SOURCE_DIR}/TESTING/runtest.cmake") + set(${out_var} ${command} PARENT_SCOPE) + endif() +endfunction() diff --git a/CMAKE/RuntestCommand.cmake b/CMAKE/RuntestCommand.cmake deleted file mode 100644 index ad8fa7a5c..000000000 --- a/CMAKE/RuntestCommand.cmake +++ /dev/null @@ -1,37 +0,0 @@ -# Build the ctest COMMAND that runs ${target}, optionally reading standard -# input from INPUT and writing standard output to OUTPUT. -# -# Under LAPACK_MEMORY_CHECK on Unix the command execs the executable, so the -# test runs as a single process. The cmake wrapper used otherwise starts the -# executable with execute_process(), which leaves valgrind with two processes -# writing to the one --log-file it was given, corrupting their records; exec -# replaces the shell instead of forking, so only one process ever writes. -# -# Everything else keeps the cmake wrapper. It needs no shell, it handles the -# per-configuration directory of multi-config generators, and it echoes the -# output of a failing test, which a bare exec cannot do. -function(lapack_runtest_command out_var target) - cmake_parse_arguments(ARG "" "INPUT;OUTPUT" "" ${ARGN}) - - if(UNIX AND LAPACK_MEMORY_CHECK) - set(command "exec \"$\"") - if(ARG_INPUT) - string(APPEND command " < \"${ARG_INPUT}\"") - endif() - if(ARG_OUTPUT) - string(APPEND command " > \"${ARG_OUTPUT}\" 2> \"${ARG_OUTPUT}.err\"") - endif() - set(${out_var} sh -c "${command}" PARENT_SCOPE) - else() - set(command "${CMAKE_COMMAND}" -DTEST=$) - if(ARG_INPUT) - list(APPEND command -DINPUT=${ARG_INPUT}) - endif() - if(ARG_OUTPUT) - list(APPEND command -DOUTPUT=${ARG_OUTPUT}) - endif() - list(APPEND command -DINTDIR=${CMAKE_CFG_INTDIR} - -P "${LAPACK_SOURCE_DIR}/TESTING/runtest.cmake") - set(${out_var} ${command} PARENT_SCOPE) - endif() -endfunction() diff --git a/CMakeLists.txt b/CMakeLists.txt index cc7393183..9a3fcb34b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -62,6 +62,10 @@ function(lapack_add_coverage lib) target_link_libraries(${lib} PRIVATE gcov) endfunction() +set(LAPACK_TESTING_JUNIT_JOB_ID "" CACHE STRING + "Identifier of the job running the tests, prefixed to the JUnit report's names." ) +mark_as_advanced(LAPACK_TESTING_JUNIT_JOB_ID) + option(LAPACK_TESTING_USE_PYTHON "Use Python for testing. Disable it on memory checks." ON) option(LAPACK_MEMORY_CHECK "Configure the test suite for valgrind memory checking" OFF) if(LAPACK_MEMORY_CHECK) @@ -161,12 +165,6 @@ if(APPLE) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-flat_namespace") set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,-flat_namespace") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-flat_namespace") - else() - if(BUILD_SHARED_LIBS AND BUILD_TESTING) - message(WARNING - "LAPACK test suite might fail with shared libraries and the default two-level namespace. " - "Disable shared libraries or enable flat namespace for symbol resolution via -DUSE_FLAT_NAMESPACE=ON.") - endif() endif() endif() @@ -194,7 +192,7 @@ set(PKG_CONFIG_DIR ${CMAKE_INSTALL_LIBDIR}/pkgconfig) # Testing option(BUILD_TESTING "Build tests" ${_is_coverage_build}) include(CTest) -include(RuntestCommand) +include(LAPACKTestHelpers) message(STATUS "Build tests: ${BUILD_TESTING}") if(BUILD_TESTING) @@ -442,13 +440,24 @@ if(BUILD_TESTING AND Python3_EXECUTABLE AND LAPACK_TESTING_USE_PYTHON) _collect_tests("${LAPACK_SOURCE_DIR}" _all_tests) + # Without a job identifier the report keeps the plain suite and class names. + set(_summary_job_option "") + if(LAPACK_TESTING_JUNIT_JOB_ID) + set(_summary_job_option "--junit-job" "${LAPACK_TESTING_JUNIT_JOB_ID}") + endif() + file(COPY ${LAPACK_SOURCE_DIR}/lapack_testing.py DESTINATION ${LAPACK_BINARY_DIR}) + # The test drivers report a numerical failure in their output and still exit + # with a status of 0, so this is the test that fails the run when one of them + # found something: --fail-on-error turns any failure or error they reported + # into a nonzero exit status of the summary. add_test( NAME LAPACK_Test_Summary WORKING_DIRECTORY ${LAPACK_BINARY_DIR} COMMAND ${Python3_EXECUTABLE} "lapack_testing.py" - "--fail-if-empty" "--fail-on-unrecognized" "--merge-apis" - "--junit-xml" "lapack_testing_junit.xml" + "--fail-on-error" "--fail-if-empty" "--fail-on-empty-output" + "--fail-on-unrecognized" "--merge-apis" + "--junit-xml" "lapack_testing_junit.xml" ${_summary_job_option} ) if(_all_tests) @@ -456,6 +465,7 @@ if(BUILD_TESTING AND Python3_EXECUTABLE AND LAPACK_TESTING_USE_PYTHON) endif() endif() + #------------------------------------- # BLAS++ / LAPACK++ option(BLAS++ "Build BLAS++" OFF) diff --git a/LAPACKE/testing/CMakeLists.txt b/LAPACKE/testing/CMakeLists.txt index b52eaae88..9c33201c7 100644 --- a/LAPACKE/testing/CMakeLists.txt +++ b/LAPACKE/testing/CMakeLists.txt @@ -40,7 +40,8 @@ endif() # different leading-dimension semantics (LDA >= N instead of LDA >= M), and # the high-level interface ignores the caller's workspace so LWORK error # exits cannot fire. The other flavors read a generated input with the -# error-exit tests disabled. +# error-exit tests disabled, and so does that one where the platform cannot +# run them at all. set(_lapacke_test_out_dir ${LAPACK_BINARY_DIR}/TESTING/lapacke) file(MAKE_DIRECTORY ${_lapacke_test_out_dir}) @@ -57,20 +58,22 @@ foreach(_prec IN LISTS LAPACKE_TEST_PRECISIONS) SUFFIX "_TEST" ${_allowlist_args} NO_STRING_REPLACEMENTS) + lapack_nag_disable_constant_propagation(${_lin_sources_test}) - file(READ ${LAPACK_SOURCE_DIR}/TESTING/${_prec}test.in _test_in_content) - string(REPLACE - "T Put T to test the error exits" - "F Put T to test the error exits" - _test_in_noerr_content "${_test_in_content}") - file(WRITE ${_lapacke_test_out_dir}/${_prec}test_noerr.in "${_test_in_noerr_content}") + lapack_test_input(_test_input + "${LAPACK_SOURCE_DIR}/TESTING/${_prec}test.in" + OUTPUT "${_lapacke_test_out_dir}/${_prec}test.in") + lapack_test_input(_test_input_noerr + "${LAPACK_SOURCE_DIR}/TESTING/${_prec}test.in" + DISABLE_ERROR_EXIT_TESTS + OUTPUT "${_lapacke_test_out_dir}/${_prec}test_noerr.in") if(BUILD_DEFAULT_API) add_library(xlintst${_prec}_lapacke_core OBJECT ${_lin_sources_test}) foreach(_layer work high) foreach(_layout cm rm) - set(_driver xlintst${_prec}_lapacke_${_layer}_${_layout}) + set(_driver xlintst${_prec}_${_layer}_${_layout}) add_executable(${_driver} $) @@ -79,18 +82,15 @@ foreach(_prec IN LISTS LAPACKE_TEST_PRECISIONS) lapacke_test_wrappers_${_layer}_${_layout} ${TMGLIB} ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES}) + set(_output "${_lapacke_test_out_dir}/${_prec}test_${_layer}_${_layout}.out") if(_layer STREQUAL "work" AND _layout STREQUAL "cm") - set(_input ${LAPACK_SOURCE_DIR}/TESTING/${_prec}test.in) + set(_input "${_test_input}") else() - set(_input ${_lapacke_test_out_dir}/${_prec}test_noerr.in) + set(_input "${_test_input_noerr}") endif() - add_test(NAME LAPACK-${_driver}_${_prec}test_in - COMMAND "${CMAKE_COMMAND}" - -DTEST=$ - -DINPUT=${_input} - -DOUTPUT=${_lapacke_test_out_dir}/${_prec}test_${_layer}_${_layout}.out - -DINTDIR=${CMAKE_CFG_INTDIR} - -P "${LAPACK_SOURCE_DIR}/TESTING/runtest.cmake") + lapack_runtest_command(_test_command ${_driver} + INPUT "${_input}" OUTPUT "${_output}") + add_test(NAME LAPACKE-${_driver}_${_prec}test_in COMMAND ${_test_command}) endforeach() endforeach() endif() @@ -103,6 +103,7 @@ foreach(_prec IN LISTS LAPACKE_TEST_PRECISIONS) generate_suffixed_sources(xlintst${_prec}_lapacke_TEST _lin_sources_test _lin_sources_test_64 SUFFIX "_64") + lapack_nag_disable_constant_propagation(${_lin_sources_test_64}) add_library(xlintst${_prec}_lapacke_core_64 OBJECT ${_lin_sources_test_64}) target_compile_options(xlintst${_prec}_lapacke_core_64 @@ -110,7 +111,7 @@ foreach(_prec IN LISTS LAPACKE_TEST_PRECISIONS) foreach(_layer work high) foreach(_layout cm rm) - set(_driver xlintst${_prec}_lapacke_${_layer}_${_layout}_64) + set(_driver xlintst${_prec}_${_layer}_${_layout}_64) add_executable(${_driver} $) @@ -119,18 +120,15 @@ foreach(_prec IN LISTS LAPACKE_TEST_PRECISIONS) lapacke_test_wrappers_${_layer}_${_layout}_64 ${TMGLIB} ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES}) + set(_output "${_lapacke_test_out_dir}/${_prec}test_${_layer}_${_layout}_64.out") if(_layer STREQUAL "work" AND _layout STREQUAL "cm") - set(_input ${LAPACK_SOURCE_DIR}/TESTING/${_prec}test.in) + set(_input "${_test_input}") else() - set(_input ${_lapacke_test_out_dir}/${_prec}test_noerr.in) + set(_input "${_test_input_noerr}") endif() - add_test(NAME LAPACK-${_driver}_${_prec}test_in - COMMAND "${CMAKE_COMMAND}" - -DTEST=$ - -DINPUT=${_input} - -DOUTPUT=${_lapacke_test_out_dir}/${_prec}test_${_layer}_${_layout}_64.out - -DINTDIR=${CMAKE_CFG_INTDIR} - -P "${LAPACK_SOURCE_DIR}/TESTING/runtest.cmake") + lapack_runtest_command(_test_command ${_driver} + INPUT "${_input}" OUTPUT "${_output}") + add_test(NAME LAPACKE-${_driver}_${_prec}test_in COMMAND ${_test_command}) endforeach() endforeach() endif() diff --git a/TESTING/CMakeLists.txt b/TESTING/CMakeLists.txt index 8834ea512..7951440bb 100644 --- a/TESTING/CMakeLists.txt +++ b/TESTING/CMakeLists.txt @@ -15,18 +15,13 @@ add_subdirectory(EIG) function(_add_lapack_test output input target) - set(TEST_INPUT "${LAPACK_SOURCE_DIR}/TESTING/${input}") + lapack_test_input(TEST_INPUT "${LAPACK_SOURCE_DIR}/TESTING/${input}") set(TEST_OUTPUT "${LAPACK_BINARY_DIR}/TESTING/${output}") + string(REPLACE "." "_" input_name ${input}) - set(testName "${target}_${input_name}") - if(EXISTS "${TEST_INPUT}") - lapack_runtest_command(test_command ${target} - INPUT "${TEST_INPUT}" OUTPUT "${TEST_OUTPUT}") - add_test(NAME LAPACK-${testName} COMMAND ${test_command}) - else() - lapack_runtest_command(test_command ${target} OUTPUT "${TEST_OUTPUT}") - add_test(NAME LAPACK-${testName} COMMAND ${test_command}) - endif() + lapack_runtest_command(test_command ${target} + INPUT "${TEST_INPUT}" OUTPUT "${TEST_OUTPUT}") + add_test(NAME LAPACK-${target}_${input_name} COMMAND ${test_command}) endfunction() function(add_lapack_test output input target) diff --git a/TESTING/EIG/alareq.f b/TESTING/EIG/alareq.f index 25ff484e4..fe4e5d596 100644 --- a/TESTING/EIG/alareq.f +++ b/TESTING/EIG/alareq.f @@ -212,7 +212,7 @@ SUBROUTINE ALAREQ( PATH, NMATS, DOTYPE, NTYPES, NIN, NOUT ) 9994 FORMAT( ' ==> Specify ', I4, ' matrix types on this line or ', $ 'adjust NTYPES on previous line' ) WRITE( NOUT, FMT = * ) - STOP + STOP 1 * * End of ALAREQ * diff --git a/TESTING/EIG/alarqg.f b/TESTING/EIG/alarqg.f index 321e8b642..e864b187b 100644 --- a/TESTING/EIG/alarqg.f +++ b/TESTING/EIG/alarqg.f @@ -212,7 +212,7 @@ SUBROUTINE ALARQG( PATH, NMATS, DOTYPE, NTYPES, NIN, NOUT ) 9994 FORMAT( ' ==> Specify ', I4, ' matrix types on this line or ', $ 'adjust NTYPES on previous line' ) WRITE( NOUT, FMT = * ) - STOP + STOP 1 * * End of ALARQG * diff --git a/TESTING/EIG/cchkdmd.f90 b/TESTING/EIG/cchkdmd.f90 index bef8771cb..79a4a5f6e 100644 --- a/TESTING/EIG/cchkdmd.f90 +++ b/TESTING/EIG/cchkdmd.f90 @@ -147,7 +147,7 @@ PROGRAM DMD_TEST ! Test the dimensions IF ( ( MIN(M,N) == 0 ) .OR. ( M < N ) ) THEN WRITE(*,*) 'Bad dimensions. Required: M >= N > 0.' - STOP + STOP 1 END IF !............. ! The seed inside the LLOOP so that each pass can be reproduced easily. @@ -352,7 +352,7 @@ PROGRAM DMD_TEST WRITE(*,*) 'The input parameters were ', & SCALE, JOBZ, RESIDS, JOBREF, WHTSVD, & M, N, LDX, LDY, NRNK, TOL, LDZ, LDAU, LDW, LDS - STOP + STOP 1 ELSE !WRITE(*,*) '... done. Workspace length computed.' END IF @@ -376,7 +376,7 @@ PROGRAM DMD_TEST WRITE(*,*) 'The input parameters were ',& SCALE, JOBZ, RESIDS, JOBREF, WHTSVD, & M, N, LDX, LDY, NRNK, TOL - STOP + STOP 1 END IF SINGVX(1:N) = WORK(1:N) @@ -527,7 +527,7 @@ PROGRAM DMD_TEST WRITE(*,*) 'The input parameters were ',& SCALE, JOBZ, RESIDS, WANTQ, WANTR, WHTSVD, & M, N, LDX, LDY, NRNK, TOL - STOP + STOP 1 END IF SINGVQX(1:N) =WORK(1:N) diff --git a/TESTING/EIG/cchkee.F b/TESTING/EIG/cchkee.F index 8e56dd997..a1f82400a 100644 --- a/TESTING/EIG/cchkee.F +++ b/TESTING/EIG/cchkee.F @@ -769,7 +769,10 @@ *> printed about each test for which the test ratio is greater *> than or equal to the threshold. *> -*> lines 3-EOF: +*> line 3: TSTERR, LOGICAL +*> Flag indicating whether or not to test the error exits. +*> +*> lines 4-EOF: *> *> Input for testing the eigencondition routines consists of a set of *> specially constructed test cases and their solutions. The data @@ -1138,17 +1141,35 @@ PROGRAM CCHKEE * .. Allocate memory dynamically .. * ALLOCATE ( S(NMAX*NMAX), STAT = AllocateStatus ) - IF (AllocateStatus /= 0) STOP "*** Not enough memory ***" + IF (AllocateStatus /= 0) THEN + WRITE( NOUT, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( A(NMAX*NMAX,NEED), STAT = AllocateStatus ) - IF (AllocateStatus /= 0) STOP "*** Not enough memory ***" + IF (AllocateStatus /= 0) THEN + WRITE( NOUT, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( B(NMAX*NMAX,5), STAT = AllocateStatus ) - IF (AllocateStatus /= 0) STOP "*** Not enough memory ***" + IF (AllocateStatus /= 0) THEN + WRITE( NOUT, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( C(NCMAX*NCMAX,NCMAX*NCMAX), STAT = AllocateStatus ) - IF (AllocateStatus /= 0) STOP "*** Not enough memory ***" + IF (AllocateStatus /= 0) THEN + WRITE( NOUT, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( RWORK(LWORK), STAT = AllocateStatus ) - IF (AllocateStatus /= 0) STOP "*** Not enough memory ***" + IF (AllocateStatus /= 0) THEN + WRITE( NOUT, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( WORK(LWORK), STAT = AllocateStatus ) - IF (AllocateStatus /= 0) STOP "*** Not enough memory ***" + IF (AllocateStatus /= 0) THEN + WRITE( NOUT, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF * .. * .. Executable Statements .. * @@ -1264,9 +1285,9 @@ PROGRAM CCHKEE * CEC: Eigencondition estimation * READ( NIN, FMT = * )THRESH + READ( NIN, FMT = * )TSTERR CALL XLAENV( 1, 1 ) CALL XLAENV( 12, 1 ) - TSTERR = .TRUE. CALL CCHKEC( THRESH, TSTERR, NIN, NOUT ) GO TO 380 ELSE @@ -1726,7 +1747,7 @@ PROGRAM CCHKEE * IF( FATAL ) THEN WRITE( NOUT, FMT = 9999 ) - STOP + STOP 1 END IF * * Read the input lines indicating the test path and its parameters. diff --git a/TESTING/EIG/csyl01.f b/TESTING/EIG/csyl01.f index 8a3cd1ae5..e523caaee 100644 --- a/TESTING/EIG/csyl01.f +++ b/TESTING/EIG/csyl01.f @@ -143,17 +143,35 @@ SUBROUTINE CSYL01( THRESH, NFAIL, RMAX, NINFO, KNT ) * .. * .. Allocate memory dynamically .. ALLOCATE ( A( MAXM, MAXM ), STAT = AllocateStatus ) - IF( AllocateStatus /= 0 ) STOP "*** Not enough memory ***" + IF( AllocateStatus /= 0 ) THEN + WRITE( *, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( B( MAXN, MAXN ), STAT = AllocateStatus ) - IF( AllocateStatus /= 0 ) STOP "*** Not enough memory ***" + IF( AllocateStatus /= 0 ) THEN + WRITE( *, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( C( MAXM, MAXN ), STAT = AllocateStatus ) - IF( AllocateStatus /= 0 ) STOP "*** Not enough memory ***" + IF( AllocateStatus /= 0 ) THEN + WRITE( *, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( CC( MAXM, MAXN ), STAT = AllocateStatus ) - IF( AllocateStatus /= 0 ) STOP "*** Not enough memory ***" + IF( AllocateStatus /= 0 ) THEN + WRITE( *, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( X( MAXM, MAXN ), STAT = AllocateStatus ) - IF( AllocateStatus /= 0 ) STOP "*** Not enough memory ***" + IF( AllocateStatus /= 0 ) THEN + WRITE( *, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( SWORK( LDSWORK, 54 ), STAT = AllocateStatus ) - IF( AllocateStatus /= 0 ) STOP "*** Not enough memory ***" + IF( AllocateStatus /= 0 ) THEN + WRITE( *, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF * .. * .. Executable Statements .. * diff --git a/TESTING/EIG/dchkdmd.f90 b/TESTING/EIG/dchkdmd.f90 index 5213008b2..dbabc7e7a 100644 --- a/TESTING/EIG/dchkdmd.f90 +++ b/TESTING/EIG/dchkdmd.f90 @@ -156,7 +156,7 @@ PROGRAM DMD_TEST ! ... Test the dimensions IF ( ( MIN(M,N) == 0 ) .OR. ( M < N ) ) THEN WRITE(*,*) 'Bad dimensions. Required: M >= N > 0.' - STOP + STOP 1 END IF !............. ! The seed inside the LLOOP so that each pass can be reproduced easily. @@ -660,7 +660,7 @@ PROGRAM DMD_TEST NFAIL_REZQ = NFAIL_REZQ + 1 WRITE(*,*) '................ DGEDMDQ FAILED!', & 'Check the code for implementation errors.' - STOP + STOP 1 END IF END IF diff --git a/TESTING/EIG/dchkee.F b/TESTING/EIG/dchkee.F index 07bb24e9f..c62aa2065 100644 --- a/TESTING/EIG/dchkee.F +++ b/TESTING/EIG/dchkee.F @@ -775,7 +775,10 @@ *> printed about each test for which the test ratio is greater *> than or equal to the threshold. *> -*> lines 3-EOF: +*> line 3: TSTERR, LOGICAL +*> Flag indicating whether or not to test the error exits. +*> +*> lines 4-EOF: *> *> Input for testing the eigencondition routines consists of a set of *> specially constructed test cases and their solutions. The data @@ -1141,13 +1144,25 @@ PROGRAM DCHKEE * .. Allocate memory dynamically .. * ALLOCATE ( A(NMAX*NMAX,NEED), STAT = AllocateStatus ) - IF (AllocateStatus /= 0) STOP "*** Not enough memory ***" + IF (AllocateStatus /= 0) THEN + WRITE( NOUT, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( B(NMAX*NMAX,5), STAT = AllocateStatus ) - IF (AllocateStatus /= 0) STOP "*** Not enough memory ***" + IF (AllocateStatus /= 0) THEN + WRITE( NOUT, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( C(NCMAX*NCMAX,NCMAX*NCMAX), STAT = AllocateStatus ) - IF (AllocateStatus /= 0) STOP "*** Not enough memory ***" + IF (AllocateStatus /= 0) THEN + WRITE( NOUT, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( WORK(LWORK), STAT = AllocateStatus ) - IF (AllocateStatus /= 0) STOP "*** Not enough memory ***" + IF (AllocateStatus /= 0) THEN + WRITE( NOUT, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF * .. * .. Executable Statements .. * @@ -1263,13 +1278,13 @@ PROGRAM DCHKEE * DEC: Eigencondition estimation * READ( NIN, FMT = * )THRESH + READ( NIN, FMT = * )TSTERR CALL XLAENV( 1, 1 ) CALL XLAENV( 12, 11 ) CALL XLAENV( 13, 2 ) CALL XLAENV( 14, 0 ) CALL XLAENV( 15, 2 ) CALL XLAENV( 16, 2 ) - TSTERR = .TRUE. CALL DCHKEC( THRESH, TSTERR, NIN, NOUT ) GO TO 10 ELSE @@ -1730,7 +1745,7 @@ PROGRAM DCHKEE * IF( FATAL ) THEN WRITE( NOUT, FMT = 9999 ) - STOP + STOP 1 END IF * * Read the input lines indicating the test path and its parameters. diff --git a/TESTING/EIG/dsyl01.f b/TESTING/EIG/dsyl01.f index 66fa4c074..05c44d124 100644 --- a/TESTING/EIG/dsyl01.f +++ b/TESTING/EIG/dsyl01.f @@ -140,17 +140,35 @@ SUBROUTINE DSYL01( THRESH, NFAIL, RMAX, NINFO, KNT ) * .. * .. Allocate memory dynamically .. ALLOCATE ( A( MAXM, MAXM ), STAT = AllocateStatus ) - IF( AllocateStatus /= 0 ) STOP "*** Not enough memory ***" + IF( AllocateStatus /= 0 ) THEN + WRITE( *, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( B( MAXN, MAXN ), STAT = AllocateStatus ) - IF( AllocateStatus /= 0 ) STOP "*** Not enough memory ***" + IF( AllocateStatus /= 0 ) THEN + WRITE( *, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( C( MAXM, MAXN ), STAT = AllocateStatus ) - IF( AllocateStatus /= 0 ) STOP "*** Not enough memory ***" + IF( AllocateStatus /= 0 ) THEN + WRITE( *, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( CC( MAXM, MAXN ), STAT = AllocateStatus ) - IF( AllocateStatus /= 0 ) STOP "*** Not enough memory ***" + IF( AllocateStatus /= 0 ) THEN + WRITE( *, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( X( MAXM, MAXN ), STAT = AllocateStatus ) - IF( AllocateStatus /= 0 ) STOP "*** Not enough memory ***" + IF( AllocateStatus /= 0 ) THEN + WRITE( *, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( SWORK( LDSWORK, 126 ), STAT = AllocateStatus ) - IF( AllocateStatus /= 0 ) STOP "*** Not enough memory ***" + IF( AllocateStatus /= 0 ) THEN + WRITE( *, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF * .. * .. Executable Statements .. * diff --git a/TESTING/EIG/schkdmd.f90 b/TESTING/EIG/schkdmd.f90 index f21dd2447..2a708dfd8 100644 --- a/TESTING/EIG/schkdmd.f90 +++ b/TESTING/EIG/schkdmd.f90 @@ -156,7 +156,7 @@ PROGRAM DMD_TEST ! ... Test the dimensions IF ( ( MIN(M,N) == 0 ) .OR. ( M < N ) ) THEN WRITE(*,*) 'Bad dimensions. Required: M >= N > 0.' - STOP + STOP 1 END IF !............. ! The seed inside the LLOOP so that each pass can be reproduced easily. diff --git a/TESTING/EIG/schkee.F b/TESTING/EIG/schkee.F index 4fa913e30..e9c560ee9 100644 --- a/TESTING/EIG/schkee.F +++ b/TESTING/EIG/schkee.F @@ -775,7 +775,10 @@ *> printed about each test for which the test ratio is greater *> than or equal to the threshold. *> -*> lines 3-EOF: +*> line 3: TSTERR, LOGICAL +*> Flag indicating whether or not to test the error exits. +*> +*> lines 4-EOF: *> *> Input for testing the eigencondition routines consists of a set of *> specially constructed test cases and their solutions. The data @@ -1141,13 +1144,25 @@ PROGRAM SCHKEE * .. Allocate memory dynamically .. * ALLOCATE ( A(NMAX*NMAX,NEED), STAT = AllocateStatus ) - IF (AllocateStatus /= 0) STOP "*** Not enough memory ***" + IF (AllocateStatus /= 0) THEN + WRITE( NOUT, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( B(NMAX*NMAX,5), STAT = AllocateStatus ) - IF (AllocateStatus /= 0) STOP "*** Not enough memory ***" + IF (AllocateStatus /= 0) THEN + WRITE( NOUT, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( C(NCMAX*NCMAX,NCMAX*NCMAX), STAT = AllocateStatus ) - IF (AllocateStatus /= 0) STOP "*** Not enough memory ***" + IF (AllocateStatus /= 0) THEN + WRITE( NOUT, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( WORK(LWORK), STAT = AllocateStatus ) - IF (AllocateStatus /= 0) STOP "*** Not enough memory ***" + IF (AllocateStatus /= 0) THEN + WRITE( NOUT, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF * .. * .. Executable Statements .. * @@ -1264,13 +1279,13 @@ PROGRAM SCHKEE * SEC: Eigencondition estimation * READ( NIN, FMT = * )THRESH + READ( NIN, FMT = * )TSTERR CALL XLAENV( 1, 1 ) CALL XLAENV( 12, 11 ) CALL XLAENV( 13, 2 ) CALL XLAENV( 14, 0 ) CALL XLAENV( 15, 2 ) CALL XLAENV( 16, 2 ) - TSTERR = .TRUE. CALL SCHKEC( THRESH, TSTERR, NIN, NOUT ) GO TO 10 ELSE @@ -1731,7 +1746,7 @@ PROGRAM SCHKEE * IF( FATAL ) THEN WRITE( NOUT, FMT = 9999 ) - STOP + STOP 1 END IF * * Read the input lines indicating the test path and its parameters. diff --git a/TESTING/EIG/ssyl01.f b/TESTING/EIG/ssyl01.f index fda30a3c0..6ceab483d 100644 --- a/TESTING/EIG/ssyl01.f +++ b/TESTING/EIG/ssyl01.f @@ -140,17 +140,35 @@ SUBROUTINE SSYL01( THRESH, NFAIL, RMAX, NINFO, KNT ) * .. * .. Allocate memory dynamically .. ALLOCATE ( A( MAXM, MAXM ), STAT = AllocateStatus ) - IF( AllocateStatus /= 0 ) STOP "*** Not enough memory ***" + IF( AllocateStatus /= 0 ) THEN + WRITE( *, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( B( MAXN, MAXN ), STAT = AllocateStatus ) - IF( AllocateStatus /= 0 ) STOP "*** Not enough memory ***" + IF( AllocateStatus /= 0 ) THEN + WRITE( *, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( C( MAXM, MAXN ), STAT = AllocateStatus ) - IF( AllocateStatus /= 0 ) STOP "*** Not enough memory ***" + IF( AllocateStatus /= 0 ) THEN + WRITE( *, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( CC( MAXM, MAXN ), STAT = AllocateStatus ) - IF( AllocateStatus /= 0 ) STOP "*** Not enough memory ***" + IF( AllocateStatus /= 0 ) THEN + WRITE( *, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( X( MAXM, MAXN ), STAT = AllocateStatus ) - IF( AllocateStatus /= 0 ) STOP "*** Not enough memory ***" + IF( AllocateStatus /= 0 ) THEN + WRITE( *, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( SWORK( LDSWORK, 54 ), STAT = AllocateStatus ) - IF( AllocateStatus /= 0 ) STOP "*** Not enough memory ***" + IF( AllocateStatus /= 0 ) THEN + WRITE( *, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF * .. * .. Executable Statements .. * diff --git a/TESTING/EIG/zchkdmd.f90 b/TESTING/EIG/zchkdmd.f90 index a6b1ec519..ff67175c0 100644 --- a/TESTING/EIG/zchkdmd.f90 +++ b/TESTING/EIG/zchkdmd.f90 @@ -147,7 +147,7 @@ PROGRAM DMD_TEST ! ... Test the dimensions IF ( ( MIN(M,N) == 0 ) .OR. ( M < N ) ) THEN WRITE(*,*) 'Bad dimensions. Required: M >= N > 0.' - STOP + STOP 1 END IF !............. ! The seed inside the LLOOP so that each pass can be reproduced easily. @@ -355,7 +355,7 @@ PROGRAM DMD_TEST WRITE(*,*) 'The input parameters were ', & SCALE, JOBZ, RESIDS, JOBREF, WHTSVD, & M, N, LDX, LDY, NRNK, TOL, LDZ, LDAU, LDW, LDS - STOP + STOP 1 END IF LZWORK = INT(ZDUMMY(LWMINOPT)) @@ -379,7 +379,7 @@ PROGRAM DMD_TEST WRITE(*,*) 'The input parameters were ',& SCALE, JOBZ, RESIDS, JOBREF, WHTSVD, & M, N, LDX, LDY, NRNK, TOL - STOP + STOP 1 END IF SINGVX(1:N) = WORK(1:N) @@ -535,7 +535,7 @@ PROGRAM DMD_TEST WRITE(*,*) 'The input parameters were ',& SCALE, JOBZ, RESIDS, WANTQ, WANTR, WHTSVD, & M, N, LDX, LDY, NRNK, TOL - STOP + STOP 1 END IF SINGVQX(1:N) = WORK(1:N) @@ -606,7 +606,7 @@ PROGRAM DMD_TEST NFAIL_REZQ = NFAIL_REZQ + 1 WRITE(*,*) '................ ZGEDMDQ FAILED!', & 'Check the code for implementation errors.' - STOP + STOP 1 END IF END IF diff --git a/TESTING/EIG/zchkee.F b/TESTING/EIG/zchkee.F index ec5d68c28..b00a41272 100644 --- a/TESTING/EIG/zchkee.F +++ b/TESTING/EIG/zchkee.F @@ -769,7 +769,10 @@ *> printed about each test for which the test ratio is greater *> than or equal to the threshold. *> -*> lines 3-EOF: +*> line 3: TSTERR, LOGICAL +*> Flag indicating whether or not to test the error exits. +*> +*> lines 4-EOF: *> *> Input for testing the eigencondition routines consists of a set of *> specially constructed test cases and their solutions. The data @@ -1138,17 +1141,35 @@ PROGRAM ZCHKEE * .. Allocate memory dynamically .. * ALLOCATE ( S(NMAX*NMAX), STAT = AllocateStatus ) - IF (AllocateStatus /= 0) STOP "*** Not enough memory ***" + IF (AllocateStatus /= 0) THEN + WRITE( NOUT, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( A(NMAX*NMAX,NEED), STAT = AllocateStatus ) - IF (AllocateStatus /= 0) STOP "*** Not enough memory ***" + IF (AllocateStatus /= 0) THEN + WRITE( NOUT, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( B(NMAX*NMAX,5), STAT = AllocateStatus ) - IF (AllocateStatus /= 0) STOP "*** Not enough memory ***" + IF (AllocateStatus /= 0) THEN + WRITE( NOUT, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( C(NCMAX*NCMAX,NCMAX*NCMAX), STAT = AllocateStatus ) - IF (AllocateStatus /= 0) STOP "*** Not enough memory ***" + IF (AllocateStatus /= 0) THEN + WRITE( NOUT, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( RWORK(LWORK), STAT = AllocateStatus ) - IF (AllocateStatus /= 0) STOP "*** Not enough memory ***" + IF (AllocateStatus /= 0) THEN + WRITE( NOUT, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( WORK(LWORK), STAT = AllocateStatus ) - IF (AllocateStatus /= 0) STOP "*** Not enough memory ***" + IF (AllocateStatus /= 0) THEN + WRITE( NOUT, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF * .. * .. Executable Statements .. * @@ -1264,9 +1285,9 @@ PROGRAM ZCHKEE * ZEC: Eigencondition estimation * READ( NIN, FMT = * )THRESH + READ( NIN, FMT = * )TSTERR CALL XLAENV( 1, 1 ) CALL XLAENV( 12, 1 ) - TSTERR = .TRUE. CALL ZCHKEC( THRESH, TSTERR, NIN, NOUT ) GO TO 380 ELSE @@ -1726,7 +1747,7 @@ PROGRAM ZCHKEE * IF( FATAL ) THEN WRITE( NOUT, FMT = 9999 ) - STOP + STOP 1 END IF * * Read the input lines indicating the test path and its parameters. diff --git a/TESTING/EIG/zsyl01.f b/TESTING/EIG/zsyl01.f index 5d26d494c..c15acc4bf 100644 --- a/TESTING/EIG/zsyl01.f +++ b/TESTING/EIG/zsyl01.f @@ -143,17 +143,35 @@ SUBROUTINE ZSYL01( THRESH, NFAIL, RMAX, NINFO, KNT ) * .. * .. Allocate memory dynamically .. ALLOCATE ( A( MAXM, MAXM ), STAT = AllocateStatus ) - IF( AllocateStatus /= 0 ) STOP "*** Not enough memory ***" + IF( AllocateStatus /= 0 ) THEN + WRITE( *, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( B( MAXN, MAXN ), STAT = AllocateStatus ) - IF( AllocateStatus /= 0 ) STOP "*** Not enough memory ***" + IF( AllocateStatus /= 0 ) THEN + WRITE( *, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( C( MAXM, MAXN ), STAT = AllocateStatus ) - IF( AllocateStatus /= 0 ) STOP "*** Not enough memory ***" + IF( AllocateStatus /= 0 ) THEN + WRITE( *, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( CC( MAXM, MAXN ), STAT = AllocateStatus ) - IF( AllocateStatus /= 0 ) STOP "*** Not enough memory ***" + IF( AllocateStatus /= 0 ) THEN + WRITE( *, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( X( MAXM, MAXN ), STAT = AllocateStatus ) - IF( AllocateStatus /= 0 ) STOP "*** Not enough memory ***" + IF( AllocateStatus /= 0 ) THEN + WRITE( *, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( SWORK( LDSWORK, 103 ), STAT = AllocateStatus ) - IF( AllocateStatus /= 0 ) STOP "*** Not enough memory ***" + IF( AllocateStatus /= 0 ) THEN + WRITE( *, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF * .. * .. Executable Statements .. * diff --git a/TESTING/LIN/CMakeLists.txt b/TESTING/LIN/CMakeLists.txt index b72a30b32..2313fa0c4 100644 --- a/TESTING/LIN/CMakeLists.txt +++ b/TESTING/LIN/CMakeLists.txt @@ -221,13 +221,8 @@ else() set(ZXLINTST ${ZLINTST_NO_XBLAS}) endif() -# Disable constant propagation for NAG compiler to avoid issues with -# creating NaN values in the CXX error-exit tests. -if(CMAKE_Fortran_COMPILER_ID STREQUAL "NAG") - set_source_files_properties( - serrcxx.f cerrcxx.f derrcxx.f zerrcxx.f - PROPERTIES COMPILE_OPTIONS "-Onopropagate") -endif() +lapack_nag_disable_constant_propagation( + serrcxx.f cerrcxx.f derrcxx.f zerrcxx.f) set(DSLINTST dchkab.f ddrvab.f ddrvac.f derrab.f derrac.f dget08.f @@ -275,18 +270,7 @@ function(add_lin_executable name) if(BUILD_INDEX64_EXT_API) include(ExtendedAPIHelpers) generate_64bit_suffixed_sources(${name} ext_sources ext_sources_64) - - # Disable constant propagation for NAG compiler to avoid issues with - # creating NaN values in the CXX error-exit tests. - if(CMAKE_Fortran_COMPILER_ID STREQUAL "NAG") - foreach(source IN LISTS ext_sources_64) - get_filename_component(source_name "${source}" NAME) - if(source_name MATCHES "^[scdz]errcxx_64\\.f$") - set_source_files_properties( - "${source}" PROPERTIES COMPILE_OPTIONS "-Onopropagate") - endif() - endforeach() - endif() + lapack_nag_disable_constant_propagation(${ext_sources_64}) add_executable(${name}_64 ${ext_sources_64}) target_compile_options(${name}_64 PRIVATE ${FOPT_ILP64}) diff --git a/TESTING/LIN/alareq.f b/TESTING/LIN/alareq.f index e30578c46..c15a0a258 100644 --- a/TESTING/LIN/alareq.f +++ b/TESTING/LIN/alareq.f @@ -212,7 +212,7 @@ SUBROUTINE ALAREQ( PATH, NMATS, DOTYPE, NTYPES, NIN, NOUT ) 9994 FORMAT( ' ==> Specify ', I4, ' matrix types on this line or ', $ 'adjust NTYPES on previous line' ) WRITE( NOUT, FMT = * ) - STOP + STOP 1 * * End of ALAREQ * diff --git a/TESTING/LIN/cchkaa.F b/TESTING/LIN/cchkaa.F index 60d2524c4..ac181df8c 100644 --- a/TESTING/LIN/cchkaa.F +++ b/TESTING/LIN/cchkaa.F @@ -204,19 +204,40 @@ PROGRAM CCHKAA * .. Allocate memory dynamically .. * ALLOCATE ( IWORK( 34*NMAX ), STAT = AllocateStatus ) - IF (AllocateStatus /= 0) STOP "*** Not enough memory ***" + IF (AllocateStatus /= 0) THEN + WRITE( NOUT, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( A( ( KDMAX+1 )*NMAX, 8 ), STAT = AllocateStatus ) - IF (AllocateStatus /= 0) STOP "*** Not enough memory ***" + IF (AllocateStatus /= 0) THEN + WRITE( NOUT, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( B( NMAX*MAXRHS, 4 ), STAT = AllocateStatus ) - IF (AllocateStatus /= 0) STOP "*** Not enough memory ***" + IF (AllocateStatus /= 0) THEN + WRITE( NOUT, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( WORK( NMAX, NMAX+MAXRHS+10 ), STAT = AllocateStatus ) - IF (AllocateStatus /= 0) STOP "*** Not enough memory ***" + IF (AllocateStatus /= 0) THEN + WRITE( NOUT, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( E( NMAX ), STAT = AllocateStatus ) - IF (AllocateStatus /= 0) STOP "*** Not enough memory ***" + IF (AllocateStatus /= 0) THEN + WRITE( NOUT, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( S( 2*NMAX ), STAT = AllocateStatus) - IF (AllocateStatus /= 0) STOP "*** Not enough memory ***" + IF (AllocateStatus /= 0) THEN + WRITE( NOUT, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( RWORK( 150*NMAX+2*MAXRHS ), STAT = AllocateStatus ) - IF (AllocateStatus /= 0) STOP "*** Not enough memory ***" + IF (AllocateStatus /= 0) THEN + WRITE( NOUT, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF * .. * .. Executable Statements .. * @@ -400,7 +421,7 @@ PROGRAM CCHKAA * IF( FATAL ) THEN WRITE( NOUT, FMT = 9999 ) - STOP + STOP 1 END IF * * Calculate and print the machine dependent constants. diff --git a/TESTING/LIN/cchkrfp.f b/TESTING/LIN/cchkrfp.f index 623656762..5a7a02ade 100644 --- a/TESTING/LIN/cchkrfp.f +++ b/TESTING/LIN/cchkrfp.f @@ -213,7 +213,7 @@ PROGRAM CCHKRFP * IF( FATAL ) THEN WRITE( NOUT, FMT = 9999 ) - STOP + STOP 1 END IF * * Calculate and print the machine dependent constants. diff --git a/TESTING/LIN/dchkaa.F b/TESTING/LIN/dchkaa.F index c66d78fc5..d0f7dbcb4 100644 --- a/TESTING/LIN/dchkaa.F +++ b/TESTING/LIN/dchkaa.F @@ -197,19 +197,40 @@ PROGRAM DCHKAA * .. Allocate memory dynamically .. * ALLOCATE ( IWORK( 34*NMAX ), STAT = AllocateStatus ) - IF (AllocateStatus /= 0) STOP "*** Not enough memory ***" + IF (AllocateStatus /= 0) THEN + WRITE( NOUT, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( A( ( KDMAX+1 )*NMAX, 8 ), STAT = AllocateStatus ) - IF (AllocateStatus /= 0) STOP "*** Not enough memory ***" + IF (AllocateStatus /= 0) THEN + WRITE( NOUT, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( B( NMAX*MAXRHS, 4 ), STAT = AllocateStatus ) - IF (AllocateStatus /= 0) STOP "*** Not enough memory ***" + IF (AllocateStatus /= 0) THEN + WRITE( NOUT, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( WORK( NMAX, 3*NMAX+MAXRHS+30 ), STAT = AllocateStatus ) - IF (AllocateStatus /= 0) STOP "*** Not enough memory ***" + IF (AllocateStatus /= 0) THEN + WRITE( NOUT, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( E( NMAX ), STAT = AllocateStatus ) - IF (AllocateStatus /= 0) STOP "*** Not enough memory ***" + IF (AllocateStatus /= 0) THEN + WRITE( NOUT, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( S( 2*NMAX ), STAT = AllocateStatus ) - IF (AllocateStatus /= 0) STOP "*** Not enough memory ***" + IF (AllocateStatus /= 0) THEN + WRITE( NOUT, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( RWORK( 5*NMAX+2*MAXRHS ), STAT = AllocateStatus ) - IF (AllocateStatus /= 0) STOP "*** Not enough memory ***" + IF (AllocateStatus /= 0) THEN + WRITE( NOUT, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF * * .. Executable Statements .. * @@ -393,7 +414,7 @@ PROGRAM DCHKAA * IF( FATAL ) THEN WRITE( NOUT, FMT = 9999 ) - STOP + STOP 1 END IF * * Calculate and print the machine dependent constants. diff --git a/TESTING/LIN/dchkab.f b/TESTING/LIN/dchkab.f index 25f081302..3999f211c 100644 --- a/TESTING/LIN/dchkab.f +++ b/TESTING/LIN/dchkab.f @@ -214,7 +214,7 @@ PROGRAM DCHKAB * IF( FATAL ) THEN WRITE( NOUT, FMT = 9999 ) - STOP + STOP 1 END IF * * Calculate and print the machine dependent constants. diff --git a/TESTING/LIN/dchkrfp.f b/TESTING/LIN/dchkrfp.f index c4290ff74..8d265efc1 100644 --- a/TESTING/LIN/dchkrfp.f +++ b/TESTING/LIN/dchkrfp.f @@ -212,7 +212,7 @@ PROGRAM DCHKRFP * IF( FATAL ) THEN WRITE( NOUT, FMT = 9999 ) - STOP + STOP 1 END IF * * Calculate and print the machine dependent constants. diff --git a/TESTING/LIN/schkaa.F b/TESTING/LIN/schkaa.F index c3a8bde80..dd3f8de4b 100644 --- a/TESTING/LIN/schkaa.F +++ b/TESTING/LIN/schkaa.F @@ -194,19 +194,40 @@ PROGRAM SCHKAA * .. Allocate memory dynamically .. * ALLOCATE ( IWORK( 34*NMAX ), STAT = AllocateStatus ) - IF (AllocateStatus /= 0) STOP "*** Not enough memory ***" + IF (AllocateStatus /= 0) THEN + WRITE( NOUT, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( A( ( KDMAX+1 )*NMAX, 8 ), STAT = AllocateStatus ) - IF (AllocateStatus /= 0) STOP "*** Not enough memory ***" + IF (AllocateStatus /= 0) THEN + WRITE( NOUT, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( B( NMAX*MAXRHS, 4 ), STAT = AllocateStatus ) - IF (AllocateStatus /= 0) STOP "*** Not enough memory ***" + IF (AllocateStatus /= 0) THEN + WRITE( NOUT, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( WORK( NMAX, 3*NMAX+MAXRHS+30 ), STAT = AllocateStatus ) - IF (AllocateStatus /= 0) STOP "*** Not enough memory ***" + IF (AllocateStatus /= 0) THEN + WRITE( NOUT, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( E( NMAX ), STAT = AllocateStatus ) - IF (AllocateStatus /= 0) STOP "*** Not enough memory ***" + IF (AllocateStatus /= 0) THEN + WRITE( NOUT, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( S( 2*NMAX ), STAT = AllocateStatus ) - IF (AllocateStatus /= 0) STOP "*** Not enough memory ***" + IF (AllocateStatus /= 0) THEN + WRITE( NOUT, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( RWORK( 5*NMAX+2*MAXRHS ), STAT = AllocateStatus ) - IF (AllocateStatus /= 0) STOP "*** Not enough memory ***" + IF (AllocateStatus /= 0) THEN + WRITE( NOUT, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF * .. * .. Executable Statements .. * @@ -390,7 +411,7 @@ PROGRAM SCHKAA * IF( FATAL ) THEN WRITE( NOUT, FMT = 9999 ) - STOP + STOP 1 END IF * * Calculate and print the machine dependent constants. diff --git a/TESTING/LIN/schkrfp.f b/TESTING/LIN/schkrfp.f index be26151ad..d552a6584 100644 --- a/TESTING/LIN/schkrfp.f +++ b/TESTING/LIN/schkrfp.f @@ -211,7 +211,7 @@ PROGRAM SCHKRFP * IF( FATAL ) THEN WRITE( NOUT, FMT = 9999 ) - STOP + STOP 1 END IF * * Calculate and print the machine dependent constants. diff --git a/TESTING/LIN/zchkaa.F b/TESTING/LIN/zchkaa.F index 81bb6fd96..fb1b5cd59 100644 --- a/TESTING/LIN/zchkaa.F +++ b/TESTING/LIN/zchkaa.F @@ -204,19 +204,40 @@ PROGRAM ZCHKAA * .. Allocate memory dynamically .. * ALLOCATE ( IWORK( 34*NMAX ), STAT = AllocateStatus ) - IF (AllocateStatus /= 0) STOP "*** Not enough memory ***" + IF (AllocateStatus /= 0) THEN + WRITE( NOUT, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( A ( (KDMAX+1) * NMAX, 8 ), STAT = AllocateStatus) - IF (AllocateStatus /= 0) STOP "*** Not enough memory ***" + IF (AllocateStatus /= 0) THEN + WRITE( NOUT, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( B ( NMAX * MAXRHS, 4 ), STAT = AllocateStatus) - IF (AllocateStatus /= 0 ) STOP "*** Not enough memory ***" + IF (AllocateStatus /= 0 ) THEN + WRITE( NOUT, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( WORK ( NMAX, NMAX+MAXRHS+10 ), STAT = AllocateStatus) - IF (AllocateStatus /= 0) STOP "*** Not enough memory ***" + IF (AllocateStatus /= 0) THEN + WRITE( NOUT, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( E( NMAX ), STAT = AllocateStatus ) - IF (AllocateStatus /= 0) STOP "*** Not enough memory ***" + IF (AllocateStatus /= 0) THEN + WRITE( NOUT, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( S( 2*NMAX ), STAT = AllocateStatus) - IF (AllocateStatus /= 0) STOP "*** Not enough memory ***" + IF (AllocateStatus /= 0) THEN + WRITE( NOUT, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF ALLOCATE ( RWORK( 150*NMAX+2*MAXRHS ), STAT = AllocateStatus) - IF (AllocateStatus /= 0) STOP "*** Not enough memory ***" + IF (AllocateStatus /= 0) THEN + WRITE( NOUT, FMT = * )'*** Not enough memory ***' + STOP 1 + END IF * .. * .. Executable Statements .. * @@ -400,7 +421,7 @@ PROGRAM ZCHKAA * IF( FATAL ) THEN WRITE( NOUT, FMT = 9999 ) - STOP + STOP 1 END IF * * Calculate and print the machine dependent constants. diff --git a/TESTING/LIN/zchkab.f b/TESTING/LIN/zchkab.f index 253905fea..2f2c92c56 100644 --- a/TESTING/LIN/zchkab.f +++ b/TESTING/LIN/zchkab.f @@ -215,7 +215,7 @@ PROGRAM ZCHKAB * IF( FATAL ) THEN WRITE( NOUT, FMT = 9999 ) - STOP + STOP 1 END IF * * Calculate and print the machine dependent constants. diff --git a/TESTING/LIN/zchkrfp.f b/TESTING/LIN/zchkrfp.f index 4c1b0e7a6..bff2192ab 100644 --- a/TESTING/LIN/zchkrfp.f +++ b/TESTING/LIN/zchkrfp.f @@ -213,7 +213,7 @@ PROGRAM ZCHKRFP * IF( FATAL ) THEN WRITE( NOUT, FMT = 9999 ) - STOP + STOP 1 END IF * * Calculate and print the machine dependent constants. diff --git a/TESTING/cec.in b/TESTING/cec.in index 622f05f1f..ded23c8f8 100644 --- a/TESTING/cec.in +++ b/TESTING/cec.in @@ -1,5 +1,6 @@ CEC Key indicating type of input 20.0E0 Threshold value for test ratios +T Put T to test the error exits 1 1 ( 2.0E0, 0.0E0) ( 2.0E0, 0.0E0) diff --git a/TESTING/ced.in b/TESTING/ced.in index 283debb94..b6e7a9edb 100644 --- a/TESTING/ced.in +++ b/TESTING/ced.in @@ -3,7 +3,7 @@ CES Data for the Complex Nonsymmetric Schur Form Driver 0 1 2 3 5 10 20 Matrix dimensions 3 3 1 11 4 8 2 0 Parameters NB, NBMIN, NXOVER, INMIN, INWIN, INIBL, ISHFTS, IACC22 20.0 Threshold for test ratios -T +T Put T to test the error exits 2 Read another line with random number generate seed 2518 3899 995 397 Seed for random number generator CES 21 Use all matrix types @@ -12,7 +12,7 @@ CEV Data for the Complex Nonsymmetric Eigenvalue Driver 0 1 2 3 5 10 20 Matrix dimensions 3 3 1 11 4 8 2 0 Parameters NB, NBMIN, NXOVER, INMIN, INWIN, INIBL, ISHFTS, IACC22 20.0 Threshold for test ratios -T +T Put T to test the error exits 2 Read another line with random number generate seed 2518 3899 995 397 Seed for random number generator CEV 21 Use all matrix types @@ -21,7 +21,7 @@ CSX Data for the Complex Nonsymmetric Schur Form Expert Driver 0 1 2 3 5 10 20 Matrix dimensions 3 3 1 11 4 8 2 0 Parameters NB, NBMIN, NXOVER, INMIN, INWIN, INIBL, ISHFTS, IACC22 20.0 Threshold for test ratios -T +T Put T to test the error exits 2 Read another line with random number generate seed 2518 3899 995 397 Seed for random number generator CSX 21 Use all matrix types @@ -526,7 +526,7 @@ CVX Data for the Complex Nonsymmetric Eigenvalue Expert Driver 0 1 2 3 5 10 20 Matrix dimensions 3 3 1 11 4 8 2 0 Parameters NB, NBMIN, NXOVER, INMIN, INWIN, INIBL, ISHFTS, IACC22 20.0 Threshold for test ratios -T +T Put T to test the error exits 2 Read another line with random number generate seed 2518 3899 995 397 Seed for random number generator CVX 21 Use all matrix types diff --git a/TESTING/cgd.in b/TESTING/cgd.in index a030a78a4..9d59a5650 100644 --- a/TESTING/cgd.in +++ b/TESTING/cgd.in @@ -3,7 +3,7 @@ CGV Data for the Complex Nonsymmetric Eigenvalue Driver 2 6 8 10 12 20 Matrix dimensions 1 1 1 2 1 Parameters NB, NBMIN, NXOVER, NS, NBCOL 10 Threshold for test ratios -.TRUE. Put T to test the error exits +T Put T to test the error exits 0 Code to interpret the seed CGV 26 Test all 26 matrix types CGS Data for the Complex Nonsymmetric Schur Form Driver @@ -11,26 +11,26 @@ CGS Data for the Complex Nonsymmetric Schur Form Driver 2 6 10 12 20 30 Matrix dimensions 1 1 1 2 1 Parameters NB, NBMIN, NXOVER, NS, NBCOL 10 Threshold for test ratios -.TRUE. Put T to test the error exits +T Put T to test the error exits 0 Code to interpret the seed CGS 26 Test all 26 matrix types CGX Data for the Complex Nonsymmetric Schur Form Expert Driver 2 Largest matrix dimension (0 <= NSIZE <= 5) 1 1 1 2 1 Parameters NB, NBMIN, NXOVER, NS, NBCOL 10 Threshold for test ratios -.TRUE. Put T to test the error exits +T Put T to test the error exits 0 Code to interpret the seed CXV Data for the Complex Nonsymmetric Eigenvalue Expert Driver 6 Number of matrix dimensions 1 1 1 2 1 Parameters NB, NBMIN, NXOVER, NS, NBCOL 10 Threshold for test ratios -.TRUE. Put T to test the error exits +T Put T to test the error exits 0 Code to interpret the seed CGX Data for the Complex Nonsymmetric Schur Form Expert Driver 0 Number of matrix dimensions 1 1 1 2 1 Parameters NB, NBMIN, NXOVER, NS, NBCOL 10 Threshold for test ratios -.TRUE. Put T to test the error exits +T Put T to test the error exits 0 Code to interpret the seed 4 2 @@ -107,7 +107,7 @@ CXV Data for the Complex Nonsymmetric Eigenvalue Expert Driver 0 Number of matrix dimensions 1 1 1 2 1 Parameters NB, NBMIN, NXOVER, NS, NBCOL 10 Threshold for test ratios -.TRUE. Put T to test the error exits +T Put T to test the error exits 0 Code to interpret the seed 4 ( 2.0000E+00, 6.0000E+00) diff --git a/TESTING/dec.in b/TESTING/dec.in index 4a2aa52a1..42a6f0f9c 100644 --- a/TESTING/dec.in +++ b/TESTING/dec.in @@ -1,5 +1,6 @@ DEC Key indicating type of input 20.0 Threshold value for test ratios +T Put T to test the error exits 8 2 7 1.0D+00 1.0D+00 1.1D+00 1.3D+00 2.0D+00 3.0D+00 -4.7D+00 3.3D+00 -1.0D+00 1.0D+00 3.7D+00 7.9D+00 4.0D+00 5.3D+00 3.3D+00 -9.0D-01 diff --git a/TESTING/ded.in b/TESTING/ded.in index d0c26853d..8dbc76134 100644 --- a/TESTING/ded.in +++ b/TESTING/ded.in @@ -3,7 +3,7 @@ DEV Data file for Real Nonsymmetric Eigenvalue Driver 0 1 2 3 5 10 20 Matrix dimensions 3 3 1 11 4 8 2 0 Parameters NB, NBMIN, NXOVER, INMIN, INWIN, INIBL, ISHFTS, IACC22 20.0 Threshold for test ratios -T +T Put T to test the error exits 2 Read another line with random number generator seed 2518 3899 995 397 Seed for random number generator DEV 21 Use all matrix types @@ -12,7 +12,7 @@ DES Data file for Real Nonsymmetric Schur Form Driver 0 1 2 3 5 10 20 Matrix dimensions 3 3 1 11 4 8 2 0 Parameters NB, NBMIN, NXOVER, INMIN, INWIN, INIBL, ISHFTS, IACC22 20.0 Threshold for test ratios -T +T Put T to test the error exits 2 Read another line with random number generator seed 2518 3899 995 397 Seed for random number generator DES 21 Use all matrix types @@ -21,7 +21,7 @@ DVX Data file for Real Nonsymmetric Eigenvalue Expert Driver 0 1 2 3 5 10 20 Matrix dimensions 3 3 1 11 4 8 2 0 Parameters NB, NBMIN, NXOVER, INMIN, INWIN, INIBL, ISHFTS, IACC22 20.0 Threshold for test ratios -T +T Put T to test the error exits 2 Read another line with random number generator seed 2518 3899 995 397 Seed for random number generator DVX 21 Use all matrix types @@ -546,7 +546,7 @@ DSX Data file for Real Nonsymmetric Schur Form Expert Driver 0 1 2 3 5 10 20 Matrix dimensions 3 3 1 11 4 8 2 0 Parameters NB, NBMIN, NXOVER, INMIN, INWIN, INIBL, ISHFTS, IACC22 20.0 Threshold for test ratios -T +T Put T to test the error exits 2 Read another line with random number generator seed 2518 3899 995 397 Seed for random number generator DSX 21 Use all matrix types diff --git a/TESTING/dgd.in b/TESTING/dgd.in index 67726ea13..496d1e0eb 100644 --- a/TESTING/dgd.in +++ b/TESTING/dgd.in @@ -3,7 +3,7 @@ DGS Data for the Real Nonsymmetric Schur Form Driver 2 6 10 12 20 30 Matrix dimensions 1 1 1 2 1 Parameters NB, NBMIN, NXOVER, NS, NBCOL 10 Threshold for test ratios -.TRUE. Put T to test the error exits +T Put T to test the error exits 2 Code to interpret the seed 1234 5678 9012 3456 DGS 26 Test all 26 matrix types @@ -12,20 +12,20 @@ DGV Data for the Real Nonsymmetric Eigenvalue Problem Driver 2 6 8 10 15 20 Matrix dimensions 1 1 1 2 1 Parameters NB, NBMIN, NXOVER, NS, NBCOL 10 Threshold value -.TRUE. Put T to test the error exits +T Put T to test the error exits 0 Code to interpret the seed DGV 26 Test all 26 matrix types DGX Data for the Real Nonsymmetric Schur Form Expert Driver 2 Largest matrix dimension (0 <= NSIZE <= 5) 1 1 1 2 1 Parameters NB, NBMIN, NXOVER, NS, NBCOL 10 Threshold for test ratios -.TRUE. Put T to test the error exits +T Put T to test the error exits 0 Code to interpret the seed DGX Data for the Real Nonsymmetric Schur Form Expert Driver 0 Largest matrix dimension 1 1 1 2 1 Parameters NB, NBMIN, NXOVER, NS, NBCOL 10 Threshold for test ratios -.TRUE. Put T to test the error exits +T Put T to test the error exits 0 Code to interpret the seed 4 2 @@ -54,13 +54,13 @@ DXV Data for the Real Nonsymmetric Eigenvalue Expert Driver 5 Largest matrix dimension 1 1 1 2 1 Parameters NB, NBMIN, NXOVER, NS, NBCOL 10 Threshold for test ratios -.TRUE. Put T to test the error exits +T Put T to test the error exits 0 Code to interpret the seed DXV Data for the Real Nonsymmetric Eigenvalue Expert Driver 0 Largest matrix dimension 1 1 1 2 1 Parameters NB, NBMIN, NXOVER, NS, NBCOL 10 Threshold for test ratios -.TRUE. Put T to test the error exits +T Put T to test the error exits 0 Code to interpret the seed 4 8.0000D+00 4.0000D+00 -1.3000D+01 4.0000D+00 Input matrix A diff --git a/TESTING/sec.in b/TESTING/sec.in index 0b2f4e68c..3fe304ec9 100644 --- a/TESTING/sec.in +++ b/TESTING/sec.in @@ -1,5 +1,6 @@ SEC Key indicating type of input 20.0 Threshold value for test ratios +T Put T to test the error exits 8 2 7 1.0E+00 1.0E+00 1.1E+00 1.3E+00 2.0E+00 3.0E+00 -4.7E+00 3.3E+00 -1.0E+00 1.0E+00 3.7E+00 7.9E+00 4.0E+00 5.3E+00 3.3E+00 -9.0E-01 diff --git a/TESTING/sed.in b/TESTING/sed.in index 56469179a..3038088f7 100644 --- a/TESTING/sed.in +++ b/TESTING/sed.in @@ -3,7 +3,7 @@ SEV Data file for the Real Nonsymmetric Eigenvalue Driver 0 1 2 3 5 10 20 Matrix dimensions 3 3 1 11 4 8 2 0 Parameters NB, NBMIN, NXOVER, INMIN, INWIN, INIBL, ISHFTS, IACC22 20.0 Threshold for test ratios -T +T Put T to test the error exits 2 Read another line with random number generator seed 2518 3899 995 397 Seed for random number generator SEV 21 Use all matrix types @@ -12,7 +12,7 @@ SES Data file for the Real Nonsymmetric Schur Form Driver 0 1 2 3 5 10 20 Matrix dimensions 3 3 1 11 4 8 2 0 Parameters NB, NBMIN, NXOVER, INMIN, INWIN, INIBL, ISHFTS, IACC22 20.0 Threshold for test ratios -T +T Put T to test the error exits 2 Read another line with random number generator seed 2518 3899 995 397 Seed for random number generator SES 21 Use all matrix types @@ -21,7 +21,7 @@ SVX Data file for the Real Nonsymmetric Eigenvalue Expert Driver 0 1 2 3 5 10 20 Matrix dimensions 3 3 1 11 4 8 2 0 Parameters NB, NBMIN, NXOVER, INMIN, INWIN, INIBL, ISHFTS, IACC22 20.0 Threshold for test ratios -T +T Put T to test the error exits 2 Read another line with random number generator seed 2518 3899 995 397 Seed for random number generator SVX 21 Use all matrix types @@ -546,7 +546,7 @@ SSX Data file for the Real Nonsymmetric Schur Form Expert Driver 0 1 2 3 5 10 20 Matrix dimensions 3 3 1 11 4 8 2 0 Parameters NB, NBMIN, NXOVER, INMIN, INWIN, INIBL, ISHFTS, IACC22 20.0 Threshold for test ratios -T +T Put T to test the error exits 2 Read another line with random number generator seed 2518 3899 995 397 Seed for random number generator SSX 21 Use all matrix types diff --git a/TESTING/sgd.in b/TESTING/sgd.in index 164b3cc35..21c9a363d 100644 --- a/TESTING/sgd.in +++ b/TESTING/sgd.in @@ -3,7 +3,7 @@ SGS Data for the Real Nonsymmetric Schur Form Driver 2 6 10 12 20 30 Matrix dimensions 1 1 1 2 1 Parameters NB, NBMIN, NXOVER, NS, NBCOL 10 Threshold for test ratios -.TRUE. Put T to test the error exits +T Put T to test the error exits 0 Code to interpret the seed SGS 26 Test all 26 matrix types SGV Data for the Real Nonsymmetric Eigenvalue Problem Driver @@ -11,20 +11,20 @@ SGV Data for the Real Nonsymmetric Eigenvalue Problem Driver 2 6 8 10 15 20 Matrix dimensions 1 1 1 2 1 Parameters NB, NBMIN, NXOVER, NS, NBCOL 10 Threshold value -.TRUE. Put T to test the error exits +T Put T to test the error exits 0 Code to interpret the seed SGV 26 Test all 26 matrix types SGX Data for the Real Nonsymmetric Schur Form Expert Driver 2 Largest matrix dimension (0 <= NSIZE <= 5) 1 1 1 2 1 Parameters NB, NBMIN, NXOVER, NS, NBCOL 10 Threshold for test ratios -.TRUE. Put T to test the error exits +T Put T to test the error exits 0 Code to interpret the seed SGX Data for the Real Nonsymmetric Schur Form Expert Driver 0 Largest matrix dimension (0 <= NSIZE <= 5) 1 1 1 2 1 Parameters NB, NBMIN, NXOVER, NS, NBCOL 10 Threshold for test ratios -.TRUE. Put T to test the error exits +T Put T to test the error exits 0 Code to interpret the seed 4 2 @@ -53,13 +53,13 @@ SXV Data for the Real Nonsymmetric Eigenvalue Expert Driver 5 Largest matrix dimension 1 1 1 2 1 Parameters NB, NBMIN, NXOVER, NS, NBCOL 10 Threshold for test ratios -.TRUE. Put T to test the error exits +T Put T to test the error exits 0 Code to interpret the seed SXV Data for the Real Nonsymmetric Eigenvalue Expert Driver 0 Largest matrix dimension 1 1 1 2 1 Parameters NB, NBMIN, NXOVER, NS, NBCOL 10 Threshold for test ratios -.TRUE. Put T to test the error exits +T Put T to test the error exits 0 Code to interpret the seed 4 8.0000E+00 4.0000E+00 -1.3000E+01 4.0000E+00 Input matrix A diff --git a/TESTING/zec.in b/TESTING/zec.in index 32a1b890c..e72ab512e 100644 --- a/TESTING/zec.in +++ b/TESTING/zec.in @@ -1,5 +1,6 @@ ZEC Key indicating type of input 20.0D0 Threshold value for test ratios +T Put T to test the error exits 1 1 ( 2.0D0, 0.0D0) ( 2.0D0, 0.0D0) diff --git a/TESTING/zed.in b/TESTING/zed.in index 6285a1c20..32420b793 100644 --- a/TESTING/zed.in +++ b/TESTING/zed.in @@ -3,7 +3,7 @@ ZES Data for the Complex Nonsymmetric Schur Form Driver 0 1 2 3 5 10 20 Matrix dimensions 3 3 1 11 4 8 2 0 Parameters NB, NBMIN, NXOVER, INMIN, INWIN, INIBL, ISHFTS, IACC22 20.0 Threshold for test ratios -T +T Put T to test the error exits 2 Read another line with random number generator seed 2518 3899 995 397 Seed for random number generator ZES 21 Use all matrix types @@ -12,7 +12,7 @@ ZEV Data for the Complex Nonsymmetric Eigenvalue Driver 0 1 2 3 5 10 20 Matrix dimensions 3 3 1 11 4 8 2 0 Parameters NB, NBMIN, NXOVER, INMIN, INWIN, INIBL, ISHFTS, IACC22 20.0 Threshold for test ratios -T +T Put T to test the error exits 2 Read another line with random number generator seed 2518 3899 995 397 Seed for random number generator ZEV 21 Use all matrix types @@ -21,7 +21,7 @@ ZSX Data for the Complex Nonsymmetric Schur Form Expert Driver 0 1 2 3 5 10 20 Matrix dimensions 3 3 1 11 4 8 2 0 Parameters NB, NBMIN, NXOVER, INMIN, INWIN, INIBL, ISHFTS, IACC22 20.0 Threshold for test ratios -T +T Put T to test the error exits 2 Read another line with random number generator seed 2518 3899 995 397 Seed for random number generator ZSX 21 Use all matrix types @@ -526,7 +526,7 @@ ZVX Data for Complex Nonsymmetric Eigenvalue Expert Driver 0 1 2 3 5 10 20 Matrix dimensions 3 3 1 11 4 8 2 0 Parameters NB, NBMIN, NXOVER, INMIN, INWIN, INIBL, ISHFTS, IACC22 20.0 Threshold for test ratios -T +T Put T to test the error exits 2 Read another line with random number generator seed 2518 3899 995 397 Seed for random number generator ZVX 21 Use all matrix types diff --git a/TESTING/zgd.in b/TESTING/zgd.in index bf462b768..1ebb8640e 100644 --- a/TESTING/zgd.in +++ b/TESTING/zgd.in @@ -3,7 +3,7 @@ ZGV Data for the Complex Nonsymmetric Eigenvalue Driver 2 6 8 10 12 20 Matrix dimensions 1 1 1 2 1 Parameters NB, NBMIN, NXOVER, NS, NBCOL 10 Threshold for test ratios -.TRUE. Put T to test the error exits +T Put T to test the error exits 0 Code to interpret the seed ZGV 26 Test all 26 matrix types ZGS Data for the Complex Nonsymmetric Schur Form Driver @@ -11,26 +11,26 @@ ZGS Data for the Complex Nonsymmetric Schur Form Driver 2 6 10 12 20 30 Matrix dimensions 1 1 1 2 1 Parameters NB, NBMIN, NXOVER, NS, NBCOL 10 Threshold for test ratios -.TRUE. Put T to test the error exits +T Put T to test the error exits 0 Code to interpret the seed ZGS 26 Test all 26 matrix types ZGX Data for the Complex Nonsymmetric Schur Form Expert Driver 2 Largest matrix dimension (0 <= NSIZE <= 5) 1 1 1 2 1 Parameters NB, NBMIN, NXOVER, NS, NBCOL 10 Threshold for test ratios -.TRUE. Put T to test the error exits +T Put T to test the error exits 0 Code to interpret the seed ZXV Data for the Complex Nonsymmetric Eigenvalue Expert Driver 6 Number of matrix dimensions 1 1 1 2 1 Parameters NB, NBMIN, NXOVER, NS, NBCOL 10 Threshold for test ratios -.TRUE. Put T to test the error exits +T Put T to test the error exits 0 Code to interpret the seed ZGX Data for the Complex Nonsymmetric Schur Form Expert Driver 0 Number of matrix dimensions 1 1 1 2 1 Parameters NB, NBMIN, NXOVER, NS, NBCOL 10 Threshold for test ratios -.TRUE. Put T to test the error exits +T Put T to test the error exits 0 Code to interpret the seed 4 2 @@ -107,7 +107,7 @@ ZXV Data for the Complex Nonsymmetric Eigenvalue Expert Driver 0 Number of matrix dimensions 1 1 1 2 1 Parameters NB, NBMIN, NXOVER, NS, NBCOL 10 Threshold for test ratios -.TRUE. Put T to test the error exits +T Put T to test the error exits 0 Code to interpret the seed 4 ( 2.0000D+00, 6.0000D+00) diff --git a/lapack_testing.py b/lapack_testing.py index 81ff874e4..4591c6d1a 100755 --- a/lapack_testing.py +++ b/lapack_testing.py @@ -8,14 +8,14 @@ precision (s/d/c/z). With ``--run`` it executes the testing drivers first and then analyzes their output. -The LAPACKE (``xlintst?_lapacke_*``), BLAS (``xblat[123]?``) and CBLAS -(``x?cblat[123]``) test drivers are analyzed too, from their own testing -directories, and are reported in their own summary sections. The -LAPACKE drivers are the linear equation tests rebuilt with the routine -calls routed through LAPACKE, one driver per precision and (API layer, -matrix layout) flavor; their output uses the classic LAPACK summary -format. The BLAS and CBLAS drivers report their test counts in -lines of the form:: +The LAPACKE (``xlintst?_{work,high}_{cm,rm}``), BLAS (``xblat[123]?``) +and CBLAS (``x?cblat[123]``) test drivers are analyzed too, from their +own testing directories, and are reported in their own summary +sections. The LAPACKE drivers are the linear equation tests rebuilt +with the routine calls routed through LAPACKE, one driver per precision +and (API layer, matrix layout) flavor; their output uses the classic +LAPACK summary format. The BLAS and CBLAS drivers report their test +counts in lines of the form:: SGEMV COMPUTATIONAL TESTS: 3456 RUN, 0 FAILED SGEMV ERROR-EXIT TESTS: 6 RUN, 0 FAILED @@ -49,6 +49,11 @@ Print only the summary table and also write a JUnit XML report of the analyzed output files, e.g. for GitLab CI test reports. + ./lapack_testing.py --junit-xml results.xml --junit-job linux-gfortran + Write a JUnit XML report whose suite and class names carry the + name of the job that ran the tests, so that the reports of + several jobs stay apart where they are collected. + ./lapack_testing.py -s --markdown summary.md Print only the summary table and also write a GitHub-flavored Markdown report of the test results, e.g. for GitHub Actions @@ -542,7 +547,7 @@ def build_test_cases(letters: str, families: "Sequence[str]") -> "List[TestCase] source_input=None if error_exits else "{}test.in".format(letter), - executable="xlintst{}_lapacke_{}_{}".format( + executable="xlintst{}_{}_{}".format( letter, layer, layout ), parser=PARSER_STANDARD, @@ -1294,7 +1299,38 @@ def output_mtime(path: Path) -> "Optional[float]": return None -def junit_testcase(outcome: CaseOutcome) -> "ET.Element": +def junit_scoped_name(job: "Optional[str]", name: str, separator: str) -> str: + """Prefix a JUnit name with the identifier of the job that ran it. + + The same test suite is run by many CI jobs, and a report collector + that gathers all of them keys a test case on its suite, class and + test name alone. Without the job in those names the reports of the + jobs collapse onto one another; with it they stay apart, and a + failure names the job it came from. + + Args: + job: The job identifier passed to ``--junit-job``, or None when + the report is not scoped to a job. + name: The name to prefix. + separator: What to put between the two: ``"."`` for the dotted + class names, which also replaces any dot in ``job``, + ``" / "`` for the free-text suite names. + + Returns: + The prefixed name, or the name unchanged when there is no job. + """ + if not job: + return name + if separator == ".": + # A dotted name is read as a path, one package or class per + # segment. Job identifiers carry the runner image version + # ("ubuntu-26.04-gfortran-shared"), so left alone their dots + # would split one job across two levels of that hierarchy. + job = job.replace(".", "_") + return "{}{}{}".format(job, separator, name) + + +def junit_testcase(outcome: CaseOutcome, job: "Optional[str]" = None) -> "ET.Element": """Build the JUnit ```` element of one analyzed test case. The element carries at most one status child: an ```` when @@ -1309,6 +1345,7 @@ def junit_testcase(outcome: CaseOutcome) -> "ET.Element": Args: outcome: The analysis outcome of the test case. + job: The job identifier to prefix to the class name, or None. Returns: The ```` element. @@ -1317,7 +1354,11 @@ def junit_testcase(outcome: CaseOutcome) -> "ET.Element": element = ET.Element( "testcase", { - "classname": "{}{}.{}".format(case.library, outcome.suffix, case.family), + "classname": junit_scoped_name( + job, + "{}{}.{}".format(case.library, outcome.suffix, case.family), + ".", + ), "name": "{} ({} {})".format( case.suffixed_output(outcome.suffix), PRECISION_NAMES[case.precision], @@ -1372,7 +1413,9 @@ def junit_testcase(outcome: CaseOutcome) -> "ET.Element": def build_junit_tree( - outcomes: "Sequence[CaseOutcome]", unrecognized: "Sequence[str]" + outcomes: "Sequence[CaseOutcome]", + unrecognized: "Sequence[str]", + job: "Optional[str]" = None, ) -> "ET.ElementTree": """Build the JUnit XML document for the analyzed test cases. @@ -1398,9 +1441,14 @@ def build_junit_tree( output file behind falls back to the time the report was built, so that the attribute is always present. + A job identifier prefixes every suite and class name, so that the + reports of the CI jobs that all run this one test suite do not + collapse onto one another where they are collected. + Args: outcomes: The analysis outcomes, in analysis order. unrecognized: The names of the unrecognized ``.out`` files. + job: The job identifier to prefix to the names, or None. Returns: The document; its root is a ```` element. @@ -1424,7 +1472,7 @@ def build_junit_tree( root, "testsuite", { - "name": section_title(library, [suffix]), + "name": junit_scoped_name(job, section_title(library, [suffix]), " / "), "timestamp": junit_timestamp(min(starts) if starts else report_time), }, ) @@ -1435,7 +1483,7 @@ def build_junit_tree( suite_time = 0.0 timed = False for outcome in suite_outcomes: - element = junit_testcase(outcome) + element = junit_testcase(outcome, job) suite.append(element) if element.find("failure") is not None: failures += 1 @@ -1475,7 +1523,7 @@ def build_junit_tree( root, "testsuite", { - "name": "lapack_testing.py", + "name": junit_scoped_name(job, "lapack_testing.py", " / "), "timestamp": junit_timestamp(report_time), "tests": "1", "failures": "1", @@ -1489,7 +1537,7 @@ def build_junit_tree( suite, "testcase", { - "classname": "lapack_testing", + "classname": junit_scoped_name(job, "lapack_testing", "."), "name": "unrecognized .out files", "time": "0.000", }, @@ -1511,7 +1559,10 @@ def build_junit_tree( def write_junit_xml( - path: Path, outcomes: "Sequence[CaseOutcome]", unrecognized: "Sequence[str]" + path: Path, + outcomes: "Sequence[CaseOutcome]", + unrecognized: "Sequence[str]", + job: "Optional[str]" = None, ) -> "Optional[str]": """Write the JUnit XML report requested via ``--junit-xml``. @@ -1524,6 +1575,7 @@ def write_junit_xml( are created. outcomes: The analysis outcomes, in analysis order. unrecognized: The names of the unrecognized ``.out`` files. + job: The job identifier to prefix to the names, or None. Returns: An error message if the report could not be written, otherwise @@ -1532,7 +1584,7 @@ def write_junit_xml( # Path.with_name below would raise ValueError for such a path. if not path.name: return "cannot write {}: the path has no file name".format(path) - tree = build_junit_tree(outcomes, unrecognized) + tree = build_junit_tree(outcomes, unrecognized, job) # ET.indent is Python 3.9+; without it the report is one long line, # which every consumer accepts just the same. indent = getattr(ET, "indent", None) @@ -2014,6 +2066,16 @@ def parse_args(argv: "Optional[Sequence[str]]" = None) -> argparse.Namespace: "PATH (one testcase per output file), e.g. for GitLab CI test " "reports; written regardless of the display and --fail-* options", ) + parser.add_argument( + "--junit-job", + metavar="NAME", + default=None, + help="identifier of the job that produced the results, e.g. the " + "name or the Codecov flag of a CI job; it is prefixed to the suite " + "and class names of the --junit-xml report, so that the reports of " + "the jobs that all run this one test suite stay apart where they " + "are collected", + ) parser.add_argument( "--markdown", metavar="PATH", @@ -2034,7 +2096,14 @@ def parse_args(argv: "Optional[Sequence[str]]" = None) -> argparse.Namespace: parser.add_argument( "--fail-if-empty", action="store_true", - help="exit with a nonzero status if no test results were analyzed", + help="exit with a nonzero status if no test results were analyzed " + "at all", + ) + parser.add_argument( + "--fail-on-empty-output", + action="store_true", + help="exit with a nonzero status if any analyzed output file " + "accounted for no tests at all", ) parser.add_argument( "--fail-on-unrecognized", @@ -2053,10 +2122,10 @@ def main(argv: "Optional[Sequence[str]]" = None) -> int: Returns: int: The process exit status. This is 2 for usage errors, 1 if a - condition requested via ``--fail-on-error``, ``--fail-if-empty`` - or ``--fail-on-unrecognized`` occurred or a report requested via - ``--junit-xml`` or ``--markdown`` could not be written, and 0 - otherwise. + condition requested via ``--fail-on-error``, ``--fail-if-empty``, + ``--fail-on-empty-output`` or ``--fail-on-unrecognized`` occurred + or a report requested via ``--junit-xml`` or ``--markdown`` + could not be written, and 0 otherwise. """ args = parse_args(argv) short_summary: bool = args.short or args.number @@ -2364,6 +2433,28 @@ def main(argv: "Optional[Sequence[str]]" = None) -> int: file=sys.stderr, ) + # A file that parses but accounts for no tests at all means a driver + # wrote its header and then ran nothing, which is what happens when + # its input file stops lining up with what it reads. Neither of the + # other checks notices: such a driver exits with status 0, and its + # sibling files keep the grand total nonzero. + empty_outputs = [ + outcome + for outcome in outcomes + if outcome.report is not None and outcome.report.counts.runs == 0 + ] + if empty_outputs: + print( + "lapack_testing.py: {} output file(s) accounted for no tests at " + "all:".format(len(empty_outputs)), + file=sys.stderr, + ) + for outcome in empty_outputs: + print( + " {}".format(outcome.case.suffixed_output(outcome.suffix)), + file=sys.stderr, + ) + unrecognized = find_unrecognized_outputs(directories) if unrecognized: print( @@ -2380,7 +2471,9 @@ def main(argv: "Optional[Sequence[str]]" = None) -> int: junit_error: "Optional[str]" = None if args.junit_xml is not None: - junit_error = write_junit_xml(Path(args.junit_xml), outcomes, unrecognized) + junit_error = write_junit_xml( + Path(args.junit_xml), outcomes, unrecognized, args.junit_job + ) if junit_error is not None: print("lapack_testing.py: {}".format(junit_error), file=sys.stderr) @@ -2399,6 +2492,8 @@ def main(argv: "Optional[Sequence[str]]" = None) -> int: if args.fail_if_empty and grand_total.runs == 0: return 1 + if args.fail_on_empty_output and empty_outputs: + return 1 if args.fail_on_unrecognized and unrecognized: return 1 if args.fail_on_error and (grand_total.errors > 0 or run_failures):