
Computational Efficiency of Three Programming Languages in N-body Simulation
Author(s) -
Junnan Pan,
Zhongmu Li
Publication year - 2021
Publication title -
journal of physics. conference series
Language(s) - English
Resource type - Journals
SCImago Journal Rank - 0.21
H-Index - 85
eISSN - 1742-6596
pISSN - 1742-6588
DOI - 10.1088/1742-6596/1995/1/012019
Subject(s) - fortran , python (programming language) , computer science , programming language , computational science , parallel computing , computational simulation
The computational efficiency of FORTRAN, C and Python languages in N-body simulation is investigated. The potential of these languages to promote the research of N-body simulation is therefore shown by this paper. Our work utilizes Particle-Particle (PP) algorithm, which not only balances the accuracy and efficiency, but also simplifies the traditional numerical calculation. The experimental results show that the computational efficiency of the three is almost the same in the case of a small number of particles, but FORTRAN shows the highest computational efficiency in the case of a large number of particles. The efficiency of Python is the lowest among three languages. The result suggests that FORTRAN is the best choice for N-body simulation, and Python should be used after optimizing the algorithm or working on extreme high-performance computers.