Please login first
Enhancing Photon Transport Simulation in Earth's Atmosphere: acceleration of python Monte-Carlo model using vectorization and parallelization techniques
, * ,
1  German Aerospace Center
Academic Editor: Alexander Kokhanovsky

Abstract:

Photon transport within Earth's atmosphere is a critical phenomenon in atmospheric science, remote sensing, and climate modeling. Accurately modeling the behavior of photons as they interact with atmospheric components like gases and aerosols is crucial for quantitative analysis of the remote sensing data. However, these simulations are computationally intensive due to the complexity of the problem, especially in the case of two- and three dimensional models. A common way to tackle the problem of multi-dimensional photon transport is Monte-Carlo simulations, which require considering a huge amount of photons to obtain a reliable statistics. This problem can be efficiently parallelized to reduce the computation time and exploit the multi-core CPU and GPU devices. This research conducts a comparative analysis of three simulation techniques: traditional loops, NumPy's vectorized operations, and CuPy's GPU acceleration. The study implements a Monte Carlo simulation method in a inhomogeneous atmosphere.

Conventional approaches to simulating photon transport involve iterative loops, leading to computational bottlenecks. In this study we examine the efficiency of three approaches that can accelerate computations. The first approach is based on a multiprocessing library that essentially deals with multithreading. The second method is based on the code vectorization and using matrix notations though the NumPy library. In this case it is possible to get rid of the loop across the photons and to track an ensemble of photons in a single batch. The simulations are performed in the paradigm “single instruction – multiple data”. The third method is a natural extension of the previous method. It is based on the GPU-accelerated library CuPy. By harnessing GPU parallelism, CuPy can significantly accelerate simulations, making them feasible for large-scale scenarios. In order to consider stopping criteria for a batch of photons, a sort of masking is applied to an ensemble of photons. Metrics such as runtime, memory usage, and scalability are evaluated to quantify the performance trade-offs. It is shown that the initial structure of the python code should not be significantly changed when using aforementioned approaches. Moreover, CuPy library allows an easy transition of the model from CPU to GPU. Experiments are performed on two cores of Intel Xeon(R) CPU @ 2.30GHz and GPU Tesla T4. Three orders of magnitude performance enhancement is achieved by using vectorization. Using GPU provided additional 10x speedup as compared to the vectorized version for 105 photons.

The study demonstrates the superiority of CuPy for photon transport simulations. CuPy's GPU acceleration substantially reduces simulation time if the number of photons is sufficiently large (>107), otherwise the overhead of CuPy is comparable with the actual computing time).

Keywords: Monte-Carlo, parallel computations, GPU
Top