Skip to content

Commit 5d3a2f2

Browse files
committed
Merge branch 'github_maintenance' into 'master'
Github maintenance See merge request qs/ore-github!8
2 parents df0065b + 4f11be0 commit 5d3a2f2

42 files changed

Lines changed: 1162 additions & 13507 deletions

Some content is hidden

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

Docker/.env

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
DEBIAN_TAG=11.7
2-
#
2+
33
# it's recommended to include CMAKE_BUILD_TYPE and BOOST_VARIANT in QL_TAG, ORE_TAG, BOOST_TAG
44
# to distinguish a release build from a debug build
5-
#
5+
66
QL_TAG=1.30_00d2fced87
77
ORE_TAG=latest
88
BOOST_TAG=1.78.0
99
BOOST_DIR=1_78_0
10-
#
10+
1111
# debug or release
12-
#
12+
1313
BOOST_VARIANT=release
14-
#
14+
1515
# Release, RelWithDebInfo, Debug
16-
#
16+
1717
CMAKE_BUILD_TYPE=Release
1818
NUM_CORES=16

Docker/Dockerfile-ORE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ RUN cd /ore \
2828
&& find -regex ".*\.\(sh\|in\|ac\|am\)" -exec dos2unix {} ';' \
2929
&& cp Docker/CMakeLists_ORE.txt CMakeLists.txt \
3030
&& mkdir -p build.ore && cd build.ore \
31-
&& cmake .. -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
31+
&& cmake .. -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
3232

3333
WORKDIR /ore/build.ore
3434
RUN --mount=type=cache,target=/ccache/ make -j ${num_cores} \

Docker/Dockerfile-multistage

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
ARG debian_tag
2+
3+
# ore build
4+
5+
FROM debian:${debian_tag} as orebuild
6+
7+
ARG num_cores
8+
ARG cmake_build_type
9+
10+
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
20+
COPY QuantLib /ore/QuantLib
21+
COPY QuantExt /ore/QuantExt
22+
COPY OREData /ore/OREData
23+
COPY OREAnalytics /ore/OREAnalytics
24+
COPY App /ore/App
25+
COPY ThirdPartyLibs /ore/ThirdPartyLibs
26+
COPY ORETest /ore/ORETest
27+
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
33+
34+
RUN apt-get update && apt-get upgrade -y \
35+
&& apt-get install -f -y build-essential libbz2-dev cmake ninja-build zlib1g-dev libboost-all-dev opencl-headers ocl-icd-opencl-dev
36+
37+
RUN cd / \
38+
&& mkdir -p build_ore && cd build_ore \
39+
&& cmake /ore -GNinja -DCMAKE_BUILD_TYPE=${cmake_build_type} -DORE_BUILD_DOC=OFF -DORE_USE_ZLIB=ON -DQL_ENABLE_SESSIONS=ON -DORE_ENABLE_OPENCL=ON
40+
41+
RUN cd /build_ore \
42+
&& cmake --build . -- -j${num_cores} install
43+
44+
RUN ldconfig
45+
46+
# ore
47+
48+
FROM debian:${debian_tag} as ore
49+
50+
COPY --from=orebuild /usr/local/include /usr/local/include
51+
COPY --from=orebuild /usr/local/lib/ /usr/local/lib
52+
COPY --from=orebuild /usr/local/bin/ /usr/local/bin
53+
COPY --from=orebuild /ore /ore
54+
COPY --from=orebuild /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu
55+
56+
RUN ldconfig
57+
58+
CMD bash
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
docker-compose --env-file Docker/.env -f Docker/docker-compose-multistage.yml build
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: '3'
2+
3+
services:
4+
ore_app:
5+
image: ore_app:${ORE_TAG}
6+
build:
7+
context: ../
8+
dockerfile: Docker/Dockerfile-multistage
9+
args:
10+
- debian_tag=${DEBIAN_TAG}
11+
- num_cores=${NUM_CORES}
12+
- cmake_build_type=${CMAKE_BUILD_TYPE}

Docs/UserGuide/allowablevalues.tex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ \subsection{Allowable Values}
4646
\emph{P, Preceding, PRECEDING}\\
4747
\emph{MP, ModifiedPreceding, Modified Preceding, MODIFIEDP}\\
4848
\emph{U, Unadjusted, INDIFF } \\
49+
\emph{HMMF, HalfMonthModifiedFollowing, HalfMonthMF, Half Month Modified Following, HALFMONTHMF}\\
4950
\emph{NEAREST } (takes future date in case of equal distance) } \\ \hline
5051
\caption{Allowable Values for Roll Conventions}
5152
\label{tab:convention}

OREAnalytics/orea/app/analytics/pricinganalytic.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,14 @@ void PricingAnalyticImpl::runAnalytic(
226226
inputs_->sensiThreshold());
227227
analytic()->reports()[type]["sensitivity_scenario"] = scenarioReport;
228228

229+
auto simmSensitivityConfigReport = boost::make_shared<InMemoryReport>();
230+
ReportWriter(inputs_->reportNaString())
231+
.writeSensitivityConfigReport(*simmSensitivityConfigReport,
232+
sensiAnalysis->scenarioGenerator()->shiftSizes(),
233+
sensiAnalysis->scenarioGenerator()->baseValues(),
234+
sensiAnalysis->scenarioGenerator()->keyToFactor());
235+
analytic()->reports()[type]["sensitivity_config"] = simmSensitivityConfigReport;
236+
229237
if (inputs_->parSensi()) {
230238
LOG("Sensi analysis - par conversion");
231239
parAnalysis->computeParInstrumentSensitivities(sensiAnalysis->simMarket());

OREAnalytics/orea/app/oreapp.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ class OREApp {
7575

7676
//! time for executing run(...) in seconds
7777
Real getRunTime();
78+
79+
std::string version() {
80+
return std::string(OPEN_SOURCE_RISK_VERSION);
81+
}
7882

7983
protected:
8084
virtual void analytics();

OREAnalytics/orea/engine/parsensitivityanalysis.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,12 @@ void ParSensitivityAnalysis::computeParInstrumentSensitivities(const boost::shar
738738
boost::shared_ptr<ShiftScenarioGenerator> scenarioGenerator =
739739
boost::dynamic_pointer_cast<ShiftScenarioGenerator>(simMarketScenGen);
740740

741+
struct SimMarketResetter {
742+
SimMarketResetter(boost::shared_ptr<SimMarket> simMarket) : simMarket_(simMarket) {}
743+
~SimMarketResetter() { simMarket_->reset(); }
744+
boost::shared_ptr<SimMarket> simMarket_;
745+
} simMarketResetter(simMarket);
746+
741747
simMarket->reset();
742748
scenarioGenerator->reset();
743749
simMarket->update(asof_);

OREAnalytics/orea/engine/valuationengine.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@ void ValuationEngine::buildCube(const boost::shared_ptr<data::Portfolio>& portfo
6868
boost::shared_ptr<analytics::NPVCube> outputCptyCube,
6969
vector<boost::shared_ptr<CounterpartyCalculator>> cptyCalculators, bool dryRun) {
7070

71+
struct SimMarketResetter {
72+
SimMarketResetter(boost::shared_ptr<SimMarket> simMarket) : simMarket_(simMarket) {}
73+
~SimMarketResetter() { simMarket_->reset(); }
74+
boost::shared_ptr<SimMarket> simMarket_;
75+
} simMarketResetter(simMarket_);
76+
7177
LOG("Build cube with mporStickyDate=" << mporStickyDate << ", dryRun=" << std::boolalpha << dryRun);
7278

7379
QL_REQUIRE(portfolio->size() > 0, "ValuationEngine: Error portfolio is empty");
@@ -265,7 +271,6 @@ void ValuationEngine::buildCube(const boost::shared_ptr<data::Portfolio>& portfo
265271
}
266272
}
267273

268-
simMarket_->reset();
269274
updateProgress(outputCube->samples(), outputCube->samples());
270275
loopTimer.stop();
271276
LOG("ValuationEngine completed: loop " << setprecision(2) << loopTimer.format(2, "%w") << " sec, "

0 commit comments

Comments
 (0)