[gmx-users] how to simulate a line charge

Amit Choubey kgp.amit at gmail.com
Sat Aug 13 08:33:31 CEST 2011


I change the maximum charge group size defined in the include/types/nblist.h
header from 32 to 267. Then grompp worked fine but the mdrun did not start.
The following error came out

Program mdrun_jptlc, VERSION 4.5.3
Source code file: ns.c, line: 2417

Fatal error:
Max #atoms in a charge group: 267 > 64

For more information and tips for troubleshooting, please check the GROMACS
website at http://www.gromacs.org/Documentation/Errors

In ns.c the relevant section (in bold) is the following:


void init_ns(FILE *fplog,const t_commrec *cr,
             gmx_ns_t *ns,t_forcerec *fr,
             const gmx_mtop_t *mtop,
             matrix box)
{
    int  mt,icg,nr_in_cg,maxcg,i,j,jcg,ngid,ncg;
    t_block *cgs;
    char *ptr;

    /* Compute largest charge groups size (# atoms) */
    nr_in_cg=1;
    for(mt=0; mt<mtop->nmoltype; mt++) {
        cgs = &mtop->moltype[mt].cgs;
        for (icg=0; (icg < cgs->nr); icg++)
        {
            nr_in_cg=max(nr_in_cg,(int)(cgs->index[icg+1]-cgs->index[icg]));
        }
    }

   * /* Verify whether largest charge group is <= max cg.*
*     * This is determined by the type of the local exclusion type *
*     * Exclusions are stored in bits. (If the type is not large*
*     * enough, enlarge it, unsigned char -> unsigned short -> unsigned
long)*
*     */*
*    maxcg = sizeof(t_excl)*8;*
*    if (nr_in_cg > maxcg)*
*    {*
*        gmx_fatal(FARGS,"Max #atoms in a charge group: %d > %d\n",*
*                  nr_in_cg,maxcg);*
*    }*

    ngid = mtop->groups.grps[egcENER].nr;
    snew(ns->bExcludeAlleg,ngid);
    for(i=0; i<ngid; i++) {
        ns->bExcludeAlleg[i] = TRUE;
        for(j=0; j<ngid; j++)
        {
            if (!(fr->egp_flags[i*ngid+j] & EGP_EXCL))
            {
                ns->bExcludeAlleg[i] = FALSE;
            }
        }
    }

    if (fr->bGrid) {
        /* Grid search */
        ns->grid = init_grid(fplog,fr);
        init_nsgrid_lists(fr,ngid,ns);
    }
    else
    {
        /* Simple search */
        snew(ns->ns_buf,ngid);
        for(i=0; (i<ngid); i++)
        {
            snew(ns->ns_buf[i],SHIFTS);
        }
        ncg = ncg_mtop(mtop);
        snew(ns->simple_aaj,2*ncg);
        for(jcg=0; (jcg<ncg); jcg++)
        {
            ns->simple_aaj[jcg]     = jcg;
            ns->simple_aaj[jcg+ncg] = jcg;
        }
    }

    /* Create array that determines whether or not atoms have VdW */
    snew(ns->bHaveVdW,fr->ntype);
    for(i=0; (i<fr->ntype); i++)
    {
        for(j=0; (j<fr->ntype); j++)
        {
            ns->bHaveVdW[i] = (ns->bHaveVdW[i] ||
                               (fr->bBHAM ?
                                ((BHAMA(fr->nbfp,fr->ntype,i,j) != 0) ||
                                 (BHAMB(fr->nbfp,fr->ntype,i,j) != 0) ||
                                 (BHAMC(fr->nbfp,fr->ntype,i,j) != 0)) :
                                ((C6(fr->nbfp,fr->ntype,i,j) != 0) ||
                                 (C12(fr->nbfp,fr->ntype,i,j) != 0))));
        }
    }
    if (debug)
        pr_bvec(debug,0,"bHaveVdW",ns->bHaveVdW,fr->ntype,TRUE);

    ns->nra_alloc = 0;
    ns->bexcl = NULL;
    if (!DOMAINDECOMP(cr))
    {
        /* This could be reduced with particle decomposition */
        ns_realloc_natoms(ns,mtop->natoms);
    }

    ns->nblist_initialized=FALSE;

    /* nbr list debug dump */
    {
        char *ptr=getenv("GMX_DUMP_NL");
        if (ptr)
        {
            ns->dump_nl=strtol(ptr,NULL,10);
            if (fplog)
            {
                fprintf(fplog, "GMX_DUMP_NL = %d", ns->dump_nl);
            }
        }
        else
        {
            ns->dump_nl=0;
        }
    }
}


Any ideas ?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://maillist.sys.kth.se/pipermail/gromacs.org_gmx-users/attachments/20110812/7c458410/attachment.html>


More information about the gromacs.org_gmx-users mailing list