Skip to content

Commit

Permalink
Move call to saveAboutTheStudy to avoid output dir duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
flomnes committed Dec 31, 2024
1 parent 5ccf108 commit 3787ea6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions src/api/API.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,19 @@ SimulationResults APIInternal::execute(
auto& parameters = study_->parameters;
parameters.optOptions = optOptions;

study_->folderOutput = output;

Benchmarking::DurationCollector durationCollector;
Benchmarking::OptimizationInfo optimizationInfo;
auto ioQueueService = std::make_shared<Yuni::Job::QueueService>();
ioQueueService->maximumThreadCount(1);
ioQueueService->start();

study_->folderOutput = output;
auto resultWriter = Solver::resultWriterFactory(parameters.resultFormat,
study_->folderOutput,
ioQueueService,
durationCollector);
study_->saveAboutTheStudy(*resultWriter);

SimulationObserver simulationObserver;

optimizationInfo = simulationRun(*study_,
Expand Down
6 changes: 3 additions & 3 deletions src/solver/application/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,6 @@ void Application::readDataForTheStudy(Data::StudyLoadOptions& options)

Antares::Solver::initializeSignalHandlers(resultWriter);

// Save about-the-study files (comments, notes, etc.)
study.saveAboutTheStudy(*resultWriter);

// Name of the simulation (again, if the value has been overwritten)
if (!pSettings.simulationName.empty())
{
Expand Down Expand Up @@ -375,6 +372,9 @@ void Application::execute()
return;
}

// Save about-the-study files (comments, notes, etc.)
pStudy->saveAboutTheStudy(*resultWriter);

SystemMemoryLogger memoryReport;
memoryReport.interval(1000 * 60 * 5); // 5 minutes
memoryReport.start();
Expand Down

0 comments on commit 3787ea6

Please sign in to comment.