Пример #1
0
void init_domdec_constraints(gmx_domdec_t *dd,
                             gmx_mtop_t *mtop,
                             gmx_constr_t constr)
{
    gmx_domdec_constraints_t *dc;
    gmx_molblock_t *molb;
    int mb,ncon,c,a;
    
    if (debug)
    {
        fprintf(debug,"Begin init_domdec_constraints\n");
    }
    
    snew(dd->constraints,1);
    dc = dd->constraints;
    
    snew(dc->molb_con_offset,mtop->nmolblock);
    snew(dc->molb_ncon_mol,mtop->nmolblock);
    
    ncon = 0;
    for(mb=0; mb<mtop->nmolblock; mb++)
    {
        molb = &mtop->molblock[mb];
        dc->molb_con_offset[mb] = ncon;
        dc->molb_ncon_mol[mb] =
            mtop->moltype[molb->type].ilist[F_CONSTR].nr/3 +
            mtop->moltype[molb->type].ilist[F_CONSTRNC].nr/3;
        ncon += molb->nmol*dc->molb_ncon_mol[mb];
    }
    
    if (ncon > 0)
    {
        snew(dc->gc_req,ncon);
        for(c=0; c<ncon; c++)
        {
            dc->gc_req[c] = 0;
        }
    }

    /* Use a hash table for the global to local index.
     * The number of keys is a rough estimate, it will be optimized later.
     */
    dc->ga2la = gmx_hash_init(min(mtop->natoms/20,
                                  mtop->natoms/(2*dd->nnodes)));

    dc->nthread = gmx_omp_nthreads_get(emntDomdec);
    snew(dc->ils,dc->nthread);

    dd->constraint_comm = specat_comm_init(dc->nthread);
}
Пример #2
0
void init_domdec_vsites(gmx_domdec_t *dd, int n_intercg_vsite)
{
    if (debug)
    {
        fprintf(debug, "Begin init_domdec_vsites\n");
    }

    /* Use a hash table for the global to local index.
     * The number of keys is a rough estimate, it will be optimized later.
     */
    dd->ga2la_vsite = gmx_hash_init(std::min(n_intercg_vsite/20,
                                             n_intercg_vsite/(2*dd->nnodes)));

    dd->vsite_comm = specat_comm_init(1);
}