Skip to content

Commit 28f77bc

Browse files
NathanielVolfangojenkins
authored andcommitted
QPR-12190 -- Fix AMCValuationEngine progress logging. progress numbers were doubled because updateProgress was being called twice, and total number does not need the +1.
1 parent 894220d commit 28f77bc

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

OREAnalytics/orea/engine/amcvaluationengine.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ void runCoreEngine(const boost::shared_ptr<ore::data::Portfolio>& portfolio,
145145
const Size aggDataNumberCreditStates, boost::shared_ptr<ore::analytics::AggregationScenarioData> asd,
146146
boost::shared_ptr<NPVCube> outputCube, boost::shared_ptr<ProgressIndicator> progressIndicator) {
147147

148-
progressIndicator->updateProgress(0, portfolio->size() + 1);
148+
progressIndicator->updateProgress(0, portfolio->size());
149149

150150
// base currency is the base currency of the cam
151151

@@ -297,7 +297,6 @@ void runCoreEngine(const boost::shared_ptr<ore::data::Portfolio>& portfolio,
297297
} catch (const std::exception& e) {
298298
StructuredTradeErrorMessage(trade.second, "Error building trade for AMC simulation", e.what()).log();
299299
}
300-
progressIndicator->updateProgress(++progressCounter, portfolio->size() + 1);
301300
}
302301

303302
timer.stop();
@@ -548,7 +547,7 @@ void runCoreEngine(const boost::shared_ptr<ore::data::Portfolio>& portfolio,
548547
}
549548
}
550549
}
551-
progressIndicator->updateProgress(++progressCounter, portfolio->size() + 1);
550+
progressIndicator->updateProgress(++progressCounter, portfolio->size());
552551
}
553552
timer.stop();
554553
valuationTime += timer.elapsed().wall * 1e-9;

0 commit comments

Comments
 (0)