"-clang-analyzer-security.insecureAPI.strcpy"
"bugprone-*" "misc-*" "readability-*" "performance-*" "mpi-*"
"-misc-misplaced-widening-cast"
- "-misc-misplaced-const"
"-misc-incorrect-roundings" #TODO: #2562
"-readability-else-after-return"
"-readability-inconsistent-declaration-parameter-name"
return ef;
}
-t_fileio *enx_file_pointer(const ener_file_t ef)
+t_fileio *enx_file_pointer(const ener_file* ef)
{
return ef->fio;
}
ener_file_t open_enx(const char *fn, const char *mode);
-struct t_fileio *enx_file_pointer(const ener_file_t ef);
+struct t_fileio *enx_file_pointer(const ener_file* ef);
/* Free the contents of ef */
void close_enx(ener_file_t ef);
return ga->atom[nt].ptype;
}
-int get_atomtype_batype(int nt, gpp_atomtype_t ga)
+int get_atomtype_batype(int nt, const gpp_atomtype* ga)
{
if ((nt < 0) || (nt >= ga->nr))
{
real get_atomtype_qA(int nt, gpp_atomtype_t at);
real get_atomtype_qB(int nt, gpp_atomtype_t at);
int get_atomtype_ptype(int nt, gpp_atomtype_t at);
-int get_atomtype_batype(int nt, gpp_atomtype_t at);
+int get_atomtype_batype(int nt, const gpp_atomtype* at);
int get_atomtype_atomnumber(int nt, gpp_atomtype_t at);
/* Return the above variable for atomtype nt, or NOTSET if not found */
*/
static int natom_match(t_param *pi,
int type_i, int type_j, int type_k, int type_l,
- const gpp_atomtype_t atype)
+ const gpp_atomtype* atype)
{
if ((pi->ai() == -1 || get_atomtype_batype(type_i, atype) == pi->ai()) &&
(pi->aj() == -1 || get_atomtype_batype(type_j, atype) == pi->aj()) &&
* were found, the vector will be empty.
*/
const std::vector<hwloc_obj_t>
-getHwLocDescendantsByType(const hwloc_obj_t obj, const hwloc_obj_type_t type)
+getHwLocDescendantsByType(const hwloc_obj* obj, const hwloc_obj_type_t type)
{
GMX_RELEASE_ASSERT(obj, "NULL hwloc object provided to getHwLocDescendantsByType()");
* \return If all the data is found the return value is 0, otherwise non-zero.
*/
int
-parseHwLocSocketsCoresThreads(const hwloc_topology_t topo,
+parseHwLocSocketsCoresThreads(hwloc_topology_t topo,
HardwareTopology::Machine * machine)
{
- const hwloc_obj_t root = hwloc_get_root_obj(topo);
+ const hwloc_obj *const root = hwloc_get_root_obj(topo);
std::vector<hwloc_obj_t> hwlocSockets = getHwLocDescendantsByType(root, HWLOC_OBJ_PACKAGE);
machine->logicalProcessorCount = hwloc_get_nbobjs_by_type(topo, HWLOC_OBJ_PU);
* \return If any cache data is found the return value is 0, otherwise non-zero.
*/
int
-parseHwLocCache(const hwloc_topology_t topo,
+parseHwLocCache(hwloc_topology_t topo,
HardwareTopology::Machine * machine)
{
// Parse caches up to L5
* entire machine) the return value is 0, otherwise non-zero.
*/
int
-parseHwLocNuma(const hwloc_topology_t topo,
+parseHwLocNuma(hwloc_topology_t topo,
HardwareTopology::Machine * machine)
{
- const hwloc_obj_t root = hwloc_get_root_obj(topo);
+ const hwloc_obj *const root = hwloc_get_root_obj(topo);
std::vector<hwloc_obj_t> hwlocNumaNodes = getHwLocDescendantsByType(root, HWLOC_OBJ_NUMANODE);
bool topologyOk = true;
else
{
// No numa nodes found. Use the entire machine as a numa node.
- const hwloc_obj_t hwlocMachine = hwloc_get_next_obj_by_type(topo, HWLOC_OBJ_MACHINE, nullptr);
+ const hwloc_obj*const hwlocMachine = hwloc_get_next_obj_by_type(topo, HWLOC_OBJ_MACHINE, nullptr);
if (hwlocMachine != nullptr)
{
* \return If any devices were found the return value is 0, otherwise non-zero.
*/
int
-parseHwLocDevices(const hwloc_topology_t topo,
+parseHwLocDevices(hwloc_topology_t topo,
HardwareTopology::Machine * machine)
{
- const hwloc_obj_t root = hwloc_get_root_obj(topo);
+ const hwloc_obj *const root = hwloc_get_root_obj(topo);
std::vector<hwloc_obj_t> pcidevs = getHwLocDescendantsByType(root, HWLOC_OBJ_PCI_DEVICE);
for (auto &p : pcidevs)
{
- const hwloc_obj_t ancestor = hwloc_get_ancestor_obj_by_type(topo, HWLOC_OBJ_NUMANODE, p);
- int numaId;
+ const hwloc_obj *const ancestor = hwloc_get_ancestor_obj_by_type(topo, HWLOC_OBJ_NUMANODE, p);
+ int numaId;
if (ancestor != nullptr)
{
numaId = ancestor->logical_index;
/* Sets the atom type in nbnxn_atomdata_t */
static void nbnxn_atomdata_set_atomtypes(nbnxn_atomdata_t *nbat,
- const nbnxn_search_t nbs,
+ const nbnxn_search *nbs,
const int *type)
{
for (const nbnxn_grid_t &grid : nbs->grid)
/* Sets the LJ combination rule parameters in nbnxn_atomdata_t */
static void nbnxn_atomdata_set_ljcombparams(nbnxn_atomdata_t *nbat,
- const nbnxn_search_t nbs)
+ const nbnxn_search *nbs)
{
if (nbat->comb_rule != ljcrNONE)
{
/* Sets the charges in nbnxn_atomdata_t *nbat */
static void nbnxn_atomdata_set_charges(nbnxn_atomdata_t *nbat,
- const nbnxn_search_t nbs,
+ const nbnxn_search *nbs,
const real *charge)
{
for (const nbnxn_grid_t &grid : nbs->grid)
* using the original charge and LJ data, not nbnxn_atomdata_t.
*/
static void nbnxn_atomdata_mask_fep(nbnxn_atomdata_t *nbat,
- const nbnxn_search_t nbs)
+ const nbnxn_search *nbs)
{
real *q;
int stride_q, nsubc;
/* Set the energy group indices for atoms in nbnxn_atomdata_t */
static void nbnxn_atomdata_set_energygroups(nbnxn_atomdata_t *nbat,
- const nbnxn_search_t nbs,
+ const nbnxn_search *nbs,
const int *atinfo)
{
if (nbat->nenergrp == 1)
/* Sets all required atom parameter data in nbnxn_atomdata_t */
void nbnxn_atomdata_set(nbnxn_atomdata_t *nbat,
- const nbnxn_search_t nbs,
+ const nbnxn_search *nbs,
const t_mdatoms *mdatoms,
const int *atinfo)
{
}
/* Copies (and reorders) the coordinates to nbnxn_atomdata_t */
-void nbnxn_atomdata_copy_x_to_nbat_x(const nbnxn_search_t nbs,
+void nbnxn_atomdata_copy_x_to_nbat_x(const nbnxn_search *nbs,
int locality,
gmx_bool FillLocal,
rvec *x,
/* Add part of the force array(s) from nbnxn_atomdata_t to f */
static void
-nbnxn_atomdata_add_nbat_f_to_f_part(const nbnxn_search_t nbs,
+nbnxn_atomdata_add_nbat_f_to_f_part(const nbnxn_search *nbs,
const nbnxn_atomdata_t *nbat,
nbnxn_atomdata_output_t *out,
int nfa,
}
/* Add the force array(s) from nbnxn_atomdata_t to f */
-void nbnxn_atomdata_add_nbat_f_to_f(const nbnxn_search_t nbs,
+void nbnxn_atomdata_add_nbat_f_to_f(nbnxn_search *nbs,
int locality,
const nbnxn_atomdata_t *nbat,
rvec *f,
/* Copy the atom data to the non-bonded atom data structure */
void nbnxn_atomdata_set(nbnxn_atomdata_t *nbat,
- const nbnxn_search_t nbs,
+ const nbnxn_search *nbs,
const t_mdatoms *mdatoms,
const int *atinfo);
/* Copy x to nbat->x.
* FillLocal tells if the local filler particle coordinates should be zeroed.
*/
-void nbnxn_atomdata_copy_x_to_nbat_x(const nbnxn_search_t nbs,
+void nbnxn_atomdata_copy_x_to_nbat_x(const nbnxn_search *nbs,
int locality,
gmx_bool FillLocal,
rvec *x,
gmx_wallcycle *wcycle);
/* Add the forces stored in nbat to f, zeros the forces in nbat */
-void nbnxn_atomdata_add_nbat_f_to_f(const nbnxn_search_t nbs,
+void nbnxn_atomdata_add_nbat_f_to_f(nbnxn_search *nbs,
int locality,
const nbnxn_atomdata_t *nbat,
rvec *f,
return numAtoms/(size[XX]*size[YY]*size[ZZ]);
}
-static void set_grid_size_xy(const nbnxn_search_t nbs,
+static void set_grid_size_xy(const nbnxn_search *nbs,
nbnxn_grid_t *grid,
int ddZone,
int numAtoms,
/* Fill a pair search cell with atoms.
* Potentially sorts atoms and sets the interaction flags.
*/
-static void fill_cell(const nbnxn_search_t nbs,
+static void fill_cell(nbnxn_search *nbs,
nbnxn_grid_t *grid,
nbnxn_atomdata_t *nbat,
int atomStart,
}
/* Spatially sort the atoms within one grid column */
-static void sort_columns_simple(const nbnxn_search_t nbs,
+static void sort_columns_simple(nbnxn_search *nbs,
int dd_zone,
nbnxn_grid_t *grid,
int atomStart, int atomEnd,
}
/* Spatially sort the atoms within one grid column */
-static void sort_columns_supersub(const nbnxn_search_t nbs,
+static void sort_columns_supersub(nbnxn_search *nbs,
int dd_zone,
nbnxn_grid_t *grid,
int atomStart, int atomEnd,
}
/* Determine in which grid cells the atoms should go */
-static void calc_cell_indices(const nbnxn_search_t nbs,
+static void calc_cell_indices(nbnxn_search *nbs,
int ddZone,
nbnxn_grid_t *grid,
int atomStart,
*ncy = nbs->grid[0].numCells[YY];
}
-gmx::ArrayRef<const int> nbnxn_get_atomorder(const nbnxn_search_t nbs)
+gmx::ArrayRef<const int> nbnxn_get_atomorder(const nbnxn_search *nbs)
{
/* Return the atom order for the home cell (index 0) */
const nbnxn_grid_t &grid = nbs->grid[0];
void nbnxn_get_ncells(nbnxn_search_t nbs, int *ncx, int *ncy);
/* Return the order indices of the atoms on the pairlist search grid */
-gmx::ArrayRef<const int> nbnxn_get_atomorder(const nbnxn_search_t nbs);
+gmx::ArrayRef<const int> nbnxn_get_atomorder(const nbnxn_search* nbs);
/* Renumber the atom indices on the grid to consecutive order */
void nbnxn_set_atomorder(nbnxn_search_t nbs);
gmx_icell_set_x_t *icell_set_x; /* Function for setting i-coords */
/* Thread-local work data */
- std::vector<nbnxn_search_work_t> work; /* Work array, one entry for each thread */
+ mutable std::vector<nbnxn_search_work_t> work; /* Work array, one entry for each thread */
};
return (double)cc->c*1e-6/cc->count;
}
-static void nbs_cycle_print(FILE *fp, const nbnxn_search_t nbs)
+static void nbs_cycle_print(FILE *fp, const nbnxn_search *nbs)
{
fprintf(fp, "\n");
fprintf(fp, "ns %4d grid %4.1f search %4.1f red.f %5.3f",
/* Print statistics of a pair list, used for debug output */
static void print_nblist_statistics_simple(FILE *fp, const nbnxn_pairlist_t *nbl,
- const nbnxn_search_t nbs, real rl)
+ const nbnxn_search *nbs, real rl)
{
const nbnxn_grid_t *grid;
int cs[SHIFTS];
/* Print statistics of a pair lists, used for debug output */
static void print_nblist_statistics_supersub(FILE *fp, const nbnxn_pairlist_t *nbl,
- const nbnxn_search_t nbs, real rl)
+ const nbnxn_search *nbs, real rl)
{
const nbnxn_grid_t *grid;
int b;
* as masks in the pair-list for simple list entry iEntry.
*/
static void
-setExclusionsForSimpleIentry(const nbnxn_search_t nbs,
+setExclusionsForSimpleIentry(const nbnxn_search *nbs,
nbnxn_pairlist_t *nbl,
gmx_bool diagRemoved,
int na_cj_2log,
* LJ parameters have been zeroed in the nbnxn data structure.
* Simultaneously make a group pair list for the perturbed pairs.
*/
-static void make_fep_list(const nbnxn_search_t nbs,
+static void make_fep_list(const nbnxn_search *nbs,
const nbnxn_atomdata_t *nbat,
nbnxn_pairlist_t *nbl,
gmx_bool bDiagRemoved,
}
/* As make_fep_list above, but for super/sub lists. */
-static void make_fep_list_supersub(const nbnxn_search_t nbs,
+static void make_fep_list_supersub(const nbnxn_search *nbs,
const nbnxn_atomdata_t *nbat,
nbnxn_pairlist_t *nbl,
gmx_bool bDiagRemoved,
* as masks in the pair-list for i-super-cluster list entry iEntry.
*/
static void
-setExclusionsForGpuIentry(const nbnxn_search_t nbs,
+setExclusionsForGpuIentry(const nbnxn_search *nbs,
nbnxn_pairlist_t *nbl,
gmx_bool diagRemoved,
const nbnxn_sci_t &iEntry,
}
/* Estimates the average size of a full j-list for super/sub setup */
-static void get_nsubpair_target(const nbnxn_search_t nbs,
+static void get_nsubpair_target(const nbnxn_search *nbs,
int iloc,
real rlist,
int min_ci_balanced,
}
}
-static void balance_fep_lists(const nbnxn_search_t nbs,
+static void balance_fep_lists(const nbnxn_search *nbs,
nbnxn_pairlist_set_t *nbl_lists)
{
int nnbl;
}
/* Generates the part of pair-list nbl assigned to our thread */
-static void nbnxn_make_pairlist_part(const nbnxn_search_t nbs,
+static void nbnxn_make_pairlist_part(const nbnxn_search *nbs,
const nbnxn_grid_t *gridi,
const nbnxn_grid_t *gridj,
nbnxn_search_work_t *work,
}
}
-static void reduce_buffer_flags(const nbnxn_search_t nbs,
+static void reduce_buffer_flags(const nbnxn_search *nbs,
int nsrc,
const nbnxn_buffer_flags_t *dest)
{
}
/* Make a local or non-local pair-list, depending on iloc */
-void nbnxn_make_pairlist(const nbnxn_search_t nbs,
+void nbnxn_make_pairlist(nbnxn_search *nbs,
nbnxn_atomdata_t *nbat,
const t_blocka *excl,
real rlist,
//! Return whether the simulation finished in a way valid for reporting walltime.
bool
-walltime_accounting_get_valid_finish(const gmx_walltime_accounting_t walltime_accounting)
+walltime_accounting_get_valid_finish(const gmx_walltime_accounting* walltime_accounting)
{
return walltime_accounting->isValidFinish;
}
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,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 whether the simulation finished in a way valid for reporting walltime.
bool
-walltime_accounting_get_valid_finish(const gmx_walltime_accounting_t walltime_accounting);
+walltime_accounting_get_valid_finish(const gmx_walltime_accounting* walltime_accounting);
/*! \brief
* Calls system timing routines (e.g. clock_gettime) to get the (fractional)