Fortran interface layer of the framework for developing particle simulator FDPS

Numerical simulations based on particle methods have been widely used in various fields including astrophysics. To date, simulation softwares have been developed by individual researchers or research groups in each field, with a huge amount of time and effort, even though numerical algorithms used are very similar. To improve the situation, we have developed a framework, called FDPS, which enables researchers to easily develop massively parallel particle simulation codes for arbitrary particle methods. Until version 3.0, FDPS have provided API only for C++ programing language. 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 newly 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 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 `template' in Fortran. By 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++.

[1]  Masakazu A. R. Kobayashi,et al.  The ν2GC simulations: Quantifying the dark side of the universe in the Planck cosmology , 2014, 1412.2860.

[2]  Junichiro Makino,et al.  Implementation and performance of FDPS: a framework for developing parallel particle simulation codes , 2016, 1601.03138.

[3]  A. Toomre,et al.  On the gravitational stability of a disk of stars , 1964 .

[4]  Raymond Angélil,et al.  Large scale molecular dynamics simulations of homogeneous nucleation. , 2013, The Journal of chemical physics.

[5]  H. Salo Simulations of dense planetary rings. III. Self-gravitating identical particles. , 1995 .

[6]  K. Nomoto,et al.  Does Explosive Nuclear Burning Occur in Tidal Disruption Events of White Dwarfs by Intermediate-mass Black Holes? , 2017, 1703.08278.

[7]  J. Makino,et al.  Unconvergence of very-large-scale giant impact simulations , 2016, 1612.06984.

[8]  M. Fujii,et al.  PENTACLE: Parallelized Particle-Particle Particle-Tree Code for Planet Formation. , 2017, 1810.11970.

[9]  J. Makino,et al.  The giant impact simulations with density independent smoothed particle hydrodynamics , 2016, 1602.00843.

[10]  A. Tanikawa Tidal double detonation: a new mechanism for the thermonuclear explosion of a white dwarf induced by a tidal disruption event , 2017, 1711.07115.

[11]  E. Kokubo,et al.  Simulating the Smallest Ring World of Chariklo , 2017, 1702.06356.

[12]  J. Makino,et al.  A COMPARISON OF SPH ARTIFICIAL VISCOSITIES AND THEIR IMPACT ON THE KEPLERIAN DISK , 2016, 1601.05903.

[13]  Piet Hut,et al.  A hierarchical O(N log N) force-calculation algorithm , 1986, Nature.