  We perform numerical magnetohydrodynamic (MHD) simulations of the
gravitational collapse and fragmentation of a cylindrical molecular cloud with
the help of the FLASH code. The cloud collapses rapidly along its radius
without any signs of fragmentation in the simulations without magnetic field.
The radial collapse of the cloud is stopped by the magnetic pressure gradient
in the simulations with parallel magnetic field. Cores with high density form
at the cloud ends during further evolution. The core densities are $n \approx
1.7 \cdot 10^{8}$ and $2 \cdot 10^{7}$ cm$^{-3}$ in the cases with initial
magnetic field strengths $B = 1.9 \cdot 10^{-4}$ and $6 \cdot 10^{-4}$ G,
respectively. The cores move toward the cloud center with supersonic speeds
$|v_{z}|=3.6$ and $5.3$ km$\cdot$s$^{-1}$. The sizes of the cores along the
filaments radius and filament main axis are $d_{r} = 0.0075$ pc and $d_{z} =
0.025$ pc, $d_{r} = 0.03$ pc and $d_{z} = 0.025$ pc, respectively. The masses
of the cores increase during the filament evolution and lie in range of
$\approx 10-20\,M_\odot$. According to our results, the cores observed at the
edges of molecular filaments can be a result of the filament evolution with
parallel magnetic field.
