Merge release-4-6 into master
[alexxy/gromacs.git] / src / gromacs / mdlib / forcerec.c
index 909006c56f3198c35bfe67b8f53931d321118e15..fec67cfaf63364d7de310adc3adc0145a0f3ff9f 100644 (file)
@@ -73,6 +73,7 @@
 #include "nbnxn_consts.h"
 #include "statutil.h"
 #include "gmx_omp_nthreads.h"
+#include "gmx_detect_hardware.h"
 
 #ifdef _MSC_VER
 /* MSVC definition for __cpuid() */
@@ -2038,6 +2039,17 @@ void init_forcerec(FILE              *fp,
     t_nblists     *nbl;
     int           *nm_ind, egp_flags;
 
+    if (fr->hwinfo == NULL)
+    {
+        /* Detect hardware, gather information.
+         * In mdrun, hwinfo has already been set before calling init_forcerec.
+         * Here we ignore GPUs, as tools will not use them anyhow.
+         */
+        snew(fr->hwinfo, 1);
+        gmx_detect_hardware(fp, fr->hwinfo, cr,
+                            FALSE, FALSE, NULL);
+    }
+
     /* By default we turn acceleration on, but it might be turned off further down... */
     fr->use_cpu_acceleration = TRUE;