Аннотация:Modeling of astrophysical processes requires the use of modern means of supporting labor-intensive calculations with more efficient parallelization of operations. In this paper, we apply our proposed methods for constructing parallel algorithms for heterogeneous parallelization on the CPU and GPU. To numerically solve the Poisson and Euler equations, the adaptive mesh refinement (AMR) method was used for five levels of nesting. A comparison is made of the acceleration of the numerical solution of the Poisson equation on the CPU and GPU on grids from 1283 to 40963. Of great importance in such a transfer is the combination of computation time on different processors, that is, code profiling. Serial numerical modeling was carried out for the case of a direct collision of clouds in a head-on scenario without rotation or collision of clouds rotating and moving in opposite directions. Collisions of molecular clouds with mutual matter penetrations are accompanied by periodic perturbations of the matter density in impact core and inside newly formed remnants, fragmented clumps and filaments. To increase the accuracy of calculations of the main variables in the areas of flow movement with high gradients, grid refinement by the AMR patch method is used. In modeling, it was found that in residual clumps with more condensed matter the gas density can reach values that are at the initial level of the matter of prestellar formations. In the zones of these formations, the emergence of new stars is more likely. It was revealed how the coherent structures of new formation, unbalanced during a collision and caused by the Kelvin-Helmholtz effects, together with other instabilities can change in their shape due to rotation, can affect the transformation of the remains.