The problem of simulation of plasma electron dynamics in the magnetic trap with inverse magnetic mirrors and multipole magnetic walls is considered. The model is built on the basis of Particle-In-Cell method. The complexity of processes under study and the necessary in a high precision of results required the development of a highly-scalable computational algorithm. Such an algorithm must be capable of computing billions of particle trajectories in a reasonable time. In order to achieve uniform and complete workload of the computational nodes of a supercomputer, the mixed Eulerian-Lagrangian decomposition is used. A dynamic time step is taken into account. This approach results in a high scalability and a significant decrease in the computational time.