Openmp work on mcarlo
Posted by
Joseph Wang-4 on
Oct 20, 2013; 2:01pm
URL: http://quantlib.414.s1.nabble.com/Openmp-work-on-mcarlo-tp14601.html
I've done some more parallelization with openmp and quantlib. I've uploaded the changes to the
https://github.com/joequant/quantlib. The branch openmp has some changes that I've issued a pull-request for. openmp-mcario has some changes that need some more work.
I've gotten the MC to work by generating the paths in a critical situation. Calculating the prices once I have the path is multithreaded, but right now I need to generate the paths in a single thread to make sure that the same sequence is generated.
The big issue right now is that there is a race condition in the calculation of barrier options which is causing one regression test to fail. The problem is that the random number generator is being called in BarrierPathPricer, and since that is run multithread, the sequence that is being pulled will change from run to run based on whether other paths have pulled random numbers already.
I think that fixing this is going to need some code restructuring, but I'd like to get some thoughts as to how to do this. Basically, the interface needs to be changed slightly so that the random numbers are drawn in a fixed order, and that might mean one call to get any additional random numbers in a pricer, which gets called in a critical section, and another to run the pricer with the random numbers.
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev