Re: [AMBER] Simple NAB script from manual segfaults at call to md()

From: case <case.biomaps.rutgers.edu>
Date: Thu, 17 Feb 2011 07:52:20 -0500

On Wed, Feb 16, 2011, Chris King wrote:

>
> After compiling with no errors, the script runs until it gets to the md
> step, at which point it segfaults; that is, there is some error with calling
> the md() function.

> Here is the script:
>
> //calc 100 md steps
> molecule m;
> float m_xyz[ dynamic ], f_xyz[ dynamic ], v[ dynamic ];
> float dummy[2], energy, dgrad;
> int minwin;
>
> m = getpdb_prm( "gly.pdb", "leaprc.ff99SB", "", 0 );
> allocate m_xyz[ 3*m.natoms ]; allocate f_xyz[ 3*m.natoms ];
> setxyz_from_mol( m, NULL, m_xyz );
>
> mm_options( "cut=25.0, ntpr=10, nsnb=999, gamma_ln=5.0" );
>
> mme_init( m, NULL, "::ZZZ", dummy, NULL );
> dgrad = 0.1;
> minwin = conjgrad( m_xyz, 3*m.natoms, energy, mme, dgrad, 10.0, 100 );
>
> mm_options( "ntpr_md=100, tempi=100.0, temp0=100.0" );
> //run md, 1step
> md( 3*m.natoms, 100, m_xyz, f_xyz, v, mme );
                                   ^^^^^

Looks like you forgot to allocate v[]; see line 12 of the example in section
14.2 of the Users' Manual.

....dac


_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
Received on Thu Feb 17 2011 - 05:00:02 PST
Custom Search