# Run through a number of tests for buggy compilers and other issues
include(gmxTestCompilerProblems)
gmx_test_compiler_problems()
+# GMX_SIMD will not be set automatically until the second
+# pass (which is not strictly guaranteed to occur), so putting this
+# check here among logically-related tests is inefficient, but the
+# potential loss is likely zero.
+if(GMX_SIMD STREQUAL "AVX_256"
+ AND CMAKE_COMPILER_IS_GNUCC
+ AND (C_COMPILER_VERSION VERSION_EQUAL "4.6.1"
+ OR CXX_COMPILER_VERSION VERSION_EQUAL "4.6.1"))
+ message(FATAL_ERROR "gcc 4.6.1 has buggy support for AVX, and GROMACS mdrun will not work. If you want simulation performance, use a more recent compiler. Otherwise, use GMX_SIMD=SSE4.1")
+ # See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49002
+endif()
+
set(PKG_CFLAGS "")
\item long-term energy conservation, especially for large systems
\end{itemize}
-\section{Porting {\gromacs}}
-The {\gromacs} system is designed with portability as a major design
-goal. However there are a number of things we assume to be present on
-the system {\gromacs} is being ported on. We assume the following
-features:
-
-\begin{enumerate}
-\item A UNIX-like operating system (BSD 4.x or SYSTEM V rev.3 or higher)
- or UNIX-like libraries running under {\eg} Cygwin
-\item an ANSI C compiler
-\end{enumerate}
-
-There are some additional features in the package that require extra
-stuff to be present, but it is checked for in the configuration script
-and you will be warned if anything important is missing.
-
-That's the requirements for a single node system. If you want
-to compile {\gromacs} for running a single simulation across multiple nodes,
-you also need an MPI library (Message-Passing Interface) to perform the
-parallel communication. This is always shipped with supercomputers, and
-for workstations you can find links to free MPI implementations through
-the {\gromacs} homepage at {\wwwpage}.
-
-
\section{Environment Variables}
{\gromacs} programs may be influenced by the use of
\normindex{environment variables}. First of all, the variables set in
With energy minimization the neighborlist will be updated for every
energy evaluation when <b>nstlist</b><tt>>0</tt>.
With <b>cutoff-scheme=Verlet</b> and <b>verlet-buffer-tolerance</b> set,
-<b>nstlist</b> is actually a minimum value and <tt>mdrun</tt> might increase it.
+<b>nstlist</b> is actually a minimum value and <tt>mdrun</tt> might increase it, unless it is set to 1.
With parallel simulations and/or non-bonded force calculation on the GPU,
a value of 20 or 40 often gives the best performance.
With <b>cutoff-scheme=Group</b> and non-exact cut-off's, <b>nstlist</b> will
out = xvgropen(eigvalfile,
"Eigenvalues of the covariance matrix",
"Eigenvector index", str, oenv);
- for (i = 0; (i < ndim); i++)
+ for (i = 0; (i < end); i++)
{
fprintf (out, "%10d %g\n", (int)i+1, eigenvalues[ndim-1-i]);
}
if (nframes-1 < ndim)
{
end = nframes-1;
+ fprintf(out, "WARNING: there are fewer frames in your trajectory than there are\n");
+ fprintf(out, "degrees of freedom in your system. Only generating the first\n");
+ fprintf(out, "%d out of %d eigenvectors and eigenvalues.\n", end, (int)ndim);
}
else
{
fprintf(out, "Trace of the covariance matrix after diagonalizing: %g\n\n",
sum);
- fprintf(out, "Wrote %d eigenvalues to %s\n", (int)ndim, eigvalfile);
+ fprintf(out, "Wrote %d eigenvalues to %s\n", (int)end, eigvalfile);
if (WriteXref == eWXR_YES)
{
fprintf(out, "Wrote reference structure to %s\n", eigvecfile);
{
const char *desc[] = {
"[THISMODULE] computes a free energy estimate based on an energy analysis",
- "from. One needs an energy file with the following components:",
- "Coul (A-B) LJ-SR (A-B) etc."
+ "from nonbonded energies. One needs an energy file with the following components:",
+ "Coul-(A-B) LJ-SR (A-B) etc.[PAR]",
+ "To utilize [TT]g_lie[tt] correctly, two simulations are required: one with the",
+ "molecule of interest bound to its receptor and one with the molecule in water.",
+ "Both need to utilize [TT]energygrps[tt] such that Coul-SR(A-B), LJ-SR(A-B), etc. terms",
+ "are written to the [TT].edr[tt] file. Values from the molecule-in-water simulation",
+ "are necessary for supplying suitable values for -Elj and -Eqq."
};
static real lie_lj = 0, lie_qq = 0, fac_lj = 0.181, fac_qq = 0.5;
static const char *ligand = "none";
ld = analyze_names(nre, enm, ligand);
snew(fr, 1);
+
out = xvgropen(ftp2fn(efXVG, NFILE, fnm), "LIE free energy estimate",
"Time (ps)", "DGbind (kJ/mol)", oenv);
while (do_enx(fp, fr))
"Use option [TT]-pbc mol[tt] in addition to [TT]-center[tt] when you",
"want all molecules in the box after the centering.[PAR]",
+ "Option [TT]-box[tt] sets the size of the new box. If you want to"
+ "modify only some of the dimensions, e.g. when reading from a trajectory,"
+ "you can use -1 for those dimensions that should stay the same"
+
"It is not always possible to use combinations of [TT]-pbc[tt],",
"[TT]-fit[tt], [TT]-ur[tt] and [TT]-center[tt] to do exactly what",
"you want in one call to [THISMODULE]. Consider using multiple",
clear_mat(fr.box);
for (m = 0; m < DIM; m++)
{
- fr.box[m][m] = newbox[m];
+ if (newbox[m] >= 0)
+ {
+ fr.box[m][m] = newbox[m];
+ }
}
}
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2004, The GROMACS development team.
* Copyright (c) 2014, 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
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2014, 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.
static void pr_int(FILE *fp, int indent, const char *title, int i)
{
pr_indent(fp, indent);
- fprintf(fp, "%-20s = %d\n", title, i);
+ fprintf(fp, "%-30s = %d\n", title, i);
}
static void pr_int64(FILE *fp, int indent, const char *title, gmx_int64_t i)
char buf[STEPSTRSIZE];
pr_indent(fp, indent);
- fprintf(fp, "%-20s = %s\n", title, gmx_step_str(i, buf));
+ fprintf(fp, "%-30s = %s\n", title, gmx_step_str(i, buf));
}
static void pr_real(FILE *fp, int indent, const char *title, real r)
{
pr_indent(fp, indent);
- fprintf(fp, "%-20s = %g\n", title, r);
+ fprintf(fp, "%-30s = %g\n", title, r);
}
static void pr_double(FILE *fp, int indent, const char *title, double d)
{
pr_indent(fp, indent);
- fprintf(fp, "%-20s = %g\n", title, d);
+ fprintf(fp, "%-30s = %g\n", title, d);
}
static void pr_str(FILE *fp, int indent, const char *title, const char *s)
for (j = j0; (j < j1 && nremove < natoms_solvt); j++)
{
jnr = nlist->jjnr[j];
+ if (jnr < 0)
+ {
+ /* skip padding */
+ continue;
+ }
copy_rvec(x_all[jnr], xj);
/* Check solvent-protein and solvent-solvent */
}
}
+ if (nvsite && ir->eI == eiNM)
+ {
+ gmx_fatal(FARGS, "Normal Mode analysis is not supported with virtual sites.\nIf you'd like to help with adding support, we have an open discussion at http://redmine.gromacs.org/issues/879\n");
+ }
+
if (ir->cutoff_scheme == ecutsVERLET)
{
fprintf(stderr, "Removing all charge groups because cutoff-scheme=%s\n",
void check_ir(const char *mdparin, t_inputrec *ir, t_gromppopts *opts,
warninp_t wi)
-/* Check internal consistency */
+/* Check internal consistency.
+ * NOTE: index groups are not set here yet, don't check things
+ * like temperature coupling group options here, but in triple_check
+ */
{
/* Strange macro: first one fills the err_buf, and then one can check
* the condition, which will print the message and increase the error
sprintf(err_buf, "%s temperature control not supported for integrator %s.", etcoupl_names[ir->etc], ei_names[ir->eI]);
CHECK(!(EI_VV(ir->eI)));
- for (i = 0; i < ir->opts.ngtc; i++)
- {
- sprintf(err_buf, "all tau_t must currently be equal using Andersen temperature control, violated for group %d", i);
- CHECK(ir->opts.tau_t[0] != ir->opts.tau_t[i]);
- sprintf(err_buf, "all tau_t must be postive using Andersen temperature control, tau_t[%d]=%10.6f",
- i, ir->opts.tau_t[i]);
- CHECK(ir->opts.tau_t[i] < 0);
- }
if (ir->nstcomm > 0 && (ir->etc == etcANDERSEN))
{
sprintf(warn_buf, "Center of mass removal not necessary for %s. All velocities of coupled groups are rerandomized periodically, so flying ice cube errors will not occur.", etcoupl_names[ir->etc]);
sprintf(err_buf, "nstcomm must be 1, not %d for %s, as velocities of atoms in coupled groups are randomized every time step", ir->nstcomm, etcoupl_names[ir->etc]);
CHECK(ir->nstcomm > 1 && (ir->etc == etcANDERSEN));
-
- for (i = 0; i < ir->opts.ngtc; i++)
- {
- int nsteps = (int)(ir->opts.tau_t[i]/ir->delta_t);
- sprintf(err_buf, "tau_t/delta_t for group %d for temperature control method %s must be a multiple of nstcomm (%d), as velocities of atoms in coupled groups are randomized every time step. The input tau_t (%8.3f) leads to %d steps per randomization", i, etcoupl_names[ir->etc], ir->nstcomm, ir->opts.tau_t[i], nsteps);
- CHECK((nsteps % ir->nstcomm) && (ir->etc == etcANDERSENMASSIVE));
- }
}
+
if (ir->etc == etcBERENDSEN)
{
sprintf(warn_buf, "The %s thermostat does not generate the correct kinetic energy distribution. You might want to consider using the %s thermostat.",
}
}
+ if (EI_VV(ir->eI) && IR_TWINRANGE(*ir) && ir->nstlist > 1)
+ {
+ sprintf(warn_buf, "Twin-range multiple time stepping does not work with integrator %s.", ei_names[ir->eI]);
+ warning_error(wi, warn_buf);
+ }
+
/* IMPLICIT SOLVENT */
if (ir->coulombtype == eelGB_NOTUSED)
{
void triple_check(const char *mdparin, t_inputrec *ir, gmx_mtop_t *sys,
warninp_t wi)
{
- char err_buf[256];
+ char err_buf[STRLEN];
int i, m, c, nmol, npct;
gmx_bool bCharge, bAcc;
real gdt_max, *mgrp, mt;
set_warning_line(wi, mdparin, -1);
+ if (ir->cutoff_scheme == ecutsVERLET &&
+ ir->verletbuf_tol > 0 &&
+ ir->nstlist > 1 &&
+ ((EI_MD(ir->eI) || EI_SD(ir->eI)) &&
+ (ir->etc == etcVRESCALE || ir->etc == etcBERENDSEN)))
+ {
+ /* Check if a too small Verlet buffer might potentially
+ * cause more drift than the thermostat can couple off.
+ */
+ /* Temperature error fraction for warning and suggestion */
+ const real T_error_warn = 0.002;
+ const real T_error_suggest = 0.001;
+ /* For safety: 2 DOF per atom (typical with constraints) */
+ const real nrdf_at = 2;
+ real T, tau, max_T_error;
+ int i;
+
+ T = 0;
+ tau = 0;
+ for (i = 0; i < ir->opts.ngtc; i++)
+ {
+ T = max(T, ir->opts.ref_t[i]);
+ tau = max(tau, ir->opts.tau_t[i]);
+ }
+ if (T > 0)
+ {
+ /* This is a worst case estimate of the temperature error,
+ * assuming perfect buffer estimation and no cancelation
+ * of errors. The factor 0.5 is because energy distributes
+ * equally over Ekin and Epot.
+ */
+ max_T_error = 0.5*tau*ir->verletbuf_tol/(nrdf_at*BOLTZ*T);
+ if (max_T_error > T_error_warn)
+ {
+ sprintf(warn_buf, "With a verlet-buffer-tolerance of %g kJ/mol/ps, a reference temperature of %g and a tau_t of %g, your temperature might be off by up to %.1f%%. To ensure the error is below %.1f%%, decrease verlet-buffer-tolerance to %.0e or decrease tau_t.",
+ ir->verletbuf_tol, T, tau,
+ 100*max_T_error,
+ 100*T_error_suggest,
+ ir->verletbuf_tol*T_error_suggest/max_T_error);
+ warning(wi, warn_buf);
+ }
+ }
+ }
+
+ if (ETC_ANDERSEN(ir->etc))
+ {
+ int i;
+
+ for (i = 0; i < ir->opts.ngtc; i++)
+ {
+ sprintf(err_buf, "all tau_t must currently be equal using Andersen temperature control, violated for group %d", i);
+ CHECK(ir->opts.tau_t[0] != ir->opts.tau_t[i]);
+ sprintf(err_buf, "all tau_t must be postive using Andersen temperature control, tau_t[%d]=%10.6f",
+ i, ir->opts.tau_t[i]);
+ CHECK(ir->opts.tau_t[i] < 0);
+ }
+
+ for (i = 0; i < ir->opts.ngtc; i++)
+ {
+ int nsteps = (int)(ir->opts.tau_t[i]/ir->delta_t);
+ sprintf(err_buf, "tau_t/delta_t for group %d for temperature control method %s must be a multiple of nstcomm (%d), as velocities of atoms in coupled groups are randomized every time step. The input tau_t (%8.3f) leads to %d steps per randomization", i, etcoupl_names[ir->etc], ir->nstcomm, ir->opts.tau_t[i], nsteps);
+ CHECK((nsteps % ir->nstcomm) && (ir->etc == etcANDERSENMASSIVE));
+ }
+ }
+
if (EI_DYNAMICS(ir->eI) && !EI_SD(ir->eI) && ir->eI != eiBD &&
ir->comm_mode == ecmNO &&
!(absolute_reference(ir, sys, FALSE, AbsRef) || ir->nsteps <= 10) &&
gmx_fatal(FARGS, "Switch/shift interaction not supported with Buckingham");
}
+ if (fr->bBHAM && fr->cutoff_scheme == ecutsVERLET)
+ {
+ gmx_fatal(FARGS, "Verlet cutoff-scheme is not supported with Buckingham");
+ }
+
if (fp)
{
fprintf(fp, "Cut-off's: NS: %g Coulomb: %g %s: %g\n",
#include "macros.h"
#include "md_logging.h"
#include "md_support.h"
+#include "names.h"
#include "gromacs/legacyheaders/types/commrec.h"
#include "gromacs/math/vec.h"
"nstdhdl", &ir->fepvals->nstdhdl);
}
}
+
+ if (EI_VV(ir->eI) && IR_TWINRANGE(*ir) && ir->nstlist > 1)
+ {
+ gmx_fatal(FARGS, "Twin-range multiple time stepping does not work with integrator %s.", ei_names[ir->eI]);
+ }
}
void rerun_parallel_comm(t_commrec *cr, t_trxframe *fr,
inc_nrnb(nrnb, eNR_FFT, 2*npme);
}
+ /* Note: this wallcycle region is closed below
+ outside an OpenMP region, so take care if
+ refactoring code here. */
wallcycle_start(wcycle, ewcPME_SPREADGATHER);
}
inc_nrnb(nrnb, eNR_GATHERFBSP,
pme->pme_order*pme->pme_order*pme->pme_order*pme->atc[0].n);
+ /* Note: this wallcycle region is opened above inside an OpenMP
+ region, so take care if refactoring code here. */
wallcycle_stop(wcycle, ewcPME_SPREADGATHER);
}
}
if (max_dist2 >= 0 && dr2 > 0.98*0.98*max_dist2)
{
- gmx_fatal(FARGS, "Distance between pull groups %d and %d (%f nm) is larger than 0.49 times the box size (%f)",
+ gmx_fatal(FARGS, "Distance between pull groups %d and %d (%f nm) is larger than 0.49 times the box size (%f).\nYou might want to consider using \"pull-geometry = direction-periodic\" instead.\n",
pcrd->group[0], pcrd->group[1], sqrt(dr2), sqrt(max_dist2));
}
{
for (int i = 0; i < g->nr; ++i)
{
- fprintf(fp, " Group %2d \"%s\" ", i + 1, g->names[i].c_str());
+ fprintf(fp, " Group %2d \"%s\" ", i, g->names[i].c_str());
gmx_ana_index_dump(fp, &g->g[i], maxn);
}
}
(DOMAINDECOMP(cr) && !MASTER(cr))) ?
NULL : state_global->x);
+ if (shellfc && ir->eI == eiNM)
+ {
+ /* Currently shells don't work with Normal Modes */
+ gmx_fatal(FARGS, "Normal Mode analysis is not supported with shells.\nIf you'd like to help with adding support, we have an open discussion at http://redmine.gromacs.org/issues/879\n");
+ }
+
+ if (vsite && ir->eI == eiNM)
+ {
+ /* Currently virtual sites don't work with Normal Modes */
+ gmx_fatal(FARGS, "Normal Mode analysis is not supported with virtual sites.\nIf you'd like to help with adding support, we have an open discussion at http://redmine.gromacs.org/issues/879\n");
+ }
+
if (DEFORM(*ir))
{
tMPI_Thread_mutex_lock(&deform_init_box_mutex);
* step to combine the long-range forces on these steps.
* For nstcalclr=1 this is not done, since the forces would have been added
* directly to the short-range forces already.
+ *
+ * TODO Remove various aspects of VV+twin-range in master
+ * branch, because VV integrators did not ever support
+ * twin-range multiple time stepping with constraints.
*/
bUpdateDoLR = (fr->bTwinRange && do_per_step(step, ir->nstcalclr));
"With the Verlet cut-off scheme and verlet-buffer-tolerance set,",
"the pair-list update interval nstlist can be chosen freely with",
"the option [TT]-nstlist[tt]. [TT]mdrun[tt] will then adjust",
- "the pair-list cut-off to maintain accuracy.",
- "By default [TT]mdrun[tt] will try to increase nstlist to improve",
- "the performance. For CPU runs nstlist might increase to 20, for GPU",
- "runs up till 40. But for medium to high parallelization or with",
- "fast GPUs, a (user supplied) larger nstlist value can give much",
+ "the pair-list cut-off to maintain accuracy, and not adjust nstlist.",
+ "Otherwise, by default, [TT]mdrun[tt] will try to increase the",
+ "value of nstlist set in the [TT].mdp[tt] file to improve the",
+ "performance. For CPU-only runs, nstlist might increase to 20, for",
+ "GPU runs up to 40. For medium to high parallelization or with",
+ "fast GPUs, a (user-supplied) larger nstlist value can give much",
"better performance.",
"[PAR]",
"When using PME with separate PME nodes or with a GPU, the two major",
if (nstlist_cmdline <= 0)
{
+ if (ir->nstlist == 1)
+ {
+ /* The user probably set nstlist=1 for a reason,
+ * don't mess with the settings.
+ */
+ return;
+ }
+
if (fp != NULL && bGPU && ir->nstlist < nstlist_try[0])
{
fprintf(fp, nstl_gpu, ir->nstlist);