# Using a GPU to Accelerate a Longwave Radiative Transfer Model with Efficient CUDA-Based Methods
## 4 GPU-Enabled Acceleration Algorithms
### Acceleration Algorithm with Two-Dimensional Domain Decomposition
CUDA C with more mature techniques usually can perform better than CUDA Fortran. 4. If there is no I/O transfer between the CPU and GPU, the highest speedup value expected for theoretical algorithms of numerical schemes during GPU parallelization is equal to the number of CUDA threads started in the accelerating. One K40 GPU has 2880 CUDA cores, so the highest speedup value of the 2-D G-RRTMG_LW on one K40 GPU should be 2880. Due to the limitation of GPU memory and inevitable I/O transfer cost, it is very hard to get the theoretical speedup. However, the acceleration algorithm can be optimized further and I/O transfer cost between the CPU and GPU can be reduced to the furthest. ## 6 Conclusions and Future Work

High-efficiency parallel computing for radiation physics is exceedingly challenging. This paper presents the acceleration of the RRTMG_LW on GPU clusters. First, a GPU-based acceleration algorithm with a one-dimensional domain decomposition was proposed. Then, a second GPU-based acceleration algorithm with a two-dimensional domain decomposition was put forward. The two acceleration algorithms of the RRTMG_LW were implemented in CUDA Fortran. The G-RRTMG_LW, the GPU version of the RRTMG_LW, was also developed. The experimental results indicated that the 2-D G-RRTMG_LW displayed better calculation performances. During the computation of one model day, the 2-D G-RRTMG_LW on one K40 GPU obtained a speedup of 18.52\(\times\) as compared to a single Intel Xeon E5-2680 CPU-core counterpart, with the run-time decreasing from 647.12 s to 34.9384 s. Due to the acceleration of the G-RRTMG_LW, the CAS-ESM achieved faster computing. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Subroutines** & **CPU Time (s)** & **K20 Time (s)** & **Speedup** \\ \hline _rrtmg\_Iw_ & 647.12 & 105.63 & **6.13** \\ \hline
**Subroutines** & **CPU Time (s)** & **K40 Time (s)** & **Speedup** \\ \hline _rrtmg\_Iw_ & 647.12 & 94.24 & **6.87** \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Run-time and speedup of the 2-D G-RRTMG_LW with I/O transfer on one GPU, where the block size = 128 and _ncol_ = 2048. The current implementation of the G-RRTMG_LW did not achieve an acceptable speedup. The future work to address this includes the following two aspects. (1) The G-RRTMG_LW will be further accelerated. It may be beneficial to accelerate the G-RRTMG_LW in the _g-point_ dimension. A GPU-based acceleration algorithm with a three-dimensional domain decomposition for the G-RRTMG_LW will be attempted to explore this idea. (2) The G-RRTMG_LW currently only runs on one GPU. However, on the K20 cluster, one node is equipped with 20 CPU cores and 2 GPU cards. To fully use the CPU cores and GPUs in this type of installation, an MPI+OpenMP+CUDA hybrid paradigm [38] will be considered. However, such a programming model will be a huge challenge in the implementation. Without a doubt, the G-RRTMG_LW on multiple GPUs will obtain even better computational performances. Conceptualization, Y.W. ; methodology, Y.W., Y.Z., and J.J.; supervision, X.J. and A.Y.Z. ; validation, Y.W. and Y.Z. ; writing--original draft, Y.W. ; writing--review and editing, Y.W. and W.L. This work was supported in part by the National Key Research and Development Program of China under Grant 2016 YFB0200800, in part by the National Natural Science Foundation of China under Grant 61602477, in part by the China Postdoctoral Science Foundation under Grant 2016M601158, in part by the Fundamental Research Funds for the Central Universities under Grant 2652017113, and in part by the Open Research Project of the Hubei Key Laboratory of Intelligent Geo-Information Processing under Grant KLIGIP-2017A04. The authors would like to acknowledge the contributions of [PERSON] for insightful suggestions on the algorithm design. The authors declare no conflict of interest.The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript; or in the decision to publish the results.