rust-or / highs-sys

Rust binding for the HiGHS linear programming solver
https://docs.rs/highs-sys
10 stars 16 forks source link

Unreliable tests on Windows? #9

Open Thell opened 1 year ago

Thell commented 1 year ago

image

After letting it sit like that while reading docs I figured something isn't right. Putting a few print statements in the tests and running without capturing shows that the tests just aren't terminating... 🤷‍♂️

   Compiling highs-sys v1.5.0 (C:\Users\thell\Workspaces\rust\highs-sys)
    Finished test [unoptimized + debuginfo] target(s) in 0.51s
     Running unittests src\lib.rs (target\debug\deps\highs_sys-3d25d1f33d6abe81.exe)

running 4 tests
test bindgen_test_layout__Lldiv_t ... ok
test bindgen_test_layout___crt_locale_data_public ... ok
test bindgen_test_layout__Mbstatet ... ok
test bindgen_test_layout___crt_locale_pointers ... ok

test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

     Running tests\test_highs_call.rs (target\debug\deps\test_highs_call-cc6750e8e836ffd8.exe)

running 1 test
test highs_call ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

     Running tests\test_highs_functions.rs (target\debug\deps\test_highs_functions-d5a2d5a05e03bb5a.exe)

running 2 tests
===== multi threading tests ========
--- completed a highs_functions test
--- completed a highs_functions test
--- completed a highs_functions test
--- completed a highs_functions test
--- completed a highs_functions test
--- completed a highs_functions test
--- completed a highs_functions test
--- completed a highs_functions test
--- completed a highs_functions test
--- completed a highs_functions test
--- completed a highs_functions test
--- completed a highs_functions test
--- completed a highs_functions test
--- completed a highs_functions test
--- completed a highs_functions test
--- completed a highs_functions test
--- completed a highs_functions test
--- completed a highs_functions test
--- completed a highs_functions test
--- completed a highs_functions test
--- completed a highs_functions test
--- completed a highs_functions test
--- completed a highs_functions test
--- completed a highs_functions test
--- completed a highs_functions test
--- completed a highs_functions test
--- completed a highs_functions test
--- completed a highs_functions test
--- completed a highs_functions test
--- completed a highs_functions test
--- completed a highs_functions test
--- completed a highs_functions test
--- completed a highs_functions test
--- completed a highs_functions test
--- completed a highs_functions test
--- completed a highs_functions test
--- completed a highs_functions test
--- completed a highs_functions test
--- completed a highs_functions test
--- completed a highs_functions test
--- completed a highs_functions test
--- completed a highs_functions test
--- completed a highs_functions test
--- completed a highs_functions test
--- completed a highs_functions test
--- completed a highs_functions test
--- completed a highs_functions test
--- completed a highs_functions test
--- completed a highs_functions test
threads collected...

Then it just spins at 100% of 1 core. After breaking out of that one I altered the number of threads started and tried a bunch more runs and got hangs on test_highs_call a few times and test_highs_functions on the remainder.

Any ideas? I used winget for the reqs with -i for the cmake to set the env vars and the installs went fine as well as the cargo build... I'm not sure what to check next.

Thell commented 1 year ago

Hi again! So, it looks like this happens when threads = 0. According to Julian in the previously linked issue thread this looked to resolve their hanging issue with HiGHS on Windows, and, indeed

        let option_name = CString::new("threads").unwrap();
        Highs_setIntOptionValue(highs, option_name.as_ptr(), 1);

has resolved the issue. I'll leave it open for you to close in case you want to make that a part of highs-sys Windows configs.

Now... on to figuring out the zlip issue on Windows, lol.