Split lines with many copyright years
[alexxy/gromacs.git] / src / gromacs / gmxlib / nrnb.h
1 /*
2  * This file is part of the GROMACS molecular simulation package.
3  *
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, 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.
11  *
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.
16  *
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.
21  *
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.
26  *
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.
34  *
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.
37  */
38
39 #ifndef GMX_GMXLIB_NRNB_H
40 #define GMX_GMXLIB_NRNB_H
41
42 #include <stdio.h>
43
44 #include "gromacs/utility/basedefinitions.h"
45
46 #define eNR_NBKERNEL_NONE (-1)
47
48 enum
49 {
50     eNR_NBKERNEL_VDW_VF,
51     eNR_NBKERNEL_VDW_F,
52     eNR_NBKERNEL_ELEC_VF,
53     eNR_NBKERNEL_ELEC_F,
54     eNR_NBKERNEL_ELEC_W3_VF,
55     eNR_NBKERNEL_ELEC_W3_F,
56     eNR_NBKERNEL_ELEC_W3W3_VF,
57     eNR_NBKERNEL_ELEC_W3W3_F,
58     eNR_NBKERNEL_ELEC_W4_VF,
59     eNR_NBKERNEL_ELEC_W4_F,
60     eNR_NBKERNEL_ELEC_W4W4_VF,
61     eNR_NBKERNEL_ELEC_W4W4_F,
62     eNR_NBKERNEL_ELEC_VDW_VF,
63     eNR_NBKERNEL_ELEC_VDW_F,
64     eNR_NBKERNEL_ELEC_VDW_W3_VF,
65     eNR_NBKERNEL_ELEC_VDW_W3_F,
66     eNR_NBKERNEL_ELEC_VDW_W3W3_VF,
67     eNR_NBKERNEL_ELEC_VDW_W3W3_F,
68     eNR_NBKERNEL_ELEC_VDW_W4_VF,
69     eNR_NBKERNEL_ELEC_VDW_W4_F,
70     eNR_NBKERNEL_ELEC_VDW_W4W4_VF,
71     eNR_NBKERNEL_ELEC_VDW_W4W4_F,
72
73     eNR_NBKERNEL_NR, /* Total number of interaction-specific kernel entries */
74
75     eNR_NBKERNEL_GENERIC = eNR_NBKERNEL_NR, /* Reuse number; KERNEL_NR is not an entry itself */
76     eNR_NBKERNEL_GENERIC_CG,
77     eNR_NBKERNEL_FREE_ENERGY, /* Add other generic kernels _before_ the free energy one */
78
79     eNR_NBKERNEL_TOTAL_NR,
80
81     eNR_NBNXN_DIST2 = eNR_NBKERNEL_TOTAL_NR, // Reuse the symbolic constant that indicates the last kernel
82     eNR_NBNXN_LJ_RF,
83     eNR_NBNXN_LJ_RF_E,
84     eNR_NBNXN_LJ_TAB,
85     eNR_NBNXN_LJ_TAB_E,
86     eNR_NBNXN_LJ_EWALD,
87     eNR_NBNXN_LJ_EWALD_E,
88     eNR_NBNXN_LJ,
89     eNR_NBNXN_LJ_E,
90     eNR_NBNXN_RF,
91     eNR_NBNXN_RF_E,
92     eNR_NBNXN_TAB,
93     eNR_NBNXN_TAB_E,
94     eNR_NBNXN_EWALD,
95     eNR_NBNXN_EWALD_E,
96     eNR_NBNXN_ADD_LJ_FSW,
97     eNR_NBNXN_ADD_LJ_FSW_E,
98     eNR_NBNXN_ADD_LJ_PSW,
99     eNR_NBNXN_ADD_LJ_PSW_E,
100     eNR_NBNXN_ADD_LJ_EWALD,
101     eNR_NBNXN_ADD_LJ_EWALD_E,
102     eNR_NB14,
103     eNR_WEIGHTS,
104     eNR_SPREAD,
105     eNR_SPREADBSP,
106     eNR_GATHERF,
107     eNR_GATHERFBSP,
108     eNR_FFT,
109     eNR_CONV,
110     eNR_SOLVEPME,
111     eNR_NS,
112     eNR_RESETX,
113     eNR_SHIFTX,
114     eNR_CGCM,
115     eNR_FSUM,
116     eNR_BONDS,
117     eNR_G96BONDS,
118     eNR_FENEBONDS,
119     eNR_TABBONDS,
120     eNR_RESTRBONDS,
121     eNR_LINEAR_ANGLES,
122     eNR_ANGLES,
123     eNR_G96ANGLES,
124     eNR_QANGLES,
125     eNR_TABANGLES,
126     eNR_PROPER,
127     eNR_IMPROPER,
128     eNR_RB,
129     eNR_FOURDIH,
130     eNR_TABDIHS,
131     eNR_DISRES,
132     eNR_ORIRES,
133     eNR_DIHRES,
134     eNR_POSRES,
135     eNR_FBPOSRES,
136     eNR_ANGRES,
137     eNR_ANGRESZ,
138     eNR_MORSE,
139     eNR_CUBICBONDS,
140     eNR_WALLS,
141     eNR_POLARIZE,
142     eNR_ANHARM_POL,
143     eNR_WPOL,
144     eNR_THOLE,
145     eNR_VIRIAL,
146     eNR_UPDATE,
147     eNR_EXTUPDATE,
148     eNR_STOPCM,
149     eNR_PCOUPL,
150     eNR_EKIN,
151     eNR_LINCS,
152     eNR_LINCSMAT,
153     eNR_SHAKE,
154     eNR_CONSTR_V,
155     eNR_SHAKE_RIJ,
156     eNR_CONSTR_VIR,
157     eNR_SETTLE,
158     eNR_VSITE2,
159     eNR_VSITE2FD,
160     eNR_VSITE3,
161     eNR_VSITE3FD,
162     eNR_VSITE3FAD,
163     eNR_VSITE3OUT,
164     eNR_VSITE4FD,
165     eNR_VSITE4FDN,
166     eNR_VSITEN,
167     eNR_CMAP,
168     eNR_UREY_BRADLEY,
169     eNR_CROSS_BOND_BOND,
170     eNR_CROSS_BOND_ANGLE,
171     eNRNB
172 };
173
174
175 struct t_nrnb
176 {
177     double n[eNRNB] = { 0 };
178 };
179
180 struct t_commrec;
181
182 void clear_nrnb(t_nrnb* nrnb);
183
184 void add_nrnb(t_nrnb* dest, t_nrnb* s1, t_nrnb* s2);
185
186 void print_nrnb(FILE* out, t_nrnb* nrnb);
187
188 void _inc_nrnb(t_nrnb* nrnb, int enr, int inc, char* file, int line);
189
190 #ifdef DEBUG_NRNB
191 #    define inc_nrnb(nrnb, enr, inc) _inc_nrnb(nrnb, enr, inc, __FILE__, __LINE__)
192 #else
193 #    define inc_nrnb(nrnb, enr, inc) (nrnb)->n[enr] += inc
194 #endif
195
196
197 void print_flop(FILE* out, t_nrnb* nrnb, double* nbfs, double* mflop);
198 /* Calculates the non-bonded forces and flop count.
199  * When out!=NULL also prints the full count table.
200  */
201
202 void print_perf(FILE* out, double nodetime, double realtime, int64_t nsteps, double delta_t, double nbfs, double mflop);
203 /* Prints the performance, nbfs and mflop come from print_flop */
204
205 void pr_load(FILE* log, struct t_commrec* cr, t_nrnb nrnb[]);
206 /* Print detailed load balancing info */
207
208 int cost_nrnb(int enr);
209 /* Cost in i860 cycles of this component of MD */
210
211 const char* nrnb_str(int enr);
212 /* Name of this component */
213
214 #endif /* GMX_GMXLIB_NRNB_H */