Skip to content

Fix Support for MPI #35

Fix Support for MPI

Fix Support for MPI #35

Workflow file for this run

# Author: Humberto Munoz Bauza (humberto.munozbauza@nasa.gov)
#
# Copyright © 2023, United States Government, as represented by the Administrator
# of the National Aeronautics and Space Administration. All rights reserved.
#
# The PySA, a powerful tool for solving optimization problems is licensed under
# the Apache License, Version 2.0 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0.
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
name: branching-tests
on:
push:
branches: [ "pysa-dpll" ]
pull_request:
branches: [ "pysa-dpll" ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
build_type: [ Release, Debug ]
cpp_compiler: [ g++, clang++ ]
mpi: [ ON, OFF ]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apt install -y libopenmpi-dev python3-pybind11 python3-dev python3-mpi4py
- name: Install and Test Python CUI (MPI)
if: matrix.mpi == 'ON'
run: |
pip install -U pip
USE_MPI=1 pip install -U .
echo -e 'p cnf 2 2\n1 2 0\n-1 -2 0' | mpirun -n 2 pysa-dpll sat
- name: Install and Test Python CUI
if: matrix.mpi == 'OFF'
run: |
pip install -U pip
pip install -U .
echo -e 'p cnf 2 2\n1 2 0\n-1 -2 0' | pysa-dpll sat
- name: Configure CMake
run: >
cmake -B ${{github.workspace}}/build \
-S ${{ github.workspace }} \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DMPI=${{ matrix.mpi }}
- name: Build
run: cmake --build ${{github.workspace}}/build
--config ${{ matrix.build_type }}
- name: Test
working-directory: ${{github.workspace}}/build/tests
run: ctest -C ${{ matrix.build_type }} --rerun-failed --output-on-failure