From 2b46a031cc5d5c76f344c19d80fe4f4615868469 Mon Sep 17 00:00:00 2001 From: Ed Date: Sat, 8 Jul 2023 06:29:28 -0600 Subject: [PATCH 01/24] removed IF (ASSOCIATED(CBUF)) because CBUF is undefined --- src/getg2ir.f | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/getg2ir.f b/src/getg2ir.f index b88b1520..188f55bc 100644 --- a/src/getg2ir.f +++ b/src/getg2ir.f @@ -51,7 +51,7 @@ END SUBROUTINE IXGB2 C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - C INITIALIZE IRET=0 - IF (ASSOCIATED(CBUF)) NULLIFY(CBUF) + NULLIFY(CBUF) MBUF=INIT ALLOCATE(CBUF(MBUF),STAT=ISTAT) ! ALLOCATE INITIAL SPACE FOR CBUF IF (ISTAT.NE.0) THEN From 8530133de03a6078dd38cce2ccfe8c442f5b2fa9 Mon Sep 17 00:00:00 2001 From: Ed Date: Sat, 8 Jul 2023 06:34:52 -0600 Subject: [PATCH 02/24] fix associated() check on undefind pointer in ixgb2() --- src/ixgb2.f | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ixgb2.f b/src/ixgb2.f index cbc79ce5..21e4c086 100644 --- a/src/ixgb2.f +++ b/src/ixgb2.f @@ -70,7 +70,7 @@ SUBROUTINE IXGB2(LUGB,LSKIP,LGRIB,CBUF,NUMFLD,MLEN,IRET) IRET=0 MLEN=0 NUMFLD=0 - IF (ASSOCIATED(CBUF)) NULLIFY(CBUF) + NULLIFY(CBUF) MBUF=INIT ALLOCATE(CBUF(MBUF),STAT=ISTAT) ! ALLOCATE INITIAL SPACE FOR CBUF IF (ISTAT.NE.0) THEN From 1202b3469b3654c9868b2d5be6f93ec0a2895a43 Mon Sep 17 00:00:00 2001 From: Ed Date: Sat, 8 Jul 2023 06:41:16 -0600 Subject: [PATCH 03/24] fixing some memory problems --- src/getg2i.f | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/getg2i.f b/src/getg2i.f index 420a2bda..a3db9ceb 100644 --- a/src/getg2i.f +++ b/src/getg2i.f @@ -61,9 +61,9 @@ SUBROUTINE GETG2I(LUGI,CBUF,NLEN,NNUM,IRET) INTEGER,INTENT(IN) :: LUGI INTEGER,INTENT(OUT) :: NLEN,NNUM,IRET CHARACTER CHEAD*162 -C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - IF (ASSOCIATED(CBUF)) NULLIFY(CBUF) -C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + NULLIFY(CBUF) + NLEN=0 NNUM=0 IRET=4 @@ -71,7 +71,6 @@ SUBROUTINE GETG2I(LUGI,CBUF,NLEN,NNUM,IRET) IF(LHEAD.EQ.162.AND.CHEAD(42:47).EQ.'GB2IX1') THEN READ(CHEAD(82:162),'(8X,3I10,2X,A40)',IOSTAT=IOS) NSKP,NLEN,NNUM IF(IOS.EQ.0) THEN - ALLOCATE(CBUF(NLEN),STAT=ISTAT) ! ALLOCATE SPACE FOR CBUF IF (ISTAT.NE.0) THEN IRET=2 @@ -83,6 +82,4 @@ SUBROUTINE GETG2I(LUGI,CBUF,NLEN,NNUM,IRET) ENDIF ENDIF -C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - RETURN END From 6e683976d5d795f9597227940ee4e3eddc072f96 Mon Sep 17 00:00:00 2001 From: Ed Date: Sat, 8 Jul 2023 06:43:57 -0600 Subject: [PATCH 04/24] fixing some memory problems --- src/getg2ir.f | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/getg2ir.f b/src/getg2ir.f index 188f55bc..d6f77281 100644 --- a/src/getg2ir.f +++ b/src/getg2ir.f @@ -34,7 +34,6 @@ !> !> @author Mark Iredell @date 1995-10-31 SUBROUTINE GETG2IR(LUGB,MSK1,MSK2,MNUM,CBUF,NLEN,NNUM,NMESS,IRET) - USE RE_ALLOC ! NEEDED FOR SUBROUTINE REALLOC PARAMETER(INIT=50000,NEXT=10000) CHARACTER(LEN=1),POINTER,DIMENSION(:) :: CBUF @@ -48,7 +47,7 @@ SUBROUTINE IXGB2(LUGB,LSKIP,LGRIB,CBUF,NUMFLD,MLEN,IRET) INTEGER,INTENT(OUT) :: NUMFLD,MLEN,IRET END SUBROUTINE IXGB2 END INTERFACE -C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + C INITIALIZE IRET=0 NULLIFY(CBUF) @@ -58,7 +57,7 @@ END SUBROUTINE IXGB2 IRET=2 RETURN ENDIF -C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + C SEARCH FOR FIRST GRIB MESSAGE ISEEK=0 CALL SKGB(LUGB,ISEEK,MSK1,LSKIP,LGRIB) @@ -68,7 +67,7 @@ END SUBROUTINE IXGB2 CALL SKGB(LUGB,ISEEK,MSK2,LSKIP,LGRIB) ENDIF ENDDO -C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + C GET INDEX RECORDS FOR EVERY GRIB MESSAGE FOUND NLEN=0 NNUM=0 @@ -86,10 +85,9 @@ END SUBROUTINE IXGB2 ENDIF MBUF=NEWSIZE ENDIF - ! + ! IF INDEX RECORDS WERE RETURNED IN CBUFTMP FROM IXGB2, ! COPY CBUFTMP INTO CBUF, THEN DEALLOCATE CBUFTMP WHEN DONE - ! IF ( ASSOCIATED(CBUFTMP) ) THEN CBUF(NLEN+1:NLEN+NBYTES)=CBUFTMP(1:NBYTES) DEALLOCATE(CBUFTMP,STAT=ISTAT) @@ -106,6 +104,4 @@ END SUBROUTINE IXGB2 ISEEK=LSKIP+LGRIB CALL SKGB(LUGB,ISEEK,MSK2,LSKIP,LGRIB) ENDDO -C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - RETURN END From 60d080ab1d8092d4b16fd2d9fe6e4f8bd67296c6 Mon Sep 17 00:00:00 2001 From: Ed Date: Sat, 8 Jul 2023 06:44:57 -0600 Subject: [PATCH 05/24] whitespace cleanup --- src/ixgb2.f | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/ixgb2.f b/src/ixgb2.f index 21e4c086..554a83c9 100644 --- a/src/ixgb2.f +++ b/src/ixgb2.f @@ -52,7 +52,6 @@ !> !> @author Mark Iredell @date 1995-10-31 SUBROUTINE IXGB2(LUGB,LSKIP,LGRIB,CBUF,NUMFLD,MLEN,IRET) - USE RE_ALLOC ! NEEDED FOR SUBROUTINE REALLOC CHARACTER(LEN=1),POINTER,DIMENSION(:) :: CBUF PARAMETER(LINMAX=5000,INIT=50000,NEXT=10000) @@ -65,7 +64,7 @@ SUBROUTINE IXGB2(LUGB,LSKIP,LGRIB,CBUF,NUMFLD,MLEN,IRET) CHARACTER CIDS(LINMAX),CGDS(LINMAX) CHARACTER(LEN=4) :: CTEMP INTEGER LOCLUS,LOCGDS,LENGDS,LOCBMS -C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + LOCLUS=0 IRET=0 MLEN=0 @@ -77,7 +76,7 @@ SUBROUTINE IXGB2(LUGB,LSKIP,LGRIB,CBUF,NUMFLD,MLEN,IRET) IRET=1 RETURN ENDIF -C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + C READ SECTIONS 0 AND 1 FOR VERSIN NUMBER AND DISCIPLINE IBREAD=MIN(LGRIB,LINMAX) CALL BAREAD(LUGB,LSKIP,IBREAD,LBREAD,CBREAD) @@ -95,7 +94,7 @@ SUBROUTINE IXGB2(LUGB,LSKIP,LGRIB,CBUF,NUMFLD,MLEN,IRET) LENSEC1=MIN(LENSEC1,IBREAD) CIDS(1:LENSEC1)=CBREAD(17:16+LENSEC1) IBSKIP=LSKIP+16+LENSEC1 -C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + C LOOP THROUGH REMAINING SECTIONS CREATING AN INDEX FOR EACH FIELD IBREAD=MAX(5,MXBMS) DO @@ -168,8 +167,7 @@ SUBROUTINE IXGB2(LUGB,LSKIP,LGRIB,CBUF,NUMFLD,MLEN,IRET) ELSEIF (NUMSEC.EQ.7) THEN ! FOUND DATA SECTION CALL G2_SBYTEC(CINDEX,IBSKIP-LSKIP,8*IXDS,8*MXDS) ! LOC. OF DATA SEC. NUMFLD=NUMFLD+1 - IF ((LINDEX+MLEN).GT.MBUF) THEN ! ALLOCATE MORE SPACE IF - ! NECESSARY + IF ((LINDEX+MLEN).GT.MBUF) THEN ! ALLOCATE MORE SPACE IF NECESSARY NEWSIZE=MAX(MBUF+NEXT,MBUF+LINDEX) CALL REALLOC(CBUF,MLEN,NEWSIZE,ISTAT) IF ( ISTAT .NE. 0 ) THEN @@ -188,6 +186,4 @@ SUBROUTINE IXGB2(LUGB,LSKIP,LGRIB,CBUF,NUMFLD,MLEN,IRET) IBSKIP=IBSKIP+LENSEC ENDDO -C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - RETURN END From 06fe84c82c03980084bca16f99da891306fc0c60 Mon Sep 17 00:00:00 2001 From: Ed Date: Sat, 8 Jul 2023 06:52:49 -0600 Subject: [PATCH 06/24] turn off printing in test that causes memory problems --- tests/test_index_gdas.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_index_gdas.F90 b/tests/test_index_gdas.F90 index 7e0262e5..53ac7b84 100644 --- a/tests/test_index_gdas.F90 +++ b/tests/test_index_gdas.F90 @@ -230,7 +230,7 @@ end subroutine getgb2s call getgb2s(cbuf, nlen, nnum, j, jdisc, jids, jpdtn, jpdt, jgdtn, & jgdt, k, gfld, lpos, iret) if (iret .ne. 0) stop 201 - call print_gribmod(gfld) +! call print_gribmod(gfld) print *, '***************************************' if (cmp_gribmod(gfld, expected_gfld(mnum)) .ne. 0) stop 202 print *, '***************************************' From e77854333215329216692d39e7ee033a3b6cce7d Mon Sep 17 00:00:00 2001 From: Ed Date: Sat, 8 Jul 2023 06:59:44 -0600 Subject: [PATCH 07/24] initialized local variable to solve memory issue --- src/getfield.F90 | 1 + 1 file changed, 1 insertion(+) diff --git a/src/getfield.F90 b/src/getfield.F90 index 6b004317..e3eda987 100644 --- a/src/getfield.F90 +++ b/src/getfield.F90 @@ -139,6 +139,7 @@ subroutine getfield(cgrib, lcgrib, ifldnum, igds, igdstmpl, & have7 = .false. ierr = 0 numfld = 0 + numlocal = 0 ! Check for valid request number if (ifldnum .le. 0) then From 0934b461dda0e3bbb84263bc372790d0ac23b720 Mon Sep 17 00:00:00 2001 From: Ed Date: Sat, 8 Jul 2023 07:03:58 -0600 Subject: [PATCH 08/24] fixed memory leak in test_files --- tests/test_files.F90 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/test_files.F90 b/tests/test_files.F90 index cb813c7a..8fbfd612 100644 --- a/tests/test_files.F90 +++ b/tests/test_files.F90 @@ -31,6 +31,9 @@ program test_files ! Close the file. call baclose(lugb, iret) if (iret .ne. 0) stop 200 + + ! Free memory. + call gf_free(gfld) print *, 'SUCCESS!' end program test_files From 1b6412e2d35729b23f51b3680f6b1cb5d2c74d9c Mon Sep 17 00:00:00 2001 From: Ed Date: Sat, 8 Jul 2023 07:24:37 -0600 Subject: [PATCH 09/24] initialized array in gdt2gds() to solve memory problems --- src/gdt2gds.f | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gdt2gds.f b/src/gdt2gds.f index 7e55d128..2edeab60 100644 --- a/src/gdt2gds.f +++ b/src/gdt2gds.f @@ -51,6 +51,7 @@ subroutine gdt2gds(igds,igdstmpl,idefnum,ideflist,kgds, integer :: kgds72(200),kgds71(200),idum(200),jdum(200) iret=0 + idum = 0 if (igds(5).eq.0) then ! Lat/Lon grid kgds(1)=0 kgds(2)=igdstmpl(8) ! Ni From aaf0740c30dcc10e9868779dca9ed645253aa062 Mon Sep 17 00:00:00 2001 From: Ed Date: Mon, 10 Jul 2023 07:24:43 -0600 Subject: [PATCH 10/24] fixed uninitialized memory in test_g2_encode --- tests/test_g2_encode.F90 | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_g2_encode.F90 b/tests/test_g2_encode.F90 index a7c3bdb6..2fe0317e 100644 --- a/tests/test_g2_encode.F90 +++ b/tests/test_g2_encode.F90 @@ -122,6 +122,7 @@ program test_g2_encode integer :: i print *, 'Testing g2 library encoding/decoding.' + fld = 1 print *, 'Testing g2 library encoding...' ! listsec0(1) Discipline-GRIB Master Table Number (Code Table 0.0) From dbab9ef3a5f0ed8f87e03eabdd7b19e8a8773e48 Mon Sep 17 00:00:00 2001 From: Ed Date: Mon, 10 Jul 2023 07:34:06 -0600 Subject: [PATCH 11/24] fixed memory problem in test code --- tests/test_getgb2p.F90 | 3 +++ tests/test_getgb2p_gdas.F90 | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/test_getgb2p.F90 b/tests/test_getgb2p.F90 index 69c5c627..5416af4a 100644 --- a/tests/test_getgb2p.F90 +++ b/tests/test_getgb2p.F90 @@ -52,11 +52,14 @@ end subroutine getgb2p do i = 1, 250 jgdt(i) = -9999 end do + nullify(gribm) print *, 'First try with extract true...' + extract = .true. call getgb2p(lugb, lugi, j, jdisc, jids, jpdtn, jpdt, jgdtn, jgdt, & extract, k, gribm, leng, iret) + print *, "done" if (iret .ne. 0) stop 101 if (k .ne. 1 .or. leng .ne. 11183) stop 110 diff --git a/tests/test_getgb2p_gdas.F90 b/tests/test_getgb2p_gdas.F90 index cdaeaed2..84727d31 100644 --- a/tests/test_getgb2p_gdas.F90 +++ b/tests/test_getgb2p_gdas.F90 @@ -35,10 +35,8 @@ subroutine getgb2p(lugb, lugi, j, jdisc, jids, jpdtn, jpdt, jgdtn, jgdt, & end subroutine getgb2p end interface - print *, 'Testing the getgb2p() subroutine - expect and ignore error messages during test...' - ! Open a real GRIB2 file. - print *, 'Testing getgb2p() some more...' + print *, 'Testing getgb2p() with file ', GDAS_FILE call baopenr(lugb, GDAS_FILE, iret) if (iret .ne. 0) stop 100 @@ -55,11 +53,13 @@ end subroutine getgb2p do i = 1, 250 jgdt(i) = -9999 end do + extract = .false. ! Try with extract both true and false. The results are the same for ! the GDAS file. do e = 1, 2 if (e .eq. 2) extract = .true. + print *, 'calling getgb2p() with extract = ', extract call getgb2p(lugb, 0, j, jdisc, jids, jpdtn, jpdt, jgdtn, jgdt, & extract, k, gribm, leng, iret) print *, iret, k, leng From d100e88cf9e1e6085dff0355bc89a2fd28fde969 Mon Sep 17 00:00:00 2001 From: Ed Date: Mon, 10 Jul 2023 07:37:55 -0600 Subject: [PATCH 12/24] add memory checking to developer workflow --- .github/workflows/developer.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/developer.yml b/.github/workflows/developer.yml index 2c34e04d..9531a26c 100644 --- a/.github/workflows/developer.yml +++ b/.github/workflows/developer.yml @@ -113,6 +113,7 @@ jobs: cd $GITHUB_WORKSPACE/g2/build ctest --verbose --output-on-failure --rerun-failed gcovr --root .. -v --html-details --exclude ../tests --exclude CMakeFiles --print-summary -o test-coverage.html &> /dev/null + ctest -T memcheck - name: cache-data if: steps.cache-data.outputs.cache-hit != 'true' From 2b072c91f0702cea9a7b39c1d764db9cbc8b7790 Mon Sep 17 00:00:00 2001 From: Ed Date: Mon, 10 Jul 2023 07:40:29 -0600 Subject: [PATCH 13/24] add memory checking to developer workflow --- .github/workflows/developer.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/developer.yml b/.github/workflows/developer.yml index 9531a26c..5fb6298f 100644 --- a/.github/workflows/developer.yml +++ b/.github/workflows/developer.yml @@ -28,7 +28,7 @@ jobs: - name: install-dependencies run: | sudo apt-get update - sudo apt-get install libpng-dev zlib1g-dev libjpeg-dev doxygen gcovr + sudo apt-get install libpng-dev zlib1g-dev libjpeg-dev doxygen gcovr valgrind - name: checkout-bacio uses: actions/checkout@v3 From 03a670e30bec2e0354808713f2c1f1c981d68ec2 Mon Sep 17 00:00:00 2001 From: Ed Date: Mon, 10 Jul 2023 08:00:50 -0600 Subject: [PATCH 14/24] trying a matrix --- .github/workflows/developer.yml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/developer.yml b/.github/workflows/developer.yml index 5fb6298f..dd2e404b 100644 --- a/.github/workflows/developer.yml +++ b/.github/workflows/developer.yml @@ -22,6 +22,8 @@ jobs: strategy: fail-fast: true + matrix: + memcheck: [false, true] steps: @@ -105,15 +107,22 @@ jobs: mkdir build doxygen --version cd build - cmake .. -DENABLE_DOCS=On -DJasper_ROOT=~/Jasper -DCMAKE_PREFIX_PATH="~/bacio;~/w3emc" -DCMAKE_Fortran_FLAGS="-g -fprofile-abs-path -fprofile-arcs -ftest-coverage -O0 -Wall -fno-omit-frame-pointer -fsanitize=address" -DCMAKE_C_FLAGS="-g -fprofile-abs-path -fprofile-arcs -ftest-coverage -O0 -Wall -fno-omit-frame-pointer -fsanitize=address" -DFTP_TEST_FILES=ON -DTEST_FILE_DIR=/home/runner/data -DCMAKE_BUILD_TYPE=Debug + if [[ ${{ matrix.memcheck }} == "false" ]]; then + cmake .. -DENABLE_DOCS=On -DJasper_ROOT=~/Jasper -DCMAKE_PREFIX_PATH="~/bacio;~/w3emc" -DCMAKE_Fortran_FLAGS="-g -fprofile-abs-path -fprofile-arcs -ftest-coverage -O0 -Wall -fno-omit-frame-pointer -fsanitize=address" -DCMAKE_C_FLAGS="-g -fprofile-abs-path -fprofile-arcs -ftest-coverage -O0 -Wall -fno-omit-frame-pointer -fsanitize=address" -DFTP_TEST_FILES=ON -DTEST_FILE_DIR=/home/runner/data -DCMAKE_BUILD_TYPE=Debug + else + cmake .. -DENABLE_DOCS=On -DJasper_ROOT=~/Jasper -DCMAKE_PREFIX_PATH="~/bacio;~/w3emc" -DCMAKE_Fortran_FLAGS="-g -O0" -DCMAKE_C_FLAGS="-g -O0" -DFTP_TEST_FILES=ON -DTEST_FILE_DIR=/home/runner/data -DCMAKE_BUILD_TYPE=Debug + fi make -j2 VERBOSE=1 - name: test run: | cd $GITHUB_WORKSPACE/g2/build - ctest --verbose --output-on-failure --rerun-failed - gcovr --root .. -v --html-details --exclude ../tests --exclude CMakeFiles --print-summary -o test-coverage.html &> /dev/null - ctest -T memcheck + if [[ ${{ matrix.memcheck }} == "false" ]]; then + ctest --verbose --output-on-failure --rerun-failed + gcovr --root .. -v --html-details --exclude ../tests --exclude CMakeFiles --print-summary -o test-coverage.html &> /dev/null + else + ctest -T memcheck + fi - name: cache-data if: steps.cache-data.outputs.cache-hit != 'true' From 9bc849ca9ef1f06230112cc1eb5d60bc49f04796 Mon Sep 17 00:00:00 2001 From: Ed Date: Mon, 10 Jul 2023 08:03:01 -0600 Subject: [PATCH 15/24] trying a matrix --- .github/workflows/developer.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/developer.yml b/.github/workflows/developer.yml index dd2e404b..e2e8eb1a 100644 --- a/.github/workflows/developer.yml +++ b/.github/workflows/developer.yml @@ -22,8 +22,8 @@ jobs: strategy: fail-fast: true - matrix: - memcheck: [false, true] + matrix: + memcheck: [false, true] steps: From 7d289a75eda3beaeeb5e943b49bea35d024825d1 Mon Sep 17 00:00:00 2001 From: Ed Date: Mon, 10 Jul 2023 08:10:56 -0600 Subject: [PATCH 16/24] trying a matrix --- .github/workflows/developer.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/developer.yml b/.github/workflows/developer.yml index e2e8eb1a..037d1e4d 100644 --- a/.github/workflows/developer.yml +++ b/.github/workflows/developer.yml @@ -131,6 +131,7 @@ jobs: cp $GITHUB_WORKSPACE/g2/build/tests/data/* ~/data - name: upload-test-coverage + if: ${{ matrix.memcheck }} == "false" uses: actions/upload-artifact@v3 with: name: g2-test-coverage From eb48e163631168251060a861da30f56fd0dea314 Mon Sep 17 00:00:00 2001 From: Ed Date: Mon, 10 Jul 2023 08:19:53 -0600 Subject: [PATCH 17/24] better job names --- .github/workflows/developer.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/developer.yml b/.github/workflows/developer.yml index 037d1e4d..fb563122 100644 --- a/.github/workflows/developer.yml +++ b/.github/workflows/developer.yml @@ -23,7 +23,15 @@ jobs: strategy: fail-fast: true matrix: - memcheck: [false, true] + memcheck: + - { + memcheck: false + name: "asan/coverage" + } + - { + memcheck: true + name: "valgrind" + } steps: From f1cd8db938009d37c12a658650f41403e95faa6b Mon Sep 17 00:00:00 2001 From: Ed Date: Mon, 10 Jul 2023 08:23:08 -0600 Subject: [PATCH 18/24] better job names --- .github/workflows/developer.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/developer.yml b/.github/workflows/developer.yml index fb563122..ac67e49c 100644 --- a/.github/workflows/developer.yml +++ b/.github/workflows/developer.yml @@ -23,7 +23,7 @@ jobs: strategy: fail-fast: true matrix: - memcheck: + config: - { memcheck: false name: "asan/coverage" @@ -115,7 +115,7 @@ jobs: mkdir build doxygen --version cd build - if [[ ${{ matrix.memcheck }} == "false" ]]; then + if [[ ${{ matrix.config.memcheck }} == "false" ]]; then cmake .. -DENABLE_DOCS=On -DJasper_ROOT=~/Jasper -DCMAKE_PREFIX_PATH="~/bacio;~/w3emc" -DCMAKE_Fortran_FLAGS="-g -fprofile-abs-path -fprofile-arcs -ftest-coverage -O0 -Wall -fno-omit-frame-pointer -fsanitize=address" -DCMAKE_C_FLAGS="-g -fprofile-abs-path -fprofile-arcs -ftest-coverage -O0 -Wall -fno-omit-frame-pointer -fsanitize=address" -DFTP_TEST_FILES=ON -DTEST_FILE_DIR=/home/runner/data -DCMAKE_BUILD_TYPE=Debug else cmake .. -DENABLE_DOCS=On -DJasper_ROOT=~/Jasper -DCMAKE_PREFIX_PATH="~/bacio;~/w3emc" -DCMAKE_Fortran_FLAGS="-g -O0" -DCMAKE_C_FLAGS="-g -O0" -DFTP_TEST_FILES=ON -DTEST_FILE_DIR=/home/runner/data -DCMAKE_BUILD_TYPE=Debug @@ -125,7 +125,7 @@ jobs: - name: test run: | cd $GITHUB_WORKSPACE/g2/build - if [[ ${{ matrix.memcheck }} == "false" ]]; then + if [[ ${{ matrix.config.memcheck }} == "false" ]]; then ctest --verbose --output-on-failure --rerun-failed gcovr --root .. -v --html-details --exclude ../tests --exclude CMakeFiles --print-summary -o test-coverage.html &> /dev/null else @@ -139,7 +139,7 @@ jobs: cp $GITHUB_WORKSPACE/g2/build/tests/data/* ~/data - name: upload-test-coverage - if: ${{ matrix.memcheck }} == "false" + if: ${{ matrix.config.memcheck }} == "false" uses: actions/upload-artifact@v3 with: name: g2-test-coverage From a4020ffc40f9cb99f3d999e06c3d968699176e8a Mon Sep 17 00:00:00 2001 From: Ed Date: Mon, 10 Jul 2023 08:25:09 -0600 Subject: [PATCH 19/24] better job names --- .github/workflows/developer.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/developer.yml b/.github/workflows/developer.yml index ac67e49c..e9ada0d4 100644 --- a/.github/workflows/developer.yml +++ b/.github/workflows/developer.yml @@ -26,13 +26,10 @@ jobs: config: - { memcheck: false - name: "asan/coverage" } - { memcheck: true - name: "valgrind" } - steps: - name: install-dependencies From 5a82ef8ec78bb6807d13f4805c05cbdbc06bacda Mon Sep 17 00:00:00 2001 From: Ed Date: Mon, 10 Jul 2023 08:27:32 -0600 Subject: [PATCH 20/24] better job names --- .github/workflows/developer.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/developer.yml b/.github/workflows/developer.yml index e9ada0d4..929540a8 100644 --- a/.github/workflows/developer.yml +++ b/.github/workflows/developer.yml @@ -26,9 +26,11 @@ jobs: config: - { memcheck: false + name: "name1" } - { memcheck: true + name: "name2" } steps: From fcb5ff48d7974daedfb02a6ff85aef72abffd648 Mon Sep 17 00:00:00 2001 From: Ed Date: Mon, 10 Jul 2023 08:31:34 -0600 Subject: [PATCH 21/24] better job names --- .github/workflows/developer.yml | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/.github/workflows/developer.yml b/.github/workflows/developer.yml index 929540a8..ab0da94a 100644 --- a/.github/workflows/developer.yml +++ b/.github/workflows/developer.yml @@ -23,15 +23,8 @@ jobs: strategy: fail-fast: true matrix: - config: - - { - memcheck: false - name: "name1" - } - - { - memcheck: true - name: "name2" - } + config: ["asan/code coverage", "memcheck"] + steps: - name: install-dependencies @@ -114,7 +107,7 @@ jobs: mkdir build doxygen --version cd build - if [[ ${{ matrix.config.memcheck }} == "false" ]]; then + if [[ ${{ matrix.config }} == "asan/code coverage" ]]; then cmake .. -DENABLE_DOCS=On -DJasper_ROOT=~/Jasper -DCMAKE_PREFIX_PATH="~/bacio;~/w3emc" -DCMAKE_Fortran_FLAGS="-g -fprofile-abs-path -fprofile-arcs -ftest-coverage -O0 -Wall -fno-omit-frame-pointer -fsanitize=address" -DCMAKE_C_FLAGS="-g -fprofile-abs-path -fprofile-arcs -ftest-coverage -O0 -Wall -fno-omit-frame-pointer -fsanitize=address" -DFTP_TEST_FILES=ON -DTEST_FILE_DIR=/home/runner/data -DCMAKE_BUILD_TYPE=Debug else cmake .. -DENABLE_DOCS=On -DJasper_ROOT=~/Jasper -DCMAKE_PREFIX_PATH="~/bacio;~/w3emc" -DCMAKE_Fortran_FLAGS="-g -O0" -DCMAKE_C_FLAGS="-g -O0" -DFTP_TEST_FILES=ON -DTEST_FILE_DIR=/home/runner/data -DCMAKE_BUILD_TYPE=Debug @@ -124,7 +117,7 @@ jobs: - name: test run: | cd $GITHUB_WORKSPACE/g2/build - if [[ ${{ matrix.config.memcheck }} == "false" ]]; then + if [[ ${{ matrix.config }} == "asan/code coverage" ]]; then ctest --verbose --output-on-failure --rerun-failed gcovr --root .. -v --html-details --exclude ../tests --exclude CMakeFiles --print-summary -o test-coverage.html &> /dev/null else From 7d692457dfe0bb9398a5ecb31e7bac069559fe81 Mon Sep 17 00:00:00 2001 From: Ed Date: Mon, 10 Jul 2023 08:39:17 -0600 Subject: [PATCH 22/24] better job names --- .github/workflows/developer.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/developer.yml b/.github/workflows/developer.yml index ab0da94a..f1eaf032 100644 --- a/.github/workflows/developer.yml +++ b/.github/workflows/developer.yml @@ -131,7 +131,7 @@ jobs: cp $GITHUB_WORKSPACE/g2/build/tests/data/* ~/data - name: upload-test-coverage - if: ${{ matrix.config.memcheck }} == "false" + if: ${{ matrix.config }} == "asan/code coverage" uses: actions/upload-artifact@v3 with: name: g2-test-coverage From 918258aebd4d0ed6fee697a04a757ef59d2f77ee Mon Sep 17 00:00:00 2001 From: Ed Date: Mon, 10 Jul 2023 08:43:45 -0600 Subject: [PATCH 23/24] better job names --- .github/workflows/developer.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/developer.yml b/.github/workflows/developer.yml index f1eaf032..af15b31e 100644 --- a/.github/workflows/developer.yml +++ b/.github/workflows/developer.yml @@ -107,7 +107,7 @@ jobs: mkdir build doxygen --version cd build - if [[ ${{ matrix.config }} == "asan/code coverage" ]]; then + if [ ${{ matrix.config }} == "asan/code coverage" ]; then cmake .. -DENABLE_DOCS=On -DJasper_ROOT=~/Jasper -DCMAKE_PREFIX_PATH="~/bacio;~/w3emc" -DCMAKE_Fortran_FLAGS="-g -fprofile-abs-path -fprofile-arcs -ftest-coverage -O0 -Wall -fno-omit-frame-pointer -fsanitize=address" -DCMAKE_C_FLAGS="-g -fprofile-abs-path -fprofile-arcs -ftest-coverage -O0 -Wall -fno-omit-frame-pointer -fsanitize=address" -DFTP_TEST_FILES=ON -DTEST_FILE_DIR=/home/runner/data -DCMAKE_BUILD_TYPE=Debug else cmake .. -DENABLE_DOCS=On -DJasper_ROOT=~/Jasper -DCMAKE_PREFIX_PATH="~/bacio;~/w3emc" -DCMAKE_Fortran_FLAGS="-g -O0" -DCMAKE_C_FLAGS="-g -O0" -DFTP_TEST_FILES=ON -DTEST_FILE_DIR=/home/runner/data -DCMAKE_BUILD_TYPE=Debug @@ -117,7 +117,7 @@ jobs: - name: test run: | cd $GITHUB_WORKSPACE/g2/build - if [[ ${{ matrix.config }} == "asan/code coverage" ]]; then + if [ ${{ matrix.config }} == "asan/code coverage" ]; then ctest --verbose --output-on-failure --rerun-failed gcovr --root .. -v --html-details --exclude ../tests --exclude CMakeFiles --print-summary -o test-coverage.html &> /dev/null else From 7b9190c85158fabd1ae2283c259d524e43ba8236 Mon Sep 17 00:00:00 2001 From: Ed Date: Mon, 10 Jul 2023 08:49:13 -0600 Subject: [PATCH 24/24] new cache key for data cache --- .github/workflows/Linux_versions.yml | 2 +- .github/workflows/developer.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Linux_versions.yml b/.github/workflows/Linux_versions.yml index bc363965..b11a3613 100644 --- a/.github/workflows/Linux_versions.yml +++ b/.github/workflows/Linux_versions.yml @@ -128,7 +128,7 @@ jobs: uses: actions/cache@v3 with: path: ~/data - key: data-1 + key: data-2 - name: build run: | diff --git a/.github/workflows/developer.yml b/.github/workflows/developer.yml index af15b31e..94f40507 100644 --- a/.github/workflows/developer.yml +++ b/.github/workflows/developer.yml @@ -98,7 +98,7 @@ jobs: uses: actions/cache@v3 with: path: ~/data - key: data-1 + key: data-2 - name: build run: |