# Segmentration Fault and to small of a timestep problem from a Amber built system

**URL:** <https://gromacs.bioexcel.eu/t/segmentration-fault-and-to-small-of-a-timestep-problem-from-a-amber-built-system/8351>\
**Category:** User discussions\
**Tags:** mdrun\
**Created:** [February 16, 2024, 6:31pm UTC](https://gromacs.bioexcel.eu/t/segmentration-fault-and-to-small-of-a-timestep-problem-from-a-amber-built-system/8351 "2024-02-16T18:31:10Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryanm](https://avatars.discourse-cdn.com/v4/letter/r/85f322/32.png) [@ryanm](https://gromacs.bioexcel.eu/u/ryanm)\
**Post date:** [February 16, 2024, 6:31pm UTC](https://gromacs.bioexcel.eu/t/segmentration-fault-and-to-small-of-a-timestep-problem-from-a-amber-built-system/8351/1 "2024-02-16T18:31:10Z")

</div>

GROMACS version:  
GROMACS modification: Yes/No  
Here post your question

Hello,

I have run my protein with a metal and ligand for 30 ns. I need to run the md simulation 30 ns. I ran into the segmentation fault error when performing nvt or npt. I need npt to run md. I adjusted the energy minimization steps, but that doesn’t work. I looked online for help and found the pressure coupling in npt.mdp can be adjusted.

pcoupl = Parrinello-Rahman

in the npt.mdp file with

pcoupl = C-rescale

This doesn’t fix the problem. I created my protein with the calcium ion, disulfide bond in Amber. There was no problem “building” in Amber. I tried using Amber forcefield and Charm forcefield in the topology, and I tried using either dry protein or solvate protein generated by acpype to run nvt, npt, and md, but I still get a segmentation fault.

The link I used for help.

[https://www.researchgate.net/post/Gromacs\_Error\_2\_particles\_communicated\_to\_PME\_rank\_3\_are\_more\_than\_2\_3\_times\_the\_cut-off\_out\_of\_the\_domain\_How\_to\_solve\_this\_error](https://www.researchgate.net/post/Gromacs_Error_2_particles_communicated_to_PME_rank_3_are_more_than_2_3_times_the_cut-off_out_of_the_domain_How_to_solve_this_error)

I am using GROMACS on a server and my computer version 2023.

Ryan Molitor

---

<div class="post-metadata">

**Author:** ![MagnusL](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/magnusl/32/2380_2.png) [@MagnusL](https://gromacs.bioexcel.eu/u/MagnusL)\
**Post date:** [February 20, 2024, 7:55am UTC](https://gromacs.bioexcel.eu/t/segmentration-fault-and-to-small-of-a-timestep-problem-from-a-amber-built-system/8351/2 "2024-02-20T07:55:23Z")

</div>

Hi Ryan,  
I theory you should not get a segmentation fault at all, but sometimes it happens if the system is exploding. Since it happens already in your first equilibration stage (nvt) I would presume that the system is not energy minimized well enough.

Do you get any messages before the segmentation fault? Often those can give a hint which atoms are moving fast, or which bonds are extended too far. It’s also good to check the output from the energy minimization run to see which atoms have the highest force. You say that you adjusted the energy minimization steps, but that it did not work. Does the energy minimization converge? Sometimes it’s good to force the energy minimization to run on CPU (if it’s running on GPU with the default settings), by using the `-nb cpu` option.

---

<div class="post-metadata">

**Author:** ![ryanm](https://avatars.discourse-cdn.com/v4/letter/r/85f322/32.png) [@ryanm](https://gromacs.bioexcel.eu/u/ryanm)\
**Post date:** [February 20, 2024, 6:49pm UTC](https://gromacs.bioexcel.eu/t/segmentration-fault-and-to-small-of-a-timestep-problem-from-a-amber-built-system/8351/3 "2024-02-20T18:49:08Z")

</div>

I had the energy minimization step up to 5000 at the start. I decreased the number steps to the energy minimization knowing that at some point it will not converge. Then, increased the steps to find the balance between where energy minimization converges and doesn’t converge, and use that energy minimization to run the md nvt run, which still gave me a segmentation fault. I can get the energy minimization to converge at above 250 steps. I haven’t tried forcing the energy minimization to run on CPU.  
I re-ran the energy minimization again. The system converges with no errors. It converged 298 steps. I used steepest descent minimization. I ran the nvt step to generate nvt.tpr. The only warning I got was:  
WARNING 1 [file mdp file]:  
Malformed define option -POSRES  
I have my position restraint stated in the mdp and top files as POSRES to restraint the system at 1000. I think gmx doesn’t recognize my position restraint in the mdp and top file?

Ryan Molitor

---

<div class="post-metadata">

**Author:** ![MagnusL](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/magnusl/32/2380_2.png) [@MagnusL](https://gromacs.bioexcel.eu/u/MagnusL)\
**Post date:** [February 20, 2024, 8:59pm UTC](https://gromacs.bioexcel.eu/t/segmentration-fault-and-to-small-of-a-timestep-problem-from-a-amber-built-system/8351/4 "2024-02-20T20:59:43Z")

</div>

Convergence in 298 steps sounds a bit suspicious. I’d recommend trying with `-nb cpu` to see if it runs longer.

The warning is also correct. The define option should be `-DPOSRES`.

---

<div class="post-metadata">

**Author:** ![ryanm](https://avatars.discourse-cdn.com/v4/letter/r/85f322/32.png) [@ryanm](https://gromacs.bioexcel.eu/u/ryanm)\
**Post date:** [February 21, 2024, 12:19am UTC](https://gromacs.bioexcel.eu/t/segmentration-fault-and-to-small-of-a-timestep-problem-from-a-amber-built-system/8351/5 "2024-02-21T00:19:57Z")

</div>

I changed the position restriants to DPOSRES. I tried running the mdrun em at 5000 steps with Verlet cut-off and cpu on my laptop.  
gmx mdrun -nb cpu -deffnm em, the command line  
I get a segmentation fault running this command, but without -nb cpu it converges at 298 steps.

---

<div class="post-metadata">

**Author:** ![MagnusL](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/magnusl/32/2380_2.png) [@MagnusL](https://gromacs.bioexcel.eu/u/MagnusL)\
**Post date:** [February 21, 2024, 6:21am UTC](https://gromacs.bioexcel.eu/t/segmentration-fault-and-to-small-of-a-timestep-problem-from-a-amber-built-system/8351/6 "2024-02-21T06:21:45Z")

</div>

Do you get any output, about which atoms have the highest force, if you run `gmx mdrun -nb cpu -deffnm em -v`?

---

<div class="post-metadata">

**Author:** ![ryanm](https://avatars.discourse-cdn.com/v4/letter/r/85f322/32.png) [@ryanm](https://gromacs.bioexcel.eu/u/ryanm)\
**Post date:** [February 21, 2024, 4:06pm UTC](https://gromacs.bioexcel.eu/t/segmentration-fault-and-to-small-of-a-timestep-problem-from-a-amber-built-system/8351/7 "2024-02-21T16:06:51Z")

</div>

Yes, I ran the gmx mdrun -nb cpu -deffnm em -v with 5000 steps. It converged at 294 steps with a maximum force of:

Steepest Descents converged to machine precision in 294 steps,  
but did not reach the requested Fmax \< 1000.  
Potential Energy = -4.2708806e+05  
Maximum force = 1.1458638e+05 on atom 3896  
Norm of force = 1.2184215e+03

---

<div class="post-metadata">

**Author:** ![ryanm](https://avatars.discourse-cdn.com/v4/letter/r/85f322/32.png) [@ryanm](https://gromacs.bioexcel.eu/u/ryanm)\
**Post date:** [February 21, 2024, 4:13pm UTC](https://gromacs.bioexcel.eu/t/segmentration-fault-and-to-small-of-a-timestep-problem-from-a-amber-built-system/8351/8 "2024-02-21T16:13:08Z")

</div>

Would adjusting the Fmax in the em.mdp file improve the energy convergence?

---

<div class="post-metadata">

**Author:** ![MagnusL](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/magnusl/32/2380_2.png) [@MagnusL](https://gromacs.bioexcel.eu/u/MagnusL)\
**Post date:** [February 21, 2024, 4:59pm UTC](https://gromacs.bioexcel.eu/t/segmentration-fault-and-to-small-of-a-timestep-problem-from-a-amber-built-system/8351/9 "2024-02-21T16:59:06Z")

</div>

I expect problems with the input structure. I would start with checking atom 3896 and its surroundings. I would not be surprised if it’s overlapping with (or very close to) another atom or if there is, e.g., a bond nearby passing through a ring structure, or if a chemical bond is far too long.

---

<div class="post-metadata">

**Author:** ![ryanm](https://avatars.discourse-cdn.com/v4/letter/r/85f322/32.png) [@ryanm](https://gromacs.bioexcel.eu/u/ryanm)\
**Post date:** [February 22, 2024, 6:06pm UTC](https://gromacs.bioexcel.eu/t/segmentration-fault-and-to-small-of-a-timestep-problem-from-a-amber-built-system/8351/10 "2024-02-22T18:06:52Z")

</div>

Okay, thank you. I looked at atom 3896. It is a water molecule used in the metal optimization in Amber and Games. From what I found there are two water molecules that optimize the metal when running GAMES and AMBER. There was no problem running GAMES and Amber, and no problems converting the amber format to GROMACS in gro and top files. The distances in the GROMACS format from the metal to the water molecules is 2.402 and 3.077 angstroms.

---

<div class="post-metadata">

**Author:** ![ryanm](https://avatars.discourse-cdn.com/v4/letter/r/85f322/32.png) [@ryanm](https://gromacs.bioexcel.eu/u/ryanm)\
**Post date:** [February 22, 2024, 6:11pm UTC](https://gromacs.bioexcel.eu/t/segmentration-fault-and-to-small-of-a-timestep-problem-from-a-amber-built-system/8351/11 "2024-02-22T18:11:29Z")

</div>

Can I output a topology from a gro file?

---

<div class="post-metadata">

**Author:** ![MagnusL](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/magnusl/32/2380_2.png) [@MagnusL](https://gromacs.bioexcel.eu/u/MagnusL)\
**Post date:** [February 23, 2024, 7:49am UTC](https://gromacs.bioexcel.eu/t/segmentration-fault-and-to-small-of-a-timestep-problem-from-a-amber-built-system/8351/12 "2024-02-23T07:49:01Z")

</div>

Do you mean the connectivities/bonds? I’m afraid not. It’s not stored in the gro file.

If the water molecules has been optimized in GAMESS it is possible that you need to make water molecules flexible during energy minimization. See if adding `define = -DFLEXIBLE` to the mdp file helps.

Otherwise, how large is the system? Would you be able to post the gro file here (or on a file sharing service)?

---

<div class="post-metadata">

**Author:** ![ryanm](https://avatars.discourse-cdn.com/v4/letter/r/85f322/32.png) [@ryanm](https://gromacs.bioexcel.eu/u/ryanm)\
**Post date:** [February 23, 2024, 6:53pm UTC](https://gromacs.bioexcel.eu/t/segmentration-fault-and-to-small-of-a-timestep-problem-from-a-amber-built-system/8351/13 "2024-02-23T18:53:12Z")

</div>

I was thinking of manipulating the coordinates in the gro file to adjust the distance, but that won’t change the bond parameters generated by GAMES. I tried running the simulation with “define = -DFLEXIBLE” in the mdp file and it outputs a segmentation fault. I can post it as a top file here.  
[solv\_GMX\_gro.top](https://gromacs.bioexcel.eu/uploads/short-url/2ajKhKgHfeoAWqeTmuEcTnpFcOD.top) (1.3 MB)

---

<div class="post-metadata">

**Author:** ![MagnusL](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/magnusl/32/2380_2.png) [@MagnusL](https://gromacs.bioexcel.eu/u/MagnusL)\
**Post date:** [February 26, 2024, 7:53am UTC](https://gromacs.bioexcel.eu/t/segmentration-fault-and-to-small-of-a-timestep-problem-from-a-amber-built-system/8351/14 "2024-02-26T07:53:07Z")

</div>

I had a look at the system. I don’t see any apparent problems. But the distance between the water hydrogen 3897 to the metal is only 2.30 Å. What metal is this? It says CA, but I guess it’s not a Ca2+ ion, right? Especially since the QM optimized water is orienting its hydrogen atom towards it. What is its VdW radius? Is it correctly parameterized in the force field?

I’m still quite sure it’s the input structure that’s the problem. Without the topology and mdp parameters I’m afraid I cannot help you much more at the moment. Using `define = -DFLEXIBLE` was mainly to see if applying constraints from an unfavorable structure caused any problems. Since it did not help there’s no reason to retain it.

---

<div class="post-metadata">

**Author:** ![ryanm](https://avatars.discourse-cdn.com/v4/letter/r/85f322/32.png) [@ryanm](https://gromacs.bioexcel.eu/u/ryanm)\
**Post date:** [February 26, 2024, 5:13pm UTC](https://gromacs.bioexcel.eu/t/segmentration-fault-and-to-small-of-a-timestep-problem-from-a-amber-built-system/8351/15 "2024-02-26T17:13:32Z")

</div>

My enzyme has no metal when you download it. According to scientific articles, they performed matchmake in Chimera to copy the coordinates of the metal ion in another enzyme and “paste it” relative to my enzyme. The metal, CA, is a calcium +2 ion, vdw radius 231. It was parameterized by GAMES, then AMBER MCPB.py builds the GAMES output into the enzyme. When I check the Amber generated topology, .prmtop, it shows the correct atomic number for calcium, 20. It is parameterized in Amber forcefield. If I add:  
; Include forcefield parameters  
#include “amber99sb.ff/forcefield.itp”  
to the topology file I get warnings saying it already recognizes the bonds and I can suppress the warning with maxwarn, or there is no warnings if I remove the forcefield parameters from the topology. Both will generate the em.tpr, but with the forcefield parameters leads to a segmentation fault appears when running gmx mdrun -deffnm -nb cpu em -v. I didn’t run GAMES on my computer. The only problem with the GAMES output was naming of the two water molecules. I also checked where I got the metal ion from, and it said Calcium ion 2+.  
[4eb0\_solv\_GMX.top](https://gromacs.bioexcel.eu/uploads/short-url/3lpAKlmvLg2u9nXq8Q9fIoBPoEu.top) (3.0 MB)  
[em.mdp](https://gromacs.bioexcel.eu/uploads/short-url/6U5g3NV6QVM4txpDC2fGlpVgoZw.mdp) (1.2 KB)  
[nvt.mdp](https://gromacs.bioexcel.eu/uploads/short-url/nabiucXTzDypzfRTPsxdM05OFHK.mdp) (1017 Bytes)  
[npt.mdp](https://gromacs.bioexcel.eu/uploads/short-url/ntCEG7pBEULA17sy6IODUuM2K0k.mdp) (1.2 KB)  
[md.mdp](https://gromacs.bioexcel.eu/uploads/short-url/AhQb5Gpbw4G5K8nqoKdSsIcHotX.mdp) (1.2 KB)

---

<div class="post-metadata">

**Author:** ![MagnusL](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/magnusl/32/2380_2.png) [@MagnusL](https://gromacs.bioexcel.eu/u/MagnusL)\
**Post date:** [February 27, 2024, 8:20am UTC](https://gromacs.bioexcel.eu/t/segmentration-fault-and-to-small-of-a-timestep-problem-from-a-amber-built-system/8351/16 "2024-02-27T08:20:18Z")

</div>

Having a closer look at this I’m afraid I can’t help you. The input coordinates energy minimize to a state that will crash. Moving the two QM optimized water molecules a bit still did not help.

I’m not an expert at parameterizing these kinds of systems. Unless you are 100% sure about what you are doing, I would start over and use common MM force field parameters and skip the QM step. Currently the partial charge on your Ca2+ ion and the neighboring waters, as well as some of the nearby protein side chains, will have their partial charges set by QM. But these will move. I think you should either stick to MD simulations (with conventional parameters) or run QM/MM for this part of the system. The latter option may be better for coordinated ions.

If you are completely sure that your parameters and input coordinates are correct then I’m afraid you’ll have to find another MD software to simulate this system.

---

<div class="post-metadata">

**Author:** ![MagnusL](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/magnusl/32/2380_2.png) [@MagnusL](https://gromacs.bioexcel.eu/u/MagnusL)\
**Post date:** [February 27, 2024, 8:55am UTC](https://gromacs.bioexcel.eu/t/segmentration-fault-and-to-small-of-a-timestep-problem-from-a-amber-built-system/8351/17 "2024-02-27T08:55:29Z")

</div>

Hi again,

I just noticed that there are covalent bonds between the Ca2+ ions and the coordinated waters. This will at least prevent them from leaving. But apparently something needs to be done about the input coordinates and/or force field parameters.

---

<div class="post-metadata">

**Author:** ![ryanm](https://avatars.discourse-cdn.com/v4/letter/r/85f322/32.png) [@ryanm](https://gromacs.bioexcel.eu/u/ryanm)\
**Post date:** [February 27, 2024, 5:37pm UTC](https://gromacs.bioexcel.eu/t/segmentration-fault-and-to-small-of-a-timestep-problem-from-a-amber-built-system/8351/18 "2024-02-27T17:37:05Z")

</div>

Okay, thank you.

---

<div class="post-metadata">

**Author:** ![patriciabinita](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/patriciabinita/32/3955_2.png) [@patriciabinita](https://gromacs.bioexcel.eu/u/patriciabinita)\
**Post date:** [November 11, 2024, 6:06am UTC](https://gromacs.bioexcel.eu/t/segmentration-fault-and-to-small-of-a-timestep-problem-from-a-amber-built-system/8351/19 "2024-11-11T06:06:32Z")

</div>

I ran into the segmentation fault error when performing nvt or npt. I need npt to run md. I adjusted the energy minimization steps, but that doesn’t work. In the equilibration step, the job halts [spacebar clicker](https://spacebarcounter.org/spacebarclicker) indicating some segmentation fault. Kindly suggest on how to interpret the error and trouble shoot the same. (outside process’s address space) Attempting to access memory the program does not have rights to (such as kernel structures in process context) Attempting to write read-only memory (such as code segment)

---

<div class="post-metadata">

**Author:** ![MagnusL](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/magnusl/32/2380_2.png) [@MagnusL](https://gromacs.bioexcel.eu/u/MagnusL)\
**Post date:** [November 11, 2024, 6:34am UTC](https://gromacs.bioexcel.eu/t/segmentration-fault-and-to-small-of-a-timestep-problem-from-a-amber-built-system/8351/20 "2024-11-11T06:34:54Z")

</div>

I would suggest starting a new thread. The thread you posted in is probably not related to your problem.
