[gmx-developers] smalloc.c

Yang Ye leafyoung81-group at yahoo.com
Fri May 12 10:05:12 CEST 2006


David van der Spoel wrote:
> Patricia Soto Becerra wrote:
>> Hi,
>> I want to implement the rest algorithm (PNAS, 102, 39, 13749-13754. 
>> (2005)). I have been following the discussions in the list of a very 
>> similar implementation, particularly:
>>
>> http://www.gromacs.org/pipermail/gmx-developers/2006-January/001493.html
>> http://www.gromacs.org/pipermail/gmx-developers/2006-January/001494.html
>>
>> Nevertheless, I get the error message:
>> ______________________________________
>> Source code file: smalloc.c, line: 113
>> Fatal error:
>> calloc for ir->opts.nrdf (nelem=1066665789, elsize=4, file tpxio.c, 
>> line 487)
>> -------------------------------------------------------
>>
>> I just cannot figure it out... Does anybody have a suggestion on how 
>> to solve this?
>>
> there must be an inconsistency in your tpr file. Did you try to modify 
> that?
This mistake shall not be derived from the changes I suggested. This is 
the changes I have made. They are declared to be under GPL.

include/types/idef.h
1. in first enum    add    F_EPOT_NOSOL    after F_NRE

include/tgroup.h
2. extern void sum_epot_nosol(t_grpopts *opts,t_groups *grps,real epot[]);

src/kernel/md.c
3. change snew(ener,F_NRE); to snew(ener,F_NRE+1);
4. replace
sum_epot(&(inputrec->opts),grps,ener);
to
sum_epot_nosol(&(inputrec->opts),grps,ener); /*Fill in F_EPOT_NOSOL*/
5. replace
    if ((repl_ex_nst > 0) && (step > 0) && !bLastStep && 
do_per_step(step,repl_ex_nst))
        bExchanged = 
replica_exchange(log,mcr,repl_ex,state,ener[F_EPOT],step,t);
to
    if ((repl_ex_nst > 0) && (step > 0) && !bLastStep && 
do_per_step(step,repl_ex_nst))
        bExchanged = 
replica_exchange(log,mcr,repl_ex,state,ener[F_EPOT_NOSOL],step,t);

/src/mdlib/tgroup.c
6. add
void sum_epot_nosol(t_grpopts *opts,t_groups *grps,real epot[])
{
  int i;
  sum_epot(opts,grps,epot);
  epot[F_EPOT_NOSOL] = epot[F_EPOT] - \
                       (grps->estat.ee[egCOULSR][grps->estat.nn-1] + \
                        grps->estat.ee[egLJSR][grps->estat.nn-1]   + \
                        grps->estat.ee[egLJ14][grps->estat.nn-1]   + \
                        grps->estat.ee[egCOUL14][grps->estat.nn-1] + \
                        grps->estat.ee[egCOULLR][grps->estat.nn-1] + \
                        grps->estat.ee[egLJLR][grps->estat.nn-1]   + \
                        grps->estat.ee[egBHAMSR][grps->estat.nn-1] + \
                        grps->estat.ee[egBHAMLR][grps->estat.nn-1]);
}

Regards,
Yang Ye




More information about the gromacs.org_gmx-developers mailing list