ChaNGa is an N-body Smoothed Particle Magnetohydrodynamics (SPMHD) code which is used to study a wide array of astrophysical systems. While the gravity and SPMHD algorithms are based on the Gasoline and pkdgrav codes, the unique feature of ChaNGa is its incorporation of the Charm++ framework which enables highly efficient parallel scaling. To achieve this, Charm++ employs over decomposition, that is to divide the work into many more work pieces than the number of available processors and let the Charm++ runtime system load balance by appropriately assigning pieces to real processors. During runtime, Charm++ applies dynamic load re-balancing strategies, to determine which work pieces should be migrated to new processors for better load balance. As the central feature of ChaNGa is its tree-based gravity solver, the work pieces handled by the Charm++ framework are vertical slices of the global tree, also known as tree pieces. The number of tree pieces is directly correlated to the given over decomposition chosen by the user. Charm++ also provides support to execute CUDA kernels on the GPU asynchronously and to manage data transfers between the CPU and GPU. A high-level description of the code, its main algorithms and kernels targeted for optimisation can be found in §8 of Deliverable 1.2 (see deliverable section).
ChaNGa is publicly available on github
https://github.com/N-BodyShop/changa