2 * This file is part of the GROMACS molecular simulation package.
4 * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
5 * Copyright (c) 2001-2004, The GROMACS development team.
6 * Copyright (c) 2013,2014,2015,2017,2018 by the GROMACS development team.
7 * Copyright (c) 2019,2020,2021, by the GROMACS development team, led by
8 * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
9 * and including many others, as listed in the AUTHORS file in the
10 * top-level source directory and at http://www.gromacs.org.
12 * GROMACS is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU Lesser General Public License
14 * as published by the Free Software Foundation; either version 2.1
15 * of the License, or (at your option) any later version.
17 * GROMACS is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * Lesser General Public License for more details.
22 * You should have received a copy of the GNU Lesser General Public
23 * License along with GROMACS; if not, see
24 * http://www.gnu.org/licenses, or write to the Free Software Foundation,
25 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
27 * If you want to redistribute modifications to GROMACS, please
28 * consider that scientific software is very special. Version
29 * control is crucial - bugs must be traceable. We will be happy to
30 * consider code for inclusion in the official distribution, but
31 * derived work must not be called official GROMACS. Details are found
32 * in the README & COPYING files - if they are missing, get the
33 * official version at http://www.gromacs.org.
35 * To help us fund GROMACS development, we humbly ask that you cite
36 * the research papers on the package. Check out http://www.gromacs.org.
39 #ifndef GMX_GMXLIB_NRNB_H
40 #define GMX_GMXLIB_NRNB_H
52 eNR_NBKERNEL_ELEC_W3_VF,
53 eNR_NBKERNEL_ELEC_W3_F,
54 eNR_NBKERNEL_ELEC_W3W3_VF,
55 eNR_NBKERNEL_ELEC_W3W3_F,
56 eNR_NBKERNEL_ELEC_W4_VF,
57 eNR_NBKERNEL_ELEC_W4_F,
58 eNR_NBKERNEL_ELEC_W4W4_VF,
59 eNR_NBKERNEL_ELEC_W4W4_F,
60 eNR_NBKERNEL_ELEC_VDW_VF,
61 eNR_NBKERNEL_ELEC_VDW_F,
62 eNR_NBKERNEL_ELEC_VDW_W3_VF,
63 eNR_NBKERNEL_ELEC_VDW_W3_F,
64 eNR_NBKERNEL_ELEC_VDW_W3W3_VF,
65 eNR_NBKERNEL_ELEC_VDW_W3W3_F,
66 eNR_NBKERNEL_ELEC_VDW_W4_VF,
67 eNR_NBKERNEL_ELEC_VDW_W4_F,
68 eNR_NBKERNEL_ELEC_VDW_W4W4_VF,
69 eNR_NBKERNEL_ELEC_VDW_W4W4_F,
71 eNR_NBKERNEL_NR, /* Total number of interaction-specific kernel entries */
73 eNR_NBKERNEL_GENERIC = eNR_NBKERNEL_NR, /* Reuse number; KERNEL_NR is not an entry itself */
74 eNR_NBKERNEL_GENERIC_CG,
75 eNR_NBKERNEL_FREE_ENERGY, /* Add other generic kernels _before_ the free energy one */
77 eNR_NBKERNEL_TOTAL_NR,
79 eNR_NBNXN_DIST2 = eNR_NBKERNEL_TOTAL_NR, // Reuse the symbolic constant that indicates the last kernel
95 eNR_NBNXN_ADD_LJ_FSW_E,
97 eNR_NBNXN_ADD_LJ_PSW_E,
98 eNR_NBNXN_ADD_LJ_EWALD,
99 eNR_NBNXN_ADD_LJ_EWALD_E,
169 eNR_CROSS_BOND_ANGLE,
176 std::array<double, eNRNB> n = { 0 };
179 void clear_nrnb(t_nrnb* nrnb);
181 void print_nrnb(FILE* out, t_nrnb* nrnb);
183 /*! \brief Increment the nonbonded kernel flop counters
185 * \param nrnb The nonbonded kernel flop counters.
186 * \param index Which counter to incrememnt.
187 * \param increment How much to increment the counter by.
189 static inline void inc_nrnb(t_nrnb* nrnb, int index, int increment)
191 nrnb->n[index] += increment;
194 /*! \brief Atomic increment of nonbonded kernel flop counters
196 * \param nrnb The nonbonded kernel flop counters.
197 * \param index Which counter to incrememnt.
198 * \param increment How much to increment the counter by.
200 * Same as inc_nrnb but includes omp atomic pragma
202 void atomicNrnbIncrement(t_nrnb* nrnb, int index, int increment);
204 void print_flop(FILE* out, t_nrnb* nrnb, double* nbfs, double* mflop);
205 /* Calculates the non-bonded forces and flop count.
206 * When out!=NULL also prints the full count table.
209 void print_perf(FILE* out, double nodetime, double realtime, int64_t nsteps, double delta_t, double nbfs, double mflop);
210 /* Prints the performance, nbfs and mflop come from print_flop */
212 int cost_nrnb(int enr);
213 /* Cost in i860 cycles of this component of MD */
215 const char* nrnb_str(int enr);
216 /* Name of this component */
218 #endif /* GMX_GMXLIB_NRNB_H */