Separate wallcycle responsibilities
commit3ad081ab6d1c012fe7b5dd771f0efc2fae370989
authorMark Abraham <mark.j.abraham@gmail.com>
Sat, 24 Oct 2015 14:43:44 +0000 (24 16:43 +0200)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Wed, 28 Oct 2015 17:27:56 +0000 (28 18:27 +0100)
treebf5b2839bcfa0c3ee065207baca76c611196b343
parent46b27b1fe5973a2a7bf118aa7222705b11ceedb3
Separate wallcycle responsibilities

Collecting cycle counts, scaling them by thread count, summing them
over ranks, and printing the results are responsibilities worth
separating. This commit removes several fields from gmx_wallcycle
that don't relate to collecting cycle counts.

Specifically,
* the summation code no longer handles scaling by thread
  count, for which there is a new function.
* the summation code returns the summed cycle counts for printing,
  rather than keep it in the cycle-counting struct

Noted TODOs regarding
* the way ewcWAIT_GPU_NB_L is being used for load-balancing and
  never reporting, so should have a different implementation.
* reducing haveInvalidCount at the same time as counter summation
  has been buggy and is needless complexity
* wallcycle_sum needs to return both rank-0 and global data in
  a way that makes more clear how they should be used
* that finish_run can be cleaned up and move back to runner.cpp
* that scaling counters by thread counts should be the
  responsibility of the code that opened the counting region

Also, removed unused field from wallcc_t

Change-Id: Ieefdb3118c5de539debc3a48426fc0461182f5fe
src/gromacs/mdlib/sim_util.cpp
src/gromacs/timing/wallcycle.cpp
src/gromacs/timing/wallcycle.h
src/programs/mdrun/runner.cpp