Cleaned up bUseGpu in runner
commit6680263bfac88ad1a63183b04158d553af7f3b63
authorMark Abraham <mark.j.abraham@gmail.com>
Tue, 18 Jul 2017 20:35:33 +0000 (18 22:35 +0200)
committerKasson <kasson@gmail.com>
Thu, 20 Jul 2017 19:23:03 +0000 (20 21:23 +0200)
treecb7cf40ff67d34f345c89c095f84da7866f6fe23
parent54821ced6ee4c604dccef7ecffaf5208b0c5dfb1
Cleaned up bUseGpu in runner

This variable was rather unclear about what it actually meant, and
various comments were wrong. This had several effects.

It obscured that automated assignment of GPU IDs to PP ranks actually
does take place after thread-MPI thread launch.

Fixing it revealed that we set up nstlist and rlist for the Verlet
scheme unnecessarily early, and this leads to an extra broadcast
(which is not costly, because there are many other broadcast calls
nearby).

Previously, -nb gpu and -nb auto would trigger GPU detection, and the
result of the detection was used to decide whether GPU assignment
might take place. tryUsePhysicalGpu and forceUsePhysicalGPu now play
the latter role, so that it is clear that we have the flexibility to
avoid assigning work to GPUs when that does not make sense (e.g. rerun
with energy groups), even if GPUs are detected. In particular,
tryUsePhysicalGpu needs to default to false when GPU support is not
configured, and when the .tpr is for the group scheme.

Removed strange comment about ignoring manually selected GPUs, which
may have been an historical artefact about doing so on PME-only ranks.

Change-Id: I69f21210a7ee931e5fa2cbe49e0999ad89ba7426
src/programs/mdrun/runner.cpp