# Segmentation fault when running an NPT

**URL:** <https://gromacs.bioexcel.eu/t/segmentation-fault-when-running-an-npt/7661>\
**Category:** User discussions\
**Created:** [November 17, 2023, 10:46am UTC](https://gromacs.bioexcel.eu/t/segmentation-fault-when-running-an-npt/7661 "2023-11-17T10:46:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nasseralhamdani](https://avatars.discourse-cdn.com/v4/letter/n/b487fb/32.png) [@Nasseralhamdani](https://gromacs.bioexcel.eu/u/Nasseralhamdani)\
**Post date:** [November 17, 2023, 10:46am UTC](https://gromacs.bioexcel.eu/t/segmentation-fault-when-running-an-npt/7661/1 "2023-11-17T10:46:16Z")

</div>

GROMACS version: 2023.2  
GROMACS modification: Yes/No

Hello and good day,

I am running some cycles of NVT-NPT for swelling procedures on a membrane. Each cycle goes like this

> NVT for 250 ps with T goes from 300-600 C  
> NVT for 500 ps with T at 600 C  
> NVT for 250 ps with T goes from 600-300 C  
> NVT for 1000 ps with T at 300 C  
> and finally an NPT for 500 ps with T 300 C and P at 1 bar

It goes well for the first cycles, but at the second cycle when it reaches to generate the .tpr file for the NPT, I get the following error.

```auto
There were 2 WARNINGs
[nas-Precision-7820-Tower:81671] ***Process received signal***
[nas-Precision-7820-Tower:81671] Signal: Segmentation fault (11)
[nas-Precision-7820-Tower:81671] Signal code: Invalid permissions (2)
[nas-Precision-7820-Tower:81671] Failing at address: 0x200000008
[nas-Precision-7820-Tower:81671] [0] /lib/x86_64-linux-gnu/libc.so.6(+0x42520)[0x7fd0f7a42520]
[nas-Precision-7820-Tower:81671] [1] /home/nas/Desktop/gromacs-2023.2/build/bin/../lib/libgromacs_mpi.so.8(_ZN22PreprocessingAtomTypesD1Ev+0x113)[0x7fd0f8a07163]
[nas-Precision-7820-Tower:81671] [2] /home/nas/Desktop/gromacs-2023.2/build/bin/../lib/libgromacs_mpi.so.8(_Z10gmx_gromppiPPc+0x5d9e)[0x7fd0f8a2386e]
[nas-Precision-7820-Tower:81671] [3] /home/nas/Desktop/gromacs-2023.2/build/bin/../lib/libgromacs_mpi.so.8(_ZN3gmx24CommandLineModuleManager3runEiPPc+0x36d)[0x7fd0f869d5bd]
[nas-Precision-7820-Tower:81671] [4] gmx_mpi(+0x7e30)[0x56267143be30]
[nas-Precision-7820-Tower:81671] [5] /lib/x86_64-linux-gnu/libc.so.6(+0x29d90)[0x7fd0f7a29d90]
[nas-Precision-7820-Tower:81671] [6] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x80)[0x7fd0f7a29e40]
[nas-Precision-7820-Tower:81671] [7] gmx_mpi(+0x7eb5)[0x56267143beb5]
[nas-Precision-7820-Tower:81671] ***End of error message***
Segmentation fault (core dumped)

```

The NPT input is the following

title = NPT equilibration at 300 K

; Run parameters  
integrator = md ; leap-frog integrator  
nsteps = 500000 ; 500000 \* 0.001 fs = 500 ps  
dt = 0.001 ; 1 fs

; Output control  
nstxout = 500 ; save coordinates every 1.0 ps  
nstvout = 500 ; save velocities every 1.0 ps  
nstenergy = 500 ; save energies every 1.0 ps  
nstlog = 500 ; update log file every 1.0 ps

; Bond parameters  
continuation = yes ; First MD run, gen-vel=yes  
;constraint\_algorithm = lincs ; No constraints  
constraints = none ; No constraints

; Nonbonded settings  
cutoff-scheme = Verlet ; Buffered neighbor searching

;verlet-buffer-tolerance = 0.1  
ns\_type = grid ; search neighboring grid cells  
nstlist = 10 ; 20 fs, largely irrelevant with Verlet scheme  
rcoulomb = 1.2 ; short-range electrostatic cutoff (in nm)  
rvdw = 1.2 ; short-range van der Waals cutoff (in nm)  
DispCorr = EnerPres ; account for cut-off vdW scheme

; Electrostatics  
coulombtype = PME ; Cutoff for electrostatics  
pme\_order = 4 ; cubic interpolation  
fourierspacing = 0.12 ; grid spacing for FFT

; Temperature coupling is on  
tcoupl = V-rescale ; V-rescale thermostat  
tc-grps = system ; two coupling groups - more accurate  
tau\_t = 0.5 ; time constant, in ps (adjusted)  
ref\_t = 300 ; reference temperature, one for each group, in K

; Pressure coupling is on  
pcoupl = Berendsen ;Pressure coupling on in NPT (changed to Berendsen)  
pcoupltype = semiisotropic ; uniform scaling of box vectors  
tau\_p = 2.0 ; time constant, in ps (adjusted)  
ref\_p = 1.0 1.0 ; reference pressure, in bar  
compressibility = 4.5e-5 4.5e-5 ; isothermal compressibility of water, bar^-1

; Periodic boundary conditions  
pbc = xy ; 2-D PBC (only x and y)  
nwall = 2 ; Two walls for confinement  
wall-atomtype = ljw ljw ; Wall atom types  
wall-type = 12-6 ; Wall potential type  
wall-r-linpot = 0.1 ; Linear potential distance from the wall  
ewald-geometry = 3dc ; Ewald summation geometry

; Velocity generation  
gen\_vel = no ; Velocity generation is off

---

<div class="post-metadata">

**Author:** ![FarzaneJP](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/farzanejp/32/1211_2.png) [@FarzaneJP](https://gromacs.bioexcel.eu/u/FarzaneJP)\
**Post date:** [November 27, 2023, 2:57pm UTC](https://gromacs.bioexcel.eu/t/segmentation-fault-when-running-an-npt/7661/2 "2023-11-27T14:57:03Z")

</div>

This may help you find a solution: Introduction to [Membrane-Protein Simulation- GROMACS tutorial](https://gromacs.bioexcel.eu/t/new-gromacs-tutorials/6913)  
and a question: what happens if you remove pbc = xy part?

---

<div class="post-metadata">

**Author:** ![Nasseralhamdani](https://avatars.discourse-cdn.com/v4/letter/n/b487fb/32.png) [@Nasseralhamdani](https://gromacs.bioexcel.eu/u/Nasseralhamdani)\
**Post date:** [November 28, 2023, 1:07pm UTC](https://gromacs.bioexcel.eu/t/segmentation-fault-when-running-an-npt/7661/3 "2023-11-28T13:07:33Z")

</div>

Thank you so much for the reply,

The error was solved by just changing the version of Gromacs to 2022.6  
I am not sure what is the exact problem, but when I run the same file with Gromacs 2023.2 I get the error, but not with the older version.

---

<div class="post-metadata">

**Author:** ![FarzaneJP](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/farzanejp/32/1211_2.png) [@FarzaneJP](https://gromacs.bioexcel.eu/u/FarzaneJP)\
**Post date:** [February 15, 2024, 4:47pm UTC](https://gromacs.bioexcel.eu/t/segmentation-fault-when-running-an-npt/7661/4 "2024-02-15T16:47:45Z")

</div>

I recommend you to always use the last version. 2024 is now available.

---

<div class="post-metadata">

**Author:** ![hess](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/hess/32/416_2.png) [@hess](https://gromacs.bioexcel.eu/u/hess)\
**Post date:** [February 19, 2024, 11:25am UTC](https://gromacs.bioexcel.eu/t/segmentation-fault-when-running-an-npt/7661/5 "2024-02-19T11:25:27Z")

</div>

You should never get a segmentation fault. Could you provide us with all the input files for grompp so we can find the cause of this issue?
