Skip to content

Commit

Permalink
Merge pull request #434 from CFD-GO/develop
Browse files Browse the repository at this point in the history
Version 6.6
  • Loading branch information
llaniewski authored May 15, 2023
2 parents 1bbefc0 + 916dbc8 commit 5cdc2df
Show file tree
Hide file tree
Showing 71 changed files with 3,661 additions and 1,925 deletions.
5 changes: 5 additions & 0 deletions .codecov.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
ignore:
- "**/pugi*" # ignore pugixml
coverage:
status:
project:
default:
threshold: 100%
1 change: 1 addition & 0 deletions .github/actions/compile/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ runs:
steps:
- shell: bash
id: compile
name: "Compile"
run: make ${{ inputs.model }}
39 changes: 30 additions & 9 deletions .github/actions/configure/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,34 @@ name: 'TCLB Test'
description: 'This action tests TCLB'
inputs:
gpu:
description: compile a GPU version
description: compile a CUDA version
default: false
cuda_arch:
description: CUDA arch (sm_) to use
default: 'sm_50'
default: ''
hip:
description: compile a HIP version
default: false
precision:
description: compute precision to use
default: 'double'
storage:
description: the storage type to use
default: 'same'
rinside:
description: compute precision to use
description: use RInside
default: false
marklines:
description: compute precision to use
description: make RT add line references for nicer error messages
default: true
coverage:
description: compute precision to use
description: compile with coverage support
default: false
paranoid:
description: compute precision to use
description: compile in paranoid mode, with all compile checks turned on
default: true
python:
description: compute precision to use
description: compile with python support
default: false
options:
description: other configure options
Expand All @@ -32,20 +38,35 @@ runs:
using: 'composite'
steps:
- shell: bash
id: compile
id: configure
name: "Running configure"
run: |
make configure
CONFOPT=""
case "${{ inputs.gpu }}" in
true) CONFOPT="$CONFOPT --enable-cuda --with-cuda-arch=${{ inputs.cuda_arch }}" ;;
true) CONFOPT="$CONFOPT --enable-cuda"
if test "${{ inputs.cuda_arch }}"
then
CONFOPT="$CONFOPT --with-cuda-arch=${{ inputs.cuda_arch }}"
fi;;
false) CONFOPT="$CONFOPT --disable-cuda" ;;
*) echo "Wrong 'gpu' input in configure action"; exit -1
esac
case "${{ inputs.hip }}" in
true) CONFOPT="$CONFOPT --enable-hip" ;;
false) CONFOPT="$CONFOPT" ;;
*) echo "Wrong 'hip' input in configure action"; exit -1
esac
case "${{ inputs.precision }}" in
double) CONFOPT="$CONFOPT --enable-double" ;;
float) CONFOPT="$CONFOPT --disable-double" ;;
*) echo "Wrong 'precision' input in configure action"; exit -1
esac
case "${{ inputs.storage }}" in
half|half-shift|float|float-shift|double) CONFOPT="$CONFOPT --with-storage=${{ inputs.storage }}" ;;
same) ;;
*) echo "Wrong 'storage' input in configure action"; exit -1
esac
case "${{ inputs.rinside }}" in
true) CONFOPT="$CONFOPT --enable-rinside" ;;
false) CONFOPT="$CONFOPT --disable-rinside" ;;
Expand Down
1 change: 1 addition & 0 deletions .github/actions/coverage/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ runs:
using: 'composite'
steps:
- shell: bash
name: "Gathering coverage data"
id: gather
run: |
lcov --capture --directory . --output-file coverage.info
Expand Down
126 changes: 111 additions & 15 deletions .github/actions/install/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ inputs:
cuda:
description: install cuda
default: false
hip:
description: install hip
default: false
openmpi:
description: install openmpi
default: true
Expand All @@ -43,53 +46,146 @@ inputs:
tapenade:
description: install tapenade
default: false
options:
description: options for install script
default: "--group --retry 3 --retry-delay 5 --sudo"
cache:
description: use github cache to store apt packages and r packages
default: false
bestapt:
description: select the best APT before installing stuff
default: false
runs:
using: 'composite'
steps:
- if: inputs.bestapt != 'false'
shell: bash
run: |
sudo gem install apt-spy2
sudo apt-spy2 fix --commit
- if: inputs.cache != 'false'
shell: bash
id: keys
run: |
echo "apt" >tmp.inp.apt
echo "${{ runner.os }}" >>tmp.inp.apt
echo "rpack" >tmp.inp.r
echo "${{ runner.os }}" >>tmp.inp.r
test "${{ inputs.essentials }}" != "false" && echo "ess" >>tmp.inp.apt
test "${{ inputs.r }}" != "false" && echo "r" >>tmp.inp.apt
test "${{ inputs.rdep }}" != "false" && echo "rdep" >>tmp.inp.r
test "${{ inputs.rpython }}" != "false" && echo "rpython" >>tmp.inp.r
test "${{ inputs.reticulate }}" != "false" && echo "reticulate" >>tmp.inp.r
test "${{ inputs.rinside }}" != "false" && echo "rinside" >>tmp.inp.r
test "${{ inputs.cuda }}" != "false" && echo "cuda ${{ inputs.cuda }}" >>tmp.inp.apt
test "${{ inputs.hip }}" != "false" && echo "hip ${{ inputs.hip }}" >>tmp.inp.apt
test "${{ inputs.openmpi }}" != "false" && echo "openmpi" >>tmp.inp.apt
test "${{ inputs.lcov }}" != "false" && echo "lcov" >>tmp.inp.apt
test "${{ inputs.python-dev }}" != "false" && echo "pydev" >>tmp.inp.apt
echo "aptkey=$(echo $(cat tmp.inp.apt) | sed 's/ /-/g')" >>$GITHUB_OUTPUT
echo "rkey=$(echo $(cat tmp.inp.r) | sed 's/ /-/g')" >>$GITHUB_OUTPUT
- if: inputs.cache != 'false'
uses: actions/cache/restore@v3
with:
path: cache_apt/
key: ${{ steps.keys.outputs.aptkey }}
restore-keys: ${{ steps.keys.outputs.aptkey }}-
- if: inputs.cache != 'false'
shell: bash
run: test -d "cache_apt" && sudo mv cache_apt/*.deb /var/cache/apt/archives/ || true
- if: inputs.essentials != 'false'
name: "Installing essentials"
shell: bash
run: tools/install.sh --sudo essentials
run: tools/install.sh ${{inputs.options}} essentials
- if: inputs.r != 'false'
name: "Installing R"
id: r
shell: bash
run: tools/install.sh --sudo r
run: |
tools/install.sh ${{inputs.options}} r
echo "rlibpath=$(R --slave -e 'cat(path.expand(Sys.getenv("R_LIBS_USER")));')" >>$GITHUB_OUTPUT
- if: inputs.cache != 'false' && inputs.r != 'false'
uses: actions/cache/restore@v3
with:
path: ${{ steps.r.outputs.rlibpath }}/
key: ${{ steps.keys.outputs.rkey }}
restore-keys: ${{ steps.keys.outputs.rkey }}-
- if: inputs.rdep != 'false'
name: "Installing R packages"
shell: bash
run: tools/install.sh --sudo rdep
run: tools/install.sh ${{inputs.options}} rdep
- if: inputs.rpython != 'false'
name: "Installing R package: rPython"
shell: bash
run: tools/install.sh --sudo rpython
run: tools/install.sh ${{inputs.options}} rpython
- if: inputs.reticulate != 'false'
name: "Installing R package: Reticulate"
shell: bash
run: tools/install.sh --sudo reticulate
run: tools/install.sh ${{inputs.options}} reticulate
- if: inputs.rinside != 'false'
name: "Installing R package: rInside"
shell: bash
run: tools/install.sh --sudo rinside
run: tools/install.sh ${{inputs.options}} rinside
- if: inputs.cuda != 'false'
shell: bash
name: "Installing CUDA"
run: |
tools/install.sh --sudo cuda ${{ inputs.cuda }}
CUDA_PATH=/usr/local/cuda-${{ inputs.cuda }}
GPU="${{ inputs.cuda }}"
if test "$GPU" == "true"
then
GPU="11.7"
fi
tools/install.sh ${{inputs.options}} cuda $GPU
CUDA_PATH=/usr/local/cuda-$GPU
echo "$CUDA_PATH/bin" >>$GITHUB_PATH
echo "LD_LIBRARY_PATH=$CUDA_PATH/lib64:$LD_LIBRARY_PATH" >>$GITHUB_ENV
echo "CUDA_PATH=$CUDA_PATH" >>$GITHUB_OUTPUT
- if: inputs.hip != 'false'
name: "Installing ROCm/HIP"
shell: bash
run: tools/install.sh ${{inputs.options}} hip ${{ inputs.hip }}
- if: inputs.openmpi != 'false'
name: "Installing OpenMPI"
shell: bash
run: tools/install.sh --sudo openmpi
run: tools/install.sh ${{inputs.options}} openmpi
- if: inputs.lcov != 'false'
name: "Installing lcov"
shell: bash
run: tools/install.sh --sudo lcov
run: tools/install.sh ${{inputs.options}} lcov
- if: inputs.submodules != 'false'
name: "Fetching git submodules"
shell: bash
run: tools/install.sh --sudo submodules
run: tools/install.sh ${{inputs.options}} submodules
- if: inputs.gitdep != 'false'
name: "Fetching git dep's (see tools/install.sh)"
shell: bash
run: tools/install.sh --sudo gitdep
run: tools/install.sh ${{inputs.options}} gitdep
- if: inputs.python-dev != 'false'
name: "Installing Python headers/libraries"
shell: bash
run: tools/install.sh --sudo python-dev
run: tools/install.sh ${{inputs.options}} python-dev
- if: inputs.module != 'false'
name: "Installing module"
shell: bash
run: tools/install.sh --sudo module
run: tools/install.sh ${{inputs.options}} module
- if: inputs.tapenade != 'false'
name: "Installing Tapenade"
shell: bash
run: tools/install.sh ${{inputs.options}} tapenade
- if: inputs.cache != 'false'
shell: bash
run: tools/install.sh --sudo tapenade
id: hashes
run: |
mkdir -p cache_apt/ && sudo mv /var/cache/apt/archives/*.deb cache_apt/
echo "apthash=$(sha256sum cache_apt/*.deb | sha256sum | cut -c 1-15)" >>$GITHUB_OUTPUT
echo "rhash=$(cat ${{ steps.r.outputs.rlibpath }}/**/DESCRIPTION | grep -v '^Built' | sha256sum | cut -c 1-15)" >>$GITHUB_OUTPUT
- if: inputs.cache != 'false' && inputs.r != 'false'
uses: actions/cache/save@v3
with:
path: ${{ steps.r.outputs.rlibpath }}/
key: ${{ steps.keys.outputs.rkey }}-${{ steps.hashes.outputs.rhash }}
- if: inputs.cache != 'false'
uses: actions/cache/save@v3
with:
path: cache_apt/
key: ${{ steps.keys.outputs.aptkey }}-${{ steps.hashes.outputs.apthash }}
1 change: 1 addition & 0 deletions .github/actions/test/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ runs:
using: 'composite'
steps:
- shell: bash
name: Run tests
run: tools/tests.sh ${{ inputs.model }}
5 changes: 2 additions & 3 deletions .github/workflows/gpu_comp.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: GPU
name: CUDA

on: [ push, pull_request ]

Expand All @@ -8,7 +8,7 @@ jobs:
strategy:
fail-fast: false
matrix:
model: [d2q9_npe_guo, d2q9_bc, d2q9, d2q9_SRT, d2q9_thin_film, d3q19, d3q19_les, d3q19_heat, d2q9_kuper, d2q9_pf, d2q9_pf_fd, d3q27, d3q27_cumulant, d3q27_cumulant_AVG_IB_SMAG]
model: [ d2q9, d2q9_bc, d3q27_cumulant, d3q27_cumulant_AVG_IB_SMAG]
steps:
- name: Git checkout
uses: actions/checkout@v3
Expand All @@ -26,7 +26,6 @@ jobs:
uses: ./.github/actions/configure
with:
gpu: true
cuda_arch: sm_60
paranoid: true
- name: Compile
uses: ./.github/actions/compile
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/hip_comp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: HIP

on: [ push, pull_request ]

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
model: [ d2q9, d2q9_bc, d3q27_cumulant, d3q27_cumulant_AVG_IB_SMAG ]
steps:
- name: Git checkout
uses: actions/checkout@v3
with:
submodules: true
- name: Install dependencies
uses: ./.github/actions/install
with:
r: true
rdep: true
openmpi: true
rinside: true
hip: 5.4.1
- name: Configure
uses: ./.github/actions/configure
with:
hip: true
paranoid: true
- name: Compile
uses: ./.github/actions/compile
with:
model: ${{ matrix.model }}
44 changes: 44 additions & 0 deletions .github/workflows/storage_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Storage

on: [ push, pull_request ]

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
model: [d2q9]
precision: [float, double]
storage: ['same', 'half', 'half-shift', "float", "float-shift", 'double']
gpu: [true, false]
exclude:
- gpu: false
storage: 'half'
- gpu: false
storage: 'half-shift'
- precision: 'float'
storage: 'double'
steps:
- name: Git checkout
uses: actions/checkout@v3
- name: Install dependencies
uses: ./.github/actions/install
with:
r: true
rdep: true
openmpi: true
rinside: true
cuda: ${{ matrix.gpu }}
- name: Configure
uses: ./.github/actions/configure
with:
gpu: ${{ matrix.gpu }}
cuda_arch: sm_60
paranoid: true
precision: ${{ matrix.precision }}
storage: ${{ matrix.storage }}
- name: Compile
uses: ./.github/actions/compile
with:
model: ${{ matrix.model }}
Loading

0 comments on commit 5cdc2df

Please sign in to comment.