|
From: Luigi B. <lui...@gm...> - 2022-01-07 09:54:49
|
Oops — it looks Vamshi was not included. On Fri, Jan 7, 2022 at 10:06 AM Luigi Ballabio <lui...@gm...> wrote: > Yes, by looking at the git logs most of the pragmas were commented out in > commit ed061df111; the one in lattice.hpp was restored in ec35ebde89. > This was in 2014, so probably with ancient versions of both the compilers > and openmp. > Vamshi, if you want to have a look, it would be useful to have an opinion > from someone that actually knows openmp. > > Luigi > > > On Thu, Jan 6, 2022 at 9:25 PM Peter Caspers <pca...@gm...> > wrote: > >> Hi, >> >> in the past we saw that a "blind" usage of open mp does more harm than >> good, see >> >> https://sourceforge.net/p/quantlib/mailman/message/32461242/ >> >> so we removed most of the pragmas. It seems that the omp pragma >> survived in lattice.hpp contrary to what is said in the mail thread, I >> don't remember if there is a good reason for that. Maybe something to >> review at some point. There are two more places, zabrsmilesection.hpp >> and gaussian1dswaptionengine.cpp where I think enabling openmp gives >> _some_ speedup although it's far from what you would hope for if I >> remember correctly. >> >> grep --include="*.?pp" -nH --null -r -e "pragma omp" * >> ql/experimental/volatility/zabrsmilesection.hpp209:#pragma omp parallel >> for >> ql/methods/lattices/lattice.hpp169: #pragma omp parallel for >> ql/methods/finitedifferences/operators/triplebandlinearop.cpp127: >> //#pragma omp parallel for >> ql/methods/finitedifferences/operators/triplebandlinearop.cpp137: >> //#pragma omp parallel for >> ql/methods/finitedifferences/operators/triplebandlinearop.cpp153: >> //#pragma omp parallel for >> ql/methods/finitedifferences/operators/triplebandlinearop.cpp172: >> //#pragma omp parallel for >> ql/methods/finitedifferences/operators/triplebandlinearop.cpp187: >> //#pragma omp parallel for >> ql/methods/finitedifferences/operators/triplebandlinearop.cpp203: >> //#pragma omp parallel for >> ql/methods/finitedifferences/operators/triplebandlinearop.cpp220: >> #pragma omp parallel for >> ql/methods/finitedifferences/operators/triplebandlinearop.cpp238: >> //#pragma omp parallel for >> ql/methods/finitedifferences/operators/triplebandlinearop.cpp260: >> //#pragma omp parallel for >> ql/methods/finitedifferences/operators/ninepointlinearop.cpp147: >> //#pragma omp parallel for >> ql/methods/finitedifferences/operators/ninepointlinearop.cpp191: >> //#pragma omp parallel for >> ql/methods/finitedifferences/parallelevolver.hpp51: >> //#pragma omp parallel for >> ql/methods/finitedifferences/parallelevolver.hpp102: >> //#pragma omp parallel for >> ql/methods/finitedifferences/stepcondition.hpp48: //#pragma >> omp parallel for >> ql/pricingengines/swaption/gaussian1dswaptionengine.cpp118:#pragma omp >> parallel for default(shared) firstprivate(p) if(expiry0>settlement) >> >> Thanks >> Peter >> >> On Thu, 6 Jan 2022 at 13:18, Jonathan Sweemer <sw...@gm...> wrote: >> > >> > Hi Vamshi, >> > >> > OpenMP is only wired into a few places in QuantLib so if your program >> doesn't use those specific code paths then you probably won't see much >> difference in terms of speed. >> > >> > Moreover, QuantLib is not thread safe in general, and wasn't >> specifically designed for thread-level parallelism. See Luigi's answer on >> Stack Overflow for more details: https://stackoverflow.com/a/47098133 >> > >> > The good news is that you can use multiprocessing instead of >> multithreading with your HPC cluster to parallelize your jobs across cores >> and nodes. >> > >> > >> > On Thu, Jan 6, 2022 at 12:28 PM Vamshi Krishna <kri...@gm...> >> wrote: >> >> >> >> Hiii Users >> >> >> >> I am new in this group and new to quantlib. I come for HPC back ground. >> >> >> >> I have tried some examples program with openMP but no major >> performance gained. >> >> >> >> When I tried FinanceBench program which which have openMP functions >> and shown good performance on multi cores. >> >> >> >> I do not, I am do correctly or not. >> >> >> >> If any user could help me "how to use quantlib on multi cores and >> multiple node hpc cluster, I will be thankful. >> >> >> >> Regards >> >> Vamshi Krishna >> >> _______________________________________________ >> >> QuantLib-users mailing list >> >> Qua...@li... >> >> https://lists.sourceforge.net/lists/listinfo/quantlib-users >> > >> > _______________________________________________ >> > QuantLib-users mailing list >> > Qua...@li... >> > https://lists.sourceforge.net/lists/listinfo/quantlib-users >> >> >> _______________________________________________ >> QuantLib-users mailing list >> Qua...@li... >> https://lists.sourceforge.net/lists/listinfo/quantlib-users >> > |