Skip to content

openmp and thread pool versions #50

openmp and thread pool versions

openmp and thread pool versions #50

Workflow file for this run

# Workflow settings
# See https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions
name: Test Schwarz # GUI display name
on: # Triggers, see https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows
push:
branches: main
pull_request:
branches: main
concurrency: # Concurrency group: which jobs run together and which cancel each other
group: CI-${{ github.head_ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false # true -> cancel all jobs if any fails
max-parallel: 8
# Build matrix for your jobs: you can define different variations to run each job in
# matrix configurations - reachable with ${{ matrix.config.<key> }}.
# Extra options:
# - cxx: path to C++ compiler
# - mode: build mode inside Pressio (Debug / Release)
matrix:
config:
- { cxx: g++, mode: Release }
- { cxx: clang++, mode: Release }
- { cxx: g++, mode: Debug }
- { cxx: clang++, mode: Debug }
env: # environment variables available to all steps
CXX: ${{ matrix.config.cxx }}
APT_PACKAGES: python3 pip python-is-python3 g++ clang gpg wget
PIP_PACKAGES: numpy scipy matplotlib
PRESSIO_SRC: ${{ github.workspace }}/pressio
PDA_SRC: ${{ github.workspace }}/pressio-demoapps
BUILD_DIR: ${{ github.workspace }}/build
steps:
- name: Clone pressio-demoapps-schwarz repository
uses: actions/checkout@v2
# TODO: switch to develop when PR #655 is merged
- name: Clone pressio repository
uses: actions/checkout@v2
with:
repository: Pressio/pressio
path: pressio
ref: use_dynalloc_rom_policy
- name: Clone pressio-demoapps repository, develop branch
uses: actions/checkout@v2
with:
repository: Pressio/pressio-demoapps
path: pressio-demoapps
ref: develop
- name: Install packages
run: |
sudo apt-get update
sudo apt-get install -y --install-suggests $APT_PACKAGES
- name: Install CMake
run: |
export CMAKE_KEYRING=/usr/share/keyrings/kitware-archive-keyring.gpg
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null \
| gpg --dearmor - \
| sudo tee $CMAKE_KEYRING >/dev/null
echo "deb [signed-by=$CMAKE_KEYRING] https://apt.kitware.com/ubuntu/ focal main" \
| sudo tee /etc/apt/sources.list.d/kitware.list >/dev/null
sudo apt-get update
rm $CMAKE_KEYRING
sudo apt-get install -y kitware-archive-keyring cmake
- name: Check environment
run: |
echo ======================================================
echo CPU Threads: $(grep -c processor /proc/cpuinfo)
echo ======================================================
echo $(which $CXX) --version
$CXX --version
echo ======================================================
echo pressio directory: $PRESSIO_SRC
echo pressio-demoapps directory: $PDA_SRC
echo Build directory: $BUILD_DIR
echo ======================================================
git --version
git status
- name: Install Python modules
run: |
sudo pip install $PIP_PACKAGES
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade setuptools
- name: Install pdas Python utilities
run: |
cd ${{ github.workspace }}/python
pip install .
- name: Configure C++ tests
run: |
cmake \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
-DCMAKE_BUILD_TYPE:STRING=${{ matrix.config.mode }} \
-DCMAKE_CXX_FLAGS="-Wall" \
-DPRESSIO_SOURCE=${PRESSIO_SRC} \
-DPDA_SOURCE=${PDA_SRC} \
-B $BUILD_DIR -S ${{ github.workspace }}
#-DCMAKE_CXX_FLAGS="-Wall -Werror" \
# NOTE: -j2 caused g++ crash (out of memory)
- name: Build C++ tests
run: |
export NUM_CPU=$(grep -c processor /proc/cpuinfo)
cmake --build $BUILD_DIR -j $NUM_CPU
- name: Run tests
run: |
export NUM_CPU=$(grep -c processor /proc/cpuinfo)
cd $BUILD_DIR
ctest -j $NUM_CPU --output-on-failure