set_property(GLOBAL PROPERTY GMX_AVX_512_SOURCE)
add_library(libgromacs_external OBJECT "")
+add_library(libgromacs_generated OBJECT "")
if (BUILD_SHARED_LIBS)
set_target_properties(libgromacs_external PROPERTIES POSITION_INDEPENDENT_CODE true)
+ set_target_properties(libgromacs_generated PROPERTIES POSITION_INDEPENDENT_CODE true)
endif()
function (_gmx_add_files_to_property PROPERTY)
utility/baseversion-gen.c.cmakein ${GENERATED_VERSION_FILE}
REMOTE_HASH)
list(APPEND LIBGROMACS_SOURCES ${GENERATED_VERSION_FILE}
- $<TARGET_OBJECTS:libgromacs_external>)
+ $<TARGET_OBJECTS:libgromacs_external>
+ $<TARGET_OBJECTS:libgromacs_generated>)
# Mark some shared GPU implementation files to compile with CUDA if needed
if (GMX_USE_CUDA)
if(CMAKE_VERSION VERSION_LESS "3.6")
message(ERROR "clang-tidy support requires cmake 3.6.")
endif()
- set_target_properties(libgromacs PROPERTIES CXX_CLANG_TIDY "${CLANG_TIDY_EXE};--checks=-clang-analyzer-security.insecureAPI.strcpy,-clang-analyzer-core.NullDereference,bugprone-*,-bugprone-integer-division;-warnings-as-errors=*")
+ set_target_properties(libgromacs PROPERTIES CXX_CLANG_TIDY "${CLANG_TIDY_EXE};--checks=\
+ -clang-analyzer-security.insecureAPI.strcpy,-clang-analyzer-core.NullDereference,\
+ bugprone-*,misc-*,readability-*,performance-*,mpi-*,-bugprone-integer-division,\
+ -readability-redundant-smartptr-get,-readability-redundant-string-cstr,-readability-simplify-boolean-expr,\
+ -misc-misplaced-widening-cast,-readability-named-parameter,-performance-noexcept-move-constructor,\
+ -readability-misleading-indentation,-readability-container-size-empty,-misc-suspicious-string-compare,\
+ -readability-redundant-control-flow,-performance-unnecessary-value-param,\
+ -readability-static-definition-in-anonymous-namespace,-misc-suspicious-missing-comma,\
+ -readability-redundant-member-init,-misc-misplaced-const,-performance-type-promotion-in-math-fn,\
+ -misc-incorrect-roundings,-misc-macro-parentheses,-readability-function-size,-readability-else-after-return,\
+ -readability-inconsistent-declaration-parameter-name,-misc-throw-by-value-catch-by-reference,\
+ -readability-non-const-parameter,-readability-implicit-bool-conversion;-warnings-as-errors=*")
endif()
gmx_write_installed_header_list()
std::string filenameModified(filename);
if (numBias > 1)
{
- size_t n = filenameModified.rfind(".");
+ size_t n = filenameModified.rfind('.');
GMX_RELEASE_ASSERT(n != std::string::npos, "The filename should contain an extension starting with .");
filenameModified.insert(n, formatString("%d", biasIndex));
}
{
/* Transform the data into a grid in order to map each grid point to a data point
using the grid functions. */
- std::vector<GridAxis> axis_;
/* Count the number of points for each dimension. Each dimension
has its own stride. */
GMX_THROW(InvalidInputError(mesg));
}
+ std::vector<GridAxis> axis_;
+ axis_.reserve(grid.numDimensions());
/* The data grid has the data that was read and the properties of the AWH grid */
for (int d = 0; d < grid.numDimensions(); d++)
{
= outputRedirector_->openTextOutputFile("onlinehelp/" + tag + ".rst");
TextWriter writer(file);
writer.writeLine(formatString(".. _%s:", displayName.c_str()));
- if (0 == displayName.compare(binaryName_ + " mdrun"))
+ if (displayName == binaryName_ + " mdrun")
{
// Make an extra link target for the convenience of
// MPI-specific documentation
{
if (dd != nullptr)
{
- return { dd->comm->npmenodes_x, dd->comm->npmenodes_y };
+ return {
+ dd->comm->npmenodes_x, dd->comm->npmenodes_y
+ };
}
else
{
- return { 1, 1 };
+ return {
+ 1, 1
+ };
}
}
lossFraction = dd_force_imb_perf_loss(dd);
std::string msg = "\n Dynamic load balancing report:\n";
- std::string dlbStateStr = "";
+ std::string dlbStateStr;
switch (dd->comm->dlbState)
{
* \param[in] numBias The total number of AWH biases in the system.
* \param[in] biasIndex The index of this bias.
*/
- OutputFile(const std::string filename,
- const std::string baseTitle,
+ OutputFile(std::string filename,
+ std::string baseTitle,
int numBias,
int biasIndex);
"Size", n_x, max_size, t_x, t_y, cs_dist, 0, cmid, cmax,
rlo, rmid, rhi, &nlevels);
gmx_ffclose(fp);
- if (mtop)
- {
- delete mtop;
- }
+ delete mtop;
sfree(t_x);
sfree(t_y);
for (i = 0; (i < n_x); i++)
real scale_factor,
real linear_toler)
{
- std::vector<int> index;
- for (auto &ai : atom_index)
- {
- index.push_back(static_cast<int>(ai));
- }
+ std::vector<int> index(atom_index.begin(), atom_index.end());
rvec xcm;
double tmass = calc_xcm(top_x, index.size(),
* someone assumes that extending the group-scheme table-type
* enumeration is something that GROMACS supports. */
/* cppcheck-suppress duplicateExpression */
- assert(etiNR == 3);
+ static_assert(etiNR == 3, "");
kernel_data.table_elec = nblists->table_elec;
kernel_data.table_vdw = nblists->table_vdw;
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017,2018, 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.
}
oatom = ps->param[i].a[1-k]; /* the other atom */
if (vsite_type[oatom] == NOTSET &&
- vsite_type[oatom] != F_VSITEN &&
oatom == plist[pindex[atom].ftype].param[pindex[atom].parnr].aj())
{
/* if the other atom isn't a vsite, and it is AI */
for (k = 0; (k < 2) && !bKeep; k++) /* for all atoms in the bond */
{
atom = ps->param[i].a[k];
- if (vsite_type[atom] == NOTSET && vsite_type[atom] != F_VSITEN)
+ if (vsite_type[atom] == NOTSET)
{
bUsed = FALSE;
for (m = 0; (m < vsnral) && !bUsed; m++)
for (k = 0; (k < 3) && !bKeep; k++) /* for all atoms in the angle */
{
atom = ps->param[i].a[k];
- if (vsite_type[atom] == NOTSET && vsite_type[atom] != F_VSITEN)
+ if (vsite_type[atom] == NOTSET)
{
bUsed = FALSE;
for (m = 0; (m < vsnral) && !bUsed; m++)
GMX_ASSERT(vsnral != 0, "If we've seen a vsite before, we know how many constructing atoms it had");
GMX_ASSERT(first_atoms != NULL, "If we've seen a vsite before, we know what its first atom index was");
atom = ps->param[i].a[k];
- if (vsite_type[atom] == NOTSET && vsite_type[atom] != F_VSITEN)
+ if (vsite_type[atom] == NOTSET)
{
/* vsnral will be set here, we don't get here with nvsite==0 */
bUsed = FALSE;
s += gmx::formatString(" Features:");
for (auto &f : cpuInfo.featureSet())
{
- s += gmx::formatString(" %s", cpuInfo.featureString(f).c_str());;
+ s += gmx::formatString(" %s", gmx::CpuInfo::featureString(f).c_str());
}
s += gmx::formatString("\n");
}
#
# 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,2018, 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(LINEARALGEBRA_SOURCES
${LINEARALGEBRA_SOURCES} ${BLAS_SOURCES} ${LAPACK_SOURCES})
-set(LIBGROMACS_SOURCES
- ${LIBGROMACS_SOURCES} ${LINEARALGEBRA_SOURCES} PARENT_SCOPE)
+target_sources(libgromacs_external PRIVATE ${LINEARALGEBRA_SOURCES})
gmx_install_headers(
eigensolver.h
void done_lincs(Lincs *li)
{
- if (li)
- {
- delete li;
- }
+ delete li;
}
/*! \brief Sets up the work division over the threads. */
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2010,2012,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2010,2012,2014,2015,2016,2018, 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.
namespace gmx
{
-using internal::OptionsImpl;
-
namespace
{
#
# This file is part of the GROMACS molecular simulation package.
#
-# Copyright (c) 2010,2012,2013,2014,2015, by the GROMACS development team, led by
+# Copyright (c) 2010,2012,2013,2014,2015,2018, 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.
# the research papers on the package. Check out http://www.gromacs.org.
file(GLOB SELECTION_SOURCES *.cpp)
+set(LIBGROMACS_SOURCES_GENERATED
+ "${CMAKE_CURRENT_LIST_DIR}/scanner.cpp"
+ "${CMAKE_CURRENT_LIST_DIR}/parser.cpp")
+list(REMOVE_ITEM SELECTION_SOURCES ${LIBGROMACS_SOURCES_GENERATED})
set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${SELECTION_SOURCES} PARENT_SCOPE)
+target_sources(libgromacs_generated PRIVATE ${LIBGROMACS_SOURCES_GENERATED})
gmx_install_headers(
nbsearch.h
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016,2017,2018, 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.
* is over a periodic boundary from `centerCell`, triclinic shifts
* should have been applied to `centerCell` X/Y components.
*/
- real computeCutoffExtent(const RVec centerCell, const ivec cell, int dim) const;
+ real computeCutoffExtent(RVec centerCell, const ivec cell, int dim) const;
/*! \brief
* Advances cell pair loop to the next cell.
*
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2009,2010,2011,2012,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2014,2015,2016,2017,2018, 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.
/* For variable symbols, return the type of the variable value */
if (symtype == gmx::SelectionParserSymbol::VariableSymbol)
{
- gmx::SelectionTreeElementPointer var = symbol->variableValue();
+ const gmx::SelectionTreeElementPointer &var = symbol->variableValue();
/* Return simple tokens for constant variables */
if (var->type == SEL_CONST)
{
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2015,2017,2018, 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.
}
else
{
- size_t newpos = input_.find("\n", pos_);
+ size_t newpos = input_.find('\n', pos_);
if (newpos == std::string::npos)
{
newpos = input_.size();