diff --git a/.github/actions/build-par-win/action.yml b/.github/actions/build-par-win/action.yml new file mode 100644 index 00000000000..f92c6d83079 --- /dev/null +++ b/.github/actions/build-par-win/action.yml @@ -0,0 +1,129 @@ +name: Build parallel MF6 (Windows) +description: Build parallel MODFLOW 6 on Windows +runs: + using: "composite" + steps: + + - name: Convert line endings + shell: cmd + run: | + unix2dos -n "modflow6\.github\common\configure_petsc.sh" "%TEMP%\configure_petsc.sh" + unix2dos -n "modflow6\.github\common\compile_petsc.sh" "%TEMP%\compile_petsc.sh" + unix2dos -n "modflow6\.github\common\compile_modflow6.bat" "%TEMP%\compile_modflow6.bat" + unix2dos -n "modflow6\.github\common\test_modflow6.bat" "%TEMP%\test_modflow6.bat" + + - name: Hide Strawberry programs + shell: bash + run: | + mkdir "$RUNNER_TEMP/strawberry" + mv /c/Strawberry/c/bin/gmake "$RUNNER_TEMP/strawberry/gmake" + mv /c/Strawberry/perl/bin/pkg-config "$RUNNER_TEMP/strawberry/pkg-config" + mv /c/Strawberry/perl/bin/pkg-config.bat "$RUNNER_TEMP/strawberry/pkg-config.bat" + + - name: Get date + id: get-date + shell: bash + run: echo "date=$(/bin/date -u "+%Y%m%d")" >> "$GITHUB_OUTPUT" + + - name: Set oneAPI install dir + shell: bash + run: echo "ONEAPI_ROOT=C:\Program Files (x86)\Intel\oneAPI" >> "$GITHUB_ENV" + + - name: Restore oneAPI cache + id: oneapi-cache + uses: actions/cache/restore@v3 + with: + path: ${{ env.ONEAPI_ROOT }} + key: oneapi-${{ runner.os }}-${{ steps.get-date.outputs.date }} + + - name: Install oneAPI BaseKit + shell: bash + if: steps.oneapi-cache.outputs.cache-hit != 'true' + run: | + url="https://registrationcenter-download.intel.com/akdlm/IRC_NAS/5cb30fb9-21e9-47e8-82da-a91e00191670/w_BaseKit_p_2024.0.1.45_offline.exe" + cmp="intel.oneapi.win.mkl.devel" + "modflow6/.github/common/install_intel_windows.bat" $url $cmp + rm -rf $TEMP/webimage.exe + rm -rf $TEMP/webimage_extracted + + - name: Install oneAPI HPCKit + shell: bash + if: steps.oneapi-cache.outputs.cache-hit != 'true' + run: | + url="https://registrationcenter-download.intel.com/akdlm/IRC_NAS/7a6db8a1-a8b9-4043-8e8e-ca54b56c34e4/w_HPCKit_p_2024.0.1.35_offline.exe" + cmp="intel.oneapi.win.cpp-dpcpp-common:intel.oneapi.win.ifort-compiler:intel.oneapi.win.mpi.devel" + "modflow6/.github/common/install_intel_windows.bat" $url $cmp + rm -rf $TEMP/webimage.exe + rm -rf $TEMP/webimage_extracted + + - name: Save oneAPI cache + if: steps.oneapi-cache.outputs.cache-hit != 'true' + uses: actions/cache/save@v3 + with: + path: ${{ env.ONEAPI_ROOT }} + key: oneapi-${{ runner.os }}-${{ steps.get-date.outputs.date }} + + - name: Restore PETSc cache + id: petsc-cache + uses: actions/cache/restore@v3 + with: + path: petsc + key: petsc-${{ runner.os }}-${{ steps.get-date.outputs.date }} + + - name: Download PETSc + if: steps.petsc-cache.outputs.cache-hit != 'true' + shell: bash + run: | + curl https://web.cels.anl.gov/projects/petsc/download/release-snapshots/petsc-3.20.5.tar.gz -O -J + mkdir petsc + tar -xzf petsc-3.20.5.tar.gz -C petsc --strip-components=1 + + - name: Setup Cygwin + if: steps.petsc-cache.outputs.cache-hit != 'true' + uses: egor-tensin/setup-cygwin@v4 + with: + packages: python3 make gcc-core gcc-g++ pkg-config + + - name: Hide Cygwin linker + if: steps.petsc-cache.outputs.cache-hit != 'true' + shell: C:\tools\cygwin\bin\bash.exe --login --norc -eo pipefail -o igncr '{0}' + run: mv /usr/bin/link.exe /usr/bin/link-cygwin.exe + + - name: Configure PETSc + if: steps.petsc-cache.outputs.cache-hit != 'true' + shell: cmd + run: | + "%ONEAPI_ROOT%\setvars.bat" intel64 vs2022 && "C:\tools\cygwin\bin\bash.exe" --login --norc -eo pipefail -o igncr "%TEMP%\configure_petsc.sh" + + - name: Build PETSc + if: steps.petsc-cache.outputs.cache-hit != 'true' + shell: cmd + run: | + "%ONEAPI_ROOT%\setvars.bat" intel64 vs2022 && "C:\tools\cygwin\bin\bash.exe" --login --norc -eo pipefail -o igncr "%TEMP%\compile_petsc.sh" + + - name: Save PETSc cache + if: steps.petsc-cache.outputs.cache-hit != 'true' + uses: actions/cache/save@v3 + with: + path: petsc + key: petsc-${{ runner.os }}-${{ steps.get-date.outputs.date }} + + - name: Setup PETSC environment + shell: cmd + run: | + set PETSC_DIR=%GITHUB_WORKSPACE%\petsc + set PETSC_ARCH=arch-mswin-c-opt + echo PETSC_DIR=%PETSC_DIR%>>%GITHUB_ENV% + echo PETSC_ARCH=%PETSC_ARCH%>>%GITHUB_ENV% + echo %PETSC_DIR%\%PETSC_ARCH%\lib>>%GITHUB_PATH% + + - name: Build modflow6 + shell: cmd + run: | + "%ONEAPI_ROOT%\setvars.bat" intel64 vs2022 && "%TEMP%\compile_modflow6.bat" + + - name: Show Meson logs + if: failure() + shell: bash + working-directory: modflow6 + run: cat builddir/meson-logs/meson-log.txt \ No newline at end of file diff --git a/.github/actions/test-par-win/action.yml b/.github/actions/test-par-win/action.yml index 7fdf470c1c4..10766d9749b 100644 --- a/.github/actions/test-par-win/action.yml +++ b/.github/actions/test-par-win/action.yml @@ -4,129 +4,8 @@ runs: using: "composite" steps: - - name: Convert line endings - shell: cmd - run: | - unix2dos -n "modflow6\.github\common\configure_petsc.sh" "%TEMP%\configure_petsc.sh" - unix2dos -n "modflow6\.github\common\compile_petsc.sh" "%TEMP%\compile_petsc.sh" - unix2dos -n "modflow6\.github\common\compile_modflow6.bat" "%TEMP%\compile_modflow6.bat" - unix2dos -n "modflow6\.github\common\test_modflow6.bat" "%TEMP%\test_modflow6.bat" - - - name: Hide Strawberry programs - shell: bash - run: | - mkdir "$RUNNER_TEMP/strawberry" - mv /c/Strawberry/c/bin/gmake "$RUNNER_TEMP/strawberry/gmake" - mv /c/Strawberry/perl/bin/pkg-config "$RUNNER_TEMP/strawberry/pkg-config" - mv /c/Strawberry/perl/bin/pkg-config.bat "$RUNNER_TEMP/strawberry/pkg-config.bat" - - - name: Get date - id: get-date - shell: bash - run: echo "date=$(/bin/date -u "+%Y%m%d")" >> "$GITHUB_OUTPUT" - - - name: Set oneAPI install dir - shell: bash - run: echo "ONEAPI_ROOT=C:\Program Files (x86)\Intel\oneAPI" >> "$GITHUB_ENV" - - - name: Restore oneAPI cache - id: oneapi-cache - uses: actions/cache/restore@v3 - with: - path: ${{ env.ONEAPI_ROOT }} - key: oneapi-${{ runner.os }}-${{ steps.get-date.outputs.date }} - - - name: Install oneAPI BaseKit - shell: bash - if: steps.oneapi-cache.outputs.cache-hit != 'true' - run: | - url="https://registrationcenter-download.intel.com/akdlm/IRC_NAS/5cb30fb9-21e9-47e8-82da-a91e00191670/w_BaseKit_p_2024.0.1.45_offline.exe" - cmp="intel.oneapi.win.mkl.devel" - "modflow6/.github/common/install_intel_windows.bat" $url $cmp - rm -rf $TEMP/webimage.exe - rm -rf $TEMP/webimage_extracted - - - name: Install oneAPI HPCKit - shell: bash - if: steps.oneapi-cache.outputs.cache-hit != 'true' - run: | - url="https://registrationcenter-download.intel.com/akdlm/IRC_NAS/7a6db8a1-a8b9-4043-8e8e-ca54b56c34e4/w_HPCKit_p_2024.0.1.35_offline.exe" - cmp="intel.oneapi.win.cpp-dpcpp-common:intel.oneapi.win.ifort-compiler:intel.oneapi.win.mpi.devel" - "modflow6/.github/common/install_intel_windows.bat" $url $cmp - rm -rf $TEMP/webimage.exe - rm -rf $TEMP/webimage_extracted - - - name: Save oneAPI cache - if: steps.oneapi-cache.outputs.cache-hit != 'true' - uses: actions/cache/save@v3 - with: - path: ${{ env.ONEAPI_ROOT }} - key: oneapi-${{ runner.os }}-${{ steps.get-date.outputs.date }} - - - name: Restore PETSc cache - id: petsc-cache - uses: actions/cache/restore@v3 - with: - path: petsc - key: petsc-${{ runner.os }}-${{ steps.get-date.outputs.date }} - - - name: Download PETSc - if: steps.petsc-cache.outputs.cache-hit != 'true' - shell: bash - run: | - curl https://web.cels.anl.gov/projects/petsc/download/release-snapshots/petsc-3.20.5.tar.gz -O -J - mkdir petsc - tar -xzf petsc-3.20.5.tar.gz -C petsc --strip-components=1 - - - name: Setup Cygwin - if: steps.petsc-cache.outputs.cache-hit != 'true' - uses: egor-tensin/setup-cygwin@v4 - with: - packages: python3 make gcc-core gcc-g++ pkg-config - - - name: Hide Cygwin linker - if: steps.petsc-cache.outputs.cache-hit != 'true' - shell: C:\tools\cygwin\bin\bash.exe --login --norc -eo pipefail -o igncr '{0}' - run: mv /usr/bin/link.exe /usr/bin/link-cygwin.exe - - - name: Configure PETSc - if: steps.petsc-cache.outputs.cache-hit != 'true' - shell: cmd - run: | - "%ONEAPI_ROOT%\setvars.bat" intel64 vs2022 && "C:\tools\cygwin\bin\bash.exe" --login --norc -eo pipefail -o igncr "%TEMP%\configure_petsc.sh" - - - name: Build PETSc - if: steps.petsc-cache.outputs.cache-hit != 'true' - shell: cmd - run: | - "%ONEAPI_ROOT%\setvars.bat" intel64 vs2022 && "C:\tools\cygwin\bin\bash.exe" --login --norc -eo pipefail -o igncr "%TEMP%\compile_petsc.sh" - - - name: Save PETSc cache - if: steps.petsc-cache.outputs.cache-hit != 'true' - uses: actions/cache/save@v3 - with: - path: petsc - key: petsc-${{ runner.os }}-${{ steps.get-date.outputs.date }} - - - name: Setup PETSC environment - shell: cmd - run: | - set PETSC_DIR=%GITHUB_WORKSPACE%\petsc - set PETSC_ARCH=arch-mswin-c-opt - echo PETSC_DIR=%PETSC_DIR%>>%GITHUB_ENV% - echo PETSC_ARCH=%PETSC_ARCH%>>%GITHUB_ENV% - echo %PETSC_DIR%\%PETSC_ARCH%\lib>>%GITHUB_PATH% - - - name: Build modflow6 - shell: cmd - run: | - "%ONEAPI_ROOT%\setvars.bat" intel64 vs2022 && "%TEMP%\compile_modflow6.bat" - - - name: Show Meson logs - if: failure() - shell: bash - working-directory: modflow6 - run: cat builddir/meson-logs/meson-log.txt + - name: Build MF6 parallel + uses: ./modflow6/.github/actions/build-par-win - name: Update flopy working-directory: modflow6/autotest diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6737e9d9359..b06f1eeef4e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -56,7 +56,7 @@ on: value: ${{ jobs.build.outputs.distname }} jobs: build: - name: Build binaries (${{ matrix.os }}) + name: Build binaries (${{ matrix.os }}, parallel=${{ matrix.parallel }}) runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -65,15 +65,23 @@ jobs: - os: ${{ inputs.linux_version }} compiler: ${{ inputs.compiler_toolchain }} version: ${{ inputs.compiler_version }} + parallel: false - os: macos-13 compiler: ${{ inputs.compiler_toolchain }} version: ${{ inputs.compiler_version }} + parallel: false - os: macos-14 compiler: gcc version: 13 + parallel: false - os: windows-2022 compiler: ${{ inputs.compiler_toolchain }} version: ${{ inputs.compiler_version }} + parallel: false + - os: windows-2022 + compiler: intel-classic + version: "2021.7" + parallel: true defaults: run: shell: bash -l {0} @@ -99,6 +107,7 @@ jobs: powershell - name: Setup ${{ matrix.compiler }} ${{ matrix.version }} + if: (!(runner.os == 'Windows' && matrix.parallel)) id: setup-fortran uses: fortran-lang/setup-fortran@v1 with: @@ -131,6 +140,15 @@ jobs: fi eval "$cmd" + - name: Get OS tag + id: ostag + run: | + ostag=$(python -c "from modflow_devtools.ostags import get_ostag; print(get_ostag())") + if [[ "${{ matrix.parallel }}" == "true" ]]; then + ostag="${ostag}par" + fi + echo "ostag=$ostag" >> $GITHUB_OUTPUT + # for statically linked gfortran ARM mac build - name: Hide dylibs (macOS) if: matrix.os == 'macos-14' @@ -148,34 +166,59 @@ jobs: fi - name: Build binaries - if: runner.os != 'Windows' - working-directory: modflow6 - run: | - meson setup builddir -Ddebug=false --prefix=$(pwd) --libdir=bin - meson install -C builddir - meson test --verbose --no-rebuild -C builddir - - - name: Build binaries (Windows) - if: runner.os == 'Windows' + if: (!(runner.os == 'Windows' && matrix.parallel)) working-directory: modflow6 - shell: pwsh run: | meson setup builddir -Ddebug=false --prefix=$(pwd) --libdir=bin meson install -C builddir meson test --verbose --no-rebuild -C builddir - - name: Get OS tag - id: ostag - run: | - ostag=$(python -c "from modflow_devtools.ostags import get_ostag; print(get_ostag())") - echo "ostag=$ostag" >> $GITHUB_OUTPUT - - name: Check architecture (macOS) working-directory: modflow6/bin if: runner.os == 'macOS' run: | otool -L mf6 - lipo -info mf6 + lipo -info mf6 + + - name: Build binaries (Windows) + if: runner.os == 'Windows' && matrix.parallel && !inputs.run_tests + uses: ./modflow6/.github/actions/build-par-win + + - name: Build and test binaries (Windows) + if: runner.os == 'Windows' && matrix.parallel && inputs.run_tests + uses: ./modflow6/.github/actions/test-par-win + + - name: Copy deps to bin dir + if: runner.os == 'Windows' && matrix.parallel + working-directory: modflow6/bin + shell: cmd + run: | + :: copy dependencies + copy "C:\Windows\System32\ucrtbase.dll" . + copy "C:\Windows\System32\msvcrt.dll" . + copy "C:\Windows\System32\msvcp_win.dll" . + copy "C:\Windows\SYSTEM32\MSVCP140.dll" . + copy "C:\Windows\SYSTEM32\VCRUNTIME140.dll" . + copy "C:\Windows\SYSTEM32\VCRUNTIME140_1.dll" . + copy "C:\Program Files (x86)\Intel\oneAPI\compiler\latest\bin\libifcoremd.dll" . + copy "C:\Program Files (x86)\Intel\oneAPI\compiler\latest\bin\libmmd.dll" . + copy "C:\Program Files (x86)\Intel\oneAPI\mkl\latest\bin\mkl_sequential.2.dll" . + copy "C:\Program Files (x86)\Intel\oneAPI\mkl\latest\bin\mkl_core.2.dll" . + copy "C:\Program Files (x86)\Intel\oneAPI\mkl\latest\bin\mkl_def.2.dll" . + copy "C:\Program Files (x86)\Intel\oneAPI\mkl\latest\bin\mkl_avx2.2.dll" . + copy "C:\Program Files (x86)\Intel\oneAPI\mkl\latest\bin\mkl_avx512.2.dll" . + copy "C:\Program Files (x86)\Intel\oneAPI\mkl\latest\bin\mkl_mc3.2.dll" . + copy "C:\Program Files (x86)\Intel\oneAPI\mpi\latest\bin\impi.dll" . + copy "C:\Program Files (x86)\Intel\oneAPI\mpi\latest\opt\mpi\libfabric\bin\libfabric.dll" . + copy "C:\Program Files (x86)\Intel\oneAPI\mpi\latest\bin\mpiexec.exe" . + copy "C:\Program Files (x86)\Intel\oneAPI\mpi\latest\bin\hydra_bstrap_proxy.exe" . + copy "C:\Program Files (x86)\Intel\oneAPI\mpi\latest\bin\hydra_pmi_proxy.exe" . + copy "C:\Program Files (x86)\Intel\oneAPI\mpi\latest\bin\hydra_service.exe" . + copy "D:\a\modflow6\modflow6\petsc\arch-mswin-c-opt\lib\libpetsc.dll" . + + :: remove rebuilt and downloaded dirs + if exist rebuilt rd /s /q rebuilt + if exist rebuilt rd /s /q downloaded - name: Upload binaries uses: actions/upload-artifact@v3 @@ -183,28 +226,27 @@ jobs: name: bin-${{ steps.ostag.outputs.ostag }} path: modflow6/bin - # only run steps below if inputs.run_tests is true - name: Checkout modflow6-testmodels - if: inputs.run_tests == true + if: inputs.run_tests == true && runner.os != 'Windows' uses: actions/checkout@v4 with: repository: MODFLOW-USGS/modflow6-testmodels path: modflow6-testmodels - name: Checkout modflow6-examples - if: inputs.run_tests == true + if: inputs.run_tests == true && runner.os != 'Windows' uses: actions/checkout@v4 with: repository: MODFLOW-USGS/modflow6-examples path: modflow6-examples - name: Update flopy - if: inputs.run_tests == true + if: inputs.run_tests == true && runner.os != 'Windows' working-directory: modflow6/autotest run: python update_flopy.py - name: Get executables - if: inputs.run_tests == true + if: inputs.run_tests == true && runner.os != 'Windows' working-directory: modflow6/autotest env: GITHUB_TOKEN: ${{ github.token }} @@ -222,19 +264,6 @@ jobs: fi pytest -v -n auto --durations 0 -m "$markers" - - name: Test modflow6 (Windows) - if: inputs.run_tests == true && runner.os == 'Windows' - working-directory: modflow6/autotest - shell: pwsh - env: - REPOS_PATH: ${{ github.workspace }} - run: | - $markers="not large" - if ("${{ inputs.developmode }}" -eq "false") { - $markers="$markers and not developmode" - } - pytest -v -n auto --durations 0 -m "$markers" --keep-failed .failed - - name: Upload failed test output if: failure() uses: actions/upload-artifact@v4 @@ -447,6 +476,9 @@ jobs: - os: macos-13 - os: macos-14 - os: windows-2022 + parallel: false + - os: windows-2022 + parallel: true defaults: run: shell: bash -l {0} @@ -498,6 +530,9 @@ jobs: id: ostag run: | ostag=$(python -c "from modflow_devtools.ostags import get_ostag; print(get_ostag())") + if [[ "${{ matrix.parallel }}" == "true" ]]; then + ostag="${ostag}par" + fi echo "ostag=$ostag" >> $GITHUB_OUTPUT - name: Download artifacts diff --git a/.github/workflows/release_dispatch.yml b/.github/workflows/release_dispatch.yml index 4c7cb5679fd..77d159d0f46 100644 --- a/.github/workflows/release_dispatch.yml +++ b/.github/workflows/release_dispatch.yml @@ -34,6 +34,11 @@ on: required: false type: string default: '2021.7' + developmode: + description: 'Build binaries in develop mode. If false, IDEVELOPMODE is set to 0.' + required: false + type: boolean + default: true run_tests: description: 'Run tests after building binaries.' required: false @@ -128,7 +133,7 @@ jobs: compiler_toolchain: ${{ needs.set_options.outputs.compiler_toolchain }} compiler_version: ${{ needs.set_options.outputs.compiler_version }} branch: ${{ needs.set_options.outputs.branch }} - developmode: false + developmode: ${{ inputs.developmode }} full: true run_tests: ${{ inputs.run_tests }} version: ${{ needs.set_options.outputs.version }} diff --git a/README.md b/README.md index afe5cbddce0..f2d96047b8f 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ This is the development repository for the USGS MODFLOW 6 Hydrologic Model. The [![MODFLOW 6 continuous integration](https://github.com/MODFLOW-USGS/modflow6/actions/workflows/ci.yml/badge.svg)](https://github.com/MODFLOW-USGS/modflow6/actions/workflows/ci.yml) [![MODFLOW 6 documentation](https://github.com/MODFLOW-USGS/modflow6/actions/workflows/docs.yml/badge.svg)](https://github.com/MODFLOW-USGS/modflow6/actions/workflows/docs.yml) [![MODFLOW 6 large models](https://github.com/MODFLOW-USGS/modflow6/actions/workflows/large.yml/badge.svg)](https://github.com/MODFLOW-USGS/modflow6/actions/workflows/large.yml) -[![MODFLOW 6 intel nightly build](https://github.com/MODFLOW-USGS/modflow6-nightly-build/actions/workflows/nightly-build-intel.yml/badge.svg)](https://github.com/MODFLOW-USGS/modflow6-nightly-build/actions/workflows/nightly-build-intel.yml) +[![MODFLOW 6 nightly build](https://github.com/MODFLOW-USGS/modflow6-nightly-build/actions/workflows/nightly-build.yml/badge.svg)](https://github.com/MODFLOW-USGS/modflow6-nightly-build/actions/workflows/nightly-build.yml) ## Branches