Skip to content

Commit

Permalink
Merge branch 'study-pdlp' into cuda-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
jajhall committed Feb 14, 2025
2 parents 890385c + bc57ad1 commit 8c9ec71
Show file tree
Hide file tree
Showing 51 changed files with 2,579 additions and 478 deletions.
43 changes: 36 additions & 7 deletions .github/workflows/build-python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,23 +75,23 @@ jobs:
python -m pytest
build_wheel_linux:
# ubuntu 22 has a latest version of cmake, but setup-python
# does not seem to provide all necessary modules to find python
# from cmake. works on my machine, test the wheels manually
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
strategy:
matrix:
python: [3.11]
steps:
- uses: actions/checkout@v4

- name: Install correct python version
uses: actions/setup-python@v5
with:
python-version: '3.10'
python-version: ${{ matrix.python }}

- name: Build wheel
run: |
python3 --version
python3 -m pip install cibuildwheel
python3 -m cibuildwheel --only cp310-manylinux_x86_64 $GITHUB_WORKSPACE
python3 -m cibuildwheel --only cp311-manylinux_x86_64 $GITHUB_WORKSPACE
- name: Install wheel
run: |
Expand All @@ -102,7 +102,36 @@ jobs:
run: |
python3 -m pip install pytest
python3 -m pytest $GITHUB_WORKSPACE
build_wheel_linux_arm:
runs-on: ubuntu-24.04-arm
strategy:
matrix:
python: [3.11]
steps:
- uses: actions/checkout@v4

- name: Install python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}

- name: Build wheel
run: |
python3 --version
python3 -m pip install cibuildwheel
python3 -m cibuildwheel --only cp311-manylinux_aarch64 $GITHUB_WORKSPACE
- name: Install wheel
run: |
ls wheelhouse
python3 -m pip install wheelhouse/*.whl
- name: Test highspy
run: |
python3 -m pip install pytest
python3 -m pytest $GITHUB_WORKSPACE
# macos 13 is Intel
build_wheel_macos_13:
runs-on: macos-13
Expand Down
28 changes: 7 additions & 21 deletions .github/workflows/build-wheels-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ jobs:
# Github Actions doesn't support pairing matrix values together, let's improvise
# https://github.com/github/feedback/discussions/7835#discussioncomment-1769026
buildplat:
- [ubuntu-20.04, manylinux_x86_64]
- [ubuntu-20.04, manylinux_i686]
- [ubuntu-20.04, manylinux_aarch64]
- [ubuntu-20.04, musllinux_x86_64] # No OpenBlas, no test
- [ubuntu-20.04, musllinux_i686]
- [ubuntu-20.04, musllinux_aarch64]
- [ubuntu-24.04, manylinux_x86_64]
- [ubuntu-24.04, manylinux_i686]
- [ubuntu-24.04-arm, manylinux_aarch64]
- [ubuntu-24.04, musllinux_x86_64] # No OpenBlas, no test
- [ubuntu-24.04, musllinux_i686]
- [ubuntu-24.04-arm, musllinux_aarch64]
- [macos-13, macosx_x86_64]
- [macos-14, macosx_arm64]
- [windows-2019, win_amd64]
Expand All @@ -58,21 +58,7 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up QEMU # Required for aarch64 builds
if: ${{ contains(matrix.buildplat[1], 'aarch64') }}
uses: docker/setup-qemu-action@v3
with:
platforms: all

- name: Build wheels (aarch64)
if: ${{ contains(matrix.buildplat[1], 'aarch64') }}
uses: pypa/[email protected]
env:
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }}
CIBW_ARCHS_LINUX: aarch64

- name: Build wheels (not aarch64)
if: ${{ !contains(matrix.buildplat[1], 'aarch64') }}
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }}
Expand Down
28 changes: 7 additions & 21 deletions .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ jobs:
# Github Actions doesn't support pairing matrix values together, let's improvise
# https://github.com/github/feedback/discussions/7835#discussioncomment-1769026
buildplat:
- [ubuntu-20.04, manylinux_x86_64]
- [ubuntu-20.04, manylinux_i686]
- [ubuntu-20.04, manylinux_aarch64]
- [ubuntu-20.04, musllinux_x86_64] # No OpenBlas, no test
- [ubuntu-20.04, musllinux_i686]
- [ubuntu-20.04, musllinux_aarch64]
- [ubuntu-24.04, manylinux_x86_64]
- [ubuntu-24.04, manylinux_i686]
- [ubuntu-24.04-arm, manylinux_aarch64]
- [ubuntu-24.04, musllinux_x86_64] # No OpenBlas, no test
- [ubuntu-24.04, musllinux_i686]
- [ubuntu-24.04-arm, musllinux_aarch64]
- [macos-13, macosx_x86_64]
- [macos-14, macosx_arm64]
- [windows-2019, win_amd64]
Expand All @@ -46,21 +46,7 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up QEMU # Required for aarch64 builds
if: ${{ contains(matrix.buildplat[1], 'aarch64') }}
uses: docker/setup-qemu-action@v3
with:
platforms: all

- name: Build wheels (aarch64)
if: ${{ contains(matrix.buildplat[1], 'aarch64') }}
uses: pypa/[email protected]
env:
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }}
CIBW_ARCHS_LINUX: aarch64

- name: Build wheels (not aarch64)
if: ${{ !contains(matrix.buildplat[1], 'aarch64') }}
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }}
23 changes: 12 additions & 11 deletions .github/workflows/code-coverage.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: code-coverage

on: [push, pull_request]
on: [pull_request]

jobs:
debug:
Expand Down Expand Up @@ -47,21 +47,22 @@ jobs:
lcov --remove cov.info "app/cxxopts*" -o cov.info
lcov --remove cov.info "src/test*" -o cov.info
lcov --list cov.info
mv cov.info coverage.info
- name: Genhtml Results Summary
working-directory: ${{runner.workspace}}/build
shell: bash
run: |
genhtml -o coverage cov.info
genhtml -o coverage coverage.info
# Made it past the first token issue.
# May need some more time to porpagate on the codecov side.
# - name: Upload coverage reports to Codecov
# uses: codecov/codecov-action@v5
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# slug: ERGO-Code/HiGHS
# fail_ci_if_error: true # optional (default = false)
# files: ${{runner.workspace}}/build/cov.info # optional
# # name: codecov-umbrella # optional
# verbose: true # optional (default = false)
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: ERGO-Code/HiGHS
fail_ci_if_error: true # optional (default = false)
files: ${{runner.workspace}}/build/coverage.info # optional
# name: codecov-umbrella # optional
verbose: true # optional (default = false)
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -363,16 +363,16 @@ if(NOT FAST_BUILD)
endif()

include(CheckCXXCompilerFlag)
if (NOT HIGHS_COVERAGE)
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(ppc64|powerpc64)" AND NOT APPLE)
if (NOT HIGHS_COVERAGE AND NOT APPLE)
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(ppc64|powerpc64)")
check_cxx_compiler_flag("-mpopcntd" COMPILER_SUPPORTS_POPCNTD)
if(COMPILER_SUPPORTS_POPCNTD)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mpopcntd")
endif()
else()
check_cxx_compiler_flag("-mpopcnt" COMPILER_SUPPORTS_POPCNT)
if(COMPILER_SUPPORTS_POPCNT)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mpopcnt")
add_compile_options(-mpopcnt)
endif()
endif()
endif()
Expand Down
23 changes: 23 additions & 0 deletions check/TestFilereader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -416,3 +416,26 @@ TEST_CASE("writeLocalModel", "[highs_filereader]") {

std::remove(write_model_file.c_str());
}

TEST_CASE("write-MI-bound-model", "[highs_filereader]") {
std::string write_model_file = "temp.mps";
Highs h;
h.setOptionValue("output_flag", dev_run);
h.addCol(1, -kHighsInf, 1, 0, nullptr, nullptr);
h.changeColIntegrality(0, HighsVarType::kInteger);
h.passColName(0, "x");
std::vector<HighsInt> index = {0};
std::vector<double> value = {1};
h.addRow(-10, kHighsInf, 1, index.data(), value.data());
h.passRowName(0, "r");
h.run();
double required_objective_value = h.getInfo().objective_function_value;
// writeModel must ensure that there is a line
//
// MI BOUND x
h.writeModel(write_model_file);
h.readModel(write_model_file);
h.run();
REQUIRE(required_objective_value == h.getInfo().objective_function_value);
std::remove(write_model_file.c_str());
}
19 changes: 15 additions & 4 deletions check/TestMipSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ TEST_CASE("IP-with-fract-bounds-no-presolve", "[highs_test_mip_solver]") {
Highs highs;
// No presolve
highs.setOptionValue("output_flag", dev_run);
highs.setOptionValue("presolve", "off");
highs.setOptionValue("presolve", kHighsOffString);

// IP without constraints and fractional bounds on variables
HighsLp lp;
Expand Down Expand Up @@ -772,7 +772,7 @@ void distillationMIP(Highs& highs) {
special_lps.distillationMip(lp, require_model_status, optimal_objective);
REQUIRE(highs.passModel(lp) == HighsStatus::kOk);
// Presolve doesn't reduce the LP
solve(highs, "on", require_model_status, optimal_objective);
solve(highs, kHighsOnString, require_model_status, optimal_objective);
}

void rowlessMIP(Highs& highs) {
Expand All @@ -793,6 +793,17 @@ void rowlessMIP(Highs& highs) {
optimal_objective = -1.0;
REQUIRE(highs.passModel(lp) == HighsStatus::kOk);
// Presolve reduces the LP to empty
solve(highs, "on", require_model_status, optimal_objective);
solve(highs, "off", require_model_status, optimal_objective);
solve(highs, kHighsOnString, require_model_status, optimal_objective);
solve(highs, kHighsOffString, require_model_status, optimal_objective);
}

TEST_CASE("issue-2122", "[highs_test_mip_solver]") {
std::string filename = std::string(HIGHS_DIR) + "/check/instances/2122.lp";
Highs highs;
highs.setOptionValue("mip_rel_gap", 0);
highs.setOptionValue("mip_abs_gap", 0);
highs.readModel(filename);
const HighsModelStatus require_model_status = HighsModelStatus::kOptimal;
const double optimal_objective = -187612.944194;
solve(highs, kHighsOnString, require_model_status, optimal_objective);
}
Loading

0 comments on commit 8c9ec71

Please sign in to comment.