diff --git a/.github/actions/test-extended/action.yml b/.github/actions/test-extended/action.yml index 49d2cc67da5..953df09622c 100644 --- a/.github/actions/test-extended/action.yml +++ b/.github/actions/test-extended/action.yml @@ -11,11 +11,20 @@ runs: version: 13 - name: Checkout PETSc + if: runner.os == 'Linux' uses: actions/checkout@v4 with: repository: petsc/petsc path: petsc ref: release + + - name: Checkout PETSc + if: runner.os == 'macOS' + uses: actions/checkout@v4 + with: + repository: petsc/petsc + path: petsc + ref: release-3.21 - name: Configure environment if: runner.os == 'Linux' @@ -37,7 +46,7 @@ runs: working-directory: petsc run: | sudo wget -P $GITHUB_WORKSPACE/petsc https://download.open-mpi.org/release/open-mpi/v5.0/openmpi-5.0.2.tar.gz - sudo ./configure PETSC_ARCH=linux-gnu --download-fblaslapack --download-openmpi=$GITHUB_WORKSPACE/petsc/openmpi-5.0.2.tar.gz + sudo ./configure PETSC_ARCH=linux-gnu --download-fblaslapack --download-openmpi=$GITHUB_WORKSPACE/petsc/openmpi-5.0.2.tar.gz --with-debugging=0 sudo make all - name: Configure PETSc @@ -64,9 +73,7 @@ runs: if: runner.os == 'macOS' shell: bash run: | - bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" brew install netcdf-fortran - brew install gcc@13 nc-config --all nf-config diff --git a/.github/actions/test-par/action.yml b/.github/actions/test-par/action.yml index 5b96a2835a6..7b390758473 100644 --- a/.github/actions/test-par/action.yml +++ b/.github/actions/test-par/action.yml @@ -11,11 +11,20 @@ runs: version: 13 - name: Checkout PETSc + if: runner.os != 'macOS' uses: actions/checkout@v4 with: repository: petsc/petsc path: petsc ref: release + + - name: Checkout PETSc + if: runner.os == 'macOS' + uses: actions/checkout@v4 + with: + repository: petsc/petsc + path: petsc + ref: release-3.21 - name: Configure environment if: runner.os == 'Linux' @@ -37,7 +46,7 @@ runs: working-directory: petsc run: | sudo wget -P $GITHUB_WORKSPACE/petsc https://download.open-mpi.org/release/open-mpi/v5.0/openmpi-5.0.2.tar.gz - sudo ./configure PETSC_ARCH=linux-gnu --download-fblaslapack --download-openmpi=$GITHUB_WORKSPACE/petsc/openmpi-5.0.2.tar.gz + sudo ./configure PETSC_ARCH=linux-gnu --download-fblaslapack --download-openmpi=$GITHUB_WORKSPACE/petsc/openmpi-5.0.2.tar.gz --with-debugging=0 sudo make all - name: Configure PETSc diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 012b22c1f4d..42ba0f583ed 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -502,7 +502,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ ubuntu-22.04, macos-12, windows-2022 ] + os: [ ubuntu-22.04, macos-13, windows-2022 ] defaults: run: shell: bash @@ -530,6 +530,15 @@ jobs: working-directory: modflow6 run: pixi run install + - name: Set LDFLAGS (macOS) + if: matrix.os == 'macos-13' + run: | + os_ver=$(sw_vers -productVersion | cut -d'.' -f1) + if (( "$os_ver" > 12 )); then + ldflags="$LDFLAGS -Wl,-ld_classic" + echo "LDFLAGS=$ldflags" >> $GITHUB_ENV + fi + - name: Test parallel MF6 if: runner.os != 'Windows' uses: ./modflow6/.github/actions/test-par @@ -555,7 +564,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ ubuntu-22.04, macos-12 ] + os: [ ubuntu-22.04, macos-13 ] defaults: run: shell: bash @@ -581,6 +590,15 @@ jobs: working-directory: modflow6 run: pixi run pip install xugrid xarray netcdf4 + - name: Set LDFLAGS (macOS) + if: matrix.os == 'macos-13' + run: | + os_ver=$(sw_vers -productVersion | cut -d'.' -f1) + if (( "$os_ver" > 12 )); then + ldflags="$LDFLAGS -Wl,-ld_classic" + echo "LDFLAGS=$ldflags" >> $GITHUB_ENV + fi + - name: Test extended MF6 uses: ./modflow6/.github/actions/test-extended diff --git a/src/Utilities/Matrix/PetscMatrix.F90 b/src/Utilities/Matrix/PetscMatrix.F90 index 440e9b71f96..c2ee2bde546 100644 --- a/src/Utilities/Matrix/PetscMatrix.F90 +++ b/src/Utilities/Matrix/PetscMatrix.F90 @@ -396,7 +396,8 @@ subroutine pm_get_aij_local(this, ia, ja, amat) ! local PetscErrorCode :: ierr integer(I4B) :: irow, icol, ipos - real(DP) :: val + integer(I4B), dimension(1) :: irow_idxs, icol_idxs + real(DP), dimension(1) :: values Mat :: local_mat call MatGetDiagonalBlock(this%mat, local_mat, ierr) @@ -405,9 +406,11 @@ subroutine pm_get_aij_local(this, ia, ja, amat) do irow = 1, this%nrow do ipos = this%ia_local(irow), this%ia_local(irow + 1) - 1 icol = this%ja_local(ipos) - call MatGetValues(local_mat, 1, irow - 1, 1, icol - 1, val, ierr) + irow_idxs(1) = irow - 1 + icol_idxs(1) = icol - 1 + call MatGetValues(local_mat, 1, irow_idxs, 1, icol_idxs, values, ierr) CHKERRQ(ierr) - this%amat_local(ipos) = val + this%amat_local(ipos) = values(1) end do end do