gmx_lincsdata_t init_lincs(FILE *fplog,gmx_mtop_t *mtop, int nflexcon_global,t_blocka *at2con, gmx_bool bPLINCS,int nIter,int nProjOrder) { struct gmx_lincsdata *li; int mb; gmx_moltype_t *molt; if (fplog) { fprintf(fplog,"\nInitializing%s LINear Constraint Solver\n", bPLINCS ? " Parallel" : ""); } snew(li,1); li->ncg = gmx_mtop_ftype_count(mtop,F_CONSTR) + gmx_mtop_ftype_count(mtop,F_CONSTRNC); li->ncg_flex = nflexcon_global; li->ncg_triangle = 0; for(mb=0; mb<mtop->nmolblock; mb++) { molt = &mtop->moltype[mtop->molblock[mb].type]; li->ncg_triangle += mtop->molblock[mb].nmol* count_triangle_constraints(molt->ilist, &at2con[mtop->molblock[mb].type]); } li->nIter = nIter; li->nOrder = nProjOrder; if (bPLINCS || li->ncg_triangle > 0) { please_cite(fplog,"Hess2008a"); } else { please_cite(fplog,"Hess97a"); } if (fplog) { fprintf(fplog,"The number of constraints is %d\n",li->ncg); if (bPLINCS) { fprintf(fplog,"There are inter charge-group constraints,\n" "will communicate selected coordinates each lincs iteration\n"); } if (li->ncg_triangle > 0) { fprintf(fplog, "%d constraints are involved in constraint triangles,\n" "will apply an additional matrix expansion of order %d for couplings\n" "between constraints inside triangles\n", li->ncg_triangle,li->nOrder); } } return li; }
gmx_lincsdata_t init_lincs(FILE *fplog,gmx_mtop_t *mtop, int nflexcon_global,t_blocka *at2con, gmx_bool bPLINCS,int nIter,int nProjOrder) { struct gmx_lincsdata *li; int mb; gmx_moltype_t *molt; if (fplog) { fprintf(fplog,"\nInitializing%s LINear Constraint Solver\n", bPLINCS ? " Parallel" : ""); } snew(li,1); li->ncg = gmx_mtop_ftype_count(mtop,F_CONSTR) + gmx_mtop_ftype_count(mtop,F_CONSTRNC); li->ncg_flex = nflexcon_global; li->ncg_triangle = 0; for(mb=0; mb<mtop->nmolblock; mb++) { molt = &mtop->moltype[mtop->molblock[mb].type]; li->ncg_triangle += mtop->molblock[mb].nmol* count_triangle_constraints(molt->ilist, &at2con[mtop->molblock[mb].type]); } li->nIter = nIter; li->nOrder = nProjOrder; /* LINCS can run on any number of threads. * Currently the number is fixed for the whole simulation, * but it could be set in set_lincs(). */ li->nth = gmx_omp_nthreads_get(emntLINCS); if (li->nth == 1) { snew(li->th,1); } else { /* Allocate an extra elements for "thread-overlap" constraints */ snew(li->th,li->nth+1); } if (debug) { fprintf(debug,"LINCS: using %d threads\n",li->nth); } if (bPLINCS || li->ncg_triangle > 0) { please_cite(fplog,"Hess2008a"); } else { please_cite(fplog,"Hess97a"); } if (fplog) { fprintf(fplog,"The number of constraints is %d\n",li->ncg); if (bPLINCS) { fprintf(fplog,"There are inter charge-group constraints,\n" "will communicate selected coordinates each lincs iteration\n"); } if (li->ncg_triangle > 0) { fprintf(fplog, "%d constraints are involved in constraint triangles,\n" "will apply an additional matrix expansion of order %d for couplings\n" "between constraints inside triangles\n", li->ncg_triangle,li->nOrder); } } return li; }