You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/quantlib/1-overview.md
+22-8Lines changed: 22 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,24 +10,22 @@ layout: learningpathall
10
10
11
11
QuantLib is an open-source C++ library for quantitative finance. It provides tools for pricing, modeling, trading, and risk management, and is widely used as both a development library and a representative financial computing workload.
12
12
13
-
Because QuantLib is a substantial C++ codebase with realistic compute behavior, it is also useful as a benchmark when evaluating cloud systems and processor architectures.
14
-
15
-
In this Learning Path, you will build QuantLib from source and run its benchmark executable on an Arm-based Azure Cobalt virtual machine.
13
+
Because QuantLib is a substantial C++ codebase with realistic compute behavior, it is also useful as a benchmark when evaluating cloud systems and processor architectures. In this Learning Path, you will build QuantLib from source and run its benchmark executable on an Arm-based Azure Cobalt virtual machine.
16
14
17
15
## Why use Azure Cobalt?
18
16
19
17
Azure Cobalt provides Arm64 virtual machines for cloud-native development and performance evaluation. Running QuantLib on Azure Cobalt gives you a practical way to measure how a real C++ finance workload behaves on Arm-based cloud infrastructure.
20
18
21
-
The workflow in this Learning Path uses:
19
+
The workflow uses:
22
20
23
-
- Ubuntu Server 22.04 LTS
21
+
- Ubuntu Server 22.04 LTS (also tested on 24.04 LTS)
24
22
- an Arm64 Azure Cobalt virtual machine
25
23
- a source build of QuantLib
26
24
- QuantLib's benchmark executable for repeatable performance testing
27
25
28
-
## What you'll do
26
+
## Benchmark workflow
29
27
30
-
This Learning Path follows a simple workflow:
28
+
The steps follow a practical benchmark flow:
31
29
32
30
1. Create and connect to an Arm64 Azure Cobalt virtual machine
33
31
2. Install the tools needed to build QuantLib
@@ -39,6 +37,22 @@ This Learning Path follows a simple workflow:
39
37
This Learning Path focuses on building and benchmarking QuantLib on Azure Cobalt. It is not a general introduction to quantitative finance or QuantLib development.
40
38
{{% /notice %}}
41
39
40
+
## What the benchmark tests
41
+
42
+
The benchmark executable runs approximately 85 tests drawn directly from QuantLib's own test suite, covering five domains:
43
+
44
+
-**Equity and FX**: American and European option pricing, Heston and Bates model calibration, convertible bonds, Andreasen-Huge volatility interpolation
-**Credit derivatives**: Nth-to-default pricing and credit default swap calibration
47
+
-**Energy**: Swing options and virtual power plant pricing
48
+
-**Math**: Gaussian quadratures, low-discrepancy sequences, statistics, and special functions
49
+
50
+
Each test has a fixed iteration count built in. Some run once per task, others run hundreds or thousands of times to produce a measurable signal. The `--size` argument multiplies the entire set: `--size=2` runs each test twice, `--size=5` runs it five times, and so on. Doubling `--size` doubles runtime while leaving throughput unchanged — this is the expected weak scaling behavior of the benchmark.
51
+
52
+
The `--nProc` argument controls the number of worker processes. Because QuantLib is not thread-safe, the benchmark uses separate processes rather than threads, coordinated through Boost IPC. Before timing begins, the benchmark runs every test once through the Boost unit test framework to verify correctness — this is what produces the `*** No errors detected` line in the output.
53
+
54
+
**System Throughput** is calculated as `(size × number_of_tests) / total_runtime`. It is the primary metric for comparing runs across thread counts and system configurations.
55
+
42
56
## Benchmarking goals
43
57
44
58
When benchmarking a workload such as QuantLib, the goal is not just to obtain one runtime number. You want a repeatable process that lets you compare runs across system sizes, thread counts, software versions, and compiler settings.
@@ -48,4 +62,4 @@ For that reason, this Learning Path emphasizes:
48
62
- using a known VM configuration
49
63
- keeping the software environment consistent
50
64
- changing one benchmark variable at a time
51
-
- recording commands and results so runs can be reproduced later
65
+
- recording commands and results so runs can be reproduced later
These packages provide the compiler toolchain, build system support, download tools, and Boost libraries needed to build QuantLib.
96
73
97
-
## Optional: use tmux for remote builds
98
-
99
-
If you want the build to continue even if your SSH session disconnects, install tmux:
100
-
101
-
```bash
102
-
sudo apt update
103
-
sudo apt install -y tmux
104
-
tmux
105
-
```
106
-
107
-
## Download QuantLib
108
-
109
-
Set the version and download the release archive:
74
+
Set the QuantLib version as an environment variable, then download the release archive. Keeping the version in `QL_VER` makes later commands easier to repeat or adapt for a newer release:
If your SSH session disconnects during the build, the compile job will be killed. To prevent this, install tmux and start a session before running `make`:
164
+
183
165
```bash
184
-
configure
185
-
Makefile.am
186
-
ql/
187
-
test-suite/
166
+
sudo apt update
167
+
sudo apt install -y tmux
168
+
tmux
188
169
```
189
170
190
-
This confirms that the source code has been unpacked correctly and is ready to configure and build.
171
+
Run the build commands from inside the tmux session. If your connection drops, reconnect to the VM and re-attach with:
172
+
173
+
```bash
174
+
tmux attach
175
+
```
176
+
{{% /notice %}}
177
+
178
+
With your environment set up, move on to the next section to build QuantLib.
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/quantlib/3-build-quantlib.md
+10-15Lines changed: 10 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,15 +6,15 @@ weight: 4
6
6
layout: learningpathall
7
7
---
8
8
9
-
## Configure the QuantLib build
9
+
## Configure the build
10
10
11
-
From the QuantLib source directory:
11
+
Return to the QuantLib source directory. This uses the `QL_VER` variable you exported when downloading the source archive:
12
12
13
13
```bash
14
14
cd~/QuantLib-$QL_VER
15
15
```
16
16
17
-
Run the configure script:
17
+
Run the configure script with benchmark support enabled:
18
18
```bash
19
19
./configure \
20
20
--prefix=/usr/local \
@@ -32,35 +32,30 @@ This configuration:
32
32
- applies CPU-specific optimization flags
33
33
34
34
35
-
## Build QuantLib
35
+
## Install QuantLib
36
36
37
-
Compile using all available cores:
37
+
Compile using all available cores. The `nproc` command returns the number of processing units visible to the VM, so `make -j$(nproc)` keeps the build command portable across VM sizes:
38
38
39
39
```bash
40
40
make -j$(nproc)
41
41
```
42
42
43
43
{{% notice Note %}}
44
-
The build may take 30–45 minutes on smaller instances. Use tmux to avoid losing progress if your SSH session disconnects.
44
+
The build may take 30–45 minutes on the Standard_D4ps_v5. If your SSH session might disconnect, set up tmux before running `make` — see the optional setup steps in the previous section.
45
45
{{% /notice %}}
46
46
47
-
## Install QuantLib
48
-
49
-
After the build completes:
47
+
After the build completes, install QuantLib into `/usr/local` and refresh the dynamic linker cache:
50
48
51
49
```bash
52
50
sudo make install
53
51
sudo ldconfig
54
52
```
55
53
56
-
## Verify the build
54
+
Move to the test suite and check that the benchmark executable was created:
57
55
58
-
Move to the test suite:
59
56
```bash
60
57
cd~/QuantLib-$QL_VER/test-suite
61
-
```
62
-
63
-
Check that the benchmark executable exists:
64
-
```bash
65
58
ls quantlib-benchmark
66
59
```
60
+
61
+
You should see `quantlib-benchmark` in the output. You will use this executable in the next section.
0 commit comments