@@ -171,7 +171,10 @@ void CrifAnalyticImpl::setUpConfigurations() {
171171 QL_REQUIRE (analytic ()->configurations ().simMarketParams , " CrifAnalytic: simMarketParams not set" );
172172 QL_REQUIRE (analytic ()->configurations ().sensiScenarioData , " CrifAnalytic: sensiScenarioData not set" );
173173 QL_REQUIRE (analytic ()->configurations ().todaysMarketParams , " CrifAnalytic: todaysMarketParams not set" );
174-
174+
175+ inputs_->loadParameter <bool >(applySimmExemptions_, " crif" , " applySimmExemptions" , false ,
176+ std::function<bool (const string&)>(parseBool));
177+
175178 setGenerateAdditionalResults (true );
176179}
177180
@@ -208,15 +211,19 @@ void CrifAnalyticImpl::runAnalytic(const QuantLib::ext::shared_ptr<ore::data::In
208211 analytic ()->addReport (LABEL, " npv_no_simm_exemptions" , npvWithoutReport);
209212
210213 std::set<std::string> removedTrades, modifiedTrades;
211- analytic ()->startTimer (" applySimmExemptions()" );
212- try {
213- std::tie (removedTrades, modifiedTrades) =
214- applySimmExemptions (*analytic ()->portfolio (), engineFactory (), crifAnalytic->simmExemptionOverrides (),
215- inputs_->useAtParCouponsTrades ());
216- } catch (std::exception& e) {
217- QL_FAIL (e.what ());
214+ if (applySimmExemptions_) {
215+ analytic ()->startTimer (" applySimmExemptions()" );
216+ try {
217+ std::tie (removedTrades, modifiedTrades) =
218+ applySimmExemptions (*analytic ()->portfolio (), engineFactory (), crifAnalytic->simmExemptionOverrides (),
219+ inputs_->useAtParCouponsTrades ());
220+ } catch (std::exception& e) {
221+ QL_FAIL (e.what ());
222+ }
223+ analytic ()->stopTimer (" applySimmExemptions()" );
224+ } else {
225+ WLOG (" Skipping application of SIMM exemptions as applySimmExemptions is set to false" );
218226 }
219- analytic ()->stopTimer (" applySimmExemptions()" );
220227
221228 // If we have an empty portfolio, then quit the CRIF analytic
222229 if (analytic ()->portfolio ()->size () == 0 ) {
0 commit comments