Skip to content

Commit

Permalink
Remove Antares mps file after read in problem generation (#991)
Browse files Browse the repository at this point in the history
Antares files are read in problem generation and are then useless, they
should be removed to improve disk usage
  • Loading branch information
tbittar authored Jan 29, 2025
1 parent 3159863 commit 88cb3b2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ std::shared_ptr<Problem> FileProblemProviderAdapter::provide_problem(
auto in_prblm = std::make_shared<Problem>(
factory.create_solver(solver_name, solver_log_manager));

in_prblm->read_prob_mps(lp_dir_.parent_path() / problem_name_);
const std::filesystem::path problem_path =
lp_dir_.parent_path() / problem_name_;
in_prblm->read_prob_mps(problem_path);
std::filesystem::remove(problem_path);
return in_prblm;
}
FileProblemProviderAdapter::FileProblemProviderAdapter(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

#include <utility>

#include "antares-xpansion/helpers/solver_utils.h"
#include "antares-xpansion/lpnamer/problem_modifier/LinkProblemsGenerator.h"
#include "antares-xpansion/xpansion_interfaces/StringManip.h"
#include "antares-xpansion/helpers/solver_utils.h"
void ZipProblemProviderAdapter::reader_extract_file(
const std::string& problem_name, ArchiveReader& reader,
const std::filesystem::path& lpDir) const {
Expand All @@ -26,6 +26,7 @@ std::shared_ptr<Problem> ZipProblemProviderAdapter::provide_problem(
factory.create_solver(solver_name, solver_log_manager));

in_prblm->read_prob_mps(lp_mps_name);
std::filesystem::remove(lp_mps_name);
return in_prblm;
}

Expand Down

0 comments on commit 88cb3b2

Please sign in to comment.