Skip to content

Commit

Permalink
Merge pull request #412 from llaniewski/feature/actions
Browse files Browse the repository at this point in the history
Working GitHub Actions tests with coverage
  • Loading branch information
llaniewski authored Nov 10, 2022
2 parents 3028168 + b19c1da commit b277f80
Show file tree
Hide file tree
Showing 13 changed files with 319 additions and 36 deletions.
12 changes: 12 additions & 0 deletions .github/actions/compile/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: 'TCLB Test'
description: 'This action tests TCLB'
inputs:
model:
description: model to compile
default: 'd2q9'
runs:
using: 'composite'
steps:
- shell: bash
id: compile
run: make ${{ inputs.model }}
76 changes: 76 additions & 0 deletions .github/actions/configure/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: 'TCLB Test'
description: 'This action tests TCLB'
inputs:
gpu:
description: compile a GPU version
default: false
cuda_arch:
description: CUDA arch (sm_) to use
default: 'sm_50'
precision:
description: compute precision to use
default: 'double'
rinside:
description: compute precision to use
default: false
marklines:
description: compute precision to use
default: true
coverage:
description: compute precision to use
default: false
paranoid:
description: compute precision to use
default: true
python:
description: compute precision to use
default: false
options:
description: other configure options
default: ''
runs:
using: 'composite'
steps:
- shell: bash
id: compile
run: |
make configure
CONFOPT=""
case "${{ inputs.gpu }}" in
true) CONFOPT="$CONFOPT --enable-cuda --with-cuda-arch=${{ inputs.cuda_arch }}" ;;
false) CONFOPT="$CONFOPT --disable-cuda" ;;
*) echo "Wrong 'gpu' 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.rinside }}" in
true) CONFOPT="$CONFOPT --enable-rinside" ;;
false) CONFOPT="$CONFOPT --disable-rinside" ;;
*) echo "Wrong 'rinside' input in configure action"; exit -1
esac
case "${{ inputs.marklines }}" in
true) CONFOPT="$CONFOPT --enable-marklines" ;;
false) CONFOPT="$CONFOPT --disable-marklines" ;;
*) echo "Wrong 'marklines' input in configure action"; exit -1
esac
case "${{ inputs.coverage }}" in
true) CONFOPT="$CONFOPT --enable-coverage" ;;
false) CONFOPT="$CONFOPT --disable-coverage" ;;
*) echo "Wrong 'coverage' input in configure action"; exit -1
esac
case "${{ inputs.paranoid }}" in
true) CONFOPT="$CONFOPT --enable-paranoid" ;;
false) CONFOPT="$CONFOPT --disable-paranoid" ;;
*) echo "Wrong 'paranoid' input in configure action"; exit -1
esac
case "${{ inputs.python }}" in
true) CONFOPT="$CONFOPT --with-python" ;;
false) CONFOPT="$CONFOPT --without-python" ;;
*) echo "Wrong 'python' input in configure action"; exit -1
esac
CONFOPT="$CONFOPT ${{ inputs.options }}"
echo "Configure options:$CONFOPT"
./configure $CONFOPT
21 changes: 21 additions & 0 deletions .github/actions/coverage/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: 'TCLB Coverage'
description: 'This action gatheres coverage data for TCLB'
outputs:
reports:
description: "Report files"
value: ${{ steps.gather.outputs.reports }}
runs:
using: 'composite'
steps:
- shell: bash
id: gather
run: |
lcov --capture --directory . --output-file coverage.info
if test -s coverage.info
then
lcov --remove coverage.info '/usr/*' --output-file coverage.info
lcov --list coverage.info
echo "reports=coverage.info" >> $GITHUB_OUTPUT
else
echo "reports=" >> $GITHUB_OUTPUT
fi
95 changes: 95 additions & 0 deletions .github/actions/install/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: 'TCLB Install'
description: 'This action installes TCLB dependencies'
inputs:
essentials:
description: install essentials
default: false
r:
description: install r
default: true
rdep:
description: install rdep
default: true
rpython:
description: install rpython
default: false
reticulate:
description: install reticulate
default: false
rinside:
description: install rinside
default: false
cuda:
description: install cuda
default: false
openmpi:
description: install openmpi
default: true
lcov:
description: install lcov
default: false
submodules:
description: install submodules
default: false
gitdep:
description: install gitdep
default: false
python-dev:
description: install python-dev
default: false
module:
description: install module
default: false
tapenade:
description: install tapenade
default: false
runs:
using: 'composite'
steps:
- if: inputs.essentials != 'false'
shell: bash
run: tools/install.sh --sudo essentials
- if: inputs.r != 'false'
shell: bash
run: tools/install.sh --sudo r
- if: inputs.rdep != 'false'
shell: bash
run: tools/install.sh --sudo rdep
- if: inputs.rpython != 'false'
shell: bash
run: tools/install.sh --sudo rpython
- if: inputs.reticulate != 'false'
shell: bash
run: tools/install.sh --sudo reticulate
- if: inputs.rinside != 'false'
shell: bash
run: tools/install.sh --sudo rinside
- if: inputs.cuda != 'false'
shell: bash
run: |
tools/install.sh --sudo cuda ${{ inputs.cuda }}
CUDA_PATH=/usr/local/cuda-${{ inputs.cuda }}
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.openmpi != 'false'
shell: bash
run: tools/install.sh --sudo openmpi
- if: inputs.lcov != 'false'
shell: bash
run: tools/install.sh --sudo lcov
- if: inputs.submodules != 'false'
shell: bash
run: tools/install.sh --sudo submodules
- if: inputs.gitdep != 'false'
shell: bash
run: tools/install.sh --sudo gitdep
- if: inputs.python-dev != 'false'
shell: bash
run: tools/install.sh --sudo python-dev
- if: inputs.module != 'false'
shell: bash
run: tools/install.sh --sudo module
- if: inputs.tapenade != 'false'
shell: bash
run: tools/install.sh --sudo tapenade
11 changes: 11 additions & 0 deletions .github/actions/test/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: 'TCLB Test'
description: 'This action tests TCLB'
inputs:
model:
description: model to compile
default: 'd2q9'
runs:
using: 'composite'
steps:
- shell: bash
run: tools/tests.sh ${{ inputs.model }}
49 changes: 49 additions & 0 deletions .github/workflows/cpu_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: CPU

on: [ push, pull_request ]

jobs:
test:
runs-on: ubuntu-latest
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]
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
python-dev: true
rinside: true
lcov: true
- name: Configure
uses: ./.github/actions/configure
with:
gpu: false
python: true
paranoid: true
coverage: true
- name: Compile
uses: ./.github/actions/compile
with:
model: ${{ matrix.model }}
- name: Run tests
uses: ./.github/actions/test
with:
model: ${{ matrix.model }}
- name: Gather coverage data
uses: ./.github/actions/coverage
id: coverage
- name: Send coverage data
uses: codecov/codecov-action@v3
if: steps.coverage.outputs.reports != ''
with:
files: ${{ steps.coverage.outputs.reports }}
flags: ${{ matrix.model }}
34 changes: 34 additions & 0 deletions .github/workflows/gpu_comp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: GPU

on: [ push, pull_request ]

jobs:
test:
runs-on: ubuntu-latest
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]
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
cuda: 11.7
- name: Configure
uses: ./.github/actions/configure
with:
gpu: true
cuda_arch: sm_60
paranoid: true
- name: Compile
uses: ./.github/actions/compile
with:
model: ${{ matrix.model }}
18 changes: 0 additions & 18 deletions .github/workflows/test.yml

This file was deleted.

6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ TCLB Solver [![ZENADO DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3550331.s
TCLB is a MPI+CUDA or MPI+CPU high-performance Computational Fluid Dynamics simulation code, based on the Lattice Boltzmann Method.
It provides a clear interface for calculation of complex physics, and the implementation of new models.

- Stable release [(`master` branch)](https://github.com/CFD-GO/TCLB/tree/master):<br/>[![Build Status](https://travis-ci.org/CFD-GO/TCLB.svg?branch=master)](https://travis-ci.org/CFD-GO/TCLB) [![codecov](https://codecov.io/gh/CFD-GO/TCLB/branch/master/graph/badge.svg)](https://codecov.io/gh/CFD-GO/TCLB) [![documentation](https://raw.githubusercontent.com/CFD-GO/documents/master/assets/documentation.svg?sanitize=true)](https://docs.tclb.io/)
- Current release [(`develop` branch)](https://github.com/CFD-GO/TCLB/tree/develop):<br/>[![Build Status](https://travis-ci.org/CFD-GO/TCLB.svg?branch=develop)](https://travis-ci.org/CFD-GO/TCLB) [![codecov](https://codecov.io/gh/CFD-GO/TCLB/branch/develop/graph/badge.svg)](https://codecov.io/gh/CFD-GO/TCLB) [![documentation](https://raw.githubusercontent.com/CFD-GO/documents/master/assets/documentation.svg?sanitize=true)](https://develop.docs.tclb.io/)
- Stable release [(`master` branch)](https://github.com/CFD-GO/TCLB/tree/master):<br/>[![CPU build status](https://github.com/CFD-GO/TCLB/actions/workflows/cpu_test.yml/badge.svg?branch=master)](https://github.com/CFD-GO/TCLB/actions/workflows/cpu_test.yml) [![GPU build status](https://github.com/CFD-GO/TCLB/actions/workflows/gpu_comp.yml/badge.svg?branch=master)](https://github.com/CFD-GO/TCLB/actions/workflows/gpu_comp.yml) [![codecov](https://codecov.io/gh/CFD-GO/TCLB/branch/master/graph/badge.svg)](https://codecov.io/gh/CFD-GO/TCLB) [![documentation](https://raw.githubusercontent.com/CFD-GO/documents/master/assets/documentation.svg?sanitize=true)](https://docs.tclb.io/)


- Current release [(`develop` branch)](https://github.com/CFD-GO/TCLB/tree/develop):<br/>[![CPU build status](https://github.com/CFD-GO/TCLB/actions/workflows/cpu_test.yml/badge.svg?branch=develop)](https://github.com/CFD-GO/TCLB/actions/workflows/cpu_test.yml) [![GPU build status](https://github.com/CFD-GO/TCLB/actions/workflows/gpu_comp.yml/badge.svg?branch=develop)](https://github.com/CFD-GO/TCLB/actions/workflows/gpu_comp.yml) [![codecov](https://codecov.io/gh/CFD-GO/TCLB/branch/develop/graph/badge.svg)](https://codecov.io/gh/CFD-GO/TCLB) [![documentation](https://raw.githubusercontent.com/CFD-GO/documents/master/assets/documentation.svg?sanitize=true)](https://develop.docs.tclb.io/)

## How to use it

Expand Down
7 changes: 0 additions & 7 deletions src/Global.h.Rt
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,6 @@ for (m in Margin) { ?>
void Clear(int,int,int);
void PreAlloc(int,int,int);
void Free();
/// Assign operator (no alloc)
inline FTabs & operator=(const FTabs & in) { <?R
for (m in NonEmptyMargin) { ?>
<?%s m$name ?> = in. <?%s m$name ?>; <?R
} ?>
return *this;
}
};

#define INFO_H 1
Expand Down
7 changes: 3 additions & 4 deletions src/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -445,9 +445,8 @@ fi

if test "x${with_python}" == "xyes"; then

AC_CHECK_PROG(python_config,"${with_python_config}","${with_python_config}",python-config)
AC_CHECK_PROG(python_bin,"${with_python_bin}","${with_python_bin}",python)

AC_CHECK_PROG(python_bin,"${with_python_bin}","${with_python_bin}",python3)
AC_CHECK_PROG(python_config,"${with_python_config}","${with_python_config}",${python_bin}-config)

AC_MSG_NOTICE([python config: ${python_config}])
AC_MSG_NOTICE([python: ${python_bin}])
Expand Down Expand Up @@ -816,7 +815,7 @@ fi

if test "x${enable_paranoid}" == "xyes"
then
CPP_OPT="${CPP_OPT} -Wall -Werror -Wno-unused-but-set-variable -Wno-unused-variable"
CPP_OPT="${CPP_OPT} -Wall -Werror -Wno-unused-but-set-variable -Wno-unused-variable -Wno-format-overflow"
fi

if test "x${enable_profiling}" == "xyes"
Expand Down
2 changes: 1 addition & 1 deletion tests
Submodule tests updated 1 files
+1 −1 d2q9_kuper/drop.test
Loading

0 comments on commit b277f80

Please sign in to comment.