Closed scarrazza closed 5 years ago
I tip my hat... there is no overhead at all from the other python stuff...
And here this PR code without numba:
VEGAS MC numba, ncalls=1000000:
Results for interation 1: 0.785875600908212 +/- 0.07909754587281996
Results for interation 2: 0.8829776344750646 +/- 0.056725899975748215
Results for interation 3: 0.9432196955108947 +/- 0.04175459380823546
Results for interation 4: 0.9744406929295116 +/- 0.030491305668939577
Results for interation 5: 0.9889151600046369 +/- 0.022307278548146032
(0.9629659800421783, 0.01556175483486767)
time (s): 116.2196056842804
Ok, so pure python can be discarded for eko :P
I've been playing a bit more with this, python uses about 1.3-1.4 more memory than the C++ version (gpu memory) which in turns makes it slower as the size of the arrays grow.
There's also a few more memory movements in the python code which I imagine are the cause.
I start thinking that python is only good for fast prototyping and numba may help if you are lazy to convert the code into a C style library with python wrapper. ;-)
Ahaha, ok...
Some numbers for cpp-cuda:
Some numbers for this PR:
Well, seems better than c++?!?