Calculation stops but job not finished

GROMACS version: 2021.4-2
GROMACS modification: No

Hello everyone,

I am running GROMACS simulations with the help of a Python script. However, all of my MD runs seem to stop with no reason around 20 ns. It seems pretty random - sometimes simulations might run up to 40 ns and sometimes it might stop around 10 or 20 ns. When I run the simulations directly on the terminal, instead of through a Python script, I get the same problem.

The commands I use are:
gmx grompp -f md.mdp -c npt.gro -p topol.top -o md.tpr -maxwarn 3
gmx mdrun -v -deffnm md -ntmpi 18

I don’t think it is related to the simulation because it happens pretty much with everything I try to simulate. But here’s an example of .mdp file that I use:

; Run control
integrator = sd ; Langevin dynamics
tinit = 0
dt = 0.002
nsteps = 20000000 ; 40 ns
nstcomm = 100

; Output control
nstxout = 500
nstvout = 500
nstfout = 0
nstlog = 500
nstenergy = 500
nstxout-compressed = 0

; Neighborsearching and short-range nonbonded interactions
cutoff-scheme = verlet
nstlist = 20
ns_type = grid
pbc = xyz
rlist = 1.2

; Electrostatics
coulombtype = PME
rcoulomb = 1.2

; van der Waals
vdwtype = cutoff
vdw-modifier = potential-switch
rvdw-switch = 1.0
rvdw = 1.2

; Apply long range dispersion corrections for Energy and Pressure
DispCorr = EnerPres

; Spacing for the PME/PPPM FFT grid
fourierspacing = 0.12

; EWALD/PME/PPPM parameters
pme_order = 6
ewald_rtol = 1e-06
epsilon_surface = 0

; Temperature coupling
; tcoupl is implicitly handled by the sd integrator
tc_grps = system
tau_t = 1.0
ref_t = 298

; Pressure coupling is on for NPT
Pcoupl = Parrinello-Rahman
tau_p = 1.0
compressibility = 4.5e-05
ref_p = 1.0

; Free energy control stuff
free_energy = no

; Do not generate velocities
gen_vel = no

; options for bonds
constraints = h-bonds ; we only have C-H bonds here

; Type of constraint algorithm
constraint-algorithm = lincs

; Constrain the starting configuration
; since we are continuing from NPT
continuation = yes

; Highest order in the expansion of the constraint coupling matrix
lincs-order = 12

This error is making me run multiple small simulations instead of one longer simulation, which is not very practical. I’d appreciate any help!

Thanks :)