Skip to content

Commit 894220d

Browse files
NathanielVolfangojenkins
authored andcommitted
QPR-12190 -- Change ValuationEngine progress numbers from nThreads * nScenarios to nTrades * nScenarios
1 parent 559aec4 commit 894220d

2 files changed

Lines changed: 114 additions & 3 deletions

File tree

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
{ "@timestamp": "2024-01-08T09:05:45.227539", "key": "Running XVA Analytic", "progress": 0, "total": 1 }
2+
{ "@timestamp": "2024-01-08T09:05:45.235627", "key": "XVA: Build Today's Market", "progress": 0, "total": 1 }
3+
{ "@timestamp": "2024-01-08T09:05:45.744550", "key": "XVA: Build Today's Market", "progress": 1, "total": 1 }
4+
{ "@timestamp": "2024-01-08T09:05:46.924022", "key": "XVA: Build Portfolio", "progress": 0, "total": 1 }
5+
{ "@timestamp": "2024-01-08T09:05:46.974646", "key": "XVA: Build Portfolio", "progress": 1, "total": 1 }
6+
{ "@timestamp": "2024-01-08T09:06:06.212893", "key": "XVA: Building cube", "progress": 0, "total": 4000 }
7+
{ "@timestamp": "2024-01-08T09:06:06.419105", "key": "XVA: Building cube", "progress": 80, "total": 8000 }
8+
{ "@timestamp": "2024-01-08T09:06:06.585721", "key": "XVA: Building cube", "progress": 160, "total": 8000 }
9+
{ "@timestamp": "2024-01-08T09:06:06.754242", "key": "XVA: Building cube", "progress": 240, "total": 8000 }
10+
{ "@timestamp": "2024-01-08T09:06:06.927262", "key": "XVA: Building cube", "progress": 320, "total": 8000 }
11+
{ "@timestamp": "2024-01-08T09:06:07.097735", "key": "XVA: Building cube", "progress": 400, "total": 8000 }
12+
{ "@timestamp": "2024-01-08T09:06:07.265772", "key": "XVA: Building cube", "progress": 480, "total": 8000 }
13+
{ "@timestamp": "2024-01-08T09:06:07.430928", "key": "XVA: Building cube", "progress": 560, "total": 8000 }
14+
{ "@timestamp": "2024-01-08T09:06:07.593224", "key": "XVA: Building cube", "progress": 640, "total": 8000 }
15+
{ "@timestamp": "2024-01-08T09:06:07.756003", "key": "XVA: Building cube", "progress": 720, "total": 8000 }
16+
{ "@timestamp": "2024-01-08T09:06:07.927882", "key": "XVA: Building cube", "progress": 800, "total": 8000 }
17+
{ "@timestamp": "2024-01-08T09:06:08.092857", "key": "XVA: Building cube", "progress": 880, "total": 8000 }
18+
{ "@timestamp": "2024-01-08T09:06:08.260418", "key": "XVA: Building cube", "progress": 960, "total": 8000 }
19+
{ "@timestamp": "2024-01-08T09:06:08.429036", "key": "XVA: Building cube", "progress": 1040, "total": 8000 }
20+
{ "@timestamp": "2024-01-08T09:06:08.599520", "key": "XVA: Building cube", "progress": 1120, "total": 8000 }
21+
{ "@timestamp": "2024-01-08T09:06:08.785611", "key": "XVA: Building cube", "progress": 1200, "total": 8000 }
22+
{ "@timestamp": "2024-01-08T09:06:08.948994", "key": "XVA: Building cube", "progress": 1280, "total": 8000 }
23+
{ "@timestamp": "2024-01-08T09:06:09.111624", "key": "XVA: Building cube", "progress": 1360, "total": 8000 }
24+
{ "@timestamp": "2024-01-08T09:06:09.273997", "key": "XVA: Building cube", "progress": 1440, "total": 8000 }
25+
{ "@timestamp": "2024-01-08T09:06:09.438296", "key": "XVA: Building cube", "progress": 1520, "total": 8000 }
26+
{ "@timestamp": "2024-01-08T09:06:09.603267", "key": "XVA: Building cube", "progress": 1600, "total": 8000 }
27+
{ "@timestamp": "2024-01-08T09:06:09.767964", "key": "XVA: Building cube", "progress": 1680, "total": 8000 }
28+
{ "@timestamp": "2024-01-08T09:06:09.934558", "key": "XVA: Building cube", "progress": 1760, "total": 8000 }
29+
{ "@timestamp": "2024-01-08T09:06:10.103993", "key": "XVA: Building cube", "progress": 1840, "total": 8000 }
30+
{ "@timestamp": "2024-01-08T09:06:10.270963", "key": "XVA: Building cube", "progress": 1920, "total": 8000 }
31+
{ "@timestamp": "2024-01-08T09:06:10.434183", "key": "XVA: Building cube", "progress": 2000, "total": 8000 }
32+
{ "@timestamp": "2024-01-08T09:06:10.603801", "key": "XVA: Building cube", "progress": 2080, "total": 8000 }
33+
{ "@timestamp": "2024-01-08T09:06:10.767197", "key": "XVA: Building cube", "progress": 2160, "total": 8000 }
34+
{ "@timestamp": "2024-01-08T09:06:10.934839", "key": "XVA: Building cube", "progress": 2240, "total": 8000 }
35+
{ "@timestamp": "2024-01-08T09:06:11.106440", "key": "XVA: Building cube", "progress": 2320, "total": 8000 }
36+
{ "@timestamp": "2024-01-08T09:06:11.262409", "key": "XVA: Building cube", "progress": 2400, "total": 8000 }
37+
{ "@timestamp": "2024-01-08T09:06:11.423983", "key": "XVA: Building cube", "progress": 2480, "total": 8000 }
38+
{ "@timestamp": "2024-01-08T09:06:11.586912", "key": "XVA: Building cube", "progress": 2560, "total": 8000 }
39+
{ "@timestamp": "2024-01-08T09:06:11.760696", "key": "XVA: Building cube", "progress": 2640, "total": 8000 }
40+
{ "@timestamp": "2024-01-08T09:06:11.924006", "key": "XVA: Building cube", "progress": 2720, "total": 8000 }
41+
{ "@timestamp": "2024-01-08T09:06:12.087112", "key": "XVA: Building cube", "progress": 2800, "total": 8000 }
42+
{ "@timestamp": "2024-01-08T09:06:12.259757", "key": "XVA: Building cube", "progress": 2880, "total": 8000 }
43+
{ "@timestamp": "2024-01-08T09:06:12.423001", "key": "XVA: Building cube", "progress": 2960, "total": 8000 }
44+
{ "@timestamp": "2024-01-08T09:06:12.607189", "key": "XVA: Building cube", "progress": 3040, "total": 8000 }
45+
{ "@timestamp": "2024-01-08T09:06:12.769153", "key": "XVA: Building cube", "progress": 3120, "total": 8000 }
46+
{ "@timestamp": "2024-01-08T09:06:12.945982", "key": "XVA: Building cube", "progress": 3200, "total": 8000 }
47+
{ "@timestamp": "2024-01-08T09:06:13.110941", "key": "XVA: Building cube", "progress": 3280, "total": 8000 }
48+
{ "@timestamp": "2024-01-08T09:06:13.283525", "key": "XVA: Building cube", "progress": 3360, "total": 8000 }
49+
{ "@timestamp": "2024-01-08T09:06:13.469345", "key": "XVA: Building cube", "progress": 3440, "total": 8000 }
50+
{ "@timestamp": "2024-01-08T09:06:13.639874", "key": "XVA: Building cube", "progress": 3520, "total": 8000 }
51+
{ "@timestamp": "2024-01-08T09:06:13.802583", "key": "XVA: Building cube", "progress": 3600, "total": 8000 }
52+
{ "@timestamp": "2024-01-08T09:06:13.959584", "key": "XVA: Building cube", "progress": 3680, "total": 8000 }
53+
{ "@timestamp": "2024-01-08T09:06:14.123947", "key": "XVA: Building cube", "progress": 3760, "total": 8000 }
54+
{ "@timestamp": "2024-01-08T09:06:14.294192", "key": "XVA: Building cube", "progress": 3840, "total": 8000 }
55+
{ "@timestamp": "2024-01-08T09:06:14.455389", "key": "XVA: Building cube", "progress": 3920, "total": 8000 }
56+
{ "@timestamp": "2024-01-08T09:06:14.638877", "key": "XVA: Building cube", "progress": 4000, "total": 8000 }
57+
{ "@timestamp": "2024-01-08T09:06:14.802060", "key": "XVA: Building cube", "progress": 4080, "total": 8000 }
58+
{ "@timestamp": "2024-01-08T09:06:14.964454", "key": "XVA: Building cube", "progress": 4160, "total": 8000 }
59+
{ "@timestamp": "2024-01-08T09:06:15.127957", "key": "XVA: Building cube", "progress": 4240, "total": 8000 }
60+
{ "@timestamp": "2024-01-08T09:06:15.290648", "key": "XVA: Building cube", "progress": 4320, "total": 8000 }
61+
{ "@timestamp": "2024-01-08T09:06:15.459997", "key": "XVA: Building cube", "progress": 4400, "total": 8000 }
62+
{ "@timestamp": "2024-01-08T09:06:15.626239", "key": "XVA: Building cube", "progress": 4480, "total": 8000 }
63+
{ "@timestamp": "2024-01-08T09:06:15.791702", "key": "XVA: Building cube", "progress": 4560, "total": 8000 }
64+
{ "@timestamp": "2024-01-08T09:06:15.959357", "key": "XVA: Building cube", "progress": 4640, "total": 8000 }
65+
{ "@timestamp": "2024-01-08T09:06:16.131004", "key": "XVA: Building cube", "progress": 4720, "total": 8000 }
66+
{ "@timestamp": "2024-01-08T09:06:16.292010", "key": "XVA: Building cube", "progress": 4800, "total": 8000 }
67+
{ "@timestamp": "2024-01-08T09:06:16.466773", "key": "XVA: Building cube", "progress": 4880, "total": 8000 }
68+
{ "@timestamp": "2024-01-08T09:06:16.638950", "key": "XVA: Building cube", "progress": 4960, "total": 8000 }
69+
{ "@timestamp": "2024-01-08T09:06:16.803467", "key": "XVA: Building cube", "progress": 5040, "total": 8000 }
70+
{ "@timestamp": "2024-01-08T09:06:16.969525", "key": "XVA: Building cube", "progress": 5120, "total": 8000 }
71+
{ "@timestamp": "2024-01-08T09:06:17.133563", "key": "XVA: Building cube", "progress": 5200, "total": 8000 }
72+
{ "@timestamp": "2024-01-08T09:06:17.301086", "key": "XVA: Building cube", "progress": 5280, "total": 8000 }
73+
{ "@timestamp": "2024-01-08T09:06:17.467484", "key": "XVA: Building cube", "progress": 5360, "total": 8000 }
74+
{ "@timestamp": "2024-01-08T09:06:17.634711", "key": "XVA: Building cube", "progress": 5440, "total": 8000 }
75+
{ "@timestamp": "2024-01-08T09:06:17.799469", "key": "XVA: Building cube", "progress": 5520, "total": 8000 }
76+
{ "@timestamp": "2024-01-08T09:06:17.961472", "key": "XVA: Building cube", "progress": 5600, "total": 8000 }
77+
{ "@timestamp": "2024-01-08T09:06:18.125814", "key": "XVA: Building cube", "progress": 5680, "total": 8000 }
78+
{ "@timestamp": "2024-01-08T09:06:18.300831", "key": "XVA: Building cube", "progress": 5760, "total": 8000 }
79+
{ "@timestamp": "2024-01-08T09:06:18.463519", "key": "XVA: Building cube", "progress": 5840, "total": 8000 }
80+
{ "@timestamp": "2024-01-08T09:06:18.625530", "key": "XVA: Building cube", "progress": 5920, "total": 8000 }
81+
{ "@timestamp": "2024-01-08T09:06:18.792499", "key": "XVA: Building cube", "progress": 6000, "total": 8000 }
82+
{ "@timestamp": "2024-01-08T09:06:18.956494", "key": "XVA: Building cube", "progress": 6080, "total": 8000 }
83+
{ "@timestamp": "2024-01-08T09:06:19.128495", "key": "XVA: Building cube", "progress": 6160, "total": 8000 }
84+
{ "@timestamp": "2024-01-08T09:06:19.303850", "key": "XVA: Building cube", "progress": 6240, "total": 8000 }
85+
{ "@timestamp": "2024-01-08T09:06:19.466049", "key": "XVA: Building cube", "progress": 6320, "total": 8000 }
86+
{ "@timestamp": "2024-01-08T09:06:19.629839", "key": "XVA: Building cube", "progress": 6400, "total": 8000 }
87+
{ "@timestamp": "2024-01-08T09:06:19.795746", "key": "XVA: Building cube", "progress": 6480, "total": 8000 }
88+
{ "@timestamp": "2024-01-08T09:06:19.962355", "key": "XVA: Building cube", "progress": 6560, "total": 8000 }
89+
{ "@timestamp": "2024-01-08T09:06:20.126194", "key": "XVA: Building cube", "progress": 6640, "total": 8000 }
90+
{ "@timestamp": "2024-01-08T09:06:20.292200", "key": "XVA: Building cube", "progress": 6720, "total": 8000 }
91+
{ "@timestamp": "2024-01-08T09:06:20.456298", "key": "XVA: Building cube", "progress": 6800, "total": 8000 }
92+
{ "@timestamp": "2024-01-08T09:06:20.624694", "key": "XVA: Building cube", "progress": 6880, "total": 8000 }
93+
{ "@timestamp": "2024-01-08T09:06:20.801441", "key": "XVA: Building cube", "progress": 6960, "total": 8000 }
94+
{ "@timestamp": "2024-01-08T09:06:20.964368", "key": "XVA: Building cube", "progress": 7040, "total": 8000 }
95+
{ "@timestamp": "2024-01-08T09:06:21.127694", "key": "XVA: Building cube", "progress": 7120, "total": 8000 }
96+
{ "@timestamp": "2024-01-08T09:06:21.290805", "key": "XVA: Building cube", "progress": 7200, "total": 8000 }
97+
{ "@timestamp": "2024-01-08T09:06:21.456906", "key": "XVA: Building cube", "progress": 7280, "total": 8000 }
98+
{ "@timestamp": "2024-01-08T09:06:21.628845", "key": "XVA: Building cube", "progress": 7360, "total": 8000 }
99+
{ "@timestamp": "2024-01-08T09:06:21.795674", "key": "XVA: Building cube", "progress": 7440, "total": 8000 }
100+
{ "@timestamp": "2024-01-08T09:06:21.955681", "key": "XVA: Building cube", "progress": 7520, "total": 8000 }
101+
{ "@timestamp": "2024-01-08T09:06:22.118116", "key": "XVA: Building cube", "progress": 7600, "total": 8000 }
102+
{ "@timestamp": "2024-01-08T09:06:22.285424", "key": "XVA: Building cube", "progress": 7680, "total": 8000 }
103+
{ "@timestamp": "2024-01-08T09:06:22.453902", "key": "XVA: Building cube", "progress": 7760, "total": 8000 }
104+
{ "@timestamp": "2024-01-08T09:06:22.617880", "key": "XVA: Building cube", "progress": 7840, "total": 8000 }
105+
{ "@timestamp": "2024-01-08T09:06:22.777885", "key": "XVA: Building cube", "progress": 7920, "total": 8000 }
106+
{ "@timestamp": "2024-01-08T09:06:22.938593", "key": "XVA: Building cube", "progress": 8000, "total": 8000 }
107+
{ "@timestamp": "2024-01-08T09:06:24.391321", "key": "XVA: Aggregation", "progress": 0, "total": 1 }
108+
{ "@timestamp": "2024-01-08T09:06:24.867227", "key": "XVA: Aggregation", "progress": 1, "total": 1 }
109+
{ "@timestamp": "2024-01-08T09:06:24.869253", "key": "XVA: Reports", "progress": 0, "total": 1 }
110+
{ "@timestamp": "2024-01-08T09:06:24.924618", "key": "XVA: Reports", "progress": 1, "total": 1 }
111+
{ "@timestamp": "2024-01-08T09:06:24.926582", "key": "Running XVA Analytic", "progress": 1, "total": 1 }

OREAnalytics/orea/engine/valuationengine.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,13 +171,13 @@ void ValuationEngine::buildCube(const boost::shared_ptr<data::Portfolio>& portfo
171171

172172
cpu_timer timer;
173173
cpu_timer loopTimer;
174+
Size nTrades = trades.size();
174175

175-
// We call Cube::samples() each time her to allow for dynamic stopping times
176+
// We call Cube::samples() each time here to allow for dynamic stopping times
176177
// e.g. MC convergence tests
177178
for (Size sample = 0; sample < (dryRun ? std::min<Size>(1, outputCube->samples()) : outputCube->samples());
178179
++sample) {
179180
TLOG("ValuationEngine: apply scenario sample #" << sample);
180-
updateProgress(sample, outputCube->samples());
181181

182182
for (auto& [tradeId, trade] : portfolio->trades())
183183
trade->instrument()->reset();
@@ -260,7 +260,7 @@ void ValuationEngine::buildCube(const boost::shared_ptr<data::Portfolio>& portfo
260260
}
261261
}
262262

263-
updateProgress(outputCube->samples(), outputCube->samples());
263+
updateProgress(outputCube->samples() * nTrades, outputCube->samples() * nTrades);
264264
loopTimer.stop();
265265
LOG("ValuationEngine completed: loop " << setprecision(2) << loopTimer.format(2, "%w") << " sec, "
266266
<< "pricing " << pricingTime << " sec, "

0 commit comments

Comments
 (0)