Remove unnecessary config.h includes
[alexxy/gromacs.git] / src / gromacs / gmxlib / nrnb.c
index 2f818ff2525cdc7611fcd98d8e7f74187340f0f5..54925d85ed4d95591c22e3dbd0b0ea8053048d8d 100644 (file)
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
 
+#include <stdlib.h>
 #include <string.h>
-#include "types/commrec.h"
-#include "sysstuff.h"
-#include "gmx_fatal.h"
-#include "names.h"
-#include "macros.h"
-#include "nrnb.h"
-#include "main.h"
-#include "smalloc.h"
+
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/legacyheaders/names.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/nrnb.h"
+#include "gromacs/utility/smalloc.h"
 
 typedef struct {
     const char *name;
@@ -118,6 +115,8 @@ static const t_nrnb_data nbdata[eNRNB] = {
     { "NxN LJ add F-switch [V&F]",      22 },
     { "NxN LJ add P-switch [F]",        27 }, /* extra cost for LJ P-switch */
     { "NxN LJ add P-switch [V&F]",      20 },
+    { "NxN LJ add LJ Ewald [F]",        36 }, /* extra cost for LJ Ewald */
+    { "NxN LJ add LJ Ewald [V&F]",      33 },
     { "1,4 nonbonded interactions",     90 },
     { "Born radii (Still)",             47 },
     { "Born radii (HCT/OBC)",          183 },
@@ -316,10 +315,10 @@ static gmx_bool nrnb_is_nbnxn_vdw_kernel(int enr)
     return (enr >= eNR_NBNXN_LJ_RF && enr <= eNR_NBNXN_LJ_E);
 }
 
-/* Returns in enr is the index of an nbnxn kernel addition (switch function) */
+/* Returns in enr is the index of an nbnxn kernel addition (LJ modification) */
 static gmx_bool nrnb_is_nbnxn_kernel_addition(int enr)
 {
-    return (enr >= eNR_NBNXN_LJ_FSW && enr <= eNR_NBNXN_LJ_PSW_E);
+    return (enr >= eNR_NBNXN_ADD_LJ_FSW && enr <= eNR_NBNXN_ADD_LJ_EWALD_E);
 }
 
 void print_flop(FILE *out, t_nrnb *nrnb, double *nbfs, double *mflop)
@@ -394,8 +393,8 @@ void print_flop(FILE *out, t_nrnb *nrnb, double *nbfs, double *mflop)
             flop    = nbdata[i].flop;
             if (nrnb_is_nbnxn_vdw_kernel(i))
             {
-                /* Possibly add the cost of a switch function */
-                for (j = eNR_NBNXN_LJ_FSW; j <= eNR_NBNXN_LJ_PSW; j += 2)
+                /* Possibly add the cost of an LJ switch/Ewald function */
+                for (j = eNR_NBNXN_ADD_LJ_FSW; j <= eNR_NBNXN_ADD_LJ_EWALD; j += 2)
                 {
                     int e_kernel_add;
 
@@ -424,6 +423,15 @@ void print_flop(FILE *out, t_nrnb *nrnb, double *nbfs, double *mflop)
         fprintf(out, " %-32s %16s %15.3f  %6.1f\n",
                 "Total", "", *mflop, tfrac);
         fprintf(out, "%s\n\n", myline);
+
+        if (nrnb->n[eNR_NBKERNEL_GENERIC] > 0)
+        {
+            fprintf(out,
+                    "WARNING: Using the slow generic C kernel. This is fine if you are\n"
+                    "comparing different implementations or MD software. Routine\n"
+                    "simulations should use a different non-bonded setup for much better\n"
+                    "performance.\n\n");
+        }
     }
 }
 
@@ -581,7 +589,7 @@ void pr_load(FILE *log, t_commrec *cr, t_nrnb nrnb[])
 
     fprintf(log, "\nDetailed load balancing info in percentage of average\n");
 
-    fprintf(log, " Type                 NODE:");
+    fprintf(log, " Type                 RANK:");
     for (i = 0; (i < cr->nnodes); i++)
     {
         fprintf(log, "%3d ", i);