We present GAMER-2, a GPU-accelerated adaptive mesh refinement (AMR) code forastrophysics. It provides a rich set of features, including adaptivetime-stepping, several hydrodynamic schemes, magnetohydrodynamics,self-gravity, particles, star formation, chemistry and radiative processes withGRACKLE, data analysis with yt, and memory pool for efficient objectallocation. GAMER-2 is fully bitwise reproducible. For the performanceoptimization, it adopts hybrid OpenMP/MPI/GPU parallelization and utilizes thesimultaneity between CPU computation, GPU computation, and CPU-GPUcommunication. Load balancing is achieved using a Hilbert space-filling curveon a level-by-level basis without the need to duplicate the entire AMRhierarchy on each MPI process. To provide convincing demonstrations of theaccuracy and performance of GAMER-2, we directly compare with Enzo on isolateddisk galaxy simulations and with FLASH on galaxy cluster merger simulations. Weshow that the physical results obtained by different codes are in very goodagreement, and GAMER-2 outperforms Enzo and FLASH by nearly one and two ordersof magnitude, respectively, on the Blue Waters supercomputers using $1-256$nodes. More importantly, GAMER-2 exhibits similar or even better parallelscalability compared to the other two codes. We also demonstrate good weak andstrong scaling using up to 4096 GPUs and 65,536 CPU cores, and achieve auniform resolution as high as $10{,}240^3$ cells. Furthermore, GAMER-2 can beadopted as an AMR+GPUs framework and has been extensively used for the wavedark matter ($psi$DM) simulations. GAMER-2 is open source (available athttps://github.com/gamer-project/gamer) and new contributions are welcome.
展开▼