Converted many integrator-loop files to C++
authorMark Abraham <mark.j.abraham@gmail.com>
Sat, 20 Sep 2014 10:59:41 +0000 (12:59 +0200)
committerMark Abraham <mark.j.abraham@gmail.com>
Wed, 15 Oct 2014 23:45:56 +0000 (01:45 +0200)
commit2875885216a8bbba14fc94cccc4c5b284f17cd72
tree693b0b3bec873dbe80c088f959cd861e0101b47a
parent106ca9e645d05a79a01fdd27446794439e197685
Converted many integrator-loop files to C++

Moved code from mdlib/init.c to other locations, to avoid creating an
init.cpp file that was freaking out the ASAN build, perhaps via linker
filename clash with utility/init.cpp. Renamed gmxlib/mvdata.c to
mdlib/broadcaststructs.cpp since that makes sense now.

Converted min and max to std:: varieties, and provided explicit
template specifications where required. Used std::sqrt to help the
compiler do automatic template type deduction.

Used static_cast<int> to suppress warnings about comparison between
signed and unsigned integers, and conversion of double to int where
that is the intention of the code.

Converted a few variables between int, real and double to correctly
reflect the intention of the code.

Fixed use of double for number of steps completed, which should be
gmx_int64_t. Formally, this is a bug in release-5-0, but you'd have to
do 2^53 steps to notice it.

Used const real to define constants so that the std::pow overloads
on Windows can work smoothly.

Added some width specifiers on environment-variable scanf calls
to avoid problems.

Removed many unused variables.

Added inline cppcheck suppressions for writes to variables that are
only read when OpenMP is being used. A recent change introduced such
variables to work around compilers that have bugs if you call a
function inside the #pragma omp, but those variables are unused if the
compilation does not use OpenMP.

Added C++ guard to free-energy kernel header.

Change-Id: Id190e36758fa6aef68b14e5c9b78eacfb0a86949
29 files changed:
src/gromacs/essentialdynamics/edsam.c
src/gromacs/fileio/mdoutf.c
src/gromacs/gmxana/gmx_pme_error.cpp
src/gromacs/gmxlib/nonbonded/nb_free_energy.h
src/gromacs/gmxlib/nrnb.c
src/gromacs/legacyheaders/mdrun.h
src/gromacs/legacyheaders/mvdata.h [deleted file]
src/gromacs/legacyheaders/nrnb.h
src/gromacs/mdlib/broadcaststructs.cpp [moved from src/gromacs/gmxlib/mvdata.c with 98% similarity]
src/gromacs/mdlib/calcmu.cpp [moved from src/gromacs/mdlib/calcmu.c with 100% similarity]
src/gromacs/mdlib/calcvir.cpp [moved from src/gromacs/mdlib/calcvir.c with 98% similarity]
src/gromacs/mdlib/clincs.cpp [moved from src/gromacs/mdlib/clincs.c with 99% similarity]
src/gromacs/mdlib/constr.cpp [moved from src/gromacs/mdlib/constr.c with 97% similarity]
src/gromacs/mdlib/coupling.cpp [moved from src/gromacs/mdlib/coupling.c with 96% similarity]
src/gromacs/mdlib/csettle.cpp [moved from src/gromacs/mdlib/csettle.c with 99% similarity]
src/gromacs/mdlib/force.cpp [moved from src/gromacs/mdlib/force.c with 99% similarity]
src/gromacs/mdlib/forcerec.cpp [moved from src/gromacs/mdlib/forcerec.c with 98% similarity]
src/gromacs/mdlib/init.c [deleted file]
src/gromacs/mdlib/md_support.cpp
src/gromacs/mdlib/mdatom.cpp [moved from src/gromacs/mdlib/mdatom.c with 97% similarity]
src/gromacs/mdlib/shakef.cpp [moved from src/gromacs/mdlib/shakef.c with 98% similarity]
src/gromacs/mdlib/sim_util.cpp [moved from src/gromacs/mdlib/sim_util.c with 98% similarity]
src/gromacs/mdlib/stat.cpp [moved from src/gromacs/mdlib/stat.c with 100% similarity]
src/gromacs/mdlib/update.cpp [moved from src/gromacs/mdlib/update.c with 97% similarity]
src/gromacs/mdlib/vcm.cpp [moved from src/gromacs/mdlib/vcm.c with 99% similarity]
src/gromacs/mdlib/vsite.cpp [moved from src/gromacs/mdlib/vsite.c with 98% similarity]
src/gromacs/timing/walltime_accounting.c
src/gromacs/timing/walltime_accounting.h
src/programs/mdrun/runner.cpp