From: Mark Abraham Date: Thu, 2 Nov 2017 09:43:11 +0000 (+0100) Subject: Merge branch release-2016 X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=commitdiff_plain;h=60dc492792a6d423aad82b3be9ad91755cb457ce;p=alexxy%2Fgromacs.git Merge branch release-2016 Ensured fix for gmx compare cmp_atoms went to the right code. Change-Id: Iabc8ec03e7ebc45517f63697c3e7dea12b3f5398 --- 60dc492792a6d423aad82b3be9ad91755cb457ce diff --cc src/gromacs/tables/forcetable.cpp index 4742c58ea4,55dbfc4b83..cfd20340b9 --- a/src/gromacs/tables/forcetable.cpp +++ b/src/gromacs/tables/forcetable.cpp @@@ -1394,16 -1425,15 +1394,17 @@@ t_forcetable *make_tables(FILE *out for (int k = 0; (k < etiNR); k++) { - /* Now fill data for tables that should not be read (perhaps - overwriting data that was read but should not be used) */ - if (!ETAB_USER(tabsel[k])) + /* Now fill data for tables that have not been read + * or add the Ewald long-range correction for Ewald user tables. + */ + if (tabsel[k] != etabUSER) { real scale = table->scale; - if (fr->bBHAM && (fr->bham_b_max != 0) && tabsel[k] == etabEXPMIN) + if (ic->useBuckingham && + (ic->buckinghamBMax != 0) && + tabsel[k] == etabEXPMIN) { - scale /= fr->bham_b_max; + scale /= ic->buckinghamBMax; } init_table(table->n, nx0, scale, &(td[k]), !useUserTable); diff --cc src/gromacs/taskassignment/resourcedivision.cpp index 541cd79d03,20efcca11c..fecba7db1f --- a/src/gromacs/taskassignment/resourcedivision.cpp +++ b/src/gromacs/taskassignment/resourcedivision.cpp @@@ -59,12 -54,10 +59,13 @@@ #include "gromacs/mdtypes/commrec.h" #include "gromacs/mdtypes/inputrec.h" #include "gromacs/mdtypes/md_enums.h" +#include "gromacs/taskassignment/hardwareassign.h" + #include "gromacs/topology/mtop_util.h" #include "gromacs/topology/topology.h" +#include "gromacs/utility/baseversion.h" #include "gromacs/utility/fatalerror.h" #include "gromacs/utility/gmxassert.h" +#include "gromacs/utility/logger.h" #include "gromacs/utility/stringutil.h" diff --cc src/gromacs/topology/atoms.cpp index 72b504596a,cc04615c90..0fa17bcd36 --- a/src/gromacs/topology/atoms.cpp +++ b/src/gromacs/topology/atoms.cpp @@@ -339,92 -326,3 +339,92 @@@ void pr_atomtypes(FILE *fp, int indent } } } + +static void cmp_atom(FILE *fp, int index, const t_atom *a1, const t_atom *a2, real ftol, real abstol) +{ + if (a2) + { + cmp_us(fp, "atom.type", index, a1->type, a2->type); + cmp_us(fp, "atom.ptype", index, a1->ptype, a2->ptype); + cmp_int(fp, "atom.resind", index, a1->resind, a2->resind); + cmp_int(fp, "atom.atomnumber", index, a1->atomnumber, a2->atomnumber); + cmp_real(fp, "atom.m", index, a1->m, a2->m, ftol, abstol); + cmp_real(fp, "atom.q", index, a1->q, a2->q, ftol, abstol); + cmp_us(fp, "atom.typeB", index, a1->typeB, a2->typeB); + cmp_real(fp, "atom.mB", index, a1->mB, a2->mB, ftol, abstol); + cmp_real(fp, "atom.qB", index, a1->qB, a2->qB, ftol, abstol); + } + else + { + cmp_us(fp, "atom.type", index, a1->type, a1->typeB); + cmp_real(fp, "atom.m", index, a1->m, a1->mB, ftol, abstol); + cmp_real(fp, "atom.q", index, a1->q, a1->qB, ftol, abstol); + } +} + +void cmp_atoms(FILE *fp, const t_atoms *a1, const t_atoms *a2, real ftol, real abstol) +{ + int i; + + fprintf(fp, "comparing atoms\n"); + + if (a2) + { + cmp_int(fp, "atoms->nr", -1, a1->nr, a2->nr); - for (i = 0; (i < a1->nr); i++) ++ for (i = 0; i < std::min(a1->nr, a2->nr); i++) + { + cmp_atom(fp, i, &(a1->atom[i]), &(a2->atom[i]), ftol, abstol); + } + } + else + { + for (i = 0; (i < a1->nr); i++) + { + cmp_atom(fp, i, &(a1->atom[i]), nullptr, ftol, abstol); + } + } +} + +void atomsSetMassesBasedOnNames(t_atoms *atoms, gmx_bool printMissingMasses) +{ + if (atoms->haveMass) + { + /* We could decide to anyhow assign then or generate a fatal error, + * but it's probably most useful to keep the masses we have. + */ + return; + } + + int maxWarn = (printMissingMasses ? 10 : 0); + int numWarn = 0; + + gmx_atomprop_t aps = gmx_atomprop_init(); + + gmx_bool haveMass = TRUE; + for (int i = 0; i < atoms->nr; i++) + { + if (!gmx_atomprop_query(aps, epropMass, + *atoms->resinfo[atoms->atom[i].resind].name, + *atoms->atomname[i], + &atoms->atom[i].m)) + { + haveMass = FALSE; + + if (numWarn < maxWarn) + { + fprintf(stderr, "Can not find mass in database for atom %s in residue %d %s\n", + *atoms->atomname[i], + atoms->resinfo[atoms->atom[i].resind].nr, + *atoms->resinfo[atoms->atom[i].resind].name); + numWarn++; + } + else + { + break; + } + } + } + atoms->haveMass = haveMass; + + gmx_atomprop_destroy(aps); +}