#
# This file is part of the GROMACS molecular simulation package.
#
-# Copyright (c) 2014,2015, by the GROMACS development team, led by
+# Copyright (c) 2014,2015,2016, 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.
# each release. It's hard to test because it is only used for
# REGRESSIONTEST_DOWNLOAD, which doesn't work until that tarball has
# been placed on the server.
-set(REGRESSIONTEST_MD5SUM "614a74e9b143bda5476f87f4ce08eec0" CACHE INTERNAL "MD5 sum of the regressiontests tarball")
+set(REGRESSIONTEST_MD5SUM "3f663536649db883a5616f25f95ac927" CACHE INTERNAL "MD5 sum of the regressiontests tarball")
math(EXPR GMX_VERSION_NUMERIC
"${GMX_VERSION_MAJOR}*10000 + ${GMX_VERSION_PATCH}")
int fep_state;
int fep_states_lj = pme->bFEP_lj ? 2 : 1;
const gmx_bool bCalcEnerVir = flags & GMX_PME_CALC_ENER_VIR;
+ const gmx_bool bBackFFT = flags & (GMX_PME_CALC_F | GMX_PME_CALC_POT);
const gmx_bool bCalcF = flags & GMX_PME_CALC_F;
assert(pme->nnodes > 0);
}
}
- if (bCalcF)
+ if (bBackFFT)
{
/* do 3d-invfft */
if (thread == 0)
* With MPI we have to synchronize here before gmx_sum_qgrid_dd.
*/
- if (bCalcF)
+ if (bBackFFT)
{
/* distribute local grid to all nodes */
#if GMX_MPI
where();
unwrap_periodic_pmegrid(pme, grid);
+ }
+ if (bCalcF)
+ {
/* interpolate forces for our local atoms */
where();
get_pme_ener_vir_lj(pme->solve_work, pme->nthread, &energy_AB[2+fep_state], vir_AB[2+fep_state]);
}
- if (bCalcF)
+ if (bBackFFT)
{
bFirst = !(flags & GMX_PME_DO_COULOMB);
calc_initial_lb_coeffs(pme, local_c6, local_sigma);
unwrap_periodic_pmegrid(pme, grid);
- /* interpolate forces for our local atoms */
- where();
- bClearF = (bFirst && PAR(cr));
- scale = pme->bFEP ? (fep_state < 1 ? 1.0-lambda_lj : lambda_lj) : 1.0;
- scale *= lb_scale_factor[grid_index-2];
-#pragma omp parallel for num_threads(pme->nthread) schedule(static)
- for (thread = 0; thread < pme->nthread; thread++)
+ if (bCalcF)
{
- try
+ /* interpolate forces for our local atoms */
+ where();
+ bClearF = (bFirst && PAR(cr));
+ scale = pme->bFEP ? (fep_state < 1 ? 1.0-lambda_lj : lambda_lj) : 1.0;
+ scale *= lb_scale_factor[grid_index-2];
+
+#pragma omp parallel for num_threads(pme->nthread) schedule(static)
+ for (thread = 0; thread < pme->nthread; thread++)
{
- gather_f_bsplines(pme, grid, bClearF, &pme->atc[0],
- &pme->atc[0].spline[thread],
- scale);
+ try
+ {
+ gather_f_bsplines(pme, grid, bClearF, &pme->atc[0],
+ &pme->atc[0].spline[thread],
+ scale);
+ }
+ GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
}
- GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
- }
- where();
- inc_nrnb(nrnb, eNR_GATHERFBSP,
- pme->pme_order*pme->pme_order*pme->pme_order*pme->atc[0].n);
+ where();
+
+ inc_nrnb(nrnb, eNR_GATHERFBSP,
+ pme->pme_order*pme->pme_order*pme->pme_order*pme->atc[0].n);
+ }
wallcycle_stop(wcycle, ewcPME_SPREADGATHER);
bFirst = FALSE;
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, 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.
set_warning_line(wi, fn, lc);
if (ptr)
{
+ // TODO This parsing should be using strip_comment, trim,
+ // strchr, etc. rather than re-inventing wheels.
+
/* Strip comment */
if ((cptr = std::strchr(buf, COMMENTSIGN)) != NULL)
{
}
}
+/* Note that sanitizing the trailing part of (*inp)[ii].value was the responsibility of read_inpfile() */
int get_eint(int *ninp, t_inpfile **inp, const char *name, int def,
warninp_t wi)
{
else
{
ret = std::strtol((*inp)[ii].value, &ptr, 10);
- if (ptr == (*inp)[ii].value)
+ if (*ptr != '\0')
{
sprintf(warn_buf, "Right hand side '%s' for parameter '%s' in parameter file is not an integer value\n", (*inp)[ii].value, (*inp)[ii].name);
warning_error(wi, warn_buf);
}
}
+/* Note that sanitizing the trailing part of (*inp)[ii].value was the responsibility of read_inpfile() */
gmx_int64_t get_eint64(int *ninp, t_inpfile **inp,
const char *name, gmx_int64_t def,
warninp_t wi)
else
{
ret = str_to_int64_t((*inp)[ii].value, &ptr);
- if (ptr == (*inp)[ii].value)
+ if (*ptr != '\0')
{
sprintf(warn_buf, "Right hand side '%s' for parameter '%s' in parameter file is not an integer value\n", (*inp)[ii].value, (*inp)[ii].name);
warning_error(wi, warn_buf);
}
}
+/* Note that sanitizing the trailing part of (*inp)[ii].value was the responsibility of read_inpfile() */
double get_ereal(int *ninp, t_inpfile **inp, const char *name, double def,
warninp_t wi)
{
else
{
ret = strtod((*inp)[ii].value, &ptr);
- if (ptr == (*inp)[ii].value)
+ if (*ptr != '\0')
{
sprintf(warn_buf, "Right hand side '%s' for parameter '%s' in parameter file is not a real value\n", (*inp)[ii].value, (*inp)[ii].name);
warning_error(wi, warn_buf);
}
}
+/* Note that sanitizing the trailing part of (*inp)[ii].value was the responsibility of read_inpfile() */
const char *get_estr(int *ninp, t_inpfile **inp, const char *name, const char *def)
{
char buf[32];
}
}
+/* Note that sanitizing the trailing part of (*inp)[ii].value was the responsibility of read_inpfile() */
int get_eeenum(int *ninp, t_inpfile **inp, const char *name, const char **defs,
warninp_t wi)
{
#
# This file is part of the GROMACS molecular simulation package.
#
-# Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+# Copyright (c) 2013,2014,2015,2016, 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.
set(test_sources
confio.cpp
+ readinp.cpp
)
if (GMX_USE_TNG)
list(APPEND test_sources tngio.cpp)
--- /dev/null
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 2016, 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.
+ */
+/*! \internal \file
+ * \brief
+ * Tests utilities for routines that parse fields e.g. from grompp input
+ *
+ * \author Mark Abraham <mark.j.abraham@gmail.com>
+ */
+#include "gmxpre.h"
+
+#include "gromacs/fileio/readinp.h"
+
+#include <gtest/gtest.h>
+
+#include "gromacs/fileio/warninp.h"
+#include "gromacs/utility/scoped_cptr.h"
+#include "gromacs/utility/smalloc.h"
+
+namespace gmx
+{
+namespace testing
+{
+
+class ReadTest : public ::testing::Test
+{
+ public:
+ ReadTest() : numInputs_(1),
+ inputField_(0),
+ inpGuard_(),
+ wi_(),
+ wiGuard_()
+ {
+ snew(inputField_, numInputs_);
+ inpGuard_.reset(inputField_);
+
+ inputField_[0].count = 0;
+ inputField_[0].bObsolete = FALSE;
+ inputField_[0].bSet = FALSE;
+ inputField_[0].name = (char *) "test";
+ inputField_[0].inp_count = 0;
+
+ wi_ = init_warning(FALSE, 0);
+ wiGuard_.reset(wi_);
+ }
+
+ int numInputs_;
+ t_inpfile *inputField_;
+ gmx::scoped_cptr<t_inpfile> inpGuard_;
+ warninp_t wi_;
+ gmx::scoped_cptr<struct warninp, free_warning> wiGuard_;
+};
+
+TEST_F(ReadTest, get_eint_ReadsInteger)
+{
+ inputField_[0].value = (char *) "1";
+ ASSERT_EQ(1, get_eint(&numInputs_, &inputField_, "test", 2, wi_));
+ ASSERT_FALSE(warning_errors_exist(wi_));
+}
+
+TEST_F(ReadTest, get_eint_WarnsAboutFloat)
+{
+ inputField_[0].value = (char *) "0.8";
+ get_eint(&numInputs_, &inputField_, "test", 2, wi_);
+ ASSERT_TRUE(warning_errors_exist(wi_));
+}
+
+TEST_F(ReadTest, get_eint_WarnsAboutString)
+{
+ inputField_[0].value = (char *) "hello";
+ get_eint(&numInputs_, &inputField_, "test", 2, wi_);
+ ASSERT_TRUE(warning_errors_exist(wi_));
+}
+
+TEST_F(ReadTest, get_eint64_ReadsInteger)
+{
+ inputField_[0].value = (char *) "1";
+ ASSERT_EQ(1, get_eint64(&numInputs_, &inputField_, "test", 2, wi_));
+ ASSERT_FALSE(warning_errors_exist(wi_));
+}
+
+TEST_F(ReadTest, get_eint64_WarnsAboutFloat)
+{
+ inputField_[0].value = (char *) "0.8";
+ get_eint64(&numInputs_, &inputField_, "test", 2, wi_);
+ ASSERT_TRUE(warning_errors_exist(wi_));
+}
+
+TEST_F(ReadTest, get_eint64_WarnsAboutString)
+{
+ inputField_[0].value = (char *) "hello";
+ get_eint64(&numInputs_, &inputField_, "test", 2, wi_);
+ ASSERT_TRUE(warning_errors_exist(wi_));
+}
+
+TEST_F(ReadTest, get_ereal_ReadsInteger)
+{
+ inputField_[0].value = (char *) "1";
+ ASSERT_EQ(1, get_ereal(&numInputs_, &inputField_, "test", 2, wi_));
+ ASSERT_FALSE(warning_errors_exist(wi_));
+}
+
+TEST_F(ReadTest, get_ereal_ReadsFloat)
+{
+ inputField_[0].value = (char *) "0.8";
+ ASSERT_EQ(0.8, get_ereal(&numInputs_, &inputField_, "test", 2, wi_));
+ ASSERT_FALSE(warning_errors_exist(wi_));
+}
+
+TEST_F(ReadTest, get_ereal_WarnsAboutString)
+{
+ inputField_[0].value = (char *) "hello";
+ get_ereal(&numInputs_, &inputField_, "test", 2, wi_);
+ ASSERT_TRUE(warning_errors_exist(wi_));
+}
+
+} // namespace
+} // namespace
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, 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.
}
}
+gmx_bool warning_errors_exist(warninp_t wi)
+{
+ return (wi->nwarn_error > 0);
+}
+
void done_warning(warninp_t wi, int f_errno, const char *file, int line)
{
print_warn_count("note", wi->nwarn_note);
wi->nwarn_warn);
}
+ free_warning(wi);
+}
+
+void free_warning(warninp_t wi)
+{
sfree(wi);
}
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2010,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014,2015,2016, 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.
* are printed, nwarn_error (local) is incremented.
*/
+gmx_bool warning_errors_exist(warninp_t wi);
+/* Return whether any error-level warnings were issued to wi. */
+
void
check_warning_error(warninp_t wi, int f_errno, const char *file, int line);
/* When warning_error has been called at least once gmx_fatal is called,
* Frees the data structure pointed to by wi.
*/
+void
+free_warning(warninp_t wi);
+/* Frees the data structure pointed to by wi. */
+
void
_too_few(warninp_t wi, const char *fn, int line);
#define too_few(wi) _too_few(wi, __FILE__, __LINE__)
#
# This file is part of the GROMACS molecular simulation package.
#
-# Copyright (c) 2009,2010,2012,2014,2015, by the GROMACS development team, led by
+# Copyright (c) 2009,2010,2012,2014,2015,2016, 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.
file(GLOB GMXLIB_SOURCES *.cpp)
set(GMXLIB_SOURCES ${GMXLIB_SOURCES} ${NONBONDED_SOURCES} PARENT_SCOPE)
+
+# if(BUILD_TESTING)
+# add_subdirectory(tests)
+# endif()
--- /dev/null
+#
+# This file is part of the GROMACS molecular simulation package.
+#
+# Copyright (c) 2016, 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.
+
+gmx_add_unit_test(GmxlibTests gmxlib-test
+ )
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, 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 decouple_atoms(t_atoms *atoms, int atomtype_decouple,
- int couple_lam0, int couple_lam1)
+ int couple_lam0, int couple_lam1,
+ const char *mol_name)
{
int i;
for (i = 0; i < atoms->nr; i++)
{
+ t_atom *atom;
+
+ atom = &atoms->atom[i];
+
+ if (atom->qB != atom->q || atom->typeB != atom->type)
+ {
+ gmx_fatal(FARGS, "Atom %d in molecule type '%s' has different A and B state charges and/or atom types set in the topology file as well as through the mdp option '%s'. You can not use both these methods simultaneously.",
+ i + 1, mol_name, "couple-moltype");
+ }
+
if (couple_lam0 == ecouplamNONE || couple_lam0 == ecouplamVDW)
{
- atoms->atom[i].q = 0.0;
+ atom->q = 0.0;
}
if (couple_lam0 == ecouplamNONE || couple_lam0 == ecouplamQ)
{
- atoms->atom[i].type = atomtype_decouple;
+ atom->type = atomtype_decouple;
}
if (couple_lam1 == ecouplamNONE || couple_lam1 == ecouplamVDW)
{
- atoms->atom[i].qB = 0.0;
+ atom->qB = 0.0;
}
if (couple_lam1 == ecouplamNONE || couple_lam1 == ecouplamQ)
{
- atoms->atom[i].typeB = atomtype_decouple;
+ atom->typeB = atomtype_decouple;
}
}
}
generate_LJCpairsNB(mol, nb_funct, nbp);
set_excl_all(&mol->excls);
}
- decouple_atoms(&mol->atoms, atomtype_decouple, couple_lam0, couple_lam1);
+ decouple_atoms(&mol->atoms, atomtype_decouple, couple_lam0, couple_lam1,
+ *mol->name);
}
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016, 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.
real rb, rl;
real drift;
+ if (!EI_DYNAMICS(ir->eI))
+ {
+ gmx_incons("Can only determine the Verlet buffer size for integrators that perform dynamics");
+ }
+ if (ir->verletbuf_tol <= 0)
+ {
+ gmx_incons("The Verlet buffer tolerance needs to be larger than zero");
+ }
+
if (reference_temperature < 0)
{
if (EI_MD(ir->eI) && ir->etc == etcNO)
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, 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.
gmx_bitmask_t *atf; /* atom flags for thread parallelization */
int atf_nalloc; /* allocation size of atf */
gmx_bool bTaskDep; /* are the LINCS tasks interdependent? */
+ gmx_bool bTaskDepTri; /* are there triangle constraints that cross task borders? */
/* arrays for temporary storage in the LINCS algorithm */
rvec *tmpv;
real *tmpncc;
rhs1 = rhs2;
rhs2 = swap;
} /* nrec*(ntriangle + ncc_triangle*2) flops */
+
+ if (lincsd->bTaskDepTri)
+ {
+ /* The constraints triangles are decoupled from each other,
+ * but constraints in one triangle cross thread task borders.
+ * We could probably avoid this with more advanced setup code.
+ */
+#pragma omp barrier
+ }
}
}
static void set_lincs_matrix_task(struct gmx_lincsdata *li,
lincs_task_t *li_task,
const real *invmass,
- int *ncc_triangle)
+ int *ncc_triangle,
+ int *nCrossTaskTriangles)
{
int i;
/* Construct the coupling coefficient matrix blmf */
- li_task->ntriangle = 0;
- *ncc_triangle = 0;
+ li_task->ntriangle = 0;
+ *ncc_triangle = 0;
+ *nCrossTaskTriangles = 0;
for (i = li_task->b0; i < li_task->b1; i++)
{
int a1, a2, n;
if (kk != i && kk != k &&
(li->bla[2*kk] == end || li->bla[2*kk+1] == end))
{
- /* If we are using multiple tasks for LINCS,
- * the calls to check_assign_triangle should have
- * put all constraints in the triangle in our task.
+ /* Check if the constraints in this triangle actually
+ * belong to a different task. We still assign them
+ * here, since it's convenient for the triangle
+ * iterations, but we then need an extra barrier.
*/
- assert(k >= li_task->b0 && k < li_task->b1);
- assert(kk >= li_task->b0 && kk < li_task->b1);
+ if (k < li_task->b0 || k >= li_task->b1 ||
+ kk < li_task->b0 || kk >= li_task->b1)
+ {
+ (*nCrossTaskTriangles)++;
+ }
if (li_task->ntriangle == 0 ||
li_task->triangle[li_task->ntriangle - 1] < i)
}
/* Construct the coupling coefficient matrix blmf */
- int th, ntriangle = 0, ncc_triangle = 0;
-#pragma omp parallel for reduction(+: ntriangle, ncc_triangle) num_threads(li->ntask) schedule(static)
+ int th, ntriangle = 0, ncc_triangle = 0, nCrossTaskTriangles = 0;
+#pragma omp parallel for reduction(+: ntriangle, ncc_triangle, nCrossTaskTriangles) num_threads(li->ntask) schedule(static)
for (th = 0; th < li->ntask; th++)
{
try
{
- set_lincs_matrix_task(li, &li->task[th], invmass, &ncc_triangle);
+ set_lincs_matrix_task(li, &li->task[th], invmass,
+ &ncc_triangle, &nCrossTaskTriangles);
ntriangle = li->task[th].ntriangle;
}
GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
}
li->ntriangle = ntriangle;
li->ncc_triangle = ncc_triangle;
+ li->bTaskDepTri = (nCrossTaskTriangles > 0);
if (debug)
{
- fprintf(debug, "Of the %d constraints %d participate in triangles\n",
+ fprintf(debug, "The %d constraints participate in %d triangles\n",
li->nc, li->ntriangle);
- fprintf(debug, "There are %d couplings of which %d in triangles\n",
+ fprintf(debug, "There are %d constraint couplings, of which %d in triangles\n",
li->ncc, li->ncc_triangle);
+ if (li->ntriangle > 0 && li->ntask > 1)
+ {
+ fprintf(debug, "%d constraint triangles contain constraints assigned to different tasks\n",
+ nCrossTaskTriangles);
+ }
}
/* Set matlam,
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016, 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.
if (th > 0)
{
clear_mat(constr->vir_r_m_dr_th[th]);
+
+ constr->settle_error[th] = -1;
}
start_th = (nsettle* th )/nth;
if (settle->nr > 0)
{
- /* Combine virial and error info of the other threads */
- for (i = 1; i < nth; i++)
- {
- settle_error = constr->settle_error[i];
- }
if (vir != NULL)
{
+ /* Reduce the virial contributions over the threads */
for (i = 1; i < nth; i++)
{
m_add(vir_r_m_dr, constr->vir_r_m_dr_th[i], vir_r_m_dr);
}
}
- if (econq == econqCoord && settle_error >= 0)
+ if (econq == econqCoord)
{
- bOK = FALSE;
- if (constr->maxwarn >= 0)
+ for (i = 1; i < nth; i++)
{
- char buf[256];
- sprintf(buf,
- "\nstep " "%" GMX_PRId64 ": Water molecule starting at atom %d can not be "
- "settled.\nCheck for bad contacts and/or reduce the timestep if appropriate.\n",
- step, ddglatnr(cr->dd, settle->iatoms[settle_error*(1+NRAL(F_SETTLE))+1]));
- if (fplog)
- {
- fprintf(fplog, "%s", buf);
- }
- fprintf(stderr, "%s", buf);
- constr->warncount_settle++;
- if (constr->warncount_settle > constr->maxwarn)
- {
- too_many_constraint_warnings(-1, constr->warncount_settle);
- }
- bDump = TRUE;
+ settle_error = std::max(settle_error, constr->settle_error[i]);
+ }
+
+ if (settle_error >= 0)
+ {
+ dump_confs(fplog, step, constr->warn_mtop, start, homenr, cr, x, xprime, box);
+
+ gmx_fatal(FARGS,
+ "\nstep " "%" GMX_PRId64 ": Water molecule starting at atom %d can not be "
+ "settled.\nCheck for bad contacts and/or reduce the timestep if appropriate.\n",
+ step, ddglatnr(cr->dd, settle->iatoms[settle_error*(1+NRAL(F_SETTLE))+1]));
}
}
}
nbl->nci = 0;
nbl->ci = NULL;
nbl->ci_nalloc = 0;
+ nbl->nsci = 0;
+ nbl->sci = NULL;
+ nbl->sci_nalloc = 0;
nbl->ncj = 0;
nbl->cj = NULL;
nbl->cj_nalloc = 0;
t_bin *rb;
int *itc0, *itc1;
int ie = 0, ifv = 0, isv = 0, irmsd = 0, imu = 0;
- int idedl = 0, idvdll = 0, idvdlnl = 0, iepl = 0, icm = 0, imass = 0, ica = 0, inb = 0;
+ int idedl = 0, idedlo = 0, idvdll = 0, idvdlnl = 0, iepl = 0, icm = 0, imass = 0, ica = 0, inb = 0;
int isig = -1;
int icj = -1, ici = -1, icx = -1;
int inn[egNR];
/* these probably need to be put into one of these categories */
where();
idedl = add_binr(rb, 1, &(ekind->dekindl));
+ if (bSumEkinhOld)
+ {
+ idedlo = add_binr(rb, 1, &(ekind->dekindl_old));
+ }
where();
ica = add_binr(rb, 1, &(ekind->cosacc.mvcos));
where();
}
}
extract_binr(rb, idedl, 1, &(ekind->dekindl));
+ if (bSumEkinhOld)
+ {
+ extract_binr(rb, idedlo, 1, &(ekind->dekindl_old));
+ }
extract_binr(rb, ica, 1, &(ekind->cosacc.mvcos));
where();
}
gmx_bool bUseGPU)
{
/* For NVE simulations, we will retain the initial list buffer */
- if (ir->verletbuf_tol > 0 && !(EI_MD(ir->eI) && ir->etc == etcNO))
+ if (EI_DYNAMICS(ir->eI) &&
+ ir->verletbuf_tol > 0 &&
+ !(EI_MD(ir->eI) && ir->etc == etcNO))
{
/* Update the Verlet buffer size for the current run setup */
verletbuf_list_setup_t ls;