diff --git a/src/libs/antares/study/parallel-years.cpp b/src/libs/antares/study/parallel-years.cpp index a5a10fb200..11cd0ba1f8 100644 --- a/src/libs/antares/study/parallel-years.cpp +++ b/src/libs/antares/study/parallel-years.cpp @@ -220,13 +220,12 @@ void SetsOfParallelYearCalculator::computeRawNbParallelYear() try { - forcedNbOfParallelYears_ = numberOfMCYearThreads.at(p.nbCores.ncMode); + rawNbOfParallelYears_ = numberOfMCYearThreads.at(p.nbCores.ncMode); } catch(const std::out_of_range& e) { - logs.fatal() << "Simulation cores level not correct : " << (int)p.nbCores.ncMode; + logs.fatal() << "Simulation cores level not correct : " << static_cast(p.nbCores.ncMode); } - } @@ -244,7 +243,7 @@ void SetsOfParallelYearCalculator::limitNbOfParallelYearsbyMinRefreshSpan() if ((p.timeSeriesToGenerate & timeSeriesThermal) && (p.timeSeriesToRefresh & timeSeriesThermal)) TSlimit = std::min(p.refreshIntervalThermal, TSlimit); - forcedNbOfParallelYears_ = std::min({p.nbYears, TSlimit, forcedNbOfParallelYears_}); + forcedNbOfParallelYears_ = std::min({p.nbYears, TSlimit, rawNbOfParallelYears_}); } bool SetsOfParallelYearCalculator::isRefreshNeededForCurrentYear(uint y) @@ -370,7 +369,6 @@ void SetsOfParallelYearCalculator::buildSetsOfParallelYears() // End of loop over years } - } diff --git a/src/libs/antares/study/parallel-years.h b/src/libs/antares/study/parallel-years.h index de23b9bfea..b81c5e0de0 100644 --- a/src/libs/antares/study/parallel-years.h +++ b/src/libs/antares/study/parallel-years.h @@ -121,6 +121,11 @@ class SetsOfParallelYearCalculator return forcedNbOfParallelYears_; } + [[nodiscard]] uint getRawNbParallelYearsForGUI() const + { + return rawNbOfParallelYears_; + } + [[nodiscard]] uint getMinNbParallelYearsForGUI() const { return computeMinNbParallelYears(); @@ -155,6 +160,7 @@ class SetsOfParallelYearCalculator bool forceParallel_; bool enableParallel_; uint forcedNbOfParallelYears_; + uint rawNbOfParallelYears_; uint number_of_cores_; bool thermalTSRefresh_; Parameters& p; diff --git a/src/libs/antares/study/study.cpp b/src/libs/antares/study/study.cpp index e0d9f9dbde..a53d8c8560 100644 --- a/src/libs/antares/study/study.cpp +++ b/src/libs/antares/study/study.cpp @@ -226,16 +226,18 @@ uint64 Study::memoryUsage() const void Study::getNumberOfCores(const bool forceParallel, const bool enableParallel, const uint nbYearsParallelForced) { - TempAreaListHolder holder{}; + TempAreaListHolder holder; bool thermalTSRefresh = holder.checkThermalTSGeneration(folderInput); SetsOfParallelYearCalculator setsBuilder(forceParallel, enableParallel, - nbYearsParallelForced, Yuni::System::CPU::Count(), + nbYearsParallelForced, + Yuni::System::CPU::Count(), thermalTSRefresh, parameters); // For GUI minNbYearsInParallel_save = setsBuilder.getMinNbParallelYearsForGUI(); + nbYearsParallelRaw = setsBuilder.getRawNbParallelYearsForGUI(); maxNbYearsInParallel_save = setsBuilder.getForcedNbOfParallelYears(); // For the solver