Skip to content

Commit

Permalink
Merge pull request #1986 from ERGO-Code/latest
Browse files Browse the repository at this point in the history
Ready for release
  • Loading branch information
galabovaa authored Oct 17, 2024
2 parents 5ce7a27 + e60cbb3 commit fcfb534
Show file tree
Hide file tree
Showing 144 changed files with 27,085 additions and 18,112 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-nuget-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ jobs:

- name: Dotnet pack
working-directory: ${{runner.workspace}}/build/dotnet/Highs.Native
run: dotnet pack -c Release /p:Version=1.7.2
run: dotnet pack -c Release /p:Version=1.8.0

- uses: actions/upload-artifact@v4
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/clang-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: DoozyX/clang-format-lint-action@v0.14
- uses: DoozyX/clang-format-lint-action@v0.18
with:
source: 'app/ src/Highs.h ./src/lp_data ./src/mip ./src/model ./src/simplex ./src/presolve ./src/simplex ./src/util ./src/test'
#./src/test ./interfaces'
extensions: 'h,cpp,c'
clangFormatVersion: 14
clangFormatVersion: 18
55 changes: 55 additions & 0 deletions .github/workflows/sanitizers-cmake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: sanitizers-cmake
on: [] #push

jobs:
sanitizer_release:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# os: [ubuntu-latest, macos-latest]
os: [ubuntu-latest]
sanitizer: [Address, Thread, Leak]
steps:
- uses: actions/checkout@v4

- name: Create Build Environment
run: cmake -E make_directory ${{runner.workspace}}/build

- name: Configure CMake and Build
shell: bash
working-directory: ${{runner.workspace}}/build
run: |
cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=RelWithDebInfo -DDEBUG_MEMORY=${{ matrix.sanitizer }}
cmake --build . --parallel
- name: Run
working-directory: ${{runner.workspace}}/build
shell: bash
run: ./bin/highs $GITHUB_WORKSPACE/check/instances/afiro.mps

sanitizer_debug:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# os: [ubuntu-latest, macos-latest]
os: [ubuntu-latest]
sanitizer: [Address, Thread, Leak]
steps:
- uses: actions/checkout@v4

- name: Create Build Environment
run: cmake -E make_directory ${{runner.workspace}}/build

- name: Configure CMake and Build
shell: bash
working-directory: ${{runner.workspace}}/build
run: |
cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug -DDEBUG_MEMORY=${{ matrix.sanitizer }}
cmake --build . --parallel
- name: Run
working-directory: ${{runner.workspace}}/build
shell: bash
run: ./bin/highs $GITHUB_WORKSPACE/check/instances/afiro.mps
File renamed without changes.
4 changes: 2 additions & 2 deletions .github/workflows/test-nuget-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:

- name: Dotnet pack
working-directory: ${{runner.workspace}}/build/dotnet/Highs.Native
run: dotnet pack -c Release /p:Version=1.7.2
run: dotnet pack -c Release /p:Version=1.8.0

- name: Add local feed
run: dotnet nuget add source ${{runner.workspace}}/nugets
Expand Down Expand Up @@ -81,7 +81,7 @@ jobs:

- name: Dotnet pack
working-directory: ${{runner.workspace}}/build/dotnet/Highs.Native
run: dotnet pack -c Release /p:Version=1.7.2
run: dotnet pack -c Release /p:Version=1.8.0

- name: Add local feed
run: dotnet nuget add source ${{runner.workspace}}/nugets
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/test-nuget-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:

- name: Dotnet pack
working-directory: ${{runner.workspace}}/build/dotnet/Highs.Native
run: dotnet pack -c Release /p:Version=1.7.2
run: dotnet pack -c Release /p:Version=1.8.0

- name: Add local feed
run: dotnet nuget add source ${{runner.workspace}}/nugets
Expand Down Expand Up @@ -81,7 +81,7 @@ jobs:

- name: Dotnet pack
working-directory: ${{runner.workspace}}/build/dotnet/Highs.Native
run: dotnet pack -c Release /p:Version=1.7.2
run: dotnet pack -c Release /p:Version=1.8.0

- name: Add local feed
run: dotnet nuget add source ${{runner.workspace}}/nugets
Expand Down Expand Up @@ -124,7 +124,7 @@ jobs:

- name: Dotnet pack
working-directory: ${{runner.workspace}}/build/dotnet/Highs.Native
run: dotnet pack -c Release /p:Version=1.7.2
run: dotnet pack -c Release /p:Version=1.8.0

- name: Add local feed
run: dotnet nuget add source ${{runner.workspace}}/nugets
Expand Down Expand Up @@ -167,7 +167,7 @@ jobs:

- name: Dotnet pack
working-directory: ${{runner.workspace}}/build/dotnet/Highs.Native
run: dotnet pack -c Release /p:Version=1.7.2
run: dotnet pack -c Release /p:Version=1.8.0

- name: Add local feed
run: dotnet nuget add source ${{runner.workspace}}/nugets
Expand Down Expand Up @@ -212,7 +212,7 @@ jobs:

- name: Dotnet pack
working-directory: ${{runner.workspace}}/build/dotnet/Highs.Native
run: dotnet pack -c Release /p:Version=1.7.2
run: dotnet pack -c Release /p:Version=1.8.0

- name: Add local feed
run: dotnet nuget add source -n name ${{runner.workspace}}\nugets
Expand All @@ -228,5 +228,5 @@ jobs:
dotnet new console
rm Program.cs
cp ${{runner.workspace}}\HiGHS\examples\call_highs_from_csharp.cs .
dotnet add package Highs.Native -v 1.7.2 -s ${{runner.workspace}}\nugets
dotnet add package Highs.Native -v 1.8.0 -s ${{runner.workspace}}\nugets
dotnet run
4 changes: 2 additions & 2 deletions .github/workflows/test-nuget-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:

- name: Dotnet pack
working-directory: ${{runner.workspace}}/build/dotnet/Highs.Native
run: dotnet pack -c Release /p:Version=1.7.2
run: dotnet pack -c Release /p:Version=1.8.0

- name: Add local feed
run: dotnet nuget add source ${{runner.workspace}}/nugets
Expand Down Expand Up @@ -74,7 +74,7 @@ jobs:

- name: Dotnet pack
working-directory: ${{runner.workspace}}/build/dotnet/Highs.Native
run: dotnet pack -c Release /p:Version=1.7.2
run: dotnet pack -c Release /p:Version=1.8.0

- name: Add local feed
run: dotnet nuget add source ${{runner.workspace}}/nugets
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-nuget-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:

- name: Dotnet pack
working-directory: ${{runner.workspace}}/build/dotnet/Highs.Native
run: dotnet pack -c Release /p:Version=1.7.2
run: dotnet pack -c Release /p:Version=1.8.0

- name: Add local feed
run: dotnet nuget add source -n name ${{runner.workspace}}\nugets
Expand All @@ -49,5 +49,5 @@ jobs:
dotnet new console
rm Program.cs
cp ${{runner.workspace}}\HiGHS\examples\call_highs_from_csharp.cs .
dotnet add package Highs.Native -v 1.7.2 -s ${{runner.workspace}}\nugets
dotnet add package Highs.Native -v 1.8.0 -s ${{runner.workspace}}\nugets
dotnet run
91 changes: 73 additions & 18 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,23 @@ if(EXISTS "${LOC_PATH}")
endif()
option(FAST_BUILD "Fast build: " ON)

find_program(GIT git)

if((GIT) AND(EXISTS ${HIGHS_SOURCE_DIR}/.git))
execute_process(
COMMAND ${GIT} status
WORKING_DIRECTORY ${HIGHS_SOURCE_DIR} OUTPUT_QUIET)

execute_process(
COMMAND ${GIT} describe --always
WORKING_DIRECTORY ${HIGHS_SOURCE_DIR}
OUTPUT_VARIABLE GITHASH OUTPUT_STRIP_TRAILING_WHITESPACE)
# string(REGEX REPLACE "^.*-g" "" GITHASH ${GITHASH})
else()
set(GITHASH "n/a")
endif()

message(STATUS "Git hash: " ${GITHASH})
# By default only build the C++ library.
option(BUILD_CXX "Build C++ library" ON)
message(STATUS "Build C++ library: ${BUILD_CXX}")
Expand Down Expand Up @@ -71,6 +88,12 @@ if (PYTHON_BUILD_SETUP)
set(ZLIB OFF)
endif()

# Address | Thread | Leak
# Linux atm
# Only Debug is theted atm
# See below for RelWithDeb info, todo test wip
set(DEBUG_MEMORY "Off" CACHE STRING "Sanitizers")

# emscripten
option(EMSCRIPTEN_HTML "Emscripten HTML output" OFF)

Expand Down Expand Up @@ -358,12 +381,6 @@ if(NOT FAST_BUILD OR CSHARP)
endif(CMAKE_CSharp_COMPILER)
endif()

# uncomment for memory debugging
# set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined")
# set (CMAKE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_LINKER_FLAGS_RELWITHDEBINFO} -fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined")
# set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined")
# set (CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address -fsanitize=undefined")

# if zlib is found, then we can enable reading zlib-compressed input
if(ZLIB AND NOT TARGET ZLIB::ZLIB)
find_package(ZLIB 1.2.3)
Expand All @@ -375,25 +392,63 @@ set(CPACK_PACKAGE_VERSION_MINOR "${HIGHS_VERSION_MINOR}")
set(CPACK_PACKAGE_VERSION_PATCH "${HIGHS_VERSION_PATCH}")
set(CPACK_PACKAGE_VENDOR "University of Edinburgh")

find_program(GIT git)

if((GIT) AND(EXISTS ${HIGHS_SOURCE_DIR}/.git))
execute_process(
COMMAND ${GIT} describe --always --dirty
WORKING_DIRECTORY ${HIGHS_SOURCE_DIR}
OUTPUT_VARIABLE GITHASH OUTPUT_STRIP_TRAILING_WHITESPACE)
string(REGEX REPLACE "^.*-g" "" GITHASH ${GITHASH})
else()
set(GITHASH "n/a")
endif()
message(STATUS "Git hash: " ${GITHASH})

# Deprecate
# string(TIMESTAMP TODAY "%Y-%m-%d")
# message(STATUS "Compilation date: " ${TODAY})

configure_file(${HIGHS_SOURCE_DIR}/src/HConfig.h.in ${HIGHS_BINARY_DIR}/HConfig.h)

if (DEBUG_MEMORY STREQUAL "Address")
set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} \
-fsanitize=address,undefined \
-fno-omit-frame-pointer \
-fsanitize-address-use-after-scope")
set (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO} \
-fsanitize=address,undefined \
-fno-omit-frame-pointer \
-fsanitize-address-use-after-scope")

set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} \
-fsanitize=address,undefined \
-fno-omit-frame-pointer \
-fno-optimize-sibling-calls ")
set (CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} \
-fsanitize=address,undefined \
-fno-omit-frame-pointer \
-fno-optimize-sibling-calls ")

elseif (DEBUG_MEMORY STREQUAL "Thread")
set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} \
-fsanitize=thread,undefined \
-fno-omit-frame-pointer")
set (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO} \
-fsanitize=thread,undefined \
-fno-omit-frame-pointer")

set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} \
-fsanitize=thread,undefined \
-fno-omit-frame-pointer ")
set (CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} \
-fsanitize=thread,undefined \
-fno-omit-frame-pointer ")

elseif (DEBUG_MEMORY STREQUAL "Leak")
set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} \
-fsanitize=leak,undefined \
-fno-omit-frame-pointer")
set (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO} \
-fsanitize=leak,undefined \
-fno-omit-frame-pointer")

set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} \
-fsanitize=leak,undefined \
-fno-omit-frame-pointer ")
set (CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} \
-fsanitize=leak,undefined \
-fno-omit-frame-pointer ")
endif()

if(NOT FAST_BUILD)
# For the moment keep above coverage part in case we are testing at CI.
option(CI "CI extended tests" ON)
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Contact [Julian](https://github.com/jajhall) (General issues and solvers), [Ivet

## Improve the documentation

The top level [documentation](https://ergo-code.github.io/HiGHS/) is created using [Docsy](https://www.docsy.dev/), with the files held on the [HiGHS repository](https://github.com/ERGO-Code/HiGHS/tree/docsy). If your change is small (like fixing typos, or one or two sentence corrections), the easiest way to do this is to fork the branch and create a pull request. (See *Contribute code to HiGHS* below for more on this.) If your change is larger, or touches multiple files, please raise an issue describing what you want to do.
The top level [documentation](https://ergo-code.github.io/HiGHS/) is created using [Docsy](https://www.docsy.dev/), with the files held on the [HiGHS repository](https://github.com/ERGO-Code/HiGHS/tree/master/docs). If your change is small (like fixing typos, or one or two sentence corrections), the easiest way to do this is to fork the branch and create a pull request. (See *Contribute code to HiGHS* below for more on this.) If your change is larger, or touches multiple files, please raise an issue describing what you want to do.

## Raise an issue

Expand Down
47 changes: 34 additions & 13 deletions FEATURES.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,43 @@
## Build changes

The python wrapper highspy is now available for aarch64 on manylinux
This allows highs to be run through Python on AWS arm64
## Code changes

Added `int64_t mip_total_lp_iterations` to `HighsCallbackDataOut` and modified accessor function

`Highs::writeSolution` and `Highs::writeBasis` now being done via `HighsIO` logging, so can be redirected to logging callback.

Introduced `const double kHighsUndefined` as value of undefined values in a user solution. It's equal to `kHighsInf`

Added `Highs::setSolution(const HighsInt num_entries, const HighsInt* index, const double* value);` to allow a sparse primal solution to be defined. When a MIP is solved to do this, the value of (new) option `mip_max_start_nodes` is used for `mip_max_nodes` to avoid excessive cost

Added options `write_presolved_model_to_file` and `write_presolved_model_file` so that presolved model can be written via a command line option

Added `Highs::feasibilityRelaxation` to solve the problem of minimizing a (possibly weighted) sum of (allowable) infeasibilities in an LP/MIP.

Added Python utility `examples/plot_highs_log.py` (due to @Thell) to visualise progress of the MIP solver.

Added minimal documentation of solvers and how simplex variants can be run

Methods receiving matrix data where only small values are explicit zeros (so removed internally) are now silent and return `HighsStatus::kOk` (since internal matrix is exact)

Now multiplying by pre-computed reciprocals rather than performing divisions in loops in simplex solver: LP performance improvement ~2.5%

Primal and dual residuals after IPM and cuPDLP-C are checked, and corrections applied to row solution and column duals

`Highs::passModelName` added to allow name to be given to the incumbent model

Memory leaks in cuPDLP-C fixed

Bug fixed in MIP presolve






Bug fix for fortran on macOS

## Code changes

The accessor function Highs_getCallbackDataOutItem in the C API means
that `pdlp_iteration_count` can be moved back to where it was inserted
into the `HighsCallbackDataOut` struct in v1.7.0, which broke the C
API. This fixes #1812

Some duplicate code has been eliminated from the MIP solver, and
modifications made to eliminate compiler warnings

Declaration of the (deprecated) method `char* highsCompilationDate()`
has been corrected

Fixed bug when describing integrality status during the human-readable solution write

2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module(
name = "highs",
version = "1.7.2",
version = "1.8.0",
)

bazel_dep(
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ The nuget package Highs.Native is on https://www.nuget.org, at https://www.nuget
It can be added to your C# project with `dotnet`

```shell
dotnet add package Highs.Native --version 1.7.2
dotnet add package Highs.Native --version 1.8.0
```

The nuget package contains runtime libraries for
Expand Down
4 changes: 2 additions & 2 deletions Version.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
HIGHS_MAJOR=1
HIGHS_MINOR=7
HIGHS_PATCH=2
HIGHS_MINOR=8
HIGHS_PATCH=0
#PRE_RELEASE=YES
Loading

0 comments on commit fcfb534

Please sign in to comment.