Add libCEED output functionals for GPU postprocessing #3802
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and Test (macOS) | |
| permissions: | |
| contents: read | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| # Filter to allow skipping the test if no relevant changes occurred. | |
| filter: | |
| runs-on: macos-15 | |
| outputs: | |
| test: ${{ steps.filter.outputs.test }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: dorny/paths-filter@v4 | |
| id: filter | |
| with: | |
| filters: | | |
| test: | |
| - 'palace/**' | |
| - 'cmake/**' | |
| - 'extern/**' | |
| - 'examples/**' | |
| - 'test/unit/**' | |
| - 'test/data/**' | |
| - '.github/workflows/build-and-test-macos.yml' | |
| build-and-test-macos: | |
| needs: filter | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: # Pairwise testing (from allpairspy) | |
| # Failing configurations currently disabled pending investigation | |
| # - compiler: gcc | |
| # mpi: mpich | |
| # math-libs: openblas | |
| # build-shared: shared | |
| # with-64bit-int: int64 | |
| # with-openmp: openmp | |
| # with-eigensolver: slepc | |
| # with-solver: superlu | |
| - compiler: clang | |
| mpi: openmpi | |
| math-libs: armpl | |
| build-shared: static | |
| with-64bit-int: int32 | |
| with-openmp: serial | |
| with-eigensolver: arpack | |
| with-solver: strumpack | |
| # - compiler: clang | |
| # mpi: mpich | |
| # math-libs: armpl | |
| # build-shared: shared | |
| # with-64bit-int: int32 | |
| # with-openmp: openmp | |
| # with-eigensolver: arpack | |
| # with-solver: mumps | |
| - compiler: gcc | |
| mpi: openmpi | |
| math-libs: openblas | |
| build-shared: static | |
| with-64bit-int: int64 | |
| with-openmp: serial | |
| with-eigensolver: slepc | |
| with-solver: mumps | |
| - compiler: gcc | |
| mpi: openmpi | |
| math-libs: armpl | |
| build-shared: shared | |
| with-64bit-int: int64 | |
| with-openmp: serial | |
| with-eigensolver: arpack | |
| with-solver: superlu | |
| - compiler: clang | |
| mpi: openmpi # was mpich; see https://github.com/awslabs/palace/issues/790 | |
| math-libs: openblas | |
| build-shared: static | |
| with-64bit-int: int32 | |
| with-openmp: openmp | |
| with-eigensolver: slepc | |
| with-solver: strumpack | |
| - compiler: clang | |
| mpi: mpich | |
| math-libs: openblas | |
| build-shared: static | |
| with-64bit-int: int64 | |
| with-openmp: serial | |
| with-eigensolver: arpack | |
| with-solver: superlu | |
| # - compiler: gcc | |
| # mpi: openmpi | |
| # math-libs: armpl | |
| # build-shared: shared | |
| # with-64bit-int: int32 | |
| # with-openmp: openmp | |
| # with-eigensolver: slepc | |
| # with-solver: strumpack | |
| # - compiler: gcc | |
| # mpi: openmpi | |
| # math-libs: armpl | |
| # build-shared: shared | |
| # with-64bit-int: int32 | |
| # with-openmp: openmp | |
| # with-eigensolver: slepc | |
| # with-solver: superlu | |
| # - compiler: gcc | |
| # mpi: openmpi | |
| # math-libs: armpl | |
| # build-shared: shared | |
| # with-64bit-int: int64 | |
| # with-openmp: openmp | |
| # with-eigensolver: slepc | |
| # with-solver: strumpack | |
| runs-on: macos-15-xlarge | |
| steps: | |
| - uses: actions/checkout@v6 | |
| if: needs.filter.outputs.test == 'true' | |
| with: | |
| submodules: 'recursive' | |
| - name: Configure Open MPI | |
| if: needs.filter.outputs.test == 'true' && matrix.mpi == 'openmpi' | |
| run: | | |
| brew install openmpi | |
| - name: Configure MPICH | |
| if: needs.filter.outputs.test == 'true' && matrix.mpi == 'mpich' | |
| run: | | |
| brew install mpich | |
| - name: Install math libraries (OpenBLAS) | |
| if: needs.filter.outputs.test == 'true' && matrix.math-libs == 'openblas' | |
| run: | | |
| brew install openblas | |
| - name: Install OpenMP | |
| if: needs.filter.outputs.test == 'true' && matrix.with-openmp == 'openmp' | |
| run: | | |
| brew install libomp | |
| echo "CPATH=/opt/homebrew/opt/libomp/include:$CPATH" >> $GITHUB_ENV | |
| echo "LIBRARY_PATH=/opt/homebrew/opt/libomp/lib:$LIBRARY_PATH" >> $GITHUB_ENV | |
| - name: Install math libraries (ARMPL) | |
| if: needs.filter.outputs.test == 'true' && matrix.math-libs == 'armpl' | |
| run: | | |
| wget -q https://developer.arm.com/-/cdn-downloads/permalink/Arm-Performance-Libraries/Version_24.10/arm-performance-libraries_24.10_macOS.tgz | |
| tar -zxvf arm-performance-libraries*.tgz && rm arm-performance-libraries*.tgz | |
| hdiutil attach armpl_24.10_flang-new_clang_19.dmg -nobrowse -quiet | |
| sudo /Volumes/armpl_24.10_flang-new_clang_19_installer/armpl* -y | |
| ls /opt/arm/ | |
| echo "ARMPL_DIR=/opt/arm/armpl_24.10_flang-new_clang_19" >> $GITHUB_ENV | |
| echo "DYLD_LIBRARY_PATH=/opt/arm/armpl_24.10_flang-new_clang_19/lib:${DYLD_LIBRARY_PATH:+${DYLD_LIBRARY_PATH}:}" >> $GITHUB_ENV | |
| hdiutil detach "/Volumes/armpl_24.10_flang-new_clang_19_installer" -quiet | |
| # We have to upgrade CMake because the bundled one has a bug with | |
| # FindMPI that prevents it from finding MPI when compiling with GNU | |
| # compilers. | |
| - name: Setup cmake | |
| if: needs.filter.outputs.test == 'true' | |
| uses: jwlawson/actions-setup-cmake@v2 | |
| with: | |
| cmake-version: '3.31.8' | |
| - name: Build Palace | |
| if: needs.filter.outputs.test == 'true' | |
| env: | |
| CMAKE_BUILD_TYPE: Release | |
| NUM_PROC_BUILD_MAX: '32' | |
| run: | | |
| # Configure environment | |
| if [[ "${{ matrix.compiler }}" == 'clang' ]]; then | |
| export CC=$(brew --prefix llvm@18)/bin/clang | |
| export CXX=$(brew --prefix llvm@18)/bin/clang++ | |
| export FC=gfortran-15 | |
| elif [[ "${{ matrix.compiler }}" == 'gcc' ]]; then | |
| export CC=gcc-15 | |
| export CXX=g++-15 | |
| export FC=gfortran-15 | |
| fi | |
| if [[ "${{ matrix.math-libs }}" == 'openblas' ]]; then | |
| export OPENBLAS_DIR=$(brew --prefix openblas) | |
| fi | |
| if [[ "${{ matrix.math-libs }}" == 'armpl' ]]; then | |
| export ARMPL_DIR=${ARMPL_DIR} | |
| export DYLD_LIBRARY_PATH=$ARMPL_DIR/lib:${DYLD_LIBRARY_PATH:-} | |
| fi | |
| export NUM_PROC_BUILD=$(nproc 2> /dev/null || sysctl -n hw.ncpu) | |
| if [[ "$NUM_PROC_BUILD" -gt "$NUM_PROC_BUILD_MAX" ]]; then | |
| NUM_PROC_BUILD=$NUM_PROC_BUILD_MAX | |
| fi | |
| [[ "${{ matrix.build-shared }}" == 'shared' ]] && BUILD_SHARED='ON' || BUILD_SHARED='OFF' | |
| [[ "${{ matrix.with-64bit-int }}" == 'int64' ]] && WITH_INT64='ON' || WITH_INT64='OFF' | |
| [[ "${{ matrix.with-openmp }}" == 'openmp' ]] && WITH_OPENMP='ON' || WITH_OPENMP='OFF' | |
| [[ "${{ matrix.with-solver }}" == 'superlu' ]] && WITH_SUPERLU='ON' || WITH_SUPERLU='OFF' | |
| [[ "${{ matrix.with-solver }}" == 'strumpack' ]] && WITH_STRUMPACK='ON' || WITH_STRUMPACK='OFF' | |
| [[ "${{ matrix.with-solver }}" == 'mumps' ]] && WITH_MUMPS='ON' || WITH_MUMPS='OFF' | |
| [[ "${{ matrix.with-eigensolver }}" == 'slepc' ]] && WITH_SLEPC='ON' || WITH_SLEPC='OFF' | |
| [[ "${{ matrix.with-eigensolver }}" == 'arpack' ]] && WITH_ARPACK='ON' || WITH_ARPACK='OFF' | |
| # Build and install (with unit tests) | |
| # Unit [Parallel] cases run at PALACE_TESTS_NUMPROC ranks (small, fast); | |
| # regression cases run at PALACE_REGRESSION_NUMPROC (~8 CPUs/case -- | |
| # fewer ranks shift tail eigenvalues past tolerance for some solvers). | |
| # CTest derives PROCESSORS = ranks x threads and pins OMP_NUM_THREADS, | |
| # so -j only bounds concurrency. | |
| TEST_CORES=$(nproc 2> /dev/null || sysctl -n hw.ncpu) | |
| if [[ "$TEST_CORES" -gt 8 ]]; then | |
| TEST_CORES=8 | |
| fi | |
| if [[ "${{ matrix.with-openmp }}" == 'openmp' ]]; then | |
| TESTS_OMP_THREADS=2 | |
| else | |
| TESTS_OMP_THREADS=1 | |
| fi | |
| REGRESSION_NUMPROC=$(( TEST_CORES / TESTS_OMP_THREADS )) | |
| if [[ "$REGRESSION_NUMPROC" -lt 1 ]]; then | |
| REGRESSION_NUMPROC=1 | |
| fi | |
| mkdir palace-build && cd palace-build | |
| cmake .. \ | |
| -DCMAKE_INSTALL_PREFIX=$(pwd)/../palace-install \ | |
| -DPALACE_TESTS_NUMPROC=2 \ | |
| -DPALACE_REGRESSION_NUMPROC=$REGRESSION_NUMPROC \ | |
| -DPALACE_TESTS_OMP_THREADS=$TESTS_OMP_THREADS \ | |
| -DBUILD_SHARED_LIBS=$BUILD_SHARED \ | |
| -DPALACE_WITH_64BIT_INT=$WITH_INT64 \ | |
| -DPALACE_WITH_OPENMP=$WITH_OPENMP \ | |
| -DPALACE_WITH_SUPERLU=$WITH_SUPERLU \ | |
| -DPALACE_WITH_STRUMPACK=$WITH_STRUMPACK \ | |
| -DPALACE_WITH_MUMPS=$WITH_MUMPS \ | |
| -DPALACE_WITH_SLEPC=$WITH_SLEPC \ | |
| -DPALACE_WITH_ARPACK=$WITH_ARPACK \ | |
| -DPALACE_MFEM_USE_EXCEPTIONS=ON | |
| make -j$NUM_PROC_BUILD palace-tests | |
| - name: Run unit tests | |
| if: needs.filter.outputs.test == 'true' | |
| timeout-minutes: 5 | |
| run: | | |
| # Configure environment | |
| export DYLD_LIBRARY_PATH="$(pwd)/palace-install/lib:$DYLD_LIBRARY_PATH" | |
| cd $(pwd)/palace-build/palace-build/test/unit | |
| # Skip [Regression] and [Long] cases here; they have their | |
| # own slower steps further down. CTest pins OMP_NUM_THREADS and | |
| # reserves PROCESSORS per case, so -j just bounds concurrency. | |
| ctest -j "$(nproc 2> /dev/null || sysctl -n hw.ncpu)" --output-on-failure -LE "^(regression|long)$" | |
| - name: Run regression tests | |
| if: needs.filter.outputs.test == 'true' | |
| # CTest owns per-case scheduling for the [Regression] cases (label | |
| # "regression"). The build-time rank/thread contract sets each case's | |
| # PROCESSORS property so -j can fan out safely. | |
| timeout-minutes: 40 | |
| run: | | |
| # Configure environment | |
| export PATH=$(pwd)/palace-install/bin:$PATH | |
| cd palace-build/palace-build/test/unit | |
| ctest -j "$(nproc 2> /dev/null || sysctl -n hw.ncpu)" --output-on-failure -L "^regression$" |