Skip to content

Commit

Permalink
ci(parallel): fix windows parallel mf6 build (#1677)
Browse files Browse the repository at this point in the history
* libpetsc.dll wasn't found if PETSc cache miss, maybe interference from cygwin setup? setup PETSc environment after building PETSc to workaround
* simplify ONEAPI_ROOT usages
  • Loading branch information
wpbonelli authored Mar 17, 2024
1 parent 00d7d97 commit 9aeeaa4
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 18 deletions.
31 changes: 14 additions & 17 deletions .github/actions/test-par-win/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ runs:
run: echo "date=$(/bin/date -u "+%Y%m%d")" >> "$GITHUB_OUTPUT"

- name: Set oneAPI install dir
id: oneapi-root
shell: bash
run: echo "ONEAPI_ROOT=C:\Program Files (x86)\Intel\oneAPI" >> "$GITHUB_ENV"

Expand Down Expand Up @@ -71,15 +70,6 @@ runs:
path: petsc
key: petsc-${{ runner.os }}-${{ steps.get-date.outputs.date }}

- name: Configure environment
shell: bash
run: |
PETSC_DIR=$GITHUB_WORKSPACE/petsc
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: Download PETSc
if: steps.petsc-cache.outputs.cache-hit != 'true'
shell: bash
Expand All @@ -97,21 +87,19 @@ runs:
- 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
which link
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: |
"${{ env.ONEAPI_ROOT }}\setvars.bat" intel64 vs2022 && "C:\tools\cygwin\bin\bash.exe" --login --norc -eo pipefail -o igncr "%TEMP%\configure_petsc.sh"
"%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: |
"${{ env.ONEAPI_ROOT }}\setvars.bat" intel64 vs2022 && "C:\tools\cygwin\bin\bash.exe" --login --norc -eo pipefail -o igncr "%TEMP%\compile_petsc.sh"
"%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'
Expand All @@ -120,10 +108,19 @@ runs:
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: |
"${{ env.ONEAPI_ROOT }}\setvars.bat" intel64 vs2022 && "%TEMP%\compile_modflow6.bat"
"%ONEAPI_ROOT%\setvars.bat" intel64 vs2022 && "%TEMP%\compile_modflow6.bat"
- name: Show Meson logs
if: failure()
Expand All @@ -149,4 +146,4 @@ runs:
env:
REPOS_PATH: ${{ github.workspace }}
run: |
"${{ env.ONEAPI_ROOT }}\setvars.bat" intel64 vs2022 && "%TEMP%\test_modflow6.bat"
"%ONEAPI_ROOT%\setvars.bat" intel64 vs2022 && "%TEMP%\test_modflow6.bat"
1 change: 1 addition & 0 deletions .github/common/test_modflow6.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
cd "%GITHUB_WORKSPACE%\modflow6\autotest"
where libpetsc.dll
ldd ..\bin\mf6
micromamba run -r "C:\Users\runneradmin\micromamba" -n modflow6 pytest -v -n auto --parallel -k "test_par" --durations 0 --keep-failed .failed
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-22.04, macos-12, windows-2022 ]
os: [ windows-2022 ] # ubuntu-22.04, macos-12, windows-2022 ]
defaults:
run:
shell: bash -l {0}
Expand Down

0 comments on commit 9aeeaa4

Please sign in to comment.