From: Paul Bauer Date: Fri, 27 Dec 2019 12:58:41 +0000 (+0100) Subject: Merge origin/release-2019 into release-2020 X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=commitdiff_plain;h=0129e2ccd1753d49c919d32ede523f214d3e8432;p=alexxy%2Fgromacs.git Merge origin/release-2019 into release-2020 Resolved Conflicts: cmake/FindHwloc.cmake cmake/gmxVersionInfo.cmake docs/CMakeLists.txt src/gromacs/gmxana/anadih.cpp src/gromacs/gmxana/gmx_angle.cpp src/gromacs/mdlib/forcerec.cpp Change-Id: Ie4408c932a712d4f9d1f42117a512e0474535df5 --- 0129e2ccd1753d49c919d32ede523f214d3e8432 diff --cc docs/CMakeLists.txt index b13a72c54d,204e2fea88..32636d3dd1 --- a/docs/CMakeLists.txt +++ b/docs/CMakeLists.txt @@@ -361,15 -367,7 +361,16 @@@ if (SPHINX_FOUND how-to/visualize.rst install-guide/index.rst release-notes/index.rst + release-notes/2020/major/highlights.rst + release-notes/2020/major/features.rst + release-notes/2020/major/performance.rst + release-notes/2020/major/tools.rst + release-notes/2020/major/bugs-fixed.rst + release-notes/2020/major/removed-functionality.rst + release-notes/2020/major/deprecated-functionality.rst + release-notes/2020/major/portability.rst + release-notes/2020/major/miscellaneous.rst + release-notes/2019/2019.6.rst release-notes/2019/2019.5.rst release-notes/2019/2019.4.rst release-notes/2019/2019.3.rst diff --cc src/gromacs/fileio/pdbio.cpp index 3466d8d4f1,9a30b7fa5d..f431614cc8 --- a/src/gromacs/fileio/pdbio.cpp +++ b/src/gromacs/fileio/pdbio.cpp @@@ -747,15 -806,15 +747,15 @@@ gmx_bool is_dummymass(const char* nm std::strcpy(buf, nm); trim(buf); - return (buf[0] == 'M') && (std::isdigit(buf[strlen(buf)-1]) != 0); + return (buf[0] == 'M') && (std::isdigit(buf[strlen(buf) - 1]) != 0); } -static void gmx_conect_addline(gmx_conect_t *con, char *line) +static void gmx_conect_addline(gmx_conect_t* con, char* line) { - int n, ai, aj; + int n, ai, aj; - std::string form2 = "%%*s"; - std::string format = form2 + "%%d"; + std::string form2 = "%*s"; + std::string format = form2 + "%d"; if (sscanf(line, format.c_str(), &ai) == 1) { do diff --cc src/gromacs/gmxana/anadih.cpp index b76f99dc1a,c266e8961d..bfe16bede1 --- a/src/gromacs/gmxana/anadih.cpp +++ b/src/gromacs/gmxana/anadih.cpp @@@ -45,8 -45,9 +45,9 @@@ #include "gromacs/fileio/confio.h" #include "gromacs/fileio/trxio.h" #include "gromacs/fileio/xvgr.h" + #include "gromacs/gmxana/angle_correction.h" #include "gromacs/gmxana/gstat.h" -#include "gromacs/listed-forces/bonded.h" +#include "gromacs/listed_forces/bonded.h" #include "gromacs/math/functions.h" #include "gromacs/math/units.h" #include "gromacs/math/vec.h" @@@ -813,32 -808,26 +814,32 @@@ void normalize_histo(int npoints, cons } } -void read_ang_dih(const char *trj_fn, - gmx_bool bAngles, gmx_bool bSaveAll, gmx_bool bRb, gmx_bool bPBC, - int maxangstat, int angstat[], - int *nframes, real **time, - int isize, int index[], - real **trans_frac, - real **aver_angle, - real *dih[], - const gmx_output_env_t *oenv) +void read_ang_dih(const char* trj_fn, + gmx_bool bAngles, + gmx_bool bSaveAll, + gmx_bool bRb, + gmx_bool bPBC, + int maxangstat, + int angstat[], + int* nframes, + real** time, + int isize, + int index[], + real** trans_frac, + real** aver_angle, + real* dih[], + const gmx_output_env_t* oenv) { - struct t_pbc *pbc; - t_trxstatus *status; + struct t_pbc* pbc; + t_trxstatus* status; int i, angind, total, teller; int nangles, n_alloc; - real t, fraction, pifac, aa, angle; + real t, fraction, pifac, angle; - real *angles[2]; + real* angles[2]; matrix box; - rvec *x; + rvec* x; int cur = 0; -#define prev (1-cur) +#define prev (1 - cur) snew(pbc, 1); read_first_x(oenv, &status, trj_fn, &t, &x, box); @@@ -946,9 -935,16 +947,16 @@@ } /* Average angles */ - aa = 0; + double aa = 0; for (i = 0; (i < nangles); i++) { + if (!bAngles && i > 0) + { - real diffa = angles[cur][i] - angles[cur][i-1]; ++ real diffa = angles[cur][i] - angles[cur][i - 1]; + diffa = correctRadianAngleRange(diffa); - angles[cur][i] = angles[cur][i-1] + diffa; ++ angles[cur][i] = angles[cur][i - 1] + diffa; + } + aa = aa + angles[cur][i]; /* angle in rad / 2Pi * max determines bin. bins go from 0 to maxangstat, @@@ -960,15 -956,7 +968,7 @@@ angle = angles[cur][i]; if (!bAngles) { - while (angle < -M_PI) - { - angle += 2 * M_PI; - } - while (angle >= M_PI) - { - angle -= 2 * M_PI; - } - - angle = correctRadianAngleRange(angle); ++ angle = correctRadianAngleRange(angle); angle += M_PI; } @@@ -994,7 -983,8 +994,8 @@@ } /* average over all angles */ - (*aver_angle)[teller] = (aa / nangles); - aa = correctRadianAngleRange(aa/nangles); ++ aa = correctRadianAngleRange(aa / nangles); + (*aver_angle)[teller] = (aa); /* this copies all current dih. angles to dih[i], teller is frame */ if (bSaveAll) diff --cc src/gromacs/gmxana/angle_correction.cpp index 0000000000,aaa687f93a..3ee9a99542 mode 000000,100644..100644 --- a/src/gromacs/gmxana/angle_correction.cpp +++ b/src/gromacs/gmxana/angle_correction.cpp @@@ -1,0 -1,56 +1,56 @@@ + /* + * This file is part of the GROMACS molecular simulation package. + * + * Copyright (c) 2019, by the GROMACS development team, led by + * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl, + * and including many others, as listed in the AUTHORS file in the + * top-level source directory and at http://www.gromacs.org. + * + * GROMACS is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 + * of the License, or (at your option) any later version. + * + * GROMACS is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with GROMACS; if not, see + * http://www.gnu.org/licenses, or write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * If you want to redistribute modifications to GROMACS, please + * consider that scientific software is very special. Version + * control is crucial - bugs must be traceable. We will be happy to + * consider code for inclusion in the official distribution, but + * derived work must not be called official GROMACS. Details are found + * in the README & COPYING files - if they are missing, get the + * official version at http://www.gromacs.org. + * + * To help us fund GROMACS development, we humbly ask that you cite + * the research papers on the package. Check out http://www.gromacs.org. + */ + #include "gmxpre.h" + + #include "angle_correction.h" + + #include + + #include "gromacs/math/units.h" + #include "gromacs/math/vec.h" + + real correctRadianAngleRange(const real angle) + { + real correctedAngle = angle; + while (correctedAngle < -M_PI) + { - correctedAngle += 2*M_PI; ++ correctedAngle += 2 * M_PI; + } + while (correctedAngle >= M_PI) + { - correctedAngle -= 2*M_PI; ++ correctedAngle -= 2 * M_PI; + } + return correctedAngle; + } diff --cc src/gromacs/gmxana/cmat.cpp index cde327414c,b695f21f68..07368d9d41 --- a/src/gromacs/gmxana/cmat.cpp +++ b/src/gromacs/gmxana/cmat.cpp @@@ -227,10 -228,10 +227,10 @@@ void low_rmsd_dist(const char* fn, rea } } - fp = xvgropen(fn, "RMS Distribution", "RMS (nm)", "a.u.", oenv); + fp = xvgropen(fn, "RMS Distribution", "RMS (nm)", "counts", oenv); for (i = 0; (i < 101); i++) { - fprintf(fp, "%10g %10d\n", i/fac, histo[i]); + fprintf(fp, "%10g %10d\n", i / fac, histo[i]); } xvgrclose(fp); sfree(histo); diff --cc src/gromacs/gmxana/gmx_angle.cpp index 0a92c634d8,b8f5da3b7a..e99bee5628 --- a/src/gromacs/gmxana/gmx_angle.cpp +++ b/src/gromacs/gmxana/gmx_angle.cpp @@@ -162,32 -152,38 +163,31 @@@ int gmx_g_angle(int argc, char* argv[] "Counting transitions only works for dihedrals with multiplicity 3" }; - FILE *out; - real dt; - int isize; - int *index; - char *grpname; - real maxang, S2, norm_fac, maxstat; - unsigned long mode; - int nframes, maxangstat, mult, *angstat; - int i, j, nangles, first, last; - gmx_bool bAver, bRb, bPeriodic, - bFrac, /* calculate fraction too? */ - bTrans, /* worry about transtions too? */ - bCorr; /* correlation function ? */ - double tfrac = 0; - char title[256]; - real **dih = nullptr; /* mega array with all dih. angles at all times*/ - real *time, *trans_frac, *aver_angle; - t_filenm fnm[] = { - { efTRX, "-f", nullptr, ffREAD }, - { efNDX, nullptr, "angle", ffREAD }, - { efXVG, "-od", "angdist", ffWRITE }, - { efXVG, "-ov", "angaver", ffOPTWR }, - { efXVG, "-of", "dihfrac", ffOPTWR }, - { efXVG, "-ot", "dihtrans", ffOPTWR }, - { efXVG, "-oh", "trhisto", ffOPTWR }, - { efXVG, "-oc", "dihcorr", ffOPTWR }, - { efTRR, "-or", nullptr, ffOPTWR } - }; + FILE* out; + real dt; + int isize; + int* index; + char* grpname; + real maxang, S2, norm_fac, maxstat; + unsigned long mode; + int nframes, maxangstat, mult, *angstat; + int i, j, nangles, first, last; + gmx_bool bAver, bRb, bPeriodic, bFrac, /* calculate fraction too? */ + bTrans, /* worry about transtions too? */ + bCorr; /* correlation function ? */ - real aver, aver2, aversig; /* fraction trans dihedrals */ + double tfrac = 0; + char title[256]; + real** dih = nullptr; /* mega array with all dih. angles at all times*/ + real * time, *trans_frac, *aver_angle; + t_filenm fnm[] = { { efTRX, "-f", nullptr, ffREAD }, { efNDX, nullptr, "angle", ffREAD }, + { efXVG, "-od", "angdist", ffWRITE }, { efXVG, "-ov", "angaver", ffOPTWR }, + { efXVG, "-of", "dihfrac", ffOPTWR }, { efXVG, "-ot", "dihtrans", ffOPTWR }, + { efXVG, "-oh", "trhisto", ffOPTWR }, { efXVG, "-oc", "dihcorr", ffOPTWR }, + { efTRR, "-or", nullptr, ffOPTWR } }; #define NFILE asize(fnm) - int npargs; - t_pargs *ppa; - gmx_output_env_t *oenv; + int npargs; + t_pargs* ppa; + gmx_output_env_t* oenv; npargs = asize(pa); ppa = add_acf_pargs(&npargs, pa); @@@ -400,22 -402,50 +400,43 @@@ /* Determine the non-zero part of the distribution */ - for (first = 0; (first < maxangstat-1) && (angstat[first+1] == 0); first++) - { - ; - } - for (last = maxangstat-1; (last > 0) && (angstat[last-1] == 0); last--) - { - ; - } + for (first = 0; (first < maxangstat - 1) && (angstat[first + 1] == 0); first++) {} + for (last = maxangstat - 1; (last > 0) && (angstat[last - 1] == 0); last--) {} - aver = aver2 = 0; - for (i = 0; (i < nframes); i++) - { - aver += RAD2DEG * aver_angle[i]; - aver2 += gmx::square(RAD2DEG * aver_angle[i]); - double aver = 0; - printf("Found points in the range from %d to %d (max %d)\n", - first, last, maxangstat); - if (bTrans || bCorr || bALL || opt2bSet("-or", NFILE, fnm)) - { /* It's better to re-calculate Std. Dev per sample */ ++ double aver = 0; ++ printf("Found points in the range from %d to %d (max %d)\n", first, last, maxangstat); ++ if (bTrans || bCorr || bALL || opt2bSet("-or", NFILE, fnm)) ++ { /* It's better to re-calculate Std. Dev per sample */ + real b_aver = aver_angle[0]; + real b = dih[0][0]; + real delta; + for (int i = 0; (i < nframes); i++) + { - delta = correctRadianAngleRange(aver_angle[i] - b_aver); ++ delta = correctRadianAngleRange(aver_angle[i] - b_aver); + b_aver += delta; - aver += b_aver; ++ aver += b_aver; + for (int j = 0; (j < nangles); j++) + { - delta = correctRadianAngleRange(dih[j][i] - b); - b += delta; ++ delta = correctRadianAngleRange(dih[j][i] - b); ++ b += delta; + } + } + } + else - { /* Incorrect for Std. Dev. */ ++ { /* Incorrect for Std. Dev. */ + real delta, b_aver = aver_angle[0]; + for (i = 0; (i < nframes); i++) + { - delta = correctRadianAngleRange(aver_angle[i] - b_aver); ++ delta = correctRadianAngleRange(aver_angle[i] - b_aver); + b_aver += delta; - aver += b_aver; ++ aver += b_aver; + } } - aver /= nframes; + aver /= nframes; - aver2 /= nframes; - aversig = std::sqrt(aver2 - gmx::square(aver)); - printf("Found points in the range from %d to %d (max %d)\n", first, last, maxangstat); - printf(" < angle > = %g\n", aver); - printf("< angle^2 > = %g\n", aver2); - printf("Std. Dev. = %g\n", aversig); + double aversig = correctRadianAngleRange(aver); + aversig *= RAD2DEG; - aver *= RAD2DEG; ++ aver *= RAD2DEG; + printf(" < angle > = %g\n", aversig); if (mult == 3) { diff --cc src/gromacs/mdlib/forcerec.cpp index b702a4a255,e3fad65f76..c8a42aac58 --- a/src/gromacs/mdlib/forcerec.cpp +++ b/src/gromacs/mdlib/forcerec.cpp @@@ -1438,14 -3087,14 +1438,14 @@@ void init_forcerec(FILE if (useGpuForBonded) { - auto stream = DOMAINDECOMP(cr) - // TODO use havePPDomainDecomposition here to simplify the code. - auto stream = (DOMAINDECOMP(cr) && (cr->nnodes - cr->npmenodes > 1)) ? - nbnxn_gpu_get_command_stream(fr->nbv->gpu_nbv, eintNonlocal) : - nbnxn_gpu_get_command_stream(fr->nbv->gpu_nbv, eintLocal); ++ auto stream = havePPDomainDecomposition(cr) + ? Nbnxm::gpu_get_command_stream( + fr->nbv->gpu_nbv, gmx::InteractionLocality::NonLocal) + : Nbnxm::gpu_get_command_stream(fr->nbv->gpu_nbv, + gmx::InteractionLocality::Local); // TODO the heap allocation is only needed while // t_forcerec lacks a constructor. - fr->gpuBonded = new gmx::GpuBonded(mtop->ffparams, - stream); + fr->gpuBonded = new gmx::GpuBonded(mtop->ffparams, stream, wcycle); } }