MPI-parallelized gravity simulation for many particles, accelerated with quadtree and Barnes-Hut approximation