Fix mdrun -nb auto -rerun with GPU and energy groups
authorMark Abraham <mark.j.abraham@gmail.com>
Tue, 15 Sep 2015 10:01:41 +0000 (12:01 +0200)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Sat, 3 Oct 2015 08:32:39 +0000 (10:32 +0200)
commite081d6331ebc02f81f344a0353659303e5db7a9e
tree68cd4e63da6b88fed638a6ab94b12270377ea52a
parent528f2227e33de4fa624cabb3a1e755d240e85804
Fix mdrun -nb auto -rerun with GPU and energy groups

inputrec was being used after calloc, but before being read from the
.tpr file. This meant mdrun -nb auto -rerun behaved as if -nb gpu has
been used (gave a fatal error).

Moved the code that regulates whether GPUs are supported (e.g. with
Verlet+energy groups) into the new function
nbnxn_gpu_acceleration_supported(), so it can be used consistently
with other such checks. Split the old nbnxn_acceleration_supported()
into nbnxn_gpu_acceleration_supported() and nbnxn_simd_supported(),
which seems a bit simpler given that the old code was called twice,
with different constant values for bGPU.

Made the thread-MPI launch code aware of bUseGPU, so that we can call
nbnxn_gpu_acceleration_supported once and do all the things correctly.

The fatal error for mdrun -nb gpu -rerun with energy groups is now
issued by SIMMASTER in runner.cpp, rather than in md.cpp.

Despite appearances, this change doesn't alter much mdrun behaviour,
except as mentioned for -rerun, and that GPU detection is now run
for mdrun -rerun when we will not end up using those GPUs.

Fixes #1823

Change-Id: I324d23ce98b0041dad148db8eac744c5dd5f66fb
src/gromacs/legacyheaders/force.h
src/gromacs/mdlib/forcerec.cpp
src/programs/mdrun/md.cpp
src/programs/mdrun/resource-division.cpp
src/programs/mdrun/resource-division.h
src/programs/mdrun/runner.cpp