Re: [AMBER] Changing the Lennard Jones potential

From: Jason Swails <jason.swails.gmail.com>
Date: Sun, 29 Sep 2013 07:58:23 -0400

On Sat, Sep 28, 2013 at 6:44 PM, Pengzhi Zhang <pzhang5.central.uh.edu>wrote:

> Dear amber users,
>
> I am trying to implement a modified vdw potential in sander of amber 10
> with
> a desolvation barrier (~r^10). In this case, a 6-10-12 form of potential is
> used.
>
> I plan to achieve this by editing the prmtop, %FLAG LENNARD_JONES_ACOEF,
> %FLAG LENNARD_JONES_BCOEF, %FLAG LENNARD_JONES_CCOEF (this term is added)
> and correspondingly add another array in the src code cn1(),cn2(),
> cn3()(this array is added).
>

Did you allocate this array?


> I have a problem reading the third array correctly. Compilation stopped
> with
> "Segmentation fault", and I printed out the arrays, they were all 0.


Compiling rarely yields a segfault (unless the compiler is buggy). I'm
assuming you mean that when you ran your modified program it segfaulted.
 Was this in serial or parallel? If parallel, does it work in serial?

If you know how to use valgrind or gdb, it can point you to the exact line
of the segfault (as long as you compile with debug symbols and turn off
compiler optimizations). (Keep in mind that the line it points to is in
the _xxxxxx.f file (note the leading underscore). [This is not true in
Amber 12 -- it corresponds to real line numbers of the actual files.]



> I
> mainly changed the file rdparm.f and changed the integration force in
> ew_directe.h and short_ene.f. Is there anyone who has some idea about what
> need to pay attention when trying to read ? Any help is appreciated.
>

A segfault is a memory violation. In this type of situation, my guess is
that some of the memory you're trying to write to or read from the new
arrays you just made (but perhaps forgot to allocate).
HTH,
Jason

-- 
Jason M. Swails
BioMaPS,
Rutgers University
Postdoctoral Researcher
_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
Received on Sun Sep 29 2013 - 05:00:04 PDT
Custom Search