In a standard theory of the formation of the planets in our Solar System, terrestrial planets and cores of gas giants are formed through accretion of kilometer-sized objects (planetesimals) in a protoplanetary disk. Gravitational $N$-body simulations of a disk system made up of numerous planetesimals are the most direct way to study the accretion process. However, the use of $N$-body simulations has been limited to idealized models (e.g. perfect accretion) and/or narrow spatial ranges in the radial direction, due to the limited number of simulation runs and particles available. We have developed new $N$-body simulation code equipped with a particle-particle particle-tree (${rm P^3T}$) scheme for studying the planetary system formation process: GPLUM. For each particle, GPLUM uses the fourth-order Hermite scheme to calculate gravitational interactions with particles within cut-off radii and the Barnes-Hut tree scheme for particles outside the cut-off radii. In existing implementations, ${rm P^3T}$ schemes use the same cut-off radius for all particles, making a simulation become slower when the mass range of the planetesimal population becomes wider. We have solved this problem by allowing each particle to have an appropriate cut-off radius depending on its mass, its distance from the central star, and the local velocity dispersion of planetesimals. In addition to achieving a significant speed-up, we have also improved the scalability of the code to reach a good strong-scaling performance up to 1024 cores in the case of $N=10^6$. GPLUM is freely available from https://github.com/YotaIshigaki/GPLUM with MIT license.