Fortran interface layer of the framework for developing particle simulator FDPS
Open Access
- 12 June 2018
- journal article
- research article
- Published by Oxford University Press (OUP) in Publications of the Astronomical Society of Japan
- Vol. 70 (4)
Abstract
Numerical simulations based on particle methods have been widely used in various fields including astrophysics. To date, various versions of simulation software have been developed by individual researchers or research groups in each field, through a huge amount of time and effort, even though the numerical algorithms used are very similar. To improve the situation, we have developed a framework, called FDPS (Framework for Developing Particle Simulators), which enables researchers to develop massively parallel particle simulation codes for arbitrary particle methods easily. Until version 3.0, FDPS provided an API (application programming interface) for the C++ programming language only. This limitation comes from the fact that FDPS is developed using the template feature in C++, which is essential to support arbitrary data types of particle. However, there are many researchers who use Fortran to develop their codes. Thus, the previous versions of FDPS require such people to invest much time to learn C++. This is inefficient. To cope with this problem, we developed a Fortran interface layer in FDPS, which provides API for Fortran. In order to support arbitrary data types of particle in Fortran, we design the Fortran interface layer as follows. Based on a given derived data type in Fortran representing particle, a Python script provided by us automatically generates a library that manipulates the C++ core part of FDPS. This library is seen as a Fortran module providing an API of FDPS from the Fortran side and uses C programs internally to interoperate Fortran with C++. In this way, we have overcome several technical issues when emulating a ‘template’ in Fortran. Using the Fortran interface, users can develop all parts of their codes in Fortran. We show that the overhead of the Fortran interface part is sufficiently small and a code written in Fortran shows a performance practically identical to the one written in C++.Keywords
All Related Versions
This publication has 13 references indexed in Scilit:
- Does Explosive Nuclear Burning Occur in Tidal Disruption Events of White Dwarfs by Intermediate-mass Black Holes?The Astrophysical Journal, 2017
- Simulating the Smallest Ring World of CharikloThe Astrophysical Journal Letters, 2017
- Implementation and performance of FDPS: a framework for developing parallel particle simulation codesPublications of the Astronomical Society of Japan, 2016
- A COMPARISON OF SPH ARTIFICIAL VISCOSITIES AND THEIR IMPACT ON THE KEPLERIAN DISKThe Astrophysical Journal Supplement Series, 2016
- The giant impact simulations with density independent smoothed particle hydrodynamicsIcarus, 2016
- The ν2GC simulations: Quantifying the dark side of the universe in the Planck cosmologyPublications of the Astronomical Society of Japan, 2015
- Large scale molecular dynamics simulations of homogeneous nucleationThe Journal of Chemical Physics, 2013
- Simulations of Dense Planetary RingsIcarus, 1995
- A hierarchical O(N log N) force-calculation algorithmNature, 1986
- On the gravitational stability of a disk of starsThe Astrophysical Journal, 1964