[gmx-developers] Re: gmx-developers digest, Vol 1 #196 - 3 msgs

Fan Hao f.Hao at chem.rug.nl
Sun Jul 13 15:55:49 CEST 2003


Thanks a lot, Eric and David! I will try a debugger while
this time I used some library functions through debug pointer
to check. Other than stdlog, I got all the coordinates of
the molecule. So I guess the first time I did read/write
memory that doesn't belong to the process as you suggested. 
Now the modified gmx is working fine according to the related
energy, force and other parameters. I will work on further
dynamic tests then. Thank you very much!


> Message: 2
> Date: Fri, 11 Jul 2003 21:12:18 -0700
> Subject: Re: [gmx-developers] (no subject)
> From: Erik Lindahl <lindahl at stanford.edu>
> To: gmx-developers at gromacs.org
> Reply-To: gmx-developers at gromacs.org
> 
> Hi Hao,
> 
> I guess this is in your modified version, right? Otherwise we should  
> look into it.
> 
> Segmentation fault means you are reading/writing memory that doesn't  
> belong to your process. The most common case is that you allocate an  
> array of say length 300 and then try to access element 400.
> 
> I guess you are getting a segmentation fault when you access atom 700  
> in your print statement. I would recommend spending a couple of hours  
> and learn to use a debugger - it's time well invested, and then you can  
> stop at any point you want and check the values of variables.
> 
> (Said by somebody who still is lazy and uses print statements even  
> after learning debuggers - do as I say and not as I do :-)
> 
> Cheers,
> 
> Erik
> 
> Message: 3
> Subject: Re: [gmx-developers] (no subject)
> From: David <spoel at xray.bmc.uu.se>
> To: gmx-developers at gromacs.org
> Organization: 
> Date: 12 Jul 2003 08:34:42 +0200
> Reply-To: gmx-developers at gromacs.org
> 
> Apart from using a debugger, you could start with running mdrun -debug
> which will give you a lot of extra output.
> Rather than writing such print statements you could use some of the
> library functions:
>   if (debug)
>     pr_rvecs(debug,0,"my coordinates",x,natoms);
> 
> Don't put numbers (like 833) in the code if you can avoid it!
> 




More information about the gromacs.org_gmx-developers mailing list