Monte Carlo -hiukkassimulaation toteuttaminen ja kiihdyttäminen Pythonin Numba-kirjastolla
Abstract
Tutkielmassa vertaillaan alkuperäisen C-kielisen MCERD-simulaatiosovelluksen ja siitä tutkielmaa varten kehitettyjen Python-kielisten versioiden suorituskykyä. MCERD simuloi Elastic Recoil Detector (ERD) ja Rutherford Backscattering (RBS) -mittauksia Monte Carlo -menetelmällä. Uusia toteutuksia on kolme: puhtaalla Pythonilla tehty ohjelma sekä tästä Numballa kiihdytetyt, yksi- ja monisäikeiset versiot. Lisäksi tarkastellaan Nvidian CUDA-näytönohjainalustaa hyödyntävän Numba-version toteutettavuutta. Havaittiin, että Numballa saavutettiin lähes C:n tasoinen suorituskyky yhdellä säikeellä, ja monella säikeellä ylitettiin alkuperäinen, joskaan ei lineaarisesti skaalautuen. Havaittiin myös, että pelkkää Pythonia käyttävä versio on hyvin hidas ja näytönohjainversion toteuttaminen olisi vaikeaa.
This thesis compares the original MCERD simulation program made in C to new version of it made in Python for the thesis. MCERD simulates Elastic Recoil Detector (ERD) and Rutherford Backscattering (RBS) measurements using the Monte Carlo method. There are three new versions: one made in pure Python and two accelerated with Numba for single-threaded and multi-threaded usage. The viability of a GPU version for Nvidia's CUDA platform using Numba is also considered. It was observed that Numba almost matched the performance of C when single-threaded, and exceeded it when multi-threaded, albeit not scaling linearly. It was also observed that the pure Python version is very slow, and that the GPU version would be difficult to implement.
This thesis compares the original MCERD simulation program made in C to new version of it made in Python for the thesis. MCERD simulates Elastic Recoil Detector (ERD) and Rutherford Backscattering (RBS) measurements using the Monte Carlo method. There are three new versions: one made in pure Python and two accelerated with Numba for single-threaded and multi-threaded usage. The viability of a GPU version for Nvidia's CUDA platform using Numba is also considered. It was observed that Numba almost matched the performance of C when single-threaded, and exceeded it when multi-threaded, albeit not scaling linearly. It was also observed that the pure Python version is very slow, and that the GPU version would be difficult to implement.
Main Author
Format
Theses
Master thesis
Published
2022
Subjects
The permanent address of the publication
https://urn.fi/URN:NBN:fi:jyu-202206213542Use this for linking
Language
Finnish