Skip to content

Commit eb9d47f

Browse files
author
jenkins
committed
git subrepo pull (merge) ore
subrepo: subdir: "ore" merged: "45e306ea90" upstream: origin: "git@gitlab.acadiasoft.net:qs/ore.git" branch: "master" commit: "8144588578" git-subrepo: version: "0.4.6" origin: "https://github.com/ingydotnet/git-subrepo" commit: "110b9eb"
2 parents 16e971f + 8144588 commit eb9d47f

69 files changed

Lines changed: 30543 additions & 318 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Docker/Dockerfile-Boost

Lines changed: 0 additions & 27 deletions
This file was deleted.

Docker/Dockerfile-ORE

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,51 @@
1-
# syntax = nexus3.acadiasoft.net:4445/docker/dockerfile:experimental
2-
ARG quantlib_version=${QL_TAG}
3-
ARG cmake_build_type=${CMAKE_BUILD_TYPE}
4-
FROM env_quantlib:${quantlib_version}
1+
# syntax = docker/dockerfile:1.2
2+
ARG debian_tag
3+
FROM debian:${debian_tag}
54

65
MAINTAINER Quaternion Risk Management
7-
LABEL Description="Build ORE and add to the QuantLib build environment"
6+
LABEL Description="Build QuantLib and add to the Boost build environment"
87

98
# Argument for number of cores to use while building
109
ARG num_cores
1110

12-
# install Eigen
13-
RUN apt-get install -f -y libeigen3-dev
11+
# Argument that chooses cmake build type
12+
ARG cmake_build_type
1413

15-
# Copy ORE sources for libs and app
14+
RUN apt-get update \
15+
&& DEBIAN_FRONTEND=noninteractive apt-get install -y build-essential libbz2-dev autoconf libtool cmake ninja-build zlib1g-dev opencl-headers ocl-icd-opencl-dev libboost-all-dev doxygen graphviz ccache libeigen3-dev \
16+
&& apt-get clean
17+
18+
# Exclusions are performed by .dockerignore
19+
COPY QuantLib /ore/QuantLib
20+
COPY CMakeLists.txt /ore/CMakeLists.txt
21+
COPY QuantLib /ore/QuantLib
1622
COPY QuantExt /ore/QuantExt
1723
COPY OREData /ore/OREData
1824
COPY OREAnalytics /ore/OREAnalytics
1925
COPY App /ore/App
2026
COPY ThirdPartyLibs /ore/ThirdPartyLibs
2127
COPY ORETest /ore/ORETest
2228
COPY cmake /ore/cmake
23-
COPY Docker /ore/Docker
2429

25-
# Need the dos2unix all if building from Windows because the shell
26-
# scripts fail if there are CRLF present in the files
30+
ENV PATH="/usr/lib/ccache:$PATH"
31+
ENV CCACHE_DIR="/ccache"
32+
ENV CCACHE_MAXSIZE="10G"
33+
# needed if QL_USE_PCH is ON
34+
#ENV CCACHE_SLOPPINESS="pch_defines,time_macros,pch_defines,time_macros,include_file_mtime,include_file_ctim"
35+
36+
# - add -fpch-preprocess to CMAKE_CXX_FLAGS when QL_USE_PCH is set to ON
2737
RUN cd /ore \
28-
&& find -regex ".*\.\(sh\|in\|ac\|am\)" -exec dos2unix {} ';' \
29-
&& cp Docker/CMakeLists_ORE.txt CMakeLists.txt \
3038
&& mkdir -p build.ore && cd build.ore \
31-
&& cmake .. -DQL_USE_PCH=OFF -DORE_BUILD_DOC=ON -DCMAKE_BUILD_TYPE=${cmake_build_type} -DCMAKE_CXX_FLAGS="-mavx2" -DORE_ENABLE_PARALLEL_UNIT_TEST_RUNNER=ON -DORE_USE_ZLIB=ON -D ORE_ENABLE_OPENCL=ON
32-
39+
&& cmake .. -GNinja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DQL_USE_PCH=OFF -DORE_BUILD_DOC=ON -DCMAKE_BUILD_TYPE=${cmake_build_type} -DCMAKE_CXX_FLAGS="-D BOOST_ENABLE_ASSERT_HANDLER -mavx2" -DQL_ENABLE_SESSIONS=ON -DQL_ENABLE_PARALLEL_UNIT_TEST_RUNNER=ON -DQL_BUILD_EXAMPLES=OFF -DQL_BUILD_BENCHMARK=OFF -DORE_ENABLE_PARALLEL_UNIT_TEST_RUNNER=ON -DORE_USE_ZLIB=ON -D ORE_ENABLE_OPENCL=ON
40+
3341
WORKDIR /ore/build.ore
3442
RUN --mount=type=cache,target=/ccache/ ccache -z \
35-
&& make -j ${num_cores} \
43+
&& cmake --build . -- -j ${num_cores} install \
3644
&& ccache -s \
37-
&& make install \
3845
&& make doc_quantext 2>&1 | grep -v "ignoring unsupported tag" \
3946
&& make doc_ored 2>&1 | grep -v "ignoring unsupported tag" \
4047
&& make doc_orea 2>&1 | grep -v "ignoring unsupported tag"
41-
48+
4249
WORKDIR /
4350
RUN mkdir -p html \
4451
&& mkdir /html/ored && cp -r /ore/OREData/doc/html/* /html/ored \

Docker/Dockerfile-QuantLib

Lines changed: 0 additions & 46 deletions
This file was deleted.

Docker/Dockerfile-multistage

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,6 @@ ARG num_cores
88
ARG cmake_build_type
99

1010
COPY CMakeLists.txt /ore/CMakeLists.txt
11-
COPY .clang-format /ore/.clang-format
12-
COPY .gitignore /ore/.gitignore
13-
COPY CMakePresets.json /ore/CMakePresets.json
14-
COPY News.txt /ore/News.txt
15-
COPY README.md /ore/README.md
16-
COPY license.txt /ore/license.txt
17-
COPY licenseheader.txt /ore/licenseheader.txt
18-
COPY ore.props /ore/ore.props
19-
COPY runCmakeVS.cmd /ore/runCmakeVS.cmd
2011
COPY QuantLib /ore/QuantLib
2112
COPY QuantExt /ore/QuantExt
2213
COPY OREData /ore/OREData
@@ -25,11 +16,6 @@ COPY App /ore/App
2516
COPY ThirdPartyLibs /ore/ThirdPartyLibs
2617
COPY ORETest /ore/ORETest
2718
COPY cmake /ore/cmake
28-
COPY Docker /ore/Docker
29-
COPY Docs ore/Docs
30-
COPY Examples ore/Examples
31-
COPY Tools ore/Tools
32-
COPY xsd ore/xsd
3319

3420
RUN apt-get update && apt-get upgrade -y \
3521
&& apt-get install -f -y build-essential libbz2-dev cmake ninja-build zlib1g-dev libboost-all-dev opencl-headers ocl-icd-opencl-dev

Docker/DockerfileRunORE.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#!/bin/sh
22

3-
docker-compose --env-file Docker/.env -f Docker/docker-compose-boost.yml build || exit 1
4-
COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker-compose --env-file Docker/.env -f Docker/docker-compose-quantlib.yml build || exit 1
53
COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker-compose --env-file Docker/.env -f Docker/docker-compose-ore.yml build || exit 1
64
docker-compose --env-file Docker/.env -f Docker/docker-compose-test.yml build || exit 1
7-
COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker-compose --env-file Docker/.env -f Docker/docker-compose-ore-app.yml build || exit 1
5+
COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker-compose --env-file Docker/.env -f Docker/docker-compose-ore-app.yml build || exit 1

Docker/docker-compose-boost.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.

Docker/docker-compose-ore.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@ services:
55
image: env_ore:${ORE_TAG}
66
cap_drop:
77
- NET_RAW
8-
volumes:
9-
- /home/shared/cache/ore_env:/ccache
108
build:
119
context: ../
1210
dockerfile: Docker/Dockerfile-ORE
1311
args:
14-
- quantlib_version=${QL_TAG}
12+
- debian_tag=${DEBIAN_TAG}
1513
- cmake_build_type=${CMAKE_BUILD_TYPE}
1614
- num_cores=${NUM_CORES}

Docker/docker-compose-quantlib.yml

Lines changed: 0 additions & 15 deletions
This file was deleted.

Docs/UserGuide/userguide.tex

Lines changed: 76 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@
132132
\title{ORE User Guide}
133133
%\author{Quaternion Risk Management Ltd.}
134134
%\author{Acadia Inc.}
135-
\date{16 October 2023}
135+
\date{15 January 2024}
136136
\maketitle
137137

138138
\newpage
@@ -156,6 +156,7 @@ \section*{Document History}
156156
31 March 2023 & Acadia & updates for release 9\\
157157
16 June 2023 & Acadia & updates for release 10\\
158158
16 October 2023 & Acadia & updates for release 11\\
159+
15 January 2024 & Acadia & updates for release 12\\
159160
\hline
160161
\end{supertabular}
161162
\end{center}
@@ -1257,6 +1258,16 @@ \section{Examples}\label{sec:examples}
12571258
\hline
12581259
52 & Scripted Trades \\
12591260
\hline
1261+
53 & Curve Building using FRAs tailored to Central Bank Meeting Dates\\
1262+
\hline
1263+
54 & Scripted Trade Exposure with AMC: Bermudan Swaption and LPI Swap \\
1264+
\hline
1265+
55 & Scripted Trade Exposure with AMC: Fx TaRF \\
1266+
\hline
1267+
56 & CVA Sensitivity using AAD \\
1268+
\hline
1269+
57 & Base Scenario Analytic \\
1270+
\hline
12601271
\end{tabular}
12611272
\caption{ORE examples.}
12621273
\label{tab_0}
@@ -3537,12 +3548,75 @@ \subsection{Scripted Trade}% Example 52
35373548
significantly more versatile, more examples and scripts to follow.
35383549

35393550
%--------------------------------------------------------------------
3540-
\subsection{GBP OIS Curve using MPC Swaps}% Example 53
3551+
\subsection{Curve Building around Central Bank Meeting Dates}% Example 53
35413552
\label{example:53}
35423553
%--------------------------------------------------------------------
35433554

35443555
This example demonstrates the build of a GBP OIS curve using MPC Swaps at the short end.
35453556

3557+
%--------------------------------------------------------------------
3558+
\subsection{Scripted Trade Exposure with AMC: Bermudan Swaption and LPI Swap}% Example 54
3559+
\label{example:54}
3560+
%--------------------------------------------------------------------
3561+
3562+
This example demonstrates exposure simulation using AMC for selected scripted trade types
3563+
\begin{itemize}
3564+
\item Bermudan Swaption
3565+
\item LPI Swap
3566+
\end{itemize}
3567+
Both payoffs are defined in {\tt scriptlibrary.xml} which is referenced in {\tt portfolio.xml}. \\
3568+
3569+
To enable the AMC processing requires the following highlighted settings in {\tt ore.xml}.
3570+
3571+
\begin{minted}[fontsize=\scriptsize]{xml}
3572+
<Analytic type="simulation">
3573+
<Parameter name="active">Y</Parameter>
3574+
<!-- Set to Y to trigger AMC processing -->
3575+
<Parameter name="amc">Y</Parameter>
3576+
<Parameter name="simulationConfigFile">simulation.xml</Parameter>
3577+
<Parameter name="pricingEnginesFile">pricingengine.xml</Parameter>
3578+
<!-- Specify a separate pricing engine file for AMC engines -->
3579+
<Parameter name="amcPricingEnginesFile">pricingengine\_amc.xml</Parameter>
3580+
<!-- Specify trade types to be covered by the AMC processing -->
3581+
<Parameter name="amcTradeTypes">ScriptedTrade</Parameter>
3582+
<Parameter name="baseCurrency">EUR</Parameter>
3583+
<Parameter name="storeScenarios">N</Parameter>
3584+
<Parameter name="cubeFile">cube.csv.gz</Parameter>
3585+
<Parameter name="aggregationScenarioDataFileName">scenariodata.csv.gz</Parameter>
3586+
<Parameter name="aggregationScenarioDataDump">scenariodata.csv</Parameter>
3587+
</Analytic>
3588+
\end{minted}
3589+
3590+
Note that ORE can handle a mix of trades covered by AMC simulation and covered by ``classic'' simulation.
3591+
The respective NPV cubes are combined before generating results such as exposures or XVAs.
3592+
3593+
%--------------------------------------------------------------------
3594+
\subsection{Scripted Trade Exposure with AMC: Target Redemption Forward}% Example 55
3595+
\label{example:55}
3596+
%--------------------------------------------------------------------
3597+
3598+
This example demonstrates exposure simulation and XVA for another scripted product, an
3599+
FX Target Redemption Forward (TaRF). In contrast to the cases presented above, you won't see
3600+
the payoff script library in the Input folder, nor is the script embedded into the trade XML file.
3601+
The trade type in this case is {\tt FxTARF} which has its own implementation in OREData/ored/portfolio/tarf.xpp
3602+
and a separate trade schema. However, the scipted trade framework is used under the hood, and the payoff
3603+
script is embedded into the C++ code in OREData/ored/portfolio/tarf.cpp.
3604+
3605+
%--------------------------------------------------------------------
3606+
\subsection{CVA Sensitivity using AD}% Example 56
3607+
\label{example:56}
3608+
%--------------------------------------------------------------------
3609+
3610+
This example demonstrates a prototype CVA sensitivity calculation applying Adjoint Algorithmic Differentiation (AAD)
3611+
to a Swap instrument represented as scripted trade.
3612+
3613+
%--------------------------------------------------------------------
3614+
\subsection{Base Scenario Analytic}% Example 57
3615+
\label{example:57}
3616+
%--------------------------------------------------------------------
3617+
3618+
Demonstration of the {\tt Scenario} analytic which has been added to export the simulation market's base scenario
3619+
as a file.
35463620

35473621
\clearpage
35483622
%========================================================

0 commit comments

Comments
 (0)