diff --git a/src/api/API.cpp b/src/api/API.cpp index 62e599c166..60fc9d8471 100644 --- a/src/api/API.cpp +++ b/src/api/API.cpp @@ -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(); 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_, diff --git a/src/solver/application/application.cpp b/src/solver/application/application.cpp index 2d1695bcf0..43dfa3368d 100644 --- a/src/solver/application/application.cpp +++ b/src/solver/application/application.cpp @@ -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()) { @@ -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();