Skip to content

Commit

Permalink
it works!
Browse files Browse the repository at this point in the history
  • Loading branch information
a-zakir committed Oct 19, 2023
1 parent 1b7746c commit 45f1a0b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 16 deletions.
12 changes: 7 additions & 5 deletions src/cpp/lpnamer/main/RunProblemGeneration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();
Expand Down Expand Up @@ -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());
});
}

Expand Down
18 changes: 9 additions & 9 deletions src/cpp/lpnamer/problem_modifier/ZipProblemsProviderAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions src/cpp/multisolver_interface/environment.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down

0 comments on commit 45f1a0b

Please sign in to comment.