Speed up mtop_util atom lookup
authorBerk Hess <hess@kth.se>
Tue, 27 Sep 2016 12:50:05 +0000 (14:50 +0200)
committerBerk Hess <hess@kth.se>
Tue, 11 Oct 2016 09:02:53 +0000 (11:02 +0200)
commitaee855491496f831e60546031d74cb918b9e063a
treec91b23b7e02927f793c22785ffcd0338ce49ab44
parent72c05d7e5b5e08b4f5005e95ddbb6d3c8ff873d5
Speed up mtop_util atom lookup

The lookup of atom indices and properties on global atom index have
been sped up by moving functions to a new header file mtop_lookup.h
and by storing start and end global atom indices in gmx_mtop_t.
Another performance improvement is that the previous molblock index is
used as starting value for the next search.
The atom+residue lookup function now also returns the reside index.
This change also simplifies the code, since we no longer need a lookup
data structure.
A large number of files are touched because the t_atom return pointer
is changed to const also in the atomloop functions.

Change-Id: I185b8c2e614604e9561190dd5e447077d88933ca
28 files changed:
src/gromacs/domdec/domdec.cpp
src/gromacs/domdec/domdec_constraints.cpp
src/gromacs/essentialdynamics/edsam.cpp
src/gromacs/fileio/groio.cpp
src/gromacs/gmxana/gmx_clustsize.cpp
src/gromacs/gmxana/gmx_energy.cpp
src/gromacs/gmxana/gmx_pme_error.cpp
src/gromacs/gmxpreprocess/gen_maxwell_velocities.cpp
src/gromacs/gmxpreprocess/grompp.cpp
src/gromacs/gmxpreprocess/readir.cpp
src/gromacs/listed-forces/orires.cpp
src/gromacs/mdlib/broadcaststructs.cpp
src/gromacs/mdlib/constr.cpp
src/gromacs/mdlib/mdatoms.cpp
src/gromacs/mdlib/qmmm.cpp
src/gromacs/mdlib/shellfc.cpp
src/gromacs/mdlib/tgroup.cpp
src/gromacs/pulling/pull.cpp
src/gromacs/pulling/pull_rotation.cpp
src/gromacs/swap/swapcoords.cpp
src/gromacs/swap/swapcoords.h
src/gromacs/tools/check.cpp
src/gromacs/topology/mtop_lookup.h [new file with mode: 0644]
src/gromacs/topology/mtop_util.cpp
src/gromacs/topology/mtop_util.h
src/gromacs/topology/topology.h
src/programs/mdrun/md.cpp
src/programs/mdrun/membed.cpp