Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/detect xpress at runtime #724

Merged
Merged
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
3519bf7
start
a-zakir Oct 18, 2023
1cd9fa2
start
a-zakir Oct 18, 2023
d9f7126
add more function
a-zakir Oct 19, 2023
3963904
by default add Xpress in available solvers list
a-zakir Oct 19, 2023
1b7746c
Merge branch 'develop'
a-zakir Oct 19, 2023
45f1a0b
it works!
a-zakir Oct 19, 2023
2e0b58f
it works 2
a-zakir Oct 19, 2023
57461f6
tidy
a-zakir Oct 20, 2023
1c88437
unload unused function
a-zakir Oct 20, 2023
de57ad5
fix conversion path->string
a-zakir Oct 20, 2023
0450e4c
add newline after msf
a-zakir Oct 20, 2023
2393fdd
set xpress dir env var
a-zakir Oct 20, 2023
88ba8c7
windows set env var XPRESSDIR
a-zakir Oct 20, 2023
d784054
update windows getenv method
a-zakir Oct 23, 2023
ca3b226
update getenv
a-zakir Oct 23, 2023
5b8710c
write err in stderr
a-zakir Oct 23, 2023
239c78f
build clean path
a-zakir Oct 23, 2023
f46956a
print clearer err message
a-zakir Oct 23, 2023
d30bdf3
list xpress dir
a-zakir Oct 23, 2023
ea1c4f0
list xpress dir 2
a-zakir Oct 23, 2023
fbd3fda
list xpress dir 3
a-zakir Oct 23, 2023
80a7815
list xpress dir 4
a-zakir Oct 23, 2023
65f0ec1
list xpress dir 5
a-zakir Oct 23, 2023
ccbdf13
remove prepos
a-zakir Oct 24, 2023
682bd83
some move
a-zakir Oct 24, 2023
925a4a7
move header file
a-zakir Oct 24, 2023
9aa3c50
treat warning
a-zakir Oct 24, 2023
b5d1f37
remove prints
a-zakir Oct 24, 2023
d5c55f7
do right
a-zakir Oct 24, 2023
0c9c969
suggestion by @flomnes
a-zakir Nov 10, 2023
daa0971
suggestion by @flomnes
a-zakir Nov 10, 2023
06ed31a
suggestion by @florian
a-zakir Nov 10, 2023
9da5a5a
rename namespace
a-zakir Nov 10, 2023
2ce15ba
remove commented code
a-zakir Nov 10, 2023
562aa15
resolve conflicts
a-zakir Nov 10, 2023
5731bce
init Xpress env if needed
a-zakir Nov 15, 2023
dd28db3
check available Solvers once per program
a-zakir Nov 15, 2023
6340cb2
set Xpress bool check
a-zakir Nov 15, 2023
fa6cbf6
print the right log messages
a-zakir Nov 15, 2023
6aa147d
rename compile unit variable
a-zakir Nov 16, 2023
4a8ad09
tmp disable xpress as this fork doesn't have it
a-zakir Dec 11, 2023
f457cdc
remove comments
a-zakir Dec 11, 2023
3ac1b43
Revert "tmp disable xpress as this fork doesn't have it"
a-zakir Dec 11, 2023
df16339
Merge branch 'feature/detect_xpress_at_runtime' of https://github.com…
a-zakir Dec 11, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
it works!
  • Loading branch information
a-zakir committed Oct 19, 2023
commit 45f1a0ba9fa479b0bbc92807a2b77e3b044fa486
12 changes: 7 additions & 5 deletions src/cpp/lpnamer/main/RunProblemGeneration.cpp
Original file line number Diff line number Diff line change
@@ -193,7 +193,7 @@ void RunProblemGeneration(
}
auto mps_file_writer = std::make_shared<MPSFileWriter>(lpDir_);
std::for_each(
std::execution::par, problems_and_data.begin(), problems_and_data.end(),
problems_and_data.begin(), problems_and_data.end(),
[&](const auto& problem_and_data) {
const auto& [problem, data] = problem_and_data;
std::shared_ptr<IProblemVariablesProviderPort> variables_provider;
@@ -205,8 +205,9 @@ void RunProblemGeneration(
std::make_shared<ProblemVariablesFromProblemAdapter>(
problem, links, logger);
}
linkProblemsGenerator.treat(data._problem_mps, couplings, problem.get(),
variables_provider.get(), mps_file_writer.get());
linkProblemsGenerator.treat(data._problem_mps, couplings,
problem.get(), variables_provider.get(),
mps_file_writer.get());
});

reader->Close();
@@ -254,8 +255,9 @@ void RunProblemGeneration(
std::make_shared<ProblemVariablesFromProblemAdapter>(
problem, links, logger);
}
linkProblemsGenerator.treat(data._problem_mps, couplings, problem.get(),
variables_provider.get(), mps_file_writer.get());
linkProblemsGenerator.treat(data._problem_mps, couplings,
problem.get(), variables_provider.get(),
mps_file_writer.get());
});
}

18 changes: 9 additions & 9 deletions src/cpp/lpnamer/problem_modifier/ZipProblemsProviderAdapter.cpp
Original file line number Diff line number Diff line change
@@ -16,15 +16,15 @@ ZipProblemsProviderAdapter::provideProblems(
SolverLogManager& solver_log_manager) const {
std::vector<std::shared_ptr<Problem>> problems(problem_names_.size());
// Order is important. Problems need to be in the same order as names
std::transform(std::execution::par,
/*std::transform preserves order of element*/
problem_names_.begin(), problem_names_.end(), problems.begin(),
[&](auto name) {
ZipProblemProviderAdapter problem_provider(lp_dir_, name,
archive_reader_);
return problem_provider.provide_problem(solver_name,
solver_log_manager);
});
std::transform(
/*std::transform preserves order of element*/
problem_names_.begin(), problem_names_.end(), problems.begin(),
[&](auto name) {
ZipProblemProviderAdapter problem_provider(lp_dir_, name,
archive_reader_);
return problem_provider.provide_problem(solver_name,
solver_log_manager);
});
return problems;
}
ZipProblemsProviderAdapter::ZipProblemsProviderAdapter(
4 changes: 2 additions & 2 deletions src/cpp/multisolver_interface/environment.cc
Original file line number Diff line number Diff line change
@@ -311,9 +311,9 @@ bool LoadXpressDynamicLibrary(std::string& xpresspath) {
static std::once_flag xpress_loading_done;
static bool ret;
static DynamicLibrary xpress_library;
static std::mutex mutex;
// static std::mutex mutex;

mutex.lock();
// mutex.lock();

std::call_once(xpress_loading_done, []() {
const std::vector<std::string> canonical_paths =
Loading