Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
c909485
Add a test with MUMPS
EmilyBourne Oct 29, 2025
9de4b5e
Correct matrix usage
EmilyBourne Oct 29, 2025
198e00b
Run on draft to test
EmilyBourne Oct 29, 2025
f8fe2f8
Better name
EmilyBourne Oct 29, 2025
626c9d0
Correct input
EmilyBourne Oct 29, 2025
8752500
Check val
EmilyBourne Oct 29, 2025
155098c
Use bool
EmilyBourne Oct 29, 2025
b27be11
Clone spack
EmilyBourne Oct 29, 2025
2df8bbf
Multi-line run
EmilyBourne Oct 29, 2025
5f73c7b
Different names for artifacts
EmilyBourne Oct 29, 2025
6e37ce3
Get both coverage reports
EmilyBourne Oct 29, 2025
d8b1649
Install manually
EmilyBourne Oct 29, 2025
5e684fd
Metis uses cmake now
EmilyBourne Oct 29, 2025
18acf7c
Specify compilers
EmilyBourne Oct 29, 2025
fd5ec43
Missing fortran
EmilyBourne Oct 29, 2025
5820844
Add flag for gfortran>=10
EmilyBourne Oct 29, 2025
4f45dc9
Correct path
EmilyBourne Oct 29, 2025
7af986c
Use absolute path
EmilyBourne Oct 29, 2025
f1b672c
Use clearer separator
EmilyBourne Oct 29, 2025
c689f78
Fix sed
EmilyBourne Oct 29, 2025
c39293a
gmake
EmilyBourne Oct 29, 2025
0243e7c
Explicit topdir
EmilyBourne Oct 29, 2025
223ac0f
Prepare folder
EmilyBourne Oct 29, 2025
53b1223
Fix install
EmilyBourne Oct 29, 2025
66a8ad3
Don't run twice
EmilyBourne Oct 29, 2025
75dd4a8
Working condition?
EmilyBourne Oct 29, 2025
4b87bd8
Uniform naming. Pass argument
EmilyBourne Oct 29, 2025
572d675
Install not required
EmilyBourne Oct 29, 2025
084bc5f
Fix for test-report. Use ternary
EmilyBourne Oct 29, 2025
eb084be
Correct condition
EmilyBourne Oct 29, 2025
57f6ba5
Simplify with ternary
EmilyBourne Oct 29, 2025
875ffd5
Finished debugging
EmilyBourne Oct 29, 2025
9bce99f
Set environment variables
EmilyBourne Oct 29, 2025
bf1db7c
Add error messages if libraries not found when GMGPOLAR_USE_MUMPS is …
EmilyBourne Oct 29, 2025
d60982a
Test with debug
EmilyBourne Oct 29, 2025
fb5ca3b
MPI spoof is in libseq not lib
EmilyBourne Oct 29, 2025
666bcd2
Include dir too
EmilyBourne Oct 29, 2025
5d873c9
Check folders
EmilyBourne Oct 29, 2025
033a6d1
Install using CMake
EmilyBourne Oct 30, 2025
da172f2
Export so var is available locally
EmilyBourne Oct 30, 2025
3b37939
Fix linking
EmilyBourne Oct 30, 2025
d17c370
Ensure METIS is found
EmilyBourne Oct 30, 2025
b4b38d4
Correct condition
EmilyBourne Oct 30, 2025
c85e5d1
Tidy up fail
EmilyBourne Oct 30, 2025
4512180
Fix linkage
EmilyBourne Oct 30, 2025
1670731
Try to fix artifact name
EmilyBourne Oct 30, 2025
6cb1271
Get fortran
EmilyBourne Oct 30, 2025
fbdb20b
Done testing
EmilyBourne Oct 30, 2025
115a8a1
Remove print
EmilyBourne Oct 30, 2025
a2810d6
Split for clean action
EmilyBourne Oct 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 34 additions & 3 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
name: "Linux Build"

inputs:
use-mumps:
description: 'Indicates if GMGPolar should be built with mumps support'
type: bool
required: true

runs:
using: "composite"
steps:
Expand All @@ -7,12 +14,36 @@ runs:
run: |
apt-get -qq update
apt-get -qq -y install lcov
- name: Install METIS
shell: bash
if: inputs.use-mumps == 'true'
run: |
apt-get -qq -y install gfortran
git clone -b v5.1.0.4 https://github.com/scivision/METIS.git
cd METIS
cmake -Bbuild -DCMAKE_INSTALL_PREFIX=$(pwd)/install -DCMAKE_BUILD_TYPE=Release
cmake --build build
cmake --install build
ls install/*
echo "METIS_DIR=$(pwd)/install" >> $GITHUB_ENV
echo "METIS_ROOT=$(pwd)/install" >> $GITHUB_ENV
- name: Install MUMPS
shell: bash
if: inputs.use-mumps == 'true'
run: |
git clone -b v5.5.1.11 https://github.com/scivision/mumps.git
cd mumps
cmake -Bbuild -DBUILD_SINGLE=on -DBUILD_DOUBLE=on -Dmetis=on -Dopenmp=on -Dparallel=off -DCMAKE_INSTALL_PREFIX=$(pwd)/install -DCMAKE_BUILD_TYPE=Release -S .
cmake --build build
cmake --install build
ls install/*
echo "MUMPS_DIR=$(pwd)/install" >> $GITHUB_ENV
- name: Build
shell:
shell: bash
# ensure that the installed compiler version is used
run: |
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Debug -DGMGPOLAR_ENABLE_COVERAGE=ON ..
cmake -DCMAKE_BUILD_TYPE=Debug -DGMGPOLAR_ENABLE_COVERAGE=ON -DGMGPOLAR_USE_MUMPS=${{ inputs.use-mumps }} ..
make -j4
- name: create build dir archive
shell: bash
Expand All @@ -21,6 +52,6 @@ runs:
- name: Upload build dir archive
uses: actions/upload-artifact@v4
with:
name: build-cpp-linux-gmgpolar
name: build-cpp-linux-gmgpolar${{ inputs.use-mumps == 'true' && '-mumps' || ''}}
path: build.tar.gz
retention-days: 1
14 changes: 11 additions & 3 deletions .github/actions/test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ inputs:
build-artifact:
description: "Name of the build artifact that contains the unit test"
required: true
use-mumps:
description: 'Indicates if GMGPolar should be built with mumps support'
type: bool
required: true

runs:
using: "composite"
Expand All @@ -13,10 +17,14 @@ runs:
run: |
apt-get -qq update
apt-get -qq -y install lcov
- name: Install MUMPS Dependencies
shell: bash
run: |
apt-get -qq -y install gfortran
- name: Download build test directory
uses: actions/download-artifact@v4
with:
name: ${{ inputs.build-artifact }}
name: ${{ inputs.build-artifact }}${{ inputs.use-mumps == 'true' && '-mumps' || ''}}
- name: extract build archive
shell: bash
run: |
Expand All @@ -38,14 +46,14 @@ runs:
- name: Upload test report
uses: actions/upload-artifact@v4
with:
name: test-report
name: test-report${{ inputs.use-mumps == 'true' && '-mumps' || ''}}
path: build/tests/testreport.xml
if-no-files-found: error
retention-days: 3
- name: Upload coverage reports
uses: actions/upload-artifact@v4
with:
name: test-coverage-reports
name: test-coverage-reports${{ inputs.use-mumps == 'true' && '-mumps' || ''}}
path: |
build/coverage-filtered.info
build/coverage
Expand Down
18 changes: 17 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,25 @@ jobs:
install-and-build:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
strategy:
matrix:
USE_MUMPS: [false, true]
name: 'install-and-build (USE_MUMPS=${{matrix.USE_MUMPS}})'
container:
image: ghcr.io/gyselax/gyselalibxx_env:latest
options: --user root
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/build
with:
use-mumps: ${{ matrix.USE_MUMPS }}

run-unit-test:
needs: install-and-build
runs-on: ubuntu-latest
strategy:
matrix:
USE_MUMPS: [false, true]
container:
image: ghcr.io/gyselax/gyselalibxx_env:latest
options: --user root
Expand All @@ -31,6 +40,7 @@ jobs:
- uses: ./.github/actions/test
with:
build-artifact: build-cpp-linux-gmgpolar
use-mumps: ${{ matrix.USE_MUMPS }}

codecov:
if: github.event.pull_request.draft == false
Expand All @@ -42,9 +52,15 @@ jobs:
uses: actions/download-artifact@v4
with:
name: test-coverage-reports
path: coverage
- name: Download mumps cpp coverage report
uses: actions/download-artifact@v4
with:
name: test-coverage-reports-mumps
path: coverage-mumps
- name: Deploy to codecov.io
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage-filtered.info
files: coverage/coverage-filtered.info,coverage-mumps/coverage-filtered.info
verbose: true
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
cmake_minimum_required(VERSION 3.12)
project(GMGPolar VERSION 2.0.0 LANGUAGES CXX)

# Options should be defined before they're used
option(GMGPOLAR_BUILD_TESTS "Build GMGPolar unit tests." ON)
option(GMGPOLAR_USE_LIKWID "Use LIKWID to measure code (regions)." OFF)
option(GMGPOLAR_USE_MUMPS "Use MUMPS to solve linear systems." OFF)
option(GMGPOLAR_ENABLE_COVERAGE "Enable code coverage reporting (requires GCC/Clang)" OFF)

if (${GMGPOLAR_USE_MUMPS})
# MUMPS does not automatically provide Fortran libraries
project(GMGPolar VERSION 2.0.0 LANGUAGES CXX Fortran)
else()
project(GMGPolar VERSION 2.0.0 LANGUAGES CXX)
endif()

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True)

Expand Down
48 changes: 31 additions & 17 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -192,17 +192,39 @@ endif()

# Handle MUMPS configuration
if(GMGPOLAR_USE_MUMPS)
if(DEFINED ENV{MUMPS_DIR})
find_package(MUMPS COMPONENTS OpenMP METIS)
if (${MUMPS_FOUND})
target_link_libraries(GMGPolarLib PUBLIC MUMPS::MUMPS)
target_compile_definitions(GMGPolarLib PUBLIC GMGPOLAR_USE_MUMPS)
elseif(DEFINED ENV{MUMPS_DIR})
set(MUMPS_DIR $ENV{MUMPS_DIR})

if(EXISTS "${MUMPS_DIR}/include" AND EXISTS "${MUMPS_DIR}/lib")
set(MUMPS_INCLUDE_DIR "${MUMPS_DIR}/include")
set(MUMPS_LIBRARY_DIR "${MUMPS_DIR}/lib")

target_include_directories(GMGPolarLib PUBLIC ${MUMPS_INCLUDE_DIR})
target_link_directories(GMGPolarLib PUBLIC ${MUMPS_LIBRARY_DIR})

if (EXISTS "${MUMPS_DIR}/libseq")
target_include_directories(GMGPolarLib PUBLIC "${MUMPS_DIR}/libseq")
target_link_directories(GMGPolarLib PUBLIC "${MUMPS_DIR}/libseq")
endif()

set(MUMPS_FOUND TRUE)
endif()

if(MUMPS_FOUND)
target_link_libraries(GMGPolarLib PUBLIC
mumps_common
smumps
dmumps
mpiseq
)
target_compile_definitions(GMGPolarLib PUBLIC GMGPOLAR_USE_MUMPS)
else()
message(SEND_ERROR "MUMPS not found")
endif()
endif()

if(DEFINED ENV{METIS_DIR})
Expand All @@ -211,25 +233,17 @@ if(GMGPOLAR_USE_MUMPS)
if(EXISTS "${METIS_DIR}/include" AND EXISTS "${METIS_DIR}/lib")
set(METIS_INCLUDE_DIR "${METIS_DIR}/include")
set(METIS_LIBRARY_DIR "${METIS_DIR}/lib")

target_include_directories(GMGPolarLib PUBLIC ${METIS_INCLUDE_DIR})
target_link_directories(GMGPolarLib PUBLIC ${METIS_LIBRARY_DIR})
set(METIS_FOUND TRUE)
endif()
endif()

if(MUMPS_FOUND)
target_link_libraries(GMGPolarLib PUBLIC
mumps_common
smumps
dmumps
mpiseq
)
target_compile_definitions(GMGPolarLib PUBLIC GMGPOLAR_USE_MUMPS)
endif()

if(METIS_FOUND)
target_link_libraries(GMGPolarLib PUBLIC metis)
if(METIS_FOUND)
target_link_libraries(GMGPolarLib PUBLIC metis)
else()
message(SEND_ERROR "METIS not found")
endif()
endif()
endif()

Expand Down