Skip to content

Commit

Permalink
Merge pull request #108 from hpsim/fix/cyclic_interfaces
Browse files Browse the repository at this point in the history
Fix support for cyclic interfaces, see #108
  • Loading branch information
greole authored Feb 11, 2024
2 parents 68624c6 + 867169f commit 6c561ab
Show file tree
Hide file tree
Showing 15 changed files with 461 additions and 285 deletions.
19 changes: 14 additions & 5 deletions .github/workflows/build-foam.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ concurrency:
cancel-in-progress: true

env:
USER: user
BUILD_TYPE: Release
OMPI_ALLOW_RUN_AS_ROOT: 1
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1
Expand All @@ -32,7 +33,7 @@ jobs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout to repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set matrix data
id: set-matrix
run: |
Expand Down Expand Up @@ -65,14 +66,14 @@ jobs:
echo "GINKGO_CHECKOUT_VERSION=$GINKGO_CHECKOUT_VERSION" >> $GITHUB_ENV
- name: Cache build folder
uses: actions/cache@v3
uses: actions/cache@v4
with:
key: build-${{ matrix.OF.path }}-${{env.GINKGO_CHECKOUT_VERSION}}
path: |
${{github.workspace}}/build
- name: Cache FOAM_USER_LIBBIN
uses: actions/cache@v3
uses: actions/cache@v4
with:
key: FOAM_USER_LIBBIN-${{ matrix.OF.version }}-${{ github.sha }}
path: |
Expand All @@ -88,7 +89,7 @@ jobs:
mkdir -p build
cd build
[ -d "/github/home/$GINKGO_CHECKOUT_VERSION" ] && cp -rp /github/home/$GINKGO_CHECKOUT_VERSION third_party
cmake -G Ninja -DOGL_ALLOW_REFERENCE_ONLY=On -DOGL_BUILD_UNITTEST=ON -DCMAKE_BUILD_TYPE=$BUILD_TYPE ..
cmake -GNinja -DOGL_ALLOW_REFERENCE_ONLY=On -DOGL_BUILD_UNITTEST=ON -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=${{matrix.OF.foam_user_libbin}} ..
- name: Build OGL
working-directory: ${{github.workspace}}/build
Expand All @@ -99,16 +100,22 @@ jobs:
- name: Install OGL
working-directory: ${{github.workspace}}
run: |
source /root/OpenFOAM/${{matrix.OF.path}}/etc/bashrc
cmake --install ./build
ls $FOAM_USER_LIBBIN
ls ${{matrix.OF.foam_user_libbin}}
- name: Check folders
working-directory: ${{github.workspace}}
run: |
echo "check build folder"
ls ./build
echo "check libbin folder ${{matrix.OF.foam_user_libbin}}"
ls ${{matrix.OF.foam_user_libbin}}
- name: Archive production artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: failure()
with:
name: ogl_build_${{ matrix.OF.path }}
Expand All @@ -119,6 +126,8 @@ jobs:
uses: ./.github/workflows/unit-test.yml
with:
path: ${{ matrix.OF.path }}
version: ${{ matrix.OF.version }}
foam_user_libbin: ${{ matrix.OF.foam_user_libbin }}
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.setup_build_matrix.outputs.matrix) }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/format-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
name: Formatting Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Run clang-format style check for C/C++/Protobuf programs.
uses: jidicula/[email protected]
with:
Expand Down
186 changes: 133 additions & 53 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
name: Integration Tests

defaults:
run:
shell: bash -o pipefail -i {0}
env:
FOAM_INST_DIR: /root/OpenFOAM
WM_PROJECT: OpenFOAM
WM_OPTIONS: linux64GccDPInt32Opt
WM_COMPILER_TYPE: system
WM_COMPILER: Gcc
WM_PRECISION_OPTION: DP
WM_LABEL_SIZE: 32
WM_COMPILE_OPTION: Opt
WM_OSTYPE: POSIX
WM_ARCH: linux64
WM_ARCH_OPTION: 64
WM_LINK_LANGUAGE: c++
WM_LABEL_OPTION: Int32
WM_MPLIB: SYSTEMOPENMPI
MPI_BUFFER_SIZE: 20000000
BUILD_TYPE: Release
OMPI_ALLOW_RUN_AS_ROOT: 1
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1
OMPI_MCA_btl_vader_single_copy_mechanism: none
OBR_RUN_CMD: "mpirun --oversubscribe -np {np} {solver} -parallel -case {path}/case > {path}/case/{solver}_{timestamp}.log 2>&1"
GINKGO_EXECUTOR: reference

on:
workflow_call:
Expand All @@ -19,53 +38,64 @@ on:
foam_user_libbin:
required: true
type: string
run-name: Integration test on ${{github.ref_name}}

env:
BUILD_TYPE: Release
OMPI_ALLOW_RUN_AS_ROOT: 1
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1
OMPI_MCA_btl_vader_single_copy_mechanism: none
OBR_RUN_CMD: "mpirun --bind-to core --map-by core -np {np} {solver} -parallel -case {path}/case > {path}/case/{solver}_{timestamp}.log 2>&1"
MPI_BUFFER_SIZE: 20000000
GINKGO_EXECUTOR: reference

jobs:
setup_integration_matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- id: set-matrix
run: |
echo "matrix=[\"cavity\"]" >> $GITHUB_OUTPUT
setup:
runs-on: ubuntu-latest
container: greole/ofbase
needs: setup_integration_matrix
name: setup-${{matrix.Case}}-${{inputs.version}}
strategy:
fail-fast: false
matrix:
Case: ${{fromJson(needs.setup_integration_matrix.outputs.matrix)}}

steps:
- uses: actions/checkout@v4
- name: Source OF enviroment
run: |
mkdir -p $FOAM_INST_DIR
echo "FOAM_ETC=$FOAM_INST_DIR/${{inputs.path}}/etc" >> $GITHUB_ENV
echo "WM_PROJECT_DIR=$FOAM_INST_DIR/${{inputs.path}}" >> $GITHUB_ENV
echo "FOAM_USER_PATH=$FOAM_INST_DIR/root-${{inputs.version}}" >> $GITHUB_ENV
echo "FOAM_TUTORIALS=$FOAM_INST_DIR/${{inputs.path}}/tutorials" >> $GITHUB_ENV
echo "FOAM_USER_LIBBIN=${{inputs.foam_user_libbin}}" >> $GITHUB_ENV
echo "FOAM_SRC=$FOAM_INST_DIR/${{inputs.path}}/src" >> $GITHUB_ENV
echo "Ginkgo_DIR=${{env.FOAM_INST_DIR}}/root-${{inputs.version}}/platforms/linux64GccDPInt32Opt/lib/cmake/Ginkgo" >> $GITHUB_ENV
echo "CYCLIC_CASE=${{inputs.cyclic_case}}" >> $GITHUB_ENV
- name: Cache workspace
uses: actions/cache@v3
uses: actions/cache@v4
with:
key: ws-${{inputs.version}}-${{matrix.Case}}-${{ github.sha }}
path: /home/runner/work/_temp/_github_home/${{matrix.Case}}
key: ws-${{inputs.version}}-${{ github.sha }}
path: /home/runner/work/_temp/_github_home/integration


- name: Update OBR
working-directory: /github/home/
run: |
ls
python3 -m pip install --upgrade pip
pip install setuptools --upgrade
pip uninstall obr -y
pip uninstall owls -y
cd /root/OBR
git pull origin feat/multi_case
pip install -e .
- name: Generate test cases
working-directory: /github/home/
run: |
source /root/OpenFOAM/${{inputs.path}}/etc/bashrc
mkdir -p ${{matrix.Case}} && cd ${{matrix.Case}}
obr init --config /__w/OGL/OGL/test/${{matrix.Case}}.yaml
export PATH=$WM_PROJECT_DIR/platforms/linux64GccDPInt32Opt/bin:$PATH
export LD_LIBRARY_PATH=$FOAM_USER_LIBBIN:$WM_PROJECT_DIR/platforms/linux64GccDPInt32Opt/lib:$WM_PROJECT_DIR/platforms/linux64GccDPInt32Opt/lib/sys-openmpi/:$WM_PROJECT_DIR/platforms/linux64GccDPInt32Opt/lib/openmpi-system:$WM_PROJECT_DIR/platforms/linux64GccDPInt32Opt/lib/dummy/:$LD_LIBRARY_PATH
mkdir -p integration && cd integration
export CYCLIC_CASE=${{inputs.cyclic_case}}
obr init --config /__w/OGL/OGL/test/integration.yaml
obr run -o generate
cat workspace/*/case/*log
setup_integration_matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- id: set-matrix
run: |
echo "matrix=[\"cavity\", \"${{inputs.cyclic_case}}\"]" >> $GITHUB_OUTPUT
run:
runs-on: ubuntu-latest
Expand All @@ -79,6 +109,17 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Source OF enviroment
run: |
mkdir -p $FOAM_INST_DIR
echo "FOAM_ETC=$FOAM_INST_DIR/${{inputs.path}}/etc" >> $GITHUB_ENV
echo "WM_PROJECT_DIR=$FOAM_INST_DIR/${{inputs.path}}" >> $GITHUB_ENV
echo "FOAM_USER_PATH=$FOAM_INST_DIR/root-${{inputs.version}}" >> $GITHUB_ENV
echo "FOAM_TUTORIALS=$FOAM_INST_DIR/${{inputs.path}}/tutorials" >> $GITHUB_ENV
echo "FOAM_USER_LIBBIN=${{inputs.foam_user_libbin}}" >> $GITHUB_ENV
echo "FOAM_SRC=$FOAM_INST_DIR/${{inputs.path}}/src" >> $GITHUB_ENV
echo "Ginkgo_DIR=${{env.FOAM_INST_DIR}}/root-${{inputs.version}}/platforms/linux64GccDPInt32Opt/lib/cmake/Ginkgo" >> $GITHUB_ENV
echo "CYCLIC_CASE=${{inputs.cyclic_case}}" >> $GITHUB_ENV
- name: Get Ginkgo checkout version
shell: bash
Expand All @@ -88,67 +129,106 @@ jobs:
echo "GINKGO_CHECKOUT_VERSION=$GINKGO_CHECKOUT_VERSION" >> $GITHUB_ENV
echo "Ginkgo_DIR=${{inputs.foam_user_libbin}}/cmake/Ginkgo" >> $GITHUB_ENV
- name: Update OBR
working-directory: /github/home/
run: |
python3 -m pip install --upgrade pip
pip install setuptools --upgrade
pip uninstall obr -y
pip uninstall owls -y
cd /root/OBR
git pull origin feat/multi_case
pip install -e .
- name: Cache build
uses: actions/cache@v3
uses: actions/cache@v4
with:
key: build-${{ inputs.path }}-${{env.GINKGO_CHECKOUT_VERSION}}
path: |
${{github.workspace}}/build
- name: Cache FOAM_USER_LIBBIN
uses: actions/cache@v3
uses: actions/cache@v4
with:
key: FOAM_USER_LIBBIN-${{ inputs.version }}-${{ github.sha }}
path: |
${{inputs.foam_user_libbin}}
- name: Cache Workspace
uses: actions/cache@v3
uses: actions/cache@v4
with:
key: ws-${{inputs.version}}-${{matrix.Case}}-${{ github.sha }}
path: /home/runner/work/_temp/_github_home/${{matrix.Case}}
key: ws-${{inputs.version}}-${{ github.sha }}
path: /home/runner/work/_temp/_github_home/integration

- name: Execute test cases
working-directory: /github/home/${{matrix.Case}}
timeout-minutes: 10
working-directory: /github/home/integration
timeout-minutes: 12
run: |
source /root/OpenFOAM/${{inputs.path}}/etc/bashrc
obr run -o runParallelSolver
export PATH=$WM_PROJECT_DIR/platforms/linux64GccDPInt32Opt/bin:$PATH
export LD_LIBRARY_PATH=${{inputs.foam_user_libbin}}:$WM_PROJECT_DIR/platforms/linux64GccDPInt32Opt/lib:$WM_PROJECT_DIR/platforms/linux64GccDPInt32Opt/lib/sys-openmpi/:$WM_PROJECT_DIR/platforms/linux64GccDPInt32Opt/lib/openmpi-system:$WM_PROJECT_DIR/platforms/linux64GccDPInt32Opt/lib/dummy/:$LD_LIBRARY_PATH
echo $FOAM_USER_LIBBIN
ls $FOAM_USER_LIBBIN
obr run -o runParallelSolver \
--filter case==${{matrix.Case}}
- name: Archive workspace
uses: actions/cache@v4
with:
key: results-${{inputs.version}}-${{ github.sha }}
path: /home/runner/work/_temp/_github_home/archive

- name: Execute test cases
working-directory: /github/home
timeout-minutes: 12
run: |
cp -r integration archive
validate:
runs-on: ubuntu-latest
container: greole/ofbase
needs: [run]
steps:
- uses: actions/checkout@v4
- name: Archive workspace
uses: actions/cache@v4
with:
key: results-${{inputs.version}}-${{ github.sha }}
path: /home/runner/work/_temp/_github_home/archive

- name: Validation of exported mtx files
working-directory: /github/home/${{matrix.Case}}
working-directory: /github/home/archive
run: |
python3 /__w/OGL/OGL/test/data_validation.py workspace
ls -la workspace/*/case/
ls -la workspace/*/case/processor0/*
python3 /__w/OGL/OGL/test/data_validation.py workspace
- name: Validate unpreconditioned state
working-directory: /github/home/${{matrix.Case}}
working-directory: /github/home/archive
run: |
obr status
obr query \
-q global -q continuityErrors -q CourantNumber \
--filter preconditioner==none \
--filter matrixFormat==Coo \
--filter global==completed \
--validate_against=/__w/OGL/OGL/test/${{matrix.Case}}_validation.json
--validate_against=/__w/OGL/OGL/test/validation.json
- name: Validate preconditioned state
working-directory: /github/home/${{matrix.Case}}
working-directory: /github/home/archive
run: |
obr status
obr query \
-q global -q continuityErrors -q CourantNumber \
--validate_against=/__w/OGL/OGL/test/${{matrix.Case}}_validation.json \
--validate_against=/__w/OGL/OGL/test/validation.json \
--filter preconditioner!=none \
--filter global==completed
- name: Validate matrix formats
working-directory: /github/home/${{matrix.Case}}
working-directory: /github/home/archive
run: |
obr status
obr query \
-q global -q continuityErrors -q CourantNumber \
--validate_against=/__w/OGL/OGL/test/${{matrix.Case}}_validation.json \
--validate_against=/__w/OGL/OGL/test/validation.json \
--filter matrixFormat!=Coo \
--filter global==completed
Expand All @@ -159,7 +239,7 @@ jobs:
find . -name "*:*" -exec rename 's|:|-|g' {} \;
- name: Archive integration artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: failure()
with:
name: ogl_integration_${{ inputs.path }}
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/test_matrix.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,16 @@
"fork": "ESI",
"path": "openfoam",
"repo": "https://develop.openfoam.com/Development/openfoam.git",
"cyclic_case": "LES/periodicPlaneChannel" ,
"foam_user_libbin": "/root/OpenFOAM/root-v2306/platforms/linux64GccDPInt32Opt/lib"
"cyclic_case": "periodicPlaneChannel" ,
"foam_user_libbin": "/github/home/OpenFOAM/user-v2312/platforms/linux64GccDPInt32Opt/lib/"
},
{
"version": "10",
"fork": "Foundation",
"path": "OpenFOAM-10",
"repo": "https://github.com/OpenFOAM/OpenFOAM-10.git",
"cyclic_case": "LES/channel395" ,
"cyclic_case": "LES/periodicPlaneChannel" ,
"foam_user_libbin": "/root/OpenFOAM/root-10/platforms/linux64GccDPInt32Opt/lib"
"cyclic_case": "channel395" ,
"foam_user_libbin": "/github/home/OpenFOAM/user-10/platforms/linux64GccDPInt32Opt/lib"
}
]
}
2 changes: 1 addition & 1 deletion .github/workflows/typo_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
name: Spell Check with Typos
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Check for typos
uses: crate-ci/typos@master

Loading

0 comments on commit 6c561ab

Please sign in to comment.