Amber-MD / cpptraj

Biomolecular simulation trajectory/data analysis.
Other
138 stars 64 forks source link

Segmentation fault (core dumped) with GIST #996

Closed robinshi123 closed 1 year ago

robinshi123 commented 2 years ago

Dear all,

I've been running MD simulations using CHARMM and have been trying to run water analysis using GIST in cpptraj. However. I found that with griddim greater than 10, the calculation always ends up with the same error: Segmentation fault (core dumped)

If I set the griddim <= 10, then the calculation is running fine. I suspect it is caused by memory limitation, so I re-do the calculation on the supercomputer at my university, but I still got the same error. The griddim value on the tutorials seems to be much larger than 10 (~40) so I wonder if it is some issue with the latest version of GIST.

I have attached the input and output files at the end. If you have any thoughts on this, please let me know. Any suggestions would be greatly appreciated. Thanks!

Best, Jie

cpptraj input file:

parm  /scratch/user/shijie0204/sh3/fixed/sh3-cabl/sh3f_cabl_fixed_neu.psf
trajin /scratch/user/shijie0204/sh3/fixed/sh3-cabl/dcd/sh3f_cabl_fixed_md_2.dcd   1 last
gist gridcntr 1 1 2  griddim 11 11 11 gridspacn 0.7
go

output in the log file with error:

CPPTRAJ: Trajectory Analysis. V6.15.1 (GitHub)


 | \/ | \/ | \/ | 
_|_/\_|_/\_|_/\_|_

| Date/time: 11/02/22 18:47:17 | Available memory: 106.799 GB

INPUT: Reading input from 'gist.cpptraj.in' [parm /scratch/user/shijie0204/sh3/fixed/sh3-cabl/sh3f_cabl_fixed_neu.psf] Reading '/scratch/user/shijie0204/sh3/fixed/sh3-cabl/sh3f_cabl_fixed_neu.psf' as Charmm PSF Reading Charmm PSF file sh3f_cabl_fixed_neu.psf as topology file. PSF contains 13863 atoms, 4375 residues. Warning: Determining bond length parameters from element types for 'sh3f_cabl_fixed_neu.psf'. [trajin /scratch/user/shijie0204/sh3/fixed/sh3-cabl/dcd/sh3f_cabl_fixed_md_2.dcd 1 last] Reading '/scratch/user/shijie0204/sh3/fixed/sh3-cabl/dcd/sh3f_cabl_fixed_md_2.dcd' as Charmm DCD Version >= 22; assuming shape matrix is stored. Warning: Trajectory box type is 'Cubic' but topology box type is 'None'. Warning: Setting topology box information from trajectory. [gist gridcntr 1 1 2 griddim 11 11 11 gridspacn 0.7] GIST: Output prefix= 'gist', grid output extension= '.dx' Output float format string= '%g', output integer format string= '%i' GIST info written to 'STDOUT' Name for data sets: GIST_00001 Skipping order calculation. Performing energy calculation. Cut off for determining solvent O-O neighbors is 3.500000 Ang Skipping water-water Eij matrix. Water reference density: 0.0334 molecules/Ang^3 Simulation temperature: 300.0000 K Distances will be imaged. -=Grid Dims=- X Y Z Bins: 11 11 11 Origin: -2.85 -2.85 -1.85 Spacing: 0.7 0.7 0.7 Center: 1 1 2 Box: Cubic ABC={7.7 7.7 7.7} abg={90 90 90} Number of voxels: 1331, voxel volume: 0.343000 Ang^3 Voxel occupancy will be determined using molecule center of mass. [go] ---------- RUN BEGIN -------------------------------------------------

PARAMETER FILES (1 total): 0: sh3f_cabl_fixed_neu.psf, 13863 atoms, 4375 res, box: Cubic, 4318 mol, 4295 solvent

INPUT TRAJECTORIES (1 total): 0: 'sh3f_cabl_fixed_md_2.dcd' is a CHARMM DCD file (coords) Little Endian 32 bit, Parm sh3f_cabl_fixed_neu.psf (Cubic box) (reading 2000 of 2000) Coordinate processing will occur on 2000 frames.

BEGIN TRAJECTORY PROCESSING: ..................................................... ACTION SETUP FOR PARM 'sh3f_cabl_fixed_neu.psf' (1 actions): 0: [gist gridcntr 1 1 2 griddim 11 11 11 gridspacn 0.7] Each solvent molecule has 3 atoms Using atoms H1-OH2-H2 as rigid substructure of the solvent. 4295 solvent molecules, 12885 solvent atoms, 978 solute atoms (13863 total). Imaging enabled for energy distance calculations. ----- sh3f_cabl_fixed_md_2.dcd (1-2000, 1) ----- Segmentation fault (core dumped)

drroe commented 2 years ago

Since it seems like the segfault happens right away, can you please post (or email to me) the topology (PSF) and 1 frame of the trajectory so I can try to reproduce this? Thanks!

robinshi123 commented 2 years ago

Since it seems like the segfault happens right away, can you please post (or email to me) the topology (PSF) and 1 frame of the trajectory so I can try to reproduce this? Thanks!

traj_files.zip

Please find attached a zip file that contains both psf file and the traj (dcd) file. Thank you so much!

drroe commented 2 years ago

Thanks for the files! I was able to reproduce the segfault; I'll look into it and get back to you ASAP.

robinshi123 commented 2 years ago

Thanks for the files! I was able to reproduce the segfault; I'll look into it and get back to you ASAP.

Thanks again for the help!

drroe commented 2 years ago

OK - I know what's going on here. The issue is that PSF files have topology information, but not parameters, which is what GIST needs to calculate the nonbond energy. While cpptraj does have the ability to read charmm parameters via the param keyword of the parm command, this is not well-tested. Your best bet would be to use the chamber command of the parmed program to convert your charmm psf and parameter files to an Amber topology, then use the Amber topology in place of the PSF when running cpptraj. In the meantime I'll try to get GIST working with PSFs (or at least have cpptraj exit gracefully with a helpful error message). Hope this helps!

robinshi123 commented 2 years ago

Thanks! As a CHARMM user, I actually have been wondering why the PSF file is called topology (which is a term used differently from CHARMM's).

Just another follow-up question: if I convert the PSF to an Amber topology, would this new topology file be compatible with CHARMM taj files (which are in DCD format)?

Thanks again! I really appreciate your prompt response and help!

drroe commented 2 years ago

I actually have been wondering why the PSF file is called topology (which is a term used differently from CHARMM's).

I'm calling it a topology file since it only contains topology information; it only describes how atoms in the system are connected via bonds, angles, torsions, etc. A PSF doesn't contains any parameters, i.e. it doesn't contains any information that is required by any force field terms (e.g. bond force constants, Lennard-Jones parameters, charges, etc).

if I convert the PSF to an Amber topology, would this new topology file be compatible with CHARMM taj files (which are in DCD format)?

You can use any topology format in CPPTRAJ with any trajectory format as long as the topology file (in Amber's case it's really a Parameter/Topology file) corresponds to the trajectory file.

robinshi123 commented 2 years ago

I'm calling it a topology file since it only contains topology information; it only describes how atoms in the system are connected via bonds, angles, torsions, etc. A PSF doesn't contain any parameters, i.e. it doesn't contain any information that is required by any force field terms (e.g. bond force constants, Lennard-Jones parameters, charges, etc).

Yes, it totally makes sense to me. It's just two different ways of usages of terminology by two systems. In CHARMM, the topology files refer to general files which contain connectivity information (bonds, angles, torsions, etc) within each specific residue, and from which the PSF is generated for each specific polypeptide. Thus, the types of content they contain are almost the same. Thanks for the clarification! I am happy that I can learn more about it.

You can use any topology format in CPPTRAJ with any trajectory format as long as the topology file (in Amber's case it's really a Parameter/Topology file) corresponds to the trajectory file.

That's good to know! I will try parmed and hopefully, it will solve my problem.

Again, thank you so much for the help!

drroe commented 2 years ago

As of version 6.15.2 (see #997) cpptraj should now exit gracefully (instead of segfaulting) when non-bonded parameters are not present.

drroe commented 2 years ago

Hi @robinshi123 , just wanted to follow up and see if the parmed solution worked for you.

robinshi123 commented 2 years ago

Hi @robinshi123 , just wanted to follow up and see if the parmed solution worked for you.

Thanks for asking! Actually, since I am not familiar with parmed, I used CHARMM-GUI to generate the Amber topology that contains all the parameters. And it seems to be working as a charm!