bugprone-*,misc-*,readability-*,performance-*,mpi-*,\
-misc-misplaced-widening-cast,-readability-named-parameter,\
-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-unnecessary-value-param,\
+ -misc-suspicious-missing-comma,\
+ -misc-misplaced-const,\
-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=*;-fix")
state_(awhBiasParams, params_.initialHistogramSize, dimParams_, grid_),
thisRankDoesIO_(thisRankWillDoIO == ThisRankWillDoIO::Yes),
biasForce_(ndim()),
- alignedTempWorkSpace_(),
+
tempForce_(ndim()),
numWarningsIssued_(0)
{
* the iterator of this map, which is based on the enum value
* (and matches the order of the lines below).
*/
-static const std::map<AwhOutputEntryType, Normalization> outputTypeToNormalization =
+const std::map<AwhOutputEntryType, Normalization> outputTypeToNormalization =
{
{ AwhOutputEntryType::MetaData, Normalization::None },
{ AwhOutputEntryType::CoordValue, Normalization::Coordinate },
gmx_incons("Illegal datatype when converting values to a real array!");
return;
}
- return;
}
real getDistanceScaleFactor(gmx_tng_trajectory_t in)
* the output that mdrun writes. It would be better to define these
* values in a single location.
*/
-static constexpr int maxAwhGraphs = 6;
+constexpr int maxAwhGraphs = 6;
/*! \brief Constructs a legend for a standard awh output file */
std::vector<std::string>makeLegend(const AwhBiasParams *awhBiasParams,
numDim_(0),
firstGraphSubBlock_(0),
numGraph_(0),
- useKTForEnergy_(0),
- scaleFactor_(),
- legend_(),
- xLabel_(),
- yLabel_()
+ useKTForEnergy_(0)
+
{
// cppcheck-suppress useInitializationList
baseFilename_ = filename.substr(0, filename.find('.'));
}
result[slice] = sum;
}
- return;
}
static void calc_potential(const char *fn, int **index, int gnx[],
/*
* 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.
perfdata->Gcycles[test_nr] = 0.0;
perfdata->ns_per_day[test_nr] = 0.0;
perfdata->PME_f_load[test_nr] = 0.0;
-
- return;
}
}
}
}
- return;
}
void do_nonbonded(const t_forcerec *fr,
*
* 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.
}
}
- return;
}
static void dump_ab(FILE *out, int natom, int nab[], t_hack *ab[], gmx_bool bHeader)
InsertMolecules()
: bBox_(false), nmolIns_(0), nmolTry_(10), seed_(0),
defaultDistance_(0.105), scaleFactor_(0.57), enumRot_(en_rotXYZ),
- top_(), ePBC_(-1)
+ ePBC_(-1)
{
clear_rvec(newBox_);
clear_rvec(deltaR_);
snew(ir->simtempvals->temperatures, ir->fepvals->n_lambda);
GetSimTemps(ir->fepvals->n_lambda, ir->simtempvals, ir->fepvals->all_lambda[efptTEMPERATURE]);
-
- return;
}
static void do_wall_params(t_inputrec *ir,
expand->wl_ratio = get_ereal(inp, "wl-ratio", 0.8, wi);
expand->init_wl_delta = get_ereal(inp, "init-wl-delta", 1.0, wi);
expand->bWLoneovert = get_eeenum(inp, "wl-oneovert", yesno_names, wi);
-
- return;
}
/*! \brief Return whether an end state with the given coupling-lambda
}
hwloc_topology_destroy(topo);
- return; // SupportLevel::Full or SupportLevel::FullWithDevices.
+// SupportLevel::Full or SupportLevel::FullWithDevices.
}
#endif
{
*dp += 2*M_PI;
}
- return;
}
/* As pdihs above, but without calculating energies and shift forces */
}
/*! \brief Zero thread-local output buffers */
-static void
+void
zero_thread_output(bonded_threading_t *bt, int thread)
{
if (!bt->haveBondeds)
#define MAX_BONDED_THREADS 256
/*! \brief Reduce thread-local force buffers */
-static void
+void
reduce_thread_forces(int n, rvec *f,
bonded_threading_t *bt,
int nthreads)
}
/*! \brief Reduce thread-local forces, shift forces and energies */
-static void
+void
reduce_thread_output(int n, rvec *f, rvec *fshift,
real *ener, gmx_grppairener_t *grpp, real *dvdl,
bonded_threading_t *bt,
/*! \brief Calculate one element of the list of bonded interactions
for this thread */
-static real
+real
calc_one_bond(int thread,
int ftype, const t_idef *idef,
const bonded_threading_t &bondedThreading,
{
MDAtoms::MDAtoms()
- : mdatoms_(nullptr), chargeA_()
+ : mdatoms_(nullptr)
{
}
}
fprintf(fplog, "]\n");
}
- return;
}
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 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.
ekinf(nullptr),
ekinh_old(nullptr),
ekin_total(),
- ekinscalef_nhc(),
- ekinscaleh_nhc(),
- vscale_nhc(),
+
dekindl(0),
mvcos(0)
{
flags(0),
fep_state(0),
lambda(),
- nosehoover_xi(),
- nosehoover_vxi(),
- nhpres_xi(),
- nhpres_vxi(),
- therm_integral(),
+
baros_integral(0),
veta(0),
vol0(0),
- x(),
- v(),
- cg_p(),
+
ekinstate(),
hist(),
dfhist(nullptr),
awhHistory(nullptr),
ddp_count(0),
- ddp_count_cg_gl(0),
- cg_gl()
+ ddp_count_cg_gl(0)
+
{
// It would be nicer to initialize these with {} or {{0}} in the
// above initialization list, but uncrustify doesn't understand
copyIndicesToGroup(indCations, nCations, g, cr);
sfree(indAnions);
sfree(indCations);
-
- return;
}
constexpr bool g_usingMpi = GMX_MPI;
//! Helper function to prepare to all-gather the vector of non-bonded tasks on this node.
-static std::vector<int> allgather(const int &input,
- int numRanks,
- MPI_Comm communicator)
+std::vector<int> allgather(const int &input,
+ int numRanks,
+ MPI_Comm communicator)
{
std::vector<int> result(numRanks);
if (g_usingMpi && numRanks > 1)
}
//! Helper function to compute allgatherv displacements.
-static std::vector<int> computeDisplacements(ArrayRef<const int> extentOnEachRank,
- int numRanks)
+std::vector<int> computeDisplacements(ArrayRef<const int> extentOnEachRank,
+ int numRanks)
{
std::vector<int> displacements(numRanks + 1);
displacements[0] = 0;
}
//! Helper function to all-gather the vector of all GPU tasks on ranks of this node.
-static std::vector<GpuTask> allgatherv(ArrayRef<const GpuTask> input,
- ArrayRef<const int> extentOnEachRank,
- ArrayRef<const int> displacementForEachRank,
- MPI_Comm communicator)
+std::vector<GpuTask> allgatherv(ArrayRef<const GpuTask> input,
+ ArrayRef<const int> extentOnEachRank,
+ ArrayRef<const int> displacementForEachRank,
+ MPI_Comm communicator)
{
// Now allocate the vector and do the allgatherv
int totalExtent = displacementForEachRank.back();
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2017, by the GROMACS development team, led by
+ * Copyright (c) 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.
* GPUs used (per node) can be different from the number of GPU IDs
* used.
*/
-static size_t countUniqueGpuIdsUsed(const GpuTaskAssignments &gpuTaskAssignmentOnRanksOfThisNode)
+size_t countUniqueGpuIdsUsed(const GpuTaskAssignments &gpuTaskAssignmentOnRanksOfThisNode)
{
std::set<int> uniqueIds;
for (const auto &assignmentsOnRank : gpuTaskAssignmentOnRanksOfThisNode)
{
public:
//! Constructor
- SingleRankChecker() : value_(false), reasons_() {}
+ SingleRankChecker() : value_(false) {}
/*! \brief Call this function for each possible condition
under which a single rank is required, along with a string
describing the constraint when it is applied. */
* that are eligible to run on GPUs.
* \param[in] gpuIds The user-supplied GPU IDs.
*/
-static GpuTaskAssignments
+GpuTaskAssignments
buildTaskAssignment(const GpuTasksOnRanks &gpuTasksOnRanksOfThisNode,
ArrayRef<const int> gpuIds)
{
*
* Sharing GPUs among multiple ranks is possible via either user or
* automated selection. */
-static bool isAnyGpuSharedBetweenRanks(const GpuTaskAssignments &gpuTaskAssignments)
+bool isAnyGpuSharedBetweenRanks(const GpuTaskAssignments &gpuTaskAssignments)
{
// Loop over all ranks i, looking on all higher ranks j whether
// any tasks on them share GPU device IDs.
EnergyFrame::EnergyFrame(const t_enxframe &enxframe,
const std::map<std::string, int> indicesOfEnergyFields)
- : values_(), step_(enxframe.step), time_(enxframe.t)
+ : step_(enxframe.step), time_(enxframe.t)
{
for (auto &index : indicesOfEnergyFields)
{
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 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.
//! Helper method to calculate a vector from two or three positions.
-static void
+void
calc_vec(int natoms, rvec x[], t_pbc *pbc, rvec xout, rvec cout)
{
switch (natoms)
/*
* 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.
* gmx::alignedMalloc(). Just like system-provided routines, it provides
* memory that is aligned - but not padded.
*/
-gmx_unused static void *
+gmx_unused void *
alignedMallocGeneric(std::size_t bytes, std::size_t alignment)
{
// The amount of extra memory (beyound what the user asked for) we need is:
* \note This is an internal routine that should only be called from
* gmx::alignedFree().
*/
-gmx_unused static void
+gmx_unused void
alignedFreeGeneric(void *p)
{
if (p)
}
//! Implement malloc of \c bytes of memory, aligned to \c alignment.
-static void *mallocImpl(std::size_t bytes, std::size_t alignment)
+void *mallocImpl(std::size_t bytes, std::size_t alignment)
{
void * p;
}
//! Free aligned memory allocated with mallocImpl().
-static void freeImpl(void *p)
+void freeImpl(void *p)
{
if (p)
{
strerror(errno));
}
close(fd);
-
#endif
-
/* name in Buf should now be OK and file is CLOSED */
-
- return;
}
FILE *gmx_fopen_temporary(char *buf)
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2010,2012,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2010,2012,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.
#undef QSORT_EXCH
#undef QSORT_SWAP
- return;
}