June 06, 2007

C++ Parallel Processing in Computational Finance, Part I: An Overview of OpenMP www.openmp.org

This blog is the first in a series of three blogs on the application of parallel programming techniques to Computational Finance with special attention being paid to Monte Carlo and PDE techniques. The current blog is meant as an overview of OpenMP at 30,000 feet.

OpenMP is a software product consisting of a collection of compiler directives (called pragmas), library functions and environment variables that developers can use to specify shared-memory parallelism in C. By shared memory we mean that all threads share a single address space and they communicate with each other by writing and reading shared variables. The OpenMP Application Programming Interface (API) is portable between various shared memory models. It has been tailored in such a way to support programs than run in both parallel and sequential modes. It is especially useful for large array-based applications. The main features are:

  • Support for parallelization of loops and iterations
  • Work-sharing constructs and the construction or parallel regions
  • Synchronisation constructs
  • Sharing and privatization of data

We shall discuss how to realize the above features in OpenMP in the next blog.

Many engineering, scientific and computational finance applications are expressed in the form of iterative constructs. In these cases the code consists of various kinds of loops. In general, loops are needed when we need to navigate in (hierarchical) data structures such and vectors, matrices, trees and graphs. Improving the performance of applications that rely heavily on loop constructs is a high priority. Given that many developers will choose to port their serial programs to the equivalent parallel ones using OpenMP we now discuss the forces to be reckoned with when we port loop-based code written for serial machines to parallelized loop code. There are a number of forces to examine that are related to the correctness and efficiency of the parallel code:

. Sequential equivalence: a given program should produce the same results when executed with one thread or with more than one thread. We use a series of transformations that we apply on the loops in order to achieve this end. These are called semantically neutral transformations if they leave the semantics of the program unchanged. A point to note is that due to round-off errors the results from a serial loop may be different from those in the equivalent parallel loop. For example, adding numbers in a loop will give different answers depending on the order in which they are added, for example if we add the numbers serially or in ascending order. This may be unacceptable and we should then decide not to parallelise the loop.

. Incremental parallelism: we parallelise a program by examining one loop at a time, for example. We apply a sequence of incremental transformations and we test the sequential equivalence after each increment. In this way we can be assured of correctness on the one hand and we can measure the performance improvement on the other hand.

. Memory utilization: In order to achieve good performance it is important to note that the way data is accessed (for example, using indexing operators or by dereferencing) is consistent with the memory model of the operating system.

 

Any comments or questions, I’d be happy to answer them.

Daniel

 

June 05, 2007

"Free Seminar Evening – Software Frameworks in C++ and C# for Applications in Computational Finance" by Daniel Duffy

Speaker: Daniel J. Duffy, Datasim

Date and Time: Tuesday 26 June 2007, 18.30 to 20.30

Venue: City of London

Registration: contact Ilona Hooft Graafland

In this seminar we discuss how modern software design techniques are used to create applications in Computational Finance using C++ and C# as the implementation languages. We elaborate on the object-oriented and generic programming features that we employ to create robust and maintainable software systems for a range of derivatives applications such as equities and interest rates. In particular, we concentrate on PDE/FDM and Monte Carlo methods.

Some of the topics to be considered are:

  • Designing architectural Frameworks for financial applications
  • Combing the object-oriented and generic programming models
  • Developing applications for Monte Carlo and PDE
  • Choosing between C++ and C#: creating interoperable applications

Who should attend:

  • Quants and quant developers
  • Managers who wish to gain insight into the software development process in Computational Finance 

Program:

18.00 – 18.30 Refreshments and Registration

18.30 – 19.30 C++ and C# for Computational Finance

19.30 – 1945 short break/refreshments

19.45 – 20.30 Option Pricing with PDE and Monte Carlo

20.30 end of seminar

About the Speaker: view Daniel's profile

May 22, 2007

Is Computational Finance a Multi-Disciplinary Activity? by Daniel Duffy

Software is an indispensable part of most businesses. In the case of computational finance the main challenge is to propose new financial models, define mathematical structures and algorithms for them and then map these algorithms to code. Some of the questions that arise are:

  • How do we define a repeatable process for modelling derivatives in C++ or C#?
  • How do the financial, mathematical and software models link up?
  • What are the requirements for our resulting software products in terms of maintainability, efficiency, functionality and reliability?

These questions are more easily posed than answered for a number of reasons; there are a number of challenges to be resolved. First, the ideal development team consists of quant analysts, developers and other professionals with knowledge of finance, mathematics and numerical analysis. Second, the members of the team need to have a common language (or even several languages) that they can use to promote interoperability. Finally, we need to take account of constraints such as time-to-market, project schedule and budget as well as the requirements on the resulting software product.
The techniques that we can use to promote computational finance as a multidisciplinary activity are:

  • Good mathematical and numerical models that unambiguously define derivatives products
  • Using the de facto modeling language UML (Unified Modeling Language)
  • Using proven Design and System Patterns
  • Using multi-paradigm programming languages that support the object-oriented and generic programming models

I shall be speaking about these software-related issues at the free evening seminar in the City of London on June 26 2007 at Charing Cross. More information and registration (you must register in order to attend), see http://www.datasimfinancial.com/course_detail.php?courseId=13

For queries, please contact Ilona Hooft Graafland at ilona@datasim.nl

Let me know if you have any questions.

Daniel


 

C(omp) Search


WWW
compplusplus.com

C(omp) Community

Could this be you? Thijs van den Berg Dr. Jörg Kienitz Bjarne Stroustrup Dr. Egor Kraev Daniel Duffy Andrea Germani Umberto Cherubini Luigi Ballabio

More Members

Meet the Editorial Team



C(omp) Feeds


Want to know when new posts and features are made available? Sign up to receive email notifications by entering your email address:

Delivered by FeedBurner



Any Comments?

Send in questions for our authors and bloggers: comp@wiley.co.uk



C(omp) Events

1) 13-15 November: Quant Invest 2007
Russell Hotel, London
Key speakers include Sushil Wadhhwani, Paul Wilmott and Deborah Fuhr...

2) 30 November: CCCP Mathematical Finance Conference
Princeton University
Speakers include Paul Glasserman, Peter Carr and Rama Cont.

3) 10-14 December: Risk Minds 2007
President Wilson, Geneva

4) 12-15 December: Quantitative Methods in Finance
Manly Pacific Hotel
Sydney, Australia
Speakers include Mark Joshi

5) January 2008: Distance Learning for Financial Engineers
Computational and Quantitative Finance in C++
Datasim Education BV


Recent Forum Discussions


C(omp) Calendar

June 2008
Sun Mon Tue Wed Thu Fri Sat
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30