Fix segfault with timer reset and -nb cpu
[alexxy/gromacs.git] / src / programs / mdrun / md.cpp
index f6c3465c8df255fe3618928fa972eed7a0fbd994..4c34f399c159880c1400d98148b085f3c8f5923e 100644 (file)
@@ -133,7 +133,10 @@ static void reset_all_counters(FILE *fplog, t_commrec *cr,
     md_print_warn(cr, fplog, "step %s: resetting all time and cycle counters\n",
                   gmx_step_str(step, sbuf));
 
-    nbnxn_gpu_reset_timings(nbv);
+    if (use_GPU(nbv))
+    {
+        nbnxn_gpu_reset_timings(nbv);
+    }
 
     wallcycle_stop(wcycle, ewcRUN);
     wallcycle_reset_all(wcycle);