Merge branch release-2018 into master
authorMark Abraham <mark.j.abraham@gmail.com>
Fri, 16 Feb 2018 12:25:41 +0000 (13:25 +0100)
committerMark Abraham <mark.j.abraham@gmail.com>
Fri, 16 Feb 2018 12:50:16 +0000 (13:50 +0100)
Trivial conflict in checkpoint.cpp from fixing whether a return value
was ignored.

Change-Id: Ie2006eeee1118b32d1a46e47191db45b454a4ecd

611 files changed:
.gitattributes
CMakeLists.txt
cmake/Platform/BlueGeneQ-base.cmake [deleted file]
cmake/Platform/BlueGeneQ-static-bgclang-CXX.cmake [deleted file]
cmake/Platform/BlueGeneQ-static.cmake [deleted file]
cmake/TestAtomics.cpp [moved from cmake/TestAtomics.c with 100% similarity]
cmake/TestBlueGeneQ.c [deleted file]
cmake/TestQPX.c [deleted file]
cmake/TestWinProcNum.cpp [moved from cmake/TestWinProcNum.c with 100% similarity]
cmake/ThreadMPI.cmake
cmake/gmxCPackUtilities.cmake
cmake/gmxDetectSimd.cmake
cmake/gmxDetectTargetArchitecture.cmake
cmake/gmxManageBlueGene.cmake [deleted file]
cmake/gmxManageFFTLibraries.cmake
cmake/gmxManageGPU.cmake
cmake/gmxManageSharedLibraries.cmake
cmake/gmxManageSimd.cmake
cmake/gmxVersionInfo.cmake
docs/CMakeLists.txt
docs/dev-manual/contribute.rst [new file with mode: 0644]
docs/dev-manual/index.rst
docs/dev-manual/jenkins.rst
docs/dev-manual/overview.rst
docs/dev-manual/testutils.rst
docs/dev-manual/uncrustify.rst
docs/doxygen/Doxyfile-common.cmakein
docs/doxygen/gmxtree.py
docs/doxygen/lib/simd.md
docs/install-guide/index.rst
docs/manual/algorithms.tex
docs/manual/forcefield.tex
docs/manual/topology.tex
docs/user-guide/cutoff-schemes.rst
docs/user-guide/file-formats.rst
docs/user-guide/mdp-options.rst
docs/user-guide/mdrun-features.rst
docs/user-guide/mdrun-performance.rst
docs/user-guide/terminology.rst
scripts/xplor2gmx.pl
share/top/amber03.ff/forcefield.itp
share/top/amber03.ff/gbsa.itp [deleted file]
share/top/amber94.ff/forcefield.itp
share/top/amber94.ff/gbsa.itp [deleted file]
share/top/amber96.ff/forcefield.itp
share/top/amber96.ff/gbsa.itp [deleted file]
share/top/amber99.ff/forcefield.itp
share/top/amber99.ff/gbsa.itp [deleted file]
share/top/amber99sb-ildn.ff/forcefield.itp
share/top/amber99sb-ildn.ff/gbsa.itp [deleted file]
share/top/amber99sb.ff/forcefield.itp
share/top/amber99sb.ff/gbsa.itp [deleted file]
share/top/amberGS.ff/forcefield.itp
share/top/amberGS.ff/gbsa.itp [deleted file]
share/top/atom_nom.tbl
share/top/charmm27.ff/forcefield.itp
share/top/charmm27.ff/gb.itp [deleted file]
share/top/oplsaa.ff/forcefield.itp
share/top/oplsaa.ff/gbsa.itp [deleted file]
src/CMakeLists.txt
src/config.h.cmakein
src/contrib/CMakeLists.txt [deleted file]
src/contrib/README [deleted file]
src/contrib/calcfdev.c [deleted file]
src/contrib/compnl.c [deleted file]
src/contrib/do_multiprot.c [deleted file]
src/contrib/do_shift.c [deleted file]
src/contrib/ehanal.c [deleted file]
src/contrib/ehdata.c [deleted file]
src/contrib/ehdata.h [deleted file]
src/contrib/ehole.c [deleted file]
src/contrib/g_anavel.c [deleted file]
src/contrib/gen_table.c [deleted file]
src/contrib/gmx_sdf.c [deleted file]
src/contrib/hexamer.c [deleted file]
src/contrib/hrefify.c [deleted file]
src/contrib/intest.f [deleted file]
src/contrib/mkice.c [deleted file]
src/contrib/random.c [deleted file]
src/contrib/scripts/amber2gmxff [deleted file]
src/contrib/scripts/amber2gmxrtp [deleted file]
src/contrib/scripts/comment-pairs [deleted file]
src/contrib/scripts/ffamber-c.tdb [deleted file]
src/contrib/scripts/ffamber-n.tdb [deleted file]
src/contrib/scripts/ffamber.atp [deleted file]
src/contrib/scripts/ffamber.hdb [deleted file]
src/contrib/scripts/ffamber.itp [deleted file]
src/contrib/scripts/ffamber.rtp [deleted file]
src/contrib/scripts/ffamberbon.itp [deleted file]
src/contrib/scripts/ffambernb.itp [deleted file]
src/contrib/scripts/sort-hdb [deleted file]
src/contrib/scripts/xlateat.dat [deleted file]
src/contrib/test.c [deleted file]
src/contrib/test_fatal.c [deleted file]
src/contrib/testfft.c [deleted file]
src/contrib/testlr.c [deleted file]
src/contrib/testtab.c [deleted file]
src/contrib/testxml.c [deleted file]
src/contrib/timefft.c [deleted file]
src/contrib/total.f [deleted file]
src/external/build-fftw/.gitattributes [moved from src/contrib/fftw/.gitattributes with 100% similarity]
src/external/build-fftw/CMakeLists.txt [moved from src/contrib/fftw/CMakeLists.txt with 98% similarity]
src/external/build-fftw/fftw-download.cmake.cmakein [moved from src/contrib/fftw/fftw-download.cmake.cmakein with 100% similarity]
src/external/gmock-1.7.0/README [deleted file]
src/external/gmock-1.7.0/gtest/README [deleted file]
src/external/googletest/CMakeLists.txt [moved from src/external/gmock-1.7.0/CMakeLists.txt with 74% similarity]
src/external/googletest/README.Gromacs [new file with mode: 0644]
src/external/googletest/README.md [new file with mode: 0644]
src/external/googletest/googlemock/CHANGES [new file with mode: 0644]
src/external/googletest/googlemock/CMakeLists.txt [new file with mode: 0644]
src/external/googletest/googlemock/CONTRIBUTORS [new file with mode: 0644]
src/external/googletest/googlemock/LICENSE [moved from src/external/gmock-1.7.0/LICENSE with 100% similarity]
src/external/googletest/googlemock/README.md [new file with mode: 0644]
src/external/googletest/googlemock/docs/CheatSheet.md [new file with mode: 0644]
src/external/googletest/googlemock/docs/CookBook.md [new file with mode: 0644]
src/external/googletest/googlemock/docs/DesignDoc.md [new file with mode: 0644]
src/external/googletest/googlemock/docs/DevGuide.md [new file with mode: 0644]
src/external/googletest/googlemock/docs/Documentation.md [new file with mode: 0644]
src/external/googletest/googlemock/docs/ForDummies.md [new file with mode: 0644]
src/external/googletest/googlemock/docs/FrequentlyAskedQuestions.md [new file with mode: 0644]
src/external/googletest/googlemock/docs/KnownIssues.md [new file with mode: 0644]
src/external/googletest/googlemock/include/gmock/gmock-actions.h [moved from src/external/gmock-1.7.0/include/gmock/gmock-actions.h with 87% similarity]
src/external/googletest/googlemock/include/gmock/gmock-cardinalities.h [moved from src/external/gmock-1.7.0/include/gmock/gmock-cardinalities.h with 100% similarity]
src/external/googletest/googlemock/include/gmock/gmock-generated-actions.h [moved from src/external/gmock-1.7.0/include/gmock/gmock-generated-actions.h with 88% similarity]
src/external/googletest/googlemock/include/gmock/gmock-generated-function-mockers.h [moved from src/external/gmock-1.7.0/include/gmock/gmock-generated-function-mockers.h with 89% similarity]
src/external/googletest/googlemock/include/gmock/gmock-generated-matchers.h [moved from src/external/gmock-1.7.0/include/gmock/gmock-generated-matchers.h with 96% similarity]
src/external/googletest/googlemock/include/gmock/gmock-generated-nice-strict.h [moved from src/external/gmock-1.7.0/include/gmock/gmock-generated-nice-strict.h with 100% similarity]
src/external/googletest/googlemock/include/gmock/gmock-matchers.h [moved from src/external/gmock-1.7.0/include/gmock/gmock-matchers.h with 86% similarity]
src/external/googletest/googlemock/include/gmock/gmock-more-actions.h [moved from src/external/gmock-1.7.0/include/gmock/gmock-more-actions.h with 86% similarity]
src/external/googletest/googlemock/include/gmock/gmock-more-matchers.h [moved from src/external/gmock-1.7.0/include/gmock/gmock-more-matchers.h with 100% similarity]
src/external/googletest/googlemock/include/gmock/gmock-spec-builders.h [moved from src/external/gmock-1.7.0/include/gmock/gmock-spec-builders.h with 95% similarity]
src/external/googletest/googlemock/include/gmock/gmock.h [moved from src/external/gmock-1.7.0/include/gmock/gmock.h with 100% similarity]
src/external/googletest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h [new file with mode: 0644]
src/external/googletest/googlemock/include/gmock/internal/custom/gmock-matchers.h [new file with mode: 0644]
src/external/googletest/googlemock/include/gmock/internal/custom/gmock-port.h [new file with mode: 0644]
src/external/googletest/googlemock/include/gmock/internal/gmock-generated-internal-utils.h [moved from src/external/gmock-1.7.0/include/gmock/internal/gmock-generated-internal-utils.h with 81% similarity]
src/external/googletest/googlemock/include/gmock/internal/gmock-internal-utils.h [moved from src/external/gmock-1.7.0/include/gmock/internal/gmock-internal-utils.h with 93% similarity]
src/external/googletest/googlemock/include/gmock/internal/gmock-port.h [moved from src/external/gmock-1.7.0/include/gmock/internal/gmock-port.h with 80% similarity]
src/external/googletest/googlemock/src/gmock-all.cc [moved from src/external/gmock-1.7.0/src/gmock-all.cc with 100% similarity]
src/external/googletest/googlemock/src/gmock-cardinalities.cc [moved from src/external/gmock-1.7.0/src/gmock-cardinalities.cc with 100% similarity]
src/external/googletest/googlemock/src/gmock-internal-utils.cc [moved from src/external/gmock-1.7.0/src/gmock-internal-utils.cc with 100% similarity]
src/external/googletest/googlemock/src/gmock-matchers.cc [moved from src/external/gmock-1.7.0/src/gmock-matchers.cc with 98% similarity]
src/external/googletest/googlemock/src/gmock-spec-builders.cc [moved from src/external/gmock-1.7.0/src/gmock-spec-builders.cc with 97% similarity]
src/external/googletest/googlemock/src/gmock.cc [moved from src/external/gmock-1.7.0/src/gmock.cc with 98% similarity]
src/external/googletest/googlemock/src/gmock_main.cc [moved from src/external/gmock-1.7.0/src/gmock_main.cc with 100% similarity]
src/external/googletest/googletest/.gitignore [new file with mode: 0644]
src/external/googletest/googletest/CHANGES [new file with mode: 0644]
src/external/googletest/googletest/CMakeLists.txt [new file with mode: 0644]
src/external/googletest/googletest/CONTRIBUTORS [new file with mode: 0644]
src/external/googletest/googletest/LICENSE [moved from src/external/gmock-1.7.0/gtest/LICENSE with 100% similarity]
src/external/googletest/googletest/README.md [new file with mode: 0644]
src/external/googletest/googletest/docs/AdvancedGuide.md [new file with mode: 0644]
src/external/googletest/googletest/docs/DevGuide.md [new file with mode: 0644]
src/external/googletest/googletest/docs/Documentation.md [new file with mode: 0644]
src/external/googletest/googletest/docs/FAQ.md [new file with mode: 0644]
src/external/googletest/googletest/docs/Primer.md [new file with mode: 0644]
src/external/googletest/googletest/docs/PumpManual.md [new file with mode: 0644]
src/external/googletest/googletest/docs/Samples.md [new file with mode: 0644]
src/external/googletest/googletest/docs/XcodeGuide.md [new file with mode: 0644]
src/external/googletest/googletest/include/gtest/gtest-death-test.h [moved from src/external/gmock-1.7.0/gtest/include/gtest/gtest-death-test.h with 100% similarity]
src/external/googletest/googletest/include/gtest/gtest-message.h [moved from src/external/gmock-1.7.0/gtest/include/gtest/gtest-message.h with 100% similarity]
src/external/googletest/googletest/include/gtest/gtest-param-test.h [moved from src/external/gmock-1.7.0/gtest/include/gtest/gtest-param-test.h with 97% similarity]
src/external/googletest/googletest/include/gtest/gtest-printers.h [moved from src/external/gmock-1.7.0/gtest/include/gtest/gtest-printers.h with 80% similarity]
src/external/googletest/googletest/include/gtest/gtest-spi.h [moved from src/external/gmock-1.7.0/gtest/include/gtest/gtest-spi.h with 100% similarity]
src/external/googletest/googletest/include/gtest/gtest-test-part.h [moved from src/external/gmock-1.7.0/gtest/include/gtest/gtest-test-part.h with 100% similarity]
src/external/googletest/googletest/include/gtest/gtest-typed-test.h [moved from src/external/gmock-1.7.0/gtest/include/gtest/gtest-typed-test.h with 96% similarity]
src/external/googletest/googletest/include/gtest/gtest.h [moved from src/external/gmock-1.7.0/gtest/include/gtest/gtest.h with 87% similarity]
src/external/googletest/googletest/include/gtest/gtest_pred_impl.h [moved from src/external/gmock-1.7.0/gtest/include/gtest/gtest_pred_impl.h with 100% similarity]
src/external/googletest/googletest/include/gtest/gtest_prod.h [moved from src/external/gmock-1.7.0/gtest/include/gtest/gtest_prod.h with 100% similarity]
src/external/googletest/googletest/include/gtest/internal/custom/gtest-port.h [new file with mode: 0644]
src/external/googletest/googletest/include/gtest/internal/custom/gtest-printers.h [new file with mode: 0644]
src/external/googletest/googletest/include/gtest/internal/custom/gtest.h [new file with mode: 0644]
src/external/googletest/googletest/include/gtest/internal/gtest-death-test-internal.h [moved from src/external/gmock-1.7.0/gtest/include/gtest/internal/gtest-death-test-internal.h with 100% similarity]
src/external/googletest/googletest/include/gtest/internal/gtest-filepath.h [moved from src/external/gmock-1.7.0/gtest/include/gtest/internal/gtest-filepath.h with 100% similarity]
src/external/googletest/googletest/include/gtest/internal/gtest-internal.h [moved from src/external/gmock-1.7.0/gtest/include/gtest/internal/gtest-internal.h with 88% similarity]
src/external/googletest/googletest/include/gtest/internal/gtest-linked_ptr.h [moved from src/external/gmock-1.7.0/gtest/include/gtest/internal/gtest-linked_ptr.h with 95% similarity]
src/external/googletest/googletest/include/gtest/internal/gtest-param-util-generated.h [moved from src/external/gmock-1.7.0/gtest/include/gtest/internal/gtest-param-util-generated.h with 98% similarity]
src/external/googletest/googletest/include/gtest/internal/gtest-param-util.h [moved from src/external/gmock-1.7.0/gtest/include/gtest/internal/gtest-param-util.h with 83% similarity]
src/external/googletest/googletest/include/gtest/internal/gtest-port-arch.h [new file with mode: 0644]
src/external/googletest/googletest/include/gtest/internal/gtest-port.h [moved from src/external/gmock-1.7.0/gtest/include/gtest/internal/gtest-port.h with 69% similarity]
src/external/googletest/googletest/include/gtest/internal/gtest-string.h [moved from src/external/gmock-1.7.0/gtest/include/gtest/internal/gtest-string.h with 100% similarity]
src/external/googletest/googletest/include/gtest/internal/gtest-tuple.h [moved from src/external/gmock-1.7.0/gtest/include/gtest/internal/gtest-tuple.h with 98% similarity]
src/external/googletest/googletest/include/gtest/internal/gtest-type-util.h [moved from src/external/gmock-1.7.0/gtest/include/gtest/internal/gtest-type-util.h with 100% similarity]
src/external/googletest/googletest/src/gtest-all.cc [moved from src/external/gmock-1.7.0/gtest/src/gtest-all.cc with 100% similarity]
src/external/googletest/googletest/src/gtest-death-test.cc [moved from src/external/gmock-1.7.0/gtest/src/gtest-death-test.cc with 98% similarity]
src/external/googletest/googletest/src/gtest-filepath.cc [moved from src/external/gmock-1.7.0/gtest/src/gtest-filepath.cc with 96% similarity]
src/external/googletest/googletest/src/gtest-internal-inl.h [moved from src/external/gmock-1.7.0/gtest/src/gtest-internal-inl.h with 97% similarity]
src/external/googletest/googletest/src/gtest-port.cc [moved from src/external/gmock-1.7.0/gtest/src/gtest-port.cc with 61% similarity]
src/external/googletest/googletest/src/gtest-printers.cc [moved from src/external/gmock-1.7.0/gtest/src/gtest-printers.cc with 96% similarity]
src/external/googletest/googletest/src/gtest-test-part.cc [moved from src/external/gmock-1.7.0/gtest/src/gtest-test-part.cc with 96% similarity]
src/external/googletest/googletest/src/gtest-typed-test.cc [moved from src/external/gmock-1.7.0/gtest/src/gtest-typed-test.cc with 74% similarity]
src/external/googletest/googletest/src/gtest.cc [moved from src/external/gmock-1.7.0/gtest/src/gtest.cc with 89% similarity]
src/external/googletest/googletest/src/gtest_main.cc [moved from src/external/gmock-1.7.0/gtest/src/gtest_main.cc with 100% similarity]
src/external/thread_mpi/include/thread_mpi/atomic.h
src/external/thread_mpi/include/thread_mpi/atomic/msvc.h
src/external/thread_mpi/include/thread_mpi/atomic/xlc_ppc.h
src/external/thread_mpi/include/thread_mpi/collective.h
src/external/thread_mpi/include/thread_mpi/list.h
src/external/thread_mpi/include/thread_mpi/lock.h
src/external/thread_mpi/include/thread_mpi/mpi_bindings.h
src/external/thread_mpi/include/thread_mpi/mutex.h
src/external/thread_mpi/include/thread_mpi/numa_malloc.h
src/external/thread_mpi/include/thread_mpi/system_error.h
src/external/thread_mpi/include/thread_mpi/threads.h
src/external/thread_mpi/include/thread_mpi/tmpi.h
src/external/thread_mpi/src/alltoall.cpp [moved from src/external/thread_mpi/src/alltoall.c with 100% similarity]
src/external/thread_mpi/src/atomic.cpp [moved from src/external/thread_mpi/src/atomic.c with 100% similarity]
src/external/thread_mpi/src/barrier.cpp [moved from src/external/thread_mpi/src/barrier.c with 100% similarity]
src/external/thread_mpi/src/bcast.cpp [moved from src/external/thread_mpi/src/bcast.c with 100% similarity]
src/external/thread_mpi/src/collective.cpp [moved from src/external/thread_mpi/src/collective.c with 99% similarity]
src/external/thread_mpi/src/comm.cpp [moved from src/external/thread_mpi/src/comm.c with 100% similarity]
src/external/thread_mpi/src/errhandler.cpp [moved from src/external/thread_mpi/src/errhandler.c with 100% similarity]
src/external/thread_mpi/src/event.cpp [moved from src/external/thread_mpi/src/event.c with 100% similarity]
src/external/thread_mpi/src/gather.cpp [moved from src/external/thread_mpi/src/gather.c with 100% similarity]
src/external/thread_mpi/src/group.cpp [moved from src/external/thread_mpi/src/group.c with 100% similarity]
src/external/thread_mpi/src/list.cpp [moved from src/external/thread_mpi/src/list.c with 100% similarity]
src/external/thread_mpi/src/lock.cpp [moved from src/external/thread_mpi/src/lock.c with 100% similarity]
src/external/thread_mpi/src/numa_malloc.cpp [moved from src/external/thread_mpi/src/numa_malloc.c with 96% similarity]
src/external/thread_mpi/src/once.cpp [moved from src/external/thread_mpi/src/once.c with 100% similarity]
src/external/thread_mpi/src/p2p_buffer.cpp [moved from src/external/thread_mpi/src/p2p_buffer.c with 100% similarity]
src/external/thread_mpi/src/p2p_protocol.cpp [moved from src/external/thread_mpi/src/p2p_protocol.c with 99% similarity]
src/external/thread_mpi/src/p2p_send_recv.cpp [moved from src/external/thread_mpi/src/p2p_send_recv.c with 100% similarity]
src/external/thread_mpi/src/p2p_wait.cpp [moved from src/external/thread_mpi/src/p2p_wait.c with 100% similarity]
src/external/thread_mpi/src/profile.cpp [moved from src/external/thread_mpi/src/profile.c with 100% similarity]
src/external/thread_mpi/src/pthreads.cpp [moved from src/external/thread_mpi/src/pthreads.c with 98% similarity]
src/external/thread_mpi/src/reduce.cpp [moved from src/external/thread_mpi/src/reduce.c with 100% similarity]
src/external/thread_mpi/src/reduce_fast.cpp [moved from src/external/thread_mpi/src/reduce_fast.c with 100% similarity]
src/external/thread_mpi/src/scan.cpp [moved from src/external/thread_mpi/src/scan.c with 100% similarity]
src/external/thread_mpi/src/scatter.cpp [moved from src/external/thread_mpi/src/scatter.c with 100% similarity]
src/external/thread_mpi/src/system_error.cpp
src/external/thread_mpi/src/tmpi_init.cpp [moved from src/external/thread_mpi/src/tmpi_init.c with 99% similarity]
src/external/thread_mpi/src/tmpi_malloc.cpp [moved from src/external/thread_mpi/src/tmpi_malloc.c with 100% similarity]
src/external/thread_mpi/src/topology.cpp [moved from src/external/thread_mpi/src/topology.c with 100% similarity]
src/external/thread_mpi/src/type.cpp [moved from src/external/thread_mpi/src/type.c with 100% similarity]
src/external/thread_mpi/src/winthreads.cpp [moved from src/external/thread_mpi/src/winthreads.c with 99% similarity]
src/gromacs/awh/awh.cpp
src/gromacs/awh/awh.h
src/gromacs/commandline/cmdlineinit.h
src/gromacs/commandline/filenm.cpp
src/gromacs/commandline/filenm.h
src/gromacs/commandline/pargs.cpp
src/gromacs/commandline/pargs.h
src/gromacs/commandline/tests/pargs.cpp
src/gromacs/domdec/domdec.cpp
src/gromacs/domdec/domdec.h
src/gromacs/domdec/domdec_box.cpp
src/gromacs/domdec/domdec_constraints.cpp
src/gromacs/domdec/domdec_internal.h
src/gromacs/domdec/domdec_setup.cpp
src/gromacs/domdec/domdec_specatomcomm.h
src/gromacs/domdec/domdec_topology.cpp
src/gromacs/domdec/ga2la.h
src/gromacs/domdec/hash.h
src/gromacs/essentialdynamics/edsam.cpp
src/gromacs/ewald/ewald.cpp
src/gromacs/ewald/ewald.h
src/gromacs/ewald/long-range-correction.h
src/gromacs/ewald/pme-gather.cpp
src/gromacs/ewald/pme-gpu-internal.cpp
src/gromacs/ewald/pme-gpu-internal.h
src/gromacs/ewald/pme-gpu-types.h
src/gromacs/ewald/pme-gpu.cpp
src/gromacs/ewald/pme-grid.cpp
src/gromacs/ewald/pme-internal.h
src/gromacs/ewald/pme-load-balancing.cpp
src/gromacs/ewald/pme-only.cpp
src/gromacs/ewald/pme-pp.cpp
src/gromacs/ewald/pme-solve.cpp
src/gromacs/ewald/pme-spline-work.cpp
src/gromacs/ewald/pme-spread.cpp
src/gromacs/ewald/pme-spread.cu
src/gromacs/ewald/pme-timings.cu
src/gromacs/ewald/pme.cpp
src/gromacs/ewald/pme.cu
src/gromacs/ewald/pme.cuh
src/gromacs/ewald/pme.h
src/gromacs/ewald/tests/testhardwarecontexts.cpp
src/gromacs/fileio/checkpoint.cpp
src/gromacs/fileio/checkpoint.h
src/gromacs/fileio/gmxfio.cpp
src/gromacs/fileio/gmxfio.h
src/gromacs/fileio/tpxio.cpp
src/gromacs/gmxana/gmx_awh.cpp
src/gromacs/gmxana/gmx_cluster.cpp
src/gromacs/gmxana/gmx_disre.cpp
src/gromacs/gmxana/gmx_energy.cpp
src/gromacs/gmxana/gmx_hbond.cpp
src/gromacs/gmxana/gmx_sham.cpp
src/gromacs/gmxlib/network.cpp
src/gromacs/gmxlib/network.h
src/gromacs/gmxlib/nonbonded/CMakeLists.txt
src/gromacs/gmxlib/nonbonded/nb_free_energy.cpp
src/gromacs/gmxlib/nonbonded/nb_generic.cpp
src/gromacs/gmxlib/nonbonded/nb_kernel.h
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/make_nb_kernel_avx_128_fma_double.py
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecGB_VdwCSTab_GeomP1P1_avx_128_fma_double.c [deleted file]
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecGB_VdwLJ_GeomP1P1_avx_128_fma_double.c [deleted file]
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecGB_VdwNone_GeomP1P1_avx_128_fma_double.c [deleted file]
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_avx_128_fma_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_template_avx_128_fma_double.pre
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/make_nb_kernel_avx_128_fma_single.py
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecGB_VdwCSTab_GeomP1P1_avx_128_fma_single.c [deleted file]
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecGB_VdwLJ_GeomP1P1_avx_128_fma_single.c [deleted file]
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecGB_VdwNone_GeomP1P1_avx_128_fma_single.c [deleted file]
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_avx_128_fma_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_template_avx_128_fma_single.pre
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/make_nb_kernel_avx_256_double.py
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecGB_VdwCSTab_GeomP1P1_avx_256_double.c [deleted file]
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecGB_VdwLJ_GeomP1P1_avx_256_double.c [deleted file]
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecGB_VdwNone_GeomP1P1_avx_256_double.c [deleted file]
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_avx_256_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_template_avx_256_double.pre
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/make_nb_kernel_avx_256_single.py
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecGB_VdwCSTab_GeomP1P1_avx_256_single.c [deleted file]
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecGB_VdwLJ_GeomP1P1_avx_256_single.c [deleted file]
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecGB_VdwNone_GeomP1P1_avx_256_single.c [deleted file]
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_avx_256_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_template_avx_256_single.pre
src/gromacs/gmxlib/nonbonded/nb_kernel_c/make_nb_kernel_c.py
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecGB_VdwBham_GeomP1P1_c.c [deleted file]
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecGB_VdwCSTab_GeomP1P1_c.c [deleted file]
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecGB_VdwLJ_GeomP1P1_c.c [deleted file]
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecGB_VdwNone_GeomP1P1_c.c [deleted file]
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_allvsall.cpp [moved from src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_allvsall.c with 98% similarity]
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_allvsall.h
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_allvsallgb.c [deleted file]
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_allvsallgb.h [deleted file]
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_c.c
src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_template_c.pre
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/make_nb_kernel_sparc64_hpc_ace_double.py
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecGB_VdwCSTab_GeomP1P1_sparc64_hpc_ace_double.c [deleted file]
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecGB_VdwLJ_GeomP1P1_sparc64_hpc_ace_double.c [deleted file]
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecGB_VdwNone_GeomP1P1_sparc64_hpc_ace_double.c [deleted file]
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_sparc64_hpc_ace_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_template_sparc64_hpc_ace_double.pre
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/make_nb_kernel_sse2_double.py
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecGB_VdwCSTab_GeomP1P1_sse2_double.c [deleted file]
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecGB_VdwLJ_GeomP1P1_sse2_double.c [deleted file]
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecGB_VdwNone_GeomP1P1_sse2_double.c [deleted file]
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_sse2_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_template_sse2_double.pre
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/make_nb_kernel_sse2_single.py
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecGB_VdwCSTab_GeomP1P1_sse2_single.c [deleted file]
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecGB_VdwLJ_GeomP1P1_sse2_single.c [deleted file]
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecGB_VdwNone_GeomP1P1_sse2_single.c [deleted file]
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_sse2_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_template_sse2_single.pre
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/make_nb_kernel_sse4_1_double.py
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecGB_VdwCSTab_GeomP1P1_sse4_1_double.c [deleted file]
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecGB_VdwLJ_GeomP1P1_sse4_1_double.c [deleted file]
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecGB_VdwNone_GeomP1P1_sse4_1_double.c [deleted file]
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_sse4_1_double.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_template_sse4_1_double.pre
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/make_nb_kernel_sse4_1_single.py
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecGB_VdwCSTab_GeomP1P1_sse4_1_single.c [deleted file]
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecGB_VdwLJ_GeomP1P1_sse4_1_single.c [deleted file]
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecGB_VdwNone_GeomP1P1_sse4_1_single.c [deleted file]
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_sse4_1_single.c
src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_template_sse4_1_single.pre
src/gromacs/gmxlib/nonbonded/nonbonded.cpp
src/gromacs/gmxlib/nrnb.cpp
src/gromacs/gmxlib/nrnb.h
src/gromacs/gmxpreprocess/convparm.cpp
src/gromacs/gmxpreprocess/gpp_atomtype.cpp
src/gromacs/gmxpreprocess/gpp_atomtype.h
src/gromacs/gmxpreprocess/grompp.cpp
src/gromacs/gmxpreprocess/nm2type.cpp
src/gromacs/gmxpreprocess/readir.cpp
src/gromacs/gmxpreprocess/resall.cpp
src/gromacs/gmxpreprocess/tests/readir.cpp
src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_EmptyInputWorks.xml
src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_HandlesDifferentKindsOfMdpLines.xml
src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_HandlesOnlyCutoffScheme.xml
src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_ImplicitSolventNoWorks.xml [moved from src/programs/mdrun/tests/alanine_vsite.mdp with 74% similarity]
src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_ProducesOutputFromElectricField.xml
src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_ProducesOutputFromElectricFieldOscillating.xml
src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_ProducesOutputFromElectricFieldPulsed.xml
src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_UserErrorsSilentlyTolerated.xml
src/gromacs/gmxpreprocess/topdirs.cpp
src/gromacs/gmxpreprocess/topio.cpp
src/gromacs/gmxpreprocess/topio.h
src/gromacs/gmxpreprocess/toppush.cpp
src/gromacs/gmxpreprocess/toppush.h
src/gromacs/gmxpreprocess/toputil.cpp
src/gromacs/gpu_utils/cuda_arch_utils.cuh
src/gromacs/gpu_utils/cuda_kernel_utils.cuh
src/gromacs/gpu_utils/cudautils.cu
src/gromacs/gpu_utils/cudautils.cuh
src/gromacs/gpu_utils/gpu_utils.cu
src/gromacs/gpu_utils/gpu_utils.h
src/gromacs/gpu_utils/gpuregiontimer.cuh
src/gromacs/gpu_utils/gpuregiontimer.h
src/gromacs/gpu_utils/gpuregiontimer_ocl.h
src/gromacs/gpu_utils/gputraits.cuh [moved from src/gromacs/simd/impl_ibm_qpx/impl_ibm_qpx_general.h with 75% similarity]
src/gromacs/gpu_utils/gputraits_ocl.h [moved from src/gromacs/simd/impl_ibm_qpx/impl_ibm_qpx.h with 73% similarity]
src/gromacs/gpu_utils/oclutils.h
src/gromacs/gpu_utils/tests/gputest.cpp
src/gromacs/gpu_utils/tests/pinnedmemorychecker.cpp
src/gromacs/hardware/architecture.h
src/gromacs/hardware/cpuinfo.cpp
src/gromacs/hardware/cpuinfo.h
src/gromacs/hardware/detecthardware.cpp
src/gromacs/hardware/detecthardware.h
src/gromacs/hardware/printhardware.cpp
src/gromacs/hardware/printhardware.h
src/gromacs/imd/imd.cpp
src/gromacs/imd/imd.h
src/gromacs/linearalgebra/nrjac.cpp
src/gromacs/listed-forces/bonded.cpp
src/gromacs/listed-forces/disre.cpp
src/gromacs/listed-forces/disre.h
src/gromacs/listed-forces/listed-forces.cpp
src/gromacs/listed-forces/listed-forces.h
src/gromacs/listed-forces/orires.cpp
src/gromacs/listed-forces/orires.h
src/gromacs/listed-forces/pairs.cpp
src/gromacs/mdlib/broadcaststructs.cpp
src/gromacs/mdlib/clincs.cpp
src/gromacs/mdlib/constr.cpp
src/gromacs/mdlib/constr.h
src/gromacs/mdlib/csettle.cpp
src/gromacs/mdlib/expanded.cpp
src/gromacs/mdlib/force.cpp
src/gromacs/mdlib/force.h
src/gromacs/mdlib/forcerec.cpp
src/gromacs/mdlib/forcerec.h
src/gromacs/mdlib/genborn.cpp [deleted file]
src/gromacs/mdlib/genborn.h [deleted file]
src/gromacs/mdlib/genborn_allvsall.cpp [deleted file]
src/gromacs/mdlib/genborn_allvsall.h [deleted file]
src/gromacs/mdlib/gmx_omp_nthreads.cpp
src/gromacs/mdlib/integrator.h
src/gromacs/mdlib/main.cpp
src/gromacs/mdlib/main.h
src/gromacs/mdlib/md_support.cpp
src/gromacs/mdlib/md_support.h
src/gromacs/mdlib/mdebin.cpp
src/gromacs/mdlib/mdoutf.cpp
src/gromacs/mdlib/mdsetup.h
src/gromacs/mdlib/minimize.cpp
src/gromacs/mdlib/nbnxn_atomdata.cpp
src/gromacs/mdlib/nbnxn_atomdata.h
src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda.cu
src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda.h
src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_data_mgmt.cu
src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel_fermi.cuh
src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel_utils.cuh
src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernels.cuh
src/gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_types.h
src/gromacs/mdlib/nbnxn_gpu_types_common.h
src/gromacs/mdlib/nbnxn_grid.cpp
src/gromacs/mdlib/nbnxn_internal.h
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_common.h
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_inner.h
src/gromacs/mdlib/nbnxn_kernels/simd_2xnn/nbnxn_kernel_simd_2xnn_outer.h
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_common.h
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_inner.h
src/gromacs/mdlib/nbnxn_kernels/simd_4xn/nbnxn_kernel_simd_4xn_outer.h
src/gromacs/mdlib/nbnxn_ocl/nbnxn_ocl.cpp
src/gromacs/mdlib/nbnxn_ocl/nbnxn_ocl_data_mgmt.cpp
src/gromacs/mdlib/nbnxn_ocl/nbnxn_ocl_kernel_amd.clh
src/gromacs/mdlib/nbnxn_ocl/nbnxn_ocl_kernel_nowarp.clh
src/gromacs/mdlib/nbnxn_ocl/nbnxn_ocl_kernel_nvidia.clh
src/gromacs/mdlib/nbnxn_ocl/nbnxn_ocl_types.h
src/gromacs/mdlib/nbnxn_search.cpp
src/gromacs/mdlib/nbnxn_search_simd_2xnn.h
src/gromacs/mdlib/nbnxn_search_simd_4xn.h
src/gromacs/mdlib/nbnxn_util.h
src/gromacs/mdlib/ns.cpp
src/gromacs/mdlib/nsgrid.cpp
src/gromacs/mdlib/shellfc.cpp
src/gromacs/mdlib/shellfc.h
src/gromacs/mdlib/sim_util.cpp
src/gromacs/mdlib/sim_util.h
src/gromacs/mdlib/simulationsignal.cpp
src/gromacs/mdlib/simulationsignal.h
src/gromacs/mdlib/tests/simulationsignal.cpp
src/gromacs/mdlib/tpi.cpp
src/gromacs/mdlib/update.cpp
src/gromacs/mdlib/update.h
src/gromacs/mdlib/vsite.cpp
src/gromacs/mdlib/vsite.h
src/gromacs/mdrunutility/handlerestart.cpp
src/gromacs/mdrunutility/handlerestart.h
src/gromacs/mdrunutility/tests/threadaffinitytest.h
src/gromacs/mdrunutility/threadaffinity.cpp
src/gromacs/mdrunutility/threadaffinity.h
src/gromacs/mdtypes/commrec.h
src/gromacs/mdtypes/forcerec.h
src/gromacs/mdtypes/imdoutputprovider.h
src/gromacs/mdtypes/inputrec.cpp
src/gromacs/mdtypes/inputrec.h
src/gromacs/mdtypes/md_enums.cpp
src/gromacs/mdtypes/md_enums.h
src/gromacs/pbcutil/pbc-simd.h
src/gromacs/pulling/pull_rotation.cpp
src/gromacs/random/tabulatednormaldistribution.cpp
src/gromacs/random/tabulatednormaldistribution.h
src/gromacs/random/tests/tabulatednormaldistribution.cpp
src/gromacs/simd/impl_arm_neon/impl_arm_neon_definitions.h
src/gromacs/simd/impl_arm_neon/impl_arm_neon_util_float.h
src/gromacs/simd/impl_arm_neon_asimd/impl_arm_neon_asimd_definitions.h
src/gromacs/simd/impl_arm_neon_asimd/impl_arm_neon_asimd_util_double.h
src/gromacs/simd/impl_ibm_qpx/impl_ibm_qpx_definitions.h [deleted file]
src/gromacs/simd/impl_ibm_qpx/impl_ibm_qpx_simd4_double.h [deleted file]
src/gromacs/simd/impl_ibm_qpx/impl_ibm_qpx_simd4_float.h [deleted file]
src/gromacs/simd/impl_ibm_qpx/impl_ibm_qpx_simd_double.h [deleted file]
src/gromacs/simd/impl_ibm_qpx/impl_ibm_qpx_simd_float.h [deleted file]
src/gromacs/simd/impl_ibm_qpx/impl_ibm_qpx_util_double.h [deleted file]
src/gromacs/simd/impl_ibm_qpx/impl_ibm_qpx_util_float.h [deleted file]
src/gromacs/simd/impl_ibm_vmx/impl_ibm_vmx_definitions.h
src/gromacs/simd/impl_ibm_vmx/impl_ibm_vmx_util_float.h
src/gromacs/simd/impl_ibm_vsx/impl_ibm_vsx.h
src/gromacs/simd/impl_ibm_vsx/impl_ibm_vsx_definitions.h
src/gromacs/simd/impl_ibm_vsx/impl_ibm_vsx_util_double.h
src/gromacs/simd/impl_ibm_vsx/impl_ibm_vsx_util_float.h
src/gromacs/simd/impl_none/impl_none.h
src/gromacs/simd/impl_reference/impl_reference_definitions.h
src/gromacs/simd/impl_sparc64_hpc_ace/impl_sparc64_hpc_ace_common.h
src/gromacs/simd/impl_x86_avx2_128/impl_x86_avx2_128_definitions.h
src/gromacs/simd/impl_x86_avx2_256/impl_x86_avx2_256_definitions.h
src/gromacs/simd/impl_x86_avx_128_fma/impl_x86_avx_128_fma_definitions.h
src/gromacs/simd/impl_x86_avx_256/impl_x86_avx_256_definitions.h
src/gromacs/simd/impl_x86_avx_256/impl_x86_avx_256_util_double.h
src/gromacs/simd/impl_x86_avx_256/impl_x86_avx_256_util_float.h
src/gromacs/simd/impl_x86_avx_512/impl_x86_avx_512_definitions.h
src/gromacs/simd/impl_x86_avx_512/impl_x86_avx_512_simd_double.h
src/gromacs/simd/impl_x86_avx_512/impl_x86_avx_512_simd_float.h
src/gromacs/simd/impl_x86_avx_512_knl/impl_x86_avx_512_knl_definitions.h
src/gromacs/simd/impl_x86_mic/impl_x86_mic_definitions.h
src/gromacs/simd/impl_x86_mic/impl_x86_mic_util_double.h
src/gromacs/simd/impl_x86_mic/impl_x86_mic_util_float.h
src/gromacs/simd/impl_x86_sse2/impl_x86_sse2_definitions.h
src/gromacs/simd/impl_x86_sse2/impl_x86_sse2_util_float.h
src/gromacs/simd/impl_x86_sse4_1/impl_x86_sse4_1_definitions.h
src/gromacs/simd/simd.h
src/gromacs/simd/simd_math.h
src/gromacs/simd/simd_memory.h
src/gromacs/simd/support.cpp
src/gromacs/simd/support.h
src/gromacs/simd/tests/bootstrap_loadstore.cpp
src/gromacs/simd/tests/simd.cpp
src/gromacs/simd/tests/simd.h
src/gromacs/simd/tests/simd4.cpp
src/gromacs/simd/tests/simd4_floatingpoint.cpp
src/gromacs/simd/tests/simd_floatingpoint.cpp
src/gromacs/simd/tests/simd_floatingpoint_util.cpp
src/gromacs/simd/tests/simd_integer.cpp
src/gromacs/simd/tests/simd_math.cpp
src/gromacs/simd/tests/simd_memory.cpp
src/gromacs/tables/cubicsplinetable.cpp
src/gromacs/tables/cubicsplinetable.h
src/gromacs/tables/forcetable.cpp
src/gromacs/tables/forcetable.h
src/gromacs/tables/quadraticsplinetable.cpp
src/gromacs/tables/splineutil.cpp
src/gromacs/tables/tests/splinetable.cpp
src/gromacs/taskassignment/resourcedivision.cpp
src/gromacs/taskassignment/resourcedivision.h
src/gromacs/taskassignment/taskassignment.cpp
src/gromacs/taskassignment/taskassignment.h
src/gromacs/timing/cyclecounter.h
src/gromacs/timing/wallcycle.cpp
src/gromacs/timing/wallcycle.h
src/gromacs/timing/walltime_accounting.cpp
src/gromacs/tools/check.cpp
src/gromacs/topology/atoms.cpp
src/gromacs/topology/atoms.h
src/gromacs/topology/idef.cpp
src/gromacs/topology/idef.h
src/gromacs/topology/ifunc.cpp
src/gromacs/utility/basedefinitions.h
src/gromacs/utility/basenetwork.cpp
src/gromacs/utility/binaryinformation.cpp
src/gromacs/utility/bitmask.h
src/gromacs/utility/coolstuff.cpp
src/gromacs/utility/cuda_version_information.cu
src/gromacs/utility/cuda_version_information.h
src/gromacs/utility/futil.h
src/gromacs/utility/gmxmpi.h
src/gromacs/utility/gmxomp.h
src/gromacs/utility/keyvaluetreetransform.h
src/gromacs/utility/smalloc.h
src/gromacs/utility/tests/CMakeLists.txt
src/programs/mdrun/md.cpp
src/programs/mdrun/mdrun.cpp
src/programs/mdrun/repl_ex.cpp
src/programs/mdrun/repl_ex.h
src/programs/mdrun/runner.cpp
src/programs/mdrun/runner.h
src/programs/mdrun/tests/CMakeLists.txt
src/programs/mdrun/tests/OctaneSandwich.mdp [deleted file]
src/programs/mdrun/tests/interactiveMD.cpp
src/programs/mdrun/tests/moduletest.cpp
src/programs/mdrun/tests/moduletest.h
src/programs/mdrun/tests/multisim.cpp
src/programs/mdrun/tests/multisimtest.cpp
src/programs/mdrun/tests/multisimtest.h
src/programs/mdrun/tests/pmetest.cpp
src/programs/mdrun/tests/refdata/PmeTest_ReproducesEnergies.xml
src/programs/mdrun/tests/refdata/PmeTest_ScalesTheBox.xml [new file with mode: 0644]
src/programs/mdrun/tests/spc2-IMD.mdp [deleted file]
src/programs/mdrun/tests/swapcoords.cpp
src/testutils/cmdlinetest.cpp
src/testutils/cmdlinetest.h
src/testutils/mpitest.cpp
src/testutils/testasserts.h
src/testutils/tests/testasserts_tests.cpp
tests/CMakeLists.txt
tests/CheckTarget.cmake
tests/CppCheck.cmake

index c5c3f0d13471576c4f960a48ba1bac7195bbc054..040c509ef21641f7d83cc9dc2ec70affc7818dcb 100644 (file)
@@ -24,10 +24,12 @@ cmake/CheckC*CompilerFlag.cmake         !filter
 cmake/FindBLAS.cmake                    !filter
 cmake/FindLAPACK.cmake                  !filter
 cmake/ThreadMPI.cmake                   !filter
-cmake/Platform/BluegeneQ*.cmake         !filter
 cmake/*.c                               -filter -gmx-doxygen
 cmake/*.cpp                             -filter -gmx-doxygen
 cmake/*.c.cmakein                       !filter
+cmake/*.h                               !filter
+cmake/*.cu                              !filter
+cmake/*.cuh                             !filter
 cmake/FindCUDA/*.cmake                  !filter
 docs/doxygen/Doxyfile-*.cmakein         !filter
 docs/doxygen/*.cpp                      !filter
@@ -38,7 +40,6 @@ scripts/GMXRC.*                         !filter
 scripts/make_gromos_rtp.py              !filter
 share/template/template.cpp             filter=copyright
 share/template/README.cmakein           !filter
-src/contrib/*                           -filter -gmx-doxygen
 src/gromacs/gmxlib/nonbonded/preprocessor/gmxpreprocess.py !filter
 src/gromacs/linearalgebra/gmx_blas/*    !filter
 src/gromacs/linearalgebra/gmx_lapack/*  !filter
index 73469b7703e21ce8d266813e7881150616603e8c..d5a5255964015d4a2ed742f10033ae801a447eae 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+# Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
 # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
 # and including many others, as listed in the AUTHORS file in the
 # top-level source directory and at http://www.gromacs.org.
@@ -240,7 +240,7 @@ gmx_option_multichoice(
     GMX_SIMD
     "SIMD instruction set for CPU kernels and compiler optimization"
     "AUTO"
-    AUTO None SSE2 SSE4.1 AVX_128_FMA AVX_256 AVX2_256 AVX2_128 AVX_512 AVX_512_KNL MIC ARM_NEON ARM_NEON_ASIMD IBM_QPX IBM_VMX IBM_VSX Sparc64_HPC_ACE Reference)
+    AUTO None SSE2 SSE4.1 AVX_128_FMA AVX_256 AVX2_256 AVX2_128 AVX_512 AVX_512_KNL MIC ARM_NEON ARM_NEON_ASIMD IBM_VMX IBM_VSX Sparc64_HPC_ACE Reference)
 
 if(GMX_TARGET_MIC)
     set(GMX_FFT_LIBRARY_DEFAULT "mkl")
@@ -445,10 +445,6 @@ gmx_set_boolean(GMX_USE_NICE "HAVE_UNISTD_H AND HAVE_NICE")
 # GROMACS defaults or user settings will make sense. Also, any
 # toolchain-related reasons for choosing whether to detect various
 # things can be sorted out now, before the detection takes place.
-if(${CMAKE_SYSTEM_NAME} MATCHES BlueGene)
-    include(gmxManageBlueGene)
-endif()
-
 if(GMX_TARGET_FUJITSU_SPARC64)
     include(gmxManageFujitsuSparc64)
 endif()
@@ -561,8 +557,6 @@ endif()
 include(ThreadMPI)
 # Enable core threading facilities
 tmpi_enable_core("${CMAKE_SOURCE_DIR}/src/external/thread_mpi/include")
-# Enable tMPI C++ support
-tmpi_enable_cxx()
 if(GMX_THREAD_MPI)
     # enable MPI functions
     tmpi_enable()
diff --git a/cmake/Platform/BlueGeneQ-base.cmake b/cmake/Platform/BlueGeneQ-base.cmake
deleted file mode 100644 (file)
index 1827a5e..0000000
+++ /dev/null
@@ -1,184 +0,0 @@
-#
-# This file is part of the GROMACS molecular simulation package.
-#
-# Copyright (c) 2013,2014, by the GROMACS development team, led by
-# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
-# and including many others, as listed in the AUTHORS file in the
-# top-level source directory and at http://www.gromacs.org.
-#
-# GROMACS is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public License
-# as published by the Free Software Foundation; either version 2.1
-# of the License, or (at your option) any later version.
-#
-# GROMACS is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with GROMACS; if not, see
-# http://www.gnu.org/licenses, or write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
-#
-# If you want to redistribute modifications to GROMACS, please
-# consider that scientific software is very special. Version
-# control is crucial - bugs must be traceable. We will be happy to
-# consider code for inclusion in the official distribution, but
-# derived work must not be called official GROMACS. Details are found
-# in the README & COPYING files - if they are missing, get the
-# official version at http://www.gromacs.org.
-#
-# To help us fund GROMACS development, we humbly ask that you cite
-# the research papers on the package. Check out http://www.gromacs.org.
-#
-#=============================================================================
-# CMake - Cross Platform Makefile Generator
-# Copyright 2000-2011 Kitware, Inc., Insight Software Consortium
-# Copyright 2010 Todd Gamblin <tgamblin@llnl.gov>
-# Copyright 2012 Julien Bigot <julien.bigot@cea.fr>
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# * Redistributions of source code must retain the above copyright
-#   notice, this list of conditions and the following disclaimer.
-#
-# * Redistributions in binary form must reproduce the above copyright
-#   notice, this list of conditions and the following disclaimer in the
-#   documentation and/or other materials provided with the distribution.
-#
-# * Neither the names of Kitware, Inc., the Insight Software Consortium,
-#   nor the names of their contributors may be used to endorse or promote
-#   products derived from this software without specific prior written
-#   permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#=============================================================================
-
-#
-# BlueGeneQ base platform file.
-#
-# NOTE: Do not set your platform to "BlueGeneQ-base".  This file is included
-# by the real platform files.  Use one of these two platforms instead:
-#
-#     BlueGeneQ-dynamic  For dynamically linked builds
-#     BlueGeneQ-static   For statically linked builds
-#
-# This platform file tries its best to adhere to the behavior of the MPI
-# compiler wrappers included with the latest BG/Q drivers.
-#
-
-
-#
-# For BG/Q builds, we're cross compiling, but we don't want to re-root things
-# (e.g. with CMAKE_FIND_ROOT_PATH) because users may have libraries anywhere on
-# the shared filesystems, and this may lie outside the root.  Instead, we set the
-# system directories so that the various system BG/Q CNK library locations are
-# searched first.  This is not the clearest thing in the world, given IBM's driver
-# layout, but this should cover all the standard ones.
-#
-set(CMAKE_SYSTEM_LIBRARY_PATH
-  /bgsys/drivers/ppcfloor/comm/xl/lib                       # default comm layer (used by mpi compiler wrappers)
-  /bgsys/drivers/ppcfloor/spi/lib/                          # other low-level stuff
-  /bgsys/drivers/ppcfloor/gnu-linux/powerpc64-bgq-linux/lib # CNK Linux image -- standard runtime libs, pthread, etc.
-)
-
-#
-# This adds directories that find commands should specifically ignore for cross compiles.
-# Most of these directories are the includeand lib directories for the frontend on BG/Q systems.
-# Not ignoring these can cause things like FindX11 to find a frontend PPC version mistakenly.
-# We use this on BG instead of re-rooting because backend libraries are typically strewn about
-# the filesystem, and we can't re-root ALL backend libraries to a single place.
-#
-set(CMAKE_SYSTEM_IGNORE_PATH
-  /lib             /lib64             /include
-  /usr/lib         /usr/lib64         /usr/include
-  /usr/local/lib   /usr/local/lib64   /usr/local/include
-  /usr/X11/lib     /usr/X11/lib64     /usr/X11/include
-  /usr/lib/X11     /usr/lib64/X11     /usr/include/X11
-  /usr/X11R6/lib   /usr/X11R6/lib64   /usr/X11R6/include
-  /usr/X11R7/lib   /usr/X11R7/lib64   /usr/X11R7/include
-)
-
-#
-# Indicate that this is a unix-like system
-#
-set(UNIX 1)
-
-#
-# Library prefixes, suffixes, extra libs.
-#
-set(CMAKE_LINK_LIBRARY_SUFFIX "")
-set(CMAKE_STATIC_LIBRARY_PREFIX "lib")     # lib
-set(CMAKE_STATIC_LIBRARY_SUFFIX ".a")      # .a
-
-set(CMAKE_SHARED_LIBRARY_PREFIX "lib")     # lib
-set(CMAKE_SHARED_LIBRARY_SUFFIX ".so")     # .so
-set(CMAKE_EXECUTABLE_SUFFIX "")            # .exe
-set(CMAKE_DL_LIBS "dl")
-
-#
-# This macro needs to be called for dynamic library support.  Unfortunately on BG/Q,
-# We can't support both static and dynamic links in the same platform file.  The
-# dynamic link platform file needs to call this explicitly to set up dynamic linking.
-#
-macro(__BlueGeneQ_set_dynamic_flags compiler_id lang)
-  if (${compiler_id} STREQUAL XL)
-    # Flags for XL compilers if we explicitly detected XL
-    set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS           "-qpic")
-    set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS    "-qmkshrobj -qnostaticlink")
-    set(BG/Q_${lang}_DYNAMIC_EXE_FLAGS                "-qnostaticlink -qnostaticlink=libgcc")
-  else()
-    # Assume flags for GNU compilers (if the ID is GNU *or* anything else).
-    set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS           "-fPIC")
-    set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS    "-shared")
-    set(BG/Q_${lang}_DYNAMIC_EXE_FLAGS                "-dynamic")
-  endif()
-
-  # Both toolchains use the GNU linker on BG/Q, so these options are shared.
-  set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG      "-Wl,-rpath,")
-  set(CMAKE_SHARED_LIBRARY_RPATH_LINK_${lang}_FLAG   "-Wl,-rpath-link,")
-  set(CMAKE_SHARED_LIBRARY_SONAME_${lang}_FLAG       "-Wl,-soname,")
-  set(CMAKE_EXE_EXPORTS_${lang}_FLAG                 "-Wl,--export-dynamic")
-  set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS        "")  # +s, flag for exe link to use shared lib
-  set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG_SEP  ":") # : or empty
-
-  set(BG/Q_${lang}_DEFAULT_EXE_FLAGS
-    "<FLAGS> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS>  -o <TARGET> <LINK_LIBRARIES>")
-  set(CMAKE_${lang}_LINK_EXECUTABLE
-    "<CMAKE_${lang}_COMPILER> ${BG/Q_${lang}_DYNAMIC_EXE_FLAGS} ${BG/Q_${lang}_DEFAULT_EXE_FLAGS}")
-endmacro()
-
-#
-# This macro needs to be called for static builds.  Right now it just adds -Wl,-relax
-# to the link line.
-#
-macro(__BlueGeneQ_set_static_flags compiler_id lang)
-  set(BG/Q_${lang}_DEFAULT_EXE_FLAGS
-    "<FLAGS> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS>  -o <TARGET> <LINK_LIBRARIES>")
-  set(CMAKE_${lang}_LINK_EXECUTABLE
-    "<CMAKE_${lang}_COMPILER> ${BG/Q_${lang}_DEFAULT_EXE_FLAGS}")
-
-  if(CMAKE_BUILD_TYPE MATCHES "Deb" AND ${compiler_id} STREQUAL "XL")
-      # Work around an unknown compiler bug triggered in
-      # compute_globals(). Using -O0 disables -qhot and this seems
-      # to break the normal OpenMP flag -qsmp unless qualified with
-      # noauto.
-      set(OpenMP_C_FLAGS "-qsmp=noauto" CACHE STRING "Compiler flag for OpenMP parallelization")
-      set(OpenMP_CXX_FLAGS "-qsmp=noauto" CACHE STRING "Compiler flag for OpenMP parallelization")
-  endif()
-
-endmacro()
diff --git a/cmake/Platform/BlueGeneQ-static-bgclang-CXX.cmake b/cmake/Platform/BlueGeneQ-static-bgclang-CXX.cmake
deleted file mode 100644 (file)
index 3e89e6f..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-#
-# This file is part of the GROMACS molecular simulation package.
-#
-# Copyright (c) 2014,2016, by the GROMACS development team, led by
-# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
-# and including many others, as listed in the AUTHORS file in the
-# top-level source directory and at http://www.gromacs.org.
-#
-# GROMACS is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public License
-# as published by the Free Software Foundation; either version 2.1
-# of the License, or (at your option) any later version.
-#
-# GROMACS is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with GROMACS; if not, see
-# http://www.gnu.org/licenses, or write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
-#
-# If you want to redistribute modifications to GROMACS, please
-# consider that scientific software is very special. Version
-# control is crucial - bugs must be traceable. We will be happy to
-# consider code for inclusion in the official distribution, but
-# derived work must not be called official GROMACS. Details are found
-# in the README & COPYING files - if they are missing, get the
-# official version at http://www.gromacs.org.
-#
-# To help us fund GROMACS development, we humbly ask that you cite
-# the research papers on the package. Check out http://www.gromacs.org.
-#
-#=============================================================================
-# CMake - Cross Platform Makefile Generator
-# Copyright 2000-2011 Kitware, Inc., Insight Software Consortium
-# Copyright 2010 Todd Gamblin <tgamblin@llnl.gov>
-# Copyright 2012 Julien Bigot <julien.bigot@cea.fr>
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# * Redistributions of source code must retain the above copyright
-#   notice, this list of conditions and the following disclaimer.
-#
-# * Redistributions in binary form must reproduce the above copyright
-#   notice, this list of conditions and the following disclaimer in the
-#   documentation and/or other materials provided with the distribution.
-#
-# * Neither the names of Kitware, Inc., the Insight Software Consortium,
-#   nor the names of their contributors may be used to endorse or promote
-#   products derived from this software without specific prior written
-#   permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-#=============================================================================
-
-include(BlueGeneQ-static)
-__BlueGeneQ_set_static_flags(bgclang C)
-__BlueGeneQ_set_static_flags(bgclang CXX)
-
-set(CMAKE_SYSTEM_NAME BlueGeneQ-static CACHE STRING "Cross-compiling for BlueGene/Q" FORCE)
-
-# Use (e.g.) bgclang and bgclang++ as base compilers inside mpicc and
-# mpicxx
diff --git a/cmake/Platform/BlueGeneQ-static.cmake b/cmake/Platform/BlueGeneQ-static.cmake
deleted file mode 100644 (file)
index de1c3a4..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-#=============================================================================
-# CMake - Cross Platform Makefile Generator
-# Copyright 2000-2011 Kitware, Inc., Insight Software Consortium
-# Copyright 2010 Todd Gamblin <tgamblin@llnl.gov>
-# Copyright 2012 Julien Bigot <julien.bigot@cea.fr>
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# * Redistributions of source code must retain the above copyright
-#   notice, this list of conditions and the following disclaimer.
-#
-# * Redistributions in binary form must reproduce the above copyright
-#   notice, this list of conditions and the following disclaimer in the
-#   documentation and/or other materials provided with the distribution.
-#
-# * Neither the names of Kitware, Inc., the Insight Software Consortium,
-#   nor the names of their contributors may be used to endorse or promote
-#   products derived from this software without specific prior written
-#   permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-#=============================================================================
-
-include(BlueGeneQ-base)
-set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE)
-set(CMAKE_FIND_LIBRARY_PREFIXES "lib")
-set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
similarity index 100%
rename from cmake/TestAtomics.c
rename to cmake/TestAtomics.cpp
diff --git a/cmake/TestBlueGeneQ.c b/cmake/TestBlueGeneQ.c
deleted file mode 100644 (file)
index 7edc604..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-int main()
-{
-#ifdef __bgq__
-    return 0;
-#else
-#error This compiler is not targetting BlueGene/Q
-#endif
-}
diff --git a/cmake/TestQPX.c b/cmake/TestQPX.c
deleted file mode 100644 (file)
index 229c35b..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-int main()
-{
-    vector4double one = vec_splats(1.0);
-    vector4double zero = vec_sub(one,one);
-    return 0;
-}
index 9a06115e732d7f66cb7cc8c63271b4d08c1b78c6..dc55cf610a5f9becfe669f0b4d324978e57aeae5 100644 (file)
@@ -33,9 +33,9 @@
 # be called official thread_mpi. Details are found in the README & COPYING
 # files.
 
-include(CheckIncludeFiles)
-include(CheckFunctionExists)
-include(CheckCSourceCompiles)
+include(CheckIncludeFileCXX)
+include(CheckCXXSymbolExists)
+include(CheckCXXSourceCompiles)
 
 # sets TMPI_ATOMICS to 1 if atomic operations are found, unset otherwise
 # Options:
@@ -44,7 +44,7 @@ MACRO(TMPI_TEST_ATOMICS INCDIR)
 
     if (NOT DEFINED TMPI_ATOMICS)
         try_compile(TEST_ATOMICS "${CMAKE_BINARY_DIR}"
-                "${CMAKE_SOURCE_DIR}/cmake/TestAtomics.c"
+                "${CMAKE_SOURCE_DIR}/cmake/TestAtomics.cpp"
                 COMPILE_DEFINITIONS "-I${INCDIR} -DTMPI_ATOMICS")
         if (TEST_ATOMICS)
             message(STATUS "Atomic operations found")
@@ -62,7 +62,7 @@ MACRO(TMPI_TEST_ATOMICS INCDIR)
 
 ENDMACRO(TMPI_TEST_ATOMICS VARIABLE)
 
-try_compile(HAVE_PROCESSOR_NUMBER ${CMAKE_BINARY_DIR} "${CMAKE_SOURCE_DIR}/cmake/TestWinProcNum.c")
+try_compile(HAVE_PROCESSOR_NUMBER ${CMAKE_BINARY_DIR} "${CMAKE_SOURCE_DIR}/cmake/TestWinProcNum.cpp")
 
 include(FindThreads)
 
@@ -74,7 +74,7 @@ if (CMAKE_USE_WIN32_THREADS_INIT AND HAVE_PROCESSOR_NUMBER)
     set(THREAD_WINDOWS 1)
     set(THREAD_LIB)
 elseif (CMAKE_USE_PTHREADS_INIT)
-    check_include_files(pthread.h    HAVE_PTHREAD_H)
+    check_include_file_cxx(pthread.h    HAVE_PTHREAD_H)
     set(THREAD_PTHREADS 1)
     set(THREAD_LIB ${CMAKE_THREAD_LIBS_INIT})
 else()
@@ -90,7 +90,7 @@ MACRO(TMPI_ENABLE_CORE INCDIR)
     if (THREAD_PTHREADS)
         set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
         # check for sched_setaffinity
-        check_c_source_compiles(
+        check_cxx_source_compiles(
             "#define _GNU_SOURCE
 #include <pthread.h>
 #include <stdlib.h>
@@ -112,18 +112,16 @@ MACRO(TMPI_ENABLE_CORE INCDIR)
 
 
 # this runs on POSIX systems
-    check_include_files(unistd.h        HAVE_UNISTD_H)
-    check_include_files(sched.h         HAVE_SCHED_H)
-    check_include_files(sys/time.h      HAVE_SYS_TIME_H)
-    check_function_exists(sysconf       HAVE_SYSCONF)
+    check_include_file_cxx(unistd.h             HAVE_UNISTD_H)
+    check_include_file_cxx(sched.h              HAVE_SCHED_H)
+    check_include_file_cxx(sys/time.h           HAVE_SYS_TIME_H)
+    check_cxx_symbol_exists(sysconf    unistd.h HAVE_SYSCONF)
 # this runs on windows
 #check_include_files(windows.h         HAVE_WINDOWS_H)
 ENDMACRO(TMPI_ENABLE_CORE)
 
 # enable C++ library build.
-MACRO(TMPI_ENABLE_CXX)
-    set(TMPI_CXX_LIB 1)
-ENDMACRO(TMPI_ENABLE_CXX)
+set(TMPI_CXX_LIB 1)
 
 # Turns on thread_mpi MPI functions.
 MACRO(TMPI_ENABLE)
@@ -169,22 +167,20 @@ MACRO(TMPI_ENABLE)
     else ()
         set(TMPI_WARNINGS 0)
     endif ()
-
-    include(CheckCSourceCompiles)
 ENDMACRO(TMPI_ENABLE)
 
 
 MACRO(TMPI_GET_SOURCE_LIST SRC_VARIABLE SRC_ROOT)
     set(${SRC_VARIABLE}
-        ${SRC_ROOT}/errhandler.c
-        ${SRC_ROOT}/tmpi_malloc.c
-        ${SRC_ROOT}/atomic.c
-        ${SRC_ROOT}/lock.c)
+        ${SRC_ROOT}/errhandler.cpp
+        ${SRC_ROOT}/tmpi_malloc.cpp
+        ${SRC_ROOT}/atomic.cpp
+        ${SRC_ROOT}/lock.cpp)
 
     if (THREAD_PTHREADS)
-        list(APPEND ${SRC_VARIABLE} ${SRC_ROOT}/pthreads.c)
+        list(APPEND ${SRC_VARIABLE} ${SRC_ROOT}/pthreads.cpp)
     elseif (THREAD_WINDOWS)
-        list(APPEND ${SRC_VARIABLE} ${SRC_ROOT}/winthreads.c)
+        list(APPEND ${SRC_VARIABLE} ${SRC_ROOT}/winthreads.cpp)
     endif ()
 
     if (TMPI_CXX_LIB)
@@ -193,17 +189,17 @@ MACRO(TMPI_GET_SOURCE_LIST SRC_VARIABLE SRC_ROOT)
 
     if (TMPI_ENABLED)
         list(APPEND ${SRC_VARIABLE}
-             ${SRC_ROOT}/alltoall.c      ${SRC_ROOT}/p2p_protocol.c
-             ${SRC_ROOT}/barrier.c       ${SRC_ROOT}/p2p_send_recv.c
-             ${SRC_ROOT}/bcast.c         ${SRC_ROOT}/p2p_wait.c
-             ${SRC_ROOT}/collective.c    ${SRC_ROOT}/profile.c
-             ${SRC_ROOT}/comm.c          ${SRC_ROOT}/reduce.c
-             ${SRC_ROOT}/event.c         ${SRC_ROOT}/reduce_fast.c
-             ${SRC_ROOT}/gather.c        ${SRC_ROOT}/scatter.c
-             ${SRC_ROOT}/group.c         ${SRC_ROOT}/tmpi_init.c
-             ${SRC_ROOT}/topology.c      ${SRC_ROOT}/list.c
-             ${SRC_ROOT}/type.c          ${SRC_ROOT}/scan.c
-             ${SRC_ROOT}/numa_malloc.c   ${SRC_ROOT}/once.c)
+             ${SRC_ROOT}/alltoall.cpp      ${SRC_ROOT}/p2p_protocol.cpp
+             ${SRC_ROOT}/barrier.cpp       ${SRC_ROOT}/p2p_send_recv.cpp
+             ${SRC_ROOT}/bcast.cpp         ${SRC_ROOT}/p2p_wait.cpp
+             ${SRC_ROOT}/collective.cpp    ${SRC_ROOT}/profile.cpp
+             ${SRC_ROOT}/comm.cpp          ${SRC_ROOT}/reduce.cpp
+             ${SRC_ROOT}/event.cpp         ${SRC_ROOT}/reduce_fast.cpp
+             ${SRC_ROOT}/gather.cpp        ${SRC_ROOT}/scatter.cpp
+             ${SRC_ROOT}/group.cpp         ${SRC_ROOT}/tmpi_init.cpp
+             ${SRC_ROOT}/topology.cpp      ${SRC_ROOT}/list.cpp
+             ${SRC_ROOT}/type.cpp          ${SRC_ROOT}/scan.cpp
+             ${SRC_ROOT}/numa_malloc.cpp   ${SRC_ROOT}/once.cpp)
     endif()
 ENDMACRO(TMPI_GET_SOURCE_LIST)
 
index 0388254c83a4b83477058f2b72b9def6dab12cfa..5a5c267c41a8623e2b8b6ee7978372b4e47955b7 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2014,2015,2016,2017, by the GROMACS development team, led by
+# Copyright (c) 2014,2015,2016,2017,2018, by the GROMACS development team, led by
 # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
 # and including many others, as listed in the AUTHORS file in the
 # top-level source directory and at http://www.gromacs.org.
index bf348fc08ffcb356f7935a6e0578ad96f8e6d31c..4231cb15eaaaa9b9289d227f58c6c9098f06fdb2 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+# Copyright (c) 2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
 # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
 # and including many others, as listed in the AUTHORS file in the
 # top-level source directory and at http://www.gromacs.org.
@@ -117,8 +117,6 @@ function(gmx_suggest_simd _suggested_simd)
                 set(OUTPUT_SIMD "IBM_VSX")
             elseif(CPU_DETECTION_FEATURES MATCHES " vmx ")
                 set(OUTPUT_SIMD "IBM_VMX")
-            elseif(CPU_DETECTION_FEATURES MATCHES " qpx ")
-                set(OUTPUT_SIMD "IBM_QPX")
             elseif(CPU_DETECTION_FEATURES MATCHES " neon_asimd ")
                 set(OUTPUT_SIMD "ARM_NEON_ASIMD")
             elseif(CPU_DETECTION_FEATURES MATCHES " neon " AND NOT GMX_DOUBLE)
@@ -140,12 +138,7 @@ endfunction()
 
 function(gmx_detect_simd _suggested_simd)
     if(GMX_SIMD STREQUAL "AUTO")
-        if(GMX_TARGET_BGQ)
-            # BG/Q requires cross-compilation, so needs this
-            # logic. While the qpx feature flag in cpuinfo works, it
-            # can't be returned by cpuinfo running on the build host.
-            set(${_suggested_simd} "IBM_QPX")
-        elseif(GMX_TARGET_FUJITSU_SPARC64)
+        if(GMX_TARGET_FUJITSU_SPARC64)
             # HPC-ACE is always present. In the future we
             # should add detection for HPC-ACE2 here.
             set(${_suggested_simd} "Sparc64_HPC_ACE")
index 4d5000b138fb95ddbbc066fca6cf6b02272d50b1..eb7710b58fb9cdf3bef21d19d871d37c5f4970e4 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2013,2014,2016, by the GROMACS development team, led by
+# Copyright (c) 2013,2014,2016,2018, by the GROMACS development team, led by
 # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
 # and including many others, as listed in the AUTHORS file in the
 # top-level source directory and at http://www.gromacs.org.
 # - architecture is one for which GROMACS has special treatment
 #   (e.g. SIMD instructions)
 #
-# Sets GMX_TARGET_X86 or GMX_TARGET_BGQ if targetting that
-# architecture. May set other such variables if/when there is future
-# need.
+# Sets GMX_TARGET_X86 etc. if targetting that architecture. May set
+# other such variables if/when there is future need.
 
 function(gmx_detect_target_architecture)
     if (NOT DEFINED GMX_TARGET_X86)
         try_compile(GMX_TARGET_X86 ${CMAKE_BINARY_DIR}
             "${CMAKE_SOURCE_DIR}/cmake/TestX86.c")
     endif()
-    if (NOT DEFINED GMX_TARGET_BGQ)
-        try_compile(GMX_TARGET_BGQ ${CMAKE_BINARY_DIR}
-            "${CMAKE_SOURCE_DIR}/cmake/TestBlueGeneQ.c")
-    endif()
     if (NOT DEFINED GMX_TARGET_MIC)
         try_compile(GMX_TARGET_MIC ${CMAKE_BINARY_DIR}
             "${CMAKE_SOURCE_DIR}/cmake/TestMIC.c")
diff --git a/cmake/gmxManageBlueGene.cmake b/cmake/gmxManageBlueGene.cmake
deleted file mode 100644 (file)
index aa9a97f..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-#
-# This file is part of the GROMACS molecular simulation package.
-#
-# Copyright (c) 2012,2013,2014,2015, by the GROMACS development team, led by
-# Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
-# and including many others, as listed in the AUTHORS file in the
-# top-level source directory and at http://www.gromacs.org.
-#
-# GROMACS is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public License
-# as published by the Free Software Foundation; either version 2.1
-# of the License, or (at your option) any later version.
-#
-# GROMACS is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with GROMACS; if not, see
-# http://www.gnu.org/licenses, or write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
-#
-# If you want to redistribute modifications to GROMACS, please
-# consider that scientific software is very special. Version
-# control is crucial - bugs must be traceable. We will be happy to
-# consider code for inclusion in the official distribution, but
-# derived work must not be called official GROMACS. Details are found
-# in the README & COPYING files - if they are missing, get the
-# official version at http://www.gromacs.org.
-#
-# To help us fund GROMACS development, we humbly ask that you cite
-# the research papers on the package. Check out http://www.gromacs.org.
-
-# Managing configuration for all kinds of BlueGene systems
-# BlueGene/L is probably obsolete, but does no harm
-# BlueGene/P needs testing, but hasn't changed
-# BlueGene/Q works
-message(STATUS "Configuring for BlueGene")
-
-if (${CMAKE_SYSTEM_NAME} STREQUAL "BlueGeneL")
-    # BlueGene/L never had shared lib support.
-    set(BUILD_SHARED_LIBS OFF CACHE BOOL "Shared libraries not compatible with BlueGene/L, disabled!" FORCE)
-endif()
-if (${CMAKE_SYSTEM_NAME} MATCHES "BlueGene.*static")
-    # BlueGene/P claims shared library support, but Mark Abraham never
-    # got it to work. BlueGene/Q claims it, but discourages it for
-    # performance reasons. So unless information to the contrary ever
-    # comes to light, we should not mess about giving the user options
-    # that are useless when they've already selected a static toolchain.
-    set(BUILD_SHARED_LIBS OFF CACHE BOOL "Static BlueGene build toolchain selected, so shared libraries are disabled" FORCE)
-endif()
-
-set(GMX_SOFTWARE_INVSQRT OFF CACHE BOOL "Do not use software reciprocal square root on BlueGene")
-set(GMX_X11 OFF CACHE BOOL "X11 not compatible with BlueGene, disabled!" FORCE)
-set(GMX_GPU OFF CACHE BOOL "Cannot do GPU acceleration on BlueGene" FORCE)
-
-# It is conceivable you could use ThreadMPI on BlueGene/Q by using its
-# facility to run lots of jobs on small chunks of the machine. You
-# certainly need proper MPI to use a whole chunk of the machine that
-# the scheduler will allocate.
-set(GMX_THREAD_MPI OFF CACHE BOOL "GROMACS bundled thread-MPI is not supported on BlueGene" FORCE)
-set(GMX_MPI ON CACHE BOOL "MPI is required on BlueGene" FORCE)
-
-# Access to /etc/passwd is not available on the back end of BlueGeneP
-# (at least), despite being detected by CMake. This can cause linker
-# warnings about harmless things in src/gromacs/utility/cstringutil.h.
-set(HAVE_PWD_H OFF)
-
index 2f72efcae7ba3b0a66d01bd169c690e3aa8a56e2..3216e8a27bf41f5fc9ff0e49fe11105a0565e53a 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+# Copyright (c) 2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
 # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
 # and including many others, as listed in the AUTHORS file in the
 # top-level source directory and at http://www.gromacs.org.
@@ -75,7 +75,7 @@ if(${GMX_FFT_LIBRARY} STREQUAL "FFTW3")
             message(FATAL_ERROR "Cannot build FFTW3 automatically (GMX_BUILD_OWN_FFTW=ON) with ninja")
         endif()
 
-        add_subdirectory(src/contrib/fftw)
+        add_subdirectory(src/external/build-fftw)
         include_directories(BEFORE ${${FFTW}_INCLUDE_DIRS})
         # libgmxfftw is always built static, so libgromacs does not
         # have a dependency on anything, so PKG_FFT should be empty
index 4e10e93eecc6c1989f6abf639226345c5e60871c..66156c227dadcf488476cefe7965528cc4456c50 100644 (file)
@@ -298,30 +298,7 @@ macro(gmx_gpu_setup)
         endif() #GMX_CLANG_CUDA
     endif() # GMX_GPU
 
-    if (GMX_CLANG_CUDA)
-        set (_GMX_CUDA_NB_SINGLE_COMPILATION_UNIT_DEFAULT FALSE)
-    else()
-        set (_GMX_CUDA_NB_SINGLE_COMPILATION_UNIT_DEFAULT TRUE)
-    endif()
-    cmake_dependent_option(GMX_CUDA_NB_SINGLE_COMPILATION_UNIT
-        "Whether to compile the CUDA non-bonded module using a single compilation unit." ${_GMX_CUDA_NB_SINGLE_COMPILATION_UNIT_DEFAULT}
-        "GMX_GPU" ON)
+    option(GMX_CUDA_NB_SINGLE_COMPILATION_UNIT "Whether to compile the CUDA non-bonded module using a single compilation unit." OFF)
     mark_as_advanced(GMX_CUDA_NB_SINGLE_COMPILATION_UNIT)
 
-    if (GMX_GPU AND NOT GMX_CLANG_CUDA)
-        # We need to use single compilation unit for kernels:
-        # when compiling with nvcc for CC 2.x devices where buggy kernel code is generated
-        gmx_check_if_changed(_gmx_cuda_target_changed GMX_CUDA_TARGET_SM GMX_CUDA_TARGET_COMPUTE CUDA_NVCC_FLAGS)
-
-        if(_gmx_cuda_target_changed OR NOT GMX_GPU_DETECTION_DONE)
-            if((NOT GMX_CUDA_TARGET_SM AND NOT GMX_CUDA_TARGET_COMPUTE) OR
-                (GMX_CUDA_TARGET_SM MATCHES "2[01]" OR GMX_CUDA_TARGET_COMPUTE MATCHES "2[01]"))
-                message(STATUS "Enabling single compilation unit for the CUDA non-bonded module. Multiple compilation units are not compatible with CC 2.x devices, to enable the feature specify only CC >=3.0 target architectures in GMX_CUDA_TARGET_SM/GMX_CUDA_TARGET_COMPUTE.")
-                set_property(CACHE GMX_CUDA_NB_SINGLE_COMPILATION_UNIT PROPERTY VALUE ON)
-            else()
-                message(STATUS "Enabling multiple compilation units for the CUDA non-bonded module.")
-                set_property(CACHE GMX_CUDA_NB_SINGLE_COMPILATION_UNIT PROPERTY VALUE OFF)
-            endif()
-        endif()
-    endif()
 endmacro()
index 42c27780c8da3d966fbf9d78e00ce38a4e6d6764..6f17fe8ab1762ffe2edb0423edd297807cba8e30 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2012,2013,2014,2015, by the GROMACS development team, led by
+# Copyright (c) 2012,2013,2014,2015,2018, by the GROMACS development team, led by
 # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
 # and including many others, as listed in the AUTHORS file in the
 # top-level source directory and at http://www.gromacs.org.
@@ -42,7 +42,7 @@
 if((APPLE OR CYGWIN OR ${CMAKE_SYSTEM_NAME} MATCHES "Linux|.*BSD|GNU") AND NOT GMX_BUILD_MDRUN_ONLY)
     # Maybe Solaris should be here? Patch this if you know!
     SET(SHARED_LIBS_DEFAULT ON)
-elseif(WIN32 OR ${CMAKE_SYSTEM_NAME} MATCHES "BlueGene")
+elseif(WIN32)
     # Support for shared libs on native Windows is a bit new. Its
     # default might change later if/when we sort things out. Also,
     # Cray should go here. What variable value can detect it?
index 9862912083439a34109b673bae6b1cee5d0155a1..1d3ec3339a4f46b37e061937f148e1f94ee0577c 100644 (file)
@@ -237,18 +237,6 @@ elseif(GMX_SIMD_ACTIVE STREQUAL "ARM_NEON_ASIMD")
     set(GMX_SIMD_${GMX_SIMD_ACTIVE} 1)
     set(SIMD_STATUS_MESSAGE "Enabling ARM (AArch64) NEON Advanced SIMD instructions using CXX flags: ${SIMD_ARM_NEON_ASIMD_CXX_FLAGS}")
 
-elseif(GMX_SIMD_ACTIVE STREQUAL "IBM_QPX")
-
-    try_compile(TEST_QPX ${CMAKE_BINARY_DIR}
-        "${CMAKE_SOURCE_DIR}/cmake/TestQPX.c")
-
-    if (TEST_QPX)
-        set(GMX_SIMD_${GMX_SIMD_ACTIVE} 1)
-        set(SIMD_STATUS_MESSAGE "Enabling IBM QPX SIMD instructions without special flags.")
-    else()
-        gmx_give_fatal_error_when_simd_support_not_found("IBM QPX" "or 'cmake .. -DCMAKE_TOOLCHAIN_FILE=Platform/BlueGeneQ-static-bgclang-CXX' to set up the tool chain" "${SUGGEST_BINUTILS_UPDATE}")
-    endif()
-
 elseif(GMX_SIMD_ACTIVE STREQUAL "IBM_VMX")
 
     gmx_find_simd_ibm_vmx_flags(SIMD_IBM_VMX_C_SUPPORTED SIMD_IBM_VMX_CXX_SUPPORTED
@@ -375,9 +363,7 @@ endif()
 # so we avoid searching for any.
 #
 if(NOT DEFINED GMX_SIMD_CALLING_CONVENTION)
-    if(GMX_TARGET_BGQ)
-        set(CALLCONV_LIST " ")
-    elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND GMX_SIMD_ACTIVE STREQUAL "REFERENCE")
+    if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND GMX_SIMD_ACTIVE STREQUAL "REFERENCE")
         set(CALLCONV_LIST __regcall " ")
    elseif(CMAKE_CXX_COMPILER_ID MATCHES "XL")
         set(CALLCONV_LIST " ")
index e8f344487bb1efa5756ce612c2b756f9bd004053..56c9b90712c71cf5c5b6d909298fa2f59aff331f 100644 (file)
@@ -56,6 +56,7 @@
 #         GROMACS     5.1    1
 #         GROMACS     2016   2
 #         GROMACS     2018   3
+#         GROMACS     2019   4
 #   LIBRARY_SOVERSION_MINOR so minor version for the built libraries.
 #       Should be increased for each release that changes only the implementation.
 #       In GROMACS, the typical policy is to increase it for each patch version
 # header) can provide useful information for, e.g., diagnosing bug reports and
 # identifying what exact version the user was using.  The following formats are
 # possible (with examples given for a particular version):
-#   4.6.1       Plain version number without any suffix signifies a build from
-#               a released source tarball.
-#   4.6.1-dev   '-dev' suffix signifies all other builds. If there is no other
-#               information, either the user built the code outside any git
-#               repository, or disabled the version info generation.
-#   4.6.1-dev-YYYYMMDD-1234abc
-#               The YYYYMMDD part shows the commit date (not author date) of
-#               the HEAD commit from which the code was built.  The abbreviated
-#               hash is the hash of that commit (the full hash is available in
-#               'gmx -version' output).
-#               If the HEAD hash is not identified as coming from branches in
-#               "authoritative" GROMACS repositories, 'gmx -version' will show
-#               the nearest ancestor commit that is identified as such (but see
-#               the '-local' and '-unknown' suffixes below).
-#   4.6.1-dev-YYYYMMDD-1234abc-dirty
-#               As above, but there were local modifications in the source tree
-#               when the code was built.
-#   4.6.1-dev-YYYYMMDD-1234abc-unknown
-#               As above, but there were no remotes in the repository that
-#               could be identified as "authoritative" GROMACS repositories.
-#               This happens if the code is not cloned from git.gromacs.org
-#               or gerrit.gromacs.org.
-#   4.6.1-dev-YYYYMMDD-1234abc-local
-#               As above, but there were no commits in the recent history of
-#               the branch that could be identified as coming from
-#               "authoritative" GROMACS repositories.  This should be
-#               relatively rare.
+#   2018.1       Plain version number without any suffix signifies a build from
+#                a released source tarball.
+#   2018.1-dev   '-dev' suffix signifies all other builds. If there is no other
+#                information, either the user built the code outside any git
+#                repository, or disabled the version info generation.
+#   2018.1-dev-YYYYMMDD-1234abc
+#                The YYYYMMDD part shows the commit date (not author date) of
+#                the HEAD commit from which the code was built.  The abbreviated
+#                hash is the hash of that commit (the full hash is available in
+#                'gmx -version' output).
+#                If the HEAD hash is not identified as coming from branches in
+#                "authoritative" GROMACS repositories, 'gmx -version' will show
+#                the nearest ancestor commit that is identified as such (but see
+#                the '-local' and '-unknown' suffixes below).
+#   2018.1-dev-YYYYMMDD-1234abc-dirty
+#                As above, but there were local modifications in the source tree
+#                when the code was built.
+#   2018.1-dev-YYYYMMDD-1234abc-unknown
+#                As above, but there were no remotes in the repository that
+#                could be identified as "authoritative" GROMACS repositories.
+#                This happens if the code is not cloned from git.gromacs.org
+#                or gerrit.gromacs.org.
+#   2018.1-dev-YYYYMMDD-1234abc-local
+#                As above, but there were no commits in the recent history of
+#                the branch that could be identified as coming from
+#                "authoritative" GROMACS repositories.  This should be
+#                relatively rare.
 #
 # Other variables set here are not intended for use outside this file.
 # The scripts gmxGenerateVersionInfo.cmake and gmxConfigureVersionInfo.cmake
 
 # The GROMACS convention is that these are the version number of the next
 # release that is going to be made from this branch.
-set(GMX_VERSION_MAJOR 2018)
-set(GMX_VERSION_PATCH 1)
+set(GMX_VERSION_MAJOR 2019)
+set(GMX_VERSION_PATCH 0)
 # The suffix, on the other hand, is used mainly for betas and release
 # candidates, where it signifies the most recent such release from
 # this branch; it will be empty before the first such release, as well
@@ -202,7 +203,7 @@ set(GMX_VERSION_SUFFIX "")
 # here. The important thing is to minimize the chance of third-party
 # code being able to dynamically link with a version of libgromacs
 # that might not work.
-set(LIBRARY_SOVERSION_MAJOR 3)
+set(LIBRARY_SOVERSION_MAJOR 4)
 set(LIBRARY_SOVERSION_MINOR 0)
 set(LIBRARY_VERSION ${LIBRARY_SOVERSION_MAJOR}.${LIBRARY_SOVERSION_MINOR}.0)
 
index 814a2eed0d9f859e3d4eb38216d91d77562b9196..e8114880a0fc60081dc7c8b081912d59619ed007 100644 (file)
@@ -106,6 +106,7 @@ if (SPHINX_FOUND)
         dev-manual/build-system.rst
         dev-manual/commitstyle.rst
         dev-manual/documentation-generation.rst
+        dev-manual/contribute.rst
         dev-manual/doxygen.rst
         dev-manual/error-handling.rst
         dev-manual/formatting.rst
diff --git a/docs/dev-manual/contribute.rst b/docs/dev-manual/contribute.rst
new file mode 100644 (file)
index 0000000..25a06ee
--- /dev/null
@@ -0,0 +1,149 @@
+Contribute to |Gromacs|
+=======================
+
+|Gromacs| is a community-driven project, and we love getting
+contributions from people. Contributions are welcome in many forms,
+including improvements to documentation, patches to fix bugs, advice
+on the forums, bug reports that let us reproduce the issue, and new
+functionality.
+
+If you are planning to contribute new functionality to |Gromacs|, we
+strongly encourage you to get in contact with us first at an early
+stage. New things can lead to exciting science, and we love
+that. However, the subsequent code maintenance is time-consuming and
+requires both "up front" and long-term commitment from you, and others
+who might not share your particular scientific enthusiasm. Please read
+this page first, and at least post on the `developer mailing
+list`_. Sometimes we'll be able to save you a lot of time even at the
+planning stage!
+
+Much of the documentation is found alongside the source code in the
+git repository. If you have changes to suggest there, those
+contributions can be done using the same mechanism as the source code
+contributions, and will be reviewed in similar ways.
+
+Checklist
+---------
+
+Before you send us your code for review and inclusion into |Gromacs|,
+please make sure that you have checked all the points on this list:
+
+* *Usefulness*: Your code should have wide applicability within the scientific
+  community. You are welcome to have smaller projects tracking our code,
+  but we are not prepared to include and maintain code that will only have
+  limited application. Evidence that people are already using your code or
+  method is one good way to show that your code is useful.
+  Scientific publications is another, but those publications should
+  ideally come from several different research groups to show
+  widespread adoption of the method.
+
+* *Advance discussion*: Please communicate with the other developers,
+  e.g.  on the `developer mailing list`_ mailing list, or `Redmine
+  <https://redmine.gromacs.org>`_ to let them know of the general
+  nature of your plans. This will prevent duplicate or wasted
+  effort. It is also a good idea to search those resources as well as
+  the literature and WWW for other projects that may be relevant.
+
+* *Verifiable*: If you propose a new method that passes the first check,
+  please make sure that we can easily verify that it will be correct
+  from a physics point of view. That must include documentation (both
+  in the source code and as later additions to the user guide and/or
+  reference manual) that a capable graduate student can read and
+  understand well enough to use your method appropriately. The source
+  code documentation will also help in maintenance and later
+  development.
+
+  This will be facilitated by the inclusions of unit tests for your code,
+  as described in the section on how to write
+  :ref:`new tests <gmx-make-new-tests>`.
+
+  We also need some form of automated high-level test of your code,
+  because people who do not understand its details need to be able to
+  change the infrastructure that you depend on. |Gromacs| uses
+  automated continuous-integration testing implemented by our
+  :doc:`jenkins <jenkins>` server, and we need quick feedback about whether your
+  code would be affected by a proposed change. This means the users of
+  your feature can continue to do good science based upon trustworthy
+  results generated by new versions of |Gromacs| released after you've
+  contributed your feature.
+
+* *Structured change process*: Reviewing code for correctness, quality
+  and performance is a very time consuming process, which we are
+  committed to because it is necessary in order to deliver software
+  that is of high enough quality for reliable scientific
+  results. However, human beings are busy and have short attention
+  spans, and a proposed change affecting 10,000 lines of code is
+  likely to generate little enthusiasm from other developers to review
+  it. Your local git commit history is likely full of changes that are
+  no longer present in the version you'd like to contribute, so we
+  can't reasonably review that, either. It might be reasonable to
+  break the process into manageable pieces, such as
+
+    * the functionality to read the :doc:`mdp settings <../user-guide/mdp-options>` you might require and
+      write a :ref:`tpr`,
+    * the functionality for :ref:`mdrun <gmx mdrun>` to execute the simplest form of your
+      feature,
+    * further extensions and/or optimizations for your feature, and
+    * functionality for an analysis tool to do useful things with the
+      simulation output.
+
+  Do get in touch with us, e.g. on the `developer mailing list`_, to
+  exchange ideas here.
+
+* *Timeliness*: We make an annual release of |Gromacs|, with a feature
+  freeze (and git branch fork) on a fixed date, which is agreed more
+  than six months in advance. We still need a month or more to do
+  quality testing on that branch, after the fork and before the
+  release, so there's a period when we cannot accept certain kinds of
+  potentially risky changes. (The master branch will remain open for
+  all kinds of changes, but it is likely that the focus of many of the
+  core developers will be on the release process.) If you have a large
+  change to propose, you need to
+
+    * make a group of smaller changes,
+    * negotiate in advance who will do the code review, and
+    * have them available for review and improvement months(!) before
+      that date. Even smaller changes are unlikely to be prioritized
+      by others for review in the last month or so!
+
+* *Coding style*: Please make sure that your code follows all the
+  :doc:`coding style <style>` and :ref:`code formatting <code-formatting>`
+  guidelines. This will make the code review go more smoothly on both sides. There are a number of
+  tools already included with |Gromacs| to facilitate this, please have
+  a look at :ref:`the respective part of the documentation <gmx-uncrustify>`.
+
+* *Code documentation*: To ensure proper code documentation, please follow the
+  instructions provided for the use of :doc:`doxygen <doxygen>`. In addition to this,
+  the new functionality should be documented in the manual and possibly the user guide .
+
+* In addition to coding style, please also follow the instructions given
+  concerning the :ref:`commit style <code-commitstyle>`. This will also
+  facilitate the code review process.
+
+Alternatives
+------------
+
+|Gromacs| has a public mirror available on GitHub at
+https://github.com/gromacs/gromacs. You may wish to fork the project
+under your own GitHub account and make your feature available that
+way. This should help you to generate a following of users that would
+help make the case for contributing the feature to the core. This process
+would then still need to follow the remaining criteria outlined here.
+
+There is a project underway to develop a stable API for |Gromacs|,
+which promises to be a great tool for permtting innovation while
+ensuring ongoing quality of the core functionality. You might prefer
+to plan to port your functionality to that API when it becomes
+available. Do keep in touch on the `developer mailing list`_, so
+you'll be the first to know when such functionality is ready for people to
+explore!
+
+Do you have more questions?
+---------------------------
+
+If you have questions regarding these points, or would like feedback on your ideas for contributing,
+please feel free to contact us through the `developer mailing list`_.
+If your code is of interest to the wider |Gromacs| community, we will be happy to assist you
+in the process of including it in the main source tree.
+
+.. _developer mailing list: https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers
index 456d24e950641e334d5763942ceb8a7293d7b955..e68023e3d241a6d34e4f8a44f557d198b5ea75db 100644 (file)
@@ -24,6 +24,7 @@ The guide is currently split into a few main parts:
 .. toctree::
    :maxdepth: 2
 
+   contribute
    overview
    build-system
    relocatable-binaries
index 5bdb9f0b7af3d284d63194414f746c4a498ac701..b73ca0f1c4f0926b31d84acea7c820a3ab961a6b 100644 (file)
@@ -167,3 +167,45 @@ information from the source tree as part of this workflow.
 
 :file:`admin/builds/update-regtest-hash.py` has logic to update the
 regressiontests tarball MD5 sum for the released tarball automatically.
+
+Updating regressiontests data
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Sometimes we add new tests to the regressiontests repository. Also, as
+the source code or data files change, it is sometimes necessary to
+update regressiontests. This requires a particular CMake build type
+and both a single and double-precision build of |Gromacs| to generate
+all the data. Jenkins can automate much of the tedium here.
+
+* Upload a regressiontests change that lacks the relevant reference
+  data (either because you deleted the outdated data, or because the
+  test is new). Jenkins will do the normal thing, which we ignore.
+  There is now a Gerrit patch number for that change, symbolized here
+  with ``MMMM``.
+
+* Go to change ``MMMM`` on gerrit, select the patch set you want to
+  update with new reference data (usually the latest one), and comment
+
+    ``[JENKINS] Update``
+
+  to update against the HEAD of the matching source-code branch, or
+
+    ``[JENKINS] Cross-verify NNNN update``
+
+  to update from builds of |Gromacs| from the latest version of
+  Gerrit source-code patch ``NNNN``. You will need to do this when
+  functionality changes in ``NNNN`` affect either the layout of
+  the files in the reference data, or the results of the simulation,
+  or the results of the subsequent analysis.
+
+* Eventually, Jenkins will upload a new version of the regressiontests
+  patch to Gerrit, which will contain the updated regressiontest data.
+  That upload will again trigger Jenkins to do the normal pre-submit
+  verify, which will now pass (but perhaps will only pass under
+  cross-verify with patch ``NNNN``, as above).
+
+* Later, if you later need to verify an updated version of source-code
+  patch ``NNNN`` against the newly generated reference data, go to the
+  source-code patch ``NNNN`` and comment
+
+    ``[JENKINS] Cross-verify MMMM``
index ee4287389779afe7adddd2864267229e8c836114..c7251cce253ae8fefb1c88624da8d0b3cd4a8adc 100644 (file)
@@ -157,11 +157,8 @@ included at the root level.  All actual code is in subdirectories:
   parts of this code are included in the build.
   See :doc:`build-system` for some explanation about how the code in this
   directory is used.
-:file:`src/contrib/`
-  Contains collection of less well maintained code that may or may
-  not compile.  It is not included in the build.
-:file:`src/contrib/fftw/`
-  As an exception to the above, this folder contains the build system code for
+:file:`src/external/build-fftw/`
+  This folder contains the build system code for
   downloading and building FFTW to be included into :file:`libgromacs`.
 
 When compiling, the include search path is set to :file:`src/`.
index c37bc7907149e54d55d39b69af0ea007d1de2046..7722a03fa63f460a2fb53581e845eeaff2d93aec 100644 (file)
@@ -120,6 +120,8 @@ that are also used in ``src/gromacs/trajectoryanalysis/tests/``.
 These cases are handled using CMake object libraries that are linked to all the
 test binaries that need them.
 
+.. _gmx-make-new-tests:
+
 Getting started with new tests
 ------------------------------
 
index 9ee104760877b9ae23c0e69bd7e6d69555368cbe..3b04a4f03663b02c881852a83c166019abf580c4 100644 (file)
@@ -1,3 +1,5 @@
+.. _gmx-uncrustify:
+
 Automatic source code formatting
 ================================
 
index c2dead2df886392a98e7c5ae54566a7381a57eef..6ac1bcc76617bc855fd06c3932201e29dd0a14eb 100644 (file)
@@ -10,8 +10,7 @@ FILE_PATTERNS          = *.c *.cpp *.h *.md
 # FILE_PATTERNS         += *.cu *.cuh
 EXAMPLE_PATH           = @CMAKE_SOURCE_DIR@
 RECURSIVE              = YES
-EXCLUDE                = @CMAKE_SOURCE_DIR@/src/contrib \
-                         @CMAKE_SOURCE_DIR@/src/external \
+EXCLUDE                = @CMAKE_SOURCE_DIR@/src/external \
                          @CMAKE_SOURCE_DIR@/src/gromacs/linearalgebra/gmx_blas \
                          @CMAKE_SOURCE_DIR@/src/gromacs/linearalgebra/gmx_lapack \
                          @CMAKE_SOURCE_DIR@/src/gromacs/selection/parser.cpp \
index 6fe496f0c7ba90b0da0dc0238a55917570949d85..b9f9be7c76181c1311866163b1510fa86762a873 100644 (file)
@@ -766,8 +766,6 @@ class GromacsTree(object):
         relpath = self._get_rel_path(rootpath)
         self._dirs[relpath] = Directory(rootpath, relpath, None)
         for dirpath, dirnames, filenames in os.walk(rootpath):
-            if 'contrib' in dirnames:
-                dirnames.remove('contrib')
             if 'refdata' in dirnames:
                 dirnames.remove('refdata')
             currentdir = self._dirs[self._get_rel_path(dirpath)]
index b79ba68e1b4b28d3a6318257060ff1c395ba62ae..cbdbf3bd9ad294d1ff0116fc014de9f1c45e89aa 100644 (file)
@@ -73,11 +73,6 @@ Just to give a few examples:
   values, and it could get very complex for higher-level code if all these
   decisions were exposed. Instead, we want to keep integers 32-bit since
   all algorithms anyway need to work in single precision (w. 32-bit ints).
-- IBM QPX uses 4-wide SIMD both for single and double precision. Integer
-  support is highly limited, and the storage format means QPX does not
-  use x86-style all-ones masks (which have different widths in single/double)
-  but it uses the sign bit to denote the _false_ value. In particular, this
-  means we cannot use the bit contents for any fancy mask operations.
 - AVX1 only supports 4-wide 128-bit integer SIMD arithmetics, but the integer
   _conversions_ can still be done 8-wide which corresponds to the single
   precision floating-point width. Similarly, with AVX1 conversions between
@@ -90,9 +85,6 @@ Just to give a few examples:
   to integers they will be put in the first two elements of a 4-wide integer
   type. This means we cannot assume that floating-point SIMD registers and
   corresponding integer registers (after conversion) have the same width.
-- The 2-wide SIMD instructions on BlueGene/L and BlueGene/P cannot do any
-  floating-point logical operations (and/andnot/or/xor) whatsoever, which
-  can be a pain when implementing approximations for math functions.
 - Since boolean values can have different width for float/double and the
   integers corresponding to float/double, we need to use separate boolean
   types for all these values and convert between them if we e.g. want to use
index 3d1d8c38d949c7d19864c2df21c7af056c0ae7ad..fcbd059a428c2c96f71669226dd93f6c64e93069 100644 (file)
@@ -524,12 +524,11 @@ lead to performance loss, e.g. on Intel Skylake-X/SP and AMD Zen.
    Additionally, with GPU accelerated runs ``AVX2_256`` can also be
    faster on high-end Skylake CPUs with both 512-bit FMA units enabled.
 9. ``AVX_512_KNL`` Knights Landing Xeon Phi processors
-10. ``IBM_QPX`` BlueGene/Q A2 cores have this.
-11. ``Sparc64_HPC_ACE`` Fujitsu machines like the K computer have this.
-12. ``IBM_VMX`` Power6 and similar Altivec processors have this.
-13. ``IBM_VSX`` Power7, Power8 and later have this.
-14. ``ARM_NEON`` 32-bit ARMv7 with NEON support.
-15. ``ARM_NEON_ASIMD`` 64-bit ARMv8 and later.
+10. ``Sparc64_HPC_ACE`` Fujitsu machines like the K computer have this.
+11. ``IBM_VMX`` Power6 and similar Altivec processors have this.
+12. ``IBM_VSX`` Power7, Power8 and later have this.
+13. ``ARM_NEON`` 32-bit ARMv7 with NEON support.
+14. ``ARM_NEON_ASIMD`` 64-bit ARMv8 and later.
 
 The CMake configure system will check that the compiler you have
 chosen can target the architecture you have chosen. mdrun will check
@@ -707,7 +706,7 @@ platforms where we believe it has been tested repeatedly and found to work.
 In general, this includes Linux, Windows, Mac OS X and BSD systems.
 Static binaries take more space, but on some hardware and/or under
 some conditions they are necessary, most commonly when you are running a parallel
-simulation using MPI libraries (e.g. BlueGene, Cray).
+simulation using MPI libraries (e.g. Cray).
 
 * To link |Gromacs| binaries statically against the internal |Gromacs|
   libraries, set ``-DBUILD_SHARED_LIBS=OFF``.
@@ -775,7 +774,7 @@ is found, and otherwise fall back on a version of BLAS internal to
 accordingly. The internal versions are fine for normal use. If you
 need to specify a non-standard path to search, use
 ``-DCMAKE_PREFIX_PATH=/path/to/search``. If you need to specify a
-library with a non-standard name (e.g. ESSL on AIX or BlueGene), then
+library with a non-standard name (e.g. ESSL on Power machines), then
 set ``-DGMX_BLAS_USER=/path/to/reach/lib/libwhatever.a``.
 
 If you are using Intel MKL_ for FFT, then the BLAS and
@@ -1106,66 +1105,6 @@ Oracle Developer Studio is not a currently supported compiler (and
 does not currently compile |Gromacs| correctly, perhaps because the
 thread-MPI atomics are incorrectly implemented in |Gromacs|).
 
-Building on BlueGene
---------------------
-
-BlueGene/Q
-^^^^^^^^^^
-There is currently native acceleration on this platform for the Verlet
-cut-off scheme. There are no plans to provide accelerated kernels for
-the group cut-off scheme, but the default plain C kernels will work
-(slowly).
-
-Only the bgclang compiler is supported, because it is the only
-availble C++11 compiler. Only static linking is supported.
-
-Computation on BlueGene floating-point units is always done in
-double-precision. However, mixed-precision builds of |Gromacs| are still
-normal and encouraged since they use cache more efficiently.
-
-You need to arrange for FFTW to be installed correctly, following the
-above instructions. You may prefer to configure FFTW with
-``--disable-fortran`` to avoid complications.
-
-MPI wrapper compilers should be used for compiling and linking. The
-MPI wrapper compilers can make it awkward to
-attempt to use IBM's optimized BLAS/LAPACK called ESSL (see the
-section on `linear algebra libraries`_. Since mdrun is the only part
-of |Gromacs| that should normally run on the compute nodes, and there is
-nearly no need for linear algebra support for mdrun, it is recommended
-to use the |Gromacs| built-in linear algebra routines - this is never
-a problem for normal simulations.
-
-The recommended configuration is to use
-
-::
-
-    cmake .. -DCMAKE_C_COMPILER=mpicc \
-             -DCMAKE_CXX_COMPILER=mpicxx \
-             -DCMAKE_TOOLCHAIN_FILE=Platform/BlueGeneQ-static-bgclang-CXX.cmake \
-             -DCMAKE_PREFIX_PATH=/your/fftw/installation/prefix \
-             -DGMX_MPI=ON \
-             -DGMX_BUILD_MDRUN_ONLY=ON
-    make
-    make install
-
-which will build a statically-linked MPI-enabled mdrun for the compute
-nodes. Otherwise, |Gromacs| default configuration
-behaviour applies.
-
-It is possible to configure and make the remaining |Gromacs| tools with
-the compute-node toolchain, but as none of those tools are MPI-aware,
-this would not normally
-be useful. Instead, users should plan to run these on the login node,
-and perform a separate |Gromacs| installation for that, using the login
-node's toolchain - not the above platform file, or any other
-compute-node toolchain. This may require requesting an up-to-date
-gcc or clang toolchain for the front end.
-
-Note that only the MPI build is available for the compute-node
-toolchains. The |Gromacs| thread-MPI or no-MPI builds are not useful at
-all on BlueGene/Q.
-
 Fujitsu PRIMEHPC
 ^^^^^^^^^^^^^^^^
 This is the architecture of the K computer, which uses Fujitsu
@@ -1239,6 +1178,6 @@ For details, you can
 have a look at the `continuous integration server used by GROMACS`_,
 which runs Jenkins_.
 
-We test irregularly on ARM v7, ARM v8, BlueGene/Q, Cray, Fujitsu
+We test irregularly on ARM v7, ARM v8, Cray, Fujitsu
 PRIMEHPC, Power8, Google Native Client and other environments, and
 with other compilers and compiler versions, too.
index 514ae907c047f531acd39d8ba9a42dba9d3f16a3..be04de79c9b588edb69ed3bff2b62cf7bd185420 100644 (file)
@@ -3051,74 +3051,6 @@ and separate PME-mesh ranks.
 \end{figure}
 
 
-\section{Implicit solvation\index{implicit solvation}\index{Generalized Born methods}}
-\label{sec:gbsa}
-Implicit solvent models provide an efficient way of representing 
-the electrostatic effects of solvent molecules, while saving a 
-large piece of the computations involved in an accurate, aqueous 
-description of the surrounding water in molecular dynamics simulations. 
-Implicit solvation models offer several advantages compared with 
-explicit solvation, including eliminating the need for the equilibration of water 
-around the solute, and the absence of viscosity, which allows the protein 
-to more quickly explore conformational space.
-
-Implicit solvent calculations in {\gromacs} can be done using the 
-generalized Born-formalism, and the Still~\cite{Still97}, HCT~\cite{Truhlar96}, 
-and OBC~\cite{Case04} models are available for calculating the Born radii.
-
-Here, the free energy $G_{\mathrm{solv}}$ of solvation is the sum of three terms,
-a solvent-solvent cavity term ($G_{\mathrm{cav}}$), a solute-solvent van der
-Waals term ($G_{\mathrm{vdw}}$), and finally a solvent-solute electrostatics
-polarization term ($G_{\mathrm{pol}}$).
-
-The sum of $G_{\mathrm{cav}}$ and $G_{\mathrm{vdw}}$ corresponds to the (non-polar)
-free energy of solvation for a molecule from which all charges
-have been removed, and is commonly called $G_{\mathrm{np}}$,
-calculated from the total solvent accessible surface area 
-multiplied with a surface tension. 
-The total expression for the solvation free energy then becomes:
-
-\beq
-G_{\mathrm{solv}} = G_{\mathrm{np}}  + G_{\mathrm{pol}}
-\label{eqn:gb_solv}
-\eeq
-
-Under the generalized Born model, $G_{\mathrm{pol}}$ is calculated from the generalized Born equation~\cite{Still97}:
-
-\beq
-G_{\mathrm{pol}} = \left(1-\frac{1}{\epsilon}\right) \sum_{i=1}^n \sum_{j>i}^n \frac {q_i q_j}{\sqrt{r^2_{ij} + b_i b_j \exp\left(\frac{-r^2_{ij}}{4 b_i b_j}\right)}}
-\label{eqn:gb_still}
-\eeq
-
-In {\gromacs}, we have introduced the substitution~\cite{Larsson10}:
-
-\beq
-c_i=\frac{1}{\sqrt{b_i}}
-\label{eqn:gb_subst}
-\eeq
-
-which makes it possible to introduce a cheap transformation to a new 
-variable $x$ when evaluating each interaction, such that:
-
-\beq
-x=\frac{r_{ij}}{\sqrt{b_i b_j }} = r_{ij} c_i c_j
-\label{eqn:gb_subst2}
-\eeq
-
-In the end, the full re-formulation of~\ref{eqn:gb_still} becomes:
-\beq
-G_{\mathrm{pol}} = \left(1-\frac{1}{\epsilon}\right) \sum_{i=1}^n \sum_{j>i}^n \frac{q_i q_j}{\sqrt{b_i  b_j}} ~\xi (x) = \left(1-\frac{1}{\epsilon}\right) \sum_{i=1}^n q_i c_i \sum_{j>i}^n q_j c_j~\xi (x)
-\label{eqn:gb_final}
-\eeq 
-
-The non-polar part ($G_{\mathrm{np}}$) of Equation~\ref{eqn:gb_solv} is calculated 
-directly from the Born radius of each atom using a simple ACE type 
-approximation by Schaefer {\em et al.}~\cite{Karplus98}, including a 
-simple loop over all atoms. 
-This requires only one extra solvation parameter, independent of atom type, 
-but differing slightly between the three Born radii models.
-
 % LocalWords:  GROningen MAchine BIOSON Groningen GROMACS Berendsen der Spoel
 % LocalWords:  Drunen Comp Phys Comm ROck NS FFT pbc EM ifthenelse gmxlite ff
 % LocalWords:  octahedra triclinic Ewald PME PPPM trjconv xy solvated
index f50da64e64a21cd5a34c936b76221430f4905fce..0445b73d7432efc9aa23e022e7511d4df4906190 100644 (file)
@@ -2891,7 +2891,7 @@ of the blocks. {\bf Note} that all {\gromacs} programs can read compressed
 \subsection{CHARMM\index{CHARMM force field}}
 \label{subsec:charmmff}
 
-{\gromacs} supports the CHARMM force field for proteins~\cite{mackerell04, mackerell98}, lipids~\cite{feller00} and nucleic acids~\cite{foloppe00,Mac2000}. The protein parameters (and to some extent the lipid and nucleic acid parameters) were thoroughly tested -- both by comparing potential energies between the port and the standard parameter set in the CHARMM molecular simulation package, as well by how the protein force field behaves together with {\gromacs}-specific techniques such as virtual sites (enabling long time steps) and a fast implicit solvent recently implemented~\cite{Larsson10} -- and the details and results are presented in the paper by Bjelkmar et al.~\cite{Bjelkmar10}. The nucleic acid parameters, as well as the ones for HEME, were converted and tested by Michel Cuendet.
+{\gromacs} supports the CHARMM force field for proteins~\cite{mackerell04, mackerell98}, lipids~\cite{feller00} and nucleic acids~\cite{foloppe00,Mac2000}. The protein parameters (and to some extent the lipid and nucleic acid parameters) were thoroughly tested -- both by comparing potential energies between the port and the standard parameter set in the CHARMM molecular simulation package, as well by how the protein force field behaves together with {\gromacs}-specific techniques such as virtual sites (enabling long time steps) recently implemented~\cite{Larsson10} -- and the details and results are presented in the paper by Bjelkmar et al.~\cite{Bjelkmar10}. The nucleic acid parameters, as well as the ones for HEME, were converted and tested by Michel Cuendet.
 
 When selecting the CHARMM force field in {\tt \normindex{pdb2gmx}} the default option is to use \normindex{CMAP} (for torsional correction map). To exclude CMAP, use {\tt -nocmap}. The basic form of the CMAP term implemented in {\gromacs} is a function of the $\phi$ and $\psi$ backbone torsion angles. This term is defined in the {\tt .rtp} file by a {\tt [ cmap ]} statement at the end of each residue supporting CMAP. The following five atom names define the two torsional angles. Atoms 1-4 define $\phi$, and atoms 2-5 define $\psi$. The corresponding atom types are then matched to the correct CMAP type in the {\tt cmap.itp} file that contains the correction maps.
 
index 9336933c400ec67f71e522edd07ff2031e786a74..bfd0393b5a7fe43f8103ee145a34fcac3d0e3fc6 100644 (file)
@@ -557,37 +557,6 @@ to be excluded, is it more convenient and much more efficient to use
 energy monitor group exclusions (see \secref{groupconcept}).
 
 
-\section{Implicit solvation parameters\index{implicit solvation parameters}}
-Starting with {\gromacs} 4.5, implicit solvent is supported. A section in the
-topology has been introduced to list those parameters:
-
-{\small
-\begin{verbatim}
-[ implicit_genborn_params ]
-; Atomtype  sar     st   pi      gbr      hct
-NH1         0.155   1    1.028   0.17063  0.79 ; N
-N           0.155   1    1       0.155    0.79 ; Proline backbone N
-H           0.1     1    1       0.115    0.85 ; H
-CT1         0.180   1    1.276   0.190    0.72 ; C
-\end{verbatim}}
-
-In this example the atom type is listed first, followed by five
-numbers, and a comment (following a semicolon).
-
-Values in columns 1-3 are not currently used. They pertain to more
-elaborate surface area algorithms, the one from Qiu {\em et al.}~\cite{Still97} in
-particular.  Column 4 contains the atomic van der Waals radii, which are used
-in computing the Born radii. The dielectric offset is specified in
-the {\tt *.mdp} file, and gets subtracted from the input van der Waals radii for the different
-Born radii methods, as described by Onufriev {\em et al.}~\cite{Case04}.  Column 5 is the 
-scale factor for the HCT and OBC models. The values are taken from the Tinker implementation of 
-the HCT pairwise scaling method~\cite{Truhlar96}.  This method has been modified such that the
-scaling factors have been adjusted to minimize differences between analytical surface areas and
-GB using the HCT algorithm.  The scaling is further modified in that it is not applied pairwise
-as proposed by Hawkins {\em et al.}~\cite{Truhlar96}, but on a per-atom (rather than a per-pair) 
-basis.
-
-
 \section{Constraint algorithms\index{constraint algorithms}}
 \label{sec:constraints}
 Constraints are defined in the {\tt [~constraints~]} section.
@@ -1463,7 +1432,6 @@ its content. That content can be seen in
 
 #include "ffnonbonded.itp"
 #include "ffbonded.itp"
-#include "gbsa.itp"
 \end{verbatim}}
 
 The two {\tt \#define} statements set up the conditions so that
index 5253b8fcc0c5026e44a659bf67e82da92c3feb0b..e78c35d251a6d9991d1ae1e8cfdd7a0a2429112f 100644 (file)
@@ -57,7 +57,6 @@ force-switch interactions             yes          yes
 switched potential                    yes          yes
 switched forces                       yes          yes
 non-periodic systems                  yes          Z + walls
-implicit solvent                      yes          no
 free energy perturbed non-bondeds     yes          yes
 energy group contributions            yes          only on CPU
 energy group exclusions               yes          no
index ea2da838e12396d4740c9605ab2d8bf79018a6b8..1210d0c91dd7240082bd09e58917e3ed4f6997d8 100644 (file)
@@ -41,6 +41,8 @@ Topology files
     residue topology (ascii)
 :ref:`ndx`
     index file
+:ref:`n2t`
+    atom naming definition (ascii)
 
 Run Input files
 ---------------
@@ -512,6 +514,39 @@ The second group **Hydrogen** has 6 elements.
 An index file generation tool is available:
 :ref:`gmx make_ndx`.
 
+.. _n2t:
+
+n2t
+---
+
+This |Gromacs| file can be used to perform primitive translations between
+atom names found in structure files and the corresponding atom types.
+This is mostly useful for using utilities such as :ref:`gmx x2top`, but users
+should be aware that the knowledge in this file is extremely limited.
+
+An example file (``share/top/gromos53a5.ff/atomname2type.n2t``) is here:
+
+::
+
+    H       H    0.408  1.008  1  O     0.1
+    O       OA  -0.674 15.9994 2  C     0.14 H 0.1               
+    C       CH3  0.000 15.035  1  C     0.15         
+    C       CH0  0.266 12.011  4  C     0.15 C 0.15     C 0.15     O 0.14
+
+A short description of the file format follows:
+
+* Column 1: Elemental symbol of the atom/first character in the atom name.
+* Column 2: The atom type to be assigned.
+* Column 3: The charge to be assigned.
+* Column 4: The mass of the atom.
+* Column 5: The number N of other atoms to which this atom is bonded.
+  The number of fields that follow are related to this number;
+  for each atom, an elemental symbol and the reference distance for its bond length.
+* Columns 6-onward: The elemental symbols and reference bond lengths for N connections
+  (column 5) to the atom being assigned parameters (column 1). The reference bond
+  lengths have a tolerance of +/- 10% from the value specified in this file. Any bond
+  outside this tolerance will not be recognized as being connected to the atom being assigned parameters.
+
 .. _out:
 
 out
index 66d210a56d2eccf688cba7f2241f9e1266b6df19..318dc4196b5c9e8131358fc4a9e65116e8561f16 100644 (file)
@@ -2237,12 +2237,11 @@ NMR refinement
 
       distance restraints over an ensemble of molecules in one
       simulation box. Normally, one would perform ensemble averaging
-      over multiple subsystems, each in a separate box, using ``mdrun
-      -multi``. Supply ``topol0.tpr``, ``topol1.tpr``, ... with
-      different coordinates and/or velocities. The environment
+      over multiple simulations, using ``mdrun
+      -multidir``. The environment
       variable ``GMX_DISRE_ENSEMBLE_SIZE`` sets the number of systems
-      within each ensemble (usually equal to the ``mdrun -multi``
-      value).
+      within each ensemble (usually equal to the number of directories
+      supplied to ``mdrun -multidir``).
 
 .. mdp:: disre-weighting
 
@@ -2301,7 +2300,7 @@ NMR refinement
    .. mdp-value:: yes
 
       use orientation restraints, ensemble averaging can be performed
-      with `mdrun -multi`
+      with ``mdrun -multidir``
 
 .. mdp:: orire-fc
 
@@ -3102,100 +3101,6 @@ Mixed quantum/classical molecular dynamics
       CASSCF method.
 
 
-Implicit solvent
-^^^^^^^^^^^^^^^^
-
-.. mdp:: implicit-solvent
-
-   .. mdp-value:: no
-
-      No implicit solvent
-
-   .. mdp-value:: GBSA
-
-      Do a simulation with implicit solvent using the Generalized Born
-      formalism. Three different methods for calculating the Born
-      radii are available, Still, HCT and OBC. These are specified
-      with the :mdp:`gb-algorithm` field. The non-polar solvation is
-      specified with the :mdp:`sa-algorithm` field.
-
-.. mdp:: gb-algorithm
-
-   .. mdp-value:: Still
-
-      Use the Still method to calculate the Born radii
-
-   .. mdp-value:: HCT
-
-      Use the Hawkins-Cramer-Truhlar method to calculate the Born
-      radii
-
-   .. mdp-value:: OBC
-
-      Use the Onufriev-Bashford-Case method to calculate the Born
-      radii
-
-.. mdp:: nstgbradii
-
-   (1) \[steps\]
-   Frequency to (re)-calculate the Born radii. For most practial
-   purposes, setting a value larger than 1 violates energy
-   conservation and leads to unstable trajectories.
-
-.. mdp:: rgbradii
-
-   (1.0) \[nm\]
-   Cut-off for the calculation of the Born radii. Currently must be
-   equal to rlist
-
-.. mdp:: gb-epsilon-solvent
-
-   (80)
-   Dielectric constant for the implicit solvent
-
-.. mdp:: gb-saltconc
-
-   (0) \[M\]
-   Salt concentration for implicit solvent models, currently not used
-
-.. mdp:: gb-obc-alpha
-.. mdp:: gb-obc-beta
-.. mdp:: gb-obc-gamma
-
-   Scale factors for the OBC model. Default values of 1, 0.78 and 4.85
-   respectively are for OBC(II). Values for OBC(I) are 0.8, 0 and 2.91
-   respectively
-
-.. mdp:: gb-dielectric-offset
-
-   (0.009) \[nm\]
-   Distance for the di-electric offset when calculating the Born
-   radii. This is the offset between the center of each atom the
-   center of the polarization energy for the corresponding atom
-
-.. mdp:: sa-algorithm
-
-   .. mdp-value:: Ace-approximation
-
-      Use an Ace-type approximation
-
-   .. mdp-value:: None
-
-      No non-polar solvation calculation done. For GBSA only the polar
-      part gets calculated
-
-.. mdp:: sa-surface-tension
-
-   \[kJ mol-1 nm-2\]
-   Default value for surface tension with SA algorithms. The default
-   value is -1; Note that if this default value is not changed it will
-   be overridden by :ref:`gmx grompp` using values that are specific
-   for the choice of radii algorithm (0.0049 kcal/mol/Angstrom^2 for
-   Still, 0.0054 kcal/mol/Angstrom2 for HCT/OBC) Setting it to 0 will
-   while using an sa-algorithm other than None means no non-polar
-   calculations are done.
-
-
 Computational Electrophysiology
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 Use these options to switch on and control ion/water position exchanges in "Computational
@@ -3344,7 +3249,7 @@ User defined thingies
 Removed features
 ^^^^^^^^^^^^^^^^
 
-This feature has been removed from |Gromacs|, but so that old
+These features have been removed from |Gromacs|, but so that old
 :ref:`mdp` and :ref:`tpr` files cannot be mistakenly misused, we still
 parse this option. :ref:`gmx grompp` and :ref:`gmx mdrun` will issue a
 fatal error if this is set.
@@ -3353,4 +3258,8 @@ fatal error if this is set.
 
    (no)
 
+.. mdp:: implicit-solvent
+
+   (no)
+
 .. _reference manual: gmx-manual-parent-dir_
index f4456d5818380c2634a8d9bf3ce434ba3bb568b7..d21eb827ab63f488e86703caa2f92d803df828ab 100644 (file)
@@ -71,24 +71,9 @@ including ``-deffnm``.
    most convenient to use. ``gmx mdrun -table`` for the group cutoff-scheme
    works only in this mode.
 
-``-multi``
-   You must organize that the filenames for each simulation in a set of
-   ``n`` simulations have an integer ``0`` through ``n-1`` appended to
-   the filename (e.g. ``topol2.tpr``), and run with
-   ``mpirun -np x gmx mdrun -multi n -s input``. The order of simulations
-   within the set is determined by the integer appended.
-
 Examples running multi-simulations
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-::
-
-    mpirun -np 32 gmx_mpi mdrun -multi
-
-Starts a multi-simulation on 32 ranks with as many simulations ``n`` as
-there are files named ``topol*.tpr`` for integers ``0`` to ``n-1``. Other
-input and output files are suffixed similarly.
-
 ::
 
     mpirun -np 32 gmx_mpi mdrun -multidir a b c d
@@ -113,7 +98,7 @@ Running replica-exchange simulations
 
 When running a multi-simulation, using ``gmx mdrun -replex n`` means that a
 replica exchange is attempted every given number of steps. The number
-of replicas is set with the ``-multi`` or ``-multidir`` option, described
+of replicas is set with ``-multidir`` option, described
 above.  All run input files should use a different value for the
 coupling parameter (e.g. temperature), which ascends over the set of
 input files. The random seed for replica exchange is set with
index f460f6f4d6967caca20432a402a30883d7b25237..859fc5f0680d338442ee9ddaf5d577912ea3d383 100644 (file)
@@ -577,7 +577,6 @@ The performance counters are:
 * Neighbor search
 * Launch GPU operations
 * Communication of coordinates
-* Born radii
 * Force
 * Waiting + Communication of force
 * Particle mesh Ewald
index e5ad730331c05cc44527e9d63a2fbd2ee44a8495..29eae4f5ef586a9646973923ceece914d0f9d06e 100644 (file)
@@ -333,7 +333,7 @@ when addressing such a scenario:
    to a breakdown in the model physics, even if the starting configuration of
    the system is reasonable.
 
-If using implicit solvation, starting your equilibration with a smaller time
+When using no explict solvent, starting your equilibration with a smaller time
 step than your production run can help energy equipartition more stably.
 
 There are several common situations in which instability frequently arises,
index b0e28a04b1a9cb936dd1bc74a58e1e11bc327326..647459d1dec1cb9c88ee5f496c01626ee5289053 100755 (executable)
@@ -1,5 +1,6 @@
 #!/usr/bin/perl -w
 
+use strict;
 #
 # This script reads an XPLOR input file with distance restraint data
 # as sometimes is found in the pdb database (http://www.pdb.org).
 #
 
 # Turn debugging off (0), or on ( > 0).
-$debug = 1;
+my $debug = 1;
 # Turn atom name translation on and off
-$trans = 1;
+my $trans = 1;
 
-#$res0  = shift;# || die "I need the residue offset\n";
-$pdb   = shift || die "I need the name of the pdb file with correct atom numbers\n";
-$core  = shift || "core.ndx";
-$tbl   = "$ENV{GMXDATA}/top/atom_nom.tbl";
+my $pdb   = shift || die "I need the name of the pdb file with correct atom numbers\n";
+my $core  = shift || "core.ndx";
+my $tbl   = "$ENV{GMXDATA}/top/atom_nom.tbl";
 
 printf "[ distance_restraints ]\n";
 printf "; Read an xplor distance restraint file, and output GROMACS distance restraints.\n";
 printf "; This also needs a pdb file with correct GROMACS atom numbering.\n";
 printf "; I used $pdb for the atom numbers\n";
 printf "; This also needs the offset in residues.\n";
-#printf "; I used $res0 for the residue offset\n";
 
 # Read the pdb file
 # If things go wrong, check whether your pdb file is read correctly.
-$natom = 0;
-$nres  = 0;
-@resname = ();
+my $natom = 0;
+my $nres  = 0;
+my @resname;
+my @aname;
+my @resnr;
 open(PDB,$pdb) || die "Can not open file $pdb\n";
-while ($line = <PDB>) {
+while (my $line = <PDB>) {
     if (index($line,"ATOM") >= 0) {
-       @tmp = split(' ',$line);
+       my @tmp = split(' ',$line);
        $aname[$natom] = $tmp[2];
        $resnr[$natom] = $tmp[4];
        if (!defined $resname[$tmp[4]]) {
@@ -52,7 +53,7 @@ close PDB;
 printf "; I found $natom atoms in the pdb file $pdb\n";
 printf "; I found $nres residues in the pdb file $pdb\n";
 if ($debug > 1) {
-    for ($i = 0; ($i < $natom); $i ++) {
+    for (my $i = 0; ($i < $natom); $i ++) {
        printf("; %5d  %5s  %5s  %5d\n",$i+1,$aname[$i],
               $resname[$resnr[$i]],$resnr[$i]);
     }
@@ -65,10 +66,13 @@ if ($debug > 1) {
 # not for content
 #
 open(TBL,$tbl) || die "Can not open atom-name translation table $tbl\n";
-$ntbl=0;
-while ($line = <TBL>) {
-    @ttt = split('#',$line);
-    @tmp = split(' ',$ttt[0]);
+my $ntbl=0;
+my @tblxplor;
+my @tblgmx;
+my @tblres;
+while (my $line = <TBL>) {
+    my @ttt = split('#',$line);
+    my @tmp = split(' ',$ttt[0]);
     if ($#tmp == 3) {
        # New table entry
        $tblres[$ntbl] = $tmp[0];
@@ -80,34 +84,39 @@ while ($line = <TBL>) {
 close TBL;
 printf "; Read $ntbl entries from $tbl\n";
 
-@templates = (
- [ "HA#", "HA1", "HA2" ],
- [ "HA*", "HA1", "HA2" ],
- [ "HB#",  "HB",         "HB1",        "HB2"   ],
- [ "HB*",  "HB",         "HB1",        "HB2"   ],
- [ "HG#",  "HG",         "HG1",        "HG2",  "HG11", "HG12", "HG13", "HG21", "HG22", "HG23"  ],
- [ "HG*",  "HG",         "HG1",        "HG2",  "HG11", "HG12", "HG13", "HG21", "HG22", "HG23"  ],
- [ "HG1#", "HG11",     "HG12", "HG13"  ],
- [ "HG1*", "HG11",     "HG12", "HG13"  ],
- [ "HG2#", "HG21",     "HG22", "HG23"  ],
- [ "HG2*", "HG21",     "HG22", "HG23"  ],
- [ "HD#",  "HD1",      "HD2",  "HD11", "HD12", "HD13", "HD21", "HD22", "HD23" ],
- [ "HD*",  "HD1",      "HD2",  "HD11", "HD12", "HD13", "HD21", "HD22", "HD23" ],
- [ "HD1#", "HD11",     "HD12"  ],
- [ "HD1*", "HD11",     "HD12"  ],
- [ "HD2#", "HD21",     "HD22"  ],
- [ "HD2*", "HD21",     "HD22"  ],
- [ "HE#",  "HE",        "HE1", "HE2"   ],
- [ "HE*",  "HE",        "HE1", "HE2"   ],
- [ "HH#",  "HH11",     "HH12", "HH21", "HH22" ],
- [ "HH*",  "HH11",     "HH12", "HH21", "HH22" ],
- [ "HZ#",  "HZ",         "HZ1",        "HZ2",  "HZ3"   ],
- [ "HZ*",  "HZ",         "HZ1",        "HZ2",  "HZ3"   ],
- [ "HN",   "H" ]
+my $default = "XXX";
+
+my @templates = (
+ [ $default, "HA#", "HA1", "HA2" ],
+ [ $default, "HA*", "HA1", "HA2" ],
+ [ $default, "HB#",  "HB",         "HB1",      "HB2"   ],
+ [ $default, "HB*",  "HB",         "HB1",      "HB2"   ],
+ [ $default, "HG#",  "HG",         "HG1",      "HG2",  "HG11", "HG12", "HG13", "HG21", "HG22", "HG23"  ],
+ [ $default, "HG*",  "HG",         "HG1",      "HG2",  "HG11", "HG12", "HG13", "HG21", "HG22", "HG23"  ],
+ [ $default, "HG1#", "HG11",   "HG12", "HG13"  ],
+ [ $default, "HG1*", "HG11",   "HG12", "HG13"  ],
+ [ $default, "HG2#", "HG21",   "HG22", "HG23"  ],
+ [ $default, "HG2*", "HG21",   "HG22", "HG23"  ],
+ [ $default, "HD#",  "HD1",    "HD2",  "HD11", "HD12", "HD13", "HD21", "HD22", "HD23" ],
+ [ $default, "HD*",  "HD1",    "HD2",  "HD11", "HD12", "HD13", "HD21", "HD22", "HD23" ],
+ [ $default, "HD1#", "HD11",   "HD12"  ],
+ [ "ILE",    "HD1*", "HD1",    "HD2",   "HD3"  ],
+ [ $default, "HD1*", "HD11",   "HD12"  ],
+ [ $default, "HD2#", "HD21",   "HD22"  ],
+ [ $default, "HD2*", "HD21",   "HD22"  ],
+ [ $default, "HE#",  "HE",      "HE1", "HE2"   ],
+ [ "GLN",    "HE*",  "HE21",   "HE22"  ],
+ [ $default, "HE*",  "HE",        "HE1",       "HE2"   ],
+ [ $default, "HE2*", "HE2",       "HE21",      "HE22"  ],
+ [ $default, "HH#",  "HH11",   "HH12", "HH21", "HH22" ],
+ [ $default, "HH*",  "HH11",   "HH12", "HH21", "HH22" ],
+ [ $default, "HZ#",  "HZ",         "HZ1",      "HZ2",  "HZ3"   ],
+ [ $default, "HZ*",  "HZ",         "HZ1",      "HZ2",  "HZ3"   ],
+ [ $default, "HN",   "H" ]
 );
 
-$ntranslated = 0;
-$nuntransltd = 0;
+my $ntranslated = 0;
+my $nuntransltd = 0;
 sub transl_aname {
     my $resnm  = shift;
     my $atom   = shift;
@@ -124,7 +133,7 @@ sub transl_aname {
     }
     $nuntransltd++;
     if ($debug > 1) {
-       printf "; No name change for $resname[$resnr] $atom\n";
+       printf "; No name change for $resnm $atom\n";
     }
     return $atom;
 }
@@ -138,9 +147,11 @@ sub expand_template {
    
     die("No residue name for residue $rnum") if (!defined ($resname[$rnum]));
     for (my $tt=0; (($tt <= $#templates) && ($bdone == 0)); $tt++) {
-       $templ = $templates[$tt];
-       if ($atom eq $templ->[0]) {
-           for ($jj = 1; ($jj <= $#{$templ}); $jj++) {
+       my $templ = $templates[$tt];
+        if (($resname[$rnum] eq $templ->[0] ||
+             $default eq $templ->[0]) &&
+            ($atom eq $templ->[1])) {
+           for ($jj = 2; ($jj <= $#{$templ}); $jj++) {
                push @atoms, transl_aname($resname[$rnum],$templ->[$jj]);
            }
            $bdone  = 1;
@@ -152,8 +163,8 @@ sub expand_template {
     if ($debug > 0) {
        my $natom = $#atoms+1;
        printf("; Found $natom elements for atom $resname[$rnum] %d $atom:",
-              $rnum+1);
-       for $aa ( @atoms ) {
+              $rnum);
+       for my $aa ( @atoms ) {
            printf " $aa";
        }
        printf "\n";
@@ -163,82 +174,87 @@ sub expand_template {
 
 if ($debug > 1) {
     printf "; There are $#templates template entries\n";
-    for ($tt=0; ($tt <= $#templates); $tt++) {
-       $templ  = $templates[$tt];
-       $ntempl = $#{$templ};
-       printf "; Item $tt ($templates[$tt][0]) has $ntempl entries\n";
+    for (my $tt=0; ($tt <= $#templates); $tt++) {
+       my $templ  = $templates[$tt];
+        my $ntempl = $#{$templ};
+       printf "; Item $tt ($templates[$tt][0] $templates[$tt][1]) has $ntempl entries\n";
     }
 }
 
 # This index file holds numbers of restraints involving core atoms
-@protcore = ( "H", "HN", "HA", "HA1", "HA2", "HB", "HB1", "HB2", "HB3", "HG", "HG1", "HG2", "HG3", "N", "O"  );
+my @protcore = ( "H", "HN", "HA", "HA1", "HA2", "HB", "HB1", "HB2", "HB3", "HG", "HG1", "HG2", "HG3", "N", "O"  );
 open(CORE,">$core") || die "Can not open $core\n";
 print CORE "[ core-restraints ]\n";
-$ncore = 0;
+my $ncore = 0;
 
-$myindex     = 0;
-$linec       = 0;
-$npair       = 0;
-$nunresolved = 0;
-while ($line = <STDIN>) {
-    @ttt = split('!',$line);
-    if ((index($ttt[0],"assign") >= 0) && (index($ttt[0],"!assign") < 0)) {
-       @tmp = split('\(',$ttt[0]);
+my $myindex     = 0;
+my $linec       = 0;
+my $npair       = 0;
+my $nunresolved = 0;
+while (my $line = <STDIN>) {
+    my @ttt = split('!',$line);
+    if (index($ttt[0], "dihedral") >= 0) {
+        last;
+    }
+    elsif ((index($ttt[0],"assign") >= 0) && (index($ttt[0],"!assign") < 0)) {
+       my @tmp = split('\(',$ttt[0]);
        # Find first argument
+        my $rhaak = undef;
        if (($rhaak  = index($tmp[1],')')) < 0) {
            printf "No ) in '$tmp[1]'\n";
        }
-       $atres1 = substr($tmp[1],0,$rhaak);
-       @at1 = split('or',$atres1);
+       my $atres1 = substr($tmp[1],0,$rhaak);
+       my @at1 = split('or',$atres1);
        
        # Find second argument
        if (($rhaak  = index($tmp[2],')')) < 0) {
            printf "No ) in '$tmp[2]'\n";
        }
-       $atres2 = substr($tmp[2],0,$rhaak);
-       @at2 = split('or',$atres2);
+       my $atres2 = substr($tmp[2],0,$rhaak);
+       my @at2 = split('or',$atres2);
 
-       @expdata = split('\)',$tmp[2]);
-       @dist    = split(' ',$expdata[1]);
+       my @expdata = split('\)',$tmp[2]);
+       my @dist    = split(' ',$expdata[1]);
 
-       $bOK   = 0;
-       $bCore = 1;
-       foreach $a1 ( @at1 ) {
-           @info1  = split(' ',$a1);
-           $r1     = $info1[1];
-           @atoms1 = expand_template($info1[4],$r1);
+       my $bOK   = 0;
+       my $bCore = 1;
+       foreach my $a1 ( @at1 ) {
+           my @info1  = split(' ',$a1);
+           my $r1     = $info1[1];
+           my @atoms1 = expand_template($info1[4],$r1);
 
-           foreach $a2 ( @at2 ) {
-               @info2  = split(' ',$a2);
-               $r2     = $info2[1];
-               @atoms2 = expand_template($info2[4],$r2);
+           foreach my $a2 ( @at2 ) {
+               my @info2  = split(' ',$a2);
+               my $r2     = $info2[1];
+               my @atoms2 = expand_template($info2[4],$r2);
 
+                my $i = undef;
                for ($i = 0; ($i < $natom) && ($resnr[$i] < $r1); $i++) { ; }
                for ( ; ($i < $natom) && ($resnr[$i] == $r1); $i++) { 
-                   foreach $ii ( @atoms1 ) {
+                   foreach my $ii ( @atoms1 ) {
                        if ($ii eq $aname[$i]) {
-                           $bCoreI = 0;
-                           for $pp ( @protcore ) {
+                           my $bCoreI = 0;
+                           for my $pp ( @protcore ) {
                                if ($ii eq $pp) {
                                    $bCoreI = 1;
                                }
                            }
-                                       
+                            my $j = undef;
                            for ($j = 0; ($j < $natom) && ($resnr[$j] < $r2); $j++) { ; }
                            for ( ; ($j < $natom) && ($resnr[$j] == $r2); $j++) { 
-                               foreach $jj ( @atoms2 ) {
+                               foreach my $jj ( @atoms2 ) {
                                    if ($jj eq $aname[$j]) {
-                                       $dd     = 0.1*$dist[0];
-                                       $dminus = 0.1*$dist[1];
-                                       $dplus  = 0.1*$dist[2];
-                                       $low    = $dd-$dminus;
-                                       $up1    = $dd+$dplus;
-                                       $up2    = $up1+1;
+                                       my $dd     = 0.1*$dist[0];
+                                       my $dminus = 0.1*$dist[1];
+                                       my $dplus  = 0.1*$dist[2];
+                                       my $low    = $dd-$dminus;
+                                       my $up1    = $dd+$dplus;
+                                       my $up2    = $up1+1;
                                        printf("%5d %5d %5d %5d %5d %7.3f %7.3f %7.3f 1.0; res $r1 $ii - res $r2 $jj\n",$i+1,$j+1,1,$myindex,1,$low,$up1,$up2);
                                        # Do some checks
                                        $bOK    = 1;
-                                       $bCoreJ = 0;
-                                       for $pp ( @protcore ) {
+                                       my $bCoreJ = 0;
+                                       for my $pp ( @protcore ) {
                                            if ($jj eq $pp) {
                                                $bCoreJ = 1;
                                            }
index 81ed483b3360ed3557d3b6fad4e1a3f3a80ba4e4..1de66e47c72641629f0764acc4f963a0c67a02fd 100644 (file)
@@ -18,6 +18,5 @@
 
 #include "ffnonbonded.itp"
 #include "ffbonded.itp"
-#include "gbsa.itp"
 
 
diff --git a/share/top/amber03.ff/gbsa.itp b/share/top/amber03.ff/gbsa.itp
deleted file mode 100644 (file)
index ad74dcd..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-[ implicit_genborn_params ]
-; atype      sar      st     pi       gbr       hct
-;Br           0.1      1      1        0.125     0.85 ; H
-C            0.172    1      1.554    0.17    0.72 ; C
-CA           0.18     1      1.037    0.17    0.72 ; C
-CB           0.172    0.012  1.554    0.17    0.72 ; C
-CC           0.172    1      1.554    0.17    0.72 ; C
-CN           0.172    0.012  1.554    0.17    0.72 ; C
-CR           0.18     1      1.073    0.17    0.72 ; C
-CT           0.18     1      1.276    0.17     0.72 ; C
-CV           0.18     1      1.073    0.17    0.72 ; C
-CW           0.18     1      1.073    0.17    0.72 ; C
-C*           0.172    0.012  1.554    0.17    0.72 ; C
-H            0.1      1      1        0.13     0.85 ; H
-HC           0.1      1      1        0.12     0.85 ; H
-H1           0.1      1      1        0.12     0.85 ; H
-HA           0.1      1      1        0.12     0.85 ; H
-H4           0.1      1      1        0.12     0.85 ; H
-H5           0.1      1      1        0.12     0.85 ; H
-HO           0.1      1      1        0.12     0.85 ; H
-HS           0.1      1      1        0.12     0.85 ; H
-HP           0.1      1      1        0.12     0.85 ; H
-N            0.155    1      1.028    0.155   0.79 ; N
-NA           0.155    1      1.028    0.155   0.79 ; N
-NB           0.155    1      1.215    0.155   0.79 ; N
-N2           0.16     1      1.215    0.155   0.79 ; N
-N3           0.16     1      1.215    0.155    0.79 ; N
-O            0.15     1      0.926    0.15     0.85 ; O
-OH           0.152    1      1.080    0.15    0.85 ; O
-O2           0.17     1      0.922    0.15     0.85 ; O
-S            0.18     1      1.121    0.18    0.96 ; S
-SH           0.18     1      1.121    0.18    0.96 ; S
-; masscenters for vsites do not have gbsa parameters
-MNH3         0        0      0        0         0
-MCH3         0        0      0        0         0
index 7715e799a7f9d17c255127e0aec2a8f8a151780b..98de2218aa45f0a4b9f0d5106cb09657f14688b7 100644 (file)
@@ -18,6 +18,5 @@
 
 #include "ffnonbonded.itp"
 #include "ffbonded.itp"
-#include "gbsa.itp"
 
 
diff --git a/share/top/amber94.ff/gbsa.itp b/share/top/amber94.ff/gbsa.itp
deleted file mode 100644 (file)
index ad74dcd..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-[ implicit_genborn_params ]
-; atype      sar      st     pi       gbr       hct
-;Br           0.1      1      1        0.125     0.85 ; H
-C            0.172    1      1.554    0.17    0.72 ; C
-CA           0.18     1      1.037    0.17    0.72 ; C
-CB           0.172    0.012  1.554    0.17    0.72 ; C
-CC           0.172    1      1.554    0.17    0.72 ; C
-CN           0.172    0.012  1.554    0.17    0.72 ; C
-CR           0.18     1      1.073    0.17    0.72 ; C
-CT           0.18     1      1.276    0.17     0.72 ; C
-CV           0.18     1      1.073    0.17    0.72 ; C
-CW           0.18     1      1.073    0.17    0.72 ; C
-C*           0.172    0.012  1.554    0.17    0.72 ; C
-H            0.1      1      1        0.13     0.85 ; H
-HC           0.1      1      1        0.12     0.85 ; H
-H1           0.1      1      1        0.12     0.85 ; H
-HA           0.1      1      1        0.12     0.85 ; H
-H4           0.1      1      1        0.12     0.85 ; H
-H5           0.1      1      1        0.12     0.85 ; H
-HO           0.1      1      1        0.12     0.85 ; H
-HS           0.1      1      1        0.12     0.85 ; H
-HP           0.1      1      1        0.12     0.85 ; H
-N            0.155    1      1.028    0.155   0.79 ; N
-NA           0.155    1      1.028    0.155   0.79 ; N
-NB           0.155    1      1.215    0.155   0.79 ; N
-N2           0.16     1      1.215    0.155   0.79 ; N
-N3           0.16     1      1.215    0.155    0.79 ; N
-O            0.15     1      0.926    0.15     0.85 ; O
-OH           0.152    1      1.080    0.15    0.85 ; O
-O2           0.17     1      0.922    0.15     0.85 ; O
-S            0.18     1      1.121    0.18    0.96 ; S
-SH           0.18     1      1.121    0.18    0.96 ; S
-; masscenters for vsites do not have gbsa parameters
-MNH3         0        0      0        0         0
-MCH3         0        0      0        0         0
index 0fd863c1ec6a61c0656dd3b94e30ce0d3473dd53..cae8717a47dcbec575ecc2e64479cf806a015830 100644 (file)
@@ -18,6 +18,5 @@
 
 #include "ffnonbonded.itp"
 #include "ffbonded.itp"
-#include "gbsa.itp"
 
 
diff --git a/share/top/amber96.ff/gbsa.itp b/share/top/amber96.ff/gbsa.itp
deleted file mode 100644 (file)
index ad74dcd..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-[ implicit_genborn_params ]
-; atype      sar      st     pi       gbr       hct
-;Br           0.1      1      1        0.125     0.85 ; H
-C            0.172    1      1.554    0.17    0.72 ; C
-CA           0.18     1      1.037    0.17    0.72 ; C
-CB           0.172    0.012  1.554    0.17    0.72 ; C
-CC           0.172    1      1.554    0.17    0.72 ; C
-CN           0.172    0.012  1.554    0.17    0.72 ; C
-CR           0.18     1      1.073    0.17    0.72 ; C
-CT           0.18     1      1.276    0.17     0.72 ; C
-CV           0.18     1      1.073    0.17    0.72 ; C
-CW           0.18     1      1.073    0.17    0.72 ; C
-C*           0.172    0.012  1.554    0.17    0.72 ; C
-H            0.1      1      1        0.13     0.85 ; H
-HC           0.1      1      1        0.12     0.85 ; H
-H1           0.1      1      1        0.12     0.85 ; H
-HA           0.1      1      1        0.12     0.85 ; H
-H4           0.1      1      1        0.12     0.85 ; H
-H5           0.1      1      1        0.12     0.85 ; H
-HO           0.1      1      1        0.12     0.85 ; H
-HS           0.1      1      1        0.12     0.85 ; H
-HP           0.1      1      1        0.12     0.85 ; H
-N            0.155    1      1.028    0.155   0.79 ; N
-NA           0.155    1      1.028    0.155   0.79 ; N
-NB           0.155    1      1.215    0.155   0.79 ; N
-N2           0.16     1      1.215    0.155   0.79 ; N
-N3           0.16     1      1.215    0.155    0.79 ; N
-O            0.15     1      0.926    0.15     0.85 ; O
-OH           0.152    1      1.080    0.15    0.85 ; O
-O2           0.17     1      0.922    0.15     0.85 ; O
-S            0.18     1      1.121    0.18    0.96 ; S
-SH           0.18     1      1.121    0.18    0.96 ; S
-; masscenters for vsites do not have gbsa parameters
-MNH3         0        0      0        0         0
-MCH3         0        0      0        0         0
index 4360afda5a10cc3e4987433b548cc599cd53764d..9703b5870af4457072a588f5fd6014d878222707 100644 (file)
@@ -18,6 +18,3 @@
 
 #include "ffnonbonded.itp"
 #include "ffbonded.itp"
-#include "gbsa.itp"
-
-
diff --git a/share/top/amber99.ff/gbsa.itp b/share/top/amber99.ff/gbsa.itp
deleted file mode 100644 (file)
index ad74dcd..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-[ implicit_genborn_params ]
-; atype      sar      st     pi       gbr       hct
-;Br           0.1      1      1        0.125     0.85 ; H
-C            0.172    1      1.554    0.17    0.72 ; C
-CA           0.18     1      1.037    0.17    0.72 ; C
-CB           0.172    0.012  1.554    0.17    0.72 ; C
-CC           0.172    1      1.554    0.17    0.72 ; C
-CN           0.172    0.012  1.554    0.17    0.72 ; C
-CR           0.18     1      1.073    0.17    0.72 ; C
-CT           0.18     1      1.276    0.17     0.72 ; C
-CV           0.18     1      1.073    0.17    0.72 ; C
-CW           0.18     1      1.073    0.17    0.72 ; C
-C*           0.172    0.012  1.554    0.17    0.72 ; C
-H            0.1      1      1        0.13     0.85 ; H
-HC           0.1      1      1        0.12     0.85 ; H
-H1           0.1      1      1        0.12     0.85 ; H
-HA           0.1      1      1        0.12     0.85 ; H
-H4           0.1      1      1        0.12     0.85 ; H
-H5           0.1      1      1        0.12     0.85 ; H
-HO           0.1      1      1        0.12     0.85 ; H
-HS           0.1      1      1        0.12     0.85 ; H
-HP           0.1      1      1        0.12     0.85 ; H
-N            0.155    1      1.028    0.155   0.79 ; N
-NA           0.155    1      1.028    0.155   0.79 ; N
-NB           0.155    1      1.215    0.155   0.79 ; N
-N2           0.16     1      1.215    0.155   0.79 ; N
-N3           0.16     1      1.215    0.155    0.79 ; N
-O            0.15     1      0.926    0.15     0.85 ; O
-OH           0.152    1      1.080    0.15    0.85 ; O
-O2           0.17     1      0.922    0.15     0.85 ; O
-S            0.18     1      1.121    0.18    0.96 ; S
-SH           0.18     1      1.121    0.18    0.96 ; S
-; masscenters for vsites do not have gbsa parameters
-MNH3         0        0      0        0         0
-MCH3         0        0      0        0         0
index b48dce509887ba5a51dba5ca98403e587b2fe703..a3b91daeb64771d3f7e2f3e0024b0c3e7d6aa7cf 100644 (file)
@@ -18,6 +18,3 @@
 
 #include "ffnonbonded.itp"
 #include "ffbonded.itp"
-#include "gbsa.itp"
-
-
diff --git a/share/top/amber99sb-ildn.ff/gbsa.itp b/share/top/amber99sb-ildn.ff/gbsa.itp
deleted file mode 100644 (file)
index ad74dcd..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-[ implicit_genborn_params ]
-; atype      sar      st     pi       gbr       hct
-;Br           0.1      1      1        0.125     0.85 ; H
-C            0.172    1      1.554    0.17    0.72 ; C
-CA           0.18     1      1.037    0.17    0.72 ; C
-CB           0.172    0.012  1.554    0.17    0.72 ; C
-CC           0.172    1      1.554    0.17    0.72 ; C
-CN           0.172    0.012  1.554    0.17    0.72 ; C
-CR           0.18     1      1.073    0.17    0.72 ; C
-CT           0.18     1      1.276    0.17     0.72 ; C
-CV           0.18     1      1.073    0.17    0.72 ; C
-CW           0.18     1      1.073    0.17    0.72 ; C
-C*           0.172    0.012  1.554    0.17    0.72 ; C
-H            0.1      1      1        0.13     0.85 ; H
-HC           0.1      1      1        0.12     0.85 ; H
-H1           0.1      1      1        0.12     0.85 ; H
-HA           0.1      1      1        0.12     0.85 ; H
-H4           0.1      1      1        0.12     0.85 ; H
-H5           0.1      1      1        0.12     0.85 ; H
-HO           0.1      1      1        0.12     0.85 ; H
-HS           0.1      1      1        0.12     0.85 ; H
-HP           0.1      1      1        0.12     0.85 ; H
-N            0.155    1      1.028    0.155   0.79 ; N
-NA           0.155    1      1.028    0.155   0.79 ; N
-NB           0.155    1      1.215    0.155   0.79 ; N
-N2           0.16     1      1.215    0.155   0.79 ; N
-N3           0.16     1      1.215    0.155    0.79 ; N
-O            0.15     1      0.926    0.15     0.85 ; O
-OH           0.152    1      1.080    0.15    0.85 ; O
-O2           0.17     1      0.922    0.15     0.85 ; O
-S            0.18     1      1.121    0.18    0.96 ; S
-SH           0.18     1      1.121    0.18    0.96 ; S
-; masscenters for vsites do not have gbsa parameters
-MNH3         0        0      0        0         0
-MCH3         0        0      0        0         0
index 8624d69dce0a21399adcc524dc612fc443c7b7ac..ad4577553b563ba07fc3c45efa72e50079156805 100644 (file)
@@ -18,6 +18,3 @@
 
 #include "ffnonbonded.itp"
 #include "ffbonded.itp"
-#include "gbsa.itp"
-
-
diff --git a/share/top/amber99sb.ff/gbsa.itp b/share/top/amber99sb.ff/gbsa.itp
deleted file mode 100644 (file)
index ad74dcd..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-[ implicit_genborn_params ]
-; atype      sar      st     pi       gbr       hct
-;Br           0.1      1      1        0.125     0.85 ; H
-C            0.172    1      1.554    0.17    0.72 ; C
-CA           0.18     1      1.037    0.17    0.72 ; C
-CB           0.172    0.012  1.554    0.17    0.72 ; C
-CC           0.172    1      1.554    0.17    0.72 ; C
-CN           0.172    0.012  1.554    0.17    0.72 ; C
-CR           0.18     1      1.073    0.17    0.72 ; C
-CT           0.18     1      1.276    0.17     0.72 ; C
-CV           0.18     1      1.073    0.17    0.72 ; C
-CW           0.18     1      1.073    0.17    0.72 ; C
-C*           0.172    0.012  1.554    0.17    0.72 ; C
-H            0.1      1      1        0.13     0.85 ; H
-HC           0.1      1      1        0.12     0.85 ; H
-H1           0.1      1      1        0.12     0.85 ; H
-HA           0.1      1      1        0.12     0.85 ; H
-H4           0.1      1      1        0.12     0.85 ; H
-H5           0.1      1      1        0.12     0.85 ; H
-HO           0.1      1      1        0.12     0.85 ; H
-HS           0.1      1      1        0.12     0.85 ; H
-HP           0.1      1      1        0.12     0.85 ; H
-N            0.155    1      1.028    0.155   0.79 ; N
-NA           0.155    1      1.028    0.155   0.79 ; N
-NB           0.155    1      1.215    0.155   0.79 ; N
-N2           0.16     1      1.215    0.155   0.79 ; N
-N3           0.16     1      1.215    0.155    0.79 ; N
-O            0.15     1      0.926    0.15     0.85 ; O
-OH           0.152    1      1.080    0.15    0.85 ; O
-O2           0.17     1      0.922    0.15     0.85 ; O
-S            0.18     1      1.121    0.18    0.96 ; S
-SH           0.18     1      1.121    0.18    0.96 ; S
-; masscenters for vsites do not have gbsa parameters
-MNH3         0        0      0        0         0
-MCH3         0        0      0        0         0
index 38db0dcb316d22380c6c1af68bbec9aee9ef59a7..86a9e1e84540b8b3917dfb0ec98d829f66879143 100644 (file)
@@ -22,6 +22,5 @@
 
 #include "ffnonbonded.itp"
 #include "ffbonded.itp"
-#include "gbsa.itp"
 
 
diff --git a/share/top/amberGS.ff/gbsa.itp b/share/top/amberGS.ff/gbsa.itp
deleted file mode 100644 (file)
index ad74dcd..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-[ implicit_genborn_params ]
-; atype      sar      st     pi       gbr       hct
-;Br           0.1      1      1        0.125     0.85 ; H
-C            0.172    1      1.554    0.17    0.72 ; C
-CA           0.18     1      1.037    0.17    0.72 ; C
-CB           0.172    0.012  1.554    0.17    0.72 ; C
-CC           0.172    1      1.554    0.17    0.72 ; C
-CN           0.172    0.012  1.554    0.17    0.72 ; C
-CR           0.18     1      1.073    0.17    0.72 ; C
-CT           0.18     1      1.276    0.17     0.72 ; C
-CV           0.18     1      1.073    0.17    0.72 ; C
-CW           0.18     1      1.073    0.17    0.72 ; C
-C*           0.172    0.012  1.554    0.17    0.72 ; C
-H            0.1      1      1        0.13     0.85 ; H
-HC           0.1      1      1        0.12     0.85 ; H
-H1           0.1      1      1        0.12     0.85 ; H
-HA           0.1      1      1        0.12     0.85 ; H
-H4           0.1      1      1        0.12     0.85 ; H
-H5           0.1      1      1        0.12     0.85 ; H
-HO           0.1      1      1        0.12     0.85 ; H
-HS           0.1      1      1        0.12     0.85 ; H
-HP           0.1      1      1        0.12     0.85 ; H
-N            0.155    1      1.028    0.155   0.79 ; N
-NA           0.155    1      1.028    0.155   0.79 ; N
-NB           0.155    1      1.215    0.155   0.79 ; N
-N2           0.16     1      1.215    0.155   0.79 ; N
-N3           0.16     1      1.215    0.155    0.79 ; N
-O            0.15     1      0.926    0.15     0.85 ; O
-OH           0.152    1      1.080    0.15    0.85 ; O
-O2           0.17     1      0.922    0.15     0.85 ; O
-S            0.18     1      1.121    0.18    0.96 ; S
-SH           0.18     1      1.121    0.18    0.96 ; S
-; masscenters for vsites do not have gbsa parameters
-MNH3         0        0      0        0         0
-MCH3         0        0      0        0         0
index 34739164eb0da0b54d0f20c43072f925adb97fe2..0de48a24c97b70e17a0653be1d2f3067f6ef14da 100644 (file)
@@ -204,9 +204,9 @@ ILE         HG11    HG12    2HG1
 ILE            HG21    HG21    1HG2    
 ILE            HG22    HG22    2HG2    
 ILE            HG23    HG23    3HG2    
-ILE            HD11    HD11    1HD1    
-ILE            HD12    HD12    2HD1    
-ILE            HD13    HD13    3HD1    
+ILE            HD1     HD1     HD1     
+ILE            HD2     HD2     HD2     
+ILE            HD3     HD3     HD3     
 ILE            C       C       C       
 ILE            CA      CA      CA      
 ILE            CB      CB      CB      
index 56a38ba53dffd4795ff657163a5c725cb85b71a4..87bf7fd983785dc995ed9f4455b6ef7a623804ea 100644 (file)
@@ -14,7 +14,6 @@
 
 #include "ffnonbonded.itp"
 #include "ffbonded.itp"
-#include "gb.itp"
 #include "cmap.itp"
 ; Nucleic acids nonbonded and bonded parameters"
 #include "ffnanonbonded.itp"
diff --git a/share/top/charmm27.ff/gb.itp b/share/top/charmm27.ff/gb.itp
deleted file mode 100644 (file)
index 33d51c6..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-[ implicit_genborn_params ]
-
-; Atom type    sar     st      pi      gbr      hct
- NH1            0.155   1       1.028   0.17063  0.79 ; N
- N             0.155   1       1       0.155    0.79 ; Proline backbone N
- NP            0.155   1       1       0.155    0.79 ; Proline backbone N for Proline N-terminus
- H              0.1     1       1       0.115    0.85 ; H
- CT1            0.180   1       1.276   0.190    0.72 ; C
- HB             0.1     1       1       0.125    0.85 ; H
- CT3            0.200   1       0.880   0.190    0.72 ; C
- HA             0.1     1       1       0.125    0.85 ; H
- C              0.172   1       1.554   0.1875   0.72 ; C
- O              0.150   1       0.926   0.148    0.85 ; O
- CT2            0.190   1       1.045   0.190    0.72 ; C
- NC2            0.160   1       1.215   0.17063  0.79 ; N
- HC             0.1     1       1       0.115    0.85 ; H
- CC             0.172   1       1.554   0.1875   0.72 ; C
- CD            0.172   1       1.554   0.1875   0.72 ; carbonyl C (in COOH termini)
- NH2            0.160   1       1.215   0.17063  0.79 ; N
- OC             0.170   1       0.922   0.148    0.85 ; O
- OB            0.170   1       0.922   0.148    0.85 ; carbonyl O (in COOH termini)
- S              0.180   1       1.121   0.1775   0.96 ; S
- SM             0.180   1       1.121   0.1775   0.96 ; disulfide sulfur
- HS             0.1     1       1       0.125    0.85 ; H
- NR1            0.155   1       1.028   0.17063  0.79 ; N
- CPH1           0.172   1       1.554   0.1875   0.72 ; C
- CPH2           0.180   1       1.073   0.1875   0.72 ; C
- HR1            0.1     1       1       0.125    0.85 ; H
- HR2            0.1     1       1       0.125    0.85 ; H
- NR2            0.155   1       1.215   0.17063  0.79 ; N
- HR3            0.1     1       1       0.115    0.85 ; H
- NR3            0.155   1       1.215   0.17063  0.79 ; N
- NH3            0.160   1       1.215   0.1625   0.79 ; N
- HP             0.1     1       1       0.125    0.85 ; H
- CP3            0.190   1       1.045   0.190    0.72 ; C
- CP1            0.180   1       1.276   0.190    0.72 ; C
- CP2            0.190   1       1.045   0.190    0.72 ; C
- OH1            0.152   1       1.080   0.1535   0.85 ; O
- CY             0.172   0.012   1.554   0.1875   0.72 ; C
- CA             0.180   1       1.073   0.1875   0.72 ; C
- HP             0.1     1       1       0.125    0.85 ; H
- NY             0.155   1       1.028   0.17063  0.79 ; N
- CPT            0.172   0.012   1.554   0.1875   0.72 ; C     
- MNH3          0       0       0       0        0    ; dummy mass
- MNH2          0       0       0       0        0    ; dummy mass
- MCH3          0       0       0       0        0    ; dummy mass
- MCH3S         0       0       0       0        0    ; dummy mass
- MW             0       0       0       0        0
index 0592862d28d0db585b7858415091c2790d32fae8..e69c4728d7117662a32fa392409e751ea6caf03d 100644 (file)
@@ -21,4 +21,3 @@
 
 #include "ffnonbonded.itp"
 #include "ffbonded.itp"
-#include "gbsa.itp"
diff --git a/share/top/oplsaa.ff/gbsa.itp b/share/top/oplsaa.ff/gbsa.itp
deleted file mode 100644 (file)
index afba702..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-[ implicit_genborn_params ]
-
-; atype    sar    st    pi       gbr      hct
-opls_102   0.16   1     1.215    0.1625   0.79 ; N (RNH3+)
-opls_135   0.2    1     0.880    0.190    0.72 ; CB
-opls_136   0.19   1     1.045    0.190    0.72 ; CB
-opls_137   0.18   1     1.276    0.190    0.72 ; CB
-opls_140   0.1    1     1        0.125    0.85 ; HA
-opls_145   0.18   1     1.073    0.1875   0.72 ; CG
-opls_146   0.1    1     1        0.115    0.85 ; HD2
-opls_149   0.19   1     1.045    0.190    0.72 ; CB
-opls_154   0.152  1     1.080    0.1535   0.85 ; OG
-opls_155   0.1    1     1        0.105    0.85 ; HG
-opls_157   0.19   1     1.045    0.190    0.72 ; CB
-opls_158   0.18   1     1.276    0.190    0.72 ; CB
-opls_166   0.18   1     1.073    0.1875   0.72 ; CZ
-opls_167   0.15   1     1.080    0.1535   0.85 ; OH
-opls_168   0.1    1     1        0.105    0.85 ; HH
-opls_200   0.18   1     1.121    0.1775   0.96 ; SG
-opls_202   0.18   1     1.121    0.1775   0.96 ; SD
-opls_203   0.18   1     1.121    0.1775   0.96 ; S
-opls_204   0.1    1     1        0.125    0.85 ; HG
-opls_206   0.19   1     1.045    0.190    0.72 ; CB
-opls_209   0.2    1     0.880    0.190    0.72 ; CE
-opls_210   0.19   1     1.045    0.190    0.72 ; CG
-opls_214   0.19   1     1.045    0.190    0.72 ; CB
-opls_223B  0.19   1     1.045    0.190    0.72 ; CA
-opls_224B  0.18   1     1.276    0.190    0.72 ; CA
-opls_235   0.172  1     1.554    0.1875   0.72 ; C
-opls_236   0.15   1     0.926    0.148    0.85 ; O
-opls_237   0.16   1     1.215    0.17063  0.79 ; ND2
-opls_238   0.155  1     1.028    0.17063  0.79 ; N
-opls_239   0.155  1     1.028    0.17063  0.79 ; N
-opls_240   0.1    1     1        0.115    0.85 ; HD21
-opls_241   0.1    1     1        0.115    0.85 ; H
-opls_245   0.19   1     1.045    0.190    0.72 ; CD
-opls_246   0.18   1     1.276    0.190    0.72 ; CA
-opls_271   0.172  1     1.554    0.1875   0.72 ; CG
-opls_272   0.17   1     0.922    0.148    0.85 ; OD1
-opls_274   0.19   1     1.045    0.190    0.72 ; CB
-opls_283   0.18   1     1.276    0.190    0.72 ; CA on C-terminal ALA,CYS,SER,THR,HIS,ASP,ASN
-opls_284   0.19   1     1.045    0.190    0.72 ; CA on C-terminal GLY
-opls_285   0.18   1     1.276    0.190    0.72 ; CA on C-terminal PRO
-opls_287   0.16   1     1.215    0.1625   0.79 ; NZ
-opls_290   0.1    1     1        0.115    0.85 ; HZ1
-opls_292   0.19   1     1.045    0.190    0.72 ; CE
-opls_292B  0.19   1     1.045    0.190    0.72 ; CA in GLY-NH3+ N-term.
-opls_293B  0.18   1     1.276    0.190    0.72 ; CA in NH3+ N-term, All AA except GLY & PRO
-opls_295   0.18   1     1.276    0.190    0.72 ; AA C-alpha on N-term PRO
-opls_296   0.19   1     1.045    0.190    0.72 ; AA:C-delta in N-term PRO NH2+
-opls_300   0.16   1     1.215    0.17063  0.79 ; NH1
-opls_301   0.1    1     1        0.115    0.85 ; HH11
-opls_302   0.172  0.012 1.554    0.1875   0.72 ; CZ (why 0.012 in Charmm?)
-opls_303   0.155  1     1.028    0.17063  0.79 ; NE
-opls_304   0.1    1     1        0.115    0.85 ; HE
-opls_307   0.19   1     1.045    0.190    0.72 ; CD
-opls_308   0.19   1     1.045    0.190    0.72 ; CG
-opls_309   0.16   1     1.215    0.1625   0.79 ; N (R2NH2+), N-terminal PRO NH2+
-opls_310   0.1    1     1        0.115    0.85 ; H (R2NH2+)
-opls_500   0.172  0.012 1.554    0.1875   0.72 ; CG
-opls_501   0.172  0.012 1.554    0.1875   0.72 ; CD2
-opls_502   0.172  0.012 1.554    0.1875   0.72 ; CE2
-opls_503   0.155  1     1.028    0.17063  0.79 ; NE2
-opls_504   0.1    1     1        0.125    0.85 ; HE2
-opls_505   0.19   1     1.045    0.190    0.72 ; CB
-opls_506   0.18   1     1.073    0.1875   0.72 ; CE1
-opls_507   0.172  0.012 1.554    0.1875   0.72 ; CG
-opls_508   0.18   1     1.073    0.1875   0.72 ; CD2
-opls_509   0.18   1     1.073    0.1875   0.72 ; CE1
-opls_510   0.172  1     1.554    0.1875   0.72 ; CG
-opls_511   0.155  1     1.028    0.17063  0.79 ; ND1
-opls_512   0.155  1     1.028    0.17063  0.79 ; ND1
-opls_513   0.1    1     1        0.115    0.85 ; HD1
-opls_514   0.18   1     1.073    0.1875   0.72 ; CD1
-opls_900   0.16   1     1.215    0.1625   0.79 ; NZ
-opls_906   0.19   1     1.045    0.190    0.72 ; CE
-opls_909   0.1    1     1        0.115    0.85 ; HZ1
-opls_911   0.1    1     1        0.125    0.85 ; HE1
-
-; masscenters for vsites do not have gbsa parameters
-
-MNH2      0       0     0        0        0
-MNH3      0       0     0        0        0
-MCH3A     0       0     0        0        0    
-MCH3B     0       0     0        0        0
\ No newline at end of file
index 517ca813bc78e507d8345d906c92112f2e4acc59..dde7c7ae151f5db51f3017b253ec2f9a0c9f61af 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+# Copyright (c) 2009,2010,2011,2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
 # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
 # and including many others, as listed in the AUTHORS file in the
 # top-level source directory and at http://www.gromacs.org.
@@ -55,7 +55,7 @@ if (BUILD_TESTING)
         set(UNITTEST_TARGET_OPTIONS EXCLUDE_FROM_ALL)
     endif()
     if (GMX_BUILD_UNITTESTS)
-        add_subdirectory(external/gmock-1.7.0)
+        add_subdirectory(external/googletest)
     endif()
     include(testutils/TestMacros.cmake)
     add_subdirectory(testutils)
@@ -63,7 +63,3 @@ endif()
 
 add_subdirectory(gromacs)
 add_subdirectory(programs)
-
-if (NOT GMX_FAHCORE)
-    add_subdirectory(contrib)
-endif()
index bd7e658901cbf87274cd3e1881a21602a9224d79..6059d4821278c3d3c08998d202b356b540dcbfd3 100644 (file)
@@ -65,9 +65,6 @@
 /* Target platform is x86 or x86_64 */
 #cmakedefine01 GMX_TARGET_X86
 
-/* Target platform is BlueGene/Q */
-#cmakedefine01 GMX_TARGET_BGQ
-
 /** Define if we are building natively on Windows */
 #cmakedefine01 GMX_NATIVE_WINDOWS
 
 /* ARM (AArch64) NEON Advanced SIMD instruction set level was selected */
 #cmakedefine01 GMX_SIMD_ARM_NEON_ASIMD
 
-/* IBM QPX was selected as SIMD instructions (e.g. BlueGene/Q) */
-#cmakedefine01 GMX_SIMD_IBM_QPX
-
 /* IBM VMX was selected as SIMD instructions (Power 6 and later) */
 #cmakedefine01 GMX_SIMD_IBM_VMX
 
diff --git a/src/contrib/CMakeLists.txt b/src/contrib/CMakeLists.txt
deleted file mode 100644 (file)
index 32cb46f..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-set(CONTRIB_PROGRAMS 
-     #add here any programs you want to compile
-
-)
-
-foreach(PROG ${CONTRIB_PROGRAMS})
-        add_executable(${PROG} ${PROG}.c ${NGMX_COMMON_SOURCE})
-       set_target_properties(${PROG} PROPERTIES OUTPUT_NAME "${PROG}${GMX_BINARY_SUFFIX}")
-endforeach(PROG)
diff --git a/src/contrib/README b/src/contrib/README
deleted file mode 100644 (file)
index 7e4bd81..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-
-This directory contains programs and scripts contributed by the
-GROMACS developers and users. It is not really officially supported
-or documented, so if there are problems your best bet is probably
-either the mailing lists or to contact the author listed in the file.
-
-To add a program, you should edit CMakeLists.txt.
-
-
-
-                   The GROMACS     Crew
\ No newline at end of file
diff --git a/src/contrib/calcfdev.c b/src/contrib/calcfdev.c
deleted file mode 100644 (file)
index ac2066f..0000000
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * 
- *                This source code is part of
- * 
- *                 G   R   O   M   A   C   S
- * 
- *          GROningen MAchine for Chemical Simulations
- * 
- *                        VERSION 3.3.99_development_20071104
- * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
- * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2006, The GROMACS development team,
- * check out http://www.gromacs.org for more information.
-
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- * 
- * If you want to redistribute modifications, please consider that
- * scientific software is very special. Version control is crucial -
- * bugs must be traceable. We will be happy to consider code for
- * inclusion in the official distribution, but derived work must not
- * be called official GROMACS. Details are found in the README & COPYING
- * files - if they are missing, get the official version at www.gromacs.org.
- * 
- * To help us fund GROMACS development, we humbly ask that you cite
- * the papers on the package - you can find them in the top README file.
- * 
- * For more info, check our website at http://www.gromacs.org
- * 
- * And Hey:
- * Groningen Machine for Chemical Simulation
- */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "typedefs.h"
-#include "gromacs/math/vec.h"
-#include "txtdump.h"
-
-void calc_force(int natom,rvec f[],rvec fff[])
-{
-  int  i,j,m;
-  int  jindex[] = { 0, 5, 10};
-  rvec dx,df;
-  real msf1,msf2;
-  
-  for(j=0; (j<2); j++) {
-    clear_rvec(fff[j]);
-    for(i=jindex[j]; (i<jindex[j+1]); i++) {
-      for(m=0; (m<DIM); m++) {
-       fff[j][m] += f[i][m];
-      }
-    }
-  }
-  
-  msf1 = iprod(fff[0],fff[0]);
-  msf2 = iprod(fff[1],fff[1]);
-  if (debug) {
-    pr_rvecs(debug,0,"force",f,natom);
-    
-    fprintf(debug,"FMOL:  %10.3f  %10.3f  %10.3f  %10.3f  %10.3f  %10.3f\n",
-           fff[0][XX],fff[0][YY],fff[0][ZZ],fff[1][XX],fff[1][YY],fff[1][ZZ]);
-    fprintf(debug,"RMSF:  %10.3e  %10.3e\n",msf1,msf2);
-  }
-}
-
-
-void calc_f_dev(int natoms,real charge[],rvec x[],rvec f[],
-               t_idef *idef,real *xiH,real *xiS)
-{
-  enum { wwwO, wwwH1, wwwH2, wwwS, wwwNR };
-  int  lj_index[wwwNR] = { 0,    4,     4,     8 };
-  real rmsf,dFH,dFS,dFO,dr_14;
-  real q[wwwNR],c6[wwwNR],c12[wwwNR],c12ratio;
-  rvec fff[2],dx;
-  int  i,j,aj;
-  
-  for(i=0; (i<wwwNR); i++) {
-    q[i]   = charge[i];
-    c12[i] = idef->iparams[lj_index[i]].lj.c12;
-    c6[i]  = idef->iparams[lj_index[i]].lj.c6;
-  }
-  
-  calc_force(natoms,f,fff);
-  rmsf = norm(fff[0]);
-  dFS = 0;
-  dFH = 0;
-  dFO = 0;
-  for(i=0; (i<4); i++) {
-    for(j=4; (j<8); j++) {
-      if (c12[i] != 0) {
-       rvec_sub(x[i],x[j],dx);
-       aj       = j % 4;
-       dr_14    = pow(iprod(dx,dx),-7);
-       c12ratio = -12*sqrt(c12[aj]/c12[i])*dr_14*iprod(fff[0],dx);
-       
-       switch (i) {
-       case wwwH1:
-       case wwwH2:
-         dFH += c12ratio;
-         break;
-       case wwwS:
-         dFS += c12ratio;
-         break;
-       case wwwO:
-         dFS += c12ratio;
-         break;
-       }
-      }
-    }
-  }
-
-  if (debug) {    
-    fprintf(debug,"FFF: dFS=%10.3e,  dFH=%10.3e,  dFO=%10.3e, rmsf=%10.3e\n",
-           dFS,dFH,dFO,rmsf);
-  }
-  if (dFH == 0)
-    *xiH = 1;
-  else
-    *xiH=rmsf/(10*c12[wwwH1]*dFH);
-    
-  if (dFS == 0)
-    *xiS = 1;
-  else
-    *xiS=rmsf/(10*c12[wwwS]*dFS);
-}
diff --git a/src/contrib/compnl.c b/src/contrib/compnl.c
deleted file mode 100644 (file)
index 0f1e4e4..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * 
- *                This source code is part of
- * 
- *                 G   R   O   M   A   C   S
- * 
- *          GROningen MAchine for Chemical Simulations
- * 
- *                        VERSION 3.2.0
- * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
- * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2004, The GROMACS development team,
- * check out http://www.gromacs.org for more information.
-
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- * 
- * If you want to redistribute modifications, please consider that
- * scientific software is very special. Version control is crucial -
- * bugs must be traceable. We will be happy to consider code for
- * inclusion in the official distribution, but derived work must not
- * be called official GROMACS. Details are found in the README & COPYING
- * files - if they are missing, get the official version at www.gromacs.org.
- * 
- * To help us fund GROMACS development, we humbly ask that you cite
- * the papers on the package - you can find them in the top README file.
- * 
- * For more info, check our website at http://www.gromacs.org
- * 
- * And Hey:
- * GROwing Monsters And Cloning Shrimps
- */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "ns.h"
-#include "gromacs/utility/smalloc.h"
-#include "wnblist.h"
-#include "gromacs/utility/futil.h"
-#include "macros.h"
-#include "gromacs/commandline/pargs.h"
-#include "copyrite.h"
-#include "gromacs/fileio/confio.h"
-#include "gromacs/pbcutil/pbc.h"
-#include "gromacs/math/vec.h"
-
-int main(int argc,char *argv[])
-{
-  static char *desc[] = {
-    "[TT]compnl[tt] compares two neighborlists as generated by [TT]mdrun[tt]",
-    "in the log file, when the environment variable DUMPNL is set to",
-    "a number larger than 0. [TT]compnl[tt] is mainly used for debugging the",
-    "[TT]mdrun[tt] internals and not for end-users."
-  };
-  FILE    *in,*out;
-  int     i,j,nmiss,mod;
-  char    **fn,title[256];
-  int     ***mat,nnb;
-  real    mb;
-  gmx_bool    bConf;
-  rvec    *x = NULL;
-  rvec    dx;
-  matrix  box;
-  t_atoms atoms;
-  t_pbc   pbc;
-  
-  t_filenm fnm[] = {
-    { efLOG, "-f1", NULL, ffREAD },
-    { efLOG, "-f2", NULL, ffREAD },
-    { efOUT, "-o",  "compnl", ffWRITE },
-    { efSTX, "-c",  NULL, ffOPTRD }
-  };
-#define NFILE asize(fnm)
-  static int natoms=648;
-  static gmx_bool bSymm=TRUE;
-  static t_pargs pa[] = {
-    { "-nat",  FALSE, etINT, { &natoms }, "Number of atoms" },
-    { "-symm", FALSE, etBOOL,{ &bSymm  }, "Symmetrize the matrices" },
-  };
-
-  CopyRight(stderr,argv[0]);
-  parse_common_args(&argc,argv,0,NFILE,fnm,asize(pa),pa,
-                   asize(desc),desc,0,NULL);
-
-  bConf = (opt2bSet("-c",NFILE,fnm));
-  if (bConf) {
-    get_stx_coordnum (opt2fn("-c",NFILE,fnm),&natoms);
-    init_t_atoms(&atoms,natoms,FALSE);
-    snew(x,natoms);
-    read_stx_conf(opt2fn("-c",NFILE,fnm),title,&atoms,x,NULL,box);
-    set_pbc(&pbc,box);
-  }
-  snew(fn,2);
-  fn[0] = opt2fn("-f1",NFILE,fnm);
-  fn[1] = opt2fn("-f2",NFILE,fnm);
-  
-  snew(mat,2);  
-  out = gmx_fio_fopen(ftp2fn(efOUT,NFILE,fnm),"w");
-  mb  = sizeof(int)*sqr(natoms/1024.0);
-  for(i=0; (i<2); i++) {
-    in = gmx_fio_fopen(fn[i],"r");
-    fprintf(stderr,"Reading %s\n",fn[i]);
-    fprintf(out,   "Reading %s\n",fn[i]);
-    fprintf(stderr,"Going to allocate %.0f Mb of memory\n",mb);
-    fprintf(out,   "Going to allocate %.0f Mb of memory\n",mb);
-    snew(mat[i],natoms);
-    for(j=0; (j<natoms); j++) 
-      snew(mat[i][j],natoms);
-    nnb = read_nblist(in,out,mat[i],natoms,bSymm);
-    gmx_fio_fclose(in);
-    fprintf(stderr,"Interaction matrix %d has %d entries\n",i,nnb);
-    fprintf(out,   "Interaction matrix %d has %d entries\n",i,nnb);
-  }
-  fprintf(stderr,"Comparing Interaction Matrices\n");
-  mod=1;
-  nmiss = 0;
-  for(i=0; (i<natoms); i+=mod) {
-    for(j=0; (j<natoms); j+=mod) {
-      if (mat[0][i][j] != mat[1][i][j]) {
-       fprintf(out,"i: %5d, j: %5d, shift[%s]: %3d, shift[%s]: %3d",
-               i,j,fn[0],mat[0][i][j]-1,fn[1],mat[1][i][j]-1);
-       if (bConf) {
-         pbc_dx(&pbc,x[i],x[j],dx);
-         fprintf(out," dist: %8.3f\n",norm(dx));
-       }
-       else
-         fprintf(out,"\n");
-       nmiss++;
-      }
-    }
-  }
-  fprintf(out,"There were %d mismatches\n",nmiss);
-  fprintf(out,"Done.\n");
-  gmx_fio_fclose(out);
-  fprintf(stderr,"There were %d mismatches\n",nmiss);
-  fprintf(stderr,"Finished\n");
-  
-  gmx_thanx(stdout);
-  
-  return 0;
-}
-
-
-
diff --git a/src/contrib/do_multiprot.c b/src/contrib/do_multiprot.c
deleted file mode 100644 (file)
index cddc1d2..0000000
+++ /dev/null
@@ -1,453 +0,0 @@
-/* -*- mode: c; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; c-file-style: "stroustrup"; -*-
- *
- *                This source code is NOT REALLY part of
- * 
- *                 G   R   O   M   A   C   S
- * 
- *          GROningen MAchine for Chemical Simulations
- * 
- *                        VERSION 4.2.5
- * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
- * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2004, The GROMACS development team,
- * check out http://www.gromacs.org for more information.
-
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- * 
- * If you want to redistribute modifications, please consider that
- * scientific software is very special. Version control is crucial -
- * bugs must be traceable. We will be happy to consider code for
- * inclusion in the official distribution, but derived work must not
- * be called official GROMACS. Details are found in the README & COPYING
- * files - if they are missing, get the official version at www.gromacs.org.
- * 
- * To help us fund GROMACS development, we humbly ask that you cite
- * the papers on the package - you can find them in the top README file.
- * 
- * For more info, check our website at http://www.gromacs.org
- *
- * Author: do_multiprot was written by Ran Friedman <r.friedman@bioc.uzh.ch>
- * 
- * And Hey:
- * Green Red Orange Magenta Azure Cyan Skyblue
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "typedefs.h"
-#include "macros.h"
-#include "gromacs/utility/smalloc.h"
-#include "gromacs/commandline/pargs.h"
-#include "copyrite.h"
-#include "gromacs/fileio/pdbio.h"
-#include "gromacs/utility/fatalerror.h"
-#include "gromacs/fileio/xvgr.h"
-#include "gromacs/topology/index.h"
-#include "gstat.h"
-#include "gromacs/fileio/tpxio.h"
-#include "viewit.h"
-#include "gbutil.h"
-#include "gromacs/math/vec.h"
-#include "gromacs/fileio/confio.h"
-
-typedef struct {
-    int resnr; 
-    int count; 
-} t_countres;
-
-static void process_multiprot_output(const char *fn, real *rmsd, int *nres, rvec rotangles, 
-                                    rvec translation, bool bCountres, t_countres *countres)
-{
-    FILE       *mpoutput;
-    char       line[256];
-    char       *string;
-    int        i=0,j=0,res;
-    
-    (*rmsd)=-1;
-    (*nres)=0;
-    mpoutput=gmx_ffopen (fn,"r");
-    
-    if (bCountres) {
-       do {
-           fgets(line, 256, mpoutput);
-       } while (strstr(line,"Match List") == NULL);
-       fgets(line, 256, mpoutput);
-       do {
-           string = strtok (line,".");
-           while (i<2 && string != NULL) {
-               string = strtok (NULL,". ");
-               i++;
-           }
-           i=0;
-           res=atoi(string);
-           if (res > 0) {
-               while (countres[j].resnr!=res)
-                   j++;
-               countres[j].count++;
-           }
-           fgets(line, 256, mpoutput);
-       } while (strstr(line,"End of Match List") == NULL);
-       rewind(mpoutput);
-    }
-    do {
-       fgets(line, 256, mpoutput);
-    } while (strstr(line,"Trans : ") == NULL);
-    
-    string = strtok (line," :");
-    string = strtok (NULL," ");
-    while (i<3 && string != NULL) {
-       string = strtok (NULL," ");
-       rotangles[i]=atof(string);
-       i++;
-    }
-    i=0;
-    while (i<3 && string != NULL) {
-       string = strtok (NULL," ");
-       translation[i]=atof(string)/10;
-       i++;
-    }
-    if (i!=3) {
-       gmx_warning("Not enough values for rotation and translation vectors in the output of multiprot");
-    }
-    
-    rotangles[YY]=rotangles[YY]*(-1); 
-    
-    while ((*rmsd) <0) {
-       fgets(line, 256, mpoutput);
-       if (strstr(line,"RMSD : ") != NULL) {
-           string = strtok (line,":");
-           string = strtok (NULL,":");
-           (*rmsd)=atof(string)/10;
-       }
-    }
-    while (!(*nres)) {
-       fgets(line,256, mpoutput);
-       if (strstr(line,"Match List") != NULL) {
-           string = strtok (line,":");
-           string = strtok (NULL,":");
-           (*nres) = atoi(string);
-       }
-    }
-    gmx_ffclose(mpoutput);
-}
-
-int main(int argc,char *argv[])
-{
-    const char *desc[] = {
-       "[TT]do_multiprot[tt] ", 
-       "reads a trajectory file and aligns it to a reference structure  ",
-       "each time frame",
-       "calling the multiprot program. This allows you to use a reference",
-       "structure whose sequence is different than that of the protein in the ",
-       "trajectory, since the alignment is based on the geometry, not sequence.",
-       "The output of [TT]do_multiprot[tt] includes the rmsd and the number of residues",
-       "on which it was calculated.",
-       "[PAR]",
-       "An aligned trajectory file is generated with the [TT]-ox[tt] option.[PAR]",
-       "With the [TT]-cr[tt] option, the number of hits in the alignment is given",
-       "per residue. This number can be between 0 and the number of frames, and",
-       "indicates the structural conservation of this residue.[PAR]",
-       "If you do not have the [TT]multiprot[tt] program, get it. [TT]do_multiprot[tt] assumes", 
-       "that the [TT]multiprot[tt] executable is [TT]/usr/local/bin/multiprot[tt]. If this is ",
-       "not the case, then you should set an environment variable [BB]MULTIPROT[bb]", 
-       "pointing to the [TT]multiprot[tt] executable, e.g.: [PAR]",
-       "[TT]setenv MULTIPROT /usr/MultiProtInstall/multiprot.Linux[tt][PAR]",
-       "Note that at the current implementation only binary alignment (your",
-       "molecule to a reference) is supported. In addition, note that the ",
-       "by default [TT]multiprot[tt] aligns the two proteins on their C-alpha carbons.",
-       "and that this depends on the [TT]multiprot[tt] parameters which are not dealt ",
-       "with here. Thus, the C-alpha carbons is expected to give the same "
-       "results as choosing the whole protein and will be slightly faster.[PAR]",
-       "For information about [TT]multiprot[tt], see:",
-       "http://bioinfo3d.cs.tau.ac.il/MultiProt/.[PAR]"
-    };
-    static bool bVerbose;
-    t_pargs pa[] = {
-       { "-v",  FALSE, etBOOL, {&bVerbose},
-         "HIDDENGenerate miles of useless information" }
-    };
-  
-    const char *bugs[] = { 
-       "The program is very slow, since multiprot is run externally"
-    };
-  
-    t_trxstatus *status;
-    t_trxstatus *trxout=NULL;
-    FILE        *tapein,*fo,*frc,*tmpf,*out=NULL,*fres=NULL;
-    const char  *fnRef;
-    const char  *fn="2_sol.res";
-    t_topology  top;
-    int         ePBC;
-    t_atoms     *atoms,ratoms,useatoms;
-    t_trxframe  fr;
-    t_pdbinfo   p;
-    int         nres,nres2,nr0;
-    real        t;
-    int         i,j,natoms,nratoms,nframe=0,model_nr=-1;
-    int         cur_res,prev_res;
-    int         nout;
-    t_countres  *countres=NULL;
-    matrix      box,rbox;
-    int         gnx;
-    char        *grpnm,*ss_str; 
-    atom_id     *index;
-    rvec        *xp,*x,*xr;
-    char        pdbfile[32],refpdb[256],title[256],rtitle[256],filemode[5];
-    char        out_title[256];
-    char        multiprot[256],*mptr;
-    int         ftp;
-    int         outftp=-1;
-    real        rmsd;
-    bool        bTrjout,bCountres;
-    const char  *TrjoutFile=NULL;
-    output_env_t oenv;
-    static rvec translation={0,0,0},rotangles={0,0,0};
-    gmx_rmpbc_t gpbc=NULL;
-    
-    t_filenm   fnm[] = {
-       { efTRX, "-f",   NULL,      ffREAD },
-       { efTPS, NULL,   NULL,      ffREAD },
-       { efNDX, NULL,   NULL,      ffOPTRD },
-       { efSTX, "-r",   NULL     , ffREAD },
-       { efXVG, "-o",  "rmss",     ffWRITE },
-       { efXVG, "-rc", "rescount", ffWRITE},
-       { efXVG, "-cr", "countres", ffOPTWR},
-       { efTRX, "-ox", "aligned",  ffOPTWR }
-    };
-#define NFILE asize(fnm)
-    
-    CopyRight(stderr,argv[0]);
-    parse_common_args(&argc,argv,PCA_CAN_TIME | PCA_CAN_VIEW | PCA_TIME_UNIT,
-                     NFILE,fnm, asize(pa),pa, asize(desc),desc,
-                     asize(bugs),bugs,&oenv
-       );
-    fnRef=opt2fn("-r",NFILE,fnm);
-    bTrjout = opt2bSet("-ox",NFILE,fnm);
-    bCountres=  opt2bSet("-cr",NFILE,fnm);
-    
-    if (bTrjout) {
-       TrjoutFile = opt2fn_null("-ox",NFILE,fnm);
-    }
-    
-    read_tps_conf(ftp2fn(efTPS,NFILE,fnm),title,&top,&ePBC,&xp,NULL,box,FALSE);
-    gpbc = gmx_rmpbc_init(&top.idef,ePBC,top.atoms.nr,box);
-    atoms=&(top.atoms);
-
-    ftp=fn2ftp(fnRef);
-    get_stx_coordnum(fnRef,&nratoms);
-    init_t_atoms(&ratoms,nratoms,TRUE);  
-    snew(xr,nratoms);
-    read_stx_conf(fnRef,rtitle,&ratoms,xr,NULL,&ePBC,rbox);
-    
-    if (bVerbose) {
-       fprintf(stderr,"Read %d atoms\n",atoms->nr); 
-       fprintf(stderr,"Read %d reference atoms\n",ratoms.nr); 
-    }
-    if (bCountres) {
-       snew(countres,ratoms.nres);
-       j=0;
-       cur_res=0;
-       for (i=0;i<ratoms.nr;i++) {
-           prev_res=cur_res;
-           cur_res=ratoms.atom[i].resind;
-           if (cur_res != prev_res) {
-               countres[j].resnr=cur_res;
-               countres[j].count=0;
-               j++;
-           }
-       }
-    }
-    get_index(atoms,ftp2fn_null(efNDX,NFILE,fnm),1,&gnx,&index,&grpnm);
-    nres=0;
-    nr0=-1;
-    for(i=0; (i<gnx); i++) {
-       if (atoms->atom[index[i]].resind != nr0) {
-           nr0=atoms->atom[index[i]].resind;
-           nres++;
-       }
-    }
-    fprintf(stderr,"There are %d residues in your selected group\n",nres);
-    
-    strcpy(pdbfile,"ddXXXXXX");
-    gmx_tmpnam(pdbfile);
-    if ((tmpf = fopen(pdbfile,"w")) == NULL) {
-       sprintf(pdbfile,"%ctmp%cfilterXXXXXX",DIR_SEPARATOR,DIR_SEPARATOR);
-       gmx_tmpnam(pdbfile);
-       if ((tmpf = fopen(pdbfile,"w")) == NULL) {
-           gmx_fatal(FARGS,"Can not open tmp file %s",pdbfile);
-       }
-    }
-    else {
-       gmx_ffclose(tmpf);
-    }
-
-    if (ftp != efPDB) {
-       strcpy(refpdb,"ddXXXXXX");
-       gmx_tmpnam(refpdb);
-       strcat(refpdb,".pdb");
-       write_sto_conf(refpdb,rtitle,&ratoms,xr,NULL,ePBC,rbox);
-    }
-    else {
-       strcpy(refpdb,fnRef);
-    }
-
-    if ((mptr=getenv("MULTIPROT")) == NULL) {
-       mptr="/usr/local/bin/multiprot";
-    }
-    if (!gmx_fexist(mptr)) {
-       gmx_fatal(FARGS,"MULTIPROT executable (%s) does not exist (use setenv MULTIPROT)",
-                 mptr);
-    }
-    sprintf (multiprot,"%s %s %s > /dev/null %s",
-            mptr, refpdb, pdbfile, "2> /dev/null");
-    
-    if (bVerbose)
-       fprintf(stderr,"multiprot cmd='%s'\n",multiprot);
-    
-    if (!read_first_frame(oenv,&status,ftp2fn(efTRX,NFILE,fnm),&fr,TRX_READ_X)) 
-       gmx_fatal(FARGS,"Could not read a frame from %s",ftp2fn(efTRX,NFILE,fnm));
-    natoms = fr.natoms;
-
-    if (bTrjout) {
-       nout=natoms;
-       /* open file now */
-       outftp=fn2ftp(TrjoutFile);
-       if (bVerbose)
-           fprintf(stderr,"Will write %s: %s\n",ftp2ext(ftp),ftp2desc(outftp));
-       strcpy(filemode,"w");
-       switch (outftp) {
-           case efXTC:
-           case efG87:
-           case efTRR:
-           case efTRJ:
-               out=NULL;
-               trxout = open_trx(TrjoutFile,filemode);
-               break;
-           case efGRO:
-           case efG96:
-           case efPDB:
-               /* Make atoms struct for output in GRO or PDB files */
-               /* get memory for stuff to go in pdb file */
-               init_t_atoms(&useatoms,nout,FALSE);
-               sfree(useatoms.resinfo);
-               useatoms.resinfo=atoms->resinfo;
-               for(i=0;(i<nout);i++) {
-                   useatoms.atomname[i]=atoms->atomname[i];
-                   useatoms.atom[i]=atoms->atom[i];
-                   useatoms.nres=max(useatoms.nres,useatoms.atom[i].resind+1);
-               }
-               useatoms.nr=nout;
-               out=gmx_ffopen(TrjoutFile,filemode);
-               break;
-       }
-    }
-    
-    if (natoms > atoms->nr) {
-       gmx_fatal(FARGS,"\nTrajectory does not match topology!");
-    }
-    if (gnx > natoms) {
-       gmx_fatal(FARGS,"\nTrajectory does not match selected group!");
-    }
-
-    fo = xvgropen(opt2fn("-o",NFILE,fnm),"RMSD","Time (ps)","RMSD (nm)",oenv);
-    frc = xvgropen(opt2fn("-rc",NFILE,fnm),"Number of Residues in the alignment","Time (ps)","Residues",oenv);
-    
-    do {
-       t = output_env_conv_time(oenv,fr.time);
-       gmx_rmpbc(gpbc,natoms,fr.box,fr.x);
-       tapein=gmx_ffopen(pdbfile,"w");
-       write_pdbfile_indexed(tapein,NULL,atoms,fr.x,ePBC,fr.box,' ',-1,gnx,index,NULL,TRUE); 
-       gmx_ffclose(tapein);
-       system(multiprot);
-       remove(pdbfile);
-       process_multiprot_output(fn, &rmsd, &nres2,rotangles,translation,bCountres,countres);
-       fprintf(fo,"%12.7f",t);
-       fprintf(fo," %12.7f\n",rmsd);
-       fprintf(frc,"%12.7f",t);
-       fprintf(frc,"%12d\n",nres2);
-       if (bTrjout) {
-           rotate_conf(natoms,fr.x,NULL,rotangles[XX],rotangles[YY],rotangles[ZZ]);
-           for(i=0; i<natoms; i++) {
-               rvec_inc(fr.x[i],translation);
-           }
-           switch(outftp) {
-               case efTRJ:
-               case efTRR:
-               case efG87:
-               case efXTC:
-                   write_trxframe(trxout,&fr,NULL);
-                   break;
-               case efGRO:
-               case efG96:
-               case efPDB:
-                   sprintf(out_title,"Generated by do_multiprot : %s t= %g %s",
-                           title,output_env_conv_time(oenv,fr.time),output_env_get_time_unit(oenv));
-                   switch(outftp) {
-                       case efGRO: 
-                           write_hconf_p(out,out_title,&useatoms,prec2ndec(fr.prec),
-                                         fr.x,NULL,fr.box);
-                           break;
-                       case efPDB:
-                           fprintf(out,"REMARK    GENERATED BY DO_MULTIPROT\n");
-                           sprintf(out_title,"%s t= %g %s",title,output_env_conv_time(oenv,fr.time),output_env_get_time_unit(oenv));
-                           /* if reading from pdb, we want to keep the original 
-                              model numbering else we write the output frame
-                              number plus one, because model 0 is not allowed in pdb */
-                           if (ftp==efPDB && fr.step > model_nr) {
-                               model_nr = fr.step;
-                           }
-                           else {
-                               model_nr++;
-                           }
-                           write_pdbfile(out,out_title,&useatoms,fr.x,ePBC,fr.box,' ',model_nr,NULL,TRUE);
-                           break;
-                       case efG96:
-                           fr.title = out_title;
-                           fr.bTitle = (nframe == 0);
-                           fr.bAtoms = FALSE;
-                           fr.bStep = TRUE;
-                           fr.bTime = TRUE;
-                           write_g96_conf(out,&fr,-1,NULL);
-                   }
-                   break;
-           }
-       }
-       nframe++;
-    } while(read_next_frame(oenv,status,&fr));
-    if (bCountres) {
-       fres=  xvgropen(opt2fn("-cr",NFILE,fnm),"Number of frames in which the residues are aligned to","Residue","Number",oenv);
-       for (i=0;i<ratoms.nres;i++) {
-           fprintf(fres,"%10d  %12d\n",countres[i].resnr,countres[i].count);
-       }
-       gmx_ffclose(fres);
-    }
-    gmx_ffclose(fo);
-    gmx_ffclose(frc);
-    fprintf(stderr,"\n");
-    close_trx(status);
-    if (trxout != NULL) {
-       close_trx(trxout);
-    }
-    else if (out != NULL) {
-       gmx_ffclose(out);
-    }
-    view_all(oenv,NFILE, fnm);
-    sfree(xr);
-    if (bCountres) {
-       sfree(countres);
-    }
-    free_t_atoms(&ratoms,TRUE);
-    if (bTrjout) {
-       if (outftp==efPDB || outftp==efGRO || outftp==efG96) {
-           free_t_atoms(&useatoms,TRUE);
-       }
-    }
-    gmx_thanx(stderr);
-    return 0;
-}
diff --git a/src/contrib/do_shift.c b/src/contrib/do_shift.c
deleted file mode 100644 (file)
index bd44853..0000000
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
- * 
- *                This source code is part of
- * 
- *                 G   R   O   M   A   C   S
- * 
- *          GROningen MAchine for Chemical Simulations
- * 
- *                        VERSION 3.3.99_development_20071104
- * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
- * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2006, The GROMACS development team,
- * check out http://www.gromacs.org for more information.
-
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- * 
- * If you want to redistribute modifications, please consider that
- * scientific software is very special. Version control is crucial -
- * bugs must be traceable. We will be happy to consider code for
- * inclusion in the official distribution, but derived work must not
- * be called official GROMACS. Details are found in the README & COPYING
- * files - if they are missing, get the official version at www.gromacs.org.
- * 
- * To help us fund GROMACS development, we humbly ask that you cite
- * the papers on the package - you can find them in the top README file.
- * 
- * For more info, check our website at http://www.gromacs.org
- * 
- * And Hey:
- * Groningen Machine for Chemical Simulation
- */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdlib.h>
-#include "errno.h"
-#include "typedefs.h"
-#include "gromacs/utility/cstringutil.h"
-#include "macros.h"
-#include "gromacs/utility/smalloc.h"
-#include "gromacs/commandline/pargs.h"
-#include "copyrite.h"
-#include "gromacs/fileio/confio.h"
-#include "gromacs/utility/fatalerror.h"
-#include "gromacs/fileio/xvgr.h"
-#include "gstat.h"
-#include "gromacs/topology/index.h"
-#include "gromacs/fileio/pdbio.h"
-
-void cat(FILE *out,char *fn,real t)
-{
-  FILE *in;
-  char *ptr,buf[256];
-  int    anr,rnr;
-  char   anm[24],rnm[24];
-  double f1,f2,f3,f4,f5,f6;
-   
-  in=gmx_ffopen(fn,"r");
-  while ((ptr=fgets2(buf,255,in)) != NULL) {
-    sscanf(buf,"%d%d%s%s%lf%lf%lf%lf%lf%lf",
-          &anr,&rnr,rnm,anm,&f1,&f2,&f3,&f4,&f5,&f6);
-    fprintf(out,"%8g  %10g  %10g  %10g  %10g  %10g  %10g  %s%d-%s%d\n",
-           t,f6,f1,f2,f3,f4,f5,rnm,rnr,anm,anr);
-  }
-  /*if ((int)strlen(buf) > 0) 
-    fprintf(out,"%s\n",buf);*/
-  fflush(out);
-  gmx_ffclose(in);
-}
-
-int main(int argc,char *argv[])
-{
-  static char *desc[] = {
-    "[TT]do_shift[tt] reads a trajectory file and computes the chemical",
-    "shift for each time frame (or every [BB]dt[bb] ps) by",
-    "calling the 'total' program. If you do not have the total program,",
-    "get it. do_shift assumes that the total executable is in",
-    "[TT]/home/mdgroup/total/total[tt]. If that is not the case, then you should",
-    "set an environment variable [BB]GMX_TOTAL[bb] as in: [PAR]",
-    "[TT]setenv GMX_TOTAL /usr/local/bin/total[tt][PAR]",
-    "where the right hand side should point to the total executable.[PAR]",
-    "Output is printed in files [TT]shift.out[tt] where t is the time of the frame.[PAR]",
-    "The program also needs an input file called [BB]random.dat[bb] which",
-    "contains the random coil chemical shifts of all protons."
-  };
-  static real dt=0.0;
-  t_pargs pa[] = {
-    { "-dt", FALSE, etREAL, { &dt }, "Time interval between frames." }
-  };
-  static char *bugs[] = {
-    "The program is very slow"
-  };
-  static     char *OXYGEN="O";
-  FILE       *out,*tot,*fp;
-  t_topology *top;
-  t_atoms    *atoms;
-  int        status,nres;
-  real       t,nt;
-  int        i,natoms,nframe=0;
-  matrix     box;
-  int        gnx;
-  char       *grpnm,*randf;
-  atom_id    *index;
-  rvec       *x,*x_s;
-  char       pdbfile[32],tmpfile[32];
-  char       total[256],*dptr;
-  t_filenm   fnm[] = {
-    { efTRX, "-f",   NULL,     ffREAD },
-    { efTPX, NULL,   NULL,     ffREAD },
-    { efNDX, NULL,   NULL,     ffREAD },
-    { efOUT, "-o",   "shift",  ffWRITE },
-    { efDAT, "-d",   "random", ffREAD }
-  };
-  char *leg[] = { "shift","ring","anisCO","anisCN","sigmaE","sum" };
-#define NFILE asize(fnm)
-
-  CopyRight(stdout,argv[0]);
-  parse_common_args(&argc,argv,PCA_CAN_TIME,NFILE,fnm,
-                   asize(pa),pa,asize(desc),desc,asize(bugs),bugs);
-                   
-  top=read_top(ftp2fn(efTPX,NFILE,fnm));
-  atoms=&(top->atoms);
-  nres=atoms->nres;
-  for(i=0; (i<atoms->nr); i++)
-    if ((strcmp(*atoms->atomname[i],"O1") == 0) ||
-       (strcmp(*atoms->atomname[i],"O2") == 0) ||
-       (strcmp(*atoms->atomname[i],"OXT") == 0) ||
-       (strcmp(*atoms->atomname[i],"OT") == 0))
-      atoms->atomname[i]=&OXYGEN;
-  rd_index(ftp2fn(efNDX,NFILE,fnm),1,&gnx,&index,&grpnm);
-  
-  snew(x_s,atoms->nr);
-
-  strcpy(pdbfile,"dsXXXXXX");
-  gmx_tmpnam(pdbfile);
-  strcpy(tmpfile,"dsXXXXXX");
-  gmx_tmpnam(tmpfile);
-  fprintf(stderr,"pdbfile = %s\ntmpfile = %s\n",pdbfile,tmpfile);
-  
-  if ((dptr=getenv("GMX_TOTAL")) == NULL)
-    dptr="/home/mdgroup/total/total";
-  sprintf(total,"%s > /dev/null",dptr);
-  fprintf(stderr,"total cmd='%s'\n",total);
-  randf=ftp2fn(efDAT,NFILE,fnm);
-  
-  natoms=read_first_x(&status,ftp2fn(efTRX,NFILE,fnm),&t,&x,box);
-  if (natoms != atoms->nr) 
-    gmx_fatal(FARGS,"Trajectory does not match topology!");
-  out=ftp2FILE(efOUT,NFILE,fnm,"w");
-  xvgr_legend(out,asize(leg),leg);
-  nt=t;
-  do {
-    if (t >= nt) {
-      rm_pbc(&(top->idef),top->atoms.nr,box,x,x_s);
-      fp=gmx_ffopen(pdbfile,"w");
-      write_pdbfile_indexed(fp,"Generated by do_shift",
-                           atoms,x_s,box,0,-1,gnx,index);
-      gmx_ffclose(fp);
-      
-      if ((tot=popen(total,"w")) == NULL)
-       perror("opening pipe to total");
-      fprintf(tot,"%s\n",pdbfile);
-      fprintf(tot,"%s\n",tmpfile);
-      fprintf(tot,"3\n");
-      fprintf(tot,"N\n");
-      fprintf(tot,"%s\n",randf);
-      fprintf(tot,"N\n");
-      fprintf(tot,"N\n");
-      if (pclose(tot) != 0)
-       perror("closing pipe to total");
-      cat(out,tmpfile,t);
-      remove(pdbfile);
-      remove(tmpfile);
-      nt+=dt;
-      nframe++;
-    }
-  } while(read_next_x(status,&t,natoms,x,box));
-  close_trx(status);
-  gmx_ffclose(out);
-  
-  gmx_thanx(stderr);
-  
-  return 0;
-}
diff --git a/src/contrib/ehanal.c b/src/contrib/ehanal.c
deleted file mode 100644 (file)
index 31c6870..0000000
+++ /dev/null
@@ -1,430 +0,0 @@
-/*
- * 
- *                This source code is part of
- * 
- *                 G   R   O   M   A   C   S
- * 
- *          GROningen MAchine for Chemical Simulations
- * 
- *                        VERSION 3.3.3
- * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
- * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2008, The GROMACS development team,
- * check out http://www.gromacs.org for more information.
-
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- * 
- * If you want to redistribute modifications, please consider that
- * scientific software is very special. Version control is crucial -
- * bugs must be traceable. We will be happy to consider code for
- * inclusion in the official distribution, but derived work must not
- * be called official GROMACS. Details are found in the README & COPYING
- * files - if they are missing, get the official version at www.gromacs.org.
- * 
- * To help us fund GROMACS development, we humbly ask that you cite
- * the papers on the package - you can find them in the top README file.
- * 
- * For more info, check our website at http://www.gromacs.org
- * 
- * And Hey:
- * Groningen Machine for Chemical Simulation
- */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
-#include "macros.h"
-#include "gromacs/utility/fatalerror.h"
-#include "random.h"
-#include "gromacs/fileio/pdbio.h"
-#include "gromacs/utility/futil.h"
-#include "gromacs/math/units.h"
-#include "gromacs/fileio/xvgr.h"
-#include "gromacs/math/vec.h"
-#include "names.h"
-#include "ehdata.h"
-#include "gromacs/fileio/pdbio.h"
-
-t_histo *init_histo(int np,real minx,real maxx)
-{
-  t_histo *h;
-  
-  snew(h,1);
-  snew(h->y,np+1);
-  snew(h->nh,np+1);
-  h->np   = np;
-  if (maxx <= minx)
-    gmx_fatal(FARGS,"minx (%f) should be less than maxx (%f) in init_histo",minx,maxx);
-  h->minx = minx;
-  h->maxx = maxx;
-  h->dx_1 = np/(maxx-minx);
-  h->dx   = (maxx-minx)/np;
-  
-  return h;
-}
-
-void done_histo(t_histo *h)
-{
-  sfree(h->y);
-  sfree(h->nh);
-  h->np = 0;
-}
-
-void add_histo(t_histo *h,real x,real y)
-{
-  int n;
-  
-  n = (x-h->minx)*h->dx_1;
-  if ((n < 0) || (n > h->np)) 
-    gmx_fatal(FARGS,"Invalid x (%f) in add_histo. Should be in %f - %f",x,h->minx,h->maxx);
-  h->y[n] += y;
-  h->nh[n]++;
-}
-
-void dump_histo(t_histo *h,char *fn,char *title,char *xaxis,char *yaxis,
-               int enorm,real norm_fac)
-{
-  FILE *fp;
-  int  i,nn;
-  
-  for(nn=h->np; (nn > 0); nn--)
-    if (h->nh[nn] != 0) 
-      break;
-  for(i=0; (i<nn); i++)
-    if (h->nh[i] > 0)
-      break;
-  fp = xvgropen(fn,title,xaxis,yaxis);
-  for(  ; (i<nn); i++) {
-    switch (enorm) {
-    case enormNO:
-      fprintf(fp,"%12f  %12f  %d\n",h->minx+h->dx*i,h->y[i],h->nh[i]);
-      break;
-    case enormFAC:
-      fprintf(fp,"%12f  %12f  %d\n",h->minx+h->dx*i,h->y[i]*norm_fac,h->nh[i]);
-      break;
-    case enormNP:
-      if (h->nh[i] > 0)
-       fprintf(fp,"%12f  %12f  %d\n",
-               h->minx+h->dx*i,h->y[i]*norm_fac/h->nh[i],h->nh[i]);
-      break;
-    default:
-      gmx_fatal(FARGS,"Wrong value for enorm (%d)",enorm);
-    }
-  }
-  gmx_ffclose(fp);
-}
-
-/*******************************************************************
- *
- * Functions to analyse and monitor scattering
- *
- *******************************************************************/  
-
-void add_scatter_event(t_ana_scat *scatter,rvec pos,gmx_bool bInel,
-                      real t,real ekin)
-{
-  int np = scatter->np;
-  
-  if (np == scatter->maxp) {
-    scatter->maxp += 32;
-    srenew(scatter->time,scatter->maxp);
-    srenew(scatter->ekin,scatter->maxp);
-    srenew(scatter->bInel,scatter->maxp);
-    srenew(scatter->pos,scatter->maxp);
-  }
-  scatter->time[np]  = t;
-  scatter->bInel[np] = np;
-  scatter->ekin[np]  = ekin;
-  copy_rvec(pos,scatter->pos[np]);
-  scatter->np++;
-}
-
-void reset_ana_scat(t_ana_scat *scatter)
-{
-  scatter->np = 0;
-}
-
-void done_scatter(t_ana_scat *scatter)
-{
-  scatter->np = 0;
-  sfree(scatter->time);
-  sfree(scatter->ekin);
-  sfree(scatter->bInel);
-  sfree(scatter->pos);
-}
-
-void analyse_scatter(t_ana_scat *scatter,t_histo *hmfp)
-{
-  int   i,n;
-  rvec  dx;
-  
-  if (scatter->np > 1) {
-    for(i=1; (i<scatter->np); i++) {
-      rvec_sub(scatter->pos[i],scatter->pos[i-1],dx);
-      add_histo(hmfp,scatter->ekin[i],norm(dx));
-    }
-  }
-}
-
-/*******************************************************************
- *
- * Functions to analyse structural changes
- *
- *******************************************************************/  
-
-t_ana_struct *init_ana_struct(int nstep,int nsave,real timestep,
-                             int maxparticle)
-{
-  t_ana_struct *anal;
-  
-  snew(anal,1);
-  anal->nanal = 1.2*((nstep / nsave)+1);
-  anal->index = 0;
-  anal->dt    = nsave*timestep;
-  snew(anal->t,anal->nanal);
-  snew(anal->maxdist,anal->nanal);
-  snew(anal->d2_com,anal->nanal);
-  snew(anal->d2_origin,anal->nanal);
-  snew(anal->nion,anal->nanal);
-  anal->nstruct   = 1;
-  anal->nparticle = 1;
-  anal->maxparticle = maxparticle;
-  snew(anal->q,1);
-  snew(anal->x,1);
-  snew(anal->x[0],maxparticle);
-  
-  return anal;
-}
-
-void done_ana_struct(t_ana_struct *anal)
-{
-  int i;
-  
-  sfree(anal->t);
-  sfree(anal->maxdist);
-  sfree(anal->d2_com);
-  sfree(anal->d2_origin);
-  sfree(anal->nion);
-  sfree(anal->q);
-  for(i=0; (i<anal->nstruct); i++)
-    sfree(anal->x[i]);
-  sfree(anal->x);
-}
-
-void reset_ana_struct(t_ana_struct *anal)
-{
-  int i;
-  
-  for(i=0; (i<anal->nanal); i++) {
-    anal->t[i] = 0;
-    anal->maxdist[i] = 0;
-    clear_rvec(anal->d2_com[i]);
-    clear_rvec(anal->d2_origin[i]);
-    anal->nion[i] = 0;
-  }
-  anal->index = 0;
-}
-
-void add_ana_struct(t_ana_struct *total,t_ana_struct *add)
-{
-  int i,m;
-  
-  if (total->index == 0)
-    total->index = add->index;
-  else if (total->index != add->index)
-    gmx_fatal(FARGS,"Analysis incompatible (total: %d, add: %d) %s, %d",
-               total->index,add->index,__FILE__,__LINE__);
-  for(i=0; (i<total->index); i++) {
-    if (total->t[i] == 0)
-      total->t[i] = add->t[i];
-    else if (total->t[i] != add->t[i])
-      gmx_fatal(FARGS,"Inconsistent times in analysis (%f-%f) %s, %d",
-                 total->t[i],add->t[i],__FILE__,__LINE__);
-    if (add->maxdist[i] > total->maxdist[i])
-      total->maxdist[i]  = add->maxdist[i];
-    for(m=0; (m<DIM); m++) {
-      total->d2_com[i][m]    += add->d2_com[i][m]/add->nion[i];
-      total->d2_origin[i][m] += add->d2_origin[i][m]/add->nion[i];
-    }
-    total->nion[i]     += add->nion[i];
-  }
-}
-
-static void do_add_struct(t_ana_struct *anal,int nparticle,rvec x[])
-{
-  int i,j;
-  
-  if (nparticle > anal->nparticle) {
-    for(i=0; (i<anal->nstruct); i++) {
-      for(j=anal->nparticle; (j<nparticle); j++)
-       copy_rvec(x[j],anal->x[i][j]);
-    }
-  }
-  anal->nparticle=nparticle;
-  srenew(anal->x,anal->nstruct+1);
-  snew(anal->x[anal->nstruct],anal->maxparticle);
-  for(j=0; (j<nparticle); j++)
-    copy_rvec(x[j],anal->x[anal->nstruct][j]);
-  anal->nstruct++;
-}
-
-void analyse_structure(t_ana_struct *anal,real t,rvec center,
-                      rvec x[],int nparticle,real charge[])
-{
-  int  i,j,m,nel,n=0;
-  rvec dx,com;
-  real dx2,dx1;
-  
-  j = anal->index;
-  if (j >= anal->nanal)
-    gmx_fatal(FARGS,"Too many points in analyse_structure");
-  anal->t[j]       = t;
-  anal->maxdist[j] = 0;
-  clear_rvec(com);
-  nel = 0;
-  for(i=0; (i<nparticle); i++) {
-    if (charge[i] < 0) {
-      rvec_inc(com,x[i]);
-      nel++;
-    }
-  }
-  if (nel > 0)
-    for(m=0; (m<3); m++)
-      com[m] /= nel;
-  for(i=0; (i<nparticle); i++) {
-    if (charge[i] < 0) {
-      rvec_sub(x[i],com,dx);
-      for(m=0; (m<DIM); m++) {
-       anal->d2_com[j][m]    += sqr(dx[m]);
-       anal->d2_origin[j][m] += sqr(x[i][m]);
-      }
-      dx2 = iprod(x[i],x[i]);
-      dx1 = sqrt(dx2);
-      if (dx1 > anal->maxdist[j])
-       anal->maxdist[j] = dx1;
-      n++;
-    }
-  }
-  do_add_struct(anal,nparticle,x);
-  anal->nion[j] = n;
-  anal->index++;
-}
-
-void dump_ana_struct(char *rmax,char *nion,char *gyr_com,char *gyr_origin,
-                    t_ana_struct *anal,int nsim)
-{
-  FILE *fp,*gp,*hp,*kp;
-  int  i,j;
-  real t,d2;
-  char *legend[] = { "Rg", "RgX", "RgY", "RgZ" };
-  
-  fp = xvgropen(rmax,"rmax","Time (fs)","r (nm)");
-  gp = xvgropen(nion,"N ion","Time (fs)","N ions");
-  hp = xvgropen(gyr_com,"Radius of gyration wrt. C.O.M.",
-               "Time (fs)","Rg (nm)");
-  xvgr_legend(hp,asize(legend),legend);
-  kp = xvgropen(gyr_origin,"Radius of gyration wrt. Origin",
-               "Time (fs)","Rg (nm)");
-  xvgr_legend(kp,asize(legend),legend);
-  for(i=0; (i<anal->index); i++) {
-    t = 1000*anal->t[i];
-    fprintf(fp,"%12g  %10.3f\n",t,anal->maxdist[i]);
-    fprintf(gp,"%12g  %10.3f\n",t,(1.0*anal->nion[i])/nsim-1);
-    d2 = anal->d2_com[i][XX] + anal->d2_com[i][YY] + anal->d2_com[i][ZZ];
-    fprintf(hp,"%12g  %10.3f  %10.3f  %10.3f  %10.3f\n",
-           t,sqrt(d2/nsim),
-           sqrt(anal->d2_com[i][XX]/nsim),
-           sqrt(anal->d2_com[i][YY]/nsim),
-           sqrt(anal->d2_com[i][ZZ]/nsim));
-    d2 = anal->d2_origin[i][XX] + anal->d2_origin[i][YY] + anal->d2_origin[i][ZZ];
-    fprintf(kp,"%12g  %10.3f  %10.3f  %10.3f  %10.3f\n",
-           t,sqrt(d2/nsim),
-           sqrt(anal->d2_origin[i][XX]/nsim),
-           sqrt(anal->d2_origin[i][YY]/nsim),
-           sqrt(anal->d2_origin[i][ZZ]/nsim));
-  }
-  gmx_ffclose(hp);
-  gmx_ffclose(gp);
-  gmx_ffclose(fp);
-  gmx_ffclose(kp);
-}
-
-void dump_as_pdb(char *pdb,t_ana_struct *anal)
-{
-  FILE *kp;
-  int  i,j;
-  real t;
-  
-  kp = gmx_ffopen(pdb,"w");
-  for(i=0; (i<anal->nstruct); i++) {
-    t = 1000*anal->t[i];
-    fprintf(kp,"MODEL  %d  time %g fs\n",i+1,t);
-    for(j=0; (j<anal->nparticle); j++) {
-      fprintf(kp,get_pdbformat(),"ATOM",i+1,(j < anal->nion[i]) ? "O" : "N",
-             "PLS",' ',1,
-             anal->x[i][j][XX]/100,
-             anal->x[i][j][YY]/100,
-             anal->x[i][j][ZZ]/100);
-      fprintf(kp,"\n");
-    }
-    fprintf(kp,"ENDMDL\n");
-  }
-  gmx_ffclose(kp);
-}
-
-char *enms[eNR] = {
-  "Coulomb", "Repulsion", "Potential",
-  "EkHole",  "EkElectron", "EkLattice", "Kinetic",
-  "Total"
-};
-
-void add_ana_ener(t_ana_ener *ae,int nn,real e[])
-{
-  int i;
-  /* First time around we are constantly increasing the array size */ 
-  if (nn >= ae->nx) {
-    if (ae->nx == ae->maxx) {
-      ae->maxx += 1024;
-      srenew(ae->e,ae->maxx);
-    }
-    for(i=0; (i<eNR); i++)
-      ae->e[ae->nx][i] = e[i];
-    ae->nx++;
-  }
-  else {
-    for(i=0; (i<eNR); i++)
-      ae->e[nn][i] += e[i];
-  }
-}
-
-void dump_ana_ener(t_ana_ener *ae,int nsim,real dt,char *edump,
-                  t_ana_struct *total)
-{
-  FILE *fp;
-  int  i,j;
-  real fac;
-  
-  fac = 1.0/(nsim*ELECTRONVOLT);
-  fp=xvgropen(edump,"Energies","Time (fs)","E (eV)");
-  xvgr_legend(fp,eNR,enms);
-  fprintf(fp,"@ s%d legend \"Ek/Nelec\"\n",eNR);
-  fprintf(fp,"@ type nxy\n");
-  for(i=0; (i<ae->nx); i++) {
-    fprintf(fp,"%10f",1000.0*dt*i);
-    for(j=0; (j<eNR); j++)
-      fprintf(fp,"  %8.3f",ae->e[i][j]*fac);
-    fprintf(fp,"  %8.3f\n",ae->e[i][eELECTRON]/(ELECTRONVOLT*total->nion[i]));
-  }    
-  fprintf(fp,"&\n");
-  gmx_ffclose(fp);
-}
-
diff --git a/src/contrib/ehdata.c b/src/contrib/ehdata.c
deleted file mode 100644 (file)
index 824aafa..0000000
+++ /dev/null
@@ -1,528 +0,0 @@
-/*
- * 
- *                This source code is part of
- * 
- *                 G   R   O   M   A   C   S
- * 
- *          GROningen MAchine for Chemical Simulations
- * 
- *                        VERSION 3.3.3
- * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
- * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2008, The GROMACS development team,
- * check out http://www.gromacs.org for more information.
-
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- * 
- * If you want to redistribute modifications, please consider that
- * scientific software is very special. Version control is crucial -
- * bugs must be traceable. We will be happy to consider code for
- * inclusion in the official distribution, but derived work must not
- * be called official GROMACS. Details are found in the README & COPYING
- * files - if they are missing, get the official version at www.gromacs.org.
- * 
- * To help us fund GROMACS development, we humbly ask that you cite
- * the papers on the package - you can find them in the top README file.
- * 
- * For more info, check our website at http://www.gromacs.org
- * 
- * And Hey:
- * Groningen Machine for Chemical Simulation
- */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdlib.h>
-#include <math.h>
-#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
-#include "macros.h"
-#include "gromacs/utility/fatalerror.h"
-#include "random.h"
-#include "gromacs/utility/strdb.h"
-#include "gromacs/utility/futil.h"
-#include "ehdata.h"
-
-typedef struct {
-  int  nener,nomega,nq;     /* Number of entries in the table      */
-  real *ener;               /* Energy values                       */
-  real **omega;             /* Omega values (energy dependent)     */
-  real ***prob,***q;        /* Probability and Q                   */
-} t_pq_inel;
-
-typedef struct {
-  int  nener,n2Ddata;       /* Number of entries in the table      */
-  real *ener;               /* Energy values                       */
-  real **prob,**data;       /* Probability and data (energy loss)  */
-} t_p2Ddata;
-
-static int realcomp(const void *a,const void *b)
-{
-  real *ra,*rb;
-  
-  ra = (real *)a;
-  rb = (real *)b;
-  if (ra < rb)
-    return -1;
-  else if (ra > rb)
-    return 1;
-  else 
-    return 0;
-}
-
-static t_p2Ddata *read_p2Ddata(char *fn)
-{
-  FILE    *fp;
-  t_p2Ddata *p2Ddata;
-  int     i,j;
-  double  e,p,o;
-  
-  fprintf(stdout,"Going to read %s\n",fn);
-  fp = gmx_ffopen(fn,"r");
-
-  /* Allocate memory and set constants */
-  snew(p2Ddata,1);
-  if (fscanf(fp,"%d%d",&p2Ddata->nener,&p2Ddata->n2Ddata) != 2)
-    gmx_fatal(FARGS,"I need two integers: nener, n in file %s",fn);
-  
-  snew(p2Ddata->ener,p2Ddata->nener);
-  snew(p2Ddata->prob,p2Ddata->nener);
-  snew(p2Ddata->data,p2Ddata->nener);
-  
-  /* Double loop to read data */
-  for(i=0; (i<p2Ddata->nener); i++) {
-    fprintf(stderr,"\rEnergy %d/%d",i+1,p2Ddata->nener);
-    snew(p2Ddata->prob[i],p2Ddata->n2Ddata);
-    snew(p2Ddata->data[i],p2Ddata->n2Ddata);
-    
-    for(j=0; (j<p2Ddata->n2Ddata); j++) {
-      fscanf(fp,"%lf%lf%lf",&e,&p,&o);
-
-      /* Consistency check */
-      if (j==0)
-       p2Ddata->ener[i] = e;
-      else if (fabs(p2Ddata->ener[i]-e) > 1e-6*e)
-       gmx_fatal(FARGS,"Inconsistent energy %f i=%d j=%d",e,i,j);
-      p2Ddata->prob[i][j] = p;
-      p2Ddata->data[i][j] = o;
-    }
-    /* There is some noise on the data, take it away by sorting,
-     * because otherwise binary search does not work.
-     * This is equivalent to shifting in the data slightly along the X-axis
-     * but better than linear search with the "real" data.
-     */
-    qsort(p2Ddata->data[i],p2Ddata->n2Ddata,sizeof(p2Ddata->data[0][0]),
-         realcomp);
-  }
-  fprintf(stderr,"\n");
-  
-  gmx_ffclose(fp);
-  
-  return p2Ddata;
-}
-
-static t_pq_inel *read_pq(char *fn)
-{
-  FILE      *fp;
-  t_pq_inel *pq;
-  int       i,j,k;
-  double    e,p,o,t;
-  
-  fprintf(stdout,"Going to read %s\n",fn);
-  fp = gmx_ffopen(fn,"r");
-
-  /* Allocate memory and set constants */
-  snew(pq,1);
-  if (fscanf(fp,"%d%d%d",&pq->nener,&pq->nomega,&pq->nq) != 3)
-    gmx_fatal(FARGS,"I need three integers: nener, nomega, nq in file %s",fn);
-  
-  snew(pq->ener,pq->nener);
-  snew(pq->omega,pq->nener);
-  snew(pq->prob,pq->nener);
-  snew(pq->q,pq->nener);
-  
-  /* Triple loop to read data */
-  for(i=0; (i<pq->nener); i++) {
-    fprintf(stderr,"\rEnergy %d/%d",i+1,pq->nener);
-    snew(pq->prob[i],pq->nomega);
-    snew(pq->q[i],pq->nomega);
-    snew(pq->omega[i],pq->nomega);
-    
-    for(j=0; (j<pq->nomega); j++) {
-      snew(pq->prob[i][j],pq->nq);
-      snew(pq->q[i][j],pq->nq);
-      
-      for(k=0; (k<pq->nq); k++) {
-       fscanf(fp,"%lf%lf%lf%lf",&e,&o,&p,&t);
-       
-       /* Consistency check */
-       if ((j == 0) && (k == 0)) 
-         pq->ener[i] = e;
-       else if (fabs(pq->ener[i]-e) > 1e-6*e)
-         gmx_fatal(FARGS,"Inconsistent energy %f i=%d j=%d k=%d",e,i,j,k);
-       
-       if (k == 0)
-         pq->omega[i][j] = o;
-       else if (fabs(pq->omega[i][j]-o) > 1e-6*o)
-         gmx_fatal(FARGS,"Inconsistent omega %f i=%d j=%d k=%d",o,i,j,k);
-       
-       pq->prob[i][j][k] = p;
-       pq->q[i][j][k] = t;
-      }
-    }
-  }
-  fprintf(stderr,"\n");
-  
-  gmx_ffclose(fp);
-  
-  return pq;
-}
-
-static int my_bsearch(real val,int ndata,real data[],gmx_bool bLower)
-{
-  int ilo,ihi,imed;
-
-  if (val < data[0])
-    return -1;
-  ilo = 0; 
-  ihi = ndata-1;
-  while ((ihi - ilo) > 1) {
-    imed = (ilo+ihi)/2;
-    if (data[imed] > val) 
-      ihi = imed;
-    else
-      ilo = imed;
-  }
-  /* Now val should be in between data[ilo] and data[ihi] */
-  /* Decide which one is closest */
-  if (bLower || ((val-data[ilo]) <= (data[ihi]-val)))
-    return ilo;
-  else
-    return ihi;
-}
-
-static real interpolate2D(int nx,int ny,real *dx,real **data,
-                         real x0,real fy,int nx0,int ny0)
-{
-  real fx;
-  
-  fx  = (x0-dx[nx0])/(dx[nx0+1]-dx[nx0]);
-  
-  return (fx*fy*data[nx0][ny0] + fx*(1-fy)*data[nx0][ny0+1] +
-         (1-fx)*fy*data[nx0+1][ny0] + (1-fx)*(1-fy)*data[nx0+1][ny0+1]); 
-}
-
-real get_omega(real ekin,int *seed,FILE *fp,char *fn)
-{
-  static t_p2Ddata *p2Ddata = NULL;
-  real r,ome,fx,fy;
-  int  eindex,oindex;
-  
-  if (p2Ddata == NULL) 
-    p2Ddata = read_p2Ddata(fn);
-  
-  /* Get energy index by binary search */
-  if ((eindex = my_bsearch(ekin,p2Ddata->nener,p2Ddata->ener,TRUE)) >= 0) {
-#ifdef DEBUG
-    if (eindex >= p2Ddata->nener)
-      gmx_fatal(FARGS,"eindex (%d) out of range (max %d) in get_omega",
-                 eindex,p2Ddata->nener);
-#endif
-
-    /* Start with random number */
-    r = rando(seed);
-    
-    /* Do binary search in the energy table */
-    if ((oindex = my_bsearch(r,p2Ddata->n2Ddata,p2Ddata->prob[eindex],TRUE)) >= 0) {
-#ifdef DEBUG
-      if (oindex >= p2Ddata->n2Ddata)
-       gmx_fatal(FARGS,"oindex (%d) out of range (max %d) in get_omega",
-                   oindex,p2Ddata->n2Ddata);
-#endif
-
-      fy = ((r-p2Ddata->prob[eindex][oindex])/
-           (p2Ddata->prob[eindex][oindex+1]-p2Ddata->prob[eindex][oindex]));
-      ome = interpolate2D(p2Ddata->nener,p2Ddata->n2Ddata,p2Ddata->ener,
-                         p2Ddata->data,ekin,fy,
-                         eindex,oindex);
-      /* ome = p2Ddata->data[eindex][oindex];*/
-      
-      if (fp) 
-       fprintf(fp,"%8.3f  %8.3f\n",ome,r);
-      
-      return ome;
-    }
-  }
-  return 0;
-}
-
-real get_theta_el(real ekin,int *seed,FILE *fp,char *fn)
-{
-  static t_p2Ddata *p2Ddata = NULL;
-  real r,theta;
-  int  eindex,tindex;
-  
-  if (p2Ddata == NULL) 
-    p2Ddata = read_p2Ddata(fn);
-  
-  /* Get energy index by binary search */
-  if ((eindex = my_bsearch(ekin,p2Ddata->nener,p2Ddata->ener,TRUE)) >= 0) {
-  
-    /* Start with random number */
-    r = rando(seed);
-    
-    /* Do binary search in the energy table */
-    if ((tindex = my_bsearch(r,p2Ddata->n2Ddata,p2Ddata->prob[eindex],FALSE)) >= 0) {
-  
-      theta = p2Ddata->data[eindex][tindex];
-      
-      if (fp) 
-       fprintf(fp,"%8.3f  %8.3f\n",theta,r);
-      
-      return theta;
-    }
-  }
-  return 0;
-}
-
-real get_q_inel(real ekin,real omega,int *seed,FILE *fp,char *fn)
-{
-  static t_pq_inel *pq = NULL;
-  int    eindex,oindex,tindex;
-  real   r,theta;
-  
-  if (pq == NULL)
-    pq = read_pq(fn);
-
-  /* Get energy index by binary search */
-  if ((eindex = my_bsearch(ekin,pq->nener,pq->ener,TRUE)) >= 0) {
-#ifdef DEBUG
-    if (eindex >= pq->nener)
-      gmx_fatal(FARGS,"eindex out of range (%d >= %d)",eindex,pq->nener);
-#endif
-      
-    /* Do binary search in the energy table */
-    if ((oindex = my_bsearch(omega,pq->nomega,pq->omega[eindex],FALSE)) >= 0) {
-#ifdef DEBUG
-      if (oindex >= pq->nomega)
-       gmx_fatal(FARGS,"oindex out of range (%d >= %d)",oindex,pq->nomega);
-#endif
-      
-      /* Start with random number */
-      r = rando(seed);
-      
-      if ((tindex = my_bsearch(r,pq->nq,pq->prob[eindex][oindex],FALSE)) >= 0) {
-#ifdef DEBUG
-       if (tindex >= pq->nq)
-         gmx_fatal(FARGS,"tindex out of range (%d >= %d)",tindex,pq->nq);
-#endif
-       
-       theta = pq->q[eindex][oindex][tindex];
-  
-       if (fp)
-         fprintf(fp,"get_q_inel: %8.3f  %8.3f\n",theta,r);
-       
-       return theta;
-      }
-    }
-  }
-  return 0;
-}
-
-static int read_cross(char *fn,real **ener,real **cross,real factor)
-{
-  char   **data=NULL;
-  double e,c;
-  int    i,j,n;
-  
-  fprintf(stdout,"Going to read %s\n",fn);
-  n = get_file(fn,&data);
-
-  /* Allocate memory */
-  snew(*cross,n);
-  snew(*ener,n);
-  for(i=j=0; (i<n); i++) {
-    if (sscanf(data[i],"%lf%lf",&e,&c) == 2) {
-      (*ener)[j] = e;
-      (*cross)[j] = c*factor;
-      j++;
-    }
-    sfree(data[i]);
-  }
-  sfree(data);
-  if (j != n)
-    fprintf(stderr,"There were %d empty lines in file %s\n",n-j,fn);
-  
-  return j;
-}
-
-real cross_inel(real ekin,real rho,char *fn)
-{
-  static real *ener  = NULL;
-  static real *cross = NULL;
-  static int  ninel;
-  int eindex;
-  
-  /* Read data at first call, convert A^2 to nm^2 */
-  if (cross == NULL)
-    ninel = read_cross(fn,&ener,&cross,rho*0.01);
-  
-  /* Compute index with binary search */
-  if ((eindex = my_bsearch(ekin,ninel,ener,FALSE)) >= 0) {
-#ifdef DEBUG
-    if (eindex >= ninel)
-      gmx_fatal(FARGS,"ekin = %f, ener[0] = %f, ener[%d] = %f",ekin,
-                 ener[0],ener[ninel-1]);
-#endif
-    return cross[eindex];
-  }
-  
-  return 0;
-}
-
-real cross_el(real ekin,real rho,char *fn)
-{
-  static real *ener  = NULL;
-  static real *cross = NULL;
-  static int  nel;
-  int eindex;
-  
-  /* Read data at first call, convert A^2 to nm^2  */
-  if (cross == NULL) 
-    nel = read_cross(fn,&ener,&cross,rho*0.01);
-  
-  /* Compute index with binary search */
-  if ((eindex = my_bsearch(ekin,nel,ener,FALSE)) >= 0) {
-#ifdef DEBUG
-    if (eindex >= nel)
-      gmx_fatal(FARGS,"ekin = %f, ener[0] = %f, ener[%d] = %f",ekin,
-                 ener[0],ener[nel-1]);
-#endif
-
-    return cross[eindex];
-  }
-  return 0;
-}
-
-real band_ener(int *seed,FILE *fp,char *fn)
-{
-  static real *ener  = NULL;
-  static real *prob  = NULL;
-  static int  nener;
-  int  eindex;
-  real r;
-  
-  /* Read data at first call, misuse read_cross function */
-  if (prob == NULL)
-    nener = read_cross(fn,&ener,&prob,1.0);
-  
-  r = rando(seed);
-  
-  if ((eindex = my_bsearch(r,nener,prob,FALSE)) >= 0) {
-#ifdef DEBUG
-    if (eindex >= nener)
-      gmx_fatal(FARGS,"r = %f, prob[0] = %f, prob[%d] = %f",r,
-                 prob[0],prob[nener-1]);
-#endif
-
-    if (fp)
-      fprintf(fp,"%8.3f  %8.3f\n",ener[eindex],r);
-    
-    return ener[eindex];
-  }
-  return 0;
-}
-
-static void test_omega(FILE *fp,int *seed)
-{
-  int i;
-
-  fprintf(fp,"Testing the energy loss tables\n");
-  for(i=0; (i<1000); i++) {
-    (void) get_omega(500*rando(seed),seed,fp,NULL);
-  }
-}
-
-static void test_q_inel(FILE *fp,int *seed)
-{
-  int i;
-  
-  fprintf(fp,"Testing the energy/omega dependent inelastic scattering q tables\n");
-  for(i=0; (i<1000); i++) {
-    (void) get_q_inel(500*rando(seed),400*rando(seed),seed,fp,NULL);
-  }
-}
-
-static void test_theta_el(FILE *fp,int *seed)
-{
-  int i;
-  
-  fprintf(fp,"Testing the energy dependent elastic scattering theta tables\n");
-  for(i=0; (i<1000); i++) {
-    (void) get_theta_el(500*rando(seed),seed,fp,NULL);
-  }
-}
-
-static void test_sigma_el(FILE *fp,real rho)
-{
-  int  i;
-
-  fprintf(fp,"Testing the elastic cross sections table\n");
-  for(i=0; (i<500); i++) {
-    fprintf(fp,"%3d  %8.3f\n",i,cross_el(i,rho,NULL));
-  }
-}
-
-static void test_sigma_inel(FILE *fp,real rho)
-{
-  int  i;
-
-  fprintf(fp,"Testing the inelastic cross sections table\n");
-  for(i=0; (i<500); i++) {
-    fprintf(fp,"%3d  %8.3f\n",i,cross_inel(i,rho,NULL));
-  }
-}
-
-static void test_band_ener(int *seed,FILE *fp)
-{
-  int i;
-  
-  for(i=0; (i<500); i++) {
-    band_ener(seed,fp,NULL);
-  }
-}
-
-void init_tables(int nfile,t_filenm fnm[],real rho)
-{
-  int  seed  = 1993;
-  real ekin  = 20;
-  real omega = 10;
-  
-  (void) band_ener(&seed,NULL,opt2fn("-band",nfile,fnm));
-  (void) cross_el(ekin,rho,opt2fn("-sigel",nfile,fnm));
-  (void) cross_inel(ekin,rho,opt2fn("-sigin",nfile,fnm));
-  (void) get_theta_el(ekin,&seed,NULL,opt2fn("-thetael",nfile,fnm));
-  (void) get_omega(ekin,&seed,NULL,opt2fn("-eloss",nfile,fnm));
-  (void) get_q_inel(ekin,omega,&seed,NULL,opt2fn("-qtrans",nfile,fnm));
-}
-
-void test_tables(int *seed,char *fn,real rho)
-{
-  FILE *fp;
-  
-  fp = fopen(fn,"w");
-
-  test_omega(fp,seed);
-  test_q_inel(fp,seed);
-  test_theta_el(fp,seed);
-  test_sigma_el(fp,rho);
-  test_sigma_inel(fp,rho);
-  test_band_ener(seed,fp);
-  
-  fclose(fp);
-}
-
diff --git a/src/contrib/ehdata.h b/src/contrib/ehdata.h
deleted file mode 100644 (file)
index 107ae80..0000000
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * 
- *                This source code is part of
- * 
- *                 G   R   O   M   A   C   S
- * 
- *          GROningen MAchine for Chemical Simulations
- * 
- *                        VERSION 3.2.0
- * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
- * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2004, The GROMACS development team,
- * check out http://www.gromacs.org for more information.
-
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- * 
- * If you want to redistribute modifications, please consider that
- * scientific software is very special. Version control is crucial -
- * bugs must be traceable. We will be happy to consider code for
- * inclusion in the official distribution, but derived work must not
- * be called official GROMACS. Details are found in the README & COPYING
- * files - if they are missing, get the official version at www.gromacs.org.
- * 
- * To help us fund GROMACS development, we humbly ask that you cite
- * the papers on the package - you can find them in the top README file.
- * 
- * For more info, check our website at http://www.gromacs.org
- * 
- * And Hey:
- * Good gRace! Old Maple Actually Chews Slate
- */
-       
-extern real get_omega(real ekin,int *seed,FILE *fp,char *fn);
-
-extern real get_q_inel(real ekin,real omega,int *seed,FILE *fp,char *fn);
-
-extern real get_theta_el(real ekin,int *seed,FILE *fp,char *fn);
-
-extern real cross_inel(real ekin,real rho,char *fn);
-
-extern real cross_el(real ekin,real rho,char *fn);
-
-extern real band_ener(int *seed,FILE *fp,char *fn);
-
-extern void init_tables(int nfile,t_filenm fnm[], real rho);
-/* Must be called before any of the table lookup thingies */
-
-extern void test_tables(int *seed,char *fn,real rho);
-
-/*******************************************************************
- *
- * Functions to make histograms
- *
- *******************************************************************/  
-       
-enum { enormNO, enormFAC, enormNP, enormNR };
-
-typedef struct {
-  int np;
-  real minx,maxx,dx,dx_1;
-  real *y;
-  int  *nh;
-} t_histo;
-
-extern t_histo *init_histo(int np,real minx,real maxx);
-
-extern void done_histo(t_histo *h);
-
-extern void add_histo(t_histo *h,real x,real y);
-
-extern void dump_histo(t_histo *h,char *fn,char *title,char *xaxis,char *yaxis,
-                      int enorm,real norm_fac);
-
-
-/*******************************************************************
- *
- * Functions to analyse and monitor scattering
- *
- *******************************************************************/  
-       
-typedef struct {
-  int  np,maxp;
-  real *time;
-  real *ekin;
-  gmx_bool *bInel;
-  rvec *pos;
-} t_ana_scat;
-
-extern void add_scatter_event(t_ana_scat *scatter,rvec pos,gmx_bool bInel,
-                             real t,real ekin);
-                             
-extern void reset_ana_scat(t_ana_scat *scatter);
-
-extern void done_scatter(t_ana_scat *scatter);
-
-extern void analyse_scatter(t_ana_scat *scatter,t_histo *hmfp);
-
-/*******************************************************************
- *
- * Functions to analyse structural changes
- *
- *******************************************************************/  
-
-typedef struct {
-  int  nanal,index;
-  real dt;
-  real *t;
-  real *maxdist;
-  rvec *d2_com,*d2_origin;
-  int  *nion;
-  int  nstruct,nparticle,maxparticle;
-  rvec *q;
-  rvec **x;
-} t_ana_struct;
-
-extern t_ana_struct *init_ana_struct(int nstep,int nsave,real timestep,
-                                    int maxparticle);
-
-extern void done_ana_struct(t_ana_struct *anal);
-
-extern void reset_ana_struct(t_ana_struct *anal);
-
-extern void add_ana_struct(t_ana_struct *total,t_ana_struct *add);
-
-extern void analyse_structure(t_ana_struct *anal,real t,rvec center,
-                             rvec x[],int nparticle,real charge[]);
-
-extern void dump_ana_struct(char *rmax,char *nion,char *gyr_com,
-                           char *gyr_origin,t_ana_struct *anal,int nsim);
-
-extern void dump_as_pdb(char *pdb,t_ana_struct *anal);
-
-/*******************************************************************
- *
- * Functions to analyse energies
- *
- *******************************************************************/  
-                           
-enum { eCOUL, eREPULS, ePOT, eHOLE, eELECTRON, eLATTICE, eKIN, eTOT, eNR };
-extern char *enms[eNR];
-
-typedef real evec[eNR];
-
-typedef struct {
-  int  nx,maxx;
-  evec *e;
-} t_ana_ener;
-
-extern void add_ana_ener(t_ana_ener *ae,int nn,real e[]);
-
-extern void dump_ana_ener(t_ana_ener *ae,int nsim,real dt,char *edump,
-                         t_ana_struct *total);
-
diff --git a/src/contrib/ehole.c b/src/contrib/ehole.c
deleted file mode 100644 (file)
index d5510ec..0000000
+++ /dev/null
@@ -1,694 +0,0 @@
-/*
- * 
- *                This source code is part of
- * 
- *                 G   R   O   M   A   C   S
- * 
- *          GROningen MAchine for Chemical Simulations
- * 
- *                        VERSION 3.3.3
- * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
- * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2008, The GROMACS development team,
- * check out http://www.gromacs.org for more information.
-
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- * 
- * If you want to redistribute modifications, please consider that
- * scientific software is very special. Version control is crucial -
- * bugs must be traceable. We will be happy to consider code for
- * inclusion in the official distribution, but derived work must not
- * be called official GROMACS. Details are found in the README & COPYING
- * files - if they are missing, get the official version at www.gromacs.org.
- * 
- * To help us fund GROMACS development, we humbly ask that you cite
- * the papers on the package - you can find them in the top README file.
- * 
- * For more info, check our website at http://www.gromacs.org
- * 
- * And Hey:
- * Groningen Machine for Chemical Simulation
- */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-#include "typedefs.h"
-#include "gromacs/utility/smalloc.h"
-#include "macros.h"
-#include "copyrite.h"
-#include "gromacs/commandline/pargs.h"
-#include "gromacs/utility/fatalerror.h"
-#include "random.h"
-#include "gromacs/fileio/pdbio.h"
-#include "gromacs/utility/futil.h"
-#include "gromacs/math/units.h"
-#include "gromacs/math/vec.h"
-#include "names.h"
-#include "ehdata.h"
-
-typedef struct {
-  int  maxparticle;
-  int  maxstep;
-  int  nsim;
-  int  nsave;
-  int  nana;
-  int  seed;
-  int  nevent;
-  gmx_bool bForce;
-  gmx_bool bScatter;
-  gmx_bool bHole;
-  real dt;
-  real deltax;
-  real epsr;
-  real Alj;
-  real Eauger;
-  real Efermi;
-  real Eband;
-  real rho;
-  real matom;
-  real evdist;
-  real size;
-} t_eh_params;
-
-#define ELECTRONMASS 5.447e-4
-/* Resting mass of electron in a.m.u. */
-#define HOLEMASS (0.8*ELECTRONMASS)
-/* Effective mass of a hole! */
-#define HBAR (PLANCK/2*M_PI)
-
-static void calc_forces(int n,rvec x[],rvec f[],real q[],real ener[],real Alj)
-{
-  const real facel = FACEL;
-  int  i,j,m;
-  rvec dx;
-  real qi,r2,r_1,r_2,fscal,df,vc,vctot,vlj,vljtot;
-  
-  for(i=0; (i<n); i++) 
-    clear_rvec(f[i]);
-  
-  vctot = vljtot = 0;
-  for(i=0; (i<n-1); i++) {
-    qi = q[i]*facel;
-    for(j=i+1; (j<n); j++) {
-      rvec_sub(x[i],x[j],dx);
-      r2      = iprod(dx,dx);
-      r_1     = 1.0/sqrt(r2);
-      r_2     = r_1*r_1;
-      vc      = qi*q[j]*r_1;
-      vctot  += vc;
-      vlj     = Alj*(r_2*r_2*r_2);
-      vljtot += vlj;
-      fscal   = (6*vlj+vc)*r_2;
-      for(m=0; (m<DIM); m++) {
-       df = fscal*dx[m];
-       f[i][m] += df;
-       f[j][m] -= df;
-      }
-    }
-  }
-  ener[eCOUL]   = vctot;
-  ener[eREPULS] = vljtot;
-  ener[ePOT]    = vctot+vljtot;
-}
-
-static void calc_ekin(int nparticle,rvec v[],rvec vold[],
-                     real q[],real m[],real ener[],real eparticle[])
-{
-  rvec vt;
-  real ekh=0,eke=0,ee;
-  int  i;
-  
-  for(i=0; (i<nparticle); i++) {
-    rvec_add(v[i],vold[i],vt);
-    ee = 0.125*m[i]*iprod(vt,vt);
-    eparticle[i] = ee/ELECTRONVOLT;
-    if (q[i] > 0)
-      ekh += ee;
-    else 
-      eke += ee;
-  }
-  ener[eHOLE]     = ekh;
-  ener[eELECTRON] = eke;
-  ener[eKIN]      = ekh+eke+ener[eLATTICE];
-}
-
-static void polar2cart(real amp,real phi,real theta,rvec v)
-{
-  real ss = sin(theta);
-  
-  v[XX] = amp*cos(phi)*ss;
-  v[YY] = amp*sin(phi)*ss;
-  v[ZZ] = amp*cos(theta);
-}
-
-static void rand_vector(real amp,rvec v,int *seed)
-{
-  real theta,phi;
-
-  theta = M_PI*rando(seed);
-  phi   = 2*M_PI*rando(seed);
-  polar2cart(amp,phi,theta,v);
-}
-
-static void rotate_theta(rvec v,real nv,real dth,int *seed,FILE *fp)
-{
-  real   dphi,theta0,phi0,cc,ss;
-  matrix mphi,mtheta,mphi_1,mtheta_1; 
-  rvec   vp,vq,vold;
-  
-  copy_rvec(v,vold);
-  theta0 = acos(v[ZZ]/nv);
-  phi0   = atan2(v[YY],v[XX]);
-  if (fp)
-    fprintf(fp,"Theta = %g  Phi = %g\n",theta0,phi0);
-    
-  clear_mat(mphi);
-  cc = cos(-phi0);
-  ss = sin(-phi0);
-  mphi[XX][XX] = mphi[YY][YY] = cc;
-  mphi[XX][YY] = -ss;
-  mphi[YY][XX] = ss;
-  mphi[ZZ][ZZ] = 1;
-  m_inv(mphi,mphi_1);
-
-  clear_mat(mtheta);
-  cc = cos(-theta0);
-  ss = sin(-theta0);
-  mtheta[XX][XX] = mtheta[ZZ][ZZ] = cc;
-  mtheta[XX][ZZ] = ss;
-  mtheta[ZZ][XX] = -ss;
-  mtheta[YY][YY] = 1;
-  m_inv(mtheta,mtheta_1);
-  
-  dphi   = 2*M_PI*rando(seed);
-  
-  /* Random rotation */
-  polar2cart(nv,dphi,dth,vp);
-  
-  mvmul(mtheta_1,vp,vq);
-  mvmul(mphi_1,vq,v);
-  
-  if (fp) {
-    real cold = cos_angle(vold,v);
-    real cnew = cos(dth);
-    if (fabs(cold-cnew) > 1e-4)
-      fprintf(fp,"cos(theta) = %8.4f  should be %8.4f  dth = %8.4f  dphi = %8.4f\n",
-             cold,cnew,dth,dphi);
-  }
-}
-
-static int create_electron(int index,rvec x[],rvec v[],rvec vold[],rvec vv,
-                          real m[],real q[],
-                          rvec center,real e0,int *seed)
-{
-  m[index] = ELECTRONMASS;
-  q[index] = -1;
-
-  clear_rvec(v[index]);
-  svmul(sqrt(2*e0/m[index]),vv,v[index]);
-  copy_rvec(v[index],vold[index]);
-  copy_rvec(center,x[index]);
-  
-  return index+1;
-}
-
-static int create_pair(int index,rvec x[],rvec v[],rvec vold[],
-                      real m[],real q[],
-                      rvec center,real e0,t_eh_params *ehp,rvec dq)
-{
-  static real massfactor = 2*HOLEMASS/(ELECTRONMASS*(ELECTRONMASS+HOLEMASS));
-  rvec x0;
-  real ve,e1;
-  
-  m[index]        = ELECTRONMASS;
-  m[index+1]      = HOLEMASS;
-  q[index]        = -1;
-  q[index+1]      = 1;
-  
-  rand_vector(0.5*ehp->deltax,x0,&ehp->seed);
-  rvec_sub(center,x0,x[index]);
-  rvec_add(center,x0,x[index+1]);
-
-  ve = sqrt(massfactor*e0)/(0.5*ehp->deltax);
-  svmul(-ve,x0,v[index]);
-  svmul(ELECTRONMASS*ve/HOLEMASS,x0,v[index+1]);
-  copy_rvec(v[index],vold[index]);
-  copy_rvec(v[index+1],vold[index+1]);
-  e1 = 0.5*(m[index]*iprod(v[index],v[index])+
-           m[index+1]*iprod(v[index+1],v[index+1]));
-  if (fabs(e0-e1)/e0 > 1e-6)
-    gmx_fatal(FARGS,"Error in create pair: e0 = %f, e1 = %f\n",e0,e1);
-  
-  return index+2;
-}
-
-static int scatter_all(FILE *fp,int nparticle,int nstep,
-                      rvec x[],rvec v[],rvec vold[],
-                      real mass[],real charge[],real ener[],real eparticle[],
-                      t_eh_params *ehp,int *nelec,int *nhole,t_ana_scat s[])
-{
-  int  i,m,np;
-  real p_el,p_inel,ptot,nv,ekin,omega,theta,costheta,Q,e0,ekprime,size2,fac;
-  rvec dq,center,vv;
-  
-  size2 = sqr(ehp->size);
-  np    = nparticle;  
-  for(i=0; (i<nparticle); i++) {
-    /* Check cross sections, assume same cross sections for holes
-     * as for electrons, for elastic scattering
-     */
-    if ((size2 == 0) || (iprod(x[i],x[i]) < size2)) {
-      nv   = norm(v[i]);
-      ekin = eparticle[i];
-      p_el = cross_el(ekin,ehp->rho,NULL)*nv*ehp->dt;
-      
-      /* Only electrons can scatter inelasticlly */
-      if (charge[i] < 0)
-       p_inel = cross_inel(ekin,ehp->rho,NULL)*nv*ehp->dt;
-      else
-       p_inel = 0;
-      
-      /* Test whether we have to scatter at all */
-      ptot = (1 - (1-p_el)*(1-p_inel));
-      if (debug && 0)
-       fprintf(debug,"p_el = %10.3e  p_inel = %10.3e ptot = %10.3e\n",
-               p_el,p_inel,ptot);
-      if (rando(&ehp->seed) < ptot) {
-       /* Test whether we have to scatter inelastic */
-       ptot = p_inel/(p_el+p_inel);
-       if (rando(&ehp->seed) < ptot) {
-         add_scatter_event(&(s[i]),x[i],TRUE,ehp->dt*nstep,ekin);
-         /* Energy loss in inelastic collision is omega */
-         if ((omega = get_omega(ekin,&ehp->seed,debug,NULL)) >= ekin)
-           gmx_fatal(FARGS,"Energy transfer error: omega = %f, ekin = %f",
-                       omega,ekin);
-         else {
-           /* Scattering angle depends on energy and energy loss */
-           Q = get_q_inel(ekin,omega,&ehp->seed,debug,NULL);
-           costheta = -0.5*(Q+omega-2*ekin)/sqrt(ekin*(ekin-omega));
-           
-           /* See whether we have gained enough energy to liberate another 
-            * hole-electron pair
-            */
-           e0      = band_ener(&ehp->seed,debug,NULL);
-           ekprime = e0 + omega - (ehp->Efermi+0.5*ehp->Eband);
-           /* Ouput */
-           fprintf(fp,"Inelastic %d: Ekin=%.2f Omega=%.2f Q=%.2f Eband=%.2f costheta=%.3f\n",
-                   i+1,ekin,omega,Q,e0,costheta);
-           if ((costheta < -1) || (costheta > 1)) {
-             fprintf(fp,"Electron/hole creation not possible due to momentum constraints\n");
-             /* Scale the velocity according to the energy loss */
-             svmul(sqrt(1-omega/ekin),v[i],v[i]);
-             ener[eLATTICE] += omega*ELECTRONVOLT;
-           }
-           else {
-             theta = acos(costheta);
-             
-             copy_rvec(v[i],dq);
-             /* Rotate around theta with random delta phi */
-             rotate_theta(v[i],nv,theta,&ehp->seed,debug);
-             /* Scale the velocity according to the energy loss */
-             svmul(sqrt(1-omega/ekin),v[i],v[i]);
-             rvec_dec(dq,v[i]);
-             
-             if (ekprime > 0) {
-               if (np >= ehp->maxparticle-2)
-                 gmx_fatal(FARGS,"Increase -maxparticle flag to more than %d",
-                             ehp->maxparticle);
-               if (ehp->bHole) {
-                 np = create_pair(np,x,v,vold,mass,charge,x[i],
-                                  ekprime*ELECTRONVOLT,ehp,dq);
-                 (*nhole)++;
-               }
-               else {
-                 copy_rvec(x[i],center);
-                 center[ZZ] += ehp->deltax;
-                 rand_vector(1,vv,&ehp->seed);
-                 np = create_electron(np,x,v,vold,vv,mass,charge,
-                                      x[i],ekprime*ELECTRONVOLT,&ehp->seed);
-               }
-               ener[eLATTICE] += (omega-ekprime)*ELECTRONVOLT;
-               (*nelec)++;
-             }
-             else
-               ener[eLATTICE] += omega*ELECTRONVOLT;
-           }
-         }
-       }
-       else {
-         add_scatter_event(&(s[i]),x[i],FALSE,ehp->dt*nstep,ekin);
-         if (debug)
-           fprintf(debug,"Elastic scattering event\n");
-         
-         /* Scattering angle depends on energy only */
-         theta = get_theta_el(ekin,&ehp->seed,debug,NULL);
-         /* Rotate around theta with random delta phi */
-         rotate_theta(v[i],nv,theta,&ehp->seed,debug);
-       }
-      }
-    }
-  }
-  return np;
-}
-
-static void integrate_velocities(int nparticle,rvec vcur[],rvec vnext[],
-                                rvec f[],real m[],real dt)
-{
-  int i,k;
-    
-  for(i=0; (i<nparticle); i++) 
-    for(k=0; (k<DIM); k++) 
-      vnext[i][k] = vcur[i][k] + f[i][k]*dt/m[i];
-}
-
-static void integrate_positions(int nparticle,rvec x[],rvec v[],real dt)
-{
-  int i,k;
-  
-  for(i=0; (i<nparticle); i++) 
-    for(k=0; (k<DIM); k++) 
-      x[i][k] += v[i][k]*dt;
-}
-
-static void print_header(FILE *fp,t_eh_params *ehp)
-{
-  fprintf(fp,"Welcome to the electron-hole simulation!\n");
-  fprintf(fp,"The energies printed in this file are in eV\n");
-  fprintf(fp,"Coordinates are in nm because of fixed width format\n");
-  fprintf(fp,"Atomtypes are used for coloring in rasmol\n");
-  fprintf(fp,"O: electrons (red), N: holes (blue)\n");
-  fprintf(fp,"Parametes for this simulation\n");
-  fprintf(fp,"seed = %d maxstep = %d dt = %g\n",
-         ehp->seed,ehp->maxstep,ehp->dt);
-  fprintf(fp,"nsave = %d nana = %d Force = %s Scatter = %s Hole = %s\n",
-         ehp->nsave,ehp->nana,gmx_bool_names[ehp->bForce],
-         gmx_bool_names[ehp->bScatter],gmx_bool_names[ehp->bHole]);
-  if (ehp->bForce)
-    fprintf(fp,"Force constant for repulsion Alj = %g\n",ehp->Alj);
-}
-
-static void do_sim(FILE *fp,char *pdbfn,t_eh_params *ehp,
-                  int *nelec,int *nhole,t_ana_struct *total,
-                  t_histo *hmfp,t_ana_ener *ae,int serial)
-{
-  FILE         *efp;
-  int          nparticle[2];
-  rvec         *x,*v[2],*f,center,vv;
-  real         *charge,*mass,*ener,*eparticle;
-  t_ana_struct *ana_struct;
-  t_ana_scat   *ana_scat;
-  int          step,i,cur = 0;
-#define next (1-cur)
-
-  /* Open output file */
-  fprintf(fp,"++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n");
-  fprintf(fp,"Simulation %d/%d\n",serial+1,ehp->nsim);
-  
-  ana_struct = init_ana_struct(ehp->maxstep,ehp->nana,ehp->dt,
-                              ehp->maxparticle);
-  /* Initiate arrays. The charge array determines whether a particle is 
-   * a hole (+1) or an electron (-1)
-   */
-  snew(x,ehp->maxparticle);          /* Position  */
-  snew(v[0],ehp->maxparticle);       /* Velocity  */
-  snew(v[1],ehp->maxparticle);       /* Velocity  */
-  snew(f,ehp->maxparticle);          /* Force     */
-  snew(charge,ehp->maxparticle);     /* Charge    */
-  snew(mass,ehp->maxparticle);       /* Mass      */
-  snew(eparticle,ehp->maxparticle);  /* Energy per particle */
-  snew(ana_scat,ehp->maxparticle);   /* Scattering event statistics */
-  snew(ener,eNR);                    /* Eenergies */
-  
-  clear_rvec(center);
-  /* Use first atom as center, it has coordinate 0,0,0 */
-  if (ehp->bScatter) {
-    /* Start with an Auger electron */
-    nparticle[cur]=0;
-    for(i=0; (i<ehp->nevent); i++) {
-      if (ehp->nevent == 1) {
-       clear_rvec(vv);
-       vv[ZZ] = 1;
-      }
-      else
-       rand_vector(1,vv,&ehp->seed);
-      nparticle[cur]  = create_electron(nparticle[cur],x,v[cur],v[next],
-                                       vv,mass,charge,center,
-                                       ehp->Eauger*ELECTRONVOLT,&ehp->seed);
-      rand_vector(ehp->evdist*0.1,vv,&ehp->seed);
-      rvec_inc(center,vv);
-    }
-  }
-  else if (ehp->bForce) {
-    /* Start with two electron and hole pairs */
-    nparticle[cur]  = create_pair(0,x,v[cur],v[next],mass,charge,center,
-                                 0.2*ehp->Eauger*ELECTRONVOLT,ehp,center);
-    center[ZZ] = 0.5; /* nm */
-    (*nelec)++;
-    (*nhole)++;
-  }
-  else {
-    fprintf(fp,"Nothing to do. Doei.\n");
-    return;
-  }
-  nparticle[next] = nparticle[cur];
-  for(step=0; (step<=ehp->maxstep); step++) {
-    if (ehp->bScatter)
-      nparticle[next] = scatter_all(fp,nparticle[cur],step,x,v[cur],v[next],
-                                   mass,charge,ener,eparticle,ehp,
-                                   nelec,nhole,ana_scat);
-    
-    if (ehp->bForce)
-      calc_forces(nparticle[cur],x,f,charge,ener,ehp->Alj);
-    
-    integrate_velocities(nparticle[next],v[cur],v[next],f,mass,ehp->dt);
-    
-    calc_ekin(nparticle[next],v[cur],v[next],charge,mass,ener,eparticle);
-    ener[eTOT] = ener[eKIN] + ener[ePOT];
-    
-    /* Produce output whenever the user says so, or when new
-     * particles have been created.
-     */
-    if ((step == ehp->maxstep) ||
-       ((ehp->nana != 0) && ((step % ehp->nana) == 0))) {
-      analyse_structure(ana_struct,(step*ehp->dt),center,x,
-                       nparticle[next],charge);
-      add_ana_ener(ae,(step/ehp->nana),ener);
-    }
-    cur = next;
-        
-    integrate_positions(nparticle[cur],x,v[cur],ehp->dt);
-  }
-  for(i=0; (i<nparticle[cur]); i++) {
-    analyse_scatter(&(ana_scat[i]),hmfp);
-    done_scatter(&(ana_scat[i]));
-  }
-  sfree(ener);
-  sfree(ana_scat); 
-  sfree(eparticle); 
-  sfree(mass);    
-  sfree(charge); 
-  sfree(f);
-  sfree(v[1]);      
-  sfree(v[0]); 
-  sfree(x);
-  dump_as_pdb(pdbfn,ana_struct);
-  add_ana_struct(total,ana_struct);
-  done_ana_struct(ana_struct);
-  sfree(ana_struct);
-}
-
-void do_sims(int NFILE,t_filenm fnm[],t_eh_params *ehp)
-{
-  t_ana_struct *total;
-  t_ana_ener   *ae;
-  t_histo      *helec,*hmfp;
-  int          *nelectron;
-  int          i,imax,ne,nh;
-  real         aver;
-  FILE         *fp,*logfp;
-  char         *pdbbuf,*ptr,*rptr;
-
-  ptr  = ftp2fn(efPDB,NFILE,fnm);
-  rptr = strdup(ptr);
-  if ((ptr = strstr(rptr,".pdb")) != NULL)
-    *ptr = '\0';
-  snew(pdbbuf,strlen(rptr)+10);
-
-  total = init_ana_struct(ehp->maxstep,ehp->nana,ehp->dt,1);
-  hmfp  = init_histo((int)ehp->Eauger,0,(int)ehp->Eauger);
-  helec = init_histo(500,0,500);
-  snew(ae,1);
-
-  logfp = gmx_ffopen(ftp2fn(efLOG,NFILE,fnm),"w");
-  print_header(logfp,ehp);
-    
-  for(i=0; (i<ehp->nsim); i++) {
-    nh = ne = 0;
-    sprintf(pdbbuf,"%s-%d.pdb",rptr,i+1);
-    do_sim(logfp,pdbbuf,ehp,&ne,&nh,total,hmfp,ae,i);
-    add_histo(helec,ne,1);
-    fprintf(stderr,"\rSim: %d/%d",i+1,ehp->nsim);
-  }
-  fprintf(stderr,"\n");
-  gmx_ffclose(logfp);
-  
-  sfree(rptr);
-  sfree(pdbbuf);
-  dump_ana_struct(opt2fn("-maxdist",NFILE,fnm),opt2fn("-nion",NFILE,fnm),
-                 opt2fn("-gyr_com",NFILE,fnm),opt2fn("-gyr_origin",NFILE,fnm),
-                 total,ehp->nsim);
-  dump_ana_ener(ae,ehp->nsim,ehp->dt*ehp->nana,
-               opt2fn("-ener",NFILE,fnm),total);
-  done_ana_struct(total);
-
-  dump_histo(helec,opt2fn("-histo",NFILE,fnm),
-            "Number of cascade electrons","N","",enormFAC,1.0/ehp->nsim);
-  dump_histo(hmfp,opt2fn("-mfp",NFILE,fnm),
-            "Mean Free Path","Ekin (eV)","MFP (nm)",enormNP,1.0);
-}
-
-int main(int argc,char *argv[])
-{
-  const char *desc[] = {
-    "[TT]ehole[tt] performs a molecular dynamics simulation of electrons and holes",
-    "in an implicit lattice. The lattice is modeled through scattering cross",
-    "sections, for elastic and inelastic scattering.",
-    "A detailed description of the scatterning processes simulated in ehole",
-    "can be found in Timneanu et al. Chemical Physics 299 (2004) 277-283",
-    "The paper also includes a description how to calculate the input files.[PAR]",
-    "Description of the input files for [TT]ehole[tt]:[BR]",
-    "[TT]-sigel.dat[tt]: elastic cross section (per atom). Two columns: Impact electron energy (eV) vs Elastic cross section (A2).[BR]",
-    "[TT]-siginel.dat[tt]: inelastic cross section (per atom). Two columns: Impact electron energy (eV) vs Inelastic cross section (A2).[BR]",
-    "[TT]-band-ener.dat[tt]: Probability of finding an electron in the valence band.",
-    "Two columns: Impact electron energy (eV) vs Probability[BR]",
-    "[TT]-eloss.dat[tt]: Probability of energy loss due to inelastic scattering. Three columns: Impact electron energy (eV) vs  Integrated probability vs Energy loss in inelastic scattering (eV).[BR]",
-    "[TT]-theta-el.dat[tt]: Probability of elastic scattering angle. Three columns: Impact electron energy (eV) vs Integrated probability vs Scattering angle (rad).[BR]",
-    "[TT]-qtrans.dat[tt]: Four columns: Impact electron energy (eV) vs Inelastic energy loss (eV) vs Integrated probability vs Scattering angle (rad).[PAR]",
-    "The program produces a number of output files. It is important that",
-    "the actual content is well-defined, sucht that no misunderstanding can",
-    "occur (famous last words...). Anyway, the program does a number of",
-    "simulations, and averages results over these. Here is a list of each of",
-    "the results and how they are computed:[BR]",
-    "[TT]-histo[tt] Distribution of nuber of liberated secondary electrons per simulation.[BR]",
-    "[TT]-maxdist[tt] The maximum distance from the origin that any electron in any simulation reaches.[BR]",
-    "[TT]-gyr_com[tt] The radius of gyration of the electron cloud with respect to its center of mass (contains 4 columns).[BR]",
-    "[TT]-gyr_origin[tt] The radius of gyration of the electron cloud with respect to the origin (contains 4 columns).[BR]",
-    "[TT]-mfp[tt] The mean free path of the electrons as a function of energy. If this is not a smooth curve you need to increase the number of simulations.[BR]",
-    "[TT]-nion[tt] The number of ions as a function of time, averaged over simulations.[BR]",
-    "[TT]-ener[tt] The energy terms in the simulation (note that there are multiple columns, so use [TT]xmgrace -nxy[tt]). This shows important information about the stability of the simulation, that is the total energy should be conserved. In this figure you can also inspect the kinetic energy per electron in order to check whether the electrons have thermalized.[BR]"
-  };
-  static t_eh_params ehp = {
-    100,    /* Max number of particles. Is a parameter but should be dynamic */
-    100000, /* Number of integration steps */
-    1,      /* nsave */
-    1,      /* nana */
-    1,      /* nsim */
-    1993,   /* Random seed */
-    1,      /* Number of events */
-    FALSE,  /* Use forces */
-    TRUE,   /* Use scattering */
-    FALSE,  /* Creat holes */
-    1e-5,   /* Time step */
-    0.05,   /* Distance (nm) between electron and hole when creating them */
-    1.0,    /* Dielectric constant */
-    0.1,    /* Force constant for repulsion function */
-    250,    /* Starting energy for the first Auger electron */
-    28.7,   /* Fermi level (eV) of diamond. */
-    5.46,   /* Band gap energy (eV) of diamond */
-    3.51,   /* Density of the solid */
-    12.011, /* (Average) mass of the atom */
-    10000.0,/* Distance between events */
-    0.0     /* Size of the system */
-  };
-  static gmx_bool bTest    = FALSE;
-  t_pargs pa[] = {
-    { "-maxparticle", FALSE, etINT,  {&ehp.maxparticle},
-      "Maximum number of particles" },
-    { "-maxstep",     FALSE, etINT,  {&ehp.maxstep}, 
-      "Number of integration steps" },
-    { "-nsim",        FALSE, etINT,  {&ehp.nsim},
-      "Number of independent simulations writing to different output files" },
-    { "-nsave",       FALSE, etINT,  {&ehp.nsave}, 
-      "Number of steps after which to save output. 0 means only when particles created. Final step is always written." },
-    { "-nana",        FALSE, etINT,  {&ehp.nana}, 
-      "Number of steps after which to do analysis." },
-    { "-seed",        FALSE, etINT,  {&ehp.seed}, 
-      "Random seed" },
-    { "-dt",          FALSE, etREAL, {&ehp.dt}, 
-      "Integration time step (ps)" },
-    { "-rho",         FALSE, etREAL, {&ehp.rho}, 
-      "Density of the sample (kg/l). Default is for Diamond" }, 
-    { "-matom",       FALSE, etREAL, {&ehp.matom}, 
-      "Mass (a.m.u.) of the atom in the solid. Default is C" },
-    { "-fermi",       FALSE, etREAL, {&ehp.Efermi}, 
-      "Fermi energy (eV) of the sample. Default is for Diamond" },
-    { "-gap",         FALSE, etREAL, {&ehp.Eband}, 
-      "Band gap energy (eV) of the sample. Default is for Diamond" },
-    { "-auger",       FALSE, etREAL, {&ehp.Eauger}, 
-      "Impact energy (eV) of first electron" },
-    { "-dx",          FALSE, etREAL, {&ehp.deltax},
-      "Distance between electron and hole when creating a pair" },
-    { "-test",        FALSE, etBOOL, {&bTest},
-      "Test table aspects of the program rather than running it for real" },
-    { "-force",       FALSE, etBOOL, {&ehp.bForce},
-      "Apply Coulomb/Repulsion forces" },
-    { "-hole",        FALSE, etBOOL, {&ehp.bHole},
-      "Create electron-hole pairs rather than electrons only" },
-    { "-scatter",     FALSE, etBOOL, {&ehp.bScatter},
-      "Do the scattering events" },
-    { "-nevent",      FALSE, etINT,  {&ehp.nevent},
-      "Number of initial Auger electrons" },
-    { "-evdist",      FALSE, etREAL, {&ehp.evdist},
-      "Average distance (A) between initial electronss" },
-    { "-size",        FALSE, etREAL, {&ehp.size},
-      "Size of the spherical system. If 0, then it is infinite" }
-  };
-#define NPA asize(pa)
-  t_filenm fnm[] = {
-    { efLOG, "-g",          "ehole",      ffWRITE },
-    { efDAT, "-sigel",      "sigel",      ffREAD },
-    { efDAT, "-sigin",      "siginel",    ffREAD },
-    { efDAT, "-eloss",      "eloss",      ffREAD },
-    { efDAT, "-qtrans",     "qtrans",     ffREAD },
-    { efDAT, "-band",       "band-ener",  ffREAD },
-    { efDAT, "-thetael",    "theta-el",   ffREAD },
-    { efPDB, "-o",          "ehole",      ffWRITE },
-    { efXVG, "-histo",      "histo",      ffWRITE },
-    { efXVG, "-maxdist",    "maxdist",    ffWRITE },
-    { efXVG, "-gyr_com",    "gyr_com",    ffWRITE },
-    { efXVG, "-gyr_origin", "gyr_origin", ffWRITE },
-    { efXVG, "-mfp",        "mfp",        ffWRITE },
-    { efXVG, "-nion",       "nion",       ffWRITE },
-    { efXVG, "-ener",       "ener",       ffWRITE }
-  };
-#define NFILE asize(fnm)
-  int seed;
-  
-  CopyRight(stdout,argv[0]);
-  parse_common_args(&argc,argv,0,NFILE,fnm,
-                   NPA,pa,asize(desc),desc,0,NULL);
-  please_cite(stdout,"Timneanu2004a");
-  
-  if (ehp.deltax <= 0)
-    gmx_fatal(FARGS,"Delta X should be > 0");
-  ehp.Alj = FACEL*pow(ehp.deltax,5);
-  ehp.rho = (ehp.rho/ehp.matom)*AVOGADRO*1e-21;
-
-  init_tables(NFILE,fnm,ehp.rho);
-
-  if (bTest) 
-    test_tables(&ehp.seed,ftp2fn(efPDB,NFILE,fnm),ehp.rho);  
-  else 
-    do_sims(NFILE,fnm,&ehp);
-  
-  gmx_thanx(stdout);
-  
-  return 0;
-}
diff --git a/src/contrib/g_anavel.c b/src/contrib/g_anavel.c
deleted file mode 100644 (file)
index 5646ab9..0000000
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * 
- *                This source code is part of
- * 
- *                 G   R   O   M   A   C   S
- * 
- *          GROningen MAchine for Chemical Simulations
- * 
- *                        VERSION 3.3.99_development_20071104
- * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
- * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2006, The GROMACS development team,
- * check out http://www.gromacs.org for more information.
-
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- * 
- * If you want to redistribute modifications, please consider that
- * scientific software is very special. Version control is crucial -
- * bugs must be traceable. We will be happy to consider code for
- * inclusion in the official distribution, but derived work must not
- * be called official GROMACS. Details are found in the README & COPYING
- * files - if they are missing, get the official version at www.gromacs.org.
- * 
- * To help us fund GROMACS development, we humbly ask that you cite
- * the papers on the package - you can find them in the top README file.
- * 
- * For more info, check our website at http://www.gromacs.org
- * 
- * And Hey:
- * Groningen Machine for Chemical Simulation
- */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "gromacs/utility/smalloc.h"
-#include "macros.h"
-#include "gromacs/commandline/pargs.h"
-#include "random.h"
-#include "names.h"
-#include "gromacs/fileio/matio.h"
-#include "gromacs/math/units.h"
-#include "gromacs/math/vec.h"
-#include "gromacs/utility/futil.h"
-#include "copyrite.h"
-#include "gromacs/fileio/tpxio.h"
-
-int main(int argc,char *argv[])
-{
-  static char *desc[] = {
-    "[TT]g_anavel[tt] computes temperature profiles in a sample. The sample",
-    "can be analysed radial, i.e. the temperature as a function of",
-    "distance from the center, cylindrical, i.e. as a function of distance",
-    "from the vector (0,0,1) through the center of the box, or otherwise",
-    "(will be specified later)"
-  };
-  t_filenm fnm[] = {
-    { efTRN,  "-f",  NULL, ffREAD },
-    { efTPX,  "-s",  NULL, ffREAD },
-    { efXPM,  "-o", "xcm", ffWRITE }
-  };
-#define NFILE asize(fnm)
-
-  static int  mode = 0,   nlevels = 10;
-  static real tmax = 300, xmax    = -1;
-  t_pargs pa[] = {
-    { "-mode",    FALSE, etINT,  {&mode},    "mode" },
-    { "-nlevels", FALSE, etINT,  {&nlevels}, "number of levels" },
-    { "-tmax",    FALSE, etREAL, {&tmax},    "max temperature in output" },
-    { "-xmax",    FALSE, etREAL, {&xmax},    "max distance from center" }
-  };
-  
-  FILE       *fp;
-  int        *npts,nmax;
-  int        status;
-  int        i,j,idum,step,nframe=0,index;
-  real       temp,rdum,hboxx,hboxy,scale,xnorm=0;
-  real       **profile=NULL;
-  real       *t_x=NULL,*t_y,hi=0;
-  t_topology *top;
-  int        d,m,n;
-  matrix     box;
-  atom_id    *sysindex;
-  gmx_bool       bHaveV,bReadV;
-  t_rgb      rgblo = { 0, 0, 1 },rgbhi = { 1, 0, 0 };
-  int        flags = TRX_READ_X | TRX_READ_V;
-  t_trxframe fr;
-
-  
-  CopyRight(stderr,argv[0]);
-  parse_common_args(&argc,argv,PCA_CAN_TIME,NFILE,fnm,
-                   asize(pa),pa,asize(desc),desc,0,NULL);
-
-  top    = read_top(ftp2fn(efTPX,NFILE,fnm));
-
-  read_first_frame(&status,ftp2fn(efTRX,NFILE,fnm),&fr,flags);
-       
-  if (xmax > 0) {
-    scale  = 5;
-    nmax   = xmax*scale;
-  }
-  else {
-    scale  = 5;
-    nmax   = (0.5*sqrt(sqr(box[XX][XX])+sqr(box[YY][YY])))*scale; 
-  }
-  snew(npts,nmax+1);
-  snew(t_y,nmax+1);
-  for(i=0; (i<=nmax); i++) {
-    npts[i] = 0;
-    t_y[i]  = i/scale;
-  }
-  do {
-    srenew(profile,++nframe);
-    snew(profile[nframe-1],nmax+1);
-    srenew(t_x,nframe);
-    t_x[nframe-1] = fr.time*1000;
-    hboxx = box[XX][XX]/2;
-    hboxy = box[YY][YY]/2;
-    for(i=0; (i<fr.natoms); i++) {
-      /* determine position dependent on mode */
-      switch (mode) {
-      case 0:
-       xnorm = sqrt(sqr(fr.x[i][XX]-hboxx) + sqr(fr.x[i][YY]-hboxy));
-       break;
-      default:
-       gmx_fatal(FARGS,"Unknown mode %d",mode);
-      }
-      index = xnorm*scale;
-      if (index <= nmax) {
-       temp = top->atoms.atom[i].m*iprod(fr.v[i],fr.v[i])/(2*BOLTZ);
-       if (temp > hi)
-         hi = temp;
-       npts[index]++;
-       profile[nframe-1][index] += temp;
-      }
-    }
-    for(i=0; (i<=nmax); i++) {
-      if (npts[i] != 0) 
-       profile[nframe-1][i] /= npts[i];
-      npts[i] = 0;
-    }
-  } while (read_next_frame(status,&fr));
-  close_trx(status);
-
-  fp = ftp2FILE(efXPM,NFILE,fnm,"w");
-  write_xpm(fp,0,"Temp. profile","T (a.u.)",
-           "t (fs)","R (nm)",
-           nframe,nmax+1,t_x,t_y,profile,0,tmax,
-           rgblo,rgbhi,&nlevels);
-  
-  gmx_thanx(stderr);
-  
-  return 0;
-}
-
diff --git a/src/contrib/gen_table.c b/src/contrib/gen_table.c
deleted file mode 100644 (file)
index 6c8f1bc..0000000
+++ /dev/null
@@ -1,848 +0,0 @@
-/*
- * 
- *                This source code is part of
- * 
- *                 G   R   O   M   A   C   S
- * 
- *          GROningen MAchine for Chemical Simulations
- * 
- *                        VERSION 3.3.99_development_20071104
- * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
- * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2006, The GROMACS development team,
- * check out http://www.gromacs.org for more information.
-
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- * 
- * If you want to redistribute modifications, please consider that
- * scientific software is very special. Version control is crucial -
- * bugs must be traceable. We will be happy to consider code for
- * inclusion in the official distribution, but derived work must not
- * be called official GROMACS. Details are found in the README & COPYING
- * files - if they are missing, get the official version at www.gromacs.org.
- * 
- * To help us fund GROMACS development, we humbly ask that you cite
- * the papers on the package - you can find them in the top README file.
- * 
- * For more info, check our website at http://www.gromacs.org
- * 
- * And Hey:
- * Groningen Machine for Chemical Simulation
- */
-#include <math.h>
-#include <string.h>
-#include <stdio.h>
-
-#include "copyrite.h"
-#include "typedefs.h"
-#include "macros.h"
-#include "gromacs/math/vec.h"
-#include "gromacs/commandline/pargs.h"
-#include "coulomb.h"
-
-enum { mGuillot2001a, mAB1, mLjc, mMaaren, mGuillot_Maple, mHard_Wall, mGG, mGG_qd_q, mGG_qd_qd, mGG_q_q, mNR };
-
-static double erf2(double x)
-{
-  return -(2*x*M_2_SQRTPI)*exp(-x*x);
-}
-
-static double erf1(double x)
-{
-  return M_2_SQRTPI*exp(-x*x);
-}
-
-static void do_hard(FILE *fp,int pts_nm,double efac,double delta)
-{
-  int    i,k,imax;
-  double x,vr,vr2,vc,vc2;
-  
-  if (delta < 0)
-    gmx_fatal(FARGS,"Delta should be >= 0 rather than %f\n",delta);
-    
-  imax     = 3.0*pts_nm;
-  for(i=0; (i<=imax); i++) {
-    x   =  i*(1.0/pts_nm);
-    
-    if (x < delta) {
-      /* Avoid very high numbers */
-      vc = vc2 = 1/delta;
-    }
-    else {
-      vc  = 1/(x);
-      vc2 = 2/pow(x,3);
-    }
-    vr  = erfc(efac*(x-delta))/2;
-    vr2 = (1-erf2(efac*(x-delta)))/2;
-    fprintf(fp,"%12.5e  %12.5e  %12.5e  %12.5e  %12.5e  %12.5e  %12.5e\n",
-           x,vr,vr2,0.0,0.0,vc,vc2);
-  }
-
-}
-
-static void do_AB1(FILE *fp,int eel,int pts_nm,int ndisp,int nrep)
-{
-  int    i,k,imax;
-  double myfac[3] = { 1, -1, 1 };
-  double myexp[3] = { 1, 6, 0 };
-  double x,v,v2;
-  
-  myexp[1] = ndisp;
-  myexp[2] = nrep;
-  imax     = 3.0*pts_nm;
-  for(i=0; (i<=imax); i++) {
-    x   =  i*(1.0/pts_nm);
-    
-    fprintf(fp,"%12.5e",x);
-    
-    for(k=0; (k<3); k++) {
-      if (x < 0.04) {
-       /* Avoid very high numbers */
-       v = v2 = 0;
-      }
-      else {
-       v  =  myfac[k]*pow(x,-myexp[k]);
-       v2 = (myexp[k]+1)*(myexp[k])*v/(x*x); 
-      }
-      fprintf(fp,"  %12.5e  %12.5e",v,v2);
-    }
-    fprintf(fp,"\n");
-  }
-}
-
-static void lo_do_ljc(double r,
-                     double *vc,double *fc,
-                     double *vd,double *fd,
-                     double *vr,double *fr)
-{
-  double r2,r_6,r_12;
-  
-  r2    = r*r;
-  r_6   = 1.0/(r2*r2*r2);
-  r_12  = r_6*r_6;
-
-  *vc   = 1.0/r;            /*  f(x)     Coulomb    */
-  *fc   = 1.0/(r2);         /* -f'(x)               */
-  
-  *vd   = -r_6;             /*  g(c)     Dispersion */
-  *fd   =  6.0*(*vd)/r;     /* -g'(x)               */
-
-  *vr   = r_12;             /*  h(x)     Repulsion  */
-  *fr   = 12.0*(*vr)/r;     /* -h'(x)               */
-}
-
-/* use with coulombtype = user */
-static void lo_do_ljc_pme(double r,
-                         double rcoulomb, double ewald_rtol,
-                         double *vc,double *fc,
-                         double *vd,double *fd,
-                         double *vr,double *fr)
-{
-  double r2,r_6,r_12;
-  double ewc;
-
-  ewc  = calc_ewaldcoeff(rcoulomb,ewald_rtol);
-
-  r2   = r*r;
-  r_6  = 1.0/(r2*r2*r2);
-  r_12 = r_6*r_6;
-  
-  *vc   = erfc(ewc*r)/r;
-  /* *vc2  = 2*erfc(ewc*r)/(r*r2)+2*exp(-(ewc*ewc*r2))*ewc*M_2_SQRTPI/r2+
-     2*ewc*ewc*ewc*exp(-(ewc*ewc*r2))*M_2_SQRTPI;*/
-  *fc  = ewc*exp(-ewc*ewc*r2)*M_2_SQRTPI/r + erfc(ewc*r)/r2;
-
-  *vd  = -r_6;
-  *fd  = -6.0*(*vd)/r;
-
-  *vr  = r_12;
-  *fr  = 12.0*(*vr)/r;
-}
-
-static void lo_do_guillot(double r,double xi, double xir,
-                         double *vc,double *fc,
-                         double *vd,double *fd,
-                         double *vr,double *fr)
-{
-  double qO     = -0.888;
-  double qOd    =  0.226;
-  double f0     = qOd/qO;
-  double sqpi   = sqrt(M_PI);
-  double rxi1,rxi2,z;
-  double r2,r_6;
-
-  r2   = r*r;
-  r_6  = 1.0/(r2*r2*r2);
-  
-  rxi1    = r/(2*xi);
-  rxi2    = r/(sqrt(2)*xi);
-  *vc   = (1 + f0*f0*erf(r/(2*xi)) + 2*f0*erf(r/(sqrt(2)*xi)) )/r;
-
-  *fc   =  f0*f0*erf(r/(2*xi)) + 2*f0*erf(r/(sqrt(2)*xi));
-    ;
- /* MuPad: Uc := erf(r/(2*xi))/r +  
-
-     Mathematica:
-     r1 := r/(2*xi);
-     r2 := r/(Sqrt[2] * xi);
-     Uc[r_] := (1 + f0 * f0 * Erf[r/(2*xi)] + 2 * f0 * Erf[r/(Sqrt[2]*xi)]) / r;
-     -D[Uc[r],r]
-     CForm= 
-     -(((2*f0*Sqrt(2/Pi))/(Power(E,Power(r,2)/(2.*Power(xi,2)))*xi) + 
-     Power(f0,2)/(Power(E,Power(r,2)/(4.*Power(xi,2)))*Sqrt(Pi)*xi))/r) + 
-     (1 + Power(f0,2)*Erf(r/(2.*xi)) + 2*f0*Erf(r/(Sqrt(2)*xi)))/Power(r,2)
-
-     
-Uc1[r_] := 1/r;
--D[Uc1[r],r]
-          -2
-Out[20]= r
-
-Uc2[r_] := f0^2 * Erf[r1] / r;
--D[Uc2[r],r]
-
-
-Uc3[r_] := 2 * f0 * Erf[r2]/ r;
--D[Uc3[r],r]
-
-Uc[r_] := Erf[r/(2*xi)] / r
-
-D[Uc[r],r]
-
-
-D[Erf[r],r]
-
-*/
-    *vc   = (1 + sqr(f0)*erf(rxi1) + 2*f0*erf(rxi2))/r;
-    *fc   = 
-      (1/r 
-       + (- f0 * (2 * sqrt(2) + exp(r2/4*xi*xi)*f0)/(exp(r2/(2*xi*xi))*sqrt(M_PI)*xi) + f0*f0*erf(r/(2*xi)) + 2 *f0 * erf(r/(sqrt(2 * xi)))  )/r2)
-      ;
-
-
-  /*  *vc2  = ((2/sqr(r))*(*vc -
-                      sqr(f0)*erf1(r1)/(2*xi) -
-                      4*f0*erf1(r2)/sqrt(2)*xi) + 
-                      (1/r)*(sqr(f0/(2.0*xi))*erf2(r1) + (2*f0/sqr(xi)))*erf2(r2)); */
-
-  *vd  = -r_6;
-  *fd  = -6.0*(*vd)/r;
-
-  z     = r/(2.0*xir);
-  *vr   = erfc(z)/z;
-  *fr   = 0.0;
-  //  *vr2  = (sqpi*(*vr)/(2.0*z*z)+(1.0/(z*z)+1)*exp(-z*z))/(sqpi*sqr(xir));
-}
-
-void lo_do_guillot_maple(double r,double xi,double xir,
-                        double *vc,double *vc2,
-                        double *vd,double *vd2,
-                        double *vr,double *vr2)
-{
-  double qO     = -0.888;
-  double qOd    = 0.226;
-  double f0     = qOd/qO;
-  double sqpi   = sqrt(M_PI);
-
-  *vc = pow(-f0/(1.0+f0)+1.0,2.0)/r+pow(-f0/(1.0+f0)+1.0,2.0)*f0*f0*erf(r/xi/2.0)/r+2.0*pow(-f0/(1.0+f0)+1.0,2.0)*f0*erf(r*sqrt(2.0)/xi/2.0)/r;
-  *vc2 = 2.0*pow(-f0/(1.0+f0)+1.0,2.0)/(r*r*r)-pow(-f0/(1.0+f0)+1.0,2.0)*f0*f0/sqrt(M_PI)/(xi*xi*xi)*exp(-r*r/(xi*xi)/4.0)/2.0-2.0*pow(-f0/(1.0+f0)+1.0,2.0)*f0*f0/sqrt(M_PI)*exp(-r*r/(xi*xi)/4.0)/xi/(r*r)+2.0*pow(-f0/(1.0+f0)+1.0,2.0)*f0*f0*erf(r/xi/2.0)/(r*r*r)-2.0*pow(-f0/(1.0+f0)+1.0,2.0)*f0/sqrt(M_PI)/(xi*xi*xi)*exp(-r*r/(xi*xi)/2.0)*sqrt(2.0)-4.0*pow(-f0/(1.0+f0)+1.0,2.0)*f0/sqrt(M_PI)*exp(-r*r/(xi*xi)/2.0)*sqrt(2.0)/xi/(r*r)+4.0*pow(-f0/(1.0+f0)+1.0,2.0)*f0*erf(r*sqrt(2.0)/xi/2.0)/(r*r*r);
-  
-  *vd   = -1.0/(r*r*r*r*r*r);
-  *vd2  = -42.0/(r*r*r*r*r*r*r*r);
-  *vr   = 2.0*erfc(r/xir/2.0)/r*xir;
-  *vr2  = 1.0/sqrt(M_PI)/(xir*xir)*exp(-r*r/(xir*xir)/4.0)+4.0/sqrt(M_PI)*exp(-r*r/(xir*xir)/4.0)/(r*r)+4.0*erfc(r/xir/2.0)/(r*r*r)*xir;
-}
-
-static void lo_do_GG(double r,double xi,double xir,
-                    double *vc,double *fc,
-                    double *vd,double *fd,
-                    double *vr,double *fr)
-{
-  double qO     = -0.888;
-  double qOd    =  0.226;
-  double f0     = qOd/qO;
-  double sqpi   = sqrt(M_PI);
-  double r2,xi2;
-
-  r2 = r*r;
-  xi2 = xi*xi;
-
-  *vc = 1.0/r + f0*f0*erf(r/(2*xi))/r + 2*f0*erf(r/(sqrt(2)*xi))/r;
-
-  // -D[1/r,r] -D[f0*f0*Erf[r/(2*xi)]/r,r] -D[2*f0*Erf[r/(Sqrt[2]*xi)]/r,r]
-  *fc  = (
-    1.0/r2 +
-    f0*f0*(-exp(-r2/(4*xi2))/(sqrt(M_PI) * r * xi) + erf(r/(2*xi))/r2) +
-    2*f0*(-sqrt(2.0/M_PI)*exp(-r2/(2*xi2))/ (r*xi) + erf(r/(sqrt(2)*xi))/r2)
-    );
-
-  // -D[1/r^6,r]
-  *vd  = -1.0/(r*r*r*r*r*r);
-  *fd  = 6.0*(*vd)/r;
-  
-  //  -D[2*xir*Erfc[r/(2*xir)]/r,r]
-  *vr  = 2.*xir*erfc(r/(2.*xir))/r;
-  *fr  = -(-2.*exp(-r2/(4*xir*xir)) / (sqrt(M_PI)*r)  - 2*xir*erfc(r/(2*xir))/r2  );
-
-}
-
-/* Guillot2001 diffuse charge - diffuse charge interaction
-   Mathematica
-
-In[19]:= Uc[r_] := Erf[r/(2*xi)]/r
-
-In[20]:= -D[Uc[r],r]
-
-                                             r
-                                        Erf[----]
-                       1                    2 xi
-Out[20]= -(-------------------------) + ---------
-             2      2                       2
-            r /(4 xi )                     r
-           E           Sqrt[Pi] r xi
-*/
-void lo_do_GG_qd_qd(double r,double xi,double xir,
-                   double *vc,double *fc,
-                   double *vd,double *fd,
-                   double *vr,double *fr)
-{
-  double sqpi   = sqrt(M_PI);
-
-  *vc = erf(r/(2*xi))/r; 
-    //erf((r*(1.0/2.0))/xi)/r;
-  *fc = -(1.0/(exp(r*r/(4*xi*xi))*sqpi*r*xi)) + (erf(r/2*xi)/(r*r));
-
-    //2.0*pow(r, -3.0)*erf((r*(1.0/2.0))/xi) - (1.0/2.0)*pow(M_PI, -1.0/2.0)*pow(xi, -3.0)*exp((-1.0/4.0)*(r*r)*pow(xi, -2.0)) - (2.0*pow(M_PI, -1.0/2.0)*pow(r, -2.0)*exp((-1.0/4.0)*(r*r)*pow(xi, -2.0)))/xi ;
-  *vd  = 0.0;
-  *fd  = 0.0;
-  *vr  = 0.0;
-  *fr  = 0.0;
-}
-
-/* Guillot2001 charge - diffuse charge interaction eqn 4 & 5
-   Mathematica
-In[17]:= Uc[r_] := Erf[r/(Sqrt[2]*xi)]/r
-
-In[18]:= -D[Uc[r],r]
-
-                    2                  r
-               Sqrt[--]        Erf[----------]
-                    Pi             Sqrt[2] xi
-Out[18]= -(----------------) + ---------------
-             2      2                 2
-            r /(2 xi )               r
-           E           r xi
-*/
-void lo_do_GG_q_qd(double r,double xi,double xir,
-                  double *vc,double *fc,
-                  double *vd,double *fd,
-                  double *vr,double *fr)
-{
-  double sqpi   = sqrt(M_PI);
-
-  *vc = erf(r/(sqrt(2)*xi)) / r;
-    //erf(((1.0/2.0)*pow(2.0, 1.0/2.0)*r)/xi)/r ;
-  *fc = -(sqrt(2/M_PI)/(exp(r*r/(2*xi*xi))*r*xi)) + (erf(r/(sqrt(2)*xi))/(r*r));
-    //2.0*pow(r, -3.0)*erf(((1.0/2.0)*pow(2.0, 1.0/2.0)*r)/xi) - pow(2.0, 1.0/2.0)*pow(M_PI, -1.0/2.0)*pow(xi, -3.0)*exp((-1.0/2.0)*(r*r)*pow(xi, -2.0)) - (2.0*pow(2.0, 1.0/2.0)*pow(M_PI, -1.0/2.0)*pow(r, -2.0)*exp((-1.0/2.0)*(r*r)*pow(xi, -2.0)))/xi ;
-
-  *vd  = 0.0;
-  *fd  = 0.0;
-  *vr  = 0.0;
-  *fr  = 0.0;
-}
-
-/* Guillot2001 charge - charge interaction (normal coulomb), repulsion and dispersion
-   Mathematica
-
-In[6]:= Uc[r_] := 1.0/r
-
-In[7]:= -D[Uc[r],r]
-
-        1.
-Out[7]= --
-         2
-        r
-
-In[8]:= Ud[r_] := -1.0/r^6
-
-In[9]:= -D[Ud[r],r]
-
-        -6.
-Out[9]= ---
-         7
-        r
-
-In[13]:= Ur[r_] := (2*xir)*Erfc[r/(2*xir)]/r
-
-In[14]:= -D[Ur[r],r]
-                                                r
-                                   2 xir Erfc[-----]
-                    2                         2 xir
-Out[16]= ----------------------- + -----------------
-           2       2                       2
-          r /(4 xir )                     r
-         E            Sqrt[Pi] r
-
-
-*/
-void lo_do_GG_q_q(double r,double xi,double xir,
-                 double *vc,double *fc,
-                 double *vd,double *fd,
-                 double *vr,double *fr)
-{
-  double sqpi   = sqrt(M_PI);
-
-  *vc  = 1.0/r;
-  *fc  = 1.0/(r*r);
-
-  *vd  = -1.0/(r*r*r*r*r*r);
-  *fd  = -6.0/(r*r*r*r*r*r*r);
-
-  *vr  = (2.0*xir*erfc(r/(2.0*xir)))/r;
-  *fr  = 2.0/(exp((r*r)/(4*xir*xir)) * sqpi *r) + (2*xir*erfc((r*xir)/2.0))/(r*r);
-    //4.0*pow(M_PI, -1.0/2.0)*pow(r, -2.0)*exp((-1.0/4.0)*(r*r)*pow(xir, -2.0)) + pow(M_PI, -1.0/2.0)*pow(xir, -2.0)*exp((-1.0/4.0)*(r*r)*pow(xir, -2.0)) + 4.0*pow(r, -3.0)*xir*erfc((r*(1.0/2.0))/xir);
-}
-
-static void do_guillot(FILE *fp,int eel,int pts_nm,double rc,double rtol,double xi,double xir)
-{
-  int    i,i0,imax;
-  double r,vc,fc,vd,fd,vr,fr;
-
-  imax = 3*pts_nm;
-  for(i=0; (i<=imax); i++) {
-    r     = i*(1.0/pts_nm);
-    /* Avoid very large numbers */
-    if (r < 0.04) {
-      vc = fc = vd = fd = vr = fr = 0;
-    }
-    else 
-      if (eel == eelPME) {
-       fprintf(fp, "Not implemented\n");
-      } else if (eel == eelCUT) { 
-       lo_do_guillot(r,xi,xir,&vc,&fc,&vd,&fd,&vr,&fr);
-      }
-    fprintf(fp,"%15.10e   %15.10e %15.10e   %15.10e %15.10e   %15.10e %15.10e\n",
-           r,vc,fc,vd,fd,vr,fr);
-
-  }
-}
-
-/* TODO: 
-   PvM: Everything is hardcoded, we should fix that. How?
-*/
-static void do_guillot2001a(const char *file,int eel,int pts_nm,double rc,double rtol,double xi,double xir)
-{
-  FILE *fp=NULL;
-  static char buf[256];
-  static char *atype[]   = { "HW", "OW", "HWd", "OWd", NULL };
-  int    i,j,k,i0,imax,atypemax=4;
-  double r,vc,fc,vd,fd,vr,fr;
-
-  /* For Guillot2001a we have four types: HW, OW, HWd and OWd. */
-
-  for (j=0;(j<atypemax);j++) {           /* loops over types */
-    for (k=0; (k<=j); k++) {                    
-      sprintf(buf,"table_%s_%s.xvg",atype[k],atype[j]);
-      
-      printf("%d %d %s\n", j, k, buf);
-      /* Guillot2001a eqn 2, 6 and 7 */
-      if (((strcmp(atype[j],"HW") == 0) && (strcmp(atype[k],"HW") == 0)) ||
-         ((strcmp(atype[j],"OW") == 0) && (strcmp(atype[k],"HW") == 0)) ||
-         ((strcmp(atype[j],"OW") == 0) && (strcmp(atype[k],"OW") == 0))) {
-
-       fp = gmx_ffopen(buf,"w");
-  
-       imax = 3*pts_nm;
-       for(i=0; (i<=imax); i++) {
-         r     = i*(1.0/pts_nm);
-         /* Avoid very large numbers */
-         if (r < 0.04) {
-           vc = fc = vd = fd = vr = fr = 0;
-         }
-         else 
-           if (eel == eelPME || eel == eelRF) {
-             fprintf(stderr, "Not implemented\n");
-             exit(1);
-           } else if (eel == eelCUT) { 
-             lo_do_GG_q_q(r,xi,xir,&vc,&fc,&vd,&fd,&vr,&fr);
-           }
-         fprintf(fp,"%15.10e   %15.10e %15.10e   %15.10e %15.10e   %15.10e %15.10e\n",
-                 r,vc,fc,vd,fd,vr,fr);
-         
-       }
-       gmx_ffclose(fp);
-     
-       /* Guillot eqn 4 and 5 */
-      } else if (((strcmp(atype[j],"HWd") == 0) && (strcmp(atype[k],"HW") == 0)) ||
-                ((strcmp(atype[j],"HWd") == 0) && (strcmp(atype[k],"OW") == 0)) ||
-                ((strcmp(atype[j],"OWd") == 0) && (strcmp(atype[k],"HW") == 0)) ||
-                ((strcmp(atype[j],"OWd") == 0) && (strcmp(atype[k],"OW") == 0))) {
-       
-       fp = gmx_ffopen(buf,"w");
-  
-       imax = 3*pts_nm;
-       for(i=0; (i<=imax); i++) {
-         r     = i*(1.0/pts_nm);
-         /* Avoid very large numbers */
-         if (r < 0.04) {
-           vc = fc = vd = fd = vr = fr = 0;
-         }
-         else 
-           if (eel == eelPME || eel == eelRF) {
-             fprintf(stderr, "Not implemented\n");
-             exit(1);
-           } else if (eel == eelCUT) { 
-             lo_do_GG_q_qd(r,xi,xir,&vc,&fc,&vd,&fd,&vr,&fr);
-           }
-         fprintf(fp,"%15.10e   %15.10e %15.10e   %15.10e %15.10e   %15.10e %15.10e\n",
-                 r,vc,fc,vd,fd,vr,fr);
-         
-       }
-       gmx_ffclose(fp);
-
-       /* Guillot2001a eqn 3 */
-      } else if (((strcmp(atype[j],"HWd") == 0) && (strcmp(atype[k],"HWd") == 0)) ||
-                ((strcmp(atype[j],"OWd") == 0) && (strcmp(atype[k],"HWd") == 0)) ||
-                ((strcmp(atype[j],"OWd") == 0) && (strcmp(atype[k],"OWd") == 0))) {
-
-       fp = gmx_ffopen(buf,"w");
-  
-       imax = 3*pts_nm;
-       for(i=0; (i<=imax); i++) {
-         r     = i*(1.0/pts_nm);
-         /* Avoid very large numbers */
-         if (r < 0.04) {
-           vc = fc = vd = fd = vr = fr = 0;
-         }
-         else 
-           if (eel == eelPME || eel == eelRF) {
-             fprintf(stderr, "Not implemented\n");
-             exit(1);
-           } else if (eel == eelCUT) { 
-             lo_do_GG_qd_qd(r,xi,xir,&vc,&fc,&vd,&fd,&vr,&fr);
-           }
-         fprintf(fp,"%15.10e   %15.10e %15.10e   %15.10e %15.10e   %15.10e %15.10e\n",
-                 r,vc,fc,vd,fd,vr,fr);
-         
-       }
-       gmx_ffclose(fp);
-
-      } else 
-       gmx_fatal(FARGS,"Invalid atom type: %s %s", atype[j], atype[k]);
-      
-      
-    }
-  }
-}
-
-static void do_ljc(FILE *fp,int eel,int pts_nm,real rc,real rtol)
-{ 
-  int    i,i0,imax;
-  double r,vc,fc,vd,fd,vr,fr;
-
-  imax = 3*pts_nm;
-  for(i=0; (i<=imax); i++) {
-    r     = i*(1.0/pts_nm);
-    /* Avoid very large numbers */
-    if (r < 0.04) {
-      vc = fc = vd = fd = vr = fr = 0;
-    } else {
-      if (eel == eelPME) {
-       lo_do_ljc_pme(r,rc,rtol,&vc,&fc,&vd,&fd,&vr,&fr);
-      } else if (eel == eelCUT) { 
-       lo_do_ljc(r,&vc,&fc,&vd,&fd,&vr,&fr);
-      }
-    }
-    fprintf(fp,"%15.10e   %15.10e %15.10e   %15.10e %15.10e   %15.10e %15.10e\n",
-           r,vc,fc,vd,fd,vr,fr);
-  }
-}
-
-static void do_guillot_maple(FILE *fp,int eel,int pts_nm,double rc,double rtol,double xi,double xir)
-{
-  int    i,i0,imax;
-  /*  double xi     = 0.15;*/
-  double r,vc,vc2,vd,vd2,vr,vr2;
-
-  imax = 3*pts_nm;
-  for(i=0; (i<=imax); i++) {
-    r     = i*(1.0/pts_nm);
-    /* Avoid very large numbers */
-    if (r < 0.04) {
-      vc = vc2 = vd = vd2 = vr = vr2 = 0;
-    }
-    else
-      if (eel == eelPME) {
-       fprintf(fp, "Not implemented\n");
-      } else if (eel == eelCUT) { 
-       lo_do_guillot_maple(r,xi,xir,&vc,&vc2,&vd,&vd2,&vr,&vr2);
-      }
-    fprintf(fp,"%12.5e  %12.5e  %12.5e   %12.5e  %12.5e  %12.5e  %12.5e\n",
-           r,vc,vc2,vd,vd2,vr,vr2);
-  }
-} 
-
-static void do_GG(FILE *fp,int eel,int pts_nm,double rc,double rtol,double xi,double xir)
-{
-  int    i,i0,imax;
-  double r,vc,vc2,vd,vd2,vr,vr2;
-
-  imax = 3*pts_nm;
-  for(i=0; (i<=imax); i++) {
-    r     = i*(1.0/pts_nm);
-    /* Avoid very large numbers */
-    if (r < 0.04) {
-      vc = vc2 = vd = vd2 = vr = vr2 = 0;
-    }
-    else
-      if (eel == eelPME) {
-       fprintf(fp, "Not implemented\n");
-      } else if (eel == eelCUT) { 
-       lo_do_GG(r,xi,xir,&vc,&vc2,&vd,&vd2,&vr,&vr2);
-      }
-    fprintf(fp,"%15.10e   %15.10e %15.10e   %15.10e %15.10e   %15.10e %15.10e\n",
-           r,vc,vc2,vd,vd2,vr,vr2);
-  }
-} 
-
-static void do_GG_q_q(FILE *fp,int eel,int pts_nm,double rc,double rtol,double xi,double xir)
-{
-  int    i,i0,imax;
-  double r,vc,vc2,vd,vd2,vr,vr2;
-
-  imax = 3*pts_nm;
-  for(i=0; (i<=imax); i++) {
-    r     = i*(1.0/pts_nm);
-    /* Avoid very large numbers */
-    if (r < 0.04) {
-      vc = vc2 = vd = vd2 = vr = vr2 = 0;
-    }
-    else
-      if (eel == eelPME) {
-       fprintf(fp, "Not implemented\n");
-      } else if (eel == eelCUT) { 
-       lo_do_GG_q_q(r,xi,xir,&vc,&vc2,&vd,&vd2,&vr,&vr2);
-      }
-    fprintf(fp,"%12.5e  %12.5e  %12.5e   %12.5e  %12.5e  %12.5e  %12.5e\n",
-           r,vc,vc2,vd,vd2,vr,vr2);
-  }
-} 
-
-static void do_GG_q_qd(FILE *fp,int eel,int pts_nm,double rc,double rtol,double xi,double xir)
-{
-  int    i,i0,imax;
-  /*  double xi     = 0.15;*/
-  double r,vc,vc2,vd,vd2,vr,vr2;
-
-  imax = 3*pts_nm;
-  for(i=0; (i<=imax); i++) {
-    r     = i*(1.0/pts_nm);
-    /* Avoid very large numbers */
-    if (r < 0.04) {
-      vc = vc2 = vd = vd2 = vr = vr2 = 0;
-    }
-    else
-      if (eel == eelPME) {
-       fprintf(fp, "Not implemented\n");
-      } else if (eel == eelCUT) { 
-       lo_do_GG_q_qd(r,xi,xir,&vc,&vc2,&vd,&vd2,&vr,&vr2);
-      }
-    fprintf(fp,"%12.5e  %12.5e  %12.5e   %12.5e  %12.5e  %12.5e  %12.5e\n",
-           r,vc,vc2,vd,vd2,vr,vr2);
-  }
-} 
-
-static void do_GG_qd_qd(FILE *fp,int eel,int pts_nm,double rc,double rtol,double xi,double xir)
-{
-  int    i,i0,imax;
-  /*  double xi     = 0.15;*/
-  double r,vc,vc2,vd,vd2,vr,vr2;
-
-  imax = 3*pts_nm;
-  for(i=0; (i<=imax); i++) {
-    r     = i*(1.0/pts_nm);
-    /* Avoid very large numbers */
-    if (r < 0.04) {
-      vc = vc2 = vd = vd2 = vr = vr2 = 0;
-    }
-    else
-      if (eel == eelPME) {
-       fprintf(fp, "Not implemented\n");
-      } else if (eel == eelCUT) { 
-       lo_do_GG_qd_qd(r,xi,xir,&vc,&vc2,&vd,&vd2,&vr,&vr2);
-      }
-    fprintf(fp,"%12.5e  %12.5e  %12.5e   %12.5e  %12.5e  %12.5e  %12.5e\n",
-           r,vc,vc2,vd,vd2,vr,vr2);
-  }
-} 
-
-static void do_maaren(FILE *fp,int eel,int pts_nm,int npow)
-{
-  int    i,i0,imax;
-  double xi     = 0.05;
-  double xir     = 0.0615;
-  double r,vc,vc2,vd,vd2,vr,vr2;
-
-  imax = 3*pts_nm;
-  for(i=0; (i<=imax); i++) {
-    r     = i*(1.0/pts_nm);
-    /* Avoid very large numbers */
-    if (r < 0.04) {
-      vc = vc2 = vd = vd2 = vr = vr2 = 0;
-    }
-    else {
-      lo_do_guillot_maple(r,xi,xir,&vc,&vc2,&vd,&vd2,&vr,&vr2);
-      vr  =  pow(r,-1.0*npow);
-      vr2 = (npow+1.0)*(npow)*vr/sqr(r); 
-    }
-    fprintf(fp,"%12.5e  %12.5e  %12.5e   %12.5e  %12.5e  %12.5e  %12.5e\n",
-           r,vc,vc2,vd,vd2,vr,vr2);
-  }
-}
-
-int main(int argc,char *argv[])
-{
-  static char *desc[] = {
-    "[TT]gen_table[tt] generates tables for [TT]mdrun[tt] for use with the USER defined",
-    "potentials. Note that the format has been update for higher",
-    "accuracy in the forces starting with version 4.0. Using older",
-    "tables with 4.0 will silently crash your simulations, as will",
-    "using new tables with an older GROMACS version. This is because in the",
-    "old version the second derevative of the potential was specified",
-    "whereas in the new version the first derivative of the potential",
-    "is used instead.[PAR]"
-  };
-  static char *opt[]     = { NULL, "cut", "rf", "pme", NULL };
-  /*  static char *model[]   = { NULL, "guillot", "AB1", "ljc", "maaren", "guillot_maple", "hard_wall", "gg_q_q", "gg_qd_q", "gg_qd_qd", NULL }; */
-  static char *model[]   = { NULL, "ljc", "gg", "guillot2001a",  
-                            NULL };
-  static real delta=0,efac=500,rc=0.9,rtol=1e-05,xi=0.15,xir=0.0615;
-  static real w1=20,w2=20;
-  static int  nrow1=1,nrow2=1;
-  static int  nrep       = 12;
-  static int  ndisp      = 6;
-  static int  pts_nm     = 500;
-  t_pargs pa[] = {
-    { "-el",     FALSE, etENUM, {opt},
-      "Electrostatics type: cut, rf or pme" },
-    { "-rc",     FALSE, etREAL, {&rc},
-      "Cut-off required for rf or pme" },
-    { "-rtol",   FALSE, etREAL, {&rtol},
-      "Ewald tolerance required for pme" },
-    { "-xi",   FALSE, etREAL, {&xi},
-      "Width of the Gaussian diffuse charge of the G&G model" },
-    { "-xir",   FALSE, etREAL, {&xir},
-      "Width of erfc(z)/z repulsion of the G&G model (z=0.5 rOO/xir)" },
-    { "-m",      FALSE, etENUM, {model},
-      "Model for the tables" },
-    { "-resol",  FALSE, etINT,  {&pts_nm},
-      "Resolution of the table (points per nm)" },
-    { "-delta",  FALSE, etREAL, {&delta},
-      "Displacement in the Coulomb functions (nm), used as 1/(r+delta). Only for hard wall potential." },
-    { "-efac",   FALSE, etREAL, {&efac},
-      "Number indicating the steepness of the hardwall potential." },
-    { "-nrep",   FALSE, etINT,  {&nrep},
-      "Power for the repulsion potential (with model AB1 or maaren)" },
-    { "-ndisp",   FALSE, etINT,  {&ndisp},
-      "Power for the dispersion potential (with model AB1 or maaren)" }
-  };
-#define NPA asize(pa)
-  t_filenm fnm[] = {
-    { efXVG, "-o", "table", ffWRITE }
-  };
-#define NFILE asize(fnm)
-  FILE *fp;
-  char *fn;
-  int  eel=0,m=0;
-  
-  CopyRight(stderr,argv[0]);
-  parse_common_args(&argc,argv,PCA_CAN_VIEW | PCA_CAN_TIME,
-                   NFILE,fnm,NPA,pa,asize(desc),desc,0,NULL);
-  
-  if (strcmp(opt[0],"cut") == 0) 
-    eel = eelCUT;
-  else if (strcmp(opt[0],"rf") == 0) 
-    eel = eelRF;
-  else if (strcmp(opt[0],"pme") == 0) 
-    eel = eelPME;
-  else 
-    gmx_fatal(FARGS,"Invalid argument %s for option -e",opt[0]);
-  if (strcmp(model[0],"maaren") == 0) 
-    m = mMaaren;
-  else if (strcmp(model[0],"AB1") == 0) 
-    m = mAB1;
-  else if (strcmp(model[0],"ljc") == 0) 
-    m = mLjc;
-  else if (strcmp(model[0],"guillot2001a") == 0) 
-    m = mGuillot2001a;
-  else if (strcmp(model[0],"guillot_maple") == 0) 
-    m = mGuillot_Maple;
-  else if (strcmp(model[0],"hard_wall") == 0) 
-    m = mHard_Wall;
-  else if (strcmp(model[0],"gg") == 0) 
-    m = mGG;
-  else if (strcmp(model[0],"gg_qd_q") == 0) 
-    m = mGG_qd_q;
-  else if (strcmp(model[0],"gg_qd_qd") == 0) 
-    m = mGG_qd_qd;
-  else if (strcmp(model[0],"gg_q_q") == 0) 
-    m = mGG_q_q;
-  else 
-    gmx_fatal(FARGS,"Invalid argument %s for option -m",opt[0]);
-    
-  fn = opt2fn("-o",NFILE,fnm);
-  if ((m != mGuillot2001a)) 
-    fp = gmx_ffopen(fn,"w");
-  switch (m) {
-  case mGuillot2001a:
-    do_guillot2001a(fn,eel,pts_nm,rc,rtol,xi,xir);
-    break;
-  case mGuillot_Maple:
-    fprintf(fp, "#\n# Table Guillot_Maple: rc=%g, rtol=%g, xi=%g, xir=%g\n#\n",rc,rtol,xi,xir);
-    do_guillot_maple(fp,eel,pts_nm,rc,rtol,xi,xir);
-    break;
-  case mGG_q_q:
-    fprintf(fp, "#\n# Table GG_q_q: rc=%g, rtol=%g, xi=%g, xir=%g\n#\n",rc,rtol,xi,xir);
-    do_GG_q_q(fp,eel,pts_nm,rc,rtol,xi,xir);
-    break;
-  case mGG:
-    fprintf(fp, "#\n# Table GG: rc=%g, rtol=%g, xi=%g, xir=%g\n#\n",rc,rtol,xi,xir);
-    do_GG(fp,eel,pts_nm,rc,rtol,xi,xir);
-    break;
-  case mGG_qd_q:
-    fprintf(stdout, "case mGG_qd_q");
-    fprintf(fp, "#\n# Table GG_qd_q: rc=%g, rtol=%g, xi=%g, xir=%g\n#\n",rc,rtol,xi,xir);
-    do_GG_q_qd(fp,eel,pts_nm,rc,rtol,xi,xir);
-    break;
-  case mGG_qd_qd:
-    fprintf(stdout, "case mGG_qd_qd");
-    fprintf(fp, "#\n# Table GG_qd_qd: rc=%g, rtol=%g, xi=%g, xir=%g\n#\n",rc,rtol,xi,xir);
-    do_GG_qd_qd(fp,eel,pts_nm,rc,rtol,xi,xir);
-    break;
-  case mMaaren:
-    do_maaren(fp,eel,pts_nm,nrep);
-    break;
-  case mAB1:
-    fprintf(fp, "#\n# Table AB1: ndisp=%d nrep=%d\n#\n",ndisp,nrep);
-    do_AB1(fp,eel,pts_nm,ndisp,nrep);
-    break;
-  case mLjc:
-    fprintf(fp, "#\n# Table LJC(12-6-1): rc=%g, rtol=%g\n#\n",rc,rtol);
-    do_ljc(fp,eel,pts_nm,rc,rtol);
-    break;
-  case mHard_Wall:
-    do_hard(fp,pts_nm,efac,delta);
-    break;
-  default:
-    gmx_fatal(FARGS,"Model %s not supported yet",model[0]);
-  }  
-  if ((m != mGuillot2001a)) 
-    gmx_ffclose(fp);
-  
-  gmx_thanx(stdout);
-  
-  return 0;
-}
diff --git a/src/contrib/gmx_sdf.c b/src/contrib/gmx_sdf.c
deleted file mode 100644 (file)
index 6818a77..0000000
+++ /dev/null
@@ -1,771 +0,0 @@
-/*
- * 
- *                This source code is NOT part of
- * 
- *                 G   R   O   M   A   C   S
- * 
- *          GROningen MAchine for Chemical Simulations
- * 
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- * 
- * And Hey:
- * Gyas ROwers Mature At Cryogenic Speed
- */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <math.h>
-
-#include "typedefs.h"
-#include "macros.h"
-#include "gromacs/math/vec.h"
-#include "gromacs/pbcutil/pbc.h"
-#include "gromacs/pbcutil/rmpbc.h"
-#include "copyrite.h"
-#include "gromacs/utility/futil.h"
-#include "gromacs/commandline/pargs.h"
-#include "gromacs/fileio/tpxio.h"
-#include "gromacs/topology/index.h"
-#include "gromacs/utility/smalloc.h"
-#include "nrnb.h"
-#include "gstat.h"
-#include "gromacs/utility/fatalerror.h"
-
-
-#define G_REF1      0
-#define G_REF2      1
-#define G_REF3      2
-#define G_SDF       3
-#define NDX_REF1    4
-#define NDX_REF2    5
-#define NDX_REF3    6
-#define G_REFMOL    7
-
-static void i_write(FILE *output, int value)
-{
-  if(fwrite(&value,sizeof(int),1,output) != 1)
-  {
-    gmx_fatal(FARGS,"Error writing to output file");
-  }
-}
-
-
-static void f_write(FILE *output,float value)
-{
-  if(fwrite(&value,sizeof(float),1,output) != 1)
-  {
-    gmx_fatal(FARGS,"Error writing to output file");
-  }
-}
-
-
-static void do_sdf(const char *fnNDX,const char *fnTPS,const char *fnTRX, 
-                   const char *fnSDF, const char *fnREF, gmx_bool bRef, 
-                   rvec cutoff, real binwidth, int mode, rvec triangle, 
-                   rvec dtri, const output_env_t oenv)
-{
-  FILE       *fp;
-  t_trxstatus *status;
-  int        ng,natoms,i,j,k,l,X,Y,Z,lc,dest;
-  ivec       nbin;
-  int        ***count;
-  /* real       ***sdf; */
-  real       sdf,min_sdf=1e10,max_sdf=0;
-  char       **grpname;
-  int        *isize;
-  int        isize_cg=0;
-  int        isize_ref=3;
-  int        ref_resind[3]={0};
-  int        nrefmol=0,refc=0;
-  atom_id    **index;
-  atom_id    *index_cg=NULL;
-  atom_id    *index_ref=NULL;
-  real       t,boxmin,hbox,normfac;
-  real       invbinw;
-  rvec       tri_upper,tri_lower;
-  rvec       *x,xcog,dx,*x_i1,xi,*x_refmol;
-  matrix     box;
-  matrix     rot; /* rotation matrix := unit vectors for the molecule frame */
-  rvec       k_mol,i1_mol,i2_mol,dx_mol;
-  real       delta;
-  atom_id    ix,jx;
-  t_topology top;
-  gmx_rmpbc_t  gpbc=NULL;
-  int        ePBC=-1;
-  t_pbc      pbc;
-  gmx_bool       bTop=FALSE,bRefDone=FALSE,bInGroup=FALSE;
-  char       title[STRLEN];
-
-
-  /* Read Topology */
-  if (fnTPS) {
-    bTop=read_tps_conf(fnTPS,title,&top,&ePBC,&x,NULL,box,TRUE);
-  }
-  
-
-
-  if ( !bTop ) {
-    fprintf(stderr,"\nNeed tpr-file to make a reference structure.\n");
-    fprintf(stderr,"Option -r will be ignored!\n");
-    bRef = FALSE;
-  }
-
-
-  /* Allocate memory for 4 groups, 3 dummy groups and a group for the ref 
-structure if needed */
-  ng = 4;
-  snew(grpname,ng);
-  /* the dummy groups are used to dynamically store triples of atoms */
-  /* for molecular coordinate systems */
-  if ( bRef )
-    {
-      snew(isize,ng+4);
-      snew(index,ng+4);
-    }
-  else 
-    {
-      snew(isize,ng+3);
-      snew(index,ng+3);
-    }
-
-
-  /* Read the index groups */
-  fprintf(stderr,"\nSelect the 3 reference groups and the SDF group:\n");
-  if (fnTPS)
-    get_index(&top.atoms,fnNDX,ng,isize,index,grpname);
-  else
-    rd_index(fnNDX,ng,isize,index,grpname);
-
-
-  isize[NDX_REF1]=isize[G_REF1];
-  for (i=NDX_REF1; i<=NDX_REF3; i++)
-    snew(index[i],isize[NDX_REF1]);
-
-
-  /* Read first frame and check it */
-  natoms=read_first_x(oenv,&status,fnTRX,&t,&x,box);
-  if ( !natoms )
-    gmx_fatal(FARGS,"Could not read coordinates from statusfile!\n");
-
-
-  /* check with topology */
-  if (fnTPS)
-    if ( natoms > top.atoms.nr )
-      gmx_fatal(FARGS,
-                "Trajectory (%d atoms) does not match topology (%d atoms)!\n",
-                natoms,top.atoms.nr);
-
-
-  /* check with index groups */
-  for (i=0; i<ng; i++)
-    for (j=0; j<isize[i]; j++)
-      if ( index[i][j] >= natoms )
-        gmx_fatal(FARGS,"Atom index (%d) in index group %s (%d atoms) larger "
-                    "than number of atoms in trajectory (%d atoms)!\n",
-                    index[i][j],grpname[i],isize[i],natoms);
-
-
-  /* check reference groups */
-  if ( mode == 1 )
-    {
-      if ( isize[G_REF1] != isize[G_REF2] || isize[G_REF1] != isize[G_REF3] || 
-           isize[G_REF2] != isize[G_REF3] )
-        gmx_fatal(FARGS,"For single particle SDF, all reference groups"
-                    "must have the same size.\n");
-
-
-      /* for single particle SDF dynamic triples are not needed */
-      /* so we build them right here */
-
-
-      /* copy all triples from G_REFx to NDX_REFx */    
-      for (i=0; i<isize[G_REF1]; i++)
-        {
-          /* check if all three atoms come from the same molecule */
-          for (j=G_REF1; j<=G_REF3; j++)
-            ref_resind[j] = top.atoms.atom[index[j][i]].resind;
-
-
-          if ( ref_resind[G_REF1] != ref_resind[G_REF2] ||
-                 ref_resind[G_REF2] != ref_resind[G_REF3] ||
-                 ref_resind[G_REF3] != ref_resind[G_REF1] )
-              {
-                fprintf(stderr,"\nWarning: reference triple (%d) will be skipped.\n",i);
-                fprintf(stderr,  "         resnr[1]: %d, resnr[2]: %d, resnr[3]: %d\n",
-                        ref_resind[G_REF1],ref_resind[G_REF2], ref_resind[G_REF3]);
-                isize[NDX_REF1]--;
-                for (j=NDX_REF1; j<=NDX_REF3; j++)
-                  srenew(index[j],isize[NDX_REF1]);
-                continue;
-              }
-          else
-            /* check if all entries are unique*/
-            if ( index[G_REF1][i] == index[G_REF2][i] ||
-                 index[G_REF2][i] == index[G_REF3][i] ||
-                 index[G_REF3][i] == index[G_REF1][i] )
-              {
-                fprintf(stderr,"Warning: reference triple (%d) will be skipped.\n",i);
-                fprintf(stderr,  "         index[1]: %d, index[2]: %d, index[3]: %d\n",
-                        index[G_REF1][i],index[G_REF2][i],index[G_REF3][i]);    
-                isize[NDX_REF1]--;
-                for (j=NDX_REF1; j<=NDX_REF3; j++)
-                  srenew(index[j],isize[NDX_REF1]);
-                continue;
-              }
-            else /* everythings fine, copy that one */
-              for (j=G_REF1; j<=G_REF3; j++)
-                index[j+4][i] = index[j][i];
-        }
-    }
-  else if ( mode == 2 )
-    {
-      if ( isize[G_REF1] != isize[G_REF2] )
-        gmx_fatal(FARGS,"For two particle SDF, reference groups 1 and 2"
-                    "must have the same size.\n");
-
-
-      for (i=0; i<isize[G_REF1]; i++)
-        {
-          /* check consistency for atoms 1 and 2 */
-          for (j=G_REF1; j<=G_REF2; j++)
-            ref_resind[j] = top.atoms.atom[index[j][i]].resind;
-
-
-          if ( ref_resind[G_REF1] != ref_resind[G_REF2] ||
-               index[G_REF1][i] == index[G_REF2][i] )
-            {
-              if ( ref_resind[G_REF1] != ref_resind[G_REF2] )
-                {
-                  fprintf(stderr,"\nWarning: bond (%d) not from one molecule."
-                          "Will not be used for SDF.\n",i);
-                  fprintf(stderr,  "         resnr[1]: %d, resnr[2]: %d\n",
-                          ref_resind[G_REF1],ref_resind[G_REF2]);
-                }
-              else
-                {
-                  fprintf(stderr,"\nWarning: atom1 and atom2 are identical."
-                          "Bond (%d) will not be used for SDF.\n",i);
-                  fprintf(stderr,  "         index[1]: %d, index[2]: %d\n",
-                          index[G_REF1][i],index[G_REF2][i]);
-                }
-              for (j=NDX_REF1; j<=NDX_REF2; j++)
-                {
-                  for (k=i; k<isize[G_REF1]-1; k++)
-                    index[j][k]=index[j][k+1];
-                  isize[j]--;
-                  srenew(index[j],isize[j]);
-                }
-            }
-        }
-    }
-
-
-  /* Read Atoms for refmol group */
-  if ( bRef )
-    {
-      snew(index[G_REFMOL],1);
-
-
-      for (i=G_REF1; i<=G_REF3; i++)
-        ref_resind[i] = top.atoms.atom[index[i][0]].resind;
-
-
-      for (i=0; i<natoms; i++)
-        {
-          if (  ref_resind[G_REF1] == top.atoms.atom[i].resind ||
-                ref_resind[G_REF2] == top.atoms.atom[i].resind ||
-                ref_resind[G_REF3] == top.atoms.atom[i].resind )
-            nrefmol++;
-        }
-      srenew(index[G_REFMOL],nrefmol);
-      isize[G_REFMOL] = nrefmol;
-      nrefmol = 0;
-
-
-      for (i=0; i<natoms; i++)
-        {
-          if (  ref_resind[G_REF1] == top.atoms.atom[i].resind ||
-                ref_resind[G_REF2] == top.atoms.atom[i].resind ||
-                ref_resind[G_REF3] == top.atoms.atom[i].resind )
-            {
-              index[G_REFMOL][nrefmol] = i;
-              nrefmol++;
-            }
-        }
-    }
-
-
-  /* initialize some stuff */
-  boxmin = min( norm(box[XX]), min( norm(box[YY]), norm(box[ZZ]) ) );
-  hbox   = boxmin / 2.0;
-
-
-  for (i=0; i<DIM; i++)
-    {
-      cutoff[i] = cutoff[i] / 2;
-      nbin[i]   = (int)(2 * cutoff[i] / binwidth) + 1;
-      invbinw = 1.0 / binwidth;
-      tri_upper[i] = triangle[i] + dtri[i];
-      tri_upper[i] = sqr(tri_upper[i]);
-      tri_lower[i] = triangle[i] - dtri[i];
-      tri_lower[i] = sqr(tri_lower[i]);
-    }
-
-
-  /* Allocate the array's for sdf */
-  snew(count,nbin[0]+1);
-  for(i=0; i<nbin[0]+1; i++) 
-    {
-      snew(count[i],nbin[1]+1);
-      for (j=0; j<nbin[1]+1; j++) 
-        snew(count[i][j],nbin[2]+1);
-    }
-
-
-  /* Allocate space for the coordinates */
-  snew(x_i1,isize[G_SDF]);
-  snew(x_refmol,isize[G_REFMOL]);
-  for (i=0; i<isize[G_REFMOL]; i++)
-    for (j=XX; j<=ZZ; j++)
-      x_refmol[i][j] = 0;
-
-
-  normfac = 0;
-
-  gpbc = gmx_rmpbc_init(&top.idef,ePBC,natoms,box);
-  
-  do {
-    /* Must init pbc every step because of pressure coupling */
-    set_pbc(&pbc,ePBC,box);
-    gmx_rmpbc(gpbc,natoms,box,x);
-  
-    /* Dynamically build the ref triples */
-    if ( mode == 2 )
-      {
-        isize[NDX_REF1]=0;
-        for (j=NDX_REF1; j<=NDX_REF3; j++)
-          srenew(index[j],isize[NDX_REF1]+1);
-
-
-        /* consistancy of G_REF[1,2] has already been check */
-        /* hence we can look for the third atom right away */
-
-
-        for (i=0; i<isize[G_REF1]; i++)
-          {
-            for (j=0; j<isize[G_REF3]; j++)
-              {
-                /* Avoid expensive stuff if possible */
-                if ( top.atoms.atom[index[G_REF1][i]].resind != 
-                     top.atoms.atom[index[G_REF3][j]].resind &&
-                     index[G_REF1][i] != index[G_REF3][j] &&
-                     index[G_REF2][i] != index[G_REF3][j] )
-                  {
-                    pbc_dx(&pbc,x[index[G_REF1][i]],x[index[G_REF3][j]],dx);
-                    delta = norm2(dx);
-                    if ( delta < tri_upper[G_REF1] &&
-                         delta > tri_lower[G_REF1] )
-                      {
-                        pbc_dx(&pbc,x[index[G_REF2][i]],x[index[G_REF3][j]],dx);
-                        delta = norm2(dx);
-                        if ( delta < tri_upper[G_REF2] &&
-                             delta > tri_lower[G_REF2] )
-                          {
-                            /* found triple */
-                            index[NDX_REF1][isize[NDX_REF1]]=index[G_REF1][i];
-                            index[NDX_REF2][isize[NDX_REF1]]=index[G_REF2][i];
-                            index[NDX_REF3][isize[NDX_REF1]]=index[G_REF3][j];
-
-
-                            /* resize groups */
-                            isize[NDX_REF1]++;
-                            for (k=NDX_REF1; k<=NDX_REF3; k++)
-                              srenew(index[k],isize[NDX_REF1]+1);
-                          }
-                      }
-                  }
-              }
-          }
-      }
-    else if ( mode ==3 )
-      {
-        isize[NDX_REF1]=0;
-        for (j=NDX_REF1; j<=NDX_REF3; j++)
-          srenew(index[j],isize[NDX_REF1]+1);
-
-        /* consistancy will be checked while searching */
-
-
-        for (i=0; i<isize[G_REF1]; i++)
-          {
-            for (j=0; j<isize[G_REF2]; j++)
-              {
-                /* Avoid expensive stuff if possible */
-                if ( top.atoms.atom[index[G_REF1][i]].resind != 
-                     top.atoms.atom[index[G_REF2][j]].resind &&
-                     index[G_REF1][i] != index[G_REF2][j] )
-                  {
-                    pbc_dx(&pbc,x[index[G_REF1][i]],x[index[G_REF2][j]],dx);
-                    delta = norm2(dx);
-                    if ( delta < tri_upper[G_REF3] &&
-                         delta > tri_lower[G_REF3] )
-                      {
-                        for (k=0; k<isize[G_REF3]; k++)
-                          {
-                            if ( top.atoms.atom[index[G_REF1][i]].resind != 
-                                 top.atoms.atom[index[G_REF3][k]].resind &&
-                                 top.atoms.atom[index[G_REF2][j]].resind != 
-                                 top.atoms.atom[index[G_REF3][k]].resind &&
-                                 index[G_REF1][i] != index[G_REF3][k] &&
-                                 index[G_REF2][j] != index[G_REF3][k])
-                              {
-                                pbc_dx(&pbc,x[index[G_REF1][i]],x[index[G_REF3][k]],dx);
-                                delta = norm2(dx);
-                                if ( delta < tri_upper[G_REF1] &&
-                                     delta > tri_lower[G_REF1] )
-                                  {
-                                    pbc_dx(&pbc,x[index[G_REF2][j]],x[index[G_REF3][k]],dx);
-                                    delta = norm2(dx);
-                                    if ( delta < tri_upper[G_REF2] &&
-                                         delta > tri_lower[G_REF2] )
-                                      {
-                                        /* found triple */
-                                        index[NDX_REF1][isize[NDX_REF1]]=index[G_REF1][i];
-                                        index[NDX_REF2][isize[NDX_REF1]]=index[G_REF2][j];
-                                        index[NDX_REF3][isize[NDX_REF1]]=index[G_REF3][k];
-                                    
-                                        /* resize groups */
-                                        isize[NDX_REF1]++;
-                                        for (l=NDX_REF1; l<=NDX_REF3; l++)
-                                          srenew(index[l],isize[NDX_REF1]+1);
-                                      }
-                                  }
-                              }
-                          }
-                      }
-                  }
-              }
-          }
-      }
-    for (i=0; i<isize[NDX_REF1]; i++)
-      {
-        /* setup the molecular coordinate system (i',j',k') */
-        /* because the coodinate system of the box forms a unit matrix */
-        /* (i',j',k') is identical with the rotation matrix */
-        clear_mat(rot);
-
-
-        /* k' = unitv(r(atom0) - r(atom1)) */
-        pbc_dx(&pbc,x[index[NDX_REF1][i]],x[index[NDX_REF2][i]],k_mol);
-        unitv(k_mol,rot[2]);
-        
-        /* i' = unitv(k' x (r(atom2) - r(atom1))) */
-        pbc_dx(&pbc,x[index[NDX_REF3][i]],x[index[NDX_REF2][i]],i1_mol);
-        cprod(i1_mol,rot[2],i2_mol);
-        unitv(i2_mol,rot[0]);
-      
-        /* j' = k' x i' */
-        cprod(rot[2],rot[0],rot[1]);
-
-
-        /* set the point of reference */
-        if ( mode == 2 )
-          copy_rvec(x[index[NDX_REF3][i]],xi);
-        else
-          copy_rvec(x[index[NDX_REF1][i]],xi);
-
-
-        /* make the reference */
-        if ( bRef )
-          {
-            for (j=0; j<isize[G_REFMOL]; j++)
-              {
-                pbc_dx(&pbc,xi,x[index[G_REFMOL][j]],dx);
-                mvmul(rot,dx,dx_mol);
-                rvec_inc(x_refmol[j],dx_mol);
-                for(k=XX; k<=ZZ; k++)
-                   x_refmol[j][k] = x_refmol[j][k] / 2;
-              }
-          }
-
-
-        /* Copy the indexed coordinates to a continuous array */
-        for(j=0; j<isize[G_SDF]; j++)
-          copy_rvec(x[index[G_SDF][j]],x_i1[j]);
-        
-        /* count the SDF */
-        for(j=0; j<isize[G_SDF]; j++) 
-          {
-            /* Exclude peaks from the reference set */
-            bInGroup=FALSE;
-            for (k=NDX_REF1; k<=NDX_REF3; k++)
-              if ( index[G_SDF][j] == index[k][i] )
-                bInGroup=TRUE;
-
-
-            if ( !bInGroup )
-              {
-                pbc_dx(&pbc,xi,x_i1[j],dx);
-            
-                /* transfer dx to the molecular coordinate system */
-                mvmul(rot,dx,dx_mol);
-
-
-                /* check cutoff's and count */
-                if ( dx_mol[XX] > -cutoff[XX] && dx_mol[XX] < cutoff[XX] )
-                  if ( dx_mol[YY] > -cutoff[YY] && dx_mol[YY] < cutoff[YY] )
-                    if ( dx_mol[ZZ] > -cutoff[ZZ] && dx_mol[ZZ] < cutoff[ZZ] )
-                      {
-                        X = (int)(floor(dx_mol[XX]*invbinw)) + (nbin[XX]-1)/2 
-+1;
-                        Y = (int)(floor(dx_mol[YY]*invbinw)) + (nbin[YY]-1)/2 
-+1;
-                        Z = (int)(floor(dx_mol[ZZ]*invbinw)) + (nbin[ZZ]-1)/2 
-+1;
-                        count[X][Y][Z]++;
-                        normfac++;
-                      }
-              }
-          }
-      }
-  } while (read_next_x(oenv,status,&t,natoms,x,box));
-  fprintf(stderr,"\n");
-  
-  gmx_rmpbc_done(gpbc);
-
-
-  close_trx(status);
-  
-  sfree(x);
-
-
-  /* write the reference strcture*/
-  if ( bRef )
-    {
-      fp=gmx_ffopen(fnREF,"w"); 
-      fprintf(fp,"%s\n",title);
-      fprintf(fp,"  %d\n",isize[G_REFMOL]);
-
-
-      for (i=0; i<isize[G_REFMOL]; i++)
-        fprintf(fp,"%5d%5s%5s%5d%8.3f%8.3f%8.3f\n",
-                top.atoms.resinfo[top.atoms.atom[index[G_REFMOL][i]].resind].nr,
-                *(top.atoms.resinfo[top.atoms.atom[index[G_REFMOL][i]].resind].name),
-                *(top.atoms.atomname[index[G_REFMOL][i]]),i+1,
-                -1*x_refmol[i][XX],-1*x_refmol[i][YY],-1*x_refmol[i][ZZ]);
-      /* Inserted -1* on the line above three times */
-      fprintf(fp,"   10.00000   10.00000   10.00000\n");
-      gmx_ffclose(fp);
-      fprintf(stderr,"\nWrote reference structure. (%d Atoms)\n",isize[G_REFMOL]);
-    }
-
-
-  /* Calculate the mean probability density */
-  fprintf(stderr,"\nNumber of configurations used for SDF: %d\n",(int)normfac);
-
-
-  normfac = nbin[0]*nbin[1]*nbin[2] / normfac;
-
-
-  fprintf(stderr,"\nMean probability density: %f\n",1/normfac);
-
-
-  /* normalize the SDF and write output */
-  /* see http://www.csc.fi/gopenmol/index.phtml for documentation */
-  fp=gmx_ffopen(fnSDF,"wb"); 
-
-
-  /* rank */
-  i_write(fp,3);
-
-
-  /* Type of surface */
-  i_write(fp,42);
-
-
-  /* Zdim, Ydim, Xdim */
-  for (i=ZZ; i>=XX; i--)
-    i_write(fp,nbin[i]);
-
-
-  /* [Z,Y,X][min,max] (box corners in Angstroem)*/
-  for (i=ZZ; i>=XX; i--)
-    {
-      f_write(fp,-cutoff[i]*10);
-      f_write(fp,cutoff[i]*10);
-    }
-
-
-/* Original Code
-  for (i=1; i<nbin[2]+1; i++)
-    for (j=1; j<nbin[1]+1; j++)
-      for (k=1; k<nbin[0]+1; k++) 
-        {
-          sdf = normfac * count[k][j][i];
-          if ( sdf < min_sdf ) min_sdf = sdf;
-          if ( sdf > max_sdf ) max_sdf = sdf;
-          f_write(fp,sdf);
-        }*/
-/* Changed Code to Mirror SDF to correct coordinates */
-  for (i=nbin[2]; i>0; i--)
-    for (j=nbin[1]; j>0; j--)
-      for (k=nbin[0]; k>0; k--)
-        {
-          sdf = normfac * count[k][j][i];
-          if ( sdf < min_sdf ) min_sdf = sdf;
-          if ( sdf > max_sdf ) max_sdf = sdf;
-          f_write(fp,sdf);
-        }
-
-  fprintf(stderr,"\nMin: %f Max: %f\n",min_sdf,max_sdf);
-
-
-  gmx_ffclose(fp); 
-
-
-  /* Give back the mem */
-  for(i=0; i<nbin[0]+1; i++)
-    {
-      for (j=0; j<nbin[1]+1; j++)
-        {
-          sfree(count[i][j]);
-        }
-      sfree(count[i]);
-    }
-  sfree(count);
-}
-
-int gmx_sdf(int argc,char *argv[])
-{
-  const char *desc[] = {
-    "[TT]g_sdf[tt] calculates the spatial distribution function (SDF) of a set of atoms",
-    "within a coordinate system defined by three atoms. There is single body, ",
-    "two body and three body SDF implemented (select with option [TT]-mode[tt]). ",
-    "In the single body case the local coordinate system is defined by using",
-    "a triple of atoms from one single molecule, for the two and three body case",
-    "the configurations are dynamically searched complexes of two or three",
-    "molecules (or residues) meeting certain distance consitions (see below).[PAR]",
-    "The program needs a trajectory, a GROMACS run input file and an index ",
-    "file to work. ",
-    "You have to setup 4 groups in the index file before using g_sdf: [PAR]",
-    "The first three groups are used to define the SDF coordinate system.",
-    "The program will dynamically generate the atom triples according to ",
-    "the selected [TT]-mode[tt]: ", 
-    "In [TT]-mode[tt] 1 the triples will be just the 1st, 2nd, 3rd, ... atoms from ",
-    "groups 1, 2 and 3. Hence the nth entries in groups 1, 2 and 3 must be from the",
-    "same residue. In [TT]-mode[tt] 2 the triples will be 1st, 2nd, 3rd, ... atoms from",
-    "groups 1 and 2 (with the nth entries in groups 1 and 2 having the same res-id).",
-    "For each pair from groups 1 and 2  group 3 is searched for an atom meeting the",
-    "distance conditions set with [TT]-triangle[tt] and [TT]-dtri[tt] relative to atoms 1 and 2. In",
-    "[TT]-mode[tt] 3 for each atom in group 1 group 2 is searched for an atom meeting the",
-    "distance condition and if a pair is found group 3 is searched for an atom",
-    "meeting the further conditions. The triple will only be used if all three atoms",
-    "have different res-id's.[PAR]",
-    "The local coordinate system is always defined using the following scheme:",
-    "Atom 1 will be used as the point of origin for the SDF. ",
-    "Atom 1 and 2 will define the principle axis (Z) of the coordinate system.",
-    "The other two axis will be defined inplane (Y) and normal (X) to the plane through",
-    "Atoms 1, 2 and 3. ",
-    "The fourth group",
-    "contains the atoms for which the SDF will be evaluated.[PAR]",
-    "For [TT]-mode[tt] 2 and 3 you have to define the distance conditions for the ",
-    "2 resp. 3 molecule complexes to be searched for using [TT]-triangle[tt] and [TT]-dtri[tt].[PAR]",
-    "The SDF will be sampled in cartesian coordinates.",
-    "Use [TT]-grid x y z[tt] to define the size of the SDF grid around the ",
-    "reference molecule. ",
-    "The Volume of the SDF grid will be V=x*y*z (nm^3). ",
-    "Use [TT]-bin[tt] to set the binwidth for grid.[PAR]",
-    "The output will be a binary 3D-grid file ([TT]gom_plt.dat[tt]) in the [REF].plt[ref] format that can be be",
-    "read directly by gOpenMol. ",
-    "The option [TT]-r[tt] will generate a [REF].gro[ref] file with the reference molecule(s) transferred to",
-    "the SDF coordinate system. Load this file into gOpenMol and display the",
-    "SDF as a contour plot (see http://www.csc.fi/gopenmol/index.phtml for ",
-    "further documentation). [PAR]",
-    "For further information about SDF's have a look at: A. Vishnyakov, JPC A, 105,",
-    "2001, 1702 and the references cited within."
-  };
-  output_env_t oenv;
-  static gmx_bool bRef=FALSE;
-  static int mode=1;
-  static rvec triangle={0.0,0.0,0.0};
-  static rvec dtri={0.03,0.03,0.03};
-  static rvec cutoff={1,1,1};
-  static real binwidth=0.05;
-  t_pargs pa[] = {
-    { "-mode",     FALSE, etINT, {&mode},
-      "SDF in [1,2,3] particle mode"},
-    { "-triangle", FALSE, etRVEC, {&triangle},
-      "r(1,3), r(2,3), r(1,2)"},
-    { "-dtri",     FALSE, etRVEC, {&dtri},
-      "dr(1,3), dr(2,3), dr(1,2)"},
-    { "-bin",      FALSE, etREAL, {&binwidth},
-      "Binwidth for the 3D-grid (nm)" },
-    { "-grid",      FALSE, etRVEC, {&cutoff},
-      "Size of the 3D-grid (nm,nm,nm)"}
-  };
-#define NPA asize(pa)
-  const char       *fnTPS,*fnNDX,*fnREF;
-  
-  t_filenm   fnm[] = {
-    { efTRX, "-f",  NULL,     ffREAD },
-    { efNDX, NULL,  NULL,     ffREAD },
-    { efTPS, NULL,  NULL,     ffOPTRD },
-    { efDAT, "-o",  "gom_plt",     ffWRITE },
-    { efSTO, "-r",  "refmol",  ffOPTWR },
-  };
-#define NFILE asize(fnm)
-  
-  CopyRight(stderr,argv[0]);
-  parse_common_args(&argc,argv,PCA_CAN_TIME,
-                    NFILE,fnm,NPA,pa,asize(desc),desc,0,NULL,&oenv);
-
-
-  fnTPS = ftp2fn_null(efTPS,NFILE,fnm);
-  fnNDX = ftp2fn_null(efNDX,NFILE,fnm);
-  fnREF = opt2fn_null("-r",NFILE,fnm);
-  bRef  = opt2bSet("-r",NFILE,fnm);
-
-
-  
-  if (!fnNDX)
-    gmx_fatal(FARGS,"No index file specified\n"
-                "             Nothing to do!");
-
-
-  if (!fnTPS)
-    gmx_fatal(FARGS,"No topology file specified\n"
-                "             Nothing to do!");
-
-
-  if ( bRef && (fn2ftp(fnREF) != efGRO))
-    {
-      fprintf(stderr,"\nOnly GROMACS format is supported for reference structures.\n");
-      fprintf(stderr,"Option -r will be ignored!\n");
-      bRef = FALSE;
-    }
-
-
-  if ((mode < 1) || (mode > 3))
-    gmx_fatal(FARGS,"Wrong -mode selection. Chose 1-, 2- oder 3-particle mode.\n");
-
-
-  do_sdf(fnNDX,fnTPS,ftp2fn(efTRX,NFILE,fnm),opt2fn("-o",NFILE,fnm),
-         fnREF,bRef,cutoff,binwidth,mode,triangle,dtri,oenv);
-
-
-  gmx_thanx(stderr);
-  
-  return 0;
-}
-
-int
-main(int argc, char *argv[])
-{
-  gmx_sdf(argc,argv);
-  return 0;
-}
diff --git a/src/contrib/hexamer.c b/src/contrib/hexamer.c
deleted file mode 100644 (file)
index bd477eb..0000000
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- * 
- *                This source code is part of
- * 
- *                 G   R   O   M   A   C   S
- * 
- *          GROningen MAchine for Chemical Simulations
- * 
- *                        VERSION 3.3.99_development_20071104
- * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
- * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2006, The GROMACS development team,
- * check out http://www.gromacs.org for more information.
-
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- * 
- * If you want to redistribute modifications, please consider that
- * scientific software is very special. Version control is crucial -
- * bugs must be traceable. We will be happy to consider code for
- * inclusion in the official distribution, but derived work must not
- * be called official GROMACS. Details are found in the README & COPYING
- * files - if they are missing, get the official version at www.gromacs.org.
- * 
- * To help us fund GROMACS development, we humbly ask that you cite
- * the papers on the package - you can find them in the top README file.
- * 
- * For more info, check our website at http://www.gromacs.org
- * 
- * And Hey:
- * Groningen Machine for Chemical Simulation
- */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <math.h>
-#include <string.h>
-
-#include "gromacs/fileio/pdbio.h"
-#include "gromacs/fileio/confio.h"
-#include "gromacs/utility/smalloc.h"
-#include "gromacs/topology/symtab.h"
-#include "macros.h"
-#include "copyrite.h"
-#include "gromacs/commandline/pargs.h"
-#include "gromacs/math/vec.h"
-#include "typedefs.h"
-#include "gbutil.h"
-#include "gromacs/math/units.h"
-
-void copy_atom(t_symtab *tab,t_atoms *a1,int i1,t_atoms *a2,int i2,
-              rvec xin[],rvec xout[],rvec vin[],rvec vout[])
-{
-  a2->atom[i2]     = a1->atom[i1];
-  a2->atomname[i2] = put_symtab(tab,*a1->atomname[i1]);
-  a2->resname[a2->atom[i2].resnr] =
-    put_symtab(tab,*a1->resname[a1->atom[i1].resnr]);
-  copy_rvec(xin[i1],xout[i2]);
-  copy_rvec(vin[i1],vout[i2]);
-}
-
-static void rotate_x(int natom,rvec xin[],real angle,rvec xout[],
-                    gmx_bool bZ,gmx_bool bUpsideDown,real dz)
-{
-  int i;
-  matrix mat;
-  
-  angle *= DEG2RAD;
-  clear_mat(mat);
-  if (bZ) {
-    mat[XX][XX] = cos(angle);
-    mat[XX][YY] = sin(angle);
-    mat[YY][XX] = -sin(angle);
-    mat[YY][YY] = cos(angle);
-    mat[ZZ][ZZ] = 1;
-  }
-  else {
-    mat[XX][XX] = 1;
-    mat[YY][YY] = cos(angle);
-    mat[YY][ZZ] = sin(angle);
-    mat[ZZ][YY] = -sin(angle);
-    mat[ZZ][ZZ] = cos(angle);
-  }
-    
-  for(i=0; (i<natom); i++) {
-    mvmul(mat,xin[i],xout[i]);
-    if (bUpsideDown)
-      xout[i][ZZ] *= -1;
-    xout[i][ZZ] += dz;
-  }
-}
-
-static void prep_x(int natom,rvec x[],real rDist,real rAngleZ,real rAngleX)
-{
-  int  i;
-  rvec xcm;
-  rvec *xx;
-  
-  /* Center on Z-axis */
-  clear_rvec(xcm);
-  for(i=0; (i<natom); i++) {
-    xcm[XX] += x[i][XX];
-    xcm[YY] += x[i][YY];
-    xcm[ZZ] += x[i][ZZ];
-  }
-  xcm[XX] /= natom;
-  xcm[YY] /= natom;
-  xcm[ZZ] /= natom;
-  for(i=0; (i<natom); i++) {
-    x[i][XX] -= xcm[XX];
-    x[i][YY] -= xcm[YY];
-    x[i][ZZ] -= xcm[ZZ];
-  }
-  if (rAngleZ != 0) {
-    snew(xx,natom);
-    rotate_x(natom,x,rAngleZ,xx,TRUE,FALSE,0);
-    for(i=0; (i<natom); i++) 
-      copy_rvec(xx[i],x[i]);
-    sfree(xx);
-  }
-  if (rAngleX != 0) {
-    snew(xx,natom);
-    rotate_x(natom,x,rAngleX,xx,FALSE,FALSE,0);
-    for(i=0; (i<natom); i++) 
-      copy_rvec(xx[i],x[i]);
-    sfree(xx);
-  }
-  if (rDist > 0) {
-    for(i=0; (i<natom); i++) 
-      x[i][XX] += rDist;
-  }
-}
-
-int main(int argc, char *argv[])
-{
-  t_symtab tab;
-  static char *desc[] = {
-    "[TT]hexamer[tt] takes a single input coordinate file and makes five symmetry",
-    "related copies."
-  };
-#define NPA asize(pa)
-  t_filenm fnm[] = {
-    { efSTX, "-f", NULL, ffREAD },
-    { efPDB, "-o", NULL, ffWRITE }
-  };
-#define NFILE asize(fnm)
-  gmx_bool bCenter    = FALSE;
-  gmx_bool bTrimer    = FALSE;
-  gmx_bool bAlternate = FALSE;
-  real rDist = 0,rAngleZ = 0,rAngleX = 0, alterz = 0;
-  t_pargs pa[] = {
-    { "-center",   FALSE, etBOOL,  {&bCenter}, 
-      "Center molecule on Z-axis first" },
-    { "-trimer",   FALSE, etBOOL,  {&bTrimer},
-      "Make trimer rather than hexamer" },
-    { "-alternate",FALSE, etBOOL,  {&bAlternate},
-      "Turn every other molecule upside down" },
-    { "-alterz",   FALSE, etREAL,  {&alterz},
-      "Add this amount to Z-coordinate in every other molecule" },
-    { "-radius",   FALSE, etREAL,  {&rDist},
-      "Distance of protein axis from Z-axis (implies [TT]-center[tt])" },
-    { "-anglez",   FALSE, etREAL,  {&rAngleZ},
-      "Initial angle of rotation around Z-axis of protein" },
-    { "-anglex",   FALSE, etREAL,  {&rAngleX},
-      "Initial angle of rotation around X-axis of protein" }
-  };
-#define NPA asize(pa)
-  FILE    *fp;
-  int     i,iout,now,natom;
-  rvec    *xin,*vin,*xout;
-  matrix  box;
-  t_atoms atoms,aout;
-  char    *infile,*outfile,title[256],buf[32];
-  
-  CopyRight(stderr,argv[0]);
-  parse_common_args(&argc,argv,0,NFILE,fnm,NPA,pa,
-                   asize(desc),desc,0,NULL);
-  bCenter = bCenter || (rDist > 0) || bAlternate;
-  
-  infile  = ftp2fn(efSTX,NFILE,fnm);
-  outfile = ftp2fn(efPDB,NFILE,fnm);
-  
-  get_stx_coordnum(infile,&natom);
-  init_t_atoms(&atoms,natom,TRUE);
-  snew(xin,natom);
-  snew(xout,natom);
-  snew(vin,natom);
-  read_stx_conf(infile,title,&atoms,xin,vin,box);
-  printf("Read %d atoms\n",atoms.nr); 
-  
-  if (bCenter) 
-    prep_x(atoms.nr,xin,rDist,rAngleZ,rAngleX);
-  
-  fp = gmx_ffopen(outfile,"w");
-  for(i=0; (i<(bTrimer ? 3 : 6)); i++) {
-    rotate_x(atoms.nr,xin,i*(bTrimer ? 120.0 : 60.0),xout,TRUE,
-            bAlternate && ((i % 2) != 0),alterz*(((i % 2) == 0) ? 0 : 1));
-    sprintf(buf,"Rotated %d degrees",i*(bTrimer ? 120 : 60));
-    write_pdbfile(fp,buf,&atoms,xout,box,'A'+i,1+i);
-  }
-  gmx_ffclose(fp);
-  
-  gmx_thanx(stderr);
-  
-  return 0;
-}
diff --git a/src/contrib/hrefify.c b/src/contrib/hrefify.c
deleted file mode 100644 (file)
index a21f14a..0000000
+++ /dev/null
@@ -1,225 +0,0 @@
-/*
- * 
- *                This source code is part of
- * 
- *                 G   R   O   M   A   C   S
- * 
- *          GROningen MAchine for Chemical Simulations
- * 
- *                        VERSION 3.3.99_development_20071104
- * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
- * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2006, The GROMACS development team,
- * check out http://www.gromacs.org for more information.
-
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- * 
- * If you want to redistribute modifications, please consider that
- * scientific software is very special. Version control is crucial -
- * bugs must be traceable. We will be happy to consider code for
- * inclusion in the official distribution, but derived work must not
- * be called official GROMACS. Details are found in the README & COPYING
- * files - if they are missing, get the official version at www.gromacs.org.
- * 
- * To help us fund GROMACS development, we humbly ask that you cite
- * the papers on the package - you can find them in the top README file.
- * 
- * For more info, check our website at http://www.gromacs.org
- * 
- * And Hey:
- * Groningen Machine for Chemical Simulation
- */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <math.h>
-#include <string.h> 
-#include <ctype.h>
-#include "gromacs/utility/smalloc.h"
-#include "typedefs.h"
-#include "macros.h"
-#include "gromacs/utility/cstringutil.h"
-#include "gromacs/fileio/confio.h"
-#include "gromacs/math/vec.h"
-#include "gromacs/commandline/pargs.h"
-#include "copyrite.h"
-#include "gromacs/fileio/pdbio.h"
-#include "gromacs/utility/strdb.h"
-
-gmx_bool isword(char c)
-{
-  return (isalnum(c) || (c=='-') || (c=='_'));
-}
-
-char *strncasestr(char *line,char *str)
-{
-  char *dum;
-
-  dum=line;
-  if (dum) {
-    while (strlen(dum) && strncasecmp(dum,str,strlen(str)))
-      dum++;
-    if (strlen(dum)==0)
-      dum=NULL;
-  }
-
-  return dum;
-}
-
-char *strstr_href(char *line,gmx_bool *bInHREF,int *i_dat,int n_dat,char **dat)
-{
-  char *start,*found,*href=NULL;
-  gmx_bool bIn;
-  int i;
-
-  found=NULL;
-  *i_dat=-1;
-  bIn=*bInHREF;
-  start=line;
-  do {
-    if (bIn) {
-      while (strlen(start) && (strncasecmp(start,"</a",3) != 0))
-       start++;
-      if (strlen(start)>0) {
-       start+=3;
-       bIn=FALSE;
-      }
-    }
-    else {
-      href=strncasestr(start,"<a href");
-      if (href)
-       bIn=TRUE;
-      i=0;
-      while((i<n_dat) && !found) {
-       found=strncasestr(start,dat[i]);
-       if (found) {
-         if (href && (found>href))
-           found=NULL;
-         else {
-           if (((found!=start) && isword(found[-1])) || 
-               isword(found[strlen(dat[i])])) 
-             found=NULL;
-           else
-             *i_dat=i;
-         }
-         i++;
-       }
-      }
-    }
-  } while (strlen(start) && !found && href);
-  *bInHREF=bIn;
-
-  return found;
-}
-
-int main(int argc, char *argv[])
-{
-  static char *desc[] = {
-    "[TT]hrefify[tt] adds href's for all the words in the input file which are not",
-    "already hyperlinked and which appear in the file specified with the",
-    "option [TT]-l[tt].[PAR]",
-    "If the href's should call a script, text can be added",
-    "with the [TT]-t[tt] option."
-  };
-
-  int n;
-  
-  char **text,**str,line[1024],*ptr,*ref,
-    start[STRLEN],word[STRLEN],end[STRLEN];
-  int n_text,n_str,i_str;
-  gmx_bool bInHREF,bIn;
-  
-  FILE    *fp;
-  char    title[STRLEN];
-  int     i,l,n_repl;
-  t_filenm fnm[] = {
-    { efDAT, "-l", "links", ffLIBRD },
-  };
-#define NFILE asize(fnm)
-  static char *in=NULL,*out=NULL,*excl=NULL,*link_text=NULL;
-  static gmx_bool peratom=FALSE;
-  t_pargs pa[] = {
-    { "-f", FALSE, etSTR, { &in } , "HTML input" },
-    { "-o", FALSE, etSTR, { &out } , "HTML output" },
-    { "-e", FALSE, etSTR, { &excl } , "Exclude a string from HREF's, "
-      "when this option is not set, the filename without path and extension "
-      "will be excluded from HREF's"},
-    { "-t", FALSE, etSTR, { &link_text } , "Insert a string in front of the "
-      "href file name, useful for scripts" }
-  };
-  
-  CopyRight(stderr,argv[0]);
-  parse_common_args(&argc,argv,0,NFILE,fnm,asize(pa),pa,
-                   asize(desc),desc,0,NULL);
-
-  if (!in || !out)
-    gmx_fatal(FARGS,"Input or output filename is not set");
-
-  n_text = get_file(in, &text);
-  fprintf(stderr,"Read %d lines from %s\n",n_text,in);
-
-  n_str=get_file(ftp2fn(efDAT,NFILE,fnm),&str);  
-  fprintf(stderr,"Read %d strings %s\n",n_str,ftp2fn(efDAT,NFILE,fnm));
-  if (!excl) {
-    for (i=strlen(in)-1; i>0 && in[i-1]!='/'; i--);
-    excl=strdup(in+i);
-    for(i=strlen(excl)-1; i>0 && (excl[i]!='.'); i--);
-    if (excl[i]=='.')
-      excl[i]='\0';
-  }
-  fprintf(stderr,"Excluding '%s' from references\n",excl);
-  for(l=0; l<n_str && strcasecmp(str[l],excl); l++);
-  if (l<n_str) {
-    for(i=l+1; i<n_str; i++)
-      str[i-1]=str[i];
-    n_str--;
-  }
-
-  if (!link_text)
-    link_text=strdup("\0");
-  else
-    fprintf(stderr,"Adding '%s' to href's\n",link_text);
-
-  fp=gmx_ffopen(out,"w");
-
-  n_repl=0;
-  i_str=-1;
-  bInHREF=FALSE;
-  for(l=0; l<n_text; l++) {
-    strcpy(line,text[l]);
-    do {
-      bIn=bInHREF;
-      ptr=strstr_href(line,&bIn,&i_str,n_str,str);
-      if (ptr) {
-       ref=ptr;
-       if ((ref!=line) && (ref[-1]=='.')) {
-         ref--;
-         while((ref>line) && isword(ref[-1]))
-           ref--;
-       }
-       strcpy(start,line);
-       start[ref-line]='\0';
-       strcpy(word,ref);
-        word[ptr-ref+strlen(str[i_str])]='\0';
-       strcpy(end,ptr+strlen(str[i_str]));
-       sprintf(line,"%s<a href=\"%s%s.html\">%s</a>%s",
-               start,link_text,str[i_str],word,end);
-       fprintf(stderr,"line %d: %s\n",l+1,str[i_str]);
-       n_repl++;
-      }
-    } while (ptr);
-    bInHREF=bIn;
-    fprintf(fp,"%s\n",line);
-  }
-
-  gmx_ffclose(fp);
-  
-  fprintf(stderr,"Added %d HTML references\n",n_repl);
-
-  return 0;
-}
-
diff --git a/src/contrib/intest.f b/src/contrib/intest.f
deleted file mode 100644 (file)
index 4c637b1..0000000
+++ /dev/null
@@ -1,181 +0,0 @@
-C
-C                This source code is part of
-C 
-C                 G   R   O   M   A   C   S
-C 
-C          GROningen MAchine for Chemical Simulations
-C 
-C                        VERSION 3.0
-C 
-C Copyright (c) 1991-2001
-C BIOSON Research Institute, Dept. of Biophysical Chemistry
-C University of Groningen, The Netherlands
-C 
-C This program is free software; you can redistribute it and/or
-C modify it under the terms of the GNU General Public License
-C as published by the Free Software Foundation; either version 2
-C of the License, or (at your option) any later version.
-C 
-C If you want to redistribute modifications, please consider that
-C scientific software is very special. Version control is crucial -
-C bugs must be traceable. We will be happy to consider code for
-C inclusion in the official distribution, but derived work must not
-C be called official GROMACS. Details are found in the README & COPYING
-C files - if they are missing, get the official version at www.gromacs.org.
-C 
-C To help us fund GROMACS development, we humbly ask that you cite
-C the papers on the package - you can find them in the top README file.
-C 
-C Do check out http://www.gromacs.org , or mail us at gromacs@gromacs.org .
-C 
-C And Hey:
-C GROup of MAchos and Cynical Suckers
-
-C
-C     This code is meant to be called from C routines.
-C     Therefore all indices start at 0, although the arrays
-C     start at 1, if an array contains an index we must add 1 to it.
-C     EG: jjnr points to particles starting at 0
-C         type is indexed from 1 to ...
-C
-
-      subroutine FORLJC(ix,iy,iz,qi,
-     $     pos,nj,type,jjnr,charge,nbfp,
-     $     faction,fip,
-     $     Vc,Vnb)
-      
-      implicit none
-      
-      real      ix,iy,iz,qi
-      real      pos(*),charge(*),faction(*),fip(3)
-      integer*4 nj,jjnr(*),type(*)
-      real      Vc,Vnb,nbfp(*)
-      
-      integer   k,jnr,j3,tj
-      real      twelve,six
-      real      fX,fY,fZ
-      real      rijX,rijY,rijZ
-      real      fijscal,vijcoul
-      real      vctot,vnbtot
-      real      rinv1,rinv2,rinv6
-      real      fjx,fjy,fjz
-      real      tx,ty,tz,vnb6,vnb12
-
-      parameter(twelve=12.0,six=6.0)
-            
-      fX     = 0
-      fY     = 0
-      fZ     = 0
-      vctot  = 0
-      vnbtot = 0
-      
-cray compiler directive ignore vector dependencies      
-c$dir ivdep
-      do k=1,nj
-         jnr   = jjnr(k)+1
-         j3    = 3*jnr-2
-         rijX  = ix - pos(j3)
-         rijY  = iy - pos(j3+1)
-         rijZ  = iz - pos(j3+2)
-
-         rinv1       = 1.0/sqrt((rijX*rijX)+(rijY*rijY)+(rijZ*rijZ))
-         rinv2       = rinv1*rinv1
-         rinv6       = rinv2*rinv2*rinv2
-         
-         tj          = 2*type(jnr)+1
-         vnb6        = nbfp(tj)*rinv6
-         vnb12       = nbfp(tj+1)*rinv6*rinv6
-         vijcoul     = qi*charge(jnr)*rinv1
-         
-         vctot       = vctot+vijcoul
-         vnbtot      = vnbtot+vnb12-vnb6
-         fijscal     = (twelve*vnb12-six*vnb6+vijcoul)*rinv2
-         
-         fjx           = faction(j3)
-         tx            = rijX*fijscal
-         fX            = fX + tx
-         faction(j3)   = fjx - tx
-         fjy           = faction(j3+1)
-         ty            = rijY*fijscal
-         fY            = fY + ty
-         faction(j3+1) = fjy - ty
-         fjz           = faction(j3+2)
-         tz            = rijZ*fijscal
-         fZ            = fZ + tz
-         faction(j3+2) = fjz - tz
-         
-      end do
-      fip(1) = fX
-      fip(2) = fY
-      fip(3) = fZ
-      Vc     = Vc  + vctot
-      Vnb    = Vnb + vnbtot
-
-      return
-      
-      end
-      
-      program main
-      
-      implicit none
-      
-      integer maxatom,maxx,maxlist,maxtype
-      parameter(maxatom=1000,maxx=3*maxatom,maxlist=100)
-      parameter(maxtype=19)
-      
-      real*4 ix,iy,iz,qi,pos(maxx),faction(maxx),fip(3)
-      real*4 charge(maxatom),nbfp(2*maxtype),Vc,Vnb
-      integer type(maxatom),jjnr(maxlist)
-      integer i,i3,j
-      
-c     setup benchmark
-      do i=1,maxtype
-         nbfp(2*i-1) = 1e-3
-         nbfp(2*i)   = 1e-6
-      end do
-      
-      type(1)=1
-      do i=2,maxatom
-         type(i)=1+mod(type(i-1)+91,maxtype)
-      end do
-      
-      do i=1,maxatom
-         i3=3*(i-1)
-         pos(i3+1) = i
-         pos(i3+2) = i
-         pos(i3+3) = 1
-         
-         charge(i) = mod(i,2)-0.5
-      end do
-
-      jjnr(1) = 13
-      do i=2,maxlist
-         jjnr(i) = mod(jjnr(i-1)+13,maxatom)
-      end do      
-         
-      ix = 0.0
-      iy = 0.0
-      iz = 0.0
-      qi = 1.0
-      Vc = 0.0
-      Vnb= 0.0
-      
-c     run it
-
-
-      do j=1,100
-         do i=1,maxatom
-            
-            call FORLJC(ix,iy,iz,qi,
-     $           pos,maxlist,type,jjnr,charge,nbfp,
-     $           faction,fip,
-     $           Vc,Vnb)
-            
-         end do
-      end do
-      
-      print *,Vc, Vnb
-      
-      stop
-      end
diff --git a/src/contrib/mkice.c b/src/contrib/mkice.c
deleted file mode 100644 (file)
index 51e64e7..0000000
+++ /dev/null
@@ -1,659 +0,0 @@
-/*
- * 
- *                This source code is part of
- * 
- *                 G   R   O   M   A   C   S
- * 
- *          GROningen MAchine for Chemical Simulations
- * 
- *                        VERSION 3.3.99_development_20071104
- * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
- * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2006, The GROMACS development team,
- * check out http://www.gromacs.org for more information.
-
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- * 
- * If you want to redistribute modifications, please consider that
- * scientific software is very special. Version control is crucial -
- * bugs must be traceable. We will be happy to consider code for
- * inclusion in the official distribution, but derived work must not
- * be called official GROMACS. Details are found in the README & COPYING
- * files - if they are missing, get the official version at www.gromacs.org.
- * 
- * To help us fund GROMACS development, we humbly ask that you cite
- * the papers on the package - you can find them in the top README file.
- * 
- * For more info, check our website at http://www.gromacs.org
- * 
- * And Hey:
- * Groningen Machine for Chemical Simulation
- */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <math.h>
-#include "typedefs.h"
-#include "gromacs/commandline/pargs.h"
-#include "copyrite.h"
-#include "gromacs/utility/fatalerror.h"
-#include "gromacs/fileio/pdbio.h"
-#include "macros.h"
-#include "gromacs/utility/smalloc.h"
-#include "gromacs/math/vec.h"
-#include "gromacs/pbcutil/pbc.h"
-#include "gromacs/math/units.h"
-#include "names.h"
-#include "txtdump.h"
-#include "gromacs/fileio/trrio.h"
-#include "gromacs/topology/symtab.h"
-#include "gromacs/utility/strdb.h"
-#include "gromacs/fileio/confio.h"
-
-#define TET   109.47
-#define DCONS 0.117265878
-
-typedef struct {
-  int n,aa[4];
-} t_bbb;
-
-static char *watname[] = { "OW ", "HW1", "HW2", "DW", "SW" };
-static char *diamname[] = { "C1", "H2", "H3", "H4", "H5", "H2", "H3", "H4", "H5" };
-static real qspc[]     = { -0.82, 0.41, 0.41 };
-static real qyaw[]     = { 1.24588, 0.62134, 0.62134, 0.0, -2.48856 };
-static real spc_lj[3][6] = {
-  { 2.6171e-3, 2.6331e-6, 0, 0, 0, 0 },
-  { 0,      0,      0, 0, 0, 0 },
-  { 0,      0,      0, 0, 0, 0 }
-};
-#define CHH 2e-9
-#define CHS 2e-9
-#define COS 2e-6
-static real yaw_lj[5][10] = {
-  { 0, 0,   0, 0,   0,   0, 0, 0, 0,      COS },
-  { 0, 0,   0, CHH, 0, CHH, 0, 0, 0,      CHS },
-  { 0, 0,   0, CHH, 0, CHH, 0, 0, 0,      CHS },
-  { 0, 0,   0, 0,   0,   0, 0, 0, 0,      0   },
-  { 0, COS, 0, CHS, 0, CHS, 0, 0, 2.6e-3, 0   }
-};
-
-void unitcell(rvec x[],rvec box,gmx_bool bYaw,real odist,real hdist)
-{
-#define cx  0.81649658
-#define cy  0.47140452
-#define cy2 0.94280904
-#define cz  0.33333333
-  
-  rvec xx[24] = {
-    { 0,   0,         0 }, /* O1 */
-    { 0,   0,         1 }, /* H relative to Oxygen */
-    { cx, cy,       -cz },
-    { cx, cy,       -cz }, /* O2 */
-    { 0, 0,       -1    }, /* H relative to Oxygen */
-    { cx,-cy,       +cz },
-    { cx, cy+cy2,     0 }, /* O3 */
-    { -cx, cy,    -cz   }, /* H relative to Oxygen */
-    { 0,   -cy2,    -cz },
-    { 0,  2*cy+cy2, -cz }, /* O4 */
-    {-cx,-cy,       +cz }, /* H relative to Oxygen */
-    { 0 , cy2,      +cz },
-    { 0,   0,         1 }, /* O5 */
-    {-cx, cy,       +cz }, /* H relative to Oxygen */
-    { 0 , -cy2,     +cz },
-    { cx, cy,      1+cz }, /* O6 */
-    { -cx, -cy,     -cz }, /* H relative to Oxygen */
-    { 0,   cy2,     -cz },
-    { cx, cy+cy2,     1 }, /* O7 */
-    { 0,  0,       -1   }, /* H relative to Oxygen */
-    { cx, cy,       +cz },
-    { 0,  2*cy+cy2,1+cz }, /* O8 */
-    { 0,   0,         1 }, /* H relative to Oxygen */
-    { cx,   -cy,    -cz }
-  };
-  int  i,iin,iout,j,m;
-  rvec tmp,t2,dip;
-  
-  clear_rvec(dip);
-  for(i=0; (i<8); i++) {
-    iin = 3*i;
-    if (bYaw)
-      iout = 5*i;
-    else
-      iout = iin;
-    svmul(odist,xx[iin],x[iout]);
-    svmul(-0.82,x[iout],t2);
-    rvec_inc(dip,t2);
-    for(j=1; (j<=2); j++) {
-      svmul(hdist,xx[iin+j],tmp);
-      rvec_add(x[iout],tmp,x[iout+j]);
-      svmul(0.41,x[iout+j],t2);
-      rvec_inc(dip,t2);
-    }
-    if (bYaw)
-      for(m=0; (m<DIM); m++) 
-       x[iout+3][m] = x[iout+4][m] = 
-         (1-2*DCONS)*x[iout][m]+DCONS*(x[iout+1][m]+x[iout+2][m]);
-  }
-  
-  box[XX] = 2*cx;
-  box[YY] = 2*(cy2+cy);
-  box[ZZ] = 2*(1+cz);
-  for(i=0; (i<DIM); i++)
-    box[i] *= odist;
-    
-  printf("Unitcell:  %10.5f  %10.5f  %10.5f\n",box[XX],box[YY],box[ZZ]);
-  printf("Dipole:    %10.5f  %10.5f  %10.5f (e nm)\n",dip[XX],dip[YY],dip[ZZ]);
-}
-
-void random_h_coords(int natmol,int nmol,rvec x[],rvec box,
-                    gmx_bool bYaw,real odist,real hdist)
-{
-#define cx  0.81649658
-#define cy  0.47140452
-#define cy2 0.94280904
-#define cz  0.33333333
-  
-  rvec xx[24] = {
-    { 0,   0,         0 }, /* O1 */
-    { 0,   0,         1 }, /* H relative to Oxygen */
-    { cx, cy,       -cz },
-    { cx, cy,       -cz }, /* O2 */
-    { 0, 0,       -1    }, /* H relative to Oxygen */
-    { cx,-cy,       +cz },
-    { cx, cy+cy2,     0 }, /* O3 */
-    { -cx, cy,    -cz   }, /* H relative to Oxygen */
-    { 0,   -cy2,    -cz },
-    { 0,  2*cy+cy2, -cz }, /* O4 */
-    {-cx,-cy,       +cz }, /* H relative to Oxygen */
-    { 0 , cy2,      +cz },
-    { 0,   0,         1 }, /* O5 */
-    {-cx, cy,       +cz }, /* H relative to Oxygen */
-    { 0 , -cy2,     +cz },
-    { cx, cy,      1+cz }, /* O6 */
-    { -cx, -cy,     -cz }, /* H relative to Oxygen */
-    { 0,   cy2,     -cz },
-    { cx, cy+cy2,     1 }, /* O7 */
-    { 0,  0,       -1   }, /* H relative to Oxygen */
-    { cx, cy,       +cz },
-    { 0,  2*cy+cy2,1+cz }, /* O8 */
-    { 0,   0,         1 }, /* H relative to Oxygen */
-    { cx,   -cy,    -cz }
-  };
-  int  i,iin,iout,j,m;
-  rvec tmp,t2,dip;
-  
-  clear_rvec(dip);
-  for(i=0; (i<nmol); i++) {
-    iin = natmol*i;
-    iout = iin;
-    svmul(odist,x[iin],x[iout]);
-    svmul(-0.82,x[iout],t2);
-    rvec_inc(dip,t2);
-    for(j=1; (j<=2); j++) {
-      svmul(hdist,xx[3*(i % 8)+j],tmp);
-      rvec_add(x[iout],tmp,x[iout+j]);
-      svmul(0.41,x[iout+j],t2);
-      rvec_inc(dip,t2);
-    }
-  }
-  
-  box[XX] = 2*cx;
-  box[YY] = 2*(cy2+cy);
-  box[ZZ] = 2*(1+cz);
-  for(i=0; (i<DIM); i++)
-    box[i] *= odist;
-    
-  printf("Unitcell:  %10.5f  %10.5f  %10.5f\n",box[XX],box[YY],box[ZZ]);
-  printf("Dipole:    %10.5f  %10.5f  %10.5f (e nm)\n",dip[XX],dip[YY],dip[ZZ]);
-}
-
-void unitcell_d(rvec x[],rvec box,real odist)
-{
-  rvec cc[8] = {
-    { 0,   0,         0 }, /* C1 */
-    { cx, cy,       -cz }, /* C2 */
-    { cx, cy+cy2,     0 }, /* C3 */
-    { 0,  2*cy+cy2, -cz }, /* C4 */
-    { 0,   0,         1 }, /* C5 */
-    { cx, cy,      1+cz }, /* C6 */
-    { cx, cy+cy2,     1 }, /* C7 */
-    { 0,  2*cy+cy2,1+cz }, /* C8 */
-  };
-  rvec hh[4] = {
-    { 0,   0,         1  }, /* H relative to C */
-    { cx,  cy,       -cz },
-    { cx, -cy,       -cz }, 
-    {-cy2,  0,       -cz }
-  };
-  int  i,iin,iout,j,m;
-  rvec tmp,t2,dip;
-  
-  clear_rvec(dip);
-  for(i=0; (i<8); i++) {
-    iin  = i;
-    iout = i;
-    svmul(odist,cc[iin],x[iout]);
-  }  
-  box[XX] = 2*cx;
-  box[YY] = 2*(cy2+cy);
-  box[ZZ] = 2*(1+cz);
-  for(i=0; (i<DIM); i++)
-    box[i] *= odist;
-    
-  printf("Unitcell:  %10.5f  %10.5f  %10.5f\n",box[XX],box[YY],box[ZZ]);
-}
-
-static t_bbb *mk_bonds(int natoms,rvec x[],real odist,
-                      gmx_bool bPBC,matrix box)
-{
-  real  od2 = odist*odist+1e-5;
-  t_pbc pbc;
-  t_bbb *bbb;
-  int   i,j;
-  rvec  dx;
-  
-  if (bPBC)
-    set_pbc(&pbc,box);
-  snew(bbb,natoms);
-  for(i=0; (i<natoms); i++) {
-    for(j=i+1; (j<natoms); j++) {
-      if (bPBC)
-       pbc_dx(&pbc,x[i],x[j],dx);
-      else
-       rvec_sub(x[i],x[j],dx);
-      if (iprod(dx,dx) <= od2) {
-       bbb[i].aa[bbb[i].n++] = j;
-       bbb[j].aa[bbb[j].n++] = i;
-      }
-    }
-  }
-  if (debug) 
-#define PRB(nn) (bbb[(i)].n >= (nn)) ? bbb[i].aa[nn-1] : -1
-    for(i=0; (i<natoms); i++)
-      fprintf(debug,"bonds from %3d:  %d %d %d %d\n",
-             i,PRB(1),PRB(2),PRB(3),PRB(4));
-#undef PRB
-  return bbb;
-}
-
-static void mk_diamond(t_atoms *a,rvec x[],real odist,t_symtab *symtab,
-                      gmx_bool bPBC,matrix box)
-{
-  
-  int   i,ib,j,k,l,m,nrm=0;
-  t_bbb *bbb;
-  gmx_bool  *bRemove;
-  rvec  dx;
-  
-  do {
-    nrm = 0;
-    bbb = mk_bonds(a->nr,x,odist,bPBC,box);
-    
-    for(i=0; (i<a->nr); i++) {
-      if (bbb[i].n < 2) {
-       for(k=0; (k<bbb[i].n); k++) {
-         ib = bbb[i].aa[k];
-         for(j=0; (j<bbb[ib].n); j++)
-           if (bbb[ib].aa[j] == i)
-             break;
-         if (j == bbb[ib].n)
-           gmx_fatal(FARGS,"Bond inconsistency (%d not in list of %d)!\n",i,ib);
-         for( ; (j<bbb[ib].n-1); j++)
-           bbb[ib].aa[j] = bbb[ib].aa[j+1];
-         bbb[ib].n--;
-         nrm++;
-       }
-       bbb[i].n = 0;
-      }
-    }
-  
-    for(i=j=0; (i<a->nr); i++) {
-      if (bbb[i].n >= 2) {
-       copy_rvec(x[i],x[j]);
-       j++;
-      }
-    }
-    fprintf(stderr,"Kicking out %d carbon atoms (out of %d)\n",
-           a->nr-j,a->nr);
-    a->nr = j;
-    sfree(bbb);
-  } while (nrm > 0);
-  /* Rename atoms */
-  bbb = mk_bonds(a->nr,x,odist,bPBC,box);
-  for(i=0; (i<a->nr); i++) {
-    switch (bbb[i].n) {
-    case 4:
-      a->atomname[i] = put_symtab(symtab,"C");
-      break;
-    case 3:
-      a->atomname[i] = put_symtab(symtab,"CH1");
-      break;
-    case 2:
-      a->atomname[i] = put_symtab(symtab,"CH2");
-      break;
-    default:
-      gmx_fatal(FARGS,"This atom (%d) has %d bonds only",i,bbb[i].n);
-    }
-  }
-  sfree(bbb);
-}
-
-static real calc_ener(real c6,real c12,rvec dx,tensor vir)
-{
-  real r,e,f;
-  int  m,n;
-  
-  r  = norm(dx);
-  e  = c12*pow(r,-12.0) - c6*pow(r,-6.0);
-  f  = 12*c12*pow(r,-14.0) - 6*c6*pow(r,-8.0);
-  for(m=0; (m<DIM); m++) 
-    for(n=0; (n<DIM); n++)
-      vir[m][n] -= 0.5*f*dx[m]*dx[n];
-      
-  return e;
-}
-
-static int read_rel_coords(char *fn,rvec **xx,int natmol)
-{
-  int    i,nline;
-  double x,y,z;
-  char   **strings=NULL;
-  
-  nline = get_file(fn,&strings);
-  printf("Read %d lines from %s\n",nline,fn);
-  snew(*xx,nline*natmol);
-  for(i=0; (i<nline); i++) {
-    if (sscanf(strings[i],"%lf%lf%lf",&x,&y,&z) != 3)
-      gmx_fatal(FARGS,"Not enough arguments on line %d of file %s (should be 3)",i,fn);
-    (*xx)[natmol*i][XX] = x;
-    (*xx)[natmol*i][YY] = y;
-    (*xx)[natmol*i][ZZ] = z;
-  }
-  return natmol*nline;
-}
-
-void virial(FILE *fp,gmx_bool bFull,int nmol,rvec x[],matrix box,real rcut,
-           gmx_bool bYaw,real q[],gmx_bool bLJ)
-{
-  int  i,j,im,jm,natmol,ik,jk,m,ninter;
-  rvec dx,f,ftot,dvir,vir,pres,xcmi,xcmj,*force;
-  real dx6,dx2,dx1,fscal,c6,c12,vcoul,v12,v6,vctot,v12tot,v6tot;
-  t_pbc pbc;
-  
-  set_pbc(&pbc,box);
-  fprintf(fp,"%3s   -  %3s: %6s %6s %6s  %6s %8s %8s %8s\n",
-         "ai","aj","dx","dy","dz","|d|","virx","viry","virz");
-  clear_rvec(ftot);
-  clear_rvec(vir);
-  ninter = 0;
-  vctot  = 0;
-  v12tot = 0;
-  v6tot  = 0;
-  natmol = bYaw ? 5 : 3;
-  snew(force,nmol*natmol);
-  
-  for(i=0; (i<nmol); i++) {
-    im = natmol*i;
-    /* Center of geometry */
-    clear_rvec(xcmi);
-    for(ik=0; (ik<natmol); ik++)
-      rvec_inc(xcmi,x[im+ik]);
-    for(m=0; (m<DIM); m++)
-      xcmi[m] /= natmol;
-
-    for(j=i+1; (j<nmol); j++) {
-      jm = natmol*j;
-      /* Center of geometry */
-      clear_rvec(xcmj);
-      for(jk=0; (jk<natmol); jk++)
-       rvec_inc(xcmj,x[jm+jk]);
-      for(m=0; (m<DIM); m++)
-       xcmj[m] /= natmol;
-
-      /* First check COM-COM distance */
-      pbc_dx(&pbc,xcmi,xcmj,dx);
-      if (norm(dx) < rcut) {
-       ninter++;
-       /* Neirest neighbour molecules! */
-       clear_rvec(dvir);
-       for(ik=0; (ik<natmol); ik++) {
-         for(jk=0; (jk<natmol); jk++) {
-           pbc_dx(&pbc,x[im+ik],x[jm+jk],dx);
-           dx2    = iprod(dx,dx);
-           dx1    = sqrt(dx2);
-           vcoul  = q[ik]*q[jk]*ONE_4PI_EPS0/dx1;
-           vctot += vcoul;
-           
-           if (bLJ) {
-             if (bYaw) {
-               c6  = yaw_lj[ik][2*jk];
-               c12 = yaw_lj[ik][2*jk+1];
-             }
-             else {
-               c6  = spc_lj[ik][2*jk];
-               c12 = spc_lj[ik][2*jk+1];
-             }
-             dx6    = dx2*dx2*dx2;
-             v6     = c6/dx6;
-             v12    = c12/(dx6*dx6);
-             v6tot -= v6;
-             v12tot+= v12;
-             fscal  = (vcoul+12*v12-6*v6)/dx2;
-           }
-           else
-             fscal  = vcoul/dx2;
-           for(m=0; (m<DIM); m++) {
-             f[m]     = dx[m]*fscal;
-             dvir[m] -= 0.5*dx[m]*f[m];
-           }
-           rvec_inc(force[ik+im],f);
-           rvec_dec(force[jk+jm],f);
-           /*if (bFull)
-             fprintf(fp,"%3s%4d-%3s%4d: %6.3f %6.3f %6.3f %6.3f"
-                     " %8.3f %8.3f %8.3f\n",
-                     watname[ik],im+ik,watname[jk],jm+jk,
-                     dx[XX],dx[YY],dx[ZZ],norm(dx),
-                     dvir[XX],dvir[YY],dvir[ZZ]);*/
-         }
-       }
-       if (bFull)
-         fprintf(fp,"%3s%4d-%3s%4d: "
-                 " %8.3f %8.3f %8.3f\n",
-                 "SOL",i,"SOL",j,dvir[XX],dvir[YY],dvir[ZZ]);
-       rvec_inc(vir,dvir);
-      }
-    }
-  }
-  fprintf(fp,"There were %d interactions between the %d molecules (%.2f %%)\n",
-         ninter,nmol,(real)ninter/(0.5*nmol*(nmol-1)));
-  fprintf(fp,"Vcoul: %10.4e  V12: %10.4e  V6: %10.4e  Vtot: %10.4e (kJ/mol)\n",
-         vctot/nmol,v12tot/nmol,v6tot/nmol,(vctot+v12tot+v6tot)/nmol);
-  pr_rvec(fp,0,"vir ",vir,DIM,TRUE);
-  
-  for(m=0; (m<DIM); m++) 
-    pres[m] = -2*PRESFAC/(det(box))*vir[m];
-  pr_rvec(fp,0,"pres",pres,DIM,TRUE);
-  pr_rvecs(fp,0,"force",force,natmol*nmol);
-  sfree(force);
-}
-
-
-
-int main(int argc,char *argv[])
-{
-  static char *desc[] = {
-    "[TT]mkice[tt] generates an ice crystal in the Ih crystal form which is the",
-    "most stable form. The rectangular unitcell contains eight molecules",
-    "and all oxygens are tetrahedrally coordinated.[PAR]",
-    "If an input file is given it is interpreted as a series of oxygen",
-    "coordinates the distance between which can be scaled by the odist flag.",
-    "The program then adds hydrogens to the oxygens in random orientation",
-    "but with proper OH distances and HOH angle. This feature allows one to",
-    "build water clusters based on oxygen coordinates only."
-  };
-  static int nx=1,ny=1,nz=1;
-  static gmx_bool bYaw=FALSE,bLJ=TRUE,bFull=TRUE,bSeries=FALSE;
-  static gmx_bool bOrdered=TRUE,bDiamond=FALSE,bPBC=TRUE;
-  static real rcut=0.3,odist=0.274,hdist=0.09572;
-  t_pargs pa[] = {
-    { "-nx",    FALSE, etINT,  {&nx}, "nx" },
-    { "-ny",    FALSE, etINT,  {&ny}, "ny" },
-    { "-nz",    FALSE, etINT,  {&nz}, "nz" },
-    { "-yaw",   FALSE, etBOOL, {&bYaw},
-      "Generate virtual sites and shell positions" },
-    { "-lj",    FALSE, etBOOL, {&bLJ},
-      "Use LJ as well as coulomb for virial calculation" },
-    { "-rcut",  FALSE,etREAL,  {&rcut},"Cut-off for virial calculations" },
-    { "-full",  FALSE,etBOOL,  {&bFull},"Full virial output" },
-    { "-odist", FALSE, etREAL, {&odist}, "Distance (nm) between oxygens" },
-    { "-hdist", FALSE, etREAL, {&hdist}, "Bondlength (nm) for OH bond" },
-    { "-diamond",FALSE,etBOOL, {&bDiamond}, "Make a diamond instead" },
-    { "-pbc",   FALSE, etBOOL, {&bPBC},  "Make a periodic diamond" },
-    { "-order", FALSE,etBOOL,  {&bOrdered}, "Make a proton-ordered ice lattice" },
-    { "-series",FALSE, etBOOL, {&bSeries}, 
-      "Do a series of virial calculations with different cut-off (from 0.3 up till the specified one)" }
-  };
-  t_filenm fnm[] = {
-    { efSTO, "-p", "ice", ffWRITE },
-    { efSTO, "-c", NULL,  ffOPTRD },
-    { efDAT, "-f", NULL,  ffOPTRD },
-    { efTRN, "-o", "ice", ffOPTWR }
-  };
-#define NFILE asize(fnm)
-
-  FILE      *fp;
-  char      *fn,quote[256];
-  int       i,j,k,n,nmax,m,natom,natmol;
-  t_atoms   *pdba;
-  t_atoms   atoms;
-  t_symtab  symtab;
-  rvec      box,tmp,*xx;
-  matrix    boxje;
-  
-  CopyRight(stdout,argv[0]);
-  parse_common_args(&argc,argv,0,NFILE,fnm,asize(pa),pa,asize(desc),
-                   desc,0,NULL);
-  if (debug) {
-    fprintf(debug,"nx  = %3d, ny  = %3d,  nz   = %3d\n",nx,ny,nz);
-    fprintf(debug,"YAW = %3s, LJ  = %3s,  rcut = %g\n",yesno_names[bYaw],
-           yesno_names[bLJ],rcut);
-  }
-
-  if (bYaw)
-    natmol = 5;
-  else if (bDiamond)
-    natmol = 1;
-  else
-    natmol = 3;
-    
-  if (opt2bSet("-f",NFILE,fnm)) {
-    natom = read_rel_coords(opt2fn("-f",NFILE,fnm),&xx,natmol);
-    nmax  = natom;
-  }
-  else {
-    natom = natmol*8;
-    nmax = natom*nx*ny*nz;
-    snew(xx,nmax);
-  }
-  snew(pdba,1);
-  init_t_atoms(pdba,nmax,TRUE);
-  pdba->nr = nmax;
-  open_symtab(&symtab);
-  for(n=0; (n<nmax); n++) {
-    pdba->pdbinfo[n].type   = epdbATOM;
-    pdba->pdbinfo[n].atomnr = 1+n;
-    pdba->atom[n].resnr     = 1+(n/natmol);
-    pdba->atomname[n] = put_symtab(&symtab,
-                                  bDiamond ? diamname[(n % natmol)] : watname[(n % natmol)]);
-    if (bDiamond)
-      pdba->resname[n] = put_symtab(&symtab,"DIA");
-    else
-      pdba->resname[n] = put_symtab(&symtab,"SOL");
-    sprintf(pdba->pdbinfo[n].pdbresnr,"%d",n);
-    pdba->atom[n].chain = ' ';
-  }
-  
-  /* Generate the unit cell */
-  if (bDiamond)
-    unitcell_d(xx,box,odist); 
-  else if (opt2bSet("-f",NFILE,fnm)) {
-    random_h_coords(natmol,natom/natmol,xx,box,bYaw,odist,hdist);
-  }
-  else
-    unitcell(xx,box,bYaw,odist,hdist);
-  if (debug) {
-    clear_mat(boxje);
-    boxje[XX][XX] = box[XX];
-    boxje[YY][YY] = box[YY];
-    boxje[ZZ][ZZ] = box[ZZ];
-  }
-  n=0;
-  for(i=0; (i<nx); i++) {
-    tmp[XX] = i*box[XX];
-    for(j=0; (j<ny); j++) {
-      tmp[YY] = j*box[YY];
-      for(k=0; (k<nz); k++) {
-       tmp[ZZ] = k*box[ZZ];
-       for(m=0; (m<natom); m++,n++) {
-         if ((!bOrdered && ((m % natmol) == 0)) || bOrdered)
-           rvec_add(xx[n % natom],tmp,xx[n]);
-         else
-           ;
-       }
-      }
-    }
-  }
-    
-  clear_mat(boxje);
-  boxje[XX][XX] = box[XX]*nx;
-  boxje[YY][YY] = box[YY]*ny;
-  boxje[ZZ][ZZ] = box[ZZ]*nz;
-  
-  printf("Crystal:   %10.5f  %10.5f  %10.5f\n",
-        nx*box[XX],ny*box[YY],nz*box[ZZ]);
-  
-  if (debug && !bDiamond) {
-    if (bSeries)
-      for(i=3; (i<=10*rcut); i++) {
-       fprintf(debug,"This is with rcut = %g\n",i*0.1);
-       virial(debug,bFull,nmax/natmol,xx,boxje,
-              0.1*i,bYaw,bYaw ? qyaw : qspc,bLJ);
-      }    
-    else
-      virial(debug,bFull,nmax/natmol,xx,boxje,
-            rcut,bYaw,bYaw ? qyaw : qspc,bLJ);
-  }
-  
-  if (bDiamond) 
-    mk_diamond(pdba,xx,odist,&symtab,bPBC,boxje);
-
-  fn = ftp2fn(efSTO,NFILE,fnm);
-  if (fn2ftp(fn) == efPDB) {
-    fp = gmx_ffopen(fn,"w");
-    if (bDiamond)
-      fprintf(fp,"HEADER    This is a *diamond*\n");
-    else
-      fprintf(fp,"HEADER    A beautiful Ice Ih crystal\n");
-    fprintf(fp,"REMARK    Generated by mkice with the following options:\n"
-           "REMARK    nx = %d, ny = %d, nz = %d, odist = %g, hdist = %g\n",
-           nx,ny,nz,odist,hdist);
-       bromacs(quote,255);
-    write_pdbfile(fp,quote,pdba,xx,boxje,' ',-1);
-    gmx_ffclose(fp);
-  }
-  else {
-    bromacs(quote,255);
-    write_sto_conf(fn,quote,pdba,xx,NULL,boxje);
-  }
-  
-  if (ftp2bSet(efTRN,NFILE,fnm))
-    write_trn(ftp2fn(efTRN,NFILE,fnm),0,0,0,boxje,nmax,xx,NULL,NULL);
-              
-  return 0;
-}
-
diff --git a/src/contrib/random.c b/src/contrib/random.c
deleted file mode 100644 (file)
index 6514ba8..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Print a lookup table for Gaussian numbers with 4 entries on each
- * line, formatted for inclusion in this file. Size is 2^bits.
- */
-
-void
-print_gaussian_table(int bits)
-{
-  int n,nh,i,j;
-  double invn,fac,x,invgauss,det,dx;
-  real  *table;
-  
-  n = 1 << bits;
-  table = (real *)malloc(n*sizeof(real));
-  
-  /* Fill a table of size n such that random draws from it
-    * produce a Gaussian distribution.
-    * We integrate the Gaussian distribution G approximating:
-    *   integral(x->x+dx) G(y) dy
-    * with:
-    *   G(x) dx + G'(x) dx^2/2 = G(x) dx - G(x) x dx^2/2
-    * Then we need to find dx such that the integral is 1/n.
-    * The last step uses dx = 1/x as the approximation is not accurate enough.
-    */
-  invn = 1.0/n;
-  fac = sqrt(2*M_PI);
-  x = 0.5*fac*invn;
-  nh = n/2;
-  for(i=0; i<nh; i++) {
-    if (i > 0) {
-      if (i < nh-1) {
-       invgauss = fac*exp(0.5*x*x);
-       /* det is larger than 0 for all x, except for the last */
-       det = 1 - 2*invn*x*invgauss;
-       dx = (1 - sqrt(det))/x;
-      } else {
-       dx = 1/x;
-      }
-      x = x + dx;
-    }
-    table[nh-1-i] = -x;
-    table[nh+i]   =  x;
-  }
-  printf("static const real *\ngaussian_table[%d] = {\n",n);
-  for(i=0;i<n;i+=4) {
-    printf("  ");
-    for(j=0;j<4;j++) {
-      printf("%14.7e",table[i+j]);
-      if(i+j<(n-1))
-       printf(",");
-    }
-    printf("\n");
-  }
-  printf("};\n");
-  free(table);
-}
-
diff --git a/src/contrib/scripts/amber2gmxff b/src/contrib/scripts/amber2gmxff
deleted file mode 100755 (executable)
index 733f378..0000000
+++ /dev/null
@@ -1,432 +0,0 @@
-#!/bin/awk -f 
-
-# reads Amber forcefield definition file(s) and converts to Gromacs
-# Version 1.1
-# Copyright (c) 2002
-# Anton Feenstra - Vrije Universiteit Amsterdam - The Netherlands
-
-function abs(r) {
-  return sqrt(r^2);
-}
-
-# unit conversion functions:
-
-# Angstrom (1e-10 m) to nanometers (1e-9 m)
-function A2nm(a) {
-  return a/10;
-}
-
-# Angstrom^-1 to nanometers^-1
-function pA2pnm(a) {
-  return a*10;
-}
-
-# kCalories to kJoules
-function kcal2kj(e) {
-  return e * 4.1868;
-}
-
-# kCal mol^-1 A^-n to kJoule mol^-1 nm^-n
-# 'n' is usually 2 (for bonds) or 6 or 12 (for LJ)
-function kcalpmolpA2kjpmolpnm(k, n) {
-  kk=kcal2kj(k);
-  for(ki=0; ki<n; ki++)
-    kk=pA2pnm(kk);
-  return kk;
-}
-
-function warning(s) {
-  printf("WARNING: %s\n", s);
-  nwarn++;
-}
-
-function print_warn() {
-  if (nwarn)
-    printf("\nThere were %d warnings\n\n", nwarn);
-}
-
-function fatal_error(s) {
-  printf("FATAL ERROR: %s\n", s);
-  exit -1;
-}
-
-BEGIN {
-  if (ARGC < 2) {
-    print("Usage:");
-    print("amber2gmxff [ffname=<name>] [debug=1] parm##.dat");
-    print("");
-    print("Reads Amber forcefield definition file (parm##.dat) and writes");
-    print("Gromacs forcefield files:");
-    print("ff<name>.atp, ff<name>.itp, ff<name>nb.itp, ff<name>bon.itp");
-    print("Default for <name> is 'amber'.");
-    print("");
-    print("Use 'debug=1' for extremely verbose output.");
-    print("");
-    xxit=1;
-    exit;
-  }
-  if ( !ffname ) ffname="amber";
-  ffbon = "ff" ffname "bon.itp";
-  ffnb  = "ff" ffname "nb.itp";
-  ffmain= "ff" ffname ".itp";
-  ffatp = "ff" ffname ".atp";
-  ffpdihs = ffname "-dihedrals.txt";
-  ffidihs = ffname "-impropers.txt";
-  printf("Sending output to: %s, %s and %s\n", ffmain, ffnb, ffbon);
-  printf("; Amber forcefield converted to Gromacs\n") > ffnb;
-  printf("; from file %s\n", ARGV[1]) > ffnb;
-  printf("; \n") > ffnb;
-  printf("; Amber forcefield converted to Gromacs\n") > ffbon;
-  printf("; from file %s\n", ARGV[1]) > ffbon;
-  printf("\n") > ffbon;
-  type=0;
-  nat=0; # atoms
-  nb=0;  # bonds
-  na=0;  # angles
-  np=0;  # propers
-  ni=0;  # impropers
-  nhb=0; # H-bonds (10-12)
-  neq=0; # equivalent 6-12
-  nlj=0; # LJ (6-12)
-  section[tp_TITL=0]="title";
-  section[tp_ATOM=1]="atom";
-  section[tp_HYDR=2]="hydro";
-  section[tp_BOND=3]="bond";
-  section[tp_ANGL=4]="angle";
-  section[tp_PDIH=5]="pdih";
-  section[tp_IDIH=6]="idih";
-  section[tp_HB  =7]="HB";
-  section[tp_EQ  =8]="eq";
-  section[tp_LJ  =9]="LJ";
-  
-}
-
-# keep track of what we are reading, sections are separated by empty line
-NF==0 {
-  if (type==tp_HB) {
-    if (bAllZero) {
-      printf("; NOTE: all H-bond (10-12) parameters are Zero\n") > ffnb;
-    } else {
-      printf("; WARNIGN: Not all H-bond (10-12) parameters are Zero\n") > ffnb;
-      warning("Not all H-bond (10-12) parameters are Zero\n");
-    }
-  }
-  type++;
-  printf("Start reading section: %d = %s\n", type, section[type]);
-  next; 
-}
-
-type==tp_TITL { # title
-  title = $0; 
-  printf("; %s\n", title) > ffnb;
-  printf("; \n") > ffnb;
-  printf("; %s\n", title) > ffbon;
-  printf("; \n") > ffbon;
-  type++;
-  next;
-}
-
-type==tp_ATOM { # atoms
-  if (debug) printf("; %s\n", $0);
-  anm = substr($0, 1, 2)  ; #  1- 2
-  anms[nat]  = anm;
-  amass[anm] = substr($0, 4,10)+0; #  4-13
-  atpol[anm] = substr($0,15,10)+0; # 15-24
-  atcom[anm] = substr($0,38,length); # rest
-  nat++;
-  if (debug) printf("; '%s' %10g %10g '%s'\n", 
-                   anm, amass[anm], atpol[anm], atcom[anm]);
-}
-
-type==tp_HYDR { # hydrophylic atoms
-  if (debug) printf("; %s\n", $0);
-  hydrophylics = $0;
-  type++;
-  next;
-}
-
-type>=tp_BOND && type<=tp_IDIH { # bonded interaction
-  ai = substr($0, 1, 2)  ; #  1- 2
-  aj = substr($0, 4, 2)  ; #  4- 5
-  ak = substr($0, 7, 2)  ; #  7- 8
-  al = substr($0,10, 2)  ; # 10-11
-}
-
-type==tp_BOND { # bonds
-  if (nb==0) {
-    printf("\n") > ffbon;
-    printf("[ bondtypes ]\n") > ffbon;
-    printf(";%4s %5s %4s %8s %8s\n", "ai", "aj", "ft", "b0", "kb") > ffbon;
-    printf(";%4s %5s %4s %8s %8s\n","","","", "(nm)", "(kj/mol/nm2)") > ffbon;
-    ft=1;
-  }
-  if (debug) printf("; %s\n", $0);
-  ibt[nb] = ai;
-  jbt[nb] = aj;
-  rk[nb]  = kcalpmolpA2kjpmolpnm(substr($0, 6,10), 2); #  6-15
-  req[nb] = A2nm(substr($0,16,10)); # 16-25
-  bcom[nb]= substr($0,29,length); # rest
-  printf("%5s %5s %4d %8g %8g ; %s\n", 
-        ibt[nb], jbt[nb], ft, req[nb], rk[nb], bcom[nb]) > ffbon;
-  nb++;
-}
-
-type==tp_ANGL { # angles
-  if (na==0) {
-    printf("\n") > ffbon;
-    printf("[ angletypes ]\n") > ffbon;
-    printf(";%4s %5s %5s %4s %8s %8s\n", 
-          "ai", "aj", "ak", "ft", "th0", "cth") > ffbon;
-    printf(";%4s %5s %5s %4s %8s %8s\n", 
-          "", "", "", "", "(degr)", "(kj/mol/rad2)") > ffbon;
-    ft=1;
-  }
-  if (debug) printf("; %s\n", $0);
-  itt[na] = ai;
-  jtt[na] = aj;
-  ktt[na] = ak; 
-  tk[na]  = kcal2kj(substr($0, 9,10)); #  9-18
-  teq[na] = substr($0,19,10)+0; # 19-28
-  acom[na]= substr($0,33,length); # rest
-  printf("%5s %5s %5s %4d %8g %8g ; %s\n", 
-        itt[na],jtt[na],ktt[na], ft, teq[na], tk[na], acom[na]) > ffbon;
-  na++;
-}
-
-type==tp_PDIH || type==tp_IDIH { # proper/improper dihedrals
-  if (type==tp_PDIH && np==0) {
-    ft=1;
-    bFirstPdihDefine=1;
-    printf("\n") > ffbon;
-    printf("[ dihedraltypes ]\n") > ffbon;
-    printf(";%4s %5s %5s %8s %8s %5s\n", 
-          "aj","ak", "ft","phi0","cp","mult") > ffbon;
-    printf(";%4s %5s %5s %8s %8s %5s\n", 
-          "","", "","(degr)","(kJ/mol/rad)","") > ffbon;
-  }
-  if (type==tp_IDIH && ni==0) {
-    ft=1; # we'll have to 'abuse' propers to correspond to Amber definition
-    printf("\n") > ffbon;
-    printf(";%4s %5s %5s %5s %5s %8s %8s %5s\n", 
-          "ai","aj","ak","al", "ft","q0","cq","mult") > ffbon;
-    printf("; WARNING: using Gromacs propers to define Amber impropers\n") > ffbon;
-    printf("; defining improper parameters for improper types\n") > ffbon;
-    warning("using Gromacs propers to define Amber impropers\n");
-  }
-  if (debug) printf("; %s\n", $0);
-  idivf   = substr($0,12, 4)+0; # 12-15
-  pk      = kcal2kj(substr($0,16,15)); # 16-30
-  phase   = substr($0,31,15)+0; # 31-45
-  pn      = substr($0,46,15)+0; # 46-50
-  com     = substr($0,61,length); # rest
-  if (type==tp_PDIH) {
-    ipt[np] = ai;
-    jpt[np] = aj;
-    kpt[np] = ak;
-    lpt[np] = al;
-    p_idivf[np] = idivf;
-    p_pk[np]    = pk   ;
-    p_phase[np] = phase;
-    p_pn[np]    = pn   ;
-    p_com[np]   = com  ;
-    np++;
-    if ( ai=="X " && al=="X " ) {
-      # this is the type of dihedral GROMACS can manage:
-      printf("%5s %5s %5d %8g %8g %5d ; %s\n", 
-            aj,ak, ft, phase, pk/idivf, pn, com) > ffbon;
-      if (pn<0) {
-       printf(" ; WARNING: multiple dihedral types not supperted") > ffbon;
-       warning("multiple dihedral types not supperted");
-      }
-    } else {
-      # here we need a hack, since we cannot hava a dihedral type 
-      # depend on all four atom types in GROMACS...
-      if (bFirstPdihDefine) {
-       bFirstPdihDefine=0;
-       printf("\n") > ffbon;
-       printf("; defining dihedral parameters for four-atom dependent\n") > ffbon;
-       printf("; dihedral types, which Gromacs does not handle by default\n") > ffbon;
-      }
-      print ai, aj, ak, al > ffpdihs;
-      gsub(" ","_",ai); gsub(" ","_",aj); gsub(" ","_",ak); gsub(" ","_",al);
-      if (pn<0 && ninc=="")
-       ninc=1;
-      printf("#define ad_%2s_%2s_%2s_%2s%1s%1s %8g %8g %5d %8g %8g %5d %s%s\n", 
-            ai,aj,ak,al, ninc?"_":" ", ninc, 
-            phase, pk/idivf, abs(pn), phase, pk/idivf, abs(pn), 
-            length(com)?"; ":"", com) > ffbon;
-      if (pn<0)
-       ninc++;
-      else
-       ninc="";
-    }
-  }
-  if (type==tp_IDIH) {
-    iit[ni] = ai;
-    jit[ni] = aj;
-    kit[ni] = ak;
-    lit[ni] = al;
-    i_idivf[ni] = idivf;
-    i_pk[ni]    = pk   ;
-    i_phase[ni] = phase;
-    i_pn[ni]    = pn   ;
-    i_com[ni]   = com  ;
-    ni++;
-    # here we need a hack, since we cannot hava a dihedral type 
-    # depend on all four atom types in GROMACS...
-    print ai, aj, ak, al > ffidihs;
-    gsub(" ","_",ai); gsub(" ","_",aj); gsub(" ","_",ak); gsub(" ","_",al);
-    printf("#define ai_%2s_%2s_%2s_%2s %8g %8g %5d %8g %8g %5d %s%s\n",
-          ai,aj,ak,al, pk,phase,pn,pk,phase,pn, 
-          length(com)?"; ":"",com) > ffbon;
-  }
-}
-
-type==tp_HB { # H-bond 10-12 parameters
-  if (nhb==0) {
-    printf("\n") > ffnb;
-    printf("; H-bond params not implemented\n") > ffnb;
-    warning("H-bond params not implemented\n");
-    bAllZero=1;
-  }
-  if (debug) printf("; %s\n", $0);
-  a=substr($0, 11, 10)+0; # 11-20
-  b=substr($0, 21, 10)+0; # 21-30
-  if (a!=0 || b!=0) {
-    printf("; WARNING: non-zero H-bond (10-12) parameters: %s %s %g %g\n",
-          ai, aj, a, b) > ffnb;
-    warning("non-zero H-bond (10-12) parameters:", ai, aj, a, b);
-    bAllZero=0;
-  }
-  nhb++;
-}
-
-type==tp_EQ { # equivalent atom symbols 6-12 parameters
-  if (neq==0) {
-    printf("\n") > ffnb;
-    printf("; LJ 6-12 equivalent atom symbols\n") > ffnb;
-    
-  }
-  if (debug) printf("; %s\n", $0);
-  anm=substr($0, 1, 2);
-  for(i=1; i<length; i+=4) {
-    eqat[neq]++;
-    eqat[neq, int(i/4)]=substr($0, i, 2);
-  }
-  printf("; ") > ffnb;
-  for(i=0; i<eqat[neq]; i++) {
-    printf("%3s ", eqat[neq, i]) > ffnb;
-  }
-  printf("(%d)\n", eqat[neq]) > ffnb;
-  neq++;
-}
-
-type==tp_LJ { # 6-12 potential parameters
-  if ( !kindnb ) {
-    label = $1;
-    kindnb= $2;
-    next;
-  }
-  if (nlj==0) {
-    printf("\n") > ffnb;
-    printf("; Define LJ 6-12 parameter types:\n") > ffnb;
-  }
-  if (debug) printf("; %s\n", $0);
-  ljt[nlj] = substr($0, 3, 2)  ; #  3- 4
-  p1       = substr($0,11,20)+0; # 11-20
-  p2       = substr($0,21,30)+0; # 21-30
-  if (kindnb=="AC") {
-    p  = kcalpmolpA2kjpmolpnm(p2, 6);
-    p2 = kcalpmolpA2kjpmolpnm(p1, 12);
-    p1 = p;
-  }
-  if (kindnb=="RE") {
-    p1 = A2nm(p1);
-    p2 = kcal2kj(p2);
-  }
-  p3 = substr($0,31,40)+0; # 31-40
-  if (debug) printf("; '%s' %10g %10g %10g\n", 
-                   ljt[nlj], p1, p2, p3);
-  printf("#define alj_%s %10g %10g\n", ljt[nlj], p1,p2) > ffnb;
-  nlj++;
-}
-
-END {
-  if (xxit) exit;
-  
-  # write forcefield main ff<name>.itp file
-  # we do that here so we have the title...
-  printf("#define _FF_%s\n", toupper(ffname)) > ffmain;
-  printf("; Amber forcefield converted to Gromacs\n") > ffmain;
-  printf("; from file %s\n", ARGV[1]) > ffmain;
-  printf("; \n") > ffmain;
-  printf("; %s\n", title) > ffmain;
-  printf("\n") > ffmain;
-  printf("[ defaults ]\n") > ffmain;
-  if (kindnb=="AC") cr=1;
-  if (kindnb=="RE") cr=2;
-  printf("; %8s %10s %10s %10s %10s\n", 
-        "nbfunc", "comb-rule", "gen-pairs", "fudgeLJ", "fudgeQQ") > ffmain;
-  printf("%10d %10d %10s %10.3g %10.3g\n", 1, cr, "no", 1.0, 1.0) > ffmain;
-  printf("\n") > ffmain;
-  printf("#include \"%s\"\n", ffnb) > ffmain;
-  printf("#include \"%s\"\n", ffbon) > ffmain;
-  
-  # expand LJ parameters (using 'equivalent atoms')
-  for(i=0; i<neq; i++) {
-    eqnm = eqat[i, 0];
-    if (debug) print i, eqnm, eqat[i];
-    for(j=1; j<eqat[i]; j++)
-      atlj[eqat[i, j]] = eqnm;
-  }
-  for(i=0; i<nat; i++) {
-    anm=anms[i];
-    if (!atlj[anm]) atlj[anm]=anm;
-    if (debug) print i, anm, atlj[anm];
-  }
-  printf("\n") > ffnb;
-  printf("[ atomtypes ]\n") > ffnb;
-  if (kindnb=="AC")
-    printf(";%4s%10s %4s %2s %-10s\n", 
-          "name", "mass", "q", "tp", "c6/c12") > ffnb;
-  if (kindnb=="RE")
-    printf(";%4s%10s %4s %2s %-10s\n", 
-          "name", "mass", "q", "tp", "sigma/epsilon") > ffnb;
-  q=0;
-  ptype="A";
-  for(i=0; i<nat; i++) {
-    anm=anms[i];
-    printf("%4s %10.6g %4.2g %2s alj_%-3s ; %s\n", 
-          anm, amass[anm], q, ptype, atlj[anm], atcom[anm]) > ffnb;
-    # here we write .atp
-    printf("%4s %10.6g ; %s\n", anm, amass[anm], atcom[anm]) > ffatp;
-  }
-  printf("\n");
-  
-  printf("Found:\n");
-  printf("# atoms:           %s\n", nat); 
-  printf("# bonds:           %s\n", nb);  
-  printf("# angles:          %s\n", na);  
-  printf("# propers:         %s\n", np);  
-  printf("# impropers:       %s\n", ni);  
-  printf("# H-bonds (10-12): %s\n", nhb); 
-  printf("# equivalent 6-12: %s\n", neq); 
-  printf("# LJ (6-12):       %s\n", nlj); 
-  
-  printf("\n") > ffnb;
-  printf("; Found:\n") > ffnb;
-  printf("; # atoms:           %s\n", nat) > ffnb; 
-  printf("; # H-bonds (10-12): %s\n", nhb) > ffnb; 
-  printf("; # equivalent 6-12: %s\n", neq) > ffnb; 
-  printf("; # LJ (6-12):       %s\n", nlj) > ffnb; 
-  printf("\n") > ffbon;
-  printf("; Found:\n") > ffbon;
-  printf("; # bonds:           %s\n", nb)  > ffbon;  
-  printf("; # angles:          %s\n", na)  > ffbon;  
-  printf("; # propers:         %s\n", np)  > ffbon;  
-  printf("; # impropers:       %s\n", ni)  > ffbon;  
-  
-  print_warn();
-}
-
-#last line
diff --git a/src/contrib/scripts/amber2gmxrtp b/src/contrib/scripts/amber2gmxrtp
deleted file mode 100755 (executable)
index d319b2d..0000000
+++ /dev/null
@@ -1,651 +0,0 @@
-#!/bin/awk -f
-
-# reads Amber building block definition file(s) and converts to Gromacs
-# Version 1.1
-# Copyright (c) 2002
-# Anton Feenstra - Vrije Universiteit Amsterdam - The Netherlands
-
-function fill_with_underscores(s, n) {
-  ss=s;
-  while (length(ss)<n)
-    ss=ss"_";
-  return ss;
-}
-
-# keep track of which section ('card') of the residue entry we are reading
-# if tp<0, 'type' is incremented
-function next_type(tp) {
-  if (tp>=0)
-    type=tp;
-  else
-    type ++;
-  if (debug) printf("Start reading section: %d = %s\n", type, section[type]);
-}
-
-# read list of dihedrals as defined in the ff files (written by amber2gmxff)
-function read_dihs(file, dihs) {
-  ndihs=0;
-  printf("Reading dihs from '%s'... ", file);
-  while ( 0<getline <file ) {
-    n=split($0,d);
-    for(i=0; i<n; i++)
-      dihs[ndihs,i]=d[i+1];
-    ndihs++;
-  }
-  close(file);
-  if (ndihs)
-    printf("Read %d dihs\n", ndihs);
-  else
-    warning("could not read dihs");
-  return ndihs;
-}
-
-# locate dihedrals in list and return number of matches
-function find_dih(ai, aj, ak, al, ndihs, dihs, found_dihs) {
-  nmatch=0;
-  dih[0]=ai; dih[1]=aj; dih[2]=ak; dih[3]=al; 
-  for(fi=0; fi<ndihs; fi++) {
-    bMatch=1;
-    if (debug) printf(".");
-    for(fd=0; fd<=1; fd++) { # forward and backward comparison
-      for(fj=0; fj<4 && bMatch; fj++)
-       if (dihs[fi,fj]!="X")
-         if (fd==0) # forward comparison
-           bMatch = (dihs[fi,fj]==dih[fj]);
-         else       # backward comparison
-           bMatch = (dihs[fi,fj]==dih[3-fj]);
-      if (bMatch) {
-       for(fj=0; fj<4; fj++)
-         found_dihs[nmatch,fj]=dihs[fi,fj];
-       nmatch++;
-      }
-    }
-  }
-  return nmatch;
-}
-
-# write list of dihedrals
-function dump_dihs(ndihs, dihs) {
-  for(i=0; i<ndihs; i++) {
-    printf("dih %d:", i);
-    for(j=0; j<4; j++)
-      printf(" %s", dihs[i,j]);
-    printf("\n");
-  }
-}
-
-function anm2atp(anmi, nat, anms, atps) {
-  anm=anmi; 
-  gsub("-","",anm); 
-  gsub("\\+","",anm); 
-  for(ii=0; ii<nat; ii++)
-    if (anm==anms[ii])
-      return atps[ii];
-}
-
-function is_hydrogen(anr) {
-  return index(isymbl[anr], "H")==1;
-}
-
-function swap_atoms(atnr1, atnr2) {
-  # swap array entries:
-  dum=igraph[atnr1]; igraph[atnr1]=igraph[atnr2]; igraph[atnr2]=dum;
-  dum=isymbl[atnr1]; isymbl[atnr1]=isymbl[atnr2]; isymbl[atnr2]=dum;
-  for(_j=0; _j<3; _j++)
-    dum=zz[atnr1,_j]; zz[atnr1,_j]=zz[atnr2,_j];  zz[atnr2,_j] =dum;
-  dum=theta[atnr1];  theta[atnr1] =theta[atnr2];  theta[atnr2] =dum;
-  dum=chg[atnr1];    chg[atnr1]   =chg[atnr2];    chg[atnr2]   =dum;
-  dum=allM[atnr1];   allM[atnr1]  =allM[atnr2];   allM[atnr2]  =dum;
-  dum=allMtp[atnr1]; allMtp[atnr1]=allMtp[atnr2]; allMtp[atnr2]=dum;
-  # swap atom number references in z-matrix definition:
-  for(_i=0; _i<nat; _i++)
-    for(_j=0; _j<nat; _j++)
-      if      (zz[_i,_j]==atnr1) zz[_i,_j]=atnr2;
-      else if (zz[_i,_j]==atnr2) zz[_i,_j]=atnr1;
-}
-
-function warning(s) {
-  printf("WARNING: %s\n", s);
-  nwarn++;
-}
-
-function print_warn() {
-  if (nwarn)
-    printf("\nThere were %d warnings\n\n", nwarn);
-}
-
-function fatal_error(s) {
-  if (nwarn) printf("(%d warnings pending)\n", nwarn);
-  printf("\nFATAL ERROR: %s\n\n", s);
-  xxit=1;
-  exit -1;
-}
-
-BEGIN {
-  if (ARGC < 2) {
-    print("Usage:");
-    print("amber2gmxrtp [ffname=<name>] [debug=1] all##.in");
-    print("");
-    print("Reads Amber residue database file (all##.in) and");
-    print("writes Gromacs residue topology file (ff<name>.rtp),");
-    print("Gromacs hydrogen database file (ff<name>.hdb),");
-#    print("and Gromacs termini database files (ff<name>-[cn].tdb).");
-    print("NOTE: For the time being, termini are implemented as");
-    print("additional residues in the ff<name>.rtp as entries with");
-    print("residue names '<res>-C' or '<res>-N'.");
-    print("Default for <name> in output files is 'amber'.");
-    print("");
-    print("Use 'debug=1' for extremely verbose output.");
-    print("");
-    xxit=1;
-    exit;
-  }
-  if ( !ffname ) ffname="amber";
-  ffrtp = "ff" ffname ".rtp";
-  ffhdb = "ff" ffname ".hdb";
-  ffctdb = "ff" ffname "-c.tdb";
-  ffntdb = "ff" ffname "-n.tdb";
-  ffpdihs = ffname "-dihedrals.txt";
-  ffidihs = ffname "-impropers.txt";
-  nptps=read_dihs(ffpdihs, pdihtps);
-  nitps=read_dihs(ffidihs, idihtps);
-  if (debug) dump_dihs(nptps, pdihtps);
-  if (debug) dump_dihs(nitps, idihtps);
-  warning("NOTE: .tdb not implemented yet (dummy files will be written).");
-  printf("Sending output to: %s\n", ffrtp);
-  printf("; Amber forcefield converted to Gromacs\n") > ffrtp;
-  printf("; \n") > ffrtp;
-  type=0;
-  nres=0; # residues
-  nM=0;
-  bM=0;
-  # declare sections and names (order corresponds to amber file format)
-  section[tp_RES_TIT=0]="residue title";
-  section[tp_OUT_FIL=1]="output file";
-  section[tp_RES_NAM=2]="residue name";
-  section[tp_GEO_TYP=3]="geometry type";
-  section[tp_LOO_CUT=4]="loop cutoff";
-  section[tp_ATOMS  =5]="atoms";
-  section[tp_EXTRAS =6]="extras";
-  section[tp_CHARGE =7]="charge";
-  section[tp_LOOP   =8]="loop";
-  section[tp_IMP_DIH=9]="improper";
-  
-  # database types (third number on first line):
-  db_tp[db_tp_UNI    =1  ]="United-atom";
-  db_tp[db_tp_UNI_NT =100]="United-atom, NH3+ terminal";
-  db_tp[db_tp_UNI_CT =101]="United-atom, COO- terminal";
-  db_tp[db_tp_ALL    =2  ]="All-atom";
-  db_tp[db_tp_ALL_NT =200]="All-atom, NH3+ terminal";
-  db_tp[db_tp_ALL_CT =201]="All-atom, COO- terminal";
-  db_tp[db_tp_OPLS   =3  ]="OPLS United-atom";
-  db_tp[db_tp_OPLS_NT=300]="OPLS United-atom, NH3+ terminal";
-  db_tp[db_tp_OPLS_CT=301]="OPLS United-atom, COO- terminal";
-  db_suf[db_tp_UNI]=db_suf[db_tp_ALL]=db_suf[db_tp_OPLS]="";
-  db_suf[db_tp_UNI_NT]=db_suf[db_tp_ALL_NT]=db_suf[db_tp_OPLS_NT]="-N";
-  db_suf[db_tp_UNI_CT]=db_suf[db_tp_ALL_CT]=db_suf[db_tp_OPLS_CT]="-C";
-  db_pre[db_tp_UNI_NT]=db_pre[db_tp_ALL_NT]=db_pre[db_tp_OPLS_NT]=1;
-  # marker for z-matrix entries that should be ignored:
-  zz_NONE=-12345;
-  
-  # declare hydrogen database hydrogen addition types (Gromacs manual p 95)
-  # atom orders:
-  hotp[htp_o_IJK =0,0]=0; hotp[htp_o_IJK,1]=1; hotp[htp_o_IJK,2]=2;
-  hotp[htp_o_JIK =1,0]=0; hotp[htp_o_JIK,1]=1; hotp[htp_o_JIK,2]=-1;
-  hotp[htp_o_JKI =2,0]=0; hotp[htp_o_JKI,1]=-1; hotp[htp_o_JKI,2]=1;
-  hotp[htp_o_JIKL=3,0]=0; hotp[htp_o_JIKL,1]=1;
-  hotp[htp_o_JIKL,2]=-2; hotp[htp_o_JIKL,3]=-1;
-  hotp[htp_o_I   =4,0]=0;
-  hotp[htp_o_ACE =5,0]=0; hotp[htp_o_ACE,1]=-1; hotp[htp_o_ACE,2]=-2;
-  # the actual hydrogen types:
-  htp_n[htp_NONE   =-12345]=1;
-  htp_n[htp_PLANE  =1]=3; htp_o[htp_PLANE  ]=htp_o_JIK;
-  htp_n[htp_SINGLE =2]=3; htp_o[htp_SINGLE ]=htp_o_IJK;
-  htp_n[htp_2PLANE =3]=3; htp_o[htp_2PLANE ]=htp_o_IJK;
-  htp_n[htp_TTETRA =4]=3; htp_o[htp_TTETRA ]=htp_o_IJK;
-  htp_n[htp_1TETRA =5]=4; htp_o[htp_1TETRA ]=htp_o_JIKL;
-  htp_n[htp_2TETRA =6]=3; htp_o[htp_2TETRA ]=htp_o_JKI;
-  htp_n[htp_WATER  =7]=1; htp_o[htp_WATER  ]=htp_o_I;
-  htp_n[htp_CARBOX =8]=3; htp_o[htp_CARBOX ]=htp_o_IJK;
-  htp_n[htp_CARBOXH=9]=3; htp_o[htp_CARBOXH]=htp_o_IJK;
-  
-  # write dummy .tdb files:
-  print "[ null ]" > ffctdb;
-  print "[ null ]" > ffntdb;
-  
-  # write empty xlateat.dat:
-  print "0" > "xlateat.dat";
-}
-
-NR==1 {
-  printf("Start reading file %s\n", FILENAME);
-  printf("; from file %s\n", FILENAME) > ffrtp;
-  idbgen = $1+0;
-  irest  = $2+0;
-  itypf  = $3+0;
-  printf("; \n") > ffrtp;
-  printf("; reading database: %s\n", db_tp[itypf]) > ffrtp;
-  printf("; \n") > ffrtp;
-  if (debug) print "dbgen:", idbgen, irest, itypf, db_suf[itypf];
-  if (db_pre[itypf]) {
-    warning("terminus: will ignore all bonds to preceding residue in this file");
-  }
-  next;
-}
-
-NR==2 {
-  namdbf = $1;
-  if (debug) print "dbname:", namdbf;
-  next;
-}
-
-$1=="STOP" { # end of database file
-  printf("Finished reading file %s\n", FILENAME);
-  printf("; end of file %s\n", FILENAME) > ffrtp;
-  NR=0;
-  next;
-}
-
-$1=="DONE" {
-  if (nat==0) fatal_error("no atoms for residue " resnm);
-  if (nM) bM=1;
-  # fix some exceptions:
-  swap_first=0;
-  kill_bond=0;
-  if (resnm=="ACE" || resnm=="HOH") {
-    # in 'ACE', HH31 comes before CH3, then HH32 and HH33 follow.
-    # we need to change this to CH3, HH31-3.
-    # in 'HOH', H1 comes before O. we need O, H1-2
-    warning("EXCEPTION: swapping atoms "igraph[0]" and "igraph[1]" in residue "resnm);
-    swap_first=1;
-    # also, the bond to 'preceding' residue must go:
-    warning("EXCEPTION: ignoring bond from "bonds[0,1]" to preceding residue in residue "resnm);
-    kill_bond=1;
-  }
-  if (db_pre[itypf]) { # do we have no preceding residue (e.g. N-ter does not)
-    kill_bond=1;
-  }
-  if (swap_first) {
-    if (debug) print("SWAP FIRST");
-    swap_atoms(0, 1);
-  }
-  if (kill_bond) {
-    if (debug) print("KILL BOND");
-    bonds[0,0]=-1;bonds[0,1]=-1;
-    zz[0,0]=zz[0,1]=zz[0,2]=zz_NONE;
-    zz[1,1]=zz[1,2]=zz_NONE;
-    zz[2,2]=zz_NONE;
-  }
-  # write rtp
-  printf("[ %s ]\n", resnmt) > ffrtp;
-  printf(" [ atoms ]\n") > ffrtp;
-  printf(";%4s %5s %8s %5s ; %s\n", "name", "type", "charge", "cg", "qtot") > ffrtp;
-  cg=0;
-  qt=0;
-  for(i=0; i<nat; i++) {
-    qt+=chg[i];
-    printf("%5s %5s %8.3f %5d ; %g\n", igraph[i],isymbl[i], chg[i],cg++, qt) > ffrtp;
-  }
-
-  # write hdb
-  nha=0;
-  for(i=0; i<nat; i++) {
-    if (is_hydrogen(i)) {
-      hi[nha]=i-1;
-      nhh[nha]=0;
-      while (is_hydrogen(i) && i<nat) {
-       i++;
-       nhh[nha]++;
-      }
-      nha++;
-    }
-  }
-  printf("%s\t%d\n", resnmt, nha) > ffhdb;
-  for(i=0; i<nha; i++) {
-    if (nhh[i]==3) { htp=htp_TTETRA; # three must be tetraeder
-    } else if (theta[hi[i]+1]==109.5 ||
-              theta[hi[i]+1]==109.47 ) { # tetraedrical or OH
-      if (nhh[i]==2) { 
-       if (r[hi[i]+1]==1.01) htp=htp_TTETRA; # -NH2: (-NH3+ after deprotonation)
-       else htp=htp_2TETRA; # C-CH2-C
-      } else if (nhh[i]==1) { # either (tert)C-H or OH
-       if (r[hi[i]+1]==0.96) htp=htp_SINGLE; # OH
-       else htp=htp_1TETRA; # (tert)C-H
-      }
-    } else if (theta[hi[i]+1]==119.8 || # backbone N-H / arg N-H2
-              theta[hi[i]+1]==118.5 || # arginine N-H
-              ( theta[hi[i]+1]>=120.0 &&
-                theta[hi[i]+1]<=126.0 ) ) { # his/trp N-H's
-      if (nhh[i]==1) htp=htp_PLANE;
-      else if (nhh[i]==2) htp=htp_2PLANE;
-    } else if (theta[hi[i]+1]==109.47 || # OH
-              theta[hi[i]+1]==118.5  || 
-              theta[hi[i]+1]==127.0  || # nucl ac.
-              theta[hi[i]+1]==117.7  || # nucl ac.
-              theta[hi[i]+1]==117.36 || # nucl ac.
-              theta[hi[i]+1]==116.77 || # nucl ac.
-              theta[hi[i]+1]==114.97 || # nucl ac.
-              theta[hi[i]+1]==107.0  || # nucl ac.
-              theta[hi[i]+1]==113.0  || 
-              theta[hi[i]+1]== 96.0 ) { # backbone N-H
-      htp=htp_SINGLE;
-    } else if (theta[hi[i]+1]==101.43) {
-      htp=htp_WATER;
-    } else if (theta[hi[i]+1]== 60.0) { # PRO-N (-NH2-)
-      htp=htp_2TETRA;
-    } else
-      htp=htp_NONE;
-    if (debug) printf("i:%d hi:%d(%s) nhh:%d htp:%d htpn:%d theta:%g r:%g\n", 
-                     i, hi[i], igraph[hi[i]], nhh[i], htp, htp_n[htp], 
-                     theta[hi[i]+1], r[hi[i]+1]);
-    printf("\t%d\t%d", nhh[i], htp) > ffhdb;
-    # more exceptions:
-    if (resnm=="ACE" && htp==htp_TTETRA)
-      htpo=htp_o_ACE;
-    else
-      htpo=htp_o[htp];
-    for(j=0; j<htp_n[htp]; j++) {
-      k=hotp[htpo,j];
-      if (debug) printf("j:%d htp:%d htp_o:%d k:%d",
-                       j, htp, htpo, k);
-      if (k==0) # atom 'i': bonded atom
-       l = igraph[hi[i]];
-      else if (k<0) { # atoms 'ijk': reference atoms upstream 
-       l = "";
-        # search other non-hydrogen z-matrix entries for 'this' atom number:
-       for(jj=0; jj<3 && k<0; jj++)
-         for(ii=hi[i]+1; ii<nat && k<0; ii++) {
-           if (debug) printf("[ii:%d H:%d jj:%d zz:%d]", 
-                             ii, is_hydrogen(ii), jj, zz[ii,jj]);
-           if (!is_hydrogen(ii) && zz[ii,jj]!=zz_NONE && zz[ii,jj]==hi[i]) {
-             if (debug) printf(":%s", igraph[ii]);
-             k++; # k<0, we count up to zero
-           }
-         }
-       if (k==0)
-         l = igraph[ii-1];
-       else {
-         if (nl) { # finally, check 'loops':
-           if (debug) printf(" nl:%d", nl);
-           for(ii=0; ii<nl; ii++)
-             for(jj=0; jj<2; jj++) {
-               if (debug) printf(" %s", loops[ii,jj]);
-               if (loops[ii,jj]==igraph[hi[i]])
-                 l = loops[ii,1-jj];
-             }
-           if (debug) printf("\n");
-         }
-         if (l=="")
-           fatal_error("no bonded atom found for atom "igraph[hi[i]]" ("hi[i]+1") in residue "resnmt);
-       }
-      } else { # atoms 'ijk': reference atoms downstream (take from z-matrix)
-       if (zz[hi[i],k-1]<0) # atom in previous residue, use 'allM':
-         l = "-"allM[nM+zz[hi[i],k-1]];
-       else # atom in this residue:
-         l = igraph[zz[hi[i],k-1]];
-      }
-      if (debug) printf(" l:%s\n",l);
-      printf("\t%s", l) > ffhdb;
-    }
-    printf("\n") > ffhdb;
-  }
-  # done hdb
-
-  if (nat>1) { # bonds etc. do not make sense for a single atom:
-  
-    if (nb==0) fatal_error("no bonds for residue " resnmt);
-    printf(" [ bonds ]\n") > ffrtp;
-    printf(";%4s %5s\n", "ai", "aj") > ffrtp;
-    ignb=0;
-    for(i=0; i<nb; i++) {
-      if (bonds[i,0]<0 && bonds[i,1]<0)
-       ignb++;
-      else {
-       if (bonds[i,0]=="") bonds[i,0]="-"allM[nM-1];
-       printf("%5s %5s\n", bonds[i,0], bonds[i,1]) > ffrtp;
-      }
-    }
-    nb-=ignb;
-    if (np>0) {
-      bFirstPdih=1;
-      for(i=0; i<np; i++) {
-        # expand 'negative' atom id's:
-       for(j=0; j<4; j++) {
-         atp = pdihsatp[i,j]+0;
-         if (atp<0) {
-           # fix atom name:
-           pdihs[i,j] = "-"allM[nM+atp];
-           # fix atom type:
-           pdihsatp[i,j] = allMtp[nM+atp];
-         }
-       }
-        # find number of pre-defined 4-atom based dihedral defines, if zero 
-        # we use implicit (2-atom based) dihedrals (which need not be listed):
-       n = find_dih(pdihsatp[i,0],pdihsatp[i,1],pdihsatp[i,2],pdihsatp[i,3], 
-                    nptps, pdihtps, null);
-       for(k=0; k<n || (n==0 && k==0); k++)
-         if ( n ) {
-           if (bFirstPdih) {
-             bFirstPdih=0;
-             printf(" [ dihedrals ]\n") > ffrtp;
-             printf(";%4s %5s %5s %5s\n", "ai", "aj", "ak", "al") > ffrtp;
-           }
-           for(j=0; j<4; j++)
-             printf("%5s ", pdihs[i,j]) > ffrtp;
-           printf("    ad") > ffrtp;
-           for(j=0; j<4; j++)
-             printf("_%2s", fill_with_underscores(pdihsatp[i,j],2) ) > ffrtp;
-           if ( n>0 ) printf("_%d", k+1) > ffrtp;
-           printf("\n") > ffrtp;
-         }
-      }
-    }
-    if (ni) {
-      printf(" [ impropers ]\n") > ffrtp;
-      printf(";%4s %5s %5s %5s\n", "ai", "aj", "ak", "al") > ffrtp;
-      for(i=0; i<ni; i++) {
-       for(j=0; j<4; j++) {
-         if (idihs[i,j]=="-M") idihs[i,j]="-"allM[nM-1];
-         if (idihs[i,j]=="+M") idihs[i,j]="+"allM[0];
-         atps[j] = anm2atp(idihs[i,j], nat, igraph, isymbl);
-         printf("%5s ", idihs[i,j]) > ffrtp;
-       }
-       if (debug) {
-         printf("%s %s %s %s ", atps[0], atps[1], atps[2], atps[3]);
-         printf("%s %s %s %s ", idihs[i,0], idihs[i,1], idihs[i,2], idihs[i,3]);
-       }
-       n = find_dih(atps[0], atps[1], atps[2], atps[3], nitps, idihtps, fdihs);
-       if (debug) printf("\n");
-       if (n==1) {
-         printf("    ai") > ffrtp;
-         for(j=0; j<4; j++)
-           printf("_%2s", fill_with_underscores(fdihs[0,j],2) ) > ffrtp;
-       } else
-         warning((n?"multiple ("n")":"no")" idih definition for "atps[0]" "atps[1]" "atps[2]" "atps[3]);
-       printf("\n") > ffrtp;
-       
-      }
-    }
-  }
-  printf("; end residue %s: %d atoms, %d bonds, %d pdihs, %d idihs\n", 
-        resnmt, nat, nb, np, ni) > ffrtp;
-  printf("\n") > ffrtp;
-  
-  # clean up
-  for(i in xlate) delete xlate[i];
-  
-  if (debug) print "done.";
-  next_type(tp_RES_TIT);
-  next;
-}
-
-type==tp_RES_TIT { # title
-  # initialize per-residue variables
-  nat=0;
-  nb=0;
-  nl=0;
-  ni=0;
-  np=0;
-  # read this section
-  title = $0; 
-  gsub("   *", " ", title);
-  if (debug) print "title:", title;
-  printf("; %s\n", title) > ffrtp;
-  printf("; \n") > ffrtp;
-  next_type(-1);
-  next;
-}
-
-type==tp_OUT_FIL { # file
-  file = $0;
-  if (debug) print "file:", file;
-  next_type(-1);
-  next;
-}
-
-type==tp_RES_NAM { # residue name
-  resnm = $1;
-  intx  = $2;
-  kform = $3+0;
-  if (debug) print "residue:", nres, resnm, intx, kform;
-  if (length(resnm)>3) {
-    warning("Residue name '"resnm"' more than three characters long");
-  }
-  # add possible suffix for terminus:
-  resnmt=resnm db_suf[itypf];
-  
-  printf("Residue: %d %s (%s)\n", nres, title, resnmt);
-  
-  resnms[nres]=resnm;
-  nres++;
-  
-  next_type(-1);
-  next;
-}
-
-type==tp_GEO_TYP { # geometry
-  ifixc  = $1;
-  iomit  = $2;
-  isymdu = $3;
-  ipos   = $4;
-  if (debug) print "geometry:", ifixc, iomit, isymdu, ipos;
-  next_type(-1);
-  next;
-}
-
-type==tp_LOO_CUT { # cut
-  cut=$1+0;
-  if (debug) print "cut:", cut;
-  next_type(-1);
-  next;
-}
-
-type==tp_ATOMS && NF==0 { # end of atoms
-  ndum=0;
-  next_type(-1);
-  next;
-}
-
-type==tp_ATOMS { # atoms
-  if ($2=="DUMM") {
-    ndum++;
-  } else {
-    i         =  $1-ndum-1;
-    igraph[i] =  $2;
-    isymbl[i] =  $3;
-    itree     =  $4;
-    zz[i,0]   =  $5-ndum-1;
-    zz[i,1]   =  $6-ndum-1;
-    zz[i,2]   =  $7-ndum-1;
-    r[i]      =  $8+0;
-    theta[i]  =  $9+0;
-    phi       = $10+0;
-    chg[i]    = $11+0;
-    nat++;
-    # fix hydrogen atom numbering:
-    if (is_hydrogen(i) && length(igraph[i])>length_heavy) {
-      hnum++;
-      igr=substr(igraph[i], 1, length_heavy) hnum;
-      if (igr!=igraph[i]) {
-       # store translated atom names:
-       if (debug) print "Xlate:", i, "'"igraph[i]"'", "'"isymbl[i]"'", 
-                    length_heavy, "'"igr"'";
-       xlate[igraph[i]]=igr;
-       igraph[i]=igr;
-      }
-    } else {
-      length_heavy=length(igraph[i])
-      hnum=0;
-    }
-    if (itree=="M" && !bM) {
-      allM[nM]   = igraph[i];
-      allMtp[nM] = isymbl[i];
-      nM++;
-    }
-    # add bonds
-    bonds[nb, 0]=igraph[zz[i,0]];
-    bonds[nb, 1]=igraph[i];
-    nb++;
-    # angles are automatic
-    # add proper dihs
-    pdihs[np, 0]=igraph[i];
-    pdihs[np, 1]=igraph[zz[i,0]];
-    pdihs[np, 2]=igraph[zz[i,1]];
-    pdihs[np, 3]=igraph[zz[i,2]];
-    pdihsatp[np, 0]=isymbl[i];
-    pdihsatp[np, 1]= zz[i,0]<0 ? zz[i,0] : isymbl[zz[i,0]];
-    pdihsatp[np, 2]= zz[i,1]<0 ? zz[i,1] : isymbl[zz[i,1]];
-    pdihsatp[np, 3]= zz[i,2]<0 ? zz[i,2] : isymbl[zz[i,2]];
-    np++;
-    if (debug) printf("atom: %d %s %s %s %d %d %d %g %g %g %g\n", 
-                     i+1, igraph[i], isymbl[i], itree, 
-                     zz[i,0], zz[i,1], zz[i,2], r[i], theta[i], phi, chg[i]);
-  }
-}
-
-type==tp_EXTRAS { # extra's
-  if (debug) print "extra:", $0;
-  for(i=tp_CHARGE; i<=tp_IMP_DIH; i++) {
-    if (toupper(section[i]) == $1) {
-      next_type(i);
-      next;
-    }
-  }
-}
-
-type>tp_EXTRAS && NF==0 { # end of an extra's section
-  if (iq && iq!=nat)
-    warning("ERROR: # charges ("iq") and # atoms ("nat") differ");
-  iq=0;
-  next_type(tp_EXTRAS);
-  next;
-}
-
-type==tp_CHARGE { # charge
-  for(i=1; i<=NF; i++) {
-    chg[iq] = $i;
-    iq++;
-  }
-  if (debug) print "charges:", iq;
-}
-
-type==tp_LOOP { # loop
-  for(i=1; i<=2; i++) bonds[nb, i-1] = xlate[$i] ? xlate[$i] : $i;
-  nb++;
-  for(i=1; i<=2; i++) loops[nl, i-1] = xlate[$i] ? xlate[$i] : $i;
-  nl++;
-}
-
-type==tp_IMP_DIH { # improper
-  for(i=1; i<=4; i++) idihs[ni, i-1] = xlate[$i] ? xlate[$i] : $i;
-  ni++;
-}
-
-END {
-  if (xxit) exit;
-  printf("Found %d residues\n", nres);
-  print_warn();
-  printf("; Found %d residues\n", nres) > ffrtp;
-}
-
-#last line
diff --git a/src/contrib/scripts/comment-pairs b/src/contrib/scripts/comment-pairs
deleted file mode 100755 (executable)
index 3b383cc..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/usr/bin/awk -f
-
-BEGIN   { pre=""; }
-/^\[/   { pre=""; }
-/pairs/ { pre=";"; }
-
-{ print pre$0; }
-
-#last line
diff --git a/src/contrib/scripts/ffamber-c.tdb b/src/contrib/scripts/ffamber-c.tdb
deleted file mode 100644 (file)
index 464d932..0000000
+++ /dev/null
@@ -1 +0,0 @@
-[ null ]
diff --git a/src/contrib/scripts/ffamber-n.tdb b/src/contrib/scripts/ffamber-n.tdb
deleted file mode 100644 (file)
index 464d932..0000000
+++ /dev/null
@@ -1 +0,0 @@
-[ null ]
diff --git a/src/contrib/scripts/ffamber.atp b/src/contrib/scripts/ffamber.atp
deleted file mode 100644 (file)
index c09ef51..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-  BR       79.9 ; bromine
-  C       12.01 ; sp2 C carbonyl group 
-  CA      12.01 ; sp2 C pure aromatic (benzene)
-  CB      12.01 ; sp2 aromatic C, 5&6 membered ring junction
-  CC      12.01 ; sp2 aromatic C, 5 memb. ring HIS
-  CK      12.01 ; sp2 C 5 memb.ring in purines
-  CM      12.01 ; sp2 C  pyrimidines in pos. 5 & 6
-  CN      12.01 ; sp2 C aromatic 5&6 memb.ring junct.(TRP)
-  CQ      12.01 ; sp2 C in 5 mem.ring of purines between 2 N
-  CR      12.01 ; sp2 arom as CQ but in HIS
-  CT      12.01 ; sp3 aliphatic C
-  CV      12.01 ; sp2 arom. 5 memb.ring w/1 N and 1 H (HIS)
-  CW      12.01 ; sp2 arom. 5 memb.ring w/1 N-H and 1 H (HIS)
-  C*      12.01 ; sp2 arom. 5 memb.ring w/1 subst. (TRP)
-  C0      40.08 ; calcium
-  F          19 ; fluorine
-  H       1.008 ; H bonded to nitrogen atoms
-  HC      1.008 ; H aliph. bond. to C without electrwd.group
-  H1      1.008 ; H aliph. bond. to C with 1 electrwd. group
-  H2      1.008 ; H aliph. bond. to C with 2 electrwd.groups
-  H3      1.008 ; H aliph. bond. to C with 3 eletrwd.groups
-  HA      1.008 ; H arom. bond. to C without elctrwd. groups
-  H4      1.008 ; H arom. bond. to C with 1 electrwd. group
-  H5      1.008 ; H arom. bond. to C with 2 electrwd. groups
-  HO      1.008 ; hydroxyl group
-  HS      1.008 ; hydrogen bonded to sulphur
-  HW      1.008 ; H in TIP3P water
-  HP      1.008 ; H bonded to C next to positively charged gr
-  I       126.9 ; iodine
-  IM      35.45 ; assumed to be Cl-
-  IP      22.99 ; assumed to be Na+
-  IB        131 ; 'big ion w/ waters' for vacuum (Na+, 6H2O)
-  MG     24.305 ; magnesium
-  N       14.01 ; sp2 nitrogen in amide groups
-  NA      14.01 ; sp2 N in 5 memb.ring w/H atom (HIS)
-  NB      14.01 ; sp2 N in 5 memb.ring w/LP (HIS,ADE,GUA)
-  NC      14.01 ; sp2 N in 6 memb.ring w/LP (ADE,GUA)
-  N2      14.01 ; sp2 N in amino groups
-  N3      14.01 ; sp3 N for charged amino groups (Lys, etc)
-  N*      14.01 ; sp2 N 
-  O          16 ; carbonyl group oxygen
-  OW         16 ; oxygen in TIP3P water
-  OH         16 ; oxygen in hydroxyl group
-  OS         16 ; ether and ester oxygen
-  O2         16 ; carboxyl and phosphate group oxygen
-  P       30.97 ; phosphate
-  S       32.06 ; sulphur in disulfide linkage
-  SH      32.06 ; sulphur in cystine
-  CU      63.55 ; copper
-  FE         55 ; iron
-  Li       6.94 ; lithium
-  K        39.1 ; potassium
-  Rb      85.47 ; rubidium
-  Cs     132.91 ; cesium
diff --git a/src/contrib/scripts/ffamber.hdb b/src/contrib/scripts/ffamber.hdb
deleted file mode 100644 (file)
index 0aaf4cc..0000000
+++ /dev/null
@@ -1,470 +0,0 @@
-ALA    3
-       1       1       N       -C      CA
-       1       5       CA      N       C       CB
-       3       4       CB      CA      N
-GLY    2
-       1       1       N       -C      CA
-       2       6       CA      C       N
-SER    4
-       1       1       N       -C      CA
-       1       5       CA      N       C       CB
-       2       6       CB      OG      CA
-       1       2       OG      CB      CA
-THR    5
-       1       1       N       -C      CA
-       1       5       CA      N       C       CB
-       1       5       CB      CA      OG1     CG2
-       3       4       CG2     CB      CA
-       1       2       OG1     CB      CA
-LEU    6
-       1       1       N       -C      CA
-       1       5       CA      N       C       CB
-       2       6       CB      CG      CA
-       1       5       CG      CB      CD2     CD1
-       3       4       CD1     CG      CB
-       3       4       CD2     CG      CB
-ILE    6
-       1       1       N       -C      CA
-       1       5       CA      N       C       CB
-       1       5       CB      CA      CG1     CG2
-       3       4       CG2     CB      CA
-       2       6       CG1     CD1     CB
-       3       4       CD1     CG1     CB
-VAL    5
-       1       1       N       -C      CA
-       1       5       CA      N       C       CB
-       1       5       CB      CA      CG2     CG1
-       3       4       CG1     CB      CA
-       3       4       CG2     CB      CA
-ASN    4
-       1       1       N       -C      CA
-       1       5       CA      N       C       CB
-       2       6       CB      CG      CA
-       2       3       ND2     CG      CB
-GLN    5
-       1       1       N       -C      CA
-       1       5       CA      N       C       CB
-       2       6       CB      CG      CA
-       2       6       CG      CD      CB
-       2       3       NE2     CD      CG
-ARG    8
-       1       1       N       -C      CA
-       1       5       CA      N       C       CB
-       2       6       CB      CG      CA
-       2       6       CG      CD      CB
-       2       6       CD      NE      CG
-       1       1       NE      CD      CZ
-       2       3       NH1     CZ      NE
-       2       3       NH2     CZ      NE
-HID    6
-       1       1       N       -C      CA
-       1       5       CA      N       C       CB
-       2       6       CB      CG      CA
-       1       1       ND1     CG      CE1
-       1       1       CE1     ND1     NE2
-       1       1       CD2     NE2     CG
-HIE    6
-       1       1       N       -C      CA
-       1       5       CA      N       C       CB
-       2       6       CB      CG      CA
-       1       1       CE1     ND1     NE2
-       1       1       NE2     CE1     CD2
-       1       1       CD2     NE2     CG
-HIP    7
-       1       1       N       -C      CA
-       1       5       CA      N       C       CB
-       2       6       CB      CG      CA
-       1       1       ND1     CG      CE1
-       1       1       CE1     ND1     NE2
-       1       1       NE2     CE1     CD2
-       1       1       CD2     NE2     CG
-TRP    9
-       1       1       N       -C      CA
-       1       5       CA      N       C       CB
-       2       6       CB      CG      CA
-       1       1       CD1     CG      NE1
-       1       1       NE1     CD1     CE2
-       1       1       CZ2     CE2     CH2
-       1       1       CH2     CZ2     CZ3
-       1       1       CZ3     CH2     CE3
-       1       1       CE3     CZ3     CD2
-PHE    8
-       1       1       N       -C      CA
-       1       5       CA      N       C       CB
-       2       6       CB      CG      CA
-       1       1       CD1     CG      CE1
-       1       1       CE1     CD1     CZ
-       1       1       CZ      CE1     CE2
-       1       1       CE2     CZ      CD2
-       1       1       CD2     CE2     CG
-TYR    8
-       1       1       N       -C      CA
-       1       5       CA      N       C       CB
-       2       6       CB      CG      CA
-       1       1       CD1     CG      CE1
-       1       1       CE1     CD1     CZ
-       1       2       OH      CZ      CE1
-       1       1       CE2     CZ      CD2
-       1       1       CD2     CE2     CG
-GLU    4
-       1       1       N       -C      CA
-       1       5       CA      N       C       CB
-       2       6       CB      CG      CA
-       2       6       CG      CD      CB
-ASP    3
-       1       1       N       -C      CA
-       1       5       CA      N       C       CB
-       2       6       CB      CG      CA
-LYS    7
-       1       1       N       -C      CA
-       1       5       CA      N       C       CB
-       2       6       CB      CG      CA
-       2       6       CG      CD      CB
-       2       6       CD      CE      CG
-       2       6       CE      NZ      CD
-       3       4       NZ      CE      CD
-LYN    7
-       1       1       N       -C      CA
-       1       5       CA      N       C       CB
-       2       6       CB      CG      CA
-       2       6       CG      CD      CB
-       2       6       CD      CE      CG
-       2       6       CE      NZ      CD
-       2       4       NZ      CE      CD
-PRO    4
-       2       6       CD      CG      N
-       2       6       CG      CB      CD
-       2       6       CB      CA      CG
-       1       5       CA      N       O       C
-CYS    4
-       1       1       N       -C      CA
-       1       5       CA      N       C       CB
-       2       6       CB      SG      CA
-       1       2       SG      CB      CA
-CYM    3
-       1       1       N       -C      CA
-       1       5       CA      N       C       CB
-       2       6       CB      SG      CA
-CYX    3
-       1       1       N       -C      CA
-       1       5       CA      N       C       CB
-       2       6       CB      SG      CA
-MET    5
-       1       1       N       -C      CA
-       1       5       CA      N       C       CB
-       2       6       CB      CG      CA
-       2       6       CG      SD      CB
-       3       4       CE      SD      CG
-ACE    1
-       3       4       CH3     C       O
-NME    2
-       1       1       N       -C      CH3
-       3       4       CH3     N       -C
-NHE    1
-       2       3       N       -C      -N
-HOH    1
-       2       7       O
-ASH    4
-       1       1       N       -C      CA
-       1       5       CA      N       C       CB
-       2       6       CB      CG      CA
-       1       2       OD2     CG      CB
-GLH    5
-       1       1       N       -C      CA
-       1       5       CA      N       C       CB
-       2       6       CB      CG      CA
-       2       6       CG      CD      CB
-       1       2       OE2     CD      CG
-CIP    0
-CIM    0
-ALA-C  3
-       1       1       N       -C      CA
-       1       5       CA      N       C       CB
-       3       4       CB      CA      N
-GLY-C  2
-       1       1       N       -C      CA
-       2       6       CA      C       N
-SER-C  4
-       1       1       N       -C      CA
-       1       5       CA      N       C       CB
-       2       6       CB      OG      CA
-       1       2       OG      CB      CA
-THR-C  5
-       1       1       N       -C      CA
-       1       5       CA      N       C       CB
-       1       5       CB      CA      OG1     CG2
-       3       4       CG2     CB      CA
-       1       2       OG1     CB      CA
-LEU-C  6
-       1       1       N       -C      CA
-       1       5       CA      N       C       CB
-       2       6       CB      CG      CA
-       1       5       CG      CB      CD2     CD1
-       3       4       CD1     CG      CB
-       3       4       CD2     CG      CB
-ILE-C  6
-       1       1       N       -C      CA
-       1       5       CA      N       C       CB
-       1       5       CB      CA      CG1     CG2
-       3       4       CG2     CB      CA
-       2       6       CG1     CD1     CB
-       3       4       CD1     CG1     CB
-VAL-C  5
-       1       1       N       -C      CA
-       1       5       CA      N       C       CB
-       1       5       CB      CA      CG2     CG1
-       3       4       CG1     CB      CA
-       3       4       CG2     CB      CA
-ASN-C  4
-       1       1       N       -C      CA
-       1       5       CA      N       C       CB
-       2       6       CB      CG      CA
-       2       3       ND2     CG      CB
-GLN-C  5
-       1       1       N       -C      CA
-       1       5       CA      N       C       CB
-       2       6       CB      CG      CA
-       2       6       CG      CD      CB
-       2       3       NE2     CD      CG
-ARG-C  8
-       1       1       N       -C      CA
-       1       5       CA      N       C       CB
-       2       6       CB      CG      CA
-       2       6       CG      CD      CB
-       2       6       CD      NE      CG
-       1       1       NE      CD      CZ
-       2       3       NH1     CZ      NE
-       2       3       NH2     CZ      NE
-HID-C  6
-       1       1       N       -C      CA
-       1       5       CA      N       C       CB
-       2       6       CB      CG      CA
-       1       1       ND1     CG      CE1
-       1       1       CE1     ND1     NE2
-       1       1       CD2     NE2     CG
-HIE-C  6
-       1       1       N       -C      CA
-       1       5       CA      N       C       CB
-       2       6       CB      CG      CA
-       1       1       CE1     ND1     NE2
-       1       1       NE2     CE1     CD2
-       1       1       CD2     NE2     CG
-HIP-C  7
-       1       1       N       -C      CA
-       1       5       CA      N       C       CB
-       2       6       CB      CG      CA
-       1       1       ND1     CG      CE1
-       1       1       CE1     ND1     NE2
-       1       1       NE2     CE1     CD2
-       1       1       CD2     NE2     CG
-TRP-C  9
-       1       1       N       -C      CA
-       1       5       CA      N       C       CB
-       2       6       CB      CG      CA
-       1       1       CD1     CG      NE1
-       1       1       NE1     CD1     CE2
-       1       1       CZ2     CE2     CH2
-       1       1       CH2     CZ2     CZ3
-       1       1       CZ3     CH2     CE3
-       1       1       CE3     CZ3     CD2
-PHE-C  8
-       1       1       N       -C      CA
-       1       5       CA      N       C       CB
-       2       6       CB      CG      CA
-       1       1       CD1     CG      CE1
-       1       1       CE1     CD1     CZ
-       1       1       CZ      CE1     CE2
-       1       1       CE2     CZ      CD2
-       1       1       CD2     CE2     CG
-TYR-C  8
-       1       1       N       -C      CA
-       1       5       CA      N       C       CB
-       2       6       CB      CG      CA
-       1       1       CD1     CG      CE1
-       1       1       CE1     CD1     CZ
-       1       2       OH      CZ      CE1
-       1       1       CE2     CZ      CD2
-       1       1       CD2     CE2     CG
-GLU-C  4
-       1       1       N       -C      CA
-       1       5       CA      N       C       CB
-       2       6       CB      CG      CA
-       2       6       CG      CD      CB
-ASP-C  3
-       1       1       N       -C      CA
-       1       5       CA      N       C       CB
-       2       6       CB      CG      CA
-LYS-C  7
-       1       1       N       -C      CA
-       1       5       CA      N       C       CB
-       2       6       CB      CG      CA
-       2       6       CG      CD      CB
-       2       6       CD      CE      CG
-       2       6       CE      NZ      CD
-       3       4       NZ      CE      CD
-PRO-C  4
-       2       6       CD      CG      N
-       2       6       CG      CB      CD
-       2       6       CB      CA      CG
-       1       5       CA      N       O       C
-CYS-C  4
-       1       1       N       -C      CA
-       1       5       CA      N       C       CB
-       2       6       CB      SG      CA
-       1       2       SG      CB      CA
-CYX-C  3
-       1       1       N       -C      CA
-       1       5       CA      N       C       CB
-       2       6       CB      SG      CA
-MET-C  5
-       1       1       N       -C      CA
-       1       5       CA      N       C       CB
-       2       6       CB      CG      CA
-       2       6       CG      SD      CB
-       3       4       CE      SD      CG
-ALA-N  3
-       3       4       N       -       -
-       1       5       CA      N       C       CB
-       3       4       CB      CA      N
-GLY-N  2
-       3       4       N       -       -
-       2       6       CA      C       N
-SER-N  4
-       3       4       N       -       -
-       1       5       CA      N       C       CB
-       2       6       CB      OG      CA
-       1       2       OG      CB      CA
-THR-N  5
-       3       4       N       -       -
-       1       5       CA      N       C       CB
-       1       5       CB      CA      OG1     CG2
-       3       4       CG2     CB      CA
-       1       2       OG1     CB      CA
-LEU-N  6
-       3       4       N       -       -
-       1       5       CA      N       C       CB
-       2       6       CB      CG      CA
-       1       5       CG      CB      CD2     CD1
-       3       4       CD1     CG      CB
-       3       4       CD2     CG      CB
-ILE-N  6
-       3       4       N       -       -
-       1       5       CA      N       C       CB
-       1       5       CB      CA      CG1     CG2
-       3       4       CG2     CB      CA
-       2       6       CG1     CD1     CB
-       3       4       CD1     CG1     CB
-VAL-N  5
-       3       4       N       -       -
-       1       5       CA      N       C       CB
-       1       5       CB      CA      CG2     CG1
-       3       4       CG1     CB      CA
-       3       4       CG2     CB      CA
-ASN-N  4
-       3       4       N       -       -
-       1       5       CA      N       C       CB
-       2       6       CB      CG      CA
-       2       3       ND2     CG      CB
-GLN-N  5
-       3       4       N       -       -
-       1       5       CA      N       C       CB
-       2       6       CB      CG      CA
-       2       6       CG      CD      CB
-       2       3       NE2     CD      CG
-ARG-N  8
-       3       4       N       -       -
-       1       5       CA      N       C       CB
-       2       6       CB      CG      CA
-       2       6       CG      CD      CB
-       2       6       CD      NE      CG
-       1       1       NE      CD      CZ
-       2       3       NH1     CZ      NE
-       2       3       NH2     CZ      NE
-HID-N  6
-       3       4       N       -       -
-       1       5       CA      N       C       CB
-       2       6       CB      CG      CA
-       1       1       ND1     CG      CE1
-       1       1       CE1     ND1     NE2
-       1       1       CD2     NE2     CG
-HIE-N  6
-       3       4       N       -       -
-       1       5       CA      N       C       CB
-       2       6       CB      CG      CA
-       1       1       CE1     ND1     NE2
-       1       1       NE2     CE1     CD2
-       1       1       CD2     NE2     CG
-HIP-N  7
-       3       4       N       -       -
-       1       5       CA      N       C       CB
-       2       6       CB      CG      CA
-       1       1       ND1     CG      CE1
-       1       1       CE1     ND1     NE2
-       1       1       NE2     CE1     CD2
-       1       1       CD2     NE2     CG
-TRP-N  9
-       3       4       N       -       -
-       1       5       CA      N       C       CB
-       2       6       CB      CG      CA
-       1       1       CD1     CG      NE1
-       1       1       NE1     CD1     CE2
-       1       1       CZ2     CE2     CH2
-       1       1       CH2     CZ2     CZ3
-       1       1       CZ3     CH2     CE3
-       1       1       CE3     CZ3     CD2
-PHE-N  8
-       3       4       N       -       -
-       1       5       CA      N       C       CB
-       2       6       CB      CG      CA
-       1       1       CD1     CG      CE1
-       1       1       CE1     CD1     CZ
-       1       1       CZ      CE1     CE2
-       1       1       CE2     CZ      CD2
-       1       1       CD2     CE2     CG
-TYR-N  8
-       3       4       N       -       -
-       1       5       CA      N       C       CB
-       2       6       CB      CG      CA
-       1       1       CD1     CG      CE1
-       1       1       CE1     CD1     CZ
-       1       2       OH      CZ      CE1
-       1       1       CE2     CZ      CD2
-       1       1       CD2     CE2     CG
-GLU-N  4
-       3       4       N       -       -
-       1       5       CA      N       C       CB
-       2       6       CB      CG      CA
-       2       6       CG      CD      CB
-ASP-N  3
-       3       4       N       -       -
-       1       5       CA      N       C       CB
-       2       6       CB      CG      CA
-LYS-N  7
-       3       4       N       -       -
-       1       5       CA      N       C       CB
-       2       6       CB      CG      CA
-       2       6       CG      CD      CB
-       2       6       CD      CE      CG
-       2       6       CE      NZ      CD
-       3       4       NZ      CE      CD
-PRO-N  5
-       2       6       N       CD      -
-       2       6       CD      CG      N
-       2       6       CG      CB      CD
-       2       6       CB      CA      CG
-       1       5       CA      N       O       C
-CYS-N  4
-       3       4       N       -       -
-       1       5       CA      N       C       CB
-       2       6       CB      SG      CA
-       1       2       SG      CB      CA
-CYX-N  3
-       3       4       N       -       -
-       1       5       CA      N       C       CB
-       2       6       CB      SG      CA
-MET-N  5
-       3       4       N       -       -
-       1       5       CA      N       C       CB
-       2       6       CB      CG      CA
-       2       6       CG      SD      CB
-       3       4       CE      SD      CG
diff --git a/src/contrib/scripts/ffamber.itp b/src/contrib/scripts/ffamber.itp
deleted file mode 100644 (file)
index a1ebc06..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#define _FF_AMBER
-; Amber forcefield converted to Gromacs
-; from file /usr/slocal/amber6/dat/parm98.dat
-; 
-; PARM94 for DNA, RNA and proteins with TIP3P Water. USE SCEE=1.2 in energy progs
-
-[ defaults ]
-;   nbfunc  comb-rule  gen-pairs    fudgeLJ    fudgeQQ
-         1          2         no          1          1
-
-#include "ffambernb.itp"
-#include "ffamberbon.itp"
diff --git a/src/contrib/scripts/ffamber.rtp b/src/contrib/scripts/ffamber.rtp
deleted file mode 100644 (file)
index fc05565..0000000
+++ /dev/null
@@ -1,3881 +0,0 @@
-; Amber forcefield converted to Gromacs
-; 
-; from file /usr/slocal/amber6/dat/all_amino94.in
-; 
-; reading database: All-atom
-; 
-; ALANINE 
-; 
-[ ALA ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N     N   -0.416     0 ; -0.4157
-    H     H    0.272     1 ; -0.1438
-   CA    CT    0.034     2 ; -0.1101
-   HA    H1    0.082     3 ; -0.0278
-   CB    CT   -0.182     4 ; -0.2103
-  HB1    HC    0.060     5 ; -0.15
-  HB2    HC    0.060     6 ; -0.0897
-  HB3    HC    0.060     7 ; -0.0294
-    C     C    0.597     8 ; 0.5679
-    O     O   -0.568     9 ; 0
- [ bonds ]
-;  ai    aj
-   -C     N
-    N     H
-    N    CA
-   CA    HA
-   CA    CB
-   CB   HB1
-   CB   HB2
-   CB   HB3
-   CA     C
-    C     O
- [ dihedrals ]
-;  ai    aj    ak    al
-   CB    CA     N    -C     ad_CT_CT_N__C__1
-   CB    CA     N    -C     ad_CT_CT_N__C__2
-   CB    CA     N    -C     ad_CT_CT_N__C__3
- [ impropers ]
-;  ai    aj    ak    al
-   -C    CA     N     H     ai_X__X__N__H_
-   CA    +N     C     O     ai_X__X__C__O_
-; end residue ALA: 10 atoms, 10 bonds, 10 pdihs, 2 idihs
-
-; GLYCINE 
-; 
-[ GLY ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N     N   -0.416     0 ; -0.4157
-    H     H    0.272     1 ; -0.1438
-   CA    CT   -0.025     2 ; -0.169
-  HA1    H1    0.070     3 ; -0.0992
-  HA2    H1    0.070     4 ; -0.0294
-    C     C    0.597     5 ; 0.5679
-    O     O   -0.568     6 ; 1.11022e-16
- [ bonds ]
-;  ai    aj
-   -C     N
-    N     H
-    N    CA
-   CA   HA1
-   CA   HA2
-   CA     C
-    C     O
- [ impropers ]
-;  ai    aj    ak    al
-   -C    CA     N     H     ai_X__X__N__H_
-   CA    +N     C     O     ai_X__X__C__O_
-; end residue GLY: 7 atoms, 7 bonds, 7 pdihs, 2 idihs
-
-; SERINE 
-; 
-[ SER ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N     N   -0.416     0 ; -0.4157
-    H     H    0.272     1 ; -0.1438
-   CA    CT   -0.025     2 ; -0.1687
-   HA    H1    0.084     3 ; -0.0844
-   CB    CT    0.212     4 ; 0.1273
-  HB1    H1    0.035     5 ; 0.1625
-  HB2    H1    0.035     6 ; 0.1977
-   OG    OH   -0.655     7 ; -0.4569
-   HG    HO    0.427     8 ; -0.0294
-    C     C    0.597     9 ; 0.5679
-    O     O   -0.568    10 ; 1.11022e-16
- [ bonds ]
-;  ai    aj
-   -C     N
-    N     H
-    N    CA
-   CA    HA
-   CA    CB
-   CB   HB1
-   CB   HB2
-   CB    OG
-   OG    HG
-   CA     C
-    C     O
- [ dihedrals ]
-;  ai    aj    ak    al
-   CB    CA     N    -C     ad_CT_CT_N__C__1
-   CB    CA     N    -C     ad_CT_CT_N__C__2
-   CB    CA     N    -C     ad_CT_CT_N__C__3
- [ impropers ]
-;  ai    aj    ak    al
-   -C    CA     N     H     ai_X__X__N__H_
-   CA    +N     C     O     ai_X__X__C__O_
-; end residue SER: 11 atoms, 11 bonds, 11 pdihs, 2 idihs
-
-; THREONINE 
-; 
-[ THR ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N     N   -0.416     0 ; -0.4157
-    H     H    0.272     1 ; -0.1438
-   CA    CT   -0.039     2 ; -0.1827
-   HA    H1    0.101     3 ; -0.082
-   CB    CT    0.365     4 ; 0.2834
-   HB    H1    0.004     5 ; 0.2877
-  CG2    CT   -0.244     6 ; 0.0439
- HG21    HC    0.064     7 ; 0.1081
- HG22    HC    0.064     8 ; 0.1723
- HG23    HC    0.064     9 ; 0.2365
-  OG1    OH   -0.676    10 ; -0.4396
-  HG1    HO    0.410    11 ; -0.0294
-    C     C    0.597    12 ; 0.5679
-    O     O   -0.568    13 ; 1.11022e-16
- [ bonds ]
-;  ai    aj
-   -C     N
-    N     H
-    N    CA
-   CA    HA
-   CA    CB
-   CB    HB
-   CB   CG2
-  CG2  HG21
-  CG2  HG22
-  CG2  HG23
-   CB   OG1
-  OG1   HG1
-   CA     C
-    C     O
- [ dihedrals ]
-;  ai    aj    ak    al
-   CB    CA     N    -C     ad_CT_CT_N__C__1
-   CB    CA     N    -C     ad_CT_CT_N__C__2
-   CB    CA     N    -C     ad_CT_CT_N__C__3
- [ impropers ]
-;  ai    aj    ak    al
-   -C    CA     N     H     ai_X__X__N__H_
-   CA    +N     C     O     ai_X__X__C__O_
-; end residue THR: 14 atoms, 14 bonds, 14 pdihs, 2 idihs
-
-; LEUCINE 
-; 
-[ LEU ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N     N   -0.416     0 ; -0.4157
-    H     H    0.272     1 ; -0.1438
-   CA    CT   -0.052     2 ; -0.1956
-   HA    H1    0.092     3 ; -0.1034
-   CB    CT   -0.110     4 ; -0.2136
-  HB1    HC    0.046     5 ; -0.1679
-  HB2    HC    0.046     6 ; -0.1222
-   CG    CT    0.353     7 ; 0.2309
-   HG    HC   -0.036     8 ; 0.1948
-  CD1    CT   -0.412     9 ; -0.2173
- HD11    HC    0.100    10 ; -0.1173
- HD12    HC    0.100    11 ; -0.0173
- HD13    HC    0.100    12 ; 0.0827
-  CD2    CT   -0.412    13 ; -0.3294
- HD21    HC    0.100    14 ; -0.2294
- HD22    HC    0.100    15 ; -0.1294
- HD23    HC    0.100    16 ; -0.0294
-    C     C    0.597    17 ; 0.5679
-    O     O   -0.568    18 ; 0
- [ bonds ]
-;  ai    aj
-   -C     N
-    N     H
-    N    CA
-   CA    HA
-   CA    CB
-   CB   HB1
-   CB   HB2
-   CB    CG
-   CG    HG
-   CG   CD1
-  CD1  HD11
-  CD1  HD12
-  CD1  HD13
-   CG   CD2
-  CD2  HD21
-  CD2  HD22
-  CD2  HD23
-   CA     C
-    C     O
- [ dihedrals ]
-;  ai    aj    ak    al
-   CB    CA     N    -C     ad_CT_CT_N__C__1
-   CB    CA     N    -C     ad_CT_CT_N__C__2
-   CB    CA     N    -C     ad_CT_CT_N__C__3
- [ impropers ]
-;  ai    aj    ak    al
-   -C    CA     N     H     ai_X__X__N__H_
-   CA    +N     C     O     ai_X__X__C__O_
-; end residue LEU: 19 atoms, 19 bonds, 19 pdihs, 2 idihs
-
-; ISOLEUCINE 
-; 
-[ ILE ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N     N   -0.416     0 ; -0.4157
-    H     H    0.272     1 ; -0.1438
-   CA    CT   -0.060     2 ; -0.2035
-   HA    H1    0.087     3 ; -0.1166
-   CB    CT    0.130     4 ; 0.0137
-   HB    HC    0.019     5 ; 0.0324
-  CG2    CT   -0.320     6 ; -0.288
- HG21    HC    0.088     7 ; -0.1998
- HG22    HC    0.088     8 ; -0.1116
- HG23    HC    0.088     9 ; -0.0234
-  CG1    CT   -0.043    10 ; -0.0664
- HG11    HC    0.024    11 ; -0.0428
- HG12    HC    0.024    12 ; -0.0192
-  CD1    CT   -0.066    13 ; -0.0852
- HD11    HC    0.019    14 ; -0.0666
- HD12    HC    0.019    15 ; -0.048
- HD13    HC    0.019    16 ; -0.0294
-    C     C    0.597    17 ; 0.5679
-    O     O   -0.568    18 ; 0
- [ bonds ]
-;  ai    aj
-   -C     N
-    N     H
-    N    CA
-   CA    HA
-   CA    CB
-   CB    HB
-   CB   CG2
-  CG2  HG21
-  CG2  HG22
-  CG2  HG23
-   CB   CG1
-  CG1  HG11
-  CG1  HG12
-  CG1   CD1
-  CD1  HD11
-  CD1  HD12
-  CD1  HD13
-   CA     C
-    C     O
- [ dihedrals ]
-;  ai    aj    ak    al
-   CB    CA     N    -C     ad_CT_CT_N__C__1
-   CB    CA     N    -C     ad_CT_CT_N__C__2
-   CB    CA     N    -C     ad_CT_CT_N__C__3
- [ impropers ]
-;  ai    aj    ak    al
-   -C    CA     N     H     ai_X__X__N__H_
-   CA    +N     C     O     ai_X__X__C__O_
-; end residue ILE: 19 atoms, 19 bonds, 19 pdihs, 2 idihs
-
-; VALINE 
-; 
-[ VAL ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N     N   -0.416     0 ; -0.4157
-    H     H    0.272     1 ; -0.1438
-   CA    CT   -0.087     2 ; -0.2313
-   HA    H1    0.097     3 ; -0.1344
-   CB    CT    0.298     4 ; 0.1641
-   HB    HC   -0.030     5 ; 0.1344
-  CG1    CT   -0.319     6 ; -0.1848
- HG11    HC    0.079     7 ; -0.1057
- HG12    HC    0.079     8 ; -0.0266
- HG13    HC    0.079     9 ; 0.0525
-  CG2    CT   -0.319    10 ; -0.2667
- HG21    HC    0.079    11 ; -0.1876
- HG22    HC    0.079    12 ; -0.1085
- HG23    HC    0.079    13 ; -0.0294
-    C     C    0.597    14 ; 0.5679
-    O     O   -0.568    15 ; 1.11022e-16
- [ bonds ]
-;  ai    aj
-   -C     N
-    N     H
-    N    CA
-   CA    HA
-   CA    CB
-   CB    HB
-   CB   CG1
-  CG1  HG11
-  CG1  HG12
-  CG1  HG13
-   CB   CG2
-  CG2  HG21
-  CG2  HG22
-  CG2  HG23
-   CA     C
-    C     O
- [ dihedrals ]
-;  ai    aj    ak    al
-   CB    CA     N    -C     ad_CT_CT_N__C__1
-   CB    CA     N    -C     ad_CT_CT_N__C__2
-   CB    CA     N    -C     ad_CT_CT_N__C__3
- [ impropers ]
-;  ai    aj    ak    al
-   -C    CA     N     H     ai_X__X__N__H_
-   CA    +N     C     O     ai_X__X__C__O_
-; end residue VAL: 16 atoms, 16 bonds, 16 pdihs, 2 idihs
-
-; ASPARAGINE 
-; 
-[ ASN ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N     N   -0.416     0 ; -0.4157
-    H     H    0.272     1 ; -0.1438
-   CA    CT    0.014     2 ; -0.1295
-   HA    H1    0.105     3 ; -0.0247
-   CB    CT   -0.204     4 ; -0.2288
-  HB1    HC    0.080     5 ; -0.1491
-  HB2    HC    0.080     6 ; -0.0694
-   CG     C    0.713     7 ; 0.6436
-  OD1     O   -0.593     8 ; 0.0505
-  ND2     N   -0.919     9 ; -0.8686
- HD21     H    0.420    10 ; -0.449
- HD22     H    0.420    11 ; -0.0294
-    C     C    0.597    12 ; 0.5679
-    O     O   -0.568    13 ; 0
- [ bonds ]
-;  ai    aj
-   -C     N
-    N     H
-    N    CA
-   CA    HA
-   CA    CB
-   CB   HB1
-   CB   HB2
-   CB    CG
-   CG   OD1
-   CG   ND2
-  ND2  HD21
-  ND2  HD22
-   CA     C
-    C     O
- [ dihedrals ]
-;  ai    aj    ak    al
-   CB    CA     N    -C     ad_CT_CT_N__C__1
-   CB    CA     N    -C     ad_CT_CT_N__C__2
-   CB    CA     N    -C     ad_CT_CT_N__C__3
- [ impropers ]
-;  ai    aj    ak    al
-   -C    CA     N     H     ai_X__X__N__H_
-   CA    +N     C     O     ai_X__X__C__O_
-   CB   ND2    CG   OD1     ai_X__X__C__O_
-   CG  HD21   ND2  HD22     ai_X__X__N__H_
-; end residue ASN: 14 atoms, 14 bonds, 14 pdihs, 4 idihs
-
-; GLUTAMINE 
-; 
-[ GLN ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N     N   -0.416     0 ; -0.4157
-    H     H    0.272     1 ; -0.1438
-   CA    CT   -0.003     2 ; -0.1469
-   HA    H1    0.085     3 ; -0.0619
-   CB    CT   -0.004     4 ; -0.0655
-  HB1    HC    0.017     5 ; -0.0484
-  HB2    HC    0.017     6 ; -0.0313
-   CG    CT   -0.065     7 ; -0.0958
-  HG1    HC    0.035     8 ; -0.0606
-  HG2    HC    0.035     9 ; -0.0254
-   CD     C    0.695    10 ; 0.6697
-  OE1     O   -0.609    11 ; 0.0611
-  NE2     N   -0.941    12 ; -0.8796
- HE21     H    0.425    13 ; -0.4545
- HE22     H    0.425    14 ; -0.0294
-    C     C    0.597    15 ; 0.5679
-    O     O   -0.568    16 ; 1.11022e-16
- [ bonds ]
-;  ai    aj
-   -C     N
-    N     H
-    N    CA
-   CA    HA
-   CA    CB
-   CB   HB1
-   CB   HB2
-   CB    CG
-   CG   HG1
-   CG   HG2
-   CG    CD
-   CD   OE1
-   CD   NE2
-  NE2  HE21
-  NE2  HE22
-   CA     C
-    C     O
- [ dihedrals ]
-;  ai    aj    ak    al
-   CB    CA     N    -C     ad_CT_CT_N__C__1
-   CB    CA     N    -C     ad_CT_CT_N__C__2
-   CB    CA     N    -C     ad_CT_CT_N__C__3
- [ impropers ]
-;  ai    aj    ak    al
-   -C    CA     N     H     ai_X__X__N__H_
-   CA    +N     C     O     ai_X__X__C__O_
-   CG   NE2    CD   OE1     ai_X__X__C__O_
-   CD  HE21   NE2  HE22     ai_X__X__N__H_
-; end residue GLN: 17 atoms, 17 bonds, 17 pdihs, 4 idihs
-
-; ARGININE 
-; 
-[ ARG ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N     N   -0.348     0 ; -0.3479
-    H     H    0.275     1 ; -0.0732
-   CA    CT   -0.264     2 ; -0.3369
-   HA    H1    0.156     3 ; -0.1809
-   CB    CT   -0.001     4 ; -0.1816
-  HB1    HC    0.033     5 ; -0.1489
-  HB2    HC    0.033     6 ; -0.1162
-   CG    CT    0.039     7 ; -0.0772
-  HG1    HC    0.029     8 ; -0.0487
-  HG2    HC    0.029     9 ; -0.0202
-   CD    CT    0.049    10 ; 0.0284
-  HD1    H1    0.069    11 ; 0.0971
-  HD2    H1    0.069    12 ; 0.1658
-   NE    N2   -0.529    13 ; -0.3637
-   HE     H    0.346    14 ; -0.0181
-   CZ    CA    0.808    15 ; 0.7895
-  NH1    N2   -0.863    16 ; -0.0732
- HH11     H    0.448    17 ; 0.3746
- HH12     H    0.448    18 ; 0.8224
-  NH2    N2   -0.863    19 ; -0.0403
- HH21     H    0.448    20 ; 0.4075
- HH22     H    0.448    21 ; 0.8553
-    C     C    0.734    22 ; 1.5894
-    O     O   -0.589    23 ; 1
- [ bonds ]
-;  ai    aj
-   -C     N
-    N     H
-    N    CA
-   CA    HA
-   CA    CB
-   CB   HB1
-   CB   HB2
-   CB    CG
-   CG   HG1
-   CG   HG2
-   CG    CD
-   CD   HD1
-   CD   HD2
-   CD    NE
-   NE    HE
-   NE    CZ
-   CZ   NH1
-  NH1  HH11
-  NH1  HH12
-   CZ   NH2
-  NH2  HH21
-  NH2  HH22
-   CA     C
-    C     O
- [ dihedrals ]
-;  ai    aj    ak    al
-   CB    CA     N    -C     ad_CT_CT_N__C__1
-   CB    CA     N    -C     ad_CT_CT_N__C__2
-   CB    CA     N    -C     ad_CT_CT_N__C__3
- [ impropers ]
-;  ai    aj    ak    al
-   -C    CA     N     H     ai_X__X__N__H_
-   CA    +N     C     O     ai_X__X__C__O_
-   NE   NH1    CZ   NH2     ai_X__N2_CA_N2
-   CD    CZ    NE    HE     ai_X__X__N2_H_
-   CZ  HH11   NH1  HH12     ai_X__X__N2_H_
-   CZ  HH21   NH2  HH22     ai_X__X__N2_H_
-; end residue ARG: 24 atoms, 24 bonds, 24 pdihs, 6 idihs
-
-; HISTIDINE DELTAH 
-; 
-[ HID ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N     N   -0.416     0 ; -0.4157
-    H     H    0.272     1 ; -0.1438
-   CA    CT    0.019     2 ; -0.125
-   HA    H1    0.088     3 ; -0.0369
-   CB    CT   -0.046     4 ; -0.0831
-  HB1    HC    0.040     5 ; -0.0429
-  HB2    HC    0.040     6 ; -0.0027
-   CG    CC   -0.027     7 ; -0.0293
-  ND1    NA   -0.381     8 ; -0.4104
-  HD1     H    0.365     9 ; -0.0455
-  CE1    CR    0.206    10 ; 0.1602
-  HE1    H5    0.139    11 ; 0.2994
-  NE2    NB   -0.573    12 ; -0.2733
-  CD2    CV    0.129    13 ; -0.1441
-  HD2    H4    0.115    14 ; -0.0294
-    C     C    0.597    15 ; 0.5679
-    O     O   -0.568    16 ; 1.11022e-16
- [ bonds ]
-;  ai    aj
-   -C     N
-    N     H
-    N    CA
-   CA    HA
-   CA    CB
-   CB   HB1
-   CB   HB2
-   CB    CG
-   CG   ND1
-  ND1   HD1
-  ND1   CE1
-  CE1   HE1
-  CE1   NE2
-  NE2   CD2
-  CD2   HD2
-   CA     C
-    C     O
-   CG   CD2
- [ dihedrals ]
-;  ai    aj    ak    al
-   CB    CA     N    -C     ad_CT_CT_N__C__1
-   CB    CA     N    -C     ad_CT_CT_N__C__2
-   CB    CA     N    -C     ad_CT_CT_N__C__3
- [ impropers ]
-;  ai    aj    ak    al
-   -C    CA     N     H     ai_X__X__N__H_
-   CA    +N     C     O     ai_X__X__C__O_
-   CG   CE1   ND1   HD1     ai_X__X__NA_H_
-   CG   NE2   CD2   HD2     ai_X__X__CV_H4
-  ND1   NE2   CE1   HE1     ai_X__X__CR_H5
-  ND1   CD2    CG    CB     ai_NA_CV_CC_CT
-; end residue HID: 17 atoms, 18 bonds, 17 pdihs, 6 idihs
-
-; HISTIDINE EPSILONH 
-; 
-[ HIE ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N     N   -0.416     0 ; -0.4157
-    H     H    0.272     1 ; -0.1438
-   CA    CT   -0.058     2 ; -0.2019
-   HA    H1    0.136     3 ; -0.0659
-   CB    CT   -0.007     4 ; -0.0733
-  HB1    HC    0.037     5 ; -0.0366
-  HB2    HC    0.037     6 ; 0.0001
-   CG    CC    0.187     7 ; 0.1869
-  ND1    NB   -0.543     8 ; -0.3563
-  CE1    CR    0.164     9 ; -0.1928
-  HE1    H5    0.143    10 ; -0.0493
-  NE2    NA   -0.280    11 ; -0.3288
-  HE2     H    0.334    12 ; 0.0051
-  CD2    CW   -0.221    13 ; -0.2156
-  HD2    H4    0.186    14 ; -0.0294
-    C     C    0.597    15 ; 0.5679
-    O     O   -0.568    16 ; 0
- [ bonds ]
-;  ai    aj
-   -C     N
-    N     H
-    N    CA
-   CA    HA
-   CA    CB
-   CB   HB1
-   CB   HB2
-   CB    CG
-   CG   ND1
-  ND1   CE1
-  CE1   HE1
-  CE1   NE2
-  NE2   HE2
-  NE2   CD2
-  CD2   HD2
-   CA     C
-    C     O
-   CG   CD2
- [ dihedrals ]
-;  ai    aj    ak    al
-   CB    CA     N    -C     ad_CT_CT_N__C__1
-   CB    CA     N    -C     ad_CT_CT_N__C__2
-   CB    CA     N    -C     ad_CT_CT_N__C__3
- [ impropers ]
-;  ai    aj    ak    al
-   -C    CA     N     H     ai_X__X__N__H_
-   CA    +N     C     O     ai_X__X__C__O_
-  CE1   CD2   NE2   HE2     ai_X__X__NA_H_
-   CG   NE2   CD2   HD2     ai_X__X__CW_H4
-  ND1   NE2   CE1   HE1     ai_X__X__CR_H5
-  ND1   CD2    CG    CB     ai_NB_CW_CC_CT
-; end residue HIE: 17 atoms, 18 bonds, 17 pdihs, 6 idihs
-
-; HISTIDINE PLUS 
-; 
-[ HIP ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N     N   -0.348     0 ; -0.3479
-    H     H    0.275     1 ; -0.0732
-   CA    CT   -0.135     2 ; -0.2086
-   HA    H1    0.121     3 ; -0.0874
-   CB    CT   -0.041     4 ; -0.1288
-  HB1    HC    0.081     5 ; -0.0478
-  HB2    HC    0.081     6 ; 0.0332
-   CG    CC   -0.001     7 ; 0.032
-  ND1    NA   -0.151     8 ; -0.1193
-  HD1     H    0.387     9 ; 0.2673
-  CE1    CR   -0.017    10 ; 0.2503
-  HE1    H5    0.268    11 ; 0.5184
-  NE2    NA   -0.172    12 ; 0.3466
-  HE2     H    0.391    13 ; 0.7377
-  CD2    CW   -0.114    14 ; 0.6236
-  HD2    H4    0.232    15 ; 0.8553
-    C     C    0.734    16 ; 1.5894
-    O     O   -0.589    17 ; 1
- [ bonds ]
-;  ai    aj
-   -C     N
-    N     H
-    N    CA
-   CA    HA
-   CA    CB
-   CB   HB1
-   CB   HB2
-   CB    CG
-   CG   ND1
-  ND1   HD1
-  ND1   CE1
-  CE1   HE1
-  CE1   NE2
-  NE2   HE2
-  NE2   CD2
-  CD2   HD2
-   CA     C
-    C     O
-   CG   CD2
- [ dihedrals ]
-;  ai    aj    ak    al
-   CB    CA     N    -C     ad_CT_CT_N__C__1
-   CB    CA     N    -C     ad_CT_CT_N__C__2
-   CB    CA     N    -C     ad_CT_CT_N__C__3
- [ impropers ]
-;  ai    aj    ak    al
-   -C    CA     N     H     ai_X__X__N__H_
-   CA    +N     C     O     ai_X__X__C__O_
-   CG   CE1   ND1   HD1     ai_X__X__NA_H_
-  CE1   CD2   NE2   HE2     ai_X__X__NA_H_
-   CG   NE2   CD2   HD2     ai_X__X__CW_H4
-  ND1   NE2   CE1   HE1     ai_X__X__CR_H5
-  ND1   CD2    CG    CB     ai_NA_CW_CC_CT
-; end residue HIP: 18 atoms, 19 bonds, 18 pdihs, 7 idihs
-
-; TRYPTOPHAN 
-; 
-[ TRP ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N     N   -0.416     0 ; -0.4157
-    H     H    0.272     1 ; -0.1438
-   CA    CT   -0.028     2 ; -0.1713
-   HA    H1    0.112     3 ; -0.059
-   CB    CT   -0.005     4 ; -0.064
-  HB1    HC    0.034     5 ; -0.0301
-  HB2    HC    0.034     6 ; 0.0038
-   CG    C*   -0.141     7 ; -0.1377
-  CD1    CW   -0.164     8 ; -0.3015
-  HD1    H4    0.206     9 ; -0.0953
-  NE1    NA   -0.342    10 ; -0.4371
-  HE1     H    0.341    11 ; -0.0959
-  CE2    CN    0.138    12 ; 0.0421
-  CZ2    CA   -0.260    13 ; -0.218
-  HZ2    HA    0.157    14 ; -0.0608
-  CH2    CA   -0.113    15 ; -0.1742
-  HH2    HA    0.142    16 ; -0.0325
-  CZ3    CA   -0.197    17 ; -0.2297
-  HZ3    HA    0.145    18 ; -0.085
-  CE3    CA   -0.239    19 ; -0.3237
-  HE3    HA    0.170    20 ; -0.1537
-  CD2    CB    0.124    21 ; -0.0294
-    C     C    0.597    22 ; 0.5679
-    O     O   -0.568    23 ; 1.11022e-16
- [ bonds ]
-;  ai    aj
-   -C     N
-    N     H
-    N    CA
-   CA    HA
-   CA    CB
-   CB   HB1
-   CB   HB2
-   CB    CG
-   CG   CD1
-  CD1   HD1
-  CD1   NE1
-  NE1   HE1
-  NE1   CE2
-  CE2   CZ2
-  CZ2   HZ2
-  CZ2   CH2
-  CH2   HH2
-  CH2   CZ3
-  CZ3   HZ3
-  CZ3   CE3
-  CE3   HE3
-  CE3   CD2
-   CA     C
-    C     O
-   CG   CD2
-  CE2   CD2
- [ dihedrals ]
-;  ai    aj    ak    al
-   CB    CA     N    -C     ad_CT_CT_N__C__1
-   CB    CA     N    -C     ad_CT_CT_N__C__2
-   CB    CA     N    -C     ad_CT_CT_N__C__3
- [ impropers ]
-;  ai    aj    ak    al
-   -C    CA     N     H     ai_X__X__N__H_
-   CA    +N     C     O     ai_X__X__C__O_
-  CD1   CE2   NE1   HE1     ai_X__X__NA_H_
-  CE2   CH2   CZ2   HZ2     ai_X__X__CA_HA
-  CZ2   CZ3   CH2   HH2     ai_X__X__CA_HA
-  CH2   CE3   CZ3   HZ3     ai_X__X__CA_HA
-  CZ3   CD2   CE3   HE3     ai_X__X__CA_HA
-   CG   NE1   CD1   HD1     ai_X__X__CW_H4
-  CD1   CD2    CG    CB     ai_CW_CB_C*_CT
-; end residue TRP: 24 atoms, 26 bonds, 24 pdihs, 9 idihs
-
-; PHENYLALANINE 
-; 
-[ PHE ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N     N   -0.416     0 ; -0.4157
-    H     H    0.272     1 ; -0.1438
-   CA    CT   -0.002     2 ; -0.1462
-   HA    H1    0.098     3 ; -0.0484
-   CB    CT   -0.034     4 ; -0.0827
-  HB1    HC    0.029     5 ; -0.0532
-  HB2    HC    0.029     6 ; -0.0237
-   CG    CA    0.012     7 ; -0.0119
-  CD1    CA   -0.126     8 ; -0.1375
-  HD1    HA    0.133     9 ; -0.0045
-  CE1    CA   -0.170    10 ; -0.1749
-  HE1    HA    0.143    11 ; -0.0319
-   CZ    CA   -0.107    12 ; -0.1391
-   HZ    HA    0.130    13 ; -0.0094
-  CE2    CA   -0.170    14 ; -0.1798
-  HE2    HA    0.143    15 ; -0.0368
-  CD2    CA   -0.126    16 ; -0.1624
-  HD2    HA    0.133    17 ; -0.0294
-    C     C    0.597    18 ; 0.5679
-    O     O   -0.568    19 ; 1.11022e-16
- [ bonds ]
-;  ai    aj
-   -C     N
-    N     H
-    N    CA
-   CA    HA
-   CA    CB
-   CB   HB1
-   CB   HB2
-   CB    CG
-   CG   CD1
-  CD1   HD1
-  CD1   CE1
-  CE1   HE1
-  CE1    CZ
-   CZ    HZ
-   CZ   CE2
-  CE2   HE2
-  CE2   CD2
-  CD2   HD2
-   CA     C
-    C     O
-   CG   CD2
- [ dihedrals ]
-;  ai    aj    ak    al
-   CB    CA     N    -C     ad_CT_CT_N__C__1
-   CB    CA     N    -C     ad_CT_CT_N__C__2
-   CB    CA     N    -C     ad_CT_CT_N__C__3
- [ impropers ]
-;  ai    aj    ak    al
-   -C    CA     N     H     ai_X__X__N__H_
-   CA    +N     C     O     ai_X__X__C__O_
-   CG   CE2   CD2   HD2     ai_X__X__CA_HA
-  CD2    CZ   CE2   HE2     ai_X__X__CA_HA
-  CE1   CE2    CZ    HZ     ai_X__X__CA_HA
-  CD1    CZ   CE1   HE1     ai_X__X__CA_HA
-   CG   CE1   CD1   HD1     ai_X__X__CA_HA
-  CD1   CD2    CG    CB     ai_CA_CA_CA_CT
-; end residue PHE: 20 atoms, 21 bonds, 20 pdihs, 8 idihs
-
-; TYROSINE 
-; 
-[ TYR ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N     N   -0.416     0 ; -0.4157
-    H     H    0.272     1 ; -0.1438
-   CA    CT   -0.001     2 ; -0.1452
-   HA    H1    0.088     3 ; -0.0576
-   CB    CT   -0.015     4 ; -0.0728
-  HB1    HC    0.029     5 ; -0.0433
-  HB2    HC    0.029     6 ; -0.0138
-   CG    CA   -0.001     7 ; -0.0149
-  CD1    CA   -0.191     8 ; -0.2055
-  HD1    HA    0.170     9 ; -0.0356
-  CE1    CA   -0.234    10 ; -0.2697
-  HE1    HA    0.166    11 ; -0.1041
-   CZ     C    0.323    12 ; 0.2185
-   OH    OH   -0.558    13 ; -0.3394
-   HH    HO    0.399    14 ; 0.0598
-  CE2    CA   -0.234    15 ; -0.1743
-  HE2    HA    0.166    16 ; -0.0087
-  CD2    CA   -0.191    17 ; -0.1993
-  HD2    HA    0.170    18 ; -0.0294
-    C     C    0.597    19 ; 0.5679
-    O     O   -0.568    20 ; 1.11022e-16
- [ bonds ]
-;  ai    aj
-   -C     N
-    N     H
-    N    CA
-   CA    HA
-   CA    CB
-   CB   HB1
-   CB   HB2
-   CB    CG
-   CG   CD1
-  CD1   HD1
-  CD1   CE1
-  CE1   HE1
-  CE1    CZ
-   CZ    OH
-   OH    HH
-   CZ   CE2
-  CE2   HE2
-  CE2   CD2
-  CD2   HD2
-   CA     C
-    C     O
-   CG   CD2
- [ dihedrals ]
-;  ai    aj    ak    al
-   CB    CA     N    -C     ad_CT_CT_N__C__1
-   CB    CA     N    -C     ad_CT_CT_N__C__2
-   CB    CA     N    -C     ad_CT_CT_N__C__3
- [ impropers ]
-;  ai    aj    ak    al
-   -C    CA     N     H     ai_X__X__N__H_
-   CA    +N     C     O     ai_X__X__C__O_
-   CG   CE2   CD2   HD2     ai_X__X__CA_HA
-  CD2    CZ   CE2   HE2     ai_X__X__CA_HA
-  CD1    CZ   CE1   HE1     ai_X__X__CA_HA
-   CG   CE1   CD1   HD1     ai_X__X__CA_HA
-  CD1   CD2    CG    CB     ai_CA_CA_CA_CT
-  CE1   CE2    CZ    OH     ai_CA_CA_C__OH
-; end residue TYR: 21 atoms, 22 bonds, 21 pdihs, 8 idihs
-
-; GLUTAMIC ACID 
-; 
-[ GLU ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N     N   -0.516     0 ; -0.5163
-    H     H    0.294     1 ; -0.2227
-   CA    CT    0.040     2 ; -0.183
-   HA    H1    0.111     3 ; -0.0725
-   CB    CT    0.056     4 ; -0.0165
-  HB1    HC   -0.017     5 ; -0.0338
-  HB2    HC   -0.017     6 ; -0.0511
-   CG    CT    0.014     7 ; -0.0375
-  HG1    HC   -0.043     8 ; -0.08
-  HG2    HC   -0.043     9 ; -0.1225
-   CD     C    0.805    10 ; 0.6829
-  OE1    O2   -0.819    11 ; -0.1359
-  OE2    O2   -0.819    12 ; -0.9547
-    C     C    0.537    13 ; -0.4181
-    O     O   -0.582    14 ; -1
- [ bonds ]
-;  ai    aj
-   -C     N
-    N     H
-    N    CA
-   CA    HA
-   CA    CB
-   CB   HB1
-   CB   HB2
-   CB    CG
-   CG   HG1
-   CG   HG2
-   CG    CD
-   CD   OE1
-   CD   OE2
-   CA     C
-    C     O
- [ dihedrals ]
-;  ai    aj    ak    al
-   CB    CA     N    -C     ad_CT_CT_N__C__1
-   CB    CA     N    -C     ad_CT_CT_N__C__2
-   CB    CA     N    -C     ad_CT_CT_N__C__3
- [ impropers ]
-;  ai    aj    ak    al
-   -C    CA     N     H     ai_X__X__N__H_
-   CA    +N     C     O     ai_X__X__C__O_
-   CG   OE1    CD   OE2     ai_X__O2_C__O2
-; end residue GLU: 15 atoms, 15 bonds, 15 pdihs, 3 idihs
-
-; ASPARTIC ACID 
-; 
-[ ASP ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N     N   -0.516     0 ; -0.5163
-    H     H    0.294     1 ; -0.2227
-   CA    CT    0.038     2 ; -0.1846
-   HA    H1    0.088     3 ; -0.0966
-   CB    CT   -0.030     4 ; -0.1269
-  HB1    HC   -0.012     5 ; -0.1391
-  HB2    HC   -0.012     6 ; -0.1513
-   CG     C    0.799     7 ; 0.6481
-  OD1    O2   -0.801     8 ; -0.1533
-  OD2    O2   -0.801     9 ; -0.9547
-    C     C    0.537    10 ; -0.4181
-    O     O   -0.582    11 ; -1
- [ bonds ]
-;  ai    aj
-   -C     N
-    N     H
-    N    CA
-   CA    HA
-   CA    CB
-   CB   HB1
-   CB   HB2
-   CB    CG
-   CG   OD1
-   CG   OD2
-   CA     C
-    C     O
- [ dihedrals ]
-;  ai    aj    ak    al
-   CB    CA     N    -C     ad_CT_CT_N__C__1
-   CB    CA     N    -C     ad_CT_CT_N__C__2
-   CB    CA     N    -C     ad_CT_CT_N__C__3
- [ impropers ]
-;  ai    aj    ak    al
-   -C    CA     N     H     ai_X__X__N__H_
-   CA    +N     C     O     ai_X__X__C__O_
-   CB   OD1    CG   OD2     ai_X__O2_C__O2
-; end residue ASP: 12 atoms, 12 bonds, 12 pdihs, 3 idihs
-
-; LYSINE 
-; 
-[ LYS ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N     N   -0.348     0 ; -0.3479
-    H     H    0.275     1 ; -0.0732
-   CA    CT   -0.240     2 ; -0.3132
-   HA    H1    0.143     3 ; -0.1706
-   CB    CT   -0.009     4 ; -0.18
-  HB1    HC    0.036     5 ; -0.1438
-  HB2    HC    0.036     6 ; -0.1076
-   CG    CT    0.019     7 ; -0.0889
-  HG1    HC    0.010     8 ; -0.0786
-  HG2    HC    0.010     9 ; -0.0683
-   CD    CT   -0.048    10 ; -0.1162
-  HD1    HC    0.062    11 ; -0.0541
-  HD2    HC    0.062    12 ; 0.008
-   CE    CT   -0.014    13 ; -0.0063
-  HE1    HP    0.114    14 ; 0.1072
-  HE2    HP    0.114    15 ; 0.2207
-   NZ    N3   -0.385    16 ; -0.1647
-  HZ1     H    0.340    17 ; 0.1753
-  HZ2     H    0.340    18 ; 0.5153
-  HZ3     H    0.340    19 ; 0.8553
-    C     C    0.734    20 ; 1.5894
-    O     O   -0.589    21 ; 1
- [ bonds ]
-;  ai    aj
-   -C     N
-    N     H
-    N    CA
-   CA    HA
-   CA    CB
-   CB   HB1
-   CB   HB2
-   CB    CG
-   CG   HG1
-   CG   HG2
-   CG    CD
-   CD   HD1
-   CD   HD2
-   CD    CE
-   CE   HE1
-   CE   HE2
-   CE    NZ
-   NZ   HZ1
-   NZ   HZ2
-   NZ   HZ3
-   CA     C
-    C     O
- [ dihedrals ]
-;  ai    aj    ak    al
-   CB    CA     N    -C     ad_CT_CT_N__C__1
-   CB    CA     N    -C     ad_CT_CT_N__C__2
-   CB    CA     N    -C     ad_CT_CT_N__C__3
- [ impropers ]
-;  ai    aj    ak    al
-   -C    CA     N     H     ai_X__X__N__H_
-   CA    +N     C     O     ai_X__X__C__O_
-; end residue LYS: 22 atoms, 22 bonds, 22 pdihs, 2 idihs
-
-; LYSINE neutral
-; 
-[ LYN ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N     N   -0.416     0 ; -0.4157
-    H     H    0.272     1 ; -0.1438
-   CA    CT   -0.072     2 ; -0.21586
-   HA    H1    0.099     3 ; -0.11646
-   CB    CT   -0.048     4 ; -0.16491
-  HB1    HC    0.034     5 ; -0.13091
-  HB2    HC    0.034     6 ; -0.09691
-   CG    CT    0.066     7 ; -0.03079
-  HG1    HC    0.010     8 ; -0.02038
-  HG2    HC    0.010     9 ; -0.00997
-   CD    CT   -0.038    10 ; -0.04765
-  HD1    HC    0.012    11 ; -0.0361
-  HD2    HC    0.012    12 ; -0.02455
-   CE    CT    0.326    13 ; 0.30149
-  HE1    HP   -0.034    14 ; 0.26791
-  HE2    HP   -0.034    15 ; 0.23433
-   NZ    N3   -1.036    16 ; -0.80148
-  HZ1     H    0.386    17 ; -0.41544
-  HZ2     H    0.386    18 ; -0.0294
-    C     C    0.597    19 ; 0.5679
-    O     O   -0.568    20 ; 1.11022e-16
- [ bonds ]
-;  ai    aj
-   -C     N
-    N     H
-    N    CA
-   CA    HA
-   CA    CB
-   CB   HB1
-   CB   HB2
-   CB    CG
-   CG   HG1
-   CG   HG2
-   CG    CD
-   CD   HD1
-   CD   HD2
-   CD    CE
-   CE   HE1
-   CE   HE2
-   CE    NZ
-   NZ   HZ1
-   NZ   HZ2
-   CA     C
-    O     O
- [ dihedrals ]
-;  ai    aj    ak    al
-   CB    CA     N    -C     ad_CT_CT_N__C__1
-   CB    CA     N    -C     ad_CT_CT_N__C__2
-   CB    CA     N    -C     ad_CT_CT_N__C__3
- [ impropers ]
-;  ai    aj    ak    al
-   -C    CA     N     H     ai_X__X__N__H_
-   CA    +N     C     O     ai_X__X__C__O_
-; end residue LYN: 21 atoms, 21 bonds, 21 pdihs, 2 idihs
-
-; PROLINE 
-; 
-[ PRO ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N     N   -0.255     0 ; -0.2548
-   CD    CT    0.019     1 ; -0.2356
-  HD1    H1    0.039     2 ; -0.1965
-  HD2    H1    0.039     3 ; -0.1574
-   CG    CT    0.019     4 ; -0.1385
-  HG1    HC    0.021     5 ; -0.1172
-  HG2    HC    0.021     6 ; -0.0959
-   CB    CT   -0.007     7 ; -0.1029
-  HB1    HC    0.025     8 ; -0.0776
-  HB2    HC    0.025     9 ; -0.0523
-   CA    CT   -0.027    10 ; -0.0789
-   HA    H1    0.064    11 ; -0.0148
-    C     C    0.590    12 ; 0.5748
-    O     O   -0.575    13 ; 0
- [ bonds ]
-;  ai    aj
-   -C     N
-    N    CD
-   CD   HD1
-   CD   HD2
-   CD    CG
-   CG   HG1
-   CG   HG2
-   CG    CB
-   CB   HB1
-   CB   HB2
-    N    CA
-   CA    HA
-   CA     C
-    C     O
-   CB    CA
- [ dihedrals ]
-;  ai    aj    ak    al
-   CG    CD     N    -C     ad_CT_CT_N__C__1
-   CG    CD     N    -C     ad_CT_CT_N__C__2
-   CG    CD     N    -C     ad_CT_CT_N__C__3
- [ impropers ]
-;  ai    aj    ak    al
-   CA    +N     C     O     ai_X__X__C__O_
-   -C    CD     N    CA     ai_X__CT_N__CT
-; end residue PRO: 14 atoms, 15 bonds, 14 pdihs, 2 idihs
-
-; CYSTEINE 
-; 
-[ CYS ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N     N   -0.416     0 ; -0.4157
-    H     H    0.272     1 ; -0.1438
-   CA    CT    0.021     2 ; -0.1225
-   HA    H1    0.112     3 ; -0.0101
-   CB    CT   -0.123     4 ; -0.1332
-  HB1    H1    0.111     5 ; -0.022
-  HB2    H1    0.111     6 ; 0.0892
-   SG    SH   -0.312     7 ; -0.2227
-   HG    HS    0.193     8 ; -0.0294
-    C     C    0.597     9 ; 0.5679
-    O     O   -0.568    10 ; 0
- [ bonds ]
-;  ai    aj
-   -C     N
-    N     H
-    N    CA
-   CA    HA
-   CA    CB
-   CB   HB1
-   CB   HB2
-   CB    SG
-   SG    HG
-   CA     C
-    C     O
- [ dihedrals ]
-;  ai    aj    ak    al
-   CB    CA     N    -C     ad_CT_CT_N__C__1
-   CB    CA     N    -C     ad_CT_CT_N__C__2
-   CB    CA     N    -C     ad_CT_CT_N__C__3
- [ impropers ]
-;  ai    aj    ak    al
-   -C    CA     N     H     ai_X__X__N__H_
-   CA    +N     C     O     ai_X__X__C__O_
-; end residue CYS: 11 atoms, 11 bonds, 11 pdihs, 2 idihs
-
-; CYSTEINE with negative charge
-; 
-[ CYM ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N     N   -0.416     0 ; -0.4157
-   H1     H    0.272     1 ; -0.1438
-   CA    CT   -0.035     2 ; -0.1789
-   HA    H1    0.051     3 ; -0.1281
-   CB    CT   -0.241     4 ; -0.3694
-  HB1    H1    0.112     5 ; -0.2572
-  HB2    H1    0.112     6 ; -0.145
-   SG    SH   -0.884     7 ; -1.0294
-    C     C    0.597     8 ; -0.4321
-    O     O   -0.568     9 ; -1
- [ bonds ]
-;  ai    aj
-   -C     N
-    N    H1
-    N    CA
-   CA    HA
-   CA    CB
-   CB   HB1
-   CB   HB2
-   CB    SG
-   CA     C
-    C     O
- [ dihedrals ]
-;  ai    aj    ak    al
-   CB    CA     N    -C     ad_CT_CT_N__C__1
-   CB    CA     N    -C     ad_CT_CT_N__C__2
-   CB    CA     N    -C     ad_CT_CT_N__C__3
- [ impropers ]
-;  ai    aj    ak    al
-   -C    CA     N    H1     ai_X__X__N__H_
-   CA    +N     C     O     ai_X__X__C__O_
-; end residue CYM: 10 atoms, 10 bonds, 10 pdihs, 2 idihs
-
-; CYSTINE(S-S BRIDGE) 
-; 
-[ CYX ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N     N   -0.416     0 ; -0.4157
-    H     H    0.272     1 ; -0.1438
-   CA    CT    0.043     2 ; -0.1009
-   HA    H1    0.077     3 ; -0.0243
-   CB    CT   -0.079     4 ; -0.1033
-  HB1    H1    0.091     5 ; -0.0123
-  HB2    H1    0.091     6 ; 0.0787
-   SG     S   -0.108     7 ; -0.0294
-    C     C    0.597     8 ; 0.5679
-    O     O   -0.568     9 ; 0
- [ bonds ]
-;  ai    aj
-   -C     N
-    N     H
-    N    CA
-   CA    HA
-   CA    CB
-   CB   HB1
-   CB   HB2
-   CB    SG
-   CA     C
-    C     O
- [ dihedrals ]
-;  ai    aj    ak    al
-   CB    CA     N    -C     ad_CT_CT_N__C__1
-   CB    CA     N    -C     ad_CT_CT_N__C__2
-   CB    CA     N    -C     ad_CT_CT_N__C__3
- [ impropers ]
-;  ai    aj    ak    al
-   -C    CA     N     H     ai_X__X__N__H_
-   CA    +N     C     O     ai_X__X__C__O_
-; end residue CYX: 10 atoms, 10 bonds, 10 pdihs, 2 idihs
-
-; METHIONINE 
-; 
-[ MET ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N     N   -0.416     0 ; -0.4157
-    H     H    0.272     1 ; -0.1438
-   CA    CT   -0.024     2 ; -0.1675
-   HA    H1    0.088     3 ; -0.0795
-   CB    CT    0.034     4 ; -0.0453
-  HB1    HC    0.024     5 ; -0.0212
-  HB2    HC    0.024     6 ; 0.0029
-   CG    CT    0.002     7 ; 0.0047
-  HG1    H1    0.044     8 ; 0.0487
-  HG2    H1    0.044     9 ; 0.0927
-   SD     S   -0.274    10 ; -0.181
-   CE    CT   -0.054    11 ; -0.2346
-  HE1    H1    0.068    12 ; -0.1662
-  HE2    H1    0.068    13 ; -0.0978
-  HE3    H1    0.068    14 ; -0.0294
-    C     C    0.597    15 ; 0.5679
-    O     O   -0.568    16 ; 0
- [ bonds ]
-;  ai    aj
-   -C     N
-    N     H
-    N    CA
-   CA    HA
-   CA    CB
-   CB   HB1
-   CB   HB2
-   CB    CG
-   CG   HG1
-   CG   HG2
-   CG    SD
-   SD    CE
-   CE   HE1
-   CE   HE2
-   CE   HE3
-   CA     C
-    C     O
- [ dihedrals ]
-;  ai    aj    ak    al
-   CB    CA     N    -C     ad_CT_CT_N__C__1
-   CB    CA     N    -C     ad_CT_CT_N__C__2
-   CB    CA     N    -C     ad_CT_CT_N__C__3
- [ impropers ]
-;  ai    aj    ak    al
-   -C    CA     N     H     ai_X__X__N__H_
-   CA    +N     C     O     ai_X__X__C__O_
-; end residue MET: 17 atoms, 17 bonds, 17 pdihs, 2 idihs
-
-;  ACE BEGINNING GROUP 
-; 
-[ ACE ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-  CH3    CT   -0.366     0 ; -0.3662
-   H1    HC    0.112     1 ; -0.2539
- HH31    HC    0.112     2 ; -0.1416
- HH32    HC    0.112     3 ; -0.0293
-    C     C    0.597     4 ; 0.5679
-    O     O   -0.568     5 ; 0
- [ bonds ]
-;  ai    aj
-   H1   CH3
-  CH3  HH31
-  CH3  HH32
-  CH3     C
-    C     O
- [ impropers ]
-;  ai    aj    ak    al
-  CH3   +CA     C     O     ai_X__X__C__O_
-; end residue ACE: 6 atoms, 5 bonds, 6 pdihs, 1 idihs
-
-; N-methyl all atom 
-; 
-[ NME ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N     N   -0.416     0 ; -0.4157
-    H     H    0.272     1 ; -0.1438
-  CH3    CT   -0.149     2 ; -0.2928
- HH31    H1    0.098     3 ; -0.1952
- HH32    H1    0.098     4 ; -0.0976
- HH33    H1    0.098     5 ; -2.77556e-17
- [ bonds ]
-;  ai    aj
-   -C     N
-    N     H
-    N   CH3
-  CH3  HH31
-  CH3  HH32
-  CH3  HH33
- [ impropers ]
-;  ai    aj    ak    al
-   -C   CH3     N     H     ai_X__X__N__H_
-; end residue NME: 6 atoms, 6 bonds, 6 pdihs, 1 idihs
-
-;  NH2 ENDING GROUP
-; 
-[ NHE ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N     N   -0.463     0 ; -0.463
-   H1     H    0.232     1 ; -0.2315
-   H2     H    0.232     2 ; 0
- [ bonds ]
-;  ai    aj
-   -C     N
-    N    H1
-    N    H2
- [ impropers ]
-;  ai    aj    ak    al
-   -C    H1     N    H2     ai_X__X__N__H_
-; end residue NHE: 3 atoms, 3 bonds, 3 pdihs, 1 idihs
-
-;  WATER, TIP3P MODEL
-; 
-[ HOH ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    O    OW   -0.834     0 ; -0.834
-   H3    HW    0.417     1 ; -0.417
-   H1    HW    0.417     2 ; 0
- [ bonds ]
-;  ai    aj
-   H3     O
-    O    H1
-   H3    H1
-; end residue HOH: 3 atoms, 3 bonds, 3 pdihs, 0 idihs
-
-; ASP neutral
-; 
-[ ASH ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N     N   -0.416     0 ; -0.4157
-    H     H    0.272     1 ; -0.1438
-   CA    CT    0.034     2 ; -0.1097
-   HA    H1    0.086     3 ; -0.0233
-   CB    CT   -0.032     4 ; -0.0549
-  HB1    HC    0.049     5 ; -0.0061
-  HB2    HC    0.049     6 ; 0.0427
-   CG     C    0.646     7 ; 0.6889
-  OD1     O   -0.555     8 ; 0.1335
-  OD2    OH   -0.638     9 ; -0.5041
-  HD2    HO    0.475    10 ; -0.0294
-    C     C    0.597    11 ; 0.5679
-    O     O   -0.568    12 ; 1.11022e-16
- [ bonds ]
-;  ai    aj
-   -C     N
-    N     H
-    N    CA
-   CA    HA
-   CA    CB
-   CB   HB1
-   CB   HB2
-   CB    CG
-   CG   OD1
-   CG   OD2
-  OD2   HD2
-   CA     C
-    C     O
- [ dihedrals ]
-;  ai    aj    ak    al
-   CB    CA     N    -C     ad_CT_CT_N__C__1
-   CB    CA     N    -C     ad_CT_CT_N__C__2
-   CB    CA     N    -C     ad_CT_CT_N__C__3
- [ impropers ]
-;  ai    aj    ak    al
-   -C    CA     N     H     ai_X__X__N__H_
-   CA    +N     C     O     ai_X__X__C__O_
-   CB   OD1    CG   OD2     ai_CT_O__C__OH
-; end residue ASH: 13 atoms, 13 bonds, 13 pdihs, 3 idihs
-
-; GLU neutral
-; 
-[ GLH ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N     N   -0.416     0 ; -0.4157
-    H     H    0.272     1 ; -0.1438
-   CA    CT    0.015     2 ; -0.1293
-   HA    H1    0.078     3 ; -0.0514
-   CB    CT   -0.007     4 ; -0.0585
-  HB1    HC    0.026     5 ; -0.0329
-  HB2    HC    0.026     6 ; -0.0073
-   CG    CT   -0.017     7 ; -0.0247
-  HG1    HC    0.043     8 ; 0.0183
-  HG2    HC    0.043     9 ; 0.0613
-   CD     C    0.680    10 ; 0.7414
-  OE1     O   -0.584    11 ; 0.1576
-  OE2    OH   -0.651    12 ; -0.4935
-  HE2    HO    0.464    13 ; -0.0294
-    C     C    0.597    14 ; 0.5679
-    O     O   -0.568    15 ; 1.11022e-16
- [ bonds ]
-;  ai    aj
-   -C     N
-    N     H
-    N    CA
-   CA    HA
-   CA    CB
-   CB   HB1
-   CB   HB2
-   CB    CG
-   CG   HG1
-   CG   HG2
-   CG    CD
-   CD   OE1
-   CD   OE2
-  OE2   HE2
-   CA     C
-    C     O
- [ dihedrals ]
-;  ai    aj    ak    al
-   CB    CA     N    -C     ad_CT_CT_N__C__1
-   CB    CA     N    -C     ad_CT_CT_N__C__2
-   CB    CA     N    -C     ad_CT_CT_N__C__3
- [ impropers ]
-;  ai    aj    ak    al
-   -C    CA     N     H     ai_X__X__N__H_
-   CA    +N     C     O     ai_X__X__C__O_
-   CG   OE1    CD   OE2     ai_CT_O__C__OH
-; end residue GLH: 16 atoms, 16 bonds, 16 pdihs, 3 idihs
-
-; Sodium Ion
-; 
-[ CIP ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-  NA+    IP    1.000     0 ; 1
-; end residue CIP: 1 atoms, 1 bonds, 1 pdihs, 0 idihs
-
-; Chloride Ion
-; 
-[ CIM ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-  CL-    IM   -1.000     0 ; -1
-; end residue CIM: 1 atoms, 1 bonds, 1 pdihs, 0 idihs
-
-; end of file /usr/slocal/amber6/dat/all_amino94.in
-; from file /usr/slocal/amber6/dat/all_aminoct94.in
-; 
-; reading database: All-atom, COO- terminal
-; 
-; ALANINE COO- ANION 
-; 
-[ ALA-C ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N     N   -0.382     0 ; -0.3821
-    H     H    0.268     1 ; -0.114
-   CA    CT   -0.175     2 ; -0.2887
-   HA    H1    0.107     3 ; -0.182
-   CB    CT   -0.209     4 ; -0.3913
-  HB1    HC    0.076     5 ; -0.3149
-  HB2    HC    0.076     6 ; -0.2385
-  HB3    HC    0.076     7 ; -0.1621
-    C     C    0.773     8 ; 0.611
-    O    O2   -0.805     9 ; -0.1945
-  OXT    O2   -0.805    10 ; -1
- [ bonds ]
-;  ai    aj
-   -C     N
-    N     H
-    N    CA
-   CA    HA
-   CA    CB
-   CB   HB1
-   CB   HB2
-   CB   HB3
-   CA     C
-    C     O
-    C   OXT
- [ dihedrals ]
-;  ai    aj    ak    al
-   CB    CA     N    -C     ad_CT_CT_N__C__1
-   CB    CA     N    -C     ad_CT_CT_N__C__2
-   CB    CA     N    -C     ad_CT_CT_N__C__3
- [ impropers ]
-;  ai    aj    ak    al
-   -C    CA     N     H     ai_X__X__N__H_
-   CA   OXT     C     O     ai_X__O2_C__O2
-; end residue ALA-C: 11 atoms, 11 bonds, 11 pdihs, 2 idihs
-
-; GLYCINE COO- ANION 
-; 
-[ GLY-C ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N     N   -0.382     0 ; -0.3821
-    H     H    0.268     1 ; -0.114
-   CA    CT   -0.249     2 ; -0.3633
-  HA1    H1    0.106     3 ; -0.2577
-  HA2    H1    0.106     4 ; -0.1521
-    C     C    0.723     5 ; 0.571
-    O    O2   -0.785     6 ; -0.2145
-  OXT    O2   -0.785     7 ; -1
- [ bonds ]
-;  ai    aj
-   -C     N
-    N     H
-    N    CA
-   CA   HA1
-   CA   HA2
-   CA     C
-    C     O
-    C   OXT
- [ impropers ]
-;  ai    aj    ak    al
-   -C    CA     N     H     ai_X__X__N__H_
-   CA   OXT     C     O     ai_X__O2_C__O2
-; end residue GLY-C: 8 atoms, 8 bonds, 8 pdihs, 2 idihs
-
-; SERINE COO- ANION 
-; 
-[ SER-C ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N     N   -0.382     0 ; -0.3821
-    H     H    0.268     1 ; -0.114
-   CA    CT   -0.272     2 ; -0.3862
-   HA    H1    0.130     3 ; -0.2558
-   CB    CT    0.112     4 ; -0.1435
-  HB1    H1    0.081     5 ; -0.0622
-  HB2    H1    0.081     6 ; 0.0191
-   OG    OH   -0.651     7 ; -0.6323
-   HG    HO    0.447     8 ; -0.1849
-    C     C    0.811     9 ; 0.6264
-    O    O2   -0.813    10 ; -0.1868
-  OXT    O2   -0.813    11 ; -1
- [ bonds ]
-;  ai    aj
-   -C     N
-    N     H
-    N    CA
-   CA    HA
-   CA    CB
-   CB   HB1
-   CB   HB2
-   CB    OG
-   OG    HG
-   CA     C
-    C     O
-    C   OXT
- [ dihedrals ]
-;  ai    aj    ak    al
-   CB    CA     N    -C     ad_CT_CT_N__C__1
-   CB    CA     N    -C     ad_CT_CT_N__C__2
-   CB    CA     N    -C     ad_CT_CT_N__C__3
- [ impropers ]
-;  ai    aj    ak    al
-   -C    CA     N     H     ai_X__X__N__H_
-   CA   OXT     C     O     ai_X__O2_C__O2
-; end residue SER-C: 12 atoms, 12 bonds, 12 pdihs, 2 idihs
-
-; THREONINE COO- ANION 
-; 
-[ THR-C ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N     N   -0.382     0 ; -0.3821
-    H     H    0.268     1 ; -0.114
-   CA    CT   -0.242     2 ; -0.356
-   HA    H1    0.121     3 ; -0.2353
-   CB    CT    0.302     4 ; 0.0672
-   HB    H1    0.008     5 ; 0.075
-  CG2    CT   -0.185     6 ; -0.1103
- HG21    HC    0.059     7 ; -0.0517
- HG22    HC    0.059     8 ; 0.0069
- HG23    HC    0.059     9 ; 0.0655
-  OG1    OH   -0.650    10 ; -0.5841
-  HG1    HO    0.412    11 ; -0.1722
-    C     C    0.781    12 ; 0.6088
-    O    O2   -0.804    13 ; -0.1956
-  OXT    O2   -0.804    14 ; -1
- [ bonds ]
-;  ai    aj
-   -C     N
-    N     H
-    N    CA
-   CA    HA
-   CA    CB
-   CB    HB
-   CB   CG2
-  CG2  HG21
-  CG2  HG22
-  CG2  HG23
-   CB   OG1
-  OG1   HG1
-   CA     C
-    C     O
-    C   OXT
- [ dihedrals ]
-;  ai    aj    ak    al
-   CB    CA     N    -C     ad_CT_CT_N__C__1
-   CB    CA     N    -C     ad_CT_CT_N__C__2
-   CB    CA     N    -C     ad_CT_CT_N__C__3
- [ impropers ]
-;  ai    aj    ak    al
-   -C    CA     N     H     ai_X__X__N__H_
-   CA   OXT     C     O     ai_X__O2_C__O2
-; end residue THR-C: 15 atoms, 15 bonds, 15 pdihs, 2 idihs
-
-; LEUCINE COO- ANION 
-; 
-[ LEU-C ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N     N   -0.382     0 ; -0.3821
-    H     H    0.268     1 ; -0.114
-   CA    CT   -0.285     2 ; -0.3987
-   HA    H1    0.135     3 ; -0.2641
-   CB    CT   -0.247     4 ; -0.511
-  HB1    HC    0.097     5 ; -0.4136
-  HB2    HC    0.097     6 ; -0.3162
-   CG    CT    0.371     7 ; 0.0544
-   HG    HC   -0.037     8 ; 0.017
-  CD1    CT   -0.416     9 ; -0.3993
- HD11    HC    0.104    10 ; -0.2955
- HD12    HC    0.104    11 ; -0.1917
- HD13    HC    0.104    12 ; -0.0879
-  CD2    CT   -0.416    13 ; -0.5042
- HD21    HC    0.104    14 ; -0.4004
- HD22    HC    0.104    15 ; -0.2966
- HD23    HC    0.104    16 ; -0.1928
-    C     C    0.833    17 ; 0.6398
-    O    O2   -0.820    18 ; -0.1801
-  OXT    O2   -0.820    19 ; -1
- [ bonds ]
-;  ai    aj
-   -C     N
-    N     H
-    N    CA
-   CA    HA
-   CA    CB
-   CB   HB1
-   CB   HB2
-   CB    CG
-   CG    HG
-   CG   CD1
-  CD1  HD11
-  CD1  HD12
-  CD1  HD13
-   CG   CD2
-  CD2  HD21
-  CD2  HD22
-  CD2  HD23
-   CA     C
-    C     O
-    C   OXT
- [ dihedrals ]
-;  ai    aj    ak    al
-   CB    CA     N    -C     ad_CT_CT_N__C__1
-   CB    CA     N    -C     ad_CT_CT_N__C__2
-   CB    CA     N    -C     ad_CT_CT_N__C__3
- [ impropers ]
-;  ai    aj    ak    al
-   -C    CA     N     H     ai_X__X__N__H_
-   CA   OXT     C     O     ai_X__O2_C__O2
-; end residue LEU-C: 20 atoms, 20 bonds, 20 pdihs, 2 idihs
-
-; ISOLEUCINE COO- ANION 
-; 
-[ ILE-C ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N     N   -0.382     0 ; -0.3821
-    H     H    0.268     1 ; -0.114
-   CA    CT   -0.310     2 ; -0.424
-   HA    H1    0.138     3 ; -0.2865
-   CB    CT    0.036     4 ; -0.2502
-   HB    HC    0.077     5 ; -0.1736
-  CG2    CT   -0.350     6 ; -0.5234
- HG21    HC    0.102     7 ; -0.4213
- HG22    HC    0.102     8 ; -0.3192
- HG23    HC    0.102     9 ; -0.2171
-  CG1    CT   -0.032    10 ; -0.2494
- HG11    HC    0.032    11 ; -0.2173
- HG12    HC    0.032    12 ; -0.1852
-  CD1    CT   -0.070    13 ; -0.2551
- HD11    HC    0.020    14 ; -0.2355
- HD12    HC    0.020    15 ; -0.2159
- HD13    HC    0.020    16 ; -0.1963
-    C     C    0.834    17 ; 0.638
-    O    O2   -0.819    18 ; -0.181
-  OXT    O2   -0.819    19 ; -1
- [ bonds ]
-;  ai    aj
-   -C     N
-    N     H
-    N    CA
-   CA    HA
-   CA    CB
-   CB    HB
-   CB   CG2
-  CG2  HG21
-  CG2  HG22
-  CG2  HG23
-   CB   CG1
-  CG1  HG11
-  CG1  HG12
-  CG1   CD1
-  CD1  HD11
-  CD1  HD12
-  CD1  HD13
-   CA     C
-    C     O
-    C   OXT
- [ dihedrals ]
-;  ai    aj    ak    al
-   CB    CA     N    -C     ad_CT_CT_N__C__1
-   CB    CA     N    -C     ad_CT_CT_N__C__2
-   CB    CA     N    -C     ad_CT_CT_N__C__3
- [ impropers ]
-;  ai    aj    ak    al
-   -C    CA     N     H     ai_X__X__N__H_
-   CA   OXT     C     O     ai_X__O2_C__O2
-; end residue ILE-C: 20 atoms, 20 bonds, 20 pdihs, 2 idihs
-
-; VALINE COO- ANION 
-; 
-[ VAL-C ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N     N   -0.382     0 ; -0.3821
-    H     H    0.268     1 ; -0.114
-   CA    CT   -0.344     2 ; -0.4578
-   HA    H1    0.144     3 ; -0.314
-   CB    CT    0.194     4 ; -0.12
-   HB    HC    0.031     5 ; -0.0892
-  CG1    CT   -0.306     6 ; -0.3956
- HG11    HC    0.084     7 ; -0.312
- HG12    HC    0.084     8 ; -0.2284
- HG13    HC    0.084     9 ; -0.1448
-  CG2    CT   -0.306    10 ; -0.4512
- HG21    HC    0.084    11 ; -0.3676
- HG22    HC    0.084    12 ; -0.284
- HG23    HC    0.084    13 ; -0.2004
-    C     C    0.835    14 ; 0.6346
-    O    O2   -0.817    15 ; -0.1827
-  OXT    O2   -0.817    16 ; -1
- [ bonds ]
-;  ai    aj
-   -C     N
-    N     H
-    N    CA
-   CA    HA
-   CA    CB
-   CB    HB
-   CB   CG1
-  CG1  HG11
-  CG1  HG12
-  CG1  HG13
-   CB   CG2
-  CG2  HG21
-  CG2  HG22
-  CG2  HG23
-   CA     C
-    C     O
-    C   OXT
- [ dihedrals ]
-;  ai    aj    ak    al
-   CB    CA     N    -C     ad_CT_CT_N__C__1
-   CB    CA     N    -C     ad_CT_CT_N__C__2
-   CB    CA     N    -C     ad_CT_CT_N__C__3
- [ impropers ]
-;  ai    aj    ak    al
-   -C    CA     N     H     ai_X__X__N__H_
-   CA   OXT     C     O     ai_X__O2_C__O2
-; end residue VAL-C: 17 atoms, 17 bonds, 17 pdihs, 2 idihs
-
-; ASPARAGINE COO- ANION 
-; 
-[ ASN-C ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N     N   -0.382     0 ; -0.3821
-    H     H    0.268     1 ; -0.114
-   CA    CT   -0.208     2 ; -0.322
-   HA    H1    0.136     3 ; -0.1862
-   CB    CT   -0.230     4 ; -0.4161
-  HB1    HC    0.102     5 ; -0.3138
-  HB2    HC    0.102     6 ; -0.2115
-   CG     C    0.715     7 ; 0.5038
-  OD1     O   -0.601     8 ; -0.0972
-  ND2     N   -0.908     9 ; -1.0056
- HD21     H    0.415    10 ; -0.5906
- HD22     H    0.415    11 ; -0.1756
-    C     C    0.805    12 ; 0.6294
-    O    O2   -0.815    13 ; -0.1853
-  OXT    O2   -0.815    14 ; -1
- [ bonds ]
-;  ai    aj
-   -C     N
-    N     H
-    N    CA
-   CA    HA
-   CA    CB
-   CB   HB1
-   CB   HB2
-   CB    CG
-   CG   OD1
-   CG   ND2
-  ND2  HD21
-  ND2  HD22
-   CA     C
-    C     O
-    C   OXT
- [ dihedrals ]
-;  ai    aj    ak    al
-   CB    CA     N    -C     ad_CT_CT_N__C__1
-   CB    CA     N    -C     ad_CT_CT_N__C__2
-   CB    CA     N    -C     ad_CT_CT_N__C__3
- [ impropers ]
-;  ai    aj    ak    al
-   -C    CA     N     H     ai_X__X__N__H_
-   CA   OXT     C     O     ai_X__O2_C__O2
-   CB   ND2    CG   OD1     ai_X__X__C__O_
-   CG  HD21   ND2  HD22     ai_X__X__N__H_
-; end residue ASN-C: 15 atoms, 15 bonds, 15 pdihs, 4 idihs
-
-; GLUTAMINE COO- ANION 
-; 
-[ GLN-C ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N     N   -0.382     0 ; -0.3821
-    H     H    0.268     1 ; -0.114
-   CA    CT   -0.225     2 ; -0.3388
-   HA    H1    0.123     3 ; -0.2156
-   CB    CT   -0.066     4 ; -0.282
-  HB1    HC    0.045     5 ; -0.2368
-  HB2    HC    0.045     6 ; -0.1916
-   CG    CT   -0.021     7 ; -0.2126
-  HG1    HC    0.020     8 ; -0.1923
-  HG2    HC    0.020     9 ; -0.172
-   CD     C    0.709    10 ; 0.5373
-  OE1     O   -0.610    11 ; -0.0725
-  NE2     N   -0.957    12 ; -1.0299
- HE21     H    0.430    13 ; -0.5995
- HE22     H    0.430    14 ; -0.1691
-    C     C    0.777    15 ; 0.6084
-    O    O2   -0.804    16 ; -0.1958
-  OXT    O2   -0.804    17 ; -1
- [ bonds ]
-;  ai    aj
-   -C     N
-    N     H
-    N    CA
-   CA    HA
-   CA    CB
-   CB   HB1
-   CB   HB2
-   CB    CG
-   CG   HG1
-   CG   HG2
-   CG    CD
-   CD   OE1
-   CD   NE2
-  NE2  HE21
-  NE2  HE22
-   CA     C
-    C     O
-    C   OXT
- [ dihedrals ]
-;  ai    aj    ak    al
-   CB    CA     N    -C     ad_CT_CT_N__C__1
-   CB    CA     N    -C     ad_CT_CT_N__C__2
-   CB    CA     N    -C     ad_CT_CT_N__C__3
- [ impropers ]
-;  ai    aj    ak    al
-   -C    CA     N     H     ai_X__X__N__H_
-   CA   OXT     C     O     ai_X__O2_C__O2
-   CG   NE2    CD   OE1     ai_X__X__C__O_
-   CD  HE21   NE2  HE22     ai_X__X__N__H_
-; end residue GLN-C: 18 atoms, 18 bonds, 18 pdihs, 4 idihs
-
-; ARGININE COO- ANION 
-; 
-[ ARG-C ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N     N   -0.348     0 ; -0.3481
-    H     H    0.276     1 ; -0.0717
-   CA    CT   -0.307     2 ; -0.3785
-   HA    H1    0.145     3 ; -0.2338
-   CB    CT   -0.037     4 ; -0.2712
-  HB1    HC    0.037     5 ; -0.2341
-  HB2    HC    0.037     6 ; -0.197
-   CG    CT    0.074     7 ; -0.1226
-  HG1    HC    0.018     8 ; -0.1041
-  HG2    HC    0.018     9 ; -0.0856
-   CD    CT    0.111    10 ; 0.0258
-  HD1    H1    0.047    11 ; 0.0726
-  HD2    H1    0.047    12 ; 0.1194
-   NE    N2   -0.556    13 ; -0.437
-   HE     H    0.348    14 ; -0.0891
-   CZ    CA    0.837    15 ; 0.7477
-  NH1    N2   -0.874    16 ; -0.126
- HH11     H    0.449    17 ; 0.3233
- HH12     H    0.449    18 ; 0.7726
-  NH2    N2   -0.874    19 ; -0.1011
- HH21     H    0.449    20 ; 0.3482
- HH22     H    0.449    21 ; 0.7975
-    C     C    0.856    22 ; 1.6532
-    O    O2   -0.827    23 ; 0.8266
-  OXT    O2   -0.827    24 ; -2.22045e-16
- [ bonds ]
-;  ai    aj
-   -C     N
-    N     H
-    N    CA
-   CA    HA
-   CA    CB
-   CB   HB1
-   CB   HB2
-   CB    CG
-   CG   HG1
-   CG   HG2
-   CG    CD
-   CD   HD1
-   CD   HD2
-   CD    NE
-   NE    HE
-   NE    CZ
-   CZ   NH1
-  NH1  HH11
-  NH1  HH12
-   CZ   NH2
-  NH2  HH21
-  NH2  HH22
-   CA     C
-    C     O
-    C   OXT
- [ dihedrals ]
-;  ai    aj    ak    al
-   CB    CA     N    -C     ad_CT_CT_N__C__1
-   CB    CA     N    -C     ad_CT_CT_N__C__2
-   CB    CA     N    -C     ad_CT_CT_N__C__3
- [ impropers ]
-;  ai    aj    ak    al
-   -C    CA     N     H     ai_X__X__N__H_
-   CA   OXT     C     O     ai_X__O2_C__O2
-   NE   NH1    CZ   NH2     ai_X__N2_CA_N2
-   CD    CZ    NE    HE     ai_X__X__N2_H_
-   CZ  HH11   NH1  HH12     ai_X__X__N2_H_
-   CZ  HH21   NH2  HH22     ai_X__X__N2_H_
-; end residue ARG-C: 25 atoms, 25 bonds, 25 pdihs, 6 idihs
-
-; HISTIDINE DELTAH COO- ANION 
-; 
-[ HID-C ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N     N   -0.382     0 ; -0.3821
-    H     H    0.268     1 ; -0.114
-   CA    CT   -0.174     2 ; -0.2879
-   HA    H1    0.110     3 ; -0.1779
-   CB    CT   -0.105     4 ; -0.2825
-  HB1    HC    0.057     5 ; -0.226
-  HB2    HC    0.057     6 ; -0.1695
-   CG    CC    0.029     7 ; -0.1402
-  ND1    NA   -0.389     8 ; -0.5294
-  HD1     H    0.376     9 ; -0.1539
-  CE1    CR    0.193    10 ; 0.0386
-  HE1    H5    0.142    11 ; 0.1804
-  NE2    NB   -0.563    12 ; -0.3825
-  CD2    CV    0.100    13 ; -0.2824
-  HD2    H4    0.124    14 ; -0.1583
-    C     C    0.761    15 ; 0.6032
-    O    O2   -0.802    16 ; -0.1984
-  OXT    O2   -0.802    17 ; -1
- [ bonds ]
-;  ai    aj
-   -C     N
-    N     H
-    N    CA
-   CA    HA
-   CA    CB
-   CB   HB1
-   CB   HB2
-   CB    CG
-   CG   ND1
-  ND1   HD1
-  ND1   CE1
-  CE1   HE1
-  CE1   NE2
-  NE2   CD2
-  CD2   HD2
-   CA     C
-    C     O
-    C   OXT
-   CG   CD2
- [ dihedrals ]
-;  ai    aj    ak    al
-   CB    CA     N    -C     ad_CT_CT_N__C__1
-   CB    CA     N    -C     ad_CT_CT_N__C__2
-   CB    CA     N    -C     ad_CT_CT_N__C__3
- [ impropers ]
-;  ai    aj    ak    al
-   -C    CA     N     H     ai_X__X__N__H_
-   CA   OXT     C     O     ai_X__O2_C__O2
-   CG   CE1   ND1   HD1     ai_X__X__NA_H_
-   CG   NE2   CD2   HD2     ai_X__X__CV_H4
-  ND1   NE2   CE1   HE1     ai_X__X__CR_H5
-  ND1   CD2    CG    CB     ai_NA_CV_CC_CT
-; end residue HID-C: 18 atoms, 19 bonds, 18 pdihs, 6 idihs
-
-; HISTIDINE EPSILON-H COO- ANION 
-; 
-[ HIE-C ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N     N   -0.382     0 ; -0.3821
-    H     H    0.268     1 ; -0.114
-   CA    CT   -0.270     2 ; -0.3839
-   HA    H1    0.165     3 ; -0.2189
-   CB    CT   -0.107     4 ; -0.3257
-  HB1    HC    0.062     5 ; -0.2637
-  HB2    HC    0.062     6 ; -0.2017
-   CG    CC    0.272     7 ; 0.0707
-  ND1    NB   -0.552     8 ; -0.481
-  CE1    CR    0.156     9 ; -0.3252
-  HE1    H5    0.145    10 ; -0.1804
-  NE2    NA   -0.267    11 ; -0.4474
-  HE2     H    0.332    12 ; -0.1155
-  CD2    CW   -0.259    13 ; -0.3743
-  HD2    H4    0.196    14 ; -0.1786
-    C     C    0.792    15 ; 0.613
-    O    O2   -0.806    16 ; -0.1935
-  OXT    O2   -0.806    17 ; -1
- [ bonds ]
-;  ai    aj
-   -C     N
-    N     H
-    N    CA
-   CA    HA
-   CA    CB
-   CB   HB1
-   CB   HB2
-   CB    CG
-   CG   ND1
-  ND1   CE1
-  CE1   HE1
-  CE1   NE2
-  NE2   HE2
-  NE2   CD2
-  CD2   HD2
-   CA     C
-    C     O
-    C   OXT
-   CG   CD2
- [ dihedrals ]
-;  ai    aj    ak    al
-   CB    CA     N    -C     ad_CT_CT_N__C__1
-   CB    CA     N    -C     ad_CT_CT_N__C__2
-   CB    CA     N    -C     ad_CT_CT_N__C__3
- [ impropers ]
-;  ai    aj    ak    al
-   -C    CA     N     H     ai_X__X__N__H_
-   CA   OXT     C     O     ai_X__O2_C__O2
-  CE1   CD2   NE2   HE2     ai_X__X__NA_H_
-   CG   NE2   CD2   HD2     ai_X__X__CW_H4
-  ND1   NE2   CE1   HE1     ai_X__X__CR_H5
-  ND1   CD2    CG    CB     ai_NB_CW_CC_CT
-; end residue HIE-C: 18 atoms, 19 bonds, 18 pdihs, 6 idihs
-
-; HISTIDINE PLUS COO- 
-; 
-[ HIP-C ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N     N   -0.348     0 ; -0.3481
-    H     H    0.276     1 ; -0.0717
-   CA    CT   -0.144     2 ; -0.2162
-   HA    H1    0.112     3 ; -0.1047
-   CB    CT   -0.080     4 ; -0.1847
-  HB1    HC    0.087     5 ; -0.0979
-  HB2    HC    0.087     6 ; -0.0111
-   CG    CC    0.030     7 ; 0.0187
-  ND1    NA   -0.150     8 ; -0.1314
-  HD1     H    0.388     9 ; 0.2569
-  CE1    CR   -0.025    10 ; 0.2318
-  HE1    H5    0.269    11 ; 0.5012
-  NE2    NA   -0.168    12 ; 0.3329
-  HE2     H    0.391    13 ; 0.7242
-  CD2    CW   -0.126    14 ; 0.5986
-  HD2    H4    0.234    15 ; 0.8322
-    C     C    0.803    16 ; 1.6354
-    O    O2   -0.818    17 ; 0.8177
-  OXT    O2   -0.818    18 ; -2.22045e-16
- [ bonds ]
-;  ai    aj
-   -C     N
-    N     H
-    N    CA
-   CA    HA
-   CA    CB
-   CB   HB1
-   CB   HB2
-   CB    CG
-   CG   ND1
-  ND1   HD1
-  ND1   CE1
-  CE1   HE1
-  CE1   NE2
-  NE2   HE2
-  NE2   CD2
-  CD2   HD2
-   CA     C
-    C     O
-    C   OXT
-   CG   CD2
- [ dihedrals ]
-;  ai    aj    ak    al
-   CB    CA     N    -C     ad_CT_CT_N__C__1
-   CB    CA     N    -C     ad_CT_CT_N__C__2
-   CB    CA     N    -C     ad_CT_CT_N__C__3
- [ impropers ]
-;  ai    aj    ak    al
-   -C    CA     N     H     ai_X__X__N__H_
-   CA   OXT     C     O     ai_X__O2_C__O2
-   CG   CE1   ND1   HD1     ai_X__X__NA_H_
-  CE1   CD2   NE2   HE2     ai_X__X__NA_H_
-   CG   NE2   CD2   HD2     ai_X__X__CW_H4
-  ND1   NE2   CE1   HE1     ai_X__X__CR_H5
-  ND1   CD2    CG    CB     ai_NA_CW_CC_CT
-; end residue HIP-C: 19 atoms, 20 bonds, 19 pdihs, 7 idihs
-
-; TRYPTOPHAN COO- ANION 
-; 
-[ TRP-C ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N     N   -0.382     0 ; -0.3821
-    H     H    0.268     1 ; -0.114
-   CA    CT   -0.208     2 ; -0.3224
-   HA    H1    0.127     3 ; -0.1952
-   CB    CT   -0.074     4 ; -0.2694
-  HB1    HC    0.050     5 ; -0.2197
-  HB2    HC    0.050     6 ; -0.17
-   CG    C*   -0.080     7 ; -0.2496
-  CD1    CW   -0.181     8 ; -0.4304
-  HD1    H4    0.204     9 ; -0.2261
-  NE1    NA   -0.332    10 ; -0.5577
-  HE1     H    0.341    11 ; -0.2164
-  CE2    CN    0.122    12 ; -0.0942
-  CZ2    CA   -0.259    13 ; -0.3536
-  HZ2    HA    0.157    14 ; -0.1969
-  CH2    CA   -0.102    15 ; -0.2989
-  HH2    HA    0.140    16 ; -0.1588
-  CZ3    CA   -0.229    17 ; -0.3875
-  HZ3    HA    0.151    18 ; -0.2368
-  CE3    CA   -0.184    19 ; -0.4205
-  HE3    HA    0.149    20 ; -0.2714
-  CD2    CB    0.108    21 ; -0.1636
-    C     C    0.766    22 ; 0.6022
-    O    O2   -0.801    23 ; -0.1989
-  OXT    O2   -0.801    24 ; -1
- [ bonds ]
-;  ai    aj
-   -C     N
-    N     H
-    N    CA
-   CA    HA
-   CA    CB
-   CB   HB1
-   CB   HB2
-   CB    CG
-   CG   CD1
-  CD1   HD1
-  CD1   NE1
-  NE1   HE1
-  NE1   CE2
-  CE2   CZ2
-  CZ2   HZ2
-  CZ2   CH2
-  CH2   HH2
-  CH2   CZ3
-  CZ3   HZ3
-  CZ3   CE3
-  CE3   HE3
-  CE3   CD2
-   CA     C
-    C     O
-    C   OXT
-   CG   CD2
-  CE2   CD2
- [ dihedrals ]
-;  ai    aj    ak    al
-   CB    CA     N    -C     ad_CT_CT_N__C__1
-   CB    CA     N    -C     ad_CT_CT_N__C__2
-   CB    CA     N    -C     ad_CT_CT_N__C__3
- [ impropers ]
-;  ai    aj    ak    al
-   -C    CA     N     H     ai_X__X__N__H_
-   CA   OXT     C     O     ai_X__O2_C__O2
-  CD1   CE2   NE1   HE1     ai_X__X__NA_H_
-  CE2   CH2   CZ2   HZ2     ai_X__X__CA_HA
-  CZ2   CZ3   CH2   HH2     ai_X__X__CA_HA
-  CH2   CE3   CZ3   HZ3     ai_X__X__CA_HA
-  CZ3   CD2   CE3   HE3     ai_X__X__CA_HA
-   CG   NE1   CD1   HD1     ai_X__X__CW_H4
-  CD1   CD2    CG    CB     ai_CW_CB_C*_CT
-; end residue TRP-C: 25 atoms, 27 bonds, 25 pdihs, 9 idihs
-
-; PHENYLALANINE COO- ANION 
-; 
-[ PHE-C ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N     N   -0.382     0 ; -0.3821
-    H     H    0.268     1 ; -0.114
-   CA    CT   -0.182     2 ; -0.2965
-   HA    H1    0.110     3 ; -0.1867
-   CB    CT   -0.096     4 ; -0.2826
-  HB1    HC    0.044     5 ; -0.2383
-  HB2    HC    0.044     6 ; -0.194
-   CG    CA    0.055     7 ; -0.1388
-  CD1    CA   -0.130     8 ; -0.2688
-  HD1    HA    0.141     9 ; -0.128
-  CE1    CA   -0.185    10 ; -0.3127
-  HE1    HA    0.146    11 ; -0.1666
-   CZ    CA   -0.094    12 ; -0.261
-   HZ    HA    0.128    13 ; -0.133
-  CE2    CA   -0.185    14 ; -0.3177
-  HE2    HA    0.146    15 ; -0.1716
-  CD2    CA   -0.130    16 ; -0.3016
-  HD2    HA    0.141    17 ; -0.1608
-    C     C    0.766    18 ; 0.6052
-    O    O2   -0.803    19 ; -0.1974
-  OXT    O2   -0.803    20 ; -1
- [ bonds ]
-;  ai    aj
-   -C     N
-    N     H
-    N    CA
-   CA    HA
-   CA    CB
-   CB   HB1
-   CB   HB2
-   CB    CG
-   CG   CD1
-  CD1   HD1
-  CD1   CE1
-  CE1   HE1
-  CE1    CZ
-   CZ    HZ
-   CZ   CE2
-  CE2   HE2
-  CE2   CD2
-  CD2   HD2
-   CA     C
-    C     O
-    C   OXT
-   CG   CD2
- [ dihedrals ]
-;  ai    aj    ak    al
-   CB    CA     N    -C     ad_CT_CT_N__C__1
-   CB    CA     N    -C     ad_CT_CT_N__C__2
-   CB    CA     N    -C     ad_CT_CT_N__C__3
- [ impropers ]
-;  ai    aj    ak    al
-   -C    CA     N     H     ai_X__X__N__H_
-   CA   OXT     C     O     ai_X__O2_C__O2
-   CG   CE2   CD2   HD2     ai_X__X__CA_HA
-  CD2    CZ   CE2   HE2     ai_X__X__CA_HA
-  CE1   CE2    CZ    HZ     ai_X__X__CA_HA
-  CD1    CZ   CE1   HE1     ai_X__X__CA_HA
-   CG   CE1   CD1   HD1     ai_X__X__CA_HA
-  CD1   CD2    CG    CB     ai_CA_CA_CA_CT
-; end residue PHE-C: 21 atoms, 22 bonds, 21 pdihs, 8 idihs
-
-; TYROSINE COO- ANION 
-; 
-[ TYR-C ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N     N   -0.382     0 ; -0.3821
-    H     H    0.268     1 ; -0.114
-   CA    CT   -0.202     2 ; -0.3155
-   HA    H1    0.109     3 ; -0.2063
-   CB    CT   -0.075     4 ; -0.2815
-  HB1    HC    0.049     5 ; -0.2325
-  HB2    HC    0.049     6 ; -0.1835
-   CG    CA    0.024     7 ; -0.1592
-  CD1    CA   -0.192     8 ; -0.3514
-  HD1    HA    0.178     9 ; -0.1734
-  CE1    CA   -0.246    10 ; -0.4192
-  HE1    HA    0.167    11 ; -0.2519
-   CZ     C    0.340    12 ; 0.0876
-   OH    OH   -0.564    13 ; -0.4767
-   HH    HO    0.402    14 ; -0.075
-  CE2    CA   -0.246    15 ; -0.3208
-  HE2    HA    0.167    16 ; -0.1535
-  CD2    CA   -0.192    17 ; -0.3457
-  HD2    HA    0.178    18 ; -0.1677
-    C     C    0.782    19 ; 0.614
-    O    O2   -0.807    20 ; -0.193
-  OXT    O2   -0.807    21 ; -1
- [ bonds ]
-;  ai    aj
-   -C     N
-    N     H
-    N    CA
-   CA    HA
-   CA    CB
-   CB   HB1
-   CB   HB2
-   CB    CG
-   CG   CD1
-  CD1   HD1
-  CD1   CE1
-  CE1   HE1
-  CE1    CZ
-   CZ    OH
-   OH    HH
-   CZ   CE2
-  CE2   HE2
-  CE2   CD2
-  CD2   HD2
-   CA     C
-    C     O
-    C   OXT
-   CG   CD2
- [ dihedrals ]
-;  ai    aj    ak    al
-   CB    CA     N    -C     ad_CT_CT_N__C__1
-   CB    CA     N    -C     ad_CT_CT_N__C__2
-   CB    CA     N    -C     ad_CT_CT_N__C__3
- [ impropers ]
-;  ai    aj    ak    al
-   -C    CA     N     H     ai_X__X__N__H_
-   CA   OXT     C     O     ai_X__O2_C__O2
-   CG   CE2   CD2   HD2     ai_X__X__CA_HA
-  CD2    CZ   CE2   HE2     ai_X__X__CA_HA
-  CD1    CZ   CE1   HE1     ai_X__X__CA_HA
-   CG   CE1   CD1   HD1     ai_X__X__CA_HA
-  CD1   CD2    CG    CB     ai_CA_CA_CA_CT
-  CE1   CE2    CZ    OH     ai_CA_CA_C__OH
-; end residue TYR-C: 22 atoms, 23 bonds, 22 pdihs, 8 idihs
-
-; GLUTAMIC ACID COO- ANION 
-; 
-[ GLU-C ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N     N   -0.519     0 ; -0.5192
-    H     H    0.305     1 ; -0.2137
-   CA    CT   -0.206     2 ; -0.4196
-   HA    H1    0.140     3 ; -0.2797
-   CB    CT    0.007     4 ; -0.2726
-  HB1    HC   -0.008     5 ; -0.2804
-  HB2    HC   -0.008     6 ; -0.2882
-   CG    CT    0.068     7 ; -0.2207
-  HG1    HC   -0.055     8 ; -0.2755
-  HG2    HC   -0.055     9 ; -0.3303
-   CD     C    0.818    10 ; 0.488
-  OE1    O2   -0.822    11 ; -0.334
-  OE2    O2   -0.822    12 ; -1.156
-    C     C    0.742    13 ; -0.414
-    O    O2   -0.793    14 ; -1.207
-  OXT    O2   -0.793    15 ; -2
- [ bonds ]
-;  ai    aj
-   -C     N
-    N     H
-    N    CA
-   CA    HA
-   CA    CB
-   CB   HB1
-   CB   HB2
-   CB    CG
-   CG   HG1
-   CG   HG2
-   CG    CD
-   CD   OE1
-   CD   OE2
-   CA     C
-    C     O
-    C   OXT
- [ dihedrals ]
-;  ai    aj    ak    al
-   CB    CA     N    -C     ad_CT_CT_N__C__1
-   CB    CA     N    -C     ad_CT_CT_N__C__2
-   CB    CA     N    -C     ad_CT_CT_N__C__3
- [ impropers ]
-;  ai    aj    ak    al
-   -C    CA     N     H     ai_X__X__N__H_
-   CA   OXT     C     O     ai_X__O2_C__O2
-   CG   OE1    CD   OE2     ai_X__O2_C__O2
-; end residue GLU-C: 16 atoms, 16 bonds, 16 pdihs, 3 idihs
-
-; ASPARTIC ACID COO- ANION 
-; 
-[ ASP-C ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N     N   -0.519     0 ; -0.5192
-    H     H    0.305     1 ; -0.2137
-   CA    CT   -0.182     2 ; -0.3954
-   HA    H1    0.105     3 ; -0.2908
-   CB    CT   -0.068     4 ; -0.3585
-  HB1    HC   -0.021     5 ; -0.3797
-  HB2    HC   -0.021     6 ; -0.4009
-   CG     C    0.885     7 ; 0.4842
-  OD1    O2   -0.816     8 ; -0.332
-  OD2    O2   -0.816     9 ; -1.1482
-    C     C    0.726    10 ; -0.4226
-    O    O2   -0.789    11 ; -1.2113
-  OXT    O2   -0.789    12 ; -2
- [ bonds ]
-;  ai    aj
-   -C     N
-    N     H
-    N    CA
-   CA    HA
-   CA    CB
-   CB   HB1
-   CB   HB2
-   CB    CG
-   CG   OD1
-   CG   OD2
-   CA     C
-    C     O
-    C   OXT
- [ dihedrals ]
-;  ai    aj    ak    al
-   CB    CA     N    -C     ad_CT_CT_N__C__1
-   CB    CA     N    -C     ad_CT_CT_N__C__2
-   CB    CA     N    -C     ad_CT_CT_N__C__3
- [ impropers ]
-;  ai    aj    ak    al
-   -C    CA     N     H     ai_X__X__N__H_
-   CA   OXT     C     O     ai_X__O2_C__O2
-   CB   OD1    CG   OD2     ai_X__O2_C__O2
-; end residue ASP-C: 13 atoms, 13 bonds, 13 pdihs, 3 idihs
-
-; LYSINE COO- ANION 
-; 
-[ LYS-C ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N     N   -0.348     0 ; -0.3481
-    H     H    0.276     1 ; -0.0717
-   CA    CT   -0.290     2 ; -0.362
-   HA    H1    0.144     3 ; -0.2182
-   CB    CT   -0.054     4 ; -0.272
-  HB1    HC    0.048     5 ; -0.2238
-  HB2    HC    0.048     6 ; -0.1756
-   CG    CT    0.023     7 ; -0.1529
-  HG1    HC    0.013     8 ; -0.1395
-  HG2    HC    0.013     9 ; -0.1261
-   CD    CT   -0.039    10 ; -0.1653
-  HD1    HC    0.061    11 ; -0.1042
-  HD2    HC    0.061    12 ; -0.0431
-   CE    CT   -0.018    13 ; -0.0607
-  HE1    HP    0.112    14 ; 0.0514
-  HE2    HP    0.112    15 ; 0.1635
-   NZ    N3   -0.374    16 ; -0.2106
-  HZ1     H    0.337    17 ; 0.1268
-  HZ2     H    0.337    18 ; 0.4642
-  HZ3     H    0.337    19 ; 0.8016
-    C     C    0.849    20 ; 1.6504
-    O    O2   -0.825    21 ; 0.8252
-  OXT    O2   -0.825    22 ; -2.22045e-16
- [ bonds ]
-;  ai    aj
-   -C     N
-    N     H
-    N    CA
-   CA    HA
-   CA    CB
-   CB   HB1
-   CB   HB2
-   CB    CG
-   CG   HG1
-   CG   HG2
-   CG    CD
-   CD   HD1
-   CD   HD2
-   CD    CE
-   CE   HE1
-   CE   HE2
-   CE    NZ
-   NZ   HZ1
-   NZ   HZ2
-   NZ   HZ3
-   CA     C
-    C     O
-    C   OXT
- [ dihedrals ]
-;  ai    aj    ak    al
-   CB    CA     N    -C     ad_CT_CT_N__C__1
-   CB    CA     N    -C     ad_CT_CT_N__C__2
-   CB    CA     N    -C     ad_CT_CT_N__C__3
- [ impropers ]
-;  ai    aj    ak    al
-   -C    CA     N     H     ai_X__X__N__H_
-   CA   OXT     C     O     ai_X__O2_C__O2
-; end residue LYS-C: 23 atoms, 23 bonds, 23 pdihs, 2 idihs
-
-; PROLINE COO- ANION 
-; 
-[ PRO-C ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N     N   -0.280     0 ; -0.2802
-   CD    CT    0.043     1 ; -0.2368
-  HD1    H1    0.033     2 ; -0.2037
-  HD2    H1    0.033     3 ; -0.1706
-   CG    CT    0.047     4 ; -0.124
-  HG1    HC    0.017     5 ; -0.1068
-  HG2    HC    0.017     6 ; -0.0896
-   CB    CT   -0.054     7 ; -0.1439
-  HB1    HC    0.038     8 ; -0.1058
-  HB2    HC    0.038     9 ; -0.0677
-   CA    CT   -0.134    10 ; -0.2013
-   HA    H1    0.078    11 ; -0.1237
-    C     C    0.663    12 ; 0.5394
-    O    O2   -0.770    13 ; -0.2303
-  OXT    O2   -0.770    14 ; -1
- [ bonds ]
-;  ai    aj
-   -C     N
-    N    CD
-   CD   HD1
-   CD   HD2
-   CD    CG
-   CG   HG1
-   CG   HG2
-   CG    CB
-   CB   HB1
-   CB   HB2
-    N    CA
-   CA    HA
-   CA     C
-    C     O
-    C   OXT
-   CA    CB
- [ dihedrals ]
-;  ai    aj    ak    al
-   CG    CD     N    -C     ad_CT_CT_N__C__1
-   CG    CD     N    -C     ad_CT_CT_N__C__2
-   CG    CD     N    -C     ad_CT_CT_N__C__3
- [ impropers ]
-;  ai    aj    ak    al
-   CA   OXT     C     O     ai_X__O2_C__O2
-   -C    CD     N    CA     ai_X__CT_N__CT
-; end residue PRO-C: 15 atoms, 16 bonds, 15 pdihs, 2 idihs
-
-; CYSTEINE COO- ANION 
-; 
-[ CYS-C ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N     N   -0.382     0 ; -0.3821
-    H     H    0.268     1 ; -0.114
-   CA    CT   -0.164     2 ; -0.2775
-   HA    H1    0.140     3 ; -0.1379
-   CB    CT   -0.200     4 ; -0.3375
-  HB1    H1    0.144     5 ; -0.1938
-  HB2    H1    0.144     6 ; -0.0501
-   SG    SH   -0.310     7 ; -0.3603
-  HS1    HS    0.207     8 ; -0.1535
-    C     C    0.750     9 ; 0.5962
-    O    O2   -0.798    10 ; -0.2019
-  OXT    O2   -0.798    11 ; -1
- [ bonds ]
-;  ai    aj
-   -C     N
-    N     H
-    N    CA
-   CA    HA
-   CA    CB
-   CB   HB1
-   CB   HB2
-   CB    SG
-   SG   HS1
-   CA     C
-    C     O
-    C   OXT
- [ dihedrals ]
-;  ai    aj    ak    al
-   CB    CA     N    -C     ad_CT_CT_N__C__1
-   CB    CA     N    -C     ad_CT_CT_N__C__2
-   CB    CA     N    -C     ad_CT_CT_N__C__3
- [ impropers ]
-;  ai    aj    ak    al
-   -C    CA     N     H     ai_X__X__N__H_
-   CA   OXT     C     O     ai_X__O2_C__O2
-; end residue CYS-C: 12 atoms, 12 bonds, 12 pdihs, 2 idihs
-
-; CYSTINE(S-S BRIDGE) COO- ANION 
-; 
-[ CYX-C ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N     N   -0.382     0 ; -0.3821
-    H     H    0.268     1 ; -0.114
-   CA    CT   -0.132     2 ; -0.2458
-   HA    H1    0.094     3 ; -0.152
-   CB    CT   -0.194     4 ; -0.3463
-  HB1    H1    0.123     5 ; -0.2235
-  HB2    H1    0.123     6 ; -0.1007
-   SG     S   -0.053     7 ; -0.1536
-    C     C    0.762     8 ; 0.6082
-    O    O2   -0.804     9 ; -0.1959
-  OXT    O2   -0.804    10 ; -1
- [ bonds ]
-;  ai    aj
-   -C     N
-    N     H
-    N    CA
-   CA    HA
-   CA    CB
-   CB   HB1
-   CB   HB2
-   CB    SG
-   CA     C
-    C     O
-    C   OXT
- [ dihedrals ]
-;  ai    aj    ak    al
-   CB    CA     N    -C     ad_CT_CT_N__C__1
-   CB    CA     N    -C     ad_CT_CT_N__C__2
-   CB    CA     N    -C     ad_CT_CT_N__C__3
- [ impropers ]
-;  ai    aj    ak    al
-   -C    CA     N     H     ai_X__X__N__H_
-   CA   OXT     C     O     ai_X__O2_C__O2
-; end residue CYX-C: 11 atoms, 11 bonds, 11 pdihs, 2 idihs
-
-; METHIONINE COO- ANION 
-; 
-[ MET-C ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N     N   -0.382     0 ; -0.3821
-    H     H    0.268     1 ; -0.114
-   CA    CT   -0.260     2 ; -0.3737
-   HA    H1    0.128     3 ; -0.246
-   CB    CT   -0.024     4 ; -0.2696
-  HB1    HC    0.048     5 ; -0.2216
-  HB2    HC    0.048     6 ; -0.1736
-   CG    CT    0.049     7 ; -0.1244
-  HG1    H1    0.032     8 ; -0.0927
-  HG2    H1    0.032     9 ; -0.061
-   SD     S   -0.269    10 ; -0.3302
-   CE    CT   -0.038    11 ; -0.3678
-  HE1    H1    0.062    12 ; -0.3053
-  HE2    H1    0.062    13 ; -0.2428
-  HE3    H1    0.062    14 ; -0.1803
-    C     C    0.801    15 ; 0.621
-    O    O2   -0.810    16 ; -0.1895
-  OXT    O2   -0.810    17 ; -1
- [ bonds ]
-;  ai    aj
-   -C     N
-    N     H
-    N    CA
-   CA    HA
-   CA    CB
-   CB   HB1
-   CB   HB2
-   CB    CG
-   CG   HG1
-   CG   HG2
-   CG    SD
-   SD    CE
-   CE   HE1
-   CE   HE2
-   CE   HE3
-   CA     C
-    C     O
-    C   OXT
- [ dihedrals ]
-;  ai    aj    ak    al
-   CB    CA     N    -C     ad_CT_CT_N__C__1
-   CB    CA     N    -C     ad_CT_CT_N__C__2
-   CB    CA     N    -C     ad_CT_CT_N__C__3
- [ impropers ]
-;  ai    aj    ak    al
-   -C    CA     N     H     ai_X__X__N__H_
-   CA   OXT     C     O     ai_X__O2_C__O2
-; end residue MET-C: 18 atoms, 18 bonds, 18 pdihs, 2 idihs
-
-; end of file /usr/slocal/amber6/dat/all_aminoct94.in
-; from file /usr/slocal/amber6/dat/all_aminont94.in
-; 
-; reading database: All-atom, NH3+ terminal
-; 
-; ALANINE 
-; 
-[ ALA-N ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N    N3    0.141     0 ; 0.1414
-   H1     H    0.200     1 ; 0.3411
-   H2     H    0.200     2 ; 0.5408
-   H3     H    0.200     3 ; 0.7405
-   CA    CT    0.096     4 ; 0.8367
-   HA    HP    0.089     5 ; 0.9256
-   CB    CT   -0.060     6 ; 0.8659
-  HB1    HC    0.030     7 ; 0.8959
-  HB2    HC    0.030     8 ; 0.9259
-  HB3    HC    0.030     9 ; 0.9559
-    C     C    0.616    10 ; 1.5722
-    O     O   -0.572    11 ; 1
- [ bonds ]
-;  ai    aj
-    N    H1
-    N    H2
-    N    H3
-    N    CA
-   CA    HA
-   CA    CB
-   CB   HB1
-   CB   HB2
-   CB   HB3
-   CA     C
-    C     O
- [ impropers ]
-;  ai    aj    ak    al
-   CA    +N     C     O     ai_X__X__C__O_
-; end residue ALA-N: 12 atoms, 11 bonds, 12 pdihs, 1 idihs
-
-; GLYCINE 
-; 
-[ GLY-N ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N    N3    0.294     0 ; 0.2943
-   H1     H    0.164     1 ; 0.4585
-   H2     H    0.164     2 ; 0.6227
-   H3     H    0.164     3 ; 0.7869
-   CA    CT   -0.010     4 ; 0.7769
-  HA1    HP    0.089     5 ; 0.8664
-  HA2    HP    0.089     6 ; 0.9559
-    C     C    0.616     7 ; 1.5722
-    O     O   -0.572     8 ; 1
- [ bonds ]
-;  ai    aj
-    N    H1
-    N    H2
-    N    H3
-    N    CA
-   CA   HA1
-   CA   HA2
-   CA     C
-    C     O
- [ impropers ]
-;  ai    aj    ak    al
-   CA    +N     C     O     ai_X__X__C__O_
-; end residue GLY-N: 9 atoms, 8 bonds, 9 pdihs, 1 idihs
-
-; SERINE 
-; 
-[ SER-N ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N    N3    0.185     0 ; 0.1849
-   H1     H    0.190     1 ; 0.3747
-   H2     H    0.190     2 ; 0.5645
-   H3     H    0.190     3 ; 0.7543
-   CA    CT    0.057     4 ; 0.811
-   HA    HP    0.078     5 ; 0.8892
-   CB    CT    0.260     6 ; 1.1488
-  HB1    H1    0.027     7 ; 1.1761
-  HB2    H1    0.027     8 ; 1.2034
-   OG    OH   -0.671     9 ; 0.532
-   HG    HO    0.424    10 ; 0.9559
-    C     C    0.616    11 ; 1.5722
-    O     O   -0.572    12 ; 1
- [ bonds ]
-;  ai    aj
-    N    H1
-    N    H2
-    N    H3
-    N    CA
-   CA    HA
-   CA    CB
-   CB   HB1
-   CB   HB2
-   CB    OG
-   OG    HG
-   CA     C
-    C     O
- [ impropers ]
-;  ai    aj    ak    al
-   CA    +N     C     O     ai_X__X__C__O_
-; end residue SER-N: 13 atoms, 12 bonds, 13 pdihs, 1 idihs
-
-; THREONINE 
-; 
-[ THR-N ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N    N3    0.181     0 ; 0.1812
-   H1     H    0.193     1 ; 0.3746
-   H2     H    0.193     2 ; 0.568
-   H3     H    0.193     3 ; 0.7614
-   CA    CT    0.003     4 ; 0.7648
-   HA    HP    0.109     5 ; 0.8735
-   CB    CT    0.451     6 ; 1.3249
-   HB    H1   -0.032     7 ; 1.2926
-  CG2    CT   -0.255     8 ; 1.0372
- HG21    HC    0.063     9 ; 1.0999
- HG22    HC    0.063    10 ; 1.1626
- HG23    HC    0.063    11 ; 1.2253
-  OG1    OH   -0.676    12 ; 0.5489
-  HG1    HO    0.407    13 ; 0.9559
-    C     C    0.616    14 ; 1.5722
-    O     O   -0.572    15 ; 1
- [ bonds ]
-;  ai    aj
-    N    H1
-    N    H2
-    N    H3
-    N    CA
-   CA    HA
-   CA    CB
-   CB    HB
-   CB   CG2
-  CG2  HG21
-  CG2  HG22
-  CG2  HG23
-   CB   OG1
-  OG1   HG1
-   CA     C
-    C     O
- [ impropers ]
-;  ai    aj    ak    al
-   CA    +N     C     O     ai_X__X__C__O_
-; end residue THR-N: 16 atoms, 15 bonds, 16 pdihs, 1 idihs
-
-; LEUCINE 
-; 
-[ LEU-N ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N    N3    0.101     0 ; 0.101
-   H1     H    0.215     1 ; 0.3158
-   H2     H    0.215     2 ; 0.5306
-   H3     H    0.215     3 ; 0.7454
-   CA    CT    0.010     4 ; 0.7558
-   HA    HP    0.105     5 ; 0.8611
-   CB    CT   -0.024     6 ; 0.8367
-  HB1    HC    0.026     7 ; 0.8623
-  HB2    HC    0.026     8 ; 0.8879
-   CG    CT    0.342     9 ; 1.23
-   HG    HC   -0.038    10 ; 1.192
-  CD1    CT   -0.411    11 ; 0.7814
- HD11    HC    0.098    12 ; 0.8794
- HD12    HC    0.098    13 ; 0.9774
- HD13    HC    0.098    14 ; 1.0754
-  CD2    CT   -0.410    15 ; 0.665
- HD21    HC    0.098    16 ; 0.763
- HD22    HC    0.098    17 ; 0.861
- HD23    HC    0.098    18 ; 0.959
-    C     C    0.612    19 ; 1.5713
-    O     O   -0.571    20 ; 1
- [ bonds ]
-;  ai    aj
-    N    H1
-    N    H2
-    N    H3
-    N    CA
-   CA    HA
-   CA    CB
-   CB   HB1
-   CB   HB2
-   CB    CG
-   CG    HG
-   CG   CD1
-  CD1  HD11
-  CD1  HD12
-  CD1  HD13
-   CG   CD2
-  CD2  HD21
-  CD2  HD22
-  CD2  HD23
-   CA     C
-    C     O
- [ impropers ]
-;  ai    aj    ak    al
-   CA    +N     C     O     ai_X__X__C__O_
-; end residue LEU-N: 21 atoms, 20 bonds, 21 pdihs, 1 idihs
-
-; ISOLEUCINE 
-; 
-[ ILE-N ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N    N3    0.031     0 ; 0.0311
-   H1     H    0.233     1 ; 0.264
-   H2     H    0.233     2 ; 0.4969
-   H3     H    0.233     3 ; 0.7298
-   CA    CT    0.026     4 ; 0.7555
-   HA    HP    0.103     5 ; 0.8586
-   CB    CT    0.189     6 ; 1.0471
-   HB    HC    0.021     7 ; 1.0684
-  CG2    CT   -0.372     8 ; 0.6964
- HG21    HC    0.095     9 ; 0.7911
- HG22    HC    0.095    10 ; 0.8858
- HG23    HC    0.095    11 ; 0.9805
-  CG1    CT   -0.039    12 ; 0.9418
- HG11    HC    0.020    13 ; 0.9619
- HG12    HC    0.020    14 ; 0.982
-  CD1    CT   -0.091    15 ; 0.8912
- HD11    HC    0.023    16 ; 0.9138
- HD12    HC    0.023    17 ; 0.9364
- HD13    HC    0.023    18 ; 0.959
-    C     C    0.612    19 ; 1.5713
-    O     O   -0.571    20 ; 1
- [ bonds ]
-;  ai    aj
-    N    H1
-    N    H2
-    N    H3
-    N    CA
-   CA    HA
-   CA    CB
-   CB    HB
-   CB   CG2
-  CG2  HG21
-  CG2  HG22
-  CG2  HG23
-   CB   CG1
-  CG1  HG11
-  CG1  HG12
-  CG1   CD1
-  CD1  HD11
-  CD1  HD12
-  CD1  HD13
-   CA     C
-    C     O
- [ impropers ]
-;  ai    aj    ak    al
-   CA    +N     C     O     ai_X__X__C__O_
-; end residue ILE-N: 21 atoms, 20 bonds, 21 pdihs, 1 idihs
-
-; VALINE 
-; 
-[ VAL-N ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N    N3    0.058     0 ; 0.0577
-   H1     H    0.227     1 ; 0.2849
-   H2     H    0.227     2 ; 0.5121
-   H3     H    0.227     3 ; 0.7393
-   CA    CT   -0.005     4 ; 0.7339
-   HA    HP    0.109     5 ; 0.8432
-   CB    CT    0.320     6 ; 1.1628
-   HB    HC   -0.022     7 ; 1.1407
-  CG1    CT   -0.313     8 ; 0.8278
- HG11    HC    0.073     9 ; 0.9013
- HG12    HC    0.073    10 ; 0.9748
- HG13    HC    0.073    11 ; 1.0483
-  CG2    CT   -0.313    12 ; 0.7354
- HG21    HC    0.073    13 ; 0.8089
- HG22    HC    0.073    14 ; 0.8824
- HG23    HC    0.073    15 ; 0.9559
-    C     C    0.616    16 ; 1.5722
-    O     O   -0.572    17 ; 1
- [ bonds ]
-;  ai    aj
-    N    H1
-    N    H2
-    N    H3
-    N    CA
-   CA    HA
-   CA    CB
-   CB    HB
-   CB   CG1
-  CG1  HG11
-  CG1  HG12
-  CG1  HG13
-   CB   CG2
-  CG2  HG21
-  CG2  HG22
-  CG2  HG23
-   CA     C
-    C     O
- [ impropers ]
-;  ai    aj    ak    al
-   CA    +N     C     O     ai_X__X__C__O_
-; end residue VAL-N: 18 atoms, 17 bonds, 18 pdihs, 1 idihs
-
-; ASPARAGINE 
-; 
-[ ASN-N ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N    N3    0.180     0 ; 0.1801
-   H1     H    0.192     1 ; 0.3722
-   H2     H    0.192     2 ; 0.5643
-   H3     H    0.192     3 ; 0.7564
-   CA    CT    0.037     4 ; 0.7932
-   HA    HP    0.123     5 ; 0.9163
-   CB    CT   -0.028     6 ; 0.888
-  HB1    HC    0.051     7 ; 0.9395
-  HB2    HC    0.051     8 ; 0.991
-   CG     C    0.583     9 ; 1.5743
-  OD1     O   -0.574    10 ; 0.9999
-  ND2     N   -0.863    11 ; 0.1365
- HD21     H    0.410    12 ; 0.5462
- HD22     H    0.410    13 ; 0.9559
-    C     C    0.616    14 ; 1.5722
-    O     O   -0.572    15 ; 1
- [ bonds ]
-;  ai    aj
-    N    H1
-    N    H2
-    N    H3
-    N    CA
-   CA    HA
-   CA    CB
-   CB   HB1
-   CB   HB2
-   CB    CG
-   CG   OD1
-   CG   ND2
-  ND2  HD21
-  ND2  HD22
-   CA     C
-    C     O
- [ impropers ]
-;  ai    aj    ak    al
-   CA    +N     C     O     ai_X__X__C__O_
-   CB   ND2    CG   OD1     ai_X__X__C__O_
-   CG  HD21   ND2  HD22     ai_X__X__N__H_
-; end residue ASN-N: 16 atoms, 15 bonds, 16 pdihs, 3 idihs
-
-; GLUTAMINE 
-; 
-[ GLN-N ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N    N3    0.149     0 ; 0.1493
-   H1     H    0.200     1 ; 0.3489
-   H2     H    0.200     2 ; 0.5485
-   H3     H    0.200     3 ; 0.7481
-   CA    CT    0.054     4 ; 0.8017
-   HA    HP    0.102     5 ; 0.9032
-   CB    CT    0.065     6 ; 0.9683
-  HB1    HC    0.005     7 ; 0.9733
-  HB2    HC    0.005     8 ; 0.9783
-   CG    CT   -0.090     9 ; 0.888
-  HG1    HC    0.033    10 ; 0.9211
-  HG2    HC    0.033    11 ; 0.9542
-   CD     C    0.735    12 ; 1.6896
-  OE1     O   -0.613    13 ; 1.0763
-  NE2     N   -1.003    14 ; 0.0732
- HE21     H    0.443    15 ; 0.5161
- HE22     H    0.443    16 ; 0.959
-    C     C    0.612    17 ; 1.5713
-    O     O   -0.571    18 ; 1
- [ bonds ]
-;  ai    aj
-    N    H1
-    N    H2
-    N    H3
-    N    CA
-   CA    HA
-   CA    CB
-   CB   HB1
-   CB   HB2
-   CB    CG
-   CG   HG1
-   CG   HG2
-   CG    CD
-   CD   OE1
-   CD   NE2
-  NE2  HE21
-  NE2  HE22
-   CA     C
-    C     O
- [ impropers ]
-;  ai    aj    ak    al
-   CA    +N     C     O     ai_X__X__C__O_
-   CG   NE2    CD   OE1     ai_X__X__C__O_
-   CD  HE21   NE2  HE22     ai_X__X__N__H_
-; end residue GLN-N: 19 atoms, 18 bonds, 19 pdihs, 3 idihs
-
-; ARGININE 
-; 
-[ ARG-N ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N    N3    0.131     0 ; 0.1305
-   H1     H    0.208     1 ; 0.3388
-   H2     H    0.208     2 ; 0.5471
-   H3     H    0.208     3 ; 0.7554
-   CA    CT   -0.022     4 ; 0.7331
-   HA    HP    0.124     5 ; 0.8573
-   CB    CT    0.012     6 ; 0.8691
-  HB1    HC    0.023     7 ; 0.8917
-  HB2    HC    0.023     8 ; 0.9143
-   CG    CT    0.024     9 ; 0.9379
-  HG1    HC    0.031    10 ; 0.9688
-  HG2    HC    0.031    11 ; 0.9997
-   CD    CT    0.093    12 ; 1.0932
-  HD1    H1    0.053    13 ; 1.1459
-  HD2    H1    0.053    14 ; 1.1986
-   NE    N2   -0.565    15 ; 0.6336
-   HE     H    0.359    16 ; 0.9928
-   CZ    CA    0.828    17 ; 1.8209
-  NH1    N2   -0.869    18 ; 0.9516
- HH11     H    0.449    19 ; 1.401
- HH12     H    0.449    20 ; 1.8504
-  NH2    N2   -0.869    21 ; 0.9811
- HH21     H    0.449    22 ; 1.4305
- HH22     H    0.449    23 ; 1.8799
-    C     C    0.721    24 ; 2.6013
-    O     O   -0.601    25 ; 2
- [ bonds ]
-;  ai    aj
-    N    H1
-    N    H2
-    N    H3
-    N    CA
-   CA    HA
-   CA    CB
-   CB   HB1
-   CB   HB2
-   CB    CG
-   CG   HG1
-   CG   HG2
-   CG    CD
-   CD   HD1
-   CD   HD2
-   CD    NE
-   NE    HE
-   NE    CZ
-   CZ   NH1
-  NH1  HH11
-  NH1  HH12
-   CZ   NH2
-  NH2  HH21
-  NH2  HH22
-   CA     C
-    C     O
- [ impropers ]
-;  ai    aj    ak    al
-   CA    +N     C     O     ai_X__X__C__O_
-   NE   NH1    CZ   NH2     ai_X__N2_CA_N2
-   CD    CZ    NE    HE     ai_X__X__N2_H_
-   CZ  HH11   NH1  HH12     ai_X__X__N2_H_
-   CZ  HH21   NH2  HH22     ai_X__X__N2_H_
-; end residue ARG-N: 26 atoms, 25 bonds, 26 pdihs, 5 idihs
-
-; HISTIDINE DELTAH 
-; 
-[ HID-N ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N    N3    0.154     0 ; 0.1542
-   H1     H    0.196     1 ; 0.3505
-   H2     H    0.196     2 ; 0.5468
-   H3     H    0.196     3 ; 0.7431
-   CA    CT    0.096     4 ; 0.8395
-   HA    HP    0.096     5 ; 0.9353
-   CB    CT    0.026     6 ; 0.9612
-  HB1    HC    0.021     7 ; 0.9821
-  HB2    HC    0.021     8 ; 1.003
-   CG    CC   -0.040     9 ; 0.9631
-  ND1    NA   -0.382    10 ; 0.5812
-  HD1     H    0.363    11 ; 0.9444
-  CE1    CR    0.213    12 ; 1.1571
-  HE1    H5    0.139    13 ; 1.2956
-  NE2    NB   -0.571    14 ; 0.7245
-  CD2    CV    0.105    15 ; 0.8291
-  HD2    H4    0.130    16 ; 0.959
-    C     C    0.612    17 ; 1.5713
-    O     O   -0.571    18 ; 1
- [ bonds ]
-;  ai    aj
-    N    H1
-    N    H2
-    N    H3
-    N    CA
-   CA    HA
-   CA    CB
-   CB   HB1
-   CB   HB2
-   CB    CG
-   CG   ND1
-  ND1   HD1
-  ND1   CE1
-  CE1   HE1
-  CE1   NE2
-  NE2   CD2
-  CD2   HD2
-   CA     C
-    C     O
-   CG   CD2
- [ impropers ]
-;  ai    aj    ak    al
-   CA    +N     C     O     ai_X__X__C__O_
-   CG   CE1   ND1   HD1     ai_X__X__NA_H_
-   CG   NE2   CD2   HD2     ai_X__X__CV_H4
-  ND1   NE2   CE1   HE1     ai_X__X__CR_H5
-  ND1   CD2    CG    CB     ai_NA_CV_CC_CT
-; end residue HID-N: 19 atoms, 19 bonds, 19 pdihs, 5 idihs
-
-; HISTIDINE EPSILONH 
-; 
-[ HIE-N ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N    N3    0.147     0 ; 0.1472
-   H1     H    0.202     1 ; 0.3488
-   H2     H    0.202     2 ; 0.5504
-   H3     H    0.202     3 ; 0.752
-   CA    CT    0.024     4 ; 0.7756
-   HA    HP    0.138     5 ; 0.9136
-   CB    CT    0.049     6 ; 0.9625
-  HB1    HC    0.022     7 ; 0.9848
-  HB2    HC    0.022     8 ; 1.0071
-   CG    CC    0.174     9 ; 1.1811
-  ND1    NB   -0.558    10 ; 0.6232
-  CE1    CR    0.180    11 ; 0.8036
-  HE1    H5    0.140    12 ; 0.9433
-  NE2    NA   -0.278    13 ; 0.6652
-  HE2     H    0.332    14 ; 0.9976
-  CD2    CW   -0.235    15 ; 0.7627
-  HD2    H4    0.196    16 ; 0.959
-    C     C    0.612    17 ; 1.5713
-    O     O   -0.571    18 ; 1
- [ bonds ]
-;  ai    aj
-    N    H1
-    N    H2
-    N    H3
-    N    CA
-   CA    HA
-   CA    CB
-   CB   HB1
-   CB   HB2
-   CB    CG
-   CG   ND1
-  ND1   CE1
-  CE1   HE1
-  CE1   NE2
-  NE2   HE2
-  NE2   CD2
-  CD2   HD2
-   CA     C
-    C     O
-   CG   CD2
- [ impropers ]
-;  ai    aj    ak    al
-   CA    +N     C     O     ai_X__X__C__O_
-  CE1   CD2   NE2   HE2     ai_X__X__NA_H_
-   CG   NE2   CD2   HD2     ai_X__X__CW_H4
-  ND1   NE2   CE1   HE1     ai_X__X__CR_H5
-  ND1   CD2    CG    CB     ai_NB_CW_CC_CT
-; end residue HIE-N: 19 atoms, 19 bonds, 19 pdihs, 5 idihs
-
-; HISTIDINE PLUS 
-; 
-[ HIP-N ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N    N3    0.256     0 ; 0.256
-   H1     H    0.170     1 ; 0.4264
-   H2     H    0.170     2 ; 0.5968
-   H3     H    0.170     3 ; 0.7672
-   CA    CT    0.058     4 ; 0.8253
-   HA    HP    0.105     5 ; 0.93
-   CB    CT    0.048     6 ; 0.9784
-  HB1    HC    0.053     7 ; 1.0315
-  HB2    HC    0.053     8 ; 1.0846
-   CG    CC   -0.024     9 ; 1.061
-  ND1    NA   -0.151    10 ; 0.91
-  HD1     H    0.382    11 ; 1.2921
-  CE1    CR   -0.001    12 ; 1.291
-  HE1    H5    0.265    13 ; 1.5555
-  NE2    NA   -0.174    14 ; 1.3816
-  HE2     H    0.392    15 ; 1.7737
-  CD2    CW   -0.143    16 ; 1.6304
-  HD2    H4    0.249    17 ; 1.8799
-    C     C    0.721    18 ; 2.6013
-    O     O   -0.601    19 ; 2
- [ bonds ]
-;  ai    aj
-    N    H1
-    N    H2
-    N    H3
-    N    CA
-   CA    HA
-   CA    CB
-   CB   HB1
-   CB   HB2
-   CB    CG
-   CG   ND1
-  ND1   HD1
-  ND1   CE1
-  CE1   HE1
-  CE1   NE2
-  NE2   HE2
-  NE2   CD2
-  CD2   HD2
-   CA     C
-    C     O
-   CG   CD2
- [ impropers ]
-;  ai    aj    ak    al
-   CA    +N     C     O     ai_X__X__C__O_
-   CG   CE1   ND1   HD1     ai_X__X__NA_H_
-  CE1   CD2   NE2   HE2     ai_X__X__NA_H_
-   CG   NE2   CD2   HD2     ai_X__X__CW_H4
-  ND1   NE2   CE1   HE1     ai_X__X__CR_H5
-  ND1   CD2    CG    CB     ai_NA_CW_CC_CT
-; end residue HIP-N: 20 atoms, 20 bonds, 20 pdihs, 6 idihs
-
-; TRYPTOPHAN 
-; 
-[ TRP-N ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N    N3    0.191     0 ; 0.1913
-   H1     H    0.189     1 ; 0.3801
-   H2     H    0.189     2 ; 0.5689
-   H3     H    0.189     3 ; 0.7577
-   CA    CT    0.042     4 ; 0.7998
-   HA    HP    0.116     5 ; 0.916
-   CB    CT    0.054     6 ; 0.9703
-  HB1    HC    0.022     7 ; 0.9925
-  HB2    HC    0.022     8 ; 1.0147
-   CG    C*   -0.165     9 ; 0.8493
-  CD1    CW   -0.179    10 ; 0.6705
-  HD1    H4    0.220    11 ; 0.89
-  NE1    NA   -0.344    12 ; 0.5456
-  HE1     H    0.341    13 ; 0.8868
-  CE2    CN    0.158    14 ; 1.0443
-  CZ2    CA   -0.271    15 ; 0.7733
-  HZ2    HA    0.159    16 ; 0.9322
-  CH2    CA   -0.108    17 ; 0.8242
-  HH2    HA    0.141    18 ; 0.9653
-  CZ3    CA   -0.203    19 ; 0.7619
-  HZ3    HA    0.146    20 ; 0.9077
-  CE3    CA   -0.227    21 ; 0.6812
-  HE3    HA    0.165    22 ; 0.8458
-  CD2    CB    0.113    23 ; 0.959
-    C     C    0.612    24 ; 1.5713
-    O     O   -0.571    25 ; 1
- [ bonds ]
-;  ai    aj
-    N    H1
-    N    H2
-    N    H3
-    N    CA
-   CA    HA
-   CA    CB
-   CB   HB1
-   CB   HB2
-   CB    CG
-   CG   CD1
-  CD1   HD1
-  CD1   NE1
-  NE1   HE1
-  NE1   CE2
-  CE2   CZ2
-  CZ2   HZ2
-  CZ2   CH2
-  CH2   HH2
-  CH2   CZ3
-  CZ3   HZ3
-  CZ3   CE3
-  CE3   HE3
-  CE3   CD2
-   CA     C
-    C     O
-   CG   CD2
-  CE2   CD2
- [ impropers ]
-;  ai    aj    ak    al
-   CA    +N     C     O     ai_X__X__C__O_
-  CD1   CE2   NE1   HE1     ai_X__X__NA_H_
-  CE2   CH2   CZ2   HZ2     ai_X__X__CA_HA
-  CZ2   CZ3   CH2   HH2     ai_X__X__CA_HA
-  CH2   CE3   CZ3   HZ3     ai_X__X__CA_HA
-  CZ3   CD2   CE3   HE3     ai_X__X__CA_HA
-   CG   NE1   CD1   HD1     ai_X__X__CW_H4
-  CD1   CD2    CG    CB     ai_CW_CB_C*_CT
-; end residue TRP-N: 26 atoms, 27 bonds, 26 pdihs, 8 idihs
-
-; PHENYLALANINE 
-; 
-[ PHE-N ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N    N3    0.174     0 ; 0.1737
-   H1     H    0.192     1 ; 0.3658
-   H2     H    0.192     2 ; 0.5579
-   H3     H    0.192     3 ; 0.75
-   CA    CT    0.073     4 ; 0.8233
-   HA    HP    0.104     5 ; 0.9274
-   CB    CT    0.033     6 ; 0.9604
-  HB1    HC    0.010     7 ; 0.9708
-  HB2    HC    0.010     8 ; 0.9812
-   CG    CA    0.003     9 ; 0.9843
-  CD1    CA   -0.139    10 ; 0.8451
-  HD1    HA    0.137    11 ; 0.9825
-  CE1    CA   -0.160    12 ; 0.8223
-  HE1    HA    0.143    13 ; 0.9656
-   CZ    CA   -0.121    14 ; 0.8448
-   HZ    HA    0.133    15 ; 0.9777
-  CE2    CA   -0.160    16 ; 0.8174
-  HE2    HA    0.143    17 ; 0.9607
-  CD2    CA   -0.139    18 ; 0.8216
-  HD2    HA    0.137    19 ; 0.959
-    C     C    0.612    20 ; 1.5713
-    O     O   -0.571    21 ; 1
- [ bonds ]
-;  ai    aj
-    N    H1
-    N    H2
-    N    H3
-    N    CA
-   CA    HA
-   CA    CB
-   CB   HB1
-   CB   HB2
-   CB    CG
-   CG   CD1
-  CD1   HD1
-  CD1   CE1
-  CE1   HE1
-  CE1    CZ
-   CZ    HZ
-   CZ   CE2
-  CE2   HE2
-  CE2   CD2
-  CD2   HD2
-   CA     C
-    C     O
-   CG   CD2
- [ impropers ]
-;  ai    aj    ak    al
-   CA    +N     C     O     ai_X__X__C__O_
-   CG   CE2   CD2   HD2     ai_X__X__CA_HA
-  CD2    CZ   CE2   HE2     ai_X__X__CA_HA
-  CE1   CE2    CZ    HZ     ai_X__X__CA_HA
-  CD1    CZ   CE1   HE1     ai_X__X__CA_HA
-   CG   CE1   CD1   HD1     ai_X__X__CA_HA
-  CD1   CD2    CG    CB     ai_CA_CA_CA_CT
-; end residue PHE-N: 22 atoms, 22 bonds, 22 pdihs, 7 idihs
-
-; TYROSINE 
-; 
-[ TYR-N ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N    N3    0.194     0 ; 0.194
-   H1     H    0.187     1 ; 0.3813
-   H2     H    0.187     2 ; 0.5686
-   H3     H    0.187     3 ; 0.7559
-   CA    CT    0.057     4 ; 0.8129
-   HA    HP    0.098     5 ; 0.9112
-   CB    CT    0.066     6 ; 0.9771
-  HB1    HC    0.010     7 ; 0.9873
-  HB2    HC    0.010     8 ; 0.9975
-   CG    CA   -0.021     9 ; 0.977
-  CD1    CA   -0.200    10 ; 0.7768
-  HD1    HA    0.172    11 ; 0.9488
-  CE1    CA   -0.224    12 ; 0.7249
-  HE1    HA    0.165    13 ; 0.8899
-   CZ     C    0.314    14 ; 1.2038
-   OH    OH   -0.558    15 ; 0.646
-   HH    HO    0.400    16 ; 1.0461
-  CE2    CA   -0.224    17 ; 0.8222
-  HE2    HA    0.165    18 ; 0.9872
-  CD2    CA   -0.200    19 ; 0.787
-  HD2    HA    0.172    20 ; 0.959
-    C     C    0.612    21 ; 1.5713
-    O     O   -0.571    22 ; 1
- [ bonds ]
-;  ai    aj
-    N    H1
-    N    H2
-    N    H3
-    N    CA
-   CA    HA
-   CA    CB
-   CB   HB1
-   CB   HB2
-   CB    CG
-   CG   CD1
-  CD1   HD1
-  CD1   CE1
-  CE1   HE1
-  CE1    CZ
-   CZ    OH
-   OH    HH
-   CZ   CE2
-  CE2   HE2
-  CE2   CD2
-  CD2   HD2
-   CA     C
-    C     O
-   CG   CD2
- [ impropers ]
-;  ai    aj    ak    al
-   CA    +N     C     O     ai_X__X__C__O_
-   CG   CE2   CD2   HD2     ai_X__X__CA_HA
-  CD2    CZ   CE2   HE2     ai_X__X__CA_HA
-  CD1    CZ   CE1   HE1     ai_X__X__CA_HA
-   CG   CE1   CD1   HD1     ai_X__X__CA_HA
-  CD1   CD2    CG    CB     ai_CA_CA_CA_CT
-  CE1   CE2    CZ    OH     ai_CA_CA_C__OH
-; end residue TYR-N: 23 atoms, 23 bonds, 23 pdihs, 7 idihs
-
-; GLUTAMIC ACID 
-; 
-[ GLU-N ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N    N3    0.002     0 ; 0.0017
-   H1     H    0.239     1 ; 0.2408
-   H2     H    0.239     2 ; 0.4799
-   H3     H    0.239     3 ; 0.719
-   CA    CT    0.059     4 ; 0.7778
-   HA    HP    0.120     5 ; 0.898
-   CB    CT    0.091     6 ; 0.9889
-  HB1    HC   -0.023     7 ; 0.9657
-  HB2    HC   -0.023     8 ; 0.9425
-   CG    CT   -0.024     9 ; 0.9189
-  HG1    HC   -0.032    10 ; 0.8874
-  HG2    HC   -0.032    11 ; 0.8559
-   CD     C    0.809    12 ; 1.6646
-  OE1    O2   -0.819    13 ; 0.8457
-  OE2    O2   -0.819    14 ; 0.0268
-    C     C    0.562    15 ; 0.5889
-    O     O   -0.589    16 ; 2.22045e-16
- [ bonds ]
-;  ai    aj
-    N    H1
-    N    H2
-    N    H3
-    N    CA
-   CA    HA
-   CA    CB
-   CB   HB1
-   CB   HB2
-   CB    CG
-   CG   HG1
-   CG   HG2
-   CG    CD
-   CD   OE1
-   CD   OE2
-   CA     C
-    C     O
- [ impropers ]
-;  ai    aj    ak    al
-   CA    +N     C     O     ai_X__X__C__O_
-   CG   OE1    CD   OE2     ai_X__O2_C__O2
-; end residue GLU-N: 17 atoms, 16 bonds, 17 pdihs, 2 idihs
-
-; ASPARTIC ACID 
-; 
-[ ASP-N ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N    N3    0.078     0 ; 0.0782
-   H1     H    0.220     1 ; 0.2982
-   H2     H    0.220     2 ; 0.5182
-   H3     H    0.220     3 ; 0.7382
-   CA    CT    0.029     4 ; 0.7674
-   HA    HP    0.114     5 ; 0.8815
-   CB    CT   -0.024     6 ; 0.858
-  HB1    HC   -0.017     7 ; 0.8411
-  HB2    HC   -0.017     8 ; 0.8242
-   CG     C    0.819     9 ; 1.6436
-  OD1    O2   -0.808    10 ; 0.8352
-  OD2    O2   -0.808    11 ; 0.0268
-    C     C    0.562    12 ; 0.5889
-    O     O   -0.589    13 ; 0
- [ bonds ]
-;  ai    aj
-    N    H1
-    N    H2
-    N    H3
-    N    CA
-   CA    HA
-   CA    CB
-   CB   HB1
-   CB   HB2
-   CB    CG
-   CG   OD1
-   CG   OD2
-   CA     C
-    C     O
- [ impropers ]
-;  ai    aj    ak    al
-   CA    +N     C     O     ai_X__X__C__O_
-   CB   OD1    CG   OD2     ai_X__O2_C__O2
-; end residue ASP-N: 14 atoms, 13 bonds, 14 pdihs, 2 idihs
-
-; LYSINE 
-; 
-[ LYS-N ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N    N3    0.097     0 ; 0.0966
-   H1     H    0.216     1 ; 0.3131
-   H2     H    0.216     2 ; 0.5296
-   H3     H    0.216     3 ; 0.7461
-   CA    CT   -0.002     4 ; 0.7446
-   HA    HP    0.118     5 ; 0.8626
-   CB    CT    0.021     6 ; 0.8838
-  HB1    HC    0.028     7 ; 0.9121
-  HB2    HC    0.028     8 ; 0.9404
-   CG    CT   -0.005     9 ; 0.9356
-  HG1    HC    0.012    10 ; 0.9477
-  HG2    HC    0.012    11 ; 0.9598
-   CD    CT   -0.061    12 ; 0.899
-  HD1    HC    0.063    13 ; 0.9623
-  HD2    HC    0.063    14 ; 1.0256
-   CE    CT   -0.018    15 ; 1.0075
-  HE1    HP    0.117    16 ; 1.1246
-  HE2    HP    0.117    17 ; 1.2417
-   NZ    N3   -0.376    18 ; 0.8653
-  HZ1     H    0.338    19 ; 1.2035
-  HZ2     H    0.338    20 ; 1.5417
-  HZ3     H    0.338    21 ; 1.8799
-    C     C    0.721    22 ; 2.6013
-    O     O   -0.601    23 ; 2
- [ bonds ]
-;  ai    aj
-    N    H1
-    N    H2
-    N    H3
-    N    CA
-   CA    HA
-   CA    CB
-   CB   HB1
-   CB   HB2
-   CB    CG
-   CG   HG1
-   CG   HG2
-   CG    CD
-   CD   HD1
-   CD   HD2
-   CD    CE
-   CE   HE1
-   CE   HE2
-   CE    NZ
-   NZ   HZ1
-   NZ   HZ2
-   NZ   HZ3
-   CA     C
-    C     O
- [ impropers ]
-;  ai    aj    ak    al
-   CA    +N     C     O     ai_X__X__C__O_
-; end residue LYS-N: 24 atoms, 23 bonds, 24 pdihs, 1 idihs
-
-; PROLINE 
-; 
-[ PRO-N ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N    N3   -0.202     0 ; -0.202
-   H1     H    0.312     1 ; 0.11
-   H2     H    0.312     2 ; 0.422
-   CD    CT   -0.012     3 ; 0.41
-  HD1    HP    0.100     4 ; 0.51
-  HD2    HP    0.100     5 ; 0.61
-   CG    CT   -0.121     6 ; 0.489
-  HG1    HC    0.100     7 ; 0.589
-  HG2    HC    0.100     8 ; 0.689
-   CB    CT   -0.115     9 ; 0.574
-  HB1    HC    0.100    10 ; 0.674
-  HB2    HC    0.100    11 ; 0.774
-   CA    CT    0.100    12 ; 0.874
-   HA    HP    0.100    13 ; 0.974
-    C     C    0.526    14 ; 1.5
-    O     O   -0.500    15 ; 1
- [ bonds ]
-;  ai    aj
-    N    H1
-    N    H2
-    N    CD
-   CD   HD1
-   CD   HD2
-   CD    CG
-   CG   HG1
-   CG   HG2
-   CG    CB
-   CB   HB1
-   CB   HB2
-    N    CA
-   CA    HA
-   CA     C
-    C     O
-   CB    CA
- [ impropers ]
-;  ai    aj    ak    al
-   CA    +N     C     O     ai_X__X__C__O_
-; end residue PRO-N: 16 atoms, 16 bonds, 16 pdihs, 1 idihs
-
-; CYSTEINE 
-; 
-[ CYS-N ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N    N3    0.133     0 ; 0.1325
-   H1     H    0.202     1 ; 0.3348
-   H2     H    0.202     2 ; 0.5371
-   H3     H    0.202     3 ; 0.7394
-   CA    CT    0.093     4 ; 0.8321
-   HA    HP    0.141     5 ; 0.9732
-   CB    CT   -0.119     6 ; 0.8537
-  HB1    H1    0.119     7 ; 0.9725
-  HB2    H1    0.119     8 ; 1.0913
-   SG    SH   -0.330     9 ; 0.7615
-  HS1    HS    0.198    10 ; 0.959
-    C     C    0.612    11 ; 1.5713
-    O     O   -0.571    12 ; 1
- [ bonds ]
-;  ai    aj
-    N    H1
-    N    H2
-    N    H3
-    N    CA
-   CA    HA
-   CA    CB
-   CB   HB1
-   CB   HB2
-   CB    SG
-   SG   HS1
-   CA     C
-    C     O
- [ impropers ]
-;  ai    aj    ak    al
-   CA    +N     C     O     ai_X__X__C__O_
-; end residue CYS-N: 13 atoms, 12 bonds, 13 pdihs, 1 idihs
-
-; CYSTINE(S-S BRIDGE) 
-; 
-[ CYX-N ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N    N3    0.207     0 ; 0.2069
-   H1     H    0.181     1 ; 0.3884
-   H2     H    0.181     2 ; 0.5699
-   H3     H    0.181     3 ; 0.7514
-   CA    CT    0.105     4 ; 0.8569
-   HA    HP    0.092     5 ; 0.9491
-   CB    CT   -0.028     6 ; 0.9214
-  HB1    H1    0.068     7 ; 0.9894
-  HB2    H1    0.068     8 ; 1.0574
-   SG     S   -0.098     9 ; 0.959
-    C     C    0.612    10 ; 1.5713
-    O     O   -0.571    11 ; 1
- [ bonds ]
-;  ai    aj
-    N    H1
-    N    H2
-    N    H3
-    N    CA
-   CA    HA
-   CA    CB
-   CB   HB1
-   CB   HB2
-   CB    SG
-   CA     C
-    C     O
- [ impropers ]
-;  ai    aj    ak    al
-   CA    +N     C     O     ai_X__X__C__O_
-; end residue CYX-N: 12 atoms, 11 bonds, 12 pdihs, 1 idihs
-
-; METHIONINE 
-; 
-[ MET-N ]
- [ atoms ]
-;name  type   charge    cg ; qtot
-    N    N3    0.159     0 ; 0.1592
-   H1     H    0.198     1 ; 0.3576
-   H2     H    0.198     2 ; 0.556
-   H3     H    0.198     3 ; 0.7544
-   CA    CT    0.022     4 ; 0.7765
-   HA    HP    0.112     5 ; 0.8881
-   CB    CT    0.086     6 ; 0.9746
-  HB1    HC    0.013     7 ; 0.9871
-  HB2    HC    0.013     8 ; 0.9996
-   CG    CT    0.033     9 ; 1.033
-  HG1    H1    0.029    10 ; 1.0622
-  HG2    H1    0.029    11 ; 1.0914
-   SD     S   -0.277    12 ; 0.814
-   CE    CT   -0.034    13 ; 0.7799
-  HE1    H1    0.060    14 ; 0.8396
-  HE2    H1    0.060    15 ; 0.8993
-  HE3    H1    0.060    16 ; 0.959
-    C     C    0.612    17 ; 1.5713
-    O     O   -0.571    18 ; 1
- [ bonds ]
-;  ai    aj
-    N    H1
-    N    H2
-    N    H3
-    N    CA
-   CA    HA
-   CA    CB
-   CB   HB1
-   CB   HB2
-   CB    CG
-   CG   HG1
-   CG   HG2
-   CG    SD
-   SD    CE
-   CE   HE1
-   CE   HE2
-   CE   HE3
-   CA     C
-    C     O
- [ impropers ]
-;  ai    aj    ak    al
-   CA    +N     C     O     ai_X__X__C__O_
-; end residue MET-N: 19 atoms, 18 bonds, 19 pdihs, 1 idihs
-
-; end of file /usr/slocal/amber6/dat/all_aminont94.in
-; Found 79 residues
diff --git a/src/contrib/scripts/ffamberbon.itp b/src/contrib/scripts/ffamberbon.itp
deleted file mode 100644 (file)
index f37d7d7..0000000
+++ /dev/null
@@ -1,418 +0,0 @@
-; Amber forcefield converted to Gromacs
-; from file /usr/slocal/amber6/dat/parm98.dat
-
-; PARM94 for DNA, RNA and proteins with TIP3P Water. USE SCEE=1.2 in energy progs
-; 
-
-[ bondtypes ]
-;  ai    aj   ft       b0       kb
-;                    (nm) (kj/mol/nm2)
-   OW    HW    1  0.09572   231530 ; TIP3P water
-   HW    HW    1  0.15136   231530 ; TIP3P water
-   C     CA    1   0.1409   196361 ; JCC,7,(1986),230; TYR
-   C     CB    1   0.1419   187150 ; JCC,7,(1986),230; GUA
-   C     CM    1   0.1444   171659 ; JCC,7,(1986),230; THY,URA
-   C     CT    1   0.1522   132722 ; JCC,7,(1986),230; AA
-   C     N*    1   0.1383   177520 ; JCC,7,(1986),230; CYT,URA
-   C     NA    1   0.1388   175008 ; JCC,7,(1986),230; GUA.URA
-   C     NC    1   0.1358   191337 ; JCC,7,(1986),230; CYT
-   C     O     1   0.1229   238648 ; JCC,7,(1986),230; AA,CYT,GUA,THY,URA
-   C     O2    1    0.125   274654 ; JCC,7,(1986),230; GLU,ASP
-   C     OH    1   0.1364   188406 ; JCC,7,(1986),230; TYR
-   CA    CA    1     0.14   196361 ; JCC,7,(1986),230; BENZENE,PHE,TRP,TYR
-   CA    CB    1   0.1404   196361 ; JCC,7,(1986),230; ADE,TRP
-   CA    CM    1   0.1433   178776 ; JCC,7,(1986),230; CYT
-   CA    CT    1    0.151   132722 ; JCC,7,(1986),230; PHE,TYR
-   CA    HA    1    0.108   153656 ; changed from 340. bsd on C6H6 nmodes; PHE,TRP,TYR
-   CA    H4    1    0.108   153656 ; changed from 340. bsd on C6H6 nmodes; no assigned
-   CA    N2    1    0.134   201385 ; JCC,7,(1986),230; ARG,CYT,GUA
-   CA    NA    1   0.1381   178776 ; JCC,7,(1986),230; GUA
-   CA    NC    1   0.1339   202222 ; JCC,7,(1986),230; ADE,CYT,GUA
-   CB    CB    1    0.137   217714 ; JCC,7,(1986),230; ADE,GUA
-   CB    N*    1   0.1374   182544 ; JCC,7,(1986),230; ADE,GUA
-   CB    NB    1   0.1391   173334 ; JCC,7,(1986),230; ADE,GUA
-   CB    NC    1   0.1354   193011 ; JCC,7,(1986),230; ADE,GUA
-   CK    H5    1    0.108   153656 ; changed from 340. bsd on C6H6 nmodes; ADE,GUA
-   CK    N*    1   0.1371   184219 ; JCC,7,(1986),230; ADE,GUA
-   CK    NB    1   0.1304   221482 ; JCC,7,(1986),230; ADE,GUA
-   CM    CM    1    0.135   229855 ; JCC,7,(1986),230; CYT,THY,URA
-   CM    CT    1    0.151   132722 ; JCC,7,(1986),230; THY
-   CM    HA    1    0.108   153656 ; changed from 340. bsd on C6H6 nmodes; CYT,URA
-   CM    H4    1    0.108   153656 ; changed from 340. bsd on C6H6 nmodes; CYT,URA
-   CM    H5    1    0.108   153656 ; changed from 340. bsd on C6H6 nmodes; not assigned
-   CM    N*    1   0.1365   187569 ; JCC,7,(1986),230; CYT,THY,URA
-   CQ    H5    1    0.108   153656 ; changed from 340. bsd on C6H6 nmodes; ADE
-   CQ    NC    1   0.1324   210177 ; JCC,7,(1986),230; ADE
-   CT    CT    1   0.1526   129791 ; JCC,7,(1986),230; AA, SUGARS
-   CT    HC    1    0.109   142351 ; changed from 331 bsd on NMA nmodes; AA, SUGARS
-   CT    H1    1    0.109   142351 ; changed from 331 bsd on NMA nmodes; AA, RIBOSE
-   CT    H2    1    0.109   142351 ; changed from 331 bsd on NMA nmodes; SUGARS
-   CT    H3    1    0.109   142351 ; changed from 331 bsd on NMA nmodes; not assigned
-   CT    HP    1    0.109   142351 ;  changed from 331; AA-lysine, methyl ammonium cation
-   CT    N*    1   0.1475   141095 ; JCC,7,(1986),230; ADE,CYT,GUA,THY,URA
-   CT    N2    1   0.1463   141095 ; JCC,7,(1986),230; ARG
-   CT    OH    1    0.141   133978 ; JCC,7,(1986),230; SUGARS
-   CT    OS    1    0.141   133978 ; JCC,7,(1986),230; NUCLEIC ACIDS
-   H     N2    1    0.101   181707 ; JCC,7,(1986),230; ADE,CYT,GUA,ARG
-   H     N*    1    0.101   181707 ; for plain unmethylated bases ADE,CYT,GUA,ARG
-   H     NA    1    0.101   181707 ; JCC,7,(1986),230; GUA,URA,HIS
-   HO    OH    1    0.096   231530 ; JCC,7,(1986),230; SUGARS,SER,TYR
-   HO    OS    1    0.096   231530 ; JCC,7,(1986),230; NUCLEOTIDE ENDS
-   O2    P     1    0.148   219807 ; JCC,7,(1986),230; NA PHOSPHATES
-   OH    P     1    0.161  96296.4 ; JCC,7,(1986),230; NA PHOSPHATES
-   OS    P     1    0.161  96296.4 ; JCC,7,(1986),230; NA PHOSPHATES
-   C*    HC    1    0.108   153656 ; changed from 340. bsd on C6H6 nmodes, not needed AA
-   C     N     1   0.1335   205153 ; JCC,7,(1986),230; AA
-   C*    CB    1   0.1459   162448 ; JCC,7,(1986),230; TRP
-   C*    CT    1   0.1495   132722 ; JCC,7,(1986),230; TRP
-   C*    CW    1   0.1352   228599 ; JCC,7,(1986),230; TRP
-   CA    CN    1     0.14   196361 ; JCC,7,(1986),230; TRP
-   CB    CN    1   0.1419   187150 ; JCC,7,(1986),230; TRP
-   CC    CT    1   0.1504   132722 ; JCC,7,(1986),230; HIS
-   CC    CV    1   0.1375   214364 ; JCC,7,(1986),230; HIS(delta)
-   CC    CW    1   0.1371   216876 ; JCC,7,(1986),230; HIS(epsilon)
-   CC    NA    1   0.1385   176683 ; JCC,7,(1986),230; HIS
-   CC    NB    1   0.1394   171659 ; JCC,7,(1986),230; HIS
-   CN    NA    1    0.138   179195 ; JCC,7,(1986),230; TRP
-   CR    H5    1    0.108   153656 ; changed from 340. bsd on C6H6 nmodes;HIS
-   CR    NA    1   0.1343   199710 ; JCC,7,(1986),230; HIS
-   CR    NB    1   0.1335   204316 ; JCC,7,(1986),230; HIS
-   CT    N     1   0.1449   141095 ; JCC,7,(1986),230; AA
-   CT    N3    1   0.1471   153656 ; JCC,7,(1986),230; LYS
-   CT    S     1    0.181  95040.4 ; changed from 222.0 based on dimethylS nmodes
-   CT    SH    1    0.181  99227.2 ; changed from 222.0 based on methanethiol nmodes
-   CV    H4    1    0.108   153656 ; changed from 340. bsd on C6H6 nmodes; HIS
-   CV    NB    1   0.1394   171659 ; JCC,7,(1986),230; HIS
-   CW    H4    1    0.108   153656 ; changed from 340. bsd on C6H6 nmodes;HIS(epsilon,+)
-   CW    NA    1   0.1381   178776 ; JCC,7,(1986),230; HIS,TRP
-   H     N     1    0.101   181707 ; JCC,7,(1986),230; AA
-   H     N3    1    0.101   181707 ; JCC,7,(1986),230; LYS    
-   HS    SH    1   0.1336   114718 ; JCC,7,(1986),230; CYS
-   S     S     1   0.2038  69500.9 ; JCC,7,(1986),230; CYX   (SCHERAGA)
-   CT    F     1    0.138   153656 ; JCC,13,(1992),963;CF4; R0=1.332 FOR CHF3
-
-[ angletypes ]
-;  ai    aj    ak   ft      th0      cth
-;                        (degr) (kj/mol/rad2)
-   HW    OW    HW    1   104.52   418.68 ; TIP3P water
-   HW    HW    OW    1   127.74        0 ; (found in crystallographic water with 3 bonds)
-   CB    C     NA    1    111.3  293.076 ; NA
-   CB    C     O     1    128.8  334.944 ; 
-   CM    C     NA    1    114.1  293.076 ; 
-   CM    C     O     1    125.3  334.944 ; 
-   CT    C     O     1    120.4  334.944 ; 
-   CT    C     O2    1      117  293.076 ; 
-   CT    C     OH    1      117  293.076 ; 
-   N*    C     NA    1    115.4  293.076 ; 
-   N*    C     NC    1    118.6  293.076 ; 
-   N*    C     O     1    120.9  334.944 ; 
-   NA    C     O     1    120.6  334.944 ; 
-   NC    C     O     1    122.5  334.944 ; 
-   CT    C     N     1    116.6  293.076 ; AA general
-   N     C     O     1    122.9  334.944 ; AA general
-   O     C     O     1      126  334.944 ; AA COO- terminal residues
-   O2    C     O2    1      126  334.944 ; AA GLU            (SCH JPC 79,2379)
-   O     C     OH    1      126  334.944 ; 
-   CA    C     CA    1      120  263.768 ; changed from 85.0  bsd on C6H6 nmodes; AA tyr
-   CA    C     OH    1      120  293.076 ; AA tyr
-   C     CA    CA    1      120  263.768 ; changed from 85.0  bsd on C6H6 nmodes
-   CA    CA    CA    1      120  263.768 ; changed from 85.0  bsd on C6H6 nmodes
-   CA    CA    CB    1      120  263.768 ; changed from 85.0  bsd on C6H6 nmodes
-   CA    CA    CT    1      120  293.076 ; 
-   CA    CA    HA    1      120  146.538 ; 
-   CA    CA    H4    1      120  146.538 ; 
-   CB    CA    HA    1      120  146.538 ; 
-   CB    CA    H4    1      120  146.538 ; 
-   CB    CA    N2    1    123.5  293.076 ; 
-   CB    CA    NC    1    117.3  293.076 ; 
-   CM    CA    N2    1    120.1  293.076 ; 
-   CM    CA    NC    1    121.5  293.076 ; 
-   N2    CA    NA    1      116  293.076 ; 
-   N2    CA    NC    1    119.3  293.076 ; 
-   NA    CA    NC    1    123.3  293.076 ; 
-   C     CA    HA    1      120  146.538 ; AA tyr
-   N2    CA    N2    1      120  293.076 ; AA arg
-   CN    CA    HA    1      120  146.538 ; AA trp
-   CA    CA    CN    1      120  263.768 ; changed from 85.0  bsd on C6H6 nmodes; AA trp
-   C     CB    CB    1    119.2  263.768 ; changed from 85.0  bsd on C6H6 nmodes; NA gua
-   C     CB    NB    1      130  293.076 ; 
-   CA    CB    CB    1    117.3  263.768 ; changed from 85.0  bsd on C6H6 nmodes; NA ade
-   CA    CB    NB    1    132.4  293.076 ; 
-   CB    CB    N*    1    106.2  293.076 ; 
-   CB    CB    NB    1    110.4  293.076 ; 
-   CB    CB    NC    1    127.7  293.076 ; 
-   N*    CB    NC    1    126.2  293.076 ; 
-   C*    CB    CA    1    134.9  263.768 ; changed from 85.0  bsd on C6H6 nmodes; AA trp
-   C*    CB    CN    1    108.8  263.768 ; changed from 85.0  bsd on C6H6 nmodes; AA trp
-   CA    CB    CN    1    116.2  263.768 ; changed from 85.0  bsd on C6H6 nmodes; AA trp
-   H5    CK    N*    1   123.05  146.538 ; 
-   H5    CK    NB    1   123.05  146.538 ; 
-   N*    CK    NB    1    113.9  293.076 ; 
-   C     CM    CM    1    120.7  263.768 ; changed from 85.0  bsd on C6H6 nmodes; NA thy
-   C     CM    CT    1    119.7  293.076 ; 
-   C     CM    HA    1    119.7  146.538 ; 
-   C     CM    H4    1    119.7  146.538 ; 
-   CA    CM    CM    1      117  263.768 ; changed from 85.0  bsd on C6H6 nmodes; NA cyt
-   CA    CM    HA    1    123.3  146.538 ; 
-   CA    CM    H4    1    123.3  146.538 ; 
-   CM    CM    CT    1    119.7  293.076 ; 
-   CM    CM    HA    1    119.7  146.538 ; 
-   CM    CM    H4    1    119.7  146.538 ; 
-   CM    CM    N*    1    121.2  293.076 ; 
-   H4    CM    N*    1    119.1  146.538 ; 
-   H5    CQ    NC    1   115.45  146.538 ; 
-   NC    CQ    NC    1    129.1  293.076 ; 
-   CM    CT    HC    1    109.5   209.34 ; changed based on NMA nmodes
-   CT    CT    CT    1    109.5  167.472 ; 
-   CT    CT    HC    1    109.5   209.34 ; changed based on NMA nmodes
-   CT    CT    H1    1    109.5   209.34 ; changed based on NMA nmodes
-   CT    CT    H2    1    109.5   209.34 ; changed based on NMA nmodes
-   CT    CT    HP    1    109.5   209.34 ; changed based on NMA nmodes
-   CT    CT    N*    1    109.5   209.34 ; 
-   CT    CT    OH    1    109.5   209.34 ; 
-   CT    CT    OS    1    109.5   209.34 ; 
-   HC    CT    HC    1    109.5  146.538 ; 
-   H1    CT    H1    1    109.5  146.538 ; 
-   HP    CT    HP    1    109.5  146.538 ; AA lys, ch3nh4+
-   H2    CT    N*    1    109.5   209.34 ; changed based on NMA nmodes
-   H1    CT    N*    1    109.5   209.34 ; changed based on NMA nmodes
-   H1    CT    OH    1    109.5   209.34 ; changed based on NMA nmodes 
-   H1    CT    OS    1    109.5   209.34 ; changed based on NMA nmodes 
-   H2    CT    OS    1    109.5   209.34 ; changed based on NMA nmodes
-   N*    CT    OS    1    109.5   209.34 ; 
-   H1    CT    N     1    109.5   209.34 ; AA general  changed based on NMA nmodes
-   C     CT    H1    1    109.5   209.34 ; AA general  changed based on NMA nmodes
-   C     CT    HP    1    109.5   209.34 ; AA zwitterion  changed based on NMA nmodes
-   H1    CT    S     1    109.5   209.34 ; AA cys     changed based on NMA nmodes
-   H1    CT    SH    1    109.5   209.34 ; AA cyx     changed based on NMA nmodes
-   CT    CT    S     1    114.7   209.34 ; AA cyx            (SCHERAGA  JPC 79,1428)
-   CT    CT    SH    1    108.6   209.34 ; AA cys
-   H2    CT    H2    1    109.5  146.538 ; AA lys
-   H1    CT    N2    1    109.5   209.34 ; AA arg     changed based on NMA nmodes
-   HP    CT    N3    1    109.5   209.34 ; AA lys, ch3nh3+, changed based on NMA nmodes
-   CA    CT    CT    1      114  263.768 ; AA phe tyr          (SCH JPC  79,2379)
-   C     CT    HC    1    109.5   209.34 ; AA gln      changed based on NMA nmodes
-   C     CT    N     1    110.1  263.768 ; AA general
-   CT    CT    N2    1    111.2  334.944 ; AA arg             (JCP 76, 1439)
-   CT    CT    N     1    109.7  334.944 ; AA ala, general    (JACS 94, 2657)
-   C     CT    CT    1    111.1  263.768 ; AA general
-   CA    CT    HC    1    109.5   209.34 ; AA tyr     changed based on NMA nmodes
-   CT    CT    N3    1    111.2  334.944 ; AA lys             (JCP 76, 1439)
-   CC    CT    CT    1    113.1  263.768 ; AA his
-   CC    CT    HC    1    109.5   209.34 ; AA his     changed based on NMA nmodes
-   C     CT    N3    1    111.2  334.944 ; AA amino terminal residues
-   C*    CT    CT    1    115.6  263.768 ; AA trp
-   C*    CT    HC    1    109.5   209.34 ; AA trp    changed based on NMA nmodes
-   CT    CC    NA    1      120  293.076 ; AA his
-   CT    CC    CV    1      120  293.076 ; AA his
-   CT    CC    NB    1      120  293.076 ; AA his
-   CV    CC    NA    1      120  293.076 ; AA his
-   CW    CC    NA    1      120  293.076 ; AA his
-   CW    CC    NB    1      120  293.076 ; AA his
-   CT    CC    CW    1      120  293.076 ; AA his
-   H5    CR    NA    1      120  146.538 ; AA his
-   H5    CR    NB    1      120  146.538 ; AA his
-   NA    CR    NA    1      120  293.076 ; AA his
-   NA    CR    NB    1      120  293.076 ; AA his
-   CC    CV    H4    1      120  146.538 ; AA his
-   CC    CV    NB    1      120  293.076 ; AA his
-   H4    CV    NB    1      120  146.538 ; AA his
-   CC    CW    H4    1      120  146.538 ; AA his
-   CC    CW    NA    1      120  293.076 ; AA his
-   H4    CW    NA    1      120  146.538 ; AA his
-   C*    CW    H4    1      120  146.538 ; AA trp
-   C*    CW    NA    1    108.7  293.076 ; AA trp
-   CT    C*    CW    1      125  293.076 ; AA trp
-   CB    C*    CT    1    128.6  293.076 ; AA trp
-   CB    C*    CW    1    106.4  263.768 ; changed from 85.0  bsd on C6H6 nmodes; AA trp
-   CA    CN    NA    1    132.8  293.076 ; AA trp
-   CB    CN    NA    1    104.4  293.076 ; AA trp
-   CA    CN    CB    1    122.7  263.768 ; changed from 85.0  bsd on C6H6 nmodes; AA trp
-   C     N     CT    1    121.9   209.34 ; AA general
-   C     N     H     1      120  125.604 ; AA general, gln, asn,changed based on NMA nmodes
-   CT    N     H     1   118.04  125.604 ; AA general,     changed based on NMA nmodes
-   CT    N     CT    1      118   209.34 ; AA pro             (DETAR JACS 99,1232)
-   H     N     H     1      120  146.538 ; ade,cyt,gua,gln,asn     **
-   C     N*    CM    1    121.6  293.076 ; 
-   C     N*    CT    1    117.6  293.076 ; 
-   C     N*    H     1    119.2  125.604 ; changed based on NMA nmodes
-   CB    N*    CK    1    105.4  293.076 ; 
-   CB    N*    CT    1    125.8  293.076 ; 
-   CB    N*    H     1    125.8  125.604 ; for unmethylated n.a. bases,chngd bsd NMA nmodes
-   CK    N*    CT    1    128.8  293.076 ; 
-   CK    N*    H     1    128.8  125.604 ; for unmethylated n.a. bases,chngd bsd NMA nmodes
-   CM    N*    CT    1    121.2  293.076 ; 
-   CM    N*    H     1    121.2  125.604 ; for unmethylated n.a. bases,chngd bsd NMA nmodes
-   CA    N2    H     1      120  146.538 ; 
-   H     N2    H     1      120  146.538 ; 
-   CT    N2    H     1    118.4  146.538 ; AA arg
-   CA    N2    CT    1    123.2   209.34 ; AA arg
-   CT    N3    H     1    109.5   209.34 ; AA lys,     changed based on NMA nmodes
-   CT    N3    CT    1    109.5   209.34 ; AA pro/nt
-   H     N3    H     1    109.5  146.538 ; AA lys, AA(end)
-   C     NA    C     1    126.4  293.076 ; 
-   C     NA    CA    1    125.2  293.076 ; 
-   C     NA    H     1    116.8  125.604 ; changed based on NMA nmodes
-   CA    NA    H     1      118  125.604 ; changed based on NMA nmodes
-   CC    NA    CR    1      120  293.076 ; AA his
-   CC    NA    H     1      120  125.604 ; AA his,    changed based on NMA nmodes
-   CR    NA    CW    1      120  293.076 ; AA his
-   CR    NA    H     1      120  125.604 ; AA his,    changed based on NMA nmodes
-   CW    NA    H     1      120  125.604 ; AA his,    changed based on NMA nmodes
-   CN    NA    CW    1    111.6  293.076 ; AA trp
-   CN    NA    H     1    123.1  125.604 ; AA trp,    changed based on NMA nmodes
-   CB    NB    CK    1    103.8  293.076 ; 
-   CC    NB    CR    1      117  293.076 ; AA his
-   CR    NB    CV    1      117  293.076 ; AA his
-   C     NC    CA    1    120.5  293.076 ; 
-   CA    NC    CB    1    112.2  293.076 ; 
-   CA    NC    CQ    1    118.6  293.076 ; 
-   CB    NC    CQ    1      111  293.076 ; 
-   C     OH    HO    1      113  146.538 ; 
-   CT    OH    HO    1    108.5  230.274 ; 
-   HO    OH    P     1    108.5  188.406 ; 
-   CT    OS    CT    1    109.5  251.208 ; 
-   CT    OS    P     1    120.5   418.68 ; 
-   P     OS    P     1    120.5   418.68 ; 
-   O2    P     OH    1   108.23  188.406 ; 
-   O2    P     O2    1    119.9  586.152 ; 
-   O2    P     OS    1   108.23   418.68 ; 
-   OH    P     OS    1    102.6  188.406 ; 
-   OS    P     OS    1    102.6  188.406 ; 
-   CT    S     CT    1     98.9  259.582 ; AA met
-   CT    S     S     1    103.7  284.702 ; AA cyx             (SCHERAGA  JPC 79,1428)
-   CT    SH    HS    1       96  180.032 ; changed from 44.0 based on methanethiol nmodes
-   HS    SH    HS    1    92.07  146.538 ; AA cys
-   F     CT    F     1    109.1  322.384 ; JCC,13,(1992),963;
-   F     CT    H1    1    109.5  146.538 ; JCC,13,(1992),963;
-
-[ dihedraltypes ]
-;  aj    ak    ft     phi0       cp  mult
-;                   (degr) (kJ/mol/rad)      
-   C     CA     1      180  15.1771     2 ; intrpol.bsd.on C6H6
-   C     CB     1      180  12.5604     2 ; intrpol.bsd.on C6H6
-   C     CM     1      180  9.10629     2 ; intrpol.bsd.on C6H6
-   C     N*     1      180  6.07086     2 ; JCC,7,(1986),230
-   C     NA     1      180  5.65218     2 ; JCC,7,(1986),230
-   C     NC     1      180  16.7472     2 ; JCC,7,(1986),230
-   C     OH     1      180  3.76812     2 ; JCC,7,(1986),230
-   C     CT     1        0        0     2 ; JCC,7,(1986),230
-   CA    CA     1      180  15.1771     2 ; intrpol.bsd.on C6H6
-   CA    CB     1      180  14.6538     2 ; intrpol.bsd.on C6H6
-   CA    CM     1      180  10.6763     2 ; intrpol.bsd.on C6H6
-   CA    CT     1        0        0     2 ; JCC,7,(1986),230
-   CA    N2     1      180  10.0483     2 ; reinterpolated 93'
-   CA    NA     1      180   6.2802     2 ; JCC,7,(1986),230
-   CA    NC     1      180  20.0966     2 ; JCC,7,(1986),230
-   CB    CB     1      180  22.8181     2 ; intrpol.bsd.on C6H6
-   CB    N*     1      180  6.90822     2 ; JCC,7,(1986),230
-   CB    NB     1      180  10.6763     2 ; JCC,7,(1986),230
-   CB    NC     1      180  17.3752     2 ; JCC,7,(1986),230
-   CK    N*     1      180  7.11756     2 ; JCC,7,(1986),230
-   CK    NB     1      180   41.868     2 ; JCC,7,(1986),230
-   CM    CM     1      180  27.8422     2 ; intrpol.bsd.on C6H6
-   CM    CT     1        0        0     3 ; JCC,7,(1986),230
-   CM    N*     1      180  7.74558     2 ; JCC,7,(1986),230
-   CQ    NC     1      180  28.4702     2 ; JCC,7,(1986),230
-   CT    CT     1        0  0.65128     3 ; JCC,7,(1986),230
-   CT    N      1        0        0     2 ; JCC,7,(1986),230
-   CT    N*     1        0        0     2 ; JCC,7,(1986),230
-   CT    N2     1        0        0     3 ; JCC,7,(1986),230
-   CT    OH     1        0   0.6978     3 ; JCC,7,(1986),230
-   CT    OS     1        0  1.60494     3 ; JCC,7,(1986),230
-   OH    P      1        0   1.0467     3 ; JCC,7,(1986),230
-   OS    P      1        0   1.0467     3 ; JCC,7,(1986),230
-   C     N      1      180   10.467     2 ; AA|check Wendy?&NMA
-   CT    N3     1        0  0.65128     3 ; JCC,7,(1986),230
-   CT    S      1        0   1.3956     3 ; JCC,7,(1986),230
-   CT    SH     1        0   1.0467     3 ; JCC,7,(1986),230
-   C*    CB     1      180  7.01289     2 ; intrpol.bsd.onC6H6aa
-   C*    CT     1        0        0     2 ; JCC,7,(1986),230
-   C*    CW     1      180  27.3189     2 ; intrpol.bsd.on C6H6
-   CA    CN     1      180  15.1771     2 ; reinterpolated 93'
-   CB    CN     1      180  12.5604     2 ; reinterpolated 93'
-   CC    CT     1        0        0     2 ; JCC,7,(1986),230
-   CC    CV     1      180   21.562     2 ; intrpol.bsd.on C6H6
-   CC    CW     1      180   22.504     2 ; intrpol.bsd.on C6H6
-   CC    NA     1      180  5.86152     2 ; JCC,7,(1986),230
-   CC    NB     1      180  10.0483     2 ; JCC,7,(1986),230
-   CN    NA     1      180  6.38487     2 ; reinterpolated 93'
-   CR    NA     1      180  9.73431     2 ; JCC,7,(1986),230
-   CR    NB     1      180   20.934     2 ; JCC,7,(1986),230
-   CV    NB     1      180  10.0483     2 ; JCC,7,(1986),230
-   CW    NA     1      180   6.2802     2 ; JCC,7,(1986),230
-
-; defining dihedral parameters for four-atom dependent
-; dihedral types, which Gromacs does not handle by default
-#define ad_CT_CT_OS_CT_1        0  1.60354     3        0  1.60354     3 
-#define ad_CT_CT_OS_CT_2      180  0.41868     2      180  0.41868     2 
-#define ad_CT_OS_CT_N*_1        0  1.60354     3        0  1.60354     3 
-#define ad_CT_OS_CT_N*_2        0   4.1868     2        0   4.1868     2 
-#define ad_C__N__CT_C_        180  0.83736     2      180  0.83736     2 
-#define ad_N__CT_C__N__1      180  1.67472     4      180  1.67472     4 
-#define ad_N__CT_C__N__2      180  5.65218     2      180  5.65218     2 
-#define ad_N__CT_C__N__3      180   3.1401     1      180   3.1401     1 
-#define ad_CT_CT_N__C__1      180   2.0934     4      180   2.0934     4 
-#define ad_CT_CT_N__C__2      180  0.62802     3      180  0.62802     3 
-#define ad_CT_CT_N__C__3        0    2.219     1        0    2.219     1 
-#define ad_CT_CT_C__N__1        0  0.41868     4        0  0.41868     4 
-#define ad_CT_CT_C__N__2        0 0.293076     2        0 0.293076     2 
-#define ad_H__N__C__O__1      180   10.467     2      180   10.467     2 ; JCC,7,(1986),230
-#define ad_H__N__C__O__2        0   8.3736     1        0   8.3736     1 ; J.C.cistrans-NMA DE
-#define ad_CT_S__S__CT_1        0  14.6538     2        0  14.6538     2 ; JCC,7,(1986),230
-#define ad_CT_S__S__CT_2        0  2.51208     3        0  2.51208     3 ; JCC,7,(1986),230
-#define ad_OS_CT_CT_OS_1        0 0.602899     3        0 0.602899     3 ; JCC,7,(1986),230
-#define ad_OS_CT_CT_OS_2        0   6.2802     2        0   6.2802     2 ; pucker anal (93')
-#define ad_OS_CT_CT_OH_1        0 0.602899     3        0 0.602899     3 ; JCC,7,(1986),230
-#define ad_OS_CT_CT_OH_2        0   6.2802     2        0   6.2802     2 ; pucker anal (93')
-#define ad_OH_CT_CT_OH_1        0 0.602899     3        0 0.602899     3 ; JCC,7,(1986),230
-#define ad_OH_CT_CT_OH_2        0   6.2802     2        0   6.2802     2 ; check glicolWC? puc
-#define ad_OH_P__OS_CT_1        0   1.0467     3        0   1.0467     3 ; JCC,7,(1986),230
-#define ad_OH_P__OS_CT_2        0  5.02416     2        0  5.02416     2 ; gg&gt ene.631g*/mp2
-#define ad_OS_P__OS_CT_1        0   1.0467     3        0   1.0467     3 ; JCC,7,(1986),230
-#define ad_OS_P__OS_CT_2        0  5.02416     2        0  5.02416     2 ; gg&gt ene.631g*/mp2
-#define ad_OS_CT_N*_CK_1        0        0     2        0        0     2 ; sugar frag calc (PC)
-#define ad_OS_CT_N*_CK_2        0   10.467     1        0   10.467     1 ; sugar frag calc (PC)
-#define ad_OS_CT_N*_CM_1        0        0     2        0        0     2 ; sugar frag calc (PC)
-#define ad_OS_CT_N*_CM_2        0   10.467     1        0   10.467     1 ; sugar frag calc (PC)
-
-;  ai    aj    ak    al    ft       q0       cq  mult
-; WARNING: using Gromacs propers to define Amber impropers
-; defining improper parameters for improper types
-#define ai_X__X__C__O_  43.9614      180     2  43.9614      180     2 ; JCC,7,(1986),230
-#define ai_X__O2_C__O2  43.9614      180     2  43.9614      180     2 ; JCC,7,(1986),230
-#define ai_X__X__N__H_   4.1868      180     2   4.1868      180     2 ; JCC,7,(1986),230
-#define ai_X__X__N2_H_   4.1868      180     2   4.1868      180     2 ; JCC,7,(1986),230
-#define ai_X__X__NA_H_   4.1868      180     2   4.1868      180     2 ; JCC,7,(1986),230
-#define ai_X__N2_CA_N2  43.9614      180     2  43.9614      180     2 ; JCC,7,(1986),230
-#define ai_X__CT_N__CT   4.1868      180     2   4.1868      180     2 ; JCC,7,(1986),230
-#define ai_X__X__CA_HA  4.60548      180     2  4.60548      180     2 ; bsd.on C6H6 nmodes
-#define ai_X__X__CW_H4  4.60548      180     2  4.60548      180     2 
-#define ai_X__X__CR_H5  4.60548      180     2  4.60548      180     2 
-#define ai_X__X__CV_H4  4.60548      180     2  4.60548      180     2 
-#define ai_X__X__CQ_H5  4.60548      180     2  4.60548      180     2 
-#define ai_X__X__CK_H5  4.60548      180     2  4.60548      180     2 
-#define ai_X__X__CM_H4  4.60548      180     2  4.60548      180     2 
-#define ai_X__X__CM_HA  4.60548      180     2  4.60548      180     2 
-#define ai_X__X__CA_H4  4.60548      180     2  4.60548      180     2 ; bsd.on C6H6 nmodes 
-#define ai_X__X__CA_H5  4.60548      180     2  4.60548      180     2 ; bsd.on C6H6 nmodes
-#define ai_CK_CB_N*_CT   4.1868      180     2   4.1868      180     2 
-#define ai_CM_C__N*_CT   4.1868      180     2   4.1868      180     2 ; dac guess, 9/94
-#define ai_CM_C__CM_CT  4.60548      180     2  4.60548      180     2 
-#define ai_CT_O__C__OH  43.9614      180     2  43.9614      180     2 
-#define ai_NA_CV_CC_CT  4.60548      180     2  4.60548      180     2 
-#define ai_NB_CW_CC_CT  4.60548      180     2  4.60548      180     2 
-#define ai_NA_CW_CC_CT  4.60548      180     2  4.60548      180     2 
-#define ai_CW_CB_C*_CT  4.60548      180     2  4.60548      180     2 
-#define ai_CA_CA_CA_CT  4.60548      180     2  4.60548      180     2 
-#define ai_C__CM_CM_CT  4.60548      180     2  4.60548      180     2 ; dac guess, 9/94
-#define ai_NC_CM_CA_N2  4.60548      180     2  4.60548      180     2 ; dac guess, 9/94
-#define ai_CB_NC_CA_N2  4.60548      180     2  4.60548      180     2 ; dac, 10/94
-#define ai_NA_NC_CA_N2  4.60548      180     2  4.60548      180     2 ; dac, 10/94
-#define ai_CA_CA_C__OH  4.60548      180     2  4.60548      180     2 
-
-; Found:
-; # bonds:           83
-; # angles:          191
-; # propers:         83
-; # impropers:       31
diff --git a/src/contrib/scripts/ffambernb.itp b/src/contrib/scripts/ffambernb.itp
deleted file mode 100644 (file)
index 8febf84..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-; Amber forcefield converted to Gromacs
-; from file /usr/slocal/amber6/dat/parm98.dat
-; 
-; PARM94 for DNA, RNA and proteins with TIP3P Water. USE SCEE=1.2 in energy progs
-; 
-
-; H-bond params not implemented
-; NOTE: all H-bond (10-12) parameters are Zero
-
-; LJ 6-12 equivalent atom symbols
-;  N   NA  N2  N*  NC  NB  N3  NP  NO (9)
-;  C   C*  CA  CB  CC  CN  CM  CK  CQ  CW  CV  CR  CA  CX  CY  CD (16)
-
-; Define LJ 6-12 parameter types:
-#define alj_H        0.06  0.0657328
-#define alj_HO          0          0
-#define alj_HS       0.06  0.0657328
-#define alj_HC     0.1487  0.0657328
-#define alj_H1     0.1387  0.0657328
-#define alj_H2     0.1287  0.0657328
-#define alj_H3     0.1187  0.0657328
-#define alj_HP       0.11  0.0657328
-#define alj_HA     0.1459   0.062802
-#define alj_H4     0.1409   0.062802
-#define alj_H5     0.1359   0.062802
-#define alj_HW          0          0
-#define alj_O     0.16612   0.879228
-#define alj_O2    0.16612   0.879228
-#define alj_OW    0.17683   0.636394
-#define alj_OH     0.1721   0.880903
-#define alj_OS    0.16837   0.711756
-#define alj_CT     0.1908   0.458036
-#define alj_CA     0.1908   0.360065
-#define alj_CM     0.1908   0.360065
-#define alj_C      0.1908   0.360065
-#define alj_N      0.1824   0.711756
-#define alj_S         0.2     1.0467
-#define alj_SH        0.2     1.0467
-#define alj_P        0.21    0.83736
-#define alj_IM      0.247    0.41868
-#define alj_Li     0.1137  0.0766184
-#define alj_IP     0.1868  0.0115974
-#define alj_K      0.2658 0.00137327
-#define alj_Rb     0.2956 0.000711756
-#define alj_Cs     0.3395 0.000337456
-#define alj_I       0.235    1.67472
-#define alj_F       0.175   0.255395
-#define alj_IB        0.5    0.41868
-
-[ atomtypes ]
-;name      mass    q tp sigma/epsilon
-  BR       79.9    0  A alj_BR  ; bromine
-  C       12.01    0  A alj_C   ; sp2 C carbonyl group 
-  CA      12.01    0  A alj_C   ; sp2 C pure aromatic (benzene)
-  CB      12.01    0  A alj_C   ; sp2 aromatic C, 5&6 membered ring junction
-  CC      12.01    0  A alj_C   ; sp2 aromatic C, 5 memb. ring HIS
-  CK      12.01    0  A alj_C   ; sp2 C 5 memb.ring in purines
-  CM      12.01    0  A alj_C   ; sp2 C  pyrimidines in pos. 5 & 6
-  CN      12.01    0  A alj_C   ; sp2 C aromatic 5&6 memb.ring junct.(TRP)
-  CQ      12.01    0  A alj_C   ; sp2 C in 5 mem.ring of purines between 2 N
-  CR      12.01    0  A alj_C   ; sp2 arom as CQ but in HIS
-  CT      12.01    0  A alj_CT  ; sp3 aliphatic C
-  CV      12.01    0  A alj_C   ; sp2 arom. 5 memb.ring w/1 N and 1 H (HIS)
-  CW      12.01    0  A alj_C   ; sp2 arom. 5 memb.ring w/1 N-H and 1 H (HIS)
-  C*      12.01    0  A alj_C   ; sp2 arom. 5 memb.ring w/1 subst. (TRP)
-  C0      40.08    0  A alj_C0  ; calcium
-  F          19    0  A alj_F   ; fluorine
-  H       1.008    0  A alj_H   ; H bonded to nitrogen atoms
-  HC      1.008    0  A alj_HC  ; H aliph. bond. to C without electrwd.group
-  H1      1.008    0  A alj_H1  ; H aliph. bond. to C with 1 electrwd. group
-  H2      1.008    0  A alj_H2  ; H aliph. bond. to C with 2 electrwd.groups
-  H3      1.008    0  A alj_H3  ; H aliph. bond. to C with 3 eletrwd.groups
-  HA      1.008    0  A alj_HA  ; H arom. bond. to C without elctrwd. groups
-  H4      1.008    0  A alj_H4  ; H arom. bond. to C with 1 electrwd. group
-  H5      1.008    0  A alj_H5  ; H arom. bond. to C with 2 electrwd. groups
-  HO      1.008    0  A alj_HO  ; hydroxyl group
-  HS      1.008    0  A alj_HS  ; hydrogen bonded to sulphur
-  HW      1.008    0  A alj_HW  ; H in TIP3P water
-  HP      1.008    0  A alj_HP  ; H bonded to C next to positively charged gr
-  I       126.9    0  A alj_I   ; iodine
-  IM      35.45    0  A alj_IM  ; assumed to be Cl-
-  IP      22.99    0  A alj_IP  ; assumed to be Na+
-  IB        131    0  A alj_IB  ; 'big ion w/ waters' for vacuum (Na+, 6H2O)
-  MG     24.305    0  A alj_MG  ; magnesium
-  N       14.01    0  A alj_N   ; sp2 nitrogen in amide groups
-  NA      14.01    0  A alj_N   ; sp2 N in 5 memb.ring w/H atom (HIS)
-  NB      14.01    0  A alj_N   ; sp2 N in 5 memb.ring w/LP (HIS,ADE,GUA)
-  NC      14.01    0  A alj_N   ; sp2 N in 6 memb.ring w/LP (ADE,GUA)
-  N2      14.01    0  A alj_N   ; sp2 N in amino groups
-  N3      14.01    0  A alj_N   ; sp3 N for charged amino groups (Lys, etc)
-  N*      14.01    0  A alj_N   ; sp2 N 
-  O          16    0  A alj_O   ; carbonyl group oxygen
-  OW         16    0  A alj_OW  ; oxygen in TIP3P water
-  OH         16    0  A alj_OH  ; oxygen in hydroxyl group
-  OS         16    0  A alj_OS  ; ether and ester oxygen
-  O2         16    0  A alj_O2  ; carboxyl and phosphate group oxygen
-  P       30.97    0  A alj_P   ; phosphate
-  S       32.06    0  A alj_S   ; sulphur in disulfide linkage
-  SH      32.06    0  A alj_SH  ; sulphur in cystine
-  CU      63.55    0  A alj_CU  ; copper
-  FE         55    0  A alj_FE  ; iron
-  Li       6.94    0  A alj_Li  ; lithium
-  K        39.1    0  A alj_K   ; potassium
-  Rb      85.47    0  A alj_Rb  ; rubidium
-  Cs     132.91    0  A alj_Cs  ; cesium
-
-; Found:
-; # atoms:           54
-; # H-bonds (10-12): 1
-; # equivalent 6-12: 2
-; # LJ (6-12):       34
diff --git a/src/contrib/scripts/sort-hdb b/src/contrib/scripts/sort-hdb
deleted file mode 100755 (executable)
index 4ca6c81..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/csh -f
-
-# first: put each residue on one line; newlines are replaced by '@'
-# then: sort lines
-# finally: replace '@' again by newline (and eliminate empty lines)
-awk '\
-NF==2 {printf "\n"; printf $0"@";} \
-NF>2 {printf $0"@"}\
-' $1 | sort | awk '\
-{gsub("@","\n"); print;}\
-' | awk 'NF'
-
-#last line
diff --git a/src/contrib/scripts/xlateat.dat b/src/contrib/scripts/xlateat.dat
deleted file mode 100644 (file)
index 573541a..0000000
+++ /dev/null
@@ -1 +0,0 @@
-0
diff --git a/src/contrib/test.c b/src/contrib/test.c
deleted file mode 100644 (file)
index 888ae65..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * 
- *                This source code is part of
- * 
- *                 G   R   O   M   A   C   S
- * 
- *          GROningen MAchine for Chemical Simulations
- * 
- *                        VERSION 3.3.99_development_20071104
- * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
- * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2006, The GROMACS development team,
- * check out http://www.gromacs.org for more information.
-
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- * 
- * If you want to redistribute modifications, please consider that
- * scientific software is very special. Version control is crucial -
- * bugs must be traceable. We will be happy to consider code for
- * inclusion in the official distribution, but derived work must not
- * be called official GROMACS. Details are found in the README & COPYING
- * files - if they are missing, get the official version at www.gromacs.org.
- * 
- * To help us fund GROMACS development, we humbly ask that you cite
- * the papers on the package - you can find them in the top README file.
- * 
- * For more info, check our website at http://www.gromacs.org
- * 
- * And Hey:
- * Groningen Machine for Chemical Simulation
- */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <math.h>
-#include "typedefs.h"
-#include "gromacs/commandline/pargs.h"
-#include "copyrite.h"
-#include "gromacs/utility/fatalerror.h"
-#include "gromacs/fileio/xvgr.h"
-#include "viewit.h"
-#include "gromacs/fileio/pdbio.h"
-#include "macros.h"
-#include "gromacs/utility/smalloc.h"
-#include "gromacs/math/vec.h"
-#include "gromacs/math/units.h"
-#include "names.h"
-#include "txtdump.h"
-#include "gromacs/fileio/confio.h"
-
-real pot(real x,real qq,real c6,real c12)
-{
-  return c12*pow(x,-12)-c6*pow(x,-6)+qq*ONE_4PI_EPS0/x;
-}
-
-real dpot(real x,real qq,real c6,real c12)
-{
-  return -(12*c12*pow(x,-13)-6*c6*pow(x,-7)+qq*ONE_4PI_EPS0/sqr(x));
-}
-
-int main(int argc,char *argv[])
-{
-  static char *desc[] = {
-    "Plot the potential"
-  };
-  static real c6=1.0e-3,c12=1.0e-6,qi=1,qj=2,sig=0.3,eps=1,sigfac=0.7;
-  t_pargs pa[] = {
-    { "-c6",   FALSE,  etREAL,  {&c6},  "c6"   },
-    { "-c12",  FALSE,  etREAL,  {&c12}, "c12"  },
-    { "-sig",  FALSE,  etREAL,  {&sig}, "sig"  },
-    { "-eps",  FALSE,  etREAL,  {&eps}, "eps"  },
-    { "-qi",   FALSE,  etREAL,  {&qi},  "qi"   },
-    { "-qj",   FALSE,  etREAL,  {&qj},  "qj"   },
-    { "-sigfac", FALSE, etREAL, {&sigfac}, "Factor in front of sigma for starting the plot" }
-  };
-  t_filenm fnm[] = {
-    { efXVG, "-o", "potje", ffWRITE }
-  };
-#define NFILE asize(fnm)
-
-  FILE      *fp;
-  int       i;
-  real      qq,x,oldx,minimum,mval,dp[2],pp[2];
-  int       cur=0;
-#define next (1-cur)
-  
-  /* CopyRight(stdout,argv[0]);*/
-  parse_common_args(&argc,argv,PCA_CAN_VIEW,
-                   NFILE,fnm,asize(pa),pa,asize(desc),
-                   desc,0,NULL);
-
-  if (opt2parg_bSet("-sig",asize(pa),pa) ||
-      opt2parg_bSet("-eps",asize(pa),pa)) {
-    c6  = 4*eps*pow(sig,6);
-    c12 = 4*eps*pow(sig,12);
-  }
-  else if ((c6 != 0) && (c12 != 0)) {
-    sig = pow(c12/c6,1.0/6.0);
-    eps = c6*c6/(4*c12);
-  }
-  else {
-    sig = eps = 0;
-  }
-  printf("c6    = %12.5e, c12     = %12.5e\n",c6,c12);
-  printf("sigma = %12.5f, epsilon = %12.5f\n",sig,eps);
-  qq = qi*qj;
-      
-  fp = xvgropen(ftp2fn(efXVG,NFILE,fnm),"Potential","r (nm)","E (kJ/mol)");
-  if (sig == 0)
-    sig=0.25;
-  minimum = -1;
-  mval    = 0;
-  oldx    = 0;
-  for(i=0; (i<100); i++) {
-    x    = sigfac*sig+sig*i*0.02;
-    dp[next] = dpot(x,qq,c6,c12);
-    fprintf(fp,"%10g  %10g  %10g\n",x,pot(x,qq,c6,c12),
-           dp[next]);
-    if ((i > 0) && (dp[cur]*dp[next] < 0)) {
-      minimum = oldx + dp[cur]*(x-oldx)/(dp[cur]-dp[next]);
-      mval    = pot(minimum,qq,c6,c12);
-      /*fprintf(stdout,"dp[cur] = %g, dp[next] = %g  oldx = %g, dx = %g\n",
-       dp[cur],dp[next],oldx,x-oldx);*/
-      printf("Minimum at r = %g (nm). Value = %g (kJ/mol)\n",
-             minimum,mval);
-    }
-    cur = next;
-    oldx = x;
-      
-  }
-  gmx_ffclose(fp);
-  
-  do_view(ftp2fn(efXVG,NFILE,fnm),NULL);
-
-  gmx_thanx(stderr);
-              
-  return 0;
-}
-
-
diff --git a/src/contrib/test_fatal.c b/src/contrib/test_fatal.c
deleted file mode 100644 (file)
index c7f2849..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-#include "gromacs/utility/fatalerror.h"
-
-void my_func(char *msg)
-{
-  fprintf(stderr,"Welcome to my_func\n%s\n",msg);
-  exit(1);
-}
-
-int main(int argc,char *argv[])
-{
-  int n = -3;
-  int choice;
-  char *end;
-  
-  /* set_gmx_error_handler(my_func);*/
-  
-  if (argc <= 1)
-    gmx_fatal(FARGS,"Expected an integer argument to %s",argv[0]);
-  choice = strtol(argv[1], &end, 10); 
-  if (end!='\0')
-    gmx_fatal(FARGS,"Expected an integer argument to %s",argv[0]);
-  
-  
-  switch (choice) {
-  case 1:
-    gmx_error("pme","oooo");
-    break;
-  case 2:
-    gmx_fatal(FARGS,"Passing string %s to you %f  %d %x","lll",8.3,34,34);
-    break;
-  case 3:
-    range_check(n,1,5);
-    break;
-  default:
-    range_check(choice,1,3);
-  }
-  return 0;
-}
diff --git a/src/contrib/testfft.c b/src/contrib/testfft.c
deleted file mode 100644 (file)
index 8d154de..0000000
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
- * 
- *                This source code is part of
- * 
- *                 G   R   O   M   A   C   S
- * 
- *          GROningen MAchine for Chemical Simulations
- * 
- *                        VERSION 3.2.0
- * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
- * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2004, The GROMACS development team,
- * check out http://www.gromacs.org for more information.
-
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- * 
- * If you want to redistribute modifications, please consider that
- * scientific software is very special. Version control is crucial -
- * bugs must be traceable. We will be happy to consider code for
- * inclusion in the official distribution, but derived work must not
- * be called official GROMACS. Details are found in the README & COPYING
- * files - if they are missing, get the official version at www.gromacs.org.
- * 
- * To help us fund GROMACS development, we humbly ask that you cite
- * the papers on the package - you can find them in the top README file.
- * 
- * For more info, check our website at http://www.gromacs.org
- * 
- * And Hey:
- * GROningen Mixture of Alchemy and Childrens' Stories
- */
-#include <math.h>
-#include <stdio.h>
-#include "typedefs.h"
-#include "macros.h"
-#include "gromacs/utility/smalloc.h"
-#include "gromacs/fileio/xvgr.h"
-#include "complex.h"
-#include "fftgrid.h"
-#include "mdrun.h"
-
-void testfft(FILE *fp,t_complex ***grid,int nx,int ny,int nz,gmx_bool bFirst)
-{
-#ifdef USE_SGI_FFT
-#if GMX_DOUBLE
-  static    zomplex   *coeff;
-#else
-  static    complex   *coeff;
-#endif  
-  static    int la1,la2;
-#endif
-  t_complex *cptr;
-  real      *gptr,*fqqq,fg,fac;
-  int       ntot,i,j,k,m,n,ndim[4];
-  int       npppm;
-  
-  ndim[0] = 0;
-  ndim[1] = nx;
-  ndim[2] = ny;
-  ndim[3] = nz;
-  
-  ntot    = nx*ny*nz;
-  cptr    = grid[0][0];
-  fqqq    = &(grid[0][0][0].re);
-  
-#ifdef USE_SGI_FFT
-  if (bFirst) {
-    fprintf(fp,"Going to use SGI optimized FFT routines.\n");
-#if GMX_DOUBLE
-    coeff  = zfft3di(nx,ny,nz,NULL);
-#else
-    coeff  = cfft3di(nx,ny,nz,NULL);
-#endif
-    bFirst = FALSE;
-  }
-  la1 = nx;
-  la2 = ny;
-#if GMX_DOUBLE
-  zfft3d(1,nx,ny,nz,(zomplex *)cptr,la1,la2,coeff);
-#else
-  cfft3d(1,nx,ny,nz,(complex *)cptr,la1,la2,coeff);
-#endif
-#else
-  fourn(fqqq-1,ndim,3,1);
-#endif
-  
-#ifdef USE_SGI_FFT
-#if GMX_DOUBLE
-  zfft3d(-1,nx,ny,nz,(zomplex *)cptr,la1,la2,coeff);
-#else
-  cfft3d(-1,nx,ny,nz,(complex *)cptr,la1,la2,coeff);
-#endif
-#else
-  fourn(fqqq-1,ndim,3,-1);
-#endif
-}
-
-void testrft(FILE *fp,real ***grid,int nx,int ny,int nz,gmx_bool bFirst)
-{
-#ifdef USE_SGI_FFT
-#if GMX_DOUBLE
-  static    double *coeff;
-#else
-  static    float *coeff;
-#endif
-  static    int la1,la2;
-#endif
-  real      *cptr;
-  real      *gptr,*fqqq,fg,fac;
-  int       ntot,i,j,k,m,n,ndim[4];
-  int       npppm,job;
-  
-  ndim[0] = 0;
-  ndim[1] = nx;
-  ndim[2] = ny;
-  ndim[3] = nz;
-  
-  ntot    = nx*ny*nz;
-  cptr    = grid[0][0];
-  fqqq    = &(grid[0][0][0]);
-  
-#ifdef USE_SGI_FFT
-  if (bFirst) {
-    fprintf(fp,"Going to use SGI optimized FFT routines.\n");
-#if GMX_DOUBLE
-    coeff  = dfft3di(nx,ny,nz,NULL);
-#else
-    coeff  = sfft3di(nx,ny,nz,NULL);
-#endif
-    bFirst = FALSE;
-  }
-  job = 1;
-  la1 = nx+2;
-  la2 = ny;
-#if GMX_DOUBLE
-  dzfft3d(job,nx,ny,nz,cptr,la1,la2,coeff);
-#else
-  scfft3d(job,nx,ny,nz,cptr,la1,la2,coeff);
-#endif
-#else
-  fourn(fqqq-1,ndim,3,1);
-#endif
-
-  job = -1;
-  
-#ifdef USE_SGI_FFT
-#if GMX_DOUBLE
-  zdfft3d(job,nx,ny,nz,cptr,la1,la2,coeff);
-#else
-  csfft3d(job,nx,ny,nz,cptr,la1,la2,coeff);
-#endif
-#else
-  fourn(fqqq-1,ndim,3,-1);
-#endif
-}
-
-int main(int argc,char *argv[])
-{
-  FILE      *fp;
-  int       nnn[] = { 8, 10, 12, 15, 16, 18, 20, 24, 25, 27, 30, 32, 36, 40,
-                     45, 48, 50, 54, 60, 64, 72, 75, 80, 81, 90, 100 };
-#define NNN asize(nnn)
-  int       *niter;
-  int       i,j,n,nit,ntot,n3;
-  double    t,nflop;
-  double    *rt,*ct;
-  t_complex ***g;
-  real      ***h;
-  
-  snew(rt,NNN);
-  snew(ct,NNN);
-  snew(niter,NNN);
-  
-  for(i=0; (i<NNN); i++) {
-    n = nnn[i];
-    fprintf(stderr,"\rReal %d     ",n);
-    if (n < 16)
-      niter[i] = 100;
-    else if (n < 26)
-      niter[i] = 50;
-    else if (n < 51)
-      niter[i] = 10;
-    else
-      niter[i] = 5;
-    nit = niter[i];
-      
-    h   = mk_rgrid(n+2,n,n);
-    start_time();
-    for(j=0; (j<nit); j++) {
-      testrft(stdout,h,n,n,n,(j==0));
-    }
-    update_time();
-    rt[i] = node_time();
-    free_rgrid(h,n,n);
-    
-    fprintf(stderr,"\rComplex %d     ",n);
-    g   = mk_cgrid(n,n,n);
-    start_time();
-    for(j=0; (j<nit); j++) {
-      testfft(stdout,g,n,n,n,(j==0));
-    }
-    update_time();
-    ct[i] = node_time();
-    free_cgrid(g,n,n);
-  }
-  fprintf(stderr,"\n");
-  fp=xvgropen("timing.xvg","FFT timings per grid point","n","t (s)");
-  for(i=0; (i<NNN); i++) {
-    n3 = 2*niter[i]*nnn[i]*nnn[i]*nnn[i];
-    fprintf(fp,"%10d  %10g  %10g\n",nnn[i],rt[i]/n3,ct[i]/n3);
-  }
-  gmx_fio_fclose(fp);
-  
-  return 0;
-}
diff --git a/src/contrib/testlr.c b/src/contrib/testlr.c
deleted file mode 100644 (file)
index f470e97..0000000
+++ /dev/null
@@ -1,580 +0,0 @@
-/*
- * 
- *                This source code is part of
- * 
- *                 G   R   O   M   A   C   S
- * 
- *          GROningen MAchine for Chemical Simulations
- * 
- *                        VERSION 3.2.0
- * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
- * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2004, The GROMACS development team,
- * check out http://www.gromacs.org for more information.
-
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- * 
- * If you want to redistribute modifications, please consider that
- * scientific software is very special. Version control is crucial -
- * bugs must be traceable. We will be happy to consider code for
- * inclusion in the official distribution, but derived work must not
- * be called official GROMACS. Details are found in the README & COPYING
- * files - if they are missing, get the official version at www.gromacs.org.
- * 
- * To help us fund GROMACS development, we humbly ask that you cite
- * the papers on the package - you can find them in the top README file.
- * 
- * For more info, check our website at http://www.gromacs.org
- * 
- * And Hey:
- * GROningen Mixture of Alchemy and Childrens' Stories
- */
-#include <math.h>
-#include <string.h>
-#include "typedefs.h"
-#include "gromacs/math/vec.h"
-#include "gromacs/math/units.h"
-#include "macros.h"
-#include "names.h"
-#include "gromacs/utility/smalloc.h"
-#include "gromacs/fileio/tpxio.h"
-#include "gromacs/commandline/pargs.h"
-#include "gromacs/fileio/writeps.h"
-#include "copyrite.h"
-#include "pppm.h"
-#include "readinp.h"
-#include "force.h"
-#include "nrnb.h"
-#include "coulomb.h"
-#include "gromacs/pbcutil/mshift.h"
-#include "poisson.h"
-#include "mdatoms.h"
-
-static real phi_sr(FILE *log,int nj,rvec x[],real charge[],real rc,real r1,
-                   rvec box, real phi[],t_block *excl,rvec f_sr[],gmx_bool bOld)
-{
-  int  i,j,k,m,ni,i1,i2;
-  real pp,r2,R,R_1,R_2,rc2;
-  real qi,qj,vsr,eps,fscal;
-  rvec dx;
-  
-  vsr = 0.0;
-  eps = ONE_4PI_EPS0;
-  rc2 = rc*rc;
-  ni=0;
-  for(i=0; (i<nj-1); i++) {
-    qi=charge[i];
-    for(j=i+1; (j<nj); j++) {
-      i1=excl->index[i];
-      i2=excl->index[i+1];
-      for(k=i1; (k<i2); k++)
-       if (excl->a[k] == j)
-         break;
-      if (k == i2) {
-       r2=calc_dx2dx(x[i],x[j],box,dx);
-       if (r2 < rc2) {
-         qj    = charge[j];
-         R_1   = invsqrt(r2);
-         R_2   = R_1*R_1;
-         R     = invsqrt(R_2);
-         if (bOld) {
-           fscal = old_f(R,rc,r1)*R_2;
-           pp    = old_phi(R,rc,r1);
-         }
-         else {
-           fscal = new_f(R,rc)*R_2;
-           pp    = new_phi(R,rc);
-         }
-         phi[i] += eps*qj*pp;
-         phi[j] += eps*qi*pp;
-         vsr    += eps*qj*qi*pp;
-         for(m=0; (m<DIM); m++) {
-           f_sr[i][m] += dx[m]*fscal;
-           f_sr[j][m] -= dx[m]*fscal;
-         }
-         ni++;
-       }
-      }
-    }
-  }
-  fprintf(log,"There were %d short range interactions, vsr=%g\n",ni,vsr);
-  
-  return vsr;
-}
-
-void calc_ener(FILE *fp,char *title,gmx_bool bHeader,int nmol,
-              int natoms,real phi[],real charge[],t_block *excl)
-{
-  int  i,i1,i2,j,k;
-  real qq,qi,vv,V,Vex,Vc,Vt;
-  
-  qq   = 0;
-  V    = 0;
-  for(i=0; (i<natoms); i++) {
-    vv   = charge[i]*phi[i];
-    V   += vv;
-    qq  += charge[i]*charge[i];
-  }
-  V  = 0.5*V;
-  Vc = 0.5*C*ONE_4PI_EPS0*qq;
-  
-  qq = 0;
-  for(i=0; (i<excl->nr); i++) {
-    i1 = excl->index[i];
-    i2 = excl->index[i+1];
-    qi = charge[i];
-    for(j=i1; (j<i2); j++) {
-      k = excl->a[j];
-      if (k != i)
-       qq+=qi*charge[k];
-    }
-  }
-  Vex = qq*0.5*C*ONE_4PI_EPS0;
-  
-  Vt = V - Vc - Vex;
-  
-  if (bHeader) {
-    fprintf(fp,"%12s  %12s  %12s  %12s  %12s  %12s\n",
-           "","Vphi","Vself","Vexcl","Vtot","1Mol");
-    
-  }
-  fprintf(fp,"%12s  %12.5e  %12.5e  %12.5e  %12.5e  %12.5e\n",
-         title,V,Vc,Vex,Vt,Vt/nmol);
-}
-
-void write_pqr(char *fn,t_atoms *atoms,rvec x[],real phi[],real dx)
-{
-  FILE *fp;
-  int  i,rnr;
-  
-  fp=gmx_fio_fopen(fn,"w");
-  for(i=0; (i<atoms->nr); i++) {
-    rnr=atoms->atom[i].resnr;
-    fprintf(fp,"%-6s%5d  %-4.4s%3.3s %c%4d    %8.3f%8.3f%8.3f%6.2f%6.2f\n",
-           "ATOM",(i+1),*atoms->atomname[i],*atoms->resname[rnr],' ',
-           (rnr+1) % 10000,
-           10*(dx+x[i][XX]),10*x[i][YY],10*(x[i][ZZ]),0.0,phi[i]);
-  }
-  gmx_fio_fclose(fp);
-}
-
-void write_grid_pqr(char *fn,int nx,int ny,int nz,real ***phi)
-{
-  FILE *fp;
-  int  i,j,k,rnr=0;
-  real fac=4.0;
-  
-  fp=gmx_fio_fopen(fn,"w");
-  for(i=0; (i<nx); i++)
-    for(j=0; (j<ny); j++)
-      for(k=0; (k<nz); k++,rnr++)
-       fprintf(fp,"%-6s%5d  %-4.4s%3.3s %c%4d    %8.3f%8.3f%8.3f%6.2f%6.2f\n",
-               "ATOM",(i+1),"C","C",' ',
-               1+((rnr+1) % 10000),fac*i,fac*j,fac*k,0.0,phi[i][j][k]);
-  gmx_fio_fclose(fp);
-}
-void plot_phi(char *fn,rvec box,int natoms,rvec x[],real phi[])
-{
-  t_psdata eps;
-  real phi_max,rr,gg,bb,fac,dx,x0,y0;
-  real offset;
-  int  i;
-  
-  phi_max=phi[0];
-  rr=gg=bb=0.0;
-  for(i=0; (i<natoms); i++) 
-    phi_max=max(phi_max,fabs(phi[i]));
-    
-  if (phi_max==0.0) {
-    fprintf(stderr,"All values zero, see .out file\n");
-    return;
-  }
-  offset=20.0;
-  fac=15.0;
-#ifdef DEBUG
-  fprintf(stderr,"Scaling box by %g\n",fac);
-#endif
-  eps=ps_open(fn,0,0,
-             (real)(fac*box[XX]+2*offset),(real)(fac*box[YY]+2*offset));
-  ps_translate(eps,offset,offset);
-  ps_color(eps,0,0,0);
-  ps_box(eps,1,1,(real)(fac*box[XX]-1),(real)(fac*box[YY]-1));
-  dx=0.15*fac;
-  for(i=0; (i<natoms); i++) {
-    rr=gg=bb=1.0;
-    if (phi[i] < 0)
-      gg=bb=(1.0+(phi[i]/phi_max));
-    else 
-      rr=gg=(1.0-(phi[i]/phi_max));
-    rr=rgbset(rr);
-    gg=rgbset(gg);
-    bb=rgbset(bb);
-    ps_color(eps,rr,gg,bb);
-    x0=fac*x[i][XX];
-    y0=fac*x[i][YY];
-    ps_fillbox(eps,(real)(x0-dx),(real)(y0-dx),(real)(x0+dx),(real)(y0+dx));
-  }
-  ps_close(eps);
-}
-
-void plot_qtab(char *fn,int nx,int ny,int nz,real ***qtab)
-{
-  rvec box;
-  rvec *xx;
-  real *phi;
-  int  i,npt,ix,iy,iz;
-  
-  box[XX]=nx;
-  box[YY]=ny;
-  box[ZZ]=nz;
-
-  npt=(box[XX]*box[YY]*box[ZZ]);
-  snew(xx,npt);
-  snew(phi,npt);
-  nx/=2;
-  ny/=2;
-  nz/=2;
-  i=0;
-  for(ix=-nx; (ix<nx); ix++)
-    for(iy=-ny; (iy<ny); iy++)
-      for(iz=-nz; (iz<nz); iz++,i++) {
-       xx[i][XX]=ix+nx+0.5;
-       xx[i][YY]=iy+ny+0.5;
-       xx[i][ZZ]=iz+nz+0.5; /* onzin */
-       phi[i]=qtab[ix+nx][iy+ny][iz+nz];
-      }
-  
-  plot_phi(fn,box,npt,xx,phi);
-  
-  sfree(xx);
-  sfree(phi);
-}
-
-void print_phi(char *fn,int natoms,rvec x[],real phi[])
-{
-  FILE *fp;
-  int  i;
-  
-  fp=gmx_fio_fopen(fn,"w");
-  for(i=0; (i<natoms); i++)
-    fprintf(fp,"%10d  %12.5e\n",i,phi[i]);
-  gmx_fio_fclose(fp);
-}
-
-void pr_f(char *fn,int natoms,rvec f[])
-{
-  FILE *fp;
-  int  i;
-  
-  fp=gmx_fio_fopen(fn,"w");
-  for(i=0; (i<natoms); i++)
-    fprintf(fp,"  %12.5e\n  %12.5e\n  %12.5e\n",f[i][XX],f[i][YY],f[i][ZZ]);
-  gmx_fio_fclose(fp);
-}
-
-void test_pppm(FILE *log,       gmx_bool bVerbose,
-              gmx_bool bGenerGhat, char *ghatfn,
-              t_atoms *atoms,  t_inputrec *ir,
-              rvec x[],        rvec f[],
-              real charge[],   rvec box,
-              real phi[],      real phi_s[],
-              int nmol,        t_commrec *cr,
-              gmx_bool bOld,       t_block *cgs)
-{
-  char       buf[256];
-  real       ener;
-  int        i;
-  t_nrnb     nrnb;
-  t_nsborder nsb;
-  
-  init_nrnb(&nrnb);
-  calc_nsb(cgs,1,&nsb,0);
-  
-  /* First time only setup is done! */
-  init_pppm(log,cr,&nsb,bVerbose,bOld,box,ghatfn,ir);
-  
-  ener = do_pppm(log,bVerbose,x,f,charge,box,phi,cr,&nsb,&nrnb);
-  fprintf(log,"Vpppm = %g\n",ener);
-  
-  sprintf(buf,"PPPM-%d.pdb",ir->nkx);
-  write_pqr(buf,atoms,x,phi,0);
-  
-  pr_f("pppm-force",atoms->nr,f);
-  
-  calc_ener(log,buf,FALSE,nmol,atoms->nr,phi,charge,&atoms->excl);
-  
-  for(i=0; (i<atoms->nr); i++) 
-    phi[i]+=phi_s[i];
-  sprintf(buf,"PPPM-%d+SR",ir->nkx);
-  calc_ener(log,buf,FALSE,nmol,atoms->nr,phi,charge,&atoms->excl);
-  strcat(buf,".pdb");
-  write_pqr(buf,atoms,x,phi,0);
-}
-
-void test_poisson(FILE *log,       gmx_bool bVerbose,
-                 t_atoms *atoms,  t_inputrec *ir,
-                 rvec x[],        rvec f[],
-                 real charge[],   rvec box,
-                 real phi[],      real phi_s[],
-                 int nmol,        t_commrec *cr,
-                 gmx_bool bFour,      rvec f_four[],
-                 real phi_f[],    gmx_bool bOld)
-{
-  char buf[256];
-  real ener;
-  rvec beta;
-  int  i,nit;
-  t_nrnb nrnb;
-  
-  init_nrnb(&nrnb);
-  
-  /* First time only setup is done! */
-  if (bFour) {
-    for(i=0; (i<atoms->nr); i++)
-      phi_f[i] -= phi_s[i];
-    ener = do_optimize_poisson(log,bVerbose,ir,atoms->nr,x,f,charge,
-                              box,phi,cr,&nrnb,f_four,phi_f,beta,bOld);
-    for(i=0; (i<atoms->nr); i++)
-      phi_f[i] += phi_s[i];
-    nit = 0;
-  }
-  else {
-    ener = do_poisson(log,bVerbose,ir,atoms->nr,x,f,charge,box,phi,
-                     cr,&nrnb,&nit,bOld);
-  }
-    
-  fprintf(log,"Vpoisson = %g, nit = %d\n",ener,nit);
-  
-  sprintf(buf,"POISSON-%d.pdb",ir->nkx);
-  write_pqr(buf,atoms,x,phi,0);
-  
-  pr_f("poisson-force",atoms->nr,f);
-  
-  calc_ener(log,buf,FALSE,nmol,atoms->nr,phi,charge,&atoms->excl);
-  
-  for(i=0; (i<atoms->nr); i++) 
-    phi[i]+=phi_s[i];
-  sprintf(buf,"POISSON-%d+SR",ir->nkx);
-  calc_ener(log,buf,FALSE,nmol,atoms->nr,phi,charge,&atoms->excl);
-  strcat(buf,".pdb");
-  write_pqr(buf,atoms,x,phi,0);
-}
-
-void test_four(FILE *log,int NFILE,t_filenm fnm[],t_atoms *atoms,
-              t_inputrec *ir,rvec x[],rvec f[],rvec box,real charge[],
-              real phi_f[],real phi_s[],int nmol,t_commrec *cr,
-              gmx_bool bOld,gmx_bool bOldEwald)
-{
-  int  i;
-  real energy;
-  ewald_tab_t et;
-
-  init_ewald_tab(&et, NULL, ir, log);
-
-  if (bOldEwald)  
-    energy = do_ewald(log,ir,atoms->nr,x,f,charge,box,phi_f,cr,bOld,et);
-  else
-    energy = do_ewald_new(log,ir,atoms->nr,x,f,charge,box,phi_f,cr,bOld,et);
-  
-  /*symmetrize_phi(log,atoms->nr,phi_f,bVerbose);*/
-    
-  /* Plot the long range fourier solution in a matrix */    
-  plot_phi(opt2fn("-elf",NFILE,fnm),box,atoms->nr,x,phi_f);
-  print_phi(opt2fn("-of",NFILE,fnm),atoms->nr,x,phi_f);
-  calc_ener(log,"Fourier",FALSE,nmol,atoms->nr,phi_f,charge,&atoms->excl);
-  write_pqr(opt2fn("-pf",NFILE,fnm),atoms,x,phi_f,0.0/*1.5*box[XX]*/);
-  pr_f("four-force",atoms->nr,f);
-  
-  /* Calc and plot the total potential */
-  for(i=0; (i<atoms->nr); i++) {
-    phi_f[i]+=phi_s[i];
-    /*clear_rvec(f[i]);*/
-  }
-  calc_ener(log,"Fourier+SR",FALSE,nmol,atoms->nr,phi_f,charge,&atoms->excl);
-}
-
-static void print_opts(FILE *fp,t_inputrec *ir,gmx_bool bFour)
-{
-  fprintf(fp,"Ewald solution: %s\n",gmx_bool_names[bFour]);
-  fprintf(fp,"r1:       %10.3e\n",ir->rcoulomb_switch);
-  fprintf(fp,"rc:       %10.3e\n",ir->rcoulomb);
-  if (bFour)
-    fprintf(fp,"KVectors: %10d  %10d  %10d\n",ir->nkx,ir->nky,ir->nkz);
-  fprintf(fp,"\n");
-}
-
-int main(int argc,char *argv[])
-{
-  static char *desc[] = {
-    "[TT]testlr[tt] tests the PPPM and Ewald method for the",
-    "long range electrostatics problem."
-  };
-  static t_filenm  fnm[] = {
-    { efTPX, NULL,   NULL,       ffREAD },
-    { efHAT, "-g",   "ghat",     ffOPTRD },
-    { efOUT, "-o",   "rho",      ffOPTWR },
-    { efOUT, "-op",  "lr-pb",    ffOPTWR },
-    { efOUT, "-of",  "lr-four",  ffOPTWR },
-    { efOUT, "-opt", "tot-pb",   ffOPTWR },
-    { efOUT, "-oft", "tot-four", ffOPTWR },
-    { efOUT, "-fin", "lr-four",  ffOPTWR },
-    { efEPS, "-es",  "sr",       ffOPTWR },
-    { efEPS, "-elf", "lr-four",  ffOPTWR },
-    { efEPS, "-etf", "tot-four", ffOPTWR },
-    { efEPS, "-qr",  "qk-real",  ffOPTWR },
-    { efEPS, "-qi",  "qk-im",    ffOPTWR },
-    { efEPS, "-elp", "lr-pb",    ffOPTWR },
-    { efEPS, "-etp", "tot-pb",   ffOPTWR },
-    { efEPS, "-rho", "rho",      ffOPTWR },
-    { efEPS, "-qq",  "charge",   ffOPTWR },
-    { efXVG, "-gt",  "gk-tab",   ffOPTWR },
-    { efXVG, "-fcorr","fcorr",   ffWRITE },
-    { efXVG, "-pcorr","pcorr",   ffWRITE },
-    { efXVG, "-ftotcorr","ftotcorr",   ffWRITE },
-    { efXVG, "-ptotcorr","ptotcorr",   ffWRITE },
-    { efLOG, "-l",   "fptest",   ffWRITE },
-    { efXVG, "-gr",  "spread",   ffOPTWR },
-    { efPDB, "-pf",  "pqr-four", ffOPTWR },
-    { efPDB, "-phitot", "pppm-phitot", ffOPTWR }
-  };
-#define NFILE asize(fnm)
-  FILE         *log;
-  t_topology   top;
-  t_tpxheader  stath;
-  t_inputrec   ir;
-  t_block      *excl;
-  t_forcerec   *fr;
-  t_commrec    *cr;
-  t_mdatoms    *mdatoms;
-  t_graph      *graph;
-  int          i,step,nre,natoms,nmol;
-  rvec         *x,*f_sr,*f_excl,*f_four,*f_pppm,*f_pois,box_size,hbox;
-  matrix       box;
-  real         t,lambda,vsr,*charge,*phi_f,*phi_pois,*phi_s,*phi_p3m,*rho;
-  output_env_t oenv;
-  
-  static gmx_bool bFour=FALSE,bVerbose=FALSE,bGGhat=FALSE,bPPPM=TRUE,
-    bPoisson=FALSE,bOld=FALSE,bOldEwald=TRUE;
-  static int nprocs = 1;
-  static t_pargs pa[] = {
-    { "-np",     FALSE, etINT,  &nprocs,  "Do it in parallel" },
-    { "-ewald",  FALSE, etBOOL, &bFour,   "Do an Ewald solution"},
-    { "-pppm",   FALSE, etBOOL, &bPPPM,   "Do a PPPM solution" },
-    { "-poisson",FALSE, etBOOL, &bPoisson,"Do a Poisson solution" },
-    {    "-v",   FALSE, etBOOL, &bVerbose,"Verbose on"},
-    { "-ghat",   FALSE, etBOOL, &bGGhat,  "Generate Ghat function"},
-    { "-old",    FALSE, etBOOL, &bOld,    "Use old function types"},
-    { "-oldewald",FALSE,etBOOL, &bOldEwald,"Use old Ewald code"}
-  };
-
-  CopyRight(stderr,argv[0]);
-  parse_common_args_r(&argc,argv,PCA_CAN_TIME | PCA_CAN_VIEW,
-                     NFILE,fnm,asize(pa),pa,asize(desc),desc,0,NULL,&oenv); 
-
-  if (nprocs > 1) {
-    cr = init_par(&argc,argv);
-    open_log(ftp2fn(efLOG,NFILE,fnm),cr);
-    log = stdlog;
-  }
-  else {
-    cr     = init_par(&argc,argv);
-    log    = ftp2FILE(efLOG,NFILE,fnm,"w");
-    stdlog = log;  }
-  
-
-  /* Read topology and coordinates */
-  read_tpxheader(ftp2fn(efTPX,NFILE,fnm),&stath,FALSE);
-  snew(x,stath.natoms);
-  snew(f_sr,stath.natoms);
-  snew(f_excl,stath.natoms);
-  snew(f_four,stath.natoms);
-  snew(f_pppm,stath.natoms);
-  snew(f_pois,stath.natoms);
-  read_tpx(ftp2fn(efTPX,NFILE,fnm),&step,&t,&lambda,&ir,
-          box,&natoms,x,NULL,NULL,&top);
-  excl=&(top.atoms.excl);
-  nmol=top.blocks[ebMOLS].nr;
-
-  /* Allocate space for potential, charges and rho (charge density) */
-  snew(charge,stath.natoms);
-  snew(phi_f,stath.natoms);
-  snew(phi_p3m,stath.natoms);
-  snew(phi_pois,stath.natoms);
-  snew(phi_s,stath.natoms);
-  snew(rho,stath.natoms);
-  
-  /* Set the charges */
-  for(i=0; (i<natoms); i++)
-    charge[i]=top.atoms.atom[i].q;
-
-  /* Make a simple box vector instead of tensor */
-  for(i=0; (i<DIM); i++) 
-    box_size[i]=box[i][i];
-  
-  /* Set some constants */
-  fr      = mk_forcerec();
-  mdatoms = atoms2md(&(top.atoms),FALSE,FALSE);
-  
-  set_LRconsts(log,ir.rcoulomb_switch,ir.rcoulomb,box_size,fr);
-  init_forcerec(log,fr,&ir,&(top.blocks[ebMOLS]),cr,
-               &(top.blocks[ebCGS]),&(top.idef),mdatoms,box,FALSE);
-  calc_shifts(box,box_size,fr->shift_vec,FALSE);
-
-  /* Periodicity stuff */  
-  graph = mk_graph(&(top.idef),top.atoms.nr,FALSE,FALSE);
-  shift_self(graph,fr->shift_vec,x);
-
-  calc_LRcorrections(log,0,natoms,ir.rcoulomb_switch,
-                    ir.rcoulomb,charge,excl,x,f_excl,bOld);
-  pr_f("f_excl.dat",natoms,f_excl);
-  
-  /* Compute the short range potential */
-  put_atoms_in_box(natoms,box,x);
-  vsr=phi_sr(log,natoms,x,charge,ir.rcoulomb,
-            ir.rcoulomb_switch,box_size,phi_s,excl,f_sr,bOld); 
-  pr_f("f_sr.dat",natoms,f_sr);
-  
-  /* Plot the short range potential in a matrix */    
-  calc_ener(log,"Short Range",TRUE,nmol,natoms,phi_s,charge,excl);
-  
-  
-  if (bFour)   
-    test_four(log,NFILE,fnm,&(top.atoms),&ir,x,f_four,box_size,charge,phi_f,
-             phi_s,nmol,cr,bOld,bOldEwald);
-  
-  if (bPPPM) 
-    test_pppm(log,bVerbose,bGGhat,opt2fn("-g",NFILE,fnm),
-             &(top.atoms),&ir,x,f_pppm,charge,box_size,phi_p3m,phi_s,nmol,
-             cr,bOld,&(top.blocks[ebCGS]));
-  
-  if (bPoisson)
-    test_poisson(log,bVerbose,
-                &(top.atoms),&ir,x,f_pois,charge,box_size,phi_pois,
-                phi_s,nmol,cr,bFour,f_four,phi_f,bOld);
-               
-  if (bPPPM && bFour) 
-    analyse_diff(log,"PPPM",oenv,
-                top.atoms.nr,f_four,f_pppm,phi_f,phi_p3m,phi_s,
-                opt2fn("-fcorr",NFILE,fnm),
-                opt2fn("-pcorr",NFILE,fnm),
-                opt2fn("-ftotcorr",NFILE,fnm),
-                opt2fn("-ptotcorr",NFILE,fnm));
-  
-  if (bPoisson && bFour) 
-    analyse_diff(log,"Poisson",oenv,
-                top.atoms.nr,f_four,f_pois,phi_f,phi_pois,phi_s,
-                opt2fn("-fcorr",NFILE,fnm),
-                opt2fn("-pcorr",NFILE,fnm),
-                opt2fn("-ftotcorr",NFILE,fnm),
-                opt2fn("-ptotcorr",NFILE,fnm));
-  
-  gmx_fio_fclose(log);
-  
-  gmx_thanx(stderr);
-  
-  return 0;
-}
-
diff --git a/src/contrib/testtab.c b/src/contrib/testtab.c
deleted file mode 100644 (file)
index 7ddd71c..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * 
- *                This source code is part of
- * 
- *                 G   R   O   M   A   C   S
- * 
- *          GROningen MAchine for Chemical Simulations
- * 
- *                        VERSION 3.2.0
- * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
- * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2004, The GROMACS development team,
- * check out http://www.gromacs.org for more information.
-
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- * 
- * If you want to redistribute modifications, please consider that
- * scientific software is very special. Version control is crucial -
- * bugs must be traceable. We will be happy to consider code for
- * inclusion in the official distribution, but derived work must not
- * be called official GROMACS. Details are found in the README & COPYING
- * files - if they are missing, get the official version at www.gromacs.org.
- * 
- * To help us fund GROMACS development, we humbly ask that you cite
- * the papers on the package - you can find them in the top README file.
- * 
- * For more info, check our website at http://www.gromacs.org
- * 
- * And Hey:
- * GROningen Mixture of Alchemy and Childrens' Stories
- */
-/* This file is completely threadsafe - keep it that way! */
-
-#include <stdio.h>
-#include "typedefs.h"
-#include "force.h"
-#include "coulomb.h"
-
-int main(int argc,char *argv[])
-{
-  t_forcerec *fr;
-  rvec box;
-  
-  fr=mk_forcerec();
-  fr->r1 = 0.6;
-  fr->rc = 0.9;
-  fr->eeltype = eelTWIN;
-  box[XX]=box[YY]=box[ZZ]=1.0;
-
-  make_tables(fr);
-  
-  return 0;
-}
diff --git a/src/contrib/testxml.c b/src/contrib/testxml.c
deleted file mode 100644 (file)
index e9fc47e..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * 
- *                This source code is part of
- * 
- *                 G   R   O   M   A   C   S
- * 
- *          GROningen MAchine for Chemical Simulations
- * 
- *                        VERSION 3.2.0
- * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
- * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2004, The GROMACS development team,
- * check out http://www.gromacs.org for more information.
-
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- * 
- * If you want to redistribute modifications, please consider that
- * scientific software is very special. Version control is crucial -
- * bugs must be traceable. We will be happy to consider code for
- * inclusion in the official distribution, but derived work must not
- * be called official GROMACS. Details are found in the README & COPYING
- * files - if they are missing, get the official version at www.gromacs.org.
- * 
- * To help us fund GROMACS development, we humbly ask that you cite
- * the papers on the package - you can find them in the top README file.
- * 
- * For more info, check our website at http://www.gromacs.org
- * 
- * And Hey:
- * GROningen Mixture of Alchemy and Childrens' Stories
- */
-#include "macros.h"
-#include "gromacs/utility/smalloc.h"
-#include "xmlio.h"
-#include "gromacs/commandline/pargs.h"
-#include "gromacs/fileio/tpxio.h"
-
-int cmain(int argc,char *argv[])
-{
-  int        step,natoms;
-  real       t,lambda;
-  t_inputrec ir;
-  t_topology top;
-  matrix     box;
-  rvec       *x,*v,*f;
-  t_filenm fnm[] = {
-    { efTPX, NULL, NULL, ffREAD  },
-    { efXML, "-r", NULL, ffREAD  },
-    { efXML, "-o", NULL, ffWRITE }
-  };  
-#define NFILE asize(fnm)
-
-  CopyRight(stderr,argv[0]);
-  parse_common_args(&argc,argv,0,NFILE,fnm,0,NULL,0,NULL,0,NULL);
-  
-  init_top(&top);
-  if (opt2bSet("-r",NFILE,fnm))
-    read_xml(opt2fn("-r",NFILE,fnm),&step,&t,&lambda,&ir,
-            box,&natoms,&x,&v,&f,&top);
-  else {
-    t_tpxheader tpx;
-    
-    read_tpxheader(ftp2fn(efTPX,NFILE,fnm),&tpx,FALSE);
-    snew(x,tpx.natoms);
-    snew(v,tpx.natoms);
-    f = NULL;
-    read_tpx(ftp2fn(efTPX,NFILE,fnm),&step,&t,&lambda,&ir,
-            box,&natoms,x,v,f,&top);
-  }
-  /*write_xml(opt2fn("-o",NFILE,fnm),step,t,lambda,&ir,box,natoms,x,v,f,&top);*/
-  
-  return 0;
-}
-
-
-
diff --git a/src/contrib/timefft.c b/src/contrib/timefft.c
deleted file mode 100644 (file)
index 1bc0cfb..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * 
- *                This source code is part of
- * 
- *                 G   R   O   M   A   C   S
- * 
- *          GROningen MAchine for Chemical Simulations
- * 
- *                        VERSION 3.2.0
- * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
- * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2004, The GROMACS development team,
- * check out http://www.gromacs.org for more information.
-
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- * 
- * If you want to redistribute modifications, please consider that
- * scientific software is very special. Version control is crucial -
- * bugs must be traceable. We will be happy to consider code for
- * inclusion in the official distribution, but derived work must not
- * be called official GROMACS. Details are found in the README & COPYING
- * files - if they are missing, get the official version at www.gromacs.org.
- * 
- * To help us fund GROMACS development, we humbly ask that you cite
- * the papers on the package - you can find them in the top README file.
- * 
- * For more info, check our website at http://www.gromacs.org
- * 
- * And Hey:
- * GROwing Monsters And Cloning Shrimps
- */
-#include <math.h>
-#include <stdio.h>
-#include <time.h>
-
-#include "typedefs.h"
-#include "macros.h"
-#include "gromacs/utility/smalloc.h"
-#include "gromacs/fileio/xvgr.h"
-#include "copyrite.h"
-#include "mdrun.h"
-#include "main.h"
-#include "gromacs/commandline/pargs.h"
-#include "gromacs/fft/fft.h"
-#include "gromacs/math/gmxcomplex.h"
-
-#if GMX_MPI
-#include "gromacs/fft/parallel_3dfft.h"
-#endif
-
-#include "fftgrid.h"
-
-
-int main(int argc,char *argv[])
-{
-  int       mmm[] = { 8, 10, 12, 15, 16, 18, 20, 24, 25, 27, 30, 32, 36, 40,
-                     45, 48, 50, 54, 60, 64, 72, 75, 80, 81, 90, 100 };
-  int       nnn[] = { 24, 32, 48, 60, 72, 84, 96 };
-#define NNN asize(nnn)
-  FILE      *fp,*fplog;
-  int       *niter;
-  int       i,j,n,nit,ntot,n3,rsize;
-  double    t,nflop,start;
-  double    *rt,*ct;
-  t_fftgrid *g;
-  t_commrec *cr;
-  static gmx_bool bReproducible = FALSE;
-  static int  nnode    = 1;
-  static int  nitfac  = 1;
-  t_pargs pa[] = {
-    { "-reproducible",   FALSE, etBOOL, {&bReproducible}, 
-      "Request binary reproducible results" },
-    { "-np",    FALSE, etINT, {&nnode},
-      "Number of NODEs" },
-    { "-itfac", FALSE, etINT, {&nitfac},
-      "Multiply number of iterations by this" }
-  };
-  static t_filenm fnm[] = {
-    { efLOG, "-g", "fft",      ffWRITE },
-    { efXVG, "-o", "fft",      ffWRITE }
-  };
-#define NFILE asize(fnm)
-  
-  cr = init_par(&argc,&argv);
-  if (MASTER(cr))
-    CopyRight(stdout,argv[0]);
-  parse_common_args(&argc,argv, PCA_CAN_SET_DEFFNM,
-                   NFILE,fnm,asize(pa),pa,0,NULL,0,NULL);
-  gmx_log_open(ftp2fn(efLOG,NFILE,fnm),cr,1,0,&fplog);
-
-  snew(niter,NNN);
-  snew(ct,NNN);
-  snew(rt,NNN);
-  rsize = sizeof(real);
-  for(i=0; (i<NNN); i++) {
-    n  = nnn[i];
-    if (n < 16)
-      niter[i] = 50;
-    else if (n < 26)
-      niter[i] = 20;
-    else if (n < 51)
-      niter[i] = 10;
-    else
-      niter[i] = 5;
-    niter[i] *= nitfac;
-    nit = niter[i];
-    
-    if (MASTER(cr))
-      fprintf(stderr,"\r3D FFT (%s precision) %3d^3, niter %3d     ",
-             (rsize == 8) ? "Double" : "Single",n,nit);
-    
-    g  = mk_fftgrid(n,n,n,NULL,NULL,cr,bReproducible);
-
-    if (PAR(cr))
-      start = time(NULL);
-    else
-      start_time();
-    for(j=0; (j<nit); j++) {
-      gmxfft3D(g,GMX_FFT_REAL_TO_COMPLEX,cr);
-      gmxfft3D(g,GMX_FFT_COMPLEX_TO_REAL,cr);
-    }
-    if (PAR(cr)) 
-      rt[i] = time(NULL)-start;
-    else {
-      update_time();
-      rt[i] = node_time();
-    }
-    done_fftgrid(g);
-    sfree(g);
-  }
-  if (MASTER(cr)) {
-    fprintf(stderr,"\n");
-    fp=xvgropen(ftp2fn(efXVG,NFILE,fnm),
-               "FFT timings","n^3","t (s)");
-    for(i=0; (i<NNN); i++) {
-      n3 = 2*niter[i]*nnn[i]*nnn[i]*nnn[i];
-      fprintf(fp,"%10d  %10g\n",nnn[i],rt[i]/(2*niter[i]));
-    }
-    gmx_fio_fclose(fp);
-  }
-  return 0;
-}
diff --git a/src/contrib/total.f b/src/contrib/total.f
deleted file mode 100644 (file)
index 5b7b571..0000000
+++ /dev/null
@@ -1,1526 +0,0 @@
-C Chemical shift calculation, to read in multiple NMR structures
-C (with protons) and calculate sd for each
-C Will also read Xray structures and add protons
-C Current limit is 5000 heavy atoms 3000 protons and 50 rings
-C Author - Mike Williamson Jan 94
-C see M P Williamson and T Asakura, J Magn Reson Ser B 101 63-71 1993
-       DIMENSION SHIFT(3000)   !Shift values for each proton
-       DIMENSION ANISCO(3000),ANISCN(3000),SHIFTE(3000)
-       DIMENSION sum(3000),exptln(3000)
-       DIMENSION EXPTL(3000)   !Exptl shifts (external file)
-       DIMENSION IRES(5000),RES(5000),ANAME(5000),FINAL(3000)
-       DIMENSION X(5000), Y(5000), Z(5000) !Heavy atom input
-       DIMENSION IRESH(3000),RESH(3000),ANAMEH(3000)
-       DIMENSION XH(3000), YH(3000), ZH(3000) !H atom input
-       DIMENSION vx(3),vy(3),vz(3),CEN(3),rh(3),pregam(3),yy(3)
-C (Anisotropy tensor plus anisotropy centre)
-       DIMENSION vca(3),vc(3),vo(3),vn(3),calctemp(3000)
-       DIMENSION datres(179),datnam(179),datshift(179)
-       DIMENSION RCNET(3000)
-       DIMENSION IACODE(50),IRATPT(9,50),IRATS(50)
-       DIMENSION shiftt(3000),exptlt(3000),VCHN(3)
-       dimension rn(3,50),cent(3,50),signr(50)
-        dimension iexp(2000),atexp(2000),pexp(2000),eexp(2000)
-        CHARACTER ANAME*4,RES*3,FN1*60,FN3*40,junk*80
-       CHARACTER ans*1,FN4*40,pexp*3,resh*3,anameh*4,prott*3
-       CHARACTER datres*3,datnam*4,YN*1,atexp*4,FN9*60,RFILE*60
-       integer AT1,AT2,AT3,INDX(3000)
-       COMMON x,y,z,xh,yh,zh
-C Set values for anisotropies, atomic charges and multiplication
-C factor for electric field: shift=-Ez*sigmaE
-       DATA XCO1/-13.0/,XCO2/-4.0/,XCN1/-11.0/,XCN2/1.40/
-       DATA sigmaE/0.60/,Qc/1.60/,Qn/-1.70/,Qo/-2.30/
-       DATA Qhn/0.70/
-C NB The atomic charges are in esu
-C
-C******************FILE INPUT************************************
-       iwarning=1
-       type *,'Input file?'
-       read(5,999)FN1
-997    format (I)
-98     FORMAT (I5)
-999    format(A)
-        type *,'Output file?'
-        read(5,999)FN3
-       type *,'Calculate for HA[1], HN[2] or all protons[3]?'
-       read(5,997)icalculate 
-       print *,'icalculate=',icalculate
-C NB Actually calculates all protons, just prints differently
-99     FORMAT(A80)
-       type *,' Are you comparing calc. to experimental shifts? [N]'
-       read(5,970)YN
-970    format(A)
-        OPEN(1,file=FN1,STATUS='OLD',readonly)
-       OPEN(3,file=FN3)
-       type *,' Random file ?'
-       read(5,999)RFILE
-       open(4,file=RFILE,status='old',readonly)
-       do 25 I=1,179           !Random coil shifts
-       read(4,998) datres(I),datnam(I),datshift(I)
-998    format(A3,1X,A4,F5.2)
-25     continue
-        if(yn.eq.'Y'.or.yn.eq.'y') then
-       type *,' File containing experimental shifts?'
-       read(5,999)FN4
-       OPEN(UNIT=8,FILE=FN4,STATUS='OLD')
-C This file should contain 2-line header, no. of protons (I5) plus list
-        type *,'Name of protein in this file?'
-       read(5,992) prott
-992     format(A3)
-       READ (8,99) JUNK
-       READ (8,99) JUNK
-       READ (8,98) Iprot
-       do 900 II=1,Iprot
-       read (8,996) iexp(ii),atexp(ii),pexp(ii),eexp(ii)
-996    format(I3,7X,A4,5X,A3,27X,F9.5)
-900     continue
-        endif
-        imodel=0
-776     iheavyatom=0
-        iproton=0
-C PDB file should end with TER or END or preferably both
-        do 10 I=1,100000
-       READ (1,99,end=777) JUNK
-        if (junk(1:5).eq.'MODEL') then
-         read(junk(6:14),'(I9)') nmodel
-         imodel=1
-        endif
-        if (junk(1:6).eq.'ENDMDL') goto 11 
-       if (junk(1:4).eq.'END') then
-         if (imodel.eq.1) goto 777
-          goto 11
-        endif
-C Replace D by H for neutron structures
-       if (junk(14:14).eq.'D') junk(14:14)='H'
-        if (junk(1:4).eq.'TER ') goto 11
-        if (junk(1:4).eq.'ATOM') then
-        if(junk(27:27).ne.' ') print 601,junk(23:26)
-601       format('WARNING: substituted residue present at ',A4)
-        if(junk(22:22).ne.' '.and.iwarning.eq.1) then
-         iwarning=2
-         type *,'WARNING: more than one chain present'
-        endif
-        if(junk(17:17).ne.' ') print 602,junk(23:26)
-602       format('WARNING: alternate conformations at residue ',A4)
-C Next line reads HN in as heavy atom, for Electric field calc.
-         if((junk(14:14).ne.'H').or.(junk(13:15).eq.' H ')) then
-         iheavyatom=iheavyatom+1
-         read(junk(13:16),'(A4)') aname(iheavyatom)
-         read(junk(18:20),'(A3)') res(iheavyatom)
-         read(junk(23:26),'(I4)') ires(iheavyatom)
-         read(junk(31:54),'(3F8.0)') x(iheavyatom),
-     .     y(iheavyatom),z(iheavyatom)
-        endif
-         if(junk(14:14).eq.'H') then
-         if((icalculate.eq.1).and.(junk(14:15).ne.'HA'))goto 10 
-         if((icalculate.eq.2).and.(junk(14:15).ne.'H '))goto 10 
-         iproton=iproton+1 
-         read(junk(13:16),'(A4)') anameh(iproton)
-         read(junk(18:20),'(A3)') resh(iproton)
-         read(junk(23:26),'(I4)') iresh(iproton)
-         read(junk(31:38),'(F8.3)') xh(iproton)
-         read(junk(39:46),'(F8.3)') yh(iproton)
-         read(junk(47:54),'(F8.3)') zh(iproton)
-         endif
-        endif
-10      CONTINUE
-11       continue
-C To avoid calculating for water molecules
-         if(res(1).eq.'WAT'.or.res(2).eq.'WAT') goto 777
-C Now see if protons are present and add them if not
-C
-C       Next Line hacked (DvdS, 12/94)
-       if ((iproton.eq.0) .or. (icalculate.eq.3)) then
-       type *,'Adding protons'
-       type *,'Print out file with protons?'
-       read(5,607)ANS
-       call addprot(x,y,z,xh,yh,zh,Iheavyatom,Iproton,
-     &   aname,anameh,res,resh,ires,iresh)
-       if(ans.eq.'Y'.or.ans.eq.'y') then
-         do 670 I=1,60
-         if(FN1(I:I).eq.' ')goto 671
-670      continue
-671      ilength=I-1
-         if(ilength.lt.40) then
-           FN9=FN1(1:ilength-4)//'_protonated.pdb'
-         else
-          FN9=FN1(ilength-8:ilength-4)//'_protonated.pdn'
-         endif
-         print 669,FN9
-669       format('Output going to ',A)
-         open(9,file=FN9)
-         write(9,660)FN1 
-660       format('REMARK  Generated from ',60A)
-         iresstart=ires(1)
-         iresend=ires(iheavyatom)
-         iline=0
-         do 668 icount=iresstart,iresend
-         do 661 I=1,iheavyatom
-         if(aname(I).eq.' H  ') goto 661
-         if(ires(I).eq.icount) then 
-         iline=iline+1
-          write(9,662)iline,aname(I),res(I),ires(I),x(I),y(I),z(I)
-         endif
-662       format('ATOM',I7,1X,A4,1X,A3,2X,I4,4X,3F8.3)
-661       continue
-          do 663 I=1,iproton
-          if(iresh(I).eq.icount) then
-         iline=iline+1
-          write(9,662)iline,anameh(I),resh(I),iresh(I),xh(I),yh(I),zh(I)
-         endif
-663       continue
-668       continue
-          write(9,665)
-          write(9,666)
-665       format('TER')
-666       format('END')
-        end if
-       end if
-         do 20 I=1,iproton
-        shift(I)=0.0           !initialise
-        anisco(I)=0.0
-        aniscn(I)=0.0
-        shiftE(I)=0.0
-20      continue
-607    FORMAT(A1)
-       type *,' All atoms read...initialising'
-        if(imodel.eq.1) type 774, nmodel
-774     format(' Calculating shifts for model',I9)
-C***********Calculate number of aromatic residues, rearrange order of
-C ring atoms, and set pointers to line numbers of aromatic atoms
-C (NB each Trp counts as two rings)
-       narom=0
-       do 105 I=1,iheavyatom
-       if((res(I).eq.'TRP'.or.res(I).eq.'TYR'.or.res(I).eq.'PHE'.
-     1   or.res(I).eq.'HIS').and.(aname(I).eq.' CB ')) THEN
-        narom = narom + 1
-         do 102 Iring=1,6
-          IRATPT(Iring,narom)=0
-102      continue
-        IACODE(narom)=IRES(I)
-         IF ((res(I).eq.'PHE').or.(res(I).eq.'TYR')) THEN
-           IRATS(narom)=6
-           do 101 K=1,20
-           IF(ires(I+K).eq.ires(I).and.
-     &       aname(I+K).eq.' CG ') IRATPT(1,narom)=I+K
-           IF(ires(I+K).eq.ires(I).and.
-     &       aname(I+K).eq.' CD1') IRATPT(2,narom)=I+K
-           IF(ires(I+K).eq.ires(I).and.
-     &       aname(I+K).eq.' CE1') IRATPT(3,narom)=I+K
-           IF(ires(I+K).eq.ires(I).and.
-     &       aname(I+K).eq.' CZ ') IRATPT(4,narom)=I+K
-           IF(ires(I+K).eq.ires(I).and.
-     &       aname(I+K).eq.' CE2') IRATPT(5,narom)=I+K
-           IF(ires(I+K).eq.ires(I).and.
-     &       aname(I+K).eq.' CD2') IRATPT(6,narom)=I+K
-101        continue
-         ELSE IF (res(I).eq.'HIS') THEN
-           IRATS(narom)=5
-           do 103 K=1,20
-           IF(ires(I+K).eq.ires(I).and.
-     &       aname(I+K).eq.' CG ') IRATPT(1,narom)=I+K
-           IF(ires(I+K).eq.ires(I).and.
-     &       aname(I+K).eq.' CD2') IRATPT(2,narom)=I+K
-           IF(ires(I+K).eq.ires(I).and.
-     &       aname(I+K).eq.' NE2') IRATPT(3,narom)=I+K
-           IF(ires(I+K).eq.ires(I).and.
-     &       aname(I+K).eq.' CE1') IRATPT(4,narom)=I+K
-           IF(ires(I+K).eq.ires(I).and.
-     &       aname(I+K).eq.' ND1') IRATPT(5,narom)=I+K
-103        continue
-         ELSE
-C Trp counts as two aromatic rings (5 then 6)
-           IRATS(narom)=5
-           do 104 K=1,20        
-           IF(ires(I+K).eq.ires(I).and.
-     &       aname(I+K).eq.' CG ') IRATPT(1,narom)=I+K
-           IF(ires(I+K).eq.ires(I).and.
-     &       aname(I+K).eq.' CD1') IRATPT(2,narom)=I+K
-           IF(ires(I+K).eq.ires(I).and.
-     &       aname(I+K).eq.' NE1') IRATPT(3,narom)=I+K
-           IF(ires(I+K).eq.ires(I).and.
-     &       aname(I+K).eq.' CE2') IRATPT(4,narom)=I+K
-           IF(ires(I+K).eq.ires(I).and.
-     &       aname(I+K).eq.' CD2') IRATPT(5,narom)=I+K
-104        continue
-            narom = narom + 1
-           IACODE(narom)=IRES(I)
-           IRATS(narom)=6
-           do 106 K=1,25
-           IF(ires(I+K).eq.ires(I).and.
-     &       aname(I+K).eq.' CE2') IRATPT(1,narom)=I+K
-           IF(ires(I+K).eq.ires(I).and.
-     &       aname(I+K).eq.' CD2') IRATPT(2,narom)=I+K
-           IF(ires(I+K).eq.ires(I).and.
-     &       aname(I+K).eq.' CE3') IRATPT(3,narom)=I+K
-           IF(ires(I+K).eq.ires(I).and.
-     &       aname(I+K).eq.' CZ3') IRATPT(4,narom)=I+K
-           IF(ires(I+K).eq.ires(I).and.
-     &       aname(I+K).eq.' CH2') IRATPT(5,narom)=I+K
-           IF(ires(I+K).eq.ires(I).and.
-     &       aname(I+K).eq.' CZ2') IRATPT(6,narom)=I+K
-106        continue
-         ENDIF
-       endif   !End of loop for each aromatic residue
-105    continue
-        do 107 J=1,narom
-       if(iratpt(1,j).eq.0.or.iratpt(2,j).eq.0.or.iratpt(3,j).eq.0.
-     &   or.iratpt(4,j).eq.0.or.iratpt(5,j).eq.0) print 960,
-     &   ires(iacode(j)),res(ires(iacode(j)))
-107     continue
-960    format(1X,'Ring atom missing for ',I4,1X,A3)
-       DO 115 L=1,iproton      !Initialise all ring current shifts to zero
-         RCNET(L)=0.
-115    CONTINUE
-C ******************************************************************
-       type *,' Calculating ring current shifts....'
-C
-      DO 116 J=1,NAROM         !FOR EACH AROMATIC RESIDUE
-C Now set up rn (ring normal) and cent for each ring.
-C Determined using atoms 1, 3 and 5 only of ring.
-C Much of this is lifted from a version of AMBER provided by Dave Case
-        call plane(IRATPT(1,j),IRATPT(3,j),IRATPT(5,j),x,y,z,rn(1,j),
-     .               cent(1,j))
-c  From pts 1, 3 and 5 calculates rn(ring normal), drn (deriv. of
-c  ring normal) and centre of ring
-c
-c  --   check on signr of normal vector
-c
-            signr(j) = 1.0
-            d1cx = x(IRATPT(1,j)) - cent(1,j)
-            d1cy = y(IRATPT(1,j)) - cent(2,j)
-            d1cz = z(IRATPT(1,j)) - cent(3,j)
-            d2cx = x(IRATPT(3,j)) - cent(1,j)
-            d2cy = y(IRATPT(3,j)) - cent(2,j)
-            d2cz = z(IRATPT(3,j)) - cent(3,j)
-            vp1 = d1cy*d2cz - d1cz*d2cy
-            vp2 = d1cz*d2cx - d1cx*d2cz
-            vp3 = d1cx*d2cy - d1cy*d2cx
-            if ((vp3*rn(3,j)+vp2*rn(2,j)+vp1*rn(1,j))
-     .               .gt.0.0) signr(j) = -1.0
-  119     DO 120 L=1,iproton   !For each proton
-       ip=L
-C Next line includes self aromatic shift for HA only
-         IF(IRESH(L).EQ.IRES(IRATPT(1,J)).AND.(ANAMEH(L)(2:3).NE.
-     &     'HA'.AND.ANAMEH(L)(2:3).NE.'H ')) GOTO 120
-c
-c  --     skip rings whose centre is more than 15A away
-c
-            relc = (xh(ip)-cent(1,j))**2 + (yh(ip)-cent(2,j))**2
-     .            +(zh(ip)-cent(3,j))**2
-            if (relc.gt.225.) go to 120
-c
-c  --   loop over pairs of bonded atoms in the ring
-c
-          do 80 k=1,irats(j)
-            kp1 = k + 1
-            if (kp1.gt.irats(j)) kp1 = 1
-c
-            call hm(ip,iratpt(k,j),iratpt(kp1,j),x,y,z,xh,yh,zh,
-     . rn(1,j),shifthm)
-            rcnet(ip) = rcnet(ip)+ signr(j)*5.4548*shifthm
-   80     continue
-  100   continue
-c
-120    continue !PROTON LOOP
-  116 CONTINUE
-C *************BEGIN ANISOTROPY CALCULATION**********************
-C ****Locate all backbone C=O and calculate anisotropic shift****
-       type *,' Calculating CO anisotropy...'
-       do 30 I=1,iheavyatom
-         if (aname(I).ne.' CA ') goto 30
-         DO 35 J=1,15
-           IF ((ANAME(I+J).EQ.' C  ').AND.(IRES(I).EQ.IRES(I+J)))
-     1       then
-            Inext=I+J
-            GOTO 38
-           ENDIF
-35       CONTINUE
-         print 95,IRES(I)
-95       format (' C atom not found for residue ',I5)
-       goto 30
-38         IF (ANAME(Inext+1).NE.' O  ') then
-            print 94,IRES(I)
-94          format (' O atom not found for residue ',I5)
-            goto 30
-           ENDIF
-C Atoms CA, C and O now located at I, Inext and (Inext+1)
-         at3=I   
-         at1=Inext
-         at2=Inext+1
-       CALL VEC(at1,at2,at3,vx,vy,vz,r)
-C Returns vectors vx,vy,vz, and distance r between at1 and at2
-       CALL CENTRE(vz,x(at1),y(at1),z(at1),1.1,cen)
-C
-C Now loop through all H, calculating shift due to this C=O
-       do 40 K=1,iproton
-         IF(IRESH(K).EQ.IRES(AT1)) GOTO 40     !SELF SHIFT
-         CALL RHAT(xh(k),yh(k),zh(k),cen,rh,rlen)
-C Returns vector rh, length rlen, between HA and CEN
-         IF(RLEN.GT.12.0) GOTO 40      !distance cutoff
-         CALL VPROD(rh,vy,pregam,stheta,tempab)
-C Returns sine of angle theta between rh and vy
-         CALL VPROD(pregam,vx,yy,sgamma,tempab)
-         calc1=XCO1*((3.0*stheta*stheta)-2.0)
-         calc2=XCO2*(1.0-(3.0*stheta*stheta*sgamma*sgamma))
-         calc3=(calc1+calc2)/(3.0*rlen*rlen*rlen)
-         shift(k)=shift(k)-calc3         
-         anisco(k)=anisco(k)-calc3
-40     continue
-30     continue
-C      if(XCO1.ne.9999.9) goto 9999 !To skip sidechain CO calculation
-C *********************************************************
-C *******************Sidechain CO from Asn, Gln************
-       do 530 I=1,iheavyatom
-       if(res(I).ne.'ASN'.and.res(I).ne.'GLN') goto 530
-         if (aname(I).ne.' CB ') goto 530
-         if(res(I).eq.'ASN') then
-          if (aname(I+1).ne.' CG '.or.aname(I+2).ne.' OD1') then
-               print 595, IRES(I)
-               goto 530
-595      format (' Missing atoms for ASN ',I5)
-          endif
-         at1=I+1
-         at2=I+2
-         at3=I
-         else if(res(I).eq.'GLN') then
-          if (aname(I+1).ne.' CG '.or.aname(I+2).ne.' CD '.or.
-     1      aname(I+3).ne.' OE1')then
-               print 596, IRES(I)
-               goto 530
-596      format (' Missing atoms for GLN ',I5)
-          endif
-         at1=I+2
-         at2=I+3
-         at3=I+1
-        endif
-       CALL VEC(at1,at2,at3,vx,vy,vz,r)
-       CALL CENTRE(vz,x(at1),y(at1),z(at1),1.1,cen)
-C Now loop through all HA, calculating shift due to this C=O
-       do 540 K=1,iproton
-         CALL RHAT(xh(k),yh(k),zh(k),cen,rh,rlen)
-         IF(RLEN.GT.12.0) GOTO 540
-         CALL VPROD(rh,vy,pregam,stheta,tempab)
-         CALL VPROD(pregam,vx,yy,sgamma,tempab)
-         calc1=XCO1*((3.0*stheta*stheta)-2.0)
-         calc2=XCO2*(1.0-(3.0*stheta*stheta*sgamma*sgamma))
-         calc3=(calc1+calc2)/(3.0*rlen*rlen*rlen)
-         shift(k)=shift(k)-calc3         
-         anisco(k)=anisco(k)-calc3
-540    continue
-530    continue
-C *****************************************************
-C *****************Sidechain CO from Asp, Glu**********
-       do 630 I=1,iheavyatom
-       if(res(I).ne.'ASP'.and.res(I).ne.'GLU') goto 630
-         if (aname(I).ne.' CB ') goto 630
-         if(res(I).eq.'ASP') then
-          if (aname(I+1).ne.' CG '.or.aname(I+2).ne.' OD1'.or.
-     1       aname(I+3).ne.' OD2') then
-               print 695, IRES(I)
-               goto 630
-695      format (' Missing atoms for ASP ',I5)
-          endif
-         at1=I+1
-         at2=I+2
-         at3=I
-         else if(res(I).eq.'GLU') then
-          if (aname(I+1).ne.' CG '.or.aname(I+2).ne.' CD '.or.
-     1      aname(I+3).ne.' OE1'.or.aname(I+4).ne.' OE2')then
-               print 696, IRES(I)
-               goto 630
-696      format (' Missing atoms for GLU ',I5)
-          endif
-         at1=I+2
-         at2=I+3
-         at3=I+1
-        endif
-       do 650 Itmp=1,iproton
-       calctemp(Itmp)=0.0
-650    continue
-       do 667 Icalc=0,1                !loop for two C-O
-       at2=at2+Icalc
-       CALL VEC(at1,at2,at3,vx,vy,vz,r)
-       CALL CENTRE(vz,x(at1),y(at1),z(at1),1.1,cen)
-       do 640 K=1,iproton
-         CALL RHAT(xh(k),yh(k),zh(k),cen,rh,rlen)
-         IF(RLEN.GT.12.0) GOTO 640
-         CALL VPROD(rh,vy,pregam,stheta,tempab)
-         CALL VPROD(pregam,vx,yy,sgamma,tempab)
-         calc1=XCO1*((3.0*stheta*stheta)-2.0)
-         calc2=XCO2*(1.0-(3.0*stheta*stheta*sgamma*sgamma))
-         calc3=(calc1+calc2)/(3.0*rlen*rlen*rlen)
-       calctemp(K)=calctemp(K)+calc3
-640    continue
-667    continue
-         do 664 kk=1,iproton
-         shift(kk)=shift(kk)-(calctemp(kk)/2.0)
-         anisco(kk)=anisco(kk)-(calctemp(kk)/2.0)
-664      continue        
-630    continue
-9999   continue
-C *******NOW DO (O=)C-N TOO *****************************
-       type *,' Calculating CN anisotropy...'
-       do 130 I=1,iheavyatom
-         if (aname(I).ne.' C  ') goto 130
-           IF (ANAME(I+1).NE.' O  ') then
-            print 94,IRES(I)
-            goto 130
-           ENDIF
-          do 131 j=1,23
-            if((aname(I+j).eq.' N  ').and.(ires(I).eq.(ires(i+j)-1)))
-     1       then
-            Inext=I+J
-            GOTO 132
-           ENDIF
-131      CONTINUE
-            if(ires(I).ne.ires(iheavyatom)) then
-            print 194,IRES(I)
-194         format(' N atom not found after residue ',I5)
-            endif
-            goto 130
-132      at1=I   
-         at2=Inext
-         at3=I+1
-       CALL VEC(at1,at2,at3,vx,vy,vz,r)
-       rbond=r*0.85    !i.e. 85% along C-N bond
-       CALL CENTRE(vz,x(at1),y(at1),z(at1),rbond,cen)
-       do 140 K=1,iproton
-         CALL RHAT(xh(k),yh(k),zh(k),cen,rh,rlen)
-         IF(RLEN.GT.12.0) GOTO 140
-        if(anameh(K).eq.' H  '.and.(iresh(k).eq.ires(Inext)))
-     $    goto 140
-         CALL VPROD(rh,vy,pregam,stheta,tempab)
-         CALL VPROD(pregam,vx,yy,sgamma,tempab)
-         calc1=XCN1*((3.0*stheta*stheta)-2.0)
-         calc2=XCN2*(1.0-(3.0*stheta*stheta*sgamma*sgamma))
-         calc3=(calc1+calc2)/(3.0*rlen*rlen*rlen)
-         shift(k)=shift(k)-calc3         
-         aniscn(k)=aniscn(k)-calc3
-140    continue
-130    continue
-C *************************************************
-C *******Calculate electric field component********
-C First find C(alpha)-H(alpha) pair, then work through
-C  all C, O and N finding field from them
-       type *,' Calculating electric field shift...'
-       do 2000 ie=1,iproton
-C skip for NH proton
-        if(anameh(ie).eq.' H  ')goto 2000
-       iha=ie
-       Ez=0.0
-       do 2010 je=1,iheavyatom 
-C Find attached heavy atom
-         if((ires(je).eq.iresh(ie)).and.(aname(je)(3:3).eq.
-     1      anameh(ie)(3:3))) then
-         ica=je
-         goto 2020
-         endif
-2010   continue
-2020   continue
-       call VEC2(iha,ica,vca,rca)
-C Returns vector vca and length rca between H(ie) and CA(je)
-C Now go through each C and add shift due to this
-       do 2030 je=1,iheavyatom
-       if(ires(je).eq.iresh(iha)) goto 2030
-       if(aname(je).eq.' C  ') then
-         call VEC2(iha,je,vc,rcc)
-          if(rcc.gt.6.0) goto 2030     !Ignore for distance>6A
-         call VSCAL(vca,vc,sc,cthet)
-         Efact=Qc/(rcc*rcc)
-         Ez=Ez+(cthet*Efact)
-       ELSE if(aname(je).eq.' N  ') then
-         call VEC2(iha,je,vn,rcn)
-          if(rcn.gt.6.0) goto 2030
-         call VSCAL(vca,vn,sc,cthet)
-         Efact=Qn/(rcn*rcn)
-         Ez=Ez+(cthet*Efact)
-       ELSE if(aname(je).eq.' O  ') then
-         call VEC2(iha,je,vo,rco)
-          if(rco.gt.6.0) goto 2030
-         call VSCAL(vca,vo,sc,cthet)
-         Efact=Qo/(rco*rco)
-         Ez=Ez+(cthet*Efact)
-       ELSE if(aname(je).eq.' H  ') then
-         call VEC2(iha,je,vchn,rchn)
-          if(rchn.gt.6.0) goto 2030
-         call VSCAL(vca,vchn,sc,cthet)
-         Efact=Qhn/(rchn*rchn)
-         Ez=Ez+(cthet*Efact)
-       endif
-2030   continue
-       shift(ie)=shift(ie)+(Ez*sigmaE)
-       shiftE(ie)=shiftE(ie)+(Ez*sigmaE)
-2000   continue
-C ****************END OF CALCULATIONS PROPER********************
-C *Correction of Gly HA shift by 0.22 ppm for random coil effect,
-C subtract 0.20 from HN shift, subtract 0.65 from HA shift,
-C convert to single precision, add random coil shift
-       do 2040 kkk=1,iproton
-       shift(kkk)=shift(kkk) + rcnet(kkk)
-       if(anameh(kkk)(2:3).eq.'HA') shift(kkk)=shift(kkk)-0.65
-       if(anameh(kkk)(2:3).eq.'H ') shift(kkk)=shift(kkk)-0.20
-       sum(kkk)=rcnet(kkk)+anisco(kkk)+aniscn(kkk)+shiftE(kkk)
-       if((resh(kkk).eq.'GLY').and.(anameh(kkk).eq.'1HA '.or.
-     1   anameh(kkk).eq.'2HA '.or.anameh(kkk).eq.' HA1'.or.
-     2   anameh(kkk).eq.' HA2')) shift(kkk)=shift(kkk)+0.22
-         do 2050 L=1,179
-          IF ((datres(L).eq.resh(kkk)).and.(datnam(L)(2:4).eq.
-     1     anameh(kkk)(2:4))) THEN
-C This next bit replaces HA shifts for aromatics by 4.45 ppm
-C  (gives roughly best fit to data)
-           if((resh(kkk).eq.'TYR'.or.resh(kkk).eq.'PHE'.or.
-     1      resh(kkk).eq.'TRP'.or.resh(kkk).eq.'HIS').and.anameh(kkk).
-     2      eq.' HA ') then
-             final(kkk)=shift(kkk)+4.45 
-             shift(kkk)=shift(kkk)+4.45-datshift(L)
-           ELSE
-             final(kkk)=shift(kkk) + datshift(L)
-           ENDIF
-         ENDIF
-2050     continue
-2040   continue
-9990    continue
-
-C ***************** Output SHIFT to channel 3**********************
-       if(yn.ne.'Y'.and.yn.ne.'y') goto 2100
-        do 909 ii=1,iprot
-       DO 910 KK=1,iproton
-       IF(IEXP(ii).EQ.IRESH(KK).AND.pexp(ii).eq.prott.and. 
-     1   atexp(ii)(1:2).eq.anameh(kk)(2:3)) THEN
-         exptln(kk)=eexp(ii)
-C exptln is the experimental shift: now subtract random coil 
-         do 2051 L=1,179
-          IF ((datres(L).eq.resh(kk)).and.(datnam(L)(1:3).eq.
-     1     anameh(kk)(1:3))) then
-          exptln(kk)=exptln(kk) - datshift(L)
-          ENDIF
-2051     continue
-         exptl(kk)=exptln(kk)
-         goto 909
-       ENDIF
-910    continue
-909    continue        
-        if(imodel.eq.1) goto 501
-       write (3,988)
-988    format(' Proton name, followed by calc. and observed shift and
-     . difference')
-       write (3,2052)
-2052   format(' (as shift - random coil shift)')
-       do 500 iprnt=1,iproton
-         if(exptln(iprnt).ne.0.00)
-     1     write(3,991) iprnt,iresh(iprnt),resh(iprnt),anameh(iprnt),
-     1     shift(iprnt),exptl(iprnt),(shift(iprnt)-exptl(iprnt))
-991    format(I5,I5,1X,A3,2X,A4,3F10.6)
-500    continue
-501     continue
-        if(imodel.eq.1) then
-       write(3,775) nmodel 
-775     format(' Result for model number',I8)
-        endif
-       CALL STATS(shift,EXPTL,iproton,anameh)
-       type *,'Do you want output sorted? [N]'
-       read(5,970)ans
-       if(ans.ne.'Y'.and.ans.ne.'y') goto 1000
-       itemp=0
-       do 505 I=1,iproton
-       if(exptl(I).eq.0.0) goto 505
-       itemp=itemp+1
-       shiftt(itemp)=shift(I)
-       exptlt(itemp)=exptl(I)
-505    continue
-       CALL INDEXX(itemp,shiftt,indx)
-       write (3,990) 
-C990   format('    Calc       Exptl       Diff')
-990    format('    Calc       Diff')
-       do 506 I=1,itemp
-C      write (3,989) shiftt(indx(I)),exptlt(indx(I)),
-       write (3,983) shiftt(indx(I)),
-     1   (shiftt(indx(I))-exptlt(indx(I)))
-989    format(3F10.4)
-983    format(2F10.4)
-506    continue
-       goto 1000
-C **************Normal output starts here***************************
-2100   continue
-C      write (3,987) FN1
-987    format(' Shift calculated for protons from ',A)
-C      write (3,986)
-986    format(' Added 0.22 for Gly, subtracted 0.65 (HA only), added 
-     1random coil shift')
-C      write (3,985)
-985    format('           Proton       ring     anisCO    anisCN     
-     1sigmaE   sum       final')
-       do 510 ip=1,iproton
-       if(icalculate.eq.1.and.anameh(ip)(2:3).ne.'HA') goto 510
-       if(icalculate.eq.2.and.anameh(ip)(2:3).ne.'H ') goto 510
-C Now do averaging for Phe,Tyr,methyls
-       if((resh(ip).eq.'VAL'.and.(anameh(ip).eq.'1HG1'.or.anameh(ip).
-     1eq.'1HG2')).or.(resh(ip).eq.'LEU'.and.(anameh(ip).eq.'1HD1'.or.
-     2anameh(ip).eq.'1HD2')).or.(resh(ip).eq.'ILE'.and.(anameh(ip).eq.
-     3'1HG2'.or.anameh(ip).eq.'1HD1')).or.(resh(ip).eq.'ALA'.and.
-     4anameh(ip).eq.'1HB ').or.(resh(ip).eq.'THR'.and.anameh(ip).eq.
-     5'1HG2')) THEN
-         final(ip)=final(ip)-sum(ip)
-         sum(ip)=(sum(ip)+sum(ip+1)+sum(ip+2))/3.0
-         anisco(ip)=(anisco(ip)+anisco(ip+1)+anisco(ip+2))/3.0
-         aniscn(ip)=(aniscn(ip)+aniscn(ip+1)+aniscn(ip+2))/3.0
-         shiftE(ip)=(shiftE(ip)+shiftE(ip+1)+shiftE(ip+2))/3.0
-         shift(ip)=(shift(ip)+shift(ip+1)+shift(ip+2))/3.0
-         final(ip)=final(ip)+sum(ip)
-         final(ip+1)=0.0
-         final(ip+2)=0.0
-       endif
-       if(resh(ip).eq.'TYR'.and.anameh(ip).eq.' HD1') then
-         if(anameh(ip+1).eq.' HD2') then
-          final(ip)=final(ip)-sum(ip)
-          sum(ip)=(sum(ip)+sum(ip+1))/2.0
-          anisco(ip)=(anisco(ip)+anisco(ip+1))/2.0
-          aniscn(ip)=(aniscn(ip)+aniscn(ip+1))/2.0
-          shiftE(ip)=(shiftE(ip)+shiftE(ip+1))/2.0
-          shift(ip)=(shift(ip)+shift(ip+1))/2.0
-          final(ip)=final(ip)+sum(ip)
-          final(ip+1)=0.0
-         else
-          type 940,resh(ip),iresh(ip)
-940      format(' Ring protons in unexpected order for ',A3,I4)
-         endif
-       endif
-       if(resh(ip).eq.'TYR'.and.anameh(ip).eq.' HE1') then
-         if(anameh(ip+1).eq.' HE2') then
-          final(ip)=final(ip)-sum(ip)
-          sum(ip)=(sum(ip)+sum(ip+1))/2.0
-          anisco(ip)=(anisco(ip)+anisco(ip+1))/2.0
-          aniscn(ip)=(aniscn(ip)+aniscn(ip+1))/2.0
-          shiftE(ip)=(shiftE(ip)+shiftE(ip+1))/2.0
-          shift(ip)=(shift(ip)+shift(ip+1))/2.0
-          final(ip)=final(ip)+sum(ip)
-          final(ip+1)=0.0
-         else
-          type 940,resh(ip),iresh(ip)
-         endif
-       endif
-       if(resh(ip).eq.'PHE'.and.anameh(ip).eq.' HD1') then
-         if(anameh(ip+1).eq.' HD2') then
-          final(ip)=final(ip)-sum(ip)
-          sum(ip)=(sum(ip)+sum(ip+1))/2.0
-          anisco(ip)=(anisco(ip)+anisco(ip+1))/2.0
-          aniscn(ip)=(aniscn(ip)+aniscn(ip+1))/2.0
-          shiftE(ip)=(shiftE(ip)+shiftE(ip+1))/2.0
-          shift(ip)=(shift(ip)+shift(ip+1))/2.0
-          final(ip)=final(ip)+sum(ip)
-          final(ip+1)=0.0
-         else
-          type 940,resh(ip),iresh(ip)
-         endif
-       endif
-       if(resh(ip).eq.'PHE'.and.anameh(ip).eq.' HE1') then
-         if(anameh(ip+1).eq.' HE2') then
-          final(ip)=final(ip)-sum(ip)
-          sum(ip)=(sum(ip)+sum(ip+1))/2.0
-          anisco(ip)=(anisco(ip)+anisco(ip+1))/2.0
-          aniscn(ip)=(aniscn(ip)+aniscn(ip+1))/2.0
-          shiftE(ip)=(shiftE(ip)+shiftE(ip+1))/2.0
-          shift(ip)=(shift(ip)+shift(ip+1))/2.0
-          final(ip)=final(ip)+sum(ip)
-          final(ip+1)=0.0
-         else
-          type 940,resh(ip),iresh(ip)
-         endif
-       endif
-C ******Write out results*********************
-       if(final(ip).ne.0.0) write(3,984)ip,iresh(ip),resh(ip),
-     1   anameh(ip),rcnet(ip),anisco(ip),aniscn(ip),shiftE(ip),
-     2   shift(ip),final(ip)
-984    format(I5,I5,1X,A3,2X,A4,6F10.5)
-510    CONTINUE
-1000   continue
-        imodel=1 !to make it work for single structure
-        goto 776
-C       Hacked DvdS 10/98
- 777   continue
-       print *,'Closing unit 3'
-       close(3)
-C
-       STOP
-       END
-C *******************************************************
-       SUBROUTINE VEC(at1,at2,at3,vx,vy,vz,r)
-       COMMON X,Y,Z
-       DIMENSION X(5000),Y(5000),Z(5000),vx(3),vy(3),vz(3)
-       DIMENSION vvx(3),vvy(3),vvz(3)
-       INTEGER at1,at2,at3
-       x1=x(at1)
-       y1=y(at1)
-       z1=z(at1)
-       x2=x(at2)
-       y2=y(at2)
-       z2=z(at2)
-       x3=x(at3)
-       y3=y(at3)
-       z3=z(at3)
-       vvz(1)=x2-x1
-       vvz(2)=y2-y1
-       vvz(3)=z2-z1
-       CALL UNITV(vvz,vz,r)
-       vvz(1)=x3-x1
-       vvz(2)=y3-y1
-       vvz(3)=z3-z1
-       CALL VPROD(vz,vvz,vvy,sthet,tempab)     
-       vvy(1)=tempab
-       CALL UNITV(vvy,vy,D)
-       CALL VPROD(vz,vy,vvx,sthet,tempab)
-       CALL UNITV(vvx,vx,D)
-       return
-       end
-C ******************************************************
-       SUBROUTINE UNITV(U,U1,D)
-       DIMENSION U(3),U1(3)
-       D=0.0
-       DO 1 JJ=1,3
-       D=D+(U(JJ)*U(JJ))
-1      CONTINUE
-       D=SQRT(D)
-       If (D.EQ.0.0) type *,' D is zero in UNITV'
-       DO 2 JJ=1,3
-       U1(JJ)=U(JJ)/D
-2      CONTINUE
-       RETURN
-       END
-C **********************************************************
-       SUBROUTINE VPROD(A,B,AB,STHET,tempab)
-       DIMENSION A(3),B(3),AB(3)
-       AB(2)=A(3)*B(1) - A(1)*B(3)
-       AB(1)=A(2)*B(3) - A(3)*B(2)
-       AB(3)=A(1)*B(2) - A(2)*B(1)
-       tempab=AB(1)
-c This is a stupid thing to do, but it's the only way I can get it
-c  to behave!
-       R1=SQRT(AB(1)*AB(1) + AB(2)*AB(2) + AB(3)*AB(3))
-       RA=SQRT(A(1)*A(1) + A(2)*A(2) + A(3)*A(3))
-       RB=SQRT(B(1)*B(1) + B(2)*B(2) + B(3)*B(3))
-         IF(RA.EQ.0.0.OR.RB.EQ.0.0) THEN
-           type *,' VPROD Zero divide...ignore',RA,RB
-           STHET=0.0
-         ELSE
-           STHET=R1/(RA*RB)
-         ENDIF
-       RETURN
-       END
-C *******************************************************
-       SUBROUTINE CENTRE(vz,a1,a2,a3,dist,cen)
-       DIMENSION vz(3),cen(3)
-       cen(1)=a1+(vz(1)*dist)
-       cen(2)=a2+(vz(2)*dist)
-       cen(3)=a3+(vz(3)*dist)
-       return
-       end
-C ********************************************************
-       SUBROUTINE RHAT(ax,ay,az,cen,rh,rlen)
-       DIMENSION cen(3),rh(3)
-       rh(1)=ax-cen(1)
-       rh(2)=ay-cen(2)
-       rh(3)=az-cen(3)
-       rlen=sqrt(rh(1)*rh(1)+rh(2)*rh(2)+rh(3)*rh(3))
-       return
-       end
-C ********************************************************
-       SUBROUTINE STATS(SSHIFT,EXPTL,iproton,anameh)
-       dimension sshift(3000),exptl(3000),anameh(3000)
-       dimension zshift(3000),zexptl(3000)
-C Calculates mean and sd of iproton values of shift and exptl
-C  also mean and sd of (shift-exptl) and regression coeff
-C Values of exptl of 0.00 presumably not found in protha.out
-C and are excluded
-       itemp=0
-       do 5 I=1,iproton
-       if(exptl(I).eq.0.0) goto 5
-       itemp=itemp+1
-       if(anameh(I).eq.'1HA '.and.anameh(I+1).eq.'2HA ') then
-         sshift(I)=(sshift(I)+sshift(I+1))/2.0
-       endif
-       zshift(itemp)=sshift(I)
-       zexptl(itemp)=exptl(I)
-5      continue
-       sm1=0.0
-       sm2=0.0
-       sms1=0.0
-       sms2=0.0
-       sm3=0.0
-       sms3=0.0
-       sm4=0.0
-C sm1,sm2 are accumulated sums of shift and exptl
-C sms1,sms2 are accumulated sums of shift**2 and exptl**2
-       do 600 L=1,itemp
-       sm1=sm1+zshift(L)
-       sm2=sm2+zexptl(L)
-       sm3=sm3+(zshift(L)-zexptl(L))
-600    continue
-       sm1=sm1/float(itemp)
-       sm2=sm2/float(itemp)
-       sm3=sm3/float(itemp)
-       do 605 L=1,itemp
-       sms1=sms1+((zshift(L)-sm1)*(zshift(L)-sm1))
-       sms2=sms2+((zexptl(L)-sm2)*(zexptl(L)-sm2))
-       sms3=sms3+((zshift(L)-zexptl(L)-sm3)*(zshift(L)-zexptl(L)-sm3))
-605    continue
-       sms1=sqrt(sms1/float(itemp))
-       sms2=sqrt(sms2/float(itemp))
-       sms3=sqrt(sms3/float(itemp))
-       do 610 L=1,itemp
-       sm4=sm4+((zshift(L)-sm1)*(zexptl(L)-sm2))
-610    continue
-       sm4=sm4/(float(itemp)*sms1*sms2)
-       write (3,1000) sm1,sm2
-1000   format(' Means of calc and exptl shifts: ',F6.4,
-     1   1X,F6.4)
-       write (3,1001) sms1,sms2
-1001   format(' SD of calc and exptl shifts: ',F6.4,
-     1   1X,F6.4)
-       write (3,1002) sm3,sms3
-1002   format(' Mean and SD of (calc-exptl shift): ',F6.4,
-     1   1X,F6.4)
-       write (3,1003) sm4,itemp
-1003   format (' Correlation coefficient calc vs exptl: ',F7.5,
-     1   ' (',I4,' protons )')
-       return
-       end
-C ************************************************
-       SUBROUTINE VEC2(iha,ica,vca,rca)
-       DIMENSION vca(3),x(5000),y(5000),z(5000)
-       DIMENSION xh(3000),yh(3000),zh(3000)
-       COMMON x,y,z,xh,yh,zh
-       vca(1)=xh(iha)-x(ica)
-       vca(2)=yh(iha)-y(ica)
-       vca(3)=zh(iha)-z(ica)
-       rca=sqrt((vca(1)*vca(1))+(vca(2)*vca(2))+(vca(3)*vca(3)))
-       return
-       end
-C *******************************************
-       SUBROUTINE VSCAL(A,B,SC,CTHET)
-       DIMENSION A(3),B(3)
-       SC=A(1)*B(1)+A(2)*B(2)+A(3)*B(3)
-       RA=SQRT(A(1)*A(1)+A(2)*A(2)+A(3)*A(3))
-       RB=SQRT(B(1)*B(1)+B(2)*B(2)+B(3)*B(3))
-       CTHET=SC/(RA*RB)
-       RETURN
-       END
-C **********************************************
-       SUBROUTINE INDEXX(N,ARRIN,INDX)
-C Indexes an array ARRIN of length N, i.e. outputs array INDX
-C such that ARRIN(INDX(J)) is in ascending order.
-C Taken from 'Numerical Recipes', W.H.Press et al, CUP 1989
-       DIMENSION ARRIN(3000),INDX(3000)
-       DO 11 J=1,N
-               INDX(J)=J
-11             CONTINUE
-       IF(N.EQ.1) RETURN
-       L=N/2+1
-       IR=N
-10     CONTINUE
-          IF(L.GT.1) THEN
-               L=L-1
-               INDXT=INDX(L)
-               Q=ARRIN(INDXT)
-          ELSE
-               INDXT=INDX(IR)
-               Q=ARRIN(INDXT)
-               INDX(IR)=INDX(1)
-               IR=IR-1
-               IF(IR.EQ.1) THEN
-                 INDX(1)=INDXT
-                 RETURN
-               ENDIF
-          ENDIF
-          I=L
-          J=L+L
-20        IF(J.LE.IR) THEN
-               IF(J.LT.IR) THEN
-                 IF(ARRIN(INDX(J)).LT.ARRIN(INDX(J+1)))J=J+1
-               ENDIF
-               IF(Q.LT.ARRIN(INDX(J))) THEN
-                 INDX(I)=INDX(J)
-                 I=J
-                 J=J+J
-               ELSE
-                 J=IR+1
-               ENDIF
-          GO TO 20
-          ENDIF
-          INDX(I)=INDXT
-       GOTO 10
-       END
-c**********************************************************
-      subroutine hm(ip,ir1,ir2,x,y,z,xh,yh,zh,rn,shhm)
-c
-c  Subroutine Haigh-Mallion:
-c  -- given proton ip, and ring atoms ir1 and ir2, with 
-c        coordinates x and ring normal vector rn;
-c  -- return Haigh-Maillion shift contribution shhm
-c
-       dimension x(5000),y(5000),z(5000),xh(3000),yh(3000)
-      dimension rn(3),r1(3),r2(3),zh(3000)
-c
-c --- extract coordinates from array x,y,z
-c
-       r1(1)=x(ir1) - xh(ip)
-       r1(2)=y(ir1) - yh(ip)
-       r1(3)=z(ir1) - zh(ip)
-       r2(1)=x(ir2) - xh(ip)
-       r2(2)=y(ir2) - yh(ip)
-       r2(3)=z(ir2) - zh(ip)
-c
-c  -- compute triple scalar product: later versions could
-c       hard-code this for efficiency, but this form is 
-c       easier to read. (Triple scalar product=vol. of 
-c       parallelepiped, =area of desired triangle)
-c
-      s12 = r1(1)*(r2(2)*rn(3) - r2(3)*rn(2))
-     .    + r1(2)*(r2(3)*rn(1) - r2(1)*rn(3))
-     .    + r1(3)*(r2(1)*rn(2) - r2(2)*rn(1))
-c
-c  -- get radial factors
-c
-      r1sq = r1(1)*r1(1) + r1(2)*r1(2) + r1(3)*r1(3)
-      r2sq = r2(1)*r2(1) + r2(2)*r2(2) + r2(3)*r2(3)
-      if (r1sq.eq.0.0 .or. r2sq.eq.0.0) then
-        write(6,*) 'Geometry error in hm: ',ip,r1,r2
-        stop
-      end if
-      temp = (1./r1sq**1.5 + 1./r2sq**1.5)*0.5 !distance bit
-      shhm = s12*temp
-      return
-      end
-C****************************************************************
-      subroutine plane (i1, i2, i3, x,y,z, rn, cent)
-c**************************************************************
-c  --- given three atoms i1,i2 and i3, and coordinates x,y,z
-c    - returns rn(i) [i=1,2,3] components of the normalized
-c      vector normal to the plane containing the three
-c      points and cent(1,2,3), the centre of the three atom.
-c
-      dimension x(5000),y(5000),z(5000) 
-      dimension rn(3),cent(3)
-c
-        x1 = x(i1)
-        y1 = y(i1)
-        z1 = z(i1)
-        x2 = x(i2)
-        y2 = y(i2)
-        z2 = z(i2)
-        x3 = x(i3)
-        y3 = y(i3)
-        z3 = z(i3)
-c
-c       ----- coefficients of the equation for the plane of atoms 1-3
-c
-        ax = y1*z2 - y2*z1 + y3*z1 - y1*z3 + y2*z3 - y3*z2
-        ay = -(x1*z2 - x2*z1 + x3*z1 - x1*z3 + x2*z3 - x3*z2)
-        az = x1*y2 - x2*y1 + x3*y1 - x1*y3 + x2*y3 - x3*y2
-        anorm = 1./sqrt(ax*ax + ay*ay + az*az)
-c
-c       ----- normalize to standard form for plane equation (i.e. such
-c       ----- that length of the vector "a" is unity
-c
-        rn(1) = ax*anorm       !ring normal unit vector
-        rn(2) = ay*anorm       !=(2-1)x(3-1)
-        rn(3) = az*anorm       !divided by its magnitude
-c
-        cent(1) = (x1+x2+x3)/3.
-        cent(2) = (y1+y2+y3)/3.
-        cent(3) = (z1+z2+z3)/3.
-c
-        return
-        end
-C ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-       subroutine addprot(x,y,z,xh,yh,zh,Iheavyatom,Iproton,
-     &   aname,anameh,res,resh,ires,iresh)
-C Does not add most exchangeable protons: N-terminal NH3,
-C  Glu,Gln,Asp,Asn sidechain, Arg sidechain,Tyr HH, His HD1,
-C  Trp HE1, Ser & Thr OH, Cys SH, Lys NH3
-C Goes through heavy atom list and adds in simple geometric way
-C NB Looks in neighbourhood of attached heavy atom for bonding
-C atoms. If the atom ordering is odd, this could cause problems.
-C Usually this would mean that the proton does not get added;
-C very occasionally it could lead to a proton being put on wrong.
-       DIMENSION x(5000),y(5000),z(5000),xh(3000),yh(3000),zh(3000)
-       DIMENSION aname(5000),res(5000),ires(5000)
-       DIMENSION anameh(3000),resh(3000),iresh(3000)
-       CHARACTER aname*4,anameh*4,res*3,resh*3
-       iproton=0
-C NB This effectively deletes any protons that already were in the file
-       do 10 I=1,iheavyatom
-       iat2=0
-       iat3=0
-       iat4=0
-       if(aname(I).eq.' N  '.and.ires(I).gt.1.and.res(I).
-     &    ne.'PRO') then
-        iat1=I
-        do 11 J=1,13
-        if(aname(I-J).eq.' C  '.and.ires(I-J).eq.ires(I)-1) then
-        iat2=I-J
-        goto 12
-         endif
-11       continue 
-12       continue
-         do 13 J=1,15
-        if(aname(I+J).eq.' CA '.and.ires(I+J).eq.ires(I)) then
-        iat3=I+J
-        goto 14
-        endif
-13       continue
-14       continue
-        if(iat2.gt.0.and.iat3.gt.0) then
-        iproton=iproton+1
-        iheavyatom=iheavyatom+1
-        call addsp2(x,y,z,xh,yh,zh,iproton,iat1,iat2,iat3,1)
-         anameh(iproton)=' H  '
-         resh(iproton)=res(iat1)
-         iresh(iproton)=ires(iat1)
-        x(iheavyatom)=xh(iproton)
-        y(iheavyatom)=yh(iproton)
-        z(iheavyatom)=zh(iproton)
-        aname(iheavyatom)=' H  '
-        res(iheavyatom)=res(iat1)
-        ires(iheavyatom)=ires(iat1)
-C The final 1 signals that it is an NH ie use NH bond distance
-        endif
-        else if (aname(I).eq.' CA '.and.res(I).ne.'GLY') then
-        iat1=I
-         do 21 J=-5,3
-        if(aname(I+J).eq.' N  '.and.ires(I+J).eq.ires(I)) then
-        iat2=I+J
-        goto 22
-        endif
-21      continue
-22      continue
-        do 23 J=1,15
-        if(aname(I+J).eq.' C  '.and.ires(I+J).eq.ires(I)) then
-        iat3=I+J
-        goto 24
-        endif
-23      continue
-24      continue
-        do 25 J=1,15
-        if(aname(I+J).eq.' CB '.and.ires(I+J).eq.ires(I)) then
-        iat4=I+J
-        goto 26
-        endif
-25      continue
-26      continue
-         if(iat2.gt.0.and.iat3.gt.0.and.iat4.gt.0) then
-        iproton=iproton+1
-        call addonesp3(x,y,z,xh,yh,zh,iproton,iat1,iat2,iat3,iat4)
-        anameh(iproton)=' HA '
-        resh(iproton)=res(iat1)
-        iresh(iproton)=ires(iat1)
-        endif
-       else if((aname(I).eq.' CB '.and.(res(I).eq.'THR'.or.
-     &   res(I).eq.'VAL'.or.res(I).eq.'ILE')).or.(aname(I).
-     &   eq.' CG '.and.res(I).eq.'LEU')) then
-        iat1=I
-        do 31 J=1,6
-        if(aname(I-J).eq.' CA '.and.ires(I-J).eq.ires(I).
-     &    and.res(I).ne.'LEU') then
-        iat2=I-J
-        goto 32
-        endif
-31       continue
-32       continue
-         do 33 J=1,6
-         if(res(I-J).eq.'LEU'.and.aname(I-J).eq.' CB ') then
-         iat2=I-J
-         goto 34
-         endif
-33       continue
-34       continue
-         do 35 J=1,3
-         if(res(I+J).eq.'THR'.and.aname(I+J)(2:3).eq.'OG') 
-     $    iat3=I+J
-         if(res(I+J).eq.'THR'.and.aname(I+J)(2:3).eq.'CG')
-     $    iat4=I+J
-         if(res(I+J).eq.'VAL'.and.aname(I+J).eq.' CG1') iat3=I+J
-         if(res(I+J).eq.'VAL'.and.aname(I+J).eq.' CG2') iat4=I+J
-         if(res(I+J).eq.'ILE'.and.aname(I+J).eq.' CG1') iat3=I+J
-         if(res(I+J).eq.'ILE'.and.aname(I+J).eq.' CG2') iat4=I+J
-         if(res(I+J).eq.'LEU'.and.aname(I+J).eq.' CD1') iat3=I+J
-         if(res(I+J).eq.'LEU'.and.aname(I+J).eq.' CD2') iat4=I+J
-35       continue
-         if(iat2.gt.0.and.iat3.gt.0.and.iat4.gt.0) then
-        iproton=iproton+1
-        call addonesp3(x,y,z,xh,yh,zh,iproton,iat1,iat2,iat3,iat4)
-         if(res(I).eq.'LEU') then
-          anameh(iproton)=' HG '
-         else
-          anameh(iproton)=' HB '
-         endif
-        resh(iproton)=res(iat1)
-        iresh(iproton)=ires(iat1)
-         endif
-        else if(aname(I).eq.' CA '.and.res(I).eq.'GLY') then
-         iat1=I
-         do 41 J=-2,2
-         if(ires(I+J).eq.ires(I).and.aname(I+J).eq.' N  ')iat3=I+J
-         if(ires(I+J).eq.ires(I).and.aname(I+J).eq.' C  ')iat2=I+J
-41       continue
-         if(iat2.gt.0.and.iat3.gt.0) then
-        iproton=iproton+2
-         call addtwosp3(x,y,z,xh,yh,zh,iproton,iat1,iat2,iat3)
-        anameh(iproton-1)='1HA '
-        anameh(iproton)='2HA '
-        resh(iproton-1)=res(iat1)
-        resh(iproton)=res(iat1)
-        iresh(iproton-1)=ires(iat1)
-        iresh(iproton)=ires(iat1)
-         endif
-        else if(aname(I).eq.' CB '.and.(res(I).eq.'CYS'.or.res(I).
-     1   eq.'ASP'.or.res(I).eq.'GLU'.or.res(I).eq.'PHE'.or.res(I).
-     2   eq.'HIS'.or.res(I).eq.'LYS'.or.res(I).eq.'LEU'.or.res(I).
-     3   eq.'MET'.or.res(I).eq.'ASN'.or.res(I).eq.'PRO'.or.res(I).
-     4   eq.'GLN'.or.res(I).eq.'ARG'.or.res(I).eq.'SER'.or.res(I).
-     5   eq.'TRP'.or.res(I).eq.'TYR')) then
-         iat1=I
-         do 42 J=-3,3
-         if(ires(I+J).eq.ires(I).and.aname(I+J).eq.' CA ')iat2=I+J
-         if(ires(I+J).eq.ires(I).and.aname(I+J)(3:3).eq.'G')
-     &    iat3=I+J
-42      continue
-         if(iat2.gt.0.and.iat3.gt.0) then
-        iproton=iproton+2
-         call addtwosp3(x,y,z,xh,yh,zh,iproton,iat1,iat2,iat3)
-        anameh(iproton-1)='1HB '
-        anameh(iproton)='2HB '
-        resh(iproton-1)=res(iat1)
-        resh(iproton)=res(iat1)
-        iresh(iproton-1)=ires(iat1)
-        iresh(iproton)=ires(iat1)
-         endif
-        else if((aname(I).eq.' CG '.and.(res(I).eq.'GLU'.or.res(I).
-     1   eq.'LYS'.or.res(I).eq.'MET'.or.res(I).eq.'PRO'.or.res(I).
-     2   eq.'GLN'.or.res(I).eq.'ARG')).or.(aname(I).eq.' CG1'.and.
-     3   res(I).eq.'ILE')) then
-         iat1=I
-         do 43 J=-3,3
-         if(ires(I+J).eq.ires(I).and.aname(I+J).eq.' CB ')iat2=I+J
-         if(ires(I+J).eq.ires(I).and.aname(I+J)(3:3).eq.'D')
-     &    iat3=I+J
-43      continue
-         if(iat2.gt.0.and.iat3.gt.0) then
-        iproton=iproton+2
-         call addtwosp3(x,y,z,xh,yh,zh,iproton,iat1,iat2,iat3)
-        anameh(iproton-1)='1HG '
-        anameh(iproton)='2HG '
-         if(res(I).eq.'ILE')anameh(iproton-1)='1HG1'
-         if(res(I).eq.'ILE')anameh(iproton)='2HG1'
-        resh(iproton-1)=res(iat1)
-        resh(iproton)=res(iat1)
-        iresh(iproton-1)=ires(iat1)
-        iresh(iproton)=ires(iat1)
-         endif
-        else if(aname(I).eq.' CD '.and.(res(I).eq.'LYS'.or.res(I).
-     1   eq.'ARG'.or.res(I).eq.'PRO')) then
-         iat1=I
-         do 44 J=-6,3
-        if(ires(I+J).eq.ires(I).and.aname(I+J).eq.' CG ')iat2=I+J
-        if(ires(I+J).eq.ires(I).and.aname(I+J)(3:3).eq.'E')
-     &   iat3=I+J 
-         if(ires(I+J).eq.ires(I).and.res(I).eq.'PRO'.and.
-     &    aname(I+J).eq.' N  ')iat3=I+J
-44       continue
-         if(iat2.gt.0.and.iat3.gt.0) then
-        iproton=iproton+2
-         call addtwosp3(x,y,z,xh,yh,zh,iproton,iat1,iat2,iat3)
-        anameh(iproton-1)='1HD '
-        anameh(iproton)='2HD '
-        resh(iproton-1)=res(iat1)
-        resh(iproton)=res(iat1)
-        iresh(iproton-1)=ires(iat1)
-        iresh(iproton)=ires(iat1)
-         endif
-        else if(aname(I).eq.' CE '.and.res(I).eq.'LYS') then
-         iat1=I
-         do 45 J=-3,3
-        if(ires(I+J).eq.ires(I).and.aname(I+J).eq.' CD ')iat2=I+J
-        if(ires(I+J).eq.ires(I).and.aname(I+J)(3:3).eq.'Z')
-     &   iat3=I+J 
-45       continue
-         if(iat2.gt.0.and.iat3.gt.0) then
-        iproton=iproton+2
-         call addtwosp3(x,y,z,xh,yh,zh,iproton,iat1,iat2,iat3)
-        anameh(iproton-1)='1HE '
-        anameh(iproton)='2HE '
-        resh(iproton-1)=res(iat1)
-        resh(iproton)=res(iat1)
-        iresh(iproton-1)=ires(iat1)
-        iresh(iproton)=ires(iat1)
-         endif
-        else if(aname(I).eq.' CB '.and.res(I).eq.'ALA') then
-         iat1=I
-         do 51 J=1,5
-         if(ires(I-J).eq.ires(I).and.aname(I-J).eq.' CA ')iat2=I-J
-         if(ires(I-J).eq.ires(I).and.aname(I-J).eq.' N  ')iat3=I-J
-51       continue
-         if(iat2.gt.0.and.iat3.gt.0)goto 52
-       else if((aname(I)(2:3).eq.'CG'.and.(res(I).eq.'VAL'.or.res(I).
-     1  eq.'THR')).or.(aname(I).eq.' CG2'.and.res(I).eq.'ILE'))then
-        iat1=I
-        do 53 J=1,5
-        if(ires(I-J).eq.ires(I).and.aname(I-J).eq.' CB ')iat2=I-J
-        if(ires(I-J).eq.ires(I).and.aname(I-J).eq.' CA ')iat3=I-J
-53      continue
-        if(iat2.gt.0.and.iat3.gt.0)goto 52
-       else if(aname(I)(2:3).eq.'CD'.and.(res(I).eq.'LEU'.or.res(I).
-     1   eq.'ILE'))then
-        iat1=I
-        do 54 J=1,5
-        if(ires(I-J).eq.ires(I).and.aname(I-J)(2:3).eq.'CG')iat2=I-J
-        if(ires(I-J).eq.ires(I).and.aname(I-J).eq.' CB ')iat3=I-J
-54      continue
-        if(iat2.gt.0.and.iat3.gt.0)goto 52
-       else if(aname(I)(2:3).eq.'CE'.and.res(I).eq.'MET')then
-        iat1=I
-        do 55 J=1,5
-        if(ires(I-J).eq.ires(I).and.aname(I-J).eq.' SD ')iat2=I-J
-        if(ires(I-J).eq.ires(I).and.aname(I-J).eq.' CG ')iat3=I-J
-55      continue
-        if(iat2.gt.0.and.iat3.gt.0) then
-52      iproton=iproton+3
-        call addthreesp3(x,y,z,xh,yh,zh,iproton,iat1,iat2,iat3)
-        anameh(iproton-2)='1H  '
-        anameh(iproton-1)='2H  '
-        anameh(iproton)='3H  '
-        anameh(iproton-2)(3:4)=aname(iat1)(3:4)
-        anameh(iproton-1)(3:4)=aname(iat1)(3:4)
-        anameh(iproton)(3:4)=aname(iat1)(3:4)
-        resh(iproton-2)=res(iat1)
-        resh(iproton-1)=res(iat1)
-        resh(iproton)=res(iat1)
-       iresh(iproton-2)=ires(iat1)
-       iresh(iproton-1)=ires(iat1)
-       iresh(iproton)=ires(iat1)
-        endif
-       else if((res(I).eq.'TYR'.or.res(I).eq.'PHE'.or.res(I).eq.
-     1  'TRP').and.aname(I).eq.' CD1')then
-        iat1=I
-        do 61 J=-5,5
-        if(ires(I+J).eq.ires(I).and.aname(I+J).eq.' CG ')iat2=I+J
-       if(ires(I+J).eq.ires(I).and.aname(I+J)(3:4).eq.'E1')iat3=I+J
-61      continue
-        if(iat2.gt.0.and.iat3.gt.0) goto 62
-       else if((res(I).eq.'TYR'.or.res(I).eq.'PHE'.or.res(I).eq.
-     1  'HIS').and.aname(I).eq.' CD2') then
-        iat1=I
-        do 63 J=-5,5
-        if(ires(I+J).eq.ires(I).and.aname(I+J).eq.' CG ')iat2=I+J
-       if(ires(I+J).eq.ires(I).and.aname(I+J)(3:4).eq.'E2')iat3=I+J
-63      continue
-        if(iat2.gt.0.and.iat3.gt.0) goto 62
-       else if((res(I).eq.'TYR'.or.res(I).eq.'PHE').and.aname(I).
-     1  eq.' CE1') then
-        iat1=I
-        do 64 J=-5,5
-        if(ires(I+J).eq.ires(I).and.aname(I+J).eq.' CD1')iat2=I+J
-       if(ires(I+J).eq.ires(I).and.aname(I+J).eq.' CZ ')iat3=I+J
-64      continue
-        if(iat2.gt.0.and.iat3.gt.0) goto 62
-       else if((res(I).eq.'TYR'.or.res(I).eq.'PHE').and.aname(I).
-     1  eq.' CE2') then
-        iat1=I
-        do 65 J=-5,5
-        if(ires(I+J).eq.ires(I).and.aname(I+J).eq.' CD2')iat2=I+J
-       if(ires(I+J).eq.ires(I).and.aname(I+J).eq.' CZ ')iat3=I+J
-65      continue
-        if(iat2.gt.0.and.iat3.gt.0) goto 62
-       else if((res(I).eq.'PHE').and.aname(I).eq.' CZ ') then
-        iat1=I
-        do 66 J=-5,5
-        if(ires(I+J).eq.ires(I).and.aname(I+J).eq.' CE1')iat2=I+J
-       if(ires(I+J).eq.ires(I).and.aname(I+J).eq.' CE2')iat3=I+J
-66      continue
-        if(iat2.gt.0.and.iat3.gt.0) goto 62
-       else if(res(I).eq.'HIS'.and.aname(I).eq.' CE1') then
-        iat1=I
-        do 67 J=-5,5
-        if(ires(I+J).eq.ires(I).and.aname(I+J).eq.' ND1')iat2=I+J
-       if(ires(I+J).eq.ires(I).and.aname(I+J).eq.' NE2')iat3=I+J
-67      continue
-        if(iat2.gt.0.and.iat3.gt.0) goto 62
-       else if(res(I).eq.'TRP'.and.aname(I).eq.' CE3') then
-        iat1=I
-        do 68 J=-8,8
-        if(ires(I+J).eq.ires(I).and.aname(I+J).eq.' CD2')iat2=I+J
-       if(ires(I+J).eq.ires(I).and.aname(I+J).eq.' CZ3')iat3=I+J
-68      continue
-        if(iat2.gt.0.and.iat3.gt.0) goto 62
-       else if(res(I).eq.'TRP'.and.aname(I).eq.' CZ3') then
-        iat1=I
-        do 69 J=-8,8
-        if(ires(I+J).eq.ires(I).and.aname(I+J).eq.' CE3')iat2=I+J
-       if(ires(I+J).eq.ires(I).and.aname(I+J).eq.' CH2')iat3=I+J
-69      continue
-        if(iat2.gt.0.and.iat3.gt.0) goto 62
-       else if(res(I).eq.'TRP'.and.aname(I).eq.' CH2') then
-        iat1=I
-        do 70 J=-8,8
-        if(ires(I+J).eq.ires(I).and.aname(I+J).eq.' CZ3')iat2=I+J
-       if(ires(I+J).eq.ires(I).and.aname(I+J).eq.' CZ2')iat3=I+J
-70      continue
-        if(iat2.gt.0.and.iat3.gt.0) goto 62
-       else if(res(I).eq.'TRP'.and.aname(I).eq.' CZ2') then
-        iat1=I
-        do 71 J=-8,8
-        if(ires(I+J).eq.ires(I).and.aname(I+J).eq.' CH2')iat2=I+J
-       if(ires(I+J).eq.ires(I).and.aname(I+J).eq.' CE2')iat3=I+J
-71      continue
-        if(iat2.gt.0.and.iat3.gt.0) then
-62      iproton=iproton+1
-        call addsp2(x,y,z,xh,yh,zh,iproton,iat1,iat2,iat3,2)
-        anameh(iproton)=' H  '
-        anameh(iproton)(3:4)=aname(iat1)(3:4)
-        resh(iproton)=res(iat1)
-       iresh(iproton)=ires(iat1)
-        endif
-       else
-C presumably a heavy atom that doesn't have protons, or one
-C with exchangeable protons that I can't be bothered to do
-       endif
-10     continue
-       return
-       end
-C===================================================================
-       subroutine addsp2(x,y,z,xh,yh,zh,Ih,Iat1,Iat2,Iat3,Ibond)
-       DIMENSION x(5000),y(5000),z(5000)
-       DIMENSION xh(3000),yh(3000),zh(3000)
-       DIMENSION r12(3),u12(3),r13(3),u13(3),r14(3),u14(3)
-C If Ibond=1, it's a NH bond, if Ibond=2 it's a CH (aromatic) bond
-       if(Ibond.eq.1)blength=0.98
-       if(Ibond.eq.2)blength=1.08
-       r12(1)=x(Iat1)-x(Iat2)
-       r12(2)=y(Iat1)-y(Iat2)
-       r12(3)=z(Iat1)-z(Iat2)
-       call unitv(r12,u12,d)
-       r13(1)=x(Iat1)-x(Iat3)
-       r13(2)=y(Iat1)-y(Iat3)
-       r13(3)=z(Iat1)-z(Iat3)
-       call unitv(r13,u13,d)
-       r14(1)=u12(1)+u13(1)
-       r14(2)=u12(2)+u13(2)
-       r14(3)=u12(3)+u13(3)
-       call unitv(r14,u14,d)
-       xh(Ih)=x(Iat1)+blength*u14(1)
-       yh(Ih)=y(Iat1)+blength*u14(2)
-       zh(Ih)=z(Iat1)+blength*u14(3)
-       return
-       end
-C------------------------------------------------------------------
-       subroutine addonesp3(x,y,z,xh,yh,zh,Ih,Iat1,Iat2,Iat3,Iat4)
-       DIMENSION x(5000),y(5000),z(5000)
-       DIMENSION xh(3000),yh(3000),zh(3000)
-       DIMENSION r12(3),u12(3),r13(3),u13(3),r14(3),u14(3)
-       DIMENSION r15(3),u15(3)
-       blength=1.08
-       r12(1)=x(Iat1)-x(Iat2)
-       r12(2)=y(Iat1)-y(Iat2)
-       r12(3)=z(Iat1)-z(Iat2)
-       call unitv(r12,u12,d)
-       r13(1)=x(Iat1)-x(Iat3)
-       r13(2)=y(Iat1)-y(Iat3)
-       r13(3)=z(Iat1)-z(Iat3)
-       call unitv(r13,u13,d)
-       r14(1)=x(Iat1)-x(Iat4)
-       r14(2)=y(Iat1)-y(Iat4)
-       r14(3)=z(Iat1)-z(Iat4)
-       call unitv(r14,u14,d)
-       r15(1)=u12(1)+u13(1)+u14(1)
-       r15(2)=u12(2)+u13(2)+u14(2)
-       r15(3)=u12(3)+u13(3)+u14(3)
-       call unitv(r15,u15,d)
-       xh(Ih)=x(Iat1)+blength*u15(1)
-       yh(Ih)=y(Iat1)+blength*u15(2)
-       zh(Ih)=z(Iat1)+blength*u15(3)
-       return
-       end
-C------------------------------------------------------------------
-       subroutine addtwosp3(x,y,z,xh,yh,zh,Ih,Iat1,Iat2,Iat3)
-C This is based on the GEN routine in VNMR (J. Hoch)
-       DIMENSION x(5000),y(5000),z(5000)
-       DIMENSION xh(3000),yh(3000),zh(3000)
-       DIMENSION r12(3),r13(3),side(3),us(3)
-       DIMENSION add(3),uadd(3),sub(3),usub(3)
-       blength=1.08
-       alpha=54.75*3.14159/180.   !H-C-H=109.5
-       r12(1)=x(Iat1)-x(Iat2)
-       r12(2)=y(Iat1)-y(Iat2)
-       r12(3)=z(Iat1)-z(Iat2)
-       r13(1)=x(Iat1)-x(Iat3)
-       r13(2)=y(Iat1)-y(Iat3)
-       r13(3)=z(Iat1)-z(Iat3)
-       sub(1)=r12(1)-r13(1)
-       sub(2)=r12(2)-r13(2)
-       sub(3)=r12(3)-r13(3)
-       call unitv(sub,usub,d)
-       add(1)=r12(1)+r13(1)
-       add(2)=r12(2)+r13(2)
-       add(3)=r12(3)+r13(3)
-       call unitv(add,uadd,d)
-       call vprod(usub,uadd,side,sintemp,tmp)
-       call unitv(side,us,d)
-       xh(Ih-1)=x(Iat1)+blength*(uadd(1)*cos(alpha)-us(1)*sin(alpha))
-       yh(Ih-1)=y(Iat1)+blength*(uadd(2)*cos(alpha)-us(2)*sin(alpha))
-       zh(Ih-1)=z(Iat1)+blength*(uadd(3)*cos(alpha)-us(3)*sin(alpha))
-       xh(Ih)=x(Iat1)+blength*(uadd(1)*cos(alpha)+us(1)*sin(alpha))
-       yh(Ih)=y(Iat1)+blength*(uadd(2)*cos(alpha)+us(2)*sin(alpha))
-       zh(Ih)=z(Iat1)+blength*(uadd(3)*cos(alpha)+us(3)*sin(alpha))
-       return
-       end
-C------------------------------------------------------------------
-       subroutine addthreesp3(x,y,z,xh,yh,zh,Ih,Iat1,Iat2,Iat3)
-C This is based on the GEN routine in VNMR (J. Hoch)
-       DIMENSION x(5000),y(5000),z(5000)
-       DIMENSION xh(3000),yh(3000),zh(3000),twist(3),utw(3)
-       DIMENSION r12(3),u12(3),r23(3),perp(3),side(3),uside(3)
-       REAL perp
-       blength=1.08
-       beta=70.5*3.14159/180.  !180-109.5
-       cosbeta=cos(beta)
-       sinbeta=sin(beta)
-       cosgam=0.866     !cos(30)
-c The methyl protons should be staggered to Iat3
-       r12(1)=x(Iat1)-x(Iat2)
-       r12(2)=y(Iat1)-y(Iat2)
-       r12(3)=z(Iat1)-z(Iat2)
-       call unitv(r12,u12,d)
-       r23(1)=x(Iat2)-x(Iat3)
-       r23(2)=y(Iat2)-y(Iat3)
-       r23(3)=z(Iat2)-z(Iat3)
-       vert=(r12(1)*r23(1)+r12(2)*r23(2)+r12(3)*r23(3))/d
-       perp(1)=u12(1)*vert
-       perp(2)=u12(2)*vert
-       perp(3)=u12(3)*vert
-       side(1)=r23(1)-perp(1)
-       side(2)=r23(2)-perp(2)
-       side(3)=r23(3)-perp(3)
-       call unitv(side,uside,d)
-       call vprod(u12,uside,twist,sintemp,tmp)
-       call unitv(twist,utw,d)
-       u12(1)=u12(1)*cosbeta
-       u12(2)=u12(2)*cosbeta
-       u12(3)=u12(3)*cosbeta
-       xh(Ih-2)=x(Iat1)+blength*(u12(1)+uside(1)*sinbeta)
-       yh(Ih-2)=y(Iat1)+blength*(u12(2)+uside(2)*sinbeta)
-       zh(Ih-2)=z(Iat1)+blength*(u12(3)+uside(3)*sinbeta)
-       xh(Ih-1)=x(Iat1)+blength*(u12(1)-sinbeta*(
-     &   uside(1)/2.0-utw(1)*cosgam))
-       yh(Ih-1)=y(Iat1)+blength*(u12(2)-sinbeta*(
-     &   uside(2)/2.0-utw(2)*cosgam))
-       zh(Ih-1)=z(Iat1)+blength*(u12(3)-sinbeta*(
-     &   uside(3)/2.0-utw(3)*cosgam))
-C NB The /2.0 is actually *sin(30)
-       xh(Ih)=x(Iat1)+blength*(u12(1)-sinbeta*(
-     &   uside(1)/2.0+utw(1)*cosgam))
-       yh(Ih)=y(Iat1)+blength*(u12(2)-sinbeta*(
-     &   uside(2)/2.0+utw(2)*cosgam))
-       zh(Ih)=z(Iat1)+blength*(u12(3)-sinbeta*(
-     &   uside(3)/2.0+utw(3)*cosgam))
-       return
-       end
similarity index 98%
rename from src/contrib/fftw/CMakeLists.txt
rename to src/external/build-fftw/CMakeLists.txt
index 620caed6fa4eadb9bd8a35754edd8a788a5c43c7..5e77dfd7c9bf79cdfe803b6cb84f855f4c8879d3 100644 (file)
@@ -93,12 +93,12 @@ if (TARGET_HOST)
 endif()
 
 # Machinery for running the external project
-set(EXTERNAL_FFTW_VERSION 3.3.5)
+set(EXTERNAL_FFTW_VERSION 3.3.7)
 # cmake make eats slashes //// -> //
 set(GMX_BUILD_OWN_FFTW_URL
     "http:////www.fftw.org/fftw-${EXTERNAL_FFTW_VERSION}.tar.gz" CACHE PATH
     "URL from where to download fftw (use an absolute path when offline, adjust GMX_BUILD_OWN_FFTW_MD5 if downloading other version than ${EXTERNAL_FFTW_VERSION})")
-set(GMX_BUILD_OWN_FFTW_MD5 6cc08a3b9c7ee06fdd5b9eb02e06f569 CACHE STRING
+set(GMX_BUILD_OWN_FFTW_MD5 0d5915d7d39b3253c1cc05030d79ac47 CACHE STRING
     "Expected MD5 hash for the file at GMX_BUILD_OWN_FFTW_URL")
 mark_as_advanced(GMX_BUILD_OWN_FFTW_URL GMX_BUILD_OWN_FFTW_MD5)
 
diff --git a/src/external/gmock-1.7.0/README b/src/external/gmock-1.7.0/README
deleted file mode 100644 (file)
index ed2e69b..0000000
+++ /dev/null
@@ -1,369 +0,0 @@
-Google C++ Mocking Framework
-============================
-
-http://code.google.com/p/googlemock/
-
-Overview
---------
-
-Google's framework for writing and using C++ mock classes on a variety
-of platforms (Linux, Mac OS X, Windows, Windows CE, Symbian, etc).
-Inspired by jMock, EasyMock, and Hamcrest, and designed with C++'s
-specifics in mind, it can help you derive better designs of your
-system and write better tests.
-
-Google Mock:
-
-- provides a declarative syntax for defining mocks,
-- can easily define partial (hybrid) mocks, which are a cross of real
-  and mock objects,
-- handles functions of arbitrary types and overloaded functions,
-- comes with a rich set of matchers for validating function arguments,
-- uses an intuitive syntax for controlling the behavior of a mock,
-- does automatic verification of expectations (no record-and-replay
-  needed),
-- allows arbitrary (partial) ordering constraints on
-  function calls to be expressed,
-- lets a user extend it by defining new matchers and actions.
-- does not use exceptions, and
-- is easy to learn and use.
-
-Please see the project page above for more information as well as the
-mailing list for questions, discussions, and development.  There is
-also an IRC channel on OFTC (irc.oftc.net) #gtest available.  Please
-join us!
-
-Please note that code under scripts/generator/ is from the cppclean
-project (http://code.google.com/p/cppclean/) and under the Apache
-License, which is different from Google Mock's license.
-
-Requirements for End Users
---------------------------
-
-Google Mock is implemented on top of the Google Test C++ testing
-framework (http://code.google.com/p/googletest/), and includes the
-latter as part of the SVN repositary and distribution package.  You
-must use the bundled version of Google Test when using Google Mock, or
-you may get compiler/linker errors.
-
-You can also easily configure Google Mock to work with another testing
-framework of your choice; although it will still need Google Test as
-an internal dependency.  Please read
-http://code.google.com/p/googlemock/wiki/ForDummies#Using_Google_Mock_with_Any_Testing_Framework
-for how to do it.
-
-Google Mock depends on advanced C++ features and thus requires a more
-modern compiler.  The following are needed to use Google Mock:
-
-### Linux Requirements ###
-
-These are the base requirements to build and use Google Mock from a source
-package (as described below):
-
-  * GNU-compatible Make or "gmake"
-  * POSIX-standard shell
-  * POSIX(-2) Regular Expressions (regex.h)
-  * C++98-standard-compliant compiler (e.g. GCC 3.4 or newer)
-
-### Windows Requirements ###
-
-  * Microsoft Visual C++ 8.0 SP1 or newer
-
-### Mac OS X Requirements ###
-
-  * Mac OS X 10.4 Tiger or newer
-  * Developer Tools Installed
-
-Requirements for Contributors
------------------------------
-
-We welcome patches.  If you plan to contribute a patch, you need to
-build Google Mock and its own tests from an SVN checkout (described
-below), which has further requirements:
-
-  * Automake version 1.9 or newer
-  * Autoconf version 2.59 or newer
-  * Libtool / Libtoolize
-  * Python version 2.3 or newer (for running some of the tests and
-    re-generating certain source files from templates)
-
-Getting the Source
-------------------
-
-There are two primary ways of getting Google Mock's source code: you
-can download a stable source release in your preferred archive format,
-or directly check out the source from our Subversion (SVN) repositary.
-The SVN checkout requires a few extra steps and some extra software
-packages on your system, but lets you track development and make
-patches much more easily, so we highly encourage it.
-
-### Source Package ###
-
-Google Mock is released in versioned source packages which can be
-downloaded from the download page [1].  Several different archive
-formats are provided, but the only difference is the tools needed to
-extract their contents, and the size of the resulting file.  Download
-whichever you are most comfortable with.
-
-  [1] http://code.google.com/p/googlemock/downloads/list
-
-Once downloaded expand the archive using whichever tools you prefer
-for that type.  This will always result in a new directory with the
-name "gmock-X.Y.Z" which contains all of the source code.  Here are
-some examples on Linux:
-
-  tar -xvzf gmock-X.Y.Z.tar.gz
-  tar -xvjf gmock-X.Y.Z.tar.bz2
-  unzip gmock-X.Y.Z.zip
-
-### SVN Checkout ###
-
-To check out the main branch (also known as the "trunk") of Google
-Mock, run the following Subversion command:
-
-  svn checkout http://googlemock.googlecode.com/svn/trunk/ gmock-svn
-
-If you are using a *nix system and plan to use the GNU Autotools build
-system to build Google Mock (described below), you'll need to
-configure it now.  Otherwise you are done with getting the source
-files.
-
-To prepare the Autotools build system, enter the target directory of
-the checkout command you used ('gmock-svn') and proceed with the
-following command:
-
-  autoreconf -fvi
-
-Once you have completed this step, you are ready to build the library.
-Note that you should only need to complete this step once.  The
-subsequent 'make' invocations will automatically re-generate the bits
-of the build system that need to be changed.
-
-If your system uses older versions of the autotools, the above command
-will fail.  You may need to explicitly specify a version to use.  For
-instance, if you have both GNU Automake 1.4 and 1.9 installed and
-'automake' would invoke the 1.4, use instead:
-
-  AUTOMAKE=automake-1.9 ACLOCAL=aclocal-1.9 autoreconf -fvi
-
-Make sure you're using the same version of automake and aclocal.
-
-Setting up the Build
---------------------
-
-To build Google Mock and your tests that use it, you need to tell your
-build system where to find its headers and source files.  The exact
-way to do it depends on which build system you use, and is usually
-straightforward.
-
-### Generic Build Instructions ###
-
-This section shows how you can integrate Google Mock into your
-existing build system.
-
-Suppose you put Google Mock in directory ${GMOCK_DIR} and Google Test
-in ${GTEST_DIR} (the latter is ${GMOCK_DIR}/gtest by default).  To
-build Google Mock, create a library build target (or a project as
-called by Visual Studio and Xcode) to compile
-
-  ${GTEST_DIR}/src/gtest-all.cc and ${GMOCK_DIR}/src/gmock-all.cc
-
-with
-
-  ${GTEST_DIR}/include and ${GMOCK_DIR}/include
-
-in the system header search path, and
-
-  ${GTEST_DIR} and ${GMOCK_DIR}
-
-in the normal header search path.  Assuming a Linux-like system and gcc,
-something like the following will do:
-
-  g++ -isystem ${GTEST_DIR}/include -I${GTEST_DIR} \
-      -isystem ${GMOCK_DIR}/include -I${GMOCK_DIR} \
-      -pthread -c ${GTEST_DIR}/src/gtest-all.cc
-  g++ -isystem ${GTEST_DIR}/include -I${GTEST_DIR} \
-      -isystem ${GMOCK_DIR}/include -I${GMOCK_DIR} \
-      -pthread -c ${GMOCK_DIR}/src/gmock-all.cc
-  ar -rv libgmock.a gtest-all.o gmock-all.o
-
-(We need -pthread as Google Test and Google Mock use threads.)
-
-Next, you should compile your test source file with
-${GTEST_DIR}/include and ${GMOCK_DIR}/include in the header search
-path, and link it with gmock and any other necessary libraries:
-
-  g++ -isystem ${GTEST_DIR}/include -isystem ${GMOCK_DIR}/include \
-      -pthread path/to/your_test.cc libgmock.a -o your_test
-
-As an example, the make/ directory contains a Makefile that you can
-use to build Google Mock on systems where GNU make is available
-(e.g. Linux, Mac OS X, and Cygwin).  It doesn't try to build Google
-Mock's own tests.  Instead, it just builds the Google Mock library and
-a sample test.  You can use it as a starting point for your own build
-script.
-
-If the default settings are correct for your environment, the
-following commands should succeed:
-
-  cd ${GMOCK_DIR}/make
-  make
-  ./gmock_test
-
-If you see errors, try to tweak the contents of make/Makefile to make
-them go away.  There are instructions in make/Makefile on how to do
-it.
-
-### Windows ###
-
-The msvc/2005 directory contains VC++ 2005 projects and the msvc/2010
-directory contains VC++ 2010 projects for building Google Mock and
-selected tests.
-
-Change to the appropriate directory and run "msbuild gmock.sln" to
-build the library and tests (or open the gmock.sln in the MSVC IDE).
-If you want to create your own project to use with Google Mock, you'll
-have to configure it to use the gmock_config propety sheet.  For that:
-
- * Open the Property Manager window (View | Other Windows | Property Manager)
- * Right-click on your project and select "Add Existing Property Sheet..."
- * Navigate to gmock_config.vsprops or gmock_config.props and select it.
- * In Project Properties | Configuration Properties | General | Additional
-   Include Directories, type <path to Google Mock>/include.
-
-Tweaking Google Mock
---------------------
-
-Google Mock can be used in diverse environments.  The default
-configuration may not work (or may not work well) out of the box in
-some environments.  However, you can easily tweak Google Mock by
-defining control macros on the compiler command line.  Generally,
-these macros are named like GTEST_XYZ and you define them to either 1
-or 0 to enable or disable a certain feature.
-
-We list the most frequently used macros below.  For a complete list,
-see file ${GTEST_DIR}/include/gtest/internal/gtest-port.h.
-
-### Choosing a TR1 Tuple Library ###
-
-Google Mock uses the C++ Technical Report 1 (TR1) tuple library
-heavily.  Unfortunately TR1 tuple is not yet widely available with all
-compilers.  The good news is that Google Test 1.4.0+ implements a
-subset of TR1 tuple that's enough for Google Mock's need.  Google Mock
-will automatically use that implementation when the compiler doesn't
-provide TR1 tuple.
-
-Usually you don't need to care about which tuple library Google Test
-and Google Mock use.  However, if your project already uses TR1 tuple,
-you need to tell Google Test and Google Mock to use the same TR1 tuple
-library the rest of your project uses, or the two tuple
-implementations will clash.  To do that, add
-
-  -DGTEST_USE_OWN_TR1_TUPLE=0
-
-to the compiler flags while compiling Google Test, Google Mock, and
-your tests.  If you want to force Google Test and Google Mock to use
-their own tuple library, just add
-
-  -DGTEST_USE_OWN_TR1_TUPLE=1
-
-to the compiler flags instead.
-
-If you want to use Boost's TR1 tuple library with Google Mock, please
-refer to the Boost website (http://www.boost.org/) for how to obtain
-it and set it up.
-
-### As a Shared Library (DLL) ###
-
-Google Mock is compact, so most users can build and link it as a static
-library for the simplicity.  Google Mock can be used as a DLL, but the
-same DLL must contain Google Test as well.  See Google Test's README
-file for instructions on how to set up necessary compiler settings.
-
-### Tweaking Google Mock ###
-
-Most of Google Test's control macros apply to Google Mock as well.
-Please see file ${GTEST_DIR}/README for how to tweak them.
-
-Upgrading from an Earlier Version
----------------------------------
-
-We strive to keep Google Mock releases backward compatible.
-Sometimes, though, we have to make some breaking changes for the
-users' long-term benefits.  This section describes what you'll need to
-do if you are upgrading from an earlier version of Google Mock.
-
-### Upgrading from 1.1.0 or Earlier ###
-
-You may need to explicitly enable or disable Google Test's own TR1
-tuple library.  See the instructions in section "Choosing a TR1 Tuple
-Library".
-
-### Upgrading from 1.4.0 or Earlier ###
-
-On platforms where the pthread library is available, Google Test and
-Google Mock use it in order to be thread-safe.  For this to work, you
-may need to tweak your compiler and/or linker flags.  Please see the
-"Multi-threaded Tests" section in file ${GTEST_DIR}/README for what
-you may need to do.
-
-If you have custom matchers defined using MatcherInterface or
-MakePolymorphicMatcher(), you'll need to update their definitions to
-use the new matcher API [2].  Matchers defined using MATCHER() or
-MATCHER_P*() aren't affected.
-
-  [2] http://code.google.com/p/googlemock/wiki/CookBook#Writing_New_Monomorphic_Matchers,
-      http://code.google.com/p/googlemock/wiki/CookBook#Writing_New_Polymorphic_Matchers
-
-Developing Google Mock
-----------------------
-
-This section discusses how to make your own changes to Google Mock.
-
-### Testing Google Mock Itself ###
-
-To make sure your changes work as intended and don't break existing
-functionality, you'll want to compile and run Google Test's own tests.
-For that you'll need Autotools.  First, make sure you have followed
-the instructions in section "SVN Checkout" to configure Google Mock.
-Then, create a build output directory and enter it.  Next,
-
-  ${GMOCK_DIR}/configure  # Standard GNU configure script, --help for more info
-
-Once you have successfully configured Google Mock, the build steps are
-standard for GNU-style OSS packages.
-
-  make        # Standard makefile following GNU conventions
-  make check  # Builds and runs all tests - all should pass.
-
-Note that when building your project against Google Mock, you are building
-against Google Test as well.  There is no need to configure Google Test
-separately.
-
-### Regenerating Source Files ###
-
-Some of Google Mock's source files are generated from templates (not
-in the C++ sense) using a script.  A template file is named FOO.pump,
-where FOO is the name of the file it will generate.  For example, the
-file include/gmock/gmock-generated-actions.h.pump is used to generate
-gmock-generated-actions.h in the same directory.
-
-Normally you don't need to worry about regenerating the source files,
-unless you need to modify them.  In that case, you should modify the
-corresponding .pump files instead and run the 'pump' script (for Pump
-is Useful for Meta Programming) to regenerate them.  You can find
-pump.py in the ${GTEST_DIR}/scripts/ directory.  Read the Pump manual
-[3] for how to use it.
-
-  [3] http://code.google.com/p/googletest/wiki/PumpManual.
-
-### Contributing a Patch ###
-
-We welcome patches.  Please read the Google Mock developer's guide [4]
-for how you can contribute.  In particular, make sure you have signed
-the Contributor License Agreement, or we won't be able to accept the
-patch.
-
-  [4] http://code.google.com/p/googlemock/wiki/DevGuide
-
-Happy testing!
diff --git a/src/external/gmock-1.7.0/gtest/README b/src/external/gmock-1.7.0/gtest/README
deleted file mode 100644 (file)
index 26f35a8..0000000
+++ /dev/null
@@ -1,435 +0,0 @@
-Google C++ Testing Framework
-============================
-
-http://code.google.com/p/googletest/
-
-Overview
---------
-
-Google's framework for writing C++ tests on a variety of platforms
-(Linux, Mac OS X, Windows, Windows CE, Symbian, etc).  Based on the
-xUnit architecture.  Supports automatic test discovery, a rich set of
-assertions, user-defined assertions, death tests, fatal and non-fatal
-failures, various options for running the tests, and XML test report
-generation.
-
-Please see the project page above for more information as well as the
-mailing list for questions, discussions, and development.  There is
-also an IRC channel on OFTC (irc.oftc.net) #gtest available.  Please
-join us!
-
-Requirements for End Users
---------------------------
-
-Google Test is designed to have fairly minimal requirements to build
-and use with your projects, but there are some.  Currently, we support
-Linux, Windows, Mac OS X, and Cygwin.  We will also make our best
-effort to support other platforms (e.g. Solaris, AIX, and z/OS).
-However, since core members of the Google Test project have no access
-to these platforms, Google Test may have outstanding issues there.  If
-you notice any problems on your platform, please notify
-googletestframework@googlegroups.com.  Patches for fixing them are
-even more welcome!
-
-### Linux Requirements ###
-
-These are the base requirements to build and use Google Test from a source
-package (as described below):
-  * GNU-compatible Make or gmake
-  * POSIX-standard shell
-  * POSIX(-2) Regular Expressions (regex.h)
-  * A C++98-standard-compliant compiler
-
-### Windows Requirements ###
-
-  * Microsoft Visual C++ 7.1 or newer
-
-### Cygwin Requirements ###
-
-  * Cygwin 1.5.25-14 or newer
-
-### Mac OS X Requirements ###
-
-  * Mac OS X 10.4 Tiger or newer
-  * Developer Tools Installed
-
-Also, you'll need CMake 2.6.4 or higher if you want to build the
-samples using the provided CMake script, regardless of the platform.
-
-Requirements for Contributors
------------------------------
-
-We welcome patches.  If you plan to contribute a patch, you need to
-build Google Test and its own tests from an SVN checkout (described
-below), which has further requirements:
-
-  * Python version 2.3 or newer (for running some of the tests and
-    re-generating certain source files from templates)
-  * CMake 2.6.4 or newer
-
-Getting the Source
-------------------
-
-There are two primary ways of getting Google Test's source code: you
-can download a stable source release in your preferred archive format,
-or directly check out the source from our Subversion (SVN) repositary.
-The SVN checkout requires a few extra steps and some extra software
-packages on your system, but lets you track the latest development and
-make patches much more easily, so we highly encourage it.
-
-### Source Package ###
-
-Google Test is released in versioned source packages which can be
-downloaded from the download page [1].  Several different archive
-formats are provided, but the only difference is the tools used to
-manipulate them, and the size of the resulting file.  Download
-whichever you are most comfortable with.
-
-  [1] http://code.google.com/p/googletest/downloads/list
-
-Once the package is downloaded, expand it using whichever tools you
-prefer for that type.  This will result in a new directory with the
-name "gtest-X.Y.Z" which contains all of the source code.  Here are
-some examples on Linux:
-
-  tar -xvzf gtest-X.Y.Z.tar.gz
-  tar -xvjf gtest-X.Y.Z.tar.bz2
-  unzip gtest-X.Y.Z.zip
-
-### SVN Checkout ###
-
-To check out the main branch (also known as the "trunk") of Google
-Test, run the following Subversion command:
-
-  svn checkout http://googletest.googlecode.com/svn/trunk/ gtest-svn
-
-Setting up the Build
---------------------
-
-To build Google Test and your tests that use it, you need to tell your
-build system where to find its headers and source files.  The exact
-way to do it depends on which build system you use, and is usually
-straightforward.
-
-### Generic Build Instructions ###
-
-Suppose you put Google Test in directory ${GTEST_DIR}.  To build it,
-create a library build target (or a project as called by Visual Studio
-and Xcode) to compile
-
-  ${GTEST_DIR}/src/gtest-all.cc
-
-with ${GTEST_DIR}/include in the system header search path and ${GTEST_DIR}
-in the normal header search path.  Assuming a Linux-like system and gcc,
-something like the following will do:
-
-  g++ -isystem ${GTEST_DIR}/include -I${GTEST_DIR} \
-      -pthread -c ${GTEST_DIR}/src/gtest-all.cc
-  ar -rv libgtest.a gtest-all.o
-
-(We need -pthread as Google Test uses threads.)
-
-Next, you should compile your test source file with
-${GTEST_DIR}/include in the system header search path, and link it
-with gtest and any other necessary libraries:
-
-  g++ -isystem ${GTEST_DIR}/include -pthread path/to/your_test.cc libgtest.a \
-      -o your_test
-
-As an example, the make/ directory contains a Makefile that you can
-use to build Google Test on systems where GNU make is available
-(e.g. Linux, Mac OS X, and Cygwin).  It doesn't try to build Google
-Test's own tests.  Instead, it just builds the Google Test library and
-a sample test.  You can use it as a starting point for your own build
-script.
-
-If the default settings are correct for your environment, the
-following commands should succeed:
-
-  cd ${GTEST_DIR}/make
-  make
-  ./sample1_unittest
-
-If you see errors, try to tweak the contents of make/Makefile to make
-them go away.  There are instructions in make/Makefile on how to do
-it.
-
-### Using CMake ###
-
-Google Test comes with a CMake build script (CMakeLists.txt) that can
-be used on a wide range of platforms ("C" stands for cross-platofrm.).
-If you don't have CMake installed already, you can download it for
-free from http://www.cmake.org/.
-
-CMake works by generating native makefiles or build projects that can
-be used in the compiler environment of your choice.  The typical
-workflow starts with:
-
-  mkdir mybuild       # Create a directory to hold the build output.
-  cd mybuild
-  cmake ${GTEST_DIR}  # Generate native build scripts.
-
-If you want to build Google Test's samples, you should replace the
-last command with
-
-  cmake -Dgtest_build_samples=ON ${GTEST_DIR}
-
-If you are on a *nix system, you should now see a Makefile in the
-current directory.  Just type 'make' to build gtest.
-
-If you use Windows and have Vistual Studio installed, a gtest.sln file
-and several .vcproj files will be created.  You can then build them
-using Visual Studio.
-
-On Mac OS X with Xcode installed, a .xcodeproj file will be generated.
-
-### Legacy Build Scripts ###
-
-Before settling on CMake, we have been providing hand-maintained build
-projects/scripts for Visual Studio, Xcode, and Autotools.  While we
-continue to provide them for convenience, they are not actively
-maintained any more.  We highly recommend that you follow the
-instructions in the previous two sections to integrate Google Test
-with your existing build system.
-
-If you still need to use the legacy build scripts, here's how:
-
-The msvc\ folder contains two solutions with Visual C++ projects.
-Open the gtest.sln or gtest-md.sln file using Visual Studio, and you
-are ready to build Google Test the same way you build any Visual
-Studio project.  Files that have names ending with -md use DLL
-versions of Microsoft runtime libraries (the /MD or the /MDd compiler
-option).  Files without that suffix use static versions of the runtime
-libraries (the /MT or the /MTd option).  Please note that one must use
-the same option to compile both gtest and the test code.  If you use
-Visual Studio 2005 or above, we recommend the -md version as /MD is
-the default for new projects in these versions of Visual Studio.
-
-On Mac OS X, open the gtest.xcodeproj in the xcode/ folder using
-Xcode.  Build the "gtest" target.  The universal binary framework will
-end up in your selected build directory (selected in the Xcode
-"Preferences..." -> "Building" pane and defaults to xcode/build).
-Alternatively, at the command line, enter:
-
-  xcodebuild
-
-This will build the "Release" configuration of gtest.framework in your
-default build location.  See the "xcodebuild" man page for more
-information about building different configurations and building in
-different locations.
-
-If you wish to use the Google Test Xcode project with Xcode 4.x and
-above, you need to either:
- * update the SDK configuration options in xcode/Config/General.xconfig.
-   Comment options SDKROOT, MACOS_DEPLOYMENT_TARGET, and GCC_VERSION. If
-   you choose this route you lose the ability to target earlier versions
-   of MacOS X.
- * Install an SDK for an earlier version. This doesn't appear to be
-   supported by Apple, but has been reported to work
-   (http://stackoverflow.com/questions/5378518).
-
-Tweaking Google Test
---------------------
-
-Google Test can be used in diverse environments.  The default
-configuration may not work (or may not work well) out of the box in
-some environments.  However, you can easily tweak Google Test by
-defining control macros on the compiler command line.  Generally,
-these macros are named like GTEST_XYZ and you define them to either 1
-or 0 to enable or disable a certain feature.
-
-We list the most frequently used macros below.  For a complete list,
-see file include/gtest/internal/gtest-port.h.
-
-### Choosing a TR1 Tuple Library ###
-
-Some Google Test features require the C++ Technical Report 1 (TR1)
-tuple library, which is not yet available with all compilers.  The
-good news is that Google Test implements a subset of TR1 tuple that's
-enough for its own need, and will automatically use this when the
-compiler doesn't provide TR1 tuple.
-
-Usually you don't need to care about which tuple library Google Test
-uses.  However, if your project already uses TR1 tuple, you need to
-tell Google Test to use the same TR1 tuple library the rest of your
-project uses, or the two tuple implementations will clash.  To do
-that, add
-
-  -DGTEST_USE_OWN_TR1_TUPLE=0
-
-to the compiler flags while compiling Google Test and your tests.  If
-you want to force Google Test to use its own tuple library, just add
-
-  -DGTEST_USE_OWN_TR1_TUPLE=1
-
-to the compiler flags instead.
-
-If you don't want Google Test to use tuple at all, add
-
-  -DGTEST_HAS_TR1_TUPLE=0
-
-and all features using tuple will be disabled.
-
-### Multi-threaded Tests ###
-
-Google Test is thread-safe where the pthread library is available.
-After #include "gtest/gtest.h", you can check the GTEST_IS_THREADSAFE
-macro to see whether this is the case (yes if the macro is #defined to
-1, no if it's undefined.).
-
-If Google Test doesn't correctly detect whether pthread is available
-in your environment, you can force it with
-
-  -DGTEST_HAS_PTHREAD=1
-
-or
-
-  -DGTEST_HAS_PTHREAD=0
-
-When Google Test uses pthread, you may need to add flags to your
-compiler and/or linker to select the pthread library, or you'll get
-link errors.  If you use the CMake script or the deprecated Autotools
-script, this is taken care of for you.  If you use your own build
-script, you'll need to read your compiler and linker's manual to
-figure out what flags to add.
-
-### As a Shared Library (DLL) ###
-
-Google Test is compact, so most users can build and link it as a
-static library for the simplicity.  You can choose to use Google Test
-as a shared library (known as a DLL on Windows) if you prefer.
-
-To compile *gtest* as a shared library, add
-
-  -DGTEST_CREATE_SHARED_LIBRARY=1
-
-to the compiler flags.  You'll also need to tell the linker to produce
-a shared library instead - consult your linker's manual for how to do
-it.
-
-To compile your *tests* that use the gtest shared library, add
-
-  -DGTEST_LINKED_AS_SHARED_LIBRARY=1
-
-to the compiler flags.
-
-Note: while the above steps aren't technically necessary today when
-using some compilers (e.g. GCC), they may become necessary in the
-future, if we decide to improve the speed of loading the library (see
-http://gcc.gnu.org/wiki/Visibility for details).  Therefore you are
-recommended to always add the above flags when using Google Test as a
-shared library.  Otherwise a future release of Google Test may break
-your build script.
-
-### Avoiding Macro Name Clashes ###
-
-In C++, macros don't obey namespaces.  Therefore two libraries that
-both define a macro of the same name will clash if you #include both
-definitions.  In case a Google Test macro clashes with another
-library, you can force Google Test to rename its macro to avoid the
-conflict.
-
-Specifically, if both Google Test and some other code define macro
-FOO, you can add
-
-  -DGTEST_DONT_DEFINE_FOO=1
-
-to the compiler flags to tell Google Test to change the macro's name
-from FOO to GTEST_FOO.  Currently FOO can be FAIL, SUCCEED, or TEST.
-For example, with -DGTEST_DONT_DEFINE_TEST=1, you'll need to write
-
-  GTEST_TEST(SomeTest, DoesThis) { ... }
-
-instead of
-
-  TEST(SomeTest, DoesThis) { ... }
-
-in order to define a test.
-
-Upgrating from an Earlier Version
----------------------------------
-
-We strive to keep Google Test releases backward compatible.
-Sometimes, though, we have to make some breaking changes for the
-users' long-term benefits.  This section describes what you'll need to
-do if you are upgrading from an earlier version of Google Test.
-
-### Upgrading from 1.3.0 or Earlier ###
-
-You may need to explicitly enable or disable Google Test's own TR1
-tuple library.  See the instructions in section "Choosing a TR1 Tuple
-Library".
-
-### Upgrading from 1.4.0 or Earlier ###
-
-The Autotools build script (configure + make) is no longer officially
-supportted.  You are encouraged to migrate to your own build system or
-use CMake.  If you still need to use Autotools, you can find
-instructions in the README file from Google Test 1.4.0.
-
-On platforms where the pthread library is available, Google Test uses
-it in order to be thread-safe.  See the "Multi-threaded Tests" section
-for what this means to your build script.
-
-If you use Microsoft Visual C++ 7.1 with exceptions disabled, Google
-Test will no longer compile.  This should affect very few people, as a
-large portion of STL (including <string>) doesn't compile in this mode
-anyway.  We decided to stop supporting it in order to greatly simplify
-Google Test's implementation.
-
-Developing Google Test
-----------------------
-
-This section discusses how to make your own changes to Google Test.
-
-### Testing Google Test Itself ###
-
-To make sure your changes work as intended and don't break existing
-functionality, you'll want to compile and run Google Test's own tests.
-For that you can use CMake:
-
-  mkdir mybuild
-  cd mybuild
-  cmake -Dgtest_build_tests=ON ${GTEST_DIR}
-
-Make sure you have Python installed, as some of Google Test's tests
-are written in Python.  If the cmake command complains about not being
-able to find Python ("Could NOT find PythonInterp (missing:
-PYTHON_EXECUTABLE)"), try telling it explicitly where your Python
-executable can be found:
-
-  cmake -DPYTHON_EXECUTABLE=path/to/python -Dgtest_build_tests=ON ${GTEST_DIR}
-
-Next, you can build Google Test and all of its own tests.  On *nix,
-this is usually done by 'make'.  To run the tests, do
-
-  make test
-
-All tests should pass.
-
-### Regenerating Source Files ###
-
-Some of Google Test's source files are generated from templates (not
-in the C++ sense) using a script.  A template file is named FOO.pump,
-where FOO is the name of the file it will generate.  For example, the
-file include/gtest/internal/gtest-type-util.h.pump is used to generate
-gtest-type-util.h in the same directory.
-
-Normally you don't need to worry about regenerating the source files,
-unless you need to modify them.  In that case, you should modify the
-corresponding .pump files instead and run the pump.py Python script to
-regenerate them.  You can find pump.py in the scripts/ directory.
-Read the Pump manual [2] for how to use it.
-
-  [2] http://code.google.com/p/googletest/wiki/PumpManual
-
-### Contributing a Patch ###
-
-We welcome patches.  Please read the Google Test developer's guide [3]
-for how you can contribute.  In particular, make sure you have signed
-the Contributor License Agreement, or we won't be able to accept the
-patch.
-
-  [3] http://code.google.com/p/googletest/wiki/GoogleTestDevGuide
-
-Happy testing!
similarity index 74%
rename from src/external/gmock-1.7.0/CMakeLists.txt
rename to src/external/googletest/CMakeLists.txt
index fa220cf29a26299d2be310491c336a13ec0f1e1e..f37e34f30978ec5a876c643063a2ae68aec66f72 100644 (file)
 include(CheckCXXCompilerFlag)
 check_cxx_compiler_flag("-Wno-unused-variable" HAS_NO_UNUSED_VARIABLE)
 
-# Avoid compiler warnings with GCC 5, which doesn't like the way
-# Google Test makes int variables that hold the results of
-# value-parameterized test registration calls, and then doesn't use
-# them. Because these definitions are created by the
-# test-instantiation macros, there's no good way to suppress them;
-# we'd prefer to avoid modifying Google Test source, and don't wish to
-# embed compiler-specific suppressions in all our test-code source
-# files.
-#
-# TODO When updating the embedded Google Test version in future, check
-# if this is still needed
-#
-# TODO If other compilers start complaining similarly, consider a
-# unilateral suppression, like we use for the Google Mock source code
-# itself.
-if(CMAKE_COMPILER_IS_GNUCXX AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5")
-    if(HAS_NO_UNUSED_VARIABLE)
-        set(GMOCK_COMPILE_FLAGS "-Wno-unused-variable")
-    endif()
-endif()
-
 # GTest/GMock suggest linking with pthreads when available for thread safety
 set(CMAKE_THREAD_PREFER_PTHREAD 1)
 find_package(Threads)
@@ -72,14 +51,8 @@ else()
     set(GTEST_IS_THREADSAFE 0)
 endif()
 
-# Skip variadic implementation of matchers if using GCC < 4.7 due to
-# GCC Bug 35722 -[C++0x] Variadic templates expansion into non-variadic class template
-if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.7")
-    list(APPEND GMOCK_COMPILE_DEFINITIONS "GTEST_LANG_CXX11=0")
-endif()
-
-set(GMOCK_DIR ${CMAKE_CURRENT_SOURCE_DIR})
-set(GTEST_DIR ${GMOCK_DIR}/gtest)
+set(GMOCK_DIR ${CMAKE_CURRENT_SOURCE_DIR}/googlemock)
+set(GTEST_DIR ${CMAKE_CURRENT_SOURCE_DIR}/googletest)
 set(GTEST_SOURCES ${GTEST_DIR}/src/gtest-all.cc)
 set(GMOCK_SOURCES ${GMOCK_DIR}/src/gmock-all.cc)
 
diff --git a/src/external/googletest/README.Gromacs b/src/external/googletest/README.Gromacs
new file mode 100644 (file)
index 0000000..00f076c
--- /dev/null
@@ -0,0 +1,54 @@
+This directory contains source code for Google C++ Testing and Mocking
+Frameworks.
+
+The code has been copied nearly verbatim from the GoogleTest 1.8.0
+tarball by copying the following files/directories recursively:
+
+README.md
+googletest
+googlemock
+
+However, the following files/subdirectories were excluded because they
+are unneeded for GROMACS:
+
+*.pump
+travis.h
+appveyor.yml
+build-aux
+cmake
+codegear
+configure.ac
+Makefile.am
+msvc
+m4
+xcode
+test
+scripts
+googletest/docs/V*md
+googletest/samples
+googlemock/docs/v*/*md
+
+The file CMakeLists.txt in this directory is part of the GROMACS build
+system and has been written from scratch.
+
+This README.Gromacs file is new, of course.
+
+In the default version, googletest-1.8.0 assumes wcscasecmp() to be
+present on Linux.  This is not the case on all platforms, so in
+gtest/src/gtest.cc we have added a define to only use this if
+GTEST_HAS_WCSCASECMP is set. Since we never set this define, we fall
+back on the alternative internal implementation which should be
+perfectly fine for now.
+
+googletest-1.8.0 also assumes that streaming results to a socket is
+something you can always do on Linux, but the implementation uses
+getaddrinfo(), about which the Cray linker warns because its use would
+require shared libraries at run time. Since GROMACS testing doesn't
+use this feature, we'd just want to turn it off, but there's no
+interface for that. So, GTEST_CAN_STREAM_RESULTS is added in
+googletest/include/gtest/internal/gtest-port.h to allow the default
+behaviour to be applied only if the user hasn't gotten involved.
+
+Two helper functions for implementing INSTANTIATE_TEST_CASE_P in
+gtest-param-test.h have had the static specifer added to their
+declarations, which silences -Wmissing-prototype warnings.
\ No newline at end of file
diff --git a/src/external/googletest/README.md b/src/external/googletest/README.md
new file mode 100644 (file)
index 0000000..076484e
--- /dev/null
@@ -0,0 +1,142 @@
+
+# Google Test #
+
+[![Build Status](https://travis-ci.org/google/googletest.svg?branch=master)](https://travis-ci.org/google/googletest)
+[![Build status](https://ci.appveyor.com/api/projects/status/4o38plt0xbo1ubc8/branch/master?svg=true)](https://ci.appveyor.com/project/BillyDonahue/googletest/branch/master)
+
+Welcome to **Google Test**, Google's C++ test framework!
+
+This repository is a merger of the formerly separate GoogleTest and
+GoogleMock projects. These were so closely related that it makes sense to
+maintain and release them together.
+
+Please see the project page above for more information as well as the
+mailing list for questions, discussions, and development.  There is
+also an IRC channel on OFTC (irc.oftc.net) #gtest available.  Please
+join us!
+
+Getting started information for **Google Test** is available in the 
+[Google Test Primer](googletest/docs/Primer.md) documentation.
+
+**Google Mock** is an extension to Google Test for writing and using C++ mock
+classes.  See the separate [Google Mock documentation](googlemock/README.md).
+
+More detailed documentation for googletest (including build instructions) are
+in its interior [googletest/README.md](googletest/README.md) file.
+
+## Features ##
+
+  * An [XUnit](https://en.wikipedia.org/wiki/XUnit) test framework.
+  * Test discovery.
+  * A rich set of assertions.
+  * User-defined assertions.
+  * Death tests.
+  * Fatal and non-fatal failures.
+  * Value-parameterized tests.
+  * Type-parameterized tests.
+  * Various options for running the tests.
+  * XML test report generation.
+
+## Platforms ##
+
+Google test has been used on a variety of platforms:
+
+  * Linux
+  * Mac OS X
+  * Windows
+  * Cygwin
+  * MinGW
+  * Windows Mobile
+  * Symbian
+
+## Who Is Using Google Test? ##
+
+In addition to many internal projects at Google, Google Test is also used by
+the following notable projects:
+
+  * The [Chromium projects](http://www.chromium.org/) (behind the Chrome
+    browser and Chrome OS).
+  * The [LLVM](http://llvm.org/) compiler.
+  * [Protocol Buffers](https://github.com/google/protobuf), Google's data
+    interchange format.
+  * The [OpenCV](http://opencv.org/) computer vision library.
+
+## Related Open Source Projects ##
+
+[Google Test UI](https://github.com/ospector/gtest-gbar) is test runner that runs
+your test binary, allows you to track its progress via a progress bar, and
+displays a list of test failures. Clicking on one shows failure text. Google
+Test UI is written in C#.
+
+[GTest TAP Listener](https://github.com/kinow/gtest-tap-listener) is an event
+listener for Google Test that implements the
+[TAP protocol](https://en.wikipedia.org/wiki/Test_Anything_Protocol) for test
+result output. If your test runner understands TAP, you may find it useful.
+
+## Requirements ##
+
+Google Test is designed to have fairly minimal requirements to build
+and use with your projects, but there are some.  Currently, we support
+Linux, Windows, Mac OS X, and Cygwin.  We will also make our best
+effort to support other platforms (e.g. Solaris, AIX, and z/OS).
+However, since core members of the Google Test project have no access
+to these platforms, Google Test may have outstanding issues there.  If
+you notice any problems on your platform, please notify
+<googletestframework@googlegroups.com>. Patches for fixing them are
+even more welcome!
+
+### Linux Requirements ###
+
+These are the base requirements to build and use Google Test from a source
+package (as described below):
+
+  * GNU-compatible Make or gmake
+  * POSIX-standard shell
+  * POSIX(-2) Regular Expressions (regex.h)
+  * A C++98-standard-compliant compiler
+
+### Windows Requirements ###
+
+  * Microsoft Visual C++ v7.1 or newer
+
+### Cygwin Requirements ###
+
+  * Cygwin v1.5.25-14 or newer
+
+### Mac OS X Requirements ###
+
+  * Mac OS X v10.4 Tiger or newer
+  * Xcode Developer Tools
+
+### Requirements for Contributors ###
+
+We welcome patches.  If you plan to contribute a patch, you need to
+build Google Test and its own tests from a git checkout (described
+below), which has further requirements:
+
+  * [Python](https://www.python.org/) v2.3 or newer (for running some of
+    the tests and re-generating certain source files from templates)
+  * [CMake](https://cmake.org/) v2.6.4 or newer
+
+## Regenerating Source Files ##
+
+Some of Google Test's source files are generated from templates (not
+in the C++ sense) using a script.
+For example, the
+file include/gtest/internal/gtest-type-util.h.pump is used to generate
+gtest-type-util.h in the same directory.
+
+You don't need to worry about regenerating the source files
+unless you need to modify them.  You would then modify the
+corresponding `.pump` files and run the '[pump.py](googletest/scripts/pump.py)'
+generator script.  See the [Pump Manual](googletest/docs/PumpManual.md).
+
+### Contributing Code ###
+
+We welcome patches.  Please read the
+[Developer's Guide](googletest/docs/DevGuide.md)
+for how you can contribute. In particular, make sure you have signed
+the Contributor License Agreement, or we won't be able to accept the
+patch.
+
+Happy testing!
diff --git a/src/external/googletest/googlemock/CHANGES b/src/external/googletest/googlemock/CHANGES
new file mode 100644 (file)
index 0000000..d6f2f76
--- /dev/null
@@ -0,0 +1,126 @@
+Changes for 1.7.0:
+
+* All new improvements in Google Test 1.7.0.
+* New feature: matchers DoubleNear(), FloatNear(),
+  NanSensitiveDoubleNear(), NanSensitiveFloatNear(),
+  UnorderedElementsAre(), UnorderedElementsAreArray(), WhenSorted(),
+  WhenSortedBy(), IsEmpty(), and SizeIs().
+* Improvement: Google Mock can now be built as a DLL.
+* Improvement: when compiled by a C++11 compiler, matchers AllOf()
+  and AnyOf() can accept an arbitrary number of matchers.
+* Improvement: when compiled by a C++11 compiler, matchers
+  ElementsAreArray() can accept an initializer list.
+* Improvement: when exceptions are enabled, a mock method with no
+  default action now throws instead crashing the test.
+* Improvement: added class testing::StringMatchResultListener to aid
+  definition of composite matchers.
+* Improvement: function return types used in MOCK_METHOD*() macros can
+  now contain unprotected commas.
+* Improvement (potentially breaking): EXPECT_THAT() and ASSERT_THAT()
+  are now more strict in ensuring that the value type and the matcher
+  type are compatible, catching potential bugs in tests.
+* Improvement: Pointee() now works on an optional<T>.
+* Improvement: the ElementsAreArray() matcher can now take a vector or
+  iterator range as input, and makes a copy of its input elements
+  before the conversion to a Matcher.
+* Improvement: the Google Mock Generator can now generate mocks for
+  some class templates.
+* Bug fix: mock object destruction triggerred by another mock object's
+  destruction no longer hangs.
+* Improvement: Google Mock Doctor works better with newer Clang and
+  GCC now.
+* Compatibility fixes.
+* Bug/warning fixes.
+
+Changes for 1.6.0:
+
+* Compilation is much faster and uses much less memory, especially
+  when the constructor and destructor of a mock class are moved out of
+  the class body.
+* New matchers: Pointwise(), Each().
+* New actions: ReturnPointee() and ReturnRefOfCopy().
+* CMake support.
+* Project files for Visual Studio 2010.
+* AllOf() and AnyOf() can handle up-to 10 arguments now.
+* Google Mock doctor understands Clang error messages now.
+* SetArgPointee<> now accepts string literals.
+* gmock_gen.py handles storage specifier macros and template return
+  types now.
+* Compatibility fixes.
+* Bug fixes and implementation clean-ups.
+* Potentially incompatible changes: disables the harmful 'make install'
+  command in autotools.
+
+Potentially breaking changes:
+
+* The description string for MATCHER*() changes from Python-style
+  interpolation to an ordinary C++ string expression.
+* SetArgumentPointee is deprecated in favor of SetArgPointee.
+* Some non-essential project files for Visual Studio 2005 are removed.
+
+Changes for 1.5.0:
+
+ * New feature: Google Mock can be safely used in multi-threaded tests
+   on platforms having pthreads.
+ * New feature: function for printing a value of arbitrary type.
+ * New feature: function ExplainMatchResult() for easy definition of
+   composite matchers.
+ * The new matcher API lets user-defined matchers generate custom
+   explanations more directly and efficiently.
+ * Better failure messages all around.
+ * NotNull() and IsNull() now work with smart pointers.
+ * Field() and Property() now work when the matcher argument is a pointer
+   passed by reference.
+ * Regular expression matchers on all platforms.
+ * Added GCC 4.0 support for Google Mock Doctor.
+ * Added gmock_all_test.cc for compiling most Google Mock tests
+   in a single file.
+ * Significantly cleaned up compiler warnings.
+ * Bug fixes, better test coverage, and implementation clean-ups.
+
+ Potentially breaking changes:
+
+ * Custom matchers defined using MatcherInterface or MakePolymorphicMatcher()
+   need to be updated after upgrading to Google Mock 1.5.0; matchers defined
+   using MATCHER or MATCHER_P* aren't affected.
+ * Dropped support for 'make install'.
+
+Changes for 1.4.0 (we skipped 1.2.* and 1.3.* to match the version of
+Google Test):
+
+ * Works in more environments: Symbian and minGW, Visual C++ 7.1.
+ * Lighter weight: comes with our own implementation of TR1 tuple (no
+   more dependency on Boost!).
+ * New feature: --gmock_catch_leaked_mocks for detecting leaked mocks.
+ * New feature: ACTION_TEMPLATE for defining templatized actions.
+ * New feature: the .After() clause for specifying expectation order.
+ * New feature: the .With() clause for for specifying inter-argument
+   constraints.
+ * New feature: actions ReturnArg<k>(), ReturnNew<T>(...), and
+   DeleteArg<k>().
+ * New feature: matchers Key(), Pair(), Args<...>(), AllArgs(), IsNull(),
+   and Contains().
+ * New feature: utility class MockFunction<F>, useful for checkpoints, etc.
+ * New feature: functions Value(x, m) and SafeMatcherCast<T>(m).
+ * New feature: copying a mock object is rejected at compile time.
+ * New feature: a script for fusing all Google Mock and Google Test
+   source files for easy deployment.
+ * Improved the Google Mock doctor to diagnose more diseases.
+ * Improved the Google Mock generator script.
+ * Compatibility fixes for Mac OS X and gcc.
+ * Bug fixes and implementation clean-ups.
+
+Changes for 1.1.0:
+
+ * New feature: ability to use Google Mock with any testing framework.
+ * New feature: macros for easily defining new matchers
+ * New feature: macros for easily defining new actions.
+ * New feature: more container matchers.
+ * New feature: actions for accessing function arguments and throwing
+   exceptions.
+ * Improved the Google Mock doctor script for diagnosing compiler errors.
+ * Bug fixes and implementation clean-ups.
+
+Changes for 1.0.0:
+
+ * Initial Open Source release of Google Mock
diff --git a/src/external/googletest/googlemock/CMakeLists.txt b/src/external/googletest/googlemock/CMakeLists.txt
new file mode 100644 (file)
index 0000000..beb259a
--- /dev/null
@@ -0,0 +1,202 @@
+########################################################################
+# CMake build script for Google Mock.
+#
+# To run the tests for Google Mock itself on Linux, use 'make test' or
+# ctest.  You can select which tests to run using 'ctest -R regex'.
+# For more options, run 'ctest --help'.
+
+# BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to
+# make it prominent in the GUI.
+option(BUILD_SHARED_LIBS "Build shared libraries (DLLs)." OFF)
+
+option(gmock_build_tests "Build all of Google Mock's own tests." OFF)
+
+# A directory to find Google Test sources.
+if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/gtest/CMakeLists.txt")
+  set(gtest_dir gtest)
+else()
+  set(gtest_dir ../googletest)
+endif()
+
+# Defines pre_project_set_up_hermetic_build() and set_up_hermetic_build().
+include("${gtest_dir}/cmake/hermetic_build.cmake" OPTIONAL)
+
+if (COMMAND pre_project_set_up_hermetic_build)
+  # Google Test also calls hermetic setup functions from add_subdirectory,
+  # although its changes will not affect things at the current scope.
+  pre_project_set_up_hermetic_build()
+endif()
+
+########################################################################
+#
+# Project-wide settings
+
+# Name of the project.
+#
+# CMake files in this project can refer to the root source directory
+# as ${gmock_SOURCE_DIR} and to the root binary directory as
+# ${gmock_BINARY_DIR}.
+# Language "C" is required for find_package(Threads).
+project(gmock CXX C)
+cmake_minimum_required(VERSION 2.6.2)
+
+if (COMMAND set_up_hermetic_build)
+  set_up_hermetic_build()
+endif()
+
+# Instructs CMake to process Google Test's CMakeLists.txt and add its
+# targets to the current scope.  We are placing Google Test's binary
+# directory in a subdirectory of our own as VC compilation may break
+# if they are the same (the default).
+add_subdirectory("${gtest_dir}" "${gmock_BINARY_DIR}/gtest")
+
+# Although Google Test's CMakeLists.txt calls this function, the
+# changes there don't affect the current scope.  Therefore we have to
+# call it again here.
+config_compiler_and_linker()  # from ${gtest_dir}/cmake/internal_utils.cmake
+
+# Adds Google Mock's and Google Test's header directories to the search path.
+include_directories("${gmock_SOURCE_DIR}/include"
+                    "${gmock_SOURCE_DIR}"
+                    "${gtest_SOURCE_DIR}/include"
+                    # This directory is needed to build directly from Google
+                    # Test sources.
+                    "${gtest_SOURCE_DIR}")
+
+# Summary of tuple support for Microsoft Visual Studio:
+# Compiler    version(MS)  version(cmake)  Support
+# ----------  -----------  --------------  -----------------------------
+# <= VS 2010  <= 10        <= 1600         Use Google Tests's own tuple.
+# VS 2012     11           1700            std::tr1::tuple + _VARIADIC_MAX=10
+# VS 2013     12           1800            std::tr1::tuple
+if (MSVC AND MSVC_VERSION EQUAL 1700)
+  add_definitions(/D _VARIADIC_MAX=10)
+endif()
+
+########################################################################
+#
+# Defines the gmock & gmock_main libraries.  User tests should link
+# with one of them.
+
+# Google Mock libraries.  We build them using more strict warnings than what
+# are used for other targets, to ensure that Google Mock can be compiled by
+# a user aggressive about warnings.
+cxx_library(gmock
+            "${cxx_strict}"
+            "${gtest_dir}/src/gtest-all.cc"
+            src/gmock-all.cc)
+
+cxx_library(gmock_main
+            "${cxx_strict}"
+            "${gtest_dir}/src/gtest-all.cc"
+            src/gmock-all.cc
+            src/gmock_main.cc)
+
+# If the CMake version supports it, attach header directory information
+# to the targets for when we are part of a parent build (ie being pulled
+# in via add_subdirectory() rather than being a standalone build).
+if (DEFINED CMAKE_VERSION AND NOT "${CMAKE_VERSION}" VERSION_LESS "2.8.11")
+  target_include_directories(gmock      INTERFACE "${gmock_SOURCE_DIR}/include")
+  target_include_directories(gmock_main INTERFACE "${gmock_SOURCE_DIR}/include")
+endif()
+
+########################################################################
+#
+# Install rules
+install(TARGETS gmock gmock_main
+  DESTINATION lib)
+install(DIRECTORY ${gmock_SOURCE_DIR}/include/gmock
+  DESTINATION include)
+
+########################################################################
+#
+# Google Mock's own tests.
+#
+# You can skip this section if you aren't interested in testing
+# Google Mock itself.
+#
+# The tests are not built by default.  To build them, set the
+# gmock_build_tests option to ON.  You can do it by running ccmake
+# or specifying the -Dgmock_build_tests=ON flag when running cmake.
+
+if (gmock_build_tests)
+  # This must be set in the root directory for the tests to be run by
+  # 'make test' or ctest.
+  enable_testing()
+
+  ############################################################
+  # C++ tests built with standard compiler flags.
+
+  cxx_test(gmock-actions_test gmock_main)
+  cxx_test(gmock-cardinalities_test gmock_main)
+  cxx_test(gmock_ex_test gmock_main)
+  cxx_test(gmock-generated-actions_test gmock_main)
+  cxx_test(gmock-generated-function-mockers_test gmock_main)
+  cxx_test(gmock-generated-internal-utils_test gmock_main)
+  cxx_test(gmock-generated-matchers_test gmock_main)
+  cxx_test(gmock-internal-utils_test gmock_main)
+  cxx_test(gmock-matchers_test gmock_main)
+  cxx_test(gmock-more-actions_test gmock_main)
+  cxx_test(gmock-nice-strict_test gmock_main)
+  cxx_test(gmock-port_test gmock_main)
+  cxx_test(gmock-spec-builders_test gmock_main)
+  cxx_test(gmock_link_test gmock_main test/gmock_link2_test.cc)
+  cxx_test(gmock_test gmock_main)
+
+  if (CMAKE_USE_PTHREADS_INIT)
+    cxx_test(gmock_stress_test gmock)
+  endif()
+
+  # gmock_all_test is commented to save time building and running tests.
+  # Uncomment if necessary.
+  # cxx_test(gmock_all_test gmock_main)
+
+  ############################################################
+  # C++ tests built with non-standard compiler flags.
+
+  cxx_library(gmock_main_no_exception "${cxx_no_exception}"
+    "${gtest_dir}/src/gtest-all.cc" src/gmock-all.cc src/gmock_main.cc)
+
+  cxx_library(gmock_main_no_rtti "${cxx_no_rtti}"
+    "${gtest_dir}/src/gtest-all.cc" src/gmock-all.cc src/gmock_main.cc)
+
+  if (NOT MSVC OR MSVC_VERSION LESS 1600)  # 1600 is Visual Studio 2010.
+    # Visual Studio 2010, 2012, and 2013 define symbols in std::tr1 that
+    # conflict with our own definitions. Therefore using our own tuple does not
+    # work on those compilers.
+    cxx_library(gmock_main_use_own_tuple "${cxx_use_own_tuple}"
+      "${gtest_dir}/src/gtest-all.cc" src/gmock-all.cc src/gmock_main.cc)
+
+    cxx_test_with_flags(gmock_use_own_tuple_test "${cxx_use_own_tuple}"
+      gmock_main_use_own_tuple test/gmock-spec-builders_test.cc)
+  endif()
+
+  cxx_test_with_flags(gmock-more-actions_no_exception_test "${cxx_no_exception}"
+    gmock_main_no_exception test/gmock-more-actions_test.cc)
+
+  cxx_test_with_flags(gmock_no_rtti_test "${cxx_no_rtti}"
+    gmock_main_no_rtti test/gmock-spec-builders_test.cc)
+
+  cxx_shared_library(shared_gmock_main "${cxx_default}"
+    "${gtest_dir}/src/gtest-all.cc" src/gmock-all.cc src/gmock_main.cc)
+
+  # Tests that a binary can be built with Google Mock as a shared library.  On
+  # some system configurations, it may not possible to run the binary without
+  # knowing more details about the system configurations. We do not try to run
+  # this binary. To get a more robust shared library coverage, configure with
+  # -DBUILD_SHARED_LIBS=ON.
+  cxx_executable_with_flags(shared_gmock_test_ "${cxx_default}"
+    shared_gmock_main test/gmock-spec-builders_test.cc)
+  set_target_properties(shared_gmock_test_
+    PROPERTIES
+    COMPILE_DEFINITIONS "GTEST_LINKED_AS_SHARED_LIBRARY=1")
+
+  ############################################################
+  # Python tests.
+
+  cxx_executable(gmock_leak_test_ test gmock_main)
+  py_test(gmock_leak_test)
+
+  cxx_executable(gmock_output_test_ test gmock)
+  py_test(gmock_output_test)
+endif()
diff --git a/src/external/googletest/googlemock/CONTRIBUTORS b/src/external/googletest/googlemock/CONTRIBUTORS
new file mode 100644 (file)
index 0000000..6e9ae36
--- /dev/null
@@ -0,0 +1,40 @@
+# This file contains a list of people who've made non-trivial
+# contribution to the Google C++ Mocking Framework project.  People
+# who commit code to the project are encouraged to add their names
+# here.  Please keep the list sorted by first names.
+
+Benoit Sigoure <tsuna@google.com>
+Bogdan Piloca <boo@google.com>
+Chandler Carruth <chandlerc@google.com>
+Dave MacLachlan <dmaclach@gmail.com>
+David Anderson <danderson@google.com>
+Dean Sturtevant
+Gene Volovich <gv@cite.com>
+Hal Burch <gmock@hburch.com>
+Jeffrey Yasskin <jyasskin@google.com>
+Jim Keller <jimkeller@google.com>
+Joe Walnes <joe@truemesh.com>
+Jon Wray <jwray@google.com>
+Keir Mierle <mierle@gmail.com>
+Keith Ray <keith.ray@gmail.com>
+Kostya Serebryany <kcc@google.com>
+Lev Makhlis
+Manuel Klimek <klimek@google.com>
+Mario Tanev <radix@google.com>
+Mark Paskin
+Markus Heule <markus.heule@gmail.com>
+Matthew Simmons <simmonmt@acm.org>
+Mike Bland <mbland@google.com>
+Neal Norwitz <nnorwitz@gmail.com>
+Nermin Ozkiranartli <nermin@google.com>
+Owen Carlsen <ocarlsen@google.com>
+Paneendra Ba <paneendra@google.com>
+Paul Menage <menage@google.com>
+Piotr Kaminski <piotrk@google.com>
+Russ Rufer <russ@pentad.com>
+Sverre Sundsdal <sundsdal@gmail.com>
+Takeshi Yoshino <tyoshino@google.com>
+Vadim Berman <vadimb@google.com>
+Vlad Losev <vladl@google.com>
+Wolfgang Klier <wklier@google.com>
+Zhanyong Wan <wan@google.com>
diff --git a/src/external/googletest/googlemock/README.md b/src/external/googletest/googlemock/README.md
new file mode 100644 (file)
index 0000000..332beab
--- /dev/null
@@ -0,0 +1,333 @@
+## Google Mock ##
+
+The Google C++ mocking framework.
+
+### Overview ###
+
+Google's framework for writing and using C++ mock classes.
+It can help you derive better designs of your system and write better tests.
+
+It is inspired by:
+
+  * [jMock](http://www.jmock.org/),
+  * [EasyMock](http://www.easymock.org/), and
+  * [Hamcrest](http://code.google.com/p/hamcrest/),
+
+and designed with C++'s specifics in mind.
+
+Google mock:
+
+  * lets you create mock classes trivially using simple macros.
+  * supports a rich set of matchers and actions.
+  * handles unordered, partially ordered, or completely ordered expectations.
+  * is extensible by users.
+
+We hope you find it useful!
+
+### Features ###
+
+  * Provides a declarative syntax for defining mocks.
+  * Can easily define partial (hybrid) mocks, which are a cross of real
+    and mock objects.
+  * Handles functions of arbitrary types and overloaded functions.
+  * Comes with a rich set of matchers for validating function arguments.
+  * Uses an intuitive syntax for controlling the behavior of a mock.
+  * Does automatic verification of expectations (no record-and-replay needed).
+  * Allows arbitrary (partial) ordering constraints on
+    function calls to be expressed,.
+  * Lets a user extend it by defining new matchers and actions.
+  * Does not use exceptions.
+  * Is easy to learn and use.
+
+Please see the project page above for more information as well as the
+mailing list for questions, discussions, and development.  There is
+also an IRC channel on OFTC (irc.oftc.net) #gtest available.  Please
+join us!
+
+Please note that code under [scripts/generator](scripts/generator/) is
+from [cppclean](http://code.google.com/p/cppclean/) and released under
+the Apache License, which is different from Google Mock's license.
+
+## Getting Started ##
+
+If you are new to the project, we suggest that you read the user
+documentation in the following order:
+
+  * Learn the [basics](../googletest/docs/Primer.md) of
+    Google Test, if you choose to use Google Mock with it (recommended).
+  * Read [Google Mock for Dummies](docs/ForDummies.md).
+  * Read the instructions below on how to build Google Mock.
+
+You can also watch Zhanyong's [talk](http://www.youtube.com/watch?v=sYpCyLI47rM) on Google Mock's usage and implementation.
+
+Once you understand the basics, check out the rest of the docs:
+
+  * [CheatSheet](docs/CheatSheet.md) - all the commonly used stuff
+    at a glance.
+  * [CookBook](docs/CookBook.md) - recipes for getting things done,
+    including advanced techniques.
+
+If you need help, please check the
+[KnownIssues](docs/KnownIssues.md) and
+[FrequentlyAskedQuestions](docs/FrequentlyAskedQuestions.md) before
+posting a question on the
+[discussion group](http://groups.google.com/group/googlemock).
+
+
+### Using Google Mock Without Google Test ###
+
+Google Mock is not a testing framework itself.  Instead, it needs a
+testing framework for writing tests.  Google Mock works seamlessly
+with [Google Test](http://code.google.com/p/googletest/), but
+you can also use it with [any C++ testing framework](googlemock/ForDummies.md#Using_Google_Mock_with_Any_Testing_Framework).
+
+### Requirements for End Users ###
+
+Google Mock is implemented on top of [Google Test](
+http://github.com/google/googletest/), and depends on it.
+You must use the bundled version of Google Test when using Google Mock.
+
+You can also easily configure Google Mock to work with another testing
+framework, although it will still need Google Test.  Please read
+["Using_Google_Mock_with_Any_Testing_Framework"](
+    docs/ForDummies.md#Using_Google_Mock_with_Any_Testing_Framework)
+for instructions.
+
+Google Mock depends on advanced C++ features and thus requires a more
+modern compiler. The following are needed to use Google Mock:
+
+#### Linux Requirements ####
+
+  * GNU-compatible Make or "gmake"
+  * POSIX-standard shell
+  * POSIX(-2) Regular Expressions (regex.h)
+  * C++98-standard-compliant compiler (e.g. GCC 3.4 or newer)
+
+#### Windows Requirements ####
+
+  * Microsoft Visual C++ 8.0 SP1 or newer
+
+#### Mac OS X Requirements ####
+
+  * Mac OS X 10.4 Tiger or newer
+  * Developer Tools Installed
+
+### Requirements for Contributors ###
+
+We welcome patches. If you plan to contribute a patch, you need to
+build Google Mock and its tests, which has further requirements:
+
+  * Automake version 1.9 or newer
+  * Autoconf version 2.59 or newer
+  * Libtool / Libtoolize
+  * Python version 2.3 or newer (for running some of the tests and
+    re-generating certain source files from templates)
+
+### Building Google Mock ###
+
+#### Preparing to Build (Unix only) ####
+
+If you are using a Unix system and plan to use the GNU Autotools build
+system to build Google Mock (described below), you'll need to
+configure it now.
+
+To prepare the Autotools build system:
+
+    cd googlemock
+    autoreconf -fvi
+
+To build Google Mock and your tests that use it, you need to tell your
+build system where to find its headers and source files.  The exact
+way to do it depends on which build system you use, and is usually
+straightforward.
+
+This section shows how you can integrate Google Mock into your
+existing build system.
+
+Suppose you put Google Mock in directory `${GMOCK_DIR}` and Google Test
+in `${GTEST_DIR}` (the latter is `${GMOCK_DIR}/gtest` by default).  To
+build Google Mock, create a library build target (or a project as
+called by Visual Studio and Xcode) to compile
+
+    ${GTEST_DIR}/src/gtest-all.cc and ${GMOCK_DIR}/src/gmock-all.cc
+
+with
+
+    ${GTEST_DIR}/include and ${GMOCK_DIR}/include
+
+in the system header search path, and
+
+    ${GTEST_DIR} and ${GMOCK_DIR}
+
+in the normal header search path.  Assuming a Linux-like system and gcc,
+something like the following will do:
+
+    g++ -isystem ${GTEST_DIR}/include -I${GTEST_DIR} \
+        -isystem ${GMOCK_DIR}/include -I${GMOCK_DIR} \
+        -pthread -c ${GTEST_DIR}/src/gtest-all.cc
+    g++ -isystem ${GTEST_DIR}/include -I${GTEST_DIR} \
+        -isystem ${GMOCK_DIR}/include -I${GMOCK_DIR} \
+        -pthread -c ${GMOCK_DIR}/src/gmock-all.cc
+    ar -rv libgmock.a gtest-all.o gmock-all.o
+
+(We need -pthread as Google Test and Google Mock use threads.)
+
+Next, you should compile your test source file with
+${GTEST\_DIR}/include and ${GMOCK\_DIR}/include in the header search
+path, and link it with gmock and any other necessary libraries:
+
+    g++ -isystem ${GTEST_DIR}/include -isystem ${GMOCK_DIR}/include \
+        -pthread path/to/your_test.cc libgmock.a -o your_test
+
+As an example, the make/ directory contains a Makefile that you can
+use to build Google Mock on systems where GNU make is available
+(e.g. Linux, Mac OS X, and Cygwin).  It doesn't try to build Google
+Mock's own tests.  Instead, it just builds the Google Mock library and
+a sample test.  You can use it as a starting point for your own build
+script.
+
+If the default settings are correct for your environment, the
+following commands should succeed:
+
+    cd ${GMOCK_DIR}/make
+    make
+    ./gmock_test
+
+If you see errors, try to tweak the contents of
+[make/Makefile](make/Makefile) to make them go away.
+
+### Windows ###
+
+The msvc/2005 directory contains VC++ 2005 projects and the msvc/2010
+directory contains VC++ 2010 projects for building Google Mock and
+selected tests.
+
+Change to the appropriate directory and run "msbuild gmock.sln" to
+build the library and tests (or open the gmock.sln in the MSVC IDE).
+If you want to create your own project to use with Google Mock, you'll
+have to configure it to use the `gmock_config` propety sheet.  For that:
+
+ * Open the Property Manager window (View | Other Windows | Property Manager)
+ * Right-click on your project and select "Add Existing Property Sheet..."
+ * Navigate to `gmock_config.vsprops` or `gmock_config.props` and select it.
+ * In Project Properties | Configuration Properties | General | Additional
+   Include Directories, type <path to Google Mock>/include.
+
+### Tweaking Google Mock ###
+
+Google Mock can be used in diverse environments.  The default
+configuration may not work (or may not work well) out of the box in
+some environments.  However, you can easily tweak Google Mock by
+defining control macros on the compiler command line.  Generally,
+these macros are named like `GTEST_XYZ` and you define them to either 1
+or 0 to enable or disable a certain feature.
+
+We list the most frequently used macros below.  For a complete list,
+see file [${GTEST\_DIR}/include/gtest/internal/gtest-port.h](
+../googletest/include/gtest/internal/gtest-port.h).
+
+### Choosing a TR1 Tuple Library ###
+
+Google Mock uses the C++ Technical Report 1 (TR1) tuple library
+heavily.  Unfortunately TR1 tuple is not yet widely available with all
+compilers.  The good news is that Google Test 1.4.0+ implements a
+subset of TR1 tuple that's enough for Google Mock's need.  Google Mock
+will automatically use that implementation when the compiler doesn't
+provide TR1 tuple.
+
+Usually you don't need to care about which tuple library Google Test
+and Google Mock use.  However, if your project already uses TR1 tuple,
+you need to tell Google Test and Google Mock to use the same TR1 tuple
+library the rest of your project uses, or the two tuple
+implementations will clash.  To do that, add
+
+    -DGTEST_USE_OWN_TR1_TUPLE=0
+
+to the compiler flags while compiling Google Test, Google Mock, and
+your tests.  If you want to force Google Test and Google Mock to use
+their own tuple library, just add
+
+    -DGTEST_USE_OWN_TR1_TUPLE=1
+
+to the compiler flags instead.
+
+If you want to use Boost's TR1 tuple library with Google Mock, please
+refer to the Boost website (http://www.boost.org/) for how to obtain
+it and set it up.
+
+### As a Shared Library (DLL) ###
+
+Google Mock is compact, so most users can build and link it as a static
+library for the simplicity.  Google Mock can be used as a DLL, but the
+same DLL must contain Google Test as well.  See
+[Google Test's README][gtest_readme]
+for instructions on how to set up necessary compiler settings.
+
+### Tweaking Google Mock ###
+
+Most of Google Test's control macros apply to Google Mock as well.
+Please see [Google Test's README][gtest_readme] for how to tweak them.
+
+### Upgrading from an Earlier Version ###
+
+We strive to keep Google Mock releases backward compatible.
+Sometimes, though, we have to make some breaking changes for the
+users' long-term benefits.  This section describes what you'll need to
+do if you are upgrading from an earlier version of Google Mock.
+
+#### Upgrading from 1.1.0 or Earlier ####
+
+You may need to explicitly enable or disable Google Test's own TR1
+tuple library.  See the instructions in section "[Choosing a TR1 Tuple
+Library](../googletest/#choosing-a-tr1-tuple-library)".
+
+#### Upgrading from 1.4.0 or Earlier ####
+
+On platforms where the pthread library is available, Google Test and
+Google Mock use it in order to be thread-safe.  For this to work, you
+may need to tweak your compiler and/or linker flags.  Please see the
+"[Multi-threaded Tests](../googletest#multi-threaded-tests
+)" section in file Google Test's README for what you may need to do.
+
+If you have custom matchers defined using `MatcherInterface` or
+`MakePolymorphicMatcher()`, you'll need to update their definitions to
+use the new matcher API (
+[monomorphic](http://code.google.com/p/googlemock/wiki/CookBook#Writing_New_Monomorphic_Matchers),
+[polymorphic](http://code.google.com/p/googlemock/wiki/CookBook#Writing_New_Polymorphic_Matchers)).
+Matchers defined using `MATCHER()` or `MATCHER_P*()` aren't affected.
+
+### Developing Google Mock ###
+
+This section discusses how to make your own changes to Google Mock.
+
+#### Testing Google Mock Itself ####
+
+To make sure your changes work as intended and don't break existing
+functionality, you'll want to compile and run Google Test's own tests.
+For that you'll need Autotools.  First, make sure you have followed
+the instructions above to configure Google Mock.
+Then, create a build output directory and enter it.  Next,
+
+    ${GMOCK_DIR}/configure  # try --help for more info
+
+Once you have successfully configured Google Mock, the build steps are
+standard for GNU-style OSS packages.
+
+    make        # Standard makefile following GNU conventions
+    make check  # Builds and runs all tests - all should pass.
+
+Note that when building your project against Google Mock, you are building
+against Google Test as well.  There is no need to configure Google Test
+separately.
+
+#### Contributing a Patch ####
+
+We welcome patches.
+Please read the [Developer's Guide](docs/DevGuide.md)
+for how you can contribute. In particular, make sure you have signed
+the Contributor License Agreement, or we won't be able to accept the
+patch.
+
+Happy testing!
+
+[gtest_readme]: ../googletest/README.md "googletest"
diff --git a/src/external/googletest/googlemock/docs/CheatSheet.md b/src/external/googletest/googlemock/docs/CheatSheet.md
new file mode 100644 (file)
index 0000000..ef4451b
--- /dev/null
@@ -0,0 +1,562 @@
+
+
+# Defining a Mock Class #
+
+## Mocking a Normal Class ##
+
+Given
+```
+class Foo {
+  ...
+  virtual ~Foo();
+  virtual int GetSize() const = 0;
+  virtual string Describe(const char* name) = 0;
+  virtual string Describe(int type) = 0;
+  virtual bool Process(Bar elem, int count) = 0;
+};
+```
+(note that `~Foo()` **must** be virtual) we can define its mock as
+```
+#include "gmock/gmock.h"
+
+class MockFoo : public Foo {
+  MOCK_CONST_METHOD0(GetSize, int());
+  MOCK_METHOD1(Describe, string(const char* name));
+  MOCK_METHOD1(Describe, string(int type));
+  MOCK_METHOD2(Process, bool(Bar elem, int count));
+};
+```
+
+To create a "nice" mock object which ignores all uninteresting calls,
+or a "strict" mock object, which treats them as failures:
+```
+NiceMock<MockFoo> nice_foo;     // The type is a subclass of MockFoo.
+StrictMock<MockFoo> strict_foo; // The type is a subclass of MockFoo.
+```
+
+## Mocking a Class Template ##
+
+To mock
+```
+template <typename Elem>
+class StackInterface {
+ public:
+  ...
+  virtual ~StackInterface();
+  virtual int GetSize() const = 0;
+  virtual void Push(const Elem& x) = 0;
+};
+```
+(note that `~StackInterface()` **must** be virtual) just append `_T` to the `MOCK_*` macros:
+```
+template <typename Elem>
+class MockStack : public StackInterface<Elem> {
+ public:
+  ...
+  MOCK_CONST_METHOD0_T(GetSize, int());
+  MOCK_METHOD1_T(Push, void(const Elem& x));
+};
+```
+
+## Specifying Calling Conventions for Mock Functions ##
+
+If your mock function doesn't use the default calling convention, you
+can specify it by appending `_WITH_CALLTYPE` to any of the macros
+described in the previous two sections and supplying the calling
+convention as the first argument to the macro. For example,
+```
+  MOCK_METHOD_1_WITH_CALLTYPE(STDMETHODCALLTYPE, Foo, bool(int n));
+  MOCK_CONST_METHOD2_WITH_CALLTYPE(STDMETHODCALLTYPE, Bar, int(double x, double y));
+```
+where `STDMETHODCALLTYPE` is defined by `<objbase.h>` on Windows.
+
+# Using Mocks in Tests #
+
+The typical flow is:
+  1. Import the Google Mock names you need to use. All Google Mock names are in the `testing` namespace unless they are macros or otherwise noted.
+  1. Create the mock objects.
+  1. Optionally, set the default actions of the mock objects.
+  1. Set your expectations on the mock objects (How will they be called? What wil they do?).
+  1. Exercise code that uses the mock objects; if necessary, check the result using [Google Test](../../googletest/) assertions.
+  1. When a mock objects is destructed, Google Mock automatically verifies that all expectations on it have been satisfied.
+
+Here is an example:
+```
+using ::testing::Return;                            // #1
+
+TEST(BarTest, DoesThis) {
+  MockFoo foo;                                    // #2
+
+  ON_CALL(foo, GetSize())                         // #3
+      .WillByDefault(Return(1));
+  // ... other default actions ...
+
+  EXPECT_CALL(foo, Describe(5))                   // #4
+      .Times(3)
+      .WillRepeatedly(Return("Category 5"));
+  // ... other expectations ...
+
+  EXPECT_EQ("good", MyProductionFunction(&foo));  // #5
+}                                                 // #6
+```
+
+# Setting Default Actions #
+
+Google Mock has a **built-in default action** for any function that
+returns `void`, `bool`, a numeric value, or a pointer.
+
+To customize the default action for functions with return type `T` globally:
+```
+using ::testing::DefaultValue;
+
+// Sets the default value to be returned. T must be CopyConstructible.
+DefaultValue<T>::Set(value);
+// Sets a factory. Will be invoked on demand. T must be MoveConstructible.
+//   T MakeT();
+DefaultValue<T>::SetFactory(&MakeT);
+// ... use the mocks ...
+// Resets the default value.
+DefaultValue<T>::Clear();
+```
+
+To customize the default action for a particular method, use `ON_CALL()`:
+```
+ON_CALL(mock_object, method(matchers))
+    .With(multi_argument_matcher)  ?
+    .WillByDefault(action);
+```
+
+# Setting Expectations #
+
+`EXPECT_CALL()` sets **expectations** on a mock method (How will it be
+called? What will it do?):
+```
+EXPECT_CALL(mock_object, method(matchers))
+    .With(multi_argument_matcher)  ?
+    .Times(cardinality)            ?
+    .InSequence(sequences)         *
+    .After(expectations)           *
+    .WillOnce(action)              *
+    .WillRepeatedly(action)        ?
+    .RetiresOnSaturation();        ?
+```
+
+If `Times()` is omitted, the cardinality is assumed to be:
+
+  * `Times(1)` when there is neither `WillOnce()` nor `WillRepeatedly()`;
+  * `Times(n)` when there are `n WillOnce()`s but no `WillRepeatedly()`, where `n` >= 1; or
+  * `Times(AtLeast(n))` when there are `n WillOnce()`s and a `WillRepeatedly()`, where `n` >= 0.
+
+A method with no `EXPECT_CALL()` is free to be invoked _any number of times_, and the default action will be taken each time.
+
+# Matchers #
+
+A **matcher** matches a _single_ argument.  You can use it inside
+`ON_CALL()` or `EXPECT_CALL()`, or use it to validate a value
+directly:
+
+| `EXPECT_THAT(value, matcher)` | Asserts that `value` matches `matcher`. |
+|:------------------------------|:----------------------------------------|
+| `ASSERT_THAT(value, matcher)` | The same as `EXPECT_THAT(value, matcher)`, except that it generates a **fatal** failure. |
+
+Built-in matchers (where `argument` is the function argument) are
+divided into several categories:
+
+## Wildcard ##
+|`_`|`argument` can be any value of the correct type.|
+|:--|:-----------------------------------------------|
+|`A<type>()` or `An<type>()`|`argument` can be any value of type `type`.     |
+
+## Generic Comparison ##
+
+|`Eq(value)` or `value`|`argument == value`|
+|:---------------------|:------------------|
+|`Ge(value)`           |`argument >= value`|
+|`Gt(value)`           |`argument > value` |
+|`Le(value)`           |`argument <= value`|
+|`Lt(value)`           |`argument < value` |
+|`Ne(value)`           |`argument != value`|
+|`IsNull()`            |`argument` is a `NULL` pointer (raw or smart).|
+|`NotNull()`           |`argument` is a non-null pointer (raw or smart).|
+|`Ref(variable)`       |`argument` is a reference to `variable`.|
+|`TypedEq<type>(value)`|`argument` has type `type` and is equal to `value`. You may need to use this instead of `Eq(value)` when the mock function is overloaded.|
+
+Except `Ref()`, these matchers make a _copy_ of `value` in case it's
+modified or destructed later. If the compiler complains that `value`
+doesn't have a public copy constructor, try wrap it in `ByRef()`,
+e.g. `Eq(ByRef(non_copyable_value))`. If you do that, make sure
+`non_copyable_value` is not changed afterwards, or the meaning of your
+matcher will be changed.
+
+## Floating-Point Matchers ##
+
+|`DoubleEq(a_double)`|`argument` is a `double` value approximately equal to `a_double`, treating two NaNs as unequal.|
+|:-------------------|:----------------------------------------------------------------------------------------------|
+|`FloatEq(a_float)`  |`argument` is a `float` value approximately equal to `a_float`, treating two NaNs as unequal.  |
+|`NanSensitiveDoubleEq(a_double)`|`argument` is a `double` value approximately equal to `a_double`, treating two NaNs as equal.  |
+|`NanSensitiveFloatEq(a_float)`|`argument` is a `float` value approximately equal to `a_float`, treating two NaNs as equal.    |
+
+The above matchers use ULP-based comparison (the same as used in
+[Google Test](../../googletest/)). They
+automatically pick a reasonable error bound based on the absolute
+value of the expected value.  `DoubleEq()` and `FloatEq()` conform to
+the IEEE standard, which requires comparing two NaNs for equality to
+return false. The `NanSensitive*` version instead treats two NaNs as
+equal, which is often what a user wants.
+
+|`DoubleNear(a_double, max_abs_error)`|`argument` is a `double` value close to `a_double` (absolute error <= `max_abs_error`), treating two NaNs as unequal.|
+|:------------------------------------|:--------------------------------------------------------------------------------------------------------------------|
+|`FloatNear(a_float, max_abs_error)`  |`argument` is a `float` value close to `a_float` (absolute error <= `max_abs_error`), treating two NaNs as unequal.  |
+|`NanSensitiveDoubleNear(a_double, max_abs_error)`|`argument` is a `double` value close to `a_double` (absolute error <= `max_abs_error`), treating two NaNs as equal.  |
+|`NanSensitiveFloatNear(a_float, max_abs_error)`|`argument` is a `float` value close to `a_float` (absolute error <= `max_abs_error`), treating two NaNs as equal.    |
+
+## String Matchers ##
+
+The `argument` can be either a C string or a C++ string object:
+
+|`ContainsRegex(string)`|`argument` matches the given regular expression.|
+|:----------------------|:-----------------------------------------------|
+|`EndsWith(suffix)`     |`argument` ends with string `suffix`.           |
+|`HasSubstr(string)`    |`argument` contains `string` as a sub-string.   |
+|`MatchesRegex(string)` |`argument` matches the given regular expression with the match starting at the first character and ending at the last character.|
+|`StartsWith(prefix)`   |`argument` starts with string `prefix`.         |
+|`StrCaseEq(string)`    |`argument` is equal to `string`, ignoring case. |
+|`StrCaseNe(string)`    |`argument` is not equal to `string`, ignoring case.|
+|`StrEq(string)`        |`argument` is equal to `string`.                |
+|`StrNe(string)`        |`argument` is not equal to `string`.            |
+
+`ContainsRegex()` and `MatchesRegex()` use the regular expression
+syntax defined
+[here](../../googletest/docs/AdvancedGuide.md#regular-expression-syntax).
+`StrCaseEq()`, `StrCaseNe()`, `StrEq()`, and `StrNe()` work for wide
+strings as well.
+
+## Container Matchers ##
+
+Most STL-style containers support `==`, so you can use
+`Eq(expected_container)` or simply `expected_container` to match a
+container exactly.   If you want to write the elements in-line,
+match them more flexibly, or get more informative messages, you can use:
+
+| `ContainerEq(container)` | The same as `Eq(container)` except that the failure message also includes which elements are in one container but not the other. |
+|:-------------------------|:---------------------------------------------------------------------------------------------------------------------------------|
+| `Contains(e)`            | `argument` contains an element that matches `e`, which can be either a value or a matcher.                                       |
+| `Each(e)`                | `argument` is a container where _every_ element matches `e`, which can be either a value or a matcher.                           |
+| `ElementsAre(e0, e1, ..., en)` | `argument` has `n + 1` elements, where the i-th element matches `ei`, which can be a value or a matcher. 0 to 10 arguments are allowed. |
+| `ElementsAreArray({ e0, e1, ..., en })`, `ElementsAreArray(array)`, or `ElementsAreArray(array, count)` | The same as `ElementsAre()` except that the expected element values/matchers come from an initializer list, STL-style container, or C-style array. |
+| `IsEmpty()`              | `argument` is an empty container (`container.empty()`).                                                                          |
+| `Pointwise(m, container)` | `argument` contains the same number of elements as in `container`, and for all i, (the i-th element in `argument`, the i-th element in `container`) match `m`, which is a matcher on 2-tuples. E.g. `Pointwise(Le(), upper_bounds)` verifies that each element in `argument` doesn't exceed the corresponding element in `upper_bounds`. See more detail below. |
+| `SizeIs(m)`              | `argument` is a container whose size matches `m`. E.g. `SizeIs(2)` or `SizeIs(Lt(2))`.                                           |
+| `UnorderedElementsAre(e0, e1, ..., en)` | `argument` has `n + 1` elements, and under some permutation each element matches an `ei` (for a different `i`), which can be a value or a matcher. 0 to 10 arguments are allowed. |
+| `UnorderedElementsAreArray({ e0, e1, ..., en })`, `UnorderedElementsAreArray(array)`, or `UnorderedElementsAreArray(array, count)` | The same as `UnorderedElementsAre()` except that the expected element values/matchers come from an initializer list, STL-style container, or C-style array. |
+| `WhenSorted(m)`          | When `argument` is sorted using the `<` operator, it matches container matcher `m`. E.g. `WhenSorted(UnorderedElementsAre(1, 2, 3))` verifies that `argument` contains elements `1`, `2`, and `3`, ignoring order. |
+| `WhenSortedBy(comparator, m)` | The same as `WhenSorted(m)`, except that the given comparator instead of `<` is used to sort `argument`. E.g. `WhenSortedBy(std::greater<int>(), ElementsAre(3, 2, 1))`. |
+
+Notes:
+
+  * These matchers can also match:
+    1. a native array passed by reference (e.g. in `Foo(const int (&a)[5])`), and
+    1. an array passed as a pointer and a count (e.g. in `Bar(const T* buffer, int len)` -- see [Multi-argument Matchers](#Multiargument_Matchers.md)).
+  * The array being matched may be multi-dimensional (i.e. its elements can be arrays).
+  * `m` in `Pointwise(m, ...)` should be a matcher for `::testing::tuple<T, U>` where `T` and `U` are the element type of the actual container and the expected container, respectively. For example, to compare two `Foo` containers where `Foo` doesn't support `operator==` but has an `Equals()` method, one might write:
+
+```
+using ::testing::get;
+MATCHER(FooEq, "") {
+  return get<0>(arg).Equals(get<1>(arg));
+}
+...
+EXPECT_THAT(actual_foos, Pointwise(FooEq(), expected_foos));
+```
+
+## Member Matchers ##
+
+|`Field(&class::field, m)`|`argument.field` (or `argument->field` when `argument` is a plain pointer) matches matcher `m`, where `argument` is an object of type _class_.|
+|:------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------|
+|`Key(e)`                 |`argument.first` matches `e`, which can be either a value or a matcher. E.g. `Contains(Key(Le(5)))` can verify that a `map` contains a key `<= 5`.|
+|`Pair(m1, m2)`           |`argument` is an `std::pair` whose `first` field matches `m1` and `second` field matches `m2`.                                                |
+|`Property(&class::property, m)`|`argument.property()` (or `argument->property()` when `argument` is a plain pointer) matches matcher `m`, where `argument` is an object of type _class_.|
+
+## Matching the Result of a Function or Functor ##
+
+|`ResultOf(f, m)`|`f(argument)` matches matcher `m`, where `f` is a function or functor.|
+|:---------------|:---------------------------------------------------------------------|
+
+## Pointer Matchers ##
+
+|`Pointee(m)`|`argument` (either a smart pointer or a raw pointer) points to a value that matches matcher `m`.|
+|:-----------|:-----------------------------------------------------------------------------------------------|
+|`WhenDynamicCastTo<T>(m)`| when `argument` is passed through `dynamic_cast<T>()`, it matches matcher `m`.                 |
+
+## Multiargument Matchers ##
+
+Technically, all matchers match a _single_ value. A "multi-argument"
+matcher is just one that matches a _tuple_. The following matchers can
+be used to match a tuple `(x, y)`:
+
+|`Eq()`|`x == y`|
+|:-----|:-------|
+|`Ge()`|`x >= y`|
+|`Gt()`|`x > y` |
+|`Le()`|`x <= y`|
+|`Lt()`|`x < y` |
+|`Ne()`|`x != y`|
+
+You can use the following selectors to pick a subset of the arguments
+(or reorder them) to participate in the matching:
+
+|`AllArgs(m)`|Equivalent to `m`. Useful as syntactic sugar in `.With(AllArgs(m))`.|
+|:-----------|:-------------------------------------------------------------------|
+|`Args<N1, N2, ..., Nk>(m)`|The tuple of the `k` selected (using 0-based indices) arguments matches `m`, e.g. `Args<1, 2>(Eq())`.|
+
+## Composite Matchers ##
+
+You can make a matcher from one or more other matchers:
+
+|`AllOf(m1, m2, ..., mn)`|`argument` matches all of the matchers `m1` to `mn`.|
+|:-----------------------|:---------------------------------------------------|
+|`AnyOf(m1, m2, ..., mn)`|`argument` matches at least one of the matchers `m1` to `mn`.|
+|`Not(m)`                |`argument` doesn't match matcher `m`.               |
+
+## Adapters for Matchers ##
+
+|`MatcherCast<T>(m)`|casts matcher `m` to type `Matcher<T>`.|
+|:------------------|:--------------------------------------|
+|`SafeMatcherCast<T>(m)`| [safely casts](CookBook.md#casting-matchers) matcher `m` to type `Matcher<T>`. |
+|`Truly(predicate)` |`predicate(argument)` returns something considered by C++ to be true, where `predicate` is a function or functor.|
+
+## Matchers as Predicates ##
+
+|`Matches(m)(value)`|evaluates to `true` if `value` matches `m`. You can use `Matches(m)` alone as a unary functor.|
+|:------------------|:---------------------------------------------------------------------------------------------|
+|`ExplainMatchResult(m, value, result_listener)`|evaluates to `true` if `value` matches `m`, explaining the result to `result_listener`.       |
+|`Value(value, m)`  |evaluates to `true` if `value` matches `m`.                                                   |
+
+## Defining Matchers ##
+
+| `MATCHER(IsEven, "") { return (arg % 2) == 0; }` | Defines a matcher `IsEven()` to match an even number. |
+|:-------------------------------------------------|:------------------------------------------------------|
+| `MATCHER_P(IsDivisibleBy, n, "") { *result_listener << "where the remainder is " << (arg % n); return (arg % n) == 0; }` | Defines a macher `IsDivisibleBy(n)` to match a number divisible by `n`. |
+| `MATCHER_P2(IsBetween, a, b, std::string(negation ? "isn't" : "is") + " between " + PrintToString(a) + " and " + PrintToString(b)) { return a <= arg && arg <= b; }` | Defines a matcher `IsBetween(a, b)` to match a value in the range [`a`, `b`]. |
+
+**Notes:**
+
+  1. The `MATCHER*` macros cannot be used inside a function or class.
+  1. The matcher body must be _purely functional_ (i.e. it cannot have any side effect, and the result must not depend on anything other than the value being matched and the matcher parameters).
+  1. You can use `PrintToString(x)` to convert a value `x` of any type to a string.
+
+## Matchers as Test Assertions ##
+
+|`ASSERT_THAT(expression, m)`|Generates a [fatal failure](../../googletest/docs/Primer.md#assertions) if the value of `expression` doesn't match matcher `m`.|
+|:---------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------|
+|`EXPECT_THAT(expression, m)`|Generates a non-fatal failure if the value of `expression` doesn't match matcher `m`.                                                          |
+
+# Actions #
+
+**Actions** specify what a mock function should do when invoked.
+
+## Returning a Value ##
+
+|`Return()`|Return from a `void` mock function.|
+|:---------|:----------------------------------|
+|`Return(value)`|Return `value`. If the type of `value` is different to the mock function's return type, `value` is converted to the latter type <i>at the time the expectation is set</i>, not when the action is executed.|
+|`ReturnArg<N>()`|Return the `N`-th (0-based) argument.|
+|`ReturnNew<T>(a1, ..., ak)`|Return `new T(a1, ..., ak)`; a different object is created each time.|
+|`ReturnNull()`|Return a null pointer.             |
+|`ReturnPointee(ptr)`|Return the value pointed to by `ptr`.|
+|`ReturnRef(variable)`|Return a reference to `variable`.  |
+|`ReturnRefOfCopy(value)`|Return a reference to a copy of `value`; the copy lives as long as the action.|
+
+## Side Effects ##
+
+|`Assign(&variable, value)`|Assign `value` to variable.|
+|:-------------------------|:--------------------------|
+| `DeleteArg<N>()`         | Delete the `N`-th (0-based) argument, which must be a pointer. |
+| `SaveArg<N>(pointer)`    | Save the `N`-th (0-based) argument to `*pointer`. |
+| `SaveArgPointee<N>(pointer)` | Save the value pointed to by the `N`-th (0-based) argument to `*pointer`. |
+| `SetArgReferee<N>(value)` |  Assign value to the variable referenced by the `N`-th (0-based) argument. |
+|`SetArgPointee<N>(value)` |Assign `value` to the variable pointed by the `N`-th (0-based) argument.|
+|`SetArgumentPointee<N>(value)`|Same as `SetArgPointee<N>(value)`. Deprecated. Will be removed in v1.7.0.|
+|`SetArrayArgument<N>(first, last)`|Copies the elements in source range [`first`, `last`) to the array pointed to by the `N`-th (0-based) argument, which can be either a pointer or an iterator. The action does not take ownership of the elements in the source range.|
+|`SetErrnoAndReturn(error, value)`|Set `errno` to `error` and return `value`.|
+|`Throw(exception)`        |Throws the given exception, which can be any copyable value. Available since v1.1.0.|
+
+## Using a Function or a Functor as an Action ##
+
+|`Invoke(f)`|Invoke `f` with the arguments passed to the mock function, where `f` can be a global/static function or a functor.|
+|:----------|:-----------------------------------------------------------------------------------------------------------------|
+|`Invoke(object_pointer, &class::method)`|Invoke the {method on the object with the arguments passed to the mock function.                                  |
+|`InvokeWithoutArgs(f)`|Invoke `f`, which can be a global/static function or a functor. `f` must take no arguments.                       |
+|`InvokeWithoutArgs(object_pointer, &class::method)`|Invoke the method on the object, which takes no arguments.                                                        |
+|`InvokeArgument<N>(arg1, arg2, ..., argk)`|Invoke the mock function's `N`-th (0-based) argument, which must be a function or a functor, with the `k` arguments.|
+
+The return value of the invoked function is used as the return value
+of the action.
+
+When defining a function or functor to be used with `Invoke*()`, you can declare any unused parameters as `Unused`:
+```
+  double Distance(Unused, double x, double y) { return sqrt(x*x + y*y); }
+  ...
+  EXPECT_CALL(mock, Foo("Hi", _, _)).WillOnce(Invoke(Distance));
+```
+
+In `InvokeArgument<N>(...)`, if an argument needs to be passed by reference, wrap it inside `ByRef()`. For example,
+```
+  InvokeArgument<2>(5, string("Hi"), ByRef(foo))
+```
+calls the mock function's #2 argument, passing to it `5` and `string("Hi")` by value, and `foo` by reference.
+
+## Default Action ##
+
+|`DoDefault()`|Do the default action (specified by `ON_CALL()` or the built-in one).|
+|:------------|:--------------------------------------------------------------------|
+
+**Note:** due to technical reasons, `DoDefault()` cannot be used inside  a composite action - trying to do so will result in a run-time error.
+
+## Composite Actions ##
+
+|`DoAll(a1, a2, ..., an)`|Do all actions `a1` to `an` and return the result of `an` in each invocation. The first `n - 1` sub-actions must return void. |
+|:-----------------------|:-----------------------------------------------------------------------------------------------------------------------------|
+|`IgnoreResult(a)`       |Perform action `a` and ignore its result. `a` must not return void.                                                           |
+|`WithArg<N>(a)`         |Pass the `N`-th (0-based) argument of the mock function to action `a` and perform it.                                         |
+|`WithArgs<N1, N2, ..., Nk>(a)`|Pass the selected (0-based) arguments of the mock function to action `a` and perform it.                                      |
+|`WithoutArgs(a)`        |Perform action `a` without any arguments.                                                                                     |
+
+## Defining Actions ##
+
+| `ACTION(Sum) { return arg0 + arg1; }` | Defines an action `Sum()` to return the sum of the mock function's argument #0 and #1. |
+|:--------------------------------------|:---------------------------------------------------------------------------------------|
+| `ACTION_P(Plus, n) { return arg0 + n; }` | Defines an action `Plus(n)` to return the sum of the mock function's argument #0 and `n`. |
+| `ACTION_Pk(Foo, p1, ..., pk) { statements; }` | Defines a parameterized action `Foo(p1, ..., pk)` to execute the given `statements`.   |
+
+The `ACTION*` macros cannot be used inside a function or class.
+
+# Cardinalities #
+
+These are used in `Times()` to specify how many times a mock function will be called:
+
+|`AnyNumber()`|The function can be called any number of times.|
+|:------------|:----------------------------------------------|
+|`AtLeast(n)` |The call is expected at least `n` times.       |
+|`AtMost(n)`  |The call is expected at most `n` times.        |
+|`Between(m, n)`|The call is expected between `m` and `n` (inclusive) times.|
+|`Exactly(n) or n`|The call is expected exactly `n` times. In particular, the call should never happen when `n` is 0.|
+
+# Expectation Order #
+
+By default, the expectations can be matched in _any_ order.  If some
+or all expectations must be matched in a given order, there are two
+ways to specify it.  They can be used either independently or
+together.
+
+## The After Clause ##
+
+```
+using ::testing::Expectation;
+...
+Expectation init_x = EXPECT_CALL(foo, InitX());
+Expectation init_y = EXPECT_CALL(foo, InitY());
+EXPECT_CALL(foo, Bar())
+    .After(init_x, init_y);
+```
+says that `Bar()` can be called only after both `InitX()` and
+`InitY()` have been called.
+
+If you don't know how many pre-requisites an expectation has when you
+write it, you can use an `ExpectationSet` to collect them:
+
+```
+using ::testing::ExpectationSet;
+...
+ExpectationSet all_inits;
+for (int i = 0; i < element_count; i++) {
+  all_inits += EXPECT_CALL(foo, InitElement(i));
+}
+EXPECT_CALL(foo, Bar())
+    .After(all_inits);
+```
+says that `Bar()` can be called only after all elements have been
+initialized (but we don't care about which elements get initialized
+before the others).
+
+Modifying an `ExpectationSet` after using it in an `.After()` doesn't
+affect the meaning of the `.After()`.
+
+## Sequences ##
+
+When you have a long chain of sequential expectations, it's easier to
+specify the order using **sequences**, which don't require you to given
+each expectation in the chain a different name.  <i>All expected<br>
+calls</i> in the same sequence must occur in the order they are
+specified.
+
+```
+using ::testing::Sequence;
+Sequence s1, s2;
+...
+EXPECT_CALL(foo, Reset())
+    .InSequence(s1, s2)
+    .WillOnce(Return(true));
+EXPECT_CALL(foo, GetSize())
+    .InSequence(s1)
+    .WillOnce(Return(1));
+EXPECT_CALL(foo, Describe(A<const char*>()))
+    .InSequence(s2)
+    .WillOnce(Return("dummy"));
+```
+says that `Reset()` must be called before _both_ `GetSize()` _and_
+`Describe()`, and the latter two can occur in any order.
+
+To put many expectations in a sequence conveniently:
+```
+using ::testing::InSequence;
+{
+  InSequence dummy;
+
+  EXPECT_CALL(...)...;
+  EXPECT_CALL(...)...;
+  ...
+  EXPECT_CALL(...)...;
+}
+```
+says that all expected calls in the scope of `dummy` must occur in
+strict order. The name `dummy` is irrelevant.)
+
+# Verifying and Resetting a Mock #
+
+Google Mock will verify the expectations on a mock object when it is destructed, or you can do it earlier:
+```
+using ::testing::Mock;
+...
+// Verifies and removes the expectations on mock_obj;
+// returns true iff successful.
+Mock::VerifyAndClearExpectations(&mock_obj);
+...
+// Verifies and removes the expectations on mock_obj;
+// also removes the default actions set by ON_CALL();
+// returns true iff successful.
+Mock::VerifyAndClear(&mock_obj);
+```
+
+You can also tell Google Mock that a mock object can be leaked and doesn't
+need to be verified:
+```
+Mock::AllowLeak(&mock_obj);
+```
+
+# Mock Classes #
+
+Google Mock defines a convenient mock class template
+```
+class MockFunction<R(A1, ..., An)> {
+ public:
+  MOCK_METHODn(Call, R(A1, ..., An));
+};
+```
+See this [recipe](CookBook.md#using-check-points) for one application of it.
+
+# Flags #
+
+| `--gmock_catch_leaked_mocks=0` | Don't report leaked mock objects as failures. |
+|:-------------------------------|:----------------------------------------------|
+| `--gmock_verbose=LEVEL`        | Sets the default verbosity level (`info`, `warning`, or `error`) of Google Mock messages. |
diff --git a/src/external/googletest/googlemock/docs/CookBook.md b/src/external/googletest/googlemock/docs/CookBook.md
new file mode 100644 (file)
index 0000000..c52f100
--- /dev/null
@@ -0,0 +1,3675 @@
+
+
+You can find recipes for using Google Mock here. If you haven't yet,
+please read the [ForDummies](ForDummies.md) document first to make sure you understand
+the basics.
+
+**Note:** Google Mock lives in the `testing` name space. For
+readability, it is recommended to write `using ::testing::Foo;` once in
+your file before using the name `Foo` defined by Google Mock. We omit
+such `using` statements in this page for brevity, but you should do it
+in your own code.
+
+# Creating Mock Classes #
+
+## Mocking Private or Protected Methods ##
+
+You must always put a mock method definition (`MOCK_METHOD*`) in a
+`public:` section of the mock class, regardless of the method being
+mocked being `public`, `protected`, or `private` in the base class.
+This allows `ON_CALL` and `EXPECT_CALL` to reference the mock function
+from outside of the mock class.  (Yes, C++ allows a subclass to change
+the access level of a virtual function in the base class.)  Example:
+
+```
+class Foo {
+ public:
+  ...
+  virtual bool Transform(Gadget* g) = 0;
+
+ protected:
+  virtual void Resume();
+
+ private:
+  virtual int GetTimeOut();
+};
+
+class MockFoo : public Foo {
+ public:
+  ...
+  MOCK_METHOD1(Transform, bool(Gadget* g));
+
+  // The following must be in the public section, even though the
+  // methods are protected or private in the base class.
+  MOCK_METHOD0(Resume, void());
+  MOCK_METHOD0(GetTimeOut, int());
+};
+```
+
+## Mocking Overloaded Methods ##
+
+You can mock overloaded functions as usual. No special attention is required:
+
+```
+class Foo {
+  ...
+
+  // Must be virtual as we'll inherit from Foo.
+  virtual ~Foo();
+
+  // Overloaded on the types and/or numbers of arguments.
+  virtual int Add(Element x);
+  virtual int Add(int times, Element x);
+
+  // Overloaded on the const-ness of this object.
+  virtual Bar& GetBar();
+  virtual const Bar& GetBar() const;
+};
+
+class MockFoo : public Foo {
+  ...
+  MOCK_METHOD1(Add, int(Element x));
+  MOCK_METHOD2(Add, int(int times, Element x);
+
+  MOCK_METHOD0(GetBar, Bar&());
+  MOCK_CONST_METHOD0(GetBar, const Bar&());
+};
+```
+
+**Note:** if you don't mock all versions of the overloaded method, the
+compiler will give you a warning about some methods in the base class
+being hidden. To fix that, use `using` to bring them in scope:
+
+```
+class MockFoo : public Foo {
+  ...
+  using Foo::Add;
+  MOCK_METHOD1(Add, int(Element x));
+  // We don't want to mock int Add(int times, Element x);
+  ...
+};
+```
+
+## Mocking Class Templates ##
+
+To mock a class template, append `_T` to the `MOCK_*` macros:
+
+```
+template <typename Elem>
+class StackInterface {
+  ...
+  // Must be virtual as we'll inherit from StackInterface.
+  virtual ~StackInterface();
+
+  virtual int GetSize() const = 0;
+  virtual void Push(const Elem& x) = 0;
+};
+
+template <typename Elem>
+class MockStack : public StackInterface<Elem> {
+  ...
+  MOCK_CONST_METHOD0_T(GetSize, int());
+  MOCK_METHOD1_T(Push, void(const Elem& x));
+};
+```
+
+## Mocking Nonvirtual Methods ##
+
+Google Mock can mock non-virtual functions to be used in what we call _hi-perf
+dependency injection_.
+
+In this case, instead of sharing a common base class with the real
+class, your mock class will be _unrelated_ to the real class, but
+contain methods with the same signatures.  The syntax for mocking
+non-virtual methods is the _same_ as mocking virtual methods:
+
+```
+// A simple packet stream class.  None of its members is virtual.
+class ConcretePacketStream {
+ public:
+  void AppendPacket(Packet* new_packet);
+  const Packet* GetPacket(size_t packet_number) const;
+  size_t NumberOfPackets() const;
+  ...
+};
+
+// A mock packet stream class.  It inherits from no other, but defines
+// GetPacket() and NumberOfPackets().
+class MockPacketStream {
+ public:
+  MOCK_CONST_METHOD1(GetPacket, const Packet*(size_t packet_number));
+  MOCK_CONST_METHOD0(NumberOfPackets, size_t());
+  ...
+};
+```
+
+Note that the mock class doesn't define `AppendPacket()`, unlike the
+real class. That's fine as long as the test doesn't need to call it.
+
+Next, you need a way to say that you want to use
+`ConcretePacketStream` in production code, and use `MockPacketStream`
+in tests.  Since the functions are not virtual and the two classes are
+unrelated, you must specify your choice at _compile time_ (as opposed
+to run time).
+
+One way to do it is to templatize your code that needs to use a packet
+stream.  More specifically, you will give your code a template type
+argument for the type of the packet stream.  In production, you will
+instantiate your template with `ConcretePacketStream` as the type
+argument.  In tests, you will instantiate the same template with
+`MockPacketStream`.  For example, you may write:
+
+```
+template <class PacketStream>
+void CreateConnection(PacketStream* stream) { ... }
+
+template <class PacketStream>
+class PacketReader {
+ public:
+  void ReadPackets(PacketStream* stream, size_t packet_num);
+};
+```
+
+Then you can use `CreateConnection<ConcretePacketStream>()` and
+`PacketReader<ConcretePacketStream>` in production code, and use
+`CreateConnection<MockPacketStream>()` and
+`PacketReader<MockPacketStream>` in tests.
+
+```
+  MockPacketStream mock_stream;
+  EXPECT_CALL(mock_stream, ...)...;
+  .. set more expectations on mock_stream ...
+  PacketReader<MockPacketStream> reader(&mock_stream);
+  ... exercise reader ...
+```
+
+## Mocking Free Functions ##
+
+It's possible to use Google Mock to mock a free function (i.e. a
+C-style function or a static method).  You just need to rewrite your
+code to use an interface (abstract class).
+
+Instead of calling a free function (say, `OpenFile`) directly,
+introduce an interface for it and have a concrete subclass that calls
+the free function:
+
+```
+class FileInterface {
+ public:
+  ...
+  virtual bool Open(const char* path, const char* mode) = 0;
+};
+
+class File : public FileInterface {
+ public:
+  ...
+  virtual bool Open(const char* path, const char* mode) {
+    return OpenFile(path, mode);
+  }
+};
+```
+
+Your code should talk to `FileInterface` to open a file.  Now it's
+easy to mock out the function.
+
+This may seem much hassle, but in practice you often have multiple
+related functions that you can put in the same interface, so the
+per-function syntactic overhead will be much lower.
+
+If you are concerned about the performance overhead incurred by
+virtual functions, and profiling confirms your concern, you can
+combine this with the recipe for [mocking non-virtual methods](#Mocking_Nonvirtual_Methods.md).
+
+## The Nice, the Strict, and the Naggy ##
+
+If a mock method has no `EXPECT_CALL` spec but is called, Google Mock
+will print a warning about the "uninteresting call". The rationale is:
+
+  * New methods may be added to an interface after a test is written. We shouldn't fail a test just because a method it doesn't know about is called.
+  * However, this may also mean there's a bug in the test, so Google Mock shouldn't be silent either. If the user believes these calls are harmless, he can add an `EXPECT_CALL()` to suppress the warning.
+
+However, sometimes you may want to suppress all "uninteresting call"
+warnings, while sometimes you may want the opposite, i.e. to treat all
+of them as errors. Google Mock lets you make the decision on a
+per-mock-object basis.
+
+Suppose your test uses a mock class `MockFoo`:
+
+```
+TEST(...) {
+  MockFoo mock_foo;
+  EXPECT_CALL(mock_foo, DoThis());
+  ... code that uses mock_foo ...
+}
+```
+
+If a method of `mock_foo` other than `DoThis()` is called, it will be
+reported by Google Mock as a warning. However, if you rewrite your
+test to use `NiceMock<MockFoo>` instead, the warning will be gone,
+resulting in a cleaner test output:
+
+```
+using ::testing::NiceMock;
+
+TEST(...) {
+  NiceMock<MockFoo> mock_foo;
+  EXPECT_CALL(mock_foo, DoThis());
+  ... code that uses mock_foo ...
+}
+```
+
+`NiceMock<MockFoo>` is a subclass of `MockFoo`, so it can be used
+wherever `MockFoo` is accepted.
+
+It also works if `MockFoo`'s constructor takes some arguments, as
+`NiceMock<MockFoo>` "inherits" `MockFoo`'s constructors:
+
+```
+using ::testing::NiceMock;
+
+TEST(...) {
+  NiceMock<MockFoo> mock_foo(5, "hi");  // Calls MockFoo(5, "hi").
+  EXPECT_CALL(mock_foo, DoThis());
+  ... code that uses mock_foo ...
+}
+```
+
+The usage of `StrictMock` is similar, except that it makes all
+uninteresting calls failures:
+
+```
+using ::testing::StrictMock;
+
+TEST(...) {
+  StrictMock<MockFoo> mock_foo;
+  EXPECT_CALL(mock_foo, DoThis());
+  ... code that uses mock_foo ...
+
+  // The test will fail if a method of mock_foo other than DoThis()
+  // is called.
+}
+```
+
+There are some caveats though (I don't like them just as much as the
+next guy, but sadly they are side effects of C++'s limitations):
+
+  1. `NiceMock<MockFoo>` and `StrictMock<MockFoo>` only work for mock methods defined using the `MOCK_METHOD*` family of macros **directly** in the `MockFoo` class. If a mock method is defined in a **base class** of `MockFoo`, the "nice" or "strict" modifier may not affect it, depending on the compiler. In particular, nesting `NiceMock` and `StrictMock` (e.g. `NiceMock<StrictMock<MockFoo> >`) is **not** supported.
+  1. The constructors of the base mock (`MockFoo`) cannot have arguments passed by non-const reference, which happens to be banned by the [Google C++ style guide](http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml).
+  1. During the constructor or destructor of `MockFoo`, the mock object is _not_ nice or strict.  This may cause surprises if the constructor or destructor calls a mock method on `this` object. (This behavior, however, is consistent with C++'s general rule: if a constructor or destructor calls a virtual method of `this` object, that method is treated as non-virtual.  In other words, to the base class's constructor or destructor, `this` object behaves like an instance of the base class, not the derived class.  This rule is required for safety.  Otherwise a base constructor may use members of a derived class before they are initialized, or a base destructor may use members of a derived class after they have been destroyed.)
+
+Finally, you should be **very cautious** about when to use naggy or strict mocks, as they tend to make tests more brittle and harder to maintain. When you refactor your code without changing its externally visible behavior, ideally you should't need to update any tests. If your code interacts with a naggy mock, however, you may start to get spammed with warnings as the result of your change. Worse, if your code interacts with a strict mock, your tests may start to fail and you'll be forced to fix them. Our general recommendation is to use nice mocks (not yet the default) most of the time, use naggy mocks (the current default) when developing or debugging tests, and use strict mocks only as the last resort.
+
+## Simplifying the Interface without Breaking Existing Code ##
+
+Sometimes a method has a long list of arguments that is mostly
+uninteresting. For example,
+
+```
+class LogSink {
+ public:
+  ...
+  virtual void send(LogSeverity severity, const char* full_filename,
+                    const char* base_filename, int line,
+                    const struct tm* tm_time,
+                    const char* message, size_t message_len) = 0;
+};
+```
+
+This method's argument list is lengthy and hard to work with (let's
+say that the `message` argument is not even 0-terminated). If we mock
+it as is, using the mock will be awkward. If, however, we try to
+simplify this interface, we'll need to fix all clients depending on
+it, which is often infeasible.
+
+The trick is to re-dispatch the method in the mock class:
+
+```
+class ScopedMockLog : public LogSink {
+ public:
+  ...
+  virtual void send(LogSeverity severity, const char* full_filename,
+                    const char* base_filename, int line, const tm* tm_time,
+                    const char* message, size_t message_len) {
+    // We are only interested in the log severity, full file name, and
+    // log message.
+    Log(severity, full_filename, std::string(message, message_len));
+  }
+
+  // Implements the mock method:
+  //
+  //   void Log(LogSeverity severity,
+  //            const string& file_path,
+  //            const string& message);
+  MOCK_METHOD3(Log, void(LogSeverity severity, const string& file_path,
+                         const string& message));
+};
+```
+
+By defining a new mock method with a trimmed argument list, we make
+the mock class much more user-friendly.
+
+## Alternative to Mocking Concrete Classes ##
+
+Often you may find yourself using classes that don't implement
+interfaces. In order to test your code that uses such a class (let's
+call it `Concrete`), you may be tempted to make the methods of
+`Concrete` virtual and then mock it.
+
+Try not to do that.
+
+Making a non-virtual function virtual is a big decision. It creates an
+extension point where subclasses can tweak your class' behavior. This
+weakens your control on the class because now it's harder to maintain
+the class' invariants. You should make a function virtual only when
+there is a valid reason for a subclass to override it.
+
+Mocking concrete classes directly is problematic as it creates a tight
+coupling between the class and the tests - any small change in the
+class may invalidate your tests and make test maintenance a pain.
+
+To avoid such problems, many programmers have been practicing "coding
+to interfaces": instead of talking to the `Concrete` class, your code
+would define an interface and talk to it. Then you implement that
+interface as an adaptor on top of `Concrete`. In tests, you can easily
+mock that interface to observe how your code is doing.
+
+This technique incurs some overhead:
+
+  * You pay the cost of virtual function calls (usually not a problem).
+  * There is more abstraction for the programmers to learn.
+
+However, it can also bring significant benefits in addition to better
+testability:
+
+  * `Concrete`'s API may not fit your problem domain very well, as you may not be the only client it tries to serve. By designing your own interface, you have a chance to tailor it to your need - you may add higher-level functionalities, rename stuff, etc instead of just trimming the class. This allows you to write your code (user of the interface) in a more natural way, which means it will be more readable, more maintainable, and you'll be more productive.
+  * If `Concrete`'s implementation ever has to change, you don't have to rewrite everywhere it is used. Instead, you can absorb the change in your implementation of the interface, and your other code and tests will be insulated from this change.
+
+Some people worry that if everyone is practicing this technique, they
+will end up writing lots of redundant code. This concern is totally
+understandable. However, there are two reasons why it may not be the
+case:
+
+  * Different projects may need to use `Concrete` in different ways, so the best interfaces for them will be different. Therefore, each of them will have its own domain-specific interface on top of `Concrete`, and they will not be the same code.
+  * If enough projects want to use the same interface, they can always share it, just like they have been sharing `Concrete`. You can check in the interface and the adaptor somewhere near `Concrete` (perhaps in a `contrib` sub-directory) and let many projects use it.
+
+You need to weigh the pros and cons carefully for your particular
+problem, but I'd like to assure you that the Java community has been
+practicing this for a long time and it's a proven effective technique
+applicable in a wide variety of situations. :-)
+
+## Delegating Calls to a Fake ##
+
+Some times you have a non-trivial fake implementation of an
+interface. For example:
+
+```
+class Foo {
+ public:
+  virtual ~Foo() {}
+  virtual char DoThis(int n) = 0;
+  virtual void DoThat(const char* s, int* p) = 0;
+};
+
+class FakeFoo : public Foo {
+ public:
+  virtual char DoThis(int n) {
+    return (n > 0) ? '+' :
+        (n < 0) ? '-' : '0';
+  }
+
+  virtual void DoThat(const char* s, int* p) {
+    *p = strlen(s);
+  }
+};
+```
+
+Now you want to mock this interface such that you can set expectations
+on it. However, you also want to use `FakeFoo` for the default
+behavior, as duplicating it in the mock object is, well, a lot of
+work.
+
+When you define the mock class using Google Mock, you can have it
+delegate its default action to a fake class you already have, using
+this pattern:
+
+```
+using ::testing::_;
+using ::testing::Invoke;
+
+class MockFoo : public Foo {
+ public:
+  // Normal mock method definitions using Google Mock.
+  MOCK_METHOD1(DoThis, char(int n));
+  MOCK_METHOD2(DoThat, void(const char* s, int* p));
+
+  // Delegates the default actions of the methods to a FakeFoo object.
+  // This must be called *before* the custom ON_CALL() statements.
+  void DelegateToFake() {
+    ON_CALL(*this, DoThis(_))
+        .WillByDefault(Invoke(&fake_, &FakeFoo::DoThis));
+    ON_CALL(*this, DoThat(_, _))
+        .WillByDefault(Invoke(&fake_, &FakeFoo::DoThat));
+  }
+ private:
+  FakeFoo fake_;  // Keeps an instance of the fake in the mock.
+};
+```
+
+With that, you can use `MockFoo` in your tests as usual. Just remember
+that if you don't explicitly set an action in an `ON_CALL()` or
+`EXPECT_CALL()`, the fake will be called upon to do it:
+
+```
+using ::testing::_;
+
+TEST(AbcTest, Xyz) {
+  MockFoo foo;
+  foo.DelegateToFake(); // Enables the fake for delegation.
+
+  // Put your ON_CALL(foo, ...)s here, if any.
+
+  // No action specified, meaning to use the default action.
+  EXPECT_CALL(foo, DoThis(5));
+  EXPECT_CALL(foo, DoThat(_, _));
+
+  int n = 0;
+  EXPECT_EQ('+', foo.DoThis(5));  // FakeFoo::DoThis() is invoked.
+  foo.DoThat("Hi", &n);           // FakeFoo::DoThat() is invoked.
+  EXPECT_EQ(2, n);
+}
+```
+
+**Some tips:**
+
+  * If you want, you can still override the default action by providing your own `ON_CALL()` or using `.WillOnce()` / `.WillRepeatedly()` in `EXPECT_CALL()`.
+  * In `DelegateToFake()`, you only need to delegate the methods whose fake implementation you intend to use.
+  * The general technique discussed here works for overloaded methods, but you'll need to tell the compiler which version you mean. To disambiguate a mock function (the one you specify inside the parentheses of `ON_CALL()`), see the "Selecting Between Overloaded Functions" section on this page; to disambiguate a fake function (the one you place inside `Invoke()`), use a `static_cast` to specify the function's type. For instance, if class `Foo` has methods `char DoThis(int n)` and `bool DoThis(double x) const`, and you want to invoke the latter, you need to write `Invoke(&fake_, static_cast<bool (FakeFoo::*)(double) const>(&FakeFoo::DoThis))` instead of `Invoke(&fake_, &FakeFoo::DoThis)` (The strange-looking thing inside the angled brackets of `static_cast` is the type of a function pointer to the second `DoThis()` method.).
+  * Having to mix a mock and a fake is often a sign of something gone wrong. Perhaps you haven't got used to the interaction-based way of testing yet. Or perhaps your interface is taking on too many roles and should be split up. Therefore, **don't abuse this**. We would only recommend to do it as an intermediate step when you are refactoring your code.
+
+Regarding the tip on mixing a mock and a fake, here's an example on
+why it may be a bad sign: Suppose you have a class `System` for
+low-level system operations. In particular, it does file and I/O
+operations. And suppose you want to test how your code uses `System`
+to do I/O, and you just want the file operations to work normally. If
+you mock out the entire `System` class, you'll have to provide a fake
+implementation for the file operation part, which suggests that
+`System` is taking on too many roles.
+
+Instead, you can define a `FileOps` interface and an `IOOps` interface
+and split `System`'s functionalities into the two. Then you can mock
+`IOOps` without mocking `FileOps`.
+
+## Delegating Calls to a Real Object ##
+
+When using testing doubles (mocks, fakes, stubs, and etc), sometimes
+their behaviors will differ from those of the real objects. This
+difference could be either intentional (as in simulating an error such
+that you can test the error handling code) or unintentional. If your
+mocks have different behaviors than the real objects by mistake, you
+could end up with code that passes the tests but fails in production.
+
+You can use the _delegating-to-real_ technique to ensure that your
+mock has the same behavior as the real object while retaining the
+ability to validate calls. This technique is very similar to the
+delegating-to-fake technique, the difference being that we use a real
+object instead of a fake. Here's an example:
+
+```
+using ::testing::_;
+using ::testing::AtLeast;
+using ::testing::Invoke;
+
+class MockFoo : public Foo {
+ public:
+  MockFoo() {
+    // By default, all calls are delegated to the real object.
+    ON_CALL(*this, DoThis())
+        .WillByDefault(Invoke(&real_, &Foo::DoThis));
+    ON_CALL(*this, DoThat(_))
+        .WillByDefault(Invoke(&real_, &Foo::DoThat));
+    ...
+  }
+  MOCK_METHOD0(DoThis, ...);
+  MOCK_METHOD1(DoThat, ...);
+  ...
+ private:
+  Foo real_;
+};
+...
+
+  MockFoo mock;
+
+  EXPECT_CALL(mock, DoThis())
+      .Times(3);
+  EXPECT_CALL(mock, DoThat("Hi"))
+      .Times(AtLeast(1));
+  ... use mock in test ...
+```
+
+With this, Google Mock will verify that your code made the right calls
+(with the right arguments, in the right order, called the right number
+of times, etc), and a real object will answer the calls (so the
+behavior will be the same as in production). This gives you the best
+of both worlds.
+
+## Delegating Calls to a Parent Class ##
+
+Ideally, you should code to interfaces, whose methods are all pure
+virtual. In reality, sometimes you do need to mock a virtual method
+that is not pure (i.e, it already has an implementation). For example:
+
+```
+class Foo {
+ public:
+  virtual ~Foo();
+
+  virtual void Pure(int n) = 0;
+  virtual int Concrete(const char* str) { ... }
+};
+
+class MockFoo : public Foo {
+ public:
+  // Mocking a pure method.
+  MOCK_METHOD1(Pure, void(int n));
+  // Mocking a concrete method.  Foo::Concrete() is shadowed.
+  MOCK_METHOD1(Concrete, int(const char* str));
+};
+```
+
+Sometimes you may want to call `Foo::Concrete()` instead of
+`MockFoo::Concrete()`. Perhaps you want to do it as part of a stub
+action, or perhaps your test doesn't need to mock `Concrete()` at all
+(but it would be oh-so painful to have to define a new mock class
+whenever you don't need to mock one of its methods).
+
+The trick is to leave a back door in your mock class for accessing the
+real methods in the base class:
+
+```
+class MockFoo : public Foo {
+ public:
+  // Mocking a pure method.
+  MOCK_METHOD1(Pure, void(int n));
+  // Mocking a concrete method.  Foo::Concrete() is shadowed.
+  MOCK_METHOD1(Concrete, int(const char* str));
+
+  // Use this to call Concrete() defined in Foo.
+  int FooConcrete(const char* str) { return Foo::Concrete(str); }
+};
+```
+
+Now, you can call `Foo::Concrete()` inside an action by:
+
+```
+using ::testing::_;
+using ::testing::Invoke;
+...
+  EXPECT_CALL(foo, Concrete(_))
+      .WillOnce(Invoke(&foo, &MockFoo::FooConcrete));
+```
+
+or tell the mock object that you don't want to mock `Concrete()`:
+
+```
+using ::testing::Invoke;
+...
+  ON_CALL(foo, Concrete(_))
+      .WillByDefault(Invoke(&foo, &MockFoo::FooConcrete));
+```
+
+(Why don't we just write `Invoke(&foo, &Foo::Concrete)`? If you do
+that, `MockFoo::Concrete()` will be called (and cause an infinite
+recursion) since `Foo::Concrete()` is virtual. That's just how C++
+works.)
+
+# Using Matchers #
+
+## Matching Argument Values Exactly ##
+
+You can specify exactly which arguments a mock method is expecting:
+
+```
+using ::testing::Return;
+...
+  EXPECT_CALL(foo, DoThis(5))
+      .WillOnce(Return('a'));
+  EXPECT_CALL(foo, DoThat("Hello", bar));
+```
+
+## Using Simple Matchers ##
+
+You can use matchers to match arguments that have a certain property:
+
+```
+using ::testing::Ge;
+using ::testing::NotNull;
+using ::testing::Return;
+...
+  EXPECT_CALL(foo, DoThis(Ge(5)))  // The argument must be >= 5.
+      .WillOnce(Return('a'));
+  EXPECT_CALL(foo, DoThat("Hello", NotNull()));
+  // The second argument must not be NULL.
+```
+
+A frequently used matcher is `_`, which matches anything:
+
+```
+using ::testing::_;
+using ::testing::NotNull;
+...
+  EXPECT_CALL(foo, DoThat(_, NotNull()));
+```
+
+## Combining Matchers ##
+
+You can build complex matchers from existing ones using `AllOf()`,
+`AnyOf()`, and `Not()`:
+
+```
+using ::testing::AllOf;
+using ::testing::Gt;
+using ::testing::HasSubstr;
+using ::testing::Ne;
+using ::testing::Not;
+...
+  // The argument must be > 5 and != 10.
+  EXPECT_CALL(foo, DoThis(AllOf(Gt(5),
+                                Ne(10))));
+
+  // The first argument must not contain sub-string "blah".
+  EXPECT_CALL(foo, DoThat(Not(HasSubstr("blah")),
+                          NULL));
+```
+
+## Casting Matchers ##
+
+Google Mock matchers are statically typed, meaning that the compiler
+can catch your mistake if you use a matcher of the wrong type (for
+example, if you use `Eq(5)` to match a `string` argument). Good for
+you!
+
+Sometimes, however, you know what you're doing and want the compiler
+to give you some slack. One example is that you have a matcher for
+`long` and the argument you want to match is `int`. While the two
+types aren't exactly the same, there is nothing really wrong with
+using a `Matcher<long>` to match an `int` - after all, we can first
+convert the `int` argument to a `long` before giving it to the
+matcher.
+
+To support this need, Google Mock gives you the
+`SafeMatcherCast<T>(m)` function. It casts a matcher `m` to type
+`Matcher<T>`. To ensure safety, Google Mock checks that (let `U` be the
+type `m` accepts):
+
+  1. Type `T` can be implicitly cast to type `U`;
+  1. When both `T` and `U` are built-in arithmetic types (`bool`, integers, and floating-point numbers), the conversion from `T` to `U` is not lossy (in other words, any value representable by `T` can also be represented by `U`); and
+  1. When `U` is a reference, `T` must also be a reference (as the underlying matcher may be interested in the address of the `U` value).
+
+The code won't compile if any of these conditions isn't met.
+
+Here's one example:
+
+```
+using ::testing::SafeMatcherCast;
+
+// A base class and a child class.
+class Base { ... };
+class Derived : public Base { ... };
+
+class MockFoo : public Foo {
+ public:
+  MOCK_METHOD1(DoThis, void(Derived* derived));
+};
+...
+
+  MockFoo foo;
+  // m is a Matcher<Base*> we got from somewhere.
+  EXPECT_CALL(foo, DoThis(SafeMatcherCast<Derived*>(m)));
+```
+
+If you find `SafeMatcherCast<T>(m)` too limiting, you can use a similar
+function `MatcherCast<T>(m)`. The difference is that `MatcherCast` works
+as long as you can `static_cast` type `T` to type `U`.
+
+`MatcherCast` essentially lets you bypass C++'s type system
+(`static_cast` isn't always safe as it could throw away information,
+for example), so be careful not to misuse/abuse it.
+
+## Selecting Between Overloaded Functions ##
+
+If you expect an overloaded function to be called, the compiler may
+need some help on which overloaded version it is.
+
+To disambiguate functions overloaded on the const-ness of this object,
+use the `Const()` argument wrapper.
+
+```
+using ::testing::ReturnRef;
+
+class MockFoo : public Foo {
+  ...
+  MOCK_METHOD0(GetBar, Bar&());
+  MOCK_CONST_METHOD0(GetBar, const Bar&());
+};
+...
+
+  MockFoo foo;
+  Bar bar1, bar2;
+  EXPECT_CALL(foo, GetBar())         // The non-const GetBar().
+      .WillOnce(ReturnRef(bar1));
+  EXPECT_CALL(Const(foo), GetBar())  // The const GetBar().
+      .WillOnce(ReturnRef(bar2));
+```
+
+(`Const()` is defined by Google Mock and returns a `const` reference
+to its argument.)
+
+To disambiguate overloaded functions with the same number of arguments
+but different argument types, you may need to specify the exact type
+of a matcher, either by wrapping your matcher in `Matcher<type>()`, or
+using a matcher whose type is fixed (`TypedEq<type>`, `An<type>()`,
+etc):
+
+```
+using ::testing::An;
+using ::testing::Lt;
+using ::testing::Matcher;
+using ::testing::TypedEq;
+
+class MockPrinter : public Printer {
+ public:
+  MOCK_METHOD1(Print, void(int n));
+  MOCK_METHOD1(Print, void(char c));
+};
+
+TEST(PrinterTest, Print) {
+  MockPrinter printer;
+
+  EXPECT_CALL(printer, Print(An<int>()));            // void Print(int);
+  EXPECT_CALL(printer, Print(Matcher<int>(Lt(5))));  // void Print(int);
+  EXPECT_CALL(printer, Print(TypedEq<char>('a')));   // void Print(char);
+
+  printer.Print(3);
+  printer.Print(6);
+  printer.Print('a');
+}
+```
+
+## Performing Different Actions Based on the Arguments ##
+
+When a mock method is called, the _last_ matching expectation that's
+still active will be selected (think "newer overrides older"). So, you
+can make a method do different things depending on its argument values
+like this:
+
+```
+using ::testing::_;
+using ::testing::Lt;
+using ::testing::Return;
+...
+  // The default case.
+  EXPECT_CALL(foo, DoThis(_))
+      .WillRepeatedly(Return('b'));
+
+  // The more specific case.
+  EXPECT_CALL(foo, DoThis(Lt(5)))
+      .WillRepeatedly(Return('a'));
+```
+
+Now, if `foo.DoThis()` is called with a value less than 5, `'a'` will
+be returned; otherwise `'b'` will be returned.
+
+## Matching Multiple Arguments as a Whole ##
+
+Sometimes it's not enough to match the arguments individually. For
+example, we may want to say that the first argument must be less than
+the second argument. The `With()` clause allows us to match
+all arguments of a mock function as a whole. For example,
+
+```
+using ::testing::_;
+using ::testing::Lt;
+using ::testing::Ne;
+...
+  EXPECT_CALL(foo, InRange(Ne(0), _))
+      .With(Lt());
+```
+
+says that the first argument of `InRange()` must not be 0, and must be
+less than the second argument.
+
+The expression inside `With()` must be a matcher of type
+`Matcher< ::testing::tuple<A1, ..., An> >`, where `A1`, ..., `An` are the
+types of the function arguments.
+
+You can also write `AllArgs(m)` instead of `m` inside `.With()`. The
+two forms are equivalent, but `.With(AllArgs(Lt()))` is more readable
+than `.With(Lt())`.
+
+You can use `Args<k1, ..., kn>(m)` to match the `n` selected arguments
+(as a tuple) against `m`. For example,
+
+```
+using ::testing::_;
+using ::testing::AllOf;
+using ::testing::Args;
+using ::testing::Lt;
+...
+  EXPECT_CALL(foo, Blah(_, _, _))
+      .With(AllOf(Args<0, 1>(Lt()), Args<1, 2>(Lt())));
+```
+
+says that `Blah()` will be called with arguments `x`, `y`, and `z` where
+`x < y < z`.
+
+As a convenience and example, Google Mock provides some matchers for
+2-tuples, including the `Lt()` matcher above. See the [CheatSheet](CheatSheet.md) for
+the complete list.
+
+Note that if you want to pass the arguments to a predicate of your own
+(e.g. `.With(Args<0, 1>(Truly(&MyPredicate)))`), that predicate MUST be
+written to take a `::testing::tuple` as its argument; Google Mock will pass the `n` selected arguments as _one_ single tuple to the predicate.
+
+## Using Matchers as Predicates ##
+
+Have you noticed that a matcher is just a fancy predicate that also
+knows how to describe itself? Many existing algorithms take predicates
+as arguments (e.g. those defined in STL's `<algorithm>` header), and
+it would be a shame if Google Mock matchers are not allowed to
+participate.
+
+Luckily, you can use a matcher where a unary predicate functor is
+expected by wrapping it inside the `Matches()` function. For example,
+
+```
+#include <algorithm>
+#include <vector>
+
+std::vector<int> v;
+...
+// How many elements in v are >= 10?
+const int count = count_if(v.begin(), v.end(), Matches(Ge(10)));
+```
+
+Since you can build complex matchers from simpler ones easily using
+Google Mock, this gives you a way to conveniently construct composite
+predicates (doing the same using STL's `<functional>` header is just
+painful). For example, here's a predicate that's satisfied by any
+number that is >= 0, <= 100, and != 50:
+
+```
+Matches(AllOf(Ge(0), Le(100), Ne(50)))
+```
+
+## Using Matchers in Google Test Assertions ##
+
+Since matchers are basically predicates that also know how to describe
+themselves, there is a way to take advantage of them in
+[Google Test](../../googletest/) assertions. It's
+called `ASSERT_THAT` and `EXPECT_THAT`:
+
+```
+  ASSERT_THAT(value, matcher);  // Asserts that value matches matcher.
+  EXPECT_THAT(value, matcher);  // The non-fatal version.
+```
+
+For example, in a Google Test test you can write:
+
+```
+#include "gmock/gmock.h"
+
+using ::testing::AllOf;
+using ::testing::Ge;
+using ::testing::Le;
+using ::testing::MatchesRegex;
+using ::testing::StartsWith;
+...
+
+  EXPECT_THAT(Foo(), StartsWith("Hello"));
+  EXPECT_THAT(Bar(), MatchesRegex("Line \\d+"));
+  ASSERT_THAT(Baz(), AllOf(Ge(5), Le(10)));
+```
+
+which (as you can probably guess) executes `Foo()`, `Bar()`, and
+`Baz()`, and verifies that:
+
+  * `Foo()` returns a string that starts with `"Hello"`.
+  * `Bar()` returns a string that matches regular expression `"Line \\d+"`.
+  * `Baz()` returns a number in the range [5, 10].
+
+The nice thing about these macros is that _they read like
+English_. They generate informative messages too. For example, if the
+first `EXPECT_THAT()` above fails, the message will be something like:
+
+```
+Value of: Foo()
+  Actual: "Hi, world!"
+Expected: starts with "Hello"
+```
+
+**Credit:** The idea of `(ASSERT|EXPECT)_THAT` was stolen from the
+[Hamcrest](https://github.com/hamcrest/) project, which adds
+`assertThat()` to JUnit.
+
+## Using Predicates as Matchers ##
+
+Google Mock provides a built-in set of matchers. In case you find them
+lacking, you can use an arbitray unary predicate function or functor
+as a matcher - as long as the predicate accepts a value of the type
+you want. You do this by wrapping the predicate inside the `Truly()`
+function, for example:
+
+```
+using ::testing::Truly;
+
+int IsEven(int n) { return (n % 2) == 0 ? 1 : 0; }
+...
+
+  // Bar() must be called with an even number.
+  EXPECT_CALL(foo, Bar(Truly(IsEven)));
+```
+
+Note that the predicate function / functor doesn't have to return
+`bool`. It works as long as the return value can be used as the
+condition in statement `if (condition) ...`.
+
+## Matching Arguments that Are Not Copyable ##
+
+When you do an `EXPECT_CALL(mock_obj, Foo(bar))`, Google Mock saves
+away a copy of `bar`. When `Foo()` is called later, Google Mock
+compares the argument to `Foo()` with the saved copy of `bar`. This
+way, you don't need to worry about `bar` being modified or destroyed
+after the `EXPECT_CALL()` is executed. The same is true when you use
+matchers like `Eq(bar)`, `Le(bar)`, and so on.
+
+But what if `bar` cannot be copied (i.e. has no copy constructor)? You
+could define your own matcher function and use it with `Truly()`, as
+the previous couple of recipes have shown. Or, you may be able to get
+away from it if you can guarantee that `bar` won't be changed after
+the `EXPECT_CALL()` is executed. Just tell Google Mock that it should
+save a reference to `bar`, instead of a copy of it. Here's how:
+
+```
+using ::testing::Eq;
+using ::testing::ByRef;
+using ::testing::Lt;
+...
+  // Expects that Foo()'s argument == bar.
+  EXPECT_CALL(mock_obj, Foo(Eq(ByRef(bar))));
+
+  // Expects that Foo()'s argument < bar.
+  EXPECT_CALL(mock_obj, Foo(Lt(ByRef(bar))));
+```
+
+Remember: if you do this, don't change `bar` after the
+`EXPECT_CALL()`, or the result is undefined.
+
+## Validating a Member of an Object ##
+
+Often a mock function takes a reference to object as an argument. When
+matching the argument, you may not want to compare the entire object
+against a fixed object, as that may be over-specification. Instead,
+you may need to validate a certain member variable or the result of a
+certain getter method of the object. You can do this with `Field()`
+and `Property()`. More specifically,
+
+```
+Field(&Foo::bar, m)
+```
+
+is a matcher that matches a `Foo` object whose `bar` member variable
+satisfies matcher `m`.
+
+```
+Property(&Foo::baz, m)
+```
+
+is a matcher that matches a `Foo` object whose `baz()` method returns
+a value that satisfies matcher `m`.
+
+For example:
+
+> | `Field(&Foo::number, Ge(3))` | Matches `x` where `x.number >= 3`. |
+|:-----------------------------|:-----------------------------------|
+> | `Property(&Foo::name, StartsWith("John "))` | Matches `x` where `x.name()` starts with `"John "`. |
+
+Note that in `Property(&Foo::baz, ...)`, method `baz()` must take no
+argument and be declared as `const`.
+
+BTW, `Field()` and `Property()` can also match plain pointers to
+objects. For instance,
+
+```
+Field(&Foo::number, Ge(3))
+```
+
+matches a plain pointer `p` where `p->number >= 3`. If `p` is `NULL`,
+the match will always fail regardless of the inner matcher.
+
+What if you want to validate more than one members at the same time?
+Remember that there is `AllOf()`.
+
+## Validating the Value Pointed to by a Pointer Argument ##
+
+C++ functions often take pointers as arguments. You can use matchers
+like `IsNull()`, `NotNull()`, and other comparison matchers to match a
+pointer, but what if you want to make sure the value _pointed to_ by
+the pointer, instead of the pointer itself, has a certain property?
+Well, you can use the `Pointee(m)` matcher.
+
+`Pointee(m)` matches a pointer iff `m` matches the value the pointer
+points to. For example:
+
+```
+using ::testing::Ge;
+using ::testing::Pointee;
+...
+  EXPECT_CALL(foo, Bar(Pointee(Ge(3))));
+```
+
+expects `foo.Bar()` to be called with a pointer that points to a value
+greater than or equal to 3.
+
+One nice thing about `Pointee()` is that it treats a `NULL` pointer as
+a match failure, so you can write `Pointee(m)` instead of
+
+```
+  AllOf(NotNull(), Pointee(m))
+```
+
+without worrying that a `NULL` pointer will crash your test.
+
+Also, did we tell you that `Pointee()` works with both raw pointers
+**and** smart pointers (`linked_ptr`, `shared_ptr`, `scoped_ptr`, and
+etc)?
+
+What if you have a pointer to pointer? You guessed it - you can use
+nested `Pointee()` to probe deeper inside the value. For example,
+`Pointee(Pointee(Lt(3)))` matches a pointer that points to a pointer
+that points to a number less than 3 (what a mouthful...).
+
+## Testing a Certain Property of an Object ##
+
+Sometimes you want to specify that an object argument has a certain
+property, but there is no existing matcher that does this. If you want
+good error messages, you should define a matcher. If you want to do it
+quick and dirty, you could get away with writing an ordinary function.
+
+Let's say you have a mock function that takes an object of type `Foo`,
+which has an `int bar()` method and an `int baz()` method, and you
+want to constrain that the argument's `bar()` value plus its `baz()`
+value is a given number. Here's how you can define a matcher to do it:
+
+```
+using ::testing::MatcherInterface;
+using ::testing::MatchResultListener;
+
+class BarPlusBazEqMatcher : public MatcherInterface<const Foo&> {
+ public:
+  explicit BarPlusBazEqMatcher(int expected_sum)
+      : expected_sum_(expected_sum) {}
+
+  virtual bool MatchAndExplain(const Foo& foo,
+                               MatchResultListener* listener) const {
+    return (foo.bar() + foo.baz()) == expected_sum_;
+  }
+
+  virtual void DescribeTo(::std::ostream* os) const {
+    *os << "bar() + baz() equals " << expected_sum_;
+  }
+
+  virtual void DescribeNegationTo(::std::ostream* os) const {
+    *os << "bar() + baz() does not equal " << expected_sum_;
+  }
+ private:
+  const int expected_sum_;
+};
+
+inline Matcher<const Foo&> BarPlusBazEq(int expected_sum) {
+  return MakeMatcher(new BarPlusBazEqMatcher(expected_sum));
+}
+
+...
+
+  EXPECT_CALL(..., DoThis(BarPlusBazEq(5)))...;
+```
+
+## Matching Containers ##
+
+Sometimes an STL container (e.g. list, vector, map, ...) is passed to
+a mock function and you may want to validate it. Since most STL
+containers support the `==` operator, you can write
+`Eq(expected_container)` or simply `expected_container` to match a
+container exactly.
+
+Sometimes, though, you may want to be more flexible (for example, the
+first element must be an exact match, but the second element can be
+any positive number, and so on). Also, containers used in tests often
+have a small number of elements, and having to define the expected
+container out-of-line is a bit of a hassle.
+
+You can use the `ElementsAre()` or `UnorderedElementsAre()` matcher in
+such cases:
+
+```
+using ::testing::_;
+using ::testing::ElementsAre;
+using ::testing::Gt;
+...
+
+  MOCK_METHOD1(Foo, void(const vector<int>& numbers));
+...
+
+  EXPECT_CALL(mock, Foo(ElementsAre(1, Gt(0), _, 5)));
+```
+
+The above matcher says that the container must have 4 elements, which
+must be 1, greater than 0, anything, and 5 respectively.
+
+If you instead write:
+
+```
+using ::testing::_;
+using ::testing::Gt;
+using ::testing::UnorderedElementsAre;
+...
+
+  MOCK_METHOD1(Foo, void(const vector<int>& numbers));
+...
+
+  EXPECT_CALL(mock, Foo(UnorderedElementsAre(1, Gt(0), _, 5)));
+```
+
+It means that the container must have 4 elements, which under some
+permutation must be 1, greater than 0, anything, and 5 respectively.
+
+`ElementsAre()` and `UnorderedElementsAre()` are overloaded to take 0
+to 10 arguments. If more are needed, you can place them in a C-style
+array and use `ElementsAreArray()` or `UnorderedElementsAreArray()`
+instead:
+
+```
+using ::testing::ElementsAreArray;
+...
+
+  // ElementsAreArray accepts an array of element values.
+  const int expected_vector1[] = { 1, 5, 2, 4, ... };
+  EXPECT_CALL(mock, Foo(ElementsAreArray(expected_vector1)));
+
+  // Or, an array of element matchers.
+  Matcher<int> expected_vector2 = { 1, Gt(2), _, 3, ... };
+  EXPECT_CALL(mock, Foo(ElementsAreArray(expected_vector2)));
+```
+
+In case the array needs to be dynamically created (and therefore the
+array size cannot be inferred by the compiler), you can give
+`ElementsAreArray()` an additional argument to specify the array size:
+
+```
+using ::testing::ElementsAreArray;
+...
+  int* const expected_vector3 = new int[count];
+  ... fill expected_vector3 with values ...
+  EXPECT_CALL(mock, Foo(ElementsAreArray(expected_vector3, count)));
+```
+
+**Tips:**
+
+  * `ElementsAre*()` can be used to match _any_ container that implements the STL iterator pattern (i.e. it has a `const_iterator` type and supports `begin()/end()`), not just the ones defined in STL. It will even work with container types yet to be written - as long as they follows the above pattern.
+  * You can use nested `ElementsAre*()` to match nested (multi-dimensional) containers.
+  * If the container is passed by pointer instead of by reference, just write `Pointee(ElementsAre*(...))`.
+  * The order of elements _matters_ for `ElementsAre*()`. Therefore don't use it with containers whose element order is undefined (e.g. `hash_map`).
+
+## Sharing Matchers ##
+
+Under the hood, a Google Mock matcher object consists of a pointer to
+a ref-counted implementation object. Copying matchers is allowed and
+very efficient, as only the pointer is copied. When the last matcher
+that references the implementation object dies, the implementation
+object will be deleted.
+
+Therefore, if you have some complex matcher that you want to use again
+and again, there is no need to build it everytime. Just assign it to a
+matcher variable and use that variable repeatedly! For example,
+
+```
+  Matcher<int> in_range = AllOf(Gt(5), Le(10));
+  ... use in_range as a matcher in multiple EXPECT_CALLs ...
+```
+
+# Setting Expectations #
+
+## Knowing When to Expect ##
+
+`ON_CALL` is likely the single most under-utilized construct in Google Mock.
+
+There are basically two constructs for defining the behavior of a mock object: `ON_CALL` and `EXPECT_CALL`. The difference? `ON_CALL` defines what happens when a mock method is called, but _doesn't imply any expectation on the method being called._ `EXPECT_CALL` not only defines the behavior, but also sets an expectation that _the method will be called with the given arguments, for the given number of times_ (and _in the given order_ when you specify the order too).
+
+Since `EXPECT_CALL` does more, isn't it better than `ON_CALL`? Not really. Every `EXPECT_CALL` adds a constraint on the behavior of the code under test. Having more constraints than necessary is _baaad_ - even worse than not having enough constraints.
+
+This may be counter-intuitive. How could tests that verify more be worse than tests that verify less? Isn't verification the whole point of tests?
+
+The answer, lies in _what_ a test should verify. **A good test verifies the contract of the code.** If a test over-specifies, it doesn't leave enough freedom to the implementation. As a result, changing the implementation without breaking the contract (e.g. refactoring and optimization), which should be perfectly fine to do, can break such tests. Then you have to spend time fixing them, only to see them broken again the next time the implementation is changed.
+
+Keep in mind that one doesn't have to verify more than one property in one test. In fact, **it's a good style to verify only one thing in one test.** If you do that, a bug will likely break only one or two tests instead of dozens (which case would you rather debug?). If you are also in the habit of giving tests descriptive names that tell what they verify, you can often easily guess what's wrong just from the test log itself.
+
+So use `ON_CALL` by default, and only use `EXPECT_CALL` when you actually intend to verify that the call is made. For example, you may have a bunch of `ON_CALL`s in your test fixture to set the common mock behavior shared by all tests in the same group, and write (scarcely) different `EXPECT_CALL`s in different `TEST_F`s to verify different aspects of the code's behavior. Compared with the style where each `TEST` has many `EXPECT_CALL`s, this leads to tests that are more resilient to implementational changes (and thus less likely to require maintenance) and makes the intent of the tests more obvious (so they are easier to maintain when you do need to maintain them).
+
+If you are bothered by the "Uninteresting mock function call" message printed when a mock method without an `EXPECT_CALL` is called, you may use a `NiceMock` instead to suppress all such messages for the mock object, or suppress the message for specific methods by adding `EXPECT_CALL(...).Times(AnyNumber())`. DO NOT suppress it by blindly adding an `EXPECT_CALL(...)`, or you'll have a test that's a pain to maintain.
+
+## Ignoring Uninteresting Calls ##
+
+If you are not interested in how a mock method is called, just don't
+say anything about it. In this case, if the method is ever called,
+Google Mock will perform its default action to allow the test program
+to continue. If you are not happy with the default action taken by
+Google Mock, you can override it using `DefaultValue<T>::Set()`
+(described later in this document) or `ON_CALL()`.
+
+Please note that once you expressed interest in a particular mock
+method (via `EXPECT_CALL()`), all invocations to it must match some
+expectation. If this function is called but the arguments don't match
+any `EXPECT_CALL()` statement, it will be an error.
+
+## Disallowing Unexpected Calls ##
+
+If a mock method shouldn't be called at all, explicitly say so:
+
+```
+using ::testing::_;
+...
+  EXPECT_CALL(foo, Bar(_))
+      .Times(0);
+```
+
+If some calls to the method are allowed, but the rest are not, just
+list all the expected calls:
+
+```
+using ::testing::AnyNumber;
+using ::testing::Gt;
+...
+  EXPECT_CALL(foo, Bar(5));
+  EXPECT_CALL(foo, Bar(Gt(10)))
+      .Times(AnyNumber());
+```
+
+A call to `foo.Bar()` that doesn't match any of the `EXPECT_CALL()`
+statements will be an error.
+
+## Understanding Uninteresting vs Unexpected Calls ##
+
+_Uninteresting_ calls and _unexpected_ calls are different concepts in Google Mock. _Very_ different.
+
+A call `x.Y(...)` is **uninteresting** if there's _not even a single_ `EXPECT_CALL(x, Y(...))` set. In other words, the test isn't interested in the `x.Y()` method at all, as evident in that the test doesn't care to say anything about it.
+
+A call `x.Y(...)` is **unexpected** if there are some `EXPECT_CALL(x, Y(...))s` set, but none of them matches the call. Put another way, the test is interested in the `x.Y()` method (therefore it _explicitly_ sets some `EXPECT_CALL` to verify how it's called); however, the verification fails as the test doesn't expect this particular call to happen.
+
+**An unexpected call is always an error,** as the code under test doesn't behave the way the test expects it to behave.
+
+**By default, an uninteresting call is not an error,** as it violates no constraint specified by the test. (Google Mock's philosophy is that saying nothing means there is no constraint.) However, it leads to a warning, as it _might_ indicate a problem (e.g. the test author might have forgotten to specify a constraint).
+
+In Google Mock, `NiceMock` and `StrictMock` can be used to make a mock class "nice" or "strict". How does this affect uninteresting calls and unexpected calls?
+
+A **nice mock** suppresses uninteresting call warnings. It is less chatty than the default mock, but otherwise is the same. If a test fails with a default mock, it will also fail using a nice mock instead. And vice versa. Don't expect making a mock nice to change the test's result.
+
+A **strict mock** turns uninteresting call warnings into errors. So making a mock strict may change the test's result.
+
+Let's look at an example:
+
+```
+TEST(...) {
+  NiceMock<MockDomainRegistry> mock_registry;
+  EXPECT_CALL(mock_registry, GetDomainOwner("google.com"))
+          .WillRepeatedly(Return("Larry Page"));
+
+  // Use mock_registry in code under test.
+  ... &mock_registry ...
+}
+```
+
+The sole `EXPECT_CALL` here says that all calls to `GetDomainOwner()` must have `"google.com"` as the argument. If `GetDomainOwner("yahoo.com")` is called, it will be an unexpected call, and thus an error. Having a nice mock doesn't change the severity of an unexpected call.
+
+So how do we tell Google Mock that `GetDomainOwner()` can be called with some other arguments as well? The standard technique is to add a "catch all" `EXPECT_CALL`:
+
+```
+  EXPECT_CALL(mock_registry, GetDomainOwner(_))
+        .Times(AnyNumber());  // catches all other calls to this method.
+  EXPECT_CALL(mock_registry, GetDomainOwner("google.com"))
+        .WillRepeatedly(Return("Larry Page"));
+```
+
+Remember that `_` is the wildcard matcher that matches anything. With this, if `GetDomainOwner("google.com")` is called, it will do what the second `EXPECT_CALL` says; if it is called with a different argument, it will do what the first `EXPECT_CALL` says.
+
+Note that the order of the two `EXPECT_CALLs` is important, as a newer `EXPECT_CALL` takes precedence over an older one.
+
+For more on uninteresting calls, nice mocks, and strict mocks, read ["The Nice, the Strict, and the Naggy"](#the-nice-the-strict-and-the-naggy).
+
+## Expecting Ordered Calls ##
+
+Although an `EXPECT_CALL()` statement defined earlier takes precedence
+when Google Mock tries to match a function call with an expectation,
+by default calls don't have to happen in the order `EXPECT_CALL()`
+statements are written. For example, if the arguments match the
+matchers in the third `EXPECT_CALL()`, but not those in the first two,
+then the third expectation will be used.
+
+If you would rather have all calls occur in the order of the
+expectations, put the `EXPECT_CALL()` statements in a block where you
+define a variable of type `InSequence`:
+
+```
+  using ::testing::_;
+  using ::testing::InSequence;
+
+  {
+    InSequence s;
+
+    EXPECT_CALL(foo, DoThis(5));
+    EXPECT_CALL(bar, DoThat(_))
+        .Times(2);
+    EXPECT_CALL(foo, DoThis(6));
+  }
+```
+
+In this example, we expect a call to `foo.DoThis(5)`, followed by two
+calls to `bar.DoThat()` where the argument can be anything, which are
+in turn followed by a call to `foo.DoThis(6)`. If a call occurred
+out-of-order, Google Mock will report an error.
+
+## Expecting Partially Ordered Calls ##
+
+Sometimes requiring everything to occur in a predetermined order can
+lead to brittle tests. For example, we may care about `A` occurring
+before both `B` and `C`, but aren't interested in the relative order
+of `B` and `C`. In this case, the test should reflect our real intent,
+instead of being overly constraining.
+
+Google Mock allows you to impose an arbitrary DAG (directed acyclic
+graph) on the calls. One way to express the DAG is to use the
+[After](CheatSheet.md#the-after-clause) clause of `EXPECT_CALL`.
+
+Another way is via the `InSequence()` clause (not the same as the
+`InSequence` class), which we borrowed from jMock 2. It's less
+flexible than `After()`, but more convenient when you have long chains
+of sequential calls, as it doesn't require you to come up with
+different names for the expectations in the chains.  Here's how it
+works:
+
+If we view `EXPECT_CALL()` statements as nodes in a graph, and add an
+edge from node A to node B wherever A must occur before B, we can get
+a DAG. We use the term "sequence" to mean a directed path in this
+DAG. Now, if we decompose the DAG into sequences, we just need to know
+which sequences each `EXPECT_CALL()` belongs to in order to be able to
+reconstruct the orginal DAG.
+
+So, to specify the partial order on the expectations we need to do two
+things: first to define some `Sequence` objects, and then for each
+`EXPECT_CALL()` say which `Sequence` objects it is part
+of. Expectations in the same sequence must occur in the order they are
+written. For example,
+
+```
+  using ::testing::Sequence;
+
+  Sequence s1, s2;
+
+  EXPECT_CALL(foo, A())
+      .InSequence(s1, s2);
+  EXPECT_CALL(bar, B())
+      .InSequence(s1);
+  EXPECT_CALL(bar, C())
+      .InSequence(s2);
+  EXPECT_CALL(foo, D())
+      .InSequence(s2);
+```
+
+specifies the following DAG (where `s1` is `A -> B`, and `s2` is `A ->
+C -> D`):
+
+```
+       +---> B
+       |
+  A ---|
+       |
+       +---> C ---> D
+```
+
+This means that A must occur before B and C, and C must occur before
+D. There's no restriction about the order other than these.
+
+## Controlling When an Expectation Retires ##
+
+When a mock method is called, Google Mock only consider expectations
+that are still active. An expectation is active when created, and
+becomes inactive (aka _retires_) when a call that has to occur later
+has occurred. For example, in
+
+```
+  using ::testing::_;
+  using ::testing::Sequence;
+
+  Sequence s1, s2;
+
+  EXPECT_CALL(log, Log(WARNING, _, "File too large."))     // #1
+      .Times(AnyNumber())
+      .InSequence(s1, s2);
+  EXPECT_CALL(log, Log(WARNING, _, "Data set is empty."))  // #2
+      .InSequence(s1);
+  EXPECT_CALL(log, Log(WARNING, _, "User not found."))     // #3
+      .InSequence(s2);
+```
+
+as soon as either #2 or #3 is matched, #1 will retire. If a warning
+`"File too large."` is logged after this, it will be an error.
+
+Note that an expectation doesn't retire automatically when it's
+saturated. For example,
+
+```
+using ::testing::_;
+...
+  EXPECT_CALL(log, Log(WARNING, _, _));                  // #1
+  EXPECT_CALL(log, Log(WARNING, _, "File too large."));  // #2
+```
+
+says that there will be exactly one warning with the message `"File
+too large."`. If the second warning contains this message too, #2 will
+match again and result in an upper-bound-violated error.
+
+If this is not what you want, you can ask an expectation to retire as
+soon as it becomes saturated:
+
+```
+using ::testing::_;
+...
+  EXPECT_CALL(log, Log(WARNING, _, _));                 // #1
+  EXPECT_CALL(log, Log(WARNING, _, "File too large."))  // #2
+      .RetiresOnSaturation();
+```
+
+Here #2 can be used only once, so if you have two warnings with the
+message `"File too large."`, the first will match #2 and the second
+will match #1 - there will be no error.
+
+# Using Actions #
+
+## Returning References from Mock Methods ##
+
+If a mock function's return type is a reference, you need to use
+`ReturnRef()` instead of `Return()` to return a result:
+
+```
+using ::testing::ReturnRef;
+
+class MockFoo : public Foo {
+ public:
+  MOCK_METHOD0(GetBar, Bar&());
+};
+...
+
+  MockFoo foo;
+  Bar bar;
+  EXPECT_CALL(foo, GetBar())
+      .WillOnce(ReturnRef(bar));
+```
+
+## Returning Live Values from Mock Methods ##
+
+The `Return(x)` action saves a copy of `x` when the action is
+_created_, and always returns the same value whenever it's
+executed. Sometimes you may want to instead return the _live_ value of
+`x` (i.e. its value at the time when the action is _executed_.).
+
+If the mock function's return type is a reference, you can do it using
+`ReturnRef(x)`, as shown in the previous recipe ("Returning References
+from Mock Methods"). However, Google Mock doesn't let you use
+`ReturnRef()` in a mock function whose return type is not a reference,
+as doing that usually indicates a user error. So, what shall you do?
+
+You may be tempted to try `ByRef()`:
+
+```
+using testing::ByRef;
+using testing::Return;
+
+class MockFoo : public Foo {
+ public:
+  MOCK_METHOD0(GetValue, int());
+};
+...
+  int x = 0;
+  MockFoo foo;
+  EXPECT_CALL(foo, GetValue())
+      .WillRepeatedly(Return(ByRef(x)));
+  x = 42;
+  EXPECT_EQ(42, foo.GetValue());
+```
+
+Unfortunately, it doesn't work here. The above code will fail with error:
+
+```
+Value of: foo.GetValue()
+  Actual: 0
+Expected: 42
+```
+
+The reason is that `Return(value)` converts `value` to the actual
+return type of the mock function at the time when the action is
+_created_, not when it is _executed_. (This behavior was chosen for
+the action to be safe when `value` is a proxy object that references
+some temporary objects.) As a result, `ByRef(x)` is converted to an
+`int` value (instead of a `const int&`) when the expectation is set,
+and `Return(ByRef(x))` will always return 0.
+
+`ReturnPointee(pointer)` was provided to solve this problem
+specifically. It returns the value pointed to by `pointer` at the time
+the action is _executed_:
+
+```
+using testing::ReturnPointee;
+...
+  int x = 0;
+  MockFoo foo;
+  EXPECT_CALL(foo, GetValue())
+      .WillRepeatedly(ReturnPointee(&x));  // Note the & here.
+  x = 42;
+  EXPECT_EQ(42, foo.GetValue());  // This will succeed now.
+```
+
+## Combining Actions ##
+
+Want to do more than one thing when a function is called? That's
+fine. `DoAll()` allow you to do sequence of actions every time. Only
+the return value of the last action in the sequence will be used.
+
+```
+using ::testing::DoAll;
+
+class MockFoo : public Foo {
+ public:
+  MOCK_METHOD1(Bar, bool(int n));
+};
+...
+
+  EXPECT_CALL(foo, Bar(_))
+      .WillOnce(DoAll(action_1,
+                      action_2,
+                      ...
+                      action_n));
+```
+
+## Mocking Side Effects ##
+
+Sometimes a method exhibits its effect not via returning a value but
+via side effects. For example, it may change some global state or
+modify an output argument. To mock side effects, in general you can
+define your own action by implementing `::testing::ActionInterface`.
+
+If all you need to do is to change an output argument, the built-in
+`SetArgPointee()` action is convenient:
+
+```
+using ::testing::SetArgPointee;
+
+class MockMutator : public Mutator {
+ public:
+  MOCK_METHOD2(Mutate, void(bool mutate, int* value));
+  ...
+};
+...
+
+  MockMutator mutator;
+  EXPECT_CALL(mutator, Mutate(true, _))
+      .WillOnce(SetArgPointee<1>(5));
+```
+
+In this example, when `mutator.Mutate()` is called, we will assign 5
+to the `int` variable pointed to by argument #1
+(0-based).
+
+`SetArgPointee()` conveniently makes an internal copy of the
+value you pass to it, removing the need to keep the value in scope and
+alive. The implication however is that the value must have a copy
+constructor and assignment operator.
+
+If the mock method also needs to return a value as well, you can chain
+`SetArgPointee()` with `Return()` using `DoAll()`:
+
+```
+using ::testing::_;
+using ::testing::Return;
+using ::testing::SetArgPointee;
+
+class MockMutator : public Mutator {
+ public:
+  ...
+  MOCK_METHOD1(MutateInt, bool(int* value));
+};
+...
+
+  MockMutator mutator;
+  EXPECT_CALL(mutator, MutateInt(_))
+      .WillOnce(DoAll(SetArgPointee<0>(5),
+                      Return(true)));
+```
+
+If the output argument is an array, use the
+`SetArrayArgument<N>(first, last)` action instead. It copies the
+elements in source range `[first, last)` to the array pointed to by
+the `N`-th (0-based) argument:
+
+```
+using ::testing::NotNull;
+using ::testing::SetArrayArgument;
+
+class MockArrayMutator : public ArrayMutator {
+ public:
+  MOCK_METHOD2(Mutate, void(int* values, int num_values));
+  ...
+};
+...
+
+  MockArrayMutator mutator;
+  int values[5] = { 1, 2, 3, 4, 5 };
+  EXPECT_CALL(mutator, Mutate(NotNull(), 5))
+      .WillOnce(SetArrayArgument<0>(values, values + 5));
+```
+
+This also works when the argument is an output iterator:
+
+```
+using ::testing::_;
+using ::testing::SeArrayArgument;
+
+class MockRolodex : public Rolodex {
+ public:
+  MOCK_METHOD1(GetNames, void(std::back_insert_iterator<vector<string> >));
+  ...
+};
+...
+
+  MockRolodex rolodex;
+  vector<string> names;
+  names.push_back("George");
+  names.push_back("John");
+  names.push_back("Thomas");
+  EXPECT_CALL(rolodex, GetNames(_))
+      .WillOnce(SetArrayArgument<0>(names.begin(), names.end()));
+```
+
+## Changing a Mock Object's Behavior Based on the State ##
+
+If you expect a call to change the behavior of a mock object, you can use `::testing::InSequence` to specify different behaviors before and after the call:
+
+```
+using ::testing::InSequence;
+using ::testing::Return;
+
+...
+  {
+    InSequence seq;
+    EXPECT_CALL(my_mock, IsDirty())
+        .WillRepeatedly(Return(true));
+    EXPECT_CALL(my_mock, Flush());
+    EXPECT_CALL(my_mock, IsDirty())
+        .WillRepeatedly(Return(false));
+  }
+  my_mock.FlushIfDirty();
+```
+
+This makes `my_mock.IsDirty()` return `true` before `my_mock.Flush()` is called and return `false` afterwards.
+
+If the behavior change is more complex, you can store the effects in a variable and make a mock method get its return value from that variable:
+
+```
+using ::testing::_;
+using ::testing::SaveArg;
+using ::testing::Return;
+
+ACTION_P(ReturnPointee, p) { return *p; }
+...
+  int previous_value = 0;
+  EXPECT_CALL(my_mock, GetPrevValue())
+      .WillRepeatedly(ReturnPointee(&previous_value));
+  EXPECT_CALL(my_mock, UpdateValue(_))
+      .WillRepeatedly(SaveArg<0>(&previous_value));
+  my_mock.DoSomethingToUpdateValue();
+```
+
+Here `my_mock.GetPrevValue()` will always return the argument of the last `UpdateValue()` call.
+
+## Setting the Default Value for a Return Type ##
+
+If a mock method's return type is a built-in C++ type or pointer, by
+default it will return 0 when invoked. Also, in C++ 11 and above, a mock
+method whose return type has a default constructor will return a default-constructed
+value by default.  You only need to specify an
+action if this default value doesn't work for you.
+
+Sometimes, you may want to change this default value, or you may want
+to specify a default value for types Google Mock doesn't know
+about. You can do this using the `::testing::DefaultValue` class
+template:
+
+```
+class MockFoo : public Foo {
+ public:
+  MOCK_METHOD0(CalculateBar, Bar());
+};
+...
+
+  Bar default_bar;
+  // Sets the default return value for type Bar.
+  DefaultValue<Bar>::Set(default_bar);
+
+  MockFoo foo;
+
+  // We don't need to specify an action here, as the default
+  // return value works for us.
+  EXPECT_CALL(foo, CalculateBar());
+
+  foo.CalculateBar();  // This should return default_bar.
+
+  // Unsets the default return value.
+  DefaultValue<Bar>::Clear();
+```
+
+Please note that changing the default value for a type can make you
+tests hard to understand. We recommend you to use this feature
+judiciously. For example, you may want to make sure the `Set()` and
+`Clear()` calls are right next to the code that uses your mock.
+
+## Setting the Default Actions for a Mock Method ##
+
+You've learned how to change the default value of a given
+type. However, this may be too coarse for your purpose: perhaps you
+have two mock methods with the same return type and you want them to
+have different behaviors. The `ON_CALL()` macro allows you to
+customize your mock's behavior at the method level:
+
+```
+using ::testing::_;
+using ::testing::AnyNumber;
+using ::testing::Gt;
+using ::testing::Return;
+...
+  ON_CALL(foo, Sign(_))
+      .WillByDefault(Return(-1));
+  ON_CALL(foo, Sign(0))
+      .WillByDefault(Return(0));
+  ON_CALL(foo, Sign(Gt(0)))
+      .WillByDefault(Return(1));
+
+  EXPECT_CALL(foo, Sign(_))
+      .Times(AnyNumber());
+
+  foo.Sign(5);   // This should return 1.
+  foo.Sign(-9);  // This should return -1.
+  foo.Sign(0);   // This should return 0.
+```
+
+As you may have guessed, when there are more than one `ON_CALL()`
+statements, the news order take precedence over the older ones. In
+other words, the **last** one that matches the function arguments will
+be used. This matching order allows you to set up the common behavior
+in a mock object's constructor or the test fixture's set-up phase and
+specialize the mock's behavior later.
+
+## Using Functions/Methods/Functors as Actions ##
+
+If the built-in actions don't suit you, you can easily use an existing
+function, method, or functor as an action:
+
+```
+using ::testing::_;
+using ::testing::Invoke;
+
+class MockFoo : public Foo {
+ public:
+  MOCK_METHOD2(Sum, int(int x, int y));
+  MOCK_METHOD1(ComplexJob, bool(int x));
+};
+
+int CalculateSum(int x, int y) { return x + y; }
+
+class Helper {
+ public:
+  bool ComplexJob(int x);
+};
+...
+
+  MockFoo foo;
+  Helper helper;
+  EXPECT_CALL(foo, Sum(_, _))
+      .WillOnce(Invoke(CalculateSum));
+  EXPECT_CALL(foo, ComplexJob(_))
+      .WillOnce(Invoke(&helper, &Helper::ComplexJob));
+
+  foo.Sum(5, 6);       // Invokes CalculateSum(5, 6).
+  foo.ComplexJob(10);  // Invokes helper.ComplexJob(10);
+```
+
+The only requirement is that the type of the function, etc must be
+_compatible_ with the signature of the mock function, meaning that the
+latter's arguments can be implicitly converted to the corresponding
+arguments of the former, and the former's return type can be
+implicitly converted to that of the latter. So, you can invoke
+something whose type is _not_ exactly the same as the mock function,
+as long as it's safe to do so - nice, huh?
+
+## Invoking a Function/Method/Functor Without Arguments ##
+
+`Invoke()` is very useful for doing actions that are more complex. It
+passes the mock function's arguments to the function or functor being
+invoked such that the callee has the full context of the call to work
+with. If the invoked function is not interested in some or all of the
+arguments, it can simply ignore them.
+
+Yet, a common pattern is that a test author wants to invoke a function
+without the arguments of the mock function. `Invoke()` allows her to
+do that using a wrapper function that throws away the arguments before
+invoking an underlining nullary function. Needless to say, this can be
+tedious and obscures the intent of the test.
+
+`InvokeWithoutArgs()` solves this problem. It's like `Invoke()` except
+that it doesn't pass the mock function's arguments to the
+callee. Here's an example:
+
+```
+using ::testing::_;
+using ::testing::InvokeWithoutArgs;
+
+class MockFoo : public Foo {
+ public:
+  MOCK_METHOD1(ComplexJob, bool(int n));
+};
+
+bool Job1() { ... }
+...
+
+  MockFoo foo;
+  EXPECT_CALL(foo, ComplexJob(_))
+      .WillOnce(InvokeWithoutArgs(Job1));
+
+  foo.ComplexJob(10);  // Invokes Job1().
+```
+
+## Invoking an Argument of the Mock Function ##
+
+Sometimes a mock function will receive a function pointer or a functor
+(in other words, a "callable") as an argument, e.g.
+
+```
+class MockFoo : public Foo {
+ public:
+  MOCK_METHOD2(DoThis, bool(int n, bool (*fp)(int)));
+};
+```
+
+and you may want to invoke this callable argument:
+
+```
+using ::testing::_;
+...
+  MockFoo foo;
+  EXPECT_CALL(foo, DoThis(_, _))
+      .WillOnce(...);
+  // Will execute (*fp)(5), where fp is the
+  // second argument DoThis() receives.
+```
+
+Arghh, you need to refer to a mock function argument but C++ has no
+lambda (yet), so you have to define your own action. :-( Or do you
+really?
+
+Well, Google Mock has an action to solve _exactly_ this problem:
+
+```
+  InvokeArgument<N>(arg_1, arg_2, ..., arg_m)
+```
+
+will invoke the `N`-th (0-based) argument the mock function receives,
+with `arg_1`, `arg_2`, ..., and `arg_m`. No matter if the argument is
+a function pointer or a functor, Google Mock handles them both.
+
+With that, you could write:
+
+```
+using ::testing::_;
+using ::testing::InvokeArgument;
+...
+  EXPECT_CALL(foo, DoThis(_, _))
+      .WillOnce(InvokeArgument<1>(5));
+  // Will execute (*fp)(5), where fp is the
+  // second argument DoThis() receives.
+```
+
+What if the callable takes an argument by reference? No problem - just
+wrap it inside `ByRef()`:
+
+```
+...
+  MOCK_METHOD1(Bar, bool(bool (*fp)(int, const Helper&)));
+...
+using ::testing::_;
+using ::testing::ByRef;
+using ::testing::InvokeArgument;
+...
+
+  MockFoo foo;
+  Helper helper;
+  ...
+  EXPECT_CALL(foo, Bar(_))
+      .WillOnce(InvokeArgument<0>(5, ByRef(helper)));
+  // ByRef(helper) guarantees that a reference to helper, not a copy of it,
+  // will be passed to the callable.
+```
+
+What if the callable takes an argument by reference and we do **not**
+wrap the argument in `ByRef()`? Then `InvokeArgument()` will _make a
+copy_ of the argument, and pass a _reference to the copy_, instead of
+a reference to the original value, to the callable. This is especially
+handy when the argument is a temporary value:
+
+```
+...
+  MOCK_METHOD1(DoThat, bool(bool (*f)(const double& x, const string& s)));
+...
+using ::testing::_;
+using ::testing::InvokeArgument;
+...
+
+  MockFoo foo;
+  ...
+  EXPECT_CALL(foo, DoThat(_))
+      .WillOnce(InvokeArgument<0>(5.0, string("Hi")));
+  // Will execute (*f)(5.0, string("Hi")), where f is the function pointer
+  // DoThat() receives.  Note that the values 5.0 and string("Hi") are
+  // temporary and dead once the EXPECT_CALL() statement finishes.  Yet
+  // it's fine to perform this action later, since a copy of the values
+  // are kept inside the InvokeArgument action.
+```
+
+## Ignoring an Action's Result ##
+
+Sometimes you have an action that returns _something_, but you need an
+action that returns `void` (perhaps you want to use it in a mock
+function that returns `void`, or perhaps it needs to be used in
+`DoAll()` and it's not the last in the list). `IgnoreResult()` lets
+you do that. For example:
+
+```
+using ::testing::_;
+using ::testing::Invoke;
+using ::testing::Return;
+
+int Process(const MyData& data);
+string DoSomething();
+
+class MockFoo : public Foo {
+ public:
+  MOCK_METHOD1(Abc, void(const MyData& data));
+  MOCK_METHOD0(Xyz, bool());
+};
+...
+
+  MockFoo foo;
+  EXPECT_CALL(foo, Abc(_))
+  // .WillOnce(Invoke(Process));
+  // The above line won't compile as Process() returns int but Abc() needs
+  // to return void.
+      .WillOnce(IgnoreResult(Invoke(Process)));
+
+  EXPECT_CALL(foo, Xyz())
+      .WillOnce(DoAll(IgnoreResult(Invoke(DoSomething)),
+      // Ignores the string DoSomething() returns.
+                      Return(true)));
+```
+
+Note that you **cannot** use `IgnoreResult()` on an action that already
+returns `void`. Doing so will lead to ugly compiler errors.
+
+## Selecting an Action's Arguments ##
+
+Say you have a mock function `Foo()` that takes seven arguments, and
+you have a custom action that you want to invoke when `Foo()` is
+called. Trouble is, the custom action only wants three arguments:
+
+```
+using ::testing::_;
+using ::testing::Invoke;
+...
+  MOCK_METHOD7(Foo, bool(bool visible, const string& name, int x, int y,
+                         const map<pair<int, int>, double>& weight,
+                         double min_weight, double max_wight));
+...
+
+bool IsVisibleInQuadrant1(bool visible, int x, int y) {
+  return visible && x >= 0 && y >= 0;
+}
+...
+
+  EXPECT_CALL(mock, Foo(_, _, _, _, _, _, _))
+      .WillOnce(Invoke(IsVisibleInQuadrant1));  // Uh, won't compile. :-(
+```
+
+To please the compiler God, you can to define an "adaptor" that has
+the same signature as `Foo()` and calls the custom action with the
+right arguments:
+
+```
+using ::testing::_;
+using ::testing::Invoke;
+
+bool MyIsVisibleInQuadrant1(bool visible, const string& name, int x, int y,
+                            const map<pair<int, int>, double>& weight,
+                            double min_weight, double max_wight) {
+  return IsVisibleInQuadrant1(visible, x, y);
+}
+...
+
+  EXPECT_CALL(mock, Foo(_, _, _, _, _, _, _))
+      .WillOnce(Invoke(MyIsVisibleInQuadrant1));  // Now it works.
+```
+
+But isn't this awkward?
+
+Google Mock provides a generic _action adaptor_, so you can spend your
+time minding more important business than writing your own
+adaptors. Here's the syntax:
+
+```
+  WithArgs<N1, N2, ..., Nk>(action)
+```
+
+creates an action that passes the arguments of the mock function at
+the given indices (0-based) to the inner `action` and performs
+it. Using `WithArgs`, our original example can be written as:
+
+```
+using ::testing::_;
+using ::testing::Invoke;
+using ::testing::WithArgs;
+...
+  EXPECT_CALL(mock, Foo(_, _, _, _, _, _, _))
+      .WillOnce(WithArgs<0, 2, 3>(Invoke(IsVisibleInQuadrant1)));
+      // No need to define your own adaptor.
+```
+
+For better readability, Google Mock also gives you:
+
+  * `WithoutArgs(action)` when the inner `action` takes _no_ argument, and
+  * `WithArg<N>(action)` (no `s` after `Arg`) when the inner `action` takes _one_ argument.
+
+As you may have realized, `InvokeWithoutArgs(...)` is just syntactic
+sugar for `WithoutArgs(Invoke(...))`.
+
+Here are more tips:
+
+  * The inner action used in `WithArgs` and friends does not have to be `Invoke()` -- it can be anything.
+  * You can repeat an argument in the argument list if necessary, e.g. `WithArgs<2, 3, 3, 5>(...)`.
+  * You can change the order of the arguments, e.g. `WithArgs<3, 2, 1>(...)`.
+  * The types of the selected arguments do _not_ have to match the signature of the inner action exactly. It works as long as they can be implicitly converted to the corresponding arguments of the inner action. For example, if the 4-th argument of the mock function is an `int` and `my_action` takes a `double`, `WithArg<4>(my_action)` will work.
+
+## Ignoring Arguments in Action Functions ##
+
+The selecting-an-action's-arguments recipe showed us one way to make a
+mock function and an action with incompatible argument lists fit
+together. The downside is that wrapping the action in
+`WithArgs<...>()` can get tedious for people writing the tests.
+
+If you are defining a function, method, or functor to be used with
+`Invoke*()`, and you are not interested in some of its arguments, an
+alternative to `WithArgs` is to declare the uninteresting arguments as
+`Unused`. This makes the definition less cluttered and less fragile in
+case the types of the uninteresting arguments change. It could also
+increase the chance the action function can be reused. For example,
+given
+
+```
+  MOCK_METHOD3(Foo, double(const string& label, double x, double y));
+  MOCK_METHOD3(Bar, double(int index, double x, double y));
+```
+
+instead of
+
+```
+using ::testing::_;
+using ::testing::Invoke;
+
+double DistanceToOriginWithLabel(const string& label, double x, double y) {
+  return sqrt(x*x + y*y);
+}
+
+double DistanceToOriginWithIndex(int index, double x, double y) {
+  return sqrt(x*x + y*y);
+}
+...
+
+  EXEPCT_CALL(mock, Foo("abc", _, _))
+      .WillOnce(Invoke(DistanceToOriginWithLabel));
+  EXEPCT_CALL(mock, Bar(5, _, _))
+      .WillOnce(Invoke(DistanceToOriginWithIndex));
+```
+
+you could write
+
+```
+using ::testing::_;
+using ::testing::Invoke;
+using ::testing::Unused;
+
+double DistanceToOrigin(Unused, double x, double y) {
+  return sqrt(x*x + y*y);
+}
+...
+
+  EXEPCT_CALL(mock, Foo("abc", _, _))
+      .WillOnce(Invoke(DistanceToOrigin));
+  EXEPCT_CALL(mock, Bar(5, _, _))
+      .WillOnce(Invoke(DistanceToOrigin));
+```
+
+## Sharing Actions ##
+
+Just like matchers, a Google Mock action object consists of a pointer
+to a ref-counted implementation object. Therefore copying actions is
+also allowed and very efficient. When the last action that references
+the implementation object dies, the implementation object will be
+deleted.
+
+If you have some complex action that you want to use again and again,
+you may not have to build it from scratch everytime. If the action
+doesn't have an internal state (i.e. if it always does the same thing
+no matter how many times it has been called), you can assign it to an
+action variable and use that variable repeatedly. For example:
+
+```
+  Action<bool(int*)> set_flag = DoAll(SetArgPointee<0>(5),
+                                      Return(true));
+  ... use set_flag in .WillOnce() and .WillRepeatedly() ...
+```
+
+However, if the action has its own state, you may be surprised if you
+share the action object. Suppose you have an action factory
+`IncrementCounter(init)` which creates an action that increments and
+returns a counter whose initial value is `init`, using two actions
+created from the same expression and using a shared action will
+exihibit different behaviors. Example:
+
+```
+  EXPECT_CALL(foo, DoThis())
+      .WillRepeatedly(IncrementCounter(0));
+  EXPECT_CALL(foo, DoThat())
+      .WillRepeatedly(IncrementCounter(0));
+  foo.DoThis();  // Returns 1.
+  foo.DoThis();  // Returns 2.
+  foo.DoThat();  // Returns 1 - Blah() uses a different
+                 // counter than Bar()'s.
+```
+
+versus
+
+```
+  Action<int()> increment = IncrementCounter(0);
+
+  EXPECT_CALL(foo, DoThis())
+      .WillRepeatedly(increment);
+  EXPECT_CALL(foo, DoThat())
+      .WillRepeatedly(increment);
+  foo.DoThis();  // Returns 1.
+  foo.DoThis();  // Returns 2.
+  foo.DoThat();  // Returns 3 - the counter is shared.
+```
+
+# Misc Recipes on Using Google Mock #
+
+## Mocking Methods That Use Move-Only Types ##
+
+C++11 introduced <em>move-only types</em>.  A move-only-typed value can be moved from one object to another, but cannot be copied.  `std::unique_ptr<T>` is probably the most commonly used move-only type.
+
+Mocking a method that takes and/or returns move-only types presents some challenges, but nothing insurmountable.  This recipe shows you how you can do it.
+
+Let’s say we are working on a fictional project that lets one post and share snippets called “buzzes”.  Your code uses these types:
+
+```
+enum class AccessLevel { kInternal, kPublic };
+
+class Buzz {
+ public:
+  explicit Buzz(AccessLevel access) { … }
+  ...
+};
+
+class Buzzer {
+ public:
+  virtual ~Buzzer() {}
+  virtual std::unique_ptr<Buzz> MakeBuzz(const std::string& text) = 0;
+  virtual bool ShareBuzz(std::unique_ptr<Buzz> buzz, Time timestamp) = 0;
+  ...
+};
+```
+
+A `Buzz` object represents a snippet being posted.  A class that implements the `Buzzer` interface is capable of creating and sharing `Buzz`.  Methods in `Buzzer` may return a `unique_ptr<Buzz>` or take a `unique_ptr<Buzz>`.  Now we need to mock `Buzzer` in our tests.
+
+To mock a method that returns a move-only type, you just use the familiar `MOCK_METHOD` syntax as usual:
+
+```
+class MockBuzzer : public Buzzer {
+ public:
+  MOCK_METHOD1(MakeBuzz, std::unique_ptr<Buzz>(const std::string& text));
+  …
+};
+```
+
+However, if you attempt to use the same `MOCK_METHOD` pattern to mock a method that takes a move-only parameter, you’ll get a compiler error currently:
+
+```
+  // Does NOT compile!
+  MOCK_METHOD2(ShareBuzz, bool(std::unique_ptr<Buzz> buzz, Time timestamp));
+```
+
+While it’s highly desirable to make this syntax just work, it’s not trivial and the work hasn’t been done yet.  Fortunately, there is a trick you can apply today to get something that works nearly as well as this.
+
+The trick, is to delegate the `ShareBuzz()` method to a mock method (let’s call it `DoShareBuzz()`) that does not take move-only parameters:
+
+```
+class MockBuzzer : public Buzzer {
+ public:
+  MOCK_METHOD1(MakeBuzz, std::unique_ptr<Buzz>(const std::string& text));
+  MOCK_METHOD2(DoShareBuzz, bool(Buzz* buzz, Time timestamp));
+  bool ShareBuzz(std::unique_ptr<Buzz> buzz, Time timestamp) {
+    return DoShareBuzz(buzz.get(), timestamp);
+  }
+};
+```
+
+Note that there's no need to define or declare `DoShareBuzz()` in a base class.  You only need to define it as a `MOCK_METHOD` in the mock class.
+
+Now that we have the mock class defined, we can use it in tests.  In the following code examples, we assume that we have defined a `MockBuzzer` object named `mock_buzzer_`:
+
+```
+  MockBuzzer mock_buzzer_;
+```
+
+First let’s see how we can set expectations on the `MakeBuzz()` method, which returns a `unique_ptr<Buzz>`.
+
+As usual, if you set an expectation without an action (i.e. the `.WillOnce()` or `.WillRepeated()` clause), when that expectation fires, the default action for that method will be taken.  Since `unique_ptr<>` has a default constructor that returns a null `unique_ptr`, that’s what you’ll get if you don’t specify an action:
+
+```
+  // Use the default action.
+  EXPECT_CALL(mock_buzzer_, MakeBuzz("hello"));
+
+  // Triggers the previous EXPECT_CALL.
+  EXPECT_EQ(nullptr, mock_buzzer_.MakeBuzz("hello"));
+```
+
+If you are not happy with the default action, you can tweak it.  Depending on what you need, you may either tweak the default action for a specific (mock object, mock method) combination using `ON_CALL()`, or you may tweak the default action for all mock methods that return a specific type.  The usage of `ON_CALL()` is similar to `EXPECT_CALL()`, so we’ll skip it and just explain how to do the latter (tweaking the default action for a specific return type).  You do this via the `DefaultValue<>::SetFactory()` and `DefaultValue<>::Clear()` API:
+
+```
+  // Sets the default action for return type std::unique_ptr<Buzz> to
+  // creating a new Buzz every time.
+  DefaultValue<std::unique_ptr<Buzz>>::SetFactory(
+      [] { return MakeUnique<Buzz>(AccessLevel::kInternal); });
+
+  // When this fires, the default action of MakeBuzz() will run, which
+  // will return a new Buzz object.
+  EXPECT_CALL(mock_buzzer_, MakeBuzz("hello")).Times(AnyNumber());
+
+  auto buzz1 = mock_buzzer_.MakeBuzz("hello");
+  auto buzz2 = mock_buzzer_.MakeBuzz("hello");
+  EXPECT_NE(nullptr, buzz1);
+  EXPECT_NE(nullptr, buzz2);
+  EXPECT_NE(buzz1, buzz2);
+
+  // Resets the default action for return type std::unique_ptr<Buzz>,
+  // to avoid interfere with other tests.
+  DefaultValue<std::unique_ptr<Buzz>>::Clear();
+```
+
+What if you want the method to do something other than the default action?  If you just need to return a pre-defined move-only value, you can use the `Return(ByMove(...))` action:
+
+```
+  // When this fires, the unique_ptr<> specified by ByMove(...) will
+  // be returned.
+  EXPECT_CALL(mock_buzzer_, MakeBuzz("world"))
+      .WillOnce(Return(ByMove(MakeUnique<Buzz>(AccessLevel::kInternal))));
+
+  EXPECT_NE(nullptr, mock_buzzer_.MakeBuzz("world"));
+```
+
+Note that `ByMove()` is essential here - if you drop it, the code won’t compile.
+
+Quiz time!  What do you think will happen if a `Return(ByMove(...))` action is performed more than once (e.g. you write `….WillRepeatedly(Return(ByMove(...)));`)?  Come think of it, after the first time the action runs, the source value will be consumed (since it’s a move-only value), so the next time around, there’s no value to move from -- you’ll get a run-time error that `Return(ByMove(...))` can only be run once.
+
+If you need your mock method to do more than just moving a pre-defined value, remember that you can always use `Invoke()` to call a lambda or a callable object, which can do pretty much anything you want:
+
+```
+  EXPECT_CALL(mock_buzzer_, MakeBuzz("x"))
+      .WillRepeatedly(Invoke([](const std::string& text) {
+        return std::make_unique<Buzz>(AccessLevel::kInternal);
+      }));
+
+  EXPECT_NE(nullptr, mock_buzzer_.MakeBuzz("x"));
+  EXPECT_NE(nullptr, mock_buzzer_.MakeBuzz("x"));
+```
+
+Every time this `EXPECT_CALL` fires, a new `unique_ptr<Buzz>` will be created and returned.  You cannot do this with `Return(ByMove(...))`.
+
+Now there’s one topic we haven’t covered: how do you set expectations on `ShareBuzz()`, which takes a move-only-typed parameter?  The answer is you don’t.  Instead, you set expectations on the `DoShareBuzz()` mock method (remember that we defined a `MOCK_METHOD` for `DoShareBuzz()`, not `ShareBuzz()`):
+
+```
+  EXPECT_CALL(mock_buzzer_, DoShareBuzz(NotNull(), _));
+
+  // When one calls ShareBuzz() on the MockBuzzer like this, the call is
+  // forwarded to DoShareBuzz(), which is mocked.  Therefore this statement
+  // will trigger the above EXPECT_CALL.
+  mock_buzzer_.ShareBuzz(MakeUnique&lt;Buzz&gt;(AccessLevel::kInternal),
+                         ::base::Now());
+```
+
+Some of you may have spotted one problem with this approach: the `DoShareBuzz()` mock method differs from the real `ShareBuzz()` method in that it cannot take ownership of the buzz parameter - `ShareBuzz()` will always delete buzz after `DoShareBuzz()` returns.  What if you need to save the buzz object somewhere for later use when `ShareBuzz()` is called?  Indeed, you'd be stuck.
+
+Another problem with the `DoShareBuzz()` we had is that it can surprise people reading or maintaining the test, as one would expect that `DoShareBuzz()` has (logically) the same contract as `ShareBuzz()`.
+
+Fortunately, these problems can be fixed with a bit more code.  Let's try to get it right this time:
+
+```
+class MockBuzzer : public Buzzer {
+ public:
+  MockBuzzer() {
+    // Since DoShareBuzz(buzz, time) is supposed to take ownership of
+    // buzz, define a default behavior for DoShareBuzz(buzz, time) to
+    // delete buzz.
+    ON_CALL(*this, DoShareBuzz(_, _))
+        .WillByDefault(Invoke([](Buzz* buzz, Time timestamp) {
+          delete buzz;
+          return true;
+        }));
+  }
+
+  MOCK_METHOD1(MakeBuzz, std::unique_ptr<Buzz>(const std::string& text));
+
+  // Takes ownership of buzz.
+  MOCK_METHOD2(DoShareBuzz, bool(Buzz* buzz, Time timestamp));
+  bool ShareBuzz(std::unique_ptr<Buzz> buzz, Time timestamp) {
+    return DoShareBuzz(buzz.release(), timestamp);
+  }
+};
+```
+
+Now, the mock `DoShareBuzz()` method is free to save the buzz argument for later use if this is what you want:
+
+```
+  std::unique_ptr<Buzz> intercepted_buzz;
+  EXPECT_CALL(mock_buzzer_, DoShareBuzz(NotNull(), _))
+      .WillOnce(Invoke([&amp;intercepted_buzz](Buzz* buzz, Time timestamp) {
+        // Save buzz in intercepted_buzz for analysis later.
+        intercepted_buzz.reset(buzz);
+        return false;
+      }));
+
+  mock_buzzer_.ShareBuzz(std::make_unique<Buzz>(AccessLevel::kInternal),
+                         Now());
+  EXPECT_NE(nullptr, intercepted_buzz);
+```
+
+Using the tricks covered in this recipe, you are now able to mock methods that take and/or return move-only types.  Put your newly-acquired power to good use - when you design a new API, you can now feel comfortable using `unique_ptrs` as appropriate, without fearing that doing so will compromise your tests.
+
+## Making the Compilation Faster ##
+
+Believe it or not, the _vast majority_ of the time spent on compiling
+a mock class is in generating its constructor and destructor, as they
+perform non-trivial tasks (e.g. verification of the
+expectations). What's more, mock methods with different signatures
+have different types and thus their constructors/destructors need to
+be generated by the compiler separately. As a result, if you mock many
+different types of methods, compiling your mock class can get really
+slow.
+
+If you are experiencing slow compilation, you can move the definition
+of your mock class' constructor and destructor out of the class body
+and into a `.cpp` file. This way, even if you `#include` your mock
+class in N files, the compiler only needs to generate its constructor
+and destructor once, resulting in a much faster compilation.
+
+Let's illustrate the idea using an example. Here's the definition of a
+mock class before applying this recipe:
+
+```
+// File mock_foo.h.
+...
+class MockFoo : public Foo {
+ public:
+  // Since we don't declare the constructor or the destructor,
+  // the compiler will generate them in every translation unit
+  // where this mock class is used.
+
+  MOCK_METHOD0(DoThis, int());
+  MOCK_METHOD1(DoThat, bool(const char* str));
+  ... more mock methods ...
+};
+```
+
+After the change, it would look like:
+
+```
+// File mock_foo.h.
+...
+class MockFoo : public Foo {
+ public:
+  // The constructor and destructor are declared, but not defined, here.
+  MockFoo();
+  virtual ~MockFoo();
+
+  MOCK_METHOD0(DoThis, int());
+  MOCK_METHOD1(DoThat, bool(const char* str));
+  ... more mock methods ...
+};
+```
+and
+```
+// File mock_foo.cpp.
+#include "path/to/mock_foo.h"
+
+// The definitions may appear trivial, but the functions actually do a
+// lot of things through the constructors/destructors of the member
+// variables used to implement the mock methods.
+MockFoo::MockFoo() {}
+MockFoo::~MockFoo() {}
+```
+
+## Forcing a Verification ##
+
+When it's being destoyed, your friendly mock object will automatically
+verify that all expectations on it have been satisfied, and will
+generate [Google Test](../../googletest/) failures
+if not. This is convenient as it leaves you with one less thing to
+worry about. That is, unless you are not sure if your mock object will
+be destoyed.
+
+How could it be that your mock object won't eventually be destroyed?
+Well, it might be created on the heap and owned by the code you are
+testing. Suppose there's a bug in that code and it doesn't delete the
+mock object properly - you could end up with a passing test when
+there's actually a bug.
+
+Using a heap checker is a good idea and can alleviate the concern, but
+its implementation may not be 100% reliable. So, sometimes you do want
+to _force_ Google Mock to verify a mock object before it is
+(hopefully) destructed. You can do this with
+`Mock::VerifyAndClearExpectations(&mock_object)`:
+
+```
+TEST(MyServerTest, ProcessesRequest) {
+  using ::testing::Mock;
+
+  MockFoo* const foo = new MockFoo;
+  EXPECT_CALL(*foo, ...)...;
+  // ... other expectations ...
+
+  // server now owns foo.
+  MyServer server(foo);
+  server.ProcessRequest(...);
+
+  // In case that server's destructor will forget to delete foo,
+  // this will verify the expectations anyway.
+  Mock::VerifyAndClearExpectations(foo);
+}  // server is destroyed when it goes out of scope here.
+```
+
+**Tip:** The `Mock::VerifyAndClearExpectations()` function returns a
+`bool` to indicate whether the verification was successful (`true` for
+yes), so you can wrap that function call inside a `ASSERT_TRUE()` if
+there is no point going further when the verification has failed.
+
+## Using Check Points ##
+
+Sometimes you may want to "reset" a mock object at various check
+points in your test: at each check point, you verify that all existing
+expectations on the mock object have been satisfied, and then you set
+some new expectations on it as if it's newly created. This allows you
+to work with a mock object in "phases" whose sizes are each
+manageable.
+
+One such scenario is that in your test's `SetUp()` function, you may
+want to put the object you are testing into a certain state, with the
+help from a mock object. Once in the desired state, you want to clear
+all expectations on the mock, such that in the `TEST_F` body you can
+set fresh expectations on it.
+
+As you may have figured out, the `Mock::VerifyAndClearExpectations()`
+function we saw in the previous recipe can help you here. Or, if you
+are using `ON_CALL()` to set default actions on the mock object and
+want to clear the default actions as well, use
+`Mock::VerifyAndClear(&mock_object)` instead. This function does what
+`Mock::VerifyAndClearExpectations(&mock_object)` does and returns the
+same `bool`, **plus** it clears the `ON_CALL()` statements on
+`mock_object` too.
+
+Another trick you can use to achieve the same effect is to put the
+expectations in sequences and insert calls to a dummy "check-point"
+function at specific places. Then you can verify that the mock
+function calls do happen at the right time. For example, if you are
+exercising code:
+
+```
+Foo(1);
+Foo(2);
+Foo(3);
+```
+
+and want to verify that `Foo(1)` and `Foo(3)` both invoke
+`mock.Bar("a")`, but `Foo(2)` doesn't invoke anything. You can write:
+
+```
+using ::testing::MockFunction;
+
+TEST(FooTest, InvokesBarCorrectly) {
+  MyMock mock;
+  // Class MockFunction<F> has exactly one mock method.  It is named
+  // Call() and has type F.
+  MockFunction<void(string check_point_name)> check;
+  {
+    InSequence s;
+
+    EXPECT_CALL(mock, Bar("a"));
+    EXPECT_CALL(check, Call("1"));
+    EXPECT_CALL(check, Call("2"));
+    EXPECT_CALL(mock, Bar("a"));
+  }
+  Foo(1);
+  check.Call("1");
+  Foo(2);
+  check.Call("2");
+  Foo(3);
+}
+```
+
+The expectation spec says that the first `Bar("a")` must happen before
+check point "1", the second `Bar("a")` must happen after check point "2",
+and nothing should happen between the two check points. The explicit
+check points make it easy to tell which `Bar("a")` is called by which
+call to `Foo()`.
+
+## Mocking Destructors ##
+
+Sometimes you want to make sure a mock object is destructed at the
+right time, e.g. after `bar->A()` is called but before `bar->B()` is
+called. We already know that you can specify constraints on the order
+of mock function calls, so all we need to do is to mock the destructor
+of the mock function.
+
+This sounds simple, except for one problem: a destructor is a special
+function with special syntax and special semantics, and the
+`MOCK_METHOD0` macro doesn't work for it:
+
+```
+  MOCK_METHOD0(~MockFoo, void());  // Won't compile!
+```
+
+The good news is that you can use a simple pattern to achieve the same
+effect. First, add a mock function `Die()` to your mock class and call
+it in the destructor, like this:
+
+```
+class MockFoo : public Foo {
+  ...
+  // Add the following two lines to the mock class.
+  MOCK_METHOD0(Die, void());
+  virtual ~MockFoo() { Die(); }
+};
+```
+
+(If the name `Die()` clashes with an existing symbol, choose another
+name.) Now, we have translated the problem of testing when a `MockFoo`
+object dies to testing when its `Die()` method is called:
+
+```
+  MockFoo* foo = new MockFoo;
+  MockBar* bar = new MockBar;
+  ...
+  {
+    InSequence s;
+
+    // Expects *foo to die after bar->A() and before bar->B().
+    EXPECT_CALL(*bar, A());
+    EXPECT_CALL(*foo, Die());
+    EXPECT_CALL(*bar, B());
+  }
+```
+
+And that's that.
+
+## Using Google Mock and Threads ##
+
+**IMPORTANT NOTE:** What we describe in this recipe is **ONLY** true on
+platforms where Google Mock is thread-safe. Currently these are only
+platforms that support the pthreads library (this includes Linux and Mac).
+To make it thread-safe on other platforms we only need to implement
+some synchronization operations in `"gtest/internal/gtest-port.h"`.
+
+In a **unit** test, it's best if you could isolate and test a piece of
+code in a single-threaded context. That avoids race conditions and
+dead locks, and makes debugging your test much easier.
+
+Yet many programs are multi-threaded, and sometimes to test something
+we need to pound on it from more than one thread. Google Mock works
+for this purpose too.
+
+Remember the steps for using a mock:
+
+  1. Create a mock object `foo`.
+  1. Set its default actions and expectations using `ON_CALL()` and `EXPECT_CALL()`.
+  1. The code under test calls methods of `foo`.
+  1. Optionally, verify and reset the mock.
+  1. Destroy the mock yourself, or let the code under test destroy it. The destructor will automatically verify it.
+
+If you follow the following simple rules, your mocks and threads can
+live happily together:
+
+  * Execute your _test code_ (as opposed to the code being tested) in _one_ thread. This makes your test easy to follow.
+  * Obviously, you can do step #1 without locking.
+  * When doing step #2 and #5, make sure no other thread is accessing `foo`. Obvious too, huh?
+  * #3 and #4 can be done either in one thread or in multiple threads - anyway you want. Google Mock takes care of the locking, so you don't have to do any - unless required by your test logic.
+
+If you violate the rules (for example, if you set expectations on a
+mock while another thread is calling its methods), you get undefined
+behavior. That's not fun, so don't do it.
+
+Google Mock guarantees that the action for a mock function is done in
+the same thread that called the mock function. For example, in
+
+```
+  EXPECT_CALL(mock, Foo(1))
+      .WillOnce(action1);
+  EXPECT_CALL(mock, Foo(2))
+      .WillOnce(action2);
+```
+
+if `Foo(1)` is called in thread 1 and `Foo(2)` is called in thread 2,
+Google Mock will execute `action1` in thread 1 and `action2` in thread
+2.
+
+Google Mock does _not_ impose a sequence on actions performed in
+different threads (doing so may create deadlocks as the actions may
+need to cooperate). This means that the execution of `action1` and
+`action2` in the above example _may_ interleave. If this is a problem,
+you should add proper synchronization logic to `action1` and `action2`
+to make the test thread-safe.
+
+
+Also, remember that `DefaultValue<T>` is a global resource that
+potentially affects _all_ living mock objects in your
+program. Naturally, you won't want to mess with it from multiple
+threads or when there still are mocks in action.
+
+## Controlling How Much Information Google Mock Prints ##
+
+When Google Mock sees something that has the potential of being an
+error (e.g. a mock function with no expectation is called, a.k.a. an
+uninteresting call, which is allowed but perhaps you forgot to
+explicitly ban the call), it prints some warning messages, including
+the arguments of the function and the return value. Hopefully this
+will remind you to take a look and see if there is indeed a problem.
+
+Sometimes you are confident that your tests are correct and may not
+appreciate such friendly messages. Some other times, you are debugging
+your tests or learning about the behavior of the code you are testing,
+and wish you could observe every mock call that happens (including
+argument values and the return value). Clearly, one size doesn't fit
+all.
+
+You can control how much Google Mock tells you using the
+`--gmock_verbose=LEVEL` command-line flag, where `LEVEL` is a string
+with three possible values:
+
+  * `info`: Google Mock will print all informational messages, warnings, and errors (most verbose). At this setting, Google Mock will also log any calls to the `ON_CALL/EXPECT_CALL` macros.
+  * `warning`: Google Mock will print both warnings and errors (less verbose). This is the default.
+  * `error`: Google Mock will print errors only (least verbose).
+
+Alternatively, you can adjust the value of that flag from within your
+tests like so:
+
+```
+  ::testing::FLAGS_gmock_verbose = "error";
+```
+
+Now, judiciously use the right flag to enable Google Mock serve you better!
+
+## Gaining Super Vision into Mock Calls ##
+
+You have a test using Google Mock. It fails: Google Mock tells you
+that some expectations aren't satisfied. However, you aren't sure why:
+Is there a typo somewhere in the matchers? Did you mess up the order
+of the `EXPECT_CALL`s? Or is the code under test doing something
+wrong?  How can you find out the cause?
+
+Won't it be nice if you have X-ray vision and can actually see the
+trace of all `EXPECT_CALL`s and mock method calls as they are made?
+For each call, would you like to see its actual argument values and
+which `EXPECT_CALL` Google Mock thinks it matches?
+
+You can unlock this power by running your test with the
+`--gmock_verbose=info` flag. For example, given the test program:
+
+```
+using testing::_;
+using testing::HasSubstr;
+using testing::Return;
+
+class MockFoo {
+ public:
+  MOCK_METHOD2(F, void(const string& x, const string& y));
+};
+
+TEST(Foo, Bar) {
+  MockFoo mock;
+  EXPECT_CALL(mock, F(_, _)).WillRepeatedly(Return());
+  EXPECT_CALL(mock, F("a", "b"));
+  EXPECT_CALL(mock, F("c", HasSubstr("d")));
+
+  mock.F("a", "good");
+  mock.F("a", "b");
+}
+```
+
+if you run it with `--gmock_verbose=info`, you will see this output:
+
+```
+[ RUN      ] Foo.Bar
+
+foo_test.cc:14: EXPECT_CALL(mock, F(_, _)) invoked
+foo_test.cc:15: EXPECT_CALL(mock, F("a", "b")) invoked
+foo_test.cc:16: EXPECT_CALL(mock, F("c", HasSubstr("d"))) invoked
+foo_test.cc:14: Mock function call matches EXPECT_CALL(mock, F(_, _))...
+    Function call: F(@0x7fff7c8dad40"a", @0x7fff7c8dad10"good")
+foo_test.cc:15: Mock function call matches EXPECT_CALL(mock, F("a", "b"))...
+    Function call: F(@0x7fff7c8dada0"a", @0x7fff7c8dad70"b")
+foo_test.cc:16: Failure
+Actual function call count doesn't match EXPECT_CALL(mock, F("c", HasSubstr("d")))...
+         Expected: to be called once
+           Actual: never called - unsatisfied and active
+[  FAILED  ] Foo.Bar
+```
+
+Suppose the bug is that the `"c"` in the third `EXPECT_CALL` is a typo
+and should actually be `"a"`. With the above message, you should see
+that the actual `F("a", "good")` call is matched by the first
+`EXPECT_CALL`, not the third as you thought. From that it should be
+obvious that the third `EXPECT_CALL` is written wrong. Case solved.
+
+## Running Tests in Emacs ##
+
+If you build and run your tests in Emacs, the source file locations of
+Google Mock and [Google Test](../../googletest/)
+errors will be highlighted. Just press `<Enter>` on one of them and
+you'll be taken to the offending line. Or, you can just type `C-x ``
+to jump to the next error.
+
+To make it even easier, you can add the following lines to your
+`~/.emacs` file:
+
+```
+(global-set-key "\M-m"   'compile)  ; m is for make
+(global-set-key [M-down] 'next-error)
+(global-set-key [M-up]   '(lambda () (interactive) (next-error -1)))
+```
+
+Then you can type `M-m` to start a build, or `M-up`/`M-down` to move
+back and forth between errors.
+
+## Fusing Google Mock Source Files ##
+
+Google Mock's implementation consists of dozens of files (excluding
+its own tests).  Sometimes you may want them to be packaged up in
+fewer files instead, such that you can easily copy them to a new
+machine and start hacking there.  For this we provide an experimental
+Python script `fuse_gmock_files.py` in the `scripts/` directory
+(starting with release 1.2.0).  Assuming you have Python 2.4 or above
+installed on your machine, just go to that directory and run
+```
+python fuse_gmock_files.py OUTPUT_DIR
+```
+
+and you should see an `OUTPUT_DIR` directory being created with files
+`gtest/gtest.h`, `gmock/gmock.h`, and `gmock-gtest-all.cc` in it.
+These three files contain everything you need to use Google Mock (and
+Google Test).  Just copy them to anywhere you want and you are ready
+to write tests and use mocks.  You can use the
+[scrpts/test/Makefile](../scripts/test/Makefile) file as an example on how to compile your tests
+against them.
+
+# Extending Google Mock #
+
+## Writing New Matchers Quickly ##
+
+The `MATCHER*` family of macros can be used to define custom matchers
+easily.  The syntax:
+
+```
+MATCHER(name, description_string_expression) { statements; }
+```
+
+will define a matcher with the given name that executes the
+statements, which must return a `bool` to indicate if the match
+succeeds.  Inside the statements, you can refer to the value being
+matched by `arg`, and refer to its type by `arg_type`.
+
+The description string is a `string`-typed expression that documents
+what the matcher does, and is used to generate the failure message
+when the match fails.  It can (and should) reference the special
+`bool` variable `negation`, and should evaluate to the description of
+the matcher when `negation` is `false`, or that of the matcher's
+negation when `negation` is `true`.
+
+For convenience, we allow the description string to be empty (`""`),
+in which case Google Mock will use the sequence of words in the
+matcher name as the description.
+
+For example:
+```
+MATCHER(IsDivisibleBy7, "") { return (arg % 7) == 0; }
+```
+allows you to write
+```
+  // Expects mock_foo.Bar(n) to be called where n is divisible by 7.
+  EXPECT_CALL(mock_foo, Bar(IsDivisibleBy7()));
+```
+or,
+```
+using ::testing::Not;
+...
+  EXPECT_THAT(some_expression, IsDivisibleBy7());
+  EXPECT_THAT(some_other_expression, Not(IsDivisibleBy7()));
+```
+If the above assertions fail, they will print something like:
+```
+  Value of: some_expression
+  Expected: is divisible by 7
+    Actual: 27
+...
+  Value of: some_other_expression
+  Expected: not (is divisible by 7)
+    Actual: 21
+```
+where the descriptions `"is divisible by 7"` and `"not (is divisible
+by 7)"` are automatically calculated from the matcher name
+`IsDivisibleBy7`.
+
+As you may have noticed, the auto-generated descriptions (especially
+those for the negation) may not be so great. You can always override
+them with a string expression of your own:
+```
+MATCHER(IsDivisibleBy7, std::string(negation ? "isn't" : "is") +
+                        " divisible by 7") {
+  return (arg % 7) == 0;
+}
+```
+
+Optionally, you can stream additional information to a hidden argument
+named `result_listener` to explain the match result. For example, a
+better definition of `IsDivisibleBy7` is:
+```
+MATCHER(IsDivisibleBy7, "") {
+  if ((arg % 7) == 0)
+    return true;
+
+  *result_listener << "the remainder is " << (arg % 7);
+  return false;
+}
+```
+
+With this definition, the above assertion will give a better message:
+```
+  Value of: some_expression
+  Expected: is divisible by 7
+    Actual: 27 (the remainder is 6)
+```
+
+You should let `MatchAndExplain()` print _any additional information_
+that can help a user understand the match result. Note that it should
+explain why the match succeeds in case of a success (unless it's
+obvious) - this is useful when the matcher is used inside
+`Not()`. There is no need to print the argument value itself, as
+Google Mock already prints it for you.
+
+**Notes:**
+
+  1. The type of the value being matched (`arg_type`) is determined by the context in which you use the matcher and is supplied to you by the compiler, so you don't need to worry about declaring it (nor can you).  This allows the matcher to be polymorphic.  For example, `IsDivisibleBy7()` can be used to match any type where the value of `(arg % 7) == 0` can be implicitly converted to a `bool`.  In the `Bar(IsDivisibleBy7())` example above, if method `Bar()` takes an `int`, `arg_type` will be `int`; if it takes an `unsigned long`, `arg_type` will be `unsigned long`; and so on.
+  1. Google Mock doesn't guarantee when or how many times a matcher will be invoked. Therefore the matcher logic must be _purely functional_ (i.e. it cannot have any side effect, and the result must not depend on anything other than the value being matched and the matcher parameters). This requirement must be satisfied no matter how you define the matcher (e.g. using one of the methods described in the following recipes). In particular, a matcher can never call a mock function, as that will affect the state of the mock object and Google Mock.
+
+## Writing New Parameterized Matchers Quickly ##
+
+Sometimes you'll want to define a matcher that has parameters.  For that you
+can use the macro:
+```
+MATCHER_P(name, param_name, description_string) { statements; }
+```
+where the description string can be either `""` or a string expression
+that references `negation` and `param_name`.
+
+For example:
+```
+MATCHER_P(HasAbsoluteValue, value, "") { return abs(arg) == value; }
+```
+will allow you to write:
+```
+  EXPECT_THAT(Blah("a"), HasAbsoluteValue(n));
+```
+which may lead to this message (assuming `n` is 10):
+```
+  Value of: Blah("a")
+  Expected: has absolute value 10
+    Actual: -9
+```
+
+Note that both the matcher description and its parameter are
+printed, making the message human-friendly.
+
+In the matcher definition body, you can write `foo_type` to
+reference the type of a parameter named `foo`.  For example, in the
+body of `MATCHER_P(HasAbsoluteValue, value)` above, you can write
+`value_type` to refer to the type of `value`.
+
+Google Mock also provides `MATCHER_P2`, `MATCHER_P3`, ..., up to
+`MATCHER_P10` to support multi-parameter matchers:
+```
+MATCHER_Pk(name, param_1, ..., param_k, description_string) { statements; }
+```
+
+Please note that the custom description string is for a particular
+**instance** of the matcher, where the parameters have been bound to
+actual values.  Therefore usually you'll want the parameter values to
+be part of the description.  Google Mock lets you do that by
+referencing the matcher parameters in the description string
+expression.
+
+For example,
+```
+  using ::testing::PrintToString;
+  MATCHER_P2(InClosedRange, low, hi,
+             std::string(negation ? "isn't" : "is") + " in range [" +
+             PrintToString(low) + ", " + PrintToString(hi) + "]") {
+    return low <= arg && arg <= hi;
+  }
+  ...
+  EXPECT_THAT(3, InClosedRange(4, 6));
+```
+would generate a failure that contains the message:
+```
+  Expected: is in range [4, 6]
+```
+
+If you specify `""` as the description, the failure message will
+contain the sequence of words in the matcher name followed by the
+parameter values printed as a tuple.  For example,
+```
+  MATCHER_P2(InClosedRange, low, hi, "") { ... }
+  ...
+  EXPECT_THAT(3, InClosedRange(4, 6));
+```
+would generate a failure that contains the text:
+```
+  Expected: in closed range (4, 6)
+```
+
+For the purpose of typing, you can view
+```
+MATCHER_Pk(Foo, p1, ..., pk, description_string) { ... }
+```
+as shorthand for
+```
+template <typename p1_type, ..., typename pk_type>
+FooMatcherPk<p1_type, ..., pk_type>
+Foo(p1_type p1, ..., pk_type pk) { ... }
+```
+
+When you write `Foo(v1, ..., vk)`, the compiler infers the types of
+the parameters `v1`, ..., and `vk` for you.  If you are not happy with
+the result of the type inference, you can specify the types by
+explicitly instantiating the template, as in `Foo<long, bool>(5, false)`.
+As said earlier, you don't get to (or need to) specify
+`arg_type` as that's determined by the context in which the matcher
+is used.
+
+You can assign the result of expression `Foo(p1, ..., pk)` to a
+variable of type `FooMatcherPk<p1_type, ..., pk_type>`.  This can be
+useful when composing matchers.  Matchers that don't have a parameter
+or have only one parameter have special types: you can assign `Foo()`
+to a `FooMatcher`-typed variable, and assign `Foo(p)` to a
+`FooMatcherP<p_type>`-typed variable.
+
+While you can instantiate a matcher template with reference types,
+passing the parameters by pointer usually makes your code more
+readable.  If, however, you still want to pass a parameter by
+reference, be aware that in the failure message generated by the
+matcher you will see the value of the referenced object but not its
+address.
+
+You can overload matchers with different numbers of parameters:
+```
+MATCHER_P(Blah, a, description_string_1) { ... }
+MATCHER_P2(Blah, a, b, description_string_2) { ... }
+```
+
+While it's tempting to always use the `MATCHER*` macros when defining
+a new matcher, you should also consider implementing
+`MatcherInterface` or using `MakePolymorphicMatcher()` instead (see
+the recipes that follow), especially if you need to use the matcher a
+lot.  While these approaches require more work, they give you more
+control on the types of the value being matched and the matcher
+parameters, which in general leads to better compiler error messages
+that pay off in the long run.  They also allow overloading matchers
+based on parameter types (as opposed to just based on the number of
+parameters).
+
+## Writing New Monomorphic Matchers ##
+
+A matcher of argument type `T` implements
+`::testing::MatcherInterface<T>` and does two things: it tests whether a
+value of type `T` matches the matcher, and can describe what kind of
+values it matches. The latter ability is used for generating readable
+error messages when expectations are violated.
+
+The interface looks like this:
+
+```
+class MatchResultListener {
+ public:
+  ...
+  // Streams x to the underlying ostream; does nothing if the ostream
+  // is NULL.
+  template <typename T>
+  MatchResultListener& operator<<(const T& x);
+
+  // Returns the underlying ostream.
+  ::std::ostream* stream();
+};
+
+template <typename T>
+class MatcherInterface {
+ public:
+  virtual ~MatcherInterface();
+
+  // Returns true iff the matcher matches x; also explains the match
+  // result to 'listener'.
+  virtual bool MatchAndExplain(T x, MatchResultListener* listener) const = 0;
+
+  // Describes this matcher to an ostream.
+  virtual void DescribeTo(::std::ostream* os) const = 0;
+
+  // Describes the negation of this matcher to an ostream.
+  virtual void DescribeNegationTo(::std::ostream* os) const;
+};
+```
+
+If you need a custom matcher but `Truly()` is not a good option (for
+example, you may not be happy with the way `Truly(predicate)`
+describes itself, or you may want your matcher to be polymorphic as
+`Eq(value)` is), you can define a matcher to do whatever you want in
+two steps: first implement the matcher interface, and then define a
+factory function to create a matcher instance. The second step is not
+strictly needed but it makes the syntax of using the matcher nicer.
+
+For example, you can define a matcher to test whether an `int` is
+divisible by 7 and then use it like this:
+```
+using ::testing::MakeMatcher;
+using ::testing::Matcher;
+using ::testing::MatcherInterface;
+using ::testing::MatchResultListener;
+
+class DivisibleBy7Matcher : public MatcherInterface<int> {
+ public:
+  virtual bool MatchAndExplain(int n, MatchResultListener* listener) const {
+    return (n % 7) == 0;
+  }
+
+  virtual void DescribeTo(::std::ostream* os) const {
+    *os << "is divisible by 7";
+  }
+
+  virtual void DescribeNegationTo(::std::ostream* os) const {
+    *os << "is not divisible by 7";
+  }
+};
+
+inline Matcher<int> DivisibleBy7() {
+  return MakeMatcher(new DivisibleBy7Matcher);
+}
+...
+
+  EXPECT_CALL(foo, Bar(DivisibleBy7()));
+```
+
+You may improve the matcher message by streaming additional
+information to the `listener` argument in `MatchAndExplain()`:
+
+```
+class DivisibleBy7Matcher : public MatcherInterface<int> {
+ public:
+  virtual bool MatchAndExplain(int n,
+                               MatchResultListener* listener) const {
+    const int remainder = n % 7;
+    if (remainder != 0) {
+      *listener << "the remainder is " << remainder;
+    }
+    return remainder == 0;
+  }
+  ...
+};
+```
+
+Then, `EXPECT_THAT(x, DivisibleBy7());` may general a message like this:
+```
+Value of: x
+Expected: is divisible by 7
+  Actual: 23 (the remainder is 2)
+```
+
+## Writing New Polymorphic Matchers ##
+
+You've learned how to write your own matchers in the previous
+recipe. Just one problem: a matcher created using `MakeMatcher()` only
+works for one particular type of arguments. If you want a
+_polymorphic_ matcher that works with arguments of several types (for
+instance, `Eq(x)` can be used to match a `value` as long as `value` ==
+`x` compiles -- `value` and `x` don't have to share the same type),
+you can learn the trick from `"gmock/gmock-matchers.h"` but it's a bit
+involved.
+
+Fortunately, most of the time you can define a polymorphic matcher
+easily with the help of `MakePolymorphicMatcher()`. Here's how you can
+define `NotNull()` as an example:
+
+```
+using ::testing::MakePolymorphicMatcher;
+using ::testing::MatchResultListener;
+using ::testing::NotNull;
+using ::testing::PolymorphicMatcher;
+
+class NotNullMatcher {
+ public:
+  // To implement a polymorphic matcher, first define a COPYABLE class
+  // that has three members MatchAndExplain(), DescribeTo(), and
+  // DescribeNegationTo(), like the following.
+
+  // In this example, we want to use NotNull() with any pointer, so
+  // MatchAndExplain() accepts a pointer of any type as its first argument.
+  // In general, you can define MatchAndExplain() as an ordinary method or
+  // a method template, or even overload it.
+  template <typename T>
+  bool MatchAndExplain(T* p,
+                       MatchResultListener* /* listener */) const {
+    return p != NULL;
+  }
+
+  // Describes the property of a value matching this matcher.
+  void DescribeTo(::std::ostream* os) const { *os << "is not NULL"; }
+
+  // Describes the property of a value NOT matching this matcher.
+  void DescribeNegationTo(::std::ostream* os) const { *os << "is NULL"; }
+};
+
+// To construct a polymorphic matcher, pass an instance of the class
+// to MakePolymorphicMatcher().  Note the return type.
+inline PolymorphicMatcher<NotNullMatcher> NotNull() {
+  return MakePolymorphicMatcher(NotNullMatcher());
+}
+...
+
+  EXPECT_CALL(foo, Bar(NotNull()));  // The argument must be a non-NULL pointer.
+```
+
+**Note:** Your polymorphic matcher class does **not** need to inherit from
+`MatcherInterface` or any other class, and its methods do **not** need
+to be virtual.
+
+Like in a monomorphic matcher, you may explain the match result by
+streaming additional information to the `listener` argument in
+`MatchAndExplain()`.
+
+## Writing New Cardinalities ##
+
+A cardinality is used in `Times()` to tell Google Mock how many times
+you expect a call to occur. It doesn't have to be exact. For example,
+you can say `AtLeast(5)` or `Between(2, 4)`.
+
+If the built-in set of cardinalities doesn't suit you, you are free to
+define your own by implementing the following interface (in namespace
+`testing`):
+
+```
+class CardinalityInterface {
+ public:
+  virtual ~CardinalityInterface();
+
+  // Returns true iff call_count calls will satisfy this cardinality.
+  virtual bool IsSatisfiedByCallCount(int call_count) const = 0;
+
+  // Returns true iff call_count calls will saturate this cardinality.
+  virtual bool IsSaturatedByCallCount(int call_count) const = 0;
+
+  // Describes self to an ostream.
+  virtual void DescribeTo(::std::ostream* os) const = 0;
+};
+```
+
+For example, to specify that a call must occur even number of times,
+you can write
+
+```
+using ::testing::Cardinality;
+using ::testing::CardinalityInterface;
+using ::testing::MakeCardinality;
+
+class EvenNumberCardinality : public CardinalityInterface {
+ public:
+  virtual bool IsSatisfiedByCallCount(int call_count) const {
+    return (call_count % 2) == 0;
+  }
+
+  virtual bool IsSaturatedByCallCount(int call_count) const {
+    return false;
+  }
+
+  virtual void DescribeTo(::std::ostream* os) const {
+    *os << "called even number of times";
+  }
+};
+
+Cardinality EvenNumber() {
+  return MakeCardinality(new EvenNumberCardinality);
+}
+...
+
+  EXPECT_CALL(foo, Bar(3))
+      .Times(EvenNumber());
+```
+
+## Writing New Actions Quickly ##
+
+If the built-in actions don't work for you, and you find it
+inconvenient to use `Invoke()`, you can use a macro from the `ACTION*`
+family to quickly define a new action that can be used in your code as
+if it's a built-in action.
+
+By writing
+```
+ACTION(name) { statements; }
+```
+in a namespace scope (i.e. not inside a class or function), you will
+define an action with the given name that executes the statements.
+The value returned by `statements` will be used as the return value of
+the action.  Inside the statements, you can refer to the K-th
+(0-based) argument of the mock function as `argK`.  For example:
+```
+ACTION(IncrementArg1) { return ++(*arg1); }
+```
+allows you to write
+```
+... WillOnce(IncrementArg1());
+```
+
+Note that you don't need to specify the types of the mock function
+arguments.  Rest assured that your code is type-safe though:
+you'll get a compiler error if `*arg1` doesn't support the `++`
+operator, or if the type of `++(*arg1)` isn't compatible with the mock
+function's return type.
+
+Another example:
+```
+ACTION(Foo) {
+  (*arg2)(5);
+  Blah();
+  *arg1 = 0;
+  return arg0;
+}
+```
+defines an action `Foo()` that invokes argument #2 (a function pointer)
+with 5, calls function `Blah()`, sets the value pointed to by argument
+#1 to 0, and returns argument #0.
+
+For more convenience and flexibility, you can also use the following
+pre-defined symbols in the body of `ACTION`:
+
+| `argK_type` | The type of the K-th (0-based) argument of the mock function |
+|:------------|:-------------------------------------------------------------|
+| `args`      | All arguments of the mock function as a tuple                |
+| `args_type` | The type of all arguments of the mock function as a tuple    |
+| `return_type` | The return type of the mock function                         |
+| `function_type` | The type of the mock function                                |
+
+For example, when using an `ACTION` as a stub action for mock function:
+```
+int DoSomething(bool flag, int* ptr);
+```
+we have:
+| **Pre-defined Symbol** | **Is Bound To** |
+|:-----------------------|:----------------|
+| `arg0`                 | the value of `flag` |
+| `arg0_type`            | the type `bool` |
+| `arg1`                 | the value of `ptr` |
+| `arg1_type`            | the type `int*` |
+| `args`                 | the tuple `(flag, ptr)` |
+| `args_type`            | the type `::testing::tuple<bool, int*>` |
+| `return_type`          | the type `int`  |
+| `function_type`        | the type `int(bool, int*)` |
+
+## Writing New Parameterized Actions Quickly ##
+
+Sometimes you'll want to parameterize an action you define.  For that
+we have another macro
+```
+ACTION_P(name, param) { statements; }
+```
+
+For example,
+```
+ACTION_P(Add, n) { return arg0 + n; }
+```
+will allow you to write
+```
+// Returns argument #0 + 5.
+... WillOnce(Add(5));
+```
+
+For convenience, we use the term _arguments_ for the values used to
+invoke the mock function, and the term _parameters_ for the values
+used to instantiate an action.
+
+Note that you don't need to provide the type of the parameter either.
+Suppose the parameter is named `param`, you can also use the
+Google-Mock-defined symbol `param_type` to refer to the type of the
+parameter as inferred by the compiler.  For example, in the body of
+`ACTION_P(Add, n)` above, you can write `n_type` for the type of `n`.
+
+Google Mock also provides `ACTION_P2`, `ACTION_P3`, and etc to support
+multi-parameter actions.  For example,
+```
+ACTION_P2(ReturnDistanceTo, x, y) {
+  double dx = arg0 - x;
+  double dy = arg1 - y;
+  return sqrt(dx*dx + dy*dy);
+}
+```
+lets you write
+```
+... WillOnce(ReturnDistanceTo(5.0, 26.5));
+```
+
+You can view `ACTION` as a degenerated parameterized action where the
+number of parameters is 0.
+
+You can also easily define actions overloaded on the number of parameters:
+```
+ACTION_P(Plus, a) { ... }
+ACTION_P2(Plus, a, b) { ... }
+```
+
+## Restricting the Type of an Argument or Parameter in an ACTION ##
+
+For maximum brevity and reusability, the `ACTION*` macros don't ask
+you to provide the types of the mock function arguments and the action
+parameters.  Instead, we let the compiler infer the types for us.
+
+Sometimes, however, we may want to be more explicit about the types.
+There are several tricks to do that.  For example:
+```
+ACTION(Foo) {
+  // Makes sure arg0 can be converted to int.
+  int n = arg0;
+  ... use n instead of arg0 here ...
+}
+
+ACTION_P(Bar, param) {
+  // Makes sure the type of arg1 is const char*.
+  ::testing::StaticAssertTypeEq<const char*, arg1_type>();
+
+  // Makes sure param can be converted to bool.
+  bool flag = param;
+}
+```
+where `StaticAssertTypeEq` is a compile-time assertion in Google Test
+that verifies two types are the same.
+
+## Writing New Action Templates Quickly ##
+
+Sometimes you want to give an action explicit template parameters that
+cannot be inferred from its value parameters.  `ACTION_TEMPLATE()`
+supports that and can be viewed as an extension to `ACTION()` and
+`ACTION_P*()`.
+
+The syntax:
+```
+ACTION_TEMPLATE(ActionName,
+                HAS_m_TEMPLATE_PARAMS(kind1, name1, ..., kind_m, name_m),
+                AND_n_VALUE_PARAMS(p1, ..., p_n)) { statements; }
+```
+
+defines an action template that takes _m_ explicit template parameters
+and _n_ value parameters, where _m_ is between 1 and 10, and _n_ is
+between 0 and 10.  `name_i` is the name of the i-th template
+parameter, and `kind_i` specifies whether it's a `typename`, an
+integral constant, or a template.  `p_i` is the name of the i-th value
+parameter.
+
+Example:
+```
+// DuplicateArg<k, T>(output) converts the k-th argument of the mock
+// function to type T and copies it to *output.
+ACTION_TEMPLATE(DuplicateArg,
+                // Note the comma between int and k:
+                HAS_2_TEMPLATE_PARAMS(int, k, typename, T),
+                AND_1_VALUE_PARAMS(output)) {
+  *output = T(::testing::get<k>(args));
+}
+```
+
+To create an instance of an action template, write:
+```
+  ActionName<t1, ..., t_m>(v1, ..., v_n)
+```
+where the `t`s are the template arguments and the
+`v`s are the value arguments.  The value argument
+types are inferred by the compiler.  For example:
+```
+using ::testing::_;
+...
+  int n;
+  EXPECT_CALL(mock, Foo(_, _))
+      .WillOnce(DuplicateArg<1, unsigned char>(&n));
+```
+
+If you want to explicitly specify the value argument types, you can
+provide additional template arguments:
+```
+  ActionName<t1, ..., t_m, u1, ..., u_k>(v1, ..., v_n)
+```
+where `u_i` is the desired type of `v_i`.
+
+`ACTION_TEMPLATE` and `ACTION`/`ACTION_P*` can be overloaded on the
+number of value parameters, but not on the number of template
+parameters.  Without the restriction, the meaning of the following is
+unclear:
+
+```
+  OverloadedAction<int, bool>(x);
+```
+
+Are we using a single-template-parameter action where `bool` refers to
+the type of `x`, or a two-template-parameter action where the compiler
+is asked to infer the type of `x`?
+
+## Using the ACTION Object's Type ##
+
+If you are writing a function that returns an `ACTION` object, you'll
+need to know its type.  The type depends on the macro used to define
+the action and the parameter types.  The rule is relatively simple:
+| **Given Definition** | **Expression** | **Has Type** |
+|:---------------------|:---------------|:-------------|
+| `ACTION(Foo)`        | `Foo()`        | `FooAction`  |
+| `ACTION_TEMPLATE(Foo, HAS_m_TEMPLATE_PARAMS(...), AND_0_VALUE_PARAMS())` |   `Foo<t1, ..., t_m>()` | `FooAction<t1, ..., t_m>` |
+| `ACTION_P(Bar, param)` | `Bar(int_value)` | `BarActionP<int>` |
+| `ACTION_TEMPLATE(Bar, HAS_m_TEMPLATE_PARAMS(...), AND_1_VALUE_PARAMS(p1))` | `Bar<t1, ..., t_m>(int_value)` | `FooActionP<t1, ..., t_m, int>` |
+| `ACTION_P2(Baz, p1, p2)` | `Baz(bool_value, int_value)` | `BazActionP2<bool, int>` |
+| `ACTION_TEMPLATE(Baz, HAS_m_TEMPLATE_PARAMS(...), AND_2_VALUE_PARAMS(p1, p2))` | `Baz<t1, ..., t_m>(bool_value, int_value)` | `FooActionP2<t1, ..., t_m, bool, int>` |
+| ...                  | ...            | ...          |
+
+Note that we have to pick different suffixes (`Action`, `ActionP`,
+`ActionP2`, and etc) for actions with different numbers of value
+parameters, or the action definitions cannot be overloaded on the
+number of them.
+
+## Writing New Monomorphic Actions ##
+
+While the `ACTION*` macros are very convenient, sometimes they are
+inappropriate.  For example, despite the tricks shown in the previous
+recipes, they don't let you directly specify the types of the mock
+function arguments and the action parameters, which in general leads
+to unoptimized compiler error messages that can baffle unfamiliar
+users.  They also don't allow overloading actions based on parameter
+types without jumping through some hoops.
+
+An alternative to the `ACTION*` macros is to implement
+`::testing::ActionInterface<F>`, where `F` is the type of the mock
+function in which the action will be used. For example:
+
+```
+template <typename F>class ActionInterface {
+ public:
+  virtual ~ActionInterface();
+
+  // Performs the action.  Result is the return type of function type
+  // F, and ArgumentTuple is the tuple of arguments of F.
+  //
+  // For example, if F is int(bool, const string&), then Result would
+  // be int, and ArgumentTuple would be ::testing::tuple<bool, const string&>.
+  virtual Result Perform(const ArgumentTuple& args) = 0;
+};
+
+using ::testing::_;
+using ::testing::Action;
+using ::testing::ActionInterface;
+using ::testing::MakeAction;
+
+typedef int IncrementMethod(int*);
+
+class IncrementArgumentAction : public ActionInterface<IncrementMethod> {
+ public:
+  virtual int Perform(const ::testing::tuple<int*>& args) {
+    int* p = ::testing::get<0>(args);  // Grabs the first argument.
+    return *p++;
+  }
+};
+
+Action<IncrementMethod> IncrementArgument() {
+  return MakeAction(new IncrementArgumentAction);
+}
+...
+
+  EXPECT_CALL(foo, Baz(_))
+      .WillOnce(IncrementArgument());
+
+  int n = 5;
+  foo.Baz(&n);  // Should return 5 and change n to 6.
+```
+
+## Writing New Polymorphic Actions ##
+
+The previous recipe showed you how to define your own action. This is
+all good, except that you need to know the type of the function in
+which the action will be used. Sometimes that can be a problem. For
+example, if you want to use the action in functions with _different_
+types (e.g. like `Return()` and `SetArgPointee()`).
+
+If an action can be used in several types of mock functions, we say
+it's _polymorphic_. The `MakePolymorphicAction()` function template
+makes it easy to define such an action:
+
+```
+namespace testing {
+
+template <typename Impl>
+PolymorphicAction<Impl> MakePolymorphicAction(const Impl& impl);
+
+}  // namespace testing
+```
+
+As an example, let's define an action that returns the second argument
+in the mock function's argument list. The first step is to define an
+implementation class:
+
+```
+class ReturnSecondArgumentAction {
+ public:
+  template <typename Result, typename ArgumentTuple>
+  Result Perform(const ArgumentTuple& args) const {
+    // To get the i-th (0-based) argument, use ::testing::get<i>(args).
+    return ::testing::get<1>(args);
+  }
+};
+```
+
+This implementation class does _not_ need to inherit from any
+particular class. What matters is that it must have a `Perform()`
+method template. This method template takes the mock function's
+arguments as a tuple in a **single** argument, and returns the result of
+the action. It can be either `const` or not, but must be invokable
+with exactly one template argument, which is the result type. In other
+words, you must be able to call `Perform<R>(args)` where `R` is the
+mock function's return type and `args` is its arguments in a tuple.
+
+Next, we use `MakePolymorphicAction()` to turn an instance of the
+implementation class into the polymorphic action we need. It will be
+convenient to have a wrapper for this:
+
+```
+using ::testing::MakePolymorphicAction;
+using ::testing::PolymorphicAction;
+
+PolymorphicAction<ReturnSecondArgumentAction> ReturnSecondArgument() {
+  return MakePolymorphicAction(ReturnSecondArgumentAction());
+}
+```
+
+Now, you can use this polymorphic action the same way you use the
+built-in ones:
+
+```
+using ::testing::_;
+
+class MockFoo : public Foo {
+ public:
+  MOCK_METHOD2(DoThis, int(bool flag, int n));
+  MOCK_METHOD3(DoThat, string(int x, const char* str1, const char* str2));
+};
+...
+
+  MockFoo foo;
+  EXPECT_CALL(foo, DoThis(_, _))
+      .WillOnce(ReturnSecondArgument());
+  EXPECT_CALL(foo, DoThat(_, _, _))
+      .WillOnce(ReturnSecondArgument());
+  ...
+  foo.DoThis(true, 5);         // Will return 5.
+  foo.DoThat(1, "Hi", "Bye");  // Will return "Hi".
+```
+
+## Teaching Google Mock How to Print Your Values ##
+
+When an uninteresting or unexpected call occurs, Google Mock prints the
+argument values and the stack trace to help you debug.  Assertion
+macros like `EXPECT_THAT` and `EXPECT_EQ` also print the values in
+question when the assertion fails.  Google Mock and Google Test do this using
+Google Test's user-extensible value printer.
+
+This printer knows how to print built-in C++ types, native arrays, STL
+containers, and any type that supports the `<<` operator.  For other
+types, it prints the raw bytes in the value and hopes that you the
+user can figure it out.
+[Google Test's advanced guide](../../googletest/docs/AdvancedGuide.md#teaching-google-test-how-to-print-your-values)
+explains how to extend the printer to do a better job at
+printing your particular type than to dump the bytes.
diff --git a/src/external/googletest/googlemock/docs/DesignDoc.md b/src/external/googletest/googlemock/docs/DesignDoc.md
new file mode 100644 (file)
index 0000000..3f515c3
--- /dev/null
@@ -0,0 +1,280 @@
+This page discusses the design of new Google Mock features.
+
+
+
+# Macros for Defining Actions #
+
+## Problem ##
+
+Due to the lack of closures in C++, it currently requires some
+non-trivial effort to define a custom action in Google Mock.  For
+example, suppose you want to "increment the value pointed to by the
+second argument of the mock function and return it", you could write:
+
+```
+int IncrementArg1(Unused, int* p, Unused) {
+  return ++(*p);
+}
+
+... WillOnce(Invoke(IncrementArg1));
+```
+
+There are several things unsatisfactory about this approach:
+
+  * Even though the action only cares about the second argument of the mock function, its definition needs to list other arguments as dummies.  This is tedious.
+  * The defined action is usable only in mock functions that takes exactly 3 arguments - an unnecessary restriction.
+  * To use the action, one has to say `Invoke(IncrementArg1)`, which isn't as nice as `IncrementArg1()`.
+
+The latter two problems can be overcome using `MakePolymorphicAction()`,
+but it requires much more boilerplate code:
+
+```
+class IncrementArg1Action {
+ public:
+  template <typename Result, typename ArgumentTuple>
+  Result Perform(const ArgumentTuple& args) const {
+    return ++(*tr1::get<1>(args));
+  }
+};
+
+PolymorphicAction<IncrementArg1Action> IncrementArg1() {
+  return MakePolymorphicAction(IncrementArg1Action());
+}
+
+... WillOnce(IncrementArg1());
+```
+
+Our goal is to allow defining custom actions with the least amount of
+boiler-plate C++ requires.
+
+## Solution ##
+
+We propose to introduce a new macro:
+```
+ACTION(name) { statements; }
+```
+
+Using this in a namespace scope will define an action with the given
+name that executes the statements.  Inside the statements, you can
+refer to the K-th (0-based) argument of the mock function as `argK`.
+For example:
+```
+ACTION(IncrementArg1) { return ++(*arg1); }
+```
+allows you to write
+```
+... WillOnce(IncrementArg1());
+```
+
+Note that you don't need to specify the types of the mock function
+arguments, as brevity is a top design goal here.  Rest assured that
+your code is still type-safe though: you'll get a compiler error if
+`*arg1` doesn't support the `++` operator, or if the type of
+`++(*arg1)` isn't compatible with the mock function's return type.
+
+Another example:
+```
+ACTION(Foo) {
+  (*arg2)(5);
+  Blah();
+  *arg1 = 0;
+  return arg0;
+}
+```
+defines an action `Foo()` that invokes argument #2 (a function pointer)
+with 5, calls function `Blah()`, sets the value pointed to by argument
+#1 to 0, and returns argument #0.
+
+For more convenience and flexibility, you can also use the following
+pre-defined symbols in the body of `ACTION`:
+
+| `argK_type` | The type of the K-th (0-based) argument of the mock function |
+|:------------|:-------------------------------------------------------------|
+| `args`      | All arguments of the mock function as a tuple                |
+| `args_type` | The type of all arguments of the mock function as a tuple    |
+| `return_type` | The return type of the mock function                         |
+| `function_type` | The type of the mock function                                |
+
+For example, when using an `ACTION` as a stub action for mock function:
+```
+int DoSomething(bool flag, int* ptr);
+```
+we have:
+| **Pre-defined Symbol** | **Is Bound To** |
+|:-----------------------|:----------------|
+| `arg0`                 | the value of `flag` |
+| `arg0_type`            | the type `bool` |
+| `arg1`                 | the value of `ptr` |
+| `arg1_type`            | the type `int*` |
+| `args`                 | the tuple `(flag, ptr)` |
+| `args_type`            | the type `std::tr1::tuple<bool, int*>` |
+| `return_type`          | the type `int`  |
+| `function_type`        | the type `int(bool, int*)` |
+
+## Parameterized actions ##
+
+Sometimes you'll want to parameterize the action.   For that we propose
+another macro
+```
+ACTION_P(name, param) { statements; }
+```
+
+For example,
+```
+ACTION_P(Add, n) { return arg0 + n; }
+```
+will allow you to write
+```
+// Returns argument #0 + 5.
+... WillOnce(Add(5));
+```
+
+For convenience, we use the term _arguments_ for the values used to
+invoke the mock function, and the term _parameters_ for the values
+used to instantiate an action.
+
+Note that you don't need to provide the type of the parameter either.
+Suppose the parameter is named `param`, you can also use the
+Google-Mock-defined symbol `param_type` to refer to the type of the
+parameter as inferred by the compiler.
+
+We will also provide `ACTION_P2`, `ACTION_P3`, and etc to support
+multi-parameter actions.  For example,
+```
+ACTION_P2(ReturnDistanceTo, x, y) {
+  double dx = arg0 - x;
+  double dy = arg1 - y;
+  return sqrt(dx*dx + dy*dy);
+}
+```
+lets you write
+```
+... WillOnce(ReturnDistanceTo(5.0, 26.5));
+```
+
+You can view `ACTION` as a degenerated parameterized action where the
+number of parameters is 0.
+
+## Advanced Usages ##
+
+### Overloading Actions ###
+
+You can easily define actions overloaded on the number of parameters:
+```
+ACTION_P(Plus, a) { ... }
+ACTION_P2(Plus, a, b) { ... }
+```
+
+### Restricting the Type of an Argument or Parameter ###
+
+For maximum brevity and reusability, the `ACTION*` macros don't let
+you specify the types of the mock function arguments and the action
+parameters.  Instead, we let the compiler infer the types for us.
+
+Sometimes, however, we may want to be more explicit about the types.
+There are several tricks to do that.  For example:
+```
+ACTION(Foo) {
+  // Makes sure arg0 can be converted to int.
+  int n = arg0;
+  ... use n instead of arg0 here ...
+}
+
+ACTION_P(Bar, param) {
+  // Makes sure the type of arg1 is const char*.
+  ::testing::StaticAssertTypeEq<const char*, arg1_type>();
+
+  // Makes sure param can be converted to bool.
+  bool flag = param;
+}
+```
+where `StaticAssertTypeEq` is a compile-time assertion we plan to add to
+Google Test (the name is chosen to match `static_assert` in C++0x).
+
+### Using the ACTION Object's Type ###
+
+If you are writing a function that returns an `ACTION` object, you'll
+need to know its type.  The type depends on the macro used to define
+the action and the parameter types.  The rule is relatively simple:
+| **Given Definition** | **Expression** | **Has Type** |
+|:---------------------|:---------------|:-------------|
+| `ACTION(Foo)`        | `Foo()`        | `FooAction`  |
+| `ACTION_P(Bar, param)` | `Bar(int_value)` | `BarActionP<int>` |
+| `ACTION_P2(Baz, p1, p2)` | `Baz(bool_value, int_value)` | `BazActionP2<bool, int>` |
+| ...                  | ...            | ...          |
+
+Note that we have to pick different suffixes (`Action`, `ActionP`,
+`ActionP2`, and etc) for actions with different numbers of parameters,
+or the action definitions cannot be overloaded on the number of
+parameters.
+
+## When to Use ##
+
+While the new macros are very convenient, please also consider other
+means of implementing actions (e.g. via `ActionInterface` or
+`MakePolymorphicAction()`), especially if you need to use the defined
+action a lot.  While the other approaches require more work, they give
+you more control on the types of the mock function arguments and the
+action parameters, which in general leads to better compiler error
+messages that pay off in the long run.  They also allow overloading
+actions based on parameter types, as opposed to just the number of
+parameters.
+
+## Related Work ##
+
+As you may have realized, the `ACTION*` macros resemble closures (also
+known as lambda expressions or anonymous functions).  Indeed, both of
+them seek to lower the syntactic overhead for defining a function.
+
+C++0x will support lambdas, but they are not part of C++ right now.
+Some non-standard libraries (most notably BLL or Boost Lambda Library)
+try to alleviate this problem.  However, they are not a good choice
+for defining actions as:
+
+  * They are non-standard and not widely installed.  Google Mock only depends on standard libraries and `tr1::tuple`, which is part of the new C++ standard and comes with gcc 4+.  We want to keep it that way.
+  * They are not trivial to learn.
+  * They will become obsolete when C++0x's lambda feature is widely supported.  We don't want to make our users use a dying library.
+  * Since they are based on operators, they are rather ad hoc: you cannot use statements, and you cannot pass the lambda arguments to a function, for example.
+  * They have subtle semantics that easily confuses new users.  For example, in expression `_1++ + foo++`, `foo` will be incremented only once where the expression is evaluated, while `_1` will be incremented every time the unnamed function is invoked.  This is far from intuitive.
+
+`ACTION*` avoid all these problems.
+
+## Future Improvements ##
+
+There may be a need for composing `ACTION*` definitions (i.e. invoking
+another `ACTION` inside the definition of one `ACTION*`).  We are not
+sure we want it yet, as one can get a similar effect by putting
+`ACTION` definitions in function templates and composing the function
+templates.  We'll revisit this based on user feedback.
+
+The reason we don't allow `ACTION*()` inside a function body is that
+the current C++ standard doesn't allow function-local types to be used
+to instantiate templates.  The upcoming C++0x standard will lift this
+restriction.  Once this feature is widely supported by compilers, we
+can revisit the implementation and add support for using `ACTION*()`
+inside a function.
+
+C++0x will also support lambda expressions.  When they become
+available, we may want to support using lambdas as actions.
+
+# Macros for Defining Matchers #
+
+Once the macros for defining actions are implemented, we plan to do
+the same for matchers:
+
+```
+MATCHER(name) { statements; }
+```
+
+where you can refer to the value being matched as `arg`.  For example,
+given:
+
+```
+MATCHER(IsPositive) { return arg > 0; }
+```
+
+you can use `IsPositive()` as a matcher that matches a value iff it is
+greater than 0.
+
+We will also add `MATCHER_P`, `MATCHER_P2`, and etc for parameterized
+matchers.
\ No newline at end of file
diff --git a/src/external/googletest/googlemock/docs/DevGuide.md b/src/external/googletest/googlemock/docs/DevGuide.md
new file mode 100644 (file)
index 0000000..f4bab75
--- /dev/null
@@ -0,0 +1,132 @@
+
+
+If you are interested in understanding the internals of Google Mock,
+building from source, or contributing ideas or modifications to the
+project, then this document is for you.
+
+# Introduction #
+
+First, let's give you some background of the project.
+
+## Licensing ##
+
+All Google Mock source and pre-built packages are provided under the [New BSD License](http://www.opensource.org/licenses/bsd-license.php).
+
+## The Google Mock Community ##
+
+The Google Mock community exists primarily through the [discussion group](http://groups.google.com/group/googlemock), the
+[issue tracker](https://github.com/google/googletest/issues) and, to a lesser extent, the [source control repository](../). You are definitely encouraged to contribute to the
+discussion and you can also help us to keep the effectiveness of the
+group high by following and promoting the guidelines listed here.
+
+### Please Be Friendly ###
+
+Showing courtesy and respect to others is a vital part of the Google
+culture, and we strongly encourage everyone participating in Google
+Mock development to join us in accepting nothing less. Of course,
+being courteous is not the same as failing to constructively disagree
+with each other, but it does mean that we should be respectful of each
+other when enumerating the 42 technical reasons that a particular
+proposal may not be the best choice. There's never a reason to be
+antagonistic or dismissive toward anyone who is sincerely trying to
+contribute to a discussion.
+
+Sure, C++ testing is serious business and all that, but it's also
+a lot of fun. Let's keep it that way. Let's strive to be one of the
+friendliest communities in all of open source.
+
+### Where to Discuss Google Mock ###
+
+As always, discuss Google Mock in the official [Google C++ Mocking Framework discussion group](http://groups.google.com/group/googlemock).  You don't have to actually submit
+code in order to sign up. Your participation itself is a valuable
+contribution.
+
+# Working with the Code #
+
+If you want to get your hands dirty with the code inside Google Mock,
+this is the section for you.
+
+## Checking Out the Source from Subversion ##
+
+Checking out the Google Mock source is most useful if you plan to
+tweak it yourself.  You check out the source for Google Mock using a
+[Subversion](http://subversion.tigris.org/) client as you would for any
+other project hosted on Google Code.  Please see the instruction on
+the [source code access page](../) for how to do it.
+
+## Compiling from Source ##
+
+Once you check out the code, you can find instructions on how to
+compile it in the [README](../README.md) file.
+
+## Testing ##
+
+A mocking framework is of no good if itself is not thoroughly tested.
+Tests should be written for any new code, and changes should be
+verified to not break existing tests before they are submitted for
+review. To perform the tests, follow the instructions in [README](http://code.google.com/p/googlemock/source/browse/trunk/README) and
+verify that there are no failures.
+
+# Contributing Code #
+
+We are excited that Google Mock is now open source, and hope to get
+great patches from the community. Before you fire up your favorite IDE
+and begin hammering away at that new feature, though, please take the
+time to read this section and understand the process. While it seems
+rigorous, we want to keep a high standard of quality in the code
+base.
+
+## Contributor License Agreements ##
+
+You must sign a Contributor License Agreement (CLA) before we can
+accept any code.  The CLA protects you and us.
+
+  * If you are an individual writing original source code and you're sure you own the intellectual property, then you'll need to sign an [individual CLA](http://code.google.com/legal/individual-cla-v1.0.html).
+  * If you work for a company that wants to allow you to contribute your work to Google Mock, then you'll need to sign a [corporate CLA](http://code.google.com/legal/corporate-cla-v1.0.html).
+
+Follow either of the two links above to access the appropriate CLA and
+instructions for how to sign and return it.
+
+## Coding Style ##
+
+To keep the source consistent, readable, diffable and easy to merge,
+we use a fairly rigid coding style, as defined by the [google-styleguide](https://github.com/google/styleguide) project.  All patches will be expected
+to conform to the style outlined [here](https://github.com/google/styleguide/blob/gh-pages/cppguide.xml).
+
+## Submitting Patches ##
+
+Please do submit code. Here's what you need to do:
+
+  1. Normally you should make your change against the SVN trunk instead of a branch or a tag, as the latter two are for release control and should be treated mostly as read-only.
+  1. Decide which code you want to submit. A submission should be a set of changes that addresses one issue in the [Google Mock issue tracker](http://code.google.com/p/googlemock/issues/list). Please don't mix more than one logical change per submittal, because it makes the history hard to follow. If you want to make a change that doesn't have a corresponding issue in the issue tracker, please create one.
+  1. Also, coordinate with team members that are listed on the issue in question. This ensures that work isn't being duplicated and communicating your plan early also generally leads to better patches.
+  1. Ensure that your code adheres to the [Google Mock source code style](#Coding_Style.md).
+  1. Ensure that there are unit tests for your code.
+  1. Sign a Contributor License Agreement.
+  1. Create a patch file using `svn diff`.
+  1. We use [Rietveld](http://codereview.appspot.com/) to do web-based code reviews.  You can read about the tool [here](https://github.com/rietveld-codereview/rietveld/wiki).  When you are ready, upload your patch via Rietveld and notify `googlemock@googlegroups.com` to review it.  There are several ways to upload the patch.  We recommend using the [upload\_gmock.py](../scripts/upload_gmock.py) script, which you can find in the `scripts/` folder in the SVN trunk.
+
+## Google Mock Committers ##
+
+The current members of the Google Mock engineering team are the only
+committers at present. In the great tradition of eating one's own
+dogfood, we will be requiring each new Google Mock engineering team
+member to earn the right to become a committer by following the
+procedures in this document, writing consistently great code, and
+demonstrating repeatedly that he or she truly gets the zen of Google
+Mock.
+
+# Release Process #
+
+We follow the typical release process for Subversion-based projects:
+
+  1. A release branch named `release-X.Y` is created.
+  1. Bugs are fixed and features are added in trunk; those individual patches are merged into the release branch until it's stable.
+  1. An individual point release (the `Z` in `X.Y.Z`) is made by creating a tag from the branch.
+  1. Repeat steps 2 and 3 throughout one release cycle (as determined by features or time).
+  1. Go back to step 1 to create another release branch and so on.
+
+
+---
+
+This page is based on the [Making GWT Better](http://code.google.com/webtoolkit/makinggwtbetter.html) guide from the [Google Web Toolkit](http://code.google.com/webtoolkit/) project.  Except as otherwise [noted](http://code.google.com/policies.html#restrictions), the content of this page is licensed under the [Creative Commons Attribution 2.5 License](http://creativecommons.org/licenses/by/2.5/).
diff --git a/src/external/googletest/googlemock/docs/Documentation.md b/src/external/googletest/googlemock/docs/Documentation.md
new file mode 100644 (file)
index 0000000..444151e
--- /dev/null
@@ -0,0 +1,12 @@
+This page lists all documentation wiki pages for Google Mock **(the SVN trunk version)**
+- **if you use a released version of Google Mock, please read the documentation for that specific version instead.**
+
+  * [ForDummies](ForDummies.md) -- start here if you are new to Google Mock.
+  * [CheatSheet](CheatSheet.md) -- a quick reference.
+  * [CookBook](CookBook.md) -- recipes for doing various tasks using Google Mock.
+  * [FrequentlyAskedQuestions](FrequentlyAskedQuestions.md) -- check here before asking a question on the mailing list.
+
+To contribute code to Google Mock, read:
+
+  * [DevGuide](DevGuide.md) -- read this _before_ writing your first patch.
+  * [Pump Manual](../googletest/docs/PumpManual.md) -- how we generate some of Google Mock's source files.
diff --git a/src/external/googletest/googlemock/docs/ForDummies.md b/src/external/googletest/googlemock/docs/ForDummies.md
new file mode 100644 (file)
index 0000000..0da4cbe
--- /dev/null
@@ -0,0 +1,439 @@
+
+
+(**Note:** If you get compiler errors that you don't understand, be sure to consult [Google Mock Doctor](FrequentlyAskedQuestions.md#how-am-i-supposed-to-make-sense-of-these-horrible-template-errors).)
+
+# What Is Google C++ Mocking Framework? #
+When you write a prototype or test, often it's not feasible or wise to rely on real objects entirely. A **mock object** implements the same interface as a real object (so it can be used as one), but lets you specify at run time how it will be used and what it should do (which methods will be called? in which order? how many times? with what arguments? what will they return? etc).
+
+**Note:** It is easy to confuse the term _fake objects_ with mock objects. Fakes and mocks actually mean very different things in the Test-Driven Development (TDD) community:
+
+  * **Fake** objects have working implementations, but usually take some shortcut (perhaps to make the operations less expensive), which makes them not suitable for production. An in-memory file system would be an example of a fake.
+  * **Mocks** are objects pre-programmed with _expectations_, which form a specification of the calls they are expected to receive.
+
+If all this seems too abstract for you, don't worry - the most important thing to remember is that a mock allows you to check the _interaction_ between itself and code that uses it. The difference between fakes and mocks will become much clearer once you start to use mocks.
+
+**Google C++ Mocking Framework** (or **Google Mock** for short) is a library (sometimes we also call it a "framework" to make it sound cool) for creating mock classes and using them. It does to C++ what [jMock](http://www.jmock.org/) and [EasyMock](http://www.easymock.org/) do to Java.
+
+Using Google Mock involves three basic steps:
+
+  1. Use some simple macros to describe the interface you want to mock, and they will expand to the implementation of your mock class;
+  1. Create some mock objects and specify its expectations and behavior using an intuitive syntax;
+  1. Exercise code that uses the mock objects. Google Mock will catch any violation of the expectations as soon as it arises.
+
+# Why Google Mock? #
+While mock objects help you remove unnecessary dependencies in tests and make them fast and reliable, using mocks manually in C++ is _hard_:
+
+  * Someone has to implement the mocks. The job is usually tedious and error-prone. No wonder people go great distance to avoid it.
+  * The quality of those manually written mocks is a bit, uh, unpredictable. You may see some really polished ones, but you may also see some that were hacked up in a hurry and have all sorts of ad hoc restrictions.
+  * The knowledge you gained from using one mock doesn't transfer to the next.
+
+In contrast, Java and Python programmers have some fine mock frameworks, which automate the creation of mocks. As a result, mocking is a proven effective technique and widely adopted practice in those communities. Having the right tool absolutely makes the difference.
+
+Google Mock was built to help C++ programmers. It was inspired by [jMock](http://www.jmock.org/) and [EasyMock](http://www.easymock.org/), but designed with C++'s specifics in mind. It is your friend if any of the following problems is bothering you:
+
+  * You are stuck with a sub-optimal design and wish you had done more prototyping before it was too late, but prototyping in C++ is by no means "rapid".
+  * Your tests are slow as they depend on too many libraries or use expensive resources (e.g. a database).
+  * Your tests are brittle as some resources they use are unreliable (e.g. the network).
+  * You want to test how your code handles a failure (e.g. a file checksum error), but it's not easy to cause one.
+  * You need to make sure that your module interacts with other modules in the right way, but it's hard to observe the interaction; therefore you resort to observing the side effects at the end of the action, which is awkward at best.
+  * You want to "mock out" your dependencies, except that they don't have mock implementations yet; and, frankly, you aren't thrilled by some of those hand-written mocks.
+
+We encourage you to use Google Mock as:
+
+  * a _design_ tool, for it lets you experiment with your interface design early and often. More iterations lead to better designs!
+  * a _testing_ tool to cut your tests' outbound dependencies and probe the interaction between your module and its collaborators.
+
+# Getting Started #
+Using Google Mock is easy! Inside your C++ source file, just `#include` `"gtest/gtest.h"` and `"gmock/gmock.h"`, and you are ready to go.
+
+# A Case for Mock Turtles #
+Let's look at an example. Suppose you are developing a graphics program that relies on a LOGO-like API for drawing. How would you test that it does the right thing? Well, you can run it and compare the screen with a golden screen snapshot, but let's admit it: tests like this are expensive to run and fragile (What if you just upgraded to a shiny new graphics card that has better anti-aliasing? Suddenly you have to update all your golden images.). It would be too painful if all your tests are like this. Fortunately, you learned about Dependency Injection and know the right thing to do: instead of having your application talk to the drawing API directly, wrap the API in an interface (say, `Turtle`) and code to that interface:
+
+```
+class Turtle {
+  ...
+  virtual ~Turtle() {}
+  virtual void PenUp() = 0;
+  virtual void PenDown() = 0;
+  virtual void Forward(int distance) = 0;
+  virtual void Turn(int degrees) = 0;
+  virtual void GoTo(int x, int y) = 0;
+  virtual int GetX() const = 0;
+  virtual int GetY() const = 0;
+};
+```
+
+(Note that the destructor of `Turtle` **must** be virtual, as is the case for **all** classes you intend to inherit from - otherwise the destructor of the derived class will not be called when you delete an object through a base pointer, and you'll get corrupted program states like memory leaks.)
+
+You can control whether the turtle's movement will leave a trace using `PenUp()` and `PenDown()`, and control its movement using `Forward()`, `Turn()`, and `GoTo()`. Finally, `GetX()` and `GetY()` tell you the current position of the turtle.
+
+Your program will normally use a real implementation of this interface. In tests, you can use a mock implementation instead. This allows you to easily check what drawing primitives your program is calling, with what arguments, and in which order. Tests written this way are much more robust (they won't break because your new machine does anti-aliasing differently), easier to read and maintain (the intent of a test is expressed in the code, not in some binary images), and run _much, much faster_.
+
+# Writing the Mock Class #
+If you are lucky, the mocks you need to use have already been implemented by some nice people. If, however, you find yourself in the position to write a mock class, relax - Google Mock turns this task into a fun game! (Well, almost.)
+
+## How to Define It ##
+Using the `Turtle` interface as example, here are the simple steps you need to follow:
+
+  1. Derive a class `MockTurtle` from `Turtle`.
+  1. Take a _virtual_ function of `Turtle` (while it's possible to [mock non-virtual methods using templates](CookBook.md#mocking-nonvirtual-methods), it's much more involved). Count how many arguments it has.
+  1. In the `public:` section of the child class, write `MOCK_METHODn();` (or `MOCK_CONST_METHODn();` if you are mocking a `const` method), where `n` is the number of the arguments; if you counted wrong, shame on you, and a compiler error will tell you so.
+  1. Now comes the fun part: you take the function signature, cut-and-paste the _function name_ as the _first_ argument to the macro, and leave what's left as the _second_ argument (in case you're curious, this is the _type of the function_).
+  1. Repeat until all virtual functions you want to mock are done.
+
+After the process, you should have something like:
+
+```
+#include "gmock/gmock.h"  // Brings in Google Mock.
+class MockTurtle : public Turtle {
+ public:
+  ...
+  MOCK_METHOD0(PenUp, void());
+  MOCK_METHOD0(PenDown, void());
+  MOCK_METHOD1(Forward, void(int distance));
+  MOCK_METHOD1(Turn, void(int degrees));
+  MOCK_METHOD2(GoTo, void(int x, int y));
+  MOCK_CONST_METHOD0(GetX, int());
+  MOCK_CONST_METHOD0(GetY, int());
+};
+```
+
+You don't need to define these mock methods somewhere else - the `MOCK_METHOD*` macros will generate the definitions for you. It's that simple! Once you get the hang of it, you can pump out mock classes faster than your source-control system can handle your check-ins.
+
+**Tip:** If even this is too much work for you, you'll find the
+`gmock_gen.py` tool in Google Mock's `scripts/generator/` directory (courtesy of the [cppclean](http://code.google.com/p/cppclean/) project) useful.  This command-line
+tool requires that you have Python 2.4 installed.  You give it a C++ file and the name of an abstract class defined in it,
+and it will print the definition of the mock class for you.  Due to the
+complexity of the C++ language, this script may not always work, but
+it can be quite handy when it does.  For more details, read the [user documentation](../scripts/generator/README).
+
+## Where to Put It ##
+When you define a mock class, you need to decide where to put its definition. Some people put it in a `*_test.cc`. This is fine when the interface being mocked (say, `Foo`) is owned by the same person or team. Otherwise, when the owner of `Foo` changes it, your test could break. (You can't really expect `Foo`'s maintainer to fix every test that uses `Foo`, can you?)
+
+So, the rule of thumb is: if you need to mock `Foo` and it's owned by others, define the mock class in `Foo`'s package (better, in a `testing` sub-package such that you can clearly separate production code and testing utilities), and put it in a `mock_foo.h`. Then everyone can reference `mock_foo.h` from their tests. If `Foo` ever changes, there is only one copy of `MockFoo` to change, and only tests that depend on the changed methods need to be fixed.
+
+Another way to do it: you can introduce a thin layer `FooAdaptor` on top of `Foo` and code to this new interface. Since you own `FooAdaptor`, you can absorb changes in `Foo` much more easily. While this is more work initially, carefully choosing the adaptor interface can make your code easier to write and more readable (a net win in the long run), as you can choose `FooAdaptor` to fit your specific domain much better than `Foo` does.
+
+# Using Mocks in Tests #
+Once you have a mock class, using it is easy. The typical work flow is:
+
+  1. Import the Google Mock names from the `testing` namespace such that you can use them unqualified (You only have to do it once per file. Remember that namespaces are a good idea and good for your health.).
+  1. Create some mock objects.
+  1. Specify your expectations on them (How many times will a method be called? With what arguments? What should it do? etc.).
+  1. Exercise some code that uses the mocks; optionally, check the result using Google Test assertions. If a mock method is called more than expected or with wrong arguments, you'll get an error immediately.
+  1. When a mock is destructed, Google Mock will automatically check whether all expectations on it have been satisfied.
+
+Here's an example:
+
+```
+#include "path/to/mock-turtle.h"
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
+using ::testing::AtLeast;                     // #1
+
+TEST(PainterTest, CanDrawSomething) {
+  MockTurtle turtle;                          // #2
+  EXPECT_CALL(turtle, PenDown())              // #3
+      .Times(AtLeast(1));
+
+  Painter painter(&turtle);                   // #4
+
+  EXPECT_TRUE(painter.DrawCircle(0, 0, 10));
+}                                             // #5
+
+int main(int argc, char** argv) {
+  // The following line must be executed to initialize Google Mock
+  // (and Google Test) before running the tests.
+  ::testing::InitGoogleMock(&argc, argv);
+  return RUN_ALL_TESTS();
+}
+```
+
+As you might have guessed, this test checks that `PenDown()` is called at least once. If the `painter` object didn't call this method, your test will fail with a message like this:
+
+```
+path/to/my_test.cc:119: Failure
+Actual function call count doesn't match this expectation:
+Actually: never called;
+Expected: called at least once.
+```
+
+**Tip 1:** If you run the test from an Emacs buffer, you can hit `<Enter>` on the line number displayed in the error message to jump right to the failed expectation.
+
+**Tip 2:** If your mock objects are never deleted, the final verification won't happen. Therefore it's a good idea to use a heap leak checker in your tests when you allocate mocks on the heap.
+
+**Important note:** Google Mock requires expectations to be set **before** the mock functions are called, otherwise the behavior is **undefined**. In particular, you mustn't interleave `EXPECT_CALL()`s and calls to the mock functions.
+
+This means `EXPECT_CALL()` should be read as expecting that a call will occur _in the future_, not that a call has occurred. Why does Google Mock work like that? Well, specifying the expectation beforehand allows Google Mock to report a violation as soon as it arises, when the context (stack trace, etc) is still available. This makes debugging much easier.
+
+Admittedly, this test is contrived and doesn't do much. You can easily achieve the same effect without using Google Mock. However, as we shall reveal soon, Google Mock allows you to do _much more_ with the mocks.
+
+## Using Google Mock with Any Testing Framework ##
+If you want to use something other than Google Test (e.g. [CppUnit](http://sourceforge.net/projects/cppunit/) or
+[CxxTest](http://cxxtest.tigris.org/)) as your testing framework, just change the `main()` function in the previous section to:
+```
+int main(int argc, char** argv) {
+  // The following line causes Google Mock to throw an exception on failure,
+  // which will be interpreted by your testing framework as a test failure.
+  ::testing::GTEST_FLAG(throw_on_failure) = true;
+  ::testing::InitGoogleMock(&argc, argv);
+  ... whatever your testing framework requires ...
+}
+```
+
+This approach has a catch: it makes Google Mock throw an exception
+from a mock object's destructor sometimes.  With some compilers, this
+sometimes causes the test program to crash.  You'll still be able to
+notice that the test has failed, but it's not a graceful failure.
+
+A better solution is to use Google Test's
+[event listener API](../../googletest/docs/AdvancedGuide.md#extending-google-test-by-handling-test-events)
+to report a test failure to your testing framework properly.  You'll need to
+implement the `OnTestPartResult()` method of the event listener interface, but it
+should be straightforward.
+
+If this turns out to be too much work, we suggest that you stick with
+Google Test, which works with Google Mock seamlessly (in fact, it is
+technically part of Google Mock.).  If there is a reason that you
+cannot use Google Test, please let us know.
+
+# Setting Expectations #
+The key to using a mock object successfully is to set the _right expectations_ on it. If you set the expectations too strict, your test will fail as the result of unrelated changes. If you set them too loose, bugs can slip through. You want to do it just right such that your test can catch exactly the kind of bugs you intend it to catch. Google Mock provides the necessary means for you to do it "just right."
+
+## General Syntax ##
+In Google Mock we use the `EXPECT_CALL()` macro to set an expectation on a mock method. The general syntax is:
+
+```
+EXPECT_CALL(mock_object, method(matchers))
+    .Times(cardinality)
+    .WillOnce(action)
+    .WillRepeatedly(action);
+```
+
+The macro has two arguments: first the mock object, and then the method and its arguments. Note that the two are separated by a comma (`,`), not a period (`.`). (Why using a comma? The answer is that it was necessary for technical reasons.)
+
+The macro can be followed by some optional _clauses_ that provide more information about the expectation. We'll discuss how each clause works in the coming sections.
+
+This syntax is designed to make an expectation read like English. For example, you can probably guess that
+
+```
+using ::testing::Return;...
+EXPECT_CALL(turtle, GetX())
+    .Times(5)
+    .WillOnce(Return(100))
+    .WillOnce(Return(150))
+    .WillRepeatedly(Return(200));
+```
+
+says that the `turtle` object's `GetX()` method will be called five times, it will return 100 the first time, 150 the second time, and then 200 every time. Some people like to call this style of syntax a Domain-Specific Language (DSL).
+
+**Note:** Why do we use a macro to do this? It serves two purposes: first it makes expectations easily identifiable (either by `grep` or by a human reader), and second it allows Google Mock to include the source file location of a failed expectation in messages, making debugging easier.
+
+## Matchers: What Arguments Do We Expect? ##
+When a mock function takes arguments, we must specify what arguments we are expecting; for example:
+
+```
+// Expects the turtle to move forward by 100 units.
+EXPECT_CALL(turtle, Forward(100));
+```
+
+Sometimes you may not want to be too specific (Remember that talk about tests being too rigid? Over specification leads to brittle tests and obscures the intent of tests. Therefore we encourage you to specify only what's necessary - no more, no less.). If you care to check that `Forward()` will be called but aren't interested in its actual argument, write `_` as the argument, which means "anything goes":
+
+```
+using ::testing::_;
+...
+// Expects the turtle to move forward.
+EXPECT_CALL(turtle, Forward(_));
+```
+
+`_` is an instance of what we call **matchers**. A matcher is like a predicate and can test whether an argument is what we'd expect. You can use a matcher inside `EXPECT_CALL()` wherever a function argument is expected.
+
+A list of built-in matchers can be found in the [CheatSheet](CheatSheet.md). For example, here's the `Ge` (greater than or equal) matcher:
+
+```
+using ::testing::Ge;...
+EXPECT_CALL(turtle, Forward(Ge(100)));
+```
+
+This checks that the turtle will be told to go forward by at least 100 units.
+
+## Cardinalities: How Many Times Will It Be Called? ##
+The first clause we can specify following an `EXPECT_CALL()` is `Times()`. We call its argument a **cardinality** as it tells _how many times_ the call should occur. It allows us to repeat an expectation many times without actually writing it as many times. More importantly, a cardinality can be "fuzzy", just like a matcher can be. This allows a user to express the intent of a test exactly.
+
+An interesting special case is when we say `Times(0)`. You may have guessed - it means that the function shouldn't be called with the given arguments at all, and Google Mock will report a Google Test failure whenever the function is (wrongfully) called.
+
+We've seen `AtLeast(n)` as an example of fuzzy cardinalities earlier. For the list of built-in cardinalities you can use, see the [CheatSheet](CheatSheet.md).
+
+The `Times()` clause can be omitted. **If you omit `Times()`, Google Mock will infer the cardinality for you.** The rules are easy to remember:
+
+  * If **neither** `WillOnce()` **nor** `WillRepeatedly()` is in the `EXPECT_CALL()`, the inferred cardinality is `Times(1)`.
+  * If there are `n WillOnce()`'s but **no** `WillRepeatedly()`, where `n` >= 1, the cardinality is `Times(n)`.
+  * If there are `n WillOnce()`'s and **one** `WillRepeatedly()`, where `n` >= 0, the cardinality is `Times(AtLeast(n))`.
+
+**Quick quiz:** what do you think will happen if a function is expected to be called twice but actually called four times?
+
+## Actions: What Should It Do? ##
+Remember that a mock object doesn't really have a working implementation? We as users have to tell it what to do when a method is invoked. This is easy in Google Mock.
+
+First, if the return type of a mock function is a built-in type or a pointer, the function has a **default action** (a `void` function will just return, a `bool` function will return `false`, and other functions will return 0). In addition, in C++ 11 and above, a mock function whose return type is default-constructible (i.e. has a default constructor) has a default action of returning a default-constructed value.  If you don't say anything, this behavior will be used.
+
+Second, if a mock function doesn't have a default action, or the default action doesn't suit you, you can specify the action to be taken each time the expectation matches using a series of `WillOnce()` clauses followed by an optional `WillRepeatedly()`. For example,
+
+```
+using ::testing::Return;...
+EXPECT_CALL(turtle, GetX())
+    .WillOnce(Return(100))
+    .WillOnce(Return(200))
+    .WillOnce(Return(300));
+```
+
+This says that `turtle.GetX()` will be called _exactly three times_ (Google Mock inferred this from how many `WillOnce()` clauses we've written, since we didn't explicitly write `Times()`), and will return 100, 200, and 300 respectively.
+
+```
+using ::testing::Return;...
+EXPECT_CALL(turtle, GetY())
+    .WillOnce(Return(100))
+    .WillOnce(Return(200))
+    .WillRepeatedly(Return(300));
+```
+
+says that `turtle.GetY()` will be called _at least twice_ (Google Mock knows this as we've written two `WillOnce()` clauses and a `WillRepeatedly()` while having no explicit `Times()`), will return 100 the first time, 200 the second time, and 300 from the third time on.
+
+Of course, if you explicitly write a `Times()`, Google Mock will not try to infer the cardinality itself. What if the number you specified is larger than there are `WillOnce()` clauses? Well, after all `WillOnce()`s are used up, Google Mock will do the _default_ action for the function every time (unless, of course, you have a `WillRepeatedly()`.).
+
+What can we do inside `WillOnce()` besides `Return()`? You can return a reference using `ReturnRef(variable)`, or invoke a pre-defined function, among [others](CheatSheet.md#actions).
+
+**Important note:** The `EXPECT_CALL()` statement evaluates the action clause only once, even though the action may be performed many times. Therefore you must be careful about side effects. The following may not do what you want:
+
+```
+int n = 100;
+EXPECT_CALL(turtle, GetX())
+.Times(4)
+.WillRepeatedly(Return(n++));
+```
+
+Instead of returning 100, 101, 102, ..., consecutively, this mock function will always return 100 as `n++` is only evaluated once. Similarly, `Return(new Foo)` will create a new `Foo` object when the `EXPECT_CALL()` is executed, and will return the same pointer every time. If you want the side effect to happen every time, you need to define a custom action, which we'll teach in the [CookBook](CookBook.md).
+
+Time for another quiz! What do you think the following means?
+
+```
+using ::testing::Return;...
+EXPECT_CALL(turtle, GetY())
+.Times(4)
+.WillOnce(Return(100));
+```
+
+Obviously `turtle.GetY()` is expected to be called four times. But if you think it will return 100 every time, think twice! Remember that one `WillOnce()` clause will be consumed each time the function is invoked and the default action will be taken afterwards. So the right answer is that `turtle.GetY()` will return 100 the first time, but **return 0 from the second time on**, as returning 0 is the default action for `int` functions.
+
+## Using Multiple Expectations ##
+So far we've only shown examples where you have a single expectation. More realistically, you're going to specify expectations on multiple mock methods, which may be from multiple mock objects.
+
+By default, when a mock method is invoked, Google Mock will search the expectations in the **reverse order** they are defined, and stop when an active expectation that matches the arguments is found (you can think of it as "newer rules override older ones."). If the matching expectation cannot take any more calls, you will get an upper-bound-violated failure. Here's an example:
+
+```
+using ::testing::_;...
+EXPECT_CALL(turtle, Forward(_));  // #1
+EXPECT_CALL(turtle, Forward(10))  // #2
+    .Times(2);
+```
+
+If `Forward(10)` is called three times in a row, the third time it will be an error, as the last matching expectation (#2) has been saturated. If, however, the third `Forward(10)` call is replaced by `Forward(20)`, then it would be OK, as now #1 will be the matching expectation.
+
+**Side note:** Why does Google Mock search for a match in the _reverse_ order of the expectations? The reason is that this allows a user to set up the default expectations in a mock object's constructor or the test fixture's set-up phase and then customize the mock by writing more specific expectations in the test body. So, if you have two expectations on the same method, you want to put the one with more specific matchers **after** the other, or the more specific rule would be shadowed by the more general one that comes after it.
+
+## Ordered vs Unordered Calls ##
+By default, an expectation can match a call even though an earlier expectation hasn't been satisfied. In other words, the calls don't have to occur in the order the expectations are specified.
+
+Sometimes, you may want all the expected calls to occur in a strict order. To say this in Google Mock is easy:
+
+```
+using ::testing::InSequence;...
+TEST(FooTest, DrawsLineSegment) {
+  ...
+  {
+    InSequence dummy;
+
+    EXPECT_CALL(turtle, PenDown());
+    EXPECT_CALL(turtle, Forward(100));
+    EXPECT_CALL(turtle, PenUp());
+  }
+  Foo();
+}
+```
+
+By creating an object of type `InSequence`, all expectations in its scope are put into a _sequence_ and have to occur _sequentially_. Since we are just relying on the constructor and destructor of this object to do the actual work, its name is really irrelevant.
+
+In this example, we test that `Foo()` calls the three expected functions in the order as written. If a call is made out-of-order, it will be an error.
+
+(What if you care about the relative order of some of the calls, but not all of them? Can you specify an arbitrary partial order? The answer is ... yes! If you are impatient, the details can be found in the [CookBook](CookBook#Expecting_Partially_Ordered_Calls.md).)
+
+## All Expectations Are Sticky (Unless Said Otherwise) ##
+Now let's do a quick quiz to see how well you can use this mock stuff already. How would you test that the turtle is asked to go to the origin _exactly twice_ (you want to ignore any other instructions it receives)?
+
+After you've come up with your answer, take a look at ours and compare notes (solve it yourself first - don't cheat!):
+
+```
+using ::testing::_;...
+EXPECT_CALL(turtle, GoTo(_, _))  // #1
+    .Times(AnyNumber());
+EXPECT_CALL(turtle, GoTo(0, 0))  // #2
+    .Times(2);
+```
+
+Suppose `turtle.GoTo(0, 0)` is called three times. In the third time, Google Mock will see that the arguments match expectation #2 (remember that we always pick the last matching expectation). Now, since we said that there should be only two such calls, Google Mock will report an error immediately. This is basically what we've told you in the "Using Multiple Expectations" section above.
+
+This example shows that **expectations in Google Mock are "sticky" by default**, in the sense that they remain active even after we have reached their invocation upper bounds. This is an important rule to remember, as it affects the meaning of the spec, and is **different** to how it's done in many other mocking frameworks (Why'd we do that? Because we think our rule makes the common cases easier to express and understand.).
+
+Simple? Let's see if you've really understood it: what does the following code say?
+
+```
+using ::testing::Return;
+...
+for (int i = n; i > 0; i--) {
+  EXPECT_CALL(turtle, GetX())
+      .WillOnce(Return(10*i));
+}
+```
+
+If you think it says that `turtle.GetX()` will be called `n` times and will return 10, 20, 30, ..., consecutively, think twice! The problem is that, as we said, expectations are sticky. So, the second time `turtle.GetX()` is called, the last (latest) `EXPECT_CALL()` statement will match, and will immediately lead to an "upper bound exceeded" error - this piece of code is not very useful!
+
+One correct way of saying that `turtle.GetX()` will return 10, 20, 30, ..., is to explicitly say that the expectations are _not_ sticky. In other words, they should _retire_ as soon as they are saturated:
+
+```
+using ::testing::Return;
+...
+for (int i = n; i > 0; i--) {
+  EXPECT_CALL(turtle, GetX())
+    .WillOnce(Return(10*i))
+    .RetiresOnSaturation();
+}
+```
+
+And, there's a better way to do it: in this case, we expect the calls to occur in a specific order, and we line up the actions to match the order. Since the order is important here, we should make it explicit using a sequence:
+
+```
+using ::testing::InSequence;
+using ::testing::Return;
+...
+{
+  InSequence s;
+
+  for (int i = 1; i <= n; i++) {
+    EXPECT_CALL(turtle, GetX())
+        .WillOnce(Return(10*i))
+        .RetiresOnSaturation();
+  }
+}
+```
+
+By the way, the other situation where an expectation may _not_ be sticky is when it's in a sequence - as soon as another expectation that comes after it in the sequence has been used, it automatically retires (and will never be used to match any call).
+
+## Uninteresting Calls ##
+A mock object may have many methods, and not all of them are that interesting. For example, in some tests we may not care about how many times `GetX()` and `GetY()` get called.
+
+In Google Mock, if you are not interested in a method, just don't say anything about it. If a call to this method occurs, you'll see a warning in the test output, but it won't be a failure.
+
+# What Now? #
+Congratulations! You've learned enough about Google Mock to start using it. Now, you might want to join the [googlemock](http://groups.google.com/group/googlemock) discussion group and actually write some tests using Google Mock - it will be fun. Hey, it may even be addictive - you've been warned.
+
+Then, if you feel like increasing your mock quotient, you should move on to the [CookBook](CookBook.md). You can learn many advanced features of Google Mock there -- and advance your level of enjoyment and testing bliss.
diff --git a/src/external/googletest/googlemock/docs/FrequentlyAskedQuestions.md b/src/external/googletest/googlemock/docs/FrequentlyAskedQuestions.md
new file mode 100644 (file)
index 0000000..5eac83f
--- /dev/null
@@ -0,0 +1,628 @@
+
+
+Please send your questions to the
+[googlemock](http://groups.google.com/group/googlemock) discussion
+group. If you need help with compiler errors, make sure you have
+tried [Google Mock Doctor](#How_am_I_supposed_to_make_sense_of_these_horrible_template_error.md) first.
+
+## When I call a method on my mock object, the method for the real object is invoked instead.  What's the problem? ##
+
+In order for a method to be mocked, it must be _virtual_, unless you use the [high-perf dependency injection technique](CookBook.md#mocking-nonvirtual-methods).
+
+## I wrote some matchers.  After I upgraded to a new version of Google Mock, they no longer compile.  What's going on? ##
+
+After version 1.4.0 of Google Mock was released, we had an idea on how
+to make it easier to write matchers that can generate informative
+messages efficiently.  We experimented with this idea and liked what
+we saw.  Therefore we decided to implement it.
+
+Unfortunately, this means that if you have defined your own matchers
+by implementing `MatcherInterface` or using `MakePolymorphicMatcher()`,
+your definitions will no longer compile.  Matchers defined using the
+`MATCHER*` family of macros are not affected.
+
+Sorry for the hassle if your matchers are affected.  We believe it's
+in everyone's long-term interest to make this change sooner than
+later.  Fortunately, it's usually not hard to migrate an existing
+matcher to the new API.  Here's what you need to do:
+
+If you wrote your matcher like this:
+```
+// Old matcher definition that doesn't work with the latest
+// Google Mock.
+using ::testing::MatcherInterface;
+...
+class MyWonderfulMatcher : public MatcherInterface<MyType> {
+ public:
+  ...
+  virtual bool Matches(MyType value) const {
+    // Returns true if value matches.
+    return value.GetFoo() > 5;
+  }
+  ...
+};
+```
+
+you'll need to change it to:
+```
+// New matcher definition that works with the latest Google Mock.
+using ::testing::MatcherInterface;
+using ::testing::MatchResultListener;
+...
+class MyWonderfulMatcher : public MatcherInterface<MyType> {
+ public:
+  ...
+  virtual bool MatchAndExplain(MyType value,
+                               MatchResultListener* listener) const {
+    // Returns true if value matches.
+    return value.GetFoo() > 5;
+  }
+  ...
+};
+```
+(i.e. rename `Matches()` to `MatchAndExplain()` and give it a second
+argument of type `MatchResultListener*`.)
+
+If you were also using `ExplainMatchResultTo()` to improve the matcher
+message:
+```
+// Old matcher definition that doesn't work with the lastest
+// Google Mock.
+using ::testing::MatcherInterface;
+...
+class MyWonderfulMatcher : public MatcherInterface<MyType> {
+ public:
+  ...
+  virtual bool Matches(MyType value) const {
+    // Returns true if value matches.
+    return value.GetFoo() > 5;
+  }
+
+  virtual void ExplainMatchResultTo(MyType value,
+                                    ::std::ostream* os) const {
+    // Prints some helpful information to os to help
+    // a user understand why value matches (or doesn't match).
+    *os << "the Foo property is " << value.GetFoo();
+  }
+  ...
+};
+```
+
+you should move the logic of `ExplainMatchResultTo()` into
+`MatchAndExplain()`, using the `MatchResultListener` argument where
+the `::std::ostream` was used:
+```
+// New matcher definition that works with the latest Google Mock.
+using ::testing::MatcherInterface;
+using ::testing::MatchResultListener;
+...
+class MyWonderfulMatcher : public MatcherInterface<MyType> {
+ public:
+  ...
+  virtual bool MatchAndExplain(MyType value,
+                               MatchResultListener* listener) const {
+    // Returns true if value matches.
+    *listener << "the Foo property is " << value.GetFoo();
+    return value.GetFoo() > 5;
+  }
+  ...
+};
+```
+
+If your matcher is defined using `MakePolymorphicMatcher()`:
+```
+// Old matcher definition that doesn't work with the latest
+// Google Mock.
+using ::testing::MakePolymorphicMatcher;
+...
+class MyGreatMatcher {
+ public:
+  ...
+  bool Matches(MyType value) const {
+    // Returns true if value matches.
+    return value.GetBar() < 42;
+  }
+  ...
+};
+... MakePolymorphicMatcher(MyGreatMatcher()) ...
+```
+
+you should rename the `Matches()` method to `MatchAndExplain()` and
+add a `MatchResultListener*` argument (the same as what you need to do
+for matchers defined by implementing `MatcherInterface`):
+```
+// New matcher definition that works with the latest Google Mock.
+using ::testing::MakePolymorphicMatcher;
+using ::testing::MatchResultListener;
+...
+class MyGreatMatcher {
+ public:
+  ...
+  bool MatchAndExplain(MyType value,
+                       MatchResultListener* listener) const {
+    // Returns true if value matches.
+    return value.GetBar() < 42;
+  }
+  ...
+};
+... MakePolymorphicMatcher(MyGreatMatcher()) ...
+```
+
+If your polymorphic matcher uses `ExplainMatchResultTo()` for better
+failure messages:
+```
+// Old matcher definition that doesn't work with the latest
+// Google Mock.
+using ::testing::MakePolymorphicMatcher;
+...
+class MyGreatMatcher {
+ public:
+  ...
+  bool Matches(MyType value) const {
+    // Returns true if value matches.
+    return value.GetBar() < 42;
+  }
+  ...
+};
+void ExplainMatchResultTo(const MyGreatMatcher& matcher,
+                          MyType value,
+                          ::std::ostream* os) {
+  // Prints some helpful information to os to help
+  // a user understand why value matches (or doesn't match).
+  *os << "the Bar property is " << value.GetBar();
+}
+... MakePolymorphicMatcher(MyGreatMatcher()) ...
+```
+
+you'll need to move the logic inside `ExplainMatchResultTo()` to
+`MatchAndExplain()`:
+```
+// New matcher definition that works with the latest Google Mock.
+using ::testing::MakePolymorphicMatcher;
+using ::testing::MatchResultListener;
+...
+class MyGreatMatcher {
+ public:
+  ...
+  bool MatchAndExplain(MyType value,
+                       MatchResultListener* listener) const {
+    // Returns true if value matches.
+    *listener << "the Bar property is " << value.GetBar();
+    return value.GetBar() < 42;
+  }
+  ...
+};
+... MakePolymorphicMatcher(MyGreatMatcher()) ...
+```
+
+For more information, you can read these
+[two](CookBook.md#writing-new-monomorphic-matchers)
+[recipes](CookBook.md#writing-new-polymorphic-matchers)
+from the cookbook.  As always, you
+are welcome to post questions on `googlemock@googlegroups.com` if you
+need any help.
+
+## When using Google Mock, do I have to use Google Test as the testing framework?  I have my favorite testing framework and don't want to switch. ##
+
+Google Mock works out of the box with Google Test.  However, it's easy
+to configure it to work with any testing framework of your choice.
+[Here](ForDummies.md#using-google-mock-with-any-testing-framework) is how.
+
+## How am I supposed to make sense of these horrible template errors? ##
+
+If you are confused by the compiler errors gcc threw at you,
+try consulting the _Google Mock Doctor_ tool first.  What it does is to
+scan stdin for gcc error messages, and spit out diagnoses on the
+problems (we call them diseases) your code has.
+
+To "install", run command:
+```
+alias gmd='<path to googlemock>/scripts/gmock_doctor.py'
+```
+
+To use it, do:
+```
+<your-favorite-build-command> <your-test> 2>&1 | gmd
+```
+
+For example:
+```
+make my_test 2>&1 | gmd
+```
+
+Or you can run `gmd` and copy-n-paste gcc's error messages to it.
+
+## Can I mock a variadic function? ##
+
+You cannot mock a variadic function (i.e. a function taking ellipsis
+(`...`) arguments) directly in Google Mock.
+
+The problem is that in general, there is _no way_ for a mock object to
+know how many arguments are passed to the variadic method, and what
+the arguments' types are.  Only the _author of the base class_ knows
+the protocol, and we cannot look into his head.
+
+Therefore, to mock such a function, the _user_ must teach the mock
+object how to figure out the number of arguments and their types.  One
+way to do it is to provide overloaded versions of the function.
+
+Ellipsis arguments are inherited from C and not really a C++ feature.
+They are unsafe to use and don't work with arguments that have
+constructors or destructors.  Therefore we recommend to avoid them in
+C++ as much as possible.
+
+## MSVC gives me warning C4301 or C4373 when I define a mock method with a const parameter.  Why? ##
+
+If you compile this using Microsoft Visual C++ 2005 SP1:
+```
+class Foo {
+  ...
+  virtual void Bar(const int i) = 0;
+};
+
+class MockFoo : public Foo {
+  ...
+  MOCK_METHOD1(Bar, void(const int i));
+};
+```
+You may get the following warning:
+```
+warning C4301: 'MockFoo::Bar': overriding virtual function only differs from 'Foo::Bar' by const/volatile qualifier
+```
+
+This is a MSVC bug.  The same code compiles fine with gcc ,for
+example.  If you use Visual C++ 2008 SP1, you would get the warning:
+```
+warning C4373: 'MockFoo::Bar': virtual function overrides 'Foo::Bar', previous versions of the compiler did not override when parameters only differed by const/volatile qualifiers
+```
+
+In C++, if you _declare_ a function with a `const` parameter, the
+`const` modifier is _ignored_.  Therefore, the `Foo` base class above
+is equivalent to:
+```
+class Foo {
+  ...
+  virtual void Bar(int i) = 0;  // int or const int?  Makes no difference.
+};
+```
+
+In fact, you can _declare_ Bar() with an `int` parameter, and _define_
+it with a `const int` parameter.  The compiler will still match them
+up.
+
+Since making a parameter `const` is meaningless in the method
+_declaration_, we recommend to remove it in both `Foo` and `MockFoo`.
+That should workaround the VC bug.
+
+Note that we are talking about the _top-level_ `const` modifier here.
+If the function parameter is passed by pointer or reference, declaring
+the _pointee_ or _referee_ as `const` is still meaningful.  For
+example, the following two declarations are _not_ equivalent:
+```
+void Bar(int* p);        // Neither p nor *p is const.
+void Bar(const int* p);  // p is not const, but *p is.
+```
+
+## I have a huge mock class, and Microsoft Visual C++ runs out of memory when compiling it.  What can I do? ##
+
+We've noticed that when the `/clr` compiler flag is used, Visual C++
+uses 5~6 times as much memory when compiling a mock class.  We suggest
+to avoid `/clr` when compiling native C++ mocks.
+
+## I can't figure out why Google Mock thinks my expectations are not satisfied.  What should I do? ##
+
+You might want to run your test with
+`--gmock_verbose=info`.  This flag lets Google Mock print a trace
+of every mock function call it receives.  By studying the trace,
+you'll gain insights on why the expectations you set are not met.
+
+## How can I assert that a function is NEVER called? ##
+
+```
+EXPECT_CALL(foo, Bar(_))
+    .Times(0);
+```
+
+## I have a failed test where Google Mock tells me TWICE that a particular expectation is not satisfied.  Isn't this redundant? ##
+
+When Google Mock detects a failure, it prints relevant information
+(the mock function arguments, the state of relevant expectations, and
+etc) to help the user debug.  If another failure is detected, Google
+Mock will do the same, including printing the state of relevant
+expectations.
+
+Sometimes an expectation's state didn't change between two failures,
+and you'll see the same description of the state twice.  They are
+however _not_ redundant, as they refer to _different points in time_.
+The fact they are the same _is_ interesting information.
+
+## I get a heap check failure when using a mock object, but using a real object is fine.  What can be wrong? ##
+
+Does the class (hopefully a pure interface) you are mocking have a
+virtual destructor?
+
+Whenever you derive from a base class, make sure its destructor is
+virtual.  Otherwise Bad Things will happen.  Consider the following
+code:
+
+```
+class Base {
+ public:
+  // Not virtual, but should be.
+  ~Base() { ... }
+  ...
+};
+
+class Derived : public Base {
+ public:
+  ...
+ private:
+  std::string value_;
+};
+
+...
+  Base* p = new Derived;
+  ...
+  delete p;  // Surprise! ~Base() will be called, but ~Derived() will not
+             // - value_ is leaked.
+```
+
+By changing `~Base()` to virtual, `~Derived()` will be correctly
+called when `delete p` is executed, and the heap checker
+will be happy.
+
+## The "newer expectations override older ones" rule makes writing expectations awkward.  Why does Google Mock do that? ##
+
+When people complain about this, often they are referring to code like:
+
+```
+// foo.Bar() should be called twice, return 1 the first time, and return
+// 2 the second time.  However, I have to write the expectations in the
+// reverse order.  This sucks big time!!!
+EXPECT_CALL(foo, Bar())
+    .WillOnce(Return(2))
+    .RetiresOnSaturation();
+EXPECT_CALL(foo, Bar())
+    .WillOnce(Return(1))
+    .RetiresOnSaturation();
+```
+
+The problem is that they didn't pick the **best** way to express the test's
+intent.
+
+By default, expectations don't have to be matched in _any_ particular
+order.  If you want them to match in a certain order, you need to be
+explicit.  This is Google Mock's (and jMock's) fundamental philosophy: it's
+easy to accidentally over-specify your tests, and we want to make it
+harder to do so.
+
+There are two better ways to write the test spec.  You could either
+put the expectations in sequence:
+
+```
+// foo.Bar() should be called twice, return 1 the first time, and return
+// 2 the second time.  Using a sequence, we can write the expectations
+// in their natural order.
+{
+  InSequence s;
+  EXPECT_CALL(foo, Bar())
+      .WillOnce(Return(1))
+      .RetiresOnSaturation();
+  EXPECT_CALL(foo, Bar())
+      .WillOnce(Return(2))
+      .RetiresOnSaturation();
+}
+```
+
+or you can put the sequence of actions in the same expectation:
+
+```
+// foo.Bar() should be called twice, return 1 the first time, and return
+// 2 the second time.
+EXPECT_CALL(foo, Bar())
+    .WillOnce(Return(1))
+    .WillOnce(Return(2))
+    .RetiresOnSaturation();
+```
+
+Back to the original questions: why does Google Mock search the
+expectations (and `ON_CALL`s) from back to front?  Because this
+allows a user to set up a mock's behavior for the common case early
+(e.g. in the mock's constructor or the test fixture's set-up phase)
+and customize it with more specific rules later.  If Google Mock
+searches from front to back, this very useful pattern won't be
+possible.
+
+## Google Mock prints a warning when a function without EXPECT\_CALL is called, even if I have set its behavior using ON\_CALL.  Would it be reasonable not to show the warning in this case? ##
+
+When choosing between being neat and being safe, we lean toward the
+latter.  So the answer is that we think it's better to show the
+warning.
+
+Often people write `ON_CALL`s in the mock object's
+constructor or `SetUp()`, as the default behavior rarely changes from
+test to test.  Then in the test body they set the expectations, which
+are often different for each test.  Having an `ON_CALL` in the set-up
+part of a test doesn't mean that the calls are expected.  If there's
+no `EXPECT_CALL` and the method is called, it's possibly an error.  If
+we quietly let the call go through without notifying the user, bugs
+may creep in unnoticed.
+
+If, however, you are sure that the calls are OK, you can write
+
+```
+EXPECT_CALL(foo, Bar(_))
+    .WillRepeatedly(...);
+```
+
+instead of
+
+```
+ON_CALL(foo, Bar(_))
+    .WillByDefault(...);
+```
+
+This tells Google Mock that you do expect the calls and no warning should be
+printed.
+
+Also, you can control the verbosity using the `--gmock_verbose` flag.
+If you find the output too noisy when debugging, just choose a less
+verbose level.
+
+## How can I delete the mock function's argument in an action? ##
+
+If you find yourself needing to perform some action that's not
+supported by Google Mock directly, remember that you can define your own
+actions using
+[MakeAction()](CookBook.md#writing-new-actions) or
+[MakePolymorphicAction()](CookBook.md#writing_new_polymorphic_actions),
+or you can write a stub function and invoke it using
+[Invoke()](CookBook.md#using-functions_methods_functors).
+
+## MOCK\_METHODn()'s second argument looks funny.  Why don't you use the MOCK\_METHODn(Method, return\_type, arg\_1, ..., arg\_n) syntax? ##
+
+What?!  I think it's beautiful. :-)
+
+While which syntax looks more natural is a subjective matter to some
+extent, Google Mock's syntax was chosen for several practical advantages it
+has.
+
+Try to mock a function that takes a map as an argument:
+```
+virtual int GetSize(const map<int, std::string>& m);
+```
+
+Using the proposed syntax, it would be:
+```
+MOCK_METHOD1(GetSize, int, const map<int, std::string>& m);
+```
+
+Guess what?  You'll get a compiler error as the compiler thinks that
+`const map<int, std::string>& m` are **two**, not one, arguments. To work
+around this you can use `typedef` to give the map type a name, but
+that gets in the way of your work.  Google Mock's syntax avoids this
+problem as the function's argument types are protected inside a pair
+of parentheses:
+```
+// This compiles fine.
+MOCK_METHOD1(GetSize, int(const map<int, std::string>& m));
+```
+
+You still need a `typedef` if the return type contains an unprotected
+comma, but that's much rarer.
+
+Other advantages include:
+  1. `MOCK_METHOD1(Foo, int, bool)` can leave a reader wonder whether the method returns `int` or `bool`, while there won't be such confusion using Google Mock's syntax.
+  1. The way Google Mock describes a function type is nothing new, although many people may not be familiar with it.  The same syntax was used in C, and the `function` library in `tr1` uses this syntax extensively.  Since `tr1` will become a part of the new version of STL, we feel very comfortable to be consistent with it.
+  1. The function type syntax is also used in other parts of Google Mock's API (e.g. the action interface) in order to make the implementation tractable. A user needs to learn it anyway in order to utilize Google Mock's more advanced features.  We'd as well stick to the same syntax in `MOCK_METHOD*`!
+
+## My code calls a static/global function.  Can I mock it? ##
+
+You can, but you need to make some changes.
+
+In general, if you find yourself needing to mock a static function,
+it's a sign that your modules are too tightly coupled (and less
+flexible, less reusable, less testable, etc).  You are probably better
+off defining a small interface and call the function through that
+interface, which then can be easily mocked.  It's a bit of work
+initially, but usually pays for itself quickly.
+
+This Google Testing Blog
+[post](http://googletesting.blogspot.com/2008/06/defeat-static-cling.html)
+says it excellently.  Check it out.
+
+## My mock object needs to do complex stuff.  It's a lot of pain to specify the actions.  Google Mock sucks! ##
+
+I know it's not a question, but you get an answer for free any way. :-)
+
+With Google Mock, you can create mocks in C++ easily.  And people might be
+tempted to use them everywhere. Sometimes they work great, and
+sometimes you may find them, well, a pain to use. So, what's wrong in
+the latter case?
+
+When you write a test without using mocks, you exercise the code and
+assert that it returns the correct value or that the system is in an
+expected state.  This is sometimes called "state-based testing".
+
+Mocks are great for what some call "interaction-based" testing:
+instead of checking the system state at the very end, mock objects
+verify that they are invoked the right way and report an error as soon
+as it arises, giving you a handle on the precise context in which the
+error was triggered.  This is often more effective and economical to
+do than state-based testing.
+
+If you are doing state-based testing and using a test double just to
+simulate the real object, you are probably better off using a fake.
+Using a mock in this case causes pain, as it's not a strong point for
+mocks to perform complex actions.  If you experience this and think
+that mocks suck, you are just not using the right tool for your
+problem. Or, you might be trying to solve the wrong problem. :-)
+
+## I got a warning "Uninteresting function call encountered - default action taken.."  Should I panic? ##
+
+By all means, NO!  It's just an FYI.
+
+What it means is that you have a mock function, you haven't set any
+expectations on it (by Google Mock's rule this means that you are not
+interested in calls to this function and therefore it can be called
+any number of times), and it is called.  That's OK - you didn't say
+it's not OK to call the function!
+
+What if you actually meant to disallow this function to be called, but
+forgot to write `EXPECT_CALL(foo, Bar()).Times(0)`?  While
+one can argue that it's the user's fault, Google Mock tries to be nice and
+prints you a note.
+
+So, when you see the message and believe that there shouldn't be any
+uninteresting calls, you should investigate what's going on.  To make
+your life easier, Google Mock prints the function name and arguments
+when an uninteresting call is encountered.
+
+## I want to define a custom action.  Should I use Invoke() or implement the action interface? ##
+
+Either way is fine - you want to choose the one that's more convenient
+for your circumstance.
+
+Usually, if your action is for a particular function type, defining it
+using `Invoke()` should be easier; if your action can be used in
+functions of different types (e.g. if you are defining
+`Return(value)`), `MakePolymorphicAction()` is
+easiest.  Sometimes you want precise control on what types of
+functions the action can be used in, and implementing
+`ActionInterface` is the way to go here. See the implementation of
+`Return()` in `include/gmock/gmock-actions.h` for an example.
+
+## I'm using the set-argument-pointee action, and the compiler complains about "conflicting return type specified".  What does it mean? ##
+
+You got this error as Google Mock has no idea what value it should return
+when the mock method is called.  `SetArgPointee()` says what the
+side effect is, but doesn't say what the return value should be.  You
+need `DoAll()` to chain a `SetArgPointee()` with a `Return()`.
+
+See this [recipe](CookBook.md#mocking_side_effects) for more details and an example.
+
+
+## My question is not in your FAQ! ##
+
+If you cannot find the answer to your question in this FAQ, there are
+some other resources you can use:
+
+  1. read other [documentation](Documentation.md),
+  1. search the mailing list [archive](http://groups.google.com/group/googlemock/topics),
+  1. ask it on [googlemock@googlegroups.com](mailto:googlemock@googlegroups.com) and someone will answer it (to prevent spam, we require you to join the [discussion group](http://groups.google.com/group/googlemock) before you can post.).
+
+Please note that creating an issue in the
+[issue tracker](https://github.com/google/googletest/issues) is _not_
+a good way to get your answer, as it is monitored infrequently by a
+very small number of people.
+
+When asking a question, it's helpful to provide as much of the
+following information as possible (people cannot help you if there's
+not enough information in your question):
+
+  * the version (or the revision number if you check out from SVN directly) of Google Mock you use (Google Mock is under active development, so it's possible that your problem has been solved in a later version),
+  * your operating system,
+  * the name and version of your compiler,
+  * the complete command line flags you give to your compiler,
+  * the complete compiler error messages (if the question is about compilation),
+  * the _actual_ code (ideally, a minimal but complete program) that has the problem you encounter.
diff --git a/src/external/googletest/googlemock/docs/KnownIssues.md b/src/external/googletest/googlemock/docs/KnownIssues.md
new file mode 100644 (file)
index 0000000..adadf51
--- /dev/null
@@ -0,0 +1,19 @@
+As any non-trivial software system, Google Mock has some known limitations and problems.  We are working on improving it, and welcome your help!  The follow is a list of issues we know about.
+
+
+
+## README contains outdated information on Google Mock's compatibility with other testing frameworks ##
+
+The `README` file in release 1.1.0 still says that Google Mock only works with Google Test.  Actually, you can configure Google Mock to work with any testing framework you choose.
+
+## Tests failing on machines using Power PC CPUs (e.g. some Macs) ##
+
+`gmock_output_test` and `gmock-printers_test` are known to fail with Power PC CPUs.  This is due to portability issues with these tests, and is not an indication of problems in Google Mock itself.  You can safely ignore them.
+
+## Failed to resolve libgtest.so.0 in tests when built against installed Google Test ##
+
+This only applies if you manually built and installed Google Test, and then built a Google Mock against it (either explicitly, or because gtest-config was in your path post-install). In this situation, Libtool has a known issue with certain systems' ldconfig setup:
+
+http://article.gmane.org/gmane.comp.sysutils.automake.general/9025
+
+This requires a manual run of "sudo ldconfig" after the "sudo make install" for Google Test before any binaries which link against it can be executed. This isn't a bug in our install, but we should at least have documented it or hacked a work-around into our install. We should have one of these solutions in our next release.
\ No newline at end of file
similarity index 87%
rename from src/external/gmock-1.7.0/include/gmock/gmock-actions.h
rename to src/external/googletest/googlemock/include/gmock/gmock-actions.h
index 7e9708ec29ead90abc67464833e3dc3d0fdfa909..b3f654af348d1a6c3d307d3539705837f3921334 100644 (file)
 #include "gmock/internal/gmock-internal-utils.h"
 #include "gmock/internal/gmock-port.h"
 
+#if GTEST_HAS_STD_TYPE_TRAITS_  // Defined by gtest-port.h via gmock-port.h.
+#include <type_traits>
+#endif
+
 namespace testing {
 
 // To implement an action Foo, define:
@@ -62,16 +66,17 @@ namespace internal {
 template <typename F1, typename F2>
 class ActionAdaptor;
 
-// BuiltInDefaultValue<T>::Get() returns the "built-in" default
-// value for type T, which is NULL when T is a pointer type, 0 when T
-// is a numeric type, false when T is bool, or "" when T is string or
-// std::string.  For any other type T, this value is undefined and the
-// function will abort the process.
+// BuiltInDefaultValueGetter<T, true>::Get() returns a
+// default-constructed T value.  BuiltInDefaultValueGetter<T,
+// false>::Get() crashes with an error.
+//
+// This primary template is used when kDefaultConstructible is true.
+template <typename T, bool kDefaultConstructible>
+struct BuiltInDefaultValueGetter {
+  static T Get() { return T(); }
+};
 template <typename T>
-class BuiltInDefaultValue {
- public:
-  // This function returns true iff type T has a built-in default value.
-  static bool Exists() { return false; }
+struct BuiltInDefaultValueGetter<T, false> {
   static T Get() {
     Assert(false, __FILE__, __LINE__,
            "Default action undefined for the function return type.");
@@ -81,6 +86,40 @@ class BuiltInDefaultValue {
   }
 };
 
+// BuiltInDefaultValue<T>::Get() returns the "built-in" default value
+// for type T, which is NULL when T is a raw pointer type, 0 when T is
+// a numeric type, false when T is bool, or "" when T is string or
+// std::string.  In addition, in C++11 and above, it turns a
+// default-constructed T value if T is default constructible.  For any
+// other type T, the built-in default T value is undefined, and the
+// function will abort the process.
+template <typename T>
+class BuiltInDefaultValue {
+ public:
+#if GTEST_HAS_STD_TYPE_TRAITS_
+  // This function returns true iff type T has a built-in default value.
+  static bool Exists() {
+    return ::std::is_default_constructible<T>::value;
+  }
+
+  static T Get() {
+    return BuiltInDefaultValueGetter<
+        T, ::std::is_default_constructible<T>::value>::Get();
+  }
+
+#else  // GTEST_HAS_STD_TYPE_TRAITS_
+  // This function returns true iff type T has a built-in default value.
+  static bool Exists() {
+    return false;
+  }
+
+  static T Get() {
+    return BuiltInDefaultValueGetter<T, false>::Get();
+  }
+
+#endif  // GTEST_HAS_STD_TYPE_TRAITS_
+};
+
 // This partial specialization says that we use the same built-in
 // default value for T and const T.
 template <typename T>
@@ -163,18 +202,27 @@ class DefaultValue {
   // Sets the default value for type T; requires T to be
   // copy-constructable and have a public destructor.
   static void Set(T x) {
-    delete value_;
-    value_ = new T(x);
+    delete producer_;
+    producer_ = new FixedValueProducer(x);
+  }
+
+  // Provides a factory function to be called to generate the default value.
+  // This method can be used even if T is only move-constructible, but it is not
+  // limited to that case.
+  typedef T (*FactoryFunction)();
+  static void SetFactory(FactoryFunction factory) {
+    delete producer_;
+    producer_ = new FactoryValueProducer(factory);
   }
 
   // Unsets the default value for type T.
   static void Clear() {
-    delete value_;
-    value_ = NULL;
+    delete producer_;
+    producer_ = NULL;
   }
 
   // Returns true iff the user has set the default value for type T.
-  static bool IsSet() { return value_ != NULL; }
+  static bool IsSet() { return producer_ != NULL; }
 
   // Returns true if T has a default return value set by the user or there
   // exists a built-in default value.
@@ -183,15 +231,42 @@ class DefaultValue {
   }
 
   // Returns the default value for type T if the user has set one;
-  // otherwise returns the built-in default value if there is one;
-  // otherwise aborts the process.
+  // otherwise returns the built-in default value. Requires that Exists()
+  // is true, which ensures that the return value is well-defined.
   static T Get() {
-    return value_ == NULL ?
-        internal::BuiltInDefaultValue<T>::Get() : *value_;
+    return producer_ == NULL ?
+        internal::BuiltInDefaultValue<T>::Get() : producer_->Produce();
   }
 
  private:
-  static const T* value_;
+  class ValueProducer {
+   public:
+    virtual ~ValueProducer() {}
+    virtual T Produce() = 0;
+  };
+
+  class FixedValueProducer : public ValueProducer {
+   public:
+    explicit FixedValueProducer(T value) : value_(value) {}
+    virtual T Produce() { return value_; }
+
+   private:
+    const T value_;
+    GTEST_DISALLOW_COPY_AND_ASSIGN_(FixedValueProducer);
+  };
+
+  class FactoryValueProducer : public ValueProducer {
+   public:
+    explicit FactoryValueProducer(FactoryFunction factory)
+        : factory_(factory) {}
+    virtual T Produce() { return factory_(); }
+
+   private:
+    const FactoryFunction factory_;
+    GTEST_DISALLOW_COPY_AND_ASSIGN_(FactoryValueProducer);
+  };
+
+  static ValueProducer* producer_;
 };
 
 // This partial specialization allows a user to set default values for
@@ -241,7 +316,7 @@ class DefaultValue<void> {
 
 // Points to the user-set default value for type T.
 template <typename T>
-const T* DefaultValue<T>::value_ = NULL;
+typename DefaultValue<T>::ValueProducer* DefaultValue<T>::producer_ = NULL;
 
 // Points to the user-set default value for type T&.
 template <typename T>
@@ -423,6 +498,14 @@ class ActionAdaptor : public ActionInterface<F1> {
   GTEST_DISALLOW_ASSIGN_(ActionAdaptor);
 };
 
+// Helper struct to specialize ReturnAction to execute a move instead of a copy
+// on return. Useful for move-only types, but could be used on any type.
+template <typename T>
+struct ByMoveWrapper {
+  explicit ByMoveWrapper(T value) : payload(internal::move(value)) {}
+  T payload;
+};
+
 // Implements the polymorphic Return(x) action, which can be used in
 // any function that returns the type of x, regardless of the argument
 // types.
@@ -453,7 +536,7 @@ class ReturnAction {
   // Constructs a ReturnAction object from the value to be returned.
   // 'value' is passed by value instead of by const reference in order
   // to allow Return("string literal") to compile.
-  explicit ReturnAction(R value) : value_(value) {}
+  explicit ReturnAction(R value) : value_(new R(internal::move(value))) {}
 
   // This template type conversion operator allows Return(x) to be
   // used in ANY function that returns x's type.
@@ -469,14 +552,14 @@ class ReturnAction {
     // in the Impl class. But both definitions must be the same.
     typedef typename Function<F>::Result Result;
     GTEST_COMPILE_ASSERT_(
-        !internal::is_reference<Result>::value,
+        !is_reference<Result>::value,
         use_ReturnRef_instead_of_Return_to_return_a_reference);
-    return Action<F>(new Impl<F>(value_));
+    return Action<F>(new Impl<R, F>(value_));
   }
 
  private:
   // Implements the Return(x) action for a particular function type F.
-  template <typename F>
+  template <typename R_, typename F>
   class Impl : public ActionInterface<F> {
    public:
     typedef typename Function<F>::Result Result;
@@ -489,20 +572,49 @@ class ReturnAction {
     // Result to call.  ImplicitCast_ forces the compiler to convert R to
     // Result without considering explicit constructors, thus resolving the
     // ambiguity. value_ is then initialized using its copy constructor.
-    explicit Impl(R value)
-        : value_(::testing::internal::ImplicitCast_<Result>(value)) {}
+    explicit Impl(const linked_ptr<R>& value)
+        : value_before_cast_(*value),
+          value_(ImplicitCast_<Result>(value_before_cast_)) {}
 
     virtual Result Perform(const ArgumentTuple&) { return value_; }
 
    private:
-    GTEST_COMPILE_ASSERT_(!internal::is_reference<Result>::value,
+    GTEST_COMPILE_ASSERT_(!is_reference<Result>::value,
                           Result_cannot_be_a_reference_type);
+    // We save the value before casting just in case it is being cast to a
+    // wrapper type.
+    R value_before_cast_;
     Result value_;
 
+    GTEST_DISALLOW_COPY_AND_ASSIGN_(Impl);
+  };
+
+  // Partially specialize for ByMoveWrapper. This version of ReturnAction will
+  // move its contents instead.
+  template <typename R_, typename F>
+  class Impl<ByMoveWrapper<R_>, F> : public ActionInterface<F> {
+   public:
+    typedef typename Function<F>::Result Result;
+    typedef typename Function<F>::ArgumentTuple ArgumentTuple;
+
+    explicit Impl(const linked_ptr<R>& wrapper)
+        : performed_(false), wrapper_(wrapper) {}
+
+    virtual Result Perform(const ArgumentTuple&) {
+      GTEST_CHECK_(!performed_)
+          << "A ByMove() action should only be performed once.";
+      performed_ = true;
+      return internal::move(wrapper_->payload);
+    }
+
+   private:
+    bool performed_;
+    const linked_ptr<R> wrapper_;
+
     GTEST_DISALLOW_ASSIGN_(Impl);
   };
 
-  R value_;
+  const linked_ptr<R> value_;
 
   GTEST_DISALLOW_ASSIGN_(ReturnAction);
 };
@@ -510,12 +622,18 @@ class ReturnAction {
 // Implements the ReturnNull() action.
 class ReturnNullAction {
  public:
-  // Allows ReturnNull() to be used in any pointer-returning function.
+  // Allows ReturnNull() to be used in any pointer-returning function. In C++11
+  // this is enforced by returning nullptr, and in non-C++11 by asserting a
+  // pointer type on compile time.
   template <typename Result, typename ArgumentTuple>
   static Result Perform(const ArgumentTuple&) {
+#if GTEST_LANG_CXX11
+    return nullptr;
+#else
     GTEST_COMPILE_ASSERT_(internal::is_pointer<Result>::value,
                           ReturnNull_can_be_used_to_return_a_pointer_only);
     return NULL;
+#endif  // GTEST_LANG_CXX11
   }
 };
 
@@ -692,7 +810,7 @@ class SetArgumentPointeeAction {
   template <typename Result, typename ArgumentTuple>
   void Perform(const ArgumentTuple& args) const {
     CompileAssertTypesEqual<void, Result>();
-    *::std::tr1::get<N>(args) = value_;
+    *::testing::get<N>(args) = value_;
   }
 
  private:
@@ -715,7 +833,7 @@ class SetArgumentPointeeAction<N, Proto, true> {
   template <typename Result, typename ArgumentTuple>
   void Perform(const ArgumentTuple& args) const {
     CompileAssertTypesEqual<void, Result>();
-    ::std::tr1::get<N>(args)->CopyFrom(*proto_);
+    ::testing::get<N>(args)->CopyFrom(*proto_);
   }
 
  private:
@@ -941,7 +1059,7 @@ Action<To>::Action(const Action<From>& from)
 // will trigger a compiler error about using array as initializer.
 template <typename R>
 internal::ReturnAction<R> Return(R value) {
-  return internal::ReturnAction<R>(value);
+  return internal::ReturnAction<R>(internal::move(value));
 }
 
 // Creates an action that returns NULL.
@@ -968,6 +1086,15 @@ inline internal::ReturnRefOfCopyAction<R> ReturnRefOfCopy(const R& x) {
   return internal::ReturnRefOfCopyAction<R>(x);
 }
 
+// Modifies the parent action (a Return() action) to perform a move of the
+// argument instead of a copy.
+// Return(ByMove()) actions can only be executed once and will assert this
+// invariant.
+template <typename R>
+internal::ByMoveWrapper<R> ByMove(R x) {
+  return internal::ByMoveWrapper<R>(internal::move(x));
+}
+
 // Creates an action that does the default action for the give mock function.
 inline internal::DoDefaultAction DoDefault() {
   return internal::DoDefaultAction();
similarity index 88%
rename from src/external/gmock-1.7.0/include/gmock/gmock-generated-actions.h
rename to src/external/googletest/googlemock/include/gmock/gmock-generated-actions.h
index 2327393d6b1a9c850cac4742c15ad079aa2ed06e..b5a889c0c3a40d6a4cf2693256f67861da256ac1 100644 (file)
@@ -51,356 +51,240 @@ template <typename Result, typename ArgumentTuple>
 class InvokeHelper;
 
 template <typename R>
-class InvokeHelper<R, ::std::tr1::tuple<> > {
+class InvokeHelper<R, ::testing::tuple<> > {
  public:
   template <typename Function>
-  static R Invoke(Function function, const ::std::tr1::tuple<>&) {
-    return function();
+  static R Invoke(Function function, const ::testing::tuple<>&) {
+           return function();
   }
 
   template <class Class, typename MethodPtr>
   static R InvokeMethod(Class* obj_ptr,
                         MethodPtr method_ptr,
-                        const ::std::tr1::tuple<>&) {
-    return (obj_ptr->*method_ptr)();
+                        const ::testing::tuple<>&) {
+           return (obj_ptr->*method_ptr)();
   }
 };
 
 template <typename R, typename A1>
-class InvokeHelper<R, ::std::tr1::tuple<A1> > {
+class InvokeHelper<R, ::testing::tuple<A1> > {
  public:
   template <typename Function>
-  static R Invoke(Function function, const ::std::tr1::tuple<A1>& args) {
-    using ::std::tr1::get;
-    return function(get<0>(args));
+  static R Invoke(Function function, const ::testing::tuple<A1>& args) {
+           return function(get<0>(args));
   }
 
   template <class Class, typename MethodPtr>
   static R InvokeMethod(Class* obj_ptr,
                         MethodPtr method_ptr,
-                        const ::std::tr1::tuple<A1>& args) {
-    using ::std::tr1::get;
-    return (obj_ptr->*method_ptr)(get<0>(args));
+                        const ::testing::tuple<A1>& args) {
+           return (obj_ptr->*method_ptr)(get<0>(args));
   }
 };
 
 template <typename R, typename A1, typename A2>
-class InvokeHelper<R, ::std::tr1::tuple<A1, A2> > {
+class InvokeHelper<R, ::testing::tuple<A1, A2> > {
  public:
   template <typename Function>
-  static R Invoke(Function function, const ::std::tr1::tuple<A1, A2>& args) {
-    using ::std::tr1::get;
-    return function(get<0>(args), get<1>(args));
+  static R Invoke(Function function, const ::testing::tuple<A1, A2>& args) {
+           return function(get<0>(args), get<1>(args));
   }
 
   template <class Class, typename MethodPtr>
   static R InvokeMethod(Class* obj_ptr,
                         MethodPtr method_ptr,
-                        const ::std::tr1::tuple<A1, A2>& args) {
-    using ::std::tr1::get;
-    return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args));
+                        const ::testing::tuple<A1, A2>& args) {
+           return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args));
   }
 };
 
 template <typename R, typename A1, typename A2, typename A3>
-class InvokeHelper<R, ::std::tr1::tuple<A1, A2, A3> > {
+class InvokeHelper<R, ::testing::tuple<A1, A2, A3> > {
  public:
   template <typename Function>
-  static R Invoke(Function function, const ::std::tr1::tuple<A1, A2,
-      A3>& args) {
-    using ::std::tr1::get;
-    return function(get<0>(args), get<1>(args), get<2>(args));
+  static R Invoke(Function function, const ::testing::tuple<A1, A2, A3>& args) {
+           return function(get<0>(args), get<1>(args), get<2>(args));
   }
 
   template <class Class, typename MethodPtr>
   static R InvokeMethod(Class* obj_ptr,
                         MethodPtr method_ptr,
-                        const ::std::tr1::tuple<A1, A2, A3>& args) {
-    using ::std::tr1::get;
-    return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), get<2>(args));
+                        const ::testing::tuple<A1, A2, A3>& args) {
+           return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args),
+               get<2>(args));
   }
 };
 
 template <typename R, typename A1, typename A2, typename A3, typename A4>
-class InvokeHelper<R, ::std::tr1::tuple<A1, A2, A3, A4> > {
+class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4> > {
  public:
   template <typename Function>
-  static R Invoke(Function function, const ::std::tr1::tuple<A1, A2, A3,
+  static R Invoke(Function function, const ::testing::tuple<A1, A2, A3,
       A4>& args) {
-    using ::std::tr1::get;
-    return function(get<0>(args), get<1>(args), get<2>(args), get<3>(args));
+           return function(get<0>(args), get<1>(args), get<2>(args),
+               get<3>(args));
   }
 
   template <class Class, typename MethodPtr>
   static R InvokeMethod(Class* obj_ptr,
                         MethodPtr method_ptr,
-                        const ::std::tr1::tuple<A1, A2, A3, A4>& args) {
-    using ::std::tr1::get;
-    return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), get<2>(args),
-        get<3>(args));
+                        const ::testing::tuple<A1, A2, A3, A4>& args) {
+           return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args),
+               get<2>(args), get<3>(args));
   }
 };
 
 template <typename R, typename A1, typename A2, typename A3, typename A4,
     typename A5>
-class InvokeHelper<R, ::std::tr1::tuple<A1, A2, A3, A4, A5> > {
+class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5> > {
  public:
   template <typename Function>
-  static R Invoke(Function function, const ::std::tr1::tuple<A1, A2, A3, A4,
+  static R Invoke(Function function, const ::testing::tuple<A1, A2, A3, A4,
       A5>& args) {
-    using ::std::tr1::get;
-    return function(get<0>(args), get<1>(args), get<2>(args), get<3>(args),
-        get<4>(args));
+           return function(get<0>(args), get<1>(args), get<2>(args),
+               get<3>(args), get<4>(args));
   }
 
   template <class Class, typename MethodPtr>
   static R InvokeMethod(Class* obj_ptr,
                         MethodPtr method_ptr,
-                        const ::std::tr1::tuple<A1, A2, A3, A4, A5>& args) {
-    using ::std::tr1::get;
-    return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), get<2>(args),
-        get<3>(args), get<4>(args));
+                        const ::testing::tuple<A1, A2, A3, A4, A5>& args) {
+           return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args),
+               get<2>(args), get<3>(args), get<4>(args));
   }
 };
 
 template <typename R, typename A1, typename A2, typename A3, typename A4,
     typename A5, typename A6>
-class InvokeHelper<R, ::std::tr1::tuple<A1, A2, A3, A4, A5, A6> > {
+class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6> > {
  public:
   template <typename Function>
-  static R Invoke(Function function, const ::std::tr1::tuple<A1, A2, A3, A4,
-      A5, A6>& args) {
-    using ::std::tr1::get;
-    return function(get<0>(args), get<1>(args), get<2>(args), get<3>(args),
-        get<4>(args), get<5>(args));
+  static R Invoke(Function function, const ::testing::tuple<A1, A2, A3, A4, A5,
+      A6>& args) {
+           return function(get<0>(args), get<1>(args), get<2>(args),
+               get<3>(args), get<4>(args), get<5>(args));
   }
 
   template <class Class, typename MethodPtr>
   static R InvokeMethod(Class* obj_ptr,
                         MethodPtr method_ptr,
-                        const ::std::tr1::tuple<A1, A2, A3, A4, A5, A6>& args) {
-    using ::std::tr1::get;
-    return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), get<2>(args),
-        get<3>(args), get<4>(args), get<5>(args));
+                        const ::testing::tuple<A1, A2, A3, A4, A5, A6>& args) {
+           return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args),
+               get<2>(args), get<3>(args), get<4>(args), get<5>(args));
   }
 };
 
 template <typename R, typename A1, typename A2, typename A3, typename A4,
     typename A5, typename A6, typename A7>
-class InvokeHelper<R, ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7> > {
+class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6, A7> > {
  public:
   template <typename Function>
-  static R Invoke(Function function, const ::std::tr1::tuple<A1, A2, A3, A4,
-      A5, A6, A7>& args) {
-    using ::std::tr1::get;
-    return function(get<0>(args), get<1>(args), get<2>(args), get<3>(args),
-        get<4>(args), get<5>(args), get<6>(args));
+  static R Invoke(Function function, const ::testing::tuple<A1, A2, A3, A4, A5,
+      A6, A7>& args) {
+           return function(get<0>(args), get<1>(args), get<2>(args),
+               get<3>(args), get<4>(args), get<5>(args), get<6>(args));
   }
 
   template <class Class, typename MethodPtr>
   static R InvokeMethod(Class* obj_ptr,
                         MethodPtr method_ptr,
-                        const ::std::tr1::tuple<A1, A2, A3, A4, A5, A6,
+                        const ::testing::tuple<A1, A2, A3, A4, A5, A6,
                             A7>& args) {
-    using ::std::tr1::get;
-    return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), get<2>(args),
-        get<3>(args), get<4>(args), get<5>(args), get<6>(args));
+           return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args),
+               get<2>(args), get<3>(args), get<4>(args), get<5>(args),
+               get<6>(args));
   }
 };
 
 template <typename R, typename A1, typename A2, typename A3, typename A4,
     typename A5, typename A6, typename A7, typename A8>
-class InvokeHelper<R, ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8> > {
+class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8> > {
  public:
   template <typename Function>
-  static R Invoke(Function function, const ::std::tr1::tuple<A1, A2, A3, A4,
-      A5, A6, A7, A8>& args) {
-    using ::std::tr1::get;
-    return function(get<0>(args), get<1>(args), get<2>(args), get<3>(args),
-        get<4>(args), get<5>(args), get<6>(args), get<7>(args));
+  static R Invoke(Function function, const ::testing::tuple<A1, A2, A3, A4, A5,
+      A6, A7, A8>& args) {
+           return function(get<0>(args), get<1>(args), get<2>(args),
+               get<3>(args), get<4>(args), get<5>(args), get<6>(args),
+               get<7>(args));
   }
 
   template <class Class, typename MethodPtr>
   static R InvokeMethod(Class* obj_ptr,
                         MethodPtr method_ptr,
-                        const ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7,
+                        const ::testing::tuple<A1, A2, A3, A4, A5, A6, A7,
                             A8>& args) {
-    using ::std::tr1::get;
-    return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), get<2>(args),
-        get<3>(args), get<4>(args), get<5>(args), get<6>(args), get<7>(args));
+           return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args),
+               get<2>(args), get<3>(args), get<4>(args), get<5>(args),
+               get<6>(args), get<7>(args));
   }
 };
 
 template <typename R, typename A1, typename A2, typename A3, typename A4,
     typename A5, typename A6, typename A7, typename A8, typename A9>
-class InvokeHelper<R, ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9> > {
+class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9> > {
  public:
   template <typename Function>
-  static R Invoke(Function function, const ::std::tr1::tuple<A1, A2, A3, A4,
-      A5, A6, A7, A8, A9>& args) {
-    using ::std::tr1::get;
-    return function(get<0>(args), get<1>(args), get<2>(args), get<3>(args),
-        get<4>(args), get<5>(args), get<6>(args), get<7>(args), get<8>(args));
+  static R Invoke(Function function, const ::testing::tuple<A1, A2, A3, A4, A5,
+      A6, A7, A8, A9>& args) {
+           return function(get<0>(args), get<1>(args), get<2>(args),
+               get<3>(args), get<4>(args), get<5>(args), get<6>(args),
+               get<7>(args), get<8>(args));
   }
 
   template <class Class, typename MethodPtr>
   static R InvokeMethod(Class* obj_ptr,
                         MethodPtr method_ptr,
-                        const ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8,
+                        const ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8,
                             A9>& args) {
-    using ::std::tr1::get;
-    return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), get<2>(args),
-        get<3>(args), get<4>(args), get<5>(args), get<6>(args), get<7>(args),
-        get<8>(args));
+           return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args),
+               get<2>(args), get<3>(args), get<4>(args), get<5>(args),
+               get<6>(args), get<7>(args), get<8>(args));
   }
 };
 
 template <typename R, typename A1, typename A2, typename A3, typename A4,
     typename A5, typename A6, typename A7, typename A8, typename A9,
     typename A10>
-class InvokeHelper<R, ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9,
+class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9,
     A10> > {
  public:
   template <typename Function>
-  static R Invoke(Function function, const ::std::tr1::tuple<A1, A2, A3, A4,
-      A5, A6, A7, A8, A9, A10>& args) {
-    using ::std::tr1::get;
-    return function(get<0>(args), get<1>(args), get<2>(args), get<3>(args),
-        get<4>(args), get<5>(args), get<6>(args), get<7>(args), get<8>(args),
-        get<9>(args));
+  static R Invoke(Function function, const ::testing::tuple<A1, A2, A3, A4, A5,
+      A6, A7, A8, A9, A10>& args) {
+           return function(get<0>(args), get<1>(args), get<2>(args),
+               get<3>(args), get<4>(args), get<5>(args), get<6>(args),
+               get<7>(args), get<8>(args), get<9>(args));
   }
 
   template <class Class, typename MethodPtr>
   static R InvokeMethod(Class* obj_ptr,
                         MethodPtr method_ptr,
-                        const ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8,
+                        const ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8,
                             A9, A10>& args) {
-    using ::std::tr1::get;
-    return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), get<2>(args),
-        get<3>(args), get<4>(args), get<5>(args), get<6>(args), get<7>(args),
-        get<8>(args), get<9>(args));
+           return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args),
+               get<2>(args), get<3>(args), get<4>(args), get<5>(args),
+               get<6>(args), get<7>(args), get<8>(args), get<9>(args));
   }
 };
 
-// CallableHelper has static methods for invoking "callables",
-// i.e. function pointers and functors.  It uses overloading to
-// provide a uniform interface for invoking different kinds of
-// callables.  In particular, you can use:
-//
-//   CallableHelper<R>::Call(callable, a1, a2, ..., an)
-//
-// to invoke an n-ary callable, where R is its return type.  If an
-// argument, say a2, needs to be passed by reference, you should write
-// ByRef(a2) instead of a2 in the above expression.
-template <typename R>
-class CallableHelper {
- public:
-  // Calls a nullary callable.
-  template <typename Function>
-  static R Call(Function function) { return function(); }
-
-  // Calls a unary callable.
-
-  // We deliberately pass a1 by value instead of const reference here
-  // in case it is a C-string literal.  If we had declared the
-  // parameter as 'const A1& a1' and write Call(function, "Hi"), the
-  // compiler would've thought A1 is 'char[3]', which causes trouble
-  // when you need to copy a value of type A1.  By declaring the
-  // parameter as 'A1 a1', the compiler will correctly infer that A1
-  // is 'const char*' when it sees Call(function, "Hi").
-  //
-  // Since this function is defined inline, the compiler can get rid
-  // of the copying of the arguments.  Therefore the performance won't
-  // be hurt.
-  template <typename Function, typename A1>
-  static R Call(Function function, A1 a1) { return function(a1); }
-
-  // Calls a binary callable.
-  template <typename Function, typename A1, typename A2>
-  static R Call(Function function, A1 a1, A2 a2) {
-    return function(a1, a2);
-  }
-
-  // Calls a ternary callable.
-  template <typename Function, typename A1, typename A2, typename A3>
-  static R Call(Function function, A1 a1, A2 a2, A3 a3) {
-    return function(a1, a2, a3);
-  }
-
-  // Calls a 4-ary callable.
-  template <typename Function, typename A1, typename A2, typename A3,
-      typename A4>
-  static R Call(Function function, A1 a1, A2 a2, A3 a3, A4 a4) {
-    return function(a1, a2, a3, a4);
-  }
-
-  // Calls a 5-ary callable.
-  template <typename Function, typename A1, typename A2, typename A3,
-      typename A4, typename A5>
-  static R Call(Function function, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) {
-    return function(a1, a2, a3, a4, a5);
-  }
-
-  // Calls a 6-ary callable.
-  template <typename Function, typename A1, typename A2, typename A3,
-      typename A4, typename A5, typename A6>
-  static R Call(Function function, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) {
-    return function(a1, a2, a3, a4, a5, a6);
-  }
-
-  // Calls a 7-ary callable.
-  template <typename Function, typename A1, typename A2, typename A3,
-      typename A4, typename A5, typename A6, typename A7>
-  static R Call(Function function, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6,
-      A7 a7) {
-    return function(a1, a2, a3, a4, a5, a6, a7);
-  }
-
-  // Calls a 8-ary callable.
-  template <typename Function, typename A1, typename A2, typename A3,
-      typename A4, typename A5, typename A6, typename A7, typename A8>
-  static R Call(Function function, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6,
-      A7 a7, A8 a8) {
-    return function(a1, a2, a3, a4, a5, a6, a7, a8);
-  }
-
-  // Calls a 9-ary callable.
-  template <typename Function, typename A1, typename A2, typename A3,
-      typename A4, typename A5, typename A6, typename A7, typename A8,
-      typename A9>
-  static R Call(Function function, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6,
-      A7 a7, A8 a8, A9 a9) {
-    return function(a1, a2, a3, a4, a5, a6, a7, a8, a9);
-  }
-
-  // Calls a 10-ary callable.
-  template <typename Function, typename A1, typename A2, typename A3,
-      typename A4, typename A5, typename A6, typename A7, typename A8,
-      typename A9, typename A10>
-  static R Call(Function function, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6,
-      A7 a7, A8 a8, A9 a9, A10 a10) {
-    return function(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
-  }
-};  // class CallableHelper
-
 // An INTERNAL macro for extracting the type of a tuple field.  It's
 // subject to change without notice - DO NOT USE IN USER CODE!
 #define GMOCK_FIELD_(Tuple, N) \
-    typename ::std::tr1::tuple_element<N, Tuple>::type
+    typename ::testing::tuple_element<N, Tuple>::type
 
 // SelectArgs<Result, ArgumentTuple, k1, k2, ..., k_n>::type is the
 // type of an n-ary function whose i-th (1-based) argument type is the
 // k{i}-th (0-based) field of ArgumentTuple, which must be a tuple
 // type, and whose return type is Result.  For example,
-//   SelectArgs<int, ::std::tr1::tuple<bool, char, double, long>, 0, 3>::type
+//   SelectArgs<int, ::testing::tuple<bool, char, double, long>, 0, 3>::type
 // is int(bool, long).
 //
 // SelectArgs<Result, ArgumentTuple, k1, k2, ..., k_n>::Select(args)
 // returns the selected fields (k1, k2, ..., k_n) of args as a tuple.
 // For example,
-//   SelectArgs<int, ::std::tr1::tuple<bool, char, double>, 2, 0>::Select(
-//       ::std::tr1::make_tuple(true, 'a', 2.5))
-// returns ::std::tr1::tuple (2.5, true).
+//   SelectArgs<int, tuple<bool, char, double>, 2, 0>::Select(
+//       ::testing::make_tuple(true, 'a', 2.5))
+// returns tuple (2.5, true).
 //
 // The numbers in list k1, k2, ..., k_n must be >= 0, where n can be
 // in the range [0, 10].  Duplicates are allowed and they don't have
@@ -418,7 +302,6 @@ class SelectArgs {
       GMOCK_FIELD_(ArgumentTuple, k10));
   typedef typename Function<type>::ArgumentTuple SelectedArgs;
   static SelectedArgs Select(const ArgumentTuple& args) {
-    using ::std::tr1::get;
     return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args),
         get<k4>(args), get<k5>(args), get<k6>(args), get<k7>(args),
         get<k8>(args), get<k9>(args), get<k10>(args));
@@ -432,7 +315,6 @@ class SelectArgs<Result, ArgumentTuple,
   typedef Result type();
   typedef typename Function<type>::ArgumentTuple SelectedArgs;
   static SelectedArgs Select(const ArgumentTuple& /* args */) {
-    using ::std::tr1::get;
     return SelectedArgs();
   }
 };
@@ -444,7 +326,6 @@ class SelectArgs<Result, ArgumentTuple,
   typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1));
   typedef typename Function<type>::ArgumentTuple SelectedArgs;
   static SelectedArgs Select(const ArgumentTuple& args) {
-    using ::std::tr1::get;
     return SelectedArgs(get<k1>(args));
   }
 };
@@ -457,7 +338,6 @@ class SelectArgs<Result, ArgumentTuple,
       GMOCK_FIELD_(ArgumentTuple, k2));
   typedef typename Function<type>::ArgumentTuple SelectedArgs;
   static SelectedArgs Select(const ArgumentTuple& args) {
-    using ::std::tr1::get;
     return SelectedArgs(get<k1>(args), get<k2>(args));
   }
 };
@@ -470,7 +350,6 @@ class SelectArgs<Result, ArgumentTuple,
       GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3));
   typedef typename Function<type>::ArgumentTuple SelectedArgs;
   static SelectedArgs Select(const ArgumentTuple& args) {
-    using ::std::tr1::get;
     return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args));
   }
 };
@@ -485,7 +364,6 @@ class SelectArgs<Result, ArgumentTuple,
       GMOCK_FIELD_(ArgumentTuple, k4));
   typedef typename Function<type>::ArgumentTuple SelectedArgs;
   static SelectedArgs Select(const ArgumentTuple& args) {
-    using ::std::tr1::get;
     return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args),
         get<k4>(args));
   }
@@ -501,7 +379,6 @@ class SelectArgs<Result, ArgumentTuple,
       GMOCK_FIELD_(ArgumentTuple, k4), GMOCK_FIELD_(ArgumentTuple, k5));
   typedef typename Function<type>::ArgumentTuple SelectedArgs;
   static SelectedArgs Select(const ArgumentTuple& args) {
-    using ::std::tr1::get;
     return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args),
         get<k4>(args), get<k5>(args));
   }
@@ -518,7 +395,6 @@ class SelectArgs<Result, ArgumentTuple,
       GMOCK_FIELD_(ArgumentTuple, k6));
   typedef typename Function<type>::ArgumentTuple SelectedArgs;
   static SelectedArgs Select(const ArgumentTuple& args) {
-    using ::std::tr1::get;
     return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args),
         get<k4>(args), get<k5>(args), get<k6>(args));
   }
@@ -535,7 +411,6 @@ class SelectArgs<Result, ArgumentTuple,
       GMOCK_FIELD_(ArgumentTuple, k6), GMOCK_FIELD_(ArgumentTuple, k7));
   typedef typename Function<type>::ArgumentTuple SelectedArgs;
   static SelectedArgs Select(const ArgumentTuple& args) {
-    using ::std::tr1::get;
     return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args),
         get<k4>(args), get<k5>(args), get<k6>(args), get<k7>(args));
   }
@@ -553,7 +428,6 @@ class SelectArgs<Result, ArgumentTuple,
       GMOCK_FIELD_(ArgumentTuple, k8));
   typedef typename Function<type>::ArgumentTuple SelectedArgs;
   static SelectedArgs Select(const ArgumentTuple& args) {
-    using ::std::tr1::get;
     return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args),
         get<k4>(args), get<k5>(args), get<k6>(args), get<k7>(args),
         get<k8>(args));
@@ -572,7 +446,6 @@ class SelectArgs<Result, ArgumentTuple,
       GMOCK_FIELD_(ArgumentTuple, k8), GMOCK_FIELD_(ArgumentTuple, k9));
   typedef typename Function<type>::ArgumentTuple SelectedArgs;
   static SelectedArgs Select(const ArgumentTuple& args) {
-    using ::std::tr1::get;
     return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args),
         get<k4>(args), get<k5>(args), get<k6>(args), get<k7>(args),
         get<k8>(args), get<k9>(args));
@@ -638,8 +511,7 @@ struct ExcessiveArg {};
 template <typename Result, class Impl>
 class ActionHelper {
  public:
-  static Result Perform(Impl* impl, const ::std::tr1::tuple<>& args) {
-    using ::std::tr1::get;
+  static Result Perform(Impl* impl, const ::testing::tuple<>& args) {
     return impl->template gmock_PerformImpl<>(args, ExcessiveArg(),
         ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
         ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
@@ -647,8 +519,7 @@ class ActionHelper {
   }
 
   template <typename A0>
-  static Result Perform(Impl* impl, const ::std::tr1::tuple<A0>& args) {
-    using ::std::tr1::get;
+  static Result Perform(Impl* impl, const ::testing::tuple<A0>& args) {
     return impl->template gmock_PerformImpl<A0>(args, get<0>(args),
         ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
         ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
@@ -656,8 +527,7 @@ class ActionHelper {
   }
 
   template <typename A0, typename A1>
-  static Result Perform(Impl* impl, const ::std::tr1::tuple<A0, A1>& args) {
-    using ::std::tr1::get;
+  static Result Perform(Impl* impl, const ::testing::tuple<A0, A1>& args) {
     return impl->template gmock_PerformImpl<A0, A1>(args, get<0>(args),
         get<1>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
         ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
@@ -665,8 +535,7 @@ class ActionHelper {
   }
 
   template <typename A0, typename A1, typename A2>
-  static Result Perform(Impl* impl, const ::std::tr1::tuple<A0, A1, A2>& args) {
-    using ::std::tr1::get;
+  static Result Perform(Impl* impl, const ::testing::tuple<A0, A1, A2>& args) {
     return impl->template gmock_PerformImpl<A0, A1, A2>(args, get<0>(args),
         get<1>(args), get<2>(args), ExcessiveArg(), ExcessiveArg(),
         ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
@@ -674,9 +543,8 @@ class ActionHelper {
   }
 
   template <typename A0, typename A1, typename A2, typename A3>
-  static Result Perform(Impl* impl, const ::std::tr1::tuple<A0, A1, A2,
+  static Result Perform(Impl* impl, const ::testing::tuple<A0, A1, A2,
       A3>& args) {
-    using ::std::tr1::get;
     return impl->template gmock_PerformImpl<A0, A1, A2, A3>(args, get<0>(args),
         get<1>(args), get<2>(args), get<3>(args), ExcessiveArg(),
         ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
@@ -684,9 +552,8 @@ class ActionHelper {
   }
 
   template <typename A0, typename A1, typename A2, typename A3, typename A4>
-  static Result Perform(Impl* impl, const ::std::tr1::tuple<A0, A1, A2, A3,
+  static Result Perform(Impl* impl, const ::testing::tuple<A0, A1, A2, A3,
       A4>& args) {
-    using ::std::tr1::get;
     return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4>(args,
         get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args),
         ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
@@ -695,9 +562,8 @@ class ActionHelper {
 
   template <typename A0, typename A1, typename A2, typename A3, typename A4,
       typename A5>
-  static Result Perform(Impl* impl, const ::std::tr1::tuple<A0, A1, A2, A3, A4,
+  static Result Perform(Impl* impl, const ::testing::tuple<A0, A1, A2, A3, A4,
       A5>& args) {
-    using ::std::tr1::get;
     return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5>(args,
         get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args),
         get<5>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(),
@@ -706,9 +572,8 @@ class ActionHelper {
 
   template <typename A0, typename A1, typename A2, typename A3, typename A4,
       typename A5, typename A6>
-  static Result Perform(Impl* impl, const ::std::tr1::tuple<A0, A1, A2, A3, A4,
+  static Result Perform(Impl* impl, const ::testing::tuple<A0, A1, A2, A3, A4,
       A5, A6>& args) {
-    using ::std::tr1::get;
     return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5, A6>(args,
         get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args),
         get<5>(args), get<6>(args), ExcessiveArg(), ExcessiveArg(),
@@ -717,9 +582,8 @@ class ActionHelper {
 
   template <typename A0, typename A1, typename A2, typename A3, typename A4,
       typename A5, typename A6, typename A7>
-  static Result Perform(Impl* impl, const ::std::tr1::tuple<A0, A1, A2, A3, A4,
+  static Result Perform(Impl* impl, const ::testing::tuple<A0, A1, A2, A3, A4,
       A5, A6, A7>& args) {
-    using ::std::tr1::get;
     return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5, A6,
         A7>(args, get<0>(args), get<1>(args), get<2>(args), get<3>(args),
         get<4>(args), get<5>(args), get<6>(args), get<7>(args), ExcessiveArg(),
@@ -728,9 +592,8 @@ class ActionHelper {
 
   template <typename A0, typename A1, typename A2, typename A3, typename A4,
       typename A5, typename A6, typename A7, typename A8>
-  static Result Perform(Impl* impl, const ::std::tr1::tuple<A0, A1, A2, A3, A4,
+  static Result Perform(Impl* impl, const ::testing::tuple<A0, A1, A2, A3, A4,
       A5, A6, A7, A8>& args) {
-    using ::std::tr1::get;
     return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5, A6, A7,
         A8>(args, get<0>(args), get<1>(args), get<2>(args), get<3>(args),
         get<4>(args), get<5>(args), get<6>(args), get<7>(args), get<8>(args),
@@ -739,9 +602,8 @@ class ActionHelper {
 
   template <typename A0, typename A1, typename A2, typename A3, typename A4,
       typename A5, typename A6, typename A7, typename A8, typename A9>
-  static Result Perform(Impl* impl, const ::std::tr1::tuple<A0, A1, A2, A3, A4,
+  static Result Perform(Impl* impl, const ::testing::tuple<A0, A1, A2, A3, A4,
       A5, A6, A7, A8, A9>& args) {
-    using ::std::tr1::get;
     return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5, A6, A7, A8,
         A9>(args, get<0>(args), get<1>(args), get<2>(args), get<3>(args),
         get<4>(args), get<5>(args), get<6>(args), get<7>(args), get<8>(args),
@@ -1053,7 +915,7 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
 //   ACTION_TEMPLATE(DuplicateArg,
 //                   HAS_2_TEMPLATE_PARAMS(int, k, typename, T),
 //                   AND_1_VALUE_PARAMS(output)) {
-//     *output = T(std::tr1::get<k>(args));
+//     *output = T(::testing::get<k>(args));
 //   }
 //   ...
 //     int n;
@@ -1384,7 +1246,7 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
             GMOCK_INTERNAL_DECL_TYPE_##value_params>\
   class GMOCK_ACTION_CLASS_(name, value_params) {\
    public:\
-    GMOCK_ACTION_CLASS_(name, value_params)\
+    explicit GMOCK_ACTION_CLASS_(name, value_params)\
         GMOCK_INTERNAL_INIT_##value_params {}\
     template <typename F>\
     class gmock_Impl : public ::testing::ActionInterface<F> {\
@@ -1492,7 +1354,7 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
   template <typename p0##_type>\
   class name##ActionP {\
    public:\
-    name##ActionP(p0##_type gmock_p0) : p0(gmock_p0) {}\
+    explicit name##ActionP(p0##_type gmock_p0) : p0(gmock_p0) {}\
     template <typename F>\
     class gmock_Impl : public ::testing::ActionInterface<F> {\
      public:\
@@ -2218,6 +2080,7 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
 
 namespace testing {
 
+
 // The ACTION*() macros trigger warning C4100 (unreferenced formal
 // parameter) in MSVC with -W4.  Unfortunately they cannot be fixed in
 // the macro definition, as the warnings are generated when the macro
@@ -2258,81 +2121,175 @@ namespace testing {
 //   InvokeArgument action from temporary values and have it performed
 //   later.
 
+namespace internal {
+namespace invoke_argument {
+
+// Appears in InvokeArgumentAdl's argument list to help avoid
+// accidental calls to user functions of the same name.
+struct AdlTag {};
+
+// InvokeArgumentAdl - a helper for InvokeArgument.
+// The basic overloads are provided here for generic functors.
+// Overloads for other custom-callables are provided in the
+// internal/custom/callback-actions.h header.
+
+template <typename R, typename F>
+R InvokeArgumentAdl(AdlTag, F f) {
+  return f();
+}
+template <typename R, typename F, typename A1>
+R InvokeArgumentAdl(AdlTag, F f, A1 a1) {
+  return f(a1);
+}
+template <typename R, typename F, typename A1, typename A2>
+R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2) {
+  return f(a1, a2);
+}
+template <typename R, typename F, typename A1, typename A2, typename A3>
+R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3) {
+  return f(a1, a2, a3);
+}
+template <typename R, typename F, typename A1, typename A2, typename A3,
+    typename A4>
+R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3, A4 a4) {
+  return f(a1, a2, a3, a4);
+}
+template <typename R, typename F, typename A1, typename A2, typename A3,
+    typename A4, typename A5>
+R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) {
+  return f(a1, a2, a3, a4, a5);
+}
+template <typename R, typename F, typename A1, typename A2, typename A3,
+    typename A4, typename A5, typename A6>
+R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) {
+  return f(a1, a2, a3, a4, a5, a6);
+}
+template <typename R, typename F, typename A1, typename A2, typename A3,
+    typename A4, typename A5, typename A6, typename A7>
+R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6,
+    A7 a7) {
+  return f(a1, a2, a3, a4, a5, a6, a7);
+}
+template <typename R, typename F, typename A1, typename A2, typename A3,
+    typename A4, typename A5, typename A6, typename A7, typename A8>
+R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6,
+    A7 a7, A8 a8) {
+  return f(a1, a2, a3, a4, a5, a6, a7, a8);
+}
+template <typename R, typename F, typename A1, typename A2, typename A3,
+    typename A4, typename A5, typename A6, typename A7, typename A8,
+    typename A9>
+R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6,
+    A7 a7, A8 a8, A9 a9) {
+  return f(a1, a2, a3, a4, a5, a6, a7, a8, a9);
+}
+template <typename R, typename F, typename A1, typename A2, typename A3,
+    typename A4, typename A5, typename A6, typename A7, typename A8,
+    typename A9, typename A10>
+R InvokeArgumentAdl(AdlTag, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6,
+    A7 a7, A8 a8, A9 a9, A10 a10) {
+  return f(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
+}
+}  // namespace invoke_argument
+}  // namespace internal
+
 ACTION_TEMPLATE(InvokeArgument,
                 HAS_1_TEMPLATE_PARAMS(int, k),
                 AND_0_VALUE_PARAMS()) {
-  return internal::CallableHelper<return_type>::Call(
-      ::std::tr1::get<k>(args));
+  using internal::invoke_argument::InvokeArgumentAdl;
+  return InvokeArgumentAdl<return_type>(
+      internal::invoke_argument::AdlTag(),
+      ::testing::get<k>(args));
 }
 
 ACTION_TEMPLATE(InvokeArgument,
                 HAS_1_TEMPLATE_PARAMS(int, k),
                 AND_1_VALUE_PARAMS(p0)) {
-  return internal::CallableHelper<return_type>::Call(
-      ::std::tr1::get<k>(args), p0);
+  using internal::invoke_argument::InvokeArgumentAdl;
+  return InvokeArgumentAdl<return_type>(
+      internal::invoke_argument::AdlTag(),
+      ::testing::get<k>(args), p0);
 }
 
 ACTION_TEMPLATE(InvokeArgument,
                 HAS_1_TEMPLATE_PARAMS(int, k),
                 AND_2_VALUE_PARAMS(p0, p1)) {
-  return internal::CallableHelper<return_type>::Call(
-      ::std::tr1::get<k>(args), p0, p1);
+  using internal::invoke_argument::InvokeArgumentAdl;
+  return InvokeArgumentAdl<return_type>(
+      internal::invoke_argument::AdlTag(),
+      ::testing::get<k>(args), p0, p1);
 }
 
 ACTION_TEMPLATE(InvokeArgument,
                 HAS_1_TEMPLATE_PARAMS(int, k),
                 AND_3_VALUE_PARAMS(p0, p1, p2)) {
-  return internal::CallableHelper<return_type>::Call(
-      ::std::tr1::get<k>(args), p0, p1, p2);
+  using internal::invoke_argument::InvokeArgumentAdl;
+  return InvokeArgumentAdl<return_type>(
+      internal::invoke_argument::AdlTag(),
+      ::testing::get<k>(args), p0, p1, p2);
 }
 
 ACTION_TEMPLATE(InvokeArgument,
                 HAS_1_TEMPLATE_PARAMS(int, k),
                 AND_4_VALUE_PARAMS(p0, p1, p2, p3)) {
-  return internal::CallableHelper<return_type>::Call(
-      ::std::tr1::get<k>(args), p0, p1, p2, p3);
+  using internal::invoke_argument::InvokeArgumentAdl;
+  return InvokeArgumentAdl<return_type>(
+      internal::invoke_argument::AdlTag(),
+      ::testing::get<k>(args), p0, p1, p2, p3);
 }
 
 ACTION_TEMPLATE(InvokeArgument,
                 HAS_1_TEMPLATE_PARAMS(int, k),
                 AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4)) {
-  return internal::CallableHelper<return_type>::Call(
-      ::std::tr1::get<k>(args), p0, p1, p2, p3, p4);
+  using internal::invoke_argument::InvokeArgumentAdl;
+  return InvokeArgumentAdl<return_type>(
+      internal::invoke_argument::AdlTag(),
+      ::testing::get<k>(args), p0, p1, p2, p3, p4);
 }
 
 ACTION_TEMPLATE(InvokeArgument,
                 HAS_1_TEMPLATE_PARAMS(int, k),
                 AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5)) {
-  return internal::CallableHelper<return_type>::Call(
-      ::std::tr1::get<k>(args), p0, p1, p2, p3, p4, p5);
+  using internal::invoke_argument::InvokeArgumentAdl;
+  return InvokeArgumentAdl<return_type>(
+      internal::invoke_argument::AdlTag(),
+      ::testing::get<k>(args), p0, p1, p2, p3, p4, p5);
 }
 
 ACTION_TEMPLATE(InvokeArgument,
                 HAS_1_TEMPLATE_PARAMS(int, k),
                 AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6)) {
-  return internal::CallableHelper<return_type>::Call(
-      ::std::tr1::get<k>(args), p0, p1, p2, p3, p4, p5, p6);
+  using internal::invoke_argument::InvokeArgumentAdl;
+  return InvokeArgumentAdl<return_type>(
+      internal::invoke_argument::AdlTag(),
+      ::testing::get<k>(args), p0, p1, p2, p3, p4, p5, p6);
 }
 
 ACTION_TEMPLATE(InvokeArgument,
                 HAS_1_TEMPLATE_PARAMS(int, k),
                 AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7)) {
-  return internal::CallableHelper<return_type>::Call(
-      ::std::tr1::get<k>(args), p0, p1, p2, p3, p4, p5, p6, p7);
+  using internal::invoke_argument::InvokeArgumentAdl;
+  return InvokeArgumentAdl<return_type>(
+      internal::invoke_argument::AdlTag(),
+      ::testing::get<k>(args), p0, p1, p2, p3, p4, p5, p6, p7);
 }
 
 ACTION_TEMPLATE(InvokeArgument,
                 HAS_1_TEMPLATE_PARAMS(int, k),
                 AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8)) {
-  return internal::CallableHelper<return_type>::Call(
-      ::std::tr1::get<k>(args), p0, p1, p2, p3, p4, p5, p6, p7, p8);
+  using internal::invoke_argument::InvokeArgumentAdl;
+  return InvokeArgumentAdl<return_type>(
+      internal::invoke_argument::AdlTag(),
+      ::testing::get<k>(args), p0, p1, p2, p3, p4, p5, p6, p7, p8);
 }
 
 ACTION_TEMPLATE(InvokeArgument,
                 HAS_1_TEMPLATE_PARAMS(int, k),
                 AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)) {
-  return internal::CallableHelper<return_type>::Call(
-      ::std::tr1::get<k>(args), p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
+  using internal::invoke_argument::InvokeArgumentAdl;
+  return InvokeArgumentAdl<return_type>(
+      internal::invoke_argument::AdlTag(),
+      ::testing::get<k>(args), p0, p1, p2, p3, p4, p5, p6, p7, p8, p9);
 }
 
 // Various overloads for ReturnNew<T>().
@@ -2412,4 +2369,9 @@ ACTION_TEMPLATE(ReturnNew,
 
 }  // namespace testing
 
+// Include any custom actions added by the local installation.
+// We must include this header at the end to make sure it can use the
+// declarations from this file.
+#include "gmock/internal/custom/gmock-generated-actions.h"
+
 #endif  // GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_
similarity index 89%
rename from src/external/gmock-1.7.0/include/gmock/gmock-generated-function-mockers.h
rename to src/external/googletest/googlemock/include/gmock/gmock-generated-function-mockers.h
index 577fd9e91144b29604b5ca6df108761fcb8826f6..4fa5ca94849f33732cc9b310a9c075e76cd9f106 100644 (file)
 #include "gmock/gmock-spec-builders.h"
 #include "gmock/internal/gmock-internal-utils.h"
 
+#if GTEST_HAS_STD_FUNCTION_
+# include <functional>
+#endif
+
 namespace testing {
 namespace internal {
 
@@ -85,7 +89,7 @@ class FunctionMocker<R(A1)> : public
   typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
 
   MockSpec<F>& With(const Matcher<A1>& m1) {
-    this->current_spec().SetMatchers(::std::tr1::make_tuple(m1));
+    this->current_spec().SetMatchers(::testing::make_tuple(m1));
     return this->current_spec();
   }
 
@@ -106,7 +110,7 @@ class FunctionMocker<R(A1, A2)> : public
   typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
 
   MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2) {
-    this->current_spec().SetMatchers(::std::tr1::make_tuple(m1, m2));
+    this->current_spec().SetMatchers(::testing::make_tuple(m1, m2));
     return this->current_spec();
   }
 
@@ -128,7 +132,7 @@ class FunctionMocker<R(A1, A2, A3)> : public
 
   MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,
       const Matcher<A3>& m3) {
-    this->current_spec().SetMatchers(::std::tr1::make_tuple(m1, m2, m3));
+    this->current_spec().SetMatchers(::testing::make_tuple(m1, m2, m3));
     return this->current_spec();
   }
 
@@ -150,7 +154,7 @@ class FunctionMocker<R(A1, A2, A3, A4)> : public
 
   MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,
       const Matcher<A3>& m3, const Matcher<A4>& m4) {
-    this->current_spec().SetMatchers(::std::tr1::make_tuple(m1, m2, m3, m4));
+    this->current_spec().SetMatchers(::testing::make_tuple(m1, m2, m3, m4));
     return this->current_spec();
   }
 
@@ -173,8 +177,7 @@ class FunctionMocker<R(A1, A2, A3, A4, A5)> : public
 
   MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,
       const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5) {
-    this->current_spec().SetMatchers(::std::tr1::make_tuple(m1, m2, m3, m4,
-        m5));
+    this->current_spec().SetMatchers(::testing::make_tuple(m1, m2, m3, m4, m5));
     return this->current_spec();
   }
 
@@ -198,7 +201,7 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6)> : public
   MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,
       const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5,
       const Matcher<A6>& m6) {
-    this->current_spec().SetMatchers(::std::tr1::make_tuple(m1, m2, m3, m4, m5,
+    this->current_spec().SetMatchers(::testing::make_tuple(m1, m2, m3, m4, m5,
         m6));
     return this->current_spec();
   }
@@ -223,7 +226,7 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7)> : public
   MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,
       const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5,
       const Matcher<A6>& m6, const Matcher<A7>& m7) {
-    this->current_spec().SetMatchers(::std::tr1::make_tuple(m1, m2, m3, m4, m5,
+    this->current_spec().SetMatchers(::testing::make_tuple(m1, m2, m3, m4, m5,
         m6, m7));
     return this->current_spec();
   }
@@ -248,7 +251,7 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8)> : public
   MockSpec<F>& With(const Matcher<A1>& m1, const Matcher<A2>& m2,
       const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5,
       const Matcher<A6>& m6, const Matcher<A7>& m7, const Matcher<A8>& m8) {
-    this->current_spec().SetMatchers(::std::tr1::make_tuple(m1, m2, m3, m4, m5,
+    this->current_spec().SetMatchers(::testing::make_tuple(m1, m2, m3, m4, m5,
         m6, m7, m8));
     return this->current_spec();
   }
@@ -274,7 +277,7 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)> : public
       const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5,
       const Matcher<A6>& m6, const Matcher<A7>& m7, const Matcher<A8>& m8,
       const Matcher<A9>& m9) {
-    this->current_spec().SetMatchers(::std::tr1::make_tuple(m1, m2, m3, m4, m5,
+    this->current_spec().SetMatchers(::testing::make_tuple(m1, m2, m3, m4, m5,
         m6, m7, m8, m9));
     return this->current_spec();
   }
@@ -301,7 +304,7 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)> : public
       const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5,
       const Matcher<A6>& m6, const Matcher<A7>& m7, const Matcher<A8>& m8,
       const Matcher<A9>& m9, const Matcher<A10>& m10) {
-    this->current_spec().SetMatchers(::std::tr1::make_tuple(m1, m2, m3, m4, m5,
+    this->current_spec().SetMatchers(::testing::make_tuple(m1, m2, m3, m4, m5,
         m6, m7, m8, m9, m10));
     return this->current_spec();
   }
@@ -353,7 +356,7 @@ using internal::FunctionMocker;
 #define GMOCK_METHOD0_(tn, constness, ct, Method, ...) \
   GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
       ) constness { \
-    GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size<                          \
+    GTEST_COMPILE_ASSERT_((::testing::tuple_size<                          \
         tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
             == 0), \
         this_method_does_not_take_0_arguments); \
@@ -372,7 +375,7 @@ using internal::FunctionMocker;
 #define GMOCK_METHOD1_(tn, constness, ct, Method, ...) \
   GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
       GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1) constness { \
-    GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size<                          \
+    GTEST_COMPILE_ASSERT_((::testing::tuple_size<                          \
         tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
             == 1), \
         this_method_does_not_take_1_argument); \
@@ -392,7 +395,7 @@ using internal::FunctionMocker;
   GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \
       GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
       GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2) constness { \
-    GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size<                          \
+    GTEST_COMPILE_ASSERT_((::testing::tuple_size<                          \
         tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
             == 2), \
         this_method_does_not_take_2_arguments); \
@@ -414,7 +417,7 @@ using internal::FunctionMocker;
       GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \
       GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
       GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3) constness { \
-    GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size<                          \
+    GTEST_COMPILE_ASSERT_((::testing::tuple_size<                          \
         tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
             == 3), \
         this_method_does_not_take_3_arguments); \
@@ -440,7 +443,7 @@ using internal::FunctionMocker;
       GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \
       GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
       GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4) constness { \
-    GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size<                          \
+    GTEST_COMPILE_ASSERT_((::testing::tuple_size<                          \
         tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
             == 4), \
         this_method_does_not_take_4_arguments); \
@@ -468,7 +471,7 @@ using internal::FunctionMocker;
       GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \
       GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \
       GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5) constness { \
-    GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size<                          \
+    GTEST_COMPILE_ASSERT_((::testing::tuple_size<                          \
         tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
             == 5), \
         this_method_does_not_take_5_arguments); \
@@ -498,7 +501,7 @@ using internal::FunctionMocker;
       GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \
       GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \
       GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6) constness { \
-    GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size<                          \
+    GTEST_COMPILE_ASSERT_((::testing::tuple_size<                          \
         tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
             == 6), \
         this_method_does_not_take_6_arguments); \
@@ -530,7 +533,7 @@ using internal::FunctionMocker;
       GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \
       GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \
       GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7) constness { \
-    GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size<                          \
+    GTEST_COMPILE_ASSERT_((::testing::tuple_size<                          \
         tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
             == 7), \
         this_method_does_not_take_7_arguments); \
@@ -564,7 +567,7 @@ using internal::FunctionMocker;
       GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \
       GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, \
       GMOCK_ARG_(tn, 8, __VA_ARGS__) gmock_a8) constness { \
-    GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size<                          \
+    GTEST_COMPILE_ASSERT_((::testing::tuple_size<                          \
         tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
             == 8), \
         this_method_does_not_take_8_arguments); \
@@ -600,7 +603,7 @@ using internal::FunctionMocker;
       GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, \
       GMOCK_ARG_(tn, 8, __VA_ARGS__) gmock_a8, \
       GMOCK_ARG_(tn, 9, __VA_ARGS__) gmock_a9) constness { \
-    GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size<                          \
+    GTEST_COMPILE_ASSERT_((::testing::tuple_size<                          \
         tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
             == 9), \
         this_method_does_not_take_9_arguments); \
@@ -640,7 +643,7 @@ using internal::FunctionMocker;
       GMOCK_ARG_(tn, 8, __VA_ARGS__) gmock_a8, \
       GMOCK_ARG_(tn, 9, __VA_ARGS__) gmock_a9, \
       GMOCK_ARG_(tn, 10, __VA_ARGS__) gmock_a10) constness { \
-    GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size<                          \
+    GTEST_COMPILE_ASSERT_((::testing::tuple_size<                          \
         tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \
             == 10), \
         this_method_does_not_take_10_arguments); \
@@ -855,6 +858,17 @@ using internal::FunctionMocker;
 // point "2", and nothing should happen between the two check
 // points. The explicit check points make it easy to tell which
 // Bar("a") is called by which call to Foo().
+//
+// MockFunction<F> can also be used to exercise code that accepts
+// std::function<F> callbacks. To do so, use AsStdFunction() method
+// to create std::function proxy forwarding to original object's Call.
+// Example:
+//
+// TEST(FooTest, RunsCallbackWithBarArgument) {
+//   MockFunction<int(string)> callback;
+//   EXPECT_CALL(callback, Call("bar")).WillOnce(Return(1));
+//   Foo(callback.AsStdFunction());
+// }
 template <typename F>
 class MockFunction;
 
@@ -865,6 +879,14 @@ class MockFunction<R()> {
 
   MOCK_METHOD0_T(Call, R());
 
+#if GTEST_HAS_STD_FUNCTION_
+  std::function<R()> AsStdFunction() {
+    return [this]() -> R {
+      return this->Call();
+    };
+  }
+#endif  // GTEST_HAS_STD_FUNCTION_
+
  private:
   GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
 };
@@ -876,6 +898,14 @@ class MockFunction<R(A0)> {
 
   MOCK_METHOD1_T(Call, R(A0));
 
+#if GTEST_HAS_STD_FUNCTION_
+  std::function<R(A0)> AsStdFunction() {
+    return [this](A0 a0) -> R {
+      return this->Call(a0);
+    };
+  }
+#endif  // GTEST_HAS_STD_FUNCTION_
+
  private:
   GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
 };
@@ -887,6 +917,14 @@ class MockFunction<R(A0, A1)> {
 
   MOCK_METHOD2_T(Call, R(A0, A1));
 
+#if GTEST_HAS_STD_FUNCTION_
+  std::function<R(A0, A1)> AsStdFunction() {
+    return [this](A0 a0, A1 a1) -> R {
+      return this->Call(a0, a1);
+    };
+  }
+#endif  // GTEST_HAS_STD_FUNCTION_
+
  private:
   GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
 };
@@ -898,6 +936,14 @@ class MockFunction<R(A0, A1, A2)> {
 
   MOCK_METHOD3_T(Call, R(A0, A1, A2));
 
+#if GTEST_HAS_STD_FUNCTION_
+  std::function<R(A0, A1, A2)> AsStdFunction() {
+    return [this](A0 a0, A1 a1, A2 a2) -> R {
+      return this->Call(a0, a1, a2);
+    };
+  }
+#endif  // GTEST_HAS_STD_FUNCTION_
+
  private:
   GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
 };
@@ -909,6 +955,14 @@ class MockFunction<R(A0, A1, A2, A3)> {
 
   MOCK_METHOD4_T(Call, R(A0, A1, A2, A3));
 
+#if GTEST_HAS_STD_FUNCTION_
+  std::function<R(A0, A1, A2, A3)> AsStdFunction() {
+    return [this](A0 a0, A1 a1, A2 a2, A3 a3) -> R {
+      return this->Call(a0, a1, a2, a3);
+    };
+  }
+#endif  // GTEST_HAS_STD_FUNCTION_
+
  private:
   GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
 };
@@ -921,6 +975,14 @@ class MockFunction<R(A0, A1, A2, A3, A4)> {
 
   MOCK_METHOD5_T(Call, R(A0, A1, A2, A3, A4));
 
+#if GTEST_HAS_STD_FUNCTION_
+  std::function<R(A0, A1, A2, A3, A4)> AsStdFunction() {
+    return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) -> R {
+      return this->Call(a0, a1, a2, a3, a4);
+    };
+  }
+#endif  // GTEST_HAS_STD_FUNCTION_
+
  private:
   GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
 };
@@ -933,6 +995,14 @@ class MockFunction<R(A0, A1, A2, A3, A4, A5)> {
 
   MOCK_METHOD6_T(Call, R(A0, A1, A2, A3, A4, A5));
 
+#if GTEST_HAS_STD_FUNCTION_
+  std::function<R(A0, A1, A2, A3, A4, A5)> AsStdFunction() {
+    return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) -> R {
+      return this->Call(a0, a1, a2, a3, a4, a5);
+    };
+  }
+#endif  // GTEST_HAS_STD_FUNCTION_
+
  private:
   GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
 };
@@ -945,6 +1015,14 @@ class MockFunction<R(A0, A1, A2, A3, A4, A5, A6)> {
 
   MOCK_METHOD7_T(Call, R(A0, A1, A2, A3, A4, A5, A6));
 
+#if GTEST_HAS_STD_FUNCTION_
+  std::function<R(A0, A1, A2, A3, A4, A5, A6)> AsStdFunction() {
+    return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) -> R {
+      return this->Call(a0, a1, a2, a3, a4, a5, a6);
+    };
+  }
+#endif  // GTEST_HAS_STD_FUNCTION_
+
  private:
   GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
 };
@@ -957,6 +1035,14 @@ class MockFunction<R(A0, A1, A2, A3, A4, A5, A6, A7)> {
 
   MOCK_METHOD8_T(Call, R(A0, A1, A2, A3, A4, A5, A6, A7));
 
+#if GTEST_HAS_STD_FUNCTION_
+  std::function<R(A0, A1, A2, A3, A4, A5, A6, A7)> AsStdFunction() {
+    return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) -> R {
+      return this->Call(a0, a1, a2, a3, a4, a5, a6, a7);
+    };
+  }
+#endif  // GTEST_HAS_STD_FUNCTION_
+
  private:
   GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
 };
@@ -969,6 +1055,15 @@ class MockFunction<R(A0, A1, A2, A3, A4, A5, A6, A7, A8)> {
 
   MOCK_METHOD9_T(Call, R(A0, A1, A2, A3, A4, A5, A6, A7, A8));
 
+#if GTEST_HAS_STD_FUNCTION_
+  std::function<R(A0, A1, A2, A3, A4, A5, A6, A7, A8)> AsStdFunction() {
+    return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7,
+        A8 a8) -> R {
+      return this->Call(a0, a1, a2, a3, a4, a5, a6, a7, a8);
+    };
+  }
+#endif  // GTEST_HAS_STD_FUNCTION_
+
  private:
   GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
 };
@@ -982,6 +1077,15 @@ class MockFunction<R(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9)> {
 
   MOCK_METHOD10_T(Call, R(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9));
 
+#if GTEST_HAS_STD_FUNCTION_
+  std::function<R(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9)> AsStdFunction() {
+    return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7,
+        A8 a8, A9 a9) -> R {
+      return this->Call(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9);
+    };
+  }
+#endif  // GTEST_HAS_STD_FUNCTION_
+
  private:
   GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFunction);
 };
similarity index 96%
rename from src/external/gmock-1.7.0/include/gmock/gmock-generated-matchers.h
rename to src/external/googletest/googlemock/include/gmock/gmock-generated-matchers.h
index b4c85715a88425e043ed1677e7744c39172f7135..57056fd91d22906b222e1daca4b92c2d2fa5ac63 100644 (file)
@@ -49,7 +49,7 @@ namespace internal {
 
 // The type of the i-th (0-based) field of Tuple.
 #define GMOCK_FIELD_TYPE_(Tuple, i) \
-    typename ::std::tr1::tuple_element<i, Tuple>::type
+    typename ::testing::tuple_element<i, Tuple>::type
 
 // TupleFields<Tuple, k0, ..., kn> is for selecting fields from a
 // tuple of type Tuple.  It has two members:
@@ -72,14 +72,13 @@ template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5, int k6,
     int k7, int k8, int k9>
 class TupleFields {
  public:
-  typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
+  typedef ::testing::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
       GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
       GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4),
       GMOCK_FIELD_TYPE_(Tuple, k5), GMOCK_FIELD_TYPE_(Tuple, k6),
       GMOCK_FIELD_TYPE_(Tuple, k7), GMOCK_FIELD_TYPE_(Tuple, k8),
       GMOCK_FIELD_TYPE_(Tuple, k9)> type;
   static type GetSelectedFields(const Tuple& t) {
-    using ::std::tr1::get;
     return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t),
         get<k5>(t), get<k6>(t), get<k7>(t), get<k8>(t), get<k9>(t));
   }
@@ -90,9 +89,8 @@ class TupleFields {
 template <class Tuple>
 class TupleFields<Tuple, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1> {
  public:
-  typedef ::std::tr1::tuple<> type;
+  typedef ::testing::tuple<> type;
   static type GetSelectedFields(const Tuple& /* t */) {
-    using ::std::tr1::get;
     return type();
   }
 };
@@ -100,9 +98,8 @@ class TupleFields<Tuple, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1> {
 template <class Tuple, int k0>
 class TupleFields<Tuple, k0, -1, -1, -1, -1, -1, -1, -1, -1, -1> {
  public:
-  typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0)> type;
+  typedef ::testing::tuple<GMOCK_FIELD_TYPE_(Tuple, k0)> type;
   static type GetSelectedFields(const Tuple& t) {
-    using ::std::tr1::get;
     return type(get<k0>(t));
   }
 };
@@ -110,10 +107,9 @@ class TupleFields<Tuple, k0, -1, -1, -1, -1, -1, -1, -1, -1, -1> {
 template <class Tuple, int k0, int k1>
 class TupleFields<Tuple, k0, k1, -1, -1, -1, -1, -1, -1, -1, -1> {
  public:
-  typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
+  typedef ::testing::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
       GMOCK_FIELD_TYPE_(Tuple, k1)> type;
   static type GetSelectedFields(const Tuple& t) {
-    using ::std::tr1::get;
     return type(get<k0>(t), get<k1>(t));
   }
 };
@@ -121,10 +117,9 @@ class TupleFields<Tuple, k0, k1, -1, -1, -1, -1, -1, -1, -1, -1> {
 template <class Tuple, int k0, int k1, int k2>
 class TupleFields<Tuple, k0, k1, k2, -1, -1, -1, -1, -1, -1, -1> {
  public:
-  typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
+  typedef ::testing::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
       GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2)> type;
   static type GetSelectedFields(const Tuple& t) {
-    using ::std::tr1::get;
     return type(get<k0>(t), get<k1>(t), get<k2>(t));
   }
 };
@@ -132,11 +127,10 @@ class TupleFields<Tuple, k0, k1, k2, -1, -1, -1, -1, -1, -1, -1> {
 template <class Tuple, int k0, int k1, int k2, int k3>
 class TupleFields<Tuple, k0, k1, k2, k3, -1, -1, -1, -1, -1, -1> {
  public:
-  typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
+  typedef ::testing::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
       GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
       GMOCK_FIELD_TYPE_(Tuple, k3)> type;
   static type GetSelectedFields(const Tuple& t) {
-    using ::std::tr1::get;
     return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t));
   }
 };
@@ -144,11 +138,10 @@ class TupleFields<Tuple, k0, k1, k2, k3, -1, -1, -1, -1, -1, -1> {
 template <class Tuple, int k0, int k1, int k2, int k3, int k4>
 class TupleFields<Tuple, k0, k1, k2, k3, k4, -1, -1, -1, -1, -1> {
  public:
-  typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
+  typedef ::testing::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
       GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
       GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4)> type;
   static type GetSelectedFields(const Tuple& t) {
-    using ::std::tr1::get;
     return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t));
   }
 };
@@ -156,12 +149,11 @@ class TupleFields<Tuple, k0, k1, k2, k3, k4, -1, -1, -1, -1, -1> {
 template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5>
 class TupleFields<Tuple, k0, k1, k2, k3, k4, k5, -1, -1, -1, -1> {
  public:
-  typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
+  typedef ::testing::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
       GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
       GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4),
       GMOCK_FIELD_TYPE_(Tuple, k5)> type;
   static type GetSelectedFields(const Tuple& t) {
-    using ::std::tr1::get;
     return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t),
         get<k5>(t));
   }
@@ -170,12 +162,11 @@ class TupleFields<Tuple, k0, k1, k2, k3, k4, k5, -1, -1, -1, -1> {
 template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5, int k6>
 class TupleFields<Tuple, k0, k1, k2, k3, k4, k5, k6, -1, -1, -1> {
  public:
-  typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
+  typedef ::testing::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
       GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
       GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4),
       GMOCK_FIELD_TYPE_(Tuple, k5), GMOCK_FIELD_TYPE_(Tuple, k6)> type;
   static type GetSelectedFields(const Tuple& t) {
-    using ::std::tr1::get;
     return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t),
         get<k5>(t), get<k6>(t));
   }
@@ -185,13 +176,12 @@ template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5, int k6,
     int k7>
 class TupleFields<Tuple, k0, k1, k2, k3, k4, k5, k6, k7, -1, -1> {
  public:
-  typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
+  typedef ::testing::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
       GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
       GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4),
       GMOCK_FIELD_TYPE_(Tuple, k5), GMOCK_FIELD_TYPE_(Tuple, k6),
       GMOCK_FIELD_TYPE_(Tuple, k7)> type;
   static type GetSelectedFields(const Tuple& t) {
-    using ::std::tr1::get;
     return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t),
         get<k5>(t), get<k6>(t), get<k7>(t));
   }
@@ -201,13 +191,12 @@ template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5, int k6,
     int k7, int k8>
 class TupleFields<Tuple, k0, k1, k2, k3, k4, k5, k6, k7, k8, -1> {
  public:
-  typedef ::std::tr1::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
+  typedef ::testing::tuple<GMOCK_FIELD_TYPE_(Tuple, k0),
       GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2),
       GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4),
       GMOCK_FIELD_TYPE_(Tuple, k5), GMOCK_FIELD_TYPE_(Tuple, k6),
       GMOCK_FIELD_TYPE_(Tuple, k7), GMOCK_FIELD_TYPE_(Tuple, k8)> type;
   static type GetSelectedFields(const Tuple& t) {
-    using ::std::tr1::get;
     return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t),
         get<k5>(t), get<k6>(t), get<k7>(t), get<k8>(t));
   }
@@ -577,29 +566,29 @@ Args(const InnerMatcher& matcher) {
 // undefined (e.g. hash_map).
 
 inline internal::ElementsAreMatcher<
-    std::tr1::tuple<> >
+    ::testing::tuple<> >
 ElementsAre() {
-  typedef std::tr1::tuple<> Args;
+  typedef ::testing::tuple<> Args;
   return internal::ElementsAreMatcher<Args>(Args());
 }
 
 template <typename T1>
 inline internal::ElementsAreMatcher<
-    std::tr1::tuple<
+    ::testing::tuple<
         typename internal::DecayArray<T1>::type> >
 ElementsAre(const T1& e1) {
-  typedef std::tr1::tuple<
+  typedef ::testing::tuple<
       typename internal::DecayArray<T1>::type> Args;
   return internal::ElementsAreMatcher<Args>(Args(e1));
 }
 
 template <typename T1, typename T2>
 inline internal::ElementsAreMatcher<
-    std::tr1::tuple<
+    ::testing::tuple<
         typename internal::DecayArray<T1>::type,
         typename internal::DecayArray<T2>::type> >
 ElementsAre(const T1& e1, const T2& e2) {
-  typedef std::tr1::tuple<
+  typedef ::testing::tuple<
       typename internal::DecayArray<T1>::type,
       typename internal::DecayArray<T2>::type> Args;
   return internal::ElementsAreMatcher<Args>(Args(e1, e2));
@@ -607,12 +596,12 @@ ElementsAre(const T1& e1, const T2& e2) {
 
 template <typename T1, typename T2, typename T3>
 inline internal::ElementsAreMatcher<
-    std::tr1::tuple<
+    ::testing::tuple<
         typename internal::DecayArray<T1>::type,
         typename internal::DecayArray<T2>::type,
         typename internal::DecayArray<T3>::type> >
 ElementsAre(const T1& e1, const T2& e2, const T3& e3) {
-  typedef std::tr1::tuple<
+  typedef ::testing::tuple<
       typename internal::DecayArray<T1>::type,
       typename internal::DecayArray<T2>::type,
       typename internal::DecayArray<T3>::type> Args;
@@ -621,13 +610,13 @@ ElementsAre(const T1& e1, const T2& e2, const T3& e3) {
 
 template <typename T1, typename T2, typename T3, typename T4>
 inline internal::ElementsAreMatcher<
-    std::tr1::tuple<
+    ::testing::tuple<
         typename internal::DecayArray<T1>::type,
         typename internal::DecayArray<T2>::type,
         typename internal::DecayArray<T3>::type,
         typename internal::DecayArray<T4>::type> >
 ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4) {
-  typedef std::tr1::tuple<
+  typedef ::testing::tuple<
       typename internal::DecayArray<T1>::type,
       typename internal::DecayArray<T2>::type,
       typename internal::DecayArray<T3>::type,
@@ -637,7 +626,7 @@ ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4) {
 
 template <typename T1, typename T2, typename T3, typename T4, typename T5>
 inline internal::ElementsAreMatcher<
-    std::tr1::tuple<
+    ::testing::tuple<
         typename internal::DecayArray<T1>::type,
         typename internal::DecayArray<T2>::type,
         typename internal::DecayArray<T3>::type,
@@ -645,7 +634,7 @@ inline internal::ElementsAreMatcher<
         typename internal::DecayArray<T5>::type> >
 ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
     const T5& e5) {
-  typedef std::tr1::tuple<
+  typedef ::testing::tuple<
       typename internal::DecayArray<T1>::type,
       typename internal::DecayArray<T2>::type,
       typename internal::DecayArray<T3>::type,
@@ -657,7 +646,7 @@ ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
 template <typename T1, typename T2, typename T3, typename T4, typename T5,
     typename T6>
 inline internal::ElementsAreMatcher<
-    std::tr1::tuple<
+    ::testing::tuple<
         typename internal::DecayArray<T1>::type,
         typename internal::DecayArray<T2>::type,
         typename internal::DecayArray<T3>::type,
@@ -666,7 +655,7 @@ inline internal::ElementsAreMatcher<
         typename internal::DecayArray<T6>::type> >
 ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
     const T5& e5, const T6& e6) {
-  typedef std::tr1::tuple<
+  typedef ::testing::tuple<
       typename internal::DecayArray<T1>::type,
       typename internal::DecayArray<T2>::type,
       typename internal::DecayArray<T3>::type,
@@ -679,7 +668,7 @@ ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
 template <typename T1, typename T2, typename T3, typename T4, typename T5,
     typename T6, typename T7>
 inline internal::ElementsAreMatcher<
-    std::tr1::tuple<
+    ::testing::tuple<
         typename internal::DecayArray<T1>::type,
         typename internal::DecayArray<T2>::type,
         typename internal::DecayArray<T3>::type,
@@ -689,7 +678,7 @@ inline internal::ElementsAreMatcher<
         typename internal::DecayArray<T7>::type> >
 ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
     const T5& e5, const T6& e6, const T7& e7) {
-  typedef std::tr1::tuple<
+  typedef ::testing::tuple<
       typename internal::DecayArray<T1>::type,
       typename internal::DecayArray<T2>::type,
       typename internal::DecayArray<T3>::type,
@@ -703,7 +692,7 @@ ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
 template <typename T1, typename T2, typename T3, typename T4, typename T5,
     typename T6, typename T7, typename T8>
 inline internal::ElementsAreMatcher<
-    std::tr1::tuple<
+    ::testing::tuple<
         typename internal::DecayArray<T1>::type,
         typename internal::DecayArray<T2>::type,
         typename internal::DecayArray<T3>::type,
@@ -714,7 +703,7 @@ inline internal::ElementsAreMatcher<
         typename internal::DecayArray<T8>::type> >
 ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
     const T5& e5, const T6& e6, const T7& e7, const T8& e8) {
-  typedef std::tr1::tuple<
+  typedef ::testing::tuple<
       typename internal::DecayArray<T1>::type,
       typename internal::DecayArray<T2>::type,
       typename internal::DecayArray<T3>::type,
@@ -730,7 +719,7 @@ ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
 template <typename T1, typename T2, typename T3, typename T4, typename T5,
     typename T6, typename T7, typename T8, typename T9>
 inline internal::ElementsAreMatcher<
-    std::tr1::tuple<
+    ::testing::tuple<
         typename internal::DecayArray<T1>::type,
         typename internal::DecayArray<T2>::type,
         typename internal::DecayArray<T3>::type,
@@ -742,7 +731,7 @@ inline internal::ElementsAreMatcher<
         typename internal::DecayArray<T9>::type> >
 ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
     const T5& e5, const T6& e6, const T7& e7, const T8& e8, const T9& e9) {
-  typedef std::tr1::tuple<
+  typedef ::testing::tuple<
       typename internal::DecayArray<T1>::type,
       typename internal::DecayArray<T2>::type,
       typename internal::DecayArray<T3>::type,
@@ -759,7 +748,7 @@ ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
 template <typename T1, typename T2, typename T3, typename T4, typename T5,
     typename T6, typename T7, typename T8, typename T9, typename T10>
 inline internal::ElementsAreMatcher<
-    std::tr1::tuple<
+    ::testing::tuple<
         typename internal::DecayArray<T1>::type,
         typename internal::DecayArray<T2>::type,
         typename internal::DecayArray<T3>::type,
@@ -773,7 +762,7 @@ inline internal::ElementsAreMatcher<
 ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
     const T5& e5, const T6& e6, const T7& e7, const T8& e8, const T9& e9,
     const T10& e10) {
-  typedef std::tr1::tuple<
+  typedef ::testing::tuple<
       typename internal::DecayArray<T1>::type,
       typename internal::DecayArray<T2>::type,
       typename internal::DecayArray<T3>::type,
@@ -792,29 +781,29 @@ ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
 // that matches n elements in any order.  We support up to n=10 arguments.
 
 inline internal::UnorderedElementsAreMatcher<
-    std::tr1::tuple<> >
+    ::testing::tuple<> >
 UnorderedElementsAre() {
-  typedef std::tr1::tuple<> Args;
+  typedef ::testing::tuple<> Args;
   return internal::UnorderedElementsAreMatcher<Args>(Args());
 }
 
 template <typename T1>
 inline internal::UnorderedElementsAreMatcher<
-    std::tr1::tuple<
+    ::testing::tuple<
         typename internal::DecayArray<T1>::type> >
 UnorderedElementsAre(const T1& e1) {
-  typedef std::tr1::tuple<
+  typedef ::testing::tuple<
       typename internal::DecayArray<T1>::type> Args;
   return internal::UnorderedElementsAreMatcher<Args>(Args(e1));
 }
 
 template <typename T1, typename T2>
 inline internal::UnorderedElementsAreMatcher<
-    std::tr1::tuple<
+    ::testing::tuple<
         typename internal::DecayArray<T1>::type,
         typename internal::DecayArray<T2>::type> >
 UnorderedElementsAre(const T1& e1, const T2& e2) {
-  typedef std::tr1::tuple<
+  typedef ::testing::tuple<
       typename internal::DecayArray<T1>::type,
       typename internal::DecayArray<T2>::type> Args;
   return internal::UnorderedElementsAreMatcher<Args>(Args(e1, e2));
@@ -822,12 +811,12 @@ UnorderedElementsAre(const T1& e1, const T2& e2) {
 
 template <typename T1, typename T2, typename T3>
 inline internal::UnorderedElementsAreMatcher<
-    std::tr1::tuple<
+    ::testing::tuple<
         typename internal::DecayArray<T1>::type,
         typename internal::DecayArray<T2>::type,
         typename internal::DecayArray<T3>::type> >
 UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3) {
-  typedef std::tr1::tuple<
+  typedef ::testing::tuple<
       typename internal::DecayArray<T1>::type,
       typename internal::DecayArray<T2>::type,
       typename internal::DecayArray<T3>::type> Args;
@@ -836,13 +825,13 @@ UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3) {
 
 template <typename T1, typename T2, typename T3, typename T4>
 inline internal::UnorderedElementsAreMatcher<
-    std::tr1::tuple<
+    ::testing::tuple<
         typename internal::DecayArray<T1>::type,
         typename internal::DecayArray<T2>::type,
         typename internal::DecayArray<T3>::type,
         typename internal::DecayArray<T4>::type> >
 UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4) {
-  typedef std::tr1::tuple<
+  typedef ::testing::tuple<
       typename internal::DecayArray<T1>::type,
       typename internal::DecayArray<T2>::type,
       typename internal::DecayArray<T3>::type,
@@ -852,7 +841,7 @@ UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4) {
 
 template <typename T1, typename T2, typename T3, typename T4, typename T5>
 inline internal::UnorderedElementsAreMatcher<
-    std::tr1::tuple<
+    ::testing::tuple<
         typename internal::DecayArray<T1>::type,
         typename internal::DecayArray<T2>::type,
         typename internal::DecayArray<T3>::type,
@@ -860,7 +849,7 @@ inline internal::UnorderedElementsAreMatcher<
         typename internal::DecayArray<T5>::type> >
 UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
     const T5& e5) {
-  typedef std::tr1::tuple<
+  typedef ::testing::tuple<
       typename internal::DecayArray<T1>::type,
       typename internal::DecayArray<T2>::type,
       typename internal::DecayArray<T3>::type,
@@ -872,7 +861,7 @@ UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
 template <typename T1, typename T2, typename T3, typename T4, typename T5,
     typename T6>
 inline internal::UnorderedElementsAreMatcher<
-    std::tr1::tuple<
+    ::testing::tuple<
         typename internal::DecayArray<T1>::type,
         typename internal::DecayArray<T2>::type,
         typename internal::DecayArray<T3>::type,
@@ -881,7 +870,7 @@ inline internal::UnorderedElementsAreMatcher<
         typename internal::DecayArray<T6>::type> >
 UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
     const T5& e5, const T6& e6) {
-  typedef std::tr1::tuple<
+  typedef ::testing::tuple<
       typename internal::DecayArray<T1>::type,
       typename internal::DecayArray<T2>::type,
       typename internal::DecayArray<T3>::type,
@@ -895,7 +884,7 @@ UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
 template <typename T1, typename T2, typename T3, typename T4, typename T5,
     typename T6, typename T7>
 inline internal::UnorderedElementsAreMatcher<
-    std::tr1::tuple<
+    ::testing::tuple<
         typename internal::DecayArray<T1>::type,
         typename internal::DecayArray<T2>::type,
         typename internal::DecayArray<T3>::type,
@@ -905,7 +894,7 @@ inline internal::UnorderedElementsAreMatcher<
         typename internal::DecayArray<T7>::type> >
 UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
     const T5& e5, const T6& e6, const T7& e7) {
-  typedef std::tr1::tuple<
+  typedef ::testing::tuple<
       typename internal::DecayArray<T1>::type,
       typename internal::DecayArray<T2>::type,
       typename internal::DecayArray<T3>::type,
@@ -920,7 +909,7 @@ UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
 template <typename T1, typename T2, typename T3, typename T4, typename T5,
     typename T6, typename T7, typename T8>
 inline internal::UnorderedElementsAreMatcher<
-    std::tr1::tuple<
+    ::testing::tuple<
         typename internal::DecayArray<T1>::type,
         typename internal::DecayArray<T2>::type,
         typename internal::DecayArray<T3>::type,
@@ -931,7 +920,7 @@ inline internal::UnorderedElementsAreMatcher<
         typename internal::DecayArray<T8>::type> >
 UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
     const T5& e5, const T6& e6, const T7& e7, const T8& e8) {
-  typedef std::tr1::tuple<
+  typedef ::testing::tuple<
       typename internal::DecayArray<T1>::type,
       typename internal::DecayArray<T2>::type,
       typename internal::DecayArray<T3>::type,
@@ -947,7 +936,7 @@ UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
 template <typename T1, typename T2, typename T3, typename T4, typename T5,
     typename T6, typename T7, typename T8, typename T9>
 inline internal::UnorderedElementsAreMatcher<
-    std::tr1::tuple<
+    ::testing::tuple<
         typename internal::DecayArray<T1>::type,
         typename internal::DecayArray<T2>::type,
         typename internal::DecayArray<T3>::type,
@@ -959,7 +948,7 @@ inline internal::UnorderedElementsAreMatcher<
         typename internal::DecayArray<T9>::type> >
 UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
     const T5& e5, const T6& e6, const T7& e7, const T8& e8, const T9& e9) {
-  typedef std::tr1::tuple<
+  typedef ::testing::tuple<
       typename internal::DecayArray<T1>::type,
       typename internal::DecayArray<T2>::type,
       typename internal::DecayArray<T3>::type,
@@ -976,7 +965,7 @@ UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
 template <typename T1, typename T2, typename T3, typename T4, typename T5,
     typename T6, typename T7, typename T8, typename T9, typename T10>
 inline internal::UnorderedElementsAreMatcher<
-    std::tr1::tuple<
+    ::testing::tuple<
         typename internal::DecayArray<T1>::type,
         typename internal::DecayArray<T2>::type,
         typename internal::DecayArray<T3>::type,
@@ -990,7 +979,7 @@ inline internal::UnorderedElementsAreMatcher<
 UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4,
     const T5& e5, const T6& e6, const T7& e7, const T8& e8, const T9& e9,
     const T10& e10) {
-  typedef std::tr1::tuple<
+  typedef ::testing::tuple<
       typename internal::DecayArray<T1>::type,
       typename internal::DecayArray<T2>::type,
       typename internal::DecayArray<T3>::type,
@@ -1413,7 +1402,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
         return ::testing::internal::FormatMatcherDescription(\
             negation, #name, \
             ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
-                ::std::tr1::tuple<>()));\
+                ::testing::tuple<>()));\
       }\
       GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
     };\
@@ -1462,7 +1451,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
         return ::testing::internal::FormatMatcherDescription(\
             negation, #name, \
             ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
-                ::std::tr1::tuple<p0##_type>(p0)));\
+                ::testing::tuple<p0##_type>(p0)));\
       }\
       GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
     };\
@@ -1471,7 +1460,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
       return ::testing::Matcher<arg_type>(\
           new gmock_Impl<arg_type>(p0));\
     }\
-    name##MatcherP(p0##_type gmock_p0) : p0(gmock_p0) {\
+    explicit name##MatcherP(p0##_type gmock_p0) : p0(gmock_p0) {\
     }\
     p0##_type p0;\
    private:\
@@ -1515,7 +1504,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
         return ::testing::internal::FormatMatcherDescription(\
             negation, #name, \
             ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
-                ::std::tr1::tuple<p0##_type, p1##_type>(p0, p1)));\
+                ::testing::tuple<p0##_type, p1##_type>(p0, p1)));\
       }\
       GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
     };\
@@ -1573,7 +1562,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
         return ::testing::internal::FormatMatcherDescription(\
             negation, #name, \
             ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
-                ::std::tr1::tuple<p0##_type, p1##_type, p2##_type>(p0, p1, \
+                ::testing::tuple<p0##_type, p1##_type, p2##_type>(p0, p1, \
                     p2)));\
       }\
       GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
@@ -1636,7 +1625,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
         return ::testing::internal::FormatMatcherDescription(\
             negation, #name, \
             ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
-                ::std::tr1::tuple<p0##_type, p1##_type, p2##_type, \
+                ::testing::tuple<p0##_type, p1##_type, p2##_type, \
                     p3##_type>(p0, p1, p2, p3)));\
       }\
       GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
@@ -1707,7 +1696,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
         return ::testing::internal::FormatMatcherDescription(\
             negation, #name, \
             ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
-                ::std::tr1::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
+                ::testing::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
                     p4##_type>(p0, p1, p2, p3, p4)));\
       }\
       GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
@@ -1781,7 +1770,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
         return ::testing::internal::FormatMatcherDescription(\
             negation, #name, \
             ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
-                ::std::tr1::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
+                ::testing::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
                     p4##_type, p5##_type>(p0, p1, p2, p3, p4, p5)));\
       }\
       GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
@@ -1859,7 +1848,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
         return ::testing::internal::FormatMatcherDescription(\
             negation, #name, \
             ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
-                ::std::tr1::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
+                ::testing::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
                     p4##_type, p5##_type, p6##_type>(p0, p1, p2, p3, p4, p5, \
                     p6)));\
       }\
@@ -1944,7 +1933,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
         return ::testing::internal::FormatMatcherDescription(\
             negation, #name, \
             ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
-                ::std::tr1::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
+                ::testing::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
                     p4##_type, p5##_type, p6##_type, p7##_type>(p0, p1, p2, \
                     p3, p4, p5, p6, p7)));\
       }\
@@ -2035,7 +2024,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
         return ::testing::internal::FormatMatcherDescription(\
             negation, #name, \
             ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
-                ::std::tr1::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
+                ::testing::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
                     p4##_type, p5##_type, p6##_type, p7##_type, \
                     p8##_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8)));\
       }\
@@ -2131,7 +2120,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) {
         return ::testing::internal::FormatMatcherDescription(\
             negation, #name, \
             ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\
-                ::std::tr1::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
+                ::testing::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \
                     p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, \
                     p9##_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)));\
       }\
similarity index 86%
rename from src/external/gmock-1.7.0/include/gmock/gmock-matchers.h
rename to src/external/googletest/googlemock/include/gmock/gmock-matchers.h
index f6fdbb78421c7092288bb0f78101ca2b2f8177c3..987be30b6436eb329bb87d2b05e26a7bc8097747 100644 (file)
@@ -52,8 +52,8 @@
 #include "gmock/internal/gmock-port.h"
 #include "gtest/gtest.h"
 
-#if GTEST_LANG_CXX11
-#include <initializer_list>  // NOLINT -- must be after gtest.h
+#if GTEST_HAS_STD_INITIALIZER_LIST_
+# include <initializer_list>  // NOLINT -- must be after gtest.h
 #endif
 
 namespace testing {
@@ -199,6 +199,31 @@ class StringMatchResultListener : public MatchResultListener {
 
 namespace internal {
 
+struct AnyEq {
+  template <typename A, typename B>
+  bool operator()(const A& a, const B& b) const { return a == b; }
+};
+struct AnyNe {
+  template <typename A, typename B>
+  bool operator()(const A& a, const B& b) const { return a != b; }
+};
+struct AnyLt {
+  template <typename A, typename B>
+  bool operator()(const A& a, const B& b) const { return a < b; }
+};
+struct AnyGt {
+  template <typename A, typename B>
+  bool operator()(const A& a, const B& b) const { return a > b; }
+};
+struct AnyLe {
+  template <typename A, typename B>
+  bool operator()(const A& a, const B& b) const { return a <= b; }
+};
+struct AnyGe {
+  template <typename A, typename B>
+  bool operator()(const A& a, const B& b) const { return a >= b; }
+};
+
 // A match result listener that ignores the explanation.
 class DummyMatchResultListener : public MatchResultListener {
  public:
@@ -296,7 +321,7 @@ class Matcher : public internal::MatcherBase<T> {
   // Constructs a null matcher.  Needed for storing Matcher objects in STL
   // containers.  A default-constructed matcher is not yet initialized.  You
   // cannot use it until a valid value has been assigned to it.
-  Matcher() {}
+  explicit Matcher() {}  // NOLINT
 
   // Constructs a matcher from its implementation.
   explicit Matcher(const MatcherInterface<T>* impl)
@@ -489,7 +514,7 @@ namespace internal {
 template <typename T, typename M>
 class MatcherCastImpl {
  public:
-  static Matcher<T> Cast(M polymorphic_matcher_or_value) {
+  static Matcher<T> Cast(const M& polymorphic_matcher_or_value) {
     // M can be a polymorhic matcher, in which case we want to use
     // its conversion operator to create Matcher<T>.  Or it can be a value
     // that should be passed to the Matcher<T>'s constructor.
@@ -510,14 +535,14 @@ class MatcherCastImpl {
   }
 
  private:
-  static Matcher<T> CastImpl(M value, BooleanConstant<false>) {
+  static Matcher<T> CastImpl(const M& value, BooleanConstant<false>) {
     // M can't be implicitly converted to Matcher<T>, so M isn't a polymorphic
     // matcher.  It must be a value then.  Use direct initialization to create
     // a matcher.
     return Matcher<T>(ImplicitCast_<T>(value));
   }
 
-  static Matcher<T> CastImpl(M polymorphic_matcher_or_value,
+  static Matcher<T> CastImpl(const M& polymorphic_matcher_or_value,
                              BooleanConstant<true>) {
     // M is implicitly convertible to Matcher<T>, which means that either
     // M is a polymorhpic matcher or Matcher<T> has an implicit constructor
@@ -582,7 +607,7 @@ class MatcherCastImpl<T, Matcher<T> > {
 // matcher m and returns a Matcher<T>.  It compiles only when T can be
 // statically converted to the argument type of m.
 template <typename T, typename M>
-inline Matcher<T> MatcherCast(M matcher) {
+inline Matcher<T> MatcherCast(const M& matcher) {
   return internal::MatcherCastImpl<T, M>::Cast(matcher);
 }
 
@@ -599,7 +624,7 @@ class SafeMatcherCastImpl {
   // This overload handles polymorphic matchers and values only since
   // monomorphic matchers are handled by the next one.
   template <typename M>
-  static inline Matcher<T> Cast(M polymorphic_matcher_or_value) {
+  static inline Matcher<T> Cast(const M& polymorphic_matcher_or_value) {
     return internal::MatcherCastImpl<T, M>::Cast(polymorphic_matcher_or_value);
   }
 
@@ -706,7 +731,6 @@ class TuplePrefix {
   template <typename MatcherTuple, typename ValueTuple>
   static bool Matches(const MatcherTuple& matcher_tuple,
                       const ValueTuple& value_tuple) {
-    using ::std::tr1::get;
     return TuplePrefix<N - 1>::Matches(matcher_tuple, value_tuple)
         && get<N - 1>(matcher_tuple).Matches(get<N - 1>(value_tuple));
   }
@@ -719,9 +743,6 @@ class TuplePrefix {
   static void ExplainMatchFailuresTo(const MatcherTuple& matchers,
                                      const ValueTuple& values,
                                      ::std::ostream* os) {
-    using ::std::tr1::tuple_element;
-    using ::std::tr1::get;
-
     // First, describes failures in the first N - 1 fields.
     TuplePrefix<N - 1>::ExplainMatchFailuresTo(matchers, values, os);
 
@@ -774,7 +795,6 @@ class TuplePrefix<0> {
 template <typename MatcherTuple, typename ValueTuple>
 bool TupleMatches(const MatcherTuple& matcher_tuple,
                   const ValueTuple& value_tuple) {
-  using ::std::tr1::tuple_size;
   // Makes sure that matcher_tuple and value_tuple have the same
   // number of fields.
   GTEST_COMPILE_ASSERT_(tuple_size<MatcherTuple>::value ==
@@ -790,7 +810,6 @@ template <typename MatcherTuple, typename ValueTuple>
 void ExplainMatchFailureTupleTo(const MatcherTuple& matchers,
                                 const ValueTuple& values,
                                 ::std::ostream* os) {
-  using ::std::tr1::tuple_size;
   TuplePrefix<tuple_size<MatcherTuple>::value>::ExplainMatchFailuresTo(
       matchers, values, os);
 }
@@ -802,7 +821,7 @@ void ExplainMatchFailureTupleTo(const MatcherTuple& matchers,
 template <typename Tuple, typename Func, typename OutIter>
 class TransformTupleValuesHelper {
  private:
-  typedef typename ::std::tr1::tuple_size<Tuple> TupleSize;
+  typedef ::testing::tuple_size<Tuple> TupleSize;
 
  public:
   // For each member of tuple 't', taken in order, evaluates '*out++ = f(t)'.
@@ -815,7 +834,7 @@ class TransformTupleValuesHelper {
   template <typename Tup, size_t kRemainingSize>
   struct IterateOverTuple {
     OutIter operator() (Func f, const Tup& t, OutIter out) const {
-      *out++ = f(::std::tr1::get<TupleSize::value - kRemainingSize>(t));
+      *out++ = f(::testing::get<TupleSize::value - kRemainingSize>(t));
       return IterateOverTuple<Tup, kRemainingSize - 1>()(f, t, out);
     }
   };
@@ -868,55 +887,90 @@ class AnythingMatcher {
 // used to match an int, a short, a double, etc).  Therefore we use
 // a template type conversion operator in the implementation.
 //
-// We define this as a macro in order to eliminate duplicated source
-// code.
-//
 // The following template definition assumes that the Rhs parameter is
 // a "bare" type (i.e. neither 'const T' nor 'T&').
-#define GMOCK_IMPLEMENT_COMPARISON_MATCHER_( \
-    name, op, relation, negated_relation) \
-  template <typename Rhs> class name##Matcher { \
-   public: \
-    explicit name##Matcher(const Rhs& rhs) : rhs_(rhs) {} \
-    template <typename Lhs> \
-    operator Matcher<Lhs>() const { \
-      return MakeMatcher(new Impl<Lhs>(rhs_)); \
-    } \
-   private: \
-    template <typename Lhs> \
-    class Impl : public MatcherInterface<Lhs> { \
-     public: \
-      explicit Impl(const Rhs& rhs) : rhs_(rhs) {} \
-      virtual bool MatchAndExplain(\
-          Lhs lhs, MatchResultListener* /* listener */) const { \
-        return lhs op rhs_; \
-      } \
-      virtual void DescribeTo(::std::ostream* os) const { \
-        *os << relation  " "; \
-        UniversalPrint(rhs_, os); \
-      } \
-      virtual void DescribeNegationTo(::std::ostream* os) const { \
-        *os << negated_relation  " "; \
-        UniversalPrint(rhs_, os); \
-      } \
-     private: \
-      Rhs rhs_; \
-      GTEST_DISALLOW_ASSIGN_(Impl); \
-    }; \
-    Rhs rhs_; \
-    GTEST_DISALLOW_ASSIGN_(name##Matcher); \
-  }
-
-// Implements Eq(v), Ge(v), Gt(v), Le(v), Lt(v), and Ne(v)
-// respectively.
-GMOCK_IMPLEMENT_COMPARISON_MATCHER_(Eq, ==, "is equal to", "isn't equal to");
-GMOCK_IMPLEMENT_COMPARISON_MATCHER_(Ge, >=, "is >=", "isn't >=");
-GMOCK_IMPLEMENT_COMPARISON_MATCHER_(Gt, >, "is >", "isn't >");
-GMOCK_IMPLEMENT_COMPARISON_MATCHER_(Le, <=, "is <=", "isn't <=");
-GMOCK_IMPLEMENT_COMPARISON_MATCHER_(Lt, <, "is <", "isn't <");
-GMOCK_IMPLEMENT_COMPARISON_MATCHER_(Ne, !=, "isn't equal to", "is equal to");
+template <typename D, typename Rhs, typename Op>
+class ComparisonBase {
+ public:
+  explicit ComparisonBase(const Rhs& rhs) : rhs_(rhs) {}
+  template <typename Lhs>
+  operator Matcher<Lhs>() const {
+    return MakeMatcher(new Impl<Lhs>(rhs_));
+  }
 
-#undef GMOCK_IMPLEMENT_COMPARISON_MATCHER_
+ private:
+  template <typename Lhs>
+  class Impl : public MatcherInterface<Lhs> {
+   public:
+    explicit Impl(const Rhs& rhs) : rhs_(rhs) {}
+    virtual bool MatchAndExplain(
+        Lhs lhs, MatchResultListener* /* listener */) const {
+      return Op()(lhs, rhs_);
+    }
+    virtual void DescribeTo(::std::ostream* os) const {
+      *os << D::Desc() << " ";
+      UniversalPrint(rhs_, os);
+    }
+    virtual void DescribeNegationTo(::std::ostream* os) const {
+      *os << D::NegatedDesc() <<  " ";
+      UniversalPrint(rhs_, os);
+    }
+   private:
+    Rhs rhs_;
+    GTEST_DISALLOW_ASSIGN_(Impl);
+  };
+  Rhs rhs_;
+  GTEST_DISALLOW_ASSIGN_(ComparisonBase);
+};
+
+template <typename Rhs>
+class EqMatcher : public ComparisonBase<EqMatcher<Rhs>, Rhs, AnyEq> {
+ public:
+  explicit EqMatcher(const Rhs& rhs)
+      : ComparisonBase<EqMatcher<Rhs>, Rhs, AnyEq>(rhs) { }
+  static const char* Desc() { return "is equal to"; }
+  static const char* NegatedDesc() { return "isn't equal to"; }
+};
+template <typename Rhs>
+class NeMatcher : public ComparisonBase<NeMatcher<Rhs>, Rhs, AnyNe> {
+ public:
+  explicit NeMatcher(const Rhs& rhs)
+      : ComparisonBase<NeMatcher<Rhs>, Rhs, AnyNe>(rhs) { }
+  static const char* Desc() { return "isn't equal to"; }
+  static const char* NegatedDesc() { return "is equal to"; }
+};
+template <typename Rhs>
+class LtMatcher : public ComparisonBase<LtMatcher<Rhs>, Rhs, AnyLt> {
+ public:
+  explicit LtMatcher(const Rhs& rhs)
+      : ComparisonBase<LtMatcher<Rhs>, Rhs, AnyLt>(rhs) { }
+  static const char* Desc() { return "is <"; }
+  static const char* NegatedDesc() { return "isn't <"; }
+};
+template <typename Rhs>
+class GtMatcher : public ComparisonBase<GtMatcher<Rhs>, Rhs, AnyGt> {
+ public:
+  explicit GtMatcher(const Rhs& rhs)
+      : ComparisonBase<GtMatcher<Rhs>, Rhs, AnyGt>(rhs) { }
+  static const char* Desc() { return "is >"; }
+  static const char* NegatedDesc() { return "isn't >"; }
+};
+template <typename Rhs>
+class LeMatcher : public ComparisonBase<LeMatcher<Rhs>, Rhs, AnyLe> {
+ public:
+  explicit LeMatcher(const Rhs& rhs)
+      : ComparisonBase<LeMatcher<Rhs>, Rhs, AnyLe>(rhs) { }
+  static const char* Desc() { return "is <="; }
+  static const char* NegatedDesc() { return "isn't <="; }
+};
+template <typename Rhs>
+class GeMatcher : public ComparisonBase<GeMatcher<Rhs>, Rhs, AnyGe> {
+ public:
+  explicit GeMatcher(const Rhs& rhs)
+      : ComparisonBase<GeMatcher<Rhs>, Rhs, AnyGe>(rhs) { }
+  static const char* Desc() { return "is >="; }
+  static const char* NegatedDesc() { return "isn't >="; }
+};
 
 // Implements the polymorphic IsNull() matcher, which matches any raw or smart
 // pointer that is NULL.
@@ -925,7 +979,11 @@ class IsNullMatcher {
   template <typename Pointer>
   bool MatchAndExplain(const Pointer& p,
                        MatchResultListener* /* listener */) const {
+#if GTEST_LANG_CXX11
+    return p == nullptr;
+#else  // GTEST_LANG_CXX11
     return GetRawPointer(p) == NULL;
+#endif  // GTEST_LANG_CXX11
   }
 
   void DescribeTo(::std::ostream* os) const { *os << "is NULL"; }
@@ -941,7 +999,11 @@ class NotNullMatcher {
   template <typename Pointer>
   bool MatchAndExplain(const Pointer& p,
                        MatchResultListener* /* listener */) const {
+#if GTEST_LANG_CXX11
+    return p != nullptr;
+#else  // GTEST_LANG_CXX11
     return GetRawPointer(p) != NULL;
+#endif  // GTEST_LANG_CXX11
   }
 
   void DescribeTo(::std::ostream* os) const { *os << "isn't NULL"; }
@@ -1315,51 +1377,64 @@ class MatchesRegexMatcher {
 // used to match a tuple<int, short>, a tuple<const long&, double>,
 // etc).  Therefore we use a template type conversion operator in the
 // implementation.
-//
-// We define this as a macro in order to eliminate duplicated source
-// code.
-#define GMOCK_IMPLEMENT_COMPARISON2_MATCHER_(name, op, relation) \
-  class name##2Matcher { \
-   public: \
-    template <typename T1, typename T2> \
-    operator Matcher< ::std::tr1::tuple<T1, T2> >() const { \
-      return MakeMatcher(new Impl< ::std::tr1::tuple<T1, T2> >); \
-    } \
-    template <typename T1, typename T2> \
-    operator Matcher<const ::std::tr1::tuple<T1, T2>&>() const { \
-      return MakeMatcher(new Impl<const ::std::tr1::tuple<T1, T2>&>); \
-    } \
-   private: \
-    template <typename Tuple> \
-    class Impl : public MatcherInterface<Tuple> { \
-     public: \
-      virtual bool MatchAndExplain( \
-          Tuple args, \
-          MatchResultListener* /* listener */) const { \
-        return ::std::tr1::get<0>(args) op ::std::tr1::get<1>(args); \
-      } \
-      virtual void DescribeTo(::std::ostream* os) const { \
-        *os << "are " relation;                                 \
-      } \
-      virtual void DescribeNegationTo(::std::ostream* os) const { \
-        *os << "aren't " relation; \
-      } \
-    }; \
-  }
-
-// Implements Eq(), Ge(), Gt(), Le(), Lt(), and Ne() respectively.
-GMOCK_IMPLEMENT_COMPARISON2_MATCHER_(Eq, ==, "an equal pair");
-GMOCK_IMPLEMENT_COMPARISON2_MATCHER_(
-    Ge, >=, "a pair where the first >= the second");
-GMOCK_IMPLEMENT_COMPARISON2_MATCHER_(
-    Gt, >, "a pair where the first > the second");
-GMOCK_IMPLEMENT_COMPARISON2_MATCHER_(
-    Le, <=, "a pair where the first <= the second");
-GMOCK_IMPLEMENT_COMPARISON2_MATCHER_(
-    Lt, <, "a pair where the first < the second");
-GMOCK_IMPLEMENT_COMPARISON2_MATCHER_(Ne, !=, "an unequal pair");
-
-#undef GMOCK_IMPLEMENT_COMPARISON2_MATCHER_
+template <typename D, typename Op>
+class PairMatchBase {
+ public:
+  template <typename T1, typename T2>
+  operator Matcher< ::testing::tuple<T1, T2> >() const {
+    return MakeMatcher(new Impl< ::testing::tuple<T1, T2> >);
+  }
+  template <typename T1, typename T2>
+  operator Matcher<const ::testing::tuple<T1, T2>&>() const {
+    return MakeMatcher(new Impl<const ::testing::tuple<T1, T2>&>);
+  }
+
+ private:
+  static ::std::ostream& GetDesc(::std::ostream& os) {  // NOLINT
+    return os << D::Desc();
+  }
+
+  template <typename Tuple>
+  class Impl : public MatcherInterface<Tuple> {
+   public:
+    virtual bool MatchAndExplain(
+        Tuple args,
+        MatchResultListener* /* listener */) const {
+      return Op()(::testing::get<0>(args), ::testing::get<1>(args));
+    }
+    virtual void DescribeTo(::std::ostream* os) const {
+      *os << "are " << GetDesc;
+    }
+    virtual void DescribeNegationTo(::std::ostream* os) const {
+      *os << "aren't " << GetDesc;
+    }
+  };
+};
+
+class Eq2Matcher : public PairMatchBase<Eq2Matcher, AnyEq> {
+ public:
+  static const char* Desc() { return "an equal pair"; }
+};
+class Ne2Matcher : public PairMatchBase<Ne2Matcher, AnyNe> {
+ public:
+  static const char* Desc() { return "an unequal pair"; }
+};
+class Lt2Matcher : public PairMatchBase<Lt2Matcher, AnyLt> {
+ public:
+  static const char* Desc() { return "a pair where the first < the second"; }
+};
+class Gt2Matcher : public PairMatchBase<Gt2Matcher, AnyGt> {
+ public:
+  static const char* Desc() { return "a pair where the first > the second"; }
+};
+class Le2Matcher : public PairMatchBase<Le2Matcher, AnyLe> {
+ public:
+  static const char* Desc() { return "a pair where the first <= the second"; }
+};
+class Ge2Matcher : public PairMatchBase<Ge2Matcher, AnyGe> {
+ public:
+  static const char* Desc() { return "a pair where the first >= the second"; }
+};
 
 // Implements the Not(...) matcher for a particular argument type T.
 // We do not nest it inside the NotMatcher class template, as that
@@ -1758,7 +1833,7 @@ class MatcherAsPredicate {
 template <typename M>
 class PredicateFormatterFromMatcher {
  public:
-  explicit PredicateFormatterFromMatcher(const M& m) : matcher_(m) {}
+  explicit PredicateFormatterFromMatcher(M m) : matcher_(internal::move(m)) {}
 
   // This template () operator allows a PredicateFormatterFromMatcher
   // object to act as a predicate-formatter suitable for using with
@@ -1798,10 +1873,11 @@ class PredicateFormatterFromMatcher {
 // A helper function for converting a matcher to a predicate-formatter
 // without the user needing to explicitly write the type.  This is
 // used for implementing ASSERT_THAT() and EXPECT_THAT().
+// Implementation detail: 'matcher' is received by-value to force decaying.
 template <typename M>
 inline PredicateFormatterFromMatcher<M>
-MakePredicateFormatterFromMatcher(const M& matcher) {
-  return PredicateFormatterFromMatcher<M>(matcher);
+MakePredicateFormatterFromMatcher(M matcher) {
+  return PredicateFormatterFromMatcher<M>(internal::move(matcher));
 }
 
 // Implements the polymorphic floating point equality matcher, which matches
@@ -1812,20 +1888,23 @@ template <typename FloatType>
 class FloatingEqMatcher {
  public:
   // Constructor for FloatingEqMatcher.
-  // The matcher's input will be compared with rhs.  The matcher treats two
+  // The matcher's input will be compared with expected.  The matcher treats two
   // NANs as equal if nan_eq_nan is true.  Otherwise, under IEEE standards,
   // equality comparisons between NANs will always return false.  We specify a
   // negative max_abs_error_ term to indicate that ULP-based approximation will
   // be used for comparison.
-  FloatingEqMatcher(FloatType rhs, bool nan_eq_nan) :
-    rhs_(rhs), nan_eq_nan_(nan_eq_nan), max_abs_error_(-1) {
+  FloatingEqMatcher(FloatType expected, bool nan_eq_nan) :
+    expected_(expected), nan_eq_nan_(nan_eq_nan), max_abs_error_(-1) {
   }
 
   // Constructor that supports a user-specified max_abs_error that will be used
   // for comparison instead of ULP-based approximation.  The max absolute
   // should be non-negative.
-  FloatingEqMatcher(FloatType rhs, bool nan_eq_nan, FloatType max_abs_error) :
-    rhs_(rhs), nan_eq_nan_(nan_eq_nan), max_abs_error_(max_abs_error) {
+  FloatingEqMatcher(FloatType expected, bool nan_eq_nan,
+                    FloatType max_abs_error)
+      : expected_(expected),
+        nan_eq_nan_(nan_eq_nan),
+        max_abs_error_(max_abs_error) {
     GTEST_CHECK_(max_abs_error >= 0)
         << ", where max_abs_error is" << max_abs_error;
   }
@@ -1834,16 +1913,18 @@ class FloatingEqMatcher {
   template <typename T>
   class Impl : public MatcherInterface<T> {
    public:
-    Impl(FloatType rhs, bool nan_eq_nan, FloatType max_abs_error) :
-      rhs_(rhs), nan_eq_nan_(nan_eq_nan), max_abs_error_(max_abs_error) {}
+    Impl(FloatType expected, bool nan_eq_nan, FloatType max_abs_error)
+        : expected_(expected),
+          nan_eq_nan_(nan_eq_nan),
+          max_abs_error_(max_abs_error) {}
 
     virtual bool MatchAndExplain(T value,
-                                 MatchResultListener* /* listener */) const {
-      const FloatingPoint<FloatType> lhs(value), rhs(rhs_);
+                                 MatchResultListener* listener) const {
+      const FloatingPoint<FloatType> actual(value), expected(expected_);
 
       // Compares NaNs first, if nan_eq_nan_ is true.
-      if (lhs.is_nan() || rhs.is_nan()) {
-        if (lhs.is_nan() && rhs.is_nan()) {
+      if (actual.is_nan() || expected.is_nan()) {
+        if (actual.is_nan() && expected.is_nan()) {
           return nan_eq_nan_;
         }
         // One is nan; the other is not nan.
@@ -1851,12 +1932,24 @@ class FloatingEqMatcher {
       }
       if (HasMaxAbsError()) {
         // We perform an equality check so that inf will match inf, regardless
-        // of error bounds.  If the result of value - rhs_ would result in
+        // of error bounds.  If the result of value - expected_ would result in
         // overflow or if either value is inf, the default result is infinity,
         // which should only match if max_abs_error_ is also infinity.
-        return value == rhs_ || fabs(value - rhs_) <= max_abs_error_;
+        if (value == expected_) {
+          return true;
+        }
+
+        const FloatType diff = value - expected_;
+        if (fabs(diff) <= max_abs_error_) {
+          return true;
+        }
+
+        if (listener->IsInterested()) {
+          *listener << "which is " << diff << " from " << expected_;
+        }
+        return false;
       } else {
-        return lhs.AlmostEquals(rhs);
+        return actual.AlmostEquals(expected);
       }
     }
 
@@ -1866,14 +1959,14 @@ class FloatingEqMatcher {
       // after outputting.
       const ::std::streamsize old_precision = os->precision(
           ::std::numeric_limits<FloatType>::digits10 + 2);
-      if (FloatingPoint<FloatType>(rhs_).is_nan()) {
+      if (FloatingPoint<FloatType>(expected_).is_nan()) {
         if (nan_eq_nan_) {
           *os << "is NaN";
         } else {
           *os << "never matches";
         }
       } else {
-        *os << "is approximately " << rhs_;
+        *os << "is approximately " << expected_;
         if (HasMaxAbsError()) {
           *os << " (absolute error <= " << max_abs_error_ << ")";
         }
@@ -1885,14 +1978,14 @@ class FloatingEqMatcher {
       // As before, get original precision.
       const ::std::streamsize old_precision = os->precision(
           ::std::numeric_limits<FloatType>::digits10 + 2);
-      if (FloatingPoint<FloatType>(rhs_).is_nan()) {
+      if (FloatingPoint<FloatType>(expected_).is_nan()) {
         if (nan_eq_nan_) {
           *os << "isn't NaN";
         } else {
           *os << "is anything";
         }
       } else {
-        *os << "isn't approximately " << rhs_;
+        *os << "isn't approximately " << expected_;
         if (HasMaxAbsError()) {
           *os << " (absolute error > " << max_abs_error_ << ")";
         }
@@ -1906,7 +1999,7 @@ class FloatingEqMatcher {
       return max_abs_error_ >= 0;
     }
 
-    const FloatType rhs_;
+    const FloatType expected_;
     const bool nan_eq_nan_;
     // max_abs_error will be used for value comparison when >= 0.
     const FloatType max_abs_error_;
@@ -1914,27 +2007,29 @@ class FloatingEqMatcher {
     GTEST_DISALLOW_ASSIGN_(Impl);
   };
 
-  // The following 3 type conversion operators allow FloatEq(rhs) and
-  // NanSensitiveFloatEq(rhs) to be used as a Matcher<float>, a
+  // The following 3 type conversion operators allow FloatEq(expected) and
+  // NanSensitiveFloatEq(expected) to be used as a Matcher<float>, a
   // Matcher<const float&>, or a Matcher<float&>, but nothing else.
   // (While Google's C++ coding style doesn't allow arguments passed
   // by non-const reference, we may see them in code not conforming to
   // the style.  Therefore Google Mock needs to support them.)
   operator Matcher<FloatType>() const {
-    return MakeMatcher(new Impl<FloatType>(rhs_, nan_eq_nan_, max_abs_error_));
+    return MakeMatcher(
+        new Impl<FloatType>(expected_, nan_eq_nan_, max_abs_error_));
   }
 
   operator Matcher<const FloatType&>() const {
     return MakeMatcher(
-        new Impl<const FloatType&>(rhs_, nan_eq_nan_, max_abs_error_));
+        new Impl<const FloatType&>(expected_, nan_eq_nan_, max_abs_error_));
   }
 
   operator Matcher<FloatType&>() const {
-    return MakeMatcher(new Impl<FloatType&>(rhs_, nan_eq_nan_, max_abs_error_));
+    return MakeMatcher(
+        new Impl<FloatType&>(expected_, nan_eq_nan_, max_abs_error_));
   }
 
  private:
-  const FloatType rhs_;
+  const FloatType expected_;
   const bool nan_eq_nan_;
   // max_abs_error will be used for value comparison when >= 0.
   const FloatType max_abs_error_;
@@ -2003,6 +2098,83 @@ class PointeeMatcher {
   GTEST_DISALLOW_ASSIGN_(PointeeMatcher);
 };
 
+// Implements the WhenDynamicCastTo<T>(m) matcher that matches a pointer or
+// reference that matches inner_matcher when dynamic_cast<T> is applied.
+// The result of dynamic_cast<To> is forwarded to the inner matcher.
+// If To is a pointer and the cast fails, the inner matcher will receive NULL.
+// If To is a reference and the cast fails, this matcher returns false
+// immediately.
+template <typename To>
+class WhenDynamicCastToMatcherBase {
+ public:
+  explicit WhenDynamicCastToMatcherBase(const Matcher<To>& matcher)
+      : matcher_(matcher) {}
+
+  void DescribeTo(::std::ostream* os) const {
+    GetCastTypeDescription(os);
+    matcher_.DescribeTo(os);
+  }
+
+  void DescribeNegationTo(::std::ostream* os) const {
+    GetCastTypeDescription(os);
+    matcher_.DescribeNegationTo(os);
+  }
+
+ protected:
+  const Matcher<To> matcher_;
+
+  static string GetToName() {
+#if GTEST_HAS_RTTI
+    return GetTypeName<To>();
+#else  // GTEST_HAS_RTTI
+    return "the target type";
+#endif  // GTEST_HAS_RTTI
+  }
+
+ private:
+  static void GetCastTypeDescription(::std::ostream* os) {
+    *os << "when dynamic_cast to " << GetToName() << ", ";
+  }
+
+  GTEST_DISALLOW_ASSIGN_(WhenDynamicCastToMatcherBase);
+};
+
+// Primary template.
+// To is a pointer. Cast and forward the result.
+template <typename To>
+class WhenDynamicCastToMatcher : public WhenDynamicCastToMatcherBase<To> {
+ public:
+  explicit WhenDynamicCastToMatcher(const Matcher<To>& matcher)
+      : WhenDynamicCastToMatcherBase<To>(matcher) {}
+
+  template <typename From>
+  bool MatchAndExplain(From from, MatchResultListener* listener) const {
+    // TODO(sbenza): Add more detail on failures. ie did the dyn_cast fail?
+    To to = dynamic_cast<To>(from);
+    return MatchPrintAndExplain(to, this->matcher_, listener);
+  }
+};
+
+// Specialize for references.
+// In this case we return false if the dynamic_cast fails.
+template <typename To>
+class WhenDynamicCastToMatcher<To&> : public WhenDynamicCastToMatcherBase<To&> {
+ public:
+  explicit WhenDynamicCastToMatcher(const Matcher<To&>& matcher)
+      : WhenDynamicCastToMatcherBase<To&>(matcher) {}
+
+  template <typename From>
+  bool MatchAndExplain(From& from, MatchResultListener* listener) const {
+    // We don't want an std::bad_cast here, so do the cast with pointers.
+    To* to = dynamic_cast<To*>(&from);
+    if (to == NULL) {
+      *listener << "which cannot be dynamic_cast to " << this->GetToName();
+      return false;
+    }
+    return MatchPrintAndExplain(*to, this->matcher_, listener);
+  }
+};
+
 // Implements the Field() matcher for matching a field (i.e. member
 // variable) of an object.
 template <typename Class, typename FieldType>
@@ -2100,8 +2272,15 @@ class PropertyMatcher {
     *listener << "whose given property is ";
     // Cannot pass the return value (for example, int) to MatchPrintAndExplain,
     // which takes a non-const reference as argument.
+#if defined(_PREFAST_ ) && _MSC_VER == 1800
+    // Workaround bug in VC++ 2013's /analyze parser.
+    // https://connect.microsoft.com/VisualStudio/feedback/details/1106363/internal-compiler-error-with-analyze-due-to-failure-to-infer-move
+    posix::Abort();  // To make sure it is never run.
+    return false;
+#else
     RefToConstProperty result = (obj.*property_)();
     return MatchPrintAndExplain(result, matcher_, listener);
+#endif
   }
 
   bool MatchAndExplainImpl(true_type /* is_pointer */, const Class* p,
@@ -2267,6 +2446,67 @@ class SizeIsMatcher {
   GTEST_DISALLOW_ASSIGN_(SizeIsMatcher);
 };
 
+// Implements a matcher that checks the begin()..end() distance of an STL-style
+// container.
+template <typename DistanceMatcher>
+class BeginEndDistanceIsMatcher {
+ public:
+  explicit BeginEndDistanceIsMatcher(const DistanceMatcher& distance_matcher)
+      : distance_matcher_(distance_matcher) {}
+
+  template <typename Container>
+  operator Matcher<Container>() const {
+    return MakeMatcher(new Impl<Container>(distance_matcher_));
+  }
+
+  template <typename Container>
+  class Impl : public MatcherInterface<Container> {
+   public:
+    typedef internal::StlContainerView<
+        GTEST_REMOVE_REFERENCE_AND_CONST_(Container)> ContainerView;
+    typedef typename std::iterator_traits<
+        typename ContainerView::type::const_iterator>::difference_type
+        DistanceType;
+    explicit Impl(const DistanceMatcher& distance_matcher)
+        : distance_matcher_(MatcherCast<DistanceType>(distance_matcher)) {}
+
+    virtual void DescribeTo(::std::ostream* os) const {
+      *os << "distance between begin() and end() ";
+      distance_matcher_.DescribeTo(os);
+    }
+    virtual void DescribeNegationTo(::std::ostream* os) const {
+      *os << "distance between begin() and end() ";
+      distance_matcher_.DescribeNegationTo(os);
+    }
+
+    virtual bool MatchAndExplain(Container container,
+                                 MatchResultListener* listener) const {
+#if GTEST_HAS_STD_BEGIN_AND_END_
+      using std::begin;
+      using std::end;
+      DistanceType distance = std::distance(begin(container), end(container));
+#else
+      DistanceType distance = std::distance(container.begin(), container.end());
+#endif
+      StringMatchResultListener distance_listener;
+      const bool result =
+          distance_matcher_.MatchAndExplain(distance, &distance_listener);
+      *listener << "whose distance between begin() and end() " << distance
+                << (result ? " matches" : " doesn't match");
+      PrintIfNotEmpty(distance_listener.str(), listener->stream());
+      return result;
+    }
+
+   private:
+    const Matcher<DistanceType> distance_matcher_;
+    GTEST_DISALLOW_ASSIGN_(Impl);
+  };
+
+ private:
+  const DistanceMatcher distance_matcher_;
+  GTEST_DISALLOW_ASSIGN_(BeginEndDistanceIsMatcher);
+};
+
 // Implements an equality matcher for any STL-style container whose elements
 // support ==. This matcher is like Eq(), but its failure explanations provide
 // more detailed information that is useful when the container is used as a set.
@@ -2284,9 +2524,10 @@ class ContainerEqMatcher {
   typedef typename View::type StlContainer;
   typedef typename View::const_reference StlContainerReference;
 
-  // We make a copy of rhs in case the elements in it are modified
+  // We make a copy of expected in case the elements in it are modified
   // after this matcher is created.
-  explicit ContainerEqMatcher(const Container& rhs) : rhs_(View::Copy(rhs)) {
+  explicit ContainerEqMatcher(const Container& expected)
+      : expected_(View::Copy(expected)) {
     // Makes sure the user doesn't instantiate this class template
     // with a const or reference type.
     (void)testing::StaticAssertTypeEq<Container,
@@ -2295,11 +2536,11 @@ class ContainerEqMatcher {
 
   void DescribeTo(::std::ostream* os) const {
     *os << "equals ";
-    UniversalPrint(rhs_, os);
+    UniversalPrint(expected_, os);
   }
   void DescribeNegationTo(::std::ostream* os) const {
     *os << "does not equal ";
-    UniversalPrint(rhs_, os);
+    UniversalPrint(expected_, os);
   }
 
   template <typename LhsContainer>
@@ -2311,7 +2552,7 @@ class ContainerEqMatcher {
         LhsView;
     typedef typename LhsView::type LhsStlContainer;
     StlContainerReference lhs_stl_container = LhsView::ConstReference(lhs);
-    if (lhs_stl_container == rhs_)
+    if (lhs_stl_container == expected_)
       return true;
 
     ::std::ostream* const os = listener->stream();
@@ -2321,8 +2562,8 @@ class ContainerEqMatcher {
       for (typename LhsStlContainer::const_iterator it =
                lhs_stl_container.begin();
            it != lhs_stl_container.end(); ++it) {
-        if (internal::ArrayAwareFind(rhs_.begin(), rhs_.end(), *it) ==
-            rhs_.end()) {
+        if (internal::ArrayAwareFind(expected_.begin(), expected_.end(), *it) ==
+            expected_.end()) {
           if (printed_header) {
             *os << ", ";
           } else {
@@ -2335,8 +2576,8 @@ class ContainerEqMatcher {
 
       // Now check for missing values.
       bool printed_header2 = false;
-      for (typename StlContainer::const_iterator it = rhs_.begin();
-           it != rhs_.end(); ++it) {
+      for (typename StlContainer::const_iterator it = expected_.begin();
+           it != expected_.end(); ++it) {
         if (internal::ArrayAwareFind(
                 lhs_stl_container.begin(), lhs_stl_container.end(), *it) ==
             lhs_stl_container.end()) {
@@ -2356,7 +2597,7 @@ class ContainerEqMatcher {
   }
 
  private:
-  const StlContainer rhs_;
+  const StlContainer expected_;
 
   GTEST_DISALLOW_ASSIGN_(ContainerEqMatcher);
 };
@@ -2482,7 +2723,7 @@ class PointwiseMatcher {
     // reference, as they may be expensive to copy.  We must use tuple
     // instead of pair here, as a pair cannot hold references (C++ 98,
     // 20.2.2 [lib.pairs]).
-    typedef ::std::tr1::tuple<const LhsValue&, const RhsValue&> InnerMatcherArg;
+    typedef ::testing::tuple<const LhsValue&, const RhsValue&> InnerMatcherArg;
 
     Impl(const TupleMatcher& tuple_matcher, const RhsStlContainer& rhs)
         // mono_tuple_matcher_ holds a monomorphic version of the tuple matcher.
@@ -3219,7 +3460,7 @@ class UnorderedElementsAreMatcher {
     typedef typename View::value_type Element;
     typedef ::std::vector<Matcher<const Element&> > MatcherVec;
     MatcherVec matchers;
-    matchers.reserve(::std::tr1::tuple_size<MatcherTuple>::value);
+    matchers.reserve(::testing::tuple_size<MatcherTuple>::value);
     TransformTupleValues(CastAndAppendTransform<const Element&>(), matchers_,
                          ::std::back_inserter(matchers));
     return MakeMatcher(new UnorderedElementsAreMatcherImpl<Container>(
@@ -3244,7 +3485,7 @@ class ElementsAreMatcher {
     typedef typename View::value_type Element;
     typedef ::std::vector<Matcher<const Element&> > MatcherVec;
     MatcherVec matchers;
-    matchers.reserve(::std::tr1::tuple_size<MatcherTuple>::value);
+    matchers.reserve(::testing::tuple_size<MatcherTuple>::value);
     TransformTupleValues(CastAndAppendTransform<const Element&>(), matchers_,
                          ::std::back_inserter(matchers));
     return MakeMatcher(new ElementsAreMatcherImpl<Container>(
@@ -3298,6 +3539,81 @@ class ElementsAreArrayMatcher {
   GTEST_DISALLOW_ASSIGN_(ElementsAreArrayMatcher);
 };
 
+// Given a 2-tuple matcher tm of type Tuple2Matcher and a value second
+// of type Second, BoundSecondMatcher<Tuple2Matcher, Second>(tm,
+// second) is a polymorphic matcher that matches a value x iff tm
+// matches tuple (x, second).  Useful for implementing
+// UnorderedPointwise() in terms of UnorderedElementsAreArray().
+//
+// BoundSecondMatcher is copyable and assignable, as we need to put
+// instances of this class in a vector when implementing
+// UnorderedPointwise().
+template <typename Tuple2Matcher, typename Second>
+class BoundSecondMatcher {
+ public:
+  BoundSecondMatcher(const Tuple2Matcher& tm, const Second& second)
+      : tuple2_matcher_(tm), second_value_(second) {}
+
+  template <typename T>
+  operator Matcher<T>() const {
+    return MakeMatcher(new Impl<T>(tuple2_matcher_, second_value_));
+  }
+
+  // We have to define this for UnorderedPointwise() to compile in
+  // C++98 mode, as it puts BoundSecondMatcher instances in a vector,
+  // which requires the elements to be assignable in C++98.  The
+  // compiler cannot generate the operator= for us, as Tuple2Matcher
+  // and Second may not be assignable.
+  //
+  // However, this should never be called, so the implementation just
+  // need to assert.
+  void operator=(const BoundSecondMatcher& /*rhs*/) {
+    GTEST_LOG_(FATAL) << "BoundSecondMatcher should never be assigned.";
+  }
+
+ private:
+  template <typename T>
+  class Impl : public MatcherInterface<T> {
+   public:
+    typedef ::testing::tuple<T, Second> ArgTuple;
+
+    Impl(const Tuple2Matcher& tm, const Second& second)
+        : mono_tuple2_matcher_(SafeMatcherCast<const ArgTuple&>(tm)),
+          second_value_(second) {}
+
+    virtual void DescribeTo(::std::ostream* os) const {
+      *os << "and ";
+      UniversalPrint(second_value_, os);
+      *os << " ";
+      mono_tuple2_matcher_.DescribeTo(os);
+    }
+
+    virtual bool MatchAndExplain(T x, MatchResultListener* listener) const {
+      return mono_tuple2_matcher_.MatchAndExplain(ArgTuple(x, second_value_),
+                                                  listener);
+    }
+
+   private:
+    const Matcher<const ArgTuple&> mono_tuple2_matcher_;
+    const Second second_value_;
+
+    GTEST_DISALLOW_ASSIGN_(Impl);
+  };
+
+  const Tuple2Matcher tuple2_matcher_;
+  const Second second_value_;
+};
+
+// Given a 2-tuple matcher tm and a value second,
+// MatcherBindSecond(tm, second) returns a matcher that matches a
+// value x iff tm matches tuple (x, second).  Useful for implementing
+// UnorderedPointwise() in terms of UnorderedElementsAreArray().
+template <typename Tuple2Matcher, typename Second>
+BoundSecondMatcher<Tuple2Matcher, Second> MatcherBindSecond(
+    const Tuple2Matcher& tm, const Second& second) {
+  return BoundSecondMatcher<Tuple2Matcher, Second>(tm, second);
+}
+
 // Returns the description for a matcher defined using the MATCHER*()
 // macro where the user-supplied description string is "", if
 // 'negation' is false; otherwise returns the description of the
@@ -3312,7 +3628,7 @@ GTEST_API_ string FormatMatcherDescription(bool negation,
 // ElementsAreArray(first, last)
 // ElementsAreArray(pointer, count)
 // ElementsAreArray(array)
-// ElementsAreArray(vector)
+// ElementsAreArray(container)
 // ElementsAreArray({ e1, e2, ..., en })
 //
 // The ElementsAreArray() functions are like ElementsAre(...), except
@@ -3344,13 +3660,13 @@ inline internal::ElementsAreArrayMatcher<T> ElementsAreArray(
   return ElementsAreArray(array, N);
 }
 
-template <typename T, typename A>
-inline internal::ElementsAreArrayMatcher<T> ElementsAreArray(
-    const ::std::vector<T, A>& vec) {
-  return ElementsAreArray(vec.begin(), vec.end());
+template <typename Container>
+inline internal::ElementsAreArrayMatcher<typename Container::value_type>
+ElementsAreArray(const Container& container) {
+  return ElementsAreArray(container.begin(), container.end());
 }
 
-#if GTEST_LANG_CXX11
+#if GTEST_HAS_STD_INITIALIZER_LIST_
 template <typename T>
 inline internal::ElementsAreArrayMatcher<T>
 ElementsAreArray(::std::initializer_list<T> xs) {
@@ -3361,7 +3677,7 @@ ElementsAreArray(::std::initializer_list<T> xs) {
 // UnorderedElementsAreArray(first, last)
 // UnorderedElementsAreArray(pointer, count)
 // UnorderedElementsAreArray(array)
-// UnorderedElementsAreArray(vector)
+// UnorderedElementsAreArray(container)
 // UnorderedElementsAreArray({ e1, e2, ..., en })
 //
 // The UnorderedElementsAreArray() functions are like
@@ -3386,13 +3702,14 @@ UnorderedElementsAreArray(const T (&array)[N]) {
   return UnorderedElementsAreArray(array, N);
 }
 
-template <typename T, typename A>
-inline internal::UnorderedElementsAreArrayMatcher<T>
-UnorderedElementsAreArray(const ::std::vector<T, A>& vec) {
-  return UnorderedElementsAreArray(vec.begin(), vec.end());
+template <typename Container>
+inline internal::UnorderedElementsAreArrayMatcher<
+    typename Container::value_type>
+UnorderedElementsAreArray(const Container& container) {
+  return UnorderedElementsAreArray(container.begin(), container.end());
 }
 
-#if GTEST_LANG_CXX11
+#if GTEST_HAS_STD_INITIALIZER_LIST_
 template <typename T>
 inline internal::UnorderedElementsAreArrayMatcher<T>
 UnorderedElementsAreArray(::std::initializer_list<T> xs) {
@@ -3557,6 +3874,19 @@ inline internal::PointeeMatcher<InnerMatcher> Pointee(
   return internal::PointeeMatcher<InnerMatcher>(inner_matcher);
 }
 
+// Creates a matcher that matches a pointer or reference that matches
+// inner_matcher when dynamic_cast<To> is applied.
+// The result of dynamic_cast<To> is forwarded to the inner matcher.
+// If To is a pointer and the cast fails, the inner matcher will receive NULL.
+// If To is a reference and the cast fails, this matcher returns false
+// immediately.
+template <typename To>
+inline PolymorphicMatcher<internal::WhenDynamicCastToMatcher<To> >
+WhenDynamicCastTo(const Matcher<To>& inner_matcher) {
+  return MakePolymorphicMatcher(
+      internal::WhenDynamicCastToMatcher<To>(inner_matcher));
+}
+
 // Creates a matcher that matches an object whose given field matches
 // 'matcher'.  For example,
 //   Field(&Foo::number, Ge(5))
@@ -3799,6 +4129,17 @@ SizeIs(const SizeMatcher& size_matcher) {
   return internal::SizeIsMatcher<SizeMatcher>(size_matcher);
 }
 
+// Returns a matcher that matches the distance between the container's begin()
+// iterator and its end() iterator, i.e. the size of the container. This matcher
+// can be used instead of SizeIs with containers such as std::forward_list which
+// do not implement size(). The container must provide const_iterator (with
+// valid iterator_traits), begin() and end().
+template <typename DistanceMatcher>
+inline internal::BeginEndDistanceIsMatcher<DistanceMatcher>
+BeginEndDistanceIs(const DistanceMatcher& distance_matcher) {
+  return internal::BeginEndDistanceIsMatcher<DistanceMatcher>(distance_matcher);
+}
+
 // Returns a matcher that matches an equal container.
 // This matcher behaves like Eq(), but in the event of mismatch lists the
 // values that are included in one container but not the other. (Duplicate
@@ -3845,12 +4186,80 @@ inline internal::PointwiseMatcher<TupleMatcher,
                                   GTEST_REMOVE_CONST_(Container)>
 Pointwise(const TupleMatcher& tuple_matcher, const Container& rhs) {
   // This following line is for working around a bug in MSVC 8.0,
-  // which causes Container to be a const type sometimes.
+  // which causes Container to be a const type sometimes (e.g. when
+  // rhs is a const int[])..
   typedef GTEST_REMOVE_CONST_(Container) RawContainer;
   return internal::PointwiseMatcher<TupleMatcher, RawContainer>(
       tuple_matcher, rhs);
 }
 
+#if GTEST_HAS_STD_INITIALIZER_LIST_
+
+// Supports the Pointwise(m, {a, b, c}) syntax.
+template <typename TupleMatcher, typename T>
+inline internal::PointwiseMatcher<TupleMatcher, std::vector<T> > Pointwise(
+    const TupleMatcher& tuple_matcher, std::initializer_list<T> rhs) {
+  return Pointwise(tuple_matcher, std::vector<T>(rhs));
+}
+
+#endif  // GTEST_HAS_STD_INITIALIZER_LIST_
+
+// UnorderedPointwise(pair_matcher, rhs) matches an STL-style
+// container or a native array that contains the same number of
+// elements as in rhs, where in some permutation of the container, its
+// i-th element and rhs's i-th element (as a pair) satisfy the given
+// pair matcher, for all i.  Tuple2Matcher must be able to be safely
+// cast to Matcher<tuple<const T1&, const T2&> >, where T1 and T2 are
+// the types of elements in the LHS container and the RHS container
+// respectively.
+//
+// This is like Pointwise(pair_matcher, rhs), except that the element
+// order doesn't matter.
+template <typename Tuple2Matcher, typename RhsContainer>
+inline internal::UnorderedElementsAreArrayMatcher<
+    typename internal::BoundSecondMatcher<
+        Tuple2Matcher, typename internal::StlContainerView<GTEST_REMOVE_CONST_(
+                           RhsContainer)>::type::value_type> >
+UnorderedPointwise(const Tuple2Matcher& tuple2_matcher,
+                   const RhsContainer& rhs_container) {
+  // This following line is for working around a bug in MSVC 8.0,
+  // which causes RhsContainer to be a const type sometimes (e.g. when
+  // rhs_container is a const int[]).
+  typedef GTEST_REMOVE_CONST_(RhsContainer) RawRhsContainer;
+
+  // RhsView allows the same code to handle RhsContainer being a
+  // STL-style container and it being a native C-style array.
+  typedef typename internal::StlContainerView<RawRhsContainer> RhsView;
+  typedef typename RhsView::type RhsStlContainer;
+  typedef typename RhsStlContainer::value_type Second;
+  const RhsStlContainer& rhs_stl_container =
+      RhsView::ConstReference(rhs_container);
+
+  // Create a matcher for each element in rhs_container.
+  ::std::vector<internal::BoundSecondMatcher<Tuple2Matcher, Second> > matchers;
+  for (typename RhsStlContainer::const_iterator it = rhs_stl_container.begin();
+       it != rhs_stl_container.end(); ++it) {
+    matchers.push_back(
+        internal::MatcherBindSecond(tuple2_matcher, *it));
+  }
+
+  // Delegate the work to UnorderedElementsAreArray().
+  return UnorderedElementsAreArray(matchers);
+}
+
+#if GTEST_HAS_STD_INITIALIZER_LIST_
+
+// Supports the UnorderedPointwise(m, {a, b, c}) syntax.
+template <typename Tuple2Matcher, typename T>
+inline internal::UnorderedElementsAreArrayMatcher<
+    typename internal::BoundSecondMatcher<Tuple2Matcher, T> >
+UnorderedPointwise(const Tuple2Matcher& tuple2_matcher,
+                   std::initializer_list<T> rhs) {
+  return UnorderedPointwise(tuple2_matcher, std::vector<T>(rhs));
+}
+
+#endif  // GTEST_HAS_STD_INITIALIZER_LIST_
+
 // Matches an STL-style container or a native array that contains at
 // least one element matching the given value or matcher.
 //
@@ -3983,4 +4392,8 @@ inline InnerMatcher AllArgs(const InnerMatcher& matcher) { return matcher; }
 
 }  // namespace testing
 
+// Include any custom callback matchers added by the local installation.
+// We must include this header at the end to make sure it can use the
+// declarations from this file.
+#include "gmock/internal/custom/gmock-matchers.h"
 #endif  // GMOCK_INCLUDE_GMOCK_GMOCK_MATCHERS_H_
similarity index 86%
rename from src/external/gmock-1.7.0/include/gmock/gmock-more-actions.h
rename to src/external/googletest/googlemock/include/gmock/gmock-more-actions.h
index fc5e5ca818e602b24f683c60bd470bda53235806..3d387b6b7d75ebc44ac0310fa62e58d61004ec64 100644 (file)
@@ -72,7 +72,7 @@ template <class Class, typename MethodPtr>
 class InvokeMethodAction {
  public:
   InvokeMethodAction(Class* obj_ptr, MethodPtr method_ptr)
-      : obj_ptr_(obj_ptr), method_ptr_(method_ptr) {}
+      : method_ptr_(method_ptr), obj_ptr_(obj_ptr) {}
 
   template <typename Result, typename ArgumentTuple>
   Result Perform(const ArgumentTuple& args) const {
@@ -81,12 +81,29 @@ class InvokeMethodAction {
   }
 
  private:
-  Class* const obj_ptr_;
+  // The order of these members matters.  Reversing the order can trigger
+  // warning C4121 in MSVC (see
+  // http://computer-programming-forum.com/7-vc.net/6fbc30265f860ad1.htm ).
   const MethodPtr method_ptr_;
+  Class* const obj_ptr_;
 
   GTEST_DISALLOW_ASSIGN_(InvokeMethodAction);
 };
 
+// An internal replacement for std::copy which mimics its behavior. This is
+// necessary because Visual Studio deprecates ::std::copy, issuing warning 4996.
+// However Visual Studio 2010 and later do not honor #pragmas which disable that
+// warning.
+template<typename InputIterator, typename OutputIterator>
+inline OutputIterator CopyElements(InputIterator first,
+                                   InputIterator last,
+                                   OutputIterator output) {
+  for (; first != last; ++first, ++output) {
+    *output = *first;
+  }
+  return output;
+}
+
 }  // namespace internal
 
 // Various overloads for Invoke().
@@ -144,7 +161,7 @@ WithArg(const InnerAction& action) {
 ACTION_TEMPLATE(ReturnArg,
                 HAS_1_TEMPLATE_PARAMS(int, k),
                 AND_0_VALUE_PARAMS()) {
-  return std::tr1::get<k>(args);
+  return ::testing::get<k>(args);
 }
 
 // Action SaveArg<k>(pointer) saves the k-th (0-based) argument of the
@@ -152,7 +169,7 @@ ACTION_TEMPLATE(ReturnArg,
 ACTION_TEMPLATE(SaveArg,
                 HAS_1_TEMPLATE_PARAMS(int, k),
                 AND_1_VALUE_PARAMS(pointer)) {
-  *pointer = ::std::tr1::get<k>(args);
+  *pointer = ::testing::get<k>(args);
 }
 
 // Action SaveArgPointee<k>(pointer) saves the value pointed to
@@ -160,7 +177,7 @@ ACTION_TEMPLATE(SaveArg,
 ACTION_TEMPLATE(SaveArgPointee,
                 HAS_1_TEMPLATE_PARAMS(int, k),
                 AND_1_VALUE_PARAMS(pointer)) {
-  *pointer = *::std::tr1::get<k>(args);
+  *pointer = *::testing::get<k>(args);
 }
 
 // Action SetArgReferee<k>(value) assigns 'value' to the variable
@@ -168,13 +185,13 @@ ACTION_TEMPLATE(SaveArgPointee,
 ACTION_TEMPLATE(SetArgReferee,
                 HAS_1_TEMPLATE_PARAMS(int, k),
                 AND_1_VALUE_PARAMS(value)) {
-  typedef typename ::std::tr1::tuple_element<k, args_type>::type argk_type;
+  typedef typename ::testing::tuple_element<k, args_type>::type argk_type;
   // Ensures that argument #k is a reference.  If you get a compiler
   // error on the next line, you are using SetArgReferee<k>(value) in
   // a mock function whose k-th (0-based) argument is not a reference.
   GTEST_COMPILE_ASSERT_(internal::is_reference<argk_type>::value,
                         SetArgReferee_must_be_used_with_a_reference_argument);
-  ::std::tr1::get<k>(args) = value;
+  ::testing::get<k>(args) = value;
 }
 
 // Action SetArrayArgument<k>(first, last) copies the elements in
@@ -185,15 +202,11 @@ ACTION_TEMPLATE(SetArgReferee,
 ACTION_TEMPLATE(SetArrayArgument,
                 HAS_1_TEMPLATE_PARAMS(int, k),
                 AND_2_VALUE_PARAMS(first, last)) {
-  // Microsoft compiler deprecates ::std::copy, so we want to suppress warning
-  // 4996 (Function call with parameters that may be unsafe) there.
-#ifdef _MSC_VER
-# pragma warning(push)          // Saves the current warning state.
-# pragma warning(disable:4996)  // Temporarily disables warning 4996.
-#endif
-  ::std::copy(first, last, ::std::tr1::get<k>(args));
+  // Visual Studio deprecates ::std::copy, so we use our own copy in that case.
 #ifdef _MSC_VER
-# pragma warning(pop)           // Restores the warning state.
+  internal::CopyElements(first, last, ::testing::get<k>(args));
+#else
+  ::std::copy(first, last, ::testing::get<k>(args));
 #endif
 }
 
@@ -202,7 +215,7 @@ ACTION_TEMPLATE(SetArrayArgument,
 ACTION_TEMPLATE(DeleteArg,
                 HAS_1_TEMPLATE_PARAMS(int, k),
                 AND_0_VALUE_PARAMS()) {
-  delete ::std::tr1::get<k>(args);
+  delete ::testing::get<k>(args);
 }
 
 // This action returns the value pointed to by 'pointer'.
similarity index 95%
rename from src/external/gmock-1.7.0/include/gmock/gmock-spec-builders.h
rename to src/external/googletest/googlemock/include/gmock/gmock-spec-builders.h
index 2dd733b60e8436403aba3239ce258d7425e24b49..fed7de66bc4ce21de9c74a74523dd30faa5bdffd 100644 (file)
@@ -211,7 +211,7 @@ class GTEST_API_ UntypedFunctionMockerBase {
   // arguments.  This function can be safely called from multiple
   // threads concurrently.  The caller is responsible for deleting the
   // result.
-  const UntypedActionResultHolderBase* UntypedInvokeWith(
+  UntypedActionResultHolderBase* UntypedInvokeWith(
       const void* untyped_args)
           GTEST_LOCK_EXCLUDED_(g_gmock_mutex);
 
@@ -1289,6 +1289,57 @@ class MockSpec {
   GTEST_DISALLOW_ASSIGN_(MockSpec);
 };  // class MockSpec
 
+// Wrapper type for generically holding an ordinary value or lvalue reference.
+// If T is not a reference type, it must be copyable or movable.
+// ReferenceOrValueWrapper<T> is movable, and will also be copyable unless
+// T is a move-only value type (which means that it will always be copyable
+// if the current platform does not support move semantics).
+//
+// The primary template defines handling for values, but function header
+// comments describe the contract for the whole template (including
+// specializations).
+template <typename T>
+class ReferenceOrValueWrapper {
+ public:
+  // Constructs a wrapper from the given value/reference.
+  explicit ReferenceOrValueWrapper(T value)
+      : value_(::testing::internal::move(value)) {
+  }
+
+  // Unwraps and returns the underlying value/reference, exactly as
+  // originally passed. The behavior of calling this more than once on
+  // the same object is unspecified.
+  T Unwrap() { return ::testing::internal::move(value_); }
+
+  // Provides nondestructive access to the underlying value/reference.
+  // Always returns a const reference (more precisely,
+  // const RemoveReference<T>&). The behavior of calling this after
+  // calling Unwrap on the same object is unspecified.
+  const T& Peek() const {
+    return value_;
+  }
+
+ private:
+  T value_;
+};
+
+// Specialization for lvalue reference types. See primary template
+// for documentation.
+template <typename T>
+class ReferenceOrValueWrapper<T&> {
+ public:
+  // Workaround for debatable pass-by-reference lint warning (c-library-team
+  // policy precludes NOLINT in this context)
+  typedef T& reference;
+  explicit ReferenceOrValueWrapper(reference ref)
+      : value_ptr_(&ref) {}
+  T& Unwrap() { return *value_ptr_; }
+  const T& Peek() const { return *value_ptr_; }
+
+ private:
+  T* value_ptr_;
+};
+
 // MSVC warns about using 'this' in base member initializer list, so
 // we need to temporarily disable the warning.  We have to do it for
 // the entire class to suppress the warning, even though it's about
@@ -1320,23 +1371,16 @@ class UntypedActionResultHolderBase {
 template <typename T>
 class ActionResultHolder : public UntypedActionResultHolderBase {
  public:
-  explicit ActionResultHolder(T a_value) : value_(a_value) {}
-
-  // The compiler-generated copy constructor and assignment operator
-  // are exactly what we need, so we don't need to define them.
-
-  // Returns the held value and deletes this object.
-  T GetValueAndDelete() const {
-    T retval(value_);
-    delete this;
-    return retval;
+  // Returns the held value. Must not be called more than once.
+  T Unwrap() {
+    return result_.Unwrap();
   }
 
   // Prints the held value as an action's result to os.
   virtual void PrintAsActionResult(::std::ostream* os) const {
     *os << "\n          Returns: ";
     // T may be a reference type, so we don't use UniversalPrint().
-    UniversalPrinter<T>::Print(value_, os);
+    UniversalPrinter<T>::Print(result_.Peek(), os);
   }
 
   // Performs the given mock function's default action and returns the
@@ -1346,8 +1390,8 @@ class ActionResultHolder : public UntypedActionResultHolderBase {
       const FunctionMockerBase<F>* func_mocker,
       const typename Function<F>::ArgumentTuple& args,
       const string& call_description) {
-    return new ActionResultHolder(
-        func_mocker->PerformDefaultAction(args, call_description));
+    return new ActionResultHolder(Wrapper(
+        func_mocker->PerformDefaultAction(args, call_description)));
   }
 
   // Performs the given action and returns the result in a new-ed
@@ -1356,44 +1400,53 @@ class ActionResultHolder : public UntypedActionResultHolderBase {
   static ActionResultHolder*
   PerformAction(const Action<F>& action,
                 const typename Function<F>::ArgumentTuple& args) {
-    return new ActionResultHolder(action.Perform(args));
+    return new ActionResultHolder(Wrapper(action.Perform(args)));
   }
 
  private:
-  T value_;
+  typedef ReferenceOrValueWrapper<T> Wrapper;
 
-  // T could be a reference type, so = isn't supported.
-  GTEST_DISALLOW_ASSIGN_(ActionResultHolder);
+  explicit ActionResultHolder(Wrapper result)
+      : result_(::testing::internal::move(result)) {
+  }
+
+  Wrapper result_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(ActionResultHolder);
 };
 
 // Specialization for T = void.
 template <>
 class ActionResultHolder<void> : public UntypedActionResultHolderBase {
  public:
-  explicit ActionResultHolder() {}
-
-  void GetValueAndDelete() const { delete this; }
+  void Unwrap() { }
 
   virtual void PrintAsActionResult(::std::ostream* /* os */) const {}
 
-  // Performs the given mock function's default action and returns NULL;
+  // Performs the given mock function's default action and returns ownership
+  // of an empty ActionResultHolder*.
   template <typename F>
   static ActionResultHolder* PerformDefaultAction(
       const FunctionMockerBase<F>* func_mocker,
       const typename Function<F>::ArgumentTuple& args,
       const string& call_description) {
     func_mocker->PerformDefaultAction(args, call_description);
-    return new ActionResultHolder();
+    return new ActionResultHolder;
   }
 
-  // Performs the given action and returns NULL.
+  // Performs the given action and returns ownership of an empty
+  // ActionResultHolder*.
   template <typename F>
   static ActionResultHolder* PerformAction(
       const Action<F>& action,
       const typename Function<F>::ArgumentTuple& args) {
     action.Perform(args);
-    return new ActionResultHolder();
+    return new ActionResultHolder;
   }
+
+ private:
+  ActionResultHolder() {}
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(ActionResultHolder);
 };
 
 // The base of the function mocker class for the given function type.
@@ -1528,8 +1581,9 @@ class FunctionMockerBase : public UntypedFunctionMockerBase {
   // threads concurrently.
   Result InvokeWith(const ArgumentTuple& args)
         GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
-    return static_cast<const ResultHolder*>(
-        this->UntypedInvokeWith(&args))->GetValueAndDelete();
+    scoped_ptr<ResultHolder> holder(
+        DownCast_<ResultHolder*>(this->UntypedInvokeWith(&args)));
+    return holder->Unwrap();
   }
 
   // Adds and returns a default action spec for this mock function.
diff --git a/src/external/googletest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h b/src/external/googletest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h
new file mode 100644 (file)
index 0000000..7dc3b1a
--- /dev/null
@@ -0,0 +1,8 @@
+// This file was GENERATED by command:
+//     pump.py gmock-generated-actions.h.pump
+// DO NOT EDIT BY HAND!!!
+
+#ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_GENERATED_ACTIONS_H_
+#define GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_GENERATED_ACTIONS_H_
+
+#endif  // GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_GENERATED_ACTIONS_H_
diff --git a/src/external/googletest/googlemock/include/gmock/internal/custom/gmock-matchers.h b/src/external/googletest/googlemock/include/gmock/internal/custom/gmock-matchers.h
new file mode 100644 (file)
index 0000000..f2efef9
--- /dev/null
@@ -0,0 +1,39 @@
+// Copyright 2015, Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// ============================================================
+// An installation-specific extension point for gmock-matchers.h.
+// ============================================================
+//
+// Adds google3 callback support to CallableTraits.
+//
+#ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_CALLBACK_MATCHERS_H_
+#define GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_CALLBACK_MATCHERS_H_
+
+#endif  //  GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_CALLBACK_MATCHERS_H_
diff --git a/src/external/googletest/googlemock/include/gmock/internal/custom/gmock-port.h b/src/external/googletest/googlemock/include/gmock/internal/custom/gmock-port.h
new file mode 100644 (file)
index 0000000..9ce8bfe
--- /dev/null
@@ -0,0 +1,46 @@
+// Copyright 2015, Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Injection point for custom user configurations.
+// The following macros can be defined:
+//
+//   Flag related macros:
+//     GMOCK_DECLARE_bool_(name)
+//     GMOCK_DECLARE_int32_(name)
+//     GMOCK_DECLARE_string_(name)
+//     GMOCK_DEFINE_bool_(name, default_val, doc)
+//     GMOCK_DEFINE_int32_(name, default_val, doc)
+//     GMOCK_DEFINE_string_(name, default_val, doc)
+//
+// ** Custom implementation starts here **
+
+#ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_PORT_H_
+#define GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_PORT_H_
+
+#endif  // GMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_PORT_H_
similarity index 81%
rename from src/external/gmock-1.7.0/include/gmock/internal/gmock-generated-internal-utils.h
rename to src/external/googletest/googlemock/include/gmock/internal/gmock-generated-internal-utils.h
index 02258451d9d37f88b71e69e24926ed8591ce902e..7811e43f87c11b007fd7b45b21e4c1a5dea61f6b 100644 (file)
@@ -69,70 +69,70 @@ template <typename Tuple>
 struct MatcherTuple;
 
 template <>
-struct MatcherTuple< ::std::tr1::tuple<> > {
-  typedef ::std::tr1::tuple< > type;
+struct MatcherTuple< ::testing::tuple<> > {
+  typedef ::testing::tuple< > type;
 };
 
 template <typename A1>
-struct MatcherTuple< ::std::tr1::tuple<A1> > {
-  typedef ::std::tr1::tuple<Matcher<A1> > type;
+struct MatcherTuple< ::testing::tuple<A1> > {
+  typedef ::testing::tuple<Matcher<A1> > type;
 };
 
 template <typename A1, typename A2>
-struct MatcherTuple< ::std::tr1::tuple<A1, A2> > {
-  typedef ::std::tr1::tuple<Matcher<A1>, Matcher<A2> > type;
+struct MatcherTuple< ::testing::tuple<A1, A2> > {
+  typedef ::testing::tuple<Matcher<A1>, Matcher<A2> > type;
 };
 
 template <typename A1, typename A2, typename A3>
-struct MatcherTuple< ::std::tr1::tuple<A1, A2, A3> > {
-  typedef ::std::tr1::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3> > type;
+struct MatcherTuple< ::testing::tuple<A1, A2, A3> > {
+  typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3> > type;
 };
 
 template <typename A1, typename A2, typename A3, typename A4>
-struct MatcherTuple< ::std::tr1::tuple<A1, A2, A3, A4> > {
-  typedef ::std::tr1::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>,
+struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4> > {
+  typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>,
       Matcher<A4> > type;
 };
 
 template <typename A1, typename A2, typename A3, typename A4, typename A5>
-struct MatcherTuple< ::std::tr1::tuple<A1, A2, A3, A4, A5> > {
-  typedef ::std::tr1::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
+struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5> > {
+  typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
       Matcher<A5> > type;
 };
 
 template <typename A1, typename A2, typename A3, typename A4, typename A5,
     typename A6>
-struct MatcherTuple< ::std::tr1::tuple<A1, A2, A3, A4, A5, A6> > {
-  typedef ::std::tr1::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
+struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5, A6> > {
+  typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
       Matcher<A5>, Matcher<A6> > type;
 };
 
 template <typename A1, typename A2, typename A3, typename A4, typename A5,
     typename A6, typename A7>
-struct MatcherTuple< ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7> > {
-  typedef ::std::tr1::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
+struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5, A6, A7> > {
+  typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
       Matcher<A5>, Matcher<A6>, Matcher<A7> > type;
 };
 
 template <typename A1, typename A2, typename A3, typename A4, typename A5,
     typename A6, typename A7, typename A8>
-struct MatcherTuple< ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8> > {
-  typedef ::std::tr1::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
+struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8> > {
+  typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
       Matcher<A5>, Matcher<A6>, Matcher<A7>, Matcher<A8> > type;
 };
 
 template <typename A1, typename A2, typename A3, typename A4, typename A5,
     typename A6, typename A7, typename A8, typename A9>
-struct MatcherTuple< ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9> > {
-  typedef ::std::tr1::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
+struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9> > {
+  typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
       Matcher<A5>, Matcher<A6>, Matcher<A7>, Matcher<A8>, Matcher<A9> > type;
 };
 
 template <typename A1, typename A2, typename A3, typename A4, typename A5,
     typename A6, typename A7, typename A8, typename A9, typename A10>
-struct MatcherTuple< ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9,
+struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9,
     A10> > {
-  typedef ::std::tr1::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
+  typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
       Matcher<A5>, Matcher<A6>, Matcher<A7>, Matcher<A8>, Matcher<A9>,
       Matcher<A10> > type;
 };
@@ -156,7 +156,7 @@ struct Function;
 template <typename R>
 struct Function<R()> {
   typedef R Result;
-  typedef ::std::tr1::tuple<> ArgumentTuple;
+  typedef ::testing::tuple<> ArgumentTuple;
   typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
   typedef void MakeResultVoid();
   typedef IgnoredValue MakeResultIgnoredValue();
@@ -166,7 +166,7 @@ template <typename R, typename A1>
 struct Function<R(A1)>
     : Function<R()> {
   typedef A1 Argument1;
-  typedef ::std::tr1::tuple<A1> ArgumentTuple;
+  typedef ::testing::tuple<A1> ArgumentTuple;
   typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
   typedef void MakeResultVoid(A1);
   typedef IgnoredValue MakeResultIgnoredValue(A1);
@@ -176,7 +176,7 @@ template <typename R, typename A1, typename A2>
 struct Function<R(A1, A2)>
     : Function<R(A1)> {
   typedef A2 Argument2;
-  typedef ::std::tr1::tuple<A1, A2> ArgumentTuple;
+  typedef ::testing::tuple<A1, A2> ArgumentTuple;
   typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
   typedef void MakeResultVoid(A1, A2);
   typedef IgnoredValue MakeResultIgnoredValue(A1, A2);
@@ -186,7 +186,7 @@ template <typename R, typename A1, typename A2, typename A3>
 struct Function<R(A1, A2, A3)>
     : Function<R(A1, A2)> {
   typedef A3 Argument3;
-  typedef ::std::tr1::tuple<A1, A2, A3> ArgumentTuple;
+  typedef ::testing::tuple<A1, A2, A3> ArgumentTuple;
   typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
   typedef void MakeResultVoid(A1, A2, A3);
   typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3);
@@ -196,7 +196,7 @@ template <typename R, typename A1, typename A2, typename A3, typename A4>
 struct Function<R(A1, A2, A3, A4)>
     : Function<R(A1, A2, A3)> {
   typedef A4 Argument4;
-  typedef ::std::tr1::tuple<A1, A2, A3, A4> ArgumentTuple;
+  typedef ::testing::tuple<A1, A2, A3, A4> ArgumentTuple;
   typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
   typedef void MakeResultVoid(A1, A2, A3, A4);
   typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4);
@@ -207,7 +207,7 @@ template <typename R, typename A1, typename A2, typename A3, typename A4,
 struct Function<R(A1, A2, A3, A4, A5)>
     : Function<R(A1, A2, A3, A4)> {
   typedef A5 Argument5;
-  typedef ::std::tr1::tuple<A1, A2, A3, A4, A5> ArgumentTuple;
+  typedef ::testing::tuple<A1, A2, A3, A4, A5> ArgumentTuple;
   typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
   typedef void MakeResultVoid(A1, A2, A3, A4, A5);
   typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5);
@@ -218,7 +218,7 @@ template <typename R, typename A1, typename A2, typename A3, typename A4,
 struct Function<R(A1, A2, A3, A4, A5, A6)>
     : Function<R(A1, A2, A3, A4, A5)> {
   typedef A6 Argument6;
-  typedef ::std::tr1::tuple<A1, A2, A3, A4, A5, A6> ArgumentTuple;
+  typedef ::testing::tuple<A1, A2, A3, A4, A5, A6> ArgumentTuple;
   typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
   typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6);
   typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6);
@@ -229,7 +229,7 @@ template <typename R, typename A1, typename A2, typename A3, typename A4,
 struct Function<R(A1, A2, A3, A4, A5, A6, A7)>
     : Function<R(A1, A2, A3, A4, A5, A6)> {
   typedef A7 Argument7;
-  typedef ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7> ArgumentTuple;
+  typedef ::testing::tuple<A1, A2, A3, A4, A5, A6, A7> ArgumentTuple;
   typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
   typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6, A7);
   typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6, A7);
@@ -240,7 +240,7 @@ template <typename R, typename A1, typename A2, typename A3, typename A4,
 struct Function<R(A1, A2, A3, A4, A5, A6, A7, A8)>
     : Function<R(A1, A2, A3, A4, A5, A6, A7)> {
   typedef A8 Argument8;
-  typedef ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8> ArgumentTuple;
+  typedef ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8> ArgumentTuple;
   typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
   typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6, A7, A8);
   typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6, A7, A8);
@@ -251,7 +251,7 @@ template <typename R, typename A1, typename A2, typename A3, typename A4,
 struct Function<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)>
     : Function<R(A1, A2, A3, A4, A5, A6, A7, A8)> {
   typedef A9 Argument9;
-  typedef ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9> ArgumentTuple;
+  typedef ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9> ArgumentTuple;
   typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
   typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6, A7, A8, A9);
   typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6, A7, A8,
@@ -264,7 +264,7 @@ template <typename R, typename A1, typename A2, typename A3, typename A4,
 struct Function<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)>
     : Function<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)> {
   typedef A10 Argument10;
-  typedef ::std::tr1::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9,
+  typedef ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9,
       A10> ArgumentTuple;
   typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
   typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10);
similarity index 93%
rename from src/external/gmock-1.7.0/include/gmock/internal/gmock-internal-utils.h
rename to src/external/googletest/googlemock/include/gmock/internal/gmock-internal-utils.h
index e12b7d7d9139787d32c58cec07df8cf6e914af05..e2ddb05c91d7c02d7e076f32ba92fce2a4e940aa 100644 (file)
@@ -361,17 +361,30 @@ template <typename T> struct DecayArray<T[]> {
   typedef const T* type;
 };
 
-// Invalid<T>() returns an invalid value of type T.  This is useful
+// Disable MSVC warnings for infinite recursion, since in this case the
+// the recursion is unreachable.
+#ifdef _MSC_VER
+# pragma warning(push)
+# pragma warning(disable:4717)
+#endif
+
+// Invalid<T>() is usable as an expression of type T, but will terminate
+// the program with an assertion failure if actually run.  This is useful
 // when a value of type T is needed for compilation, but the statement
 // will not really be executed (or we don't care if the statement
 // crashes).
 template <typename T>
 inline T Invalid() {
-  return const_cast<typename remove_reference<T>::type&>(
-      *static_cast<volatile typename remove_reference<T>::type*>(NULL));
+  Assert(false, "", -1, "Internal error: attempt to return invalid value");
+  // This statement is unreachable, and would never terminate even if it
+  // could be reached. It is provided only to placate compiler warnings
+  // about missing return statements.
+  return Invalid<T>();
 }
-template <>
-inline void Invalid<void>() {}
+
+#ifdef _MSC_VER
+# pragma warning(pop)
+#endif
 
 // Given a raw type (i.e. having no top-level reference or const
 // modifier) RawContainer that's either an STL-style container or a
@@ -434,16 +447,17 @@ class StlContainerView<Element[N]> {
     //     ConstReference(const char * (&)[4])')
     // (and though the N parameter type is mismatched in the above explicit
     // conversion of it doesn't help - only the conversion of the array).
-    return type(const_cast<Element*>(&array[0]), N, kReference);
+    return type(const_cast<Element*>(&array[0]), N,
+                RelationToSourceReference());
 #else
-    return type(array, N, kReference);
+    return type(array, N, RelationToSourceReference());
 #endif  // GTEST_OS_SYMBIAN
   }
   static type Copy(const Element (&array)[N]) {
 #if GTEST_OS_SYMBIAN
-    return type(const_cast<Element*>(&array[0]), N, kCopy);
+    return type(const_cast<Element*>(&array[0]), N, RelationToSourceCopy());
 #else
-    return type(array, N, kCopy);
+    return type(array, N, RelationToSourceCopy());
 #endif  // GTEST_OS_SYMBIAN
   }
 };
@@ -451,7 +465,7 @@ class StlContainerView<Element[N]> {
 // This specialization is used when RawContainer is a native array
 // represented as a (pointer, size) tuple.
 template <typename ElementPointer, typename Size>
-class StlContainerView< ::std::tr1::tuple<ElementPointer, Size> > {
+class StlContainerView< ::testing::tuple<ElementPointer, Size> > {
  public:
   typedef GTEST_REMOVE_CONST_(
       typename internal::PointeeOf<ElementPointer>::type) RawElement;
@@ -459,13 +473,11 @@ class StlContainerView< ::std::tr1::tuple<ElementPointer, Size> > {
   typedef const type const_reference;
 
   static const_reference ConstReference(
-      const ::std::tr1::tuple<ElementPointer, Size>& array) {
-    using ::std::tr1::get;
-    return type(get<0>(array), get<1>(array), kReference);
+      const ::testing::tuple<ElementPointer, Size>& array) {
+    return type(get<0>(array), get<1>(array), RelationToSourceReference());
   }
-  static type Copy(const ::std::tr1::tuple<ElementPointer, Size>& array) {
-    using ::std::tr1::get;
-    return type(get<0>(array), get<1>(array), kCopy);
+  static type Copy(const ::testing::tuple<ElementPointer, Size>& array) {
+    return type(get<0>(array), get<1>(array), RelationToSourceCopy());
   }
 };
 
@@ -496,3 +508,4 @@ struct BooleanConstant {};
 }  // namespace testing
 
 #endif  // GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_INTERNAL_UTILS_H_
+
similarity index 80%
rename from src/external/gmock-1.7.0/include/gmock/internal/gmock-port.h
rename to src/external/googletest/googlemock/include/gmock/internal/gmock-port.h
index b6c5c7f1f419db8097e0091f146876a9fc9295be..63f4a6802e8e660d36aa89b12dc28138d20f680b 100644 (file)
 // Author: vadimb@google.com (Vadim Berman)
 //
 // Low-level types and utilities for porting Google Mock to various
-// platforms.  They are subject to change without notice.  DO NOT USE
-// THEM IN USER CODE.
+// platforms.  All macros ending with _ and symbols defined in an
+// internal namespace are subject to change without notice.  Code
+// outside Google Mock MUST NOT USE THEM DIRECTLY.  Macros that don't
+// end with _ are part of Google Mock's public API and can be used by
+// code outside Google Mock.
 
 #ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_PORT_H_
 #define GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_PORT_H_
 #include <stdlib.h>
 #include <iostream>
 
-// Most of the types needed for porting Google Mock are also required
-// for Google Test and are defined in gtest-port.h.
+// Most of the utilities needed for porting Google Mock are also
+// required for Google Test and are defined in gtest-port.h.
+//
+// Note to maintainers: to reduce code duplication, prefer adding
+// portability utilities to Google Test's gtest-port.h instead of
+// here, as Google Mock depends on Google Test.  Only add a utility
+// here if it's truly specific to Google Mock.
 #include "gtest/internal/gtest-linked_ptr.h"
 #include "gtest/internal/gtest-port.h"
+#include "gmock/internal/custom/gmock-port.h"
 
 // To avoid conditional compilation everywhere, we make it
 // gmock-port.h's responsibility to #include the header implementing
@@ -60,6 +69,8 @@
 // use this syntax to reference Google Mock flags.
 #define GMOCK_FLAG(name) FLAGS_gmock_##name
 
+#if !defined(GMOCK_DECLARE_bool_)
+
 // Macros for declaring flags.
 #define GMOCK_DECLARE_bool_(name) extern GTEST_API_ bool GMOCK_FLAG(name)
 #define GMOCK_DECLARE_int32_(name) \
@@ -75,4 +86,6 @@
 #define GMOCK_DEFINE_string_(name, default_val, doc) \
     GTEST_API_ ::std::string GMOCK_FLAG(name) = (default_val)
 
+#endif  // !defined(GMOCK_DECLARE_bool_)
+
 #endif  // GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_PORT_H_
similarity index 98%
rename from src/external/gmock-1.7.0/src/gmock-matchers.cc
rename to src/external/googletest/googlemock/src/gmock-matchers.cc
index 9ed29abfb71162eef6b2b8f92ae67d9f000d7332..e7424510fca22663f2939e1ddfd08beeef1258eb 100644 (file)
@@ -191,9 +191,9 @@ GTEST_API_ string FormatMatcherDescription(bool negation,
 // .                                         [ sink ]  .
 //
 // See Also:
-//   [1] Cormen, et al (2001). "Section 26.2: The FordFulkerson method".
-//       "Introduction to Algorithms (Second ed.)", pp. 651664.
-//   [2] "FordFulkerson algorithm", Wikipedia,
+//   [1] Cormen, et al (2001). "Section 26.2: The Ford-Fulkerson method".
+//       "Introduction to Algorithms (Second ed.)", pp. 651-664.
+//   [2] "Ford-Fulkerson algorithm", Wikipedia,
 //       'http://en.wikipedia.org/wiki/Ford%E2%80%93Fulkerson_algorithm'
 class MaxBipartiteMatchState {
  public:
similarity index 97%
rename from src/external/gmock-1.7.0/src/gmock-spec-builders.cc
rename to src/external/googletest/googlemock/src/gmock-spec-builders.cc
index abaae3ad9808100afbd587f4985a4b985ff4692d..95513420707fc3f1e66c4a052f350451a65b877b 100644 (file)
@@ -245,12 +245,22 @@ GTEST_API_ ThreadLocal<Sequence*> g_gmock_implicit_sequence;
 // Reports an uninteresting call (whose description is in msg) in the
 // manner specified by 'reaction'.
 void ReportUninterestingCall(CallReaction reaction, const string& msg) {
+  // Include a stack trace only if --gmock_verbose=info is specified.
+  const int stack_frames_to_skip =
+      GMOCK_FLAG(verbose) == kInfoVerbosity ? 3 : -1;
   switch (reaction) {
     case kAllow:
-      Log(kInfo, msg, 3);
+      Log(kInfo, msg, stack_frames_to_skip);
       break;
     case kWarn:
-      Log(kWarning, msg, 3);
+      Log(kWarning,
+          msg +
+          "\nNOTE: You can safely ignore the above warning unless this "
+          "call should not happen.  Do not suppress it by blindly adding "
+          "an EXPECT_CALL() if you don't mean to enforce the call.  "
+          "See https://github.com/google/googletest/blob/master/googlemock/docs/CookBook.md#"
+          "knowing-when-to-expect for details.\n",
+          stack_frames_to_skip);
       break;
     default:  // FAIL
       Expect(false, NULL, -1, msg);
@@ -325,7 +335,7 @@ const char* UntypedFunctionMockerBase::Name() const
 // Calculates the result of invoking this mock function with the given
 // arguments, prints it, and returns it.  The caller is responsible
 // for deleting the result.
-const UntypedActionResultHolderBase*
+UntypedActionResultHolderBase*
 UntypedFunctionMockerBase::UntypedInvokeWith(const void* const untyped_args)
     GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
   if (untyped_expectations_.size() == 0) {
@@ -363,7 +373,7 @@ UntypedFunctionMockerBase::UntypedInvokeWith(const void* const untyped_args)
     this->UntypedDescribeUninterestingCall(untyped_args, &ss);
 
     // Calculates the function result.
-    const UntypedActionResultHolderBase* const result =
+    UntypedActionResultHolderBase* const result =
         this->UntypedPerformDefaultAction(untyped_args, ss.str());
 
     // Prints the function result.
@@ -410,7 +420,7 @@ UntypedFunctionMockerBase::UntypedInvokeWith(const void* const untyped_args)
     untyped_expectation->DescribeLocationTo(&loc);
   }
 
-  const UntypedActionResultHolderBase* const result =
+  UntypedActionResultHolderBase* const result =
       untyped_action == NULL ?
       this->UntypedPerformDefaultAction(untyped_args, ss.str()) :
       this->UntypedPerformAction(untyped_action, untyped_args);
similarity index 98%
rename from src/external/gmock-1.7.0/src/gmock.cc
rename to src/external/googletest/googlemock/src/gmock.cc
index 1c06985d16232d68889a3f11c7cfaff48ab1095f..eac3d842ba075815f3109839e7990e4d9dfd2e05 100644 (file)
@@ -106,8 +106,9 @@ static bool ParseGoogleMockBoolFlag(const char* str, const char* flag,
 //
 // On success, stores the value of the flag in *value, and returns
 // true.  On failure, returns false without changing *value.
+template <typename String>
 static bool ParseGoogleMockStringFlag(const char* str, const char* flag,
-                                      std::string* value) {
+                                      String* value) {
   // Gets the value of the flag as a string.
   const char* const value_str = ParseGoogleMockFlagValue(str, flag, false);
 
diff --git a/src/external/googletest/googletest/.gitignore b/src/external/googletest/googletest/.gitignore
new file mode 100644 (file)
index 0000000..4b7be4b
--- /dev/null
@@ -0,0 +1,2 @@
+# python
+*.pyc
diff --git a/src/external/googletest/googletest/CHANGES b/src/external/googletest/googletest/CHANGES
new file mode 100644 (file)
index 0000000..0552132
--- /dev/null
@@ -0,0 +1,157 @@
+Changes for 1.7.0:
+
+* New feature: death tests are supported on OpenBSD and in iOS
+  simulator now.
+* New feature: Google Test now implements a protocol to allow
+  a test runner to detect that a test program has exited
+  prematurely and report it as a failure (before it would be
+  falsely reported as a success if the exit code is 0).
+* New feature: Test::RecordProperty() can now be used outside of the
+  lifespan of a test method, in which case it will be attributed to
+  the current test case or the test program in the XML report.
+* New feature (potentially breaking): --gtest_list_tests now prints
+  the type parameters and value parameters for each test.
+* Improvement: char pointers and char arrays are now escaped properly
+  in failure messages.
+* Improvement: failure summary in XML reports now includes file and
+  line information.
+* Improvement: the <testsuites> XML element now has a timestamp attribute.
+* Improvement: When --gtest_filter is specified, XML report now doesn't
+  contain information about tests that are filtered out.
+* Fixed the bug where long --gtest_filter flag values are truncated in
+  death tests.
+* Potentially breaking change: RUN_ALL_TESTS() is now implemented as a
+  function instead of a macro in order to work better with Clang.
+* Compatibility fixes with C++ 11 and various platforms.
+* Bug/warning fixes.
+
+Changes for 1.6.0:
+
+* New feature: ADD_FAILURE_AT() for reporting a test failure at the
+  given source location -- useful for writing testing utilities.
+* New feature: the universal value printer is moved from Google Mock
+  to Google Test.
+* New feature: type parameters and value parameters are reported in
+  the XML report now.
+* A gtest_disable_pthreads CMake option.
+* Colored output works in GNU Screen sessions now.
+* Parameters of value-parameterized tests are now printed in the
+  textual output.
+* Failures from ad hoc test assertions run before RUN_ALL_TESTS() are
+  now correctly reported.
+* Arguments of ASSERT_XY and EXPECT_XY no longer need to support << to
+  ostream.
+* More complete handling of exceptions.
+* GTEST_ASSERT_XY can be used instead of ASSERT_XY in case the latter
+  name is already used by another library.
+* --gtest_catch_exceptions is now true by default, allowing a test
+  program to continue after an exception is thrown.
+* Value-parameterized test fixtures can now derive from Test and
+  WithParamInterface<T> separately, easing conversion of legacy tests.
+* Death test messages are clearly marked to make them more
+  distinguishable from other messages.
+* Compatibility fixes for Android, Google Native Client, MinGW, HP UX,
+  PowerPC, Lucid autotools, libCStd, Sun C++, Borland C++ Builder (Code Gear),
+  IBM XL C++ (Visual Age C++), and C++0x.
+* Bug fixes and implementation clean-ups.
+* Potentially incompatible changes: disables the harmful 'make install'
+  command in autotools.
+
+Changes for 1.5.0:
+
+ * New feature: assertions can be safely called in multiple threads
+   where the pthreads library is available.
+ * New feature: predicates used inside EXPECT_TRUE() and friends
+   can now generate custom failure messages.
+ * New feature: Google Test can now be compiled as a DLL.
+ * New feature: fused source files are included.
+ * New feature: prints help when encountering unrecognized Google Test flags.
+ * Experimental feature: CMake build script (requires CMake 2.6.4+).
+ * Experimental feature: the Pump script for meta programming.
+ * double values streamed to an assertion are printed with enough precision
+   to differentiate any two different values.
+ * Google Test now works on Solaris and AIX.
+ * Build and test script improvements.
+ * Bug fixes and implementation clean-ups.
+
+ Potentially breaking changes:
+
+ * Stopped supporting VC++ 7.1 with exceptions disabled.
+ * Dropped support for 'make install'.
+
+Changes for 1.4.0:
+
+ * New feature: the event listener API
+ * New feature: test shuffling
+ * New feature: the XML report format is closer to junitreport and can
+   be parsed by Hudson now.
+ * New feature: when a test runs under Visual Studio, its failures are
+   integrated in the IDE.
+ * New feature: /MD(d) versions of VC++ projects.
+ * New feature: elapsed time for the tests is printed by default.
+ * New feature: comes with a TR1 tuple implementation such that Boost
+   is no longer needed for Combine().
+ * New feature: EXPECT_DEATH_IF_SUPPORTED macro and friends.
+ * New feature: the Xcode project can now produce static gtest
+   libraries in addition to a framework.
+ * Compatibility fixes for Solaris, Cygwin, minGW, Windows Mobile,
+   Symbian, gcc, and C++Builder.
+ * Bug fixes and implementation clean-ups.
+
+Changes for 1.3.0:
+
+ * New feature: death tests on Windows, Cygwin, and Mac.
+ * New feature: ability to use Google Test assertions in other testing
+   frameworks.
+ * New feature: ability to run disabled test via
+   --gtest_also_run_disabled_tests.
+ * New feature: the --help flag for printing the usage.
+ * New feature: access to Google Test flag values in user code.
+ * New feature: a script that packs Google Test into one .h and one
+   .cc file for easy deployment.
+ * New feature: support for distributing test functions to multiple
+   machines (requires support from the test runner).
+ * Bug fixes and implementation clean-ups.
+
+Changes for 1.2.1:
+
+ * Compatibility fixes for Linux IA-64 and IBM z/OS.
+ * Added support for using Boost and other TR1 implementations.
+ * Changes to the build scripts to support upcoming release of Google C++
+   Mocking Framework.
+ * Added Makefile to the distribution package.
+ * Improved build instructions in README.
+
+Changes for 1.2.0:
+
+ * New feature: value-parameterized tests.
+ * New feature: the ASSERT/EXPECT_(NON)FATAL_FAILURE(_ON_ALL_THREADS)
+   macros.
+ * Changed the XML report format to match JUnit/Ant's.
+ * Added tests to the Xcode project.
+ * Added scons/SConscript for building with SCons.
+ * Added src/gtest-all.cc for building Google Test from a single file.
+ * Fixed compatibility with Solaris and z/OS.
+ * Enabled running Python tests on systems with python 2.3 installed,
+   e.g. Mac OS X 10.4.
+ * Bug fixes.
+
+Changes for 1.1.0:
+
+ * New feature: type-parameterized tests.
+ * New feature: exception assertions.
+ * New feature: printing elapsed time of tests.
+ * Improved the robustness of death tests.
+ * Added an Xcode project and samples.
+ * Adjusted the output format on Windows to be understandable by Visual Studio.
+ * Minor bug fixes.
+
+Changes for 1.0.1:
+
+ * Added project files for Visual Studio 7.1.
+ * Fixed issues with compiling on Mac OS X.
+ * Fixed issues with compiling on Cygwin.
+
+Changes for 1.0.0:
+
+ * Initial Open Source release of Google Test
diff --git a/src/external/googletest/googletest/CMakeLists.txt b/src/external/googletest/googletest/CMakeLists.txt
new file mode 100644 (file)
index 0000000..621d0f0
--- /dev/null
@@ -0,0 +1,286 @@
+########################################################################
+# CMake build script for Google Test.
+#
+# To run the tests for Google Test itself on Linux, use 'make test' or
+# ctest.  You can select which tests to run using 'ctest -R regex'.
+# For more options, run 'ctest --help'.
+
+# BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to
+# make it prominent in the GUI.
+option(BUILD_SHARED_LIBS "Build shared libraries (DLLs)." OFF)
+
+# When other libraries are using a shared version of runtime libraries,
+# Google Test also has to use one.
+option(
+  gtest_force_shared_crt
+  "Use shared (DLL) run-time lib even when Google Test is built as static lib."
+  OFF)
+
+option(gtest_build_tests "Build all of gtest's own tests." OFF)
+
+option(gtest_build_samples "Build gtest's sample programs." OFF)
+
+option(gtest_disable_pthreads "Disable uses of pthreads in gtest." OFF)
+
+option(
+  gtest_hide_internal_symbols
+  "Build gtest with internal symbols hidden in shared libraries."
+  OFF)
+
+# Defines pre_project_set_up_hermetic_build() and set_up_hermetic_build().
+include(cmake/hermetic_build.cmake OPTIONAL)
+
+if (COMMAND pre_project_set_up_hermetic_build)
+  pre_project_set_up_hermetic_build()
+endif()
+
+########################################################################
+#
+# Project-wide settings
+
+# Name of the project.
+#
+# CMake files in this project can refer to the root source directory
+# as ${gtest_SOURCE_DIR} and to the root binary directory as
+# ${gtest_BINARY_DIR}.
+# Language "C" is required for find_package(Threads).
+project(gtest CXX C)
+cmake_minimum_required(VERSION 2.6.2)
+
+if (COMMAND set_up_hermetic_build)
+  set_up_hermetic_build()
+endif()
+
+if (gtest_hide_internal_symbols)
+  set(CMAKE_CXX_VISIBILITY_PRESET hidden)
+  set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
+endif()
+
+# Define helper functions and macros used by Google Test.
+include(cmake/internal_utils.cmake)
+
+config_compiler_and_linker()  # Defined in internal_utils.cmake.
+
+# Where Google Test's .h files can be found.
+include_directories(
+  ${gtest_SOURCE_DIR}/include
+  ${gtest_SOURCE_DIR})
+
+# Where Google Test's libraries can be found.
+link_directories(${gtest_BINARY_DIR}/src)
+
+# Summary of tuple support for Microsoft Visual Studio:
+# Compiler    version(MS)  version(cmake)  Support
+# ----------  -----------  --------------  -----------------------------
+# <= VS 2010  <= 10        <= 1600         Use Google Tests's own tuple.
+# VS 2012     11           1700            std::tr1::tuple + _VARIADIC_MAX=10
+# VS 2013     12           1800            std::tr1::tuple
+if (MSVC AND MSVC_VERSION EQUAL 1700)
+  add_definitions(/D _VARIADIC_MAX=10)
+endif()
+
+########################################################################
+#
+# Defines the gtest & gtest_main libraries.  User tests should link
+# with one of them.
+
+# Google Test libraries.  We build them using more strict warnings than what
+# are used for other targets, to ensure that gtest can be compiled by a user
+# aggressive about warnings.
+cxx_library(gtest "${cxx_strict}" src/gtest-all.cc)
+cxx_library(gtest_main "${cxx_strict}" src/gtest_main.cc)
+target_link_libraries(gtest_main gtest)
+
+# If the CMake version supports it, attach header directory information
+# to the targets for when we are part of a parent build (ie being pulled
+# in via add_subdirectory() rather than being a standalone build).
+if (DEFINED CMAKE_VERSION AND NOT "${CMAKE_VERSION}" VERSION_LESS "2.8.11")
+  target_include_directories(gtest      INTERFACE "${gtest_SOURCE_DIR}/include")
+  target_include_directories(gtest_main INTERFACE "${gtest_SOURCE_DIR}/include")
+endif()
+
+########################################################################
+#
+# Install rules
+install(TARGETS gtest gtest_main
+  DESTINATION lib)
+install(DIRECTORY ${gtest_SOURCE_DIR}/include/gtest
+  DESTINATION include)
+
+########################################################################
+#
+# Samples on how to link user tests with gtest or gtest_main.
+#
+# They are not built by default.  To build them, set the
+# gtest_build_samples option to ON.  You can do it by running ccmake
+# or specifying the -Dgtest_build_samples=ON flag when running cmake.
+
+if (gtest_build_samples)
+  cxx_executable(sample1_unittest samples gtest_main samples/sample1.cc)
+  cxx_executable(sample2_unittest samples gtest_main samples/sample2.cc)
+  cxx_executable(sample3_unittest samples gtest_main)
+  cxx_executable(sample4_unittest samples gtest_main samples/sample4.cc)
+  cxx_executable(sample5_unittest samples gtest_main samples/sample1.cc)
+  cxx_executable(sample6_unittest samples gtest_main)
+  cxx_executable(sample7_unittest samples gtest_main)
+  cxx_executable(sample8_unittest samples gtest_main)
+  cxx_executable(sample9_unittest samples gtest)
+  cxx_executable(sample10_unittest samples gtest)
+endif()
+
+########################################################################
+#
+# Google Test's own tests.
+#
+# You can skip this section if you aren't interested in testing
+# Google Test itself.
+#
+# The tests are not built by default.  To build them, set the
+# gtest_build_tests option to ON.  You can do it by running ccmake
+# or specifying the -Dgtest_build_tests=ON flag when running cmake.
+
+if (gtest_build_tests)
+  # This must be set in the root directory for the tests to be run by
+  # 'make test' or ctest.
+  enable_testing()
+
+  ############################################################
+  # C++ tests built with standard compiler flags.
+
+  cxx_test(gtest-death-test_test gtest_main)
+  cxx_test(gtest_environment_test gtest)
+  cxx_test(gtest-filepath_test gtest_main)
+  cxx_test(gtest-linked_ptr_test gtest_main)
+  cxx_test(gtest-listener_test gtest_main)
+  cxx_test(gtest_main_unittest gtest_main)
+  cxx_test(gtest-message_test gtest_main)
+  cxx_test(gtest_no_test_unittest gtest)
+  cxx_test(gtest-options_test gtest_main)
+  cxx_test(gtest-param-test_test gtest
+    test/gtest-param-test2_test.cc)
+  cxx_test(gtest-port_test gtest_main)
+  cxx_test(gtest_pred_impl_unittest gtest_main)
+  cxx_test(gtest_premature_exit_test gtest
+    test/gtest_premature_exit_test.cc)
+  cxx_test(gtest-printers_test gtest_main)
+  cxx_test(gtest_prod_test gtest_main
+    test/production.cc)
+  cxx_test(gtest_repeat_test gtest)
+  cxx_test(gtest_sole_header_test gtest_main)
+  cxx_test(gtest_stress_test gtest)
+  cxx_test(gtest-test-part_test gtest_main)
+  cxx_test(gtest_throw_on_failure_ex_test gtest)
+  cxx_test(gtest-typed-test_test gtest_main
+    test/gtest-typed-test2_test.cc)
+  cxx_test(gtest_unittest gtest_main)
+  cxx_test(gtest-unittest-api_test gtest)
+
+  ############################################################
+  # C++ tests built with non-standard compiler flags.
+
+  # MSVC 7.1 does not support STL with exceptions disabled.
+  if (NOT MSVC OR MSVC_VERSION GREATER 1310)
+    cxx_library(gtest_no_exception "${cxx_no_exception}"
+      src/gtest-all.cc)
+    cxx_library(gtest_main_no_exception "${cxx_no_exception}"
+      src/gtest-all.cc src/gtest_main.cc)
+  endif()
+  cxx_library(gtest_main_no_rtti "${cxx_no_rtti}"
+    src/gtest-all.cc src/gtest_main.cc)
+
+  cxx_test_with_flags(gtest-death-test_ex_nocatch_test
+    "${cxx_exception} -DGTEST_ENABLE_CATCH_EXCEPTIONS_=0"
+    gtest test/gtest-death-test_ex_test.cc)
+  cxx_test_with_flags(gtest-death-test_ex_catch_test
+    "${cxx_exception} -DGTEST_ENABLE_CATCH_EXCEPTIONS_=1"
+    gtest test/gtest-death-test_ex_test.cc)
+
+  cxx_test_with_flags(gtest_no_rtti_unittest "${cxx_no_rtti}"
+    gtest_main_no_rtti test/gtest_unittest.cc)
+
+  cxx_shared_library(gtest_dll "${cxx_default}"
+    src/gtest-all.cc src/gtest_main.cc)
+
+  cxx_executable_with_flags(gtest_dll_test_ "${cxx_default}"
+    gtest_dll test/gtest_all_test.cc)
+  set_target_properties(gtest_dll_test_
+                        PROPERTIES
+                        COMPILE_DEFINITIONS "GTEST_LINKED_AS_SHARED_LIBRARY=1")
+
+  if (NOT MSVC OR MSVC_VERSION LESS 1600)  # 1600 is Visual Studio 2010.
+    # Visual Studio 2010, 2012, and 2013 define symbols in std::tr1 that
+    # conflict with our own definitions. Therefore using our own tuple does not
+    # work on those compilers.
+    cxx_library(gtest_main_use_own_tuple "${cxx_use_own_tuple}"
+      src/gtest-all.cc src/gtest_main.cc)
+
+    cxx_test_with_flags(gtest-tuple_test "${cxx_use_own_tuple}"
+      gtest_main_use_own_tuple test/gtest-tuple_test.cc)
+
+    cxx_test_with_flags(gtest_use_own_tuple_test "${cxx_use_own_tuple}"
+      gtest_main_use_own_tuple
+      test/gtest-param-test_test.cc test/gtest-param-test2_test.cc)
+  endif()
+
+  ############################################################
+  # Python tests.
+
+  cxx_executable(gtest_break_on_failure_unittest_ test gtest)
+  py_test(gtest_break_on_failure_unittest)
+
+  # Visual Studio .NET 2003 does not support STL with exceptions disabled.
+  if (NOT MSVC OR MSVC_VERSION GREATER 1310)  # 1310 is Visual Studio .NET 2003
+    cxx_executable_with_flags(
+      gtest_catch_exceptions_no_ex_test_
+      "${cxx_no_exception}"
+      gtest_main_no_exception
+      test/gtest_catch_exceptions_test_.cc)
+  endif()
+
+  cxx_executable_with_flags(
+    gtest_catch_exceptions_ex_test_
+    "${cxx_exception}"
+    gtest_main
+    test/gtest_catch_exceptions_test_.cc)
+  py_test(gtest_catch_exceptions_test)
+
+  cxx_executable(gtest_color_test_ test gtest)
+  py_test(gtest_color_test)
+
+  cxx_executable(gtest_env_var_test_ test gtest)
+  py_test(gtest_env_var_test)
+
+  cxx_executable(gtest_filter_unittest_ test gtest)
+  py_test(gtest_filter_unittest)
+
+  cxx_executable(gtest_help_test_ test gtest_main)
+  py_test(gtest_help_test)
+
+  cxx_executable(gtest_list_tests_unittest_ test gtest)
+  py_test(gtest_list_tests_unittest)
+
+  cxx_executable(gtest_output_test_ test gtest)
+  py_test(gtest_output_test)
+
+  cxx_executable(gtest_shuffle_test_ test gtest)
+  py_test(gtest_shuffle_test)
+
+  # MSVC 7.1 does not support STL with exceptions disabled.
+  if (NOT MSVC OR MSVC_VERSION GREATER 1310)
+    cxx_executable(gtest_throw_on_failure_test_ test gtest_no_exception)
+    set_target_properties(gtest_throw_on_failure_test_
+      PROPERTIES
+      COMPILE_FLAGS "${cxx_no_exception}")
+    py_test(gtest_throw_on_failure_test)
+  endif()
+
+  cxx_executable(gtest_uninitialized_test_ test gtest)
+  py_test(gtest_uninitialized_test)
+
+  cxx_executable(gtest_xml_outfile1_test_ test gtest_main)
+  cxx_executable(gtest_xml_outfile2_test_ test gtest_main)
+  py_test(gtest_xml_outfiles_test)
+
+  cxx_executable(gtest_xml_output_unittest_ test gtest)
+  py_test(gtest_xml_output_unittest)
+endif()
diff --git a/src/external/googletest/googletest/CONTRIBUTORS b/src/external/googletest/googletest/CONTRIBUTORS
new file mode 100644 (file)
index 0000000..feae2fc
--- /dev/null
@@ -0,0 +1,37 @@
+# This file contains a list of people who've made non-trivial
+# contribution to the Google C++ Testing Framework project.  People
+# who commit code to the project are encouraged to add their names
+# here.  Please keep the list sorted by first names.
+
+Ajay Joshi <jaj@google.com>
+Balázs Dán <balazs.dan@gmail.com>
+Bharat Mediratta <bharat@menalto.com>
+Chandler Carruth <chandlerc@google.com>
+Chris Prince <cprince@google.com>
+Chris Taylor <taylorc@google.com>
+Dan Egnor <egnor@google.com>
+Eric Roman <eroman@chromium.org>
+Hady Zalek <hady.zalek@gmail.com>
+Jeffrey Yasskin <jyasskin@google.com>
+Jói Sigurðsson <joi@google.com>
+Keir Mierle <mierle@gmail.com>
+Keith Ray <keith.ray@gmail.com>
+Kenton Varda <kenton@google.com>
+Manuel Klimek <klimek@google.com>
+Markus Heule <markus.heule@gmail.com>
+Mika Raento <mikie@iki.fi>
+Miklós Fazekas <mfazekas@szemafor.com>
+Pasi Valminen <pasi.valminen@gmail.com>
+Patrick Hanna <phanna@google.com>
+Patrick Riley <pfr@google.com>
+Peter Kaminski <piotrk@google.com>
+Preston Jackson <preston.a.jackson@gmail.com>
+Rainer Klaffenboeck <rainer.klaffenboeck@dynatrace.com>
+Russ Cox <rsc@google.com>
+Russ Rufer <russ@pentad.com>
+Sean Mcafee <eefacm@gmail.com>
+Sigurður Ásgeirsson <siggi@google.com>
+Tracy Bialik <tracy@pentad.com>
+Vadim Berman <vadimb@google.com>
+Vlad Losev <vladl@google.com>
+Zhanyong Wan <wan@google.com>
diff --git a/src/external/googletest/googletest/README.md b/src/external/googletest/googletest/README.md
new file mode 100644 (file)
index 0000000..edd4408
--- /dev/null
@@ -0,0 +1,280 @@
+
+### Generic Build Instructions ###
+
+#### Setup ####
+
+To build Google Test and your tests that use it, you need to tell your
+build system where to find its headers and source files.  The exact
+way to do it depends on which build system you use, and is usually
+straightforward.
+
+#### Build ####
+
+Suppose you put Google Test in directory `${GTEST_DIR}`.  To build it,
+create a library build target (or a project as called by Visual Studio
+and Xcode) to compile
+
+    ${GTEST_DIR}/src/gtest-all.cc
+
+with `${GTEST_DIR}/include` in the system header search path and `${GTEST_DIR}`
+in the normal header search path.  Assuming a Linux-like system and gcc,
+something like the following will do:
+
+    g++ -isystem ${GTEST_DIR}/include -I${GTEST_DIR} \
+        -pthread -c ${GTEST_DIR}/src/gtest-all.cc
+    ar -rv libgtest.a gtest-all.o
+
+(We need `-pthread` as Google Test uses threads.)
+
+Next, you should compile your test source file with
+`${GTEST_DIR}/include` in the system header search path, and link it
+with gtest and any other necessary libraries:
+
+    g++ -isystem ${GTEST_DIR}/include -pthread path/to/your_test.cc libgtest.a \
+        -o your_test
+
+As an example, the make/ directory contains a Makefile that you can
+use to build Google Test on systems where GNU make is available
+(e.g. Linux, Mac OS X, and Cygwin).  It doesn't try to build Google
+Test's own tests.  Instead, it just builds the Google Test library and
+a sample test.  You can use it as a starting point for your own build
+script.
+
+If the default settings are correct for your environment, the
+following commands should succeed:
+
+    cd ${GTEST_DIR}/make
+    make
+    ./sample1_unittest
+
+If you see errors, try to tweak the contents of `make/Makefile` to make
+them go away.  There are instructions in `make/Makefile` on how to do
+it.
+
+### Using CMake ###
+
+Google Test comes with a CMake build script (
+[CMakeLists.txt](CMakeLists.txt)) that can be used on a wide range of platforms ("C" stands for
+cross-platform.). If you don't have CMake installed already, you can
+download it for free from <http://www.cmake.org/>.
+
+CMake works by generating native makefiles or build projects that can
+be used in the compiler environment of your choice.  The typical
+workflow starts with:
+
+    mkdir mybuild       # Create a directory to hold the build output.
+    cd mybuild
+    cmake ${GTEST_DIR}  # Generate native build scripts.
+
+If you want to build Google Test's samples, you should replace the
+last command with
+
+    cmake -Dgtest_build_samples=ON ${GTEST_DIR}
+
+If you are on a \*nix system, you should now see a Makefile in the
+current directory.  Just type 'make' to build gtest.
+
+If you use Windows and have Visual Studio installed, a `gtest.sln` file
+and several `.vcproj` files will be created.  You can then build them
+using Visual Studio.
+
+On Mac OS X with Xcode installed, a `.xcodeproj` file will be generated.
+
+### Legacy Build Scripts ###
+
+Before settling on CMake, we have been providing hand-maintained build
+projects/scripts for Visual Studio, Xcode, and Autotools.  While we
+continue to provide them for convenience, they are not actively
+maintained any more.  We highly recommend that you follow the
+instructions in the previous two sections to integrate Google Test
+with your existing build system.
+
+If you still need to use the legacy build scripts, here's how:
+
+The msvc\ folder contains two solutions with Visual C++ projects.
+Open the `gtest.sln` or `gtest-md.sln` file using Visual Studio, and you
+are ready to build Google Test the same way you build any Visual
+Studio project.  Files that have names ending with -md use DLL
+versions of Microsoft runtime libraries (the /MD or the /MDd compiler
+option).  Files without that suffix use static versions of the runtime
+libraries (the /MT or the /MTd option).  Please note that one must use
+the same option to compile both gtest and the test code.  If you use
+Visual Studio 2005 or above, we recommend the -md version as /MD is
+the default for new projects in these versions of Visual Studio.
+
+On Mac OS X, open the `gtest.xcodeproj` in the `xcode/` folder using
+Xcode.  Build the "gtest" target.  The universal binary framework will
+end up in your selected build directory (selected in the Xcode
+"Preferences..." -> "Building" pane and defaults to xcode/build).
+Alternatively, at the command line, enter:
+
+    xcodebuild
+
+This will build the "Release" configuration of gtest.framework in your
+default build location.  See the "xcodebuild" man page for more
+information about building different configurations and building in
+different locations.
+
+If you wish to use the Google Test Xcode project with Xcode 4.x and
+above, you need to either:
+
+ * update the SDK configuration options in xcode/Config/General.xconfig.
+   Comment options `SDKROOT`, `MACOS_DEPLOYMENT_TARGET`, and `GCC_VERSION`. If
+   you choose this route you lose the ability to target earlier versions
+   of MacOS X.
+ * Install an SDK for an earlier version. This doesn't appear to be
+   supported by Apple, but has been reported to work
+   (http://stackoverflow.com/questions/5378518).
+
+### Tweaking Google Test ###
+
+Google Test can be used in diverse environments.  The default
+configuration may not work (or may not work well) out of the box in
+some environments.  However, you can easily tweak Google Test by
+defining control macros on the compiler command line.  Generally,
+these macros are named like `GTEST_XYZ` and you define them to either 1
+or 0 to enable or disable a certain feature.
+
+We list the most frequently used macros below.  For a complete list,
+see file [include/gtest/internal/gtest-port.h](include/gtest/internal/gtest-port.h).
+
+### Choosing a TR1 Tuple Library ###
+
+Some Google Test features require the C++ Technical Report 1 (TR1)
+tuple library, which is not yet available with all compilers.  The
+good news is that Google Test implements a subset of TR1 tuple that's
+enough for its own need, and will automatically use this when the
+compiler doesn't provide TR1 tuple.
+
+Usually you don't need to care about which tuple library Google Test
+uses.  However, if your project already uses TR1 tuple, you need to
+tell Google Test to use the same TR1 tuple library the rest of your
+project uses, or the two tuple implementations will clash.  To do
+that, add
+
+    -DGTEST_USE_OWN_TR1_TUPLE=0
+
+to the compiler flags while compiling Google Test and your tests.  If
+you want to force Google Test to use its own tuple library, just add
+
+    -DGTEST_USE_OWN_TR1_TUPLE=1
+
+to the compiler flags instead.
+
+If you don't want Google Test to use tuple at all, add
+
+    -DGTEST_HAS_TR1_TUPLE=0
+
+and all features using tuple will be disabled.
+
+### Multi-threaded Tests ###
+
+Google Test is thread-safe where the pthread library is available.
+After `#include "gtest/gtest.h"`, you can check the `GTEST_IS_THREADSAFE`
+macro to see whether this is the case (yes if the macro is `#defined` to
+1, no if it's undefined.).
+
+If Google Test doesn't correctly detect whether pthread is available
+in your environment, you can force it with
+
+    -DGTEST_HAS_PTHREAD=1
+
+or
+
+    -DGTEST_HAS_PTHREAD=0
+
+When Google Test uses pthread, you may need to add flags to your
+compiler and/or linker to select the pthread library, or you'll get
+link errors.  If you use the CMake script or the deprecated Autotools
+script, this is taken care of for you.  If you use your own build
+script, you'll need to read your compiler and linker's manual to
+figure out what flags to add.
+
+### As a Shared Library (DLL) ###
+
+Google Test is compact, so most users can build and link it as a
+static library for the simplicity.  You can choose to use Google Test
+as a shared library (known as a DLL on Windows) if you prefer.
+
+To compile *gtest* as a shared library, add
+
+    -DGTEST_CREATE_SHARED_LIBRARY=1
+
+to the compiler flags.  You'll also need to tell the linker to produce
+a shared library instead - consult your linker's manual for how to do
+it.
+
+To compile your *tests* that use the gtest shared library, add
+
+    -DGTEST_LINKED_AS_SHARED_LIBRARY=1
+
+to the compiler flags.
+
+Note: while the above steps aren't technically necessary today when
+using some compilers (e.g. GCC), they may become necessary in the
+future, if we decide to improve the speed of loading the library (see
+<http://gcc.gnu.org/wiki/Visibility> for details).  Therefore you are
+recommended to always add the above flags when using Google Test as a
+shared library.  Otherwise a future release of Google Test may break
+your build script.
+
+### Avoiding Macro Name Clashes ###
+
+In C++, macros don't obey namespaces.  Therefore two libraries that
+both define a macro of the same name will clash if you `#include` both
+definitions.  In case a Google Test macro clashes with another
+library, you can force Google Test to rename its macro to avoid the
+conflict.
+
+Specifically, if both Google Test and some other code define macro
+FOO, you can add
+
+    -DGTEST_DONT_DEFINE_FOO=1
+
+to the compiler flags to tell Google Test to change the macro's name
+from `FOO` to `GTEST_FOO`.  Currently `FOO` can be `FAIL`, `SUCCEED`,
+or `TEST`.  For example, with `-DGTEST_DONT_DEFINE_TEST=1`, you'll
+need to write
+
+    GTEST_TEST(SomeTest, DoesThis) { ... }
+
+instead of
+
+    TEST(SomeTest, DoesThis) { ... }
+
+in order to define a test.
+
+## Developing Google Test ##
+
+This section discusses how to make your own changes to Google Test.
+
+### Testing Google Test Itself ###
+
+To make sure your changes work as intended and don't break existing
+functionality, you'll want to compile and run Google Test's own tests.
+For that you can use CMake:
+
+    mkdir mybuild
+    cd mybuild
+    cmake -Dgtest_build_tests=ON ${GTEST_DIR}
+
+Make sure you have Python installed, as some of Google Test's tests
+are written in Python.  If the cmake command complains about not being
+able to find Python (`Could NOT find PythonInterp (missing:
+PYTHON_EXECUTABLE)`), try telling it explicitly where your Python
+executable can be found:
+
+    cmake -DPYTHON_EXECUTABLE=path/to/python -Dgtest_build_tests=ON ${GTEST_DIR}
+
+Next, you can build Google Test and all of its own tests.  On \*nix,
+this is usually done by 'make'.  To run the tests, do
+
+    make test
+
+All tests should pass.
+
+Normally you don't need to worry about regenerating the source files,
+unless you need to modify them.  In that case, you should modify the
+corresponding .pump files instead and run the pump.py Python script to
+regenerate them.  You can find pump.py in the [scripts/](scripts/) directory.
+Read the [Pump manual](docs/PumpManual.md) for how to use it.
diff --git a/src/external/googletest/googletest/docs/AdvancedGuide.md b/src/external/googletest/googletest/docs/AdvancedGuide.md
new file mode 100644 (file)
index 0000000..93a6520
--- /dev/null
@@ -0,0 +1,2182 @@
+
+
+Now that you have read [Primer](Primer.md) and learned how to write tests
+using Google Test, it's time to learn some new tricks. This document
+will show you more assertions as well as how to construct complex
+failure messages, propagate fatal failures, reuse and speed up your
+test fixtures, and use various flags with your tests.
+
+# More Assertions #
+
+This section covers some less frequently used, but still significant,
+assertions.
+
+## Explicit Success and Failure ##
+
+These three assertions do not actually test a value or expression. Instead,
+they generate a success or failure directly. Like the macros that actually
+perform a test, you may stream a custom failure message into the them.
+
+| `SUCCEED();` |
+|:-------------|
+
+Generates a success. This does NOT make the overall test succeed. A test is
+considered successful only if none of its assertions fail during its execution.
+
+Note: `SUCCEED()` is purely documentary and currently doesn't generate any
+user-visible output. However, we may add `SUCCEED()` messages to Google Test's
+output in the future.
+
+| `FAIL();`  | `ADD_FAILURE();` | `ADD_FAILURE_AT("`_file\_path_`", `_line\_number_`);` |
+|:-----------|:-----------------|:------------------------------------------------------|
+
+`FAIL()` generates a fatal failure, while `ADD_FAILURE()` and `ADD_FAILURE_AT()` generate a nonfatal
+failure. These are useful when control flow, rather than a Boolean expression,
+deteremines the test's success or failure. For example, you might want to write
+something like:
+
+```
+switch(expression) {
+  case 1: ... some checks ...
+  case 2: ... some other checks
+  ...
+  default: FAIL() << "We shouldn't get here.";
+}
+```
+
+Note: you can only use `FAIL()` in functions that return `void`. See the [Assertion Placement section](#assertion-placement) for more information.
+
+_Availability_: Linux, Windows, Mac.
+
+## Exception Assertions ##
+
+These are for verifying that a piece of code throws (or does not
+throw) an exception of the given type:
+
+| **Fatal assertion** | **Nonfatal assertion** | **Verifies** |
+|:--------------------|:-----------------------|:-------------|
+| `ASSERT_THROW(`_statement_, _exception\_type_`);`  | `EXPECT_THROW(`_statement_, _exception\_type_`);`  | _statement_ throws an exception of the given type  |
+| `ASSERT_ANY_THROW(`_statement_`);`                | `EXPECT_ANY_THROW(`_statement_`);`                | _statement_ throws an exception of any type        |
+| `ASSERT_NO_THROW(`_statement_`);`                 | `EXPECT_NO_THROW(`_statement_`);`                 | _statement_ doesn't throw any exception            |
+
+Examples:
+
+```
+ASSERT_THROW(Foo(5), bar_exception);
+
+EXPECT_NO_THROW({
+  int n = 5;
+  Bar(&n);
+});
+```
+
+_Availability_: Linux, Windows, Mac; since version 1.1.0.
+
+## Predicate Assertions for Better Error Messages ##
+
+Even though Google Test has a rich set of assertions, they can never be
+complete, as it's impossible (nor a good idea) to anticipate all the scenarios
+a user might run into. Therefore, sometimes a user has to use `EXPECT_TRUE()`
+to check a complex expression, for lack of a better macro. This has the problem
+of not showing you the values of the parts of the expression, making it hard to
+understand what went wrong. As a workaround, some users choose to construct the
+failure message by themselves, streaming it into `EXPECT_TRUE()`. However, this
+is awkward especially when the expression has side-effects or is expensive to
+evaluate.
+
+Google Test gives you three different options to solve this problem:
+
+### Using an Existing Boolean Function ###
+
+If you already have a function or a functor that returns `bool` (or a type
+that can be implicitly converted to `bool`), you can use it in a _predicate
+assertion_ to get the function arguments printed for free:
+
+| **Fatal assertion** | **Nonfatal assertion** | **Verifies** |
+|:--------------------|:-----------------------|:-------------|
+| `ASSERT_PRED1(`_pred1, val1_`);`       | `EXPECT_PRED1(`_pred1, val1_`);` | _pred1(val1)_ returns true |
+| `ASSERT_PRED2(`_pred2, val1, val2_`);` | `EXPECT_PRED2(`_pred2, val1, val2_`);` |  _pred2(val1, val2)_ returns true |
+|  ...                | ...                    | ...          |
+
+In the above, _predn_ is an _n_-ary predicate function or functor, where
+_val1_, _val2_, ..., and _valn_ are its arguments. The assertion succeeds
+if the predicate returns `true` when applied to the given arguments, and fails
+otherwise. When the assertion fails, it prints the value of each argument. In
+either case, the arguments are evaluated exactly once.
+
+Here's an example. Given
+
+```
+// Returns true iff m and n have no common divisors except 1.
+bool MutuallyPrime(int m, int n) { ... }
+const int a = 3;
+const int b = 4;
+const int c = 10;
+```
+
+the assertion `EXPECT_PRED2(MutuallyPrime, a, b);` will succeed, while the
+assertion `EXPECT_PRED2(MutuallyPrime, b, c);` will fail with the message
+
+<pre>
+!MutuallyPrime(b, c) is false, where<br>
+b is 4<br>
+c is 10<br>
+</pre>
+
+**Notes:**
+
+  1. If you see a compiler error "no matching function to call" when using `ASSERT_PRED*` or `EXPECT_PRED*`, please see [this FAQ](FAQ.md#the-compiler-complains-no-matching-function-to-call-when-i-use-assert_predn-how-do-i-fix-it) for how to resolve it.
+  1. Currently we only provide predicate assertions of arity <= 5. If you need a higher-arity assertion, let us know.
+
+_Availability_: Linux, Windows, Mac
+
+### Using a Function That Returns an AssertionResult ###
+
+While `EXPECT_PRED*()` and friends are handy for a quick job, the
+syntax is not satisfactory: you have to use different macros for
+different arities, and it feels more like Lisp than C++.  The
+`::testing::AssertionResult` class solves this problem.
+
+An `AssertionResult` object represents the result of an assertion
+(whether it's a success or a failure, and an associated message).  You
+can create an `AssertionResult` using one of these factory
+functions:
+
+```
+namespace testing {
+
+// Returns an AssertionResult object to indicate that an assertion has
+// succeeded.
+AssertionResult AssertionSuccess();
+
+// Returns an AssertionResult object to indicate that an assertion has
+// failed.
+AssertionResult AssertionFailure();
+
+}
+```
+
+You can then use the `<<` operator to stream messages to the
+`AssertionResult` object.
+
+To provide more readable messages in Boolean assertions
+(e.g. `EXPECT_TRUE()`), write a predicate function that returns
+`AssertionResult` instead of `bool`. For example, if you define
+`IsEven()` as:
+
+```
+::testing::AssertionResult IsEven(int n) {
+  if ((n % 2) == 0)
+    return ::testing::AssertionSuccess();
+  else
+    return ::testing::AssertionFailure() << n << " is odd";
+}
+```
+
+instead of:
+
+```
+bool IsEven(int n) {
+  return (n % 2) == 0;
+}
+```
+
+the failed assertion `EXPECT_TRUE(IsEven(Fib(4)))` will print:
+
+<pre>
+Value of: IsEven(Fib(4))<br>
+Actual: false (*3 is odd*)<br>
+Expected: true<br>
+</pre>
+
+instead of a more opaque
+
+<pre>
+Value of: IsEven(Fib(4))<br>
+Actual: false<br>
+Expected: true<br>
+</pre>
+
+If you want informative messages in `EXPECT_FALSE` and `ASSERT_FALSE`
+as well, and are fine with making the predicate slower in the success
+case, you can supply a success message:
+
+```
+::testing::AssertionResult IsEven(int n) {
+  if ((n % 2) == 0)
+    return ::testing::AssertionSuccess() << n << " is even";
+  else
+    return ::testing::AssertionFailure() << n << " is odd";
+}
+```
+
+Then the statement `EXPECT_FALSE(IsEven(Fib(6)))` will print
+
+<pre>
+Value of: IsEven(Fib(6))<br>
+Actual: true (8 is even)<br>
+Expected: false<br>
+</pre>
+
+_Availability_: Linux, Windows, Mac; since version 1.4.1.
+
+### Using a Predicate-Formatter ###
+
+If you find the default message generated by `(ASSERT|EXPECT)_PRED*` and
+`(ASSERT|EXPECT)_(TRUE|FALSE)` unsatisfactory, or some arguments to your
+predicate do not support streaming to `ostream`, you can instead use the
+following _predicate-formatter assertions_ to _fully_ customize how the
+message is formatted:
+
+| **Fatal assertion** | **Nonfatal assertion** | **Verifies** |
+|:--------------------|:-----------------------|:-------------|
+| `ASSERT_PRED_FORMAT1(`_pred\_format1, val1_`);`        | `EXPECT_PRED_FORMAT1(`_pred\_format1, val1_`);` | _pred\_format1(val1)_ is successful |
+| `ASSERT_PRED_FORMAT2(`_pred\_format2, val1, val2_`);` | `EXPECT_PRED_FORMAT2(`_pred\_format2, val1, val2_`);` | _pred\_format2(val1, val2)_ is successful |
+| `...`               | `...`                  | `...`        |
+
+The difference between this and the previous two groups of macros is that instead of
+a predicate, `(ASSERT|EXPECT)_PRED_FORMAT*` take a _predicate-formatter_
+(_pred\_formatn_), which is a function or functor with the signature:
+
+`::testing::AssertionResult PredicateFormattern(const char* `_expr1_`, const char* `_expr2_`, ... const char* `_exprn_`, T1 `_val1_`, T2 `_val2_`, ... Tn `_valn_`);`
+
+where _val1_, _val2_, ..., and _valn_ are the values of the predicate
+arguments, and _expr1_, _expr2_, ..., and _exprn_ are the corresponding
+expressions as they appear in the source code. The types `T1`, `T2`, ..., and
+`Tn` can be either value types or reference types. For example, if an
+argument has type `Foo`, you can declare it as either `Foo` or `const Foo&`,
+whichever is appropriate.
+
+A predicate-formatter returns a `::testing::AssertionResult` object to indicate
+whether the assertion has succeeded or not. The only way to create such an
+object is to call one of these factory functions:
+
+As an example, let's improve the failure message in the previous example, which uses `EXPECT_PRED2()`:
+
+```
+// Returns the smallest prime common divisor of m and n,
+// or 1 when m and n are mutually prime.
+int SmallestPrimeCommonDivisor(int m, int n) { ... }
+
+// A predicate-formatter for asserting that two integers are mutually prime.
+::testing::AssertionResult AssertMutuallyPrime(const char* m_expr,
+                                               const char* n_expr,
+                                               int m,
+                                               int n) {
+  if (MutuallyPrime(m, n))
+    return ::testing::AssertionSuccess();
+
+  return ::testing::AssertionFailure()
+      << m_expr << " and " << n_expr << " (" << m << " and " << n
+      << ") are not mutually prime, " << "as they have a common divisor "
+      << SmallestPrimeCommonDivisor(m, n);
+}
+```
+
+With this predicate-formatter, we can use
+
+```
+EXPECT_PRED_FORMAT2(AssertMutuallyPrime, b, c);
+```
+
+to generate the message
+
+<pre>
+b and c (4 and 10) are not mutually prime, as they have a common divisor 2.<br>
+</pre>
+
+As you may have realized, many of the assertions we introduced earlier are
+special cases of `(EXPECT|ASSERT)_PRED_FORMAT*`. In fact, most of them are
+indeed defined using `(EXPECT|ASSERT)_PRED_FORMAT*`.
+
+_Availability_: Linux, Windows, Mac.
+
+
+## Floating-Point Comparison ##
+
+Comparing floating-point numbers is tricky. Due to round-off errors, it is
+very unlikely that two floating-points will match exactly. Therefore,
+`ASSERT_EQ` 's naive comparison usually doesn't work. And since floating-points
+can have a wide value range, no single fixed error bound works. It's better to
+compare by a fixed relative error bound, except for values close to 0 due to
+the loss of precision there.
+
+In general, for floating-point comparison to make sense, the user needs to
+carefully choose the error bound. If they don't want or care to, comparing in
+terms of Units in the Last Place (ULPs) is a good default, and Google Test
+provides assertions to do this. Full details about ULPs are quite long; if you
+want to learn more, see
+[this article on float comparison](http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm).
+
+### Floating-Point Macros ###
+
+| **Fatal assertion** | **Nonfatal assertion** | **Verifies** |
+|:--------------------|:-----------------------|:-------------|
+| `ASSERT_FLOAT_EQ(`_val1, val2_`);`  | `EXPECT_FLOAT_EQ(`_val1, val2_`);` | the two `float` values are almost equal |
+| `ASSERT_DOUBLE_EQ(`_val1, val2_`);` | `EXPECT_DOUBLE_EQ(`_val1, val2_`);` | the two `double` values are almost equal |
+
+By "almost equal", we mean the two values are within 4 ULP's from each
+other.
+
+The following assertions allow you to choose the acceptable error bound:
+
+| **Fatal assertion** | **Nonfatal assertion** | **Verifies** |
+|:--------------------|:-----------------------|:-------------|
+| `ASSERT_NEAR(`_val1, val2, abs\_error_`);` | `EXPECT_NEAR`_(val1, val2, abs\_error_`);` | the difference between _val1_ and _val2_ doesn't exceed the given absolute error |
+
+_Availability_: Linux, Windows, Mac.
+
+### Floating-Point Predicate-Format Functions ###
+
+Some floating-point operations are useful, but not that often used. In order
+to avoid an explosion of new macros, we provide them as predicate-format
+functions that can be used in predicate assertion macros (e.g.
+`EXPECT_PRED_FORMAT2`, etc).
+
+```
+EXPECT_PRED_FORMAT2(::testing::FloatLE, val1, val2);
+EXPECT_PRED_FORMAT2(::testing::DoubleLE, val1, val2);
+```
+
+Verifies that _val1_ is less than, or almost equal to, _val2_. You can
+replace `EXPECT_PRED_FORMAT2` in the above table with `ASSERT_PRED_FORMAT2`.
+
+_Availability_: Linux, Windows, Mac.
+
+## Windows HRESULT assertions ##
+
+These assertions test for `HRESULT` success or failure.
+
+| **Fatal assertion** | **Nonfatal assertion** | **Verifies** |
+|:--------------------|:-----------------------|:-------------|
+| `ASSERT_HRESULT_SUCCEEDED(`_expression_`);` | `EXPECT_HRESULT_SUCCEEDED(`_expression_`);` | _expression_ is a success `HRESULT` |
+| `ASSERT_HRESULT_FAILED(`_expression_`);`    | `EXPECT_HRESULT_FAILED(`_expression_`);`    | _expression_ is a failure `HRESULT` |
+
+The generated output contains the human-readable error message
+associated with the `HRESULT` code returned by _expression_.
+
+You might use them like this:
+
+```
+CComPtr shell;
+ASSERT_HRESULT_SUCCEEDED(shell.CoCreateInstance(L"Shell.Application"));
+CComVariant empty;
+ASSERT_HRESULT_SUCCEEDED(shell->ShellExecute(CComBSTR(url), empty, empty, empty, empty));
+```
+
+_Availability_: Windows.
+
+## Type Assertions ##
+
+You can call the function
+```
+::testing::StaticAssertTypeEq<T1, T2>();
+```
+to assert that types `T1` and `T2` are the same.  The function does
+nothing if the assertion is satisfied.  If the types are different,
+the function call will fail to compile, and the compiler error message
+will likely (depending on the compiler) show you the actual values of
+`T1` and `T2`.  This is mainly useful inside template code.
+
+_Caveat:_ When used inside a member function of a class template or a
+function template, `StaticAssertTypeEq<T1, T2>()` is effective _only if_
+the function is instantiated.  For example, given:
+```
+template <typename T> class Foo {
+ public:
+  void Bar() { ::testing::StaticAssertTypeEq<int, T>(); }
+};
+```
+the code:
+```
+void Test1() { Foo<bool> foo; }
+```
+will _not_ generate a compiler error, as `Foo<bool>::Bar()` is never
+actually instantiated.  Instead, you need:
+```
+void Test2() { Foo<bool> foo; foo.Bar(); }
+```
+to cause a compiler error.
+
+_Availability:_ Linux, Windows, Mac; since version 1.3.0.
+
+## Assertion Placement ##
+
+You can use assertions in any C++ function. In particular, it doesn't
+have to be a method of the test fixture class. The one constraint is
+that assertions that generate a fatal failure (`FAIL*` and `ASSERT_*`)
+can only be used in void-returning functions. This is a consequence of
+Google Test not using exceptions. By placing it in a non-void function
+you'll get a confusing compile error like
+`"error: void value not ignored as it ought to be"`.
+
+If you need to use assertions in a function that returns non-void, one option
+is to make the function return the value in an out parameter instead. For
+example, you can rewrite `T2 Foo(T1 x)` to `void Foo(T1 x, T2* result)`. You
+need to make sure that `*result` contains some sensible value even when the
+function returns prematurely. As the function now returns `void`, you can use
+any assertion inside of it.
+
+If changing the function's type is not an option, you should just use
+assertions that generate non-fatal failures, such as `ADD_FAILURE*` and
+`EXPECT_*`.
+
+_Note_: Constructors and destructors are not considered void-returning
+functions, according to the C++ language specification, and so you may not use
+fatal assertions in them. You'll get a compilation error if you try. A simple
+workaround is to transfer the entire body of the constructor or destructor to a
+private void-returning method. However, you should be aware that a fatal
+assertion failure in a constructor does not terminate the current test, as your
+intuition might suggest; it merely returns from the constructor early, possibly
+leaving your object in a partially-constructed state. Likewise, a fatal
+assertion failure in a destructor may leave your object in a
+partially-destructed state. Use assertions carefully in these situations!
+
+# Teaching Google Test How to Print Your Values #
+
+When a test assertion such as `EXPECT_EQ` fails, Google Test prints the
+argument values to help you debug.  It does this using a
+user-extensible value printer.
+
+This printer knows how to print built-in C++ types, native arrays, STL
+containers, and any type that supports the `<<` operator.  For other
+types, it prints the raw bytes in the value and hopes that you the
+user can figure it out.
+
+As mentioned earlier, the printer is _extensible_.  That means
+you can teach it to do a better job at printing your particular type
+than to dump the bytes.  To do that, define `<<` for your type:
+
+```
+#include <iostream>
+
+namespace foo {
+
+class Bar { ... };  // We want Google Test to be able to print instances of this.
+
+// It's important that the << operator is defined in the SAME
+// namespace that defines Bar.  C++'s look-up rules rely on that.
+::std::ostream& operator<<(::std::ostream& os, const Bar& bar) {
+  return os << bar.DebugString();  // whatever needed to print bar to os
+}
+
+}  // namespace foo
+```
+
+Sometimes, this might not be an option: your team may consider it bad
+style to have a `<<` operator for `Bar`, or `Bar` may already have a
+`<<` operator that doesn't do what you want (and you cannot change
+it).  If so, you can instead define a `PrintTo()` function like this:
+
+```
+#include <iostream>
+
+namespace foo {
+
+class Bar { ... };
+
+// It's important that PrintTo() is defined in the SAME
+// namespace that defines Bar.  C++'s look-up rules rely on that.
+void PrintTo(const Bar& bar, ::std::ostream* os) {
+  *os << bar.DebugString();  // whatever needed to print bar to os
+}
+
+}  // namespace foo
+```
+
+If you have defined both `<<` and `PrintTo()`, the latter will be used
+when Google Test is concerned.  This allows you to customize how the value
+appears in Google Test's output without affecting code that relies on the
+behavior of its `<<` operator.
+
+If you want to print a value `x` using Google Test's value printer
+yourself, just call `::testing::PrintToString(`_x_`)`, which
+returns an `std::string`:
+
+```
+vector<pair<Bar, int> > bar_ints = GetBarIntVector();
+
+EXPECT_TRUE(IsCorrectBarIntVector(bar_ints))
+    << "bar_ints = " << ::testing::PrintToString(bar_ints);
+```
+
+# Death Tests #
+
+In many applications, there are assertions that can cause application failure
+if a condition is not met. These sanity checks, which ensure that the program
+is in a known good state, are there to fail at the earliest possible time after
+some program state is corrupted. If the assertion checks the wrong condition,
+then the program may proceed in an erroneous state, which could lead to memory
+corruption, security holes, or worse. Hence it is vitally important to test
+that such assertion statements work as expected.
+
+Since these precondition checks cause the processes to die, we call such tests
+_death tests_. More generally, any test that checks that a program terminates
+(except by throwing an exception) in an expected fashion is also a death test.
+
+Note that if a piece of code throws an exception, we don't consider it "death"
+for the purpose of death tests, as the caller of the code could catch the exception
+and avoid the crash. If you want to verify exceptions thrown by your code,
+see [Exception Assertions](#exception-assertions).
+
+If you want to test `EXPECT_*()/ASSERT_*()` failures in your test code, see [Catching Failures](#catching-failures).
+
+## How to Write a Death Test ##
+
+Google Test has the following macros to support death tests:
+
+| **Fatal assertion** | **Nonfatal assertion** | **Verifies** |
+|:--------------------|:-----------------------|:-------------|
+| `ASSERT_DEATH(`_statement, regex_`);` | `EXPECT_DEATH(`_statement, regex_`);` | _statement_ crashes with the given error |
+| `ASSERT_DEATH_IF_SUPPORTED(`_statement, regex_`);` | `EXPECT_DEATH_IF_SUPPORTED(`_statement, regex_`);` | if death tests are supported, verifies that _statement_ crashes with the given error; otherwise verifies nothing |
+| `ASSERT_EXIT(`_statement, predicate, regex_`);` | `EXPECT_EXIT(`_statement, predicate, regex_`);` |_statement_ exits with the given error and its exit code matches _predicate_ |
+
+where _statement_ is a statement that is expected to cause the process to
+die, _predicate_ is a function or function object that evaluates an integer
+exit status, and _regex_ is a regular expression that the stderr output of
+_statement_ is expected to match. Note that _statement_ can be _any valid
+statement_ (including _compound statement_) and doesn't have to be an
+expression.
+
+As usual, the `ASSERT` variants abort the current test function, while the
+`EXPECT` variants do not.
+
+**Note:** We use the word "crash" here to mean that the process
+terminates with a _non-zero_ exit status code.  There are two
+possibilities: either the process has called `exit()` or `_exit()`
+with a non-zero value, or it may be killed by a signal.
+
+This means that if _statement_ terminates the process with a 0 exit
+code, it is _not_ considered a crash by `EXPECT_DEATH`.  Use
+`EXPECT_EXIT` instead if this is the case, or if you want to restrict
+the exit code more precisely.
+
+A predicate here must accept an `int` and return a `bool`. The death test
+succeeds only if the predicate returns `true`. Google Test defines a few
+predicates that handle the most common cases:
+
+```
+::testing::ExitedWithCode(exit_code)
+```
+
+This expression is `true` if the program exited normally with the given exit
+code.
+
+```
+::testing::KilledBySignal(signal_number)  // Not available on Windows.
+```
+
+This expression is `true` if the program was killed by the given signal.
+
+The `*_DEATH` macros are convenient wrappers for `*_EXIT` that use a predicate
+that verifies the process' exit code is non-zero.
+
+Note that a death test only cares about three things:
+
+  1. does _statement_ abort or exit the process?
+  1. (in the case of `ASSERT_EXIT` and `EXPECT_EXIT`) does the exit status satisfy _predicate_?  Or (in the case of `ASSERT_DEATH` and `EXPECT_DEATH`) is the exit status non-zero?  And
+  1. does the stderr output match _regex_?
+
+In particular, if _statement_ generates an `ASSERT_*` or `EXPECT_*` failure, it will **not** cause the death test to fail, as Google Test assertions don't abort the process.
+
+To write a death test, simply use one of the above macros inside your test
+function. For example,
+
+```
+TEST(MyDeathTest, Foo) {
+  // This death test uses a compound statement.
+  ASSERT_DEATH({ int n = 5; Foo(&n); }, "Error on line .* of Foo()");
+}
+TEST(MyDeathTest, NormalExit) {
+  EXPECT_EXIT(NormalExit(), ::testing::ExitedWithCode(0), "Success");
+}
+TEST(MyDeathTest, KillMyself) {
+  EXPECT_EXIT(KillMyself(), ::testing::KilledBySignal(SIGKILL), "Sending myself unblockable signal");
+}
+```
+
+verifies that:
+
+  * calling `Foo(5)` causes the process to die with the given error message,
+  * calling `NormalExit()` causes the process to print `"Success"` to stderr and exit with exit code 0, and
+  * calling `KillMyself()` kills the process with signal `SIGKILL`.
+
+The test function body may contain other assertions and statements as well, if
+necessary.
+
+_Important:_ We strongly recommend you to follow the convention of naming your
+test case (not test) `*DeathTest` when it contains a death test, as
+demonstrated in the above example. The `Death Tests And Threads` section below
+explains why.
+
+If a test fixture class is shared by normal tests and death tests, you
+can use typedef to introduce an alias for the fixture class and avoid
+duplicating its code:
+```
+class FooTest : public ::testing::Test { ... };
+
+typedef FooTest FooDeathTest;
+
+TEST_F(FooTest, DoesThis) {
+  // normal test
+}
+
+TEST_F(FooDeathTest, DoesThat) {
+  // death test
+}
+```
+
+_Availability:_ Linux, Windows (requires MSVC 8.0 or above), Cygwin, and Mac (the latter three are supported since v1.3.0).  `(ASSERT|EXPECT)_DEATH_IF_SUPPORTED` are new in v1.4.0.
+
+## Regular Expression Syntax ##
+
+On POSIX systems (e.g. Linux, Cygwin, and Mac), Google Test uses the
+[POSIX extended regular expression](http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap09.html#tag_09_04)
+syntax in death tests. To learn about this syntax, you may want to read this [Wikipedia entry](http://en.wikipedia.org/wiki/Regular_expression#POSIX_Extended_Regular_Expressions).
+
+On Windows, Google Test uses its own simple regular expression
+implementation. It lacks many features you can find in POSIX extended
+regular expressions.  For example, we don't support union (`"x|y"`),
+grouping (`"(xy)"`), brackets (`"[xy]"`), and repetition count
+(`"x{5,7}"`), among others. Below is what we do support (Letter `A` denotes a
+literal character, period (`.`), or a single `\\` escape sequence; `x`
+and `y` denote regular expressions.):
+
+| `c` | matches any literal character `c` |
+|:----|:----------------------------------|
+| `\\d` | matches any decimal digit         |
+| `\\D` | matches any character that's not a decimal digit |
+| `\\f` | matches `\f`                      |
+| `\\n` | matches `\n`                      |
+| `\\r` | matches `\r`                      |
+| `\\s` | matches any ASCII whitespace, including `\n` |
+| `\\S` | matches any character that's not a whitespace |
+| `\\t` | matches `\t`                      |
+| `\\v` | matches `\v`                      |
+| `\\w` | matches any letter, `_`, or decimal digit |
+| `\\W` | matches any character that `\\w` doesn't match |
+| `\\c` | matches any literal character `c`, which must be a punctuation |
+| `\\.` | matches the `.` character         |
+| `.` | matches any single character except `\n` |
+| `A?` | matches 0 or 1 occurrences of `A` |
+| `A*` | matches 0 or many occurrences of `A` |
+| `A+` | matches 1 or many occurrences of `A` |
+| `^` | matches the beginning of a string (not that of each line) |
+| `$` | matches the end of a string (not that of each line) |
+| `xy` | matches `x` followed by `y`       |
+
+To help you determine which capability is available on your system,
+Google Test defines macro `GTEST_USES_POSIX_RE=1` when it uses POSIX
+extended regular expressions, or `GTEST_USES_SIMPLE_RE=1` when it uses
+the simple version.  If you want your death tests to work in both
+cases, you can either `#if` on these macros or use the more limited
+syntax only.
+
+## How It Works ##
+
+Under the hood, `ASSERT_EXIT()` spawns a new process and executes the
+death test statement in that process. The details of of how precisely
+that happens depend on the platform and the variable
+`::testing::GTEST_FLAG(death_test_style)` (which is initialized from the
+command-line flag `--gtest_death_test_style`).
+
+  * On POSIX systems, `fork()` (or `clone()` on Linux) is used to spawn the child, after which:
+    * If the variable's value is `"fast"`, the death test statement is immediately executed.
+    * If the variable's value is `"threadsafe"`, the child process re-executes the unit test binary just as it was originally invoked, but with some extra flags to cause just the single death test under consideration to be run.
+  * On Windows, the child is spawned using the `CreateProcess()` API, and re-executes the binary to cause just the single death test under consideration to be run - much like the `threadsafe` mode on POSIX.
+
+Other values for the variable are illegal and will cause the death test to
+fail. Currently, the flag's default value is `"fast"`. However, we reserve the
+right to change it in the future. Therefore, your tests should not depend on
+this.
+
+In either case, the parent process waits for the child process to complete, and checks that
+
+  1. the child's exit status satisfies the predicate, and
+  1. the child's stderr matches the regular expression.
+
+If the death test statement runs to completion without dying, the child
+process will nonetheless terminate, and the assertion fails.
+
+## Death Tests And Threads ##
+
+The reason for the two death test styles has to do with thread safety. Due to
+well-known problems with forking in the presence of threads, death tests should
+be run in a single-threaded context. Sometimes, however, it isn't feasible to
+arrange that kind of environment. For example, statically-initialized modules
+may start threads before main is ever reached. Once threads have been created,
+it may be difficult or impossible to clean them up.
+
+Google Test has three features intended to raise awareness of threading issues.
+
+  1. A warning is emitted if multiple threads are running when a death test is encountered.
+  1. Test cases with a name ending in "DeathTest" are run before all other tests.
+  1. It uses `clone()` instead of `fork()` to spawn the child process on Linux (`clone()` is not available on Cygwin and Mac), as `fork()` is more likely to cause the child to hang when the parent process has multiple threads.
+
+It's perfectly fine to create threads inside a death test statement; they are
+executed in a separate process and cannot affect the parent.
+
+## Death Test Styles ##
+
+The "threadsafe" death test style was introduced in order to help mitigate the
+risks of testing in a possibly multithreaded environment. It trades increased
+test execution time (potentially dramatically so) for improved thread safety.
+We suggest using the faster, default "fast" style unless your test has specific
+problems with it.
+
+You can choose a particular style of death tests by setting the flag
+programmatically:
+
+```
+::testing::FLAGS_gtest_death_test_style = "threadsafe";
+```
+
+You can do this in `main()` to set the style for all death tests in the
+binary, or in individual tests. Recall that flags are saved before running each
+test and restored afterwards, so you need not do that yourself. For example:
+
+```
+TEST(MyDeathTest, TestOne) {
+  ::testing::FLAGS_gtest_death_test_style = "threadsafe";
+  // This test is run in the "threadsafe" style:
+  ASSERT_DEATH(ThisShouldDie(), "");
+}
+
+TEST(MyDeathTest, TestTwo) {
+  // This test is run in the "fast" style:
+  ASSERT_DEATH(ThisShouldDie(), "");
+}
+
+int main(int argc, char** argv) {
+  ::testing::InitGoogleTest(&argc, argv);
+  ::testing::FLAGS_gtest_death_test_style = "fast";
+  return RUN_ALL_TESTS();
+}
+```
+
+## Caveats ##
+
+The _statement_ argument of `ASSERT_EXIT()` can be any valid C++ statement.
+If it leaves the current function via a `return` statement or by throwing an exception,
+the death test is considered to have failed.  Some Google Test macros may return
+from the current function (e.g. `ASSERT_TRUE()`), so be sure to avoid them in _statement_.
+
+Since _statement_ runs in the child process, any in-memory side effect (e.g.
+modifying a variable, releasing memory, etc) it causes will _not_ be observable
+in the parent process. In particular, if you release memory in a death test,
+your program will fail the heap check as the parent process will never see the
+memory reclaimed. To solve this problem, you can
+
+  1. try not to free memory in a death test;
+  1. free the memory again in the parent process; or
+  1. do not use the heap checker in your program.
+
+Due to an implementation detail, you cannot place multiple death test
+assertions on the same line; otherwise, compilation will fail with an unobvious
+error message.
+
+Despite the improved thread safety afforded by the "threadsafe" style of death
+test, thread problems such as deadlock are still possible in the presence of
+handlers registered with `pthread_atfork(3)`.
+
+# Using Assertions in Sub-routines #
+
+## Adding Traces to Assertions ##
+
+If a test sub-routine is called from several places, when an assertion
+inside it fails, it can be hard to tell which invocation of the
+sub-routine the failure is from.  You can alleviate this problem using
+extra logging or custom failure messages, but that usually clutters up
+your tests. A better solution is to use the `SCOPED_TRACE` macro:
+
+| `SCOPED_TRACE(`_message_`);` |
+|:-----------------------------|
+
+where _message_ can be anything streamable to `std::ostream`. This
+macro will cause the current file name, line number, and the given
+message to be added in every failure message. The effect will be
+undone when the control leaves the current lexical scope.
+
+For example,
+
+```
+10: void Sub1(int n) {
+11:   EXPECT_EQ(1, Bar(n));
+12:   EXPECT_EQ(2, Bar(n + 1));
+13: }
+14:
+15: TEST(FooTest, Bar) {
+16:   {
+17:     SCOPED_TRACE("A");  // This trace point will be included in
+18:                         // every failure in this scope.
+19:     Sub1(1);
+20:   }
+21:   // Now it won't.
+22:   Sub1(9);
+23: }
+```
+
+could result in messages like these:
+
+```
+path/to/foo_test.cc:11: Failure
+Value of: Bar(n)
+Expected: 1
+  Actual: 2
+   Trace:
+path/to/foo_test.cc:17: A
+
+path/to/foo_test.cc:12: Failure
+Value of: Bar(n + 1)
+Expected: 2
+  Actual: 3
+```
+
+Without the trace, it would've been difficult to know which invocation
+of `Sub1()` the two failures come from respectively. (You could add an
+extra message to each assertion in `Sub1()` to indicate the value of
+`n`, but that's tedious.)
+
+Some tips on using `SCOPED_TRACE`:
+
+  1. With a suitable message, it's often enough to use `SCOPED_TRACE` at the beginning of a sub-routine, instead of at each call site.
+  1. When calling sub-routines inside a loop, make the loop iterator part of the message in `SCOPED_TRACE` such that you can know which iteration the failure is from.
+  1. Sometimes the line number of the trace point is enough for identifying the particular invocation of a sub-routine. In this case, you don't have to choose a unique message for `SCOPED_TRACE`. You can simply use `""`.
+  1. You can use `SCOPED_TRACE` in an inner scope when there is one in the outer scope. In this case, all active trace points will be included in the failure messages, in reverse order they are encountered.
+  1. The trace dump is clickable in Emacs' compilation buffer - hit return on a line number and you'll be taken to that line in the source file!
+
+_Availability:_ Linux, Windows, Mac.
+
+## Propagating Fatal Failures ##
+
+A common pitfall when using `ASSERT_*` and `FAIL*` is not understanding that
+when they fail they only abort the _current function_, not the entire test. For
+example, the following test will segfault:
+```
+void Subroutine() {
+  // Generates a fatal failure and aborts the current function.
+  ASSERT_EQ(1, 2);
+  // The following won't be executed.
+  ...
+}
+
+TEST(FooTest, Bar) {
+  Subroutine();
+  // The intended behavior is for the fatal failure
+  // in Subroutine() to abort the entire test.
+  // The actual behavior: the function goes on after Subroutine() returns.
+  int* p = NULL;
+  *p = 3; // Segfault!
+}
+```
+
+Since we don't use exceptions, it is technically impossible to
+implement the intended behavior here.  To alleviate this, Google Test
+provides two solutions.  You could use either the
+`(ASSERT|EXPECT)_NO_FATAL_FAILURE` assertions or the
+`HasFatalFailure()` function.  They are described in the following two
+subsections.
+
+### Asserting on Subroutines ###
+
+As shown above, if your test calls a subroutine that has an `ASSERT_*`
+failure in it, the test will continue after the subroutine
+returns. This may not be what you want.
+
+Often people want fatal failures to propagate like exceptions.  For
+that Google Test offers the following macros:
+
+| **Fatal assertion** | **Nonfatal assertion** | **Verifies** |
+|:--------------------|:-----------------------|:-------------|
+| `ASSERT_NO_FATAL_FAILURE(`_statement_`);` | `EXPECT_NO_FATAL_FAILURE(`_statement_`);` | _statement_ doesn't generate any new fatal failures in the current thread. |
+
+Only failures in the thread that executes the assertion are checked to
+determine the result of this type of assertions.  If _statement_
+creates new threads, failures in these threads are ignored.
+
+Examples:
+
+```
+ASSERT_NO_FATAL_FAILURE(Foo());
+
+int i;
+EXPECT_NO_FATAL_FAILURE({
+  i = Bar();
+});
+```
+
+_Availability:_ Linux, Windows, Mac. Assertions from multiple threads
+are currently not supported.
+
+### Checking for Failures in the Current Test ###
+
+`HasFatalFailure()` in the `::testing::Test` class returns `true` if an
+assertion in the current test has suffered a fatal failure. This
+allows functions to catch fatal failures in a sub-routine and return
+early.
+
+```
+class Test {
+ public:
+  ...
+  static bool HasFatalFailure();
+};
+```
+
+The typical usage, which basically simulates the behavior of a thrown
+exception, is:
+
+```
+TEST(FooTest, Bar) {
+  Subroutine();
+  // Aborts if Subroutine() had a fatal failure.
+  if (HasFatalFailure())
+    return;
+  // The following won't be executed.
+  ...
+}
+```
+
+If `HasFatalFailure()` is used outside of `TEST()` , `TEST_F()` , or a test
+fixture, you must add the `::testing::Test::` prefix, as in:
+
+```
+if (::testing::Test::HasFatalFailure())
+  return;
+```
+
+Similarly, `HasNonfatalFailure()` returns `true` if the current test
+has at least one non-fatal failure, and `HasFailure()` returns `true`
+if the current test has at least one failure of either kind.
+
+_Availability:_ Linux, Windows, Mac.  `HasNonfatalFailure()` and
+`HasFailure()` are available since version 1.4.0.
+
+# Logging Additional Information #
+
+In your test code, you can call `RecordProperty("key", value)` to log
+additional information, where `value` can be either a string or an `int`. The _last_ value recorded for a key will be emitted to the XML output
+if you specify one. For example, the test
+
+```
+TEST_F(WidgetUsageTest, MinAndMaxWidgets) {
+  RecordProperty("MaximumWidgets", ComputeMaxUsage());
+  RecordProperty("MinimumWidgets", ComputeMinUsage());
+}
+```
+
+will output XML like this:
+
+```
+...
+  <testcase name="MinAndMaxWidgets" status="run" time="6" classname="WidgetUsageTest"
+            MaximumWidgets="12"
+            MinimumWidgets="9" />
+...
+```
+
+_Note_:
+  * `RecordProperty()` is a static member of the `Test` class. Therefore it needs to be prefixed with `::testing::Test::` if used outside of the `TEST` body and the test fixture class.
+  * `key` must be a valid XML attribute name, and cannot conflict with the ones already used by Google Test (`name`, `status`, `time`, `classname`, `type_param`, and `value_param`).
+  * Calling `RecordProperty()` outside of the lifespan of a test is allowed. If it's called outside of a test but between a test case's `SetUpTestCase()` and `TearDownTestCase()` methods, it will be attributed to the XML element for the test case. If it's called outside of all test cases (e.g. in a test environment), it will be attributed to the top-level XML element.
+
+_Availability_: Linux, Windows, Mac.
+
+# Sharing Resources Between Tests in the Same Test Case #
+
+
+
+Google Test creates a new test fixture object for each test in order to make
+tests independent and easier to debug. However, sometimes tests use resources
+that are expensive to set up, making the one-copy-per-test model prohibitively
+expensive.
+
+If the tests don't change the resource, there's no harm in them sharing a
+single resource copy. So, in addition to per-test set-up/tear-down, Google Test
+also supports per-test-case set-up/tear-down. To use it:
+
+  1. In your test fixture class (say `FooTest` ), define as `static` some member variables to hold the shared resources.
+  1. In the same test fixture class, define a `static void SetUpTestCase()` function (remember not to spell it as **`SetupTestCase`** with a small `u`!) to set up the shared resources and a `static void TearDownTestCase()` function to tear them down.
+
+That's it! Google Test automatically calls `SetUpTestCase()` before running the
+_first test_ in the `FooTest` test case (i.e. before creating the first
+`FooTest` object), and calls `TearDownTestCase()` after running the _last test_
+in it (i.e. after deleting the last `FooTest` object). In between, the tests
+can use the shared resources.
+
+Remember that the test order is undefined, so your code can't depend on a test
+preceding or following another. Also, the tests must either not modify the
+state of any shared resource, or, if they do modify the state, they must
+restore the state to its original value before passing control to the next
+test.
+
+Here's an example of per-test-case set-up and tear-down:
+```
+class FooTest : public ::testing::Test {
+ protected:
+  // Per-test-case set-up.
+  // Called before the first test in this test case.
+  // Can be omitted if not needed.
+  static void SetUpTestCase() {
+    shared_resource_ = new ...;
+  }
+
+  // Per-test-case tear-down.
+  // Called after the last test in this test case.
+  // Can be omitted if not needed.
+  static void TearDownTestCase() {
+    delete shared_resource_;
+    shared_resource_ = NULL;
+  }
+
+  // You can define per-test set-up and tear-down logic as usual.
+  virtual void SetUp() { ... }
+  virtual void TearDown() { ... }
+
+  // Some expensive resource shared by all tests.
+  static T* shared_resource_;
+};
+
+T* FooTest::shared_resource_ = NULL;
+
+TEST_F(FooTest, Test1) {
+  ... you can refer to shared_resource here ...
+}
+TEST_F(FooTest, Test2) {
+  ... you can refer to shared_resource here ...
+}
+```
+
+_Availability:_ Linux, Windows, Mac.
+
+# Global Set-Up and Tear-Down #
+
+Just as you can do set-up and tear-down at the test level and the test case
+level, you can also do it at the test program level. Here's how.
+
+First, you subclass the `::testing::Environment` class to define a test
+environment, which knows how to set-up and tear-down:
+
+```
+class Environment {
+ public:
+  virtual ~Environment() {}
+  // Override this to define how to set up the environment.
+  virtual void SetUp() {}
+  // Override this to define how to tear down the environment.
+  virtual void TearDown() {}
+};
+```
+
+Then, you register an instance of your environment class with Google Test by
+calling the `::testing::AddGlobalTestEnvironment()` function:
+
+```
+Environment* AddGlobalTestEnvironment(Environment* env);
+```
+
+Now, when `RUN_ALL_TESTS()` is called, it first calls the `SetUp()` method of
+the environment object, then runs the tests if there was no fatal failures, and
+finally calls `TearDown()` of the environment object.
+
+It's OK to register multiple environment objects. In this case, their `SetUp()`
+will be called in the order they are registered, and their `TearDown()` will be
+called in the reverse order.
+
+Note that Google Test takes ownership of the registered environment objects.
+Therefore **do not delete them** by yourself.
+
+You should call `AddGlobalTestEnvironment()` before `RUN_ALL_TESTS()` is
+called, probably in `main()`. If you use `gtest_main`, you need to      call
+this before `main()` starts for it to take effect. One way to do this is to
+define a global variable like this:
+
+```
+::testing::Environment* const foo_env = ::testing::AddGlobalTestEnvironment(new FooEnvironment);
+```
+
+However, we strongly recommend you to write your own `main()` and call
+`AddGlobalTestEnvironment()` there, as relying on initialization of global
+variables makes the code harder to read and may cause problems when you
+register multiple environments from different translation units and the
+environments have dependencies among them (remember that the compiler doesn't
+guarantee the order in which global variables from different translation units
+are initialized).
+
+_Availability:_ Linux, Windows, Mac.
+
+
+# Value Parameterized Tests #
+
+_Value-parameterized tests_ allow you to test your code with different
+parameters without writing multiple copies of the same test.
+
+Suppose you write a test for your code and then realize that your code is affected by a presence of a Boolean command line flag.
+
+```
+TEST(MyCodeTest, TestFoo) {
+  // A code to test foo().
+}
+```
+
+Usually people factor their test code into a function with a Boolean parameter in such situations. The function sets the flag, then executes the testing code.
+
+```
+void TestFooHelper(bool flag_value) {
+  flag = flag_value;
+  // A code to test foo().
+}
+
+TEST(MyCodeTest, TestFoo) {
+  TestFooHelper(false);
+  TestFooHelper(true);
+}
+```
+
+But this setup has serious drawbacks. First, when a test assertion fails in your tests, it becomes unclear what value of the parameter caused it to fail. You can stream a clarifying message into your `EXPECT`/`ASSERT` statements, but it you'll have to do it with all of them. Second, you have to add one such helper function per test. What if you have ten tests? Twenty? A hundred?
+
+Value-parameterized tests will let you write your test only once and then easily instantiate and run it with an arbitrary number of parameter values.
+
+Here are some other situations when value-parameterized tests come handy:
+
+  * You want to test different implementations of an OO interface.
+  * You want to test your code over various inputs (a.k.a. data-driven testing). This feature is easy to abuse, so please exercise your good sense when doing it!
+
+## How to Write Value-Parameterized Tests ##
+
+To write value-parameterized tests, first you should define a fixture
+class.  It must be derived from both `::testing::Test` and
+`::testing::WithParamInterface<T>` (the latter is a pure interface),
+where `T` is the type of your parameter values.  For convenience, you
+can just derive the fixture class from `::testing::TestWithParam<T>`,
+which itself is derived from both `::testing::Test` and
+`::testing::WithParamInterface<T>`. `T` can be any copyable type. If
+it's a raw pointer, you are responsible for managing the lifespan of
+the pointed values.
+
+```
+class FooTest : public ::testing::TestWithParam<const char*> {
+  // You can implement all the usual fixture class members here.
+  // To access the test parameter, call GetParam() from class
+  // TestWithParam<T>.
+};
+
+// Or, when you want to add parameters to a pre-existing fixture class:
+class BaseTest : public ::testing::Test {
+  ...
+};
+class BarTest : public BaseTest,
+                public ::testing::WithParamInterface<const char*> {
+  ...
+};
+```
+
+Then, use the `TEST_P` macro to define as many test patterns using
+this fixture as you want.  The `_P` suffix is for "parameterized" or
+"pattern", whichever you prefer to think.
+
+```
+TEST_P(FooTest, DoesBlah) {
+  // Inside a test, access the test parameter with the GetParam() method
+  // of the TestWithParam<T> class:
+  EXPECT_TRUE(foo.Blah(GetParam()));
+  ...
+}
+
+TEST_P(FooTest, HasBlahBlah) {
+  ...
+}
+```
+
+Finally, you can use `INSTANTIATE_TEST_CASE_P` to instantiate the test
+case with any set of parameters you want. Google Test defines a number of
+functions for generating test parameters. They return what we call
+(surprise!) _parameter generators_. Here is a summary of them,
+which are all in the `testing` namespace:
+
+| `Range(begin, end[, step])` | Yields values `{begin, begin+step, begin+step+step, ...}`. The values do not include `end`. `step` defaults to 1. |
+|:----------------------------|:------------------------------------------------------------------------------------------------------------------|
+| `Values(v1, v2, ..., vN)`   | Yields values `{v1, v2, ..., vN}`.                                                                                |
+| `ValuesIn(container)` and `ValuesIn(begin, end)` | Yields values from a C-style array, an STL-style container, or an iterator range `[begin, end)`. `container`, `begin`, and `end` can be expressions whose values are determined at run time.  |
+| `Bool()`                    | Yields sequence `{false, true}`.                                                                                  |
+| `Combine(g1, g2, ..., gN)`  | Yields all combinations (the Cartesian product for the math savvy) of the values generated by the `N` generators. This is only available if your system provides the `<tr1/tuple>` header. If you are sure your system does, and Google Test disagrees, you can override it by defining `GTEST_HAS_TR1_TUPLE=1`. See comments in [include/gtest/internal/gtest-port.h](../include/gtest/internal/gtest-port.h) for more information. |
+
+For more details, see the comments at the definitions of these functions in the [source code](../include/gtest/gtest-param-test.h).
+
+The following statement will instantiate tests from the `FooTest` test case
+each with parameter values `"meeny"`, `"miny"`, and `"moe"`.
+
+```
+INSTANTIATE_TEST_CASE_P(InstantiationName,
+                        FooTest,
+                        ::testing::Values("meeny", "miny", "moe"));
+```
+
+To distinguish different instances of the pattern (yes, you can
+instantiate it more than once), the first argument to
+`INSTANTIATE_TEST_CASE_P` is a prefix that will be added to the actual
+test case name. Remember to pick unique prefixes for different
+instantiations. The tests from the instantiation above will have these
+names:
+
+  * `InstantiationName/FooTest.DoesBlah/0` for `"meeny"`
+  * `InstantiationName/FooTest.DoesBlah/1` for `"miny"`
+  * `InstantiationName/FooTest.DoesBlah/2` for `"moe"`
+  * `InstantiationName/FooTest.HasBlahBlah/0` for `"meeny"`
+  * `InstantiationName/FooTest.HasBlahBlah/1` for `"miny"`
+  * `InstantiationName/FooTest.HasBlahBlah/2` for `"moe"`
+
+You can use these names in [--gtest\_filter](#running-a-subset-of-the-tests).
+
+This statement will instantiate all tests from `FooTest` again, each
+with parameter values `"cat"` and `"dog"`:
+
+```
+const char* pets[] = {"cat", "dog"};
+INSTANTIATE_TEST_CASE_P(AnotherInstantiationName, FooTest,
+                        ::testing::ValuesIn(pets));
+```
+
+The tests from the instantiation above will have these names:
+
+  * `AnotherInstantiationName/FooTest.DoesBlah/0` for `"cat"`
+  * `AnotherInstantiationName/FooTest.DoesBlah/1` for `"dog"`
+  * `AnotherInstantiationName/FooTest.HasBlahBlah/0` for `"cat"`
+  * `AnotherInstantiationName/FooTest.HasBlahBlah/1` for `"dog"`
+
+Please note that `INSTANTIATE_TEST_CASE_P` will instantiate _all_
+tests in the given test case, whether their definitions come before or
+_after_ the `INSTANTIATE_TEST_CASE_P` statement.
+
+You can see
+[these](../samples/sample7_unittest.cc)
+[files](../samples/sample8_unittest.cc) for more examples.
+
+_Availability_: Linux, Windows (requires MSVC 8.0 or above), Mac; since version 1.2.0.
+
+## Creating Value-Parameterized Abstract Tests ##
+
+In the above, we define and instantiate `FooTest` in the same source
+file. Sometimes you may want to define value-parameterized tests in a
+library and let other people instantiate them later. This pattern is
+known as <i>abstract tests</i>. As an example of its application, when you
+are designing an interface you can write a standard suite of abstract
+tests (perhaps using a factory function as the test parameter) that
+all implementations of the interface are expected to pass. When
+someone implements the interface, he can instantiate your suite to get
+all the interface-conformance tests for free.
+
+To define abstract tests, you should organize your code like this:
+
+  1. Put the definition of the parameterized test fixture class (e.g. `FooTest`) in a header file, say `foo_param_test.h`. Think of this as _declaring_ your abstract tests.
+  1. Put the `TEST_P` definitions in `foo_param_test.cc`, which includes `foo_param_test.h`. Think of this as _implementing_ your abstract tests.
+
+Once they are defined, you can instantiate them by including
+`foo_param_test.h`, invoking `INSTANTIATE_TEST_CASE_P()`, and linking
+with `foo_param_test.cc`. You can instantiate the same abstract test
+case multiple times, possibly in different source files.
+
+# Typed Tests #
+
+Suppose you have multiple implementations of the same interface and
+want to make sure that all of them satisfy some common requirements.
+Or, you may have defined several types that are supposed to conform to
+the same "concept" and you want to verify it.  In both cases, you want
+the same test logic repeated for different types.
+
+While you can write one `TEST` or `TEST_F` for each type you want to
+test (and you may even factor the test logic into a function template
+that you invoke from the `TEST`), it's tedious and doesn't scale:
+if you want _m_ tests over _n_ types, you'll end up writing _m\*n_
+`TEST`s.
+
+_Typed tests_ allow you to repeat the same test logic over a list of
+types.  You only need to write the test logic once, although you must
+know the type list when writing typed tests.  Here's how you do it:
+
+First, define a fixture class template.  It should be parameterized
+by a type.  Remember to derive it from `::testing::Test`:
+
+```
+template <typename T>
+class FooTest : public ::testing::Test {
+ public:
+  ...
+  typedef std::list<T> List;
+  static T shared_;
+  T value_;
+};
+```
+
+Next, associate a list of types with the test case, which will be
+repeated for each type in the list:
+
+```
+typedef ::testing::Types<char, int, unsigned int> MyTypes;
+TYPED_TEST_CASE(FooTest, MyTypes);
+```
+
+The `typedef` is necessary for the `TYPED_TEST_CASE` macro to parse
+correctly.  Otherwise the compiler will think that each comma in the
+type list introduces a new macro argument.
+
+Then, use `TYPED_TEST()` instead of `TEST_F()` to define a typed test
+for this test case.  You can repeat this as many times as you want:
+
+```
+TYPED_TEST(FooTest, DoesBlah) {
+  // Inside a test, refer to the special name TypeParam to get the type
+  // parameter.  Since we are inside a derived class template, C++ requires
+  // us to visit the members of FooTest via 'this'.
+  TypeParam n = this->value_;
+
+  // To visit static members of the fixture, add the 'TestFixture::'
+  // prefix.
+  n += TestFixture::shared_;
+
+  // To refer to typedefs in the fixture, add the 'typename TestFixture::'
+  // prefix.  The 'typename' is required to satisfy the compiler.
+  typename TestFixture::List values;
+  values.push_back(n);
+  ...
+}
+
+TYPED_TEST(FooTest, HasPropertyA) { ... }
+```
+
+You can see `samples/sample6_unittest.cc` for a complete example.
+
+_Availability:_ Linux, Windows (requires MSVC 8.0 or above), Mac;
+since version 1.1.0.
+
+# Type-Parameterized Tests #
+
+_Type-parameterized tests_ are like typed tests, except that they
+don't require you to know the list of types ahead of time.  Instead,
+you can define the test logic first and instantiate it with different
+type lists later.  You can even instantiate it more than once in the
+same program.
+
+If you are designing an interface or concept, you can define a suite
+of type-parameterized tests to verify properties that any valid
+implementation of the interface/concept should have.  Then, the author
+of each implementation can just instantiate the test suite with his
+type to verify that it conforms to the requirements, without having to
+write similar tests repeatedly.  Here's an example:
+
+First, define a fixture class template, as we did with typed tests:
+
+```
+template <typename T>
+class FooTest : public ::testing::Test {
+  ...
+};
+```
+
+Next, declare that you will define a type-parameterized test case:
+
+```
+TYPED_TEST_CASE_P(FooTest);
+```
+
+The `_P` suffix is for "parameterized" or "pattern", whichever you
+prefer to think.
+
+Then, use `TYPED_TEST_P()` to define a type-parameterized test.  You
+can repeat this as many times as you want:
+
+```
+TYPED_TEST_P(FooTest, DoesBlah) {
+  // Inside a test, refer to TypeParam to get the type parameter.
+  TypeParam n = 0;
+  ...
+}
+
+TYPED_TEST_P(FooTest, HasPropertyA) { ... }
+```
+
+Now the tricky part: you need to register all test patterns using the
+`REGISTER_TYPED_TEST_CASE_P` macro before you can instantiate them.
+The first argument of the macro is the test case name; the rest are
+the names of the tests in this test case:
+
+```
+REGISTER_TYPED_TEST_CASE_P(FooTest,
+                           DoesBlah, HasPropertyA);
+```
+
+Finally, you are free to instantiate the pattern with the types you
+want.  If you put the above code in a header file, you can `#include`
+it in multiple C++ source files and instantiate it multiple times.
+
+```
+typedef ::testing::Types<char, int, unsigned int> MyTypes;
+INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, MyTypes);
+```
+
+To distinguish different instances of the pattern, the first argument
+to the `INSTANTIATE_TYPED_TEST_CASE_P` macro is a prefix that will be
+added to the actual test case name.  Remember to pick unique prefixes
+for different instances.
+
+In the special case where the type list contains only one type, you
+can write that type directly without `::testing::Types<...>`, like this:
+
+```
+INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, int);
+```
+
+You can see `samples/sample6_unittest.cc` for a complete example.
+
+_Availability:_ Linux, Windows (requires MSVC 8.0 or above), Mac;
+since version 1.1.0.
+
+# Testing Private Code #
+
+If you change your software's internal implementation, your tests should not
+break as long as the change is not observable by users. Therefore, per the
+_black-box testing principle_, most of the time you should test your code
+through its public interfaces.
+
+If you still find yourself needing to test internal implementation code,
+consider if there's a better design that wouldn't require you to do so. If you
+absolutely have to test non-public interface code though, you can. There are
+two cases to consider:
+
+  * Static functions (_not_ the same as static member functions!) or unnamed namespaces, and
+  * Private or protected class members
+
+## Static Functions ##
+
+Both static functions and definitions/declarations in an unnamed namespace are
+only visible within the same translation unit. To test them, you can `#include`
+the entire `.cc` file being tested in your `*_test.cc` file. (`#include`ing `.cc`
+files is not a good way to reuse code - you should not do this in production
+code!)
+
+However, a better approach is to move the private code into the
+`foo::internal` namespace, where `foo` is the namespace your project normally
+uses, and put the private declarations in a `*-internal.h` file. Your
+production `.cc` files and your tests are allowed to include this internal
+header, but your clients are not. This way, you can fully test your internal
+implementation without leaking it to your clients.
+
+## Private Class Members ##
+
+Private class members are only accessible from within the class or by friends.
+To access a class' private members, you can declare your test fixture as a
+friend to the class and define accessors in your fixture. Tests using the
+fixture can then access the private members of your production class via the
+accessors in the fixture. Note that even though your fixture is a friend to
+your production class, your tests are not automatically friends to it, as they
+are technically defined in sub-classes of the fixture.
+
+Another way to test private members is to refactor them into an implementation
+class, which is then declared in a `*-internal.h` file. Your clients aren't
+allowed to include this header but your tests can. Such is called the Pimpl
+(Private Implementation) idiom.
+
+Or, you can declare an individual test as a friend of your class by adding this
+line in the class body:
+
+```
+FRIEND_TEST(TestCaseName, TestName);
+```
+
+For example,
+```
+// foo.h
+#include "gtest/gtest_prod.h"
+
+// Defines FRIEND_TEST.
+class Foo {
+  ...
+ private:
+  FRIEND_TEST(FooTest, BarReturnsZeroOnNull);
+  int Bar(void* x);
+};
+
+// foo_test.cc
+...
+TEST(FooTest, BarReturnsZeroOnNull) {
+  Foo foo;
+  EXPECT_EQ(0, foo.Bar(NULL));
+  // Uses Foo's private member Bar().
+}
+```
+
+Pay special attention when your class is defined in a namespace, as you should
+define your test fixtures and tests in the same namespace if you want them to
+be friends of your class. For example, if the code to be tested looks like:
+
+```
+namespace my_namespace {
+
+class Foo {
+  friend class FooTest;
+  FRIEND_TEST(FooTest, Bar);
+  FRIEND_TEST(FooTest, Baz);
+  ...
+  definition of the class Foo
+  ...
+};
+
+}  // namespace my_namespace
+```
+
+Your test code should be something like:
+
+```
+namespace my_namespace {
+class FooTest : public ::testing::Test {
+ protected:
+  ...
+};
+
+TEST_F(FooTest, Bar) { ... }
+TEST_F(FooTest, Baz) { ... }
+
+}  // namespace my_namespace
+```
+
+# Catching Failures #
+
+If you are building a testing utility on top of Google Test, you'll
+want to test your utility.  What framework would you use to test it?
+Google Test, of course.
+
+The challenge is to verify that your testing utility reports failures
+correctly.  In frameworks that report a failure by throwing an
+exception, you could catch the exception and assert on it.  But Google
+Test doesn't use exceptions, so how do we test that a piece of code
+generates an expected failure?
+
+`"gtest/gtest-spi.h"` contains some constructs to do this.  After 
+`#include`ing this header, you can use
+
+| `EXPECT_FATAL_FAILURE(`_statement, substring_`);` |
+|:--------------------------------------------------|
+
+to assert that _statement_ generates a fatal (e.g. `ASSERT_*`) failure
+whose message contains the given _substring_, or use
+
+| `EXPECT_NONFATAL_FAILURE(`_statement, substring_`);` |
+|:-----------------------------------------------------|
+
+if you are expecting a non-fatal (e.g. `EXPECT_*`) failure.
+
+For technical reasons, there are some caveats:
+
+  1. You cannot stream a failure message to either macro.
+  1. _statement_ in `EXPECT_FATAL_FAILURE()` cannot reference local non-static variables or non-static members of `this` object.
+  1. _statement_ in `EXPECT_FATAL_FAILURE()` cannot return a value.
+
+_Note:_ Google Test is designed with threads in mind. Once the
+synchronization primitives in `"gtest/internal/gtest-port.h"` have
+been implemented, Google Test will become thread-safe, meaning that
+you can then use assertions in multiple threads concurrently. Before
+that, however, Google Test only supports single-threaded usage. Once
+thread-safe, `EXPECT_FATAL_FAILURE()` and `EXPECT_NONFATAL_FAILURE()`
+will capture failures in the current thread only. If _statement_
+creates new threads, failures in these threads will be ignored. If
+you want to capture failures from all threads instead, you should use
+the following macros:
+
+| `EXPECT_FATAL_FAILURE_ON_ALL_THREADS(`_statement, substring_`);` |
+|:-----------------------------------------------------------------|
+| `EXPECT_NONFATAL_FAILURE_ON_ALL_THREADS(`_statement, substring_`);` |
+
+# Getting the Current Test's Name #
+
+Sometimes a function may need to know the name of the currently running test.
+For example, you may be using the `SetUp()` method of your test fixture to set
+the golden file name based on which test is running. The `::testing::TestInfo`
+class has this information:
+
+```
+namespace testing {
+
+class TestInfo {
+ public:
+  // Returns the test case name and the test name, respectively.
+  //
+  // Do NOT delete or free the return value - it's managed by the
+  // TestInfo class.
+  const char* test_case_name() const;
+  const char* name() const;
+};
+
+}  // namespace testing
+```
+
+
+> To obtain a `TestInfo` object for the currently running test, call
+`current_test_info()` on the `UnitTest` singleton object:
+
+```
+// Gets information about the currently running test.
+// Do NOT delete the returned object - it's managed by the UnitTest class.
+const ::testing::TestInfo* const test_info =
+  ::testing::UnitTest::GetInstance()->current_test_info();
+printf("We are in test %s of test case %s.\n",
+       test_info->name(), test_info->test_case_name());
+```
+
+`current_test_info()` returns a null pointer if no test is running. In
+particular, you cannot find the test case name in `TestCaseSetUp()`,
+`TestCaseTearDown()` (where you know the test case name implicitly), or
+functions called from them.
+
+_Availability:_ Linux, Windows, Mac.
+
+# Extending Google Test by Handling Test Events #
+
+Google Test provides an <b>event listener API</b> to let you receive
+notifications about the progress of a test program and test
+failures. The events you can listen to include the start and end of
+the test program, a test case, or a test method, among others. You may
+use this API to augment or replace the standard console output,
+replace the XML output, or provide a completely different form of
+output, such as a GUI or a database. You can also use test events as
+checkpoints to implement a resource leak checker, for example.
+
+_Availability:_ Linux, Windows, Mac; since v1.4.0.
+
+## Defining Event Listeners ##
+
+To define a event listener, you subclass either
+[testing::TestEventListener](../include/gtest/gtest.h#L991)
+or [testing::EmptyTestEventListener](../include/gtest/gtest.h#L1044).
+The former is an (abstract) interface, where <i>each pure virtual method<br>
+can be overridden to handle a test event</i> (For example, when a test
+starts, the `OnTestStart()` method will be called.). The latter provides
+an empty implementation of all methods in the interface, such that a
+subclass only needs to override the methods it cares about.
+
+When an event is fired, its context is passed to the handler function
+as an argument. The following argument types are used:
+  * [UnitTest](../include/gtest/gtest.h#L1151) reflects the state of the entire test program,
+  * [TestCase](../include/gtest/gtest.h#L778) has information about a test case, which can contain one or more tests,
+  * [TestInfo](../include/gtest/gtest.h#L644) contains the state of a test, and
+  * [TestPartResult](../include/gtest/gtest-test-part.h#L47) represents the result of a test assertion.
+
+An event handler function can examine the argument it receives to find
+out interesting information about the event and the test program's
+state.  Here's an example:
+
+```
+  class MinimalistPrinter : public ::testing::EmptyTestEventListener {
+    // Called before a test starts.
+    virtual void OnTestStart(const ::testing::TestInfo& test_info) {
+      printf("*** Test %s.%s starting.\n",
+             test_info.test_case_name(), test_info.name());
+    }
+
+    // Called after a failed assertion or a SUCCEED() invocation.
+    virtual void OnTestPartResult(
+        const ::testing::TestPartResult& test_part_result) {
+      printf("%s in %s:%d\n%s\n",
+             test_part_result.failed() ? "*** Failure" : "Success",
+             test_part_result.file_name(),
+             test_part_result.line_number(),
+             test_part_result.summary());
+    }
+
+    // Called after a test ends.
+    virtual void OnTestEnd(const ::testing::TestInfo& test_info) {
+      printf("*** Test %s.%s ending.\n",
+             test_info.test_case_name(), test_info.name());
+    }
+  };
+```
+
+## Using Event Listeners ##
+
+To use the event listener you have defined, add an instance of it to
+the Google Test event listener list (represented by class
+[TestEventListeners](../include/gtest/gtest.h#L1064)
+- note the "s" at the end of the name) in your
+`main()` function, before calling `RUN_ALL_TESTS()`:
+```
+int main(int argc, char** argv) {
+  ::testing::InitGoogleTest(&argc, argv);
+  // Gets hold of the event listener list.
+  ::testing::TestEventListeners& listeners =
+      ::testing::UnitTest::GetInstance()->listeners();
+  // Adds a listener to the end.  Google Test takes the ownership.
+  listeners.Append(new MinimalistPrinter);
+  return RUN_ALL_TESTS();
+}
+```
+
+There's only one problem: the default test result printer is still in
+effect, so its output will mingle with the output from your minimalist
+printer. To suppress the default printer, just release it from the
+event listener list and delete it. You can do so by adding one line:
+```
+  ...
+  delete listeners.Release(listeners.default_result_printer());
+  listeners.Append(new MinimalistPrinter);
+  return RUN_ALL_TESTS();
+```
+
+Now, sit back and enjoy a completely different output from your
+tests. For more details, you can read this
+[sample](../samples/sample9_unittest.cc).
+
+You may append more than one listener to the list. When an `On*Start()`
+or `OnTestPartResult()` event is fired, the listeners will receive it in
+the order they appear in the list (since new listeners are added to
+the end of the list, the default text printer and the default XML
+generator will receive the event first). An `On*End()` event will be
+received by the listeners in the _reverse_ order. This allows output by
+listeners added later to be framed by output from listeners added
+earlier.
+
+## Generating Failures in Listeners ##
+
+You may use failure-raising macros (`EXPECT_*()`, `ASSERT_*()`,
+`FAIL()`, etc) when processing an event. There are some restrictions:
+
+  1. You cannot generate any failure in `OnTestPartResult()` (otherwise it will cause `OnTestPartResult()` to be called recursively).
+  1. A listener that handles `OnTestPartResult()` is not allowed to generate any failure.
+
+When you add listeners to the listener list, you should put listeners
+that handle `OnTestPartResult()` _before_ listeners that can generate
+failures. This ensures that failures generated by the latter are
+attributed to the right test by the former.
+
+We have a sample of failure-raising listener
+[here](../samples/sample10_unittest.cc).
+
+# Running Test Programs: Advanced Options #
+
+Google Test test programs are ordinary executables. Once built, you can run
+them directly and affect their behavior via the following environment variables
+and/or command line flags. For the flags to work, your programs must call
+`::testing::InitGoogleTest()` before calling `RUN_ALL_TESTS()`.
+
+To see a list of supported flags and their usage, please run your test
+program with the `--help` flag.  You can also use `-h`, `-?`, or `/?`
+for short.  This feature is added in version 1.3.0.
+
+If an option is specified both by an environment variable and by a
+flag, the latter takes precedence.  Most of the options can also be
+set/read in code: to access the value of command line flag
+`--gtest_foo`, write `::testing::GTEST_FLAG(foo)`.  A common pattern is
+to set the value of a flag before calling `::testing::InitGoogleTest()`
+to change the default value of the flag:
+```
+int main(int argc, char** argv) {
+  // Disables elapsed time by default.
+  ::testing::GTEST_FLAG(print_time) = false;
+
+  // This allows the user to override the flag on the command line.
+  ::testing::InitGoogleTest(&argc, argv);
+
+  return RUN_ALL_TESTS();
+}
+```
+
+## Selecting Tests ##
+
+This section shows various options for choosing which tests to run.
+
+### Listing Test Names ###
+
+Sometimes it is necessary to list the available tests in a program before
+running them so that a filter may be applied if needed. Including the flag
+`--gtest_list_tests` overrides all other flags and lists tests in the following
+format:
+```
+TestCase1.
+  TestName1
+  TestName2
+TestCase2.
+  TestName
+```
+
+None of the tests listed are actually run if the flag is provided. There is no
+corresponding environment variable for this flag.
+
+_Availability:_ Linux, Windows, Mac.
+
+### Running a Subset of the Tests ###
+
+By default, a Google Test program runs all tests the user has defined.
+Sometimes, you want to run only a subset of the tests (e.g. for debugging or
+quickly verifying a change). If you set the `GTEST_FILTER` environment variable
+or the `--gtest_filter` flag to a filter string, Google Test will only run the
+tests whose full names (in the form of `TestCaseName.TestName`) match the
+filter.
+
+The format of a filter is a '`:`'-separated list of wildcard patterns (called
+the positive patterns) optionally followed by a '`-`' and another
+'`:`'-separated pattern list (called the negative patterns). A test matches the
+filter if and only if it matches any of the positive patterns but does not
+match any of the negative patterns.
+
+A pattern may contain `'*'` (matches any string) or `'?'` (matches any single
+character). For convenience, the filter `'*-NegativePatterns'` can be also
+written as `'-NegativePatterns'`.
+
+For example:
+
+  * `./foo_test` Has no flag, and thus runs all its tests.
+  * `./foo_test --gtest_filter=*` Also runs everything, due to the single match-everything `*` value.
+  * `./foo_test --gtest_filter=FooTest.*` Runs everything in test case `FooTest`.
+  * `./foo_test --gtest_filter=*Null*:*Constructor*` Runs any test whose full name contains either `"Null"` or `"Constructor"`.
+  * `./foo_test --gtest_filter=-*DeathTest.*` Runs all non-death tests.
+  * `./foo_test --gtest_filter=FooTest.*-FooTest.Bar` Runs everything in test case `FooTest` except `FooTest.Bar`.
+
+_Availability:_ Linux, Windows, Mac.
+
+### Temporarily Disabling Tests ###
+
+If you have a broken test that you cannot fix right away, you can add the
+`DISABLED_` prefix to its name. This will exclude it from execution. This is
+better than commenting out the code or using `#if 0`, as disabled tests are
+still compiled (and thus won't rot).
+
+If you need to disable all tests in a test case, you can either add `DISABLED_`
+to the front of the name of each test, or alternatively add it to the front of
+the test case name.
+
+For example, the following tests won't be run by Google Test, even though they
+will still be compiled:
+
+```
+// Tests that Foo does Abc.
+TEST(FooTest, DISABLED_DoesAbc) { ... }
+
+class DISABLED_BarTest : public ::testing::Test { ... };
+
+// Tests that Bar does Xyz.
+TEST_F(DISABLED_BarTest, DoesXyz) { ... }
+```
+
+_Note:_ This feature should only be used for temporary pain-relief. You still
+have to fix the disabled tests at a later date. As a reminder, Google Test will
+print a banner warning you if a test program contains any disabled tests.
+
+_Tip:_ You can easily count the number of disabled tests you have
+using `grep`. This number can be used as a metric for improving your
+test quality.
+
+_Availability:_ Linux, Windows, Mac.
+
+### Temporarily Enabling Disabled Tests ###
+
+To include [disabled tests](#temporarily-disabling-tests) in test
+execution, just invoke the test program with the
+`--gtest_also_run_disabled_tests` flag or set the
+`GTEST_ALSO_RUN_DISABLED_TESTS` environment variable to a value other
+than `0`.  You can combine this with the
+[--gtest\_filter](#running-a-subset-of-the-tests) flag to further select
+which disabled tests to run.
+
+_Availability:_ Linux, Windows, Mac; since version 1.3.0.
+
+## Repeating the Tests ##
+
+Once in a while you'll run into a test whose result is hit-or-miss. Perhaps it
+will fail only 1% of the time, making it rather hard to reproduce the bug under
+a debugger. This can be a major source of frustration.
+
+The `--gtest_repeat` flag allows you to repeat all (or selected) test methods
+in a program many times. Hopefully, a flaky test will eventually fail and give
+you a chance to debug. Here's how to use it:
+
+| `$ foo_test --gtest_repeat=1000` | Repeat foo\_test 1000 times and don't stop at failures. |
+|:---------------------------------|:--------------------------------------------------------|
+| `$ foo_test --gtest_repeat=-1`   | A negative count means repeating forever.               |
+| `$ foo_test --gtest_repeat=1000 --gtest_break_on_failure` | Repeat foo\_test 1000 times, stopping at the first failure. This is especially useful when running under a debugger: when the testfails, it will drop into the debugger and you can then inspect variables and stacks. |
+| `$ foo_test --gtest_repeat=1000 --gtest_filter=FooBar` | Repeat the tests whose name matches the filter 1000 times. |
+
+If your test program contains global set-up/tear-down code registered
+using `AddGlobalTestEnvironment()`, it will be repeated in each
+iteration as well, as the flakiness may be in it. You can also specify
+the repeat count by setting the `GTEST_REPEAT` environment variable.
+
+_Availability:_ Linux, Windows, Mac.
+
+## Shuffling the Tests ##
+
+You can specify the `--gtest_shuffle` flag (or set the `GTEST_SHUFFLE`
+environment variable to `1`) to run the tests in a program in a random
+order. This helps to reveal bad dependencies between tests.
+
+By default, Google Test uses a random seed calculated from the current
+time. Therefore you'll get a different order every time. The console
+output includes the random seed value, such that you can reproduce an
+order-related test failure later. To specify the random seed
+explicitly, use the `--gtest_random_seed=SEED` flag (or set the
+`GTEST_RANDOM_SEED` environment variable), where `SEED` is an integer
+between 0 and 99999. The seed value 0 is special: it tells Google Test
+to do the default behavior of calculating the seed from the current
+time.
+
+If you combine this with `--gtest_repeat=N`, Google Test will pick a
+different random seed and re-shuffle the tests in each iteration.
+
+_Availability:_ Linux, Windows, Mac; since v1.4.0.
+
+## Controlling Test Output ##
+
+This section teaches how to tweak the way test results are reported.
+
+### Colored Terminal Output ###
+
+Google Test can use colors in its terminal output to make it easier to spot
+the separation between tests, and whether tests passed.
+
+You can set the GTEST\_COLOR environment variable or set the `--gtest_color`
+command line flag to `yes`, `no`, or `auto` (the default) to enable colors,
+disable colors, or let Google Test decide. When the value is `auto`, Google
+Test will use colors if and only if the output goes to a terminal and (on
+non-Windows platforms) the `TERM` environment variable is set to `xterm` or
+`xterm-color`.
+
+_Availability:_ Linux, Windows, Mac.
+
+### Suppressing the Elapsed Time ###
+
+By default, Google Test prints the time it takes to run each test.  To
+suppress that, run the test program with the `--gtest_print_time=0`
+command line flag.  Setting the `GTEST_PRINT_TIME` environment
+variable to `0` has the same effect.
+
+_Availability:_ Linux, Windows, Mac.  (In Google Test 1.3.0 and lower,
+the default behavior is that the elapsed time is **not** printed.)
+
+### Generating an XML Report ###
+
+Google Test can emit a detailed XML report to a file in addition to its normal
+textual output. The report contains the duration of each test, and thus can
+help you identify slow tests.
+
+To generate the XML report, set the `GTEST_OUTPUT` environment variable or the
+`--gtest_output` flag to the string `"xml:_path_to_output_file_"`, which will
+create the file at the given location. You can also just use the string
+`"xml"`, in which case the output can be found in the `test_detail.xml` file in
+the current directory.
+
+If you specify a directory (for example, `"xml:output/directory/"` on Linux or
+`"xml:output\directory\"` on Windows), Google Test will create the XML file in
+that directory, named after the test executable (e.g. `foo_test.xml` for test
+program `foo_test` or `foo_test.exe`). If the file already exists (perhaps left
+over from a previous run), Google Test will pick a different name (e.g.
+`foo_test_1.xml`) to avoid overwriting it.
+
+The report uses the format described here.  It is based on the
+`junitreport` Ant task and can be parsed by popular continuous build
+systems like [Hudson](https://hudson.dev.java.net/). Since that format
+was originally intended for Java, a little interpretation is required
+to make it apply to Google Test tests, as shown here:
+
+```
+<testsuites name="AllTests" ...>
+  <testsuite name="test_case_name" ...>
+    <testcase name="test_name" ...>
+      <failure message="..."/>
+      <failure message="..."/>
+      <failure message="..."/>
+    </testcase>
+  </testsuite>
+</testsuites>
+```
+
+  * The root `<testsuites>` element corresponds to the entire test program.
+  * `<testsuite>` elements correspond to Google Test test cases.
+  * `<testcase>` elements correspond to Google Test test functions.
+
+For instance, the following program
+
+```
+TEST(MathTest, Addition) { ... }
+TEST(MathTest, Subtraction) { ... }
+TEST(LogicTest, NonContradiction) { ... }
+```
+
+could generate this report:
+
+```
+<?xml version="1.0" encoding="UTF-8"?>
+<testsuites tests="3" failures="1" errors="0" time="35" name="AllTests">
+  <testsuite name="MathTest" tests="2" failures="1" errors="0" time="15">
+    <testcase name="Addition" status="run" time="7" classname="">
+      <failure message="Value of: add(1, 1)&#x0A; Actual: 3&#x0A;Expected: 2" type=""/>
+      <failure message="Value of: add(1, -1)&#x0A; Actual: 1&#x0A;Expected: 0" type=""/>
+    </testcase>
+    <testcase name="Subtraction" status="run" time="5" classname="">
+    </testcase>
+  </testsuite>
+  <testsuite name="LogicTest" tests="1" failures="0" errors="0" time="5">
+    <testcase name="NonContradiction" status="run" time="5" classname="">
+    </testcase>
+  </testsuite>
+</testsuites>
+```
+
+Things to note:
+
+  * The `tests` attribute of a `<testsuites>` or `<testsuite>` element tells how many test functions the Google Test program or test case contains, while the `failures` attribute tells how many of them failed.
+  * The `time` attribute expresses the duration of the test, test case, or entire test program in milliseconds.
+  * Each `<failure>` element corresponds to a single failed Google Test assertion.
+  * Some JUnit concepts don't apply to Google Test, yet we have to conform to the DTD. Therefore you'll see some dummy elements and attributes in the report. You can safely ignore these parts.
+
+_Availability:_ Linux, Windows, Mac.
+
+## Controlling How Failures Are Reported ##
+
+### Turning Assertion Failures into Break-Points ###
+
+When running test programs under a debugger, it's very convenient if the
+debugger can catch an assertion failure and automatically drop into interactive
+mode. Google Test's _break-on-failure_ mode supports this behavior.
+
+To enable it, set the `GTEST_BREAK_ON_FAILURE` environment variable to a value
+other than `0` . Alternatively, you can use the `--gtest_break_on_failure`
+command line flag.
+
+_Availability:_ Linux, Windows, Mac.
+
+### Disabling Catching Test-Thrown Exceptions ###
+
+Google Test can be used either with or without exceptions enabled.  If
+a test throws a C++ exception or (on Windows) a structured exception
+(SEH), by default Google Test catches it, reports it as a test
+failure, and continues with the next test method.  This maximizes the
+coverage of a test run.  Also, on Windows an uncaught exception will
+cause a pop-up window, so catching the exceptions allows you to run
+the tests automatically.
+
+When debugging the test failures, however, you may instead want the
+exceptions to be handled by the debugger, such that you can examine
+the call stack when an exception is thrown.  To achieve that, set the
+`GTEST_CATCH_EXCEPTIONS` environment variable to `0`, or use the
+`--gtest_catch_exceptions=0` flag when running the tests.
+
+**Availability**: Linux, Windows, Mac.
+
+### Letting Another Testing Framework Drive ###
+
+If you work on a project that has already been using another testing
+framework and is not ready to completely switch to Google Test yet,
+you can get much of Google Test's benefit by using its assertions in
+your existing tests.  Just change your `main()` function to look
+like:
+
+```
+#include "gtest/gtest.h"
+
+int main(int argc, char** argv) {
+  ::testing::GTEST_FLAG(throw_on_failure) = true;
+  // Important: Google Test must be initialized.
+  ::testing::InitGoogleTest(&argc, argv);
+
+  ... whatever your existing testing framework requires ...
+}
+```
+
+With that, you can use Google Test assertions in addition to the
+native assertions your testing framework provides, for example:
+
+```
+void TestFooDoesBar() {
+  Foo foo;
+  EXPECT_LE(foo.Bar(1), 100);     // A Google Test assertion.
+  CPPUNIT_ASSERT(foo.IsEmpty());  // A native assertion.
+}
+```
+
+If a Google Test assertion fails, it will print an error message and
+throw an exception, which will be treated as a failure by your host
+testing framework.  If you compile your code with exceptions disabled,
+a failed Google Test assertion will instead exit your program with a
+non-zero code, which will also signal a test failure to your test
+runner.
+
+If you don't write `::testing::GTEST_FLAG(throw_on_failure) = true;` in
+your `main()`, you can alternatively enable this feature by specifying
+the `--gtest_throw_on_failure` flag on the command-line or setting the
+`GTEST_THROW_ON_FAILURE` environment variable to a non-zero value.
+
+Death tests are _not_ supported when other test framework is used to organize tests.
+
+_Availability:_ Linux, Windows, Mac; since v1.3.0.
+
+## Distributing Test Functions to Multiple Machines ##
+
+If you have more than one machine you can use to run a test program,
+you might want to run the test functions in parallel and get the
+result faster.  We call this technique _sharding_, where each machine
+is called a _shard_.
+
+Google Test is compatible with test sharding.  To take advantage of
+this feature, your test runner (not part of Google Test) needs to do
+the following:
+
+  1. Allocate a number of machines (shards) to run the tests.
+  1. On each shard, set the `GTEST_TOTAL_SHARDS` environment variable to the total number of shards.  It must be the same for all shards.
+  1. On each shard, set the `GTEST_SHARD_INDEX` environment variable to the index of the shard.  Different shards must be assigned different indices, which must be in the range `[0, GTEST_TOTAL_SHARDS - 1]`.
+  1. Run the same test program on all shards.  When Google Test sees the above two environment variables, it will select a subset of the test functions to run.  Across all shards, each test function in the program will be run exactly once.
+  1. Wait for all shards to finish, then collect and report the results.
+
+Your project may have tests that were written without Google Test and
+thus don't understand this protocol.  In order for your test runner to
+figure out which test supports sharding, it can set the environment
+variable `GTEST_SHARD_STATUS_FILE` to a non-existent file path.  If a
+test program supports sharding, it will create this file to
+acknowledge the fact (the actual contents of the file are not
+important at this time; although we may stick some useful information
+in it in the future.); otherwise it will not create it.
+
+Here's an example to make it clear.  Suppose you have a test program
+`foo_test` that contains the following 5 test functions:
+```
+TEST(A, V)
+TEST(A, W)
+TEST(B, X)
+TEST(B, Y)
+TEST(B, Z)
+```
+and you have 3 machines at your disposal.  To run the test functions in
+parallel, you would set `GTEST_TOTAL_SHARDS` to 3 on all machines, and
+set `GTEST_SHARD_INDEX` to 0, 1, and 2 on the machines respectively.
+Then you would run the same `foo_test` on each machine.
+
+Google Test reserves the right to change how the work is distributed
+across the shards, but here's one possible scenario:
+
+  * Machine #0 runs `A.V` and `B.X`.
+  * Machine #1 runs `A.W` and `B.Y`.
+  * Machine #2 runs `B.Z`.
+
+_Availability:_ Linux, Windows, Mac; since version 1.3.0.
+
+# Fusing Google Test Source Files #
+
+Google Test's implementation consists of ~30 files (excluding its own
+tests).  Sometimes you may want them to be packaged up in two files (a
+`.h` and a `.cc`) instead, such that you can easily copy them to a new
+machine and start hacking there.  For this we provide an experimental
+Python script `fuse_gtest_files.py` in the `scripts/` directory (since release 1.3.0).
+Assuming you have Python 2.4 or above installed on your machine, just
+go to that directory and run
+```
+python fuse_gtest_files.py OUTPUT_DIR
+```
+
+and you should see an `OUTPUT_DIR` directory being created with files
+`gtest/gtest.h` and `gtest/gtest-all.cc` in it.  These files contain
+everything you need to use Google Test.  Just copy them to anywhere
+you want and you are ready to write tests.  You can use the
+[scripts/test/Makefile](../scripts/test/Makefile)
+file as an example on how to compile your tests against them.
+
+# Where to Go from Here #
+
+Congratulations! You've now learned more advanced Google Test tools and are
+ready to tackle more complex testing tasks. If you want to dive even deeper, you
+can read the [Frequently-Asked Questions](FAQ.md).
diff --git a/src/external/googletest/googletest/docs/DevGuide.md b/src/external/googletest/googletest/docs/DevGuide.md
new file mode 100644 (file)
index 0000000..06467a3
--- /dev/null
@@ -0,0 +1,126 @@
+
+
+If you are interested in understanding the internals of Google Test,
+building from source, or contributing ideas or modifications to the
+project, then this document is for you.
+
+# Introduction #
+
+First, let's give you some background of the project.
+
+## Licensing ##
+
+All Google Test source and pre-built packages are provided under the [New BSD License](http://www.opensource.org/licenses/bsd-license.php).
+
+## The Google Test Community ##
+
+The Google Test community exists primarily through the [discussion group](http://groups.google.com/group/googletestframework) and the GitHub repository.
+You are definitely encouraged to contribute to the
+discussion and you can also help us to keep the effectiveness of the
+group high by following and promoting the guidelines listed here.
+
+### Please Be Friendly ###
+
+Showing courtesy and respect to others is a vital part of the Google
+culture, and we strongly encourage everyone participating in Google
+Test development to join us in accepting nothing less. Of course,
+being courteous is not the same as failing to constructively disagree
+with each other, but it does mean that we should be respectful of each
+other when enumerating the 42 technical reasons that a particular
+proposal may not be the best choice. There's never a reason to be
+antagonistic or dismissive toward anyone who is sincerely trying to
+contribute to a discussion.
+
+Sure, C++ testing is serious business and all that, but it's also
+a lot of fun. Let's keep it that way. Let's strive to be one of the
+friendliest communities in all of open source.
+
+As always, discuss Google Test in the official GoogleTest discussion group.
+You don't have to actually submit code in order to sign up. Your participation
+itself is a valuable contribution.
+
+# Working with the Code #
+
+If you want to get your hands dirty with the code inside Google Test,
+this is the section for you.
+
+## Compiling from Source ##
+
+Once you check out the code, you can find instructions on how to
+compile it in the [README](../README.md) file.
+
+## Testing ##
+
+A testing framework is of no good if itself is not thoroughly tested.
+Tests should be written for any new code, and changes should be
+verified to not break existing tests before they are submitted for
+review. To perform the tests, follow the instructions in
+[README](../README.md) and verify that there are no failures.
+
+# Contributing Code #
+
+We are excited that Google Test is now open source, and hope to get
+great patches from the community. Before you fire up your favorite IDE
+and begin hammering away at that new feature, though, please take the
+time to read this section and understand the process. While it seems
+rigorous, we want to keep a high standard of quality in the code
+base.
+
+## Contributor License Agreements ##
+
+You must sign a Contributor License Agreement (CLA) before we can
+accept any code.  The CLA protects you and us.
+
+  * If you are an individual writing original source code and you're sure you own the intellectual property, then you'll need to sign an [individual CLA](http://code.google.com/legal/individual-cla-v1.0.html).
+  * If you work for a company that wants to allow you to contribute your work to Google Test, then you'll need to sign a [corporate CLA](http://code.google.com/legal/corporate-cla-v1.0.html).
+
+Follow either of the two links above to access the appropriate CLA and
+instructions for how to sign and return it.
+
+## Coding Style ##
+
+To keep the source consistent, readable, diffable and easy to merge,
+we use a fairly rigid coding style, as defined by the [google-styleguide](http://code.google.com/p/google-styleguide/) project.  All patches will be expected
+to conform to the style outlined [here](http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml).
+
+## Updating Generated Code ##
+
+Some of Google Test's source files are generated by the Pump tool (a
+Python script).  If you need to update such files, please modify the
+source (`foo.h.pump`) and re-generate the C++ file using Pump.  You
+can read the PumpManual for details.
+
+## Submitting Patches ##
+
+Please do submit code. Here's what you need to do:
+
+  1. A submission should be a set of changes that addresses one issue in the [issue tracker](https://github.com/google/googletest/issues). Please don't mix more than one logical change per submittal, because it makes the history hard to follow. If you want to make a change that doesn't have a corresponding issue in the issue tracker, please create one.
+  1. Also, coordinate with team members that are listed on the issue in question. This ensures that work isn't being duplicated and communicating your plan early also generally leads to better patches.
+  1. Ensure that your code adheres to the [Google Test source code style](#Coding_Style.md).
+  1. Ensure that there are unit tests for your code.
+  1. Sign a Contributor License Agreement.
+  1. Create a Pull Request in the usual way.
+
+## Google Test Committers ##
+
+The current members of the Google Test engineering team are the only
+committers at present. In the great tradition of eating one's own
+dogfood, we will be requiring each new Google Test engineering team
+member to earn the right to become a committer by following the
+procedures in this document, writing consistently great code, and
+demonstrating repeatedly that he or she truly gets the zen of Google
+Test.
+
+# Release Process #
+
+We follow a typical release process:
+
+  1. A release branch named `release-X.Y` is created.
+  1. Bugs are fixed and features are added in trunk; those individual patches are merged into the release branch until it's stable.
+  1. An individual point release (the `Z` in `X.Y.Z`) is made by creating a tag from the branch.
+  1. Repeat steps 2 and 3 throughout one release cycle (as determined by features or time).
+  1. Go back to step 1 to create another release branch and so on.
+
+---
+
+This page is based on the [Making GWT Better](http://code.google.com/webtoolkit/makinggwtbetter.html) guide from the [Google Web Toolkit](http://code.google.com/webtoolkit/) project.  Except as otherwise [noted](http://code.google.com/policies.html#restrictions), the content of this page is licensed under the [Creative Commons Attribution 2.5 License](http://creativecommons.org/licenses/by/2.5/).
diff --git a/src/external/googletest/googletest/docs/Documentation.md b/src/external/googletest/googletest/docs/Documentation.md
new file mode 100644 (file)
index 0000000..8ca1aac
--- /dev/null
@@ -0,0 +1,14 @@
+This page lists all documentation wiki pages for Google Test **(the SVN trunk version)**
+-- **if you use a released version of Google Test, please read the
+documentation for that specific version instead.**
+
+  * [Primer](Primer.md) -- start here if you are new to Google Test.
+  * [Samples](Samples.md) -- learn from examples.
+  * [AdvancedGuide](AdvancedGuide.md) -- learn more about Google Test.
+  * [XcodeGuide](XcodeGuide.md) -- how to use Google Test in Xcode on Mac.
+  * [Frequently-Asked Questions](FAQ.md) -- check here before asking a question on the mailing list.
+
+To contribute code to Google Test, read:
+
+  * [DevGuide](DevGuide.md) -- read this _before_ writing your first patch.
+  * [PumpManual](PumpManual.md) -- how we generate some of Google Test's source files.
\ No newline at end of file
diff --git a/src/external/googletest/googletest/docs/FAQ.md b/src/external/googletest/googletest/docs/FAQ.md
new file mode 100644 (file)
index 0000000..5fd6cb7
--- /dev/null
@@ -0,0 +1,1087 @@
+
+
+If you cannot find the answer to your question here, and you have read
+[Primer](Primer.md) and [AdvancedGuide](AdvancedGuide.md), send it to
+googletestframework@googlegroups.com.
+
+## Why should I use Google Test instead of my favorite C++ testing framework? ##
+
+First, let us say clearly that we don't want to get into the debate of
+which C++ testing framework is **the best**.  There exist many fine
+frameworks for writing C++ tests, and we have tremendous respect for
+the developers and users of them.  We don't think there is (or will
+be) a single best framework - you have to pick the right tool for the
+particular task you are tackling.
+
+We created Google Test because we couldn't find the right combination
+of features and conveniences in an existing framework to satisfy _our_
+needs.  The following is a list of things that _we_ like about Google
+Test.  We don't claim them to be unique to Google Test - rather, the
+combination of them makes Google Test the choice for us.  We hope this
+list can help you decide whether it is for you too.
+
+  * Google Test is designed to be portable: it doesn't require exceptions or RTTI; it works around various bugs in various compilers and environments; etc.  As a result, it works on Linux, Mac OS X, Windows and several embedded operating systems.
+  * Nonfatal assertions (`EXPECT_*`) have proven to be great time savers, as they allow a test to report multiple failures in a single edit-compile-test cycle.
+  * It's easy to write assertions that generate informative messages: you just use the stream syntax to append any additional information, e.g. `ASSERT_EQ(5, Foo(i)) << " where i = " << i;`.  It doesn't require a new set of macros or special functions.
+  * Google Test automatically detects your tests and doesn't require you to enumerate them in order to run them.
+  * Death tests are pretty handy for ensuring that your asserts in production code are triggered by the right conditions.
+  * `SCOPED_TRACE` helps you understand the context of an assertion failure when it comes from inside a sub-routine or loop.
+  * You can decide which tests to run using name patterns.  This saves time when you want to quickly reproduce a test failure.
+  * Google Test can generate XML test result reports that can be parsed by popular continuous build system like Hudson.
+  * Simple things are easy in Google Test, while hard things are possible: in addition to advanced features like [global test environments](AdvancedGuide.md#global-set-up-and-tear-down) and tests parameterized by [values](AdvancedGuide.md#value-parameterized-tests) or [types](docs/AdvancedGuide.md#typed-tests), Google Test supports various ways for the user to extend the framework -- if Google Test doesn't do something out of the box, chances are that a user can implement the feature using Google Test's public API, without changing Google Test itself.  In particular, you can:
+    * expand your testing vocabulary by defining [custom predicates](AdvancedGuide.md#predicate-assertions-for-better-error-messages),
+    * teach Google Test how to [print your types](AdvancedGuide.md#teaching-google-test-how-to-print-your-values),
+    * define your own testing macros or utilities and verify them using Google Test's [Service Provider Interface](AdvancedGuide.md#catching-failures), and
+    * reflect on the test cases or change the test output format by intercepting the [test events](AdvancedGuide.md#extending-google-test-by-handling-test-events).
+
+## I'm getting warnings when compiling Google Test.  Would you fix them? ##
+
+We strive to minimize compiler warnings Google Test generates.  Before releasing a new version, we test to make sure that it doesn't generate warnings when compiled using its CMake script on Windows, Linux, and Mac OS.
+
+Unfortunately, this doesn't mean you are guaranteed to see no warnings when compiling Google Test in your environment:
+
+  * You may be using a different compiler as we use, or a different version of the same compiler.  We cannot possibly test for all compilers.
+  * You may be compiling on a different platform as we do.
+  * Your project may be using different compiler flags as we do.
+
+It is not always possible to make Google Test warning-free for everyone.  Or, it may not be desirable if the warning is rarely enabled and fixing the violations makes the code more complex.
+
+If you see warnings when compiling Google Test, we suggest that you use the `-isystem` flag (assuming your are using GCC) to mark Google Test headers as system headers.  That'll suppress warnings from Google Test headers.
+
+## Why should not test case names and test names contain underscore? ##
+
+Underscore (`_`) is special, as C++ reserves the following to be used by
+the compiler and the standard library:
+
+  1. any identifier that starts with an `_` followed by an upper-case letter, and
+  1. any identifier that containers two consecutive underscores (i.e. `__`) _anywhere_ in its name.
+
+User code is _prohibited_ from using such identifiers.
+
+Now let's look at what this means for `TEST` and `TEST_F`.
+
+Currently `TEST(TestCaseName, TestName)` generates a class named
+`TestCaseName_TestName_Test`.  What happens if `TestCaseName` or `TestName`
+contains `_`?
+
+  1. If `TestCaseName` starts with an `_` followed by an upper-case letter (say, `_Foo`), we end up with `_Foo_TestName_Test`, which is reserved and thus invalid.
+  1. If `TestCaseName` ends with an `_` (say, `Foo_`), we get `Foo__TestName_Test`, which is invalid.
+  1. If `TestName` starts with an `_` (say, `_Bar`), we get `TestCaseName__Bar_Test`, which is invalid.
+  1. If `TestName` ends with an `_` (say, `Bar_`), we get `TestCaseName_Bar__Test`, which is invalid.
+
+So clearly `TestCaseName` and `TestName` cannot start or end with `_`
+(Actually, `TestCaseName` can start with `_` -- as long as the `_` isn't
+followed by an upper-case letter.  But that's getting complicated.  So
+for simplicity we just say that it cannot start with `_`.).
+
+It may seem fine for `TestCaseName` and `TestName` to contain `_` in the
+middle.  However, consider this:
+``` cpp
+TEST(Time, Flies_Like_An_Arrow) { ... }
+TEST(Time_Flies, Like_An_Arrow) { ... }
+```
+
+Now, the two `TEST`s will both generate the same class
+(`Time_Files_Like_An_Arrow_Test`).  That's not good.
+
+So for simplicity, we just ask the users to avoid `_` in `TestCaseName`
+and `TestName`.  The rule is more constraining than necessary, but it's
+simple and easy to remember.  It also gives Google Test some wiggle
+room in case its implementation needs to change in the future.
+
+If you violate the rule, there may not be immediately consequences,
+but your test may (just may) break with a new compiler (or a new
+version of the compiler you are using) or with a new version of Google
+Test.  Therefore it's best to follow the rule.
+
+## Why is it not recommended to install a pre-compiled copy of Google Test (for example, into /usr/local)? ##
+
+In the early days, we said that you could install
+compiled Google Test libraries on `*`nix systems using `make install`.
+Then every user of your machine can write tests without
+recompiling Google Test.
+
+This seemed like a good idea, but it has a
+got-cha: every user needs to compile his tests using the _same_ compiler
+flags used to compile the installed Google Test libraries; otherwise
+he may run into undefined behaviors (i.e. the tests can behave
+strangely and may even crash for no obvious reasons).
+
+Why?  Because C++ has this thing called the One-Definition Rule: if
+two C++ source files contain different definitions of the same
+class/function/variable, and you link them together, you violate the
+rule.  The linker may or may not catch the error (in many cases it's
+not required by the C++ standard to catch the violation).  If it
+doesn't, you get strange run-time behaviors that are unexpected and
+hard to debug.
+
+If you compile Google Test and your test code using different compiler
+flags, they may see different definitions of the same
+class/function/variable (e.g. due to the use of `#if` in Google Test).
+Therefore, for your sanity, we recommend to avoid installing pre-compiled
+Google Test libraries.  Instead, each project should compile
+Google Test itself such that it can be sure that the same flags are
+used for both Google Test and the tests.
+
+## How do I generate 64-bit binaries on Windows (using Visual Studio 2008)? ##
+
+(Answered by Trevor Robinson)
+
+Load the supplied Visual Studio solution file, either `msvc\gtest-md.sln` or
+`msvc\gtest.sln`. Go through the migration wizard to migrate the
+solution and project files to Visual Studio 2008. Select
+`Configuration Manager...` from the `Build` menu. Select `<New...>` from
+the `Active solution platform` dropdown.  Select `x64` from the new
+platform dropdown, leave `Copy settings from` set to `Win32` and
+`Create new project platforms` checked, then click `OK`. You now have
+`Win32` and `x64` platform configurations, selectable from the
+`Standard` toolbar, which allow you to toggle between building 32-bit or
+64-bit binaries (or both at once using Batch Build).
+
+In order to prevent build output files from overwriting one another,
+you'll need to change the `Intermediate Directory` settings for the
+newly created platform configuration across all the projects. To do
+this, multi-select (e.g. using shift-click) all projects (but not the
+solution) in the `Solution Explorer`. Right-click one of them and
+select `Properties`. In the left pane, select `Configuration Properties`,
+and from the `Configuration` dropdown, select `All Configurations`.
+Make sure the selected platform is `x64`. For the
+`Intermediate Directory` setting, change the value from
+`$(PlatformName)\$(ConfigurationName)` to
+`$(OutDir)\$(ProjectName)`. Click `OK` and then build the
+solution. When the build is complete, the 64-bit binaries will be in
+the `msvc\x64\Debug` directory.
+
+## Can I use Google Test on MinGW? ##
+
+We haven't tested this ourselves, but Per Abrahamsen reported that he
+was able to compile and install Google Test successfully when using
+MinGW from Cygwin.  You'll need to configure it with:
+
+`PATH/TO/configure CC="gcc -mno-cygwin" CXX="g++ -mno-cygwin"`
+
+You should be able to replace the `-mno-cygwin` option with direct links
+to the real MinGW binaries, but we haven't tried that.
+
+Caveats:
+
+  * There are many warnings when compiling.
+  * `make check` will produce some errors as not all tests for Google Test itself are compatible with MinGW.
+
+We also have reports on successful cross compilation of Google Test
+MinGW binaries on Linux using
+[these instructions](http://wiki.wxwidgets.org/Cross-Compiling_Under_Linux#Cross-compiling_under_Linux_for_MS_Windows)
+on the WxWidgets site.
+
+Please contact `googletestframework@googlegroups.com` if you are
+interested in improving the support for MinGW.
+
+## Why does Google Test support EXPECT\_EQ(NULL, ptr) and ASSERT\_EQ(NULL, ptr) but not EXPECT\_NE(NULL, ptr) and ASSERT\_NE(NULL, ptr)? ##
+
+Due to some peculiarity of C++, it requires some non-trivial template
+meta programming tricks to support using `NULL` as an argument of the
+`EXPECT_XX()` and `ASSERT_XX()` macros. Therefore we only do it where
+it's most needed (otherwise we make the implementation of Google Test
+harder to maintain and more error-prone than necessary).
+
+The `EXPECT_EQ()` macro takes the _expected_ value as its first
+argument and the _actual_ value as the second. It's reasonable that
+someone wants to write `EXPECT_EQ(NULL, some_expression)`, and this
+indeed was requested several times. Therefore we implemented it.
+
+The need for `EXPECT_NE(NULL, ptr)` isn't nearly as strong. When the
+assertion fails, you already know that `ptr` must be `NULL`, so it
+doesn't add any information to print ptr in this case. That means
+`EXPECT_TRUE(ptr != NULL)` works just as well.
+
+If we were to support `EXPECT_NE(NULL, ptr)`, for consistency we'll
+have to support `EXPECT_NE(ptr, NULL)` as well, as unlike `EXPECT_EQ`,
+we don't have a convention on the order of the two arguments for
+`EXPECT_NE`. This means using the template meta programming tricks
+twice in the implementation, making it even harder to understand and
+maintain. We believe the benefit doesn't justify the cost.
+
+Finally, with the growth of Google Mock's [matcher](../../googlemock/docs/CookBook.md#using-matchers-in-google-test-assertions) library, we are
+encouraging people to use the unified `EXPECT_THAT(value, matcher)`
+syntax more often in tests. One significant advantage of the matcher
+approach is that matchers can be easily combined to form new matchers,
+while the `EXPECT_NE`, etc, macros cannot be easily
+combined. Therefore we want to invest more in the matchers than in the
+`EXPECT_XX()` macros.
+
+## Does Google Test support running tests in parallel? ##
+
+Test runners tend to be tightly coupled with the build/test
+environment, and Google Test doesn't try to solve the problem of
+running tests in parallel.  Instead, we tried to make Google Test work
+nicely with test runners.  For example, Google Test's XML report
+contains the time spent on each test, and its `gtest_list_tests` and
+`gtest_filter` flags can be used for splitting the execution of test
+methods into multiple processes.  These functionalities can help the
+test runner run the tests in parallel.
+
+## Why don't Google Test run the tests in different threads to speed things up? ##
+
+It's difficult to write thread-safe code.  Most tests are not written
+with thread-safety in mind, and thus may not work correctly in a
+multi-threaded setting.
+
+If you think about it, it's already hard to make your code work when
+you know what other threads are doing.  It's much harder, and
+sometimes even impossible, to make your code work when you don't know
+what other threads are doing (remember that test methods can be added,
+deleted, or modified after your test was written).  If you want to run
+the tests in parallel, you'd better run them in different processes.
+
+## Why aren't Google Test assertions implemented using exceptions? ##
+
+Our original motivation was to be able to use Google Test in projects
+that disable exceptions.  Later we realized some additional benefits
+of this approach:
+
+  1. Throwing in a destructor is undefined behavior in C++.  Not using exceptions means Google Test's assertions are safe to use in destructors.
+  1. The `EXPECT_*` family of macros will continue even after a failure, allowing multiple failures in a `TEST` to be reported in a single run. This is a popular feature, as in C++ the edit-compile-test cycle is usually quite long and being able to fixing more than one thing at a time is a blessing.
+  1. If assertions are implemented using exceptions, a test may falsely ignore a failure if it's caught by user code:
+``` cpp
+try { ... ASSERT_TRUE(...) ... }
+catch (...) { ... }
+```
+The above code will pass even if the `ASSERT_TRUE` throws.  While it's unlikely for someone to write this in a test, it's possible to run into this pattern when you write assertions in callbacks that are called by the code under test.
+
+The downside of not using exceptions is that `ASSERT_*` (implemented
+using `return`) will only abort the current function, not the current
+`TEST`.
+
+## Why do we use two different macros for tests with and without fixtures? ##
+
+Unfortunately, C++'s macro system doesn't allow us to use the same
+macro for both cases.  One possibility is to provide only one macro
+for tests with fixtures, and require the user to define an empty
+fixture sometimes:
+
+``` cpp
+class FooTest : public ::testing::Test {};
+
+TEST_F(FooTest, DoesThis) { ... }
+```
+or
+``` cpp
+typedef ::testing::Test FooTest;
+
+TEST_F(FooTest, DoesThat) { ... }
+```
+
+Yet, many people think this is one line too many. :-) Our goal was to
+make it really easy to write tests, so we tried to make simple tests
+trivial to create.  That means using a separate macro for such tests.
+
+We think neither approach is ideal, yet either of them is reasonable.
+In the end, it probably doesn't matter much either way.
+
+## Why don't we use structs as test fixtures? ##
+
+We like to use structs only when representing passive data.  This
+distinction between structs and classes is good for documenting the
+intent of the code's author.  Since test fixtures have logic like
+`SetUp()` and `TearDown()`, they are better defined as classes.
+
+## Why are death tests implemented as assertions instead of using a test runner? ##
+
+Our goal was to make death tests as convenient for a user as C++
+possibly allows.  In particular:
+
+  * The runner-style requires to split the information into two pieces: the definition of the death test itself, and the specification for the runner on how to run the death test and what to expect.  The death test would be written in C++, while the runner spec may or may not be.  A user needs to carefully keep the two in sync. `ASSERT_DEATH(statement, expected_message)` specifies all necessary information in one place, in one language, without boilerplate code. It is very declarative.
+  * `ASSERT_DEATH` has a similar syntax and error-reporting semantics as other Google Test assertions, and thus is easy to learn.
+  * `ASSERT_DEATH` can be mixed with other assertions and other logic at your will.  You are not limited to one death test per test method. For example, you can write something like:
+``` cpp
+    if (FooCondition()) {
+      ASSERT_DEATH(Bar(), "blah");
+    } else {
+      ASSERT_EQ(5, Bar());
+    }
+```
+If you prefer one death test per test method, you can write your tests in that style too, but we don't want to impose that on the users.  The fewer artificial limitations the better.
+  * `ASSERT_DEATH` can reference local variables in the current function, and you can decide how many death tests you want based on run-time information.  For example,
+``` cpp
+    const int count = GetCount();  // Only known at run time.
+    for (int i = 1; i <= count; i++) {
+      ASSERT_DEATH({
+        double* buffer = new double[i];
+        ... initializes buffer ...
+        Foo(buffer, i)
+      }, "blah blah");
+    }
+```
+The runner-based approach tends to be more static and less flexible, or requires more user effort to get this kind of flexibility.
+
+Another interesting thing about `ASSERT_DEATH` is that it calls `fork()`
+to create a child process to run the death test.  This is lightening
+fast, as `fork()` uses copy-on-write pages and incurs almost zero
+overhead, and the child process starts from the user-supplied
+statement directly, skipping all global and local initialization and
+any code leading to the given statement.  If you launch the child
+process from scratch, it can take seconds just to load everything and
+start running if the test links to many libraries dynamically.
+
+## My death test modifies some state, but the change seems lost after the death test finishes. Why? ##
+
+Death tests (`EXPECT_DEATH`, etc) are executed in a sub-process s.t. the
+expected crash won't kill the test program (i.e. the parent process). As a
+result, any in-memory side effects they incur are observable in their
+respective sub-processes, but not in the parent process. You can think of them
+as running in a parallel universe, more or less.
+
+## The compiler complains about "undefined references" to some static const member variables, but I did define them in the class body. What's wrong? ##
+
+If your class has a static data member:
+
+``` cpp
+// foo.h
+class Foo {
+  ...
+  static const int kBar = 100;
+};
+```
+
+You also need to define it _outside_ of the class body in `foo.cc`:
+
+``` cpp
+const int Foo::kBar;  // No initializer here.
+```
+
+Otherwise your code is **invalid C++**, and may break in unexpected ways. In
+particular, using it in Google Test comparison assertions (`EXPECT_EQ`, etc)
+will generate an "undefined reference" linker error.
+
+## I have an interface that has several implementations. Can I write a set of tests once and repeat them over all the implementations? ##
+
+Google Test doesn't yet have good support for this kind of tests, or
+data-driven tests in general. We hope to be able to make improvements in this
+area soon.
+
+## Can I derive a test fixture from another? ##
+
+Yes.
+
+Each test fixture has a corresponding and same named test case. This means only
+one test case can use a particular fixture. Sometimes, however, multiple test
+cases may want to use the same or slightly different fixtures. For example, you
+may want to make sure that all of a GUI library's test cases don't leak
+important system resources like fonts and brushes.
+
+In Google Test, you share a fixture among test cases by putting the shared
+logic in a base test fixture, then deriving from that base a separate fixture
+for each test case that wants to use this common logic. You then use `TEST_F()`
+to write tests using each derived fixture.
+
+Typically, your code looks like this:
+
+``` cpp
+// Defines a base test fixture.
+class BaseTest : public ::testing::Test {
+  protected:
+   ...
+};
+
+// Derives a fixture FooTest from BaseTest.
+class FooTest : public BaseTest {
+  protected:
+    virtual void SetUp() {
+      BaseTest::SetUp();  // Sets up the base fixture first.
+      ... additional set-up work ...
+    }
+    virtual void TearDown() {
+      ... clean-up work for FooTest ...
+      BaseTest::TearDown();  // Remember to tear down the base fixture
+                             // after cleaning up FooTest!
+    }
+    ... functions and variables for FooTest ...
+};
+
+// Tests that use the fixture FooTest.
+TEST_F(FooTest, Bar) { ... }
+TEST_F(FooTest, Baz) { ... }
+
+... additional fixtures derived from BaseTest ...
+```
+
+If necessary, you can continue to derive test fixtures from a derived fixture.
+Google Test has no limit on how deep the hierarchy can be.
+
+For a complete example using derived test fixtures, see
+[sample5](../samples/sample5_unittest.cc).
+
+## My compiler complains "void value not ignored as it ought to be." What does this mean? ##
+
+You're probably using an `ASSERT_*()` in a function that doesn't return `void`.
+`ASSERT_*()` can only be used in `void` functions.
+
+## My death test hangs (or seg-faults). How do I fix it? ##
+
+In Google Test, death tests are run in a child process and the way they work is
+delicate. To write death tests you really need to understand how they work.
+Please make sure you have read this.
+
+In particular, death tests don't like having multiple threads in the parent
+process. So the first thing you can try is to eliminate creating threads
+outside of `EXPECT_DEATH()`.
+
+Sometimes this is impossible as some library you must use may be creating
+threads before `main()` is even reached. In this case, you can try to minimize
+the chance of conflicts by either moving as many activities as possible inside
+`EXPECT_DEATH()` (in the extreme case, you want to move everything inside), or
+leaving as few things as possible in it. Also, you can try to set the death
+test style to `"threadsafe"`, which is safer but slower, and see if it helps.
+
+If you go with thread-safe death tests, remember that they rerun the test
+program from the beginning in the child process. Therefore make sure your
+program can run side-by-side with itself and is deterministic.
+
+In the end, this boils down to good concurrent programming. You have to make
+sure that there is no race conditions or dead locks in your program. No silver
+bullet - sorry!
+
+## Should I use the constructor/destructor of the test fixture or the set-up/tear-down function? ##
+
+The first thing to remember is that Google Test does not reuse the
+same test fixture object across multiple tests. For each `TEST_F`,
+Google Test will create a fresh test fixture object, _immediately_
+call `SetUp()`, run the test body, call `TearDown()`, and then
+_immediately_ delete the test fixture object.
+
+When you need to write per-test set-up and tear-down logic, you have
+the choice between using the test fixture constructor/destructor or
+`SetUp()/TearDown()`. The former is usually preferred, as it has the
+following benefits:
+
+  * By initializing a member variable in the constructor, we have the option to make it `const`, which helps prevent accidental changes to its value and makes the tests more obviously correct.
+  * In case we need to subclass the test fixture class, the subclass' constructor is guaranteed to call the base class' constructor first, and the subclass' destructor is guaranteed to call the base class' destructor afterward. With `SetUp()/TearDown()`, a subclass may make the mistake of forgetting to call the base class' `SetUp()/TearDown()` or call them at the wrong moment.
+
+You may still want to use `SetUp()/TearDown()` in the following rare cases:
+  * If the tear-down operation could throw an exception, you must use `TearDown()` as opposed to the destructor, as throwing in a destructor leads to undefined behavior and usually will kill your program right away. Note that many standard libraries (like STL) may throw when exceptions are enabled in the compiler. Therefore you should prefer `TearDown()` if you want to write portable tests that work with or without exceptions.
+  * The assertion macros throw an exception when flag `--gtest_throw_on_failure` is specified. Therefore, you shouldn't use Google Test assertions in a destructor if you plan to run your tests with this flag.
+  * In a constructor or destructor, you cannot make a virtual function call on this object. (You can call a method declared as virtual, but it will be statically bound.) Therefore, if you need to call a method that will be overriden in a derived class, you have to use `SetUp()/TearDown()`.
+
+## The compiler complains "no matching function to call" when I use ASSERT\_PREDn. How do I fix it? ##
+
+If the predicate function you use in `ASSERT_PRED*` or `EXPECT_PRED*` is
+overloaded or a template, the compiler will have trouble figuring out which
+overloaded version it should use. `ASSERT_PRED_FORMAT*` and
+`EXPECT_PRED_FORMAT*` don't have this problem.
+
+If you see this error, you might want to switch to
+`(ASSERT|EXPECT)_PRED_FORMAT*`, which will also give you a better failure
+message. If, however, that is not an option, you can resolve the problem by
+explicitly telling the compiler which version to pick.
+
+For example, suppose you have
+
+``` cpp
+bool IsPositive(int n) {
+  return n > 0;
+}
+bool IsPositive(double x) {
+  return x > 0;
+}
+```
+
+you will get a compiler error if you write
+
+``` cpp
+EXPECT_PRED1(IsPositive, 5);
+```
+
+However, this will work:
+
+``` cpp
+EXPECT_PRED1(*static_cast<bool (*)(int)>*(IsPositive), 5);
+```
+
+(The stuff inside the angled brackets for the `static_cast` operator is the
+type of the function pointer for the `int`-version of `IsPositive()`.)
+
+As another example, when you have a template function
+
+``` cpp
+template <typename T>
+bool IsNegative(T x) {
+  return x < 0;
+}
+```
+
+you can use it in a predicate assertion like this:
+
+``` cpp
+ASSERT_PRED1(IsNegative*<int>*, -5);
+```
+
+Things are more interesting if your template has more than one parameters. The
+following won't compile:
+
+``` cpp
+ASSERT_PRED2(*GreaterThan<int, int>*, 5, 0);
+```
+
+
+as the C++ pre-processor thinks you are giving `ASSERT_PRED2` 4 arguments,
+which is one more than expected. The workaround is to wrap the predicate
+function in parentheses:
+
+``` cpp
+ASSERT_PRED2(*(GreaterThan<int, int>)*, 5, 0);
+```
+
+
+## My compiler complains about "ignoring return value" when I call RUN\_ALL\_TESTS(). Why? ##
+
+Some people had been ignoring the return value of `RUN_ALL_TESTS()`. That is,
+instead of
+
+``` cpp
+return RUN_ALL_TESTS();
+```
+
+they write
+
+``` cpp
+RUN_ALL_TESTS();
+```
+
+This is wrong and dangerous. A test runner needs to see the return value of
+`RUN_ALL_TESTS()` in order to determine if a test has passed. If your `main()`
+function ignores it, your test will be considered successful even if it has a
+Google Test assertion failure. Very bad.
+
+To help the users avoid this dangerous bug, the implementation of
+`RUN_ALL_TESTS()` causes gcc to raise this warning, when the return value is
+ignored. If you see this warning, the fix is simple: just make sure its value
+is used as the return value of `main()`.
+
+## My compiler complains that a constructor (or destructor) cannot return a value. What's going on? ##
+
+Due to a peculiarity of C++, in order to support the syntax for streaming
+messages to an `ASSERT_*`, e.g.
+
+``` cpp
+ASSERT_EQ(1, Foo()) << "blah blah" << foo;
+```
+
+we had to give up using `ASSERT*` and `FAIL*` (but not `EXPECT*` and
+`ADD_FAILURE*`) in constructors and destructors. The workaround is to move the
+content of your constructor/destructor to a private void member function, or
+switch to `EXPECT_*()` if that works. This section in the user's guide explains
+it.
+
+## My set-up function is not called. Why? ##
+
+C++ is case-sensitive. It should be spelled as `SetUp()`.  Did you
+spell it as `Setup()`?
+
+Similarly, sometimes people spell `SetUpTestCase()` as `SetupTestCase()` and
+wonder why it's never called.
+
+## How do I jump to the line of a failure in Emacs directly? ##
+
+Google Test's failure message format is understood by Emacs and many other
+IDEs, like acme and XCode. If a Google Test message is in a compilation buffer
+in Emacs, then it's clickable. You can now hit `enter` on a message to jump to
+the corresponding source code, or use `C-x `` to jump to the next failure.
+
+## I have several test cases which share the same test fixture logic, do I have to define a new test fixture class for each of them? This seems pretty tedious. ##
+
+You don't have to. Instead of
+
+``` cpp
+class FooTest : public BaseTest {};
+
+TEST_F(FooTest, Abc) { ... }
+TEST_F(FooTest, Def) { ... }
+
+class BarTest : public BaseTest {};
+
+TEST_F(BarTest, Abc) { ... }
+TEST_F(BarTest, Def) { ... }
+```
+
+you can simply `typedef` the test fixtures:
+``` cpp
+typedef BaseTest FooTest;
+
+TEST_F(FooTest, Abc) { ... }
+TEST_F(FooTest, Def) { ... }
+
+typedef BaseTest BarTest;
+
+TEST_F(BarTest, Abc) { ... }
+TEST_F(BarTest, Def) { ... }
+```
+
+## The Google Test output is buried in a whole bunch of log messages. What do I do? ##
+
+The Google Test output is meant to be a concise and human-friendly report. If
+your test generates textual output itself, it will mix with the Google Test
+output, making it hard to read. However, there is an easy solution to this
+problem.
+
+Since most log messages go to stderr, we decided to let Google Test output go
+to stdout. This way, you can easily separate the two using redirection. For
+example:
+```
+./my_test > googletest_output.txt
+```
+
+## Why should I prefer test fixtures over global variables? ##
+
+There are several good reasons:
+  1. It's likely your test needs to change the states of its global variables. This makes it difficult to keep side effects from escaping one test and contaminating others, making debugging difficult. By using fixtures, each test has a fresh set of variables that's different (but with the same names). Thus, tests are kept independent of each other.
+  1. Global variables pollute the global namespace.
+  1. Test fixtures can be reused via subclassing, which cannot be done easily with global variables. This is useful if many test cases have something in common.
+
+## How do I test private class members without writing FRIEND\_TEST()s? ##
+
+You should try to write testable code, which means classes should be easily
+tested from their public interface. One way to achieve this is the Pimpl idiom:
+you move all private members of a class into a helper class, and make all
+members of the helper class public.
+
+You have several other options that don't require using `FRIEND_TEST`:
+  * Write the tests as members of the fixture class:
+``` cpp
+class Foo {
+  friend class FooTest;
+  ...
+};
+
+class FooTest : public ::testing::Test {
+ protected:
+  ...
+  void Test1() {...} // This accesses private members of class Foo.
+  void Test2() {...} // So does this one.
+};
+
+TEST_F(FooTest, Test1) {
+  Test1();
+}
+
+TEST_F(FooTest, Test2) {
+  Test2();
+}
+```
+  * In the fixture class, write accessors for the tested class' private members, then use the accessors in your tests:
+``` cpp
+class Foo {
+  friend class FooTest;
+  ...
+};
+
+class FooTest : public ::testing::Test {
+ protected:
+  ...
+  T1 get_private_member1(Foo* obj) {
+    return obj->private_member1_;
+  }
+};
+
+TEST_F(FooTest, Test1) {
+  ...
+  get_private_member1(x)
+  ...
+}
+```
+  * If the methods are declared **protected**, you can change their access level in a test-only subclass:
+``` cpp
+class YourClass {
+  ...
+ protected: // protected access for testability.
+  int DoSomethingReturningInt();
+  ...
+};
+
+// in the your_class_test.cc file:
+class TestableYourClass : public YourClass {
+  ...
+ public: using YourClass::DoSomethingReturningInt; // changes access rights
+  ...
+};
+
+TEST_F(YourClassTest, DoSomethingTest) {
+  TestableYourClass obj;
+  assertEquals(expected_value, obj.DoSomethingReturningInt());
+}
+```
+
+## How do I test private class static members without writing FRIEND\_TEST()s? ##
+
+We find private static methods clutter the header file.  They are
+implementation details and ideally should be kept out of a .h. So often I make
+them free functions instead.
+
+Instead of:
+``` cpp
+// foo.h
+class Foo {
+  ...
+ private:
+  static bool Func(int n);
+};
+
+// foo.cc
+bool Foo::Func(int n) { ... }
+
+// foo_test.cc
+EXPECT_TRUE(Foo::Func(12345));
+```
+
+You probably should better write:
+``` cpp
+// foo.h
+class Foo {
+  ...
+};
+
+// foo.cc
+namespace internal {
+  bool Func(int n) { ... }
+}
+
+// foo_test.cc
+namespace internal {
+  bool Func(int n);
+}
+
+EXPECT_TRUE(internal::Func(12345));
+```
+
+## I would like to run a test several times with different parameters. Do I need to write several similar copies of it? ##
+
+No. You can use a feature called [value-parameterized tests](AdvancedGuide.md#Value_Parameterized_Tests) which
+lets you repeat your tests with different parameters, without defining it more than once.
+
+## How do I test a file that defines main()? ##
+
+To test a `foo.cc` file, you need to compile and link it into your unit test
+program. However, when the file contains a definition for the `main()`
+function, it will clash with the `main()` of your unit test, and will result in
+a build error.
+
+The right solution is to split it into three files:
+  1. `foo.h` which contains the declarations,
+  1. `foo.cc` which contains the definitions except `main()`, and
+  1. `foo_main.cc` which contains nothing but the definition of `main()`.
+
+Then `foo.cc` can be easily tested.
+
+If you are adding tests to an existing file and don't want an intrusive change
+like this, there is a hack: just include the entire `foo.cc` file in your unit
+test. For example:
+``` cpp
+// File foo_unittest.cc
+
+// The headers section
+...
+
+// Renames main() in foo.cc to make room for the unit test main()
+#define main FooMain
+
+#include "a/b/foo.cc"
+
+// The tests start here.
+...
+```
+
+
+However, please remember this is a hack and should only be used as the last
+resort.
+
+## What can the statement argument in ASSERT\_DEATH() be? ##
+
+`ASSERT_DEATH(_statement_, _regex_)` (or any death assertion macro) can be used
+wherever `_statement_` is valid. So basically `_statement_` can be any C++
+statement that makes sense in the current context. In particular, it can
+reference global and/or local variables, and can be:
+  * a simple function call (often the case),
+  * a complex expression, or
+  * a compound statement.
+
+Some examples are shown here:
+
+``` cpp
+// A death test can be a simple function call.
+TEST(MyDeathTest, FunctionCall) {
+  ASSERT_DEATH(Xyz(5), "Xyz failed");
+}
+
+// Or a complex expression that references variables and functions.
+TEST(MyDeathTest, ComplexExpression) {
+  const bool c = Condition();
+  ASSERT_DEATH((c ? Func1(0) : object2.Method("test")),
+               "(Func1|Method) failed");
+}
+
+// Death assertions can be used any where in a function. In
+// particular, they can be inside a loop.
+TEST(MyDeathTest, InsideLoop) {
+  // Verifies that Foo(0), Foo(1), ..., and Foo(4) all die.
+  for (int i = 0; i < 5; i++) {
+    EXPECT_DEATH_M(Foo(i), "Foo has \\d+ errors",
+                   ::testing::Message() << "where i is " << i);
+  }
+}
+
+// A death assertion can contain a compound statement.
+TEST(MyDeathTest, CompoundStatement) {
+  // Verifies that at lease one of Bar(0), Bar(1), ..., and
+  // Bar(4) dies.
+  ASSERT_DEATH({
+    for (int i = 0; i < 5; i++) {
+      Bar(i);
+    }
+  },
+  "Bar has \\d+ errors");}
+```
+
+`googletest_unittest.cc` contains more examples if you are interested.
+
+## What syntax does the regular expression in ASSERT\_DEATH use? ##
+
+On POSIX systems, Google Test uses the POSIX Extended regular
+expression syntax
+(http://en.wikipedia.org/wiki/Regular_expression#POSIX_Extended_Regular_Expressions).
+On Windows, it uses a limited variant of regular expression
+syntax. For more details, see the
+[regular expression syntax](AdvancedGuide.md#Regular_Expression_Syntax).
+
+## I have a fixture class Foo, but TEST\_F(Foo, Bar) gives me error "no matching function for call to Foo::Foo()". Why? ##
+
+Google Test needs to be able to create objects of your test fixture class, so
+it must have a default constructor. Normally the compiler will define one for
+you. However, there are cases where you have to define your own:
+  * If you explicitly declare a non-default constructor for class `Foo`, then you need to define a default constructor, even if it would be empty.
+  * If `Foo` has a const non-static data member, then you have to define the default constructor _and_ initialize the const member in the initializer list of the constructor. (Early versions of `gcc` doesn't force you to initialize the const member. It's a bug that has been fixed in `gcc 4`.)
+
+## Why does ASSERT\_DEATH complain about previous threads that were already joined? ##
+
+With the Linux pthread library, there is no turning back once you cross the
+line from single thread to multiple threads. The first time you create a
+thread, a manager thread is created in addition, so you get 3, not 2, threads.
+Later when the thread you create joins the main thread, the thread count
+decrements by 1, but the manager thread will never be killed, so you still have
+2 threads, which means you cannot safely run a death test.
+
+The new NPTL thread library doesn't suffer from this problem, as it doesn't
+create a manager thread. However, if you don't control which machine your test
+runs on, you shouldn't depend on this.
+
+## Why does Google Test require the entire test case, instead of individual tests, to be named FOODeathTest when it uses ASSERT\_DEATH? ##
+
+Google Test does not interleave tests from different test cases. That is, it
+runs all tests in one test case first, and then runs all tests in the next test
+case, and so on. Google Test does this because it needs to set up a test case
+before the first test in it is run, and tear it down afterwords. Splitting up
+the test case would require multiple set-up and tear-down processes, which is
+inefficient and makes the semantics unclean.
+
+If we were to determine the order of tests based on test name instead of test
+case name, then we would have a problem with the following situation:
+
+``` cpp
+TEST_F(FooTest, AbcDeathTest) { ... }
+TEST_F(FooTest, Uvw) { ... }
+
+TEST_F(BarTest, DefDeathTest) { ... }
+TEST_F(BarTest, Xyz) { ... }
+```
+
+Since `FooTest.AbcDeathTest` needs to run before `BarTest.Xyz`, and we don't
+interleave tests from different test cases, we need to run all tests in the
+`FooTest` case before running any test in the `BarTest` case. This contradicts
+with the requirement to run `BarTest.DefDeathTest` before `FooTest.Uvw`.
+
+## But I don't like calling my entire test case FOODeathTest when it contains both death tests and non-death tests. What do I do? ##
+
+You don't have to, but if you like, you may split up the test case into
+`FooTest` and `FooDeathTest`, where the names make it clear that they are
+related:
+
+``` cpp
+class FooTest : public ::testing::Test { ... };
+
+TEST_F(FooTest, Abc) { ... }
+TEST_F(FooTest, Def) { ... }
+
+typedef FooTest FooDeathTest;
+
+TEST_F(FooDeathTest, Uvw) { ... EXPECT_DEATH(...) ... }
+TEST_F(FooDeathTest, Xyz) { ... ASSERT_DEATH(...) ... }
+```
+
+## The compiler complains about "no match for 'operator<<'" when I use an assertion. What gives? ##
+
+If you use a user-defined type `FooType` in an assertion, you must make sure
+there is an `std::ostream& operator<<(std::ostream&, const FooType&)` function
+defined such that we can print a value of `FooType`.
+
+In addition, if `FooType` is declared in a name space, the `<<` operator also
+needs to be defined in the _same_ name space.
+
+## How do I suppress the memory leak messages on Windows? ##
+
+Since the statically initialized Google Test singleton requires allocations on
+the heap, the Visual C++ memory leak detector will report memory leaks at the
+end of the program run. The easiest way to avoid this is to use the
+`_CrtMemCheckpoint` and `_CrtMemDumpAllObjectsSince` calls to not report any
+statically initialized heap objects. See MSDN for more details and additional
+heap check/debug routines.
+
+## I am building my project with Google Test in Visual Studio and all I'm getting is a bunch of linker errors (or warnings). Help! ##
+
+You may get a number of the following linker error or warnings if you
+attempt to link your test project with the Google Test library when
+your project and the are not built using the same compiler settings.
+
+  * LNK2005: symbol already defined in object
+  * LNK4217: locally defined symbol 'symbol' imported in function 'function'
+  * LNK4049: locally defined symbol 'symbol' imported
+
+The Google Test project (gtest.vcproj) has the Runtime Library option
+set to /MT (use multi-threaded static libraries, /MTd for debug). If
+your project uses something else, for example /MD (use multi-threaded
+DLLs, /MDd for debug), you need to change the setting in the Google
+Test project to match your project's.
+
+To update this setting open the project properties in the Visual
+Studio IDE then select the branch Configuration Properties | C/C++ |
+Code Generation and change the option "Runtime Library".  You may also try
+using gtest-md.vcproj instead of gtest.vcproj.
+
+## I put my tests in a library and Google Test doesn't run them. What's happening? ##
+Have you read a
+[warning](Primer.md#important-note-for-visual-c-users) on
+the Google Test Primer page?
+
+## I want to use Google Test with Visual Studio but don't know where to start. ##
+Many people are in your position and one of the posted his solution to
+our mailing list.
+
+## I am seeing compile errors mentioning std::type\_traits when I try to use Google Test on Solaris. ##
+Google Test uses parts of the standard C++ library that SunStudio does not support.
+Our users reported success using alternative implementations. Try running the build after runing this commad:
+
+`export CC=cc CXX=CC CXXFLAGS='-library=stlport4'`
+
+## How can my code detect if it is running in a test? ##
+
+If you write code that sniffs whether it's running in a test and does
+different things accordingly, you are leaking test-only logic into
+production code and there is no easy way to ensure that the test-only
+code paths aren't run by mistake in production.  Such cleverness also
+leads to
+[Heisenbugs](http://en.wikipedia.org/wiki/Unusual_software_bug#Heisenbug).
+Therefore we strongly advise against the practice, and Google Test doesn't
+provide a way to do it.
+
+In general, the recommended way to cause the code to behave
+differently under test is [dependency injection](http://jamesshore.com/Blog/Dependency-Injection-Demystified.html).
+You can inject different functionality from the test and from the
+production code.  Since your production code doesn't link in the
+for-test logic at all, there is no danger in accidentally running it.
+
+However, if you _really_, _really_, _really_ have no choice, and if
+you follow the rule of ending your test program names with `_test`,
+you can use the _horrible_ hack of sniffing your executable name
+(`argv[0]` in `main()`) to know whether the code is under test.
+
+## Google Test defines a macro that clashes with one defined by another library. How do I deal with that? ##
+
+In C++, macros don't obey namespaces.  Therefore two libraries that
+both define a macro of the same name will clash if you `#include` both
+definitions.  In case a Google Test macro clashes with another
+library, you can force Google Test to rename its macro to avoid the
+conflict.
+
+Specifically, if both Google Test and some other code define macro
+`FOO`, you can add
+```
+  -DGTEST_DONT_DEFINE_FOO=1
+```
+to the compiler flags to tell Google Test to change the macro's name
+from `FOO` to `GTEST_FOO`. For example, with `-DGTEST_DONT_DEFINE_TEST=1`, you'll need to write
+``` cpp
+  GTEST_TEST(SomeTest, DoesThis) { ... }
+```
+instead of
+``` cpp
+  TEST(SomeTest, DoesThis) { ... }
+```
+in order to define a test.
+
+Currently, the following `TEST`, `FAIL`, `SUCCEED`, and the basic comparison assertion macros can have alternative names. You can see the full list of covered macros [here](http://www.google.com/codesearch?q=if+!GTEST_DONT_DEFINE_\w%2B+package:http://googletest\.googlecode\.com+file:/include/gtest/gtest.h). More information can be found in the "Avoiding Macro Name Clashes" section of the README file.
+
+
+## Is it OK if I have two separate `TEST(Foo, Bar)` test methods defined in different namespaces? ##
+
+Yes.
+
+The rule is **all test methods in the same test case must use the same fixture class**. This means that the following is **allowed** because both tests use the same fixture class (`::testing::Test`).
+
+``` cpp
+namespace foo {
+TEST(CoolTest, DoSomething) {
+  SUCCEED();
+}
+}  // namespace foo
+
+namespace bar {
+TEST(CoolTest, DoSomething) {
+  SUCCEED();
+}
+}  // namespace foo
+```
+
+However, the following code is **not allowed** and will produce a runtime error from Google Test because the test methods are using different test fixture classes with the same test case name.
+
+``` cpp
+namespace foo {
+class CoolTest : public ::testing::Test {};  // Fixture foo::CoolTest
+TEST_F(CoolTest, DoSomething) {
+  SUCCEED();
+}
+}  // namespace foo
+
+namespace bar {
+class CoolTest : public ::testing::Test {};  // Fixture: bar::CoolTest
+TEST_F(CoolTest, DoSomething) {
+  SUCCEED();
+}
+}  // namespace foo
+```
+
+## How do I build Google Testing Framework with Xcode 4? ##
+
+If you try to build Google Test's Xcode project with Xcode 4.0 or later, you may encounter an error message that looks like
+"Missing SDK in target gtest\_framework: /Developer/SDKs/MacOSX10.4u.sdk". That means that Xcode does not support the SDK the project is targeting. See the Xcode section in the [README](../README.md) file on how to resolve this.
+
+## My question is not covered in your FAQ! ##
+
+If you cannot find the answer to your question in this FAQ, there are
+some other resources you can use:
+
+  1. read other [wiki pages](../docs),
+  1. search the mailing list [archive](https://groups.google.com/forum/#!forum/googletestframework),
+  1. ask it on [googletestframework@googlegroups.com](mailto:googletestframework@googlegroups.com) and someone will answer it (to prevent spam, we require you to join the [discussion group](http://groups.google.com/group/googletestframework) before you can post.).
+
+Please note that creating an issue in the
+[issue tracker](https://github.com/google/googletest/issues) is _not_
+a good way to get your answer, as it is monitored infrequently by a
+very small number of people.
+
+When asking a question, it's helpful to provide as much of the
+following information as possible (people cannot help you if there's
+not enough information in your question):
+
+  * the version (or the commit hash if you check out from Git directly) of Google Test you use (Google Test is under active development, so it's possible that your problem has been solved in a later version),
+  * your operating system,
+  * the name and version of your compiler,
+  * the complete command line flags you give to your compiler,
+  * the complete compiler error messages (if the question is about compilation),
+  * the _actual_ code (ideally, a minimal but complete program) that has the problem you encounter.
diff --git a/src/external/googletest/googletest/docs/Primer.md b/src/external/googletest/googletest/docs/Primer.md
new file mode 100644 (file)
index 0000000..474c1d2
--- /dev/null
@@ -0,0 +1,502 @@
+
+
+# Introduction: Why Google C++ Testing Framework? #
+
+_Google C++ Testing Framework_ helps you write better C++ tests.
+
+No matter whether you work on Linux, Windows, or a Mac, if you write C++ code,
+Google Test can help you.
+
+So what makes a good test, and how does Google C++ Testing Framework fit in? We believe:
+  1. Tests should be _independent_ and _repeatable_. It's a pain to debug a test that succeeds or fails as a result of other tests.  Google C++ Testing Framework isolates the tests by running each of them on a different object. When a test fails, Google C++ Testing Framework allows you to run it in isolation for quick debugging.
+  1. Tests should be well _organized_ and reflect the structure of the tested code.  Google C++ Testing Framework groups related tests into test cases that can share data and subroutines. This common pattern is easy to recognize and makes tests easy to maintain. Such consistency is especially helpful when people switch projects and start to work on a new code base.
+  1. Tests should be _portable_ and _reusable_. The open-source community has a lot of code that is platform-neutral, its tests should also be platform-neutral.  Google C++ Testing Framework works on different OSes, with different compilers (gcc, MSVC, and others), with or without exceptions, so Google C++ Testing Framework tests can easily work with a variety of configurations.  (Note that the current release only contains build scripts for Linux - we are actively working on scripts for other platforms.)
+  1. When tests fail, they should provide as much _information_ about the problem as possible. Google C++ Testing Framework doesn't stop at the first test failure. Instead, it only stops the current test and continues with the next. You can also set up tests that report non-fatal failures after which the current test continues. Thus, you can detect and fix multiple bugs in a single run-edit-compile cycle.
+  1. The testing framework should liberate test writers from housekeeping chores and let them focus on the test _content_.  Google C++ Testing Framework automatically keeps track of all tests defined, and doesn't require the user to enumerate them in order to run them.
+  1. Tests should be _fast_. With Google C++ Testing Framework, you can reuse shared resources across tests and pay for the set-up/tear-down only once, without making tests depend on each other.
+
+Since Google C++ Testing Framework is based on the popular xUnit
+architecture, you'll feel right at home if you've used JUnit or PyUnit before.
+If not, it will take you about 10 minutes to learn the basics and get started.
+So let's go!
+
+_Note:_ We sometimes refer to Google C++ Testing Framework informally
+as _Google Test_.
+
+# Setting up a New Test Project #
+
+To write a test program using Google Test, you need to compile Google
+Test into a library and link your test with it.  We provide build
+files for some popular build systems: `msvc/` for Visual Studio,
+`xcode/` for Mac Xcode, `make/` for GNU make, `codegear/` for Borland
+C++ Builder, and the autotools script (deprecated) and
+`CMakeLists.txt` for CMake (recommended) in the Google Test root
+directory.  If your build system is not on this list, you can take a
+look at `make/Makefile` to learn how Google Test should be compiled
+(basically you want to compile `src/gtest-all.cc` with `GTEST_ROOT`
+and `GTEST_ROOT/include` in the header search path, where `GTEST_ROOT`
+is the Google Test root directory).
+
+Once you are able to compile the Google Test library, you should
+create a project or build target for your test program.  Make sure you
+have `GTEST_ROOT/include` in the header search path so that the
+compiler can find `"gtest/gtest.h"` when compiling your test.  Set up
+your test project to link with the Google Test library (for example,
+in Visual Studio, this is done by adding a dependency on
+`gtest.vcproj`).
+
+If you still have questions, take a look at how Google Test's own
+tests are built and use them as examples.
+
+# Basic Concepts #
+
+When using Google Test, you start by writing _assertions_, which are statements
+that check whether a condition is true. An assertion's result can be _success_,
+_nonfatal failure_, or _fatal failure_. If a fatal failure occurs, it aborts
+the current function; otherwise the program continues normally.
+
+_Tests_ use assertions to verify the tested code's behavior. If a test crashes
+or has a failed assertion, then it _fails_; otherwise it _succeeds_.
+
+A _test case_ contains one or many tests. You should group your tests into test
+cases that reflect the structure of the tested code. When multiple tests in a
+test case need to share common objects and subroutines, you can put them into a
+_test fixture_ class.
+
+A _test program_ can contain multiple test cases.
+
+We'll now explain how to write a test program, starting at the individual
+assertion level and building up to tests and test cases.
+
+# Assertions #
+
+Google Test assertions are macros that resemble function calls. You test a
+class or function by making assertions about its behavior. When an assertion
+fails, Google Test prints the assertion's source file and line number location,
+along with a failure message. You may also supply a custom failure message
+which will be appended to Google Test's message.
+
+The assertions come in pairs that test the same thing but have different
+effects on the current function. `ASSERT_*` versions generate fatal failures
+when they fail, and **abort the current function**. `EXPECT_*` versions generate
+nonfatal failures, which don't abort the current function. Usually `EXPECT_*`
+are preferred, as they allow more than one failures to be reported in a test.
+However, you should use `ASSERT_*` if it doesn't make sense to continue when
+the assertion in question fails.
+
+Since a failed `ASSERT_*` returns from the current function immediately,
+possibly skipping clean-up code that comes after it, it may cause a space leak.
+Depending on the nature of the leak, it may or may not be worth fixing - so
+keep this in mind if you get a heap checker error in addition to assertion
+errors.
+
+To provide a custom failure message, simply stream it into the macro using the
+`<<` operator, or a sequence of such operators. An example:
+```
+ASSERT_EQ(x.size(), y.size()) << "Vectors x and y are of unequal length";
+
+for (int i = 0; i < x.size(); ++i) {
+  EXPECT_EQ(x[i], y[i]) << "Vectors x and y differ at index " << i;
+}
+```
+
+Anything that can be streamed to an `ostream` can be streamed to an assertion
+macro--in particular, C strings and `string` objects. If a wide string
+(`wchar_t*`, `TCHAR*` in `UNICODE` mode on Windows, or `std::wstring`) is
+streamed to an assertion, it will be translated to UTF-8 when printed.
+
+## Basic Assertions ##
+
+These assertions do basic true/false condition testing.
+
+| **Fatal assertion** | **Nonfatal assertion** | **Verifies** |
+|:--------------------|:-----------------------|:-------------|
+| `ASSERT_TRUE(`_condition_`)`;  | `EXPECT_TRUE(`_condition_`)`;   | _condition_ is true |
+| `ASSERT_FALSE(`_condition_`)`; | `EXPECT_FALSE(`_condition_`)`;  | _condition_ is false |
+
+Remember, when they fail, `ASSERT_*` yields a fatal failure and
+returns from the current function, while `EXPECT_*` yields a nonfatal
+failure, allowing the function to continue running. In either case, an
+assertion failure means its containing test fails.
+
+_Availability_: Linux, Windows, Mac.
+
+## Binary Comparison ##
+
+This section describes assertions that compare two values.
+
+| **Fatal assertion** | **Nonfatal assertion** | **Verifies** |
+|:--------------------|:-----------------------|:-------------|
+|`ASSERT_EQ(`_val1_`, `_val2_`);`|`EXPECT_EQ(`_val1_`, `_val2_`);`| _val1_ `==` _val2_ |
+|`ASSERT_NE(`_val1_`, `_val2_`);`|`EXPECT_NE(`_val1_`, `_val2_`);`| _val1_ `!=` _val2_ |
+|`ASSERT_LT(`_val1_`, `_val2_`);`|`EXPECT_LT(`_val1_`, `_val2_`);`| _val1_ `<` _val2_ |
+|`ASSERT_LE(`_val1_`, `_val2_`);`|`EXPECT_LE(`_val1_`, `_val2_`);`| _val1_ `<=` _val2_ |
+|`ASSERT_GT(`_val1_`, `_val2_`);`|`EXPECT_GT(`_val1_`, `_val2_`);`| _val1_ `>` _val2_ |
+|`ASSERT_GE(`_val1_`, `_val2_`);`|`EXPECT_GE(`_val1_`, `_val2_`);`| _val1_ `>=` _val2_ |
+
+In the event of a failure, Google Test prints both _val1_ and _val2_.
+
+Value arguments must be comparable by the assertion's comparison
+operator or you'll get a compiler error.  We used to require the
+arguments to support the `<<` operator for streaming to an `ostream`,
+but it's no longer necessary since v1.6.0 (if `<<` is supported, it
+will be called to print the arguments when the assertion fails;
+otherwise Google Test will attempt to print them in the best way it
+can. For more details and how to customize the printing of the
+arguments, see this Google Mock [recipe](../../googlemock/docs/CookBook.md#teaching-google-mock-how-to-print-your-values).).
+
+These assertions can work with a user-defined type, but only if you define the
+corresponding comparison operator (e.g. `==`, `<`, etc).  If the corresponding
+operator is defined, prefer using the `ASSERT_*()` macros because they will
+print out not only the result of the comparison, but the two operands as well.
+
+Arguments are always evaluated exactly once. Therefore, it's OK for the
+arguments to have side effects. However, as with any ordinary C/C++ function,
+the arguments' evaluation order is undefined (i.e. the compiler is free to
+choose any order) and your code should not depend on any particular argument
+evaluation order.
+
+`ASSERT_EQ()` does pointer equality on pointers. If used on two C strings, it
+tests if they are in the same memory location, not if they have the same value.
+Therefore, if you want to compare C strings (e.g. `const char*`) by value, use
+`ASSERT_STREQ()` , which will be described later on. In particular, to assert
+that a C string is `NULL`, use `ASSERT_STREQ(NULL, c_string)` . However, to
+compare two `string` objects, you should use `ASSERT_EQ`.
+
+Macros in this section work with both narrow and wide string objects (`string`
+and `wstring`).
+
+_Availability_: Linux, Windows, Mac.
+
+_Historical note_: Before February 2016 `*_EQ` had a convention of calling it as
+`ASSERT_EQ(expected, actual)`, so lots of existing code uses this order.
+Now `*_EQ` treats both parameters in the same way.
+
+## String Comparison ##
+
+The assertions in this group compare two **C strings**. If you want to compare
+two `string` objects, use `EXPECT_EQ`, `EXPECT_NE`, and etc instead.
+
+| **Fatal assertion** | **Nonfatal assertion** | **Verifies** |
+|:--------------------|:-----------------------|:-------------|
+| `ASSERT_STREQ(`_str1_`, `_str2_`);`    | `EXPECT_STREQ(`_str1_`, `_str_2`);`     | the two C strings have the same content |
+| `ASSERT_STRNE(`_str1_`, `_str2_`);`    | `EXPECT_STRNE(`_str1_`, `_str2_`);`     | the two C strings have different content |
+| `ASSERT_STRCASEEQ(`_str1_`, `_str2_`);`| `EXPECT_STRCASEEQ(`_str1_`, `_str2_`);` | the two C strings have the same content, ignoring case |
+| `ASSERT_STRCASENE(`_str1_`, `_str2_`);`| `EXPECT_STRCASENE(`_str1_`, `_str2_`);` | the two C strings have different content, ignoring case |
+
+Note that "CASE" in an assertion name means that case is ignored.
+
+`*STREQ*` and `*STRNE*` also accept wide C strings (`wchar_t*`). If a
+comparison of two wide strings fails, their values will be printed as UTF-8
+narrow strings.
+
+A `NULL` pointer and an empty string are considered _different_.
+
+_Availability_: Linux, Windows, Mac.
+
+See also: For more string comparison tricks (substring, prefix, suffix, and
+regular expression matching, for example), see the [Advanced Google Test Guide](AdvancedGuide.md).
+
+# Simple Tests #
+
+To create a test:
+  1. Use the `TEST()` macro to define and name a test function, These are ordinary C++ functions that don't return a value.
+  1. In this function, along with any valid C++ statements you want to include, use the various Google Test assertions to check values.
+  1. The test's result is determined by the assertions; if any assertion in the test fails (either fatally or non-fatally), or if the test crashes, the entire test fails. Otherwise, it succeeds.
+
+```
+TEST(test_case_name, test_name) {
+ ... test body ...
+}
+```
+
+
+`TEST()` arguments go from general to specific. The _first_ argument is the
+name of the test case, and the _second_ argument is the test's name within the
+test case. Both names must be valid C++ identifiers, and they should not contain underscore (`_`). A test's _full name_ consists of its containing test case and its
+individual name. Tests from different test cases can have the same individual
+name.
+
+For example, let's take a simple integer function:
+```
+int Factorial(int n); // Returns the factorial of n
+```
+
+A test case for this function might look like:
+```
+// Tests factorial of 0.
+TEST(FactorialTest, HandlesZeroInput) {
+  EXPECT_EQ(1, Factorial(0));
+}
+
+// Tests factorial of positive numbers.
+TEST(FactorialTest, HandlesPositiveInput) {
+  EXPECT_EQ(1, Factorial(1));
+  EXPECT_EQ(2, Factorial(2));
+  EXPECT_EQ(6, Factorial(3));
+  EXPECT_EQ(40320, Factorial(8));
+}
+```
+
+Google Test groups the test results by test cases, so logically-related tests
+should be in the same test case; in other words, the first argument to their
+`TEST()` should be the same. In the above example, we have two tests,
+`HandlesZeroInput` and `HandlesPositiveInput`, that belong to the same test
+case `FactorialTest`.
+
+_Availability_: Linux, Windows, Mac.
+
+# Test Fixtures: Using the Same Data Configuration for Multiple Tests #
+
+If you find yourself writing two or more tests that operate on similar data,
+you can use a _test fixture_. It allows you to reuse the same configuration of
+objects for several different tests.
+
+To create a fixture, just:
+  1. Derive a class from `::testing::Test` . Start its body with `protected:` or `public:` as we'll want to access fixture members from sub-classes.
+  1. Inside the class, declare any objects you plan to use.
+  1. If necessary, write a default constructor or `SetUp()` function to prepare the objects for each test. A common mistake is to spell `SetUp()` as `Setup()` with a small `u` - don't let that happen to you.
+  1. If necessary, write a destructor or `TearDown()` function to release any resources you allocated in `SetUp()` . To learn when you should use the constructor/destructor and when you should use `SetUp()/TearDown()`, read this [FAQ entry](FAQ.md#should-i-use-the-constructordestructor-of-the-test-fixture-or-the-set-uptear-down-function).
+  1. If needed, define subroutines for your tests to share.
+
+When using a fixture, use `TEST_F()` instead of `TEST()` as it allows you to
+access objects and subroutines in the test fixture:
+```
+TEST_F(test_case_name, test_name) {
+ ... test body ...
+}
+```
+
+Like `TEST()`, the first argument is the test case name, but for `TEST_F()`
+this must be the name of the test fixture class. You've probably guessed: `_F`
+is for fixture.
+
+Unfortunately, the C++ macro system does not allow us to create a single macro
+that can handle both types of tests. Using the wrong macro causes a compiler
+error.
+
+Also, you must first define a test fixture class before using it in a
+`TEST_F()`, or you'll get the compiler error "`virtual outside class
+declaration`".
+
+For each test defined with `TEST_F()`, Google Test will:
+  1. Create a _fresh_ test fixture at runtime
+  1. Immediately initialize it via `SetUp()` ,
+  1. Run the test
+  1. Clean up by calling `TearDown()`
+  1. Delete the test fixture.  Note that different tests in the same test case have different test fixture objects, and Google Test always deletes a test fixture before it creates the next one. Google Test does not reuse the same test fixture for multiple tests. Any changes one test makes to the fixture do not affect other tests.
+
+As an example, let's write tests for a FIFO queue class named `Queue`, which
+has the following interface:
+```
+template <typename E> // E is the element type.
+class Queue {
+ public:
+  Queue();
+  void Enqueue(const E& element);
+  E* Dequeue(); // Returns NULL if the queue is empty.
+  size_t size() const;
+  ...
+};
+```
+
+First, define a fixture class. By convention, you should give it the name
+`FooTest` where `Foo` is the class being tested.
+```
+class QueueTest : public ::testing::Test {
+ protected:
+  virtual void SetUp() {
+    q1_.Enqueue(1);
+    q2_.Enqueue(2);
+    q2_.Enqueue(3);
+  }
+
+  // virtual void TearDown() {}
+
+  Queue<int> q0_;
+  Queue<int> q1_;
+  Queue<int> q2_;
+};
+```
+
+In this case, `TearDown()` is not needed since we don't have to clean up after
+each test, other than what's already done by the destructor.
+
+Now we'll write tests using `TEST_F()` and this fixture.
+```
+TEST_F(QueueTest, IsEmptyInitially) {
+  EXPECT_EQ(0, q0_.size());
+}
+
+TEST_F(QueueTest, DequeueWorks) {
+  int* n = q0_.Dequeue();
+  EXPECT_EQ(NULL, n);
+
+  n = q1_.Dequeue();
+  ASSERT_TRUE(n != NULL);
+  EXPECT_EQ(1, *n);
+  EXPECT_EQ(0, q1_.size());
+  delete n;
+
+  n = q2_.Dequeue();
+  ASSERT_TRUE(n != NULL);
+  EXPECT_EQ(2, *n);
+  EXPECT_EQ(1, q2_.size());
+  delete n;
+}
+```
+
+The above uses both `ASSERT_*` and `EXPECT_*` assertions. The rule of thumb is
+to use `EXPECT_*` when you want the test to continue to reveal more errors
+after the assertion failure, and use `ASSERT_*` when continuing after failure
+doesn't make sense. For example, the second assertion in the `Dequeue` test is
+`ASSERT_TRUE(n != NULL)`, as we need to dereference the pointer `n` later,
+which would lead to a segfault when `n` is `NULL`.
+
+When these tests run, the following happens:
+  1. Google Test constructs a `QueueTest` object (let's call it `t1` ).
+  1. `t1.SetUp()` initializes `t1` .
+  1. The first test ( `IsEmptyInitially` ) runs on `t1` .
+  1. `t1.TearDown()` cleans up after the test finishes.
+  1. `t1` is destructed.
+  1. The above steps are repeated on another `QueueTest` object, this time running the `DequeueWorks` test.
+
+_Availability_: Linux, Windows, Mac.
+
+_Note_: Google Test automatically saves all _Google Test_ flags when a test
+object is constructed, and restores them when it is destructed.
+
+# Invoking the Tests #
+
+`TEST()` and `TEST_F()` implicitly register their tests with Google Test. So, unlike with many other C++ testing frameworks, you don't have to re-list all your defined tests in order to run them.
+
+After defining your tests, you can run them with `RUN_ALL_TESTS()` , which returns `0` if all the tests are successful, or `1` otherwise. Note that `RUN_ALL_TESTS()` runs _all tests_ in your link unit -- they can be from different test cases, or even different source files.
+
+When invoked, the `RUN_ALL_TESTS()` macro:
+  1. Saves the state of all  Google Test flags.
+  1. Creates a test fixture object for the first test.
+  1. Initializes it via `SetUp()`.
+  1. Runs the test on the fixture object.
+  1. Cleans up the fixture via `TearDown()`.
+  1. Deletes the fixture.
+  1. Restores the state of all Google Test flags.
+  1. Repeats the above steps for the next test, until all tests have run.
+
+In addition, if the text fixture's constructor generates a fatal failure in
+step 2, there is no point for step 3 - 5 and they are thus skipped. Similarly,
+if step 3 generates a fatal failure, step 4 will be skipped.
+
+_Important_: You must not ignore the return value of `RUN_ALL_TESTS()`, or `gcc`
+will give you a compiler error. The rationale for this design is that the
+automated testing service determines whether a test has passed based on its
+exit code, not on its stdout/stderr output; thus your `main()` function must
+return the value of `RUN_ALL_TESTS()`.
+
+Also, you should call `RUN_ALL_TESTS()` only **once**. Calling it more than once
+conflicts with some advanced Google Test features (e.g. thread-safe death
+tests) and thus is not supported.
+
+_Availability_: Linux, Windows, Mac.
+
+# Writing the main() Function #
+
+You can start from this boilerplate:
+```
+#include "this/package/foo.h"
+#include "gtest/gtest.h"
+
+namespace {
+
+// The fixture for testing class Foo.
+class FooTest : public ::testing::Test {
+ protected:
+  // You can remove any or all of the following functions if its body
+  // is empty.
+
+  FooTest() {
+    // You can do set-up work for each test here.
+  }
+
+  virtual ~FooTest() {
+    // You can do clean-up work that doesn't throw exceptions here.
+  }
+
+  // If the constructor and destructor are not enough for setting up
+  // and cleaning up each test, you can define the following methods:
+
+  virtual void SetUp() {
+    // Code here will be called immediately after the constructor (right
+    // before each test).
+  }
+
+  virtual void TearDown() {
+    // Code here will be called immediately after each test (right
+    // before the destructor).
+  }
+
+  // Objects declared here can be used by all tests in the test case for Foo.
+};
+
+// Tests that the Foo::Bar() method does Abc.
+TEST_F(FooTest, MethodBarDoesAbc) {
+  const string input_filepath = "this/package/testdata/myinputfile.dat";
+  const string output_filepath = "this/package/testdata/myoutputfile.dat";
+  Foo f;
+  EXPECT_EQ(0, f.Bar(input_filepath, output_filepath));
+}
+
+// Tests that Foo does Xyz.
+TEST_F(FooTest, DoesXyz) {
+  // Exercises the Xyz feature of Foo.
+}
+
+}  // namespace
+
+int main(int argc, char **argv) {
+  ::testing::InitGoogleTest(&argc, argv);
+  return RUN_ALL_TESTS();
+}
+```
+
+The `::testing::InitGoogleTest()` function parses the command line for Google
+Test flags, and removes all recognized flags. This allows the user to control a
+test program's behavior via various flags, which we'll cover in [AdvancedGuide](AdvancedGuide.md).
+You must call this function before calling `RUN_ALL_TESTS()`, or the flags
+won't be properly initialized.
+
+On Windows, `InitGoogleTest()` also works with wide strings, so it can be used
+in programs compiled in `UNICODE` mode as well.
+
+But maybe you think that writing all those main() functions is too much work? We agree with you completely and that's why Google Test provides a basic implementation of main(). If it fits your needs, then just link your test with gtest\_main library and you are good to go.
+
+## Important note for Visual C++ users ##
+If you put your tests into a library and your `main()` function is in a different library or in your .exe file, those tests will not run. The reason is a [bug](https://connect.microsoft.com/feedback/viewfeedback.aspx?FeedbackID=244410&siteid=210) in Visual C++. When you define your tests, Google Test creates certain static objects to register them. These objects are not referenced from elsewhere but their constructors are still supposed to run. When Visual C++ linker sees that nothing in the library is referenced from other places it throws the library out. You have to reference your library with tests from your main program to keep the linker from discarding it. Here is how to do it. Somewhere in your library code declare a function:
+```
+__declspec(dllexport) int PullInMyLibrary() { return 0; }
+```
+If you put your tests in a static library (not DLL) then `__declspec(dllexport)` is not required. Now, in your main program, write a code that invokes that function:
+```
+int PullInMyLibrary();
+static int dummy = PullInMyLibrary();
+```
+This will keep your tests referenced and will make them register themselves at startup.
+
+In addition, if you define your tests in a static library, add `/OPT:NOREF` to your main program linker options. If you use MSVC++ IDE, go to your .exe project properties/Configuration Properties/Linker/Optimization and set References setting to `Keep Unreferenced Data (/OPT:NOREF)`. This will keep Visual C++ linker from discarding individual symbols generated by your tests from the final executable.
+
+There is one more pitfall, though. If you use Google Test as a static library (that's how it is defined in gtest.vcproj) your tests must also reside in a static library. If you have to have them in a DLL, you _must_ change Google Test to build into a DLL as well. Otherwise your tests will not run correctly or will not run at all. The general conclusion here is: make your life easier - do not write your tests in libraries!
+
+# Where to Go from Here #
+
+Congratulations! You've learned the Google Test basics. You can start writing
+and running Google Test tests, read some [samples](Samples.md), or continue with
+[AdvancedGuide](AdvancedGuide.md), which describes many more useful Google Test features.
+
+# Known Limitations #
+
+Google Test is designed to be thread-safe.  The implementation is
+thread-safe on systems where the `pthreads` library is available.  It
+is currently _unsafe_ to use Google Test assertions from two threads
+concurrently on other systems (e.g. Windows).  In most tests this is
+not an issue as usually the assertions are done in the main thread. If
+you want to help, you can volunteer to implement the necessary
+synchronization primitives in `gtest-port.h` for your platform.
diff --git a/src/external/googletest/googletest/docs/PumpManual.md b/src/external/googletest/googletest/docs/PumpManual.md
new file mode 100644 (file)
index 0000000..8184f15
--- /dev/null
@@ -0,0 +1,177 @@
+
+
+<b>P</b>ump is <b>U</b>seful for <b>M</b>eta <b>P</b>rogramming.
+
+# The Problem #
+
+Template and macro libraries often need to define many classes,
+functions, or macros that vary only (or almost only) in the number of
+arguments they take. It's a lot of repetitive, mechanical, and
+error-prone work.
+
+Variadic templates and variadic macros can alleviate the problem.
+However, while both are being considered by the C++ committee, neither
+is in the standard yet or widely supported by compilers.  Thus they
+are often not a good choice, especially when your code needs to be
+portable. And their capabilities are still limited.
+
+As a result, authors of such libraries often have to write scripts to
+generate their implementation. However, our experience is that it's
+tedious to write such scripts, which tend to reflect the structure of
+the generated code poorly and are often hard to read and edit. For
+example, a small change needed in the generated code may require some
+non-intuitive, non-trivial changes in the script. This is especially
+painful when experimenting with the code.
+
+# Our Solution #
+
+Pump (for Pump is Useful for Meta Programming, Pretty Useful for Meta
+Programming, or Practical Utility for Meta Programming, whichever you
+prefer) is a simple meta-programming tool for C++. The idea is that a
+programmer writes a `foo.pump` file which contains C++ code plus meta
+code that manipulates the C++ code. The meta code can handle
+iterations over a range, nested iterations, local meta variable
+definitions, simple arithmetic, and conditional expressions. You can
+view it as a small Domain-Specific Language. The meta language is
+designed to be non-intrusive (s.t. it won't confuse Emacs' C++ mode,
+for example) and concise, making Pump code intuitive and easy to
+maintain.
+
+## Highlights ##
+
+  * The implementation is in a single Python script and thus ultra portable: no build or installation is needed and it works cross platforms.
+  * Pump tries to be smart with respect to [Google's style guide](http://code.google.com/p/google-styleguide/): it breaks long lines (easy to have when they are generated) at acceptable places to fit within 80 columns and indent the continuation lines correctly.
+  * The format is human-readable and more concise than XML.
+  * The format works relatively well with Emacs' C++ mode.
+
+## Examples ##
+
+The following Pump code (where meta keywords start with `$`, `[[` and `]]` are meta brackets, and `$$` starts a meta comment that ends with the line):
+
+```
+$var n = 3     $$ Defines a meta variable n.
+$range i 0..n  $$ Declares the range of meta iterator i (inclusive).
+$for i [[
+               $$ Meta loop.
+// Foo$i does blah for $i-ary predicates.
+$range j 1..i
+template <size_t N $for j [[, typename A$j]]>
+class Foo$i {
+$if i == 0 [[
+  blah a;
+]] $elif i <= 2 [[
+  blah b;
+]] $else [[
+  blah c;
+]]
+};
+
+]]
+```
+
+will be translated by the Pump compiler to:
+
+```
+// Foo0 does blah for 0-ary predicates.
+template <size_t N>
+class Foo0 {
+  blah a;
+};
+
+// Foo1 does blah for 1-ary predicates.
+template <size_t N, typename A1>
+class Foo1 {
+  blah b;
+};
+
+// Foo2 does blah for 2-ary predicates.
+template <size_t N, typename A1, typename A2>
+class Foo2 {
+  blah b;
+};
+
+// Foo3 does blah for 3-ary predicates.
+template <size_t N, typename A1, typename A2, typename A3>
+class Foo3 {
+  blah c;
+};
+```
+
+In another example,
+
+```
+$range i 1..n
+Func($for i + [[a$i]]);
+$$ The text between i and [[ is the separator between iterations.
+```
+
+will generate one of the following lines (without the comments), depending on the value of `n`:
+
+```
+Func();              // If n is 0.
+Func(a1);            // If n is 1.
+Func(a1 + a2);       // If n is 2.
+Func(a1 + a2 + a3);  // If n is 3.
+// And so on...
+```
+
+## Constructs ##
+
+We support the following meta programming constructs:
+
+| `$var id = exp` | Defines a named constant value. `$id` is valid util the end of the current meta lexical block. |
+|:----------------|:-----------------------------------------------------------------------------------------------|
+| `$range id exp..exp` | Sets the range of an iteration variable, which can be reused in multiple loops later.          |
+| `$for id sep [[ code ]]` | Iteration. The range of `id` must have been defined earlier. `$id` is valid in `code`.         |
+| `$($)`          | Generates a single `$` character.                                                              |
+| `$id`           | Value of the named constant or iteration variable.                                             |
+| `$(exp)`        | Value of the expression.                                                                       |
+| `$if exp [[ code ]] else_branch` | Conditional.                                                                                   |
+| `[[ code ]]`    | Meta lexical block.                                                                            |
+| `cpp_code`      | Raw C++ code.                                                                                  |
+| `$$ comment`    | Meta comment.                                                                                  |
+
+**Note:** To give the user some freedom in formatting the Pump source
+code, Pump ignores a new-line character if it's right after `$for foo`
+or next to `[[` or `]]`. Without this rule you'll often be forced to write
+very long lines to get the desired output. Therefore sometimes you may
+need to insert an extra new-line in such places for a new-line to show
+up in your output.
+
+## Grammar ##
+
+```
+code ::= atomic_code*
+atomic_code ::= $var id = exp
+    | $var id = [[ code ]]
+    | $range id exp..exp
+    | $for id sep [[ code ]]
+    | $($)
+    | $id
+    | $(exp)
+    | $if exp [[ code ]] else_branch
+    | [[ code ]]
+    | cpp_code
+sep ::= cpp_code | empty_string
+else_branch ::= $else [[ code ]]
+    | $elif exp [[ code ]] else_branch
+    | empty_string
+exp ::= simple_expression_in_Python_syntax
+```
+
+## Code ##
+
+You can find the source code of Pump in [scripts/pump.py](../scripts/pump.py). It is still
+very unpolished and lacks automated tests, although it has been
+successfully used many times. If you find a chance to use it in your
+project, please let us know what you think!  We also welcome help on
+improving Pump.
+
+## Real Examples ##
+
+You can find real-world applications of Pump in [Google Test](http://www.google.com/codesearch?q=file%3A\.pump%24+package%3Ahttp%3A%2F%2Fgoogletest\.googlecode\.com) and [Google Mock](http://www.google.com/codesearch?q=file%3A\.pump%24+package%3Ahttp%3A%2F%2Fgooglemock\.googlecode\.com).  The source file `foo.h.pump` generates `foo.h`.
+
+## Tips ##
+
+  * If a meta variable is followed by a letter or digit, you can separate them using `[[]]`, which inserts an empty string. For example `Foo$j[[]]Helper` generate `Foo1Helper` when `j` is 1.
+  * To avoid extra-long Pump source lines, you can break a line anywhere you want by inserting `[[]]` followed by a new line. Since any new-line character next to `[[` or `]]` is ignored, the generated code won't contain this new line.
diff --git a/src/external/googletest/googletest/docs/Samples.md b/src/external/googletest/googletest/docs/Samples.md
new file mode 100644 (file)
index 0000000..f21d200
--- /dev/null
@@ -0,0 +1,14 @@
+If you're like us, you'd like to look at some Google Test sample code.  The
+[samples folder](../samples) has a number of well-commented samples showing how to use a
+variety of Google Test features.
+
+  * [Sample #1](../samples/sample1_unittest.cc) shows the basic steps of using Google Test to test C++ functions.
+  * [Sample #2](../samples/sample2_unittest.cc) shows a more complex unit test for a class with multiple member functions.
+  * [Sample #3](../samples/sample3_unittest.cc) uses a test fixture.
+  * [Sample #4](../samples/sample4_unittest.cc) is another basic example of using Google Test.
+  * [Sample #5](../samples/sample5_unittest.cc) teaches how to reuse a test fixture in multiple test cases by deriving sub-fixtures from it.
+  * [Sample #6](../samples/sample6_unittest.cc) demonstrates type-parameterized tests.
+  * [Sample #7](../samples/sample7_unittest.cc) teaches the basics of value-parameterized tests.
+  * [Sample #8](../samples/sample8_unittest.cc) shows using `Combine()` in value-parameterized tests.
+  * [Sample #9](../samples/sample9_unittest.cc) shows use of the listener API to modify Google Test's console output and the use of its reflection API to inspect test results.
+  * [Sample #10](../samples/sample10_unittest.cc) shows use of the listener API to implement a primitive memory leak checker.
diff --git a/src/external/googletest/googletest/docs/XcodeGuide.md b/src/external/googletest/googletest/docs/XcodeGuide.md
new file mode 100644 (file)
index 0000000..bf24bf5
--- /dev/null
@@ -0,0 +1,93 @@
+
+
+This guide will explain how to use the Google Testing Framework in your Xcode projects on Mac OS X. This tutorial begins by quickly explaining what to do for experienced users. After the quick start, the guide goes provides additional explanation about each step.
+
+# Quick Start #
+
+Here is the quick guide for using Google Test in your Xcode project.
+
+  1. Download the source from the [website](http://code.google.com/p/googletest) using this command: `svn checkout http://googletest.googlecode.com/svn/trunk/ googletest-read-only`
+  1. Open up the `gtest.xcodeproj` in the `googletest-read-only/xcode/` directory and build the gtest.framework.
+  1. Create a new "Shell Tool" target in your Xcode project called something like "UnitTests"
+  1. Add the gtest.framework to your project and add it to the "Link Binary with Libraries" build phase of "UnitTests"
+  1. Add your unit test source code to the "Compile Sources" build phase of "UnitTests"
+  1. Edit the "UnitTests" executable and add an environment variable named "DYLD\_FRAMEWORK\_PATH" with a value equal to the path to the framework containing the gtest.framework relative to the compiled executable.
+  1. Build and Go
+
+The following sections further explain each of the steps listed above in depth, describing in more detail how to complete it including some variations.
+
+# Get the Source #
+
+Currently, the gtest.framework discussed here isn't available in a tagged release of Google Test, it is only available in the trunk. As explained at the Google Test [site](http://code.google.com/p/googletest/source/checkout">svn), you can get the code from anonymous SVN with this command:
+
+```
+svn checkout http://googletest.googlecode.com/svn/trunk/ googletest-read-only
+```
+
+Alternatively, if you are working with Subversion in your own code base, you can add Google Test as an external dependency to your own Subversion repository. By following this approach, everyone that checks out your svn repository will also receive a copy of Google Test (a specific version, if you wish) without having to check it out explicitly. This makes the set up of your project simpler and reduces the copied code in the repository.
+
+To use `svn:externals`, decide where you would like to have the external source reside. You might choose to put the external source inside the trunk, because you want it to be part of the branch when you make a release. However, keeping it outside the trunk in a version-tagged directory called something like `third-party/googletest/1.0.1`, is another option. Once the location is established, use `svn propedit svn:externals _directory_` to set the svn:externals property on a directory in your repository. This directory won't contain the code, but be its versioned parent directory.
+
+The command `svn propedit` will bring up your Subversion editor, making editing the long, (potentially multi-line) property simpler. This same method can be used to check out a tagged branch, by using the appropriate URL (e.g. `http://googletest.googlecode.com/svn/tags/release-1.0.1`). Additionally, the svn:externals property allows the specification of a particular revision of the trunk with the `-r_##_` option (e.g. `externals/src/googletest -r60 http://googletest.googlecode.com/svn/trunk`).
+
+Here is an example of using the svn:externals properties on a trunk (read via `svn propget`) of a project. This value checks out a copy of Google Test into the `trunk/externals/src/googletest/` directory.
+
+```
+[Computer:svn] user$ svn propget svn:externals trunk
+externals/src/googletest http://googletest.googlecode.com/svn/trunk
+```
+
+# Add the Framework to Your Project #
+
+The next step is to build and add the gtest.framework to your own project. This guide describes two common ways below.
+
+  * **Option 1** --- The simplest way to add Google Test to your own project, is to open gtest.xcodeproj (found in the xcode/ directory of the Google Test trunk) and build the framework manually. Then, add the built framework into your project using the "Add->Existing Framework..." from the context menu or "Project->Add..." from the main menu. The gtest.framework is relocatable and contains the headers and object code that you'll need to make tests. This method requires rebuilding every time you upgrade Google Test in your project.
+  * **Option 2** --- If you are going to be living off the trunk of Google Test, incorporating its latest features into your unit tests (or are a Google Test developer yourself). You'll want to rebuild the framework every time the source updates. to do this, you'll need to add the gtest.xcodeproj file, not the framework itself, to your own Xcode project. Then, from the build products that are revealed by the project's disclosure triangle, you can find the gtest.framework, which can be added to your targets (discussed below).
+
+# Make a Test Target #
+
+To start writing tests, make a new "Shell Tool" target. This target template is available under BSD, Cocoa, or Carbon. Add your unit test source code to the "Compile Sources" build phase of the target.
+
+Next, you'll want to add gtest.framework in two different ways, depending upon which option you chose above.
+
+  * **Option 1** --- During compilation, Xcode will need to know that you are linking against the gtest.framework. Add the gtest.framework to the "Link Binary with Libraries" build phase of your test target. This will include the Google Test headers in your header search path, and will tell the linker where to find the library.
+  * **Option 2** --- If your working out of the trunk, you'll also want to add gtest.framework to your "Link Binary with Libraries" build phase of your test target. In addition, you'll  want to add the gtest.framework as a dependency to your unit test target. This way, Xcode will make sure that gtest.framework is up to date, every time your build your target. Finally, if you don't share build directories with Google Test, you'll have to copy the gtest.framework into your own build products directory using a "Run Script" build phase.
+
+# Set Up the Executable Run Environment #
+
+Since the unit test executable is a shell tool, it doesn't have a bundle with a `Contents/Frameworks` directory, in which to place gtest.framework. Instead, the dynamic linker must be told at runtime to search for the framework in another location. This can be accomplished by setting the "DYLD\_FRAMEWORK\_PATH" environment variable in the "Edit Active Executable ..." Arguments tab, under "Variables to be set in the environment:". The path for this value is the path (relative or absolute) of the directory containing the gtest.framework.
+
+If you haven't set up the DYLD\_FRAMEWORK\_PATH, correctly, you might get a message like this:
+
+```
+[Session started at 2008-08-15 06:23:57 -0600.]
+  dyld: Library not loaded: @loader_path/../Frameworks/gtest.framework/Versions/A/gtest
+    Referenced from: /Users/username/Documents/Sandbox/gtestSample/build/Debug/WidgetFrameworkTest
+    Reason: image not found
+```
+
+To correct this problem, got to the directory containing the executable named in "Referenced from:" value in the error message above. Then, with the terminal in this location, find the relative path to the directory containing the gtest.framework. That is the value you'll need to set as the DYLD\_FRAMEWORK\_PATH.
+
+# Build and Go #
+
+Now, when you click "Build and Go", the test will be executed. Dumping out something like this:
+
+```
+[Session started at 2008-08-06 06:36:13 -0600.]
+[==========] Running 2 tests from 1 test case.
+[----------] Global test environment set-up.
+[----------] 2 tests from WidgetInitializerTest
+[ RUN      ] WidgetInitializerTest.TestConstructor
+[       OK ] WidgetInitializerTest.TestConstructor
+[ RUN      ] WidgetInitializerTest.TestConversion
+[       OK ] WidgetInitializerTest.TestConversion
+[----------] Global test environment tear-down
+[==========] 2 tests from 1 test case ran.
+[  PASSED  ] 2 tests.
+
+The Debugger has exited with status 0.  
+```
+
+# Summary #
+
+Unit testing is a valuable way to ensure your data model stays valid even during rapid development or refactoring. The Google Testing Framework is a great unit testing framework for C and C++ which integrates well with an Xcode development environment.
\ No newline at end of file
similarity index 97%
rename from src/external/gmock-1.7.0/gtest/include/gtest/gtest-param-test.h
rename to src/external/googletest/googletest/include/gtest/gtest-param-test.h
index 40c6648f4f14c909c7baa1b1e6c899644584ac3a..2d668ac188229f12f37f8c269b7cc344e55c72b0 100644 (file)
@@ -1387,14 +1387,17 @@ internal::CartesianProductHolder10<Generator1, Generator2, Generator3,
     static int AddToRegistry() { \
       ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
           GetTestCasePatternHolder<test_case_name>(\
-              #test_case_name, __FILE__, __LINE__)->AddTestPattern(\
-                  #test_case_name, \
-                  #test_name, \
-                  new ::testing::internal::TestMetaFactory< \
-                      GTEST_TEST_CLASS_NAME_(test_case_name, test_name)>()); \
+              #test_case_name, \
+              ::testing::internal::CodeLocation(\
+                  __FILE__, __LINE__))->AddTestPattern(\
+                      #test_case_name, \
+                      #test_name, \
+                      new ::testing::internal::TestMetaFactory< \
+                          GTEST_TEST_CLASS_NAME_(\
+                              test_case_name, test_name)>()); \
       return 0; \
     } \
-    static int gtest_registering_dummy_; \
+    static int gtest_registering_dummy_ GTEST_ATTRIBUTE_UNUSED_; \
     GTEST_DISALLOW_COPY_AND_ASSIGN_(\
         GTEST_TEST_CLASS_NAME_(test_case_name, test_name)); \
   }; \
@@ -1403,16 +1406,36 @@ internal::CartesianProductHolder10<Generator1, Generator2, Generator3,
       GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::AddToRegistry(); \
   void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
 
-# define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator) \
+// The optional last argument to INSTANTIATE_TEST_CASE_P allows the user
+// to specify a function or functor that generates custom test name suffixes
+// based on the test parameters. The function should accept one argument of
+// type testing::TestParamInfo<class ParamType>, and return std::string.
+//
+// testing::PrintToStringParamName is a builtin test suffix generator that
+// returns the value of testing::PrintToString(GetParam()). It does not work
+// for std::string or C strings.
+//
+// Note: test names must be non-empty, unique, and may only contain ASCII
+// alphanumeric characters or underscore.
+
+# define INSTANTIATE_TEST_CASE_P(prefix, test_case_name, generator, ...) \
   static ::testing::internal::ParamGenerator<test_case_name::ParamType> \
       gtest_##prefix##test_case_name##_EvalGenerator_() { return generator; } \
-  int gtest_##prefix##test_case_name##_dummy_ = \
+  static ::std::string gtest_##prefix##test_case_name##_EvalGenerateName_( \
+      const ::testing::TestParamInfo<test_case_name::ParamType>& info) { \
+    return ::testing::internal::GetParamNameGen<test_case_name::ParamType> \
+        (__VA_ARGS__)(info); \
+  } \
+  int gtest_##prefix##test_case_name##_dummy_ GTEST_ATTRIBUTE_UNUSED_ = \
       ::testing::UnitTest::GetInstance()->parameterized_test_registry(). \
           GetTestCasePatternHolder<test_case_name>(\
-              #test_case_name, __FILE__, __LINE__)->AddTestCaseInstantiation(\
-                  #prefix, \
-                  &gtest_##prefix##test_case_name##_EvalGenerator_, \
-                  __FILE__, __LINE__)
+              #test_case_name, \
+              ::testing::internal::CodeLocation(\
+                  __FILE__, __LINE__))->AddTestCaseInstantiation(\
+                      #prefix, \
+                      &gtest_##prefix##test_case_name##_EvalGenerator_, \
+                      &gtest_##prefix##test_case_name##_EvalGenerateName_, \
+                      __FILE__, __LINE__)
 
 }  // namespace testing
 
similarity index 80%
rename from src/external/gmock-1.7.0/gtest/include/gtest/gtest-printers.h
rename to src/external/googletest/googletest/include/gtest/gtest-printers.h
index 0639d9f5869d02374776f19ef526ce39b6a69d96..8a33164cb38ab505962f75b157654aeee5459f3a 100644 (file)
 #include "gtest/internal/gtest-port.h"
 #include "gtest/internal/gtest-internal.h"
 
+#if GTEST_HAS_STD_TUPLE_
+# include <tuple>
+#endif
+
 namespace testing {
 
 // Definitions in the 'internal' and 'internal2' name spaces are
@@ -250,6 +254,103 @@ void DefaultPrintNonContainerTo(const T& value, ::std::ostream* os) {
 namespace testing {
 namespace internal {
 
+// FormatForComparison<ToPrint, OtherOperand>::Format(value) formats a
+// value of type ToPrint that is an operand of a comparison assertion
+// (e.g. ASSERT_EQ).  OtherOperand is the type of the other operand in
+// the comparison, and is used to help determine the best way to
+// format the value.  In particular, when the value is a C string
+// (char pointer) and the other operand is an STL string object, we
+// want to format the C string as a string, since we know it is
+// compared by value with the string object.  If the value is a char
+// pointer but the other operand is not an STL string object, we don't
+// know whether the pointer is supposed to point to a NUL-terminated
+// string, and thus want to print it as a pointer to be safe.
+//
+// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+
+// The default case.
+template <typename ToPrint, typename OtherOperand>
+class FormatForComparison {
+ public:
+  static ::std::string Format(const ToPrint& value) {
+    return ::testing::PrintToString(value);
+  }
+};
+
+// Array.
+template <typename ToPrint, size_t N, typename OtherOperand>
+class FormatForComparison<ToPrint[N], OtherOperand> {
+ public:
+  static ::std::string Format(const ToPrint* value) {
+    return FormatForComparison<const ToPrint*, OtherOperand>::Format(value);
+  }
+};
+
+// By default, print C string as pointers to be safe, as we don't know
+// whether they actually point to a NUL-terminated string.
+
+#define GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(CharType)                \
+  template <typename OtherOperand>                                      \
+  class FormatForComparison<CharType*, OtherOperand> {                  \
+   public:                                                              \
+    static ::std::string Format(CharType* value) {                      \
+      return ::testing::PrintToString(static_cast<const void*>(value)); \
+    }                                                                   \
+  }
+
+GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(char);
+GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const char);
+GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(wchar_t);
+GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const wchar_t);
+
+#undef GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_
+
+// If a C string is compared with an STL string object, we know it's meant
+// to point to a NUL-terminated string, and thus can print it as a string.
+
+#define GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(CharType, OtherStringType) \
+  template <>                                                           \
+  class FormatForComparison<CharType*, OtherStringType> {               \
+   public:                                                              \
+    static ::std::string Format(CharType* value) {                      \
+      return ::testing::PrintToString(value);                           \
+    }                                                                   \
+  }
+
+GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::std::string);
+GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::std::string);
+
+#if GTEST_HAS_GLOBAL_STRING
+GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::string);
+GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::string);
+#endif
+
+#if GTEST_HAS_GLOBAL_WSTRING
+GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(wchar_t, ::wstring);
+GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const wchar_t, ::wstring);
+#endif
+
+#if GTEST_HAS_STD_WSTRING
+GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(wchar_t, ::std::wstring);
+GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const wchar_t, ::std::wstring);
+#endif
+
+#undef GTEST_IMPL_FORMAT_C_STRING_AS_STRING_
+
+// Formats a comparison assertion (e.g. ASSERT_EQ, EXPECT_LT, and etc)
+// operand to be used in a failure message.  The type (but not value)
+// of the other operand may affect the format.  This allows us to
+// print a char* as a raw pointer when it is compared against another
+// char* or void*, and print it as a C string when it is compared
+// against an std::string object, for example.
+//
+// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+template <typename T1, typename T2>
+std::string FormatForComparisonFailureMessage(
+    const T1& value, const T2& /* other_operand */) {
+  return FormatForComparison<T1, T2>::Format(value);
+}
+
 // UniversalPrinter<T>::Print(value, ostream_ptr) prints the given
 // value to the given ostream.  The caller must ensure that
 // 'ostream_ptr' is not NULL, or the behavior is undefined.
@@ -480,14 +581,16 @@ inline void PrintTo(const ::std::wstring& s, ::std::ostream* os) {
 }
 #endif  // GTEST_HAS_STD_WSTRING
 
-#if GTEST_HAS_TR1_TUPLE
-// Overload for ::std::tr1::tuple.  Needed for printing function arguments,
-// which are packed as tuples.
-
+#if GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_
 // Helper function for printing a tuple.  T must be instantiated with
 // a tuple type.
 template <typename T>
 void PrintTupleTo(const T& t, ::std::ostream* os);
+#endif  // GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_
+
+#if GTEST_HAS_TR1_TUPLE
+// Overload for ::std::tr1::tuple.  Needed for printing function arguments,
+// which are packed as tuples.
 
 // Overloaded PrintTo() for tuples of various arities.  We support
 // tuples of up-to 10 fields.  The following implementation works
@@ -561,6 +664,13 @@ void PrintTo(
 }
 #endif  // GTEST_HAS_TR1_TUPLE
 
+#if GTEST_HAS_STD_TUPLE_
+template <typename... Types>
+void PrintTo(const ::std::tuple<Types...>& t, ::std::ostream* os) {
+  PrintTupleTo(t, os);
+}
+#endif  // GTEST_HAS_STD_TUPLE_
+
 // Overload for std::pair.
 template <typename T1, typename T2>
 void PrintTo(const ::std::pair<T1, T2>& value, ::std::ostream* os) {
@@ -580,10 +690,7 @@ class UniversalPrinter {
  public:
   // MSVC warns about adding const to a function type, so we want to
   // disable the warning.
-#ifdef _MSC_VER
-# pragma warning(push)          // Saves the current warning state.
-# pragma warning(disable:4180)  // Temporarily disables warning 4180.
-#endif  // _MSC_VER
+  GTEST_DISABLE_MSC_WARNINGS_PUSH_(4180)
 
   // Note: we deliberately don't call this PrintTo(), as that name
   // conflicts with ::testing::internal::PrintTo in the body of the
@@ -600,9 +707,7 @@ class UniversalPrinter {
     PrintTo(value, os);
   }
 
-#ifdef _MSC_VER
-# pragma warning(pop)           // Restores the warning state.
-#endif  // _MSC_VER
+  GTEST_DISABLE_MSC_WARNINGS_POP_()
 };
 
 // UniversalPrintArray(begin, len, os) prints an array of 'len'
@@ -654,10 +759,7 @@ class UniversalPrinter<T&> {
  public:
   // MSVC warns about adding const to a function type, so we want to
   // disable the warning.
-#ifdef _MSC_VER
-# pragma warning(push)          // Saves the current warning state.
-# pragma warning(disable:4180)  // Temporarily disables warning 4180.
-#endif  // _MSC_VER
+  GTEST_DISABLE_MSC_WARNINGS_PUSH_(4180)
 
   static void Print(const T& value, ::std::ostream* os) {
     // Prints the address of the value.  We use reinterpret_cast here
@@ -668,9 +770,7 @@ class UniversalPrinter<T&> {
     UniversalPrint(value, os);
   }
 
-#ifdef _MSC_VER
-# pragma warning(pop)           // Restores the warning state.
-#endif  // _MSC_VER
+  GTEST_DISABLE_MSC_WARNINGS_POP_()
 };
 
 // Prints a value tersely: for a reference type, the referenced value
@@ -756,16 +856,65 @@ void UniversalPrint(const T& value, ::std::ostream* os) {
   UniversalPrinter<T1>::Print(value, os);
 }
 
-#if GTEST_HAS_TR1_TUPLE
 typedef ::std::vector<string> Strings;
 
+// TuplePolicy<TupleT> must provide:
+// - tuple_size
+//     size of tuple TupleT.
+// - get<size_t I>(const TupleT& t)
+//     static function extracting element I of tuple TupleT.
+// - tuple_element<size_t I>::type
+//     type of element I of tuple TupleT.
+template <typename TupleT>
+struct TuplePolicy;
+
+#if GTEST_HAS_TR1_TUPLE
+template <typename TupleT>
+struct TuplePolicy {
+  typedef TupleT Tuple;
+  static const size_t tuple_size = ::std::tr1::tuple_size<Tuple>::value;
+
+  template <size_t I>
+  struct tuple_element : ::std::tr1::tuple_element<I, Tuple> {};
+
+  template <size_t I>
+  static typename AddReference<
+      const typename ::std::tr1::tuple_element<I, Tuple>::type>::type get(
+      const Tuple& tuple) {
+    return ::std::tr1::get<I>(tuple);
+  }
+};
+template <typename TupleT>
+const size_t TuplePolicy<TupleT>::tuple_size;
+#endif  // GTEST_HAS_TR1_TUPLE
+
+#if GTEST_HAS_STD_TUPLE_
+template <typename... Types>
+struct TuplePolicy< ::std::tuple<Types...> > {
+  typedef ::std::tuple<Types...> Tuple;
+  static const size_t tuple_size = ::std::tuple_size<Tuple>::value;
+
+  template <size_t I>
+  struct tuple_element : ::std::tuple_element<I, Tuple> {};
+
+  template <size_t I>
+  static const typename ::std::tuple_element<I, Tuple>::type& get(
+      const Tuple& tuple) {
+    return ::std::get<I>(tuple);
+  }
+};
+template <typename... Types>
+const size_t TuplePolicy< ::std::tuple<Types...> >::tuple_size;
+#endif  // GTEST_HAS_STD_TUPLE_
+
+#if GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_
 // This helper template allows PrintTo() for tuples and
 // UniversalTersePrintTupleFieldsToStrings() to be defined by
 // induction on the number of tuple fields.  The idea is that
 // TuplePrefixPrinter<N>::PrintPrefixTo(t, os) prints the first N
 // fields in tuple t, and can be defined in terms of
 // TuplePrefixPrinter<N - 1>.
-
+//
 // The inductive case.
 template <size_t N>
 struct TuplePrefixPrinter {
@@ -773,9 +922,14 @@ struct TuplePrefixPrinter {
   template <typename Tuple>
   static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) {
     TuplePrefixPrinter<N - 1>::PrintPrefixTo(t, os);
-    *os << ", ";
-    UniversalPrinter<typename ::std::tr1::tuple_element<N - 1, Tuple>::type>
-        ::Print(::std::tr1::get<N - 1>(t), os);
+    GTEST_INTENTIONAL_CONST_COND_PUSH_()
+    if (N > 1) {
+    GTEST_INTENTIONAL_CONST_COND_POP_()
+      *os << ", ";
+    }
+    UniversalPrinter<
+        typename TuplePolicy<Tuple>::template tuple_element<N - 1>::type>
+        ::Print(TuplePolicy<Tuple>::template get<N - 1>(t), os);
   }
 
   // Tersely prints the first N fields of a tuple to a string vector,
@@ -784,12 +938,12 @@ struct TuplePrefixPrinter {
   static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) {
     TuplePrefixPrinter<N - 1>::TersePrintPrefixToStrings(t, strings);
     ::std::stringstream ss;
-    UniversalTersePrint(::std::tr1::get<N - 1>(t), &ss);
+    UniversalTersePrint(TuplePolicy<Tuple>::template get<N - 1>(t), &ss);
     strings->push_back(ss.str());
   }
 };
 
-// Base cases.
+// Base case.
 template <>
 struct TuplePrefixPrinter<0> {
   template <typename Tuple>
@@ -798,34 +952,13 @@ struct TuplePrefixPrinter<0> {
   template <typename Tuple>
   static void TersePrintPrefixToStrings(const Tuple&, Strings*) {}
 };
-// We have to specialize the entire TuplePrefixPrinter<> class
-// template here, even though the definition of
-// TersePrintPrefixToStrings() is the same as the generic version, as
-// Embarcadero (formerly CodeGear, formerly Borland) C++ doesn't
-// support specializing a method template of a class template.
-template <>
-struct TuplePrefixPrinter<1> {
-  template <typename Tuple>
-  static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) {
-    UniversalPrinter<typename ::std::tr1::tuple_element<0, Tuple>::type>::
-        Print(::std::tr1::get<0>(t), os);
-  }
 
-  template <typename Tuple>
-  static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) {
-    ::std::stringstream ss;
-    UniversalTersePrint(::std::tr1::get<0>(t), &ss);
-    strings->push_back(ss.str());
-  }
-};
-
-// Helper function for printing a tuple.  T must be instantiated with
-// a tuple type.
-template <typename T>
-void PrintTupleTo(const T& t, ::std::ostream* os) {
+// Helper function for printing a tuple.
+// Tuple must be either std::tr1::tuple or std::tuple type.
+template <typename Tuple>
+void PrintTupleTo(const Tuple& t, ::std::ostream* os) {
   *os << "(";
-  TuplePrefixPrinter< ::std::tr1::tuple_size<T>::value>::
-      PrintPrefixTo(t, os);
+  TuplePrefixPrinter<TuplePolicy<Tuple>::tuple_size>::PrintPrefixTo(t, os);
   *os << ")";
 }
 
@@ -835,11 +968,11 @@ void PrintTupleTo(const T& t, ::std::ostream* os) {
 template <typename Tuple>
 Strings UniversalTersePrintTupleFieldsToStrings(const Tuple& value) {
   Strings result;
-  TuplePrefixPrinter< ::std::tr1::tuple_size<Tuple>::value>::
+  TuplePrefixPrinter<TuplePolicy<Tuple>::tuple_size>::
       TersePrintPrefixToStrings(value, &result);
   return result;
 }
-#endif  // GTEST_HAS_TR1_TUPLE
+#endif  // GTEST_HAS_TR1_TUPLE || GTEST_HAS_STD_TUPLE_
 
 }  // namespace internal
 
@@ -852,4 +985,9 @@ template <typename T>
 
 }  // namespace testing
 
+// Include any custom printer added by the local installation.
+// We must include this header at the end to make sure it can use the
+// declarations from this file.
+#include "gtest/internal/custom/gtest-printers.h"
+
 #endif  // GTEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
similarity index 96%
rename from src/external/gmock-1.7.0/gtest/include/gtest/gtest-typed-test.h
rename to src/external/googletest/googletest/include/gtest/gtest-typed-test.h
index fe1e83b274bc218e42c60b08f2990e9bed2fc981..5f69d5678eaf34a600ca45f8cf934083162fafd2 100644 (file)
@@ -181,7 +181,8 @@ INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, MyTypes);
           ::testing::internal::TemplateSel< \
               GTEST_TEST_CLASS_NAME_(CaseName, TestName)>, \
           GTEST_TYPE_PARAMS_(CaseName)>::Register(\
-              "", #CaseName, #TestName, 0); \
+              "", ::testing::internal::CodeLocation(__FILE__, __LINE__), \
+              #CaseName, #TestName, 0); \
   template <typename gtest_TypeParam_> \
   void GTEST_TEST_CLASS_NAME_(CaseName, TestName)<gtest_TypeParam_>::TestBody()
 
@@ -252,7 +253,10 @@ INSTANTIATE_TYPED_TEST_CASE_P(My, FooTest, MyTypes);
       ::testing::internal::TypeParameterizedTestCase<CaseName, \
           GTEST_CASE_NAMESPACE_(CaseName)::gtest_AllTests_, \
           ::testing::internal::TypeList< Types >::type>::Register(\
-              #Prefix, #CaseName, GTEST_REGISTERED_TEST_NAMES_(CaseName))
+              #Prefix, \
+              ::testing::internal::CodeLocation(__FILE__, __LINE__), \
+              &GTEST_TYPED_TEST_CASE_P_STATE_(CaseName), \
+              #CaseName, GTEST_REGISTERED_TEST_NAMES_(CaseName))
 
 #endif  // GTEST_HAS_TYPED_TEST_P
 
similarity index 87%
rename from src/external/gmock-1.7.0/gtest/include/gtest/gtest.h
rename to src/external/googletest/googletest/include/gtest/gtest.h
index f76d8bea1eb45d265dbab007a217d826aed1a60c..f846c5bd66964977fa91eff90597ddd0bdcdce8c 100644 (file)
 // class ::string, which has the same interface as ::std::string, but
 // has a different implementation.
 //
-// The user can define GTEST_HAS_GLOBAL_STRING to 1 to indicate that
+// You can define GTEST_HAS_GLOBAL_STRING to 1 to indicate that
 // ::string is available AND is a distinct type to ::std::string, or
 // define it to 0 to indicate otherwise.
 //
-// If the user's ::std::string and ::string are the same class due to
-// aliasing, he should define GTEST_HAS_GLOBAL_STRING to 0.
+// If ::std::string and ::string are the same class on your platform
+// due to aliasing, you should define GTEST_HAS_GLOBAL_STRING to 0.
 //
-// If the user doesn't define GTEST_HAS_GLOBAL_STRING, it is defined
+// If you do not define GTEST_HAS_GLOBAL_STRING, it is defined
 // heuristically.
 
 namespace testing {
@@ -258,8 +258,31 @@ class GTEST_API_ AssertionResult {
   // Copy constructor.
   // Used in EXPECT_TRUE/FALSE(assertion_result).
   AssertionResult(const AssertionResult& other);
+
+  GTEST_DISABLE_MSC_WARNINGS_PUSH_(4800 /* forcing value to bool */)
+
   // Used in the EXPECT_TRUE/FALSE(bool_expression).
-  explicit AssertionResult(bool success) : success_(success) {}
+  //
+  // T must be contextually convertible to bool.
+  //
+  // The second parameter prevents this overload from being considered if
+  // the argument is implicitly convertible to AssertionResult. In that case
+  // we want AssertionResult's copy constructor to be used.
+  template <typename T>
+  explicit AssertionResult(
+      const T& success,
+      typename internal::EnableIf<
+          !internal::ImplicitlyConvertible<T, AssertionResult>::value>::type*
+          /*enabler*/ = NULL)
+      : success_(success) {}
+
+  GTEST_DISABLE_MSC_WARNINGS_POP_()
+
+  // Assignment operator.
+  AssertionResult& operator=(AssertionResult other) {
+    swap(other);
+    return *this;
+  }
 
   // Returns true iff the assertion succeeded.
   operator bool() const { return success_; }  // NOLINT
@@ -300,6 +323,9 @@ class GTEST_API_ AssertionResult {
     message_->append(a_message.GetString().c_str());
   }
 
+  // Swap the contents of this AssertionResult with other.
+  void swap(AssertionResult& other);
+
   // Stores result of the assertion predicate.
   bool success_;
   // Stores the message describing the condition in case the expectation
@@ -307,8 +333,6 @@ class GTEST_API_ AssertionResult {
   // Referenced via a pointer to avoid taking too much stack frame space
   // with test assertions.
   internal::scoped_ptr< ::std::string> message_;
-
-  GTEST_DISALLOW_ASSIGN_(AssertionResult);
 };
 
 // Makes a successful assertion result.
@@ -335,8 +359,8 @@ GTEST_API_ AssertionResult AssertionFailure(const Message& msg);
 //
 //   class FooTest : public testing::Test {
 //    protected:
-//     virtual void SetUp() { ... }
-//     virtual void TearDown() { ... }
+//     void SetUp() override { ... }
+//     void TearDown() override { ... }
 //     ...
 //   };
 //
@@ -428,20 +452,19 @@ class GTEST_API_ Test {
   // internal method to avoid clashing with names used in user TESTs.
   void DeleteSelf_() { delete this; }
 
-  // Uses a GTestFlagSaver to save and restore all Google Test flags.
-  const internal::GTestFlagSaver* const gtest_flag_saver_;
+  const internal::scoped_ptr< GTEST_FLAG_SAVER_ > gtest_flag_saver_;
 
-  // Often a user mis-spells SetUp() as Setup() and spends a long time
+  // Often a user misspells SetUp() as Setup() and spends a long time
   // wondering why it is never called by Google Test.  The declaration of
   // the following method is solely for catching such an error at
   // compile time:
   //
   //   - The return type is deliberately chosen to be not void, so it
-  //   will be a conflict if a user declares void Setup() in his test
-  //   fixture.
+  //   will be a conflict if void Setup() is declared in the user's
+  //   test fixture.
   //
   //   - This method is private, so it will be another compiler error
-  //   if a user calls it from his test fixture.
+  //   if the method is called from the user's test fixture.
   //
   // DO NOT OVERRIDE THIS FUNCTION.
   //
@@ -646,6 +669,12 @@ class GTEST_API_ TestInfo {
     return NULL;
   }
 
+  // Returns the file name where this test is defined.
+  const char* file() const { return location_.file.c_str(); }
+
+  // Returns the line where this test is defined.
+  int line() const { return location_.line; }
+
   // Returns true if this test should run, that is if the test is not
   // disabled (or it is disabled but the also_run_disabled_tests flag has
   // been specified) and its full name matches the user-specified filter.
@@ -688,6 +717,7 @@ class GTEST_API_ TestInfo {
       const char* name,
       const char* type_param,
       const char* value_param,
+      internal::CodeLocation code_location,
       internal::TypeId fixture_class_id,
       Test::SetUpTestCaseFunc set_up_tc,
       Test::TearDownTestCaseFunc tear_down_tc,
@@ -699,6 +729,7 @@ class GTEST_API_ TestInfo {
            const std::string& name,
            const char* a_type_param,   // NULL if not a type-parameterized test
            const char* a_value_param,  // NULL if not a value-parameterized test
+           internal::CodeLocation a_code_location,
            internal::TypeId fixture_class_id,
            internal::TestFactoryBase* factory);
 
@@ -725,6 +756,7 @@ class GTEST_API_ TestInfo {
   // Text representation of the value parameter, or NULL if this is not a
   // value-parameterized test.
   const internal::scoped_ptr<const ::std::string> value_param_;
+  internal::CodeLocation location_;
   const internal::TypeId fixture_class_id_;   // ID of the test fixture class
   bool should_run_;                 // True iff this test should run
   bool is_disabled_;                // True iff this test is disabled
@@ -924,7 +956,7 @@ class GTEST_API_ TestCase {
 };
 
 // An Environment object is capable of setting up and tearing down an
-// environment.  The user should subclass this to define his own
+// environment.  You should subclass this to define your own
 // environment(s).
 //
 // An Environment object does the set-up and tear-down in virtual
@@ -1336,139 +1368,42 @@ GTEST_API_ void InitGoogleTest(int* argc, wchar_t** argv);
 
 namespace internal {
 
-// FormatForComparison<ToPrint, OtherOperand>::Format(value) formats a
-// value of type ToPrint that is an operand of a comparison assertion
-// (e.g. ASSERT_EQ).  OtherOperand is the type of the other operand in
-// the comparison, and is used to help determine the best way to
-// format the value.  In particular, when the value is a C string
-// (char pointer) and the other operand is an STL string object, we
-// want to format the C string as a string, since we know it is
-// compared by value with the string object.  If the value is a char
-// pointer but the other operand is not an STL string object, we don't
-// know whether the pointer is supposed to point to a NUL-terminated
-// string, and thus want to print it as a pointer to be safe.
-//
-// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
-
-// The default case.
-template <typename ToPrint, typename OtherOperand>
-class FormatForComparison {
- public:
-  static ::std::string Format(const ToPrint& value) {
-    return ::testing::PrintToString(value);
-  }
-};
-
-// Array.
-template <typename ToPrint, size_t N, typename OtherOperand>
-class FormatForComparison<ToPrint[N], OtherOperand> {
- public:
-  static ::std::string Format(const ToPrint* value) {
-    return FormatForComparison<const ToPrint*, OtherOperand>::Format(value);
-  }
-};
-
-// By default, print C string as pointers to be safe, as we don't know
-// whether they actually point to a NUL-terminated string.
-
-#define GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(CharType)                \
-  template <typename OtherOperand>                                      \
-  class FormatForComparison<CharType*, OtherOperand> {                  \
-   public:                                                              \
-    static ::std::string Format(CharType* value) {                      \
-      return ::testing::PrintToString(static_cast<const void*>(value)); \
-    }                                                                   \
-  }
-
-GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(char);
-GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const char);
-GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(wchar_t);
-GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const wchar_t);
-
-#undef GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_
-
-// If a C string is compared with an STL string object, we know it's meant
-// to point to a NUL-terminated string, and thus can print it as a string.
-
-#define GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(CharType, OtherStringType) \
-  template <>                                                           \
-  class FormatForComparison<CharType*, OtherStringType> {               \
-   public:                                                              \
-    static ::std::string Format(CharType* value) {                      \
-      return ::testing::PrintToString(value);                           \
-    }                                                                   \
-  }
-
-GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::std::string);
-GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::std::string);
-
-#if GTEST_HAS_GLOBAL_STRING
-GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::string);
-GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::string);
-#endif
-
-#if GTEST_HAS_GLOBAL_WSTRING
-GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(wchar_t, ::wstring);
-GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const wchar_t, ::wstring);
-#endif
-
-#if GTEST_HAS_STD_WSTRING
-GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(wchar_t, ::std::wstring);
-GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const wchar_t, ::std::wstring);
-#endif
-
-#undef GTEST_IMPL_FORMAT_C_STRING_AS_STRING_
-
-// Formats a comparison assertion (e.g. ASSERT_EQ, EXPECT_LT, and etc)
-// operand to be used in a failure message.  The type (but not value)
-// of the other operand may affect the format.  This allows us to
-// print a char* as a raw pointer when it is compared against another
-// char* or void*, and print it as a C string when it is compared
-// against an std::string object, for example.
-//
-// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+// Separate the error generating code from the code path to reduce the stack
+// frame size of CmpHelperEQ. This helps reduce the overhead of some sanitizers
+// when calling EXPECT_* in a tight loop.
 template <typename T1, typename T2>
-std::string FormatForComparisonFailureMessage(
-    const T1& value, const T2& /* other_operand */) {
-  return FormatForComparison<T1, T2>::Format(value);
+AssertionResult CmpHelperEQFailure(const char* lhs_expression,
+                                   const char* rhs_expression,
+                                   const T1& lhs, const T2& rhs) {
+  return EqFailure(lhs_expression,
+                   rhs_expression,
+                   FormatForComparisonFailureMessage(lhs, rhs),
+                   FormatForComparisonFailureMessage(rhs, lhs),
+                   false);
 }
 
 // The helper function for {ASSERT|EXPECT}_EQ.
 template <typename T1, typename T2>
-AssertionResult CmpHelperEQ(const char* expected_expression,
-                            const char* actual_expression,
-                            const T1& expected,
-                            const T2& actual) {
-#ifdef _MSC_VER
-# pragma warning(push)          // Saves the current warning state.
-# pragma warning(disable:4389)  // Temporarily disables warning on
-                                // signed/unsigned mismatch.
-# pragma warning(disable:4805)  // Temporarily disables warning on
-                                // unsafe mix of types
-#endif
-
-  if (expected == actual) {
+AssertionResult CmpHelperEQ(const char* lhs_expression,
+                            const char* rhs_expression,
+                            const T1& lhs,
+                            const T2& rhs) {
+GTEST_DISABLE_MSC_WARNINGS_PUSH_(4389 /* signed/unsigned mismatch */)
+  if (lhs == rhs) {
     return AssertionSuccess();
   }
+GTEST_DISABLE_MSC_WARNINGS_POP_()
 
-#ifdef _MSC_VER
-# pragma warning(pop)          // Restores the warning state.
-#endif
-
-  return EqFailure(expected_expression,
-                   actual_expression,
-                   FormatForComparisonFailureMessage(expected, actual),
-                   FormatForComparisonFailureMessage(actual, expected),
-                   false);
+  return CmpHelperEQFailure(lhs_expression, rhs_expression, lhs, rhs);
 }
 
 // With this overloaded version, we allow anonymous enums to be used
 // in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous enums
 // can be implicitly cast to BiggestInt.
-GTEST_API_ AssertionResult CmpHelperEQ(const char* expected_expression,
-                                       const char* actual_expression,
-                                       BiggestInt expected,
-                                       BiggestInt actual);
+GTEST_API_ AssertionResult CmpHelperEQ(const char* lhs_expression,
+                                       const char* rhs_expression,
+                                       BiggestInt lhs,
+                                       BiggestInt rhs);
 
 // The helper class for {ASSERT|EXPECT}_EQ.  The template argument
 // lhs_is_null_literal is true iff the first argument to ASSERT_EQ()
@@ -1479,12 +1414,11 @@ class EqHelper {
  public:
   // This templatized version is for the general case.
   template <typename T1, typename T2>
-  static AssertionResult Compare(const char* expected_expression,
-                                 const char* actual_expression,
-                                 const T1& expected,
-                                 const T2& actual) {
-    return CmpHelperEQ(expected_expression, actual_expression, expected,
-                       actual);
+  static AssertionResult Compare(const char* lhs_expression,
+                                 const char* rhs_expression,
+                                 const T1& lhs,
+                                 const T2& rhs) {
+    return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
   }
 
   // With this overloaded version, we allow anonymous enums to be used
@@ -1493,12 +1427,11 @@ class EqHelper {
   //
   // Even though its body looks the same as the above version, we
   // cannot merge the two, as it will make anonymous enums unhappy.
-  static AssertionResult Compare(const char* expected_expression,
-                                 const char* actual_expression,
-                                 BiggestInt expected,
-                                 BiggestInt actual) {
-    return CmpHelperEQ(expected_expression, actual_expression, expected,
-                       actual);
+  static AssertionResult Compare(const char* lhs_expression,
+                                 const char* rhs_expression,
+                                 BiggestInt lhs,
+                                 BiggestInt rhs) {
+    return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
   }
 };
 
@@ -1513,40 +1446,52 @@ class EqHelper<true> {
   // EXPECT_EQ(false, a_bool).
   template <typename T1, typename T2>
   static AssertionResult Compare(
-      const char* expected_expression,
-      const char* actual_expression,
-      const T1& expected,
-      const T2& actual,
+      const char* lhs_expression,
+      const char* rhs_expression,
+      const T1& lhs,
+      const T2& rhs,
       // The following line prevents this overload from being considered if T2
       // is not a pointer type.  We need this because ASSERT_EQ(NULL, my_ptr)
       // expands to Compare("", "", NULL, my_ptr), which requires a conversion
       // to match the Secret* in the other overload, which would otherwise make
       // this template match better.
       typename EnableIf<!is_pointer<T2>::value>::type* = 0) {
-    return CmpHelperEQ(expected_expression, actual_expression, expected,
-                       actual);
+    return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
   }
 
   // This version will be picked when the second argument to ASSERT_EQ() is a
   // pointer, e.g. ASSERT_EQ(NULL, a_pointer).
   template <typename T>
   static AssertionResult Compare(
-      const char* expected_expression,
-      const char* actual_expression,
+      const char* lhs_expression,
+      const char* rhs_expression,
       // We used to have a second template parameter instead of Secret*.  That
       // template parameter would deduce to 'long', making this a better match
       // than the first overload even without the first overload's EnableIf.
       // Unfortunately, gcc with -Wconversion-null warns when "passing NULL to
       // non-pointer argument" (even a deduced integral argument), so the old
       // implementation caused warnings in user code.
-      Secret* /* expected (NULL) */,
-      T* actual) {
-    // We already know that 'expected' is a null pointer.
-    return CmpHelperEQ(expected_expression, actual_expression,
-                       static_cast<T*>(NULL), actual);
+      Secret* /* lhs (NULL) */,
+      T* rhs) {
+    // We already know that 'lhs' is a null pointer.
+    return CmpHelperEQ(lhs_expression, rhs_expression,
+                       static_cast<T*>(NULL), rhs);
   }
 };
 
+// Separate the error generating code from the code path to reduce the stack
+// frame size of CmpHelperOP. This helps reduce the overhead of some sanitizers
+// when calling EXPECT_OP in a tight loop.
+template <typename T1, typename T2>
+AssertionResult CmpHelperOpFailure(const char* expr1, const char* expr2,
+                                   const T1& val1, const T2& val2,
+                                   const char* op) {
+  return AssertionFailure()
+         << "Expected: (" << expr1 << ") " << op << " (" << expr2
+         << "), actual: " << FormatForComparisonFailureMessage(val1, val2)
+         << " vs " << FormatForComparisonFailureMessage(val2, val1);
+}
+
 // A macro for implementing the helper functions needed to implement
 // ASSERT_?? and EXPECT_??.  It is here just to avoid copy-and-paste
 // of similar code.
@@ -1557,6 +1502,7 @@ class EqHelper<true> {
 // with gcc 4.
 //
 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
+
 #define GTEST_IMPL_CMP_HELPER_(op_name, op)\
 template <typename T1, typename T2>\
 AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \
@@ -1564,10 +1510,7 @@ AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \
   if (val1 op val2) {\
     return AssertionSuccess();\
   } else {\
-    return AssertionFailure() \
-        << "Expected: (" << expr1 << ") " #op " (" << expr2\
-        << "), actual: " << FormatForComparisonFailureMessage(val1, val2)\
-        << " vs " << FormatForComparisonFailureMessage(val2, val1);\
+    return CmpHelperOpFailure(expr1, expr2, val1, val2, #op);\
   }\
 }\
 GTEST_API_ AssertionResult CmpHelper##op_name(\
@@ -1591,18 +1534,18 @@ GTEST_IMPL_CMP_HELPER_(GT, >);
 // The helper function for {ASSERT|EXPECT}_STREQ.
 //
 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
-GTEST_API_ AssertionResult CmpHelperSTREQ(const char* expected_expression,
-                                          const char* actual_expression,
-                                          const char* expected,
-                                          const char* actual);
+GTEST_API_ AssertionResult CmpHelperSTREQ(const char* s1_expression,
+                                          const char* s2_expression,
+                                          const char* s1,
+                                          const char* s2);
 
 // The helper function for {ASSERT|EXPECT}_STRCASEEQ.
 //
 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
-GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char* expected_expression,
-                                              const char* actual_expression,
-                                              const char* expected,
-                                              const char* actual);
+GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char* s1_expression,
+                                              const char* s2_expression,
+                                              const char* s1,
+                                              const char* s2);
 
 // The helper function for {ASSERT|EXPECT}_STRNE.
 //
@@ -1624,10 +1567,10 @@ GTEST_API_ AssertionResult CmpHelperSTRCASENE(const char* s1_expression,
 // Helper function for *_STREQ on wide strings.
 //
 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
-GTEST_API_ AssertionResult CmpHelperSTREQ(const char* expected_expression,
-                                          const char* actual_expression,
-                                          const wchar_t* expected,
-                                          const wchar_t* actual);
+GTEST_API_ AssertionResult CmpHelperSTREQ(const char* s1_expression,
+                                          const char* s2_expression,
+                                          const wchar_t* s1,
+                                          const wchar_t* s2);
 
 // Helper function for *_STRNE on wide strings.
 //
@@ -1685,28 +1628,28 @@ namespace internal {
 //
 // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
 template <typename RawType>
-AssertionResult CmpHelperFloatingPointEQ(const char* expected_expression,
-                                         const char* actual_expression,
-                                         RawType expected,
-                                         RawType actual) {
-  const FloatingPoint<RawType> lhs(expected), rhs(actual);
+AssertionResult CmpHelperFloatingPointEQ(const char* lhs_expression,
+                                         const char* rhs_expression,
+                                         RawType lhs_value,
+                                         RawType rhs_value) {
+  const FloatingPoint<RawType> lhs(lhs_value), rhs(rhs_value);
 
   if (lhs.AlmostEquals(rhs)) {
     return AssertionSuccess();
   }
 
-  ::std::stringstream expected_ss;
-  expected_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
-              << expected;
+  ::std::stringstream lhs_ss;
+  lhs_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
+         << lhs_value;
 
-  ::std::stringstream actual_ss;
-  actual_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
-            << actual;
+  ::std::stringstream rhs_ss;
+  rhs_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
+         << rhs_value;
 
-  return EqFailure(expected_expression,
-                   actual_expression,
-                   StringStreamToString(&expected_ss),
-                   StringStreamToString(&actual_ss),
+  return EqFailure(lhs_expression,
+                   rhs_expression,
+                   StringStreamToString(&lhs_ss),
+                   StringStreamToString(&rhs_ss),
                    false);
 }
 
@@ -1914,13 +1857,13 @@ class TestWithParam : public Test, public WithParamInterface<T> {
 // AssertionResult. For more information on how to use AssertionResult with
 // these macros see comments on that class.
 #define EXPECT_TRUE(condition) \
-  GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
+  GTEST_TEST_BOOLEAN_((condition), #condition, false, true, \
                       GTEST_NONFATAL_FAILURE_)
 #define EXPECT_FALSE(condition) \
   GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
                       GTEST_NONFATAL_FAILURE_)
 #define ASSERT_TRUE(condition) \
-  GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
+  GTEST_TEST_BOOLEAN_((condition), #condition, false, true, \
                       GTEST_FATAL_FAILURE_)
 #define ASSERT_FALSE(condition) \
   GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
@@ -1932,12 +1875,12 @@ class TestWithParam : public Test, public WithParamInterface<T> {
 
 // Macros for testing equalities and inequalities.
 //
-//    * {ASSERT|EXPECT}_EQ(expected, actual): Tests that expected == actual
-//    * {ASSERT|EXPECT}_NE(v1, v2):           Tests that v1 != v2
-//    * {ASSERT|EXPECT}_LT(v1, v2):           Tests that v1 < v2
-//    * {ASSERT|EXPECT}_LE(v1, v2):           Tests that v1 <= v2
-//    * {ASSERT|EXPECT}_GT(v1, v2):           Tests that v1 > v2
-//    * {ASSERT|EXPECT}_GE(v1, v2):           Tests that v1 >= v2
+//    * {ASSERT|EXPECT}_EQ(v1, v2): Tests that v1 == v2
+//    * {ASSERT|EXPECT}_NE(v1, v2): Tests that v1 != v2
+//    * {ASSERT|EXPECT}_LT(v1, v2): Tests that v1 < v2
+//    * {ASSERT|EXPECT}_LE(v1, v2): Tests that v1 <= v2
+//    * {ASSERT|EXPECT}_GT(v1, v2): Tests that v1 > v2
+//    * {ASSERT|EXPECT}_GE(v1, v2): Tests that v1 >= v2
 //
 // When they are not, Google Test prints both the tested expressions and
 // their actual values.  The values must be compatible built-in types,
@@ -1959,8 +1902,8 @@ class TestWithParam : public Test, public WithParamInterface<T> {
 //   are related, not how their content is related.  To compare two C
 //   strings by content, use {ASSERT|EXPECT}_STR*().
 //
-//   3. {ASSERT|EXPECT}_EQ(expected, actual) is preferred to
-//   {ASSERT|EXPECT}_TRUE(expected == actual), as the former tells you
+//   3. {ASSERT|EXPECT}_EQ(v1, v2) is preferred to
+//   {ASSERT|EXPECT}_TRUE(v1 == v2), as the former tells you
 //   what the actual value is when it fails, and similarly for the
 //   other comparisons.
 //
@@ -1976,12 +1919,12 @@ class TestWithParam : public Test, public WithParamInterface<T> {
 //   ASSERT_LT(i, array_size);
 //   ASSERT_GT(records.size(), 0) << "There is no record left.";
 
-#define EXPECT_EQ(expected, actual) \
+#define EXPECT_EQ(val1, val2) \
   EXPECT_PRED_FORMAT2(::testing::internal:: \
-                      EqHelper<GTEST_IS_NULL_LITERAL_(expected)>::Compare, \
-                      expected, actual)
-#define EXPECT_NE(expected, actual) \
-  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperNE, expected, actual)
+                      EqHelper<GTEST_IS_NULL_LITERAL_(val1)>::Compare, \
+                      val1, val2)
+#define EXPECT_NE(val1, val2) \
+  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2)
 #define EXPECT_LE(val1, val2) \
   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
 #define EXPECT_LT(val1, val2) \
@@ -1991,10 +1934,10 @@ class TestWithParam : public Test, public WithParamInterface<T> {
 #define EXPECT_GT(val1, val2) \
   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
 
-#define GTEST_ASSERT_EQ(expected, actual) \
+#define GTEST_ASSERT_EQ(val1, val2) \
   ASSERT_PRED_FORMAT2(::testing::internal:: \
-                      EqHelper<GTEST_IS_NULL_LITERAL_(expected)>::Compare, \
-                      expected, actual)
+                      EqHelper<GTEST_IS_NULL_LITERAL_(val1)>::Compare, \
+                      val1, val2)
 #define GTEST_ASSERT_NE(val1, val2) \
   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2)
 #define GTEST_ASSERT_LE(val1, val2) \
@@ -2049,29 +1992,29 @@ class TestWithParam : public Test, public WithParamInterface<T> {
 //
 // These macros evaluate their arguments exactly once.
 
-#define EXPECT_STREQ(expected, actual) \
-  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, expected, actual)
+#define EXPECT_STREQ(s1, s2) \
+  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, s1, s2)
 #define EXPECT_STRNE(s1, s2) \
   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
-#define EXPECT_STRCASEEQ(expected, actual) \
-  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, expected, actual)
+#define EXPECT_STRCASEEQ(s1, s2) \
+  EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, s1, s2)
 #define EXPECT_STRCASENE(s1, s2)\
   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
 
-#define ASSERT_STREQ(expected, actual) \
-  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, expected, actual)
+#define ASSERT_STREQ(s1, s2) \
+  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, s1, s2)
 #define ASSERT_STRNE(s1, s2) \
   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
-#define ASSERT_STRCASEEQ(expected, actual) \
-  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, expected, actual)
+#define ASSERT_STRCASEEQ(s1, s2) \
+  ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, s1, s2)
 #define ASSERT_STRCASENE(s1, s2)\
   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
 
 // Macros for comparing floating-point numbers.
 //
-//    * {ASSERT|EXPECT}_FLOAT_EQ(expected, actual):
+//    * {ASSERT|EXPECT}_FLOAT_EQ(val1, val2):
 //         Tests that two float values are almost equal.
-//    * {ASSERT|EXPECT}_DOUBLE_EQ(expected, actual):
+//    * {ASSERT|EXPECT}_DOUBLE_EQ(val1, val2):
 //         Tests that two double values are almost equal.
 //    * {ASSERT|EXPECT}_NEAR(v1, v2, abs_error):
 //         Tests that v1 and v2 are within the given distance to each other.
@@ -2081,21 +2024,21 @@ class TestWithParam : public Test, public WithParamInterface<T> {
 // FloatingPoint template class in gtest-internal.h if you are
 // interested in the implementation details.
 
-#define EXPECT_FLOAT_EQ(expected, actual)\
+#define EXPECT_FLOAT_EQ(val1, val2)\
   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
-                      expected, actual)
+                      val1, val2)
 
-#define EXPECT_DOUBLE_EQ(expected, actual)\
+#define EXPECT_DOUBLE_EQ(val1, val2)\
   EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
-                      expected, actual)
+                      val1, val2)
 
-#define ASSERT_FLOAT_EQ(expected, actual)\
+#define ASSERT_FLOAT_EQ(val1, val2)\
   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
-                      expected, actual)
+                      val1, val2)
 
-#define ASSERT_DOUBLE_EQ(expected, actual)\
+#define ASSERT_DOUBLE_EQ(val1, val2)\
   ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
-                      expected, actual)
+                      val1, val2)
 
 #define EXPECT_NEAR(val1, val2, abs_error)\
   EXPECT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
@@ -2217,8 +2160,8 @@ bool StaticAssertTypeEq() {
 // The convention is to end the test case name with "Test".  For
 // example, a test case for the Foo class can be named FooTest.
 //
-// The user should put his test code between braces after using this
-// macro.  Example:
+// Test code should appear between braces after an invocation of
+// this macro.  Example:
 //
 //   TEST(FooTest, InitializesCorrectly) {
 //     Foo foo;
diff --git a/src/external/googletest/googletest/include/gtest/internal/custom/gtest-port.h b/src/external/googletest/googletest/include/gtest/internal/custom/gtest-port.h
new file mode 100644 (file)
index 0000000..7e744bd
--- /dev/null
@@ -0,0 +1,69 @@
+// Copyright 2015, Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Injection point for custom user configurations.
+// The following macros can be defined:
+//
+//   Flag related macros:
+//     GTEST_FLAG(flag_name)
+//     GTEST_USE_OWN_FLAGFILE_FLAG_  - Define to 0 when the system provides its
+//                                     own flagfile flag parsing.
+//     GTEST_DECLARE_bool_(name)
+//     GTEST_DECLARE_int32_(name)
+//     GTEST_DECLARE_string_(name)
+//     GTEST_DEFINE_bool_(name, default_val, doc)
+//     GTEST_DEFINE_int32_(name, default_val, doc)
+//     GTEST_DEFINE_string_(name, default_val, doc)
+//
+//   Test filtering:
+//     GTEST_TEST_FILTER_ENV_VAR_ - The name of an environment variable that
+//                                  will be used if --GTEST_FLAG(test_filter)
+//                                  is not provided.
+//
+//   Logging:
+//     GTEST_LOG_(severity)
+//     GTEST_CHECK_(condition)
+//     Functions LogToStderr() and FlushInfoLog() have to be provided too.
+//
+//   Threading:
+//     GTEST_HAS_NOTIFICATION_ - Enabled if Notification is already provided.
+//     GTEST_HAS_MUTEX_AND_THREAD_LOCAL_ - Enabled if Mutex and ThreadLocal are
+//                                         already provided.
+//     Must also provide GTEST_DECLARE_STATIC_MUTEX_(mutex) and
+//     GTEST_DEFINE_STATIC_MUTEX_(mutex)
+//
+//     GTEST_EXCLUSIVE_LOCK_REQUIRED_(locks)
+//     GTEST_LOCK_EXCLUDED_(locks)
+//
+// ** Custom implementation starts here **
+
+#ifndef GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PORT_H_
+#define GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PORT_H_
+
+#endif  // GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PORT_H_
diff --git a/src/external/googletest/googletest/include/gtest/internal/custom/gtest-printers.h b/src/external/googletest/googletest/include/gtest/internal/custom/gtest-printers.h
new file mode 100644 (file)
index 0000000..60c1ea0
--- /dev/null
@@ -0,0 +1,42 @@
+// Copyright 2015, Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// This file provides an injection point for custom printers in a local
+// installation of gTest.
+// It will be included from gtest-printers.h and the overrides in this file
+// will be visible to everyone.
+// See documentation at gtest/gtest-printers.h for details on how to define a
+// custom printer.
+//
+// ** Custom implementation starts here **
+
+#ifndef GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PRINTERS_H_
+#define GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PRINTERS_H_
+
+#endif  // GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PRINTERS_H_
diff --git a/src/external/googletest/googletest/include/gtest/internal/custom/gtest.h b/src/external/googletest/googletest/include/gtest/internal/custom/gtest.h
new file mode 100644 (file)
index 0000000..c27412a
--- /dev/null
@@ -0,0 +1,41 @@
+// Copyright 2015, Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Injection point for custom user configurations.
+// The following macros can be defined:
+//
+// GTEST_OS_STACK_TRACE_GETTER_  - The name of an implementation of
+//                                 OsStackTraceGetterInterface.
+//
+// ** Custom implementation starts here **
+
+#ifndef GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_H_
+#define GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_H_
+
+#endif  // GTEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_H_
similarity index 88%
rename from src/external/gmock-1.7.0/gtest/include/gtest/internal/gtest-internal.h
rename to src/external/googletest/googletest/include/gtest/internal/gtest-internal.h
index 0dcc3a3194f440dd971c3fe965a58cdd1a05d53b..ebd1cf615de07d9b5ab0e60c71008261efe54213 100644 (file)
 #include <string.h>
 #include <iomanip>
 #include <limits>
+#include <map>
 #include <set>
+#include <string>
+#include <vector>
 
 #include "gtest/gtest-message.h"
 #include "gtest/internal/gtest-string.h"
@@ -97,9 +100,6 @@ class ScopedTrace;                     // Implements scoped trace.
 class TestInfoImpl;                    // Opaque implementation of TestInfo
 class UnitTestImpl;                    // Opaque implementation of UnitTest
 
-// How many times InitGoogleTest() has been called.
-GTEST_API_ extern int g_init_gtest_count;
-
 // The text used in failure messages to indicate the start of the
 // stack trace.
 GTEST_API_ extern const char kStackTraceMarker[];
@@ -171,6 +171,36 @@ class GTEST_API_ ScopedTrace {
                             // c'tor and d'tor.  Therefore it doesn't
                             // need to be used otherwise.
 
+namespace edit_distance {
+// Returns the optimal edits to go from 'left' to 'right'.
+// All edits cost the same, with replace having lower priority than
+// add/remove.
+// Simple implementation of the Wagner–Fischer algorithm.
+// See http://en.wikipedia.org/wiki/Wagner-Fischer_algorithm
+enum EditType { kMatch, kAdd, kRemove, kReplace };
+GTEST_API_ std::vector<EditType> CalculateOptimalEdits(
+    const std::vector<size_t>& left, const std::vector<size_t>& right);
+
+// Same as above, but the input is represented as strings.
+GTEST_API_ std::vector<EditType> CalculateOptimalEdits(
+    const std::vector<std::string>& left,
+    const std::vector<std::string>& right);
+
+// Create a diff of the input strings in Unified diff format.
+GTEST_API_ std::string CreateUnifiedDiff(const std::vector<std::string>& left,
+                                         const std::vector<std::string>& right,
+                                         size_t context = 2);
+
+}  // namespace edit_distance
+
+// Calculate the diff between 'left' and 'right' and return it in unified diff
+// format.
+// If not null, stores in 'total_line_count' the total number of lines found
+// in left + right.
+GTEST_API_ std::string DiffStrings(const std::string& left,
+                                   const std::string& right,
+                                   size_t* total_line_count);
+
 // Constructs and returns the message for an equality assertion
 // (e.g. ASSERT_EQ, EXPECT_STREQ, etc) failure.
 //
@@ -471,6 +501,13 @@ GTEST_API_ AssertionResult IsHRESULTFailure(const char* expr,
 typedef void (*SetUpTestCaseFunc)();
 typedef void (*TearDownTestCaseFunc)();
 
+struct CodeLocation {
+  CodeLocation(const string& a_file, int a_line) : file(a_file), line(a_line) {}
+
+  string file;
+  int line;
+};
+
 // Creates a new TestInfo object and registers it with Google Test;
 // returns the created object.
 //
@@ -482,6 +519,7 @@ typedef void (*TearDownTestCaseFunc)();
 //                     this is not a typed or a type-parameterized test.
 //   value_param       text representation of the test's value parameter,
 //                     or NULL if this is not a type-parameterized test.
+//   code_location:    code location where the test is defined
 //   fixture_class_id: ID of the test fixture class
 //   set_up_tc:        pointer to the function that sets up the test case
 //   tear_down_tc:     pointer to the function that tears down the test case
@@ -493,6 +531,7 @@ GTEST_API_ TestInfo* MakeAndRegisterTestInfo(
     const char* name,
     const char* type_param,
     const char* value_param,
+    CodeLocation code_location,
     TypeId fixture_class_id,
     SetUpTestCaseFunc set_up_tc,
     TearDownTestCaseFunc tear_down_tc,
@@ -522,10 +561,21 @@ class GTEST_API_ TypedTestCasePState {
       fflush(stderr);
       posix::Abort();
     }
-    defined_test_names_.insert(test_name);
+    registered_tests_.insert(
+        ::std::make_pair(test_name, CodeLocation(file, line)));
     return true;
   }
 
+  bool TestExists(const std::string& test_name) const {
+    return registered_tests_.count(test_name) > 0;
+  }
+
+  const CodeLocation& GetCodeLocation(const std::string& test_name) const {
+    RegisteredTestsMap::const_iterator it = registered_tests_.find(test_name);
+    GTEST_CHECK_(it != registered_tests_.end());
+    return it->second;
+  }
+
   // Verifies that registered_tests match the test names in
   // defined_test_names_; returns registered_tests if successful, or
   // aborts the program otherwise.
@@ -533,8 +583,10 @@ class GTEST_API_ TypedTestCasePState {
       const char* file, int line, const char* registered_tests);
 
  private:
+  typedef ::std::map<std::string, CodeLocation> RegisteredTestsMap;
+
   bool registered_;
-  ::std::set<const char*> defined_test_names_;
+  RegisteredTestsMap registered_tests_;
 };
 
 // Skips to the first non-space char after the first comma in 'str';
@@ -555,6 +607,11 @@ inline std::string GetPrefixUntilComma(const char* str) {
   return comma == NULL ? str : std::string(str, comma);
 }
 
+// Splits a given string on a given delimiter, populating a given
+// vector with the fields.
+void SplitString(const ::std::string& str, char delimiter,
+                 ::std::vector< ::std::string>* dest);
+
 // TypeParameterizedTest<Fixture, TestSel, Types>::Register()
 // registers a list of type-parameterized tests with Google Test.  The
 // return value is insignificant - we just need to return something
@@ -569,8 +626,10 @@ class TypeParameterizedTest {
   // specified in INSTANTIATE_TYPED_TEST_CASE_P(Prefix, TestCase,
   // Types).  Valid values for 'index' are [0, N - 1] where N is the
   // length of Types.
-  static bool Register(const char* prefix, const char* case_name,
-                       const char* test_names, int index) {
+  static bool Register(const char* prefix,
+                       CodeLocation code_location,
+                       const char* case_name, const char* test_names,
+                       int index) {
     typedef typename Types::Head Type;
     typedef Fixture<Type> FixtureClass;
     typedef typename GTEST_BIND_(TestSel, Type) TestClass;
@@ -580,9 +639,10 @@ class TypeParameterizedTest {
     MakeAndRegisterTestInfo(
         (std::string(prefix) + (prefix[0] == '\0' ? "" : "/") + case_name + "/"
          + StreamableToString(index)).c_str(),
-        GetPrefixUntilComma(test_names).c_str(),
+        StripTrailingSpaces(GetPrefixUntilComma(test_names)).c_str(),
         GetTypeName<Type>().c_str(),
         NULL,  // No value parameter.
+        code_location,
         GetTypeId<FixtureClass>(),
         TestClass::SetUpTestCase,
         TestClass::TearDownTestCase,
@@ -590,7 +650,7 @@ class TypeParameterizedTest {
 
     // Next, recurses (at compile time) with the tail of the type list.
     return TypeParameterizedTest<Fixture, TestSel, typename Types::Tail>
-        ::Register(prefix, case_name, test_names, index + 1);
+        ::Register(prefix, code_location, case_name, test_names, index + 1);
   }
 };
 
@@ -598,8 +658,9 @@ class TypeParameterizedTest {
 template <GTEST_TEMPLATE_ Fixture, class TestSel>
 class TypeParameterizedTest<Fixture, TestSel, Types0> {
  public:
-  static bool Register(const char* /*prefix*/, const char* /*case_name*/,
-                       const char* /*test_names*/, int /*index*/) {
+  static bool Register(const char* /*prefix*/, CodeLocation,
+                       const char* /*case_name*/, const char* /*test_names*/,
+                       int /*index*/) {
     return true;
   }
 };
@@ -611,17 +672,31 @@ class TypeParameterizedTest<Fixture, TestSel, Types0> {
 template <GTEST_TEMPLATE_ Fixture, typename Tests, typename Types>
 class TypeParameterizedTestCase {
  public:
-  static bool Register(const char* prefix, const char* case_name,
-                       const char* test_names) {
+  static bool Register(const char* prefix, CodeLocation code_location,
+                       const TypedTestCasePState* state,
+                       const char* case_name, const char* test_names) {
+    std::string test_name = StripTrailingSpaces(
+        GetPrefixUntilComma(test_names));
+    if (!state->TestExists(test_name)) {
+      fprintf(stderr, "Failed to get code location for test %s.%s at %s.",
+              case_name, test_name.c_str(),
+              FormatFileLocation(code_location.file.c_str(),
+                                 code_location.line).c_str());
+      fflush(stderr);
+      posix::Abort();
+    }
+    const CodeLocation& test_location = state->GetCodeLocation(test_name);
+
     typedef typename Tests::Head Head;
 
     // First, register the first test in 'Test' for each type in 'Types'.
     TypeParameterizedTest<Fixture, Head, Types>::Register(
-        prefix, case_name, test_names, 0);
+        prefix, test_location, case_name, test_names, 0);
 
     // Next, recurses (at compile time) with the tail of the test list.
     return TypeParameterizedTestCase<Fixture, typename Tests::Tail, Types>
-        ::Register(prefix, case_name, SkipComma(test_names));
+        ::Register(prefix, code_location, state,
+                   case_name, SkipComma(test_names));
   }
 };
 
@@ -629,8 +704,9 @@ class TypeParameterizedTestCase {
 template <GTEST_TEMPLATE_ Fixture, typename Types>
 class TypeParameterizedTestCase<Fixture, Templates0, Types> {
  public:
-  static bool Register(const char* /*prefix*/, const char* /*case_name*/,
-                       const char* /*test_names*/) {
+  static bool Register(const char* /*prefix*/, CodeLocation,
+                       const TypedTestCasePState* /*state*/,
+                       const char* /*case_name*/, const char* /*test_names*/) {
     return true;
   }
 };
@@ -784,7 +860,7 @@ class ImplicitlyConvertible {
   // MakeFrom() is an expression whose type is From.  We cannot simply
   // use From(), as the type From may not have a public default
   // constructor.
-  static From MakeFrom();
+  static typename AddReference<From>::type MakeFrom();
 
   // These two functions are overloaded.  Given an expression
   // Helper(x), the compiler will pick the first version if x can be
@@ -802,25 +878,20 @@ class ImplicitlyConvertible {
   // We have to put the 'public' section after the 'private' section,
   // or MSVC refuses to compile the code.
  public:
-  // MSVC warns about implicitly converting from double to int for
-  // possible loss of data, so we need to temporarily disable the
-  // warning.
-#ifdef _MSC_VER
-# pragma warning(push)          // Saves the current warning state.
-# pragma warning(disable:4244)  // Temporarily disables warning 4244.
-
-  static const bool value =
-      sizeof(Helper(ImplicitlyConvertible::MakeFrom())) == 1;
-# pragma warning(pop)           // Restores the warning state.
-#elif defined(__BORLANDC__)
+#if defined(__BORLANDC__)
   // C++Builder cannot use member overload resolution during template
   // instantiation.  The simplest workaround is to use its C++0x type traits
   // functions (C++Builder 2009 and above only).
   static const bool value = __is_convertible(From, To);
 #else
+  // MSVC warns about implicitly converting from double to int for
+  // possible loss of data, so we need to temporarily disable the
+  // warning.
+  GTEST_DISABLE_MSC_WARNINGS_PUSH_(4244)
   static const bool value =
       sizeof(Helper(ImplicitlyConvertible::MakeFrom())) == 1;
-#endif  // _MSV_VER
+  GTEST_DISABLE_MSC_WARNINGS_POP_()
+#endif  // __BORLANDC__
 };
 template <typename From, typename To>
 const bool ImplicitlyConvertible<From, To>::value;
@@ -946,11 +1017,10 @@ void CopyArray(const T* from, size_t size, U* to) {
 
 // The relation between an NativeArray object (see below) and the
 // native array it represents.
-enum RelationToSource {
-  kReference,  // The NativeArray references the native array.
-  kCopy        // The NativeArray makes a copy of the native array and
-               // owns the copy.
-};
+// We use 2 different structs to allow non-copyable types to be used, as long
+// as RelationToSourceReference() is passed.
+struct RelationToSourceReference {};
+struct RelationToSourceCopy {};
 
 // Adapts a native array to a read-only STL-style container.  Instead
 // of the complete STL container concept, this adaptor only implements
@@ -968,22 +1038,23 @@ class NativeArray {
   typedef Element* iterator;
   typedef const Element* const_iterator;
 
-  // Constructs from a native array.
-  NativeArray(const Element* array, size_t count, RelationToSource relation) {
-    Init(array, count, relation);
+  // Constructs from a native array. References the source.
+  NativeArray(const Element* array, size_t count, RelationToSourceReference) {
+    InitRef(array, count);
+  }
+
+  // Constructs from a native array. Copies the source.
+  NativeArray(const Element* array, size_t count, RelationToSourceCopy) {
+    InitCopy(array, count);
   }
 
   // Copy constructor.
   NativeArray(const NativeArray& rhs) {
-    Init(rhs.array_, rhs.size_, rhs.relation_to_source_);
+    (this->*rhs.clone_)(rhs.array_, rhs.size_);
   }
 
   ~NativeArray() {
-    // Ensures that the user doesn't instantiate NativeArray with a
-    // const or reference type.
-    static_cast<void>(StaticAssertTypeEqHelper<Element,
-        GTEST_REMOVE_REFERENCE_AND_CONST_(Element)>());
-    if (relation_to_source_ == kCopy)
+    if (clone_ != &NativeArray::InitRef)
       delete[] array_;
   }
 
@@ -997,23 +1068,30 @@ class NativeArray {
   }
 
  private:
-  // Initializes this object; makes a copy of the input array if
-  // 'relation' is kCopy.
-  void Init(const Element* array, size_t a_size, RelationToSource relation) {
-    if (relation == kReference) {
-      array_ = array;
-    } else {
-      Element* const copy = new Element[a_size];
-      CopyArray(array, a_size, copy);
-      array_ = copy;
-    }
+  enum {
+    kCheckTypeIsNotConstOrAReference = StaticAssertTypeEqHelper<
+        Element, GTEST_REMOVE_REFERENCE_AND_CONST_(Element)>::value,
+  };
+
+  // Initializes this object with a copy of the input.
+  void InitCopy(const Element* array, size_t a_size) {
+    Element* const copy = new Element[a_size];
+    CopyArray(array, a_size, copy);
+    array_ = copy;
     size_ = a_size;
-    relation_to_source_ = relation;
+    clone_ = &NativeArray::InitCopy;
+  }
+
+  // Initializes this object with a reference of the input.
+  void InitRef(const Element* array, size_t a_size) {
+    array_ = array;
+    size_ = a_size;
+    clone_ = &NativeArray::InitRef;
   }
 
   const Element* array_;
   size_t size_;
-  RelationToSource relation_to_source_;
+  void (NativeArray::*clone_)(const Element*, size_t);
 
   GTEST_DISALLOW_ASSIGN_(NativeArray);
 };
@@ -1148,6 +1226,7 @@ class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) : public parent_class {\
   ::test_info_ =\
     ::testing::internal::MakeAndRegisterTestInfo(\
         #test_case_name, #test_name, NULL, NULL, \
+        ::testing::internal::CodeLocation(__FILE__, __LINE__), \
         (parent_id), \
         parent_class::SetUpTestCase, \
         parent_class::TearDownTestCase, \
@@ -1156,3 +1235,4 @@ class GTEST_TEST_CLASS_NAME_(test_case_name, test_name) : public parent_class {\
 void GTEST_TEST_CLASS_NAME_(test_case_name, test_name)::TestBody()
 
 #endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
+
similarity index 95%
rename from src/external/gmock-1.7.0/gtest/include/gtest/internal/gtest-linked_ptr.h
rename to src/external/googletest/googletest/include/gtest/internal/gtest-linked_ptr.h
index b1362cd002cf876d36f60dbab684d096fabfd0b8..36029422174f215848681db1110bcdb23538a12e 100644 (file)
@@ -110,7 +110,12 @@ class linked_ptr_internal {
     MutexLock lock(&g_linked_ptr_mutex);
 
     linked_ptr_internal const* p = ptr;
-    while (p->next_ != ptr) p = p->next_;
+    while (p->next_ != ptr) {
+      assert(p->next_ != this &&
+             "Trying to join() a linked ring we are already in. "
+             "Is GMock thread safety enabled?");
+      p = p->next_;
+    }
     p->next_ = this;
     next_ = ptr;
   }
@@ -123,7 +128,12 @@ class linked_ptr_internal {
 
     if (next_ == this) return true;
     linked_ptr_internal const* p = next_;
-    while (p->next_ != this) p = p->next_;
+    while (p->next_ != this) {
+      assert(p->next_ != next_ &&
+             "Trying to depart() a linked ring we are not in. "
+             "Is GMock thread safety enabled?");
+      p = p->next_;
+    }
     p->next_ = next_;
     return false;
   }
similarity index 98%
rename from src/external/gmock-1.7.0/gtest/include/gtest/internal/gtest-param-util-generated.h
rename to src/external/googletest/googletest/include/gtest/internal/gtest-param-util-generated.h
index e80548592c703af1f08de3cbfce22bc8c7a3b462..4d1d81d20ffca32ba8f9577ff5bd06bfe2de7463 100644 (file)
@@ -40,7 +40,7 @@
 // and at most 10 arguments in Combine. Please contact
 // googletestframework@googlegroups.com if you need more.
 // Please note that the number of arguments to Combine is limited
-// by the maximum arity of the implementation of tr1::tuple which is
+// by the maximum arity of the implementation of tuple which is
 // currently set at 10.
 
 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_
@@ -79,7 +79,10 @@ class ValueArray1 {
   explicit ValueArray1(T1 v1) : v1_(v1) {}
 
   template <typename T>
-  operator ParamGenerator<T>() const { return ValuesIn(&v1_, &v1_ + 1); }
+  operator ParamGenerator<T>() const {
+    const T array[] = {static_cast<T>(v1_)};
+    return ValuesIn(array);
+  }
 
  private:
   // No implementation - assignment is unsupported.
@@ -3157,9 +3160,9 @@ class ValueArray50 {
 //
 template <typename T1, typename T2>
 class CartesianProductGenerator2
-    : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2> > {
+    : public ParamGeneratorInterface< ::testing::tuple<T1, T2> > {
  public:
-  typedef ::std::tr1::tuple<T1, T2> ParamType;
+  typedef ::testing::tuple<T1, T2> ParamType;
 
   CartesianProductGenerator2(const ParamGenerator<T1>& g1,
       const ParamGenerator<T2>& g2)
@@ -3272,9 +3275,9 @@ class CartesianProductGenerator2
 
 template <typename T1, typename T2, typename T3>
 class CartesianProductGenerator3
-    : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3> > {
+    : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3> > {
  public:
-  typedef ::std::tr1::tuple<T1, T2, T3> ParamType;
+  typedef ::testing::tuple<T1, T2, T3> ParamType;
 
   CartesianProductGenerator3(const ParamGenerator<T1>& g1,
       const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3)
@@ -3404,9 +3407,9 @@ class CartesianProductGenerator3
 
 template <typename T1, typename T2, typename T3, typename T4>
 class CartesianProductGenerator4
-    : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4> > {
+    : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4> > {
  public:
-  typedef ::std::tr1::tuple<T1, T2, T3, T4> ParamType;
+  typedef ::testing::tuple<T1, T2, T3, T4> ParamType;
 
   CartesianProductGenerator4(const ParamGenerator<T1>& g1,
       const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
@@ -3555,9 +3558,9 @@ class CartesianProductGenerator4
 
 template <typename T1, typename T2, typename T3, typename T4, typename T5>
 class CartesianProductGenerator5
-    : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5> > {
+    : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5> > {
  public:
-  typedef ::std::tr1::tuple<T1, T2, T3, T4, T5> ParamType;
+  typedef ::testing::tuple<T1, T2, T3, T4, T5> ParamType;
 
   CartesianProductGenerator5(const ParamGenerator<T1>& g1,
       const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
@@ -3723,10 +3726,10 @@ class CartesianProductGenerator5
 template <typename T1, typename T2, typename T3, typename T4, typename T5,
     typename T6>
 class CartesianProductGenerator6
-    : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5,
+    : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5,
         T6> > {
  public:
-  typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> ParamType;
+  typedef ::testing::tuple<T1, T2, T3, T4, T5, T6> ParamType;
 
   CartesianProductGenerator6(const ParamGenerator<T1>& g1,
       const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
@@ -3909,10 +3912,10 @@ class CartesianProductGenerator6
 template <typename T1, typename T2, typename T3, typename T4, typename T5,
     typename T6, typename T7>
 class CartesianProductGenerator7
-    : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
+    : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5, T6,
         T7> > {
  public:
-  typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7> ParamType;
+  typedef ::testing::tuple<T1, T2, T3, T4, T5, T6, T7> ParamType;
 
   CartesianProductGenerator7(const ParamGenerator<T1>& g1,
       const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
@@ -4112,10 +4115,10 @@ class CartesianProductGenerator7
 template <typename T1, typename T2, typename T3, typename T4, typename T5,
     typename T6, typename T7, typename T8>
 class CartesianProductGenerator8
-    : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
+    : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5, T6,
         T7, T8> > {
  public:
-  typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8> ParamType;
+  typedef ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8> ParamType;
 
   CartesianProductGenerator8(const ParamGenerator<T1>& g1,
       const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
@@ -4334,10 +4337,10 @@ class CartesianProductGenerator8
 template <typename T1, typename T2, typename T3, typename T4, typename T5,
     typename T6, typename T7, typename T8, typename T9>
 class CartesianProductGenerator9
-    : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
+    : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5, T6,
         T7, T8, T9> > {
  public:
-  typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9> ParamType;
+  typedef ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9> ParamType;
 
   CartesianProductGenerator9(const ParamGenerator<T1>& g1,
       const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
@@ -4573,10 +4576,10 @@ class CartesianProductGenerator9
 template <typename T1, typename T2, typename T3, typename T4, typename T5,
     typename T6, typename T7, typename T8, typename T9, typename T10>
 class CartesianProductGenerator10
-    : public ParamGeneratorInterface< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
+    : public ParamGeneratorInterface< ::testing::tuple<T1, T2, T3, T4, T5, T6,
         T7, T8, T9, T10> > {
  public:
-  typedef ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> ParamType;
+  typedef ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> ParamType;
 
   CartesianProductGenerator10(const ParamGenerator<T1>& g1,
       const ParamGenerator<T2>& g2, const ParamGenerator<T3>& g3,
@@ -4838,8 +4841,8 @@ class CartesianProductHolder2 {
 CartesianProductHolder2(const Generator1& g1, const Generator2& g2)
       : g1_(g1), g2_(g2) {}
   template <typename T1, typename T2>
-  operator ParamGenerator< ::std::tr1::tuple<T1, T2> >() const {
-    return ParamGenerator< ::std::tr1::tuple<T1, T2> >(
+  operator ParamGenerator< ::testing::tuple<T1, T2> >() const {
+    return ParamGenerator< ::testing::tuple<T1, T2> >(
         new CartesianProductGenerator2<T1, T2>(
         static_cast<ParamGenerator<T1> >(g1_),
         static_cast<ParamGenerator<T2> >(g2_)));
@@ -4860,8 +4863,8 @@ CartesianProductHolder3(const Generator1& g1, const Generator2& g2,
     const Generator3& g3)
       : g1_(g1), g2_(g2), g3_(g3) {}
   template <typename T1, typename T2, typename T3>
-  operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3> >() const {
-    return ParamGenerator< ::std::tr1::tuple<T1, T2, T3> >(
+  operator ParamGenerator< ::testing::tuple<T1, T2, T3> >() const {
+    return ParamGenerator< ::testing::tuple<T1, T2, T3> >(
         new CartesianProductGenerator3<T1, T2, T3>(
         static_cast<ParamGenerator<T1> >(g1_),
         static_cast<ParamGenerator<T2> >(g2_),
@@ -4885,8 +4888,8 @@ CartesianProductHolder4(const Generator1& g1, const Generator2& g2,
     const Generator3& g3, const Generator4& g4)
       : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {}
   template <typename T1, typename T2, typename T3, typename T4>
-  operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4> >() const {
-    return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4> >(
+  operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4> >() const {
+    return ParamGenerator< ::testing::tuple<T1, T2, T3, T4> >(
         new CartesianProductGenerator4<T1, T2, T3, T4>(
         static_cast<ParamGenerator<T1> >(g1_),
         static_cast<ParamGenerator<T2> >(g2_),
@@ -4912,8 +4915,8 @@ CartesianProductHolder5(const Generator1& g1, const Generator2& g2,
     const Generator3& g3, const Generator4& g4, const Generator5& g5)
       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {}
   template <typename T1, typename T2, typename T3, typename T4, typename T5>
-  operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5> >() const {
-    return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5> >(
+  operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5> >() const {
+    return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5> >(
         new CartesianProductGenerator5<T1, T2, T3, T4, T5>(
         static_cast<ParamGenerator<T1> >(g1_),
         static_cast<ParamGenerator<T2> >(g2_),
@@ -4943,8 +4946,8 @@ CartesianProductHolder6(const Generator1& g1, const Generator2& g2,
       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {}
   template <typename T1, typename T2, typename T3, typename T4, typename T5,
       typename T6>
-  operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> >() const {
-    return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6> >(
+  operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6> >() const {
+    return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6> >(
         new CartesianProductGenerator6<T1, T2, T3, T4, T5, T6>(
         static_cast<ParamGenerator<T1> >(g1_),
         static_cast<ParamGenerator<T2> >(g2_),
@@ -4976,9 +4979,9 @@ CartesianProductHolder7(const Generator1& g1, const Generator2& g2,
       : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {}
   template <typename T1, typename T2, typename T3, typename T4, typename T5,
       typename T6, typename T7>
-  operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6,
+  operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6,
       T7> >() const {
-    return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7> >(
+    return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7> >(
         new CartesianProductGenerator7<T1, T2, T3, T4, T5, T6, T7>(
         static_cast<ParamGenerator<T1> >(g1_),
         static_cast<ParamGenerator<T2> >(g2_),
@@ -5014,9 +5017,9 @@ CartesianProductHolder8(const Generator1& g1, const Generator2& g2,
           g8_(g8) {}
   template <typename T1, typename T2, typename T3, typename T4, typename T5,
       typename T6, typename T7, typename T8>
-  operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7,
+  operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7,
       T8> >() const {
-    return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8> >(
+    return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8> >(
         new CartesianProductGenerator8<T1, T2, T3, T4, T5, T6, T7, T8>(
         static_cast<ParamGenerator<T1> >(g1_),
         static_cast<ParamGenerator<T2> >(g2_),
@@ -5055,9 +5058,9 @@ CartesianProductHolder9(const Generator1& g1, const Generator2& g2,
           g9_(g9) {}
   template <typename T1, typename T2, typename T3, typename T4, typename T5,
       typename T6, typename T7, typename T8, typename T9>
-  operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
+  operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
       T9> >() const {
-    return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
+    return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
         T9> >(
         new CartesianProductGenerator9<T1, T2, T3, T4, T5, T6, T7, T8, T9>(
         static_cast<ParamGenerator<T1> >(g1_),
@@ -5099,10 +5102,10 @@ CartesianProductHolder10(const Generator1& g1, const Generator2& g2,
           g9_(g9), g10_(g10) {}
   template <typename T1, typename T2, typename T3, typename T4, typename T5,
       typename T6, typename T7, typename T8, typename T9, typename T10>
-  operator ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
-      T9, T10> >() const {
-    return ParamGenerator< ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8,
-        T9, T10> >(
+  operator ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9,
+      T10> >() const {
+    return ParamGenerator< ::testing::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9,
+        T10> >(
         new CartesianProductGenerator10<T1, T2, T3, T4, T5, T6, T7, T8, T9,
             T10>(
         static_cast<ParamGenerator<T1> >(g1_),
similarity index 83%
rename from src/external/gmock-1.7.0/gtest/include/gtest/internal/gtest-param-util.h
rename to src/external/googletest/googletest/include/gtest/internal/gtest-param-util.h
index d5e1028b0c1b45890cc1c5a272bebc53b8ff2676..82cab9b0201b19b7afba39197f7ea7f8a4a0b170 100644 (file)
 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
 
+#include <ctype.h>
+
 #include <iterator>
+#include <set>
 #include <utility>
 #include <vector>
 
 #if GTEST_HAS_PARAM_TEST
 
 namespace testing {
+
+// Input to a parameterized test name generator, describing a test parameter.
+// Consists of the parameter value and the integer parameter index.
+template <class ParamType>
+struct TestParamInfo {
+  TestParamInfo(const ParamType& a_param, size_t an_index) :
+    param(a_param),
+    index(an_index) {}
+  ParamType param;
+  size_t index;
+};
+
+// A builtin parameterized test name generator which returns the result of
+// testing::PrintToString.
+struct PrintToStringParamName {
+  template <class ParamType>
+  std::string operator()(const TestParamInfo<ParamType>& info) const {
+    return PrintToString(info.param);
+  }
+};
+
 namespace internal {
 
 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
@@ -58,7 +82,7 @@ namespace internal {
 // TEST_P macro is used to define two tests with the same name
 // but in different namespaces.
 GTEST_API_ void ReportInvalidTestCaseType(const char* test_case_name,
-                                          const char* file, int line);
+                                          CodeLocation code_location);
 
 template <typename> class ParamGeneratorInterface;
 template <typename> class ParamGenerator;
@@ -206,7 +230,7 @@ class RangeGenerator : public ParamGeneratorInterface<T> {
       return base_;
     }
     virtual void Advance() {
-      value_ = value_ + step_;
+      value_ = static_cast<T>(value_ + step_);
       index_++;
     }
     virtual ParamIteratorInterface<T>* Clone() const {
@@ -243,7 +267,7 @@ class RangeGenerator : public ParamGeneratorInterface<T> {
                                const T& end,
                                const IncrementT& step) {
     int end_index = 0;
-    for (T i = begin; i < end; i = i + step)
+    for (T i = begin; i < end; i = static_cast<T>(i + step))
       end_index++;
     return end_index;
   }
@@ -345,6 +369,37 @@ class ValuesInIteratorRangeGenerator : public ParamGeneratorInterface<T> {
   const ContainerType container_;
 };  // class ValuesInIteratorRangeGenerator
 
+// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
+//
+// Default parameterized test name generator, returns a string containing the
+// integer test parameter index.
+template <class ParamType>
+std::string DefaultParamName(const TestParamInfo<ParamType>& info) {
+  Message name_stream;
+  name_stream << info.index;
+  return name_stream.GetString();
+}
+
+// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
+//
+// Parameterized test name overload helpers, which help the
+// INSTANTIATE_TEST_CASE_P macro choose between the default parameterized
+// test name generator and user param name generator.
+template <class ParamType, class ParamNameGenFunctor>
+ParamNameGenFunctor GetParamNameGen(ParamNameGenFunctor func) {
+  return func;
+}
+
+template <class ParamType>
+struct ParamNameGenFunc {
+  typedef std::string Type(const TestParamInfo<ParamType>&);
+};
+
+template <class ParamType>
+typename ParamNameGenFunc<ParamType>::Type *GetParamNameGen() {
+  return DefaultParamName;
+}
+
 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
 //
 // Stores a parameter value and later creates tests parameterized with that
@@ -449,9 +504,11 @@ class ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase {
   typedef typename TestCase::ParamType ParamType;
   // A function that returns an instance of appropriate generator type.
   typedef ParamGenerator<ParamType>(GeneratorCreationFunc)();
+  typedef typename ParamNameGenFunc<ParamType>::Type ParamNameGeneratorFunc;
 
-  explicit ParameterizedTestCaseInfo(const char* name)
-      : test_case_name_(name) {}
+  explicit ParameterizedTestCaseInfo(
+      const char* name, CodeLocation code_location)
+      : test_case_name_(name), code_location_(code_location) {}
 
   // Test case base name for display purposes.
   virtual const string& GetTestCaseName() const { return test_case_name_; }
@@ -474,9 +531,11 @@ class ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase {
   // about a generator.
   int AddTestCaseInstantiation(const string& instantiation_name,
                                GeneratorCreationFunc* func,
-                               const char* /* file */,
-                               int /* line */) {
-    instantiations_.push_back(::std::make_pair(instantiation_name, func));
+                               ParamNameGeneratorFunc* name_func,
+                               const char* file,
+                               int line) {
+    instantiations_.push_back(
+        InstantiationInfo(instantiation_name, func, name_func, file, line));
     return 0;  // Return value used only to run this method in namespace scope.
   }
   // UnitTest class invokes this method to register tests in this test case
@@ -491,25 +550,45 @@ class ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase {
       for (typename InstantiationContainer::iterator gen_it =
                instantiations_.begin(); gen_it != instantiations_.end();
                ++gen_it) {
-        const string& instantiation_name = gen_it->first;
-        ParamGenerator<ParamType> generator((*gen_it->second)());
+        const string& instantiation_name = gen_it->name;
+        ParamGenerator<ParamType> generator((*gen_it->generator)());
+        ParamNameGeneratorFunc* name_func = gen_it->name_func;
+        const char* file = gen_it->file;
+        int line = gen_it->line;
 
         string test_case_name;
         if ( !instantiation_name.empty() )
           test_case_name = instantiation_name + "/";
         test_case_name += test_info->test_case_base_name;
 
-        int i = 0;
+        size_t i = 0;
+        std::set<std::string> test_param_names;
         for (typename ParamGenerator<ParamType>::iterator param_it =
                  generator.begin();
              param_it != generator.end(); ++param_it, ++i) {
           Message test_name_stream;
-          test_name_stream << test_info->test_base_name << "/" << i;
+
+          std::string param_name = name_func(
+              TestParamInfo<ParamType>(*param_it, i));
+
+          GTEST_CHECK_(IsValidParamName(param_name))
+              << "Parameterized test name '" << param_name
+              << "' is invalid, in " << file
+              << " line " << line << std::endl;
+
+          GTEST_CHECK_(test_param_names.count(param_name) == 0)
+              << "Duplicate parameterized test name '" << param_name
+              << "', in " << file << " line " << line << std::endl;
+
+          test_param_names.insert(param_name);
+
+          test_name_stream << test_info->test_base_name << "/" << param_name;
           MakeAndRegisterTestInfo(
               test_case_name.c_str(),
               test_name_stream.GetString().c_str(),
               NULL,  // No type parameter.
               PrintToString(*param_it).c_str(),
+              code_location_,
               GetTestCaseTypeId(),
               TestCase::SetUpTestCase,
               TestCase::TearDownTestCase,
@@ -535,12 +614,45 @@ class ParameterizedTestCaseInfo : public ParameterizedTestCaseInfoBase {
     const scoped_ptr<TestMetaFactoryBase<ParamType> > test_meta_factory;
   };
   typedef ::std::vector<linked_ptr<TestInfo> > TestInfoContainer;
-  // Keeps pairs of <Instantiation name, Sequence generator creation function>
-  // received from INSTANTIATE_TEST_CASE_P macros.
-  typedef ::std::vector<std::pair<string, GeneratorCreationFunc*> >
-      InstantiationContainer;
+  // Records data received from INSTANTIATE_TEST_CASE_P macros:
+  //  <Instantiation name, Sequence generator creation function,
+  //     Name generator function, Source file, Source line>
+  struct InstantiationInfo {
+      InstantiationInfo(const std::string &name_in,
+                        GeneratorCreationFunc* generator_in,
+                        ParamNameGeneratorFunc* name_func_in,
+                        const char* file_in,
+                        int line_in)
+          : name(name_in),
+            generator(generator_in),
+            name_func(name_func_in),
+            file(file_in),
+            line(line_in) {}
+
+      std::string name;
+      GeneratorCreationFunc* generator;
+      ParamNameGeneratorFunc* name_func;
+      const char* file;
+      int line;
+  };
+  typedef ::std::vector<InstantiationInfo> InstantiationContainer;
+
+  static bool IsValidParamName(const std::string& name) {
+    // Check for empty string
+    if (name.empty())
+      return false;
+
+    // Check for invalid characters
+    for (std::string::size_type index = 0; index < name.size(); ++index) {
+      if (!isalnum(name[index]) && name[index] != '_')
+        return false;
+    }
+
+    return true;
+  }
 
   const string test_case_name_;
+  CodeLocation code_location_;
   TestInfoContainer tests_;
   InstantiationContainer instantiations_;
 
@@ -568,8 +680,7 @@ class ParameterizedTestCaseRegistry {
   template <class TestCase>
   ParameterizedTestCaseInfo<TestCase>* GetTestCasePatternHolder(
       const char* test_case_name,
-      const char* file,
-      int line) {
+      CodeLocation code_location) {
     ParameterizedTestCaseInfo<TestCase>* typed_test_info = NULL;
     for (TestCaseInfoContainer::iterator it = test_case_infos_.begin();
          it != test_case_infos_.end(); ++it) {
@@ -578,7 +689,7 @@ class ParameterizedTestCaseRegistry {
           // Complain about incorrect usage of Google Test facilities
           // and terminate the program since we cannot guaranty correct
           // test case setup and tear-down in this case.
-          ReportInvalidTestCaseType(test_case_name,  file, line);
+          ReportInvalidTestCaseType(test_case_name, code_location);
           posix::Abort();
         } else {
           // At this point we are sure that the object we found is of the same
@@ -591,7 +702,8 @@ class ParameterizedTestCaseRegistry {
       }
     }
     if (typed_test_info == NULL) {
-      typed_test_info = new ParameterizedTestCaseInfo<TestCase>(test_case_name);
+      typed_test_info = new ParameterizedTestCaseInfo<TestCase>(
+          test_case_name, code_location);
       test_case_infos_.push_back(typed_test_info);
     }
     return typed_test_info;
diff --git a/src/external/googletest/googletest/include/gtest/internal/gtest-port-arch.h b/src/external/googletest/googletest/include/gtest/internal/gtest-port-arch.h
new file mode 100644 (file)
index 0000000..74ab949
--- /dev/null
@@ -0,0 +1,93 @@
+// Copyright 2015, Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+//     * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//     * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+//     * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// The Google C++ Testing Framework (Google Test)
+//
+// This header file defines the GTEST_OS_* macro.
+// It is separate from gtest-port.h so that custom/gtest-port.h can include it.
+
+#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_ARCH_H_
+#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_ARCH_H_
+
+// Determines the platform on which Google Test is compiled.
+#ifdef __CYGWIN__
+# define GTEST_OS_CYGWIN 1
+#elif defined __SYMBIAN32__
+# define GTEST_OS_SYMBIAN 1
+#elif defined _WIN32
+# define GTEST_OS_WINDOWS 1
+# ifdef _WIN32_WCE
+#  define GTEST_OS_WINDOWS_MOBILE 1
+# elif defined(__MINGW__) || defined(__MINGW32__)
+#  define GTEST_OS_WINDOWS_MINGW 1
+# elif defined(WINAPI_FAMILY)
+#  include <winapifamily.h>
+#  if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
+#   define GTEST_OS_WINDOWS_DESKTOP 1
+#  elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
+#   define GTEST_OS_WINDOWS_PHONE 1
+#  elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
+#   define GTEST_OS_WINDOWS_RT 1
+#  else
+    // WINAPI_FAMILY defined but no known partition matched.
+    // Default to desktop.
+#   define GTEST_OS_WINDOWS_DESKTOP 1
+#  endif
+# else
+#  define GTEST_OS_WINDOWS_DESKTOP 1
+# endif  // _WIN32_WCE
+#elif defined __APPLE__
+# define GTEST_OS_MAC 1
+# if TARGET_OS_IPHONE
+#  define GTEST_OS_IOS 1
+# endif
+#elif defined __FreeBSD__
+# define GTEST_OS_FREEBSD 1
+#elif defined __linux__
+# define GTEST_OS_LINUX 1
+# if defined __ANDROID__
+#  define GTEST_OS_LINUX_ANDROID 1
+# endif
+#elif defined __MVS__
+# define GTEST_OS_ZOS 1
+#elif defined(__sun) && defined(__SVR4)
+# define GTEST_OS_SOLARIS 1
+#elif defined(_AIX)
+# define GTEST_OS_AIX 1
+#elif defined(__hpux)
+# define GTEST_OS_HPUX 1
+#elif defined __native_client__
+# define GTEST_OS_NACL 1
+#elif defined __OpenBSD__
+# define GTEST_OS_OPENBSD 1
+#elif defined __QNX__
+# define GTEST_OS_QNX 1
+#endif  // __CYGWIN__
+
+#endif  // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_ARCH_H_
similarity index 69%
rename from src/external/gmock-1.7.0/gtest/include/gtest/internal/gtest-port.h
rename to src/external/googletest/googletest/include/gtest/internal/gtest-port.h
index 811078c80d6a6fe7923baf5979537447ac5d740b..0094ed5077e69a59afc3f535c9dcfc403b31fbbc 100644 (file)
 // Authors: wan@google.com (Zhanyong Wan)
 //
 // Low-level types and utilities for porting Google Test to various
-// platforms.  They are subject to change without notice.  DO NOT USE
-// THEM IN USER CODE.
+// platforms.  All macros ending with _ and symbols defined in an
+// internal namespace are subject to change without notice.  Code
+// outside Google Test MUST NOT USE THEM DIRECTLY.  Macros that don't
+// end with _ are part of Google Test's public API and can be used by
+// code outside Google Test.
 //
 // This file is fundamental to Google Test.  All other Google Test source
 // files are expected to #include this.  Therefore, it cannot #include
 #ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
 #define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
 
-// The user can define the following macros in the build script to
-// control Google Test's behavior.  If the user doesn't define a macro
-// in this list, Google Test will define it.
+// Environment-describing macros
+// -----------------------------
+//
+// Google Test can be used in many different environments.  Macros in
+// this section tell Google Test what kind of environment it is being
+// used in, such that Google Test can provide environment-specific
+// features and implementations.
+//
+// Google Test tries to automatically detect the properties of its
+// environment, so users usually don't need to worry about these
+// macros.  However, the automatic detection is not perfect.
+// Sometimes it's necessary for a user to define some of the following
+// macros in the build script to override Google Test's decisions.
+//
+// If the user doesn't define a macro in the list, Google Test will
+// provide a default definition.  After this header is #included, all
+// macros in this list will be defined to either 1 or 0.
+//
+// Notes to maintainers:
+//   - Each macro here is a user-tweakable knob; do not grow the list
+//     lightly.
+//   - Use #if to key off these macros.  Don't use #ifdef or "#if
+//     defined(...)", which will not work as these macros are ALWAYS
+//     defined.
 //
 //   GTEST_HAS_CLONE          - Define it to 1/0 to indicate that clone(2)
 //                              is/isn't available.
 //   GTEST_CREATE_SHARED_LIBRARY
 //                            - Define to 1 when compiling Google Test itself
 //                              as a shared library.
-//   GTEST_CAN_STREAM_RESULTS - Define to 1/0 to indicate that streaming
-//                              results to a socket is/isn't available
 
-// This header defines the following utilities:
+// Platform-indicating macros
+// --------------------------
+//
+// Macros indicating the platform on which Google Test is being used
+// (a macro is defined to 1 if compiled on the given platform;
+// otherwise UNDEFINED -- it's never defined to 0.).  Google Test
+// defines these macros automatically.  Code outside Google Test MUST
+// NOT define them.
 //
-// Macros indicating the current platform (defined to 1 if compiled on
-// the given platform; otherwise undefined):
 //   GTEST_OS_AIX      - IBM AIX
 //   GTEST_OS_CYGWIN   - Cygwin
+//   GTEST_OS_FREEBSD  - FreeBSD
 //   GTEST_OS_HPUX     - HP-UX
 //   GTEST_OS_LINUX    - Linux
 //     GTEST_OS_LINUX_ANDROID - Google Android
 //   GTEST_OS_MAC      - Mac OS X
 //     GTEST_OS_IOS    - iOS
-//       GTEST_OS_IOS_SIMULATOR - iOS simulator
 //   GTEST_OS_NACL     - Google Native Client (NaCl)
 //   GTEST_OS_OPENBSD  - OpenBSD
 //   GTEST_OS_QNX      - QNX
 //     GTEST_OS_WINDOWS_DESKTOP  - Windows Desktop
 //     GTEST_OS_WINDOWS_MINGW    - MinGW
 //     GTEST_OS_WINDOWS_MOBILE   - Windows Mobile
+//     GTEST_OS_WINDOWS_PHONE    - Windows Phone
+//     GTEST_OS_WINDOWS_RT       - Windows Store App/WinRT
 //   GTEST_OS_ZOS      - z/OS
 //
 // Among the platforms, Cygwin, Linux, Max OS X, and Windows have the
 // googletestframework@googlegroups.com (patches for fixing them are
 // even more welcome!).
 //
-// Note that it is possible that none of the GTEST_OS_* macros are defined.
+// It is possible that none of the GTEST_OS_* macros are defined.
+
+// Feature-indicating macros
+// -------------------------
+//
+// Macros indicating which Google Test features are available (a macro
+// is defined to 1 if the corresponding feature is supported;
+// otherwise UNDEFINED -- it's never defined to 0.).  Google Test
+// defines these macros automatically.  Code outside Google Test MUST
+// NOT define them.
+//
+// These macros are public so that portable tests can be written.
+// Such tests typically surround code using a feature with an #if
+// which controls that code.  For example:
+//
+// #if GTEST_HAS_DEATH_TEST
+//   EXPECT_DEATH(DoSomethingDeadly());
+// #endif
 //
-// Macros indicating available Google Test features (defined to 1 if
-// the corresponding feature is supported; otherwise undefined):
 //   GTEST_HAS_COMBINE      - the Combine() function (for value-parameterized
 //                            tests)
 //   GTEST_HAS_DEATH_TEST   - death tests
 //   GTEST_HAS_PARAM_TEST   - value-parameterized tests
 //   GTEST_HAS_TYPED_TEST   - typed tests
 //   GTEST_HAS_TYPED_TEST_P - type-parameterized tests
+//   GTEST_IS_THREADSAFE    - Google Test is thread-safe.
 //   GTEST_USES_POSIX_RE    - enhanced POSIX regex is used. Do not confuse with
 //                            GTEST_HAS_POSIX_RE (see above) which users can
 //                            define themselves.
 //   GTEST_USES_SIMPLE_RE   - our own simple regex is used;
 //                            the above two are mutually exclusive.
 //   GTEST_CAN_COMPARE_NULL - accepts untyped NULL in EXPECT_EQ().
+
+// Misc public macros
+// ------------------
+//
+//   GTEST_FLAG(flag_name)  - references the variable corresponding to
+//                            the given Google Test flag.
+
+// Internal utilities
+// ------------------
+//
+// The following macros and utilities are for Google Test's INTERNAL
+// use only.  Code outside Google Test MUST NOT USE THEM DIRECTLY.
 //
 // Macros for basic C++ coding:
 //   GTEST_AMBIGUOUS_ELSE_BLOCKER_ - for disabling a gcc warning.
 //   GTEST_DISALLOW_ASSIGN_   - disables operator=.
 //   GTEST_DISALLOW_COPY_AND_ASSIGN_ - disables copy ctor and operator=.
 //   GTEST_MUST_USE_RESULT_   - declares that a function's result must be used.
+//   GTEST_INTENTIONAL_CONST_COND_PUSH_ - start code section where MSVC C4127 is
+//                                        suppressed (constant conditional).
+//   GTEST_INTENTIONAL_CONST_COND_POP_  - finish code section where MSVC C4127
+//                                        is suppressed.
+//
+// C++11 feature wrappers:
+//
+//   testing::internal::move  - portability wrapper for std::move.
 //
 // Synchronization:
 //   Mutex, MutexLock, ThreadLocal, GetThreadCount()
-//                  - synchronization primitives.
-//   GTEST_IS_THREADSAFE - defined to 1 to indicate that the above
-//                         synchronization primitives have real implementations
-//                         and Google Test is thread-safe; or 0 otherwise.
+//                            - synchronization primitives.
 //
 // Template meta programming:
 //   is_pointer     - as in TR1; needed on Symbian and IBM XL C/C++ only.
 //   BiggestInt     - the biggest signed integer type.
 //
 // Command-line utilities:
-//   GTEST_FLAG()       - references a flag.
 //   GTEST_DECLARE_*()  - declares a flag.
 //   GTEST_DEFINE_*()   - defines a flag.
 //   GetInjectableArgvs() - returns the command line as a vector of strings.
 # include <TargetConditionals.h>
 #endif
 
+#include <algorithm>  // NOLINT
 #include <iostream>  // NOLINT
 #include <sstream>  // NOLINT
 #include <string>  // NOLINT
+#include <utility>
+#include <vector>  // NOLINT
 
-#define GTEST_DEV_EMAIL_ "googletestframework@@googlegroups.com"
-#define GTEST_FLAG_PREFIX_ "gtest_"
-#define GTEST_FLAG_PREFIX_DASH_ "gtest-"
-#define GTEST_FLAG_PREFIX_UPPER_ "GTEST_"
-#define GTEST_NAME_ "Google Test"
-#define GTEST_PROJECT_URL_ "http://code.google.com/p/googletest/"
+#include "gtest/internal/gtest-port-arch.h"
+#include "gtest/internal/custom/gtest-port.h"
+
+#if !defined(GTEST_DEV_EMAIL_)
+# define GTEST_DEV_EMAIL_ "googletestframework@@googlegroups.com"
+# define GTEST_FLAG_PREFIX_ "gtest_"
+# define GTEST_FLAG_PREFIX_DASH_ "gtest-"
+# define GTEST_FLAG_PREFIX_UPPER_ "GTEST_"
+# define GTEST_NAME_ "Google Test"
+# define GTEST_PROJECT_URL_ "https://github.com/google/googletest/"
+#endif  // !defined(GTEST_DEV_EMAIL_)
+
+#if !defined(GTEST_INIT_GOOGLE_TEST_NAME_)
+# define GTEST_INIT_GOOGLE_TEST_NAME_ "testing::InitGoogleTest"
+#endif  // !defined(GTEST_INIT_GOOGLE_TEST_NAME_)
 
 // Determines the version of gcc that is used to compile this.
 #ifdef __GNUC__
     (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__)
 #endif  // __GNUC__
 
-// Determines the platform on which Google Test is compiled.
-#ifdef __CYGWIN__
-# define GTEST_OS_CYGWIN 1
-#elif defined __SYMBIAN32__
-# define GTEST_OS_SYMBIAN 1
-#elif defined _WIN32
-# define GTEST_OS_WINDOWS 1
-# ifdef _WIN32_WCE
-#  define GTEST_OS_WINDOWS_MOBILE 1
-# elif defined(__MINGW__) || defined(__MINGW32__)
-#  define GTEST_OS_WINDOWS_MINGW 1
-# else
-#  define GTEST_OS_WINDOWS_DESKTOP 1
-# endif  // _WIN32_WCE
-#elif defined __APPLE__
-# define GTEST_OS_MAC 1
-# if TARGET_OS_IPHONE
-#  define GTEST_OS_IOS 1
-#  if TARGET_IPHONE_SIMULATOR
-#   define GTEST_OS_IOS_SIMULATOR 1
-#  endif
-# endif
-#elif defined __linux__
-# define GTEST_OS_LINUX 1
-# if defined __ANDROID__
-#  define GTEST_OS_LINUX_ANDROID 1
-# endif
-#elif defined __MVS__
-# define GTEST_OS_ZOS 1
-#elif defined(__sun) && defined(__SVR4)
-# define GTEST_OS_SOLARIS 1
-#elif defined(_AIX)
-# define GTEST_OS_AIX 1
-#elif defined(__hpux)
-# define GTEST_OS_HPUX 1
-#elif defined __native_client__
-# define GTEST_OS_NACL 1
-#elif defined __OpenBSD__
-# define GTEST_OS_OPENBSD 1
-#elif defined __QNX__
-# define GTEST_OS_QNX 1
-#endif  // __CYGWIN__
+// Macros for disabling Microsoft Visual C++ warnings.
+//
+//   GTEST_DISABLE_MSC_WARNINGS_PUSH_(4800 4385)
+//   /* code that triggers warnings C4800 and C4385 */
+//   GTEST_DISABLE_MSC_WARNINGS_POP_()
+#if _MSC_VER >= 1500
+# define GTEST_DISABLE_MSC_WARNINGS_PUSH_(warnings) \
+    __pragma(warning(push))                        \
+    __pragma(warning(disable: warnings))
+# define GTEST_DISABLE_MSC_WARNINGS_POP_()          \
+    __pragma(warning(pop))
+#else
+// Older versions of MSVC don't have __pragma.
+# define GTEST_DISABLE_MSC_WARNINGS_PUSH_(warnings)
+# define GTEST_DISABLE_MSC_WARNINGS_POP_()
+#endif
 
 #ifndef GTEST_LANG_CXX11
 // gcc and clang define __GXX_EXPERIMENTAL_CXX0X__ when
 # endif
 #endif
 
+// Distinct from C++11 language support, some environments don't provide
+// proper C++11 library support. Notably, it's possible to build in
+// C++11 mode when targeting Mac OS X 10.6, which has an old libstdc++
+// with no C++11 support.
+//
+// libstdc++ has sufficient C++11 support as of GCC 4.6.0, __GLIBCXX__
+// 20110325, but maintenance releases in the 4.4 and 4.5 series followed
+// this date, so check for those versions by their date stamps.
+// https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html#abi.versioning
+#if GTEST_LANG_CXX11 && \
+    (!defined(__GLIBCXX__) || ( \
+        __GLIBCXX__ >= 20110325ul &&  /* GCC >= 4.6.0 */ \
+        /* Blacklist of patch releases of older branches: */ \
+        __GLIBCXX__ != 20110416ul &&  /* GCC 4.4.6 */ \
+        __GLIBCXX__ != 20120313ul &&  /* GCC 4.4.7 */ \
+        __GLIBCXX__ != 20110428ul &&  /* GCC 4.5.3 */ \
+        __GLIBCXX__ != 20120702ul))   /* GCC 4.5.4 */
+# define GTEST_STDLIB_CXX11 1
+#endif
+
+// Only use C++11 library features if the library provides them.
+#if GTEST_STDLIB_CXX11
+# define GTEST_HAS_STD_BEGIN_AND_END_ 1
+# define GTEST_HAS_STD_FORWARD_LIST_ 1
+# define GTEST_HAS_STD_FUNCTION_ 1
+# define GTEST_HAS_STD_INITIALIZER_LIST_ 1
+# define GTEST_HAS_STD_MOVE_ 1
+# define GTEST_HAS_STD_SHARED_PTR_ 1
+# define GTEST_HAS_STD_TYPE_TRAITS_ 1
+# define GTEST_HAS_STD_UNIQUE_PTR_ 1
+#endif
+
+// C++11 specifies that <tuple> provides std::tuple.
+// Some platforms still might not have it, however.
+#if GTEST_LANG_CXX11
+# define GTEST_HAS_STD_TUPLE_ 1
+# if defined(__clang__)
+// Inspired by http://clang.llvm.org/docs/LanguageExtensions.html#__has_include
+#  if defined(__has_include) && !__has_include(<tuple>)
+#   undef GTEST_HAS_STD_TUPLE_
+#  endif
+# elif defined(_MSC_VER)
+// Inspired by boost/config/stdlib/dinkumware.hpp
+#  if defined(_CPPLIB_VER) && _CPPLIB_VER < 520
+#   undef GTEST_HAS_STD_TUPLE_
+#  endif
+# elif defined(__GLIBCXX__)
+// Inspired by boost/config/stdlib/libstdcpp3.hpp,
+// http://gcc.gnu.org/gcc-4.2/changes.html and
+// http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt01ch01.html#manual.intro.status.standard.200x
+#  if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 2)
+#   undef GTEST_HAS_STD_TUPLE_
+#  endif
+# endif
+#endif
+
 // Brings in definitions for functions used in the testing::internal::posix
 // namespace (read, write, close, chdir, isatty, stat). We do not currently
 // use them on Windows Mobile.
-#if !GTEST_OS_WINDOWS
+#if GTEST_OS_WINDOWS
+# if !GTEST_OS_WINDOWS_MOBILE
+#  include <direct.h>
+#  include <io.h>
+# endif
+// In order to avoid having to include <windows.h>, use forward declaration
+// assuming CRITICAL_SECTION is a typedef of _RTL_CRITICAL_SECTION.
+// This assumption is verified by
+// WindowsTypesTest.CRITICAL_SECTIONIs_RTL_CRITICAL_SECTION.
+struct _RTL_CRITICAL_SECTION;
+#else
 // This assumes that non-Windows OSes provide unistd.h. For OSes where this
 // is not the case, we need to include headers that provide the functions
 // mentioned above.
 # include <unistd.h>
 # include <strings.h>
-#elif !GTEST_OS_WINDOWS_MOBILE
-# include <direct.h>
-# include <io.h>
-#endif
+#endif  // GTEST_OS_WINDOWS
 
 #if GTEST_OS_LINUX_ANDROID
 // Used to define __ANDROID_API__ matching the target NDK API level.
 # endif
 #endif
 
-#if GTEST_HAS_POSIX_RE
+#if GTEST_USES_PCRE
+// The appropriate headers have already been included.
+
+#elif GTEST_HAS_POSIX_RE
 
 // On some platforms, <regex.h> needs someone to define size_t, and
 // won't compile otherwise.  We can #include it here as we already
 // simple regex implementation instead.
 # define GTEST_USES_SIMPLE_RE 1
 
-#endif  // GTEST_HAS_POSIX_RE
+#endif  // GTEST_USES_PCRE
 
 #ifndef GTEST_HAS_EXCEPTIONS
 // The user didn't tell us whether exceptions are enabled, so we need
 #   define _HAS_EXCEPTIONS 1
 #  endif  // _HAS_EXCEPTIONS
 #  define GTEST_HAS_EXCEPTIONS _HAS_EXCEPTIONS
+# elif defined(__clang__)
+// clang defines __EXCEPTIONS iff exceptions are enabled before clang 220714,
+// but iff cleanups are enabled after that. In Obj-C++ files, there can be
+// cleanups for ObjC exceptions which also need cleanups, even if C++ exceptions
+// are disabled. clang has __has_feature(cxx_exceptions) which checks for C++
+// exceptions starting at clang r206352, but which checked for cleanups prior to
+// that. To reliably check for C++ exception availability with clang, check for
+// __EXCEPTIONS && __has_feature(cxx_exceptions).
+#  define GTEST_HAS_EXCEPTIONS (__EXCEPTIONS && __has_feature(cxx_exceptions))
 # elif defined(__GNUC__) && __EXCEPTIONS
 // gcc defines __EXCEPTIONS to 1 iff exceptions are enabled.
 #  define GTEST_HAS_EXCEPTIONS 1
 
 // Determines whether Google Test can use the pthreads library.
 #ifndef GTEST_HAS_PTHREAD
-// The user didn't tell us explicitly, so we assume pthreads support is
-// available on Linux and Mac.
+// The user didn't tell us explicitly, so we make reasonable assumptions about
+// which platforms have pthreads support.
 //
 // To disable threading support in Google Test, add -DGTEST_HAS_PTHREAD=0
 // to your compiler flags.
 # define GTEST_HAS_PTHREAD (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_HPUX \
-    || GTEST_OS_QNX)
+    || GTEST_OS_QNX || GTEST_OS_FREEBSD || GTEST_OS_NACL)
 #endif  // GTEST_HAS_PTHREAD
 
 #if GTEST_HAS_PTHREAD
 # include <time.h>  // NOLINT
 #endif
 
+// Determines if hash_map/hash_set are available.
+// Only used for testing against those containers.
+#if !defined(GTEST_HAS_HASH_MAP_)
+# if _MSC_VER
+#  define GTEST_HAS_HASH_MAP_ 1  // Indicates that hash_map is available.
+#  define GTEST_HAS_HASH_SET_ 1  // Indicates that hash_set is available.
+# endif  // _MSC_VER
+#endif  // !defined(GTEST_HAS_HASH_MAP_)
+
 // Determines whether Google Test can use tr1/tuple.  You can define
 // this macro to 0 to prevent Google Test from using tuple (any
 // feature depending on tuple with be disabled in this mode).
 
 // To avoid conditional compilation everywhere, we make it
 // gtest-port.h's responsibility to #include the header implementing
-// tr1/tuple.
+// tuple.
+#if GTEST_HAS_STD_TUPLE_
+# include <tuple>  // IWYU pragma: export
+# define GTEST_TUPLE_NAMESPACE_ ::std
+#endif  // GTEST_HAS_STD_TUPLE_
+
+// We include tr1::tuple even if std::tuple is available to define printers for
+// them.
 #if GTEST_HAS_TR1_TUPLE
+# ifndef GTEST_TUPLE_NAMESPACE_
+#  define GTEST_TUPLE_NAMESPACE_ ::std::tr1
+# endif  // GTEST_TUPLE_NAMESPACE_
 
 # if GTEST_USE_OWN_TR1_TUPLE
-#  include "gtest/internal/gtest-tuple.h"
+#  include "gtest/internal/gtest-tuple.h"  // IWYU pragma: export  // NOLINT
 # elif GTEST_ENV_HAS_STD_TUPLE_
 #  include <tuple>
 // C++11 puts its tuple into the ::std namespace rather than
@@ -576,7 +717,7 @@ using ::std::tuple_size;
 // This prevents <boost/tr1/detail/config.hpp>, which defines
 // BOOST_HAS_TR1_TUPLE, from being #included by Boost's <tuple>.
 #  define BOOST_TR1_DETAIL_CONFIG_HPP_INCLUDED
-#  include <tuple>
+#  include <tuple>  // IWYU pragma: export  // NOLINT
 
 # elif defined(__GNUC__) && (GTEST_GCC_VER_ >= 40000)
 // GCC 4.0+ implements tr1/tuple in the <tr1/tuple> header.  This does
@@ -599,7 +740,7 @@ using ::std::tuple_size;
 # else
 // If the compiler is not GCC 4.0+, we assume the user is using a
 // spec-conforming TR1 implementation.
-#  include <tuple>  // NOLINT
+#  include <tuple>  // IWYU pragma: export  // NOLINT
 # endif  // GTEST_USE_OWN_TR1_TUPLE
 
 #endif  // GTEST_HAS_TR1_TUPLE
@@ -633,7 +774,8 @@ using ::std::tuple_size;
 #ifndef GTEST_HAS_STREAM_REDIRECTION
 // By default, we assume that stream redirection is supported on all
 // platforms except known mobile ones.
-# if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN
+# if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN || \
+    GTEST_OS_WINDOWS_PHONE || GTEST_OS_WINDOWS_RT
 #  define GTEST_HAS_STREAM_REDIRECTION 0
 # else
 #  define GTEST_HAS_STREAM_REDIRECTION 1
@@ -645,12 +787,11 @@ using ::std::tuple_size;
 // abort() in a VC 7.1 application compiled as GUI in debug config
 // pops up a dialog window that cannot be suppressed programmatically.
 #if (GTEST_OS_LINUX || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS || \
-     (GTEST_OS_MAC && !GTEST_OS_IOS) || GTEST_OS_IOS_SIMULATOR || \
+     (GTEST_OS_MAC && !GTEST_OS_IOS) || \
      (GTEST_OS_WINDOWS_DESKTOP && _MSC_VER >= 1400) || \
      GTEST_OS_WINDOWS_MINGW || GTEST_OS_AIX || GTEST_OS_HPUX || \
-     GTEST_OS_OPENBSD || GTEST_OS_QNX)
+     GTEST_OS_OPENBSD || GTEST_OS_QNX || GTEST_OS_FREEBSD)
 # define GTEST_HAS_DEATH_TEST 1
-# include <vector>  // NOLINT
 #endif
 
 // We don't support MSVC 7.1 with exceptions disabled now.  Therefore
@@ -681,12 +822,8 @@ using ::std::tuple_size;
     (GTEST_OS_WINDOWS || GTEST_OS_CYGWIN || GTEST_OS_SYMBIAN || GTEST_OS_AIX)
 
 // Determines whether test results can be streamed to a socket.
-#ifndef GTEST_CAN_STREAM_RESULTS
-# if GTEST_OS_LINUX
-#  define GTEST_CAN_STREAM_RESULTS_ 1
-# endif
-#else
-# define GTEST_CAN_STREAM_RESULTS_ GTEST_CAN_STREAM_RESULTS
+#if GTEST_OS_LINUX
+# define GTEST_CAN_STREAM_RESULTS_ 1
 #endif
 
 // Defines some utility macros.
@@ -718,7 +855,12 @@ using ::std::tuple_size;
 // compiler the variable/parameter does not have to be used.
 #if defined(__GNUC__) && !defined(COMPILER_ICC)
 # define GTEST_ATTRIBUTE_UNUSED_ __attribute__ ((unused))
-#else
+#elif defined(__clang__)
+# if __has_attribute(unused)
+#  define GTEST_ATTRIBUTE_UNUSED_ __attribute__ ((unused))
+# endif
+#endif
+#ifndef GTEST_ATTRIBUTE_UNUSED_
 # define GTEST_ATTRIBUTE_UNUSED_
 #endif
 
@@ -744,6 +886,19 @@ using ::std::tuple_size;
 # define GTEST_MUST_USE_RESULT_
 #endif  // __GNUC__ && (GTEST_GCC_VER_ >= 30400) && !COMPILER_ICC
 
+// MS C++ compiler emits warning when a conditional expression is compile time
+// constant. In some contexts this warning is false positive and needs to be
+// suppressed. Use the following two macros in such cases:
+//
+// GTEST_INTENTIONAL_CONST_COND_PUSH_()
+// while (true) {
+// GTEST_INTENTIONAL_CONST_COND_POP_()
+// }
+# define GTEST_INTENTIONAL_CONST_COND_PUSH_() \
+    GTEST_DISABLE_MSC_WARNINGS_PUSH_(4127)
+# define GTEST_INTENTIONAL_CONST_COND_POP_() \
+    GTEST_DISABLE_MSC_WARNINGS_POP_()
+
 // Determine whether the compiler supports Microsoft's Structured Exception
 // Handling.  This is supported by several Windows compilers but generally
 // does not exist on any other system.
@@ -758,17 +913,22 @@ using ::std::tuple_size;
 #  define GTEST_HAS_SEH 0
 # endif
 
+#define GTEST_IS_THREADSAFE \
+    (GTEST_HAS_MUTEX_AND_THREAD_LOCAL_ \
+     || (GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT) \
+     || GTEST_HAS_PTHREAD)
+
 #endif  // GTEST_HAS_SEH
 
 #ifdef _MSC_VER
-
 # if GTEST_LINKED_AS_SHARED_LIBRARY
 #  define GTEST_API_ __declspec(dllimport)
 # elif GTEST_CREATE_SHARED_LIBRARY
 #  define GTEST_API_ __declspec(dllexport)
 # endif
-
-#endif  // _MSC_VER
+#elif __GNUC__ >= 4 || defined(__clang__)
+# define GTEST_API_ __attribute__((visibility ("default")))
+#endif // _MSC_VER
 
 #ifndef GTEST_API_
 # define GTEST_API_
@@ -788,10 +948,58 @@ using ::std::tuple_size;
 # define GTEST_HAS_CXXABI_H_ 0
 #endif
 
+// A function level attribute to disable checking for use of uninitialized
+// memory when built with MemorySanitizer.
+#if defined(__clang__)
+# if __has_feature(memory_sanitizer)
+#  define GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_ \
+       __attribute__((no_sanitize_memory))
+# else
+#  define GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_
+# endif  // __has_feature(memory_sanitizer)
+#else
+# define GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_
+#endif  // __clang__
+
+// A function level attribute to disable AddressSanitizer instrumentation.
+#if defined(__clang__)
+# if __has_feature(address_sanitizer)
+#  define GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_ \
+       __attribute__((no_sanitize_address))
+# else
+#  define GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
+# endif  // __has_feature(address_sanitizer)
+#else
+# define GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
+#endif  // __clang__
+
+// A function level attribute to disable ThreadSanitizer instrumentation.
+#if defined(__clang__)
+# if __has_feature(thread_sanitizer)
+#  define GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_ \
+       __attribute__((no_sanitize_thread))
+# else
+#  define GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_
+# endif  // __has_feature(thread_sanitizer)
+#else
+# define GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_
+#endif  // __clang__
+
 namespace testing {
 
 class Message;
 
+#if defined(GTEST_TUPLE_NAMESPACE_)
+// Import tuple and friends into the ::testing namespace.
+// It is part of our interface, having them in ::testing allows us to change
+// their types as needed.
+using GTEST_TUPLE_NAMESPACE_::get;
+using GTEST_TUPLE_NAMESPACE_::make_tuple;
+using GTEST_TUPLE_NAMESPACE_::tuple;
+using GTEST_TUPLE_NAMESPACE_::tuple_size;
+using GTEST_TUPLE_NAMESPACE_::tuple_element;
+#endif  // defined(GTEST_TUPLE_NAMESPACE_)
+
 namespace internal {
 
 // A secret type that Google Test users don't know about.  It has no
@@ -803,8 +1011,8 @@ class Secret;
 // expression is true. For example, you could use it to verify the
 // size of a static array:
 //
-//   GTEST_COMPILE_ASSERT_(ARRAYSIZE(content_type_names) == CONTENT_NUM_TYPES,
-//                         content_type_names_incorrect_size);
+//   GTEST_COMPILE_ASSERT_(GTEST_ARRAY_SIZE_(names) == NUM_NAMES,
+//                         names_incorrect_size);
 //
 // or to make sure a struct is smaller than a certain size:
 //
@@ -814,16 +1022,22 @@ class Secret;
 // the expression is false, most compilers will issue a warning/error
 // containing the name of the variable.
 
+#if GTEST_LANG_CXX11
+# define GTEST_COMPILE_ASSERT_(expr, msg) static_assert(expr, #msg)
+#else  // !GTEST_LANG_CXX11
 template <bool>
-struct CompileAssert {
+  struct CompileAssert {
 };
 
-#define GTEST_COMPILE_ASSERT_(expr, msg) \
+# define GTEST_COMPILE_ASSERT_(expr, msg) \
   typedef ::testing::internal::CompileAssert<(static_cast<bool>(expr))> \
       msg[static_cast<bool>(expr) ? 1 : -1] GTEST_ATTRIBUTE_UNUSED_
+#endif  // !GTEST_LANG_CXX11
 
 // Implementation details of GTEST_COMPILE_ASSERT_:
 //
+// (In C++11, we simply use static_assert instead of the following)
+//
 // - GTEST_COMPILE_ASSERT_ works by defining an array type that has -1
 //   elements (and thus is invalid) when the expression is false.
 //
@@ -870,7 +1084,12 @@ template <typename T1, typename T2>
 struct StaticAssertTypeEqHelper;
 
 template <typename T>
-struct StaticAssertTypeEqHelper<T, T> {};
+struct StaticAssertTypeEqHelper<T, T> {
+  enum { value = true };
+};
+
+// Evaluates to the number of elements in 'array'.
+#define GTEST_ARRAY_SIZE_(array) (sizeof(array) / sizeof(array[0]))
 
 #if GTEST_HAS_GLOBAL_STRING
 typedef ::string string;
@@ -919,6 +1138,11 @@ class scoped_ptr {
     }
   }
 
+  friend void swap(scoped_ptr& a, scoped_ptr& b) {
+    using std::swap;
+    swap(a.ptr_, b.ptr_);
+  }
+
  private:
   T* ptr_;
 
@@ -1042,13 +1266,18 @@ class GTEST_API_ GTestLog {
   GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestLog);
 };
 
-#define GTEST_LOG_(severity) \
+#if !defined(GTEST_LOG_)
+
+# define GTEST_LOG_(severity) \
     ::testing::internal::GTestLog(::testing::internal::GTEST_##severity, \
                                   __FILE__, __LINE__).GetStream()
 
 inline void LogToStderr() {}
 inline void FlushInfoLog() { fflush(NULL); }
 
+#endif  // !defined(GTEST_LOG_)
+
+#if !defined(GTEST_CHECK_)
 // INTERNAL IMPLEMENTATION - DO NOT USE.
 //
 // GTEST_CHECK_ is an all-mode assert. It aborts the program if the condition
@@ -1063,12 +1292,13 @@ inline void FlushInfoLog() { fflush(NULL); }
 //    condition itself, plus additional message streamed into it, if any,
 //    and then it aborts the program. It aborts the program irrespective of
 //    whether it is built in the debug mode or not.
-#define GTEST_CHECK_(condition) \
+# define GTEST_CHECK_(condition) \
     GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
     if (::testing::internal::IsTrue(condition)) \
       ; \
     else \
       GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
+#endif  // !defined(GTEST_CHECK_)
 
 // An all-mode assert to verify that the given POSIX-style function
 // call returns 0 (indicating success).  Known limitation: this
@@ -1080,6 +1310,15 @@ inline void FlushInfoLog() { fflush(NULL); }
     GTEST_LOG_(FATAL) << #posix_call << "failed with error " \
                       << gtest_error
 
+#if GTEST_HAS_STD_MOVE_
+using std::move;
+#else  // GTEST_HAS_STD_MOVE_
+template <typename T>
+const T& move(const T& t) {
+  return t;
+}
+#endif  // GTEST_HAS_STD_MOVE_
+
 // INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
 //
 // Use ImplicitCast_ as a safe version of static_cast for upcasting in
@@ -1130,7 +1369,9 @@ inline To DownCast_(From* f) {  // so we only accept pointers
   // for compile-time type checking, and has no overhead in an
   // optimized build at run-time, as it will be optimized away
   // completely.
+  GTEST_INTENTIONAL_CONST_COND_PUSH_()
   if (false) {
+  GTEST_INTENTIONAL_CONST_COND_POP_()
     const To to = NULL;
     ::testing::internal::ImplicitCast_<From*>(to);
   }
@@ -1151,6 +1392,11 @@ template <class Derived, class Base>
 Derived* CheckedDowncastToActualType(Base* base) {
 #if GTEST_HAS_RTTI
   GTEST_CHECK_(typeid(*base) == typeid(Derived));
+#endif
+
+#if GTEST_HAS_DOWNCAST_
+  return ::down_cast<Derived*>(base);
+#elif GTEST_HAS_RTTI
   return dynamic_cast<Derived*>(base);  // NOLINT
 #else
   return static_cast<Derived*>(base);  // Poor man's downcast.
@@ -1172,6 +1418,17 @@ GTEST_API_ std::string GetCapturedStderr();
 
 #endif  // GTEST_HAS_STREAM_REDIRECTION
 
+// Returns a path to temporary directory.
+GTEST_API_ std::string TempDir();
+
+// Returns the size (in bytes) of a file.
+GTEST_API_ size_t GetFileSize(FILE* file);
+
+// Reads the entire content of a file as a string.
+GTEST_API_ std::string ReadEntireFile(FILE* file);
+
+// All command line arguments.
+GTEST_API_ const ::std::vector<testing::internal::string>& GetArgvs();
 
 #if GTEST_HAS_DEATH_TEST
 
@@ -1179,18 +1436,15 @@ const ::std::vector<testing::internal::string>& GetInjectableArgvs();
 void SetInjectableArgvs(const ::std::vector<testing::internal::string>*
                              new_argvs);
 
-// A copy of all command line arguments.  Set by InitGoogleTest().
-extern ::std::vector<testing::internal::string> g_argvs;
 
 #endif  // GTEST_HAS_DEATH_TEST
 
 // Defines synchronization primitives.
-
-#if GTEST_HAS_PTHREAD
-
-// Sleeps for (roughly) n milli-seconds.  This function is only for
-// testing Google Test's own constructs.  Don't use it in user tests,
-// either directly or indirectly.
+#if GTEST_IS_THREADSAFE
+# if GTEST_HAS_PTHREAD
+// Sleeps for (roughly) n milliseconds.  This function is only for testing
+// Google Test's own constructs.  Don't use it in user tests, either
+// directly or indirectly.
 inline void SleepMilliseconds(int n) {
   const timespec time = {
     0,                  // 0 seconds.
@@ -1198,7 +1452,13 @@ inline void SleepMilliseconds(int n) {
   };
   nanosleep(&time, NULL);
 }
+# endif  // GTEST_HAS_PTHREAD
+
+# if GTEST_HAS_NOTIFICATION_
+// Notification has already been imported into the namespace.
+// Nothing to do here.
 
+# elif GTEST_HAS_PTHREAD
 // Allows a controller thread to pause execution of newly created
 // threads until notified.  Instances of this class must be created
 // and destroyed in the controller thread.
@@ -1242,6 +1502,62 @@ class Notification {
   GTEST_DISALLOW_COPY_AND_ASSIGN_(Notification);
 };
 
+# elif GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT
+
+GTEST_API_ void SleepMilliseconds(int n);
+
+// Provides leak-safe Windows kernel handle ownership.
+// Used in death tests and in threading support.
+class GTEST_API_ AutoHandle {
+ public:
+  // Assume that Win32 HANDLE type is equivalent to void*. Doing so allows us to
+  // avoid including <windows.h> in this header file. Including <windows.h> is
+  // undesirable because it defines a lot of symbols and macros that tend to
+  // conflict with client code. This assumption is verified by
+  // WindowsTypesTest.HANDLEIsVoidStar.
+  typedef void* Handle;
+  AutoHandle();
+  explicit AutoHandle(Handle handle);
+
+  ~AutoHandle();
+
+  Handle Get() const;
+  void Reset();
+  void Reset(Handle handle);
+
+ private:
+  // Returns true iff the handle is a valid handle object that can be closed.
+  bool IsCloseable() const;
+
+  Handle handle_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(AutoHandle);
+};
+
+// Allows a controller thread to pause execution of newly created
+// threads until notified.  Instances of this class must be created
+// and destroyed in the controller thread.
+//
+// This class is only for testing Google Test's own constructs. Do not
+// use it in user tests, either directly or indirectly.
+class GTEST_API_ Notification {
+ public:
+  Notification();
+  void Notify();
+  void WaitForNotification();
+
+ private:
+  AutoHandle event_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(Notification);
+};
+# endif  // GTEST_HAS_NOTIFICATION_
+
+// On MinGW, we can have both GTEST_OS_WINDOWS and GTEST_HAS_PTHREAD
+// defined, but we don't want to use MinGW's pthreads implementation, which
+// has conformance problems with some versions of the POSIX standard.
+# if GTEST_HAS_PTHREAD && !GTEST_OS_WINDOWS_MINGW
+
 // As a C-function, ThreadFuncWithCLinkage cannot be templated itself.
 // Consequently, it cannot select a correct instantiation of ThreadWithParam
 // in order to call its Run(). Introducing ThreadWithParamBase as a
@@ -1279,10 +1595,9 @@ extern "C" inline void* ThreadFuncWithCLinkage(void* thread) {
 template <typename T>
 class ThreadWithParam : public ThreadWithParamBase {
  public:
-  typedef void (*UserThreadFunc)(T);
+  typedef void UserThreadFunc(T);
 
-  ThreadWithParam(
-      UserThreadFunc func, T param, Notification* thread_can_start)
+  ThreadWithParam(UserThreadFunc* func, T param, Notification* thread_can_start)
       : func_(func),
         param_(param),
         thread_can_start_(thread_can_start),
@@ -1309,7 +1624,7 @@ class ThreadWithParam : public ThreadWithParamBase {
   }
 
  private:
-  const UserThreadFunc func_;  // User-supplied thread function.
+  UserThreadFunc* const func_;  // User-supplied thread function.
   const T param_;  // User-supplied parameter to the thread function.
   // When non-NULL, used to block execution until the controller thread
   // notifies.
@@ -1319,26 +1634,293 @@ class ThreadWithParam : public ThreadWithParamBase {
 
   GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParam);
 };
+# endif  // !GTEST_OS_WINDOWS && GTEST_HAS_PTHREAD ||
+         // GTEST_HAS_MUTEX_AND_THREAD_LOCAL_
+
+# if GTEST_HAS_MUTEX_AND_THREAD_LOCAL_
+// Mutex and ThreadLocal have already been imported into the namespace.
+// Nothing to do here.
 
-// MutexBase and Mutex implement mutex on pthreads-based platforms. They
-// are used in conjunction with class MutexLock:
+# elif GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT
+
+// Mutex implements mutex on Windows platforms.  It is used in conjunction
+// with class MutexLock:
 //
 //   Mutex mutex;
 //   ...
-//   MutexLock lock(&mutex);  // Acquires the mutex and releases it at the end
-//                            // of the current scope.
-//
-// MutexBase implements behavior for both statically and dynamically
-// allocated mutexes.  Do not use MutexBase directly.  Instead, write
-// the following to define a static mutex:
+//   MutexLock lock(&mutex);  // Acquires the mutex and releases it at the
+//                            // end of the current scope.
 //
+// A static Mutex *must* be defined or declared using one of the following
+// macros:
 //   GTEST_DEFINE_STATIC_MUTEX_(g_some_mutex);
+//   GTEST_DECLARE_STATIC_MUTEX_(g_some_mutex);
+//
+// (A non-static Mutex is defined/declared in the usual way).
+class GTEST_API_ Mutex {
+ public:
+  enum MutexType { kStatic = 0, kDynamic = 1 };
+  // We rely on kStaticMutex being 0 as it is to what the linker initializes
+  // type_ in static mutexes.  critical_section_ will be initialized lazily
+  // in ThreadSafeLazyInit().
+  enum StaticConstructorSelector { kStaticMutex = 0 };
+
+  // This constructor intentionally does nothing.  It relies on type_ being
+  // statically initialized to 0 (effectively setting it to kStatic) and on
+  // ThreadSafeLazyInit() to lazily initialize the rest of the members.
+  explicit Mutex(StaticConstructorSelector /*dummy*/) {}
+
+  Mutex();
+  ~Mutex();
+
+  void Lock();
+
+  void Unlock();
+
+  // Does nothing if the current thread holds the mutex. Otherwise, crashes
+  // with high probability.
+  void AssertHeld();
+
+ private:
+  // Initializes owner_thread_id_ and critical_section_ in static mutexes.
+  void ThreadSafeLazyInit();
+
+  // Per http://blogs.msdn.com/b/oldnewthing/archive/2004/02/23/78395.aspx,
+  // we assume that 0 is an invalid value for thread IDs.
+  unsigned int owner_thread_id_;
+
+  // For static mutexes, we rely on these members being initialized to zeros
+  // by the linker.
+  MutexType type_;
+  long critical_section_init_phase_;  // NOLINT
+  _RTL_CRITICAL_SECTION* critical_section_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(Mutex);
+};
+
+# define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
+    extern ::testing::internal::Mutex mutex
+
+# define GTEST_DEFINE_STATIC_MUTEX_(mutex) \
+    ::testing::internal::Mutex mutex(::testing::internal::Mutex::kStaticMutex)
+
+// We cannot name this class MutexLock because the ctor declaration would
+// conflict with a macro named MutexLock, which is defined on some
+// platforms. That macro is used as a defensive measure to prevent against
+// inadvertent misuses of MutexLock like "MutexLock(&mu)" rather than
+// "MutexLock l(&mu)".  Hence the typedef trick below.
+class GTestMutexLock {
+ public:
+  explicit GTestMutexLock(Mutex* mutex)
+      : mutex_(mutex) { mutex_->Lock(); }
+
+  ~GTestMutexLock() { mutex_->Unlock(); }
+
+ private:
+  Mutex* const mutex_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestMutexLock);
+};
+
+typedef GTestMutexLock MutexLock;
+
+// Base class for ValueHolder<T>.  Allows a caller to hold and delete a value
+// without knowing its type.
+class ThreadLocalValueHolderBase {
+ public:
+  virtual ~ThreadLocalValueHolderBase() {}
+};
+
+// Provides a way for a thread to send notifications to a ThreadLocal
+// regardless of its parameter type.
+class ThreadLocalBase {
+ public:
+  // Creates a new ValueHolder<T> object holding a default value passed to
+  // this ThreadLocal<T>'s constructor and returns it.  It is the caller's
+  // responsibility not to call this when the ThreadLocal<T> instance already
+  // has a value on the current thread.
+  virtual ThreadLocalValueHolderBase* NewValueForCurrentThread() const = 0;
+
+ protected:
+  ThreadLocalBase() {}
+  virtual ~ThreadLocalBase() {}
+
+ private:
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocalBase);
+};
+
+// Maps a thread to a set of ThreadLocals that have values instantiated on that
+// thread and notifies them when the thread exits.  A ThreadLocal instance is
+// expected to persist until all threads it has values on have terminated.
+class GTEST_API_ ThreadLocalRegistry {
+ public:
+  // Registers thread_local_instance as having value on the current thread.
+  // Returns a value that can be used to identify the thread from other threads.
+  static ThreadLocalValueHolderBase* GetValueOnCurrentThread(
+      const ThreadLocalBase* thread_local_instance);
+
+  // Invoked when a ThreadLocal instance is destroyed.
+  static void OnThreadLocalDestroyed(
+      const ThreadLocalBase* thread_local_instance);
+};
+
+class GTEST_API_ ThreadWithParamBase {
+ public:
+  void Join();
+
+ protected:
+  class Runnable {
+   public:
+    virtual ~Runnable() {}
+    virtual void Run() = 0;
+  };
+
+  ThreadWithParamBase(Runnable *runnable, Notification* thread_can_start);
+  virtual ~ThreadWithParamBase();
+
+ private:
+  AutoHandle thread_;
+};
+
+// Helper class for testing Google Test's multi-threading constructs.
+template <typename T>
+class ThreadWithParam : public ThreadWithParamBase {
+ public:
+  typedef void UserThreadFunc(T);
+
+  ThreadWithParam(UserThreadFunc* func, T param, Notification* thread_can_start)
+      : ThreadWithParamBase(new RunnableImpl(func, param), thread_can_start) {
+  }
+  virtual ~ThreadWithParam() {}
+
+ private:
+  class RunnableImpl : public Runnable {
+   public:
+    RunnableImpl(UserThreadFunc* func, T param)
+        : func_(func),
+          param_(param) {
+    }
+    virtual ~RunnableImpl() {}
+    virtual void Run() {
+      func_(param_);
+    }
+
+   private:
+    UserThreadFunc* const func_;
+    const T param_;
+
+    GTEST_DISALLOW_COPY_AND_ASSIGN_(RunnableImpl);
+  };
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParam);
+};
+
+// Implements thread-local storage on Windows systems.
 //
-// You can forward declare a static mutex like this:
+//   // Thread 1
+//   ThreadLocal<int> tl(100);  // 100 is the default value for each thread.
 //
-//   GTEST_DECLARE_STATIC_MUTEX_(g_some_mutex);
+//   // Thread 2
+//   tl.set(150);  // Changes the value for thread 2 only.
+//   EXPECT_EQ(150, tl.get());
+//
+//   // Thread 1
+//   EXPECT_EQ(100, tl.get());  // In thread 1, tl has the original value.
+//   tl.set(200);
+//   EXPECT_EQ(200, tl.get());
+//
+// The template type argument T must have a public copy constructor.
+// In addition, the default ThreadLocal constructor requires T to have
+// a public default constructor.
+//
+// The users of a TheadLocal instance have to make sure that all but one
+// threads (including the main one) using that instance have exited before
+// destroying it. Otherwise, the per-thread objects managed for them by the
+// ThreadLocal instance are not guaranteed to be destroyed on all platforms.
 //
-// To create a dynamic mutex, just define an object of type Mutex.
+// Google Test only uses global ThreadLocal objects.  That means they
+// will die after main() has returned.  Therefore, no per-thread
+// object managed by Google Test will be leaked as long as all threads
+// using Google Test have exited when main() returns.
+template <typename T>
+class ThreadLocal : public ThreadLocalBase {
+ public:
+  ThreadLocal() : default_factory_(new DefaultValueHolderFactory()) {}
+  explicit ThreadLocal(const T& value)
+      : default_factory_(new InstanceValueHolderFactory(value)) {}
+
+  ~ThreadLocal() { ThreadLocalRegistry::OnThreadLocalDestroyed(this); }
+
+  T* pointer() { return GetOrCreateValue(); }
+  const T* pointer() const { return GetOrCreateValue(); }
+  const T& get() const { return *pointer(); }
+  void set(const T& value) { *pointer() = value; }
+
+ private:
+  // Holds a value of T.  Can be deleted via its base class without the caller
+  // knowing the type of T.
+  class ValueHolder : public ThreadLocalValueHolderBase {
+   public:
+    ValueHolder() : value_() {}
+    explicit ValueHolder(const T& value) : value_(value) {}
+
+    T* pointer() { return &value_; }
+
+   private:
+    T value_;
+    GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolder);
+  };
+
+
+  T* GetOrCreateValue() const {
+    return static_cast<ValueHolder*>(
+        ThreadLocalRegistry::GetValueOnCurrentThread(this))->pointer();
+  }
+
+  virtual ThreadLocalValueHolderBase* NewValueForCurrentThread() const {
+    return default_factory_->MakeNewHolder();
+  }
+
+  class ValueHolderFactory {
+   public:
+    ValueHolderFactory() {}
+    virtual ~ValueHolderFactory() {}
+    virtual ValueHolder* MakeNewHolder() const = 0;
+
+   private:
+    GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolderFactory);
+  };
+
+  class DefaultValueHolderFactory : public ValueHolderFactory {
+   public:
+    DefaultValueHolderFactory() {}
+    virtual ValueHolder* MakeNewHolder() const { return new ValueHolder(); }
+
+   private:
+    GTEST_DISALLOW_COPY_AND_ASSIGN_(DefaultValueHolderFactory);
+  };
+
+  class InstanceValueHolderFactory : public ValueHolderFactory {
+   public:
+    explicit InstanceValueHolderFactory(const T& value) : value_(value) {}
+    virtual ValueHolder* MakeNewHolder() const {
+      return new ValueHolder(value_);
+    }
+
+   private:
+    const T value_;  // The value for each thread.
+
+    GTEST_DISALLOW_COPY_AND_ASSIGN_(InstanceValueHolderFactory);
+  };
+
+  scoped_ptr<ValueHolderFactory> default_factory_;
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocal);
+};
+
+# elif GTEST_HAS_PTHREAD
+
+// MutexBase and Mutex implement mutex on pthreads-based platforms.
 class MutexBase {
  public:
   // Acquires this mutex.
@@ -1383,17 +1965,12 @@ class MutexBase {
 };
 
 // Forward-declares a static mutex.
-# define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
-    extern ::testing::internal::MutexBase mutex
+#  define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
+     extern ::testing::internal::MutexBase mutex
 
 // Defines and statically (i.e. at link time) initializes a static mutex.
-// The initialization list here does not explicitly initialize each field,
-// instead relying on default initialization for the unspecified fields. In
-// particular, the owner_ field (a pthread_t) is not explicitly initialized.
-// This allows initialization to work whether pthread_t is a scalar or struct.
-// The flag -Wmissing-field-initializers must not be specified for this to work.
-# define GTEST_DEFINE_STATIC_MUTEX_(mutex) \
-    ::testing::internal::MutexBase mutex = { PTHREAD_MUTEX_INITIALIZER, false }
+#  define GTEST_DEFINE_STATIC_MUTEX_(mutex) \
+     ::testing::internal::MutexBase mutex = { PTHREAD_MUTEX_INITIALIZER, false, pthread_t() }
 
 // The Mutex class can only be used for mutexes created at runtime. It
 // shares its API with MutexBase otherwise.
@@ -1411,9 +1988,11 @@ class Mutex : public MutexBase {
   GTEST_DISALLOW_COPY_AND_ASSIGN_(Mutex);
 };
 
-// We cannot name this class MutexLock as the ctor declaration would
+// We cannot name this class MutexLock because the ctor declaration would
 // conflict with a macro named MutexLock, which is defined on some
-// platforms.  Hence the typedef trick below.
+// platforms. That macro is used as a defensive measure to prevent against
+// inadvertent misuses of MutexLock like "MutexLock(&mu)" rather than
+// "MutexLock l(&mu)".  Hence the typedef trick below.
 class GTestMutexLock {
  public:
   explicit GTestMutexLock(MutexBase* mutex)
@@ -1447,41 +2026,14 @@ extern "C" inline void DeleteThreadLocalValue(void* value_holder) {
 }
 
 // Implements thread-local storage on pthreads-based systems.
-//
-//   // Thread 1
-//   ThreadLocal<int> tl(100);  // 100 is the default value for each thread.
-//
-//   // Thread 2
-//   tl.set(150);  // Changes the value for thread 2 only.
-//   EXPECT_EQ(150, tl.get());
-//
-//   // Thread 1
-//   EXPECT_EQ(100, tl.get());  // In thread 1, tl has the original value.
-//   tl.set(200);
-//   EXPECT_EQ(200, tl.get());
-//
-// The template type argument T must have a public copy constructor.
-// In addition, the default ThreadLocal constructor requires T to have
-// a public default constructor.
-//
-// An object managed for a thread by a ThreadLocal instance is deleted
-// when the thread exits.  Or, if the ThreadLocal instance dies in
-// that thread, when the ThreadLocal dies.  It's the user's
-// responsibility to ensure that all other threads using a ThreadLocal
-// have exited when it dies, or the per-thread objects for those
-// threads will not be deleted.
-//
-// Google Test only uses global ThreadLocal objects.  That means they
-// will die after main() has returned.  Therefore, no per-thread
-// object managed by Google Test will be leaked as long as all threads
-// using Google Test have exited when main() returns.
 template <typename T>
 class ThreadLocal {
  public:
-  ThreadLocal() : key_(CreateKey()),
-                  default_() {}
-  explicit ThreadLocal(const T& value) : key_(CreateKey()),
-                                         default_(value) {}
+  ThreadLocal()
+      : key_(CreateKey()), default_factory_(new DefaultValueHolderFactory()) {}
+  explicit ThreadLocal(const T& value)
+      : key_(CreateKey()),
+        default_factory_(new InstanceValueHolderFactory(value)) {}
 
   ~ThreadLocal() {
     // Destroys the managed object for the current thread, if any.
@@ -1501,6 +2053,7 @@ class ThreadLocal {
   // Holds a value of type T.
   class ValueHolder : public ThreadLocalValueHolderBase {
    public:
+    ValueHolder() : value_() {}
     explicit ValueHolder(const T& value) : value_(value) {}
 
     T* pointer() { return &value_; }
@@ -1526,22 +2079,54 @@ class ThreadLocal {
       return CheckedDowncastToActualType<ValueHolder>(holder)->pointer();
     }
 
-    ValueHolder* const new_holder = new ValueHolder(default_);
+    ValueHolder* const new_holder = default_factory_->MakeNewHolder();
     ThreadLocalValueHolderBase* const holder_base = new_holder;
     GTEST_CHECK_POSIX_SUCCESS_(pthread_setspecific(key_, holder_base));
     return new_holder->pointer();
   }
 
+  class ValueHolderFactory {
+   public:
+    ValueHolderFactory() {}
+    virtual ~ValueHolderFactory() {}
+    virtual ValueHolder* MakeNewHolder() const = 0;
+
+   private:
+    GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolderFactory);
+  };
+
+  class DefaultValueHolderFactory : public ValueHolderFactory {
+   public:
+    DefaultValueHolderFactory() {}
+    virtual ValueHolder* MakeNewHolder() const { return new ValueHolder(); }
+
+   private:
+    GTEST_DISALLOW_COPY_AND_ASSIGN_(DefaultValueHolderFactory);
+  };
+
+  class InstanceValueHolderFactory : public ValueHolderFactory {
+   public:
+    explicit InstanceValueHolderFactory(const T& value) : value_(value) {}
+    virtual ValueHolder* MakeNewHolder() const {
+      return new ValueHolder(value_);
+    }
+
+   private:
+    const T value_;  // The value for each thread.
+
+    GTEST_DISALLOW_COPY_AND_ASSIGN_(InstanceValueHolderFactory);
+  };
+
   // A key pthreads uses for looking up per-thread values.
   const pthread_key_t key_;
-  const T default_;  // The default value for each thread.
+  scoped_ptr<ValueHolderFactory> default_factory_;
 
   GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocal);
 };
 
-# define GTEST_IS_THREADSAFE 1
+# endif  // GTEST_HAS_MUTEX_AND_THREAD_LOCAL_
 
-#else  // GTEST_HAS_PTHREAD
+#else  // GTEST_IS_THREADSAFE
 
 // A dummy implementation of synchronization primitives (mutex, lock,
 // and thread-local variable).  Necessary for compiling Google Test where
@@ -1561,6 +2146,11 @@ class Mutex {
 
 # define GTEST_DEFINE_STATIC_MUTEX_(mutex) ::testing::internal::Mutex mutex
 
+// We cannot name this class MutexLock because the ctor declaration would
+// conflict with a macro named MutexLock, which is defined on some
+// platforms. That macro is used as a defensive measure to prevent against
+// inadvertent misuses of MutexLock like "MutexLock(&mu)" rather than
+// "MutexLock l(&mu)".  Hence the typedef trick below.
 class GTestMutexLock {
  public:
   explicit GTestMutexLock(Mutex*) {}  // NOLINT
@@ -1581,11 +2171,7 @@ class ThreadLocal {
   T value_;
 };
 
-// The above synchronization primitives have dummy implementations.
-// Therefore Google Test is not thread-safe.
-# define GTEST_IS_THREADSAFE 0
-
-#endif  // GTEST_HAS_PTHREAD
+#endif  // GTEST_IS_THREADSAFE
 
 // Returns the number of threads running in the process, or 0 to indicate that
 // we cannot detect it.
@@ -1695,6 +2281,13 @@ inline char ToUpper(char ch) {
   return static_cast<char>(toupper(static_cast<unsigned char>(ch)));
 }
 
+inline std::string StripTrailingSpaces(std::string str) {
+  std::string::iterator it = str.end();
+  while (it != str.begin() && IsSpace(*--it))
+    it = str.erase(it);
+  return str;
+}
+
 // The testing::internal::posix namespace holds wrappers for common
 // POSIX functions.  These wrappers hide the differences between
 // Windows/MSVC and POSIX systems.  Since some compilers define these
@@ -1758,11 +2351,7 @@ inline bool IsDir(const StatStruct& st) { return S_ISDIR(st.st_mode); }
 
 // Functions deprecated by MSVC 8.0.
 
-#ifdef _MSC_VER
-// Temporarily disable warning 4996 (deprecated function).
-# pragma warning(push)
-# pragma warning(disable:4996)
-#endif
+GTEST_DISABLE_MSC_WARNINGS_PUSH_(4996 /* deprecated function */)
 
 inline const char* StrNCpy(char* dest, const char* src, size_t n) {
   return strncpy(dest, src, n);
@@ -1772,7 +2361,7 @@ inline const char* StrNCpy(char* dest, const char* src, size_t n) {
 // StrError() aren't needed on Windows CE at this time and thus not
 // defined there.
 
-#if !GTEST_OS_WINDOWS_MOBILE
+#if !GTEST_OS_WINDOWS_MOBILE && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT
 inline int ChDir(const char* dir) { return chdir(dir); }
 #endif
 inline FILE* FOpen(const char* path, const char* mode) {
@@ -1796,8 +2385,9 @@ inline int Close(int fd) { return close(fd); }
 inline const char* StrError(int errnum) { return strerror(errnum); }
 #endif
 inline const char* GetEnv(const char* name) {
-#if GTEST_OS_WINDOWS_MOBILE
+#if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_WINDOWS_PHONE | GTEST_OS_WINDOWS_RT
   // We are on Windows CE, which has no environment variables.
+  static_cast<void>(name);  // To prevent 'unused argument' warning.
   return NULL;
 #elif defined(__BORLANDC__) || defined(__SunOS_5_8) || defined(__SunOS_5_9)
   // Environment variables which we programmatically clear will be set to the
@@ -1809,9 +2399,7 @@ inline const char* GetEnv(const char* name) {
 #endif
 }
 
-#ifdef _MSC_VER
-# pragma warning(pop)  // Restores the warning state.
-#endif
+GTEST_DISABLE_MSC_WARNINGS_POP_()
 
 #if GTEST_OS_WINDOWS_MOBILE
 // Windows CE has no C library. The abort() function is used in
@@ -1912,11 +2500,20 @@ typedef TypeWithSize<8>::Int TimeInMillis;  // Represents time in milliseconds.
 // Utilities for command line flags and environment variables.
 
 // Macro for referencing flags.
-#define GTEST_FLAG(name) FLAGS_gtest_##name
+#if !defined(GTEST_FLAG)
+# define GTEST_FLAG(name) FLAGS_gtest_##name
+#endif  // !defined(GTEST_FLAG)
+
+#if !defined(GTEST_USE_OWN_FLAGFILE_FLAG_)
+# define GTEST_USE_OWN_FLAGFILE_FLAG_ 1
+#endif  // !defined(GTEST_USE_OWN_FLAGFILE_FLAG_)
+
+#if !defined(GTEST_DECLARE_bool_)
+# define GTEST_FLAG_SAVER_ ::testing::internal::GTestFlagSaver
 
 // Macros for declaring flags.
-#define GTEST_DECLARE_bool_(name) GTEST_API_ extern bool GTEST_FLAG(name)
-#define GTEST_DECLARE_int32_(name) \
+# define GTEST_DECLARE_bool_(name) GTEST_API_ extern bool GTEST_FLAG(name)
+# define GTEST_DECLARE_int32_(name) \
     GTEST_API_ extern ::testing::internal::Int32 GTEST_FLAG(name)
 #define GTEST_DECLARE_string_(name) \
     GTEST_API_ extern ::std::string GTEST_FLAG(name)
@@ -1929,9 +2526,13 @@ typedef TypeWithSize<8>::Int TimeInMillis;  // Represents time in milliseconds.
 #define GTEST_DEFINE_string_(name, default_val, doc) \
     GTEST_API_ ::std::string GTEST_FLAG(name) = (default_val)
 
+#endif  // !defined(GTEST_DECLARE_bool_)
+
 // Thread annotations
-#define GTEST_EXCLUSIVE_LOCK_REQUIRED_(locks)
-#define GTEST_LOCK_EXCLUDED_(locks)
+#if !defined(GTEST_EXCLUSIVE_LOCK_REQUIRED_)
+# define GTEST_EXCLUSIVE_LOCK_REQUIRED_(locks)
+# define GTEST_LOCK_EXCLUDED_(locks)
+#endif  // !defined(GTEST_EXCLUSIVE_LOCK_REQUIRED_)
 
 // Parses 'str' for a 32-bit signed integer.  If successful, writes the result
 // to *value and returns true; otherwise leaves *value unchanged and returns
@@ -1945,7 +2546,7 @@ bool ParseInt32(const Message& src_text, const char* str, Int32* value);
 // corresponding to the given Google Test flag.
 bool BoolFromGTestEnv(const char* flag, bool default_val);
 GTEST_API_ Int32 Int32FromGTestEnv(const char* flag, Int32 default_val);
-const char* StringFromGTestEnv(const char* flag, const char* default_val);
+std::string StringFromGTestEnv(const char* flag, const char* default_val);
 
 }  // namespace internal
 }  // namespace testing
similarity index 98%
rename from src/external/gmock-1.7.0/gtest/include/gtest/internal/gtest-tuple.h
rename to src/external/googletest/googletest/include/gtest/internal/gtest-tuple.h
index 7b3dfc312dc5c9ae1ce67e16b7f577334449bdba..e9b405340a855f60258b134026be7b13612ebe1e 100644 (file)
    private:
 #endif
 
+// Visual Studio 2010, 2012, and 2013 define symbols in std::tr1 that conflict
+// with our own definitions. Therefore using our own tuple does not work on
+// those compilers.
+#if defined(_MSC_VER) && _MSC_VER >= 1600  /* 1600 is Visual Studio 2010 */
+# error "gtest's tuple doesn't compile on Visual Studio 2010 or later. \
+GTEST_USE_OWN_TR1_TUPLE must be set to 0 on those compilers."
+#endif
+
 // GTEST_n_TUPLE_(T) is the type of an n-tuple.
 #define GTEST_0_TUPLE_(T) tuple<>
 #define GTEST_1_TUPLE_(T) tuple<T##0, void, void, void, void, void, void, \
similarity index 98%
rename from src/external/gmock-1.7.0/gtest/src/gtest-death-test.cc
rename to src/external/googletest/googletest/src/gtest-death-test.cc
index a6023fce4fa1451e6357d91c63842632934af169..a01a3698308782821e4f90f41285128b75c8e3ba 100644 (file)
@@ -33,6 +33,7 @@
 
 #include "gtest/gtest-death-test.h"
 #include "gtest/internal/gtest-port.h"
+#include "gtest/internal/custom/gtest.h"
 
 #if GTEST_HAS_DEATH_TEST
 
@@ -68,9 +69,9 @@
 
 // Indicates that this translation unit is part of Google Test's
 // implementation.  It must come before gtest-internal-inl.h is
-// included, or there will be a compiler error.  This trick is to
-// prevent a user from accidentally including gtest-internal-inl.h in
-// his code.
+// included, or there will be a compiler error.  This trick exists to
+// prevent the accidental inclusion of gtest-internal-inl.h in the
+// user's code.
 #define GTEST_IMPLEMENTATION_ 1
 #include "src/gtest-internal-inl.h"
 #undef GTEST_IMPLEMENTATION_
@@ -120,7 +121,9 @@ namespace internal {
 
 // Valid only for fast death tests. Indicates the code is running in the
 // child process of a fast style death test.
+# if !GTEST_OS_WINDOWS
 static bool g_in_fast_death_test_child = false;
+# endif
 
 // Returns a Boolean value indicating whether the caller is currently
 // executing in the context of the death test child process.  Tools such as
@@ -169,6 +172,14 @@ KilledBySignal::KilledBySignal(int signum) : signum_(signum) {
 
 // KilledBySignal function-call operator.
 bool KilledBySignal::operator()(int exit_status) const {
+#  if defined(GTEST_KILLED_BY_SIGNAL_OVERRIDE_)
+  {
+    bool result;
+    if (GTEST_KILLED_BY_SIGNAL_OVERRIDE_(signum_, exit_status, &result)) {
+      return result;
+    }
+  }
+#  endif  // defined(GTEST_KILLED_BY_SIGNAL_OVERRIDE_)
   return WIFSIGNALED(exit_status) && WTERMSIG(exit_status) == signum_;
 }
 # endif  // !GTEST_OS_WINDOWS
@@ -875,6 +886,11 @@ class ExecDeathTest : public ForkingDeathTest {
   static ::std::vector<testing::internal::string>
   GetArgvsForDeathTestChildProcess() {
     ::std::vector<testing::internal::string> args = GetInjectableArgvs();
+#  if defined(GTEST_EXTRA_DEATH_TEST_COMMAND_LINE_ARGS_)
+    ::std::vector<testing::internal::string> extra_args =
+        GTEST_EXTRA_DEATH_TEST_COMMAND_LINE_ARGS_();
+    args.insert(args.end(), extra_args.begin(), extra_args.end());
+#  endif  // defined(GTEST_EXTRA_DEATH_TEST_COMMAND_LINE_ARGS_)
     return args;
   }
   // The name of the file in which the death test is located.
@@ -985,6 +1001,8 @@ void StackLowerThanAddress(const void* ptr, bool* result) {
   *result = (&dummy < ptr);
 }
 
+// Make sure AddressSanitizer does not tamper with the stack here.
+GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
 bool StackGrowsDown() {
   int dummy;
   bool result;
@@ -1202,26 +1220,6 @@ bool DefaultDeathTestFactory::Create(const char* statement, const RE* regex,
   return true;
 }
 
-// Splits a given string on a given delimiter, populating a given
-// vector with the fields.  GTEST_HAS_DEATH_TEST implies that we have
-// ::std::string, so we can use it here.
-static void SplitString(const ::std::string& str, char delimiter,
-                        ::std::vector< ::std::string>* dest) {
-  ::std::vector< ::std::string> parsed;
-  ::std::string::size_type pos = 0;
-  while (::testing::internal::AlwaysTrue()) {
-    const ::std::string::size_type colon = str.find(delimiter, pos);
-    if (colon == ::std::string::npos) {
-      parsed.push_back(str.substr(pos));
-      break;
-    } else {
-      parsed.push_back(str.substr(pos, colon - pos));
-      pos = colon + 1;
-    }
-  }
-  dest->swap(parsed);
-}
-
 # if GTEST_OS_WINDOWS
 // Recreates the pipe and event handles from the provided parameters,
 // signals the event, and returns a file descriptor wrapped around the pipe
similarity index 96%
rename from src/external/gmock-1.7.0/gtest/src/gtest-filepath.cc
rename to src/external/googletest/googletest/src/gtest-filepath.cc
index 6be58b6fca2efebbcfc56f9d253e442cd863d868..0292dc11957eaa218b358f1f761ca4a5cb2faea7 100644 (file)
@@ -70,7 +70,6 @@ namespace internal {
 // of them.
 const char kPathSeparator = '\\';
 const char kAlternatePathSeparator = '/';
-const char kPathSeparatorString[] = "\\";
 const char kAlternatePathSeparatorString[] = "/";
 # if GTEST_OS_WINDOWS_MOBILE
 // Windows CE doesn't have a current directory. You should not use
@@ -84,7 +83,6 @@ const char kCurrentDirectoryString[] = ".\\";
 # endif  // GTEST_OS_WINDOWS_MOBILE
 #else
 const char kPathSeparator = '/';
-const char kPathSeparatorString[] = "/";
 const char kCurrentDirectoryString[] = "./";
 #endif  // GTEST_OS_WINDOWS
 
@@ -99,7 +97,7 @@ static bool IsPathSeparator(char c) {
 
 // Returns the current working directory, or "" if unsuccessful.
 FilePath FilePath::GetCurrentDir() {
-#if GTEST_OS_WINDOWS_MOBILE
+#if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_WINDOWS_PHONE || GTEST_OS_WINDOWS_RT
   // Windows CE doesn't have a current directory, so we just return
   // something reasonable.
   return FilePath(kCurrentDirectoryString);
@@ -108,7 +106,14 @@ FilePath FilePath::GetCurrentDir() {
   return FilePath(_getcwd(cwd, sizeof(cwd)) == NULL ? "" : cwd);
 #else
   char cwd[GTEST_PATH_MAX_ + 1] = { '\0' };
-  return FilePath(getcwd(cwd, sizeof(cwd)) == NULL ? "" : cwd);
+  char* result = getcwd(cwd, sizeof(cwd));
+# if GTEST_OS_NACL
+  // getcwd will likely fail in NaCl due to the sandbox, so return something
+  // reasonable. The user may have provided a shim implementation for getcwd,
+  // however, so fallback only when failure is detected.
+  return FilePath(result == NULL ? kCurrentDirectoryString : cwd);
+# endif  // GTEST_OS_NACL
+  return FilePath(result == NULL ? "" : cwd);
 #endif  // GTEST_OS_WINDOWS_MOBILE
 }
 
similarity index 97%
rename from src/external/gmock-1.7.0/gtest/src/gtest-internal-inl.h
rename to src/external/googletest/googletest/src/gtest-internal-inl.h
index 35df303cca645706aafa47b546d9c4d3a75495a0..ed8a682a964f070ca06a9d8e9a77ea568db0fd3a 100644 (file)
@@ -40,7 +40,7 @@
 // GTEST_IMPLEMENTATION_ is defined to 1 iff the current translation unit is
 // part of Google Test's implementation; otherwise it's undefined.
 #if !GTEST_IMPLEMENTATION_
-// A user is trying to include this from his code - just say no.
+// If this file is included from the user's code, just say no.
 # error "gtest-internal-inl.h is part of Google Test's internal implementation."
 # error "It must not be included except by Google Test itself."
 #endif  // GTEST_IMPLEMENTATION_
@@ -100,6 +100,7 @@ const char kShuffleFlag[] = "shuffle";
 const char kStackTraceDepthFlag[] = "stack_trace_depth";
 const char kStreamResultToFlag[] = "stream_result_to";
 const char kThrowOnFailureFlag[] = "throw_on_failure";
+const char kFlagfileFlag[] = "flagfile";
 
 // A valid random seed must be in [1, kMaxRandomSeed].
 const int kMaxRandomSeed = 99999;
@@ -432,6 +433,10 @@ class OsStackTraceGetterInterface {
   // CurrentStackTrace() will use to find and hide Google Test stack frames.
   virtual void UponLeavingGTest() = 0;
 
+  // This string is inserted in place of stack frames that are part of
+  // Google Test's implementation.
+  static const char* const kElidedFramesMarker;
+
  private:
   GTEST_DISALLOW_COPY_AND_ASSIGN_(OsStackTraceGetterInterface);
 };
@@ -439,26 +444,12 @@ class OsStackTraceGetterInterface {
 // A working implementation of the OsStackTraceGetterInterface interface.
 class OsStackTraceGetter : public OsStackTraceGetterInterface {
  public:
-  OsStackTraceGetter() : caller_frame_(NULL) {}
-
-  virtual string CurrentStackTrace(int max_depth, int skip_count)
-      GTEST_LOCK_EXCLUDED_(mutex_);
+  OsStackTraceGetter() {}
 
-  virtual void UponLeavingGTest() GTEST_LOCK_EXCLUDED_(mutex_);
-
-  // This string is inserted in place of stack frames that are part of
-  // Google Test's implementation.
-  static const char* const kElidedFramesMarker;
+  virtual string CurrentStackTrace(int max_depth, int skip_count);
+  virtual void UponLeavingGTest();
 
  private:
-  Mutex mutex_;  // protects all internal state
-
-  // We save the stack frame below the frame that calls user code.
-  // We do this because the address of the frame immediately below
-  // the user code changes between the call to UponLeavingGTest()
-  // and any calls to CurrentStackTrace() from within the user code.
-  void* caller_frame_;
-
   GTEST_DISALLOW_COPY_AND_ASSIGN_(OsStackTraceGetter);
 };
 
@@ -968,32 +959,6 @@ GTEST_API_ void ParseGoogleTestFlagsOnly(int* argc, wchar_t** argv);
 // platform.
 GTEST_API_ std::string GetLastErrnoDescription();
 
-# if GTEST_OS_WINDOWS
-// Provides leak-safe Windows kernel handle ownership.
-class AutoHandle {
- public:
-  AutoHandle() : handle_(INVALID_HANDLE_VALUE) {}
-  explicit AutoHandle(HANDLE handle) : handle_(handle) {}
-
-  ~AutoHandle() { Reset(); }
-
-  HANDLE Get() const { return handle_; }
-  void Reset() { Reset(INVALID_HANDLE_VALUE); }
-  void Reset(HANDLE handle) {
-    if (handle != handle_) {
-      if (handle_ != INVALID_HANDLE_VALUE)
-        ::CloseHandle(handle_);
-      handle_ = handle;
-    }
-  }
-
- private:
-  HANDLE handle_;
-
-  GTEST_DISALLOW_COPY_AND_ASSIGN_(AutoHandle);
-};
-# endif  // GTEST_OS_WINDOWS
-
 // Attempts to parse a string into a positive integer pointed to by the
 // number parameter.  Returns true if that is possible.
 // GTEST_HAS_DEATH_TEST implies that we have ::std::string, so we can use
@@ -1067,7 +1032,7 @@ class TestResultAccessor {
 #if GTEST_CAN_STREAM_RESULTS_
 
 // Streams test results to the given port on the given host machine.
-class StreamingListener : public EmptyTestEventListener {
+class GTEST_API_ StreamingListener : public EmptyTestEventListener {
  public:
   // Abstract base class for writing strings to a socket.
   class AbstractSocketWriter {
similarity index 61%
rename from src/external/gmock-1.7.0/gtest/src/gtest-port.cc
rename to src/external/googletest/googletest/src/gtest-port.cc
index 0c4df5f29a751f2ec02a44c955a0ae0b2157d0ee..e5bf3dd2be4be336176feb5d14d70d9526b28c7d 100644 (file)
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
+#include <fstream>
 
-#if GTEST_OS_WINDOWS_MOBILE
-# include <windows.h>  // For TerminateProcess()
-#elif GTEST_OS_WINDOWS
+#if GTEST_OS_WINDOWS
+# include <windows.h>
 # include <io.h>
 # include <sys/stat.h>
+# include <map>  // Used in ThreadLocal.
 #else
 # include <unistd.h>
-#endif  // GTEST_OS_WINDOWS_MOBILE
+#endif  // GTEST_OS_WINDOWS
 
 #if GTEST_OS_MAC
 # include <mach/mach_init.h>
 
 #if GTEST_OS_QNX
 # include <devctl.h>
+# include <fcntl.h>
 # include <sys/procfs.h>
 #endif  // GTEST_OS_QNX
 
+#if GTEST_OS_AIX
+# include <procinfo.h>
+# include <sys/types.h>
+#endif  // GTEST_OS_AIX
+
 #include "gtest/gtest-spi.h"
 #include "gtest/gtest-message.h"
 #include "gtest/internal/gtest-internal.h"
@@ -63,9 +70,9 @@
 
 // Indicates that this translation unit is part of Google Test's
 // implementation.  It must come before gtest-internal-inl.h is
-// included, or there will be a compiler error.  This trick is to
-// prevent a user from accidentally including gtest-internal-inl.h in
-// his code.
+// included, or there will be a compiler error.  This trick exists to
+// prevent the accidental inclusion of gtest-internal-inl.h in the
+// user's code.
 #define GTEST_IMPLEMENTATION_ 1
 #include "src/gtest-internal-inl.h"
 #undef GTEST_IMPLEMENTATION_
@@ -82,10 +89,31 @@ const int kStdOutFileno = STDOUT_FILENO;
 const int kStdErrFileno = STDERR_FILENO;
 #endif  // _MSC_VER
 
-#if GTEST_OS_MAC
+#if GTEST_OS_LINUX
+
+namespace {
+template <typename T>
+T ReadProcFileField(const string& filename, int field) {
+  std::string dummy;
+  std::ifstream file(filename.c_str());
+  while (field-- > 0) {
+    file >> dummy;
+  }
+  T output = 0;
+  file >> output;
+  return output;
+}
+}  // namespace
+
+// Returns the number of active threads, or 0 when there is an error.
+size_t GetThreadCount() {
+  const string filename =
+      (Message() << "/proc/" << getpid() << "/stat").GetString();
+  return ReadProcFileField<int>(filename, 19);
+}
+
+#elif GTEST_OS_MAC
 
-// Returns the number of threads running in the process, or 0 to indicate that
-// we cannot detect it.
 size_t GetThreadCount() {
   const task_t task = mach_task_self();
   mach_msg_type_number_t thread_count;
@@ -123,6 +151,19 @@ size_t GetThreadCount() {
   }
 }
 
+#elif GTEST_OS_AIX
+
+size_t GetThreadCount() {
+  struct procentry64 entry;
+  pid_t pid = getpid();
+  int status = getprocs64(&entry, sizeof(entry), NULL, 0, &pid, 1);
+  if (status == 1) {
+    return entry.pi_thcount;
+  } else {
+    return 0;
+  }
+}
+
 #else
 
 size_t GetThreadCount() {
@@ -131,7 +172,390 @@ size_t GetThreadCount() {
   return 0;
 }
 
-#endif  // GTEST_OS_MAC
+#endif  // GTEST_OS_LINUX
+
+#if GTEST_IS_THREADSAFE && GTEST_OS_WINDOWS
+
+void SleepMilliseconds(int n) {
+  ::Sleep(n);
+}
+
+AutoHandle::AutoHandle()
+    : handle_(INVALID_HANDLE_VALUE) {}
+
+AutoHandle::AutoHandle(Handle handle)
+    : handle_(handle) {}
+
+AutoHandle::~AutoHandle() {
+  Reset();
+}
+
+AutoHandle::Handle AutoHandle::Get() const {
+  return handle_;
+}
+
+void AutoHandle::Reset() {
+  Reset(INVALID_HANDLE_VALUE);
+}
+
+void AutoHandle::Reset(HANDLE handle) {
+  // Resetting with the same handle we already own is invalid.
+  if (handle_ != handle) {
+    if (IsCloseable()) {
+      ::CloseHandle(handle_);
+    }
+    handle_ = handle;
+  } else {
+    GTEST_CHECK_(!IsCloseable())
+        << "Resetting a valid handle to itself is likely a programmer error "
+            "and thus not allowed.";
+  }
+}
+
+bool AutoHandle::IsCloseable() const {
+  // Different Windows APIs may use either of these values to represent an
+  // invalid handle.
+  return handle_ != NULL && handle_ != INVALID_HANDLE_VALUE;
+}
+
+Notification::Notification()
+    : event_(::CreateEvent(NULL,   // Default security attributes.
+                           TRUE,   // Do not reset automatically.
+                           FALSE,  // Initially unset.
+                           NULL)) {  // Anonymous event.
+  GTEST_CHECK_(event_.Get() != NULL);
+}
+
+void Notification::Notify() {
+  GTEST_CHECK_(::SetEvent(event_.Get()) != FALSE);
+}
+
+void Notification::WaitForNotification() {
+  GTEST_CHECK_(
+      ::WaitForSingleObject(event_.Get(), INFINITE) == WAIT_OBJECT_0);
+}
+
+Mutex::Mutex()
+    : owner_thread_id_(0),
+      type_(kDynamic),
+      critical_section_init_phase_(0),
+      critical_section_(new CRITICAL_SECTION) {
+  ::InitializeCriticalSection(critical_section_);
+}
+
+Mutex::~Mutex() {
+  // Static mutexes are leaked intentionally. It is not thread-safe to try
+  // to clean them up.
+  // TODO(yukawa): Switch to Slim Reader/Writer (SRW) Locks, which requires
+  // nothing to clean it up but is available only on Vista and later.
+  // http://msdn.microsoft.com/en-us/library/windows/desktop/aa904937.aspx
+  if (type_ == kDynamic) {
+    ::DeleteCriticalSection(critical_section_);
+    delete critical_section_;
+    critical_section_ = NULL;
+  }
+}
+
+void Mutex::Lock() {
+  ThreadSafeLazyInit();
+  ::EnterCriticalSection(critical_section_);
+  owner_thread_id_ = ::GetCurrentThreadId();
+}
+
+void Mutex::Unlock() {
+  ThreadSafeLazyInit();
+  // We don't protect writing to owner_thread_id_ here, as it's the
+  // caller's responsibility to ensure that the current thread holds the
+  // mutex when this is called.
+  owner_thread_id_ = 0;
+  ::LeaveCriticalSection(critical_section_);
+}
+
+// Does nothing if the current thread holds the mutex. Otherwise, crashes
+// with high probability.
+void Mutex::AssertHeld() {
+  ThreadSafeLazyInit();
+  GTEST_CHECK_(owner_thread_id_ == ::GetCurrentThreadId())
+      << "The current thread is not holding the mutex @" << this;
+}
+
+// Initializes owner_thread_id_ and critical_section_ in static mutexes.
+void Mutex::ThreadSafeLazyInit() {
+  // Dynamic mutexes are initialized in the constructor.
+  if (type_ == kStatic) {
+    switch (
+        ::InterlockedCompareExchange(&critical_section_init_phase_, 1L, 0L)) {
+      case 0:
+        // If critical_section_init_phase_ was 0 before the exchange, we
+        // are the first to test it and need to perform the initialization.
+        owner_thread_id_ = 0;
+        critical_section_ = new CRITICAL_SECTION;
+        ::InitializeCriticalSection(critical_section_);
+        // Updates the critical_section_init_phase_ to 2 to signal
+        // initialization complete.
+        GTEST_CHECK_(::InterlockedCompareExchange(
+                          &critical_section_init_phase_, 2L, 1L) ==
+                      1L);
+        break;
+      case 1:
+        // Somebody else is already initializing the mutex; spin until they
+        // are done.
+        while (::InterlockedCompareExchange(&critical_section_init_phase_,
+                                            2L,
+                                            2L) != 2L) {
+          // Possibly yields the rest of the thread's time slice to other
+          // threads.
+          ::Sleep(0);
+        }
+        break;
+
+      case 2:
+        break;  // The mutex is already initialized and ready for use.
+
+      default:
+        GTEST_CHECK_(false)
+            << "Unexpected value of critical_section_init_phase_ "
+            << "while initializing a static mutex.";
+    }
+  }
+}
+
+namespace {
+
+class ThreadWithParamSupport : public ThreadWithParamBase {
+ public:
+  static HANDLE CreateThread(Runnable* runnable,
+                             Notification* thread_can_start) {
+    ThreadMainParam* param = new ThreadMainParam(runnable, thread_can_start);
+    DWORD thread_id;
+    // TODO(yukawa): Consider to use _beginthreadex instead.
+    HANDLE thread_handle = ::CreateThread(
+        NULL,    // Default security.
+        0,       // Default stack size.
+        &ThreadWithParamSupport::ThreadMain,
+        param,   // Parameter to ThreadMainStatic
+        0x0,     // Default creation flags.
+        &thread_id);  // Need a valid pointer for the call to work under Win98.
+    GTEST_CHECK_(thread_handle != NULL) << "CreateThread failed with error "
+                                        << ::GetLastError() << ".";
+    if (thread_handle == NULL) {
+      delete param;
+    }
+    return thread_handle;
+  }
+
+ private:
+  struct ThreadMainParam {
+    ThreadMainParam(Runnable* runnable, Notification* thread_can_start)
+        : runnable_(runnable),
+          thread_can_start_(thread_can_start) {
+    }
+    scoped_ptr<Runnable> runnable_;
+    // Does not own.
+    Notification* thread_can_start_;
+  };
+
+  static DWORD WINAPI ThreadMain(void* ptr) {
+    // Transfers ownership.
+    scoped_ptr<ThreadMainParam> param(static_cast<ThreadMainParam*>(ptr));
+    if (param->thread_can_start_ != NULL)
+      param->thread_can_start_->WaitForNotification();
+    param->runnable_->Run();
+    return 0;
+  }
+
+  // Prohibit instantiation.
+  ThreadWithParamSupport();
+
+  GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParamSupport);
+};
+
+}  // namespace
+
+ThreadWithParamBase::ThreadWithParamBase(Runnable *runnable,
+                                         Notification* thread_can_start)
+      : thread_(ThreadWithParamSupport::CreateThread(runnable,
+                                                     thread_can_start)) {
+}
+
+ThreadWithParamBase::~ThreadWithParamBase() {
+  Join();
+}
+
+void ThreadWithParamBase::Join() {
+  GTEST_CHECK_(::WaitForSingleObject(thread_.Get(), INFINITE) == WAIT_OBJECT_0)
+      << "Failed to join the thread with error " << ::GetLastError() << ".";
+}
+
+// Maps a thread to a set of ThreadIdToThreadLocals that have values
+// instantiated on that thread and notifies them when the thread exits.  A
+// ThreadLocal instance is expected to persist until all threads it has
+// values on have terminated.
+class ThreadLocalRegistryImpl {
+ public:
+  // Registers thread_local_instance as having value on the current thread.
+  // Returns a value that can be used to identify the thread from other threads.
+  static ThreadLocalValueHolderBase* GetValueOnCurrentThread(
+      const ThreadLocalBase* thread_local_instance) {
+    DWORD current_thread = ::GetCurrentThreadId();
+    MutexLock lock(&mutex_);
+    ThreadIdToThreadLocals* const thread_to_thread_locals =
+        GetThreadLocalsMapLocked();
+    ThreadIdToThreadLocals::iterator thread_local_pos =
+        thread_to_thread_locals->find(current_thread);
+    if (thread_local_pos == thread_to_thread_locals->end()) {
+      thread_local_pos = thread_to_thread_locals->insert(
+          std::make_pair(current_thread, ThreadLocalValues())).first;
+      StartWatcherThreadFor(current_thread);
+    }
+    ThreadLocalValues& thread_local_values = thread_local_pos->second;
+    ThreadLocalValues::iterator value_pos =
+        thread_local_values.find(thread_local_instance);
+    if (value_pos == thread_local_values.end()) {
+      value_pos =
+          thread_local_values
+              .insert(std::make_pair(
+                  thread_local_instance,
+                  linked_ptr<ThreadLocalValueHolderBase>(
+                      thread_local_instance->NewValueForCurrentThread())))
+              .first;
+    }
+    return value_pos->second.get();
+  }
+
+  static void OnThreadLocalDestroyed(
+      const ThreadLocalBase* thread_local_instance) {
+    std::vector<linked_ptr<ThreadLocalValueHolderBase> > value_holders;
+    // Clean up the ThreadLocalValues data structure while holding the lock, but
+    // defer the destruction of the ThreadLocalValueHolderBases.
+    {
+      MutexLock lock(&mutex_);
+      ThreadIdToThreadLocals* const thread_to_thread_locals =
+          GetThreadLocalsMapLocked();
+      for (ThreadIdToThreadLocals::iterator it =
+          thread_to_thread_locals->begin();
+          it != thread_to_thread_locals->end();
+          ++it) {
+        ThreadLocalValues& thread_local_values = it->second;
+        ThreadLocalValues::iterator value_pos =
+            thread_local_values.find(thread_local_instance);
+        if (value_pos != thread_local_values.end()) {
+          value_holders.push_back(value_pos->second);
+          thread_local_values.erase(value_pos);
+          // This 'if' can only be successful at most once, so theoretically we
+          // could break out of the loop here, but we don't bother doing so.
+        }
+      }
+    }
+    // Outside the lock, let the destructor for 'value_holders' deallocate the
+    // ThreadLocalValueHolderBases.
+  }
+
+  static void OnThreadExit(DWORD thread_id) {
+    GTEST_CHECK_(thread_id != 0) << ::GetLastError();
+    std::vector<linked_ptr<ThreadLocalValueHolderBase> > value_holders;
+    // Clean up the ThreadIdToThreadLocals data structure while holding the
+    // lock, but defer the destruction of the ThreadLocalValueHolderBases.
+    {
+      MutexLock lock(&mutex_);
+      ThreadIdToThreadLocals* const thread_to_thread_locals =
+          GetThreadLocalsMapLocked();
+      ThreadIdToThreadLocals::iterator thread_local_pos =
+          thread_to_thread_locals->find(thread_id);
+      if (thread_local_pos != thread_to_thread_locals->end()) {
+        ThreadLocalValues& thread_local_values = thread_local_pos->second;
+        for (ThreadLocalValues::iterator value_pos =
+            thread_local_values.begin();
+            value_pos != thread_local_values.end();
+            ++value_pos) {
+          value_holders.push_back(value_pos->second);
+        }
+        thread_to_thread_locals->erase(thread_local_pos);
+      }
+    }
+    // Outside the lock, let the destructor for 'value_holders' deallocate the
+    // ThreadLocalValueHolderBases.
+  }
+
+ private:
+  // In a particular thread, maps a ThreadLocal object to its value.
+  typedef std::map<const ThreadLocalBase*,
+                   linked_ptr<ThreadLocalValueHolderBase> > ThreadLocalValues;
+  // Stores all ThreadIdToThreadLocals having values in a thread, indexed by
+  // thread's ID.
+  typedef std::map<DWORD, ThreadLocalValues> ThreadIdToThreadLocals;
+
+  // Holds the thread id and thread handle that we pass from
+  // StartWatcherThreadFor to WatcherThreadFunc.
+  typedef std::pair<DWORD, HANDLE> ThreadIdAndHandle;
+
+  static void StartWatcherThreadFor(DWORD thread_id) {
+    // The returned handle will be kept in thread_map and closed by
+    // watcher_thread in WatcherThreadFunc.
+    HANDLE thread = ::OpenThread(SYNCHRONIZE | THREAD_QUERY_INFORMATION,
+                                 FALSE,
+                                 thread_id);
+    GTEST_CHECK_(thread != NULL);
+    // We need to to pass a valid thread ID pointer into CreateThread for it
+    // to work correctly under Win98.
+    DWORD watcher_thread_id;
+    HANDLE watcher_thread = ::CreateThread(
+        NULL,   // Default security.
+        0,      // Default stack size
+        &ThreadLocalRegistryImpl::WatcherThreadFunc,
+        reinterpret_cast<LPVOID>(new ThreadIdAndHandle(thread_id, thread)),
+        CREATE_SUSPENDED,
+        &watcher_thread_id);
+    GTEST_CHECK_(watcher_thread != NULL);
+    // Give the watcher thread the same priority as ours to avoid being
+    // blocked by it.
+    ::SetThreadPriority(watcher_thread,
+                        ::GetThreadPriority(::GetCurrentThread()));
+    ::ResumeThread(watcher_thread);
+    ::CloseHandle(watcher_thread);
+  }
+
+  // Monitors exit from a given thread and notifies those
+  // ThreadIdToThreadLocals about thread termination.
+  static DWORD WINAPI WatcherThreadFunc(LPVOID param) {
+    const ThreadIdAndHandle* tah =
+        reinterpret_cast<const ThreadIdAndHandle*>(param);
+    GTEST_CHECK_(
+        ::WaitForSingleObject(tah->second, INFINITE) == WAIT_OBJECT_0);
+    OnThreadExit(tah->first);
+    ::CloseHandle(tah->second);
+    delete tah;
+    return 0;
+  }
+
+  // Returns map of thread local instances.
+  static ThreadIdToThreadLocals* GetThreadLocalsMapLocked() {
+    mutex_.AssertHeld();
+    static ThreadIdToThreadLocals* map = new ThreadIdToThreadLocals;
+    return map;
+  }
+
+  // Protects access to GetThreadLocalsMapLocked() and its return value.
+  static Mutex mutex_;
+  // Protects access to GetThreadMapLocked() and its return value.
+  static Mutex thread_map_mutex_;
+};
+
+Mutex ThreadLocalRegistryImpl::mutex_(Mutex::kStaticMutex);
+Mutex ThreadLocalRegistryImpl::thread_map_mutex_(Mutex::kStaticMutex);
+
+ThreadLocalValueHolderBase* ThreadLocalRegistry::GetValueOnCurrentThread(
+      const ThreadLocalBase* thread_local_instance) {
+  return ThreadLocalRegistryImpl::GetValueOnCurrentThread(
+      thread_local_instance);
+}
+
+void ThreadLocalRegistry::OnThreadLocalDestroyed(
+      const ThreadLocalBase* thread_local_instance) {
+  ThreadLocalRegistryImpl::OnThreadLocalDestroyed(thread_local_instance);
+}
+
+#endif  // GTEST_IS_THREADSAFE && GTEST_OS_WINDOWS
 
 #if GTEST_USES_POSIX_RE
 
@@ -481,7 +905,6 @@ GTEST_API_ ::std::string FormatCompilerIndependentFileLocation(
     return file_name + ":" + StreamableToString(line);
 }
 
-
 GTestLog::GTestLog(GTestLogSeverity severity, const char* file, int line)
     : severity_(severity) {
   const char* const marker =
@@ -502,10 +925,7 @@ GTestLog::~GTestLog() {
 }
 // Disable Microsoft deprecation warnings for POSIX functions called from
 // this class (creat, dup, dup2, and close)
-#ifdef _MSC_VER
-# pragma warning(push)
-# pragma warning(disable: 4996)
-#endif  // _MSC_VER
+GTEST_DISABLE_MSC_WARNINGS_PUSH_(4996)
 
 #if GTEST_HAS_STREAM_REDIRECTION
 
@@ -581,12 +1001,6 @@ class CapturedStream {
   }
 
  private:
-  // Reads the entire content of a file as an std::string.
-  static std::string ReadEntireFile(FILE* file);
-
-  // Returns the size (in bytes) of a file.
-  static size_t GetFileSize(FILE* file);
-
   const int fd_;  // A stream to capture.
   int uncaptured_fd_;
   // Name of the temporary file holding the stderr output.
@@ -595,38 +1009,7 @@ class CapturedStream {
   GTEST_DISALLOW_COPY_AND_ASSIGN_(CapturedStream);
 };
 
-// Returns the size (in bytes) of a file.
-size_t CapturedStream::GetFileSize(FILE* file) {
-  fseek(file, 0, SEEK_END);
-  return static_cast<size_t>(ftell(file));
-}
-
-// Reads the entire content of a file as a string.
-std::string CapturedStream::ReadEntireFile(FILE* file) {
-  const size_t file_size = GetFileSize(file);
-  char* const buffer = new char[file_size];
-
-  size_t bytes_last_read = 0;  // # of bytes read in the last fread()
-  size_t bytes_read = 0;       // # of bytes read so far
-
-  fseek(file, 0, SEEK_SET);
-
-  // Keeps reading the file until we cannot read further or the
-  // pre-determined file size is reached.
-  do {
-    bytes_last_read = fread(buffer+bytes_read, 1, file_size-bytes_read, file);
-    bytes_read += bytes_last_read;
-  } while (bytes_last_read > 0 && bytes_read < file_size);
-
-  const std::string content(buffer, bytes_read);
-  delete[] buffer;
-
-  return content;
-}
-
-# ifdef _MSC_VER
-#  pragma warning(pop)
-# endif  // _MSC_VER
+GTEST_DISABLE_MSC_WARNINGS_POP_()
 
 static CapturedStream* g_captured_stderr = NULL;
 static CapturedStream* g_captured_stdout = NULL;
@@ -672,10 +1055,52 @@ std::string GetCapturedStderr() {
 
 #endif  // GTEST_HAS_STREAM_REDIRECTION
 
-#if GTEST_HAS_DEATH_TEST
+std::string TempDir() {
+#if GTEST_OS_WINDOWS_MOBILE
+  return "\\temp\\";
+#elif GTEST_OS_WINDOWS
+  const char* temp_dir = posix::GetEnv("TEMP");
+  if (temp_dir == NULL || temp_dir[0] == '\0')
+    return "\\temp\\";
+  else if (temp_dir[strlen(temp_dir) - 1] == '\\')
+    return temp_dir;
+  else
+    return std::string(temp_dir) + "\\";
+#elif GTEST_OS_LINUX_ANDROID
+  return "/sdcard/";
+#else
+  return "/tmp/";
+#endif  // GTEST_OS_WINDOWS_MOBILE
+}
+
+size_t GetFileSize(FILE* file) {
+  fseek(file, 0, SEEK_END);
+  return static_cast<size_t>(ftell(file));
+}
+
+std::string ReadEntireFile(FILE* file) {
+  const size_t file_size = GetFileSize(file);
+  char* const buffer = new char[file_size];
+
+  size_t bytes_last_read = 0;  // # of bytes read in the last fread()
+  size_t bytes_read = 0;       // # of bytes read so far
+
+  fseek(file, 0, SEEK_SET);
+
+  // Keeps reading the file until we cannot read further or the
+  // pre-determined file size is reached.
+  do {
+    bytes_last_read = fread(buffer+bytes_read, 1, file_size-bytes_read, file);
+    bytes_read += bytes_last_read;
+  } while (bytes_last_read > 0 && bytes_read < file_size);
+
+  const std::string content(buffer, bytes_read);
+  delete[] buffer;
+
+  return content;
+}
 
-// A copy of all command line arguments.  Set by InitGoogleTest().
-::std::vector<testing::internal::string> g_argvs;
+#if GTEST_HAS_DEATH_TEST
 
 static const ::std::vector<testing::internal::string>* g_injected_test_argvs =
                                         NULL;  // Owned.
@@ -690,7 +1115,7 @@ const ::std::vector<testing::internal::string>& GetInjectableArgvs() {
   if (g_injected_test_argvs != NULL) {
     return *g_injected_test_argvs;
   }
-  return g_argvs;
+  return GetArgvs();
 }
 #endif  // GTEST_HAS_DEATH_TEST
 
@@ -764,6 +1189,9 @@ bool ParseInt32(const Message& src_text, const char* str, Int32* value) {
 //
 // The value is considered true iff it's not "0".
 bool BoolFromGTestEnv(const char* flag, bool default_value) {
+#if defined(GTEST_GET_BOOL_FROM_ENV_)
+  return GTEST_GET_BOOL_FROM_ENV_(flag, default_value);
+#endif  // defined(GTEST_GET_BOOL_FROM_ENV_)
   const std::string env_var = FlagToEnvVar(flag);
   const char* const string_value = posix::GetEnv(env_var.c_str());
   return string_value == NULL ?
@@ -774,6 +1202,9 @@ bool BoolFromGTestEnv(const char* flag, bool default_value) {
 // variable corresponding to the given flag; if it isn't set or
 // doesn't represent a valid 32-bit integer, returns default_value.
 Int32 Int32FromGTestEnv(const char* flag, Int32 default_value) {
+#if defined(GTEST_GET_INT32_FROM_ENV_)
+  return GTEST_GET_INT32_FROM_ENV_(flag, default_value);
+#endif  // defined(GTEST_GET_INT32_FROM_ENV_)
   const std::string env_var = FlagToEnvVar(flag);
   const char* const string_value = posix::GetEnv(env_var.c_str());
   if (string_value == NULL) {
@@ -795,10 +1226,33 @@ Int32 Int32FromGTestEnv(const char* flag, Int32 default_value) {
 
 // Reads and returns the string environment variable corresponding to
 // the given flag; if it's not set, returns default_value.
-const char* StringFromGTestEnv(const char* flag, const char* default_value) {
+std::string StringFromGTestEnv(const char* flag, const char* default_value) {
+#if defined(GTEST_GET_STRING_FROM_ENV_)
+  return GTEST_GET_STRING_FROM_ENV_(flag, default_value);
+#endif  // defined(GTEST_GET_STRING_FROM_ENV_)
   const std::string env_var = FlagToEnvVar(flag);
-  const char* const value = posix::GetEnv(env_var.c_str());
-  return value == NULL ? default_value : value;
+  const char* value = posix::GetEnv(env_var.c_str());
+  if (value != NULL) {
+    return value;
+  }
+
+  // As a special case for the 'output' flag, if GTEST_OUTPUT is not
+  // set, we look for XML_OUTPUT_FILE, which is set by the Bazel build
+  // system.  The value of XML_OUTPUT_FILE is a filename without the
+  // "xml:" prefix of GTEST_OUTPUT.
+  //
+  // The net priority order after flag processing is thus:
+  //   --gtest_output command line flag
+  //   GTEST_OUTPUT environment variable
+  //   XML_OUTPUT_FILE environment variable
+  //   'default_value'
+  if (strcmp(flag, "output") == 0) {
+    value = posix::GetEnv("XML_OUTPUT_FILE");
+    if (value != NULL) {
+      return std::string("xml:") + value;
+    }
+  }
+  return default_value;
 }
 
 }  // namespace internal
similarity index 96%
rename from src/external/gmock-1.7.0/gtest/src/gtest-printers.cc
rename to src/external/googletest/googletest/src/gtest-printers.cc
index 75fa40810097e72a9c3f4f2c883a8d8bbdd66ea0..a2df412f8a20459043cdb70e5b095a72b7a1394a 100644 (file)
@@ -45,6 +45,7 @@
 #include "gtest/gtest-printers.h"
 #include <ctype.h>
 #include <stdio.h>
+#include <cwchar>
 #include <ostream>  // NOLINT
 #include <string>
 #include "gtest/internal/gtest-port.h"
@@ -56,6 +57,9 @@ namespace {
 using ::std::ostream;
 
 // Prints a segment of bytes in the given object.
+GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_
+GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
+GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_
 void PrintByteSegmentInObjectTo(const unsigned char* obj_bytes, size_t start,
                                 size_t count, ostream* os) {
   char text[5] = "";
@@ -252,6 +256,9 @@ void PrintTo(wchar_t wc, ostream* os) {
 // The array starts at begin, the length is len, it may include '\0' characters
 // and may not be NUL-terminated.
 template <typename CharType>
+GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_
+GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
+GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_
 static void PrintCharsAsStringTo(
     const CharType* begin, size_t len, ostream* os) {
   const char* const kQuoteBegin = sizeof(CharType) == 1 ? "\"" : "L\"";
@@ -273,6 +280,9 @@ static void PrintCharsAsStringTo(
 // Prints a (const) char/wchar_t array of 'len' elements, starting at address
 // 'begin'.  CharType must be either char or wchar_t.
 template <typename CharType>
+GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_
+GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
+GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_
 static void UniversalPrintCharArray(
     const CharType* begin, size_t len, ostream* os) {
   // The code
@@ -329,7 +339,7 @@ void PrintTo(const wchar_t* s, ostream* os) {
     *os << "NULL";
   } else {
     *os << ImplicitCast_<const void*>(s) << " pointing to ";
-    PrintCharsAsStringTo(s, wcslen(s), os);
+    PrintCharsAsStringTo(s, std::wcslen(s), os);
   }
 }
 #endif  // wchar_t is native
similarity index 96%
rename from src/external/gmock-1.7.0/gtest/src/gtest-test-part.cc
rename to src/external/googletest/googletest/src/gtest-test-part.cc
index c60eef3ab353114a9b3f7283815762bb58832766..fb0e35425e1e6f7179d02b93945bdee431b25e4e 100644 (file)
@@ -35,9 +35,9 @@
 
 // Indicates that this translation unit is part of Google Test's
 // implementation.  It must come before gtest-internal-inl.h is
-// included, or there will be a compiler error.  This trick is to
-// prevent a user from accidentally including gtest-internal-inl.h in
-// his code.
+// included, or there will be a compiler error.  This trick exists to
+// prevent the accidental inclusion of gtest-internal-inl.h in the
+// user's code.
 #define GTEST_IMPLEMENTATION_ 1
 #include "src/gtest-internal-inl.h"
 #undef GTEST_IMPLEMENTATION_
similarity index 74%
rename from src/external/gmock-1.7.0/gtest/src/gtest-typed-test.cc
rename to src/external/googletest/googletest/src/gtest-typed-test.cc
index f0079f407c5feffcad938d207a11ad90628bce7a..df1eef4754efeb6bc066239b1ccc3bfeeb896310 100644 (file)
@@ -45,33 +45,41 @@ static const char* SkipSpaces(const char* str) {
   return str;
 }
 
+static std::vector<std::string> SplitIntoTestNames(const char* src) {
+  std::vector<std::string> name_vec;
+  src = SkipSpaces(src);
+  for (; src != NULL; src = SkipComma(src)) {
+    name_vec.push_back(StripTrailingSpaces(GetPrefixUntilComma(src)));
+  }
+  return name_vec;
+}
+
 // Verifies that registered_tests match the test names in
-// defined_test_names_; returns registered_tests if successful, or
+// registered_tests_; returns registered_tests if successful, or
 // aborts the program otherwise.
 const char* TypedTestCasePState::VerifyRegisteredTestNames(
     const char* file, int line, const char* registered_tests) {
-  typedef ::std::set<const char*>::const_iterator DefinedTestIter;
+  typedef RegisteredTestsMap::const_iterator RegisteredTestIter;
   registered_ = true;
 
-  // Skip initial whitespace in registered_tests since some
-  // preprocessors prefix stringizied literals with whitespace.
-  registered_tests = SkipSpaces(registered_tests);
+  std::vector<std::string> name_vec = SplitIntoTestNames(registered_tests);
 
   Message errors;
-  ::std::set<std::string> tests;
-  for (const char* names = registered_tests; names != NULL;
-       names = SkipComma(names)) {
-    const std::string name = GetPrefixUntilComma(names);
+
+  std::set<std::string> tests;
+  for (std::vector<std::string>::const_iterator name_it = name_vec.begin();
+       name_it != name_vec.end(); ++name_it) {
+    const std::string& name = *name_it;
     if (tests.count(name) != 0) {
       errors << "Test " << name << " is listed more than once.\n";
       continue;
     }
 
     bool found = false;
-    for (DefinedTestIter it = defined_test_names_.begin();
-         it != defined_test_names_.end();
+    for (RegisteredTestIter it = registered_tests_.begin();
+         it != registered_tests_.end();
          ++it) {
-      if (name == *it) {
+      if (name == it->first) {
         found = true;
         break;
       }
@@ -85,11 +93,11 @@ const char* TypedTestCasePState::VerifyRegisteredTestNames(
     }
   }
 
-  for (DefinedTestIter it = defined_test_names_.begin();
-       it != defined_test_names_.end();
+  for (RegisteredTestIter it = registered_tests_.begin();
+       it != registered_tests_.end();
        ++it) {
-    if (tests.count(*it) == 0) {
-      errors << "You forgot to list test " << *it << ".\n";
+    if (tests.count(it->first) == 0) {
+      errors << "You forgot to list test " << it->first << ".\n";
     }
   }
 
similarity index 89%
rename from src/external/gmock-1.7.0/gtest/src/gtest.cc
rename to src/external/googletest/googletest/src/gtest.cc
index 211174deb59a6a63d7a00b748d266007c7e8ca95..184ff6f22ffbe804ea0844773e59984537e71a54 100644 (file)
@@ -32,6 +32,7 @@
 // The Google C++ Testing Framework (Google Test)
 
 #include "gtest/gtest.h"
+#include "gtest/internal/custom/gtest.h"
 #include "gtest/gtest-spi.h"
 
 #include <ctype.h>
@@ -46,6 +47,8 @@
 #include <cmath>
 #include <iomanip>
 #include <limits>
+#include <list>
+#include <map>
 #include <ostream>  // NOLINT
 #include <sstream>
 #include <vector>
@@ -80,6 +83,7 @@
 #elif GTEST_OS_WINDOWS_MOBILE  // We are on Windows CE.
 
 # include <windows.h>  // NOLINT
+# undef min
 
 #elif GTEST_OS_WINDOWS  // We are on Windows proper.
 
 // cpplint thinks that the header is already included, so we want to
 // silence it.
 # include <windows.h>  // NOLINT
+# undef min
 
 #else
 
 #if GTEST_CAN_STREAM_RESULTS_
 # include <arpa/inet.h>  // NOLINT
 # include <netdb.h>  // NOLINT
+# include <sys/socket.h>  // NOLINT
+# include <sys/types.h>  // NOLINT
 #endif
 
 // Indicates that this translation unit is part of Google Test's
@@ -183,6 +190,12 @@ bool g_help_flag = false;
 }  // namespace internal
 
 static const char* GetDefaultFilter() {
+#ifdef GTEST_TEST_FILTER_ENV_VAR_
+  const char* const testbridge_test_only = getenv(GTEST_TEST_FILTER_ENV_VAR_);
+  if (testbridge_test_only != NULL) {
+    return testbridge_test_only;
+  }
+#endif  // GTEST_TEST_FILTER_ENV_VAR_
   return kUniversalFilter;
 }
 
@@ -283,6 +296,13 @@ GTEST_DEFINE_bool_(
     "if exceptions are enabled or exit the program with a non-zero code "
     "otherwise.");
 
+#if GTEST_USE_OWN_FLAGFILE_FLAG_
+GTEST_DEFINE_string_(
+    flagfile,
+    internal::StringFromGTestEnv("flagfile", ""),
+    "This flag specifies the flagfile to read command-line flags from.");
+#endif  // GTEST_USE_OWN_FLAGFILE_FLAG_
+
 namespace internal {
 
 // Generates a random number from [0, range), using a Linear
@@ -307,13 +327,7 @@ UInt32 Random::Generate(UInt32 range) {
 // GTestIsInitialized() returns true iff the user has initialized
 // Google Test.  Useful for catching the user mistake of not initializing
 // Google Test before calling RUN_ALL_TESTS().
-//
-// A user must call testing::InitGoogleTest() to initialize Google
-// Test.  g_init_gtest_count is set to the number of times
-// InitGoogleTest() has been called.  We don't protect this variable
-// under a mutex as it is only accessed in the main thread.
-GTEST_API_ int g_init_gtest_count = 0;
-static bool GTestIsInitialized() { return g_init_gtest_count != 0; }
+static bool GTestIsInitialized() { return GetArgvs().size() > 0; }
 
 // Iterates over a vector of TestCases, keeping a running sum of the
 // results of calling a given int-returning method on each.
@@ -369,8 +383,16 @@ void AssertHelper::operator=(const Message& message) const {
 // Mutex for linked pointers.
 GTEST_API_ GTEST_DEFINE_STATIC_MUTEX_(g_linked_ptr_mutex);
 
-// Application pathname gotten in InitGoogleTest.
-std::string g_executable_path;
+// A copy of all command line arguments.  Set by InitGoogleTest().
+::std::vector<testing::internal::string> g_argvs;
+
+const ::std::vector<testing::internal::string>& GetArgvs() {
+#if defined(GTEST_CUSTOM_GET_ARGVS_)
+  return GTEST_CUSTOM_GET_ARGVS_();
+#else  // defined(GTEST_CUSTOM_GET_ARGVS_)
+  return g_argvs;
+#endif  // defined(GTEST_CUSTOM_GET_ARGVS_)
+}
 
 // Returns the current application's name, removing directory path if that
 // is present.
@@ -378,9 +400,9 @@ FilePath GetCurrentExecutableName() {
   FilePath result;
 
 #if GTEST_OS_WINDOWS
-  result.Set(FilePath(g_executable_path).RemoveExtension("exe"));
+  result.Set(FilePath(GetArgvs()[0]).RemoveExtension("exe"));
 #else
-  result.Set(FilePath(g_executable_path));
+  result.Set(FilePath(GetArgvs()[0]));
 #endif  // GTEST_OS_WINDOWS
 
   return result.RemoveDirectoryName();
@@ -772,8 +794,12 @@ int UnitTestImpl::test_to_run_count() const {
 // CurrentOsStackTraceExceptTop(1), Foo() will be included in the
 // trace but Bar() and CurrentOsStackTraceExceptTop() won't.
 std::string UnitTestImpl::CurrentOsStackTraceExceptTop(int skip_count) {
-  (void)skip_count;
-  return "";
+  return os_stack_trace_getter()->CurrentStackTrace(
+      static_cast<int>(GTEST_FLAG(stack_trace_depth)),
+      skip_count + 1
+      // Skips the user-specified number of frames plus this function
+      // itself.
+      );  // NOLINT
 }
 
 // Returns the current time in milliseconds.
@@ -802,21 +828,13 @@ TimeInMillis GetTimeInMillis() {
 #elif GTEST_OS_WINDOWS && !GTEST_HAS_GETTIMEOFDAY_
   __timeb64 now;
 
-# ifdef _MSC_VER
-
   // MSVC 8 deprecates _ftime64(), so we want to suppress warning 4996
   // (deprecated function) there.
   // TODO(kenton@google.com): Use GetTickCount()?  Or use
   //   SystemTimeToFileTime()
-#  pragma warning(push)          // Saves the current warning state.
-#  pragma warning(disable:4996)  // Temporarily disables warning 4996.
-  _ftime64(&now);
-#  pragma warning(pop)           // Restores the warning state.
-# else
-
+  GTEST_DISABLE_MSC_WARNINGS_PUSH_(4996)
   _ftime64(&now);
-
-# endif  // _MSC_VER
+  GTEST_DISABLE_MSC_WARNINGS_POP_()
 
   return static_cast<TimeInMillis>(now.time) * 1000 + now.millitm;
 #elif GTEST_HAS_GETTIMEOFDAY_
@@ -901,6 +919,23 @@ static void StreamWideCharsToMessage(const wchar_t* wstr, size_t length,
 
 #endif  // GTEST_HAS_STD_WSTRING || GTEST_HAS_GLOBAL_WSTRING
 
+void SplitString(const ::std::string& str, char delimiter,
+                 ::std::vector< ::std::string>* dest) {
+  ::std::vector< ::std::string> parsed;
+  ::std::string::size_type pos = 0;
+  while (::testing::internal::AlwaysTrue()) {
+    const ::std::string::size_type colon = str.find(delimiter, pos);
+    if (colon == ::std::string::npos) {
+      parsed.push_back(str.substr(pos));
+      break;
+    } else {
+      parsed.push_back(str.substr(pos, colon - pos));
+      pos = colon + 1;
+    }
+  }
+  dest->swap(parsed);
+}
+
 }  // namespace internal
 
 // Constructs an empty Message.
@@ -956,6 +991,13 @@ AssertionResult::AssertionResult(const AssertionResult& other)
                static_cast< ::std::string*>(NULL)) {
 }
 
+// Swaps two AssertionResults.
+void AssertionResult::swap(AssertionResult& other) {
+  using std::swap;
+  swap(success_, other.success_);
+  swap(message_, other.message_);
+}
+
 // Returns the assertion's negation. Used with EXPECT/ASSERT_FALSE.
 AssertionResult AssertionResult::operator!() const {
   AssertionResult negation(!success_);
@@ -982,6 +1024,276 @@ AssertionResult AssertionFailure(const Message& message) {
 
 namespace internal {
 
+namespace edit_distance {
+std::vector<EditType> CalculateOptimalEdits(const std::vector<size_t>& left,
+                                            const std::vector<size_t>& right) {
+  std::vector<std::vector<double> > costs(
+      left.size() + 1, std::vector<double>(right.size() + 1));
+  std::vector<std::vector<EditType> > best_move(
+      left.size() + 1, std::vector<EditType>(right.size() + 1));
+
+  // Populate for empty right.
+  for (size_t l_i = 0; l_i < costs.size(); ++l_i) {
+    costs[l_i][0] = static_cast<double>(l_i);
+    best_move[l_i][0] = kRemove;
+  }
+  // Populate for empty left.
+  for (size_t r_i = 1; r_i < costs[0].size(); ++r_i) {
+    costs[0][r_i] = static_cast<double>(r_i);
+    best_move[0][r_i] = kAdd;
+  }
+
+  for (size_t l_i = 0; l_i < left.size(); ++l_i) {
+    for (size_t r_i = 0; r_i < right.size(); ++r_i) {
+      if (left[l_i] == right[r_i]) {
+        // Found a match. Consume it.
+        costs[l_i + 1][r_i + 1] = costs[l_i][r_i];
+        best_move[l_i + 1][r_i + 1] = kMatch;
+        continue;
+      }
+
+      const double add = costs[l_i + 1][r_i];
+      const double remove = costs[l_i][r_i + 1];
+      const double replace = costs[l_i][r_i];
+      if (add < remove && add < replace) {
+        costs[l_i + 1][r_i + 1] = add + 1;
+        best_move[l_i + 1][r_i + 1] = kAdd;
+      } else if (remove < add && remove < replace) {
+        costs[l_i + 1][r_i + 1] = remove + 1;
+        best_move[l_i + 1][r_i + 1] = kRemove;
+      } else {
+        // We make replace a little more expensive than add/remove to lower
+        // their priority.
+        costs[l_i + 1][r_i + 1] = replace + 1.00001;
+        best_move[l_i + 1][r_i + 1] = kReplace;
+      }
+    }
+  }
+
+  // Reconstruct the best path. We do it in reverse order.
+  std::vector<EditType> best_path;
+  for (size_t l_i = left.size(), r_i = right.size(); l_i > 0 || r_i > 0;) {
+    EditType move = best_move[l_i][r_i];
+    best_path.push_back(move);
+    l_i -= move != kAdd;
+    r_i -= move != kRemove;
+  }
+  std::reverse(best_path.begin(), best_path.end());
+  return best_path;
+}
+
+namespace {
+
+// Helper class to convert string into ids with deduplication.
+class InternalStrings {
+ public:
+  size_t GetId(const std::string& str) {
+    IdMap::iterator it = ids_.find(str);
+    if (it != ids_.end()) return it->second;
+    size_t id = ids_.size();
+    return ids_[str] = id;
+  }
+
+ private:
+  typedef std::map<std::string, size_t> IdMap;
+  IdMap ids_;
+};
+
+}  // namespace
+
+std::vector<EditType> CalculateOptimalEdits(
+    const std::vector<std::string>& left,
+    const std::vector<std::string>& right) {
+  std::vector<size_t> left_ids, right_ids;
+  {
+    InternalStrings intern_table;
+    for (size_t i = 0; i < left.size(); ++i) {
+      left_ids.push_back(intern_table.GetId(left[i]));
+    }
+    for (size_t i = 0; i < right.size(); ++i) {
+      right_ids.push_back(intern_table.GetId(right[i]));
+    }
+  }
+  return CalculateOptimalEdits(left_ids, right_ids);
+}
+
+namespace {
+
+// Helper class that holds the state for one hunk and prints it out to the
+// stream.
+// It reorders adds/removes when possible to group all removes before all
+// adds. It also adds the hunk header before printint into the stream.
+class Hunk {
+ public:
+  Hunk(size_t left_start, size_t right_start)
+      : left_start_(left_start),
+        right_start_(right_start),
+        adds_(),
+        removes_(),
+        common_() {}
+
+  void PushLine(char edit, const char* line) {
+    switch (edit) {
+      case ' ':
+        ++common_;
+        FlushEdits();
+        hunk_.push_back(std::make_pair(' ', line));
+        break;
+      case '-':
+        ++removes_;
+        hunk_removes_.push_back(std::make_pair('-', line));
+        break;
+      case '+':
+        ++adds_;
+        hunk_adds_.push_back(std::make_pair('+', line));
+        break;
+    }
+  }
+
+  void PrintTo(std::ostream* os) {
+    PrintHeader(os);
+    FlushEdits();
+    for (std::list<std::pair<char, const char*> >::const_iterator it =
+             hunk_.begin();
+         it != hunk_.end(); ++it) {
+      *os << it->first << it->second << "\n";
+    }
+  }
+
+  bool has_edits() const { return adds_ || removes_; }
+
+ private:
+  void FlushEdits() {
+    hunk_.splice(hunk_.end(), hunk_removes_);
+    hunk_.splice(hunk_.end(), hunk_adds_);
+  }
+
+  // Print a unified diff header for one hunk.
+  // The format is
+  //   "@@ -<left_start>,<left_length> +<right_start>,<right_length> @@"
+  // where the left/right parts are ommitted if unnecessary.
+  void PrintHeader(std::ostream* ss) const {
+    *ss << "@@ ";
+    if (removes_) {
+      *ss << "-" << left_start_ << "," << (removes_ + common_);
+    }
+    if (removes_ && adds_) {
+      *ss << " ";
+    }
+    if (adds_) {
+      *ss << "+" << right_start_ << "," << (adds_ + common_);
+    }
+    *ss << " @@\n";
+  }
+
+  size_t left_start_, right_start_;
+  size_t adds_, removes_, common_;
+  std::list<std::pair<char, const char*> > hunk_, hunk_adds_, hunk_removes_;
+};
+
+}  // namespace
+
+// Create a list of diff hunks in Unified diff format.
+// Each hunk has a header generated by PrintHeader above plus a body with
+// lines prefixed with ' ' for no change, '-' for deletion and '+' for
+// addition.
+// 'context' represents the desired unchanged prefix/suffix around the diff.
+// If two hunks are close enough that their contexts overlap, then they are
+// joined into one hunk.
+std::string CreateUnifiedDiff(const std::vector<std::string>& left,
+                              const std::vector<std::string>& right,
+                              size_t context) {
+  const std::vector<EditType> edits = CalculateOptimalEdits(left, right);
+
+  size_t l_i = 0, r_i = 0, edit_i = 0;
+  std::stringstream ss;
+  while (edit_i < edits.size()) {
+    // Find first edit.
+    while (edit_i < edits.size() && edits[edit_i] == kMatch) {
+      ++l_i;
+      ++r_i;
+      ++edit_i;
+    }
+
+    // Find the first line to include in the hunk.
+    const size_t prefix_context = std::min(l_i, context);
+    Hunk hunk(l_i - prefix_context + 1, r_i - prefix_context + 1);
+    for (size_t i = prefix_context; i > 0; --i) {
+      hunk.PushLine(' ', left[l_i - i].c_str());
+    }
+
+    // Iterate the edits until we found enough suffix for the hunk or the input
+    // is over.
+    size_t n_suffix = 0;
+    for (; edit_i < edits.size(); ++edit_i) {
+      if (n_suffix >= context) {
+        // Continue only if the next hunk is very close.
+        std::vector<EditType>::const_iterator it = edits.begin() + edit_i;
+        while (it != edits.end() && *it == kMatch) ++it;
+        if (it == edits.end() || (it - edits.begin()) - edit_i >= context) {
+          // There is no next edit or it is too far away.
+          break;
+        }
+      }
+
+      EditType edit = edits[edit_i];
+      // Reset count when a non match is found.
+      n_suffix = edit == kMatch ? n_suffix + 1 : 0;
+
+      if (edit == kMatch || edit == kRemove || edit == kReplace) {
+        hunk.PushLine(edit == kMatch ? ' ' : '-', left[l_i].c_str());
+      }
+      if (edit == kAdd || edit == kReplace) {
+        hunk.PushLine('+', right[r_i].c_str());
+      }
+
+      // Advance indices, depending on edit type.
+      l_i += edit != kAdd;
+      r_i += edit != kRemove;
+    }
+
+    if (!hunk.has_edits()) {
+      // We are done. We don't want this hunk.
+      break;
+    }
+
+    hunk.PrintTo(&ss);
+  }
+  return ss.str();
+}
+
+}  // namespace edit_distance
+
+namespace {
+
+// The string representation of the values received in EqFailure() are already
+// escaped. Split them on escaped '\n' boundaries. Leave all other escaped
+// characters the same.
+std::vector<std::string> SplitEscapedString(const std::string& str) {
+  std::vector<std::string> lines;
+  size_t start = 0, end = str.size();
+  if (end > 2 && str[0] == '"' && str[end - 1] == '"') {
+    ++start;
+    --end;
+  }
+  bool escaped = false;
+  for (size_t i = start; i + 1 < end; ++i) {
+    if (escaped) {
+      escaped = false;
+      if (str[i] == 'n') {
+        lines.push_back(str.substr(start, i - start - 1));
+        start = i + 1;
+      }
+    } else {
+      escaped = str[i] == '\\';
+    }
+  }
+  lines.push_back(str.substr(start, end - start));
+  return lines;
+}
+
+}  // namespace
+
 // Constructs and returns the message for an equality assertion
 // (e.g. ASSERT_EQ, EXPECT_STREQ, etc) failure.
 //
@@ -989,31 +1301,42 @@ namespace internal {
 // and their values, as strings.  For example, for ASSERT_EQ(foo, bar)
 // where foo is 5 and bar is 6, we have:
 //
-//   expected_expression: "foo"
-//   actual_expression:   "bar"
-//   expected_value:      "5"
-//   actual_value:        "6"
+//   lhs_expression: "foo"
+//   rhs_expression: "bar"
+//   lhs_value:      "5"
+//   rhs_value:      "6"
 //
 // The ignoring_case parameter is true iff the assertion is a
-// *_STRCASEEQ*.  When it's true, the string " (ignoring case)" will
+// *_STRCASEEQ*.  When it's true, the string "Ignoring case" will
 // be inserted into the message.
-AssertionResult EqFailure(const char* expected_expression,
-                          const char* actual_expression,
-                          const std::string& expected_value,
-                          const std::string& actual_value,
+AssertionResult EqFailure(const char* lhs_expression,
+                          const char* rhs_expression,
+                          const std::string& lhs_value,
+                          const std::string& rhs_value,
                           bool ignoring_case) {
   Message msg;
-  msg << "Value of: " << actual_expression;
-  if (actual_value != actual_expression) {
-    msg << "\n  Actual: " << actual_value;
+  msg << "      Expected: " << lhs_expression;
+  if (lhs_value != lhs_expression) {
+    msg << "\n      Which is: " << lhs_value;
+  }
+  msg << "\nTo be equal to: " << rhs_expression;
+  if (rhs_value != rhs_expression) {
+    msg << "\n      Which is: " << rhs_value;
   }
 
-  msg << "\nExpected: " << expected_expression;
   if (ignoring_case) {
-    msg << " (ignoring case)";
+    msg << "\nIgnoring case";
   }
-  if (expected_value != expected_expression) {
-    msg << "\nWhich is: " << expected_value;
+
+  if (!lhs_value.empty() && !rhs_value.empty()) {
+    const std::vector<std::string> lhs_lines =
+        SplitEscapedString(lhs_value);
+    const std::vector<std::string> rhs_lines =
+        SplitEscapedString(rhs_value);
+    if (lhs_lines.size() > 1 || rhs_lines.size() > 1) {
+      msg << "\nWith diff:\n"
+          << edit_distance::CreateUnifiedDiff(lhs_lines, rhs_lines);
+    }
   }
 
   return AssertionFailure() << msg;
@@ -1111,18 +1434,18 @@ namespace internal {
 
 // The helper function for {ASSERT|EXPECT}_EQ with int or enum
 // arguments.
-AssertionResult CmpHelperEQ(const char* expected_expression,
-                            const char* actual_expression,
-                            BiggestInt expected,
-                            BiggestInt actual) {
-  if (expected == actual) {
+AssertionResult CmpHelperEQ(const char* lhs_expression,
+                            const char* rhs_expression,
+                            BiggestInt lhs,
+                            BiggestInt rhs) {
+  if (lhs == rhs) {
     return AssertionSuccess();
   }
 
-  return EqFailure(expected_expression,
-                   actual_expression,
-                   FormatForComparisonFailureMessage(expected, actual),
-                   FormatForComparisonFailureMessage(actual, expected),
+  return EqFailure(lhs_expression,
+                   rhs_expression,
+                   FormatForComparisonFailureMessage(lhs, rhs),
+                   FormatForComparisonFailureMessage(rhs, lhs),
                    false);
 }
 
@@ -1161,34 +1484,34 @@ GTEST_IMPL_CMP_HELPER_(GT, > )
 #undef GTEST_IMPL_CMP_HELPER_
 
 // The helper function for {ASSERT|EXPECT}_STREQ.
-AssertionResult CmpHelperSTREQ(const char* expected_expression,
-                               const char* actual_expression,
-                               const char* expected,
-                               const char* actual) {
-  if (String::CStringEquals(expected, actual)) {
+AssertionResult CmpHelperSTREQ(const char* lhs_expression,
+                               const char* rhs_expression,
+                               const char* lhs,
+                               const char* rhs) {
+  if (String::CStringEquals(lhs, rhs)) {
     return AssertionSuccess();
   }
 
-  return EqFailure(expected_expression,
-                   actual_expression,
-                   PrintToString(expected),
-                   PrintToString(actual),
+  return EqFailure(lhs_expression,
+                   rhs_expression,
+                   PrintToString(lhs),
+                   PrintToString(rhs),
                    false);
 }
 
 // The helper function for {ASSERT|EXPECT}_STRCASEEQ.
-AssertionResult CmpHelperSTRCASEEQ(const char* expected_expression,
-                                   const char* actual_expression,
-                                   const char* expected,
-                                   const char* actual) {
-  if (String::CaseInsensitiveCStringEquals(expected, actual)) {
+AssertionResult CmpHelperSTRCASEEQ(const char* lhs_expression,
+                                   const char* rhs_expression,
+                                   const char* lhs,
+                                   const char* rhs) {
+  if (String::CaseInsensitiveCStringEquals(lhs, rhs)) {
     return AssertionSuccess();
   }
 
-  return EqFailure(expected_expression,
-                   actual_expression,
-                   PrintToString(expected),
-                   PrintToString(actual),
+  return EqFailure(lhs_expression,
+                   rhs_expression,
+                   PrintToString(lhs),
+                   PrintToString(rhs),
                    true);
 }
 
@@ -1543,18 +1866,18 @@ bool String::WideCStringEquals(const wchar_t * lhs, const wchar_t * rhs) {
 }
 
 // Helper function for *_STREQ on wide strings.
-AssertionResult CmpHelperSTREQ(const char* expected_expression,
-                               const char* actual_expression,
-                               const wchar_t* expected,
-                               const wchar_t* actual) {
-  if (String::WideCStringEquals(expected, actual)) {
+AssertionResult CmpHelperSTREQ(const char* lhs_expression,
+                               const char* rhs_expression,
+                               const wchar_t* lhs,
+                               const wchar_t* rhs) {
+  if (String::WideCStringEquals(lhs, rhs)) {
     return AssertionSuccess();
   }
 
-  return EqFailure(expected_expression,
-                   actual_expression,
-                   PrintToString(expected),
-                   PrintToString(actual),
+  return EqFailure(lhs_expression,
+                   rhs_expression,
+                   PrintToString(lhs),
+                   PrintToString(rhs),
                    false);
 }
 
@@ -1607,7 +1930,7 @@ bool String::CaseInsensitiveWideCStringEquals(const wchar_t* lhs,
 
 #if GTEST_OS_WINDOWS
   return _wcsicmp(lhs, rhs) == 0;
-#elif GTEST_OS_LINUX && !GTEST_OS_LINUX_ANDROID && GTEST_HAS_WCSCASECMP
+#elif GTEST_OS_LINUX && !GTEST_OS_LINUX_ANDROID
   return wcscasecmp(lhs, rhs) == 0;
 #else
   // Android, Mac OS X and Cygwin don't define wcscasecmp.
@@ -1887,14 +2210,15 @@ int TestResult::test_property_count() const {
 
 // Creates a Test object.
 
-// The c'tor saves the values of all Google Test flags.
+// The c'tor saves the states of all flags.
 Test::Test()
-    : gtest_flag_saver_(new internal::GTestFlagSaver) {
+    : gtest_flag_saver_(new GTEST_FLAG_SAVER_) {
 }
 
-// The d'tor restores the values of all Google Test flags.
+// The d'tor restores the states of all flags.  The actual work is
+// done by the d'tor of the gtest_flag_saver_ field, and thus not
+// visible here.
 Test::~Test() {
-  delete gtest_flag_saver_;
 }
 
 // Sets up the test fixture.
@@ -1963,8 +2287,8 @@ bool Test::HasSameFixtureClass() {
     const bool this_is_TEST = this_fixture_id == internal::GetTestTypeId();
 
     if (first_is_TEST || this_is_TEST) {
-      // The user mixed TEST and TEST_F in this test case - we'll tell
-      // him/her how to fix it.
+      // Both TEST and TEST_F appear in same test case, which is incorrect.
+      // Tell the user how to fix this.
 
       // Gets the name of the TEST and the name of the TEST_F.  Note
       // that first_is_TEST and this_is_TEST cannot both be true, as
@@ -1984,8 +2308,8 @@ bool Test::HasSameFixtureClass() {
           << "want to change the TEST to TEST_F or move it to another test\n"
           << "case.";
     } else {
-      // The user defined two fixture classes with the same name in
-      // two namespaces - we'll tell him/her how to fix it.
+      // Two fixture classes with the same name appear in two different
+      // namespaces, which is not allowed. Tell the user how to fix this.
       ADD_FAILURE()
           << "All tests in the same test case must use the same test fixture\n"
           << "class.  However, in test case "
@@ -2178,12 +2502,14 @@ TestInfo::TestInfo(const std::string& a_test_case_name,
                    const std::string& a_name,
                    const char* a_type_param,
                    const char* a_value_param,
+                   internal::CodeLocation a_code_location,
                    internal::TypeId fixture_class_id,
                    internal::TestFactoryBase* factory)
     : test_case_name_(a_test_case_name),
       name_(a_name),
       type_param_(a_type_param ? new std::string(a_type_param) : NULL),
       value_param_(a_value_param ? new std::string(a_value_param) : NULL),
+      location_(a_code_location),
       fixture_class_id_(fixture_class_id),
       should_run_(false),
       is_disabled_(false),
@@ -2207,6 +2533,7 @@ namespace internal {
 //                     this is not a typed or a type-parameterized test.
 //   value_param:      text representation of the test's value parameter,
 //                     or NULL if this is not a value-parameterized test.
+//   code_location:    code location where the test is defined
 //   fixture_class_id: ID of the test fixture class
 //   set_up_tc:        pointer to the function that sets up the test case
 //   tear_down_tc:     pointer to the function that tears down the test case
@@ -2218,20 +2545,21 @@ TestInfo* MakeAndRegisterTestInfo(
     const char* name,
     const char* type_param,
     const char* value_param,
+    CodeLocation code_location,
     TypeId fixture_class_id,
     SetUpTestCaseFunc set_up_tc,
     TearDownTestCaseFunc tear_down_tc,
     TestFactoryBase* factory) {
   TestInfo* const test_info =
       new TestInfo(test_case_name, name, type_param, value_param,
-                   fixture_class_id, factory);
+                   code_location, fixture_class_id, factory);
   GetUnitTestImpl()->AddTestInfo(set_up_tc, tear_down_tc, test_info);
   return test_info;
 }
 
 #if GTEST_HAS_PARAM_TEST
 void ReportInvalidTestCaseType(const char* test_case_name,
-                               const char* file, int line) {
+                               CodeLocation code_location) {
   Message errors;
   errors
       << "Attempted redefinition of test case " << test_case_name << ".\n"
@@ -2243,7 +2571,9 @@ void ReportInvalidTestCaseType(const char* test_case_name,
       << "probably rename one of the classes to put the tests into different\n"
       << "test cases.";
 
-  fprintf(stderr, "%s %s", FormatFileLocation(file, line).c_str(),
+  fprintf(stderr, "%s %s",
+          FormatFileLocation(code_location.file.c_str(),
+                             code_location.line).c_str(),
           errors.GetString().c_str());
 }
 #endif  // GTEST_HAS_PARAM_TEST
@@ -2554,7 +2884,8 @@ enum GTestColor {
   COLOR_YELLOW
 };
 
-#if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE
+#if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE && \
+    !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT
 
 // Returns the character attribute for the given color.
 WORD GetColorAttribute(GTestColor color) {
@@ -2599,6 +2930,10 @@ bool ShouldUseColor(bool stdout_is_tty) {
         String::CStringEquals(term, "xterm-256color") ||
         String::CStringEquals(term, "screen") ||
         String::CStringEquals(term, "screen-256color") ||
+        String::CStringEquals(term, "tmux") ||
+        String::CStringEquals(term, "tmux-256color") ||
+        String::CStringEquals(term, "rxvt-unicode") ||
+        String::CStringEquals(term, "rxvt-unicode-256color") ||
         String::CStringEquals(term, "linux") ||
         String::CStringEquals(term, "cygwin");
     return stdout_is_tty && term_supports_color;
@@ -2622,8 +2957,9 @@ void ColoredPrintf(GTestColor color, const char* fmt, ...) {
   va_list args;
   va_start(args, fmt);
 
-#if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN || GTEST_OS_ZOS || GTEST_OS_IOS
-  const bool use_color = false;
+#if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_SYMBIAN || GTEST_OS_ZOS || \
+    GTEST_OS_IOS || GTEST_OS_WINDOWS_PHONE || GTEST_OS_WINDOWS_RT
+  const bool use_color = AlwaysFalse();
 #else
   static const bool in_color_mode =
       ShouldUseColor(posix::IsATTY(posix::FileNo(stdout)) != 0);
@@ -2637,7 +2973,8 @@ void ColoredPrintf(GTestColor color, const char* fmt, ...) {
     return;
   }
 
-#if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE
+#if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE && \
+    !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT
   const HANDLE stdout_handle = GetStdHandle(STD_OUTPUT_HANDLE);
 
   // Gets the current text color.
@@ -3212,34 +3549,39 @@ std::string XmlUnitTestResultPrinter::RemoveInvalidXmlCharacters(
 // Formats the given time in milliseconds as seconds.
 std::string FormatTimeInMillisAsSeconds(TimeInMillis ms) {
   ::std::stringstream ss;
-  ss << ms/1000.0;
+  ss << (static_cast<double>(ms) * 1e-3);
   return ss.str();
 }
 
-// Converts the given epoch time in milliseconds to a date string in the ISO
-// 8601 format, without the timezone information.
-std::string FormatEpochTimeInMillisAsIso8601(TimeInMillis ms) {
-  // Using non-reentrant version as localtime_r is not portable.
-  time_t seconds = static_cast<time_t>(ms / 1000);
-#ifdef _MSC_VER
-# pragma warning(push)          // Saves the current warning state.
-# pragma warning(disable:4996)  // Temporarily disables warning 4996
-                                // (function or variable may be unsafe).
-  const struct tm* const time_struct = localtime(&seconds);  // NOLINT
-# pragma warning(pop)           // Restores the warning state again.
+static bool PortableLocaltime(time_t seconds, struct tm* out) {
+#if defined(_MSC_VER)
+  return localtime_s(out, &seconds) == 0;
+#elif defined(__MINGW32__) || defined(__MINGW64__)
+  // MINGW <time.h> provides neither localtime_r nor localtime_s, but uses
+  // Windows' localtime(), which has a thread-local tm buffer.
+  struct tm* tm_ptr = localtime(&seconds);  // NOLINT
+  if (tm_ptr == NULL)
+    return false;
+  *out = *tm_ptr;
+  return true;
 #else
-  const struct tm* const time_struct = localtime(&seconds);  // NOLINT
+  return localtime_r(&seconds, out) != NULL;
 #endif
-  if (time_struct == NULL)
-    return "";  // Invalid ms value
+}
 
+// Converts the given epoch time in milliseconds to a date string in the ISO
+// 8601 format, without the timezone information.
+std::string FormatEpochTimeInMillisAsIso8601(TimeInMillis ms) {
+  struct tm time_struct;
+  if (!PortableLocaltime(static_cast<time_t>(ms / 1000), &time_struct))
+    return "";
   // YYYY-MM-DDThh:mm:ss
-  return StreamableToString(time_struct->tm_year + 1900) + "-" +
-      String::FormatIntWidth2(time_struct->tm_mon + 1) + "-" +
-      String::FormatIntWidth2(time_struct->tm_mday) + "T" +
-      String::FormatIntWidth2(time_struct->tm_hour) + ":" +
-      String::FormatIntWidth2(time_struct->tm_min) + ":" +
-      String::FormatIntWidth2(time_struct->tm_sec);
+  return StreamableToString(time_struct.tm_year + 1900) + "-" +
+      String::FormatIntWidth2(time_struct.tm_mon + 1) + "-" +
+      String::FormatIntWidth2(time_struct.tm_mday) + "T" +
+      String::FormatIntWidth2(time_struct.tm_hour) + ":" +
+      String::FormatIntWidth2(time_struct.tm_min) + ":" +
+      String::FormatIntWidth2(time_struct.tm_sec);
 }
 
 // Streams an XML CDATA section, escaping invalid CDATA sequences as needed.
@@ -3502,26 +3844,15 @@ ScopedTrace::~ScopedTrace()
 
 // class OsStackTraceGetter
 
-// Returns the current OS stack trace as an std::string.  Parameters:
-//
-//   max_depth  - the maximum number of stack frames to be included
-//                in the trace.
-//   skip_count - the number of top frames to be skipped; doesn't count
-//                against max_depth.
-//
-string OsStackTraceGetter::CurrentStackTrace(int /* max_depth */,
-                                             int /* skip_count */)
-    GTEST_LOCK_EXCLUDED_(mutex_) {
-  return "";
-}
+const char* const OsStackTraceGetterInterface::kElidedFramesMarker =
+    "... " GTEST_NAME_ " internal frames ...";
 
-void OsStackTraceGetter::UponLeavingGTest()
-    GTEST_LOCK_EXCLUDED_(mutex_) {
+string OsStackTraceGetter::CurrentStackTrace(int /*max_depth*/,
+                                             int /*skip_count*/) {
+  return "";
 }
 
-const char* const
-OsStackTraceGetter::kElidedFramesMarker =
-    "... " GTEST_NAME_ " internal frames ...";
+void OsStackTraceGetter::UponLeavingGTest() {}
 
 // A helper class that creates the premature-exit file in its
 // constructor and deletes the file in its destructor.
@@ -3812,7 +4143,7 @@ void UnitTest::AddTestPartResult(
     // with another testing framework) and specify the former on the
     // command line for debugging.
     if (GTEST_FLAG(break_on_failure)) {
-#if GTEST_OS_WINDOWS
+#if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT
       // Using DebugBreak on Windows allows gtest to still break into a debugger
       // when a failure happens and both the --gtest_break_on_failure and
       // the --gtest_catch_exceptions flags are specified.
@@ -3890,7 +4221,7 @@ int UnitTest::Run() {
   // process. In either case the user does not want to see pop-up dialogs
   // about crashes - they are expected.
   if (impl()->catch_exceptions() || in_death_test_child_process) {
-# if !GTEST_OS_WINDOWS_MOBILE
+# if !GTEST_OS_WINDOWS_MOBILE && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT
     // SetErrorMode doesn't exist on CE.
     SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOALIGNMENTFAULTEXCEPT |
                  SEM_NOGPFAULTERRORBOX | SEM_NOOPENFILEERRORBOX);
@@ -3993,17 +4324,10 @@ namespace internal {
 
 UnitTestImpl::UnitTestImpl(UnitTest* parent)
     : parent_(parent),
-#ifdef _MSC_VER
-# pragma warning(push)                    // Saves the current warning state.
-# pragma warning(disable:4355)            // Temporarily disables warning 4355
-                                         // (using this in initializer).
+      GTEST_DISABLE_MSC_WARNINGS_PUSH_(4355 /* using this in initializer */)
       default_global_test_part_result_reporter_(this),
       default_per_thread_test_part_result_reporter_(this),
-# pragma warning(pop)                     // Restores the warning state again.
-#else
-      default_global_test_part_result_reporter_(this),
-      default_per_thread_test_part_result_reporter_(this),
-#endif  // _MSC_VER
+      GTEST_DISABLE_MSC_WARNINGS_POP_()
       global_test_part_result_repoter_(
           &default_global_test_part_result_reporter_),
       per_thread_test_part_result_reporter_(
@@ -4114,6 +4438,11 @@ void UnitTestImpl::PostFlagParsingInit() {
   if (!post_flag_parse_init_performed_) {
     post_flag_parse_init_performed_ = true;
 
+#if defined(GTEST_CUSTOM_TEST_EVENT_LISTENER_)
+    // Register to send notifications about key process state changes.
+    listeners()->Append(new GTEST_CUSTOM_TEST_EVENT_LISTENER_());
+#endif  // defined(GTEST_CUSTOM_TEST_EVENT_LISTENER_)
+
 #if GTEST_HAS_DEATH_TEST
     InitDeathTestSubprocessControlInfo();
     SuppressTestEventsIfInSubprocess();
@@ -4247,6 +4576,11 @@ bool UnitTestImpl::RunAllTests() {
 
 #if GTEST_HAS_DEATH_TEST
   in_subprocess_for_death_test = (internal_run_death_test_flag_.get() != NULL);
+# if defined(GTEST_EXTRA_DEATH_TEST_CHILD_SETUP_)
+  if (in_subprocess_for_death_test) {
+    GTEST_EXTRA_DEATH_TEST_CHILD_SETUP_();
+  }
+# endif  // defined(GTEST_EXTRA_DEATH_TEST_CHILD_SETUP_)
 #endif  // GTEST_HAS_DEATH_TEST
 
   const bool should_shard = ShouldShard(kTestTotalShards, kTestShardIndex,
@@ -4583,7 +4917,11 @@ void UnitTestImpl::set_os_stack_trace_getter(
 // getter, and returns it.
 OsStackTraceGetterInterface* UnitTestImpl::os_stack_trace_getter() {
   if (os_stack_trace_getter_ == NULL) {
+#ifdef GTEST_OS_STACK_TRACE_GETTER_
+    os_stack_trace_getter_ = new GTEST_OS_STACK_TRACE_GETTER_;
+#else
     os_stack_trace_getter_ = new OsStackTraceGetter;
+#endif  // GTEST_OS_STACK_TRACE_GETTER_
   }
 
   return os_stack_trace_getter_;
@@ -4882,6 +5220,58 @@ static const char kColorEncodedHelpMessage[] =
 "(not one in your own code or tests), please report it to\n"
 "@G<" GTEST_DEV_EMAIL_ ">@D.\n";
 
+bool ParseGoogleTestFlag(const char* const arg) {
+  return ParseBoolFlag(arg, kAlsoRunDisabledTestsFlag,
+                       &GTEST_FLAG(also_run_disabled_tests)) ||
+      ParseBoolFlag(arg, kBreakOnFailureFlag,
+                    &GTEST_FLAG(break_on_failure)) ||
+      ParseBoolFlag(arg, kCatchExceptionsFlag,
+                    &GTEST_FLAG(catch_exceptions)) ||
+      ParseStringFlag(arg, kColorFlag, &GTEST_FLAG(color)) ||
+      ParseStringFlag(arg, kDeathTestStyleFlag,
+                      &GTEST_FLAG(death_test_style)) ||
+      ParseBoolFlag(arg, kDeathTestUseFork,
+                    &GTEST_FLAG(death_test_use_fork)) ||
+      ParseStringFlag(arg, kFilterFlag, &GTEST_FLAG(filter)) ||
+      ParseStringFlag(arg, kInternalRunDeathTestFlag,
+                      &GTEST_FLAG(internal_run_death_test)) ||
+      ParseBoolFlag(arg, kListTestsFlag, &GTEST_FLAG(list_tests)) ||
+      ParseStringFlag(arg, kOutputFlag, &GTEST_FLAG(output)) ||
+      ParseBoolFlag(arg, kPrintTimeFlag, &GTEST_FLAG(print_time)) ||
+      ParseInt32Flag(arg, kRandomSeedFlag, &GTEST_FLAG(random_seed)) ||
+      ParseInt32Flag(arg, kRepeatFlag, &GTEST_FLAG(repeat)) ||
+      ParseBoolFlag(arg, kShuffleFlag, &GTEST_FLAG(shuffle)) ||
+      ParseInt32Flag(arg, kStackTraceDepthFlag,
+                     &GTEST_FLAG(stack_trace_depth)) ||
+      ParseStringFlag(arg, kStreamResultToFlag,
+                      &GTEST_FLAG(stream_result_to)) ||
+      ParseBoolFlag(arg, kThrowOnFailureFlag,
+                    &GTEST_FLAG(throw_on_failure));
+}
+
+#if GTEST_USE_OWN_FLAGFILE_FLAG_
+void LoadFlagsFromFile(const std::string& path) {
+  FILE* flagfile = posix::FOpen(path.c_str(), "r");
+  if (!flagfile) {
+    fprintf(stderr,
+            "Unable to open file \"%s\"\n",
+            GTEST_FLAG(flagfile).c_str());
+    fflush(stderr);
+    exit(EXIT_FAILURE);
+  }
+  std::string contents(ReadEntireFile(flagfile));
+  posix::FClose(flagfile);
+  std::vector<std::string> lines;
+  SplitString(contents, '\n', &lines);
+  for (size_t i = 0; i < lines.size(); ++i) {
+    if (lines[i].empty())
+      continue;
+    if (!ParseGoogleTestFlag(lines[i].c_str()))
+      g_help_flag = true;
+  }
+}
+#endif  // GTEST_USE_OWN_FLAGFILE_FLAG_
+
 // Parses the command line for Google Test flags, without initializing
 // other parts of Google Test.  The type parameter CharType can be
 // instantiated to either char or wchar_t.
@@ -4895,35 +5285,24 @@ void ParseGoogleTestFlagsOnlyImpl(int* argc, CharType** argv) {
     using internal::ParseInt32Flag;
     using internal::ParseStringFlag;
 
-    // Do we see a Google Test flag?
-    if (ParseBoolFlag(arg, kAlsoRunDisabledTestsFlag,
-                      &GTEST_FLAG(also_run_disabled_tests)) ||
-        ParseBoolFlag(arg, kBreakOnFailureFlag,
-                      &GTEST_FLAG(break_on_failure)) ||
-        ParseBoolFlag(arg, kCatchExceptionsFlag,
-                      &GTEST_FLAG(catch_exceptions)) ||
-        ParseStringFlag(arg, kColorFlag, &GTEST_FLAG(color)) ||
-        ParseStringFlag(arg, kDeathTestStyleFlag,
-                        &GTEST_FLAG(death_test_style)) ||
-        ParseBoolFlag(arg, kDeathTestUseFork,
-                      &GTEST_FLAG(death_test_use_fork)) ||
-        ParseStringFlag(arg, kFilterFlag, &GTEST_FLAG(filter)) ||
-        ParseStringFlag(arg, kInternalRunDeathTestFlag,
-                        &GTEST_FLAG(internal_run_death_test)) ||
-        ParseBoolFlag(arg, kListTestsFlag, &GTEST_FLAG(list_tests)) ||
-        ParseStringFlag(arg, kOutputFlag, &GTEST_FLAG(output)) ||
-        ParseBoolFlag(arg, kPrintTimeFlag, &GTEST_FLAG(print_time)) ||
-        ParseInt32Flag(arg, kRandomSeedFlag, &GTEST_FLAG(random_seed)) ||
-        ParseInt32Flag(arg, kRepeatFlag, &GTEST_FLAG(repeat)) ||
-        ParseBoolFlag(arg, kShuffleFlag, &GTEST_FLAG(shuffle)) ||
-        ParseInt32Flag(arg, kStackTraceDepthFlag,
-                       &GTEST_FLAG(stack_trace_depth)) ||
-        ParseStringFlag(arg, kStreamResultToFlag,
-                        &GTEST_FLAG(stream_result_to)) ||
-        ParseBoolFlag(arg, kThrowOnFailureFlag,
-                      &GTEST_FLAG(throw_on_failure))
-        ) {
-      // Yes.  Shift the remainder of the argv list left by one.  Note
+    bool remove_flag = false;
+    if (ParseGoogleTestFlag(arg)) {
+      remove_flag = true;
+#if GTEST_USE_OWN_FLAGFILE_FLAG_
+    } else if (ParseStringFlag(arg, kFlagfileFlag, &GTEST_FLAG(flagfile))) {
+      LoadFlagsFromFile(GTEST_FLAG(flagfile));
+      remove_flag = true;
+#endif  // GTEST_USE_OWN_FLAGFILE_FLAG_
+    } else if (arg_string == "--help" || arg_string == "-h" ||
+               arg_string == "-?" || arg_string == "/?" ||
+               HasGoogleTestFlagPrefix(arg)) {
+      // Both help flag and unrecognized Google Test flags (excluding
+      // internal ones) trigger help display.
+      g_help_flag = true;
+    }
+
+    if (remove_flag) {
+      // Shift the remainder of the argv list left by one.  Note
       // that argv has (*argc + 1) elements, the last one always being
       // NULL.  The following loop moves the trailing NULL element as
       // well.
@@ -4937,12 +5316,6 @@ void ParseGoogleTestFlagsOnlyImpl(int* argc, CharType** argv) {
       // We also need to decrement the iterator as we just removed
       // an element.
       i--;
-    } else if (arg_string == "--help" || arg_string == "-h" ||
-               arg_string == "-?" || arg_string == "/?" ||
-               HasGoogleTestFlagPrefix(arg)) {
-      // Both help flag and unrecognized Google Test flags (excluding
-      // internal ones) trigger help display.
-      g_help_flag = true;
     }
   }
 
@@ -4969,24 +5342,16 @@ void ParseGoogleTestFlagsOnly(int* argc, wchar_t** argv) {
 // wchar_t.
 template <typename CharType>
 void InitGoogleTestImpl(int* argc, CharType** argv) {
-  g_init_gtest_count++;
-
   // We don't want to run the initialization code twice.
-  if (g_init_gtest_count != 1) return;
+  if (GTestIsInitialized()) return;
 
   if (*argc <= 0) return;
 
-  internal::g_executable_path = internal::StreamableToString(argv[0]);
-
-#if GTEST_HAS_DEATH_TEST
-
   g_argvs.clear();
   for (int i = 0; i != *argc; i++) {
     g_argvs.push_back(StreamableToString(argv[i]));
   }
 
-#endif  // GTEST_HAS_DEATH_TEST
-
   ParseGoogleTestFlagsOnly(argc, argv);
   GetUnitTestImpl()->PostFlagParsingInit();
 }
@@ -5003,13 +5368,21 @@ void InitGoogleTestImpl(int* argc, CharType** argv) {
 //
 // Calling the function for the second time has no user-visible effect.
 void InitGoogleTest(int* argc, char** argv) {
+#if defined(GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_)
+  GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_(argc, argv);
+#else  // defined(GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_)
   internal::InitGoogleTestImpl(argc, argv);
+#endif  // defined(GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_)
 }
 
 // This overloaded version can be used in Windows programs compiled in
 // UNICODE mode.
 void InitGoogleTest(int* argc, wchar_t** argv) {
+#if defined(GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_)
+  GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_(argc, argv);
+#else  // defined(GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_)
   internal::InitGoogleTestImpl(argc, argv);
+#endif  // defined(GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_)
 }
 
 }  // namespace testing
index 5a183ab6b51bfff7d9834ff10ea08bc2fc6dc675..5dc78986caecaa172cd4efb58b441c6cdf271cd7 100644 (file)
 
 #include "visibility.h"
 
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-#if 0
-} /* Avoids screwing up auto-indentation */
-#endif
-
 /* Setting TMPI_ATOMICS_DISABLED permits the build to enforce that no
  * atomic operations are used. This is used when building to run
  * ThreadSanitzer.
@@ -635,10 +627,4 @@ void tMPI_Spinlock_wait(tMPI_Spinlock_t *x);
 #define TMPI_ATOMICS
 #endif
 
-
-#ifdef __cplusplus
-}
-#endif
-
-
 #endif /* TMPI_ATOMIC_H_ */
index 50bd7dc71bd95dd20dd0f072bfb5e61450e6dfbc..11f6438982319b77081bb77af6a7b9258889ee8c 100644 (file)
 #include <windows.h>
 #undef WIN32_LEAN_AND_MEAN
 
-#if (!defined(inline)) && (!defined(__cplusplus))
-#define inline_defined_in_atomic 1
-#define inline __inline
-#endif
-
 #define tMPI_Atomic_memory_barrier()
 
 
index 19f7bb6a490cfbea278358f11559e48e1c282308..3b22137ce9e9c98eac8998715df50d03b869efd4 100644 (file)
    files.
  */
 
-/* PowerPC using xlC inline assembly.
- * Recent versions of xlC (>=7.0) _partially_ support GCC inline assembly
- * if you use the option -qasm=gcc but we have had to hack things a bit, in
- * particular when it comes to clobbered variables. Since this implementation
- * _could_ be buggy, we have separated it from the known-to-be-working gcc
- * one above.
- *
- * For now, we just disable the inline keyword if we're compiling C code:
- */
-#if 1
-#if (!defined(__cplusplus)) && (!defined(inline))
-#define inline_defined_in_atomic 1
-#define inline
-#endif
-#endif
-
-
 /* IBM xlC compiler */
-#ifdef __cplusplus
 #include <builtins.h>
-#endif
 
 
 #define TMPI_XLC_INTRINSICS
index c1cf2b9784f675aaf826112ed593cf0a4f39d539..249bf6a04df8d30cc0626b6e164c52531b326236 100644 (file)
 
 #include "visibility.h"
 
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-#if 0
-} /* Avoids screwing up auto-indentation */
-#endif
-
 /** Execute function once over comm
 
     Executes a given function only once per collective call over comm.
@@ -121,8 +113,4 @@ typedef struct
 TMPI_EXPORT
 tMPI_Reduce_req *tMPI_Reduce_req_alloc(tMPI_Comm comm);
 
-#ifdef __cplusplus
-} /* closing extern "C" */
-#endif
-
 #endif /* TMPI_COLLECTIVE_H_ */
index 03b579cb196bafe8b7f2305bacfd94ddf0970d3b..14a8aa13f69db780c060ecaa4b5ec4284751cf8d 100644 (file)
  */
 
 
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-#if 0
-} /* Avoids screwing up auto-indentation */
-#endif
-
-
 /**  Lock-free single-ended stack (FIFO)
 
    Is a list with push, pop and detach operations */
@@ -158,9 +149,4 @@ void tMPI_List_insert(tMPI_List *l, tMPI_List_element *after,
 void tMPI_List_remove(tMPI_List *l, tMPI_List_element *le);
 #endif
 
-
-#ifdef __cplusplus
-} /* closing extern "C" */
-#endif
-
 #endif /* TMPI_LIST_H_ */
index 84a9794fdd2c0418896292335337db70ed32495f..0a2bcefc67a56894c8137f2989a9b1b569c354b4 100644 (file)
 #include "wait.h"
 #include "atomic.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 /** Fast (possibly busy-wait-based) lock type
  *
  *  This lock type forms an intermediate between the spinlocks and mutexes:
@@ -106,8 +102,4 @@ int tMPI_Lock_trylock(tMPI_Lock_t *lock);
 TMPI_EXPORT
 int tMPI_Lock_islocked(tMPI_Lock_t *lock);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* TMPI_FASTLOCK_H_ */
index f4cf02b9435a4006279aa3c5abc09d33a4735e8b..788a72088a9818bd6f4a59fc61f9e8cad104709f 100644 (file)
  */
 
 #ifndef DOXYGEN
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-
-
 
 /* The MPI_Comm structure contains the group of processes to communicate
    with (defines the scope for global operations such as broadcast) */
@@ -256,10 +249,6 @@ typedef tMPI_Op MPI_Op;
 #define MPI_Allreduce               tMPI_Allreduce
 #define MPI_Scan                    tMPI_Scan
 
-#ifdef __cplusplus
-} /* closing extern "C" */
-#endif
-
-#endif
+#endif /* DOXYGEN */
 
 #endif /* TMPI_MPI_BINDINGS_H_ */
index 4916b541253ae5118523212b50a6b52766fd677a..fc5381a7542102a2fbaeb1f31a04600d4105160b 100644 (file)
@@ -50,9 +50,6 @@
 #include "system_error.h"
 #include "threads.h"
 
-#ifdef __cplusplus
-
-
 namespace tMPI
 {
 /*! \brief A lock guard class that allows for the simple management of
@@ -173,6 +170,4 @@ class TMPI_EXPORT mutex
 };
 }
 
-#endif /* __cplusplus */
-
 #endif /* TMPI_MUTEX_H_ */
index 04237743028c1e22d66028506e23bd3fb8a92c41..7b506538260899e16a4332bdc03b9c3727e97af9 100644 (file)
 
 #include "visibility.h"
 
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-#if 0
-} /* Avoids screwing up auto-indentation */
-#endif
-
 
 #if (defined(WIN32) || defined( _WIN32 ) || defined(WIN64) || defined( _WIN64 )) && !defined (__CYGWIN__) && !defined (__CYGWIN32__)
 
@@ -128,9 +120,4 @@ void *tMPI_Realloc_local(void *ptr, size_t size);
 TMPI_EXPORT
 int tMPI_Free_numa(void *ptr);
 
-
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* TMPI_NUMA_MALLOC_H_ */
index c1d046ecf7751e330e19944741b2be58aa0e76b5..f425f7c68ba6850f702d4365e0202b5c15f548cf 100644 (file)
@@ -48,8 +48,6 @@
 
 #include "visibility.h"
 
-#ifdef __cplusplus
-
 namespace tMPI
 {
 /*! \brief Subset of the C++11 system_error class
@@ -76,6 +74,4 @@ class system_error : public std::runtime_error
 };
 }
 
-#endif /* __cplusplus */
-
 #endif /* TMPI_SYSTEM_ERROR_H_ */
index 2abd8e5430a7de99111fe6e1f0fa0fda06976a2d..11a459e09bded1a33c5917f81bb24fbd9b33fe3c 100644 (file)
 #include "atomic.h"
 
 
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-#if 0
-} /* Avoids screwing up auto-indentation */
-#endif
-
-
-
-
-
 /*! \brief Thread ID: abstract tMPI_Thread type
  *
  *  The contents of this structure depends on the actual threads
@@ -685,9 +673,4 @@ int tMPI_Thread_barrier_wait(tMPI_Thread_barrier_t *barrier);
 
 /*! \} */
 
-
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* TMPI_THREADS_H_ */
index 5e9c472806b05ce0f50f26b3a44f6e0e39527402..b2c6ad905aee147e002c98c3ee23280b526f75a2 100644 (file)
 
 #include "visibility.h"
 
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-#if 0
-} /* Avoids screwing up auto-indentation */
-#endif
-
-
-
 /** tMPI definition.
 
    Use this to check for thread_mpi with the preprocessor. */
@@ -1394,8 +1384,4 @@ int tMPI_Scan(void* sendbuf, void* recvbuf, int count,
 
 
 
-#ifdef __cplusplus
-} /* closing extern "C" */
-#endif
-
 #endif /* TMPI_TMPI_H_ */
similarity index 99%
rename from src/external/thread_mpi/src/collective.c
rename to src/external/thread_mpi/src/collective.cpp
index 11a70977509818495f49eb1c557c11afb06b7e62..03a2dff8e88d27558c807857df9920a1eb0fd7f4 100644 (file)
@@ -143,6 +143,7 @@ void tMPI_Copy_buffer_list_return(struct copy_buffer_list *cbl,
 }
 #endif
 
+static
 int tMPI_Coll_envt_init(struct coll_env_thread *met, int N)
 {
     tMPI_Atomic_set(&(met->current_sync), 0);
@@ -177,6 +178,7 @@ int tMPI_Coll_envt_init(struct coll_env_thread *met, int N)
     return TMPI_SUCCESS;
 }
 
+static
 void tMPI_Coll_envt_destroy(struct coll_env_thread *met)
 {
     free( (void*)met->buf );
similarity index 96%
rename from src/external/thread_mpi/src/numa_malloc.c
rename to src/external/thread_mpi/src/numa_malloc.cpp
index c0c455d20a82d75f9ddf266092f21df00008a345..a873e86b71c2f81b94da18fc57e8630ab8064abb 100644 (file)
@@ -29,6 +29,8 @@
 
 #ifndef THREAD_WINDOWS
 
+#include "../include/thread_mpi/numa_malloc.h"
+
 /* We don't have specific NUMA aware allocators: */
 
 void *tMPI_Malloc_local(size_t size)
@@ -332,7 +334,7 @@ ReturnHeapHandle(
 
         HeapSetInformation(
                 hHeap,
-                0,          /* HeapCompatibilityInformation */
+                HEAP_INFORMATION_CLASS(0), /* HeapCompatibilityInformation */
                 &ulOption,
                 sizeof(ulOption)
                 );
@@ -443,7 +445,7 @@ void *tMPI_Realloc_local(void *ptr, size_t size)
 
     if (hHeap != phdr->hHeap)
     {
-        new_ptr = HeapAlloc( hHeap, 0, new_size );
+        new_ptr = static_cast<unsigned char *>(HeapAlloc( hHeap, 0, new_size ));
 
         /* if the new allocation succeeded, copy the buffer and free the
            original buffer.
@@ -485,12 +487,11 @@ void *tMPI_Realloc_local(void *ptr, size_t size)
 
         hHeap = phdr->hHeap;
 
-        new_ptr = HeapReAlloc(
-                    hHeap,
-                    0,
-                    phdr,
-                    new_size
-                    );
+        new_ptr = static_cast<unsigned char *>(HeapReAlloc(hHeap,
+                                                           0,
+                                                           phdr,
+                                                           new_size
+                                                           ));
     }
 
     if (new_ptr == NULL)
similarity index 99%
rename from src/external/thread_mpi/src/p2p_protocol.c
rename to src/external/thread_mpi/src/p2p_protocol.cpp
index c89e50323286e4f530eaddeeb02c8f3566ac89fe..05f45149c3e03213046d1442ef7dcd79bdb86b75 100644 (file)
@@ -578,7 +578,7 @@ void tMPI_Req_init(struct tmpi_req_ *rq, struct envelope *ev)
 }
 
 /* Point-to-point communication protocol functions */
-void tMPI_Set_req(struct envelope *ev, struct tmpi_req_ *req)
+static void tMPI_Set_req(struct envelope *ev, struct tmpi_req_ *req)
 {
     req->source = ev->src;
     req->comm   = ev->comm;
@@ -620,6 +620,7 @@ void tMPI_Set_status(struct tmpi_req_ *req, tMPI_Status *st)
     }
 }
 
+static
 tmpi_bool tMPI_Envelope_matches(const struct envelope *sev,
                                 const struct envelope *rev)
 {
@@ -654,6 +655,7 @@ tmpi_bool tMPI_Envelope_matches(const struct envelope *sev,
     return FALSE;
 }
 
+static
 struct envelope* tMPI_Send_env_list_search_old(struct send_envelope_list *evl,
                                                struct envelope           *rev)
 {
@@ -673,6 +675,7 @@ struct envelope* tMPI_Send_env_list_search_old(struct send_envelope_list *evl,
     return NULL;
 }
 
+static
 struct envelope* tMPI_Recv_env_list_search_new(struct recv_envelope_list *evl,
                                                struct envelope           *sev)
 {
@@ -753,6 +756,7 @@ void tMPI_Send_copy_buffer(struct envelope *sev, struct tmpi_req_ *req)
 }
 #endif
 
+static
 struct envelope* tMPI_Prep_send_envelope(struct send_envelope_list *evl,
                                          tMPI_Comm comm,
                                          struct tmpi_thread *src,
@@ -802,6 +806,7 @@ struct envelope* tMPI_Prep_send_envelope(struct send_envelope_list *evl,
     return ev;
 }
 
+static
 struct envelope* tMPI_Prep_recv_envelope(struct tmpi_thread *cur,
                                          tMPI_Comm comm,
                                          struct tmpi_thread *src,
similarity index 98%
rename from src/external/thread_mpi/src/pthreads.c
rename to src/external/thread_mpi/src/pthreads.cpp
index 9ead64079f3b342dc9feec74ff8f4d7898445fe0..2d88fde6350f7a5479ff643568b2991d4e729c86 100644 (file)
@@ -52,7 +52,8 @@
 
 #ifdef THREAD_PTHREADS
 
-#ifdef HAVE_PTHREAD_SETAFFINITY
+/* We wish to use some non-POSIX GNU extensions for handling thread affinity */
+#if defined(HAVE_PTHREAD_SETAFFINITY) && !defined(_GNU_SOURCE)
 #define _GNU_SOURCE
 #endif
 
@@ -318,7 +319,7 @@ tMPI_Thread_t tMPI_Thread_self(void)
         return NULL;
     }
 
-    th = pthread_getspecific(thread_id_key);
+    th = static_cast<tMPI_Thread_t>(pthread_getspecific(thread_id_key));
 
     /* check if it is already in our list */
     if (th == NULL)
@@ -361,7 +362,7 @@ int tMPI_Thread_setaffinity_single(tMPI_Thread_t tmpi_unused thread,
                                    unsigned int  tmpi_unused nr)
 {
 #ifdef HAVE_PTHREAD_SETAFFINITY
-    int       nt = tMPI_Thread_get_hw_number();
+    unsigned int nt = static_cast<unsigned int>(tMPI_Thread_get_hw_number());
     cpu_set_t set;
 
     if (nt < nr)
@@ -899,7 +900,11 @@ int tMPI_Thread_barrier_wait(tMPI_Thread_barrier_t * barrier)
     /* check whether the barrier is initialized */
     if (tMPI_Atomic_get( &(barrier->initialized)  ) == 0)
     {
-        tMPI_Thread_barrier_init_once(barrier);
+        ret = tMPI_Thread_barrier_init_once(barrier);
+        if (ret != 0)
+        {
+            return ret;
+        }
     }
 
 
index 88bcb84f8bad7f979341e3cf7f97e03376b8a8b5..46d116c721db6b0321a8ac0d4229796cca2adc55 100644 (file)
@@ -35,8 +35,6 @@
    files.
  */
 
-#ifdef __cplusplus
-
 #include <cerrno>
 #include <cstring>
 #include <cstdlib>
@@ -48,5 +46,3 @@ tMPI::system_error::system_error(error_code ec)
     : runtime_error(std::string(std::strerror(ec))), ec_(ec)
 {
 }
-
-#endif /* __cplusplus */
similarity index 99%
rename from src/external/thread_mpi/src/tmpi_init.c
rename to src/external/thread_mpi/src/tmpi_init.cpp
index 0728618d30b0f1e19cfdcdf3aa0949ef7f64051e..0be43601ae30dc3e38b3bb734006c58fe7ae552e 100644 (file)
@@ -57,6 +57,7 @@
 
 #endif
 
+#include <cassert>
 
 #include "impl.h"
 
@@ -98,6 +99,7 @@ struct tmpi_global *tmpi_global = NULL;
 
 
 /* start N threads with argc, argv (used by tMPI_Init)*/
+static
 int tMPI_Start_threads(tmpi_bool main_returns, int N,
                        tMPI_Affinity_strategy aff_strategy,
                        int *argc, char ***argv,
@@ -450,6 +452,7 @@ int tMPI_Start_threads(tmpi_bool main_returns, int N,
         {
             return ret;
         }
+        assert(TMPI_COMM_WORLD != nullptr);
         TMPI_GROUP_EMPTY = tMPI_Group_alloc();
 
         if (tMPI_Thread_key_create(&id_key, NULL))
similarity index 99%
rename from src/external/thread_mpi/src/winthreads.c
rename to src/external/thread_mpi/src/winthreads.cpp
index 2457de652604bbb947f54051661bbf62fded09a7..6b9a7a6d927ebac9e9fb5d7b6593557387155f1c 100644 (file)
@@ -364,8 +364,9 @@ int tMPI_Init_NUMA(void)
 
     /* allocate array of processor info blocks */
 
-    pMPI_ProcessorInfo = malloc( sizeof(MPI_NUMA_PROCESSOR_INFO) *
-                                 dwTotalProcessors );
+    pMPI_ProcessorInfo =
+        static_cast<MPI_NUMA_PROCESSOR_INFO *> (malloc( sizeof(MPI_NUMA_PROCESSOR_INFO) *
+                                                        dwTotalProcessors ));
     if (pMPI_ProcessorInfo == NULL)
     {
         goto cleanup;
index 6c3671bdbbd8989dc9e0318624993ba7b5b20c5c..6337ab6e71e0e8319a791a49604aae5524577423 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -114,15 +114,17 @@ BiasCoupledToSystem::BiasCoupledToSystem(Bias                    bias,
     GMX_RELEASE_ASSERT(static_cast<size_t>(bias.ndim()) == pullCoordIndex.size(), "The bias dimensionality should match the number of pull coordinates.");
 }
 
-Awh::Awh(FILE              *fplog,
-         const t_inputrec  &inputRecord,
-         const t_commrec   *commRecord,
-         const AwhParams   &awhParams,
-         const std::string &biasInitFilename,
-         pull_t            *pull_work) :
+Awh::Awh(FILE                 *fplog,
+         const t_inputrec     &inputRecord,
+         const t_commrec      *commRecord,
+         const gmx_multisim_t *multiSimRecord,
+         const AwhParams      &awhParams,
+         const std::string    &biasInitFilename,
+         pull_t               *pull_work) :
     seed_(awhParams.seed),
     nstout_(awhParams.nstOut),
     commRecord_(commRecord),
+    multiSimRecord_(multiSimRecord),
     pull_(pull_work),
     potentialOffset_(0)
 {
@@ -142,9 +144,9 @@ Awh::Awh(FILE              *fplog,
     }
 
     int numSharingSimulations = 1;
-    if (awhParams.shareBiasMultisim && MULTISIM(commRecord_))
+    if (awhParams.shareBiasMultisim && isMultiSim(multiSimRecord_))
     {
-        numSharingSimulations = commRecord_->ms->nsim;
+        numSharingSimulations = multiSimRecord_->nsim;
     }
 
     /* Initialize all the biases */
@@ -185,7 +187,7 @@ Awh::Awh(FILE              *fplog,
             pointSize.push_back(biasCts.bias.state().points().size());
         }
         /* Ensure that the shared biased are compatible between simulations */
-        biasesAreCompatibleForSharingBetweenSimulations(awhParams, pointSize, commRecord_->ms);
+        biasesAreCompatibleForSharingBetweenSimulations(awhParams, pointSize, multiSimRecord_);
     }
 }
 
@@ -240,7 +242,7 @@ real Awh::applyBiasForcesAndUpdateBias(int                     ePBC,
         gmx::ArrayRef<const double> biasForce =
             biasCts.bias.calcForceAndUpdateBias(coordValue,
                                                 &biasPotential, &biasPotentialJump,
-                                                commRecord_->ms,
+                                                multiSimRecord_,
                                                 t, step, seed_, fplog);
 
         awhPotential += biasPotential;
index 1fe09c9ff14d53cd342454a492ed11cf995a2648..26d4efe5bd685fb93772843aaf8ed96774067fbc 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -118,16 +118,18 @@ class Awh
          * \param[in,out] fplog             General output file, normally md.log, can be nullptr.
          * \param[in]     inputRecord       General input parameters (as set up by grompp).
          * \param[in]     commRecord        Struct for communication, can be nullptr.
+         * \param[in]     multiSimRecord    Multi-sim handler
          * \param[in]     awhParams         AWH input parameters, consistent with the relevant parts of \p inputRecord (as set up by grompp).
          * \param[in]     biasInitFilename  Name of file to read PMF and target from.
          * \param[in,out] pull_work         Pointer to a pull struct which AWH will couple to, has to be initialized, is assumed not to change during the lifetime of the Awh object.
          */
-        Awh(FILE              *fplog,
-            const t_inputrec  &inputRecord,
-            const t_commrec   *commRecord,
-            const AwhParams   &awhParams,
-            const std::string &biasInitFilename,
-            pull_t            *pull_work);
+        Awh(FILE                 *fplog,
+            const t_inputrec     &inputRecord,
+            const t_commrec      *commRecord,
+            const gmx_multisim_t *multiSimRecord,
+            const AwhParams      &awhParams,
+            const std::string    &biasInitFilename,
+            pull_t               *pull_work);
 
         /*! \brief Destructor. */
         ~Awh();
@@ -242,6 +244,7 @@ class Awh
         const gmx_int64_t                seed_;                /**< Random seed for MC jumping with umbrella type bias potential. */
         const int                        nstout_;              /**< Interval in steps for writing to energy file. */
         const t_commrec                 *commRecord_;          /**< Pointer to the communication record. */
+        const gmx_multisim_t            *multiSimRecord_;      /**< Handler for multi-simulations. */
         pull_t                          *pull_;                /**< Pointer to the pull working data. */
         double                           potentialOffset_;     /**< The offset of the bias potential which changes due to bias updates. */
 };
index 44d9c3e1bdd4e5b6f6b17df3a6b47a02ac9efbdd..3edd96a265c0950d74b9cacea5a04c3cc7f3314d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -43,8 +43,6 @@
 #ifndef GMX_COMMANDLINE_CMDLINEINIT_H
 #define GMX_COMMANDLINE_CMDLINEINIT_H
 
-#ifdef __cplusplus
-
 #include <functional>
 #include <memory>
 
@@ -182,10 +180,6 @@ int runCommandLineModule(int argc, char *argv[],
 
 } // namespace gmx
 
-extern "C"
-{
-#endif
-
 /*! \brief
  * Implements a main() method that runs a given C main function.
  *
@@ -220,8 +214,4 @@ extern "C"
  */
 int gmx_run_cmain(int argc, char *argv[], int (*mainFunction)(int, char *[]));
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif
index cbda55311ff5e91b4d9435ee27bb6666288015ff..904be4ce834b9eebf0d89ffa5e10e8bac8639d4f 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -44,6 +44,7 @@
 #include "gromacs/fileio/filetypes.h"
 #include "gromacs/utility/basedefinitions.h"
 #include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/smalloc.h"
 
 /* Use bitflag ... */
@@ -77,7 +78,7 @@ const char *opt2fn(const char *opt, int nfile, const t_filenm fnm[])
         }
     }
 
-    fprintf(stderr, "No option %s\n", opt);
+    GMX_RELEASE_ASSERT(false, "opt2fn should be called with a valid option");
 
     return nullptr;
 }
@@ -95,7 +96,8 @@ int opt2fns(char **fns[], const char *opt, int nfile, const t_filenm fnm[])
         }
     }
 
-    fprintf(stderr, "No option %s\n", opt);
+    GMX_RELEASE_ASSERT(false, "opt2fns should be called with a valid option");
+
     return 0;
 }
 
@@ -111,7 +113,8 @@ const char *ftp2fn(int ftp, int nfile, const t_filenm fnm[])
         }
     }
 
-    fprintf(stderr, "ftp2fn: No filetype %s\n", ftp2ext_with_dot(ftp));
+    GMX_RELEASE_ASSERT(false, "ftp2fn should be called with a valid option");
+
     return nullptr;
 }
 
@@ -128,7 +131,8 @@ int ftp2fns(char **fns[], int ftp, int nfile, const t_filenm fnm[])
         }
     }
 
-    fprintf(stderr, "ftp2fn: No filetype %s\n", ftp2ext_with_dot(ftp));
+    GMX_RELEASE_ASSERT(false, "ftp2fns should be called with a valid option");
+
     return 0;
 }
 
@@ -144,7 +148,7 @@ gmx_bool ftp2bSet(int ftp, int nfile, const t_filenm fnm[])
         }
     }
 
-    fprintf(stderr, "ftp2fn: No filetype %s\n", ftp2ext_with_dot(ftp));
+    GMX_RELEASE_ASSERT(false, "ftp2bSet should be called with a valid option");
 
     return FALSE;
 }
@@ -161,7 +165,7 @@ gmx_bool opt2bSet(const char *opt, int nfile, const t_filenm fnm[])
         }
     }
 
-    fprintf(stderr, "No option %s\n", opt);
+    GMX_RELEASE_ASSERT(false, "opt2bSet should be called with a valid option");
 
     return FALSE;
 }
@@ -184,7 +188,9 @@ const char *opt2fn_null(const char *opt, int nfile, const t_filenm fnm[])
             }
         }
     }
-    fprintf(stderr, "No option %s\n", opt);
+
+    GMX_RELEASE_ASSERT(false, "opt2fn_null should be called with a valid option");
+
     return nullptr;
 }
 
@@ -206,7 +212,9 @@ const char *ftp2fn_null(int ftp, int nfile, const t_filenm fnm[])
             }
         }
     }
-    fprintf(stderr, "ftp2fn: No filetype %s\n", ftp2ext_with_dot(ftp));
+
+    GMX_RELEASE_ASSERT(false, "ftp2fn_null should be called with a valid option");
+
     return nullptr;
 }
 
index 68b0fe3d478cf42f67610c64669eac85d56b2052..6d2a3545bd7b66418b90f6947ce6a328a399fad0 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -106,9 +106,9 @@ struct t_filenm {
  */
 const char *opt2fn(const char *opt, int nfile, const t_filenm fnm[]);
 
-/*! \brief
- * Returns the filenames belonging to cmd-line option opt, or NULL when
- * no such option.
+/*! \brief Sets in \c fns the filenames belonging to cmd-line option
+ * opt, or NULL when no such option. Returns the number of filenames
+ * found.
  */
 int opt2fns(char **fns[], const char *opt, int nfile,
             const t_filenm fnm[]);
index 66d049a155416f6baf5da29db06e9679706507ab..311cfbbc30286ae3fb323239f7e20ac68affea1c 100644 (file)
@@ -266,7 +266,7 @@ class OptionsAdapter
         /*! \brief
          * Copies values back from options to t_pargs/t_filenm.
          */
-        void copyValues(bool bReadNode);
+        void copyValues();
 
     private:
         struct FileNameData
@@ -419,15 +419,11 @@ void OptionsAdapter::pargsToOptions(Options *options, t_pargs *pa)
     GMX_THROW(NotImplementedError("Argument type not implemented"));
 }
 
-void OptionsAdapter::copyValues(bool bReadNode)
+void OptionsAdapter::copyValues()
 {
     std::list<FileNameData>::const_iterator file;
     for (file = fileNameOptions_.begin(); file != fileNameOptions_.end(); ++file)
     {
-        if (!bReadNode && (file->fnm->flag & ffREAD))
-        {
-            continue;
-        }
         if (file->optionInfo->isSet())
         {
             file->fnm->flag |= ffSET;
@@ -500,7 +496,7 @@ gmx_bool parse_common_args(int *argc, char *argv[], unsigned long Flags,
         gmx::FileNameOptionManager      fileOptManager;
 
         fileOptManager.disableInputOptionChecking(
-                isFlagSet(PCA_NOT_READ_NODE) || isFlagSet(PCA_DISABLE_INPUT_FILE_CHECKING));
+                isFlagSet(PCA_DISABLE_INPUT_FILE_CHECKING));
         options.addManager(&fileOptManager);
 
         if (isFlagSet(PCA_CAN_SET_DEFFNM))
@@ -611,7 +607,7 @@ gmx_bool parse_common_args(int *argc, char *argv[], unsigned long Flags,
             setTimeValue(TDELTA, tdelta);
         }
 
-        adapter.copyValues(!isFlagSet(PCA_NOT_READ_NODE));
+        adapter.copyValues();
 
         return TRUE;
     }
index 915f21cf4226d2421be1ef551c386205de3b7157..b09454ff87ede63372277928c8d4579ec5cb53a2 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -232,8 +232,6 @@ gmx_bool opt2parg_bSet(const char *option, int nparg, const t_pargs *pa);
 #define PCA_CAN_SET_DEFFNM (1<<10)
 /** Do not raise a fatal error when invalid options are encountered. */
 #define PCA_NOEXIT_ON_ARGS (1<<11)
-/** Is this node not reading: for parallel all nodes but the master */
-#define PCA_NOT_READ_NODE  (1<<16)
 /** Don't do any special processing for ffREAD files */
 #define PCA_DISABLE_INPUT_FILE_CHECKING (1<<17)
 
index 0eb9a17a3e7ae76f08e18494607d917e7a746119..1d8a7b47e33d4aca1723050ef754862298b260ae 100644 (file)
@@ -536,44 +536,6 @@ TEST_F(ParseCommonArgsTest, CompletesExtensionFromExistingFileWithDefaultFileNam
     done_filenms(nfile(), fnm);
 }
 
-/********************************************************************
- * Tests for general behavior
- */
-
-TEST_F(ParseCommonArgsTest, HandlesNonReadNode)
-{
-    t_filenm          fnm[] = {
-        { efTPS, "-s",  nullptr,  ffREAD },
-        { efTRX, "-f",  nullptr,  ffREAD },
-        { efTRX, "-f2", nullptr,  ffREAD }
-    };
-    const char *const cmdline[] = {
-        "test", "-f", "-f2", "other"
-    };
-    parseFromArray(cmdline, PCA_NOT_READ_NODE, fnm, gmx::EmptyArrayRef());
-    EXPECT_EQ(nullptr, fnm[0].fns);
-    EXPECT_EQ(nullptr, fnm[1].fns);
-    EXPECT_EQ(nullptr, fnm[2].fns);
-    done_filenms(nfile(), fnm);
-}
-
-TEST_F(ParseCommonArgsTest, HandlesNonReadNodeWithDefaultFileName)
-{
-    t_filenm          fnm[] = {
-        { efTPS, "-s",  nullptr,  ffREAD },
-        { efTRX, "-f",  nullptr,  ffREAD },
-        { efTRX, "-f2", nullptr,  ffREAD }
-    };
-    const char *const cmdline[] = {
-        "test", "-deffnm", "def", "-f", "-f2", "other"
-    };
-    parseFromArray(cmdline, PCA_CAN_SET_DEFFNM | PCA_NOT_READ_NODE, fnm, gmx::EmptyArrayRef());
-    EXPECT_EQ(nullptr, fnm[0].fns);
-    EXPECT_EQ(nullptr, fnm[1].fns);
-    EXPECT_EQ(nullptr, fnm[2].fns);
-    done_filenms(nfile(), fnm);
-}
-
 // This is needed e.g. for tune_pme, which passes unknown arguments on
 // to child mdrun processes that it spawns.
 TEST_F(ParseCommonArgsTest, CanKeepUnknownArgs)
index 33745e1be449fdf10041f66d41b5937bf4d76e36..f3c8eb9d0d9069f368e3f56888b1897b1695e526 100644 (file)
@@ -67,7 +67,6 @@
 #include "gromacs/mdlib/constr.h"
 #include "gromacs/mdlib/force.h"
 #include "gromacs/mdlib/forcerec.h"
-#include "gromacs/mdlib/genborn.h"
 #include "gromacs/mdlib/gmx_omp_nthreads.h"
 #include "gromacs/mdlib/mdatoms.h"
 #include "gromacs/mdlib/mdrun.h"
@@ -391,8 +390,10 @@ void dd_get_constraint_range(const gmx_domdec_t *dd, int *at_start, int *at_end)
     *at_end   = dd->comm->nat[ddnatCON];
 }
 
-void dd_move_x(gmx_domdec_t *dd, matrix box, rvec x[])
+void dd_move_x(gmx_domdec_t *dd, matrix box, rvec x[], gmx_wallcycle *wcycle)
 {
+    wallcycle_start(wcycle, ewcMOVEX);
+
     int                    nzone, nat_tot, n, d, p, i, j, at0, at1, zone;
     int                   *index, *cgindex;
     gmx_domdec_comm_t     *comm;
@@ -499,10 +500,14 @@ void dd_move_x(gmx_domdec_t *dd, matrix box, rvec x[])
         }
         nzone += nzone;
     }
+
+    wallcycle_stop(wcycle, ewcMOVEX);
 }
 
-void dd_move_f(gmx_domdec_t *dd, rvec f[], rvec *fshift)
+void dd_move_f(gmx_domdec_t *dd, rvec f[], rvec *fshift, gmx_wallcycle *wcycle)
 {
+    wallcycle_start(wcycle, ewcMOVEF);
+
     int                    nzone, nat_tot, n, d, p, i, j, at0, at1, zone;
     int                   *index, *cgindex;
     gmx_domdec_comm_t     *comm;
@@ -620,6 +625,7 @@ void dd_move_f(gmx_domdec_t *dd, rvec f[], rvec *fshift)
         }
         nzone /= 2;
     }
+    wallcycle_stop(wcycle, ewcMOVEF);
 }
 
 void dd_atom_spread_real(gmx_domdec_t *dd, real v[])
@@ -9196,7 +9202,7 @@ void dd_partition_system(FILE                *fplog,
                          gmx_vsite_t         *vsite,
                          gmx_constr_t         constr,
                          t_nrnb              *nrnb,
-                         gmx_wallcycle_t      wcycle,
+                         gmx_wallcycle       *wcycle,
                          gmx_bool             bVerbose)
 {
     gmx_domdec_t      *dd;
@@ -9755,11 +9761,6 @@ void dd_partition_system(FILE                *fplog,
     mdAlgorithmsSetupAtomData(cr, ir, top_global, top_local, fr,
                               nullptr, mdAtoms, vsite, nullptr);
 
-    if (ir->implicit_solvent)
-    {
-        make_local_gb(cr, fr->born, ir->gb_algorithm);
-    }
-
     auto mdatoms = mdAtoms->mdatoms();
     if (!thisRankHasDuty(cr, DUTY_PME))
     {
@@ -9814,7 +9815,7 @@ void dd_partition_system(FILE                *fplog,
 
     if (comm->nstDDDump > 0 && step % comm->nstDDDump == 0)
     {
-        dd_move_x(dd, state_local->box, as_rvec_array(state_local->x.data()));
+        dd_move_x(dd, state_local->box, as_rvec_array(state_local->x.data()), nullWallcycle);
         write_dd_pdb("dd_dump", step, "dump", top_global, cr,
                      -1, as_rvec_array(state_local->x.data()), state_local->box);
     }
index 44f61a0372d2495b18d24f8c13b57649b091ba9d..d058c2f78a366f02b8a5cf60f0425e5cadaac046 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2005,2006,2007,2008,2009,2010,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2005,2006,2007,2008,2009,2010,2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #ifndef GMX_DOMDEC_DOMDEC_H
 #define GMX_DOMDEC_DOMDEC_H
 
-#include <stdio.h>
-
 #include <vector>
 
-#include "gromacs/gmxlib/nrnb.h"
+#include "gromacs/math/paddedvector.h"
 #include "gromacs/math/vectypes.h"
-#include "gromacs/mdlib/vsite.h"
-#include "gromacs/mdtypes/forcerec.h"
-#include "gromacs/mdtypes/mdatom.h"
-#include "gromacs/timing/wallcycle.h"
-#include "gromacs/topology/block.h"
-#include "gromacs/topology/idef.h"
-#include "gromacs/topology/topology.h"
 #include "gromacs/utility/arrayref.h"
 #include "gromacs/utility/basedefinitions.h"
 #include "gromacs/utility/real.h"
 
+struct cginfo_mb_t;
 struct gmx_domdec_t;
 struct gmx_ddbox_t;
 struct gmx_domdec_zones_t;
+struct gmx_localtop_t;
+struct gmx_mtop_t;
+struct gmx_vsite_t;
 struct MdrunOptions;
+struct t_block;
+struct t_blocka;
 struct t_commrec;
+struct t_forcerec;
 struct t_inputrec;
+struct t_mdatoms;
+struct t_nrnb;
+struct gmx_wallcycle;
 class t_state;
 
 namespace gmx
@@ -287,14 +288,14 @@ void dd_force_flop_stop(struct gmx_domdec_t *dd, t_nrnb *nrnb);
 float dd_pme_f_ratio(struct gmx_domdec_t *dd);
 
 /*! \brief Communicate the coordinates to the neighboring cells and do pbc. */
-void dd_move_x(struct gmx_domdec_t *dd, matrix box, rvec x[]);
+void dd_move_x(struct gmx_domdec_t *dd, matrix box, rvec x[], gmx_wallcycle *wcycle);
 
 /*! \brief Sum the forces over the neighboring cells.
  *
  * When fshift!=NULL the shift forces are updated to obtain
  * the correct virial from the single sum including f.
  */
-void dd_move_f(struct gmx_domdec_t *dd, rvec f[], rvec *fshift);
+void dd_move_f(struct gmx_domdec_t *dd, rvec f[], rvec *fshift, gmx_wallcycle *wcycle);
 
 /*! \brief Communicate a real for each atom to the neighboring cells. */
 void dd_atom_spread_real(struct gmx_domdec_t *dd, real v[]);
@@ -325,7 +326,7 @@ void dd_partition_system(FILE                *fplog,
                          gmx_vsite_t         *vsite,
                          struct gmx_constr   *constr,
                          t_nrnb              *nrnb,
-                         gmx_wallcycle_t      wcycle,
+                         gmx_wallcycle       *wcycle,
                          gmx_bool             bVerbose);
 
 /*! \brief Reset all the statistics and counters for total run counting */
index 257ceaec646b65933b2dbdd149f5dd72197d1f7b..c5c3018c6a7d1c18a93db15f1133abfa5e75e724 100644 (file)
@@ -54,6 +54,7 @@
 #include "gromacs/mdtypes/commrec.h"
 #include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/pbcutil/pbc.h"
+#include "gromacs/topology/block.h"
 #include "gromacs/utility/fatalerror.h"
 
 /*! \brief Calculates the average and standard deviation in 3D of n charge groups */
index c20440a276632211f0d628470c58ed7319d76b85..01ce45282e01d4ff505e5576ffbfba5830ef91c4 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2006,2007,2008,2009,2010,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2006,2007,2008,2009,2010,2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -58,6 +58,7 @@
 #include "gromacs/mdlib/constr.h"
 #include "gromacs/mdlib/gmx_omp_nthreads.h"
 #include "gromacs/mdtypes/commrec.h"
+#include "gromacs/mdtypes/forcerec.h" // only for GET_CGINFO_*
 #include "gromacs/pbcutil/ishift.h"
 #include "gromacs/topology/mtop_lookup.h"
 #include "gromacs/utility/exceptions.h"
index f26700fbe59600bfceec8f985fbbde95a78ae514..e1107052d6267a284124c005b92db7e985553b24 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 
 #include "gromacs/domdec/domdec.h"
 #include "gromacs/domdec/domdec_struct.h"
-#include "gromacs/mdtypes/commrec.h"
 #include "gromacs/timing/cyclecounter.h"
 #include "gromacs/topology/block.h"
 
+struct t_commrec;
+
 /*! \cond INTERNAL */
 
 struct BalanceRegion;
index dfa9c1418405853a3456c53a04ac9ca7e894e01a..f22e7ecf092ad43bc2babceaa91632233b5b00c1 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2008,2009,2010,2011,2012,2013,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2008,2009,2010,2011,2012,2013,2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -60,6 +60,7 @@
 #include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/mdtypes/md_enums.h"
 #include "gromacs/pbcutil/pbc.h"
+#include "gromacs/topology/topology.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 
index 9484c9debce75686a825274d0035fb17b869a374..825fdc4f9cadc070d0891be516d7a40804964dec 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2005,2006,2007,2008,2009,2010,2012,2013,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2005,2006,2007,2008,2009,2010,2012,2013,2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #define GMX_DOMDEC_DOMDEC_SPECATOMCOMM_H
 
 #include "gromacs/math/vectypes.h"
-#include "gromacs/mdtypes/commrec.h"
 #include "gromacs/utility/basedefinitions.h"
 
+struct gmx_domdec_t;
 struct gmx_hash_t;
+struct t_commrec;
 
 typedef struct {
     int  nsend;
index 92ac66d1ac0b1a84f1e713eb7a6e61279ea571d6..b18ee3f16984e0a4e2da0969fdd4d8d191a626a3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -67,6 +67,7 @@
 #include "gromacs/mdtypes/commrec.h"
 #include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/mdtypes/md_enums.h"
+#include "gromacs/mdtypes/mdatom.h"
 #include "gromacs/mdtypes/state.h"
 #include "gromacs/pbcutil/mshift.h"
 #include "gromacs/pbcutil/pbc.h"
@@ -788,22 +789,6 @@ void dd_make_reverse_top(FILE *fplog,
 
     gmx_reverse_top_t *rt = dd->reverse_top;
 
-    if (rt->ril_mt_tot_size >= 200000 &&
-        mtop->mols.nr > 1 &&
-        mtop->nmolblock == 1 && mtop->molblock[0].nmol == 1)
-    {
-        /* mtop comes from a pre Gromacs 4 tpr file */
-        const char *note = "NOTE: The tpr file used for this simulation is in an old format, for less memory usage and possibly more performance create a new tpr file with an up to date version of grompp";
-        if (fplog)
-        {
-            fprintf(fplog, "\n%s\n\n", note);
-        }
-        if (DDMASTER(dd))
-        {
-            fprintf(stderr, "\n%s\n\n", note);
-        }
-    }
-
     /* With the Verlet scheme, exclusions are handled in the non-bonded
      * kernels and only exclusions inside the cut-off lead to exclusion
      * forces. Since each atom pair is treated at most once in the non-bonded
@@ -874,7 +859,7 @@ void dd_make_reverse_top(FILE *fplog,
  * confuses static analysis tools unless we fuse the vsite
  * atom-indexing organization code with the ifunc-adding code, so that
  * they can see that nral is the same value. */
-static gmx_inline void
+static inline void
 add_ifunc_for_vsites(t_iatom *tiatoms, gmx_ga2la_t *ga2la,
                      int nral, gmx_bool bHomeA,
                      int a, int a_gl, int a_mol,
@@ -923,7 +908,7 @@ add_ifunc_for_vsites(t_iatom *tiatoms, gmx_ga2la_t *ga2la,
 }
 
 /*! \brief Store a bonded interaction at the end of \p il */
-static gmx_inline void add_ifunc(int nral, t_iatom *tiatoms, t_ilist *il)
+static inline void add_ifunc(int nral, t_iatom *tiatoms, t_ilist *il)
 {
     t_iatom *liatoms;
     int      k;
@@ -1302,7 +1287,7 @@ static void combine_idef(t_idef *dest, const thread_work_t *src, int nsrc,
 
 /*! \brief Check and when available assign bonded interactions for local atom i
  */
-static gmx_inline void
+static inline void
 check_assign_interactions_atom(int i, int i_gl,
                                int mol, int i_mol,
                                const int *index, const int *rtil,
index f8faac4d34f7a43617c2b73d07e4780bb7e8a3f2..9ef7c8958a368bac21875065f5465db5ab6300b8 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2010,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -48,7 +48,6 @@
 #ifndef GMX_DOMDEC_GA2LA_H
 #define GMX_DOMDEC_GA2LA_H
 
-#include "gromacs/mdtypes/commrec.h"
 #include "gromacs/utility/basedefinitions.h"
 #include "gromacs/utility/smalloc.h"
 
index 3d3b8f15f839a4d93cda5df50af69c42a202382d..765a0f370a4a1ec3958b6bfd10d8b700b8ef27b8 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 
 #include <stdio.h>
 
-#include "gromacs/mdtypes/commrec.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 
+struct t_commrec;
+
 /*! \internal \brief Hashing key-generation helper struct */
 struct gmx_hash_e_t
 {
index f1014be513113bdc180d77f5b30f1997c27f8a62..891491b19eb80e9f0d49b12f0271f3e0d13d46bd 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -1950,7 +1950,7 @@ void dd_make_local_ed_indices(gmx_domdec_t *dd, struct gmx_edsam *ed)
 }
 
 
-static gmx_inline void ed_unshift_single_coord(matrix box, const rvec x, const ivec is, rvec xu)
+static inline void ed_unshift_single_coord(matrix box, const rvec x, const ivec is, rvec xu)
 {
     int tx, ty, tz;
 
index cd0ca1e98512a19ad2fcfbcd77d961d715488e8d..f295328ef1d77fb23594808967a1f9e1de404e2b 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -64,6 +64,7 @@
 #include "gromacs/math/vec.h"
 #include "gromacs/math/vectypes.h"
 #include "gromacs/mdtypes/commrec.h"
+#include "gromacs/mdtypes/forcerec.h"
 #include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/mdtypes/md_enums.h"
 #include "gromacs/utility/fatalerror.h"
index 6d31ab8380cd8abfc27398dae617c7773c90db39..2361e67995da37221cd44e1b1ac316993344a1f0 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #include <stdio.h>
 
 #include "gromacs/math/vectypes.h"
-#include "gromacs/mdtypes/commrec.h"
-#include "gromacs/mdtypes/forcerec.h"
 #include "gromacs/utility/real.h"
 
+struct t_commrec;
+struct t_forcerec;
 struct t_inputrec;
 
 /* Forward declaration of type for managing Ewald tables */
index 026189262a4a71490ab6eedb87a4b6acfca2abf7..1a87917b89d5015d0ed07b1c6b91fe718522c70a 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #define GMX_EWALD_LONG_RANGE_CORRECTION_H
 
 #include "gromacs/math/vectypes.h"
-#include "gromacs/mdtypes/commrec.h"
-#include "gromacs/mdtypes/forcerec.h"
 #include "gromacs/topology/block.h"
 #include "gromacs/utility/basedefinitions.h"
 #include "gromacs/utility/real.h"
 
+struct t_commrec;
+struct t_forcerec;
 struct t_inputrec;
 
 /*! \brief Calculate long-range Ewald correction terms.
index edaf535b5c8c99bdd5194d0fb4b7be60912f58f0..e9c5c0d8935697f254c46f9c8a140e33ea0bb4bb 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
index 7a033ca7ffb4fc5645a735c9431879e766cd349f..c4a9ae9689ea34379479abe81fd779d29bf120a2 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -201,9 +201,6 @@ static void pme_gpu_copy_common_data_from(const gmx_pme_t *pme)
     pmeGpu->common->nk[XX]        = pme->nkx;
     pmeGpu->common->nk[YY]        = pme->nky;
     pmeGpu->common->nk[ZZ]        = pme->nkz;
-    pmeGpu->common->pmegrid_n[XX] = pme->pmegrid_nx;
-    pmeGpu->common->pmegrid_n[YY] = pme->pmegrid_ny;
-    pmeGpu->common->pmegrid_n[ZZ] = pme->pmegrid_nz;
     pmeGpu->common->pme_order     = pme->pme_order;
     for (int i = 0; i < DIM; i++)
     {
index 454a44cfda249c6e82d5be656a71173d3202ee07..baef28566275594ff82001755d77f27ab25fd8fe 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -496,7 +496,7 @@ CUDA_FUNC_QUALIFIER void pme_gpu_gather(PmeGpu                *CUDA_FUNC_ARGUMEN
  * \param[in] pmeGpu         The PME GPU structure.
  * \returns                  True if PME runs on multiple GPUs, false otherwise.
  */
-gmx_inline bool pme_gpu_uses_dd(const PmeGpu *pmeGpu)
+inline bool pme_gpu_uses_dd(const PmeGpu *pmeGpu)
 {
     return !pmeGpu->settings.useDecomposition;
 }
@@ -507,7 +507,7 @@ gmx_inline bool pme_gpu_uses_dd(const PmeGpu *pmeGpu)
  * \param[in] pmeGpu         The PME GPU structure.
  * \returns                  True if the gathering is performed on GPU, false otherwise.
  */
-gmx_inline bool pme_gpu_performs_gather(const PmeGpu *pmeGpu)
+inline bool pme_gpu_performs_gather(const PmeGpu *pmeGpu)
 {
     return pmeGpu->settings.performGPUGather;
 }
@@ -518,7 +518,7 @@ gmx_inline bool pme_gpu_performs_gather(const PmeGpu *pmeGpu)
  * \param[in] pmeGpu         The PME GPU structure.
  * \returns                  True if FFT is performed on GPU, false otherwise.
  */
-gmx_inline bool pme_gpu_performs_FFT(const PmeGpu *pmeGpu)
+inline bool pme_gpu_performs_FFT(const PmeGpu *pmeGpu)
 {
     return pmeGpu->settings.performGPUFFT;
 }
@@ -529,7 +529,7 @@ gmx_inline bool pme_gpu_performs_FFT(const PmeGpu *pmeGpu)
  * \param[in] pmeGpu         The PME GPU structure.
  * \returns                  True if (un-)wrapping is performed on GPU, false otherwise.
  */
-gmx_inline bool pme_gpu_performs_wrapping(const PmeGpu *pmeGpu)
+inline bool pme_gpu_performs_wrapping(const PmeGpu *pmeGpu)
 {
     return pmeGpu->settings.useDecomposition;
 }
@@ -540,7 +540,7 @@ gmx_inline bool pme_gpu_performs_wrapping(const PmeGpu *pmeGpu)
  * \param[in] pmeGpu         The PME GPU structure.
  * \returns                  True if solving is performed on GPU, false otherwise.
  */
-gmx_inline bool pme_gpu_performs_solve(const PmeGpu *pmeGpu)
+inline bool pme_gpu_performs_solve(const PmeGpu *pmeGpu)
 {
     return pmeGpu->settings.performGPUSolve;
 }
@@ -553,7 +553,7 @@ gmx_inline bool pme_gpu_performs_solve(const PmeGpu *pmeGpu)
  * \param[in] pmeGpu             The PME GPU structure.
  * \param[in] testing            Should the testing mode be enabled, or disabled.
  */
-gmx_inline void pme_gpu_set_testing(PmeGpu *pmeGpu, bool testing)
+inline void pme_gpu_set_testing(PmeGpu *pmeGpu, bool testing)
 {
     pmeGpu->settings.copyAllOutputs = testing;
     pmeGpu->settings.transferKind   = testing ? GpuApiCallBehavior::Sync : GpuApiCallBehavior::Async;
@@ -565,7 +565,7 @@ gmx_inline void pme_gpu_set_testing(PmeGpu *pmeGpu, bool testing)
  * \param[in] pmeGpu             The PME GPU structure.
  * \returns                      true if testing mode is enabled, false otherwise.
  */
-gmx_inline bool pme_gpu_is_testing(const PmeGpu *pmeGpu)
+inline bool pme_gpu_is_testing(const PmeGpu *pmeGpu)
 {
     return pmeGpu->settings.copyAllOutputs;
 }
index 5d689c1cf9d6ca4ca6584be42ba371f1992b08b7..003bc60170ae18545ee245627b774f6df92d05ea 100644 (file)
@@ -285,13 +285,9 @@ struct PmeGpuStaging
 struct PmeShared
 {
     /*! \brief Grid count - currently always 1 on GPU */
-    int ngrids;
+    int                    ngrids;
     /*! \brief Grid dimensions - nkx, nky, nkz */
-    int nk[DIM];
-    /*! \brief Padded grid dimensions - pmegrid_nx, pmegrid_ny, pmegrid_nz
-     * TODO: find out if these are really needed for the CPU FFT compatibility.
-     */
-    int                    pmegrid_n[DIM];
+    int                    nk[DIM];
     /*! \brief PME interpolation order */
     int                    pme_order;
     /*! \brief Ewald splitting coefficient for Coulomb */
index ab13d44db58e6168f2f955ff0361e3e3f00f8e90..ba53868eb3cdfbe71888d0d4b6de7d2c8e1ef8ac 100644 (file)
@@ -170,7 +170,7 @@ void inline parallel_3dfft_execute_gpu_wrapper(gmx_pme_t              *pme,
 void pme_gpu_prepare_computation(gmx_pme_t            *pme,
                                  bool                  needToUpdateBox,
                                  const matrix          box,
-                                 gmx_wallcycle_t       wcycle,
+                                 gmx_wallcycle        *wcycle,
                                  int                   flags)
 {
     GMX_ASSERT(pme_gpu_active(pme), "This should be a GPU run of PME but it is not enabled.");
@@ -213,7 +213,7 @@ void pme_gpu_prepare_computation(gmx_pme_t            *pme,
 
 void pme_gpu_launch_spread(gmx_pme_t            *pme,
                            const rvec           *x,
-                           gmx_wallcycle_t       wcycle)
+                           gmx_wallcycle        *wcycle)
 {
     GMX_ASSERT(pme_gpu_active(pme), "This should be a GPU run of PME but it is not enabled.");
 
@@ -242,7 +242,7 @@ void pme_gpu_launch_spread(gmx_pme_t            *pme,
 }
 
 void pme_gpu_launch_complex_transforms(gmx_pme_t      *pme,
-                                       gmx_wallcycle_t wcycle)
+                                       gmx_wallcycle  *wcycle)
 {
     PmeGpu            *pmeGpu                 = pme->gpu;
     const bool         computeEnergyAndVirial = pmeGpu->settings.currentFlags & GMX_PME_CALC_ENER_VIR;
@@ -298,7 +298,7 @@ void pme_gpu_launch_complex_transforms(gmx_pme_t      *pme,
 }
 
 void pme_gpu_launch_gather(const gmx_pme_t                 *pme,
-                           gmx_wallcycle_t gmx_unused       wcycle,
+                           gmx_wallcycle gmx_unused        *wcycle,
                            PmeForceOutputHandling           forceTreatment)
 {
     GMX_ASSERT(pme_gpu_active(pme), "This should be a GPU run of PME but it is not enabled.");
@@ -346,7 +346,7 @@ static void pme_gpu_get_staged_results(const gmx_pme_t                *pme,
 }
 
 bool pme_gpu_try_finish_task(const gmx_pme_t                *pme,
-                             gmx_wallcycle_t                 wcycle,
+                             gmx_wallcycle                  *wcycle,
                              gmx::ArrayRef<const gmx::RVec> *forces,
                              matrix                          virial,
                              real                           *energy,
@@ -391,7 +391,7 @@ bool pme_gpu_try_finish_task(const gmx_pme_t                *pme,
 }
 
 void pme_gpu_wait_finish_task(const gmx_pme_t                *pme,
-                              gmx_wallcycle_t                 wcycle,
+                              gmx_wallcycle                  *wcycle,
                               gmx::ArrayRef<const gmx::RVec> *forces,
                               matrix                          virial,
                               real                           *energy)
index 937584ca6192a64b3cb28d7349db84a7ca9907eb..dcf2a06c3cc624a15b3e362bd18e82faf033580b 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -73,22 +73,22 @@ void gmx_sum_qgrid_dd(struct gmx_pme_t *pme, real *grid, int direction)
     int            recv_index0, recv_nindex;
     MPI_Status     stat;
     int            i, j, k, ix, iy, iz, icnt;
-    int            ipulse, send_id, recv_id, datasize;
+    int            send_id, recv_id, datasize;
     real          *p;
     real          *sendptr, *recvptr;
 
     /* Start with minor-rank communication. This is a bit of a pain since it is not contiguous */
     overlap = &pme->overlap[1];
 
-    for (ipulse = 0; ipulse < overlap->noverlap_nodes; ipulse++)
+    for (size_t ipulse = 0; ipulse < overlap->comm_data.size(); ipulse++)
     {
         /* Since we have already (un)wrapped the overlap in the z-dimension,
          * we only have to communicate 0 to nkz (not pmegrid_nz).
          */
         if (direction == GMX_SUM_GRID_FORWARD)
         {
-            send_id       = overlap->send_id[ipulse];
-            recv_id       = overlap->recv_id[ipulse];
+            send_id       = overlap->comm_data[ipulse].send_id;
+            recv_id       = overlap->comm_data[ipulse].recv_id;
             send_index0   = overlap->comm_data[ipulse].send_index0;
             send_nindex   = overlap->comm_data[ipulse].send_nindex;
             recv_index0   = overlap->comm_data[ipulse].recv_index0;
@@ -96,8 +96,8 @@ void gmx_sum_qgrid_dd(struct gmx_pme_t *pme, real *grid, int direction)
         }
         else
         {
-            send_id       = overlap->recv_id[ipulse];
-            recv_id       = overlap->send_id[ipulse];
+            send_id       = overlap->comm_data[ipulse].recv_id;
+            recv_id       = overlap->comm_data[ipulse].send_id;
             send_index0   = overlap->comm_data[ipulse].recv_index0;
             send_nindex   = overlap->comm_data[ipulse].recv_nindex;
             recv_index0   = overlap->comm_data[ipulse].send_index0;
@@ -130,9 +130,9 @@ void gmx_sum_qgrid_dd(struct gmx_pme_t *pme, real *grid, int direction)
 
         datasize      = pme->pmegrid_nx * pme->nkz;
 
-        MPI_Sendrecv(overlap->sendbuf, send_nindex*datasize, GMX_MPI_REAL,
+        MPI_Sendrecv(overlap->sendbuf.data(), send_nindex*datasize, GMX_MPI_REAL,
                      send_id, ipulse,
-                     overlap->recvbuf, recv_nindex*datasize, GMX_MPI_REAL,
+                     overlap->recvbuf.data(), recv_nindex*datasize, GMX_MPI_REAL,
                      recv_id, ipulse,
                      overlap->mpi_comm, &stat);
 
@@ -175,22 +175,22 @@ void gmx_sum_qgrid_dd(struct gmx_pme_t *pme, real *grid, int direction)
      */
     overlap = &pme->overlap[0];
 
-    for (ipulse = 0; ipulse < overlap->noverlap_nodes; ipulse++)
+    for (size_t ipulse = 0; ipulse < overlap->comm_data.size(); ipulse++)
     {
         if (direction == GMX_SUM_GRID_FORWARD)
         {
-            send_id       = overlap->send_id[ipulse];
-            recv_id       = overlap->recv_id[ipulse];
+            send_id       = overlap->comm_data[ipulse].send_id;
+            recv_id       = overlap->comm_data[ipulse].recv_id;
             send_index0   = overlap->comm_data[ipulse].send_index0;
             send_nindex   = overlap->comm_data[ipulse].send_nindex;
             recv_index0   = overlap->comm_data[ipulse].recv_index0;
             recv_nindex   = overlap->comm_data[ipulse].recv_nindex;
-            recvptr       = overlap->recvbuf;
+            recvptr       = overlap->recvbuf.data();
         }
         else
         {
-            send_id       = overlap->recv_id[ipulse];
-            recv_id       = overlap->send_id[ipulse];
+            send_id       = overlap->comm_data[ipulse].recv_id;
+            recv_id       = overlap->comm_data[ipulse].send_id;
             send_index0   = overlap->comm_data[ipulse].recv_index0;
             send_nindex   = overlap->comm_data[ipulse].recv_nindex;
             recv_index0   = overlap->comm_data[ipulse].send_index0;
index b7eac933689cb5f943bbfa4b58ad04d3390aa599..b8c6900d58a6a35f4cacbb03ced2cb886249d8cc 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -115,29 +115,32 @@ void gmx_pme_reinit(struct gmx_pme_t **pmedata,
 //! @cond Doxygen_Suppress
 
 /*! \brief Data structure for grid communication */
-typedef struct {
+struct pme_grid_comm_t
+{
+    int send_id;         //!< Source rank id
     int send_index0;
     int send_nindex;
+    int recv_id;         //!< Destination rank id
     int recv_index0;
     int recv_nindex;
-    int recv_size;   /* Receive buffer width, used with OpenMP */
-} pme_grid_comm_t;
+    int recv_size = 0;   //!< Receive buffer width, used with OpenMP
+};
 
-/*! \brief Data structure for grid overlap communication */
-typedef struct {
+/*! \brief Data structure for grid overlap communication in a single dimension */
+struct pme_overlap_t
+{
 #if GMX_MPI
-    MPI_Comm         mpi_comm;
+    MPI_Comm                     mpi_comm;       //!< MPI communcator
 #endif
-    int              nnodes, nodeid;
-    int             *s2g0;
-    int             *s2g1;
-    int              noverlap_nodes;
-    int             *send_id, *recv_id;
-    int              send_size; /* Send buffer width, used with OpenMP */
-    pme_grid_comm_t *comm_data;
-    real            *sendbuf;
-    real            *recvbuf;
-} pme_overlap_t;
+    int                          nnodes;         //!< Number of ranks
+    int                          nodeid;         //!< Unique rank identifcator
+    std::vector<int>             s2g0;           //!< The local interpolation grid start
+    std::vector<int>             s2g1;           //!< The local interpolation grid end
+    int                          send_size;      //!< Send buffer width, used with OpenMP
+    std::vector<pme_grid_comm_t> comm_data;      //!< All the individual communication data for each rank
+    std::vector<real>            sendbuf;        //!< Shared buffer for sending
+    std::vector<real>            recvbuf;        //!< Shared buffer for receiving
+};
 
 /*! \brief Data structure for organizing particle allocation to threads */
 typedef struct {
index c9935fe83972d2b9825f7771532929c28dd8c61d..d88a0dd2ce05c582761af6aba165ada680501a47 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -45,8 +45,6 @@
 
 #include "pme-load-balancing.h"
 
-#include "config.h"
-
 #include <assert.h>
 
 #include <cmath>
@@ -842,25 +840,6 @@ pme_load_balance(pme_load_balancing_t      *pme_lb,
 
     nbnxn_gpu_pme_loadbal_update_param(nbv, ic, listParams);
 
-    /* With tMPI + GPUs some ranks may be sharing GPU(s) and therefore
-     * also sharing texture references. To keep the code simple, we don't
-     * treat texture references as shared resources, but this means that
-     * the coulomb_tab texture ref will get updated by multiple threads.
-     * Hence, to ensure that the non-bonded kernels don't start before all
-     * texture binding operations are finished, we need to wait for all ranks
-     * to arrive here before continuing.
-     *
-     * Note that we could omit this barrier if GPUs are not shared (or
-     * texture objects are used), but as this is initialization code, there
-     * is not point in complicating things.
-     */
-#if GMX_THREAD_MPI
-    if (PAR(cr) && use_GPU(nbv))
-    {
-        gmx_barrier(cr);
-    }
-#endif  /* GMX_THREAD_MPI */
-
     if (!pme_lb->bSepPMERanks)
     {
         /* FIXME:
index 509744d934654e85f8ea806adf792cb27e9a012b..34d81fafe900dcae70cc4e5457fd7f61d107c4f9 100644 (file)
@@ -534,7 +534,7 @@ static void gmx_pme_send_force_vir_ener(gmx_pme_pp *pme_pp,
 
 int gmx_pmeonly(struct gmx_pme_t *pme,
                 t_commrec *cr,    t_nrnb *mynrnb,
-                gmx_wallcycle_t wcycle,
+                gmx_wallcycle  *wcycle,
                 gmx_walltime_accounting_t walltime_accounting,
                 t_inputrec *ir, PmeRunMode runMode)
 {
index 837cc1d1afa5b384f0f0392545b1252c929cf7a3..67ee1d773d4af02a39931c3e14e0c669e433b16e 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -61,6 +61,7 @@
 #include "gromacs/mdtypes/forceoutput.h"
 #include "gromacs/mdtypes/interaction_const.h"
 #include "gromacs/mdtypes/md_enums.h"
+#include "gromacs/timing/wallcycle.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/gmxmpi.h"
 #include "gromacs/utility/smalloc.h"
@@ -246,8 +247,10 @@ void gmx_pme_send_parameters(t_commrec *cr,
 void gmx_pme_send_coordinates(t_commrec *cr, matrix box, rvec *x,
                               real lambda_q, real lambda_lj,
                               gmx_bool bEnerVir,
-                              gmx_int64_t step)
+                              gmx_int64_t step, gmx_wallcycle *wcycle)
 {
+    wallcycle_start(wcycle, ewcPP_PMESENDX);
+
     unsigned int flags = PP_PME_COORD;
     if (bEnerVir)
     {
@@ -255,6 +258,8 @@ void gmx_pme_send_coordinates(t_commrec *cr, matrix box, rvec *x,
     }
     gmx_pme_send_coeffs_coords(cr, flags, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
                                box, x, lambda_q, lambda_lj, 0, 0, step);
+
+    wallcycle_stop(wcycle, ewcPP_PMESENDX);
 }
 
 void gmx_pme_send_finish(t_commrec *cr)
index 28a020ae892ef44836e712ad0a0d95d8ddcf8966..f9cccf78d7a1d4e4e9713a7a50901b9e0d269ce5 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -220,7 +220,7 @@ void get_pme_ener_vir_lj(struct pme_solve_work_t *work, int nthread,
 
 #if defined PME_SIMD_SOLVE
 /* Calculate exponentials through SIMD */
-gmx_inline static void calc_exponentials_q(int, int, real f, ArrayRef<const SimdReal> d_aligned, ArrayRef<const SimdReal> r_aligned, ArrayRef<SimdReal> e_aligned)
+inline static void calc_exponentials_q(int, int, real f, ArrayRef<const SimdReal> d_aligned, ArrayRef<const SimdReal> r_aligned, ArrayRef<SimdReal> e_aligned)
 {
     {
         SimdReal              f_simd(f);
@@ -243,7 +243,7 @@ gmx_inline static void calc_exponentials_q(int, int, real f, ArrayRef<const Simd
     }
 }
 #else
-gmx_inline static void calc_exponentials_q(int start, int end, real f, ArrayRef<real> d, ArrayRef<real> r, ArrayRef<real> e)
+inline static void calc_exponentials_q(int start, int end, real f, ArrayRef<real> d, ArrayRef<real> r, ArrayRef<real> e)
 {
     GMX_ASSERT(d.size() == r.size(), "d and r must have same size");
     GMX_ASSERT(d.size() == e.size(), "d and e must have same size");
@@ -265,7 +265,7 @@ gmx_inline static void calc_exponentials_q(int start, int end, real f, ArrayRef<
 
 #if defined PME_SIMD_SOLVE
 /* Calculate exponentials through SIMD */
-gmx_inline static void calc_exponentials_lj(int, int, ArrayRef<SimdReal> r_aligned, ArrayRef<SimdReal> factor_aligned, ArrayRef<SimdReal> d_aligned)
+inline static void calc_exponentials_lj(int, int, ArrayRef<SimdReal> r_aligned, ArrayRef<SimdReal> factor_aligned, ArrayRef<SimdReal> d_aligned)
 {
     SimdReal              tmp_r, tmp_d, tmp_fac, d_inv, tmp_mk;
     const SimdReal        sqr_PI = sqrt(SimdReal(M_PI));
@@ -289,7 +289,7 @@ gmx_inline static void calc_exponentials_lj(int, int, ArrayRef<SimdReal> r_align
     }
 }
 #else
-gmx_inline static void calc_exponentials_lj(int start, int end, ArrayRef<real> r, ArrayRef<real> tmp2, ArrayRef<real> d)
+inline static void calc_exponentials_lj(int start, int end, ArrayRef<real> r, ArrayRef<real> tmp2, ArrayRef<real> d)
 {
     int  kx;
     real mk;
index cb4a625084853d7923d910030aaebeb988851e8f..37b8b07190f3a9ba31596aadd7cfe2ed9a78dfec 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
index f38efc81bca8695a3cd981db65fda8c53e40e60b..62c9862dd61ee2423bd7e0665bff854587bd4647 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -710,8 +710,7 @@ static void sum_fftgrid_dd(const gmx_pme_t *pme, real *fftgrid, int grid_index)
     MPI_Status stat;
 #endif
     int  recv_size_y;
-    int  ipulse, size_yx;
-    real *sendptr, *recvptr;
+    int  size_yx;
     int  x, y, z, indg, indb;
 
     /* Note that this routine is only used for forward communication.
@@ -745,7 +744,7 @@ static void sum_fftgrid_dd(const gmx_pme_t *pme, real *fftgrid, int grid_index)
         int send_size_y = overlap->send_size;
 #endif
 
-        for (ipulse = 0; ipulse < overlap->noverlap_nodes; ipulse++)
+        for (size_t ipulse = 0; ipulse < overlap->comm_data.size(); ipulse++)
         {
             send_index0   =
                 overlap->comm_data[ipulse].send_index0 -
@@ -755,8 +754,8 @@ static void sum_fftgrid_dd(const gmx_pme_t *pme, real *fftgrid, int grid_index)
             recv_nindex   = overlap->comm_data[ipulse].recv_nindex;
             recv_size_y   = overlap->comm_data[ipulse].recv_size;
 
-            sendptr = overlap->sendbuf + send_index0*local_fft_ndata[ZZ];
-            recvptr = overlap->recvbuf;
+            auto *sendptr = const_cast<real *>(overlap->sendbuf.data()) + send_index0 * local_fft_ndata[ZZ];
+            auto *recvptr = const_cast<real *>(overlap->recvbuf.data());
 
             if (debug != nullptr)
             {
@@ -765,8 +764,8 @@ static void sum_fftgrid_dd(const gmx_pme_t *pme, real *fftgrid, int grid_index)
             }
 
 #if GMX_MPI
-            int send_id = overlap->send_id[ipulse];
-            int recv_id = overlap->recv_id[ipulse];
+            int send_id = overlap->comm_data[ipulse].send_id;
+            int recv_id = overlap->comm_data[ipulse].recv_id;
             MPI_Sendrecv(sendptr, send_size_y*datasize, GMX_MPI_REAL,
                          send_id, ipulse,
                          recvptr, recv_size_y*datasize, GMX_MPI_REAL,
@@ -790,7 +789,7 @@ static void sum_fftgrid_dd(const gmx_pme_t *pme, real *fftgrid, int grid_index)
             if (pme->nnodes_major > 1)
             {
                 /* Copy from the received buffer to the send buffer for dim 0 */
-                sendptr = pme->overlap[0].sendbuf;
+                sendptr = const_cast<real *>(pme->overlap[0].sendbuf.data());
                 for (x = 0; x < size_yx; x++)
                 {
                     for (y = 0; y < recv_nindex; y++)
@@ -816,14 +815,12 @@ static void sum_fftgrid_dd(const gmx_pme_t *pme, real *fftgrid, int grid_index)
         /* Major dimension */
         const pme_overlap_t *overlap = &pme->overlap[0];
 
-        ipulse = 0;
+        size_t ipulse = 0;
 
         send_nindex   = overlap->comm_data[ipulse].send_nindex;
         /* We don't use recv_index0, as we always receive starting at 0 */
         recv_nindex   = overlap->comm_data[ipulse].recv_nindex;
 
-        recvptr = overlap->recvbuf;
-
         if (debug != nullptr)
         {
             fprintf(debug, "PME fftgrid comm x %2d x %2d x %2d\n",
@@ -831,10 +828,11 @@ static void sum_fftgrid_dd(const gmx_pme_t *pme, real *fftgrid, int grid_index)
         }
 
 #if GMX_MPI
-        int datasize = local_fft_ndata[YY]*local_fft_ndata[ZZ];
-        int send_id  = overlap->send_id[ipulse];
-        int recv_id  = overlap->recv_id[ipulse];
-        sendptr      = overlap->sendbuf;
+        int datasize  = local_fft_ndata[YY]*local_fft_ndata[ZZ];
+        int send_id   = overlap->comm_data[ipulse].send_id;
+        int recv_id   = overlap->comm_data[ipulse].recv_id;
+        auto *sendptr = const_cast<real *>(overlap->sendbuf.data());
+        auto *recvptr = const_cast<real *>(overlap->recvbuf.data());
         MPI_Sendrecv(sendptr, send_nindex*datasize, GMX_MPI_REAL,
                      send_id, ipulse,
                      recvptr, recv_nindex*datasize, GMX_MPI_REAL,
@@ -850,7 +848,7 @@ static void sum_fftgrid_dd(const gmx_pme_t *pme, real *fftgrid, int grid_index)
                 indb = (x*local_fft_ndata[YY] + y)*local_fft_ndata[ZZ];
                 for (z = 0; z < local_fft_ndata[ZZ]; z++)
                 {
-                    fftgrid[indg+z] += recvptr[indb+z];
+                    fftgrid[indg + z] += overlap->recvbuf[indb + z];
                 }
             }
         }
@@ -979,8 +977,8 @@ void spread_on_grid(const gmx_pme_t *pme,
             {
                 reduce_threadgrid_overlap(pme, grids, thread,
                                           fftgrid,
-                                          pme->overlap[0].sendbuf,
-                                          pme->overlap[1].sendbuf,
+                                          const_cast<real *>(pme->overlap[0].sendbuf.data()),
+                                          const_cast<real *>(pme->overlap[1].sendbuf.data()),
                                           grid_index);
             }
             GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
index 20bb4e509063dd4c6faf5247c39722dae24677eb..fbf148f780444396b1d58e9e38b6013b1c34281f 100644 (file)
@@ -77,21 +77,6 @@ constexpr int c_spreadMaxWarpsPerBlock = 8;
 //! Spreading max block size in threads
 constexpr int c_spreadMaxThreadsPerBlock = c_spreadMaxWarpsPerBlock * warp_size;
 
-//! Texture references for CC 2.x
-texture<int, 1, cudaReadModeElementType>   gridlineIndicesTableTextureRef;
-texture<float, 1, cudaReadModeElementType> fractShiftsTableTextureRef;
-
-/*! Returns the reference to the gridlineIndices texture. */
-const struct texture<int, 1, cudaReadModeElementType> &pme_gpu_get_gridline_texref()
-{
-    return gridlineIndicesTableTextureRef;
-}
-
-/*! Returns the reference to the fractShifts texture. */
-const struct texture<float, 1, cudaReadModeElementType> &pme_gpu_get_fract_shifts_texref()
-{
-    return fractShiftsTableTextureRef;
-}
 
 /*! \brief
  * General purpose function for loading atom-related data from global to shared memory.
@@ -251,16 +236,10 @@ __device__ __forceinline__ void calculate_splines(const PmeGpuCudaKernelParams
             sm_fractCoords[sharedMemoryIndex] +=
                 fetchFromParamLookupTable(kernelParams.grid.d_fractShiftsTable,
                                           kernelParams.fractShiftsTableTexture,
-#if DISABLE_CUDA_TEXTURES == 0
-                                          fractShiftsTableTextureRef,
-#endif
                                           tableIndex);
             sm_gridlineIndices[sharedMemoryIndex] =
                 fetchFromParamLookupTable(kernelParams.grid.d_gridlineIndicesTable,
                                           kernelParams.gridlineIndicesTableTexture,
-#if DISABLE_CUDA_TEXTURES == 0
-                                          gridlineIndicesTableTextureRef,
-#endif
                                           tableIndex);
             gm_gridlineIndices[atomIndexOffset * DIM + sharedMemoryIndex] = sm_gridlineIndices[sharedMemoryIndex];
         }
index f615530c99758b00a8c32bd58bf3cee1c6c2b1da..f806e803a7069c01f36f7d9527966219de21903d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -53,7 +53,7 @@
  * \param[in] pme            The PME data structure.
  * \returns                  True if timings are enabled, false otherwise.
  */
-gmx_inline bool pme_gpu_timings_enabled(const PmeGpu *pmeGpu)
+inline bool pme_gpu_timings_enabled(const PmeGpu *pmeGpu)
 {
     return pmeGpu->archSpecific->useTiming;
 }
index d669a50e5146cfc43c4216163585be36294b468e..0f64912941405b96f8109b44d4f9171b301b22df 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -298,10 +298,7 @@ init_overlap_comm(pme_overlap_t *  ol,
                   int              ndata,
                   int              commplainsize)
 {
-    int              b, i;
-    pme_grid_comm_t *pgc;
     gmx_bool         bCont;
-    int              fft_start, fft_end, send_index1, recv_index1;
 #if GMX_MPI
     MPI_Status       stat;
 
@@ -318,13 +315,13 @@ init_overlap_comm(pme_overlap_t *  ol,
      * that belong to higher nodes (modulo nnodes)
      */
 
-    snew(ol->s2g0, ol->nnodes+1);
-    snew(ol->s2g1, ol->nnodes);
+    ol->s2g0.resize(ol->nnodes + 1);
+    ol->s2g1.resize(ol->nnodes);
     if (debug)
     {
         fprintf(debug, "PME slab boundaries:");
     }
-    for (i = 0; i < nnodes; i++)
+    for (int i = 0; i < nnodes; i++)
     {
         /* s2g0 the local interpolation grid start.
          * s2g1 the local interpolation grid end.
@@ -332,8 +329,8 @@ init_overlap_comm(pme_overlap_t *  ol,
          * spatially uniform along dimension x or y, we need to round
          * s2g0 down and s2g1 up.
          */
-        ol->s2g0[i] = ( i   *ndata + 0       )/nnodes;
-        ol->s2g1[i] = ((i+1)*ndata + nnodes-1)/nnodes + norder - 1;
+        ol->s2g0[i] = (i * ndata + 0) / nnodes;
+        ol->s2g1[i] = ((i + 1) * ndata + nnodes - 1) / nnodes + norder - 1;
 
         if (debug)
         {
@@ -347,55 +344,50 @@ init_overlap_comm(pme_overlap_t *  ol,
     }
 
     /* Determine with how many nodes we need to communicate the grid overlap */
-    b = 0;
+    int testRankCount = 0;
     do
     {
-        b++;
+        testRankCount++;
         bCont = FALSE;
-        for (i = 0; i < nnodes; i++)
+        for (int i = 0; i < nnodes; i++)
         {
-            if ((i+b <  nnodes && ol->s2g1[i] > ol->s2g0[i+b]) ||
-                (i+b >= nnodes && ol->s2g1[i] > ol->s2g0[i+b-nnodes] + ndata))
+            if ((i + testRankCount <  nnodes && ol->s2g1[i] > ol->s2g0[i + testRankCount]) ||
+                (i + testRankCount >= nnodes && ol->s2g1[i] > ol->s2g0[i + testRankCount - nnodes] + ndata))
             {
                 bCont = TRUE;
             }
         }
     }
-    while (bCont && b < nnodes);
-    ol->noverlap_nodes = b - 1;
-
-    snew(ol->send_id, ol->noverlap_nodes);
-    snew(ol->recv_id, ol->noverlap_nodes);
-    for (b = 0; b < ol->noverlap_nodes; b++)
-    {
-        ol->send_id[b] = (ol->nodeid + (b + 1)) % ol->nnodes;
-        ol->recv_id[b] = (ol->nodeid - (b + 1) + ol->nnodes) % ol->nnodes;
-    }
-    snew(ol->comm_data, ol->noverlap_nodes);
+    while (bCont && testRankCount < nnodes);
 
+    ol->comm_data.resize(testRankCount - 1);
     ol->send_size = 0;
-    for (b = 0; b < ol->noverlap_nodes; b++)
+
+    for (size_t b = 0; b < ol->comm_data.size(); b++)
     {
-        pgc = &ol->comm_data[b];
+        pme_grid_comm_t *pgc = &ol->comm_data[b];
+
         /* Send */
-        fft_start        = ol->s2g0[ol->send_id[b]];
-        fft_end          = ol->s2g0[ol->send_id[b]+1];
-        if (ol->send_id[b] < nodeid)
+        pgc->send_id = (ol->nodeid + (b + 1)) % ol->nnodes;
+        int fft_start = ol->s2g0[pgc->send_id];
+        int fft_end   = ol->s2g0[pgc->send_id + 1];
+        if (pgc->send_id < nodeid)
         {
             fft_start += ndata;
             fft_end   += ndata;
         }
-        send_index1       = ol->s2g1[nodeid];
-        send_index1       = std::min(send_index1, fft_end);
-        pgc->send_index0  = fft_start;
-        pgc->send_nindex  = std::max(0, send_index1 - pgc->send_index0);
-        ol->send_size    += pgc->send_nindex;
+        int send_index1  = ol->s2g1[nodeid];
+        send_index1      = std::min(send_index1, fft_end);
+        pgc->send_index0 = fft_start;
+        pgc->send_nindex = std::max(0, send_index1 - pgc->send_index0);
+        ol->send_size   += pgc->send_nindex;
 
         /* We always start receiving to the first index of our slab */
+        pgc->recv_id     = (ol->nodeid - (b + 1) + ol->nnodes) % ol->nnodes;
         fft_start        = ol->s2g0[ol->nodeid];
-        fft_end          = ol->s2g0[ol->nodeid+1];
-        recv_index1      = ol->s2g1[ol->recv_id[b]];
-        if (ol->recv_id[b] > nodeid)
+        fft_end          = ol->s2g0[ol->nodeid + 1];
+        int recv_index1  = ol->s2g1[pgc->recv_id];
+        if (pgc->recv_id > nodeid)
         {
             recv_index1 -= ndata;
         }
@@ -406,30 +398,17 @@ init_overlap_comm(pme_overlap_t *  ol,
 
 #if GMX_MPI
     /* Communicate the buffer sizes to receive */
-    for (b = 0; b < ol->noverlap_nodes; b++)
+    for (size_t b = 0; b < ol->comm_data.size(); b++)
     {
-        MPI_Sendrecv(&ol->send_size, 1, MPI_INT, ol->send_id[b], b,
-                     &ol->comm_data[b].recv_size, 1, MPI_INT, ol->recv_id[b], b,
+        MPI_Sendrecv(&ol->send_size, 1, MPI_INT, ol->comm_data[b].send_id, b,
+                     &ol->comm_data[b].recv_size, 1, MPI_INT, ol->comm_data[b].recv_id, b,
                      ol->mpi_comm, &stat);
     }
 #endif
 
     /* For non-divisible grid we need pme_order iso pme_order-1 */
-    snew(ol->sendbuf, norder*commplainsize);
-    snew(ol->recvbuf, norder*commplainsize);
-}
-
-/*! \brief Destroy data structure for communication */
-static void
-destroy_overlap_comm(const pme_overlap_t *ol)
-{
-    sfree(ol->s2g0);
-    sfree(ol->s2g1);
-    sfree(ol->send_id);
-    sfree(ol->recv_id);
-    sfree(ol->comm_data);
-    sfree(ol->sendbuf);
-    sfree(ol->recvbuf);
+    ol->sendbuf.resize(norder * commplainsize);
+    ol->recvbuf.resize(norder * commplainsize);
 }
 
 int minimalPmeGridSize(int pmeOrder)
@@ -740,7 +719,7 @@ gmx_pme_t *gmx_pme_init(const t_commrec     *cr,
     /* Double-check for a limitation of the (current) sum_fftgrid_dd code.
      * Note that gmx_pme_check_restrictions checked for this already.
      */
-    if (pme->bUseThreads && pme->overlap[0].noverlap_nodes > 1)
+    if (pme->bUseThreads && (pme->overlap[0].comm_data.size() > 1))
     {
         gmx_incons("More than one communication pulse required for grid overlap communication along the major dimension while using threads");
     }
@@ -986,7 +965,7 @@ int gmx_pme_do(struct gmx_pme_t *pme,
                real sigmaA[],   real sigmaB[],
                matrix box,      t_commrec *cr,
                int  maxshift_x, int maxshift_y,
-               t_nrnb *nrnb,    gmx_wallcycle_t wcycle,
+               t_nrnb *nrnb,    gmx_wallcycle *wcycle,
                matrix vir_q,    matrix vir_lj,
                real *energy_q,  real *energy_lj,
                real lambda_q,   real lambda_lj,
@@ -1730,9 +1709,6 @@ void gmx_pme_destroy(gmx_pme_t *pme)
         sfree(pme->bsp_mod[i]);
     }
 
-    destroy_overlap_comm(&pme->overlap[0]);
-    destroy_overlap_comm(&pme->overlap[1]);
-
     sfree(pme->lb_buf1);
     sfree(pme->lb_buf2);
 
index 735ff5f9b6d619c3616c29b167dd0f6ddb14a804..bbc2bbaacc2e76b9abf2b4556377fa81bdfed4c7 100644 (file)
@@ -347,14 +347,12 @@ void pme_gpu_realloc_and_copy_fract_shifts(PmeGpu *pmeGpu)
 
     initParamLookupTable(kernelParamsPtr->grid.d_fractShiftsTable,
                          kernelParamsPtr->fractShiftsTableTexture,
-                         &pme_gpu_get_fract_shifts_texref(),
                          pmeGpu->common->fsh.data(),
                          newFractShiftsSize,
                          pmeGpu->deviceInfo);
 
     initParamLookupTable(kernelParamsPtr->grid.d_gridlineIndicesTable,
                          kernelParamsPtr->gridlineIndicesTableTexture,
-                         &pme_gpu_get_gridline_texref(),
                          pmeGpu->common->nn.data(),
                          newFractShiftsSize,
                          pmeGpu->deviceInfo);
@@ -365,11 +363,9 @@ void pme_gpu_free_fract_shifts(const PmeGpu *pmeGpu)
     auto *kernelParamsPtr = pmeGpu->kernelParams.get();
     destroyParamLookupTable(kernelParamsPtr->grid.d_fractShiftsTable,
                             kernelParamsPtr->fractShiftsTableTexture,
-                            &pme_gpu_get_fract_shifts_texref(),
                             pmeGpu->deviceInfo);
     destroyParamLookupTable(kernelParamsPtr->grid.d_gridlineIndicesTable,
                             kernelParamsPtr->gridlineIndicesTableTexture,
-                            &pme_gpu_get_gridline_texref(),
                             pmeGpu->deviceInfo);
 }
 
index 3c018d7f3cac4837bbd7973837af61e2a2356854..e58c3de4957dd5416027746c46875ce31ac9facf 100644 (file)
@@ -240,12 +240,4 @@ struct PmeGpuCudaKernelParams : PmeGpuKernelParamsBase
     cudaTextureObject_t gridlineIndicesTableTexture;
 };
 
-/* CUDA texture reference functions which reside in respective kernel files
- * (due to texture references having scope of a translation unit).
- */
-/*! Returns the reference to the gridlineIndices texture. */
-const struct texture<int, 1, cudaReadModeElementType>   &pme_gpu_get_gridline_texref();
-/*! Returns the reference to the fractShifts texture. */
-const struct texture<float, 1, cudaReadModeElementType> &pme_gpu_get_fract_shifts_texref();
-
 #endif
index d8d8838ddb0bc3cfa3a12422ad3796aef3d35b16..4b9972cfbc6cec44582b7bb359ef05f97fcaa9af 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -51,7 +51,6 @@
 #include <string>
 
 #include "gromacs/math/vectypes.h"
-#include "gromacs/timing/wallcycle.h"
 #include "gromacs/timing/walltime_accounting.h"
 #include "gromacs/utility/arrayref.h"
 #include "gromacs/utility/basedefinitions.h"
@@ -65,6 +64,7 @@ struct PmeGpu;
 struct gmx_wallclock_gpu_pme_t;
 struct gmx_device_info_t;
 struct gmx_pme_t;
+struct gmx_wallcycle;
 
 enum class GpuTaskCompletion;
 
@@ -167,7 +167,7 @@ int gmx_pme_do(struct gmx_pme_t *pme,
                real sigmaA[],   real sigmaB[],
                matrix box,      t_commrec *cr,
                int  maxshift_x, int maxshift_y,
-               t_nrnb *nrnb,    gmx_wallcycle_t wcycle,
+               t_nrnb *nrnb,    gmx_wallcycle *wcycle,
                matrix vir_q,    matrix vir_lj,
                real *energy_q,  real *energy_lj,
                real lambda_q,   real lambda_lj,
@@ -177,7 +177,7 @@ int gmx_pme_do(struct gmx_pme_t *pme,
 /*! \brief Called on the nodes that do PME exclusively (as slaves) */
 int gmx_pmeonly(struct gmx_pme_t *pme,
                 struct t_commrec *cr,     t_nrnb *mynrnb,
-                gmx_wallcycle_t wcycle,
+                gmx_wallcycle  *wcycle,
                 gmx_walltime_accounting_t walltime_accounting,
                 t_inputrec *ir, PmeRunMode runMode);
 
@@ -204,7 +204,7 @@ void gmx_pme_send_parameters(struct t_commrec *cr,
 void gmx_pme_send_coordinates(struct t_commrec *cr, matrix box, rvec *x,
                               real lambda_q, real lambda_lj,
                               gmx_bool bEnerVir,
-                              gmx_int64_t step);
+                              gmx_int64_t step, gmx_wallcycle *wcycle);
 
 /*! \brief Tell our PME-only node to finish */
 void gmx_pme_send_finish(struct t_commrec *cr);
@@ -296,7 +296,7 @@ void pme_gpu_get_timings(const gmx_pme_t         *pme,
 void pme_gpu_prepare_computation(gmx_pme_t      *pme,
                                  bool            needToUpdateBox,
                                  const matrix    box,
-                                 gmx_wallcycle_t wcycle,
+                                 gmx_wallcycle  *wcycle,
                                  int             flags);
 
 /*! \brief
@@ -308,7 +308,7 @@ void pme_gpu_prepare_computation(gmx_pme_t      *pme,
  */
 void pme_gpu_launch_spread(gmx_pme_t      *pme,
                            const rvec     *x,
-                           gmx_wallcycle_t wcycle);
+                           gmx_wallcycle  *wcycle);
 
 /*! \brief
  * Launches middle stages of PME (FFT R2C, solving, FFT C2R) either on GPU or on CPU, depending on the run mode.
@@ -317,7 +317,7 @@ void pme_gpu_launch_spread(gmx_pme_t      *pme,
  * \param[in] wcycle            The wallclock counter.
  */
 void pme_gpu_launch_complex_transforms(gmx_pme_t       *pme,
-                                       gmx_wallcycle_t  wcycle);
+                                       gmx_wallcycle   *wcycle);
 
 /*! \brief
  * Launches last stage of PME on GPU - force gathering and D2H force transfer.
@@ -329,7 +329,7 @@ void pme_gpu_launch_complex_transforms(gmx_pme_t       *pme,
  *                               and accumulates. The reduction is non-atomic.
  */
 void pme_gpu_launch_gather(const gmx_pme_t        *pme,
-                           gmx_wallcycle_t         wcycle,
+                           gmx_wallcycle          *wcycle,
                            PmeForceOutputHandling  forceTreatment);
 
 /*! \brief
@@ -343,7 +343,7 @@ void pme_gpu_launch_gather(const gmx_pme_t        *pme,
  * \param[out] energy         The output energy.
  */
 void pme_gpu_wait_finish_task(const gmx_pme_t                *pme,
-                              gmx_wallcycle_t                 wcycle,
+                              gmx_wallcycle                  *wcycle,
                               gmx::ArrayRef<const gmx::RVec> *forces,
                               matrix                          virial,
                               real                           *energy);
@@ -369,7 +369,7 @@ void pme_gpu_wait_finish_task(const gmx_pme_t                *pme,
  * \returns                   True if the PME GPU tasks have completed
  */
 bool pme_gpu_try_finish_task(const gmx_pme_t                *pme,
-                             gmx_wallcycle_t                 wcycle,
+                             gmx_wallcycle                  *wcycle,
                              gmx::ArrayRef<const gmx::RVec> *forces,
                              matrix                          virial,
                              real                           *energy,
index 3a5b29f2b3c0efcc91bde2cf92cdf8fb94a5f578..52da6d62371bb064c81ee4cad2703ab9d954f1d4 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2017, by the GROMACS development team, led by
+ * Copyright (c) 2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 
 #include "config.h"
 
-#include "gromacs/gmxlib/network.h"
 #include "gromacs/gpu_utils/gpu_utils.h"
 #include "gromacs/hardware/hw_info.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/loggerbuilder.h"
-#include "gromacs/utility/unique_cptr.h"
 
 namespace gmx
 {
@@ -87,12 +85,10 @@ void callAddGlobalTestEnvironment()
 //! Simple hardware initialization
 static gmx_hw_info_t *hardwareInit()
 {
-    unique_cptr<t_commrec, done_commrec> commrec(init_commrec());
-    gmx_init_intranode_counters(commrec.get());
     LoggerBuilder builder;
     LoggerOwner   logOwner(builder.build());
     MDLogger      log(logOwner.logger());
-    return gmx_detect_hardware(log, commrec.get());
+    return gmx_detect_hardware(log);
 }
 
 void PmeTestEnvironment::SetUp()
index cf1f39993109fead155bce6668aee31026fd1da8..c609e1277437e03617b6b002174bfb7252604a4a 100644 (file)
@@ -51,6 +51,8 @@
 #include <sys/locking.h>
 #endif
 
+#include <array>
+
 #include "buildinfo.h"
 #include "gromacs/fileio/filetypes.h"
 #include "gromacs/fileio/gmxfio.h"
@@ -229,20 +231,16 @@ static void cp_error()
     gmx_fatal(FARGS, "Checkpoint file corrupted/truncated, or maybe you are out of disk space?");
 }
 
-static void do_cpt_string_err(XDR *xd, gmx_bool bRead, const char *desc, char **s, FILE *list)
+static void do_cpt_string_err(XDR *xd, const char *desc, gmx::ArrayRef<char> s, FILE *list)
 {
-    if (bRead)
-    {
-        snew(*s, CPTSTRLEN);
-    }
-    if (xdr_string(xd, s, CPTSTRLEN) == 0)
+    char *data = s.data();
+    if (xdr_string(xd, &data, s.size()) == 0)
     {
         cp_error();
     }
     if (list)
     {
-        fprintf(list, "%s = %s\n", desc, *s);
-        sfree(*s);
+        fprintf(list, "%s = %s\n", desc, data);
     }
 }
 
@@ -876,23 +874,49 @@ static int do_cpte_matrices(XDR *xd, StatePart part, int ecpt, int sflags,
     return ret;
 }
 
-static void do_cpt_header(XDR *xd, gmx_bool bRead, int *file_version,
-                          char **version, char **btime, char **buser, char **bhost,
-                          int *double_prec,
-                          char **fprog, char **ftime,
-                          int *eIntegrator, int *simulation_part,
-                          gmx_int64_t *step, double *t,
-                          int *nnodes, int *dd_nc, int *npme,
-                          int *natoms, int *ngtc, int *nnhpres, int *nhchainlength,
-                          int *nlambda, int *flags_state,
-                          int *flags_eks, int *flags_enh, int *flags_dfh, int *flags_awhh,
-                          int *nED, int *eSwapCoords,
-                          FILE *list)
+// TODO Expand this into being a container of all data for
+// serialization of a checkpoint, which can be stored by the caller
+// (e.g. so that mdrun doesn't have to open the checkpoint twice).
+// This will separate issues of allocation from those of
+// serialization, help separate comparison from reading, and have
+// better defined transformation functions to/from trajectory frame
+// data structures.
+struct CheckpointHeaderContents
+{
+    int         file_version;
+    char        version[CPTSTRLEN];
+    char        btime[CPTSTRLEN];
+    char        buser[CPTSTRLEN];
+    char        bhost[CPTSTRLEN];
+    int         double_prec;
+    char        fprog[CPTSTRLEN];
+    char        ftime[CPTSTRLEN];
+    int         eIntegrator;
+    int         simulation_part;
+    gmx_int64_t step;
+    double      t;
+    int         nnodes;
+    ivec        dd_nc;
+    int         npme;
+    int         natoms;
+    int         ngtc;
+    int         nnhpres;
+    int         nhchainlength;
+    int         nlambda;
+    int         flags_state;
+    int         flags_eks;
+    int         flags_enh;
+    int         flags_dfh;
+    int         flags_awhh;
+    int         nED;
+    int         eSwapCoords;
+};
+
+static void do_cpt_header(XDR *xd, gmx_bool bRead, FILE *list,
+                          CheckpointHeaderContents *contents)
 {
     bool_t res = 0;
     int    magic;
-    int    idum = 0;
-    char  *fhost;
 
     if (bRead)
     {
@@ -913,138 +937,134 @@ static void do_cpt_header(XDR *xd, gmx_bool bRead, int *file_version,
                   "The checkpoint file is corrupted or not a checkpoint file",
                   magic, CPT_MAGIC1);
     }
+    char fhost[255];
     if (!bRead)
     {
-        snew(fhost, 255);
         gmx_gethostname(fhost, 255);
     }
-    do_cpt_string_err(xd, bRead, "GROMACS version", version, list);
-    do_cpt_string_err(xd, bRead, "GROMACS build time", btime, list);
-    do_cpt_string_err(xd, bRead, "GROMACS build user", buser, list);
-    do_cpt_string_err(xd, bRead, "GROMACS build host", bhost, list);
-    do_cpt_string_err(xd, bRead, "generating program", fprog, list);
-    do_cpt_string_err(xd, bRead, "generation time", ftime, list);
-    *file_version = cpt_version;
-    do_cpt_int_err(xd, "checkpoint file version", file_version, list);
-    if (*file_version > cpt_version)
+    do_cpt_string_err(xd, "GROMACS version", contents->version, list);
+    do_cpt_string_err(xd, "GROMACS build time", contents->btime, list);
+    do_cpt_string_err(xd, "GROMACS build user", contents->buser, list);
+    do_cpt_string_err(xd, "GROMACS build host", contents->bhost, list);
+    do_cpt_string_err(xd, "generating program", contents->fprog, list);
+    do_cpt_string_err(xd, "generation time", contents->ftime, list);
+    contents->file_version = cpt_version;
+    do_cpt_int_err(xd, "checkpoint file version", &contents->file_version, list);
+    if (contents->file_version > cpt_version)
     {
-        gmx_fatal(FARGS, "Attempting to read a checkpoint file of version %d with code of version %d\n", *file_version, cpt_version);
+        gmx_fatal(FARGS, "Attempting to read a checkpoint file of version %d with code of version %d\n", contents->file_version, cpt_version);
     }
-    if (*file_version >= 13)
+    if (contents->file_version >= 13)
     {
-        do_cpt_int_err(xd, "GROMACS double precision", double_prec, list);
+        do_cpt_int_err(xd, "GROMACS double precision", &contents->double_prec, list);
     }
     else
     {
-        *double_prec = -1;
+        contents->double_prec = -1;
     }
-    if (*file_version >= 12)
+    if (contents->file_version >= 12)
     {
-        do_cpt_string_err(xd, bRead, "generating host", &fhost, list);
-        if (list == nullptr)
-        {
-            sfree(fhost);
-        }
+        do_cpt_string_err(xd, "generating host", fhost, list);
     }
-    do_cpt_int_err(xd, "#atoms", natoms, list);
-    do_cpt_int_err(xd, "#T-coupling groups", ngtc, list);
-    if (*file_version >= 10)
+    do_cpt_int_err(xd, "#atoms", &contents->natoms, list);
+    do_cpt_int_err(xd, "#T-coupling groups", &contents->ngtc, list);
+    if (contents->file_version >= 10)
     {
-        do_cpt_int_err(xd, "#Nose-Hoover T-chains", nhchainlength, list);
+        do_cpt_int_err(xd, "#Nose-Hoover T-chains", &contents->nhchainlength, list);
     }
     else
     {
-        *nhchainlength = 1;
+        contents->nhchainlength = 1;
     }
-    if (*file_version >= 11)
+    if (contents->file_version >= 11)
     {
-        do_cpt_int_err(xd, "#Nose-Hoover T-chains for barostat ", nnhpres, list);
+        do_cpt_int_err(xd, "#Nose-Hoover T-chains for barostat ", &contents->nnhpres, list);
     }
     else
     {
-        *nnhpres = 0;
+        contents->nnhpres = 0;
     }
-    if (*file_version >= 14)
+    if (contents->file_version >= 14)
     {
-        do_cpt_int_err(xd, "# of total lambda states ", nlambda, list);
+        do_cpt_int_err(xd, "# of total lambda states ", &contents->nlambda, list);
     }
     else
     {
-        *nlambda = 0;
+        contents->nlambda = 0;
     }
-    do_cpt_int_err(xd, "integrator", eIntegrator, list);
-    if (*file_version >= 3)
+    do_cpt_int_err(xd, "integrator", &contents->eIntegrator, list);
+    if (contents->file_version >= 3)
     {
-        do_cpt_int_err(xd, "simulation part #", simulation_part, list);
+        do_cpt_int_err(xd, "simulation part #", &contents->simulation_part, list);
     }
     else
     {
-        *simulation_part = 1;
+        contents->simulation_part = 1;
     }
-    if (*file_version >= 5)
+    if (contents->file_version >= 5)
     {
-        do_cpt_step_err(xd, "step", step, list);
+        do_cpt_step_err(xd, "step", &contents->step, list);
     }
     else
     {
+        int idum = 0;
         do_cpt_int_err(xd, "step", &idum, list);
-        *step = idum;
+        contents->step = static_cast<gmx_int64_t>(idum);
     }
-    do_cpt_double_err(xd, "t", t, list);
-    do_cpt_int_err(xd, "#PP-ranks", nnodes, list);
-    idum = 1;
-    do_cpt_int_err(xd, "dd_nc[x]", dd_nc ? &(dd_nc[0]) : &idum, list);
-    do_cpt_int_err(xd, "dd_nc[y]", dd_nc ? &(dd_nc[1]) : &idum, list);
-    do_cpt_int_err(xd, "dd_nc[z]", dd_nc ? &(dd_nc[2]) : &idum, list);
-    do_cpt_int_err(xd, "#PME-only ranks", npme, list);
-    do_cpt_int_err(xd, "state flags", flags_state, list);
-    if (*file_version >= 4)
+    do_cpt_double_err(xd, "t", &contents->t, list);
+    do_cpt_int_err(xd, "#PP-ranks", &contents->nnodes, list);
+    do_cpt_int_err(xd, "dd_nc[x]", &contents->dd_nc[XX], list);
+    do_cpt_int_err(xd, "dd_nc[y]", &contents->dd_nc[YY], list);
+    do_cpt_int_err(xd, "dd_nc[z]", &contents->dd_nc[ZZ], list);
+    do_cpt_int_err(xd, "#PME-only ranks", &contents->npme, list);
+    do_cpt_int_err(xd, "state flags", &contents->flags_state, list);
+    if (contents->file_version >= 4)
     {
-        do_cpt_int_err(xd, "ekin data flags", flags_eks, list);
-        do_cpt_int_err(xd, "energy history flags", flags_enh, list);
+        do_cpt_int_err(xd, "ekin data flags", &contents->flags_eks, list);
+        do_cpt_int_err(xd, "energy history flags", &contents->flags_enh, list);
     }
     else
     {
-        *flags_eks   = 0;
-        *flags_enh   = (*flags_state >> (estORIRE_DTAV+1));
-        *flags_state = (*flags_state & ~((1<<(estORIRE_DTAV+1)) |
-                                         (1<<(estORIRE_DTAV+2)) |
-                                         (1<<(estORIRE_DTAV+3))));
+        contents->flags_eks   = 0;
+        contents->flags_enh   = (contents->flags_state >> (estORIRE_DTAV+1));
+        contents->flags_state = (contents->flags_state & ~((1<<(estORIRE_DTAV+1)) |
+                                                           (1<<(estORIRE_DTAV+2)) |
+                                                           (1<<(estORIRE_DTAV+3))));
     }
-    if (*file_version >= 14)
+    if (contents->file_version >= 14)
     {
-        do_cpt_int_err(xd, "df history flags", flags_dfh, list);
+        do_cpt_int_err(xd, "df history flags", &contents->flags_dfh, list);
     }
     else
     {
-        *flags_dfh = 0;
+        contents->flags_dfh = 0;
     }
 
-    if (*file_version >= 15)
+    if (contents->file_version >= 15)
     {
-        do_cpt_int_err(xd, "ED data sets", nED, list);
+        do_cpt_int_err(xd, "ED data sets", &contents->nED, list);
     }
     else
     {
-        *nED = 0;
+        contents->nED = 0;
     }
 
-    if (*file_version >= 16)
+    if (contents->file_version >= 16)
     {
-        do_cpt_int_err(xd, "swap", eSwapCoords, list);
+        do_cpt_int_err(xd, "swap", &contents->eSwapCoords, list);
     }
     else
     {
-        *eSwapCoords = eswapNO;
+        contents->eSwapCoords = eswapNO;
     }
 
-    if (*file_version >= 17)
+    if (contents->file_version >= 17)
     {
-        do_cpt_int_err(xd, "AWH history flags", flags_awhh, list);
+        do_cpt_int_err(xd, "AWH history flags", &contents->flags_awhh, list);
     }
     else
     {
-        *flags_awhh = 0;
+        contents->flags_awhh = 0;
     }
 }
 
@@ -1672,39 +1692,34 @@ static int do_cpt_awh(XDR *xd, gmx_bool bRead,
 }
 
 static int do_cpt_files(XDR *xd, gmx_bool bRead,
-                        gmx_file_position_t **p_outputfiles, int *nfiles,
+                        std::vector<gmx_file_position_t> *outputfiles,
                         FILE *list, int file_version)
 {
-    int                  i;
-    gmx_off_t            offset;
-    gmx_off_t            mask = 0xFFFFFFFFL;
-    int                  offset_high, offset_low;
-    char                *buf;
-    gmx_file_position_t *outputfiles;
+    gmx_off_t                   offset;
+    gmx_off_t                   mask = 0xFFFFFFFFL;
+    int                         offset_high, offset_low;
+    std::array<char, CPTSTRLEN> buf;
+    GMX_RELEASE_ASSERT(outputfiles, "Must have valid outputfiles");
 
-    if (do_cpt_int(xd, "number of output files", nfiles, list) != 0)
+    // Ensure that reading pre-allocates outputfiles, while writing
+    // writes what is already there.
+    int nfiles = outputfiles->size();
+    if (do_cpt_int(xd, "number of output files", &nfiles, list) != 0)
     {
         return -1;
     }
-
     if (bRead)
     {
-        snew(*p_outputfiles, *nfiles);
+        outputfiles->resize(nfiles);
     }
 
-    outputfiles = *p_outputfiles;
-
-    for (i = 0; i < *nfiles; i++)
+    for (auto &outputfile : *outputfiles)
     {
         /* 64-bit XDR numbers are not portable, so it is stored as separate high/low fractions */
         if (bRead)
         {
-            do_cpt_string_err(xd, bRead, "output filename", &buf, list);
-            std::strncpy(outputfiles[i].filename, buf, CPTSTRLEN-1);
-            if (list == nullptr)
-            {
-                sfree(buf);
-            }
+            do_cpt_string_err(xd, "output filename", buf, list);
+            std::strncpy(outputfile.filename, buf.data(), buf.size()-1);
 
             if (do_cpt_int(xd, "file_offset_high", &offset_high, list) != 0)
             {
@@ -1714,14 +1729,13 @@ static int do_cpt_files(XDR *xd, gmx_bool bRead,
             {
                 return -1;
             }
-            outputfiles[i].offset = (static_cast<gmx_off_t>(offset_high) << 32 ) | ( static_cast<gmx_off_t>(offset_low) & mask );
+            outputfile.offset = (static_cast<gmx_off_t>(offset_high) << 32 ) | ( static_cast<gmx_off_t>(offset_low) & mask );
         }
         else
         {
-            buf = outputfiles[i].filename;
-            do_cpt_string_err(xd, bRead, "output filename", &buf, list);
+            do_cpt_string_err(xd, "output filename", outputfile.filename, list);
             /* writing */
-            offset      = outputfiles[i].offset;
+            offset      = outputfile.offset;
             if (offset == -1)
             {
                 offset_low  = -1;
@@ -1743,19 +1757,19 @@ static int do_cpt_files(XDR *xd, gmx_bool bRead,
         }
         if (file_version >= 8)
         {
-            if (do_cpt_int(xd, "file_checksum_size", &(outputfiles[i].chksum_size),
+            if (do_cpt_int(xd, "file_checksum_size", &outputfile.chksum_size,
                            list) != 0)
             {
                 return -1;
             }
-            if (do_cpt_u_chars(xd, "file_checksum", 16, outputfiles[i].chksum, list) != 0)
+            if (do_cpt_u_chars(xd, "file_checksum", 16, outputfile.chksum, list) != 0)
             {
                 return -1;
             }
         }
         else
         {
-            outputfiles[i].chksum_size = -1;
+            outputfile.chksum_size = -1;
         }
     }
     return 0;
@@ -1771,20 +1785,9 @@ void write_checkpoint(const char *fn, gmx_bool bNumberAndKeep,
                       t_state *state, ObservablesHistory *observablesHistory)
 {
     t_fileio            *fp;
-    int                  file_version;
-    char                *version;
-    char                *btime;
-    char                *buser;
-    char                *bhost;
-    int                  double_prec;
-    char                *fprog;
     char                *fntemp; /* the temporary checkpoint file name */
-    char                 timebuf[STRLEN];
     int                  npmenodes;
     char                 buf[1024], suffix[5+STEPSTRSIZE], sbuf[STEPSTRSIZE];
-    gmx_file_position_t *outputfiles;
-    int                  noutputfiles;
-    char                *ftime;
     t_fileio            *ret;
 
     if (DOMAINDECOMP(cr))
@@ -1811,6 +1814,7 @@ void write_checkpoint(const char *fn, gmx_bool bNumberAndKeep,
     snew(fntemp, std::strlen(fn));
     std::strcpy(fntemp, fn);
 #endif
+    char timebuf[STRLEN];
     gmx_format_current_time(timebuf, STRLEN);
 
     if (fplog)
@@ -1820,7 +1824,7 @@ void write_checkpoint(const char *fn, gmx_bool bNumberAndKeep,
     }
 
     /* Get offsets for open files */
-    gmx_fio_get_output_file_positions(&outputfiles, &noutputfiles);
+    auto outputfiles = gmx_fio_get_output_file_positions();
 
     fp = gmx_fio_open(fntemp, "w");
 
@@ -1900,38 +1904,35 @@ void write_checkpoint(const char *fn, gmx_bool bNumberAndKeep,
      * the same version, user, time, and build host!
      */
 
-    version = gmx_strdup(gmx_version());
-    btime   = gmx_strdup(BUILD_TIME);
-    buser   = gmx_strdup(BUILD_USER);
-    bhost   = gmx_strdup(BUILD_HOST);
-
-    double_prec = GMX_DOUBLE;
-    fprog       = gmx_strdup(gmx::getProgramContext().fullBinaryPath());
-
-    ftime   = &(timebuf[0]);
-
-    int             nlambda     = (state->dfhist ? state->dfhist->nlambda : 0);
-
-    edsamhistory_t *edsamhist   = observablesHistory->edsamHistory.get();
-    int             nED         = (edsamhist ? edsamhist->nED : 0);
-
-    swaphistory_t  *swaphist    = observablesHistory->swapHistory.get();
-    int             eSwapCoords = (swaphist ? swaphist->eSwapCoords : eswapNO);
-
-    do_cpt_header(gmx_fio_getxdr(fp), FALSE, &file_version,
-                  &version, &btime, &buser, &bhost, &double_prec, &fprog, &ftime,
-                  &eIntegrator, &simulation_part, &step, &t, &nppnodes,
-                  DOMAINDECOMP(cr) ? domdecCells : nullptr, &npmenodes,
-                  &state->natoms, &state->ngtc, &state->nnhpres,
-                  &state->nhchainlength, &nlambda, &state->flags, &flags_eks, &flags_enh, &flags_dfh, &flags_awhh,
-                  &nED, &eSwapCoords,
-                  nullptr);
+    int                      nlambda     = (state->dfhist ? state->dfhist->nlambda : 0);
+
+    edsamhistory_t          *edsamhist   = observablesHistory->edsamHistory.get();
+    int                      nED         = (edsamhist ? edsamhist->nED : 0);
+
+    swaphistory_t           *swaphist    = observablesHistory->swapHistory.get();
+    int                      eSwapCoords = (swaphist ? swaphist->eSwapCoords : eswapNO);
+
+    CheckpointHeaderContents headerContents =
+    {
+        0, {0}, {0}, {0}, {0}, GMX_DOUBLE, {0}, {0},
+        eIntegrator, simulation_part, step, t, nppnodes,
+        {0}, npmenodes,
+        state->natoms, state->ngtc, state->nnhpres,
+        state->nhchainlength, nlambda, state->flags, flags_eks, flags_enh, flags_dfh, flags_awhh,
+        nED, eSwapCoords
+    };
+    std::strcpy(headerContents.version, gmx_version());
+    std::strcpy(headerContents.btime, BUILD_TIME);
+    std::strcpy(headerContents.buser, BUILD_USER);
+    std::strcpy(headerContents.bhost, BUILD_HOST);
+    std::strcpy(headerContents.fprog, gmx::getProgramContext().fullBinaryPath());
+    std::strcpy(headerContents.ftime, timebuf);
+    if (DOMAINDECOMP(cr))
+    {
+        copy_ivec(domdecCells, headerContents.dd_nc);
+    }
 
-    sfree(version);
-    sfree(btime);
-    sfree(buser);
-    sfree(bhost);
-    sfree(fprog);
+    do_cpt_header(gmx_fio_getxdr(fp), FALSE, nullptr, &headerContents);
 
     if ((do_cpt_state(gmx_fio_getxdr(fp), state->flags, state, nullptr) < 0)        ||
         (do_cpt_ekinstate(gmx_fio_getxdr(fp), flags_eks, &state->ekinstate, nullptr) < 0) ||
@@ -1940,13 +1941,13 @@ void write_checkpoint(const char *fn, gmx_bool bNumberAndKeep,
         (do_cpt_EDstate(gmx_fio_getxdr(fp), FALSE, nED, edsamhist, nullptr) < 0)      ||
         (do_cpt_awh(gmx_fio_getxdr(fp), FALSE, flags_awhh, state->awhHistory.get(), NULL) < 0) ||
         (do_cpt_swapstate(gmx_fio_getxdr(fp), FALSE, eSwapCoords, swaphist, nullptr) < 0) ||
-        (do_cpt_files(gmx_fio_getxdr(fp), FALSE, &outputfiles, &noutputfiles, nullptr,
-                      file_version) < 0))
+        (do_cpt_files(gmx_fio_getxdr(fp), FALSE, &outputfiles, nullptr,
+                      headerContents.file_version) < 0))
     {
         gmx_file("Cannot read/write checkpoint; corrupt file, or maybe you are out of disk space?");
     }
 
-    do_cpt_footer(gmx_fio_getxdr(fp), file_version);
+    do_cpt_footer(gmx_fio_getxdr(fp), headerContents.file_version);
 
     /* we really, REALLY, want to make sure to physically write the checkpoint,
        and all the files it depends on, out to disk. Because we've
@@ -2009,7 +2010,6 @@ void write_checkpoint(const char *fn, gmx_bool bNumberAndKeep,
     }
 #endif  /* GMX_NO_RENAME */
 
-    sfree(outputfiles);
     sfree(fntemp);
 
 #ifdef GMX_FAHCORE
@@ -2071,12 +2071,8 @@ static void check_string(FILE *fplog, const char *type, const char *p,
     }
 }
 
-static void check_match(FILE *fplog,
-                        char *version,
-                        char *btime, char *buser, char *bhost, int double_prec,
-                        char *fprog,
-                        const t_commrec *cr, int npp_f, int npme_f,
-                        const ivec dd_nc, const ivec dd_nc_f,
+static void check_match(FILE *fplog, const t_commrec *cr, const ivec dd_nc,
+                        const CheckpointHeaderContents &headerContents,
                         gmx_bool reproducibilityRequested)
 {
     /* Note that this check_string on the version will also print a message
@@ -2084,10 +2080,10 @@ static void check_match(FILE *fplog,
      * message further down with reproducibilityRequested=TRUE.
      */
     gmx_bool versionDiffers = FALSE;
-    check_string(fplog, "Version", gmx_version(), version, &versionDiffers);
+    check_string(fplog, "Version", gmx_version(), headerContents.version, &versionDiffers);
 
     gmx_bool precisionDiffers = FALSE;
-    check_int   (fplog, "Double prec.", GMX_DOUBLE, double_prec, &precisionDiffers);
+    check_int   (fplog, "Double prec.", GMX_DOUBLE, headerContents.double_prec, &precisionDiffers);
     if (precisionDiffers)
     {
         const char msg_precision_difference[] =
@@ -2104,28 +2100,33 @@ static void check_match(FILE *fplog,
 
     if (reproducibilityRequested)
     {
-        check_string(fplog, "Build time", BUILD_TIME, btime, &mm);
-        check_string(fplog, "Build user", BUILD_USER, buser, &mm);
-        check_string(fplog, "Build host", BUILD_HOST, bhost, &mm);
-        check_string(fplog, "Program name", gmx::getProgramContext().fullBinaryPath(), fprog, &mm);
+        check_string(fplog, "Build time", BUILD_TIME, headerContents.btime, &mm);
+        check_string(fplog, "Build user", BUILD_USER, headerContents.buser, &mm);
+        check_string(fplog, "Build host", BUILD_HOST, headerContents.bhost, &mm);
+        check_string(fplog, "Program name", gmx::getProgramContext().fullBinaryPath(), headerContents.fprog, &mm);
 
-        check_int   (fplog, "#ranks", cr->nnodes, npp_f+npme_f, &mm);
+        check_int   (fplog, "#ranks", cr->nnodes, headerContents.nnodes, &mm);
     }
 
     if (cr->nnodes > 1 && reproducibilityRequested)
     {
-        check_int (fplog, "#PME-ranks", cr->npmenodes, npme_f, &mm);
+        check_int (fplog, "#PME-ranks", cr->npmenodes, headerContents.npme, &mm);
 
         int npp = cr->nnodes;
         if (cr->npmenodes >= 0)
         {
             npp -= cr->npmenodes;
         }
+        int npp_f = headerContents.nnodes;
+        if (headerContents.npme >= 0)
+        {
+            npp_f -= headerContents.npme;
+        }
         if (npp == npp_f)
         {
-            check_int (fplog, "#DD-cells[x]", dd_nc[XX], dd_nc_f[XX], &mm);
-            check_int (fplog, "#DD-cells[y]", dd_nc[YY], dd_nc_f[YY], &mm);
-            check_int (fplog, "#DD-cells[z]", dd_nc[ZZ], dd_nc_f[ZZ], &mm);
+            check_int (fplog, "#DD-cells[x]", dd_nc[XX], headerContents.dd_nc[XX], &mm);
+            check_int (fplog, "#DD-cells[y]", dd_nc[YY], headerContents.dd_nc[YY], &mm);
+            check_int (fplog, "#DD-cells[z]", dd_nc[ZZ], headerContents.dd_nc[ZZ], &mm);
         }
     }
 
@@ -2138,7 +2139,7 @@ static void check_match(FILE *fplog,
         int        gmx_major;
         int        cpt_major;
         sscanf(gmx_version(), "%5d", &gmx_major);
-        int        ret                 = sscanf(version, "%5d", &cpt_major);
+        int        ret                 = sscanf(headerContents.version, "%5d", &cpt_major);
         gmx_bool   majorVersionDiffers = (ret < 1 || gmx_major != cpt_major);
 
         const char msg_major_version_difference[] =
@@ -2181,26 +2182,18 @@ static void check_match(FILE *fplog,
 static void read_checkpoint(const char *fn, FILE **pfplog,
                             const t_commrec *cr,
                             const ivec dd_nc,
-                            int eIntegrator, int *init_fep_state, gmx_int64_t *step, double *t,
+                            int eIntegrator,
+                            int *init_fep_state,
+                            CheckpointHeaderContents *headerContents,
                             t_state *state, gmx_bool *bReadEkin,
                             ObservablesHistory *observablesHistory,
-                            int *simulation_part,
                             gmx_bool bAppendOutputFiles, gmx_bool bForceAppend,
                             gmx_bool reproducibilityRequested)
 {
     t_fileio            *fp;
-    int                  i, j, rc;
-    int                  file_version;
-    char                *version, *btime, *buser, *bhost, *fprog, *ftime;
-    int                  double_prec;
+    int                  j, rc;
     char                 buf[STEPSTRSIZE];
-    int                  eIntegrator_f, nppnodes_f, npmenodes_f;
-    ivec                 dd_nc_f;
-    int                  natoms, ngtc, nnhpres, nhchainlength, nlambda, fflags, flags_eks, flags_enh, flags_dfh, flags_awhh;
-    int                  nED, eSwapCoords;
     int                  ret;
-    gmx_file_position_t *outputfiles;
-    int                  nfiles;
     t_fileio            *chksum_file;
     FILE               * fplog = *pfplog;
     unsigned char        digest[16];
@@ -2222,16 +2215,10 @@ static void read_checkpoint(const char *fn, FILE **pfplog,
 #endif
 
     fp = gmx_fio_open(fn, "r");
-    do_cpt_header(gmx_fio_getxdr(fp), TRUE, &file_version,
-                  &version, &btime, &buser, &bhost, &double_prec, &fprog, &ftime,
-                  &eIntegrator_f, simulation_part, step, t,
-                  &nppnodes_f, dd_nc_f, &npmenodes_f,
-                  &natoms, &ngtc, &nnhpres, &nhchainlength, &nlambda,
-                  &fflags, &flags_eks, &flags_enh, &flags_dfh, &flags_awhh,
-                  &nED, &eSwapCoords, nullptr);
+    do_cpt_header(gmx_fio_getxdr(fp), TRUE, nullptr, headerContents);
 
     if (bAppendOutputFiles &&
-        file_version >= 13 && double_prec != GMX_DOUBLE)
+        headerContents->file_version >= 13 && headerContents->double_prec != GMX_DOUBLE)
     {
         gmx_fatal(FARGS, "Output file appending requested, but the code and checkpoint file precision (single/double) don't match");
     }
@@ -2239,7 +2226,7 @@ static void read_checkpoint(const char *fn, FILE **pfplog,
     if (cr == nullptr || MASTER(cr))
     {
         fprintf(stderr, "\nReading checkpoint file %s generated: %s\n\n",
-                fn, ftime);
+                fn, headerContents->ftime);
     }
 
     /* This will not be written if we do appending, since fplog is still NULL then */
@@ -2247,45 +2234,45 @@ static void read_checkpoint(const char *fn, FILE **pfplog,
     {
         fprintf(fplog, "\n");
         fprintf(fplog, "Reading checkpoint file %s\n", fn);
-        fprintf(fplog, "  file generated by:     %s\n", fprog);
-        fprintf(fplog, "  file generated at:     %s\n", ftime);
-        fprintf(fplog, "  GROMACS build time:    %s\n", btime);
-        fprintf(fplog, "  GROMACS build user:    %s\n", buser);
-        fprintf(fplog, "  GROMACS build host:    %s\n", bhost);
-        fprintf(fplog, "  GROMACS double prec.:  %d\n", double_prec);
-        fprintf(fplog, "  simulation part #:     %d\n", *simulation_part);
-        fprintf(fplog, "  step:                  %s\n", gmx_step_str(*step, buf));
-        fprintf(fplog, "  time:                  %f\n", *t);
+        fprintf(fplog, "  file generated by:     %s\n", headerContents->fprog);
+        fprintf(fplog, "  file generated at:     %s\n", headerContents->ftime);
+        fprintf(fplog, "  GROMACS build time:    %s\n", headerContents->btime);
+        fprintf(fplog, "  GROMACS build user:    %s\n", headerContents->buser);
+        fprintf(fplog, "  GROMACS build host:    %s\n", headerContents->bhost);
+        fprintf(fplog, "  GROMACS double prec.:  %d\n", headerContents->double_prec);
+        fprintf(fplog, "  simulation part #:     %d\n", headerContents->simulation_part);
+        fprintf(fplog, "  step:                  %s\n", gmx_step_str(headerContents->step, buf));
+        fprintf(fplog, "  time:                  %f\n", headerContents->t);
         fprintf(fplog, "\n");
     }
 
-    if (natoms != state->natoms)
+    if (headerContents->natoms != state->natoms)
     {
-        gmx_fatal(FARGS, "Checkpoint file is for a system of %d atoms, while the current system consists of %d atoms", natoms, state->natoms);
+        gmx_fatal(FARGS, "Checkpoint file is for a system of %d atoms, while the current system consists of %d atoms", headerContents->natoms, state->natoms);
     }
-    if (ngtc != state->ngtc)
+    if (headerContents->ngtc != state->ngtc)
     {
-        gmx_fatal(FARGS, "Checkpoint file is for a system of %d T-coupling groups, while the current system consists of %d T-coupling groups", ngtc, state->ngtc);
+        gmx_fatal(FARGS, "Checkpoint file is for a system of %d T-coupling groups, while the current system consists of %d T-coupling groups", headerContents->ngtc, state->ngtc);
     }
-    if (nnhpres != state->nnhpres)
+    if (headerContents->nnhpres != state->nnhpres)
     {
-        gmx_fatal(FARGS, "Checkpoint file is for a system of %d NH-pressure-coupling variables, while the current system consists of %d NH-pressure-coupling variables", nnhpres, state->nnhpres);
+        gmx_fatal(FARGS, "Checkpoint file is for a system of %d NH-pressure-coupling variables, while the current system consists of %d NH-pressure-coupling variables", headerContents->nnhpres, state->nnhpres);
     }
 
     int nlambdaHistory = (state->dfhist ? state->dfhist->nlambda : 0);
-    if (nlambda != nlambdaHistory)
+    if (headerContents->nlambda != nlambdaHistory)
     {
-        gmx_fatal(FARGS, "Checkpoint file is for a system with %d lambda states, while the current system consists of %d lambda states", nlambda, nlambdaHistory);
+        gmx_fatal(FARGS, "Checkpoint file is for a system with %d lambda states, while the current system consists of %d lambda states", headerContents->nlambda, nlambdaHistory);
     }
 
-    init_gtc_state(state, state->ngtc, state->nnhpres, nhchainlength); /* need to keep this here to keep the tpr format working */
+    init_gtc_state(state, state->ngtc, state->nnhpres, headerContents->nhchainlength); /* need to keep this here to keep the tpr format working */
     /* write over whatever was read; we use the number of Nose-Hoover chains from the checkpoint */
 
-    if (eIntegrator_f != eIntegrator)
+    if (headerContents->eIntegrator != eIntegrator)
     {
         if (MASTER(cr))
         {
-            fprintf(stderr, int_warn, EI(eIntegrator_f), EI(eIntegrator));
+            fprintf(stderr, int_warn, EI(headerContents->eIntegrator), EI(eIntegrator));
         }
         if (bAppendOutputFiles)
         {
@@ -2296,11 +2283,11 @@ static void read_checkpoint(const char *fn, FILE **pfplog,
         }
         if (fplog)
         {
-            fprintf(fplog, int_warn, EI(eIntegrator_f), EI(eIntegrator));
+            fprintf(fplog, int_warn, EI(headerContents->eIntegrator), EI(eIntegrator));
         }
     }
 
-    if (fflags != state->flags)
+    if (headerContents->flags_state != state->flags)
     {
 
         if (MASTER(cr))
@@ -2327,45 +2314,48 @@ static void read_checkpoint(const char *fn, FILE **pfplog,
 
         if (fplog)
         {
-            print_flag_mismatch(fplog, state->flags, fflags);
+            print_flag_mismatch(fplog, state->flags, headerContents->flags_state);
         }
     }
     else
     {
         if (MASTER(cr))
         {
-            check_match(fplog, version, btime, buser, bhost, double_prec, fprog,
-                        cr, nppnodes_f, npmenodes_f, dd_nc, dd_nc_f,
+            check_match(fplog, cr, dd_nc, *headerContents,
                         reproducibilityRequested);
         }
     }
-    ret             = do_cpt_state(gmx_fio_getxdr(fp), fflags, state, nullptr);
+    ret             = do_cpt_state(gmx_fio_getxdr(fp), headerContents->flags_state, state, nullptr);
     *init_fep_state = state->fep_state;  /* there should be a better way to do this than setting it here.
                                             Investigate for 5.0. */
     if (ret)
     {
         cp_error();
     }
-    ret = do_cpt_ekinstate(gmx_fio_getxdr(fp), flags_eks, &state->ekinstate, nullptr);
+    ret = do_cpt_ekinstate(gmx_fio_getxdr(fp), headerContents->flags_eks, &state->ekinstate, nullptr);
     if (ret)
     {
         cp_error();
     }
-    *bReadEkin = ((flags_eks & (1<<eeksEKINH)) || (flags_eks & (1<<eeksEKINF)) || (flags_eks & (1<<eeksEKINO)) ||
-                  ((flags_eks & (1<<eeksEKINSCALEF)) | (flags_eks & (1<<eeksEKINSCALEH)) | (flags_eks & (1<<eeksVSCALE))));
+    *bReadEkin = ((headerContents->flags_eks & (1<<eeksEKINH)) ||
+                  (headerContents->flags_eks & (1<<eeksEKINF)) ||
+                  (headerContents->flags_eks & (1<<eeksEKINO)) ||
+                  ((headerContents->flags_eks & (1<<eeksEKINSCALEF)) |
+                   (headerContents->flags_eks & (1<<eeksEKINSCALEH)) |
+                   (headerContents->flags_eks & (1<<eeksVSCALE))));
 
-    if (flags_enh && observablesHistory->energyHistory == nullptr)
+    if (headerContents->flags_enh && observablesHistory->energyHistory == nullptr)
     {
         observablesHistory->energyHistory = std::unique_ptr<energyhistory_t>(new energyhistory_t {});
     }
     ret = do_cpt_enerhist(gmx_fio_getxdr(fp), TRUE,
-                          flags_enh, observablesHistory->energyHistory.get(), nullptr);
+                          headerContents->flags_enh, observablesHistory->energyHistory.get(), nullptr);
     if (ret)
     {
         cp_error();
     }
 
-    if (file_version < 6)
+    if (headerContents->file_version < 6)
     {
         const char *warn = "Reading checkpoint file in old format, assuming that the run that generated this file started at step 0, if this is not the case the averages stored in the energy file will be incorrect.";
 
@@ -2374,54 +2364,55 @@ static void read_checkpoint(const char *fn, FILE **pfplog,
         {
             fprintf(fplog, "\nWARNING: %s\n\n", warn);
         }
-        observablesHistory->energyHistory->nsum     = *step;
-        observablesHistory->energyHistory->nsum_sim = *step;
+        observablesHistory->energyHistory->nsum     = headerContents->step;
+        observablesHistory->energyHistory->nsum_sim = headerContents->step;
     }
 
-    ret = do_cpt_df_hist(gmx_fio_getxdr(fp), flags_dfh, nlambda, &state->dfhist, nullptr);
+    ret = do_cpt_df_hist(gmx_fio_getxdr(fp), headerContents->flags_dfh, headerContents->nlambda, &state->dfhist, nullptr);
     if (ret)
     {
         cp_error();
     }
 
-    if (nED > 0 && observablesHistory->edsamHistory == nullptr)
+    if (headerContents->nED > 0 && observablesHistory->edsamHistory == nullptr)
     {
         observablesHistory->edsamHistory = std::unique_ptr<edsamhistory_t>(new edsamhistory_t {});
     }
-    ret = do_cpt_EDstate(gmx_fio_getxdr(fp), TRUE, nED, observablesHistory->edsamHistory.get(), nullptr);
+    ret = do_cpt_EDstate(gmx_fio_getxdr(fp), TRUE, headerContents->nED, observablesHistory->edsamHistory.get(), nullptr);
     if (ret)
     {
         cp_error();
     }
 
-    if (flags_awhh != 0 && state->awhHistory == nullptr)
+    if (headerContents->flags_awhh != 0 && state->awhHistory == nullptr)
     {
         state->awhHistory = std::shared_ptr<gmx::AwhHistory>(new gmx::AwhHistory());
     }
     ret = do_cpt_awh(gmx_fio_getxdr(fp), TRUE,
-                     flags_awhh, state->awhHistory.get(), NULL);
+                     headerContents->flags_awhh, state->awhHistory.get(), NULL);
     if (ret)
     {
         cp_error();
     }
 
-    if (eSwapCoords != eswapNO && observablesHistory->swapHistory == nullptr)
+    if (headerContents->eSwapCoords != eswapNO && observablesHistory->swapHistory == nullptr)
     {
         observablesHistory->swapHistory = std::unique_ptr<swaphistory_t>(new swaphistory_t {});
     }
-    ret = do_cpt_swapstate(gmx_fio_getxdr(fp), TRUE, eSwapCoords, observablesHistory->swapHistory.get(), nullptr);
+    ret = do_cpt_swapstate(gmx_fio_getxdr(fp), TRUE, headerContents->eSwapCoords, observablesHistory->swapHistory.get(), nullptr);
     if (ret)
     {
         cp_error();
     }
 
-    ret = do_cpt_files(gmx_fio_getxdr(fp), TRUE, &outputfiles, &nfiles, nullptr, file_version);
+    std::vector<gmx_file_position_t> outputfiles;
+    ret = do_cpt_files(gmx_fio_getxdr(fp), TRUE, &outputfiles, nullptr, headerContents->file_version);
     if (ret)
     {
         cp_error();
     }
 
-    ret = do_cpt_footer(gmx_fio_getxdr(fp), file_version);
+    ret = do_cpt_footer(gmx_fio_getxdr(fp), headerContents->file_version);
     if (ret)
     {
         cp_error();
@@ -2431,12 +2422,6 @@ static void read_checkpoint(const char *fn, FILE **pfplog,
         gmx_file("Cannot read/write checkpoint; corrupt file, or maybe you are out of disk space?");
     }
 
-    sfree(fprog);
-    sfree(ftime);
-    sfree(btime);
-    sfree(buser);
-    sfree(bhost);
-
     /* If the user wants to append to output files,
      * we use the file pointer positions of the output files stored
      * in the checkpoint file and truncate the files such that any frames
@@ -2446,6 +2431,10 @@ static void read_checkpoint(const char *fn, FILE **pfplog,
      */
     if (bAppendOutputFiles)
     {
+        if (outputfiles.empty())
+        {
+            gmx_fatal(FARGS, "No names of output files were recorded in the checkpoint");
+        }
         if (fn2ftp(outputfiles[0].filename) != efLOG)
         {
             /* make sure first file is log file so that it is OK to use it for
@@ -2454,23 +2443,24 @@ static void read_checkpoint(const char *fn, FILE **pfplog,
             gmx_fatal(FARGS, "The first output file should always be the log "
                       "file but instead is: %s. Cannot do appending because of this condition.", outputfiles[0].filename);
         }
-        for (i = 0; i < nfiles; i++)
+        bool firstFile = true;
+        for (const auto &outputfile : outputfiles)
         {
-            if (outputfiles[i].offset < 0)
+            if (outputfile.offset < 0)
             {
                 gmx_fatal(FARGS, "The original run wrote a file called '%s' which "
                           "is larger than 2 GB, but mdrun did not support large file"
                           " offsets. Can not append. Run mdrun with -noappend",
-                          outputfiles[i].filename);
+                          outputfile.filename);
             }
 #ifdef GMX_FAHCORE
-            chksum_file = gmx_fio_open(outputfiles[i].filename, "a");
+            chksum_file = gmx_fio_open(outputfile.filename, "a");
 
 #else
-            chksum_file = gmx_fio_open(outputfiles[i].filename, "r+");
+            chksum_file = gmx_fio_open(outputfile.filename, "r+");
 
             /* lock log file */
-            if (i == 0)
+            if (firstFile)
             {
                 /* Note that there are systems where the lock operation
                  * will succeed, but a second process can also lock the file.
@@ -2494,48 +2484,51 @@ static void read_checkpoint(const char *fn, FILE **pfplog,
                         }
                         else
                         {
-                            fprintf(stderr, "\nNOTE: File locking is not supported on this system, will not lock %s\n\n", outputfiles[i].filename);
+                            fprintf(stderr, "\nNOTE: File locking is not supported on this system, will not lock %s\n\n", outputfile.filename);
                             if (fplog)
                             {
-                                fprintf(fplog, "\nNOTE: File locking not supported on this system, will not lock %s\n\n", outputfiles[i].filename);
+                                fprintf(fplog, "\nNOTE: File locking not supported on this system, will not lock %s\n\n", outputfile.filename);
                             }
                         }
                     }
                     else if (errno == EACCES || errno == EAGAIN)
                     {
                         gmx_fatal(FARGS, "Failed to lock: %s. Already running "
-                                  "simulation?", outputfiles[i].filename);
+                                  "simulation?", outputfile.filename);
                     }
                     else
                     {
                         gmx_fatal(FARGS, "Failed to lock: %s. %s.",
-                                  outputfiles[i].filename, std::strerror(errno));
+                                  outputfile.filename, std::strerror(errno));
                     }
                 }
             }
 
             /* compute md5 chksum */
-            if (outputfiles[i].chksum_size != -1)
+            if (outputfile.chksum_size != -1)
             {
-                if (gmx_fio_get_file_md5(chksum_file, outputfiles[i].offset,
-                                         digest) != outputfiles[i].chksum_size) /*at the end of the call the file position is at the end of the file*/
+                if (gmx_fio_get_file_md5(chksum_file, outputfile.offset,
+                                         digest) != outputfile.chksum_size) /*at the end of the call the file position is at the end of the file*/
                 {
                     gmx_fatal(FARGS, "Can't read %d bytes of '%s' to compute checksum. The file has been replaced or its contents have been modified. Cannot do appending because of this condition.",
-                              outputfiles[i].chksum_size,
-                              outputfiles[i].filename);
+                              outputfile.chksum_size,
+                              outputfile.filename);
                 }
             }
-            if (i == 0)  /*log file needs to be seeked in case we need to truncate (other files are truncated below)*/
+            /* log file needs to be seeked in case we need to truncate
+             * (other files are truncated below)*/
+            if (firstFile)
             {
-                if (gmx_fio_seek(chksum_file, outputfiles[i].offset))
+                if (gmx_fio_seek(chksum_file, outputfile.offset))
                 {
                     gmx_fatal(FARGS, "Seek error! Failed to truncate log-file: %s.", std::strerror(errno));
                 }
             }
 #endif
 
-            if (i == 0) /*open log file here - so that lock is never lifted
-                           after chksum is calculated */
+            /* open log file here - so that lock is never lifted
+             * after chksum is calculated */
+            if (firstFile)
             {
                 *pfplog = gmx_fio_getfp(chksum_file);
             }
@@ -2545,12 +2538,12 @@ static void read_checkpoint(const char *fn, FILE **pfplog,
             }
 #ifndef GMX_FAHCORE
             /* compare md5 chksum */
-            if (outputfiles[i].chksum_size != -1 &&
-                memcmp(digest, outputfiles[i].chksum, 16) != 0)
+            if (outputfile.chksum_size != -1 &&
+                memcmp(digest, outputfile.chksum, 16) != 0)
             {
                 if (debug)
                 {
-                    fprintf(debug, "chksum for %s: ", outputfiles[i].filename);
+                    fprintf(debug, "chksum for %s: ", outputfile.filename);
                     for (j = 0; j < 16; j++)
                     {
                         fprintf(debug, "%02x", digest[j]);
@@ -2558,26 +2551,25 @@ static void read_checkpoint(const char *fn, FILE **pfplog,
                     fprintf(debug, "\n");
                 }
                 gmx_fatal(FARGS, "Checksum wrong for '%s'. The file has been replaced or its contents have been modified. Cannot do appending because of this condition.",
-                          outputfiles[i].filename);
+                          outputfile.filename);
             }
 #endif
 
 
-            if (i != 0) /*log file is already seeked to correct position */
+            if (!firstFile) /* log file is already seeked to correct position */
             {
 #if !GMX_NATIVE_WINDOWS || !defined(GMX_FAHCORE)
                 /* For FAHCORE, we do this elsewhere*/
-                rc = gmx_truncate(outputfiles[i].filename, outputfiles[i].offset);
+                rc = gmx_truncate(outputfile.filename, outputfile.offset);
                 if (rc != 0)
                 {
-                    gmx_fatal(FARGS, "Truncation of file %s failed. Cannot do appending because of this failure.", outputfiles[i].filename);
+                    gmx_fatal(FARGS, "Truncation of file %s failed. Cannot do appending because of this failure.", outputfile.filename);
                 }
 #endif
             }
+            firstFile = false;
         }
     }
-
-    sfree(outputfiles);
 }
 
 
@@ -2589,30 +2581,29 @@ void load_checkpoint(const char *fn, FILE **fplog,
                      gmx_bool bAppend, gmx_bool bForceAppend,
                      gmx_bool reproducibilityRequested)
 {
-    gmx_int64_t     step;
-    double          t;
-
+    CheckpointHeaderContents headerContents;
     if (SIMMASTER(cr))
     {
         /* Read the state from the checkpoint file */
         read_checkpoint(fn, fplog,
                         cr, dd_nc,
-                        ir->eI, &(ir->fepvals->init_fep_state), &step, &t,
+                        ir->eI, &(ir->fepvals->init_fep_state),
+                        &headerContents,
                         state, bReadEkin, observablesHistory,
-                        &ir->simulation_part, bAppend, bForceAppend,
+                        bAppend, bForceAppend,
                         reproducibilityRequested);
     }
     if (PAR(cr))
     {
-        gmx_bcast(sizeof(step), &step, cr);
+        gmx_bcast(sizeof(headerContents.step), &headerContents.step, cr);
         gmx_bcast(sizeof(*bReadEkin), bReadEkin, cr);
     }
     ir->bContinuation    = TRUE;
     if (ir->nsteps >= 0)
     {
-        ir->nsteps          += ir->init_step - step;
+        ir->nsteps          += ir->init_step - headerContents.step;
     }
-    ir->init_step        = step;
+    ir->init_step        = headerContents.step;
     ir->simulation_part += 1;
 }
 
@@ -2620,17 +2611,6 @@ void read_checkpoint_part_and_step(const char  *filename,
                                    int         *simulation_part,
                                    gmx_int64_t *step)
 {
-    int       file_version;
-    char     *version, *btime, *buser, *bhost, *fprog, *ftime;
-    int       double_prec;
-    int       eIntegrator;
-    int       nppnodes, npme;
-    ivec      dd_nc;
-    int       nlambda;
-    int       flags_eks, flags_enh, flags_dfh, flags_awhh;
-    double    t;
-    t_state   state;
-    int       nED, eSwapCoords;
     t_fileio *fp;
 
     if (filename == nullptr ||
@@ -2642,50 +2622,36 @@ void read_checkpoint_part_and_step(const char  *filename,
         return;
     }
 
-    /* Not calling initializing state before use is nasty, but all we
-       do is read into its member variables and throw the struct away
-       again immediately. */
-
-    do_cpt_header(gmx_fio_getxdr(fp), TRUE, &file_version,
-                  &version, &btime, &buser, &bhost, &double_prec, &fprog, &ftime,
-                  &eIntegrator, simulation_part, step, &t, &nppnodes, dd_nc, &npme,
-                  &state.natoms, &state.ngtc, &state.nnhpres, &state.nhchainlength,
-                  &nlambda, &state.flags, &flags_eks, &flags_enh, &flags_dfh, &flags_awhh,
-                  &nED, &eSwapCoords, nullptr);
-
+    CheckpointHeaderContents headerContents;
+    do_cpt_header(gmx_fio_getxdr(fp), TRUE, nullptr, &headerContents);
     gmx_fio_close(fp);
+    *simulation_part = headerContents.simulation_part;
+    *step            = headerContents.step;
 }
 
 static void read_checkpoint_data(t_fileio *fp, int *simulation_part,
                                  gmx_int64_t *step, double *t, t_state *state,
-                                 int *nfiles, gmx_file_position_t **outputfiles)
-{
-    int                  file_version;
-    char                *version, *btime, *buser, *bhost, *fprog, *ftime;
-    int                  double_prec;
-    int                  eIntegrator;
-    int                  nppnodes, npme;
-    ivec                 dd_nc;
-    int                  nlambda;
-    int                  flags_eks, flags_enh, flags_dfh, flags_awhh;
-    int                  nED, eSwapCoords;
-    int                  nfiles_loc;
-    gmx_file_position_t *files_loc = nullptr;
-    int                  ret;
-
-    do_cpt_header(gmx_fio_getxdr(fp), TRUE, &file_version,
-                  &version, &btime, &buser, &bhost, &double_prec, &fprog, &ftime,
-                  &eIntegrator, simulation_part, step, t, &nppnodes, dd_nc, &npme,
-                  &state->natoms, &state->ngtc, &state->nnhpres, &state->nhchainlength,
-                  &nlambda, &state->flags, &flags_eks, &flags_enh, &flags_dfh, &flags_awhh,
-                  &nED, &eSwapCoords, nullptr);
-    ret =
+                                 std::vector<gmx_file_position_t> *outputfiles)
+{
+    int                      ret;
+
+    CheckpointHeaderContents headerContents;
+    do_cpt_header(gmx_fio_getxdr(fp), TRUE, nullptr, &headerContents);
+    *simulation_part     = headerContents.simulation_part;
+    *step                = headerContents.step;
+    *t                   = headerContents.t;
+    state->natoms        = headerContents.natoms;
+    state->ngtc          = headerContents.ngtc;
+    state->nnhpres       = headerContents.nnhpres;
+    state->nhchainlength = headerContents.nhchainlength;
+    state->flags         = headerContents.flags_state;
+    ret                  =
         do_cpt_state(gmx_fio_getxdr(fp), state->flags, state, nullptr);
     if (ret)
     {
         cp_error();
     }
-    ret = do_cpt_ekinstate(gmx_fio_getxdr(fp), flags_eks, &state->ekinstate, nullptr);
+    ret = do_cpt_ekinstate(gmx_fio_getxdr(fp), headerContents.flags_eks, &state->ekinstate, nullptr);
     if (ret)
     {
         cp_error();
@@ -2693,95 +2659,63 @@ static void read_checkpoint_data(t_fileio *fp, int *simulation_part,
 
     energyhistory_t enerhist;
     ret = do_cpt_enerhist(gmx_fio_getxdr(fp), TRUE,
-                          flags_enh, &enerhist, nullptr);
+                          headerContents.flags_enh, &enerhist, nullptr);
     if (ret)
     {
         cp_error();
     }
-    ret = do_cpt_df_hist(gmx_fio_getxdr(fp), flags_dfh, nlambda, &state->dfhist, nullptr);
+    ret = do_cpt_df_hist(gmx_fio_getxdr(fp), headerContents.flags_dfh, headerContents.nlambda, &state->dfhist, nullptr);
     if (ret)
     {
         cp_error();
     }
 
     edsamhistory_t edsamhist = {};
-    ret = do_cpt_EDstate(gmx_fio_getxdr(fp), TRUE, nED, &edsamhist, nullptr);
+    ret = do_cpt_EDstate(gmx_fio_getxdr(fp), TRUE, headerContents.nED, &edsamhist, nullptr);
     if (ret)
     {
         cp_error();
     }
 
     ret = do_cpt_awh(gmx_fio_getxdr(fp), TRUE,
-                     flags_awhh, state->awhHistory.get(), NULL);
+                     headerContents.flags_awhh, state->awhHistory.get(), NULL);
     if (ret)
     {
         cp_error();
     }
 
     swaphistory_t swaphist = {};
-    ret = do_cpt_swapstate(gmx_fio_getxdr(fp), TRUE, eSwapCoords, &swaphist, nullptr);
+    ret = do_cpt_swapstate(gmx_fio_getxdr(fp), TRUE, headerContents.eSwapCoords, &swaphist, nullptr);
     if (ret)
     {
         cp_error();
     }
 
     ret = do_cpt_files(gmx_fio_getxdr(fp), TRUE,
-                       &files_loc,
-                       &nfiles_loc,
-                       nullptr, file_version);
-    if (outputfiles != nullptr)
-    {
-        *outputfiles = files_loc;
-    }
-    else
-    {
-        sfree(files_loc);
-    }
-    if (nfiles != nullptr)
-    {
-        *nfiles = nfiles_loc;
-    }
+                       outputfiles,
+                       nullptr, headerContents.file_version);
 
     if (ret)
     {
         cp_error();
     }
 
-    ret = do_cpt_footer(gmx_fio_getxdr(fp), file_version);
+    ret = do_cpt_footer(gmx_fio_getxdr(fp), headerContents.file_version);
     if (ret)
     {
         cp_error();
     }
-
-    sfree(fprog);
-    sfree(ftime);
-    sfree(btime);
-    sfree(buser);
-    sfree(bhost);
-}
-
-void
-read_checkpoint_state(const char *fn, int *simulation_part,
-                      gmx_int64_t *step, double *t, t_state *state)
-{
-    t_fileio *fp;
-
-    fp = gmx_fio_open(fn, "r");
-    read_checkpoint_data(fp, simulation_part, step, t, state, nullptr, nullptr);
-    if (gmx_fio_close(fp) != 0)
-    {
-        gmx_file("Cannot read/write checkpoint; corrupt file, or maybe you are out of disk space?");
-    }
 }
 
 void read_checkpoint_trxframe(t_fileio *fp, t_trxframe *fr)
 {
-    t_state         state;
-    int             simulation_part;
-    gmx_int64_t     step;
-    double          t;
+    t_state                          state;
+    int                              simulation_part;
+    gmx_int64_t                      step;
+    double                           t;
 
-    read_checkpoint_data(fp, &simulation_part, &step, &t, &state, nullptr, nullptr);
+    std::vector<gmx_file_position_t> outputfiles;
+    read_checkpoint_data(fp, &simulation_part, &step, &t, &state, &outputfiles);
 
     fr->natoms  = state.natoms;
     fr->bStep   = TRUE;
@@ -2814,36 +2748,24 @@ void read_checkpoint_trxframe(t_fileio *fp, t_trxframe *fr)
 void list_checkpoint(const char *fn, FILE *out)
 {
     t_fileio            *fp;
-    int                  file_version;
-    char                *version, *btime, *buser, *bhost, *fprog, *ftime;
-    int                  double_prec;
-    int                  eIntegrator, simulation_part, nppnodes, npme;
-    gmx_int64_t          step;
-    double               t;
-    ivec                 dd_nc;
-    int                  nlambda;
-    int                  flags_eks, flags_enh, flags_dfh, flags_awhh;;
-    int                  nED, eSwapCoords;
     int                  ret;
-    gmx_file_position_t *outputfiles;
-    int                  nfiles;
 
     t_state              state;
 
     fp = gmx_fio_open(fn, "r");
-    do_cpt_header(gmx_fio_getxdr(fp), TRUE, &file_version,
-                  &version, &btime, &buser, &bhost, &double_prec, &fprog, &ftime,
-                  &eIntegrator, &simulation_part, &step, &t, &nppnodes, dd_nc, &npme,
-                  &state.natoms, &state.ngtc, &state.nnhpres, &state.nhchainlength,
-                  &nlambda, &state.flags,
-                  &flags_eks, &flags_enh, &flags_dfh, &flags_awhh, &nED, &eSwapCoords,
-                  out);
-    ret = do_cpt_state(gmx_fio_getxdr(fp), state.flags, &state, out);
+    CheckpointHeaderContents headerContents;
+    do_cpt_header(gmx_fio_getxdr(fp), TRUE, out, &headerContents);
+    state.natoms        = headerContents.natoms;
+    state.ngtc          = headerContents.ngtc;
+    state.nnhpres       = headerContents.nnhpres;
+    state.nhchainlength = headerContents.nhchainlength;
+    state.flags         = headerContents.flags_state;
+    ret                 = do_cpt_state(gmx_fio_getxdr(fp), state.flags, &state, out);
     if (ret)
     {
         cp_error();
     }
-    ret = do_cpt_ekinstate(gmx_fio_getxdr(fp), flags_eks, &state.ekinstate, out);
+    ret = do_cpt_ekinstate(gmx_fio_getxdr(fp), headerContents.flags_eks, &state.ekinstate, out);
     if (ret)
     {
         cp_error();
@@ -2851,40 +2773,41 @@ void list_checkpoint(const char *fn, FILE *out)
 
     energyhistory_t enerhist;
     ret = do_cpt_enerhist(gmx_fio_getxdr(fp), TRUE,
-                          flags_enh, &enerhist, out);
+                          headerContents.flags_enh, &enerhist, out);
 
     if (ret == 0)
     {
         ret = do_cpt_df_hist(gmx_fio_getxdr(fp),
-                             flags_dfh, nlambda, &state.dfhist, out);
+                             headerContents.flags_dfh, headerContents.nlambda, &state.dfhist, out);
     }
 
     if (ret == 0)
     {
         edsamhistory_t edsamhist = {};
-        ret = do_cpt_EDstate(gmx_fio_getxdr(fp), TRUE, nED, &edsamhist, out);
+        ret = do_cpt_EDstate(gmx_fio_getxdr(fp), TRUE, headerContents.nED, &edsamhist, out);
     }
 
     if (ret == 0)
     {
         ret = do_cpt_awh(gmx_fio_getxdr(fp), TRUE,
-                         flags_awhh, state.awhHistory.get(), out);
+                         headerContents.flags_awhh, state.awhHistory.get(), out);
     }
 
     if (ret == 0)
     {
         swaphistory_t swaphist = {};
-        ret = do_cpt_swapstate(gmx_fio_getxdr(fp), TRUE, eSwapCoords, &swaphist, out);
+        ret = do_cpt_swapstate(gmx_fio_getxdr(fp), TRUE, headerContents.eSwapCoords, &swaphist, out);
     }
 
     if (ret == 0)
     {
-        ret = do_cpt_files(gmx_fio_getxdr(fp), TRUE, &outputfiles, &nfiles, out, file_version);
+        std::vector<gmx_file_position_t> outputfiles;
+        ret = do_cpt_files(gmx_fio_getxdr(fp), TRUE, &outputfiles, out, headerContents.file_version);
     }
 
     if (ret == 0)
     {
-        ret = do_cpt_footer(gmx_fio_getxdr(fp), file_version);
+        ret = do_cpt_footer(gmx_fio_getxdr(fp), headerContents.file_version);
     }
 
     if (ret)
@@ -2899,17 +2822,15 @@ void list_checkpoint(const char *fn, FILE *out)
 
 /* This routine cannot print tons of data, since it is called before the log file is opened. */
 void
-read_checkpoint_simulation_part_and_filenames(t_fileio             *fp,
-                                              int                  *simulation_part,
-                                              int                  *nfiles,
-                                              gmx_file_position_t **outputfiles)
+read_checkpoint_simulation_part_and_filenames(t_fileio                         *fp,
+                                              int                              *simulation_part,
+                                              std::vector<gmx_file_position_t> *outputfiles)
 {
     gmx_int64_t step = 0;
     double      t;
     t_state     state;
 
-    read_checkpoint_data(fp, simulation_part, &step, &t, &state,
-                         nfiles, outputfiles);
+    read_checkpoint_data(fp, simulation_part, &step, &t, &state, outputfiles);
     if (gmx_fio_close(fp) != 0)
     {
         gmx_file("Cannot read/write checkpoint; corrupt file, or maybe you are out of disk space?");
index 697e31c14ba8c390f9a19b2235efb86c19f50a61..be07ba515fd40772ec081a67ce639350f0edbbb0 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 
 #include <cstdio>
 
+#include <vector>
+
 #include "gromacs/math/vectypes.h"
 #include "gromacs/utility/basedefinitions.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 class energyhistory_t;
 struct gmx_file_position_t;
 struct ObservablesHistory;
@@ -90,14 +88,6 @@ void load_checkpoint(const char *fn, FILE **fplog,
                      gmx_bool bAppend, gmx_bool bForceAppend,
                      gmx_bool reproducibilityRequested);
 
-/* Read the state from checkpoint file.
- * Arrays in state that are NULL are allocated.
- * If bReadRNG=TRUE a RNG state compatible with the current
- * number of nodes was read.
- */
-void read_checkpoint_state(const char *fn, int *simulation_part,
-                           gmx_int64_t *step, double *t, t_state *state);
-
 /* Read everything that can be stored in t_trxframe from a checkpoint file */
 void read_checkpoint_trxframe(struct t_fileio *fp, t_trxframe *fr);
 
@@ -124,17 +114,10 @@ void read_checkpoint_part_and_step(const char  *filename,
  *
  * \param[in]  fp               Handle to open checkpoint file
  * \param[out] simulation_part  The part of the simulation that wrote the checkpoint
- * \param[out] nfiles           Number of output files from the previous run
- * \param[out] outputfiles      Pointer to array of output file names from the previous run. Pointer is allocated in this function.
- */
+ * \param[out] outputfiles      Container of output file names from the previous run. */
 void
-read_checkpoint_simulation_part_and_filenames(struct t_fileio             *fp,
-                                              int                         *simulation_part,
-                                              int                         *nfiles,
-                                              struct gmx_file_position_t **outputfiles);
-
-#ifdef __cplusplus
-}
-#endif
+read_checkpoint_simulation_part_and_filenames(struct t_fileio                  *fp,
+                                              int                              *simulation_part,
+                                              std::vector<gmx_file_position_t> *outputfiles);
 
 #endif
index 485abae3a9a74447acce2f0cff6477b173726acf..62f59a48701be0e2fc44cca57517d658c780ac4a 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -574,18 +574,10 @@ static int gmx_fio_int_get_file_position(t_fileio *fio, gmx_off_t *offset)
     return 0;
 }
 
-int gmx_fio_get_output_file_positions(gmx_file_position_t **p_outputfiles,
-                                      int                  *p_nfiles)
+std::vector<gmx_file_position_t> gmx_fio_get_output_file_positions()
 {
-    int                   nfiles, nalloc;
-    gmx_file_position_t * outputfiles;
-    t_fileio             *cur;
-
-    nfiles = 0;
-
-    /* pre-allocate 100 files */
-    nalloc = 100;
-    snew(outputfiles, nalloc);
+    std::vector<gmx_file_position_t> outputfiles;
+    t_fileio                        *cur;
 
     Lock openFilesLock(open_file_mutex);
     cur = gmx_fio_get_first();
@@ -595,32 +587,24 @@ int gmx_fio_get_output_file_positions(gmx_file_position_t **p_outputfiles,
            we call this routine... */
         if (!cur->bRead && cur->iFTP != efCPT)
         {
-            /* This is an output file currently open for writing, add it */
-            if (nfiles == nalloc)
-            {
-                nalloc += 100;
-                srenew(outputfiles, nalloc);
-            }
+            outputfiles.push_back(gmx_file_position_t {});
 
-            std::strncpy(outputfiles[nfiles].filename, cur->fn, STRLEN - 1);
+            std::strncpy(outputfiles.back().filename, cur->fn, STRLEN - 1);
 
             /* Get the file position */
-            gmx_fio_int_get_file_position(cur, &outputfiles[nfiles].offset);
+            gmx_fio_int_get_file_position(cur, &outputfiles.back().offset);
 #ifndef GMX_FAHCORE
-            outputfiles[nfiles].chksum_size
+            outputfiles.back().chksum_size
                 = gmx_fio_int_get_file_md5(cur,
-                                           outputfiles[nfiles].offset,
-                                           outputfiles[nfiles].chksum);
+                                           outputfiles.back().offset,
+                                           outputfiles.back().chksum);
 #endif
-            nfiles++;
         }
 
         cur = gmx_fio_get_next(cur);
     }
-    *p_nfiles      = nfiles;
-    *p_outputfiles = outputfiles;
 
-    return 0;
+    return outputfiles;
 }
 
 
index d08249e4a15ac045784afb177c6f1d46d60cc510..a94f7d86301a84011391dec37691a59e7550516d 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 
 #include <stdio.h>
 
+#include <vector>
+
 #include "gromacs/math/vectypes.h"
 #include "gromacs/utility/cstringutil.h"
 #include "gromacs/utility/futil.h"
 #include "gromacs/utility/real.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 typedef struct t_fileio t_fileio;
 
 /* NOTE ABOUT THREAD SAFETY:
@@ -141,24 +139,19 @@ FILE *gmx_fio_getfp(t_fileio *fio);
  * If you do not have it on some other platform you do not have largefile
  * support at all, and you can define it to int (or better, find out how to
  * enable large files).  */
-typedef struct gmx_file_position_t
+struct gmx_file_position_t
 {
-    char          filename[STRLEN];
-    gmx_off_t     offset;
-    unsigned char chksum[16];
-    int           chksum_size;
-}
-gmx_file_position_t;
-
-int gmx_fio_get_output_file_positions(gmx_file_position_t ** outputfiles,
-                                      int                   *nfiles );
-/* Return the name and file pointer positions for all currently open
- * output files. This is used for saving in the checkpoint files, so we
- * can truncate output files upon restart-with-appending.
+    char          filename[STRLEN] = {0};
+    gmx_off_t     offset           = 0;
+    unsigned char chksum[16]       = {0};
+    int           chksum_size      = 0;
+};
+
+/*! \brief Return data about output files.
  *
- * For the first argument you should use a pointer, which will be set to
- * point to a list of open files.
- */
+ * This is used for handling data stored in the checkpoint files, so
+ * we can truncate output files upon restart-with-appending. */
+std::vector<gmx_file_position_t> gmx_fio_get_output_file_positions();
 
 t_fileio *gmx_fio_all_output_fsync(void);
 /* fsync all open output files. This is used for checkpointing, where
@@ -181,8 +174,4 @@ int gmx_fio_get_file_md5(t_fileio *fio, gmx_off_t offset,
 int xtc_seek_time(t_fileio *fio, real time, int natoms, gmx_bool bSeekForwardOnly);
 
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif
index 6e3db2cd43856485e782c4c93660071e9c355cea..d60a5c97edb085283f8f79c82f0ced7b0b14bff1 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -118,6 +118,7 @@ enum tpxv {
     tpxv_PullExternalPotential,                              /**< Added pull type external potential */
     tpxv_GenericParamsForElectricField,                      /**< Introduced KeyValueTree and moved electric field parameters */
     tpxv_AcceleratedWeightHistogram,                         /**< sampling with accelerated weight histogram method (AWH) */
+    tpxv_RemoveImplicitSolvation,                            /**< removed support for implicit solvation */
     tpxv_Count                                               /**< the total number of tpxv versions */
 };
 
@@ -153,7 +154,7 @@ static const int tpx_generation = 26;
 /* This number should be the most recent backwards incompatible version
  * I.e., if this number is 9, we cannot read tpx version 9 with this code.
  */
-static const int tpx_incompatible_version = 30; // GMX3.2 has version 31
+static const int tpx_incompatible_version = 57; // GMX4.0 has version 58
 
 
 
@@ -164,44 +165,35 @@ typedef struct {
 } t_ftupd;
 
 /*
+ * TODO The following three lines make little sense, please clarify if
+ * you've had to work out how ftupd works.
+ *
  * The entries should be ordered in:
  * 1. ascending function type number
  * 2. ascending file version number
+ *
+ * Because we support reading of old .tpr file versions (even when
+ * mdrun can no longer run the simulation), we need to be able to read
+ * obsolete t_interaction_function types. Any data read from such
+ * fields is discarded. Their names have _NOLONGERUSED appended to
+ * them to make things clear.
  */
 static const t_ftupd ftupd[] = {
-    { 34, F_FENEBONDS         },
-    { 43, F_TABBONDS          },
-    { 43, F_TABBONDSNC        },
     { 70, F_RESTRBONDS        },
     { tpxv_RestrictedBendingAndCombinedAngleTorsionPotentials, F_RESTRANGLES },
     { 76, F_LINEAR_ANGLES     },
-    { 34, F_QUARTIC_ANGLES    },
-    { 43, F_TABANGLES         },
     { tpxv_RestrictedBendingAndCombinedAngleTorsionPotentials, F_RESTRDIHS },
     { tpxv_RestrictedBendingAndCombinedAngleTorsionPotentials, F_CBTDIHS },
-    { 43, F_TABDIHS           },
     { 65, F_CMAP              },
-    { 60, F_GB12              },
-    { 61, F_GB13              },
-    { 61, F_GB14              },
-    { 72, F_GBPOL             },
-    { 72, F_NPSOLVATION       },
-    { 41, F_LJC14_Q           },
-    { 41, F_LJC_PAIRS_NB      },
-    { 32, F_BHAM_LR_NOLONGERUSED },
-    { 32, F_RF_EXCL           },
-    { 32, F_COUL_RECIP        },
+    { 60, F_GB12_NOLONGERUSED },
+    { 61, F_GB13_NOLONGERUSED },
+    { 61, F_GB14_NOLONGERUSED },
+    { 72, F_GBPOL_NOLONGERUSED },
+    { 72, F_NPSOLVATION_NOLONGERUSED },
     { 93, F_LJ_RECIP          },
-    { 46, F_DPD               },
-    { 36, F_THOLE_POL         },
     { 90, F_FBPOSRES          },
-    { 49, F_VSITE4FDN         },
-    { 50, F_VSITEN            },
-    { 46, F_COM_PULL          },
-    { 46, F_ECONSERVED        },
     { 69, F_VTEMP_NOLONGERUSED},
     { 66, F_PDISPCORR         },
-    { 54, F_DVDL_CONSTR       },
     { 76, F_ANHARM_POL        },
     { 79, F_DVDL_COUL         },
     { 79, F_DVDL_VDW,         },
@@ -222,8 +214,7 @@ static const t_ftupd ftupd[] = {
 static void do_pullgrp_tpx_pre95(t_fileio     *fio,
                                  t_pull_group *pgrp,
                                  t_pull_coord *pcrd,
-                                 gmx_bool      bRead,
-                                 int           file_version)
+                                 gmx_bool      bRead)
 {
     rvec tmp;
 
@@ -246,14 +237,7 @@ static void do_pullgrp_tpx_pre95(t_fileio     *fio,
     pcrd->init = tmp[0];
     gmx_fio_do_real(fio, pcrd->rate);
     gmx_fio_do_real(fio, pcrd->k);
-    if (file_version >= 56)
-    {
-        gmx_fio_do_real(fio, pcrd->kB);
-    }
-    else
-    {
-        pcrd->kB = pcrd->k;
-    }
+    gmx_fio_do_real(fio, pcrd->kB);
 }
 
 static void do_pull_group(t_fileio *fio, t_pull_group *pgrp, gmx_bool bRead)
@@ -551,14 +535,7 @@ static void do_fepvals(t_fileio *fio, t_lambda *fepvals, gmx_bool bRead, int fil
         }
     }
     gmx_fio_do_real(fio, fepvals->sc_alpha);
-    if (file_version >= 38)
-    {
-        gmx_fio_do_int(fio, fepvals->sc_power);
-    }
-    else
-    {
-        fepvals->sc_power = 2;
-    }
+    gmx_fio_do_int(fio, fepvals->sc_power);
     if (file_version >= 79)
     {
         gmx_fio_do_real(fio, fepvals->sc_r_power);
@@ -789,7 +766,7 @@ static void do_pull(t_fileio *fio, pull_params_t *pull, gmx_bool bRead,
         {
             /* We read and ignore a pull coordinate for group 0 */
             do_pullgrp_tpx_pre95(fio, &pull->group[g], &pull->coord[std::max(g-1, 0)],
-                                 bRead, file_version);
+                                 bRead);
             if (g > 0)
             {
                 pull->coord[g-1].group[0] = 0;
@@ -1020,10 +997,10 @@ static void do_legacy_efield(t_fileio *fio, gmx::KeyValueTreeObjectBuilder *root
 
 
 static void do_inputrec(t_fileio *fio, t_inputrec *ir, gmx_bool bRead,
-                        int file_version, real *fudgeQQ)
+                        int file_version)
 {
     int      i, j, k, idum = 0;
-    real     rdum, bd_temp;
+    real     rdum;
     gmx_bool bdum = 0;
 
     if (file_version != tpx_version)
@@ -1063,14 +1040,7 @@ static void do_inputrec(t_fileio *fio, t_inputrec *ir, gmx_bool bRead,
         ir->init_step = idum;
     }
 
-    if (file_version >= 58)
-    {
-        gmx_fio_do_int(fio, ir->simulation_part);
-    }
-    else
-    {
-        ir->simulation_part = 1;
-    }
+    gmx_fio_do_int(fio, ir->simulation_part);
 
     if (file_version >= 67)
     {
@@ -1080,29 +1050,6 @@ static void do_inputrec(t_fileio *fio, t_inputrec *ir, gmx_bool bRead,
     {
         ir->nstcalcenergy = 1;
     }
-    if (file_version < 53)
-    {
-        /* The pbc info has been moved out of do_inputrec,
-         * since we always want it, also without reading the inputrec.
-         */
-        gmx_fio_do_int(fio, ir->ePBC);
-        if (file_version >= 45)
-        {
-            gmx_fio_do_int(fio, ir->bPeriodicMols);
-        }
-        else
-        {
-            if (ir->ePBC == 2)
-            {
-                ir->ePBC          = epbcXYZ;
-                ir->bPeriodicMols = TRUE;
-            }
-            else
-            {
-                ir->bPeriodicMols = FALSE;
-            }
-        }
-    }
     if (file_version >= 81)
     {
         gmx_fio_do_int(fio, ir->cutoff_scheme);
@@ -1118,33 +1065,11 @@ static void do_inputrec(t_fileio *fio, t_inputrec *ir, gmx_bool bRead,
     gmx_fio_do_int(fio, ir->ns_type);
     gmx_fio_do_int(fio, ir->nstlist);
     gmx_fio_do_int(fio, idum); /* used to be ndelta; not used anymore */
-    if (file_version < 41)
-    {
-        gmx_fio_do_int(fio, idum);
-        gmx_fio_do_int(fio, idum);
-    }
-    if (file_version >= 45)
-    {
-        gmx_fio_do_real(fio, ir->rtpi);
-    }
-    else
-    {
-        ir->rtpi = 0.05;
-    }
+
+    gmx_fio_do_real(fio, ir->rtpi);
+
     gmx_fio_do_int(fio, ir->nstcomm);
-    if (file_version > 34)
-    {
-        gmx_fio_do_int(fio, ir->comm_mode);
-    }
-    else if (ir->nstcomm < 0)
-    {
-        ir->comm_mode = ecmANGULAR;
-    }
-    else
-    {
-        ir->comm_mode = ecmLINEAR;
-    }
-    ir->nstcomm = abs(ir->nstcomm);
+    gmx_fio_do_int(fio, ir->comm_mode);
 
     /* ignore nstcheckpoint */
     if (file_version < tpxv_RemoveObsoleteParameters1)
@@ -1223,10 +1148,6 @@ static void do_inputrec(t_fileio *fio, t_inputrec *ir, gmx_bool bRead,
         gmx_fio_do_int(fio, dummy_nstcalclr);
     }
     gmx_fio_do_int(fio, ir->coulombtype);
-    if (file_version < 32 && ir->coulombtype == eelRF)
-    {
-        ir->coulombtype = eelRF_NEC_UNSUPPORTED;
-    }
     if (file_version >= 81)
     {
         gmx_fio_do_int(fio, ir->coulomb_modifier);
@@ -1250,72 +1171,41 @@ static void do_inputrec(t_fileio *fio, t_inputrec *ir, gmx_bool bRead,
     gmx_fio_do_real(fio, ir->rvdw);
     gmx_fio_do_int(fio, ir->eDispCorr);
     gmx_fio_do_real(fio, ir->epsilon_r);
-    if (file_version >= 37)
-    {
-        gmx_fio_do_real(fio, ir->epsilon_rf);
-    }
-    else
-    {
-        if (EEL_RF(ir->coulombtype))
-        {
-            ir->epsilon_rf = ir->epsilon_r;
-            ir->epsilon_r  = 1.0;
-        }
-        else
-        {
-            ir->epsilon_rf = 1.0;
-        }
-    }
+    gmx_fio_do_real(fio, ir->epsilon_rf);
     gmx_fio_do_real(fio, ir->tabext);
 
-    gmx_fio_do_int(fio, ir->gb_algorithm);
-    gmx_fio_do_int(fio, ir->nstgbradii);
-    gmx_fio_do_real(fio, ir->rgbradii);
-    gmx_fio_do_real(fio, ir->gb_saltconc);
-    gmx_fio_do_int(fio, ir->implicit_solvent);
-    if (file_version >= 55)
+    // This permits reading a .tpr file that used implicit solvent,
+    // and later permitting mdrun to refuse to run it.
+    if (bRead)
     {
-        gmx_fio_do_real(fio, ir->gb_epsilon_solvent);
-        gmx_fio_do_real(fio, ir->gb_obc_alpha);
-        gmx_fio_do_real(fio, ir->gb_obc_beta);
-        gmx_fio_do_real(fio, ir->gb_obc_gamma);
-        if (file_version >= 60)
+        if (file_version < tpxv_RemoveImplicitSolvation)
         {
-            gmx_fio_do_real(fio, ir->gb_dielectric_offset);
-            gmx_fio_do_int(fio, ir->sa_algorithm);
+            gmx_fio_do_int(fio, idum);
+            gmx_fio_do_int(fio, idum);
+            gmx_fio_do_real(fio, rdum);
+            gmx_fio_do_real(fio, rdum);
+            gmx_fio_do_int(fio, idum);
+            ir->implicit_solvent = (idum > 0);
         }
         else
         {
-            ir->gb_dielectric_offset = 0.009;
-            ir->sa_algorithm         = esaAPPROX;
+            ir->implicit_solvent = false;
         }
-        gmx_fio_do_real(fio, ir->sa_surface_tension);
-
-        /* Override sa_surface_tension if it is not changed in the mpd-file */
-        if (ir->sa_surface_tension < 0)
+        if (file_version < tpxv_RemoveImplicitSolvation)
         {
-            if (ir->gb_algorithm == egbSTILL)
-            {
-                ir->sa_surface_tension = 0.0049 * 100 * CAL2JOULE;
-            }
-            else if (ir->gb_algorithm == egbHCT || ir->gb_algorithm == egbOBC)
+            gmx_fio_do_real(fio, rdum);
+            gmx_fio_do_real(fio, rdum);
+            gmx_fio_do_real(fio, rdum);
+            gmx_fio_do_real(fio, rdum);
+            if (file_version >= 60)
             {
-                ir->sa_surface_tension = 0.0054 * 100 * CAL2JOULE;
+                gmx_fio_do_real(fio, rdum);
+                gmx_fio_do_int(fio, idum);
             }
+            gmx_fio_do_real(fio, rdum);
         }
-
-    }
-    else
-    {
-        /* Better use sensible values than insane (0.0) ones... */
-        ir->gb_epsilon_solvent = 80;
-        ir->gb_obc_alpha       = 1.0;
-        ir->gb_obc_beta        = 0.8;
-        ir->gb_obc_gamma       = 4.85;
-        ir->sa_surface_tension = 2.092;
     }
 
-
     if (file_version >= 81)
     {
         gmx_fio_do_real(fio, ir->fourier_spacing);
@@ -1386,18 +1276,10 @@ static void do_inputrec(t_fileio *fio, t_inputrec *ir, gmx_bool bRead,
     gmx_fio_do_rvec(fio, ir->compress[XX]);
     gmx_fio_do_rvec(fio, ir->compress[YY]);
     gmx_fio_do_rvec(fio, ir->compress[ZZ]);
-    if (file_version >= 47)
-    {
-        gmx_fio_do_int(fio, ir->refcoord_scaling);
-        gmx_fio_do_rvec(fio, ir->posres_com);
-        gmx_fio_do_rvec(fio, ir->posres_comB);
-    }
-    else
-    {
-        ir->refcoord_scaling = erscNO;
-        clear_rvec(ir->posres_com);
-        clear_rvec(ir->posres_comB);
-    }
+    gmx_fio_do_int(fio, ir->refcoord_scaling);
+    gmx_fio_do_rvec(fio, ir->posres_com);
+    gmx_fio_do_rvec(fio, ir->posres_comB);
+
     if (file_version < 79)
     {
         gmx_fio_do_int(fio, ir->andersen_seed);
@@ -1407,17 +1289,7 @@ static void do_inputrec(t_fileio *fio, t_inputrec *ir, gmx_bool bRead,
         ir->andersen_seed = 0;
     }
 
-    if (file_version < 37)
-    {
-        gmx_fio_do_real(fio, rdum);
-    }
-
     gmx_fio_do_real(fio, ir->shake_tol);
-    if (file_version < 54)
-    {
-        // cppcheck-suppress redundantPointerOp
-        gmx_fio_do_real(fio, *fudgeQQ);
-    }
 
     gmx_fio_do_int(fio, ir->efep);
     do_fepvals(fio, ir->fepvals, bRead, file_version);
@@ -1455,10 +1327,8 @@ static void do_inputrec(t_fileio *fio, t_inputrec *ir, gmx_bool bRead,
     {
         do_expandedvals(fio, ir->expandedvals, ir->fepvals, bRead, file_version);
     }
-    if (file_version >= 57)
-    {
-        gmx_fio_do_int(fio, ir->eDisre);
-    }
+
+    gmx_fio_do_int(fio, ir->eDisre);
     gmx_fio_do_int(fio, ir->eDisreWeighting);
     gmx_fio_do_gmx_bool(fio, ir->bDisreMixed);
     gmx_fio_do_real(fio, ir->dr_fc);
@@ -1472,11 +1342,6 @@ static void do_inputrec(t_fileio *fio, t_inputrec *ir, gmx_bool bRead,
     if (file_version < 79)
     {
         gmx_fio_do_real(fio, rdum);
-        if (file_version < 56)
-        {
-            gmx_fio_do_real(fio, rdum);
-            gmx_fio_do_int(fio, idum);
-        }
     }
 
     gmx_fio_do_real(fio, ir->em_stepsize);
@@ -1488,10 +1353,6 @@ static void do_inputrec(t_fileio *fio, t_inputrec *ir, gmx_bool bRead,
     gmx_fio_do_int(fio, ir->nProjOrder);
     gmx_fio_do_real(fio, ir->LincsWarnAngle);
     gmx_fio_do_int(fio, ir->nLincsIter);
-    if (file_version < 33)
-    {
-        gmx_fio_do_real(fio, bd_temp);
-    }
     gmx_fio_do_real(fio, ir->bd_fric);
     if (file_version >= tpxv_Use64BitRandomSeed)
     {
@@ -1502,19 +1363,10 @@ static void do_inputrec(t_fileio *fio, t_inputrec *ir, gmx_bool bRead,
         gmx_fio_do_int(fio, idum);
         ir->ld_seed = idum;
     }
-    if (file_version >= 33)
-    {
-        for (i = 0; i < DIM; i++)
-        {
-            gmx_fio_do_rvec(fio, ir->deform[i]);
-        }
-    }
-    else
+
+    for (i = 0; i < DIM; i++)
     {
-        for (i = 0; i < DIM; i++)
-        {
-            clear_rvec(ir->deform[i]);
-        }
+        gmx_fio_do_rvec(fio, ir->deform[i]);
     }
     gmx_fio_do_real(fio, ir->cos_accel);
 
@@ -1567,7 +1419,6 @@ static void do_inputrec(t_fileio *fio, t_inputrec *ir, gmx_bool bRead,
     }
 
     /* pull stuff */
-    if (file_version >= 48)
     {
         int ePullOld = 0;
 
@@ -1591,10 +1442,6 @@ static void do_inputrec(t_fileio *fio, t_inputrec *ir, gmx_bool bRead,
             do_pull(fio, ir->pull, bRead, file_version, ePullOld);
         }
     }
-    else
-    {
-        ir->bPull = FALSE;
-    }
 
     if (file_version >= tpxv_AcceleratedWeightHistogram)
     {
@@ -1683,13 +1530,6 @@ static void do_inputrec(t_fileio *fio, t_inputrec *ir, gmx_bool bRead,
         gmx_fio_ndo_real(fio, ir->opts.nrdf, ir->opts.ngtc);
         gmx_fio_ndo_real(fio, ir->opts.ref_t, ir->opts.ngtc);
         gmx_fio_ndo_real(fio, ir->opts.tau_t, ir->opts.ngtc);
-        if (file_version < 33 && ir->eI == eiBD)
-        {
-            for (i = 0; i < ir->opts.ngtc; i++)
-            {
-                ir->opts.tau_t[i] = bd_temp;
-            }
-        }
     }
     if (ir->opts.ngfrz > 0)
     {
@@ -1717,34 +1557,17 @@ static void do_inputrec(t_fileio *fio, t_inputrec *ir, gmx_bool bRead,
         gmx_fio_ndo_real(fio, ir->opts.anneal_temp[j], k);
     }
     /* Walls */
-    if (file_version >= 45)
     {
         gmx_fio_do_int(fio, ir->nwall);
         gmx_fio_do_int(fio, ir->wall_type);
-        if (file_version >= 50)
-        {
-            gmx_fio_do_real(fio, ir->wall_r_linpot);
-        }
-        else
-        {
-            ir->wall_r_linpot = -1;
-        }
+        gmx_fio_do_real(fio, ir->wall_r_linpot);
         gmx_fio_do_int(fio, ir->wall_atomtype[0]);
         gmx_fio_do_int(fio, ir->wall_atomtype[1]);
         gmx_fio_do_real(fio, ir->wall_density[0]);
         gmx_fio_do_real(fio, ir->wall_density[1]);
         gmx_fio_do_real(fio, ir->wall_ewald_zfac);
     }
-    else
-    {
-        ir->nwall            = 0;
-        ir->wall_type        = 0;
-        ir->wall_atomtype[0] = -1;
-        ir->wall_atomtype[1] = -1;
-        ir->wall_density[0]  = 0;
-        ir->wall_density[1]  = 0;
-        ir->wall_ewald_zfac  = 3;
-    }
+
     /* Cosine stuff for electric fields */
     if (file_version < tpxv_GenericParamsForElectricField)
     {
@@ -1766,7 +1589,6 @@ static void do_inputrec(t_fileio *fio, t_inputrec *ir, gmx_bool bRead,
     }
 
     /* QMMM stuff */
-    if (file_version >= 39)
     {
         gmx_fio_do_gmx_bool(fio, ir->bQMMM);
         gmx_fio_do_int(fio, ir->QMMMscheme);
@@ -2007,20 +1829,9 @@ static void do_iparams(t_fileio *fio, t_functype ftype, t_iparams *iparams,
         case F_ANGRESZ:
             gmx_fio_do_real(fio, iparams->pdihs.phiA);
             gmx_fio_do_real(fio, iparams->pdihs.cpA);
-            if ((ftype == F_ANGRES || ftype == F_ANGRESZ) && file_version < 42)
-            {
-                /* Read the incorrectly stored multiplicity */
-                gmx_fio_do_real(fio, iparams->harmonic.rB);
-                gmx_fio_do_real(fio, iparams->harmonic.krB);
-                iparams->pdihs.phiB = iparams->pdihs.phiA;
-                iparams->pdihs.cpB  = iparams->pdihs.cpA;
-            }
-            else
-            {
-                gmx_fio_do_real(fio, iparams->pdihs.phiB);
-                gmx_fio_do_real(fio, iparams->pdihs.cpB);
-                gmx_fio_do_int(fio, iparams->pdihs.mult);
-            }
+            gmx_fio_do_real(fio, iparams->pdihs.phiB);
+            gmx_fio_do_real(fio, iparams->pdihs.cpB);
+            gmx_fio_do_int(fio, iparams->pdihs.mult);
             break;
         case F_RESTRDIHS:
             gmx_fio_do_real(fio, iparams->pdihs.phiA);
@@ -2119,22 +1930,28 @@ static void do_iparams(t_fileio *fio, t_functype ftype, t_iparams *iparams,
             gmx_fio_do_int(fio, iparams->vsiten.n);
             gmx_fio_do_real(fio, iparams->vsiten.a);
             break;
-        case F_GB12:
-        case F_GB13:
-        case F_GB14:
-            /* We got rid of some parameters in version 68 */
-            if (bRead && file_version < 68)
+        case F_GB12_NOLONGERUSED:
+        case F_GB13_NOLONGERUSED:
+        case F_GB14_NOLONGERUSED:
+            // Implicit solvent parameters can still be read, but never used
+            if (bRead)
             {
-                gmx_fio_do_real(fio, rdum);
-                gmx_fio_do_real(fio, rdum);
-                gmx_fio_do_real(fio, rdum);
-                gmx_fio_do_real(fio, rdum);
+                if (file_version < 68)
+                {
+                    gmx_fio_do_real(fio, rdum);
+                    gmx_fio_do_real(fio, rdum);
+                    gmx_fio_do_real(fio, rdum);
+                    gmx_fio_do_real(fio, rdum);
+                }
+                if (file_version < tpxv_RemoveImplicitSolvation)
+                {
+                    gmx_fio_do_real(fio, rdum);
+                    gmx_fio_do_real(fio, rdum);
+                    gmx_fio_do_real(fio, rdum);
+                    gmx_fio_do_real(fio, rdum);
+                    gmx_fio_do_real(fio, rdum);
+                }
             }
-            gmx_fio_do_real(fio, iparams->gb.sar);
-            gmx_fio_do_real(fio, iparams->gb.st);
-            gmx_fio_do_real(fio, iparams->gb.pi);
-            gmx_fio_do_real(fio, iparams->gb.gbr);
-            gmx_fio_do_real(fio, iparams->gb.bmlt);
             break;
         case F_CMAP:
             gmx_fio_do_int(fio, iparams->cmap.cmapA);
@@ -2146,17 +1963,8 @@ static void do_iparams(t_fileio *fio, t_functype ftype, t_iparams *iparams,
     }
 }
 
-static void do_ilist(t_fileio *fio, t_ilist *ilist, gmx_bool bRead, int file_version)
+static void do_ilist(t_fileio *fio, t_ilist *ilist, gmx_bool bRead)
 {
-    int      i, idum;
-
-    if (file_version < 44)
-    {
-        for (i = 0; i < MAXNODES; i++)
-        {
-            gmx_fio_do_int(fio, idum);
-        }
-    }
     gmx_fio_do_int(fio, ilist->nr);
     if (bRead)
     {
@@ -2168,14 +1976,7 @@ static void do_ilist(t_fileio *fio, t_ilist *ilist, gmx_bool bRead, int file_ver
 static void do_ffparams(t_fileio *fio, gmx_ffparams_t *ffparams,
                         gmx_bool bRead, int file_version)
 {
-    int          idum, i;
-    unsigned int k;
-
     gmx_fio_do_int(fio, ffparams->atnr);
-    if (file_version < 57)
-    {
-        gmx_fio_do_int(fio, idum);
-    }
     gmx_fio_do_int(fio, ffparams->ntypes);
     if (bRead)
     {
@@ -2194,21 +1995,18 @@ static void do_ffparams(t_fileio *fio, gmx_ffparams_t *ffparams,
         ffparams->reppow = 12.0;
     }
 
-    if (file_version >= 57)
-    {
-        gmx_fio_do_real(fio, ffparams->fudgeQQ);
-    }
+    gmx_fio_do_real(fio, ffparams->fudgeQQ);
 
     /* Check whether all these function types are supported by the code.
      * In practice the code is backwards compatible, which means that the
      * numbering may have to be altered from old numbering to new numbering
      */
-    for (i = 0; (i < ffparams->ntypes); i++)
+    for (int i = 0; i < ffparams->ntypes; i++)
     {
         if (bRead)
         {
             /* Loop over file versions */
-            for (k = 0; (k < NFTUPD); k++)
+            for (int k = 0; k < NFTUPD; k++)
             {
                 /* Compare the read file_version to the update table */
                 if ((file_version < ftupd[k].fvnr) &&
@@ -2267,7 +2065,7 @@ static void do_ilists(t_fileio *fio, t_ilist *ilist, gmx_bool bRead,
         }
         else
         {
-            do_ilist(fio, &ilist[j], bRead, file_version);
+            do_ilist(fio, &ilist[j], bRead);
             if (file_version < 78 && j == F_SETTLE && ilist[j].nr > 0)
             {
                 add_settle_atoms(&ilist[j]);
@@ -2276,35 +2074,9 @@ static void do_ilists(t_fileio *fio, t_ilist *ilist, gmx_bool bRead,
     }
 }
 
-static void do_idef(t_fileio *fio, gmx_ffparams_t *ffparams, gmx_moltype_t *molt,
-                    gmx_bool bRead, int file_version)
+static void do_block(t_fileio *fio, t_block *block, gmx_bool bRead)
 {
-    do_ffparams(fio, ffparams, bRead, file_version);
-
-    if (file_version >= 54)
-    {
-        gmx_fio_do_real(fio, ffparams->fudgeQQ);
-    }
-
-    do_ilists(fio, molt->ilist, bRead, file_version);
-}
-
-static void do_block(t_fileio *fio, t_block *block, gmx_bool bRead, int file_version)
-{
-    int      i, idum, dum_nra, *dum_a;
-
-    if (file_version < 44)
-    {
-        for (i = 0; i < MAXNODES; i++)
-        {
-            gmx_fio_do_int(fio, idum);
-        }
-    }
     gmx_fio_do_int(fio, block->nr);
-    if (file_version < 51)
-    {
-        gmx_fio_do_int(fio, dum_nra);
-    }
     if (bRead)
     {
         if ((block->nalloc_index > 0) && (nullptr != block->index))
@@ -2315,27 +2087,10 @@ static void do_block(t_fileio *fio, t_block *block, gmx_bool bRead, int file_ver
         snew(block->index, block->nalloc_index);
     }
     gmx_fio_ndo_int(fio, block->index, block->nr+1);
-
-    if (file_version < 51 && dum_nra > 0)
-    {
-        snew(dum_a, dum_nra);
-        gmx_fio_ndo_int(fio, dum_a, dum_nra);
-        sfree(dum_a);
-    }
 }
 
-static void do_blocka(t_fileio *fio, t_blocka *block, gmx_bool bRead,
-                      int file_version)
+static void do_blocka(t_fileio *fio, t_blocka *block, gmx_bool bRead)
 {
-    int      i, idum;
-
-    if (file_version < 44)
-    {
-        for (i = 0; i < MAXNODES; i++)
-        {
-            gmx_fio_do_int(fio, idum);
-        }
-    }
     gmx_fio_do_int(fio, block->nr);
     gmx_fio_do_int(fio, block->nra);
     if (bRead)
@@ -2390,11 +2145,8 @@ atomicnumber_to_element(int atomicnumber)
 }
 
 
-static void do_atom(t_fileio *fio, t_atom *atom, int ngrp, gmx_bool bRead,
-                    int file_version, gmx_groups_t *groups, int atnr)
+static void do_atom(t_fileio *fio, t_atom *atom, gmx_bool bRead)
 {
-    int    i, myngrp;
-
     gmx_fio_do_real(fio, atom->m);
     gmx_fio_do_real(fio, atom->q);
     gmx_fio_do_real(fio, atom->mB);
@@ -2403,78 +2155,28 @@ static void do_atom(t_fileio *fio, t_atom *atom, int ngrp, gmx_bool bRead,
     gmx_fio_do_ushort(fio, atom->typeB);
     gmx_fio_do_int(fio, atom->ptype);
     gmx_fio_do_int(fio, atom->resind);
-    if (file_version >= 52)
-    {
-        gmx_fio_do_int(fio, atom->atomnumber);
-        if (bRead)
-        {
-            /* Set element string from atomic number if present.
-             * This routine returns an empty string if the name is not found.
-             */
-            std::strncpy(atom->elem, atomicnumber_to_element(atom->atomnumber), 4);
-            /* avoid warnings about potentially unterminated string */
-            atom->elem[3] = '\0';
-        }
-    }
-    else if (bRead)
-    {
-        atom->atomnumber = 0;
-    }
-    if (file_version < 39)
-    {
-        myngrp = 9;
-    }
-    else
-    {
-        myngrp = ngrp;
-    }
-
-    if (file_version < 57)
+    gmx_fio_do_int(fio, atom->atomnumber);
+    if (bRead)
     {
-        unsigned char uchar[egcNR];
-        gmx_fio_ndo_uchar(fio, uchar, myngrp);
-        for (i = myngrp; (i < ngrp); i++)
-        {
-            uchar[i] = 0;
-        }
-        /* Copy the old data format to the groups struct */
-        for (i = 0; i < ngrp; i++)
-        {
-            groups->grpnr[i][atnr] = uchar[i];
-        }
+        /* Set element string from atomic number if present.
+         * This routine returns an empty string if the name is not found.
+         */
+        std::strncpy(atom->elem, atomicnumber_to_element(atom->atomnumber), 4);
+        /* avoid warnings about potentially unterminated string */
+        atom->elem[3] = '\0';
     }
 }
 
-static void do_grps(t_fileio *fio, int ngrp, t_grps grps[], gmx_bool bRead,
-                    int file_version)
+static void do_grps(t_fileio *fio, int ngrp, t_grps grps[], gmx_bool bRead)
 {
-    int      j, myngrp;
-
-    if (file_version < 39)
+    for (int j = 0; j < ngrp; j++)
     {
-        myngrp = 9;
-    }
-    else
-    {
-        myngrp = ngrp;
-    }
-
-    for (j = 0; (j < ngrp); j++)
-    {
-        if (j < myngrp)
-        {
-            gmx_fio_do_int(fio, grps[j].nr);
-            if (bRead)
-            {
-                snew(grps[j].nm_ind, grps[j].nr);
-            }
-            gmx_fio_ndo_int(fio, grps[j].nm_ind, grps[j].nr);
-        }
-        else
+        gmx_fio_do_int(fio, grps[j].nr);
+        if (bRead)
         {
-            grps[j].nr = 1;
             snew(grps[j].nm_ind, grps[j].nr);
         }
+        gmx_fio_ndo_int(fio, grps[j].nm_ind, grps[j].nr);
     }
 }
 
@@ -2527,22 +2229,12 @@ static void do_resinfo(t_fileio *fio, int n, t_resinfo *ri, gmx_bool bRead,
 }
 
 static void do_atoms(t_fileio *fio, t_atoms *atoms, gmx_bool bRead, t_symtab *symtab,
-                     int file_version,
-                     gmx_groups_t *groups)
+                     int file_version)
 {
     int i;
 
     gmx_fio_do_int(fio, atoms->nr);
     gmx_fio_do_int(fio, atoms->nres);
-    if (file_version < 57)
-    {
-        gmx_fio_do_int(fio, groups->ngrpname);
-        for (i = 0; i < egcNR; i++)
-        {
-            groups->ngrpnr[i] = atoms->nr;
-            snew(groups->grpnr[i], groups->ngrpnr[i]);
-        }
-    }
     if (bRead)
     {
         /* Since we have always written all t_atom properties in the tpr file
@@ -2560,10 +2252,6 @@ static void do_atoms(t_fileio *fio, t_atoms *atoms, gmx_bool bRead, t_symtab *sy
         snew(atoms->atomtype, atoms->nr);
         snew(atoms->atomtypeB, atoms->nr);
         snew(atoms->resinfo, atoms->nres);
-        if (file_version < 57)
-        {
-            snew(groups->grpname, groups->ngrpname);
-        }
         atoms->pdbinfo = nullptr;
     }
     else
@@ -2572,29 +2260,21 @@ static void do_atoms(t_fileio *fio, t_atoms *atoms, gmx_bool bRead, t_symtab *sy
     }
     for (i = 0; (i < atoms->nr); i++)
     {
-        do_atom(fio, &atoms->atom[i], egcNR, bRead, file_version, groups, i);
+        do_atom(fio, &atoms->atom[i], bRead);
     }
     do_strstr(fio, atoms->nr, atoms->atomname, bRead, symtab);
     do_strstr(fio, atoms->nr, atoms->atomtype, bRead, symtab);
     do_strstr(fio, atoms->nr, atoms->atomtypeB, bRead, symtab);
 
     do_resinfo(fio, atoms->nres, atoms->resinfo, bRead, symtab, file_version);
-
-    if (file_version < 57)
-    {
-        do_strstr(fio, groups->ngrpname, groups->grpname, bRead, symtab);
-
-        do_grps(fio, egcNR, groups->grps, bRead, file_version);
-    }
 }
 
 static void do_groups(t_fileio *fio, gmx_groups_t *groups,
-                      gmx_bool bRead, t_symtab *symtab,
-                      int file_version)
+                      gmx_bool bRead, t_symtab *symtab)
 {
     int      g;
 
-    do_grps(fio, egcNR, groups->grps, bRead, file_version);
+    do_grps(fio, egcNR, groups->grps, bRead);
     gmx_fio_do_int(fio, groups->ngrpname);
     if (bRead)
     {
@@ -2631,24 +2311,22 @@ static void do_atomtypes(t_fileio *fio, t_atomtypes *atomtypes, gmx_bool bRead,
     j = atomtypes->nr;
     if (bRead)
     {
-        snew(atomtypes->radius, j);
-        snew(atomtypes->vol, j);
-        snew(atomtypes->surftens, j);
         snew(atomtypes->atomnumber, j);
-        snew(atomtypes->gb_radius, j);
-        snew(atomtypes->S_hct, j);
     }
-    gmx_fio_ndo_real(fio, atomtypes->radius, j);
-    gmx_fio_ndo_real(fio, atomtypes->vol, j);
-    gmx_fio_ndo_real(fio, atomtypes->surftens, j);
-    if (file_version >= 40)
+    if (bRead && file_version < tpxv_RemoveImplicitSolvation)
     {
-        gmx_fio_ndo_int(fio, atomtypes->atomnumber, j);
+        std::vector<real> dummy(atomtypes->nr, 0);
+        gmx_fio_ndo_real(fio, dummy.data(), dummy.size());
+        gmx_fio_ndo_real(fio, dummy.data(), dummy.size());
+        gmx_fio_ndo_real(fio, dummy.data(), dummy.size());
     }
-    if (file_version >= 60)
+    gmx_fio_ndo_int(fio, atomtypes->atomnumber, j);
+
+    if (bRead && file_version >= 60 && file_version < tpxv_RemoveImplicitSolvation)
     {
-        gmx_fio_ndo_real(fio, atomtypes->gb_radius, j);
-        gmx_fio_ndo_real(fio, atomtypes->S_hct, j);
+        std::vector<real> dummy(atomtypes->nr, 0);
+        gmx_fio_ndo_real(fio, dummy.data(), dummy.size());
+        gmx_fio_ndo_real(fio, dummy.data(), dummy.size());
     }
 }
 
@@ -2726,25 +2404,18 @@ static void do_cmap(t_fileio *fio, gmx_cmap_t *cmap_grid, gmx_bool bRead)
 
 
 static void do_moltype(t_fileio *fio, gmx_moltype_t *molt, gmx_bool bRead,
-                       t_symtab *symtab, int file_version,
-                       gmx_groups_t *groups)
+                       t_symtab *symtab, int file_version)
 {
-    if (file_version >= 57)
-    {
-        do_symstr(fio, &(molt->name), bRead, symtab);
-    }
+    do_symstr(fio, &(molt->name), bRead, symtab);
 
-    do_atoms(fio, &molt->atoms, bRead, symtab, file_version, groups);
+    do_atoms(fio, &molt->atoms, bRead, symtab, file_version);
 
-    if (file_version >= 57)
-    {
-        do_ilists(fio, molt->ilist, bRead, file_version);
+    do_ilists(fio, molt->ilist, bRead, file_version);
 
-        do_block(fio, &molt->cgs, bRead, file_version);
-    }
+    do_block(fio, &molt->cgs, bRead);
 
     /* This used to be in the atoms struct */
-    do_blocka(fio, &molt->excls, bRead, file_version);
+    do_blocka(fio, &molt->excls, bRead);
 }
 
 static void do_molblock(t_fileio *fio, gmx_molblock_t *molb, gmx_bool bRead)
@@ -2803,93 +2474,6 @@ static t_block mtop_mols(gmx_mtop_t *mtop)
     return mols;
 }
 
-static void add_posres_molblock(gmx_mtop_t *mtop)
-{
-    t_ilist        *il, *ilfb;
-    int             am, i, mol, a;
-    gmx_bool        bFE;
-    gmx_molblock_t *molb;
-    t_iparams      *ip;
-
-    /* posres reference positions are stored in ip->posres (if present) and
-       in ip->fbposres (if present). If normal and flat-bottomed posres are present,
-       posres.pos0A are identical to fbposres.pos0. */
-    il   = &mtop->moltype[0].ilist[F_POSRES];
-    ilfb = &mtop->moltype[0].ilist[F_FBPOSRES];
-    if (il->nr == 0 && ilfb->nr == 0)
-    {
-        return;
-    }
-    am  = 0;
-    bFE = FALSE;
-    for (i = 0; i < il->nr; i += 2)
-    {
-        ip = &mtop->ffparams.iparams[il->iatoms[i]];
-        am = std::max(am, il->iatoms[i+1]);
-        if (ip->posres.pos0B[XX] != ip->posres.pos0A[XX] ||
-            ip->posres.pos0B[YY] != ip->posres.pos0A[YY] ||
-            ip->posres.pos0B[ZZ] != ip->posres.pos0A[ZZ])
-        {
-            bFE = TRUE;
-        }
-    }
-    /* This loop is required if we have only flat-bottomed posres:
-       - set am
-       - bFE == FALSE (no B-state for flat-bottomed posres) */
-    if (il->nr == 0)
-    {
-        for (i = 0; i < ilfb->nr; i += 2)
-        {
-            am = std::max(am, ilfb->iatoms[i+1]);
-        }
-    }
-    /* Make the posres coordinate block end at a molecule end */
-    mol = 0;
-    while (am >= mtop->mols.index[mol+1])
-    {
-        mol++;
-    }
-    molb             = &mtop->molblock[0];
-    molb->nposres_xA = mtop->mols.index[mol+1];
-    snew(molb->posres_xA, molb->nposres_xA);
-    if (bFE)
-    {
-        molb->nposres_xB = molb->nposres_xA;
-        snew(molb->posres_xB, molb->nposres_xB);
-    }
-    else
-    {
-        molb->nposres_xB = 0;
-    }
-    for (i = 0; i < il->nr; i += 2)
-    {
-        ip                     = &mtop->ffparams.iparams[il->iatoms[i]];
-        a                      = il->iatoms[i+1];
-        molb->posres_xA[a][XX] = ip->posres.pos0A[XX];
-        molb->posres_xA[a][YY] = ip->posres.pos0A[YY];
-        molb->posres_xA[a][ZZ] = ip->posres.pos0A[ZZ];
-        if (bFE)
-        {
-            molb->posres_xB[a][XX] = ip->posres.pos0B[XX];
-            molb->posres_xB[a][YY] = ip->posres.pos0B[YY];
-            molb->posres_xB[a][ZZ] = ip->posres.pos0B[ZZ];
-        }
-    }
-    if (il->nr == 0)
-    {
-        /* If only flat-bottomed posres are present, take reference pos from them.
-           Here: bFE == FALSE      */
-        for (i = 0; i < ilfb->nr; i += 2)
-        {
-            ip                     = &mtop->ffparams.iparams[ilfb->iatoms[i]];
-            a                      = ilfb->iatoms[i+1];
-            molb->posres_xA[a][XX] = ip->fbposres.pos0[XX];
-            molb->posres_xA[a][YY] = ip->fbposres.pos0[YY];
-            molb->posres_xA[a][ZZ] = ip->fbposres.pos0[ZZ];
-        }
-    }
-}
-
 static void set_disres_npair(gmx_mtop_t *mtop)
 {
     t_iparams            *ip;
@@ -2926,7 +2510,6 @@ static void do_mtop(t_fileio *fio, gmx_mtop_t *mtop, gmx_bool bRead,
                     int file_version)
 {
     int            mt, mb;
-    t_blocka       dumb;
 
     if (bRead)
     {
@@ -2936,58 +2519,29 @@ static void do_mtop(t_fileio *fio, gmx_mtop_t *mtop, gmx_bool bRead,
 
     do_symstr(fio, &(mtop->name), bRead, &(mtop->symtab));
 
-    if (file_version >= 57)
-    {
-        do_ffparams(fio, &mtop->ffparams, bRead, file_version);
+    do_ffparams(fio, &mtop->ffparams, bRead, file_version);
+
+    gmx_fio_do_int(fio, mtop->nmoltype);
 
-        gmx_fio_do_int(fio, mtop->nmoltype);
-    }
-    else
-    {
-        mtop->nmoltype = 1;
-    }
     if (bRead)
     {
         snew(mtop->moltype, mtop->nmoltype);
-        if (file_version < 57)
-        {
-            mtop->moltype[0].name = mtop->name;
-        }
     }
     for (mt = 0; mt < mtop->nmoltype; mt++)
     {
-        do_moltype(fio, &mtop->moltype[mt], bRead, &mtop->symtab, file_version,
-                   &mtop->groups);
+        do_moltype(fio, &mtop->moltype[mt], bRead, &mtop->symtab, file_version);
     }
 
-    if (file_version >= 57)
-    {
-        gmx_fio_do_int(fio, mtop->nmolblock);
-    }
-    else
-    {
-        mtop->nmolblock = 1;
-    }
+    gmx_fio_do_int(fio, mtop->nmolblock);
     if (bRead)
     {
         snew(mtop->molblock, mtop->nmolblock);
     }
-    if (file_version >= 57)
-    {
-        for (mb = 0; mb < mtop->nmolblock; mb++)
-        {
-            do_molblock(fio, &mtop->molblock[mb], bRead);
-        }
-        gmx_fio_do_int(fio, mtop->natoms);
-    }
-    else
+    for (mb = 0; mb < mtop->nmolblock; mb++)
     {
-        mtop->molblock[0].type       = 0;
-        mtop->molblock[0].nmol       = 1;
-        mtop->molblock[0].natoms_mol = mtop->moltype[0].atoms.nr;
-        mtop->molblock[0].nposres_xA = 0;
-        mtop->molblock[0].nposres_xB = 0;
+        do_molblock(fio, &mtop->molblock[mb], bRead);
     }
+    gmx_fio_do_int(fio, mtop->natoms);
 
     if (file_version >= tpxv_IntermolecularBondeds)
     {
@@ -3008,12 +2562,6 @@ static void do_mtop(t_fileio *fio, gmx_mtop_t *mtop, gmx_bool bRead,
 
     do_atomtypes (fio, &(mtop->atomtypes), bRead, file_version);
 
-    if (file_version < 57)
-    {
-        do_idef (fio, &mtop->ffparams, &mtop->moltype[0], bRead, file_version);
-        mtop->natoms = mtop->moltype[0].atoms.nr;
-    }
-
     if (file_version >= 65)
     {
         do_cmap(fio, &mtop->ffparams.cmap_grid, bRead);
@@ -3025,39 +2573,12 @@ static void do_mtop(t_fileio *fio, gmx_mtop_t *mtop, gmx_bool bRead,
         mtop->ffparams.cmap_grid.cmapdata     = nullptr;
     }
 
-    if (file_version >= 57)
-    {
-        do_groups(fio, &mtop->groups, bRead, &(mtop->symtab), file_version);
-    }
+    do_groups(fio, &mtop->groups, bRead, &(mtop->symtab));
 
-    if (file_version < 57)
-    {
-        do_block(fio, &mtop->moltype[0].cgs, bRead, file_version);
-        do_block(fio, &mtop->mols, bRead, file_version);
-        /* Add the posres coordinates to the molblock */
-        add_posres_molblock(mtop);
-    }
     if (bRead)
     {
-        if (file_version >= 57)
-        {
-            done_block(&mtop->mols);
-            mtop->mols = mtop_mols(mtop);
-        }
-    }
-
-    if (file_version < 51)
-    {
-        /* Here used to be the shake blocks */
-        do_blocka(fio, &dumb, bRead, file_version);
-        if (dumb.nr > 0)
-        {
-            sfree(dumb.index);
-        }
-        if (dumb.nra > 0)
-        {
-            sfree(dumb.a);
-        }
+        done_block(&mtop->mols);
+        mtop->mols = mtop_mols(mtop);
     }
 
     if (bRead)
@@ -3381,7 +2902,7 @@ static int do_tpx(t_fileio *fio, gmx_bool bRead,
         }
         if (fileGeneration <= tpx_generation && ir)
         {
-            do_inputrec(fio, ir, bRead, fileVersion, mtop ? &mtop->ffparams.fudgeQQ : nullptr);
+            do_inputrec(fio, ir, bRead, fileVersion);
             if (fileVersion < 51)
             {
                 set_box_rel(ir, state);
index adf06ef22fb0ddeeb1e5093650898af1a18568fc..fa7804d961f93924e30c3a89b2815089a5954f86 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -177,44 +177,40 @@ class OutputFile
 };
 
 /*! \brief All meta-data that is shared for all output files for one bias */
-class BiasReader
+struct BiasOutputSetup
 {
-    public:
-        //! Constructor.
-        BiasReader(int                         subblockStart,
-                   int                         numSubBlocks,
-                   std::unique_ptr<OutputFile> awhOutputFile,
-                   std::unique_ptr<OutputFile> frictionOutputFile) :
-            subblockStart_(subblockStart),
-            numSubBlocks_(numSubBlocks),
-            awhOutputFile_(std::move(awhOutputFile)),
-            frictionOutputFile_(std::move(frictionOutputFile))
-        {
-        }
+    //! Constructor.
+    BiasOutputSetup(int                         subblockStart,
+                    std::unique_ptr<OutputFile> awhOutputFile,
+                    std::unique_ptr<OutputFile> frictionOutputFile) :
+        subblockStart_(subblockStart),
+        awhOutputFile_(std::move(awhOutputFile)),
+        frictionOutputFile_(std::move(frictionOutputFile))
+    {
+    }
 
-        //! Return the AWH output file data.
-        const OutputFile &awhOutputFile() const
-        {
-            GMX_RELEASE_ASSERT(awhOutputFile_ != nullptr, "awhOutputFile() called without initialized AWH output file");
+    //! Return the AWH output file data.
+    const OutputFile &awhOutputFile() const
+    {
+        GMX_RELEASE_ASSERT(awhOutputFile_ != nullptr, "awhOutputFile() called without initialized AWH output file");
 
-            return *awhOutputFile_.get();
-        }
+        return *awhOutputFile_.get();
+    }
 
-        //! Return the a pointer to the friction output file data, can return nullptr
-        const OutputFile *frictionOutputFile() const
-        {
-            return frictionOutputFile_.get();
-        }
+    //! Return the a pointer to the friction output file data, can return nullptr
+    const OutputFile *frictionOutputFile() const
+    {
+        return frictionOutputFile_.get();
+    }
 
-        //! Return the starting subblock.
-        int subblockStart() const
-        {
-            return subblockStart_;
-        }
+    //! Return the starting subblock.
+    int subblockStart() const
+    {
+        return subblockStart_;
+    }
 
     private:
         const int                   subblockStart_;      /**< The start index of the subblocks to read. */
-        const int                   numSubBlocks_;       /**< Number of subblocks to read. */
         std::unique_ptr<OutputFile> awhOutputFile_;      /**< The standard AWH output file data. */
         std::unique_ptr<OutputFile> frictionOutputFile_; /**< The friction/metric tensor output file data */
 };
@@ -238,9 +234,9 @@ class AwhReader
                              const gmx_output_env_t *oenv) const;
 
     private:
-        std::vector<BiasReader> biasReader_; /**< The readers, one for each AWH bias. */
+        std::vector<BiasOutputSetup> biasOutputSetups_; /**< The output setups, one for each AWH bias. */
     public:
-        const real              kT_;         /**< kB*T in kJ/mol. */
+        const real                   kT_;               /**< kB*T in kJ/mol. */
 };
 
 namespace
@@ -452,9 +448,9 @@ AwhReader::AwhReader(const AwhParams  *awhParams,
             frictionOutputFile->initializeFrictionOutputFile(subblockStart, numSubBlocks, awhBiasParams, energyUnit, kT);
         }
 
-        biasReader_.emplace_back(BiasReader(subblockStart, numSubBlocks,
-                                            std::move(awhOutputFile),
-                                            std::move(frictionOutputFile)));
+        biasOutputSetups_.emplace_back(BiasOutputSetup(subblockStart,
+                                                       std::move(awhOutputFile),
+                                                       std::move(frictionOutputFile)));
 
         subblockStart += numSubBlocks;
     }
@@ -501,13 +497,13 @@ void AwhReader::processAwhFrame(const t_enxblock       &block,
 {
     /* We look for AWH data every energy frame and count the no of AWH frames found. We only extract every 'skip' AWH frame. */
 
-    for (auto &biasReader : biasReader_)
+    for (const auto &setup : biasOutputSetups_)
     {
-        const int subStart = biasReader.subblockStart();
+        const int subStart = setup.subblockStart();
 
         /* Each frame and AWH instance extracted generates one xvg file. */
         {
-            const OutputFile &awhOutputFile = biasReader.awhOutputFile();
+            const OutputFile &awhOutputFile = setup.awhOutputFile();
 
             FILE             *fpAwh = awhOutputFile.openBiasOutputFile(time, oenv);
 
@@ -524,7 +520,7 @@ void AwhReader::processAwhFrame(const t_enxblock       &block,
             gmx_ffclose(fpAwh);
         }
 
-        const OutputFile *frictionOutputFile = biasReader.frictionOutputFile();
+        const OutputFile *frictionOutputFile = setup.frictionOutputFile();
         if (frictionOutputFile != nullptr)
         {
             FILE *fpFriction = frictionOutputFile->openBiasOutputFile(time, oenv);
index 9e4838c5bd848c7d595dcd3891f37f192e3b0701..238a5639f23d0a539d60facabe491c77042ff95f 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -68,7 +68,7 @@
 #include "gromacs/utility/stringutil.h"
 
 /* print to two file pointers at once (i.e. stderr and log) */
-static gmx_inline
+static inline
 void lo_ffprintf(FILE *fp1, FILE *fp2, const char *buf)
 {
     fprintf(fp1, "%s", buf);
@@ -76,14 +76,14 @@ void lo_ffprintf(FILE *fp1, FILE *fp2, const char *buf)
 }
 
 /* just print a prepared buffer to fp1 and fp2 */
-static gmx_inline
+static inline
 void ffprintf(FILE *fp1, FILE *fp2, const char *buf)
 {
     lo_ffprintf(fp1, fp2, buf);
 }
 
 /* prepare buffer with one argument, then print to fp1 and fp2 */
-static gmx_inline
+static inline
 void ffprintf_d(FILE *fp1, FILE *fp2, char *buf, const char *fmt, int arg)
 {
     sprintf(buf, fmt, arg);
@@ -91,7 +91,7 @@ void ffprintf_d(FILE *fp1, FILE *fp2, char *buf, const char *fmt, int arg)
 }
 
 /* prepare buffer with one argument, then print to fp1 and fp2 */
-static gmx_inline
+static inline
 void ffprintf_g(FILE *fp1, FILE *fp2, char *buf, const char *fmt, real arg)
 {
     sprintf(buf, fmt, arg);
@@ -99,7 +99,7 @@ void ffprintf_g(FILE *fp1, FILE *fp2, char *buf, const char *fmt, real arg)
 }
 
 /* prepare buffer with one argument, then print to fp1 and fp2 */
-static gmx_inline
+static inline
 void ffprintf_s(FILE *fp1, FILE *fp2, char *buf, const char *fmt, const char *arg)
 {
     sprintf(buf, fmt, arg);
@@ -107,7 +107,7 @@ void ffprintf_s(FILE *fp1, FILE *fp2, char *buf, const char *fmt, const char *ar
 }
 
 /* prepare buffer with two arguments, then print to fp1 and fp2 */
-static gmx_inline
+static inline
 void ffprintf_dd(FILE *fp1, FILE *fp2, char *buf, const char *fmt, int arg1, int arg2)
 {
     sprintf(buf, fmt, arg1, arg2);
@@ -115,7 +115,7 @@ void ffprintf_dd(FILE *fp1, FILE *fp2, char *buf, const char *fmt, int arg1, int
 }
 
 /* prepare buffer with two arguments, then print to fp1 and fp2 */
-static gmx_inline
+static inline
 void ffprintf_gg(FILE *fp1, FILE *fp2, char *buf, const char *fmt, real arg1, real arg2)
 {
     sprintf(buf, fmt, arg1, arg2);
@@ -123,7 +123,7 @@ void ffprintf_gg(FILE *fp1, FILE *fp2, char *buf, const char *fmt, real arg1, re
 }
 
 /* prepare buffer with two arguments, then print to fp1 and fp2 */
-static gmx_inline
+static inline
 void ffprintf_ss(FILE *fp1, FILE *fp2, char *buf, const char *fmt, const char *arg1, const char *arg2)
 {
     sprintf(buf, fmt, arg1, arg2);
index 4af2ee6974e89d9b208ecccc0d863821d9b3486f..9ba08eef54dd21278427aa10f3589bceb69121c5 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -204,7 +204,7 @@ static void check_viol(FILE *log,
         while (((i+n) < disres->nr) &&
                (forceparams[forceatoms[i+n]].disres.label == label));
 
-        calc_disres_R_6(nullptr, n, &forceatoms[i],
+        calc_disres_R_6(nullptr, nullptr, n, &forceatoms[i],
                         (const rvec*)x, pbc, fcd, nullptr);
 
         if (fcd->disres.Rt_6[label] <= 0)
@@ -813,7 +813,7 @@ int gmx_disre(int argc, char *argv[])
     }
 
     ir->dr_tau = 0.0;
-    init_disres(fplog, &mtop, ir, nullptr, &fcd, nullptr, FALSE);
+    init_disres(fplog, &mtop, ir, nullptr, nullptr, &fcd, nullptr, FALSE);
 
     natoms = read_first_x(oenv, &status, ftp2fn(efTRX, NFILE, fnm), &t, &x, box);
     snew(f, 5*natoms);
index 2a65deea16744c811b102a4aea2dacdc5f33cc16..c756e4e777b7ad14112f995c83bc86cf5d94214f 100644 (file)
@@ -1655,7 +1655,7 @@ int gmx_energy(int argc, char *argv[])
     };
     static gmx_bool    bSum    = FALSE, bFee = FALSE, bPrAll = FALSE, bFluct = FALSE, bDriftCorr = FALSE;
     static gmx_bool    bDp     = FALSE, bMutot = FALSE, bOrinst = FALSE, bOvec = FALSE, bFluctProps = FALSE;
-    static int         skip    = 0, nmol = 1, nbmin = 5, nbmax = 5;
+    static int         nmol    = 1, nbmin = 5, nbmax = 5;
     static real        reftemp = 300.0, ezero = 0;
     t_pargs            pa[]    = {
         { "-fee",   FALSE, etBOOL,  {&bFee},
@@ -1674,8 +1674,6 @@ int gmx_energy(int argc, char *argv[])
           "Maximum number of blocks for error estimate" },
         { "-mutot", FALSE, etBOOL, {&bMutot},
           "Compute the total dipole moment from the components" },
-        { "-skip", FALSE, etINT,  {&skip},
-          "Skip number of frames between data points" },
         { "-aver", FALSE, etBOOL, {&bPrAll},
           "Also print the exact average and rmsd stored in the energy frames (only when 1 term is requested)" },
         { "-nmol", FALSE, etINT,  {&nmol},
@@ -1706,7 +1704,7 @@ int gmx_energy(int argc, char *argv[])
     t_enxframe        *frame, *fr = nullptr;
     int                cur = 0;
 #define NEXT (1-cur)
-    int                nre, teller, nfr;
+    int                nre, nfr;
     gmx_int64_t        start_step;
     real               start_t;
     gmx_bool           bDHDL;
@@ -1872,7 +1870,6 @@ int gmx_energy(int argc, char *argv[])
     snew(edat.s, nset);
 
     /* Initiate counters */
-    teller       = 0;
     bFoundStart  = FALSE;
     start_step   = 0;
     start_t      = 0;
@@ -2000,69 +1997,62 @@ int gmx_energy(int argc, char *argv[])
                 time[edat.nframes] = fr->t;
                 edat.nframes++;
             }
-            /*
-             * Printing time, only when we do not want to skip frames
-             */
-            if (!skip || teller % skip == 0)
+            if (bDHDL)
             {
-                if (bDHDL)
-                {
-                    do_dhdl(fr, ir, &fp_dhdl, opt2fn("-odh", NFILE, fnm), bDp, &dh_blocks, &dh_hists, &dh_samples, &dh_lambdas, oenv);
-                }
+                do_dhdl(fr, ir, &fp_dhdl, opt2fn("-odh", NFILE, fnm), bDp, &dh_blocks, &dh_hists, &dh_samples, &dh_lambdas, oenv);
+            }
 
-                /*******************************************
-                 * E N E R G I E S
-                 *******************************************/
-                else
+            /*******************************************
+             * E N E R G I E S
+             *******************************************/
+            else
+            {
+                if (fr->nre > 0)
                 {
-                    if (fr->nre > 0)
+                    if (bPrAll)
+                    {
+                        /* We skip frames with single points (usually only the first frame),
+                         * since they would result in an average plot with outliers.
+                         */
+                        if (fr->nsum > 1)
+                        {
+                            print_time(out, fr->t);
+                            print1(out, bDp, fr->ener[set[0]].e);
+                            print1(out, bDp, fr->ener[set[0]].esum/fr->nsum);
+                            print1(out, bDp, std::sqrt(fr->ener[set[0]].eav/fr->nsum));
+                            fprintf(out, "\n");
+                        }
+                    }
+                    else
                     {
-                        if (bPrAll)
+                        print_time(out, fr->t);
+                        if (bSum)
                         {
-                            /* We skip frames with single points (usually only the first frame),
-                             * since they would result in an average plot with outliers.
-                             */
-                            if (fr->nsum > 1)
+                            sum = 0;
+                            for (i = 0; i < nset; i++)
                             {
-                                print_time(out, fr->t);
-                                print1(out, bDp, fr->ener[set[0]].e);
-                                print1(out, bDp, fr->ener[set[0]].esum/fr->nsum);
-                                print1(out, bDp, std::sqrt(fr->ener[set[0]].eav/fr->nsum));
-                                fprintf(out, "\n");
+                                sum += fr->ener[set[i]].e;
                             }
+                            print1(out, bDp, sum/nmol-ezero);
                         }
                         else
                         {
-                            print_time(out, fr->t);
-                            if (bSum)
+                            for (i = 0; (i < nset); i++)
                             {
-                                sum = 0;
-                                for (i = 0; i < nset; i++)
+                                if (bIsEner[i])
                                 {
-                                    sum += fr->ener[set[i]].e;
+                                    print1(out, bDp, (fr->ener[set[i]].e)/nmol-ezero);
                                 }
-                                print1(out, bDp, sum/nmol-ezero);
-                            }
-                            else
-                            {
-                                for (i = 0; (i < nset); i++)
+                                else
                                 {
-                                    if (bIsEner[i])
-                                    {
-                                        print1(out, bDp, (fr->ener[set[i]].e)/nmol-ezero);
-                                    }
-                                    else
-                                    {
-                                        print1(out, bDp, fr->ener[set[i]].e);
-                                    }
+                                    print1(out, bDp, fr->ener[set[i]].e);
                                 }
                             }
-                            fprintf(out, "\n");
                         }
+                        fprintf(out, "\n");
                     }
                 }
             }
-            teller++;
         }
     }
     while (bCont && (timecheck == 0));
index b04b78898e4e9806ac19cad67be21694575433bf..94e417b2b26f2d553f31e35e96f6f3226bade5cd 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2008, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -1108,15 +1108,15 @@ static void count_da_grid(ivec ngrid, t_gridcell ***grid, t_icell danr)
  * This could be implemented slightly more efficient, but the code
  * would get much more complicated.
  */
-static gmx_inline gmx_bool grid_loop_begin(int n, int x, gmx_bool bTric, gmx_bool bEdge)
+static inline gmx_bool grid_loop_begin(int n, int x, gmx_bool bTric, gmx_bool bEdge)
 {
     return ((n == 1) ? x : bTric && bEdge ? 0     : (x-1));
 }
-static gmx_inline gmx_bool grid_loop_end(int n, int x, gmx_bool bTric, gmx_bool bEdge)
+static inline gmx_bool grid_loop_end(int n, int x, gmx_bool bTric, gmx_bool bEdge)
 {
     return ((n == 1) ? x : bTric && bEdge ? (n-1) : (x+1));
 }
-static gmx_inline int grid_mod(int j, int n)
+static inline int grid_mod(int j, int n)
 {
     return (j+n) % (n);
 }
index 14f8d1fb6943e5e05ff82d794c38b4cdcc5347bd..6fce2045cd9321ac162a17725e200cbf52d33d36 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -227,7 +227,7 @@ static int comp_minima(const void *a, const void *b)
     }
 }
 
-static gmx_inline
+static inline
 void print_minimum(FILE *fp, int num, const t_minimum *min)
 {
     fprintf(fp,
@@ -235,7 +235,7 @@ void print_minimum(FILE *fp, int num, const t_minimum *min)
             num, min->index, min->ener);
 }
 
-static gmx_inline
+static inline
 void add_minimum(FILE *fp, int num, const t_minimum *min, t_minimum *mm)
 {
     print_minimum(fp, num, min);
@@ -243,7 +243,7 @@ void add_minimum(FILE *fp, int num, const t_minimum *min, t_minimum *mm)
     mm[num].ener  = min->ener;
 }
 
-static gmx_inline
+static inline
 gmx_bool is_local_minimum_from_below(const t_minimum *this_min,
                                      int              dimension_index,
                                      int              dimension_min,
@@ -256,7 +256,7 @@ gmx_bool is_local_minimum_from_below(const t_minimum *this_min,
     /* Note over/underflow within W cannot occur. */
 }
 
-static gmx_inline
+static inline
 gmx_bool is_local_minimum_from_above(const t_minimum *this_min,
                                      int              dimension_index,
                                      int              dimension_max,
index d35662d81e9b7d52d9a73fce8ac5a8bada007134..3a3257199750f9ee0bf8587e084f9445892be625 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 /* The source code in this file should be thread-safe.
       Please keep it that way. */
 
-void gmx_fill_commrec_from_mpi(t_commrec gmx_unused *cr)
+void gmx_fill_commrec_from_mpi(t_commrec            *cr,
+                               const gmx_multisim_t *ms)
 {
 #if !GMX_MPI
     gmx_call("gmx_fill_commrec_from_mpi");
+    GMX_UNUSED_VALUE(cr);
+    GMX_UNUSED_VALUE(ms);
 #else
     if (!gmx_mpi_initialized())
     {
@@ -76,7 +79,7 @@ void gmx_fill_commrec_from_mpi(t_commrec gmx_unused *cr)
     // all multi-node MPI cases with more than one PP rank per node,
     // with and without GPUs. By always having it available, we also
     // don't need to protect calls to mpi_comm_physicalnode, etc.
-    if (PAR(cr) || MULTISIM(cr))
+    if (PAR(cr) || isMultiSim(ms))
     {
         MPI_Comm_split(MPI_COMM_WORLD, gmx_physicalnode_id_hash(), cr->nodeid, &cr->mpi_comm_physicalnode);
     }
@@ -93,11 +96,12 @@ t_commrec *init_commrec()
 
     snew(cr, 1);
 
+    cr->mpi_comm_physicalnode = MPI_COMM_NULL;
 #if GMX_LIB_MPI
-    gmx_fill_commrec_from_mpi(cr);
+    gmx_fill_commrec_from_mpi(cr, nullptr);
 #else
-    cr->mpi_comm_mysim   = nullptr;
-    cr->mpi_comm_mygroup = nullptr;
+    cr->mpi_comm_mysim   = MPI_COMM_NULL;
+    cr->mpi_comm_mygroup = MPI_COMM_NULL;
     cr->nnodes           = 1;
     cr->sim_nodeid       = 0;
     cr->nodeid           = cr->sim_nodeid;
@@ -122,7 +126,7 @@ t_commrec *init_commrec()
     return cr;
 }
 
-static void done_mpi_in_place_buf(mpi_in_place_buf_t *buf)
+void done_mpi_in_place_buf(mpi_in_place_buf_t *buf)
 {
     if (nullptr != buf)
     {
@@ -137,7 +141,7 @@ static void done_mpi_in_place_buf(mpi_in_place_buf_t *buf)
 void done_commrec(t_commrec *cr)
 {
 #if GMX_MPI
-    if (PAR(cr) || MULTISIM(cr))
+    if (cr->mpi_comm_physicalnode != MPI_COMM_NULL)
     {
         MPI_Comm_free(&cr->mpi_comm_physicalnode);
     }
@@ -147,16 +151,12 @@ void done_commrec(t_commrec *cr)
         // TODO: implement
         // done_domdec(cr->dd);
     }
-    if (nullptr != cr->ms)
-    {
-        done_mpi_in_place_buf(cr->ms->mpb);
-        sfree(cr->ms);
-    }
     done_mpi_in_place_buf(cr->mpb);
     sfree(cr);
 }
 
-t_commrec *reinitialize_commrec_for_this_thread(const t_commrec gmx_unused *cro)
+t_commrec *reinitialize_commrec_for_this_thread(const t_commrec      *cro,
+                                                const gmx_multisim_t *ms)
 {
 #if GMX_THREAD_MPI
     t_commrec *cr;
@@ -168,13 +168,15 @@ t_commrec *reinitialize_commrec_for_this_thread(const t_commrec gmx_unused *cro)
     *cr = *cro;
 
     /* and we start setting our own thread-specific values for things */
-    gmx_fill_commrec_from_mpi(cr);
+    gmx_fill_commrec_from_mpi(cr, ms);
 
     // TODO cr->duty should not be initialized here
     cr->duty             = (DUTY_PP | DUTY_PME);
 
     return cr;
 #else
+    GMX_UNUSED_VALUE(cro);
+    GMX_UNUSED_VALUE(ms);
     return nullptr;
 #endif
 }
@@ -271,7 +273,6 @@ void gmx_init_intranode_counters(t_commrec *cr)
 {
     /* counters for PP+PME and PP-only processes on my physical node */
     int nrank_intranode, rank_intranode;
-    int nrank_pp_intranode, rank_pp_intranode;
     /* thread-MPI is not initialized when not running in parallel */
 #if GMX_MPI && !GMX_THREAD_MPI
     int nrank_world, rank_world;
@@ -297,8 +298,6 @@ void gmx_init_intranode_counters(t_commrec *cr)
 
     nrank_intranode    = 0;
     rank_intranode     = 0;
-    nrank_pp_intranode = 0;
-    rank_pp_intranode  = 0;
     for (i = 0; i < nrank_world; i++)
     {
         if (hash[i] == myhash)
@@ -309,14 +308,6 @@ void gmx_init_intranode_counters(t_commrec *cr)
                 rank_intranode++;
             }
         }
-        if (hash_pp[i] == myhash)
-        {
-            nrank_pp_intranode++;
-            if (thisRankHasDuty(cr, DUTY_PP) && i < rank_world)
-            {
-                rank_pp_intranode++;
-            }
-        }
     }
     sfree(hash);
     sfree(hash_s);
@@ -326,8 +317,6 @@ void gmx_init_intranode_counters(t_commrec *cr)
     /* Serial or thread-MPI code: we run within a single physical node */
     nrank_intranode    = cr->nnodes;
     rank_intranode     = cr->sim_nodeid;
-    nrank_pp_intranode = cr->nnodes - cr->npmenodes;
-    rank_pp_intranode  = cr->nodeid;
 #endif
 
     if (debug)
@@ -341,17 +330,13 @@ void gmx_init_intranode_counters(t_commrec *cr)
         {
             sprintf(sbuf, "%s", thisRankHasDuty(cr, DUTY_PP) ? "PP" : "PME");
         }
-        fprintf(debug, "On %3s rank %d: nrank_intranode=%d, rank_intranode=%d, "
-                "nrank_pp_intranode=%d, rank_pp_intranode=%d\n",
+        fprintf(debug, "On %3s rank %d: nrank_intranode=%d, rank_intranode=%d\n",
                 sbuf, cr->sim_nodeid,
-                nrank_intranode, rank_intranode,
-                nrank_pp_intranode, rank_pp_intranode);
+                nrank_intranode, rank_intranode);
     }
 
     cr->nrank_intranode    = nrank_intranode;
     cr->rank_intranode     = rank_intranode;
-    cr->nrank_pp_intranode = nrank_pp_intranode;
-    cr->rank_pp_intranode  = rank_pp_intranode;
 }
 
 
index 3297dc8d63eeef5d8b17a9c13b938a850edbe80e..95a163b2e894ed110f9fa88005c45533cd6eda47 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -53,17 +53,20 @@ struct t_filenm;
 struct t_commrec *init_commrec(void);
 /* Allocate, initialize and return the commrec. */
 
-void done_commrec(struct t_commrec *cr);
+void done_commrec(t_commrec *cr);
 /* Free memory associated with the commrec. */
 
-struct t_commrec *reinitialize_commrec_for_this_thread(const struct t_commrec *cro);
+struct t_commrec *reinitialize_commrec_for_this_thread(const t_commrec      *cro,
+                                                       const gmx_multisim_t *ms);
+
 /* Initialize communication records for thread-parallel simulations.
    Must be called on all threads before any communication takes place by
    the individual threads. Copies the original commrec to
    thread-local versions (a small memory leak results because we don't
    deallocate the old shared version).  */
 
-void gmx_fill_commrec_from_mpi(struct t_commrec *cr);
+void gmx_fill_commrec_from_mpi(t_commrec            *cr,
+                               const gmx_multisim_t *ms);
 /* Continues t_commrec construction */
 
 void gmx_setup_nodecomm(FILE *fplog, struct t_commrec *cr);
index ab4da5a0e61e5c21036b77e9a6b0d5d98ed2fc68..56d33bcee3788c9adadca0bd06928a4885cad902 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
+# Copyright (c) 2012,2013,2014,2015,2017,2018, by the GROMACS development team, led by
 # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
 # and including many others, as listed in the AUTHORS file in the
 # top-level source directory and at http://www.gromacs.org.
@@ -33,7 +33,7 @@
 # the research papers on the package. Check out http://www.gromacs.org.
 
 # Sources that should always be built
-file(GLOB NONBONDED_SOURCES *.cpp nb_kernel_c/*.c)
+file(GLOB NONBONDED_SOURCES *.cpp nb_kernel_c/*.c nb_kernel_c/*.cpp)
 
 if("${GMX_SIMD_ACTIVE}" STREQUAL "SSE2" AND NOT GMX_DOUBLE)
     file(GLOB NONBONDED_SSE2_SINGLE_SOURCES nb_kernel_sse2_single/*.c)
index 381e49c69f309eff1cf77cd2e53c4a6fda4df848..a3c495c885ce4d993188cc24f0f14e5704693840 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -568,10 +568,6 @@ gmx_nb_free_energy_kernel(const t_nblist * gmx_restrict    nlist,
                                     FscalC[i]  = -qq[i]*tabscale*FF*rC;
                                     break;
 
-                                case GMX_NBKERNEL_ELEC_GENERALIZEDBORN:
-                                    gmx_fatal(FARGS, "Free energy and GB not implemented.\n");
-                                    break;
-
                                 case GMX_NBKERNEL_ELEC_EWALD:
                                     if (bConvertEwaldToCoulomb)
                                     {
index 3dfc7bdf1ffe3b8ca972f0fb36747c3e0c765eda..d95223a1b37005b9f6e7fa7cd36282d2c485c90f 100644 (file)
@@ -301,11 +301,6 @@ gmx_nb_generic_kernel(t_nblist *                nlist,
                         felec            = -qq*FF*tabscale*rinv;
                         break;
 
-                    case GMX_NBKERNEL_ELEC_GENERALIZEDBORN:
-                        /* GB */
-                        gmx_fatal(FARGS, "Death & horror! GB generic interaction not implemented.\n");
-                        break;
-
                     case GMX_NBKERNEL_ELEC_EWALD:
                         ewrt             = rsq*rinv*ewtabscale;
                         ewitab           = ewrt;
index 11f0f01ace08c2ad4a4cc8c278f0419e41d08094..e85b6a251912c1db7a736d6e8eeba3a6e2fe99f4 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -52,6 +52,22 @@ extern "C" {
 } /* fixes auto-indentation problems */
 #endif
 
+/*! \def gmx_inline
+ * \brief
+ * Keyword to use in C code instead of C99 `inline`.
+ *
+ * Some of the C compilers we support do not recognize the C99 keyword
+ * `inline`.  This macro should be used in C code and in shared C/C++ headers
+ * to indicate a function is inlined.
+ * C++ code should use plain `inline`, as that is already in C++98.
+ */
+#if !defined __cplusplus && defined _MSC_VER
+#define gmx_inline __inline
+#else
+/* C++ or C99 */
+#define gmx_inline inline
+#endif
+
 /* Structure to collect kernel data not available in forcerec or mdatoms structures.
  * This is only used inside the nonbonded module.
  */
@@ -70,7 +86,6 @@ typedef struct
     /* potentials */
     real *             energygrp_elec;
     real *             energygrp_vdw;
-    real *             energygrp_polarization;
 }
 nb_kernel_data_t;
 
@@ -118,7 +133,7 @@ typedef struct nb_kernel_info
 {
     nb_kernel_t *   kernelptr;
     const char *    kernelname;
-    const char *    architecture;     /* e.g. "C", "SSE", "BlueGene", etc. */
+    const char *    architecture;     /* e.g. "C", "SSE", "AVX_256", etc. */
 
     const char *    electrostatics;
     const char *    electrostatics_modifier;
index 1de4fa15c186b51bbfa0e9914d066cca96c78e73..9c600f9b86952b1e844ae76420afc832e7e928da 100755 (executable)
@@ -105,7 +105,6 @@ ElectrostaticsList = {
     'None'                    : [],
     'Coulomb'                 : ['rinv','rinvsq'],
     'ReactionField'           : ['rinv','rinvsq'],
-    'GeneralizedBorn'         : ['rinv','r'],
     'CubicSplineTable'        : ['rinv','r','table'],
     'Ewald'                   : ['rinv','rinvsq','r'],
 }
@@ -190,7 +189,6 @@ Abbreviation = {
     'Coulomb'                 : 'Coul',
     'Ewald'                   : 'Ew',
     'ReactionField'           : 'RF',
-    'GeneralizedBorn'         : 'GB',
     'CubicSplineTable'        : 'CSTab',
     'LennardJones'            : 'LJ',
     'Buckingham'              : 'Bham',
@@ -269,7 +267,7 @@ def KeepKernel(KernelElec,KernelElecMod,KernelVdw,KernelVdwMod,KernelGeom,Kernel
         return 0
 
     # No need for LJ-only water optimization, or water optimization with implicit solvent.
-    if('Water' in KernelGeom[0] and (KernelElec=='None' or 'GeneralizedBorn' in KernelElec)):
+    if('Water' in KernelGeom[0] and KernelElec=='None'):
         return 0
 
     # Non-matching table settings are pointless
diff --git a/src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecGB_VdwCSTab_GeomP1P1_avx_128_fma_double.c b/src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecGB_VdwCSTab_GeomP1P1_avx_128_fma_double.c
deleted file mode 100644 (file)
index ac8fc85..0000000
+++ /dev/null
@@ -1,858 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
- * and including many others, as listed in the AUTHORS file in the
- * top-level source directory and at http://www.gromacs.org.
- *
- * GROMACS is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * GROMACS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GROMACS; if not, see
- * http://www.gnu.org/licenses, or write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
- *
- * If you want to redistribute modifications to GROMACS, please
- * consider that scientific software is very special. Version
- * control is crucial - bugs must be traceable. We will be happy to
- * consider code for inclusion in the official distribution, but
- * derived work must not be called official GROMACS. Details are found
- * in the README & COPYING files - if they are missing, get the
- * official version at http://www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the research papers on the package. Check out http://www.gromacs.org.
- */
-/*
- * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
- */
-#include "gmxpre.h"
-
-#include "config.h"
-
-#include <math.h>
-
-#include "../nb_kernel.h"
-#include "gromacs/gmxlib/nrnb.h"
-
-#include "kernelutil_x86_avx_128_fma_double.h"
-
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_avx_128_fma_double
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            CubicSplineTable
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        PotentialAndForce
- */
-void
-nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_avx_128_fma_double
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
-     * just 0 for non-waters.
-     * Suffixes A,B refer to j loop unrolling done with SSE double precision, e.g. for the two different
-     * jnr indices corresponding to data put in the four positions in the SIMD register.
-     */
-    int              i_shift_offset,i_coord_offset,outeriter,inneriter;
-    int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
-    int              jnrA,jnrB;
-    int              j_coord_offsetA,j_coord_offsetB;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             rcutoff_scalar;
-    real             *shiftvec,*fshift,*x,*f;
-    __m128d          tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
-    int              vdwioffset0;
-    __m128d          ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0A,vdwjidx0B;
-    __m128d          jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    __m128d          dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
-    __m128d          velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    __m128i          gbitab;
-    __m128d          vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,dvdaj,gbeps,twogbeps,dvdatmp;
-    __m128d          minushalf = _mm_set1_pd(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    int              nvdwtype;
-    __m128d          rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
-    int              *vdwtype;
-    real             *vdwparam;
-    __m128d          one_sixth   = _mm_set1_pd(1.0/6.0);
-    __m128d          one_twelfth = _mm_set1_pd(1.0/12.0);
-    __m128i          vfitab;
-    __m128i          ifour       = _mm_set1_epi32(4);
-    __m128d          rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF,twovfeps;
-    real             *vftab;
-    __m128d          dummy_mask,cutoff_mask;
-    __m128d          signbit   = gmx_mm_castsi128_pd( _mm_set_epi32(0x80000000,0x00000000,0x80000000,0x00000000) );
-    __m128d          one     = _mm_set1_pd(1.0);
-    __m128d          two     = _mm_set1_pd(2.0);
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = _mm_set1_pd(fr->ic->epsfac);
-    charge           = mdatoms->chargeA;
-    nvdwtype         = fr->ntype;
-    vdwparam         = fr->nbfp;
-    vdwtype          = mdatoms->typeA;
-
-    vftab            = kernel_data->table_vdw->data;
-    vftabscale       = _mm_set1_pd(kernel_data->table_vdw->scale);
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = _mm_set1_pd(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = _mm_set1_pd((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-
-    /* Avoid stupid compiler warnings */
-    jnrA = jnrB = 0;
-    j_coord_offsetA = 0;
-    j_coord_offsetB = 0;
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        gmx_mm_load_shift_and_1rvec_broadcast_pd(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
-
-        fix0             = _mm_setzero_pd();
-        fiy0             = _mm_setzero_pd();
-        fiz0             = _mm_setzero_pd();
-
-        /* Load parameters for i particles */
-        iq0              = _mm_mul_pd(facel,_mm_load1_pd(charge+inr+0));
-        isai0            = _mm_load1_pd(invsqrta+inr+0);
-        vdwioffset0      = 2*nvdwtype*vdwtype[inr+0];
-
-        /* Reset potential sums */
-        velecsum         = _mm_setzero_pd();
-        vgbsum           = _mm_setzero_pd();
-        vvdwsum          = _mm_setzero_pd();
-        dvdasum          = _mm_setzero_pd();
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrA             = jjnr[jidx];
-            jnrB             = jjnr[jidx+1];
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_2ptr_swizzle_pd(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_pd(ix0,jx0);
-            dy00             = _mm_sub_pd(iy0,jy0);
-            dz00             = _mm_sub_pd(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_pd(dx00,dy00,dz00);
-
-            rinv00           = avx128fma_invsqrt_d(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm_load_2real_swizzle_pd(charge+jnrA+0,charge+jnrB+0);
-            isaj0            = gmx_mm_load_2real_swizzle_pd(invsqrta+jnrA+0,invsqrta+jnrB+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-            vdwjidx0B        = 2*vdwtype[jnrB+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_pd(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_pd(iq0,jq0);
-            gmx_mm_load_2pair_swizzle_pd(vdwparam+vdwioffset0+vdwjidx0A,
-                                         vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
-
-            /* Calculate table index by multiplying r with table scale and truncate to integer */
-            rt               = _mm_mul_pd(r00,vftabscale);
-            vfitab           = _mm_cvttpd_epi32(rt);
-#ifdef __XOP__
-            vfeps            = _mm_frcz_pd(rt);
-#else
-            vfeps            = _mm_sub_pd(rt,_mm_round_pd(rt, _MM_FROUND_FLOOR));
-#endif
-            twovfeps         = _mm_add_pd(vfeps,vfeps);
-            vfitab           = _mm_slli_epi32(vfitab,3);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_pd(isai0,isaj0);
-            gbqqfactor       = _mm_xor_pd(signbit,_mm_mul_pd(qq00,_mm_mul_pd(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_pd(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_pd(r00,gbscale);
-            gbitab           = _mm_cvttpd_epi32(rt);
-#ifdef __XOP__
-            gbeps            = _mm_frcz_pd(rt);
-#else
-            gbeps            = _mm_sub_pd(rt,_mm_round_pd(rt, _MM_FROUND_FLOOR));
-#endif
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_pd( gbtab + _mm_extract_epi32(gbitab,0) );
-            F                = _mm_load_pd( gbtab + _mm_extract_epi32(gbitab,1) );
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( gbtab + _mm_extract_epi32(gbitab,0) +2);
-            H                = _mm_load_pd( gbtab + _mm_extract_epi32(gbitab,1) +2);
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Fp               = _mm_macc_pd(gbeps,_mm_macc_pd(gbeps,H,G),F);
-            VV               = _mm_macc_pd(gbeps,Fp,Y);
-            vgb              = _mm_mul_pd(gbqqfactor,VV);
-
-            twogbeps         = _mm_add_pd(gbeps,gbeps);
-            FF               = _mm_macc_pd(_mm_macc_pd(twogbeps,H,G),gbeps,Fp);
-            fgb              = _mm_mul_pd(gbqqfactor,_mm_mul_pd(FF,gbscale));
-            dvdatmp          = _mm_mul_pd(minushalf,_mm_macc_pd(fgb,r00,vgb));
-            dvdasum          = _mm_add_pd(dvdasum,dvdatmp);
-            gmx_mm_increment_2real_swizzle_pd(dvda+jnrA,dvda+jnrB,_mm_mul_pd(dvdatmp,_mm_mul_pd(isaj0,isaj0)));
-            velec            = _mm_mul_pd(qq00,rinv00);
-            felec            = _mm_mul_pd(_mm_msub_pd(velec,rinv00,fgb),rinv00);
-
-            /* CUBIC SPLINE TABLE DISPERSION */
-            Y                = _mm_load_pd( vftab + _mm_extract_epi32(vfitab,0) );
-            F                = _mm_load_pd( vftab + _mm_extract_epi32(vfitab,1) );
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( vftab + _mm_extract_epi32(vfitab,0) +2);
-            H                = _mm_load_pd( vftab + _mm_extract_epi32(vfitab,1) +2);
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Fp               = _mm_macc_pd(vfeps,_mm_macc_pd(H,vfeps,G),F);
-            VV               = _mm_macc_pd(vfeps,Fp,Y);
-            vvdw6            = _mm_mul_pd(c6_00,VV);
-            FF               = _mm_macc_pd(vfeps,_mm_macc_pd(twovfeps,H,G),Fp);
-            fvdw6            = _mm_mul_pd(c6_00,FF);
-
-            /* CUBIC SPLINE TABLE REPULSION */
-            vfitab           = _mm_add_epi32(vfitab,ifour);
-            Y                = _mm_load_pd( vftab + _mm_extract_epi32(vfitab,0) );
-            F                = _mm_load_pd( vftab + _mm_extract_epi32(vfitab,1) );
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( vftab + _mm_extract_epi32(vfitab,0) +2);
-            H                = _mm_load_pd( vftab + _mm_extract_epi32(vfitab,1) +2);
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Fp               = _mm_macc_pd(vfeps,_mm_macc_pd(H,vfeps,G),F);
-            VV               = _mm_macc_pd(vfeps,Fp,Y);
-            vvdw12           = _mm_mul_pd(c12_00,VV);
-            FF               = _mm_macc_pd(vfeps,_mm_macc_pd(twovfeps,H,G),Fp);
-            fvdw12           = _mm_mul_pd(c12_00,FF);
-            vvdw             = _mm_add_pd(vvdw12,vvdw6);
-            fvdw             = _mm_xor_pd(signbit,_mm_mul_pd(_mm_add_pd(fvdw6,fvdw12),_mm_mul_pd(vftabscale,rinv00)));
-
-            /* Update potential sum for this i atom from the interaction with this j atom. */
-            velecsum         = _mm_add_pd(velecsum,velec);
-            vgbsum           = _mm_add_pd(vgbsum,vgb);
-            vvdwsum          = _mm_add_pd(vvdwsum,vvdw);
-
-            fscal            = _mm_add_pd(felec,fvdw);
-
-            /* Update vectorial force */
-            fix0             = _mm_macc_pd(dx00,fscal,fix0);
-            fiy0             = _mm_macc_pd(dy00,fscal,fiy0);
-            fiz0             = _mm_macc_pd(dz00,fscal,fiz0);
-            
-            gmx_mm_decrement_1rvec_2ptr_swizzle_pd(f+j_coord_offsetA,f+j_coord_offsetB,
-                                                   _mm_mul_pd(dx00,fscal),
-                                                   _mm_mul_pd(dy00,fscal),
-                                                   _mm_mul_pd(dz00,fscal));
-
-            /* Inner loop uses 95 flops */
-        }
-
-        if(jidx<j_index_end)
-        {
-
-            jnrA             = jjnr[jidx];
-            j_coord_offsetA  = DIM*jnrA;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_1ptr_swizzle_pd(x+j_coord_offsetA,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_pd(ix0,jx0);
-            dy00             = _mm_sub_pd(iy0,jy0);
-            dz00             = _mm_sub_pd(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_pd(dx00,dy00,dz00);
-
-            rinv00           = avx128fma_invsqrt_d(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = _mm_load_sd(charge+jnrA+0);
-            isaj0            = _mm_load_sd(invsqrta+jnrA+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_pd(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_pd(iq0,jq0);
-            gmx_mm_load_1pair_swizzle_pd(vdwparam+vdwioffset0+vdwjidx0A,&c6_00,&c12_00);
-
-            /* Calculate table index by multiplying r with table scale and truncate to integer */
-            rt               = _mm_mul_pd(r00,vftabscale);
-            vfitab           = _mm_cvttpd_epi32(rt);
-#ifdef __XOP__
-            vfeps            = _mm_frcz_pd(rt);
-#else
-            vfeps            = _mm_sub_pd(rt,_mm_round_pd(rt, _MM_FROUND_FLOOR));
-#endif
-            twovfeps         = _mm_add_pd(vfeps,vfeps);
-            vfitab           = _mm_slli_epi32(vfitab,3);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_pd(isai0,isaj0);
-            gbqqfactor       = _mm_xor_pd(signbit,_mm_mul_pd(qq00,_mm_mul_pd(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_pd(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_pd(r00,gbscale);
-            gbitab           = _mm_cvttpd_epi32(rt);
-#ifdef __XOP__
-            gbeps            = _mm_frcz_pd(rt);
-#else
-            gbeps            = _mm_sub_pd(rt,_mm_round_pd(rt, _MM_FROUND_FLOOR));
-#endif
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_pd( gbtab + _mm_extract_epi32(gbitab,0) );
-            F                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( gbtab + _mm_extract_epi32(gbitab,0) +2);
-            H                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Fp               = _mm_macc_pd(gbeps,_mm_macc_pd(gbeps,H,G),F);
-            VV               = _mm_macc_pd(gbeps,Fp,Y);
-            vgb              = _mm_mul_pd(gbqqfactor,VV);
-
-            twogbeps         = _mm_add_pd(gbeps,gbeps);
-            FF               = _mm_macc_pd(_mm_macc_pd(twogbeps,H,G),gbeps,Fp);
-            fgb              = _mm_mul_pd(gbqqfactor,_mm_mul_pd(FF,gbscale));
-            dvdatmp          = _mm_mul_pd(minushalf,_mm_macc_pd(fgb,r00,vgb));
-            dvdatmp          = _mm_unpacklo_pd(dvdatmp,_mm_setzero_pd());
-            dvdasum          = _mm_add_pd(dvdasum,dvdatmp);
-            gmx_mm_increment_1real_pd(dvda+jnrA,_mm_mul_pd(dvdatmp,_mm_mul_pd(isaj0,isaj0)));
-            velec            = _mm_mul_pd(qq00,rinv00);
-            felec            = _mm_mul_pd(_mm_msub_pd(velec,rinv00,fgb),rinv00);
-
-            /* CUBIC SPLINE TABLE DISPERSION */
-            Y                = _mm_load_pd( vftab + _mm_extract_epi32(vfitab,0) );
-            F                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( vftab + _mm_extract_epi32(vfitab,0) +2);
-            H                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Fp               = _mm_macc_pd(vfeps,_mm_macc_pd(H,vfeps,G),F);
-            VV               = _mm_macc_pd(vfeps,Fp,Y);
-            vvdw6            = _mm_mul_pd(c6_00,VV);
-            FF               = _mm_macc_pd(vfeps,_mm_macc_pd(twovfeps,H,G),Fp);
-            fvdw6            = _mm_mul_pd(c6_00,FF);
-
-            /* CUBIC SPLINE TABLE REPULSION */
-            vfitab           = _mm_add_epi32(vfitab,ifour);
-            Y                = _mm_load_pd( vftab + _mm_extract_epi32(vfitab,0) );
-            F                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( vftab + _mm_extract_epi32(vfitab,0) +2);
-            H                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Fp               = _mm_macc_pd(vfeps,_mm_macc_pd(H,vfeps,G),F);
-            VV               = _mm_macc_pd(vfeps,Fp,Y);
-            vvdw12           = _mm_mul_pd(c12_00,VV);
-            FF               = _mm_macc_pd(vfeps,_mm_macc_pd(twovfeps,H,G),Fp);
-            fvdw12           = _mm_mul_pd(c12_00,FF);
-            vvdw             = _mm_add_pd(vvdw12,vvdw6);
-            fvdw             = _mm_xor_pd(signbit,_mm_mul_pd(_mm_add_pd(fvdw6,fvdw12),_mm_mul_pd(vftabscale,rinv00)));
-
-            /* Update potential sum for this i atom from the interaction with this j atom. */
-            velec            = _mm_unpacklo_pd(velec,_mm_setzero_pd());
-            velecsum         = _mm_add_pd(velecsum,velec);
-            vgb              = _mm_unpacklo_pd(vgb,_mm_setzero_pd());
-            vgbsum           = _mm_add_pd(vgbsum,vgb);
-            vvdw             = _mm_unpacklo_pd(vvdw,_mm_setzero_pd());
-            vvdwsum          = _mm_add_pd(vvdwsum,vvdw);
-
-            fscal            = _mm_add_pd(felec,fvdw);
-
-            fscal            = _mm_unpacklo_pd(fscal,_mm_setzero_pd());
-
-            /* Update vectorial force */
-            fix0             = _mm_macc_pd(dx00,fscal,fix0);
-            fiy0             = _mm_macc_pd(dy00,fscal,fiy0);
-            fiz0             = _mm_macc_pd(dz00,fscal,fiz0);
-            
-            gmx_mm_decrement_1rvec_1ptr_swizzle_pd(f+j_coord_offsetA,
-                                                   _mm_mul_pd(dx00,fscal),
-                                                   _mm_mul_pd(dy00,fscal),
-                                                   _mm_mul_pd(dz00,fscal));
-
-            /* Inner loop uses 95 flops */
-        }
-
-        /* End of innermost loop */
-
-        gmx_mm_update_iforce_1atom_swizzle_pd(fix0,fiy0,fiz0,
-                                              f+i_coord_offset,fshift+i_shift_offset);
-
-        ggid                        = gid[iidx];
-        /* Update potential energies */
-        gmx_mm_update_1pot_pd(velecsum,kernel_data->energygrp_elec+ggid);
-        gmx_mm_update_1pot_pd(vgbsum,kernel_data->energygrp_polarization+ggid);
-        gmx_mm_update_1pot_pd(vvdwsum,kernel_data->energygrp_vdw+ggid);
-        dvdasum = _mm_mul_pd(dvdasum, _mm_mul_pd(isai0,isai0));
-        gmx_mm_update_1pot_pd(dvdasum,dvda+inr);
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 10 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_VF,outeriter*10 + inneriter*95);
-}
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_avx_128_fma_double
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            CubicSplineTable
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        Force
- */
-void
-nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_avx_128_fma_double
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
-     * just 0 for non-waters.
-     * Suffixes A,B refer to j loop unrolling done with SSE double precision, e.g. for the two different
-     * jnr indices corresponding to data put in the four positions in the SIMD register.
-     */
-    int              i_shift_offset,i_coord_offset,outeriter,inneriter;
-    int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
-    int              jnrA,jnrB;
-    int              j_coord_offsetA,j_coord_offsetB;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             rcutoff_scalar;
-    real             *shiftvec,*fshift,*x,*f;
-    __m128d          tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
-    int              vdwioffset0;
-    __m128d          ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0A,vdwjidx0B;
-    __m128d          jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    __m128d          dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
-    __m128d          velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    __m128i          gbitab;
-    __m128d          vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,dvdaj,gbeps,twogbeps,dvdatmp;
-    __m128d          minushalf = _mm_set1_pd(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    int              nvdwtype;
-    __m128d          rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
-    int              *vdwtype;
-    real             *vdwparam;
-    __m128d          one_sixth   = _mm_set1_pd(1.0/6.0);
-    __m128d          one_twelfth = _mm_set1_pd(1.0/12.0);
-    __m128i          vfitab;
-    __m128i          ifour       = _mm_set1_epi32(4);
-    __m128d          rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF,twovfeps;
-    real             *vftab;
-    __m128d          dummy_mask,cutoff_mask;
-    __m128d          signbit   = gmx_mm_castsi128_pd( _mm_set_epi32(0x80000000,0x00000000,0x80000000,0x00000000) );
-    __m128d          one     = _mm_set1_pd(1.0);
-    __m128d          two     = _mm_set1_pd(2.0);
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = _mm_set1_pd(fr->ic->epsfac);
-    charge           = mdatoms->chargeA;
-    nvdwtype         = fr->ntype;
-    vdwparam         = fr->nbfp;
-    vdwtype          = mdatoms->typeA;
-
-    vftab            = kernel_data->table_vdw->data;
-    vftabscale       = _mm_set1_pd(kernel_data->table_vdw->scale);
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = _mm_set1_pd(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = _mm_set1_pd((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-
-    /* Avoid stupid compiler warnings */
-    jnrA = jnrB = 0;
-    j_coord_offsetA = 0;
-    j_coord_offsetB = 0;
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        gmx_mm_load_shift_and_1rvec_broadcast_pd(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
-
-        fix0             = _mm_setzero_pd();
-        fiy0             = _mm_setzero_pd();
-        fiz0             = _mm_setzero_pd();
-
-        /* Load parameters for i particles */
-        iq0              = _mm_mul_pd(facel,_mm_load1_pd(charge+inr+0));
-        isai0            = _mm_load1_pd(invsqrta+inr+0);
-        vdwioffset0      = 2*nvdwtype*vdwtype[inr+0];
-
-        dvdasum          = _mm_setzero_pd();
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrA             = jjnr[jidx];
-            jnrB             = jjnr[jidx+1];
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_2ptr_swizzle_pd(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_pd(ix0,jx0);
-            dy00             = _mm_sub_pd(iy0,jy0);
-            dz00             = _mm_sub_pd(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_pd(dx00,dy00,dz00);
-
-            rinv00           = avx128fma_invsqrt_d(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm_load_2real_swizzle_pd(charge+jnrA+0,charge+jnrB+0);
-            isaj0            = gmx_mm_load_2real_swizzle_pd(invsqrta+jnrA+0,invsqrta+jnrB+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-            vdwjidx0B        = 2*vdwtype[jnrB+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_pd(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_pd(iq0,jq0);
-            gmx_mm_load_2pair_swizzle_pd(vdwparam+vdwioffset0+vdwjidx0A,
-                                         vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
-
-            /* Calculate table index by multiplying r with table scale and truncate to integer */
-            rt               = _mm_mul_pd(r00,vftabscale);
-            vfitab           = _mm_cvttpd_epi32(rt);
-#ifdef __XOP__
-            vfeps            = _mm_frcz_pd(rt);
-#else
-            vfeps            = _mm_sub_pd(rt,_mm_round_pd(rt, _MM_FROUND_FLOOR));
-#endif
-            twovfeps         = _mm_add_pd(vfeps,vfeps);
-            vfitab           = _mm_slli_epi32(vfitab,3);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_pd(isai0,isaj0);
-            gbqqfactor       = _mm_xor_pd(signbit,_mm_mul_pd(qq00,_mm_mul_pd(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_pd(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_pd(r00,gbscale);
-            gbitab           = _mm_cvttpd_epi32(rt);
-#ifdef __XOP__
-            gbeps            = _mm_frcz_pd(rt);
-#else
-            gbeps            = _mm_sub_pd(rt,_mm_round_pd(rt, _MM_FROUND_FLOOR));
-#endif
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_pd( gbtab + _mm_extract_epi32(gbitab,0) );
-            F                = _mm_load_pd( gbtab + _mm_extract_epi32(gbitab,1) );
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( gbtab + _mm_extract_epi32(gbitab,0) +2);
-            H                = _mm_load_pd( gbtab + _mm_extract_epi32(gbitab,1) +2);
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Fp               = _mm_macc_pd(gbeps,_mm_macc_pd(gbeps,H,G),F);
-            VV               = _mm_macc_pd(gbeps,Fp,Y);
-            vgb              = _mm_mul_pd(gbqqfactor,VV);
-
-            twogbeps         = _mm_add_pd(gbeps,gbeps);
-            FF               = _mm_macc_pd(_mm_macc_pd(twogbeps,H,G),gbeps,Fp);
-            fgb              = _mm_mul_pd(gbqqfactor,_mm_mul_pd(FF,gbscale));
-            dvdatmp          = _mm_mul_pd(minushalf,_mm_macc_pd(fgb,r00,vgb));
-            dvdasum          = _mm_add_pd(dvdasum,dvdatmp);
-            gmx_mm_increment_2real_swizzle_pd(dvda+jnrA,dvda+jnrB,_mm_mul_pd(dvdatmp,_mm_mul_pd(isaj0,isaj0)));
-            velec            = _mm_mul_pd(qq00,rinv00);
-            felec            = _mm_mul_pd(_mm_msub_pd(velec,rinv00,fgb),rinv00);
-
-            /* CUBIC SPLINE TABLE DISPERSION */
-            Y                = _mm_load_pd( vftab + _mm_extract_epi32(vfitab,0) );
-            F                = _mm_load_pd( vftab + _mm_extract_epi32(vfitab,1) );
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( vftab + _mm_extract_epi32(vfitab,0) +2);
-            H                = _mm_load_pd( vftab + _mm_extract_epi32(vfitab,1) +2);
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Fp               = _mm_macc_pd(vfeps,_mm_macc_pd(H,vfeps,G),F);
-            FF               = _mm_macc_pd(vfeps,_mm_macc_pd(twovfeps,H,G),Fp);
-            fvdw6            = _mm_mul_pd(c6_00,FF);
-
-            /* CUBIC SPLINE TABLE REPULSION */
-            vfitab           = _mm_add_epi32(vfitab,ifour);
-            Y                = _mm_load_pd( vftab + _mm_extract_epi32(vfitab,0) );
-            F                = _mm_load_pd( vftab + _mm_extract_epi32(vfitab,1) );
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( vftab + _mm_extract_epi32(vfitab,0) +2);
-            H                = _mm_load_pd( vftab + _mm_extract_epi32(vfitab,1) +2);
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Fp               = _mm_macc_pd(vfeps,_mm_macc_pd(H,vfeps,G),F);
-            FF               = _mm_macc_pd(vfeps,_mm_macc_pd(twovfeps,H,G),Fp);
-            fvdw12           = _mm_mul_pd(c12_00,FF);
-            fvdw             = _mm_xor_pd(signbit,_mm_mul_pd(_mm_add_pd(fvdw6,fvdw12),_mm_mul_pd(vftabscale,rinv00)));
-
-            fscal            = _mm_add_pd(felec,fvdw);
-
-            /* Update vectorial force */
-            fix0             = _mm_macc_pd(dx00,fscal,fix0);
-            fiy0             = _mm_macc_pd(dy00,fscal,fiy0);
-            fiz0             = _mm_macc_pd(dz00,fscal,fiz0);
-            
-            gmx_mm_decrement_1rvec_2ptr_swizzle_pd(f+j_coord_offsetA,f+j_coord_offsetB,
-                                                   _mm_mul_pd(dx00,fscal),
-                                                   _mm_mul_pd(dy00,fscal),
-                                                   _mm_mul_pd(dz00,fscal));
-
-            /* Inner loop uses 85 flops */
-        }
-
-        if(jidx<j_index_end)
-        {
-
-            jnrA             = jjnr[jidx];
-            j_coord_offsetA  = DIM*jnrA;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_1ptr_swizzle_pd(x+j_coord_offsetA,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_pd(ix0,jx0);
-            dy00             = _mm_sub_pd(iy0,jy0);
-            dz00             = _mm_sub_pd(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_pd(dx00,dy00,dz00);
-
-            rinv00           = avx128fma_invsqrt_d(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = _mm_load_sd(charge+jnrA+0);
-            isaj0            = _mm_load_sd(invsqrta+jnrA+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_pd(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_pd(iq0,jq0);
-            gmx_mm_load_1pair_swizzle_pd(vdwparam+vdwioffset0+vdwjidx0A,&c6_00,&c12_00);
-
-            /* Calculate table index by multiplying r with table scale and truncate to integer */
-            rt               = _mm_mul_pd(r00,vftabscale);
-            vfitab           = _mm_cvttpd_epi32(rt);
-#ifdef __XOP__
-            vfeps            = _mm_frcz_pd(rt);
-#else
-            vfeps            = _mm_sub_pd(rt,_mm_round_pd(rt, _MM_FROUND_FLOOR));
-#endif
-            twovfeps         = _mm_add_pd(vfeps,vfeps);
-            vfitab           = _mm_slli_epi32(vfitab,3);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_pd(isai0,isaj0);
-            gbqqfactor       = _mm_xor_pd(signbit,_mm_mul_pd(qq00,_mm_mul_pd(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_pd(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_pd(r00,gbscale);
-            gbitab           = _mm_cvttpd_epi32(rt);
-#ifdef __XOP__
-            gbeps            = _mm_frcz_pd(rt);
-#else
-            gbeps            = _mm_sub_pd(rt,_mm_round_pd(rt, _MM_FROUND_FLOOR));
-#endif
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_pd( gbtab + _mm_extract_epi32(gbitab,0) );
-            F                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( gbtab + _mm_extract_epi32(gbitab,0) +2);
-            H                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Fp               = _mm_macc_pd(gbeps,_mm_macc_pd(gbeps,H,G),F);
-            VV               = _mm_macc_pd(gbeps,Fp,Y);
-            vgb              = _mm_mul_pd(gbqqfactor,VV);
-
-            twogbeps         = _mm_add_pd(gbeps,gbeps);
-            FF               = _mm_macc_pd(_mm_macc_pd(twogbeps,H,G),gbeps,Fp);
-            fgb              = _mm_mul_pd(gbqqfactor,_mm_mul_pd(FF,gbscale));
-            dvdatmp          = _mm_mul_pd(minushalf,_mm_macc_pd(fgb,r00,vgb));
-            dvdatmp          = _mm_unpacklo_pd(dvdatmp,_mm_setzero_pd());
-            dvdasum          = _mm_add_pd(dvdasum,dvdatmp);
-            gmx_mm_increment_1real_pd(dvda+jnrA,_mm_mul_pd(dvdatmp,_mm_mul_pd(isaj0,isaj0)));
-            velec            = _mm_mul_pd(qq00,rinv00);
-            felec            = _mm_mul_pd(_mm_msub_pd(velec,rinv00,fgb),rinv00);
-
-            /* CUBIC SPLINE TABLE DISPERSION */
-            Y                = _mm_load_pd( vftab + _mm_extract_epi32(vfitab,0) );
-            F                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( vftab + _mm_extract_epi32(vfitab,0) +2);
-            H                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Fp               = _mm_macc_pd(vfeps,_mm_macc_pd(H,vfeps,G),F);
-            FF               = _mm_macc_pd(vfeps,_mm_macc_pd(twovfeps,H,G),Fp);
-            fvdw6            = _mm_mul_pd(c6_00,FF);
-
-            /* CUBIC SPLINE TABLE REPULSION */
-            vfitab           = _mm_add_epi32(vfitab,ifour);
-            Y                = _mm_load_pd( vftab + _mm_extract_epi32(vfitab,0) );
-            F                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( vftab + _mm_extract_epi32(vfitab,0) +2);
-            H                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Fp               = _mm_macc_pd(vfeps,_mm_macc_pd(H,vfeps,G),F);
-            FF               = _mm_macc_pd(vfeps,_mm_macc_pd(twovfeps,H,G),Fp);
-            fvdw12           = _mm_mul_pd(c12_00,FF);
-            fvdw             = _mm_xor_pd(signbit,_mm_mul_pd(_mm_add_pd(fvdw6,fvdw12),_mm_mul_pd(vftabscale,rinv00)));
-
-            fscal            = _mm_add_pd(felec,fvdw);
-
-            fscal            = _mm_unpacklo_pd(fscal,_mm_setzero_pd());
-
-            /* Update vectorial force */
-            fix0             = _mm_macc_pd(dx00,fscal,fix0);
-            fiy0             = _mm_macc_pd(dy00,fscal,fiy0);
-            fiz0             = _mm_macc_pd(dz00,fscal,fiz0);
-            
-            gmx_mm_decrement_1rvec_1ptr_swizzle_pd(f+j_coord_offsetA,
-                                                   _mm_mul_pd(dx00,fscal),
-                                                   _mm_mul_pd(dy00,fscal),
-                                                   _mm_mul_pd(dz00,fscal));
-
-            /* Inner loop uses 85 flops */
-        }
-
-        /* End of innermost loop */
-
-        gmx_mm_update_iforce_1atom_swizzle_pd(fix0,fiy0,fiz0,
-                                              f+i_coord_offset,fshift+i_shift_offset);
-
-        dvdasum = _mm_mul_pd(dvdasum, _mm_mul_pd(isai0,isai0));
-        gmx_mm_update_1pot_pd(dvdasum,dvda+inr);
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 7 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_F,outeriter*7 + inneriter*85);
-}
diff --git a/src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecGB_VdwLJ_GeomP1P1_avx_128_fma_double.c b/src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecGB_VdwLJ_GeomP1P1_avx_128_fma_double.c
deleted file mode 100644 (file)
index 477ee06..0000000
+++ /dev/null
@@ -1,736 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
- * and including many others, as listed in the AUTHORS file in the
- * top-level source directory and at http://www.gromacs.org.
- *
- * GROMACS is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * GROMACS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GROMACS; if not, see
- * http://www.gnu.org/licenses, or write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
- *
- * If you want to redistribute modifications to GROMACS, please
- * consider that scientific software is very special. Version
- * control is crucial - bugs must be traceable. We will be happy to
- * consider code for inclusion in the official distribution, but
- * derived work must not be called official GROMACS. Details are found
- * in the README & COPYING files - if they are missing, get the
- * official version at http://www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the research papers on the package. Check out http://www.gromacs.org.
- */
-/*
- * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
- */
-#include "gmxpre.h"
-
-#include "config.h"
-
-#include <math.h>
-
-#include "../nb_kernel.h"
-#include "gromacs/gmxlib/nrnb.h"
-
-#include "kernelutil_x86_avx_128_fma_double.h"
-
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_avx_128_fma_double
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            LennardJones
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        PotentialAndForce
- */
-void
-nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_avx_128_fma_double
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
-     * just 0 for non-waters.
-     * Suffixes A,B refer to j loop unrolling done with SSE double precision, e.g. for the two different
-     * jnr indices corresponding to data put in the four positions in the SIMD register.
-     */
-    int              i_shift_offset,i_coord_offset,outeriter,inneriter;
-    int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
-    int              jnrA,jnrB;
-    int              j_coord_offsetA,j_coord_offsetB;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             rcutoff_scalar;
-    real             *shiftvec,*fshift,*x,*f;
-    __m128d          tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
-    int              vdwioffset0;
-    __m128d          ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0A,vdwjidx0B;
-    __m128d          jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    __m128d          dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
-    __m128d          velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    __m128i          gbitab;
-    __m128d          vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,dvdaj,gbeps,twogbeps,dvdatmp;
-    __m128d          minushalf = _mm_set1_pd(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    int              nvdwtype;
-    __m128d          rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
-    int              *vdwtype;
-    real             *vdwparam;
-    __m128d          one_sixth   = _mm_set1_pd(1.0/6.0);
-    __m128d          one_twelfth = _mm_set1_pd(1.0/12.0);
-    __m128i          vfitab;
-    __m128i          ifour       = _mm_set1_epi32(4);
-    __m128d          rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF,twovfeps;
-    real             *vftab;
-    __m128d          dummy_mask,cutoff_mask;
-    __m128d          signbit   = gmx_mm_castsi128_pd( _mm_set_epi32(0x80000000,0x00000000,0x80000000,0x00000000) );
-    __m128d          one     = _mm_set1_pd(1.0);
-    __m128d          two     = _mm_set1_pd(2.0);
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = _mm_set1_pd(fr->ic->epsfac);
-    charge           = mdatoms->chargeA;
-    nvdwtype         = fr->ntype;
-    vdwparam         = fr->nbfp;
-    vdwtype          = mdatoms->typeA;
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = _mm_set1_pd(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = _mm_set1_pd((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-
-    /* Avoid stupid compiler warnings */
-    jnrA = jnrB = 0;
-    j_coord_offsetA = 0;
-    j_coord_offsetB = 0;
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        gmx_mm_load_shift_and_1rvec_broadcast_pd(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
-
-        fix0             = _mm_setzero_pd();
-        fiy0             = _mm_setzero_pd();
-        fiz0             = _mm_setzero_pd();
-
-        /* Load parameters for i particles */
-        iq0              = _mm_mul_pd(facel,_mm_load1_pd(charge+inr+0));
-        isai0            = _mm_load1_pd(invsqrta+inr+0);
-        vdwioffset0      = 2*nvdwtype*vdwtype[inr+0];
-
-        /* Reset potential sums */
-        velecsum         = _mm_setzero_pd();
-        vgbsum           = _mm_setzero_pd();
-        vvdwsum          = _mm_setzero_pd();
-        dvdasum          = _mm_setzero_pd();
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrA             = jjnr[jidx];
-            jnrB             = jjnr[jidx+1];
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_2ptr_swizzle_pd(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_pd(ix0,jx0);
-            dy00             = _mm_sub_pd(iy0,jy0);
-            dz00             = _mm_sub_pd(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_pd(dx00,dy00,dz00);
-
-            rinv00           = avx128fma_invsqrt_d(rsq00);
-
-            rinvsq00         = _mm_mul_pd(rinv00,rinv00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm_load_2real_swizzle_pd(charge+jnrA+0,charge+jnrB+0);
-            isaj0            = gmx_mm_load_2real_swizzle_pd(invsqrta+jnrA+0,invsqrta+jnrB+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-            vdwjidx0B        = 2*vdwtype[jnrB+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_pd(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_pd(iq0,jq0);
-            gmx_mm_load_2pair_swizzle_pd(vdwparam+vdwioffset0+vdwjidx0A,
-                                         vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_pd(isai0,isaj0);
-            gbqqfactor       = _mm_xor_pd(signbit,_mm_mul_pd(qq00,_mm_mul_pd(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_pd(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_pd(r00,gbscale);
-            gbitab           = _mm_cvttpd_epi32(rt);
-#ifdef __XOP__
-            gbeps            = _mm_frcz_pd(rt);
-#else
-            gbeps            = _mm_sub_pd(rt,_mm_round_pd(rt, _MM_FROUND_FLOOR));
-#endif
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_pd( gbtab + _mm_extract_epi32(gbitab,0) );
-            F                = _mm_load_pd( gbtab + _mm_extract_epi32(gbitab,1) );
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( gbtab + _mm_extract_epi32(gbitab,0) +2);
-            H                = _mm_load_pd( gbtab + _mm_extract_epi32(gbitab,1) +2);
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Fp               = _mm_macc_pd(gbeps,_mm_macc_pd(gbeps,H,G),F);
-            VV               = _mm_macc_pd(gbeps,Fp,Y);
-            vgb              = _mm_mul_pd(gbqqfactor,VV);
-
-            twogbeps         = _mm_add_pd(gbeps,gbeps);
-            FF               = _mm_macc_pd(_mm_macc_pd(twogbeps,H,G),gbeps,Fp);
-            fgb              = _mm_mul_pd(gbqqfactor,_mm_mul_pd(FF,gbscale));
-            dvdatmp          = _mm_mul_pd(minushalf,_mm_macc_pd(fgb,r00,vgb));
-            dvdasum          = _mm_add_pd(dvdasum,dvdatmp);
-            gmx_mm_increment_2real_swizzle_pd(dvda+jnrA,dvda+jnrB,_mm_mul_pd(dvdatmp,_mm_mul_pd(isaj0,isaj0)));
-            velec            = _mm_mul_pd(qq00,rinv00);
-            felec            = _mm_mul_pd(_mm_msub_pd(velec,rinv00,fgb),rinv00);
-
-            /* LENNARD-JONES DISPERSION/REPULSION */
-
-            rinvsix          = _mm_mul_pd(_mm_mul_pd(rinvsq00,rinvsq00),rinvsq00);
-            vvdw6            = _mm_mul_pd(c6_00,rinvsix);
-            vvdw12           = _mm_mul_pd(c12_00,_mm_mul_pd(rinvsix,rinvsix));
-            vvdw             = _mm_msub_pd( vvdw12,one_twelfth, _mm_mul_pd(vvdw6,one_sixth) );
-            fvdw             = _mm_mul_pd(_mm_sub_pd(vvdw12,vvdw6),rinvsq00);
-
-            /* Update potential sum for this i atom from the interaction with this j atom. */
-            velecsum         = _mm_add_pd(velecsum,velec);
-            vgbsum           = _mm_add_pd(vgbsum,vgb);
-            vvdwsum          = _mm_add_pd(vvdwsum,vvdw);
-
-            fscal            = _mm_add_pd(felec,fvdw);
-
-            /* Update vectorial force */
-            fix0             = _mm_macc_pd(dx00,fscal,fix0);
-            fiy0             = _mm_macc_pd(dy00,fscal,fiy0);
-            fiz0             = _mm_macc_pd(dz00,fscal,fiz0);
-            
-            gmx_mm_decrement_1rvec_2ptr_swizzle_pd(f+j_coord_offsetA,f+j_coord_offsetB,
-                                                   _mm_mul_pd(dx00,fscal),
-                                                   _mm_mul_pd(dy00,fscal),
-                                                   _mm_mul_pd(dz00,fscal));
-
-            /* Inner loop uses 74 flops */
-        }
-
-        if(jidx<j_index_end)
-        {
-
-            jnrA             = jjnr[jidx];
-            j_coord_offsetA  = DIM*jnrA;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_1ptr_swizzle_pd(x+j_coord_offsetA,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_pd(ix0,jx0);
-            dy00             = _mm_sub_pd(iy0,jy0);
-            dz00             = _mm_sub_pd(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_pd(dx00,dy00,dz00);
-
-            rinv00           = avx128fma_invsqrt_d(rsq00);
-
-            rinvsq00         = _mm_mul_pd(rinv00,rinv00);
-
-            /* Load parameters for j particles */
-            jq0              = _mm_load_sd(charge+jnrA+0);
-            isaj0            = _mm_load_sd(invsqrta+jnrA+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_pd(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_pd(iq0,jq0);
-            gmx_mm_load_1pair_swizzle_pd(vdwparam+vdwioffset0+vdwjidx0A,&c6_00,&c12_00);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_pd(isai0,isaj0);
-            gbqqfactor       = _mm_xor_pd(signbit,_mm_mul_pd(qq00,_mm_mul_pd(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_pd(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_pd(r00,gbscale);
-            gbitab           = _mm_cvttpd_epi32(rt);
-#ifdef __XOP__
-            gbeps            = _mm_frcz_pd(rt);
-#else
-            gbeps            = _mm_sub_pd(rt,_mm_round_pd(rt, _MM_FROUND_FLOOR));
-#endif
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_pd( gbtab + _mm_extract_epi32(gbitab,0) );
-            F                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( gbtab + _mm_extract_epi32(gbitab,0) +2);
-            H                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Fp               = _mm_macc_pd(gbeps,_mm_macc_pd(gbeps,H,G),F);
-            VV               = _mm_macc_pd(gbeps,Fp,Y);
-            vgb              = _mm_mul_pd(gbqqfactor,VV);
-
-            twogbeps         = _mm_add_pd(gbeps,gbeps);
-            FF               = _mm_macc_pd(_mm_macc_pd(twogbeps,H,G),gbeps,Fp);
-            fgb              = _mm_mul_pd(gbqqfactor,_mm_mul_pd(FF,gbscale));
-            dvdatmp          = _mm_mul_pd(minushalf,_mm_macc_pd(fgb,r00,vgb));
-            dvdatmp          = _mm_unpacklo_pd(dvdatmp,_mm_setzero_pd());
-            dvdasum          = _mm_add_pd(dvdasum,dvdatmp);
-            gmx_mm_increment_1real_pd(dvda+jnrA,_mm_mul_pd(dvdatmp,_mm_mul_pd(isaj0,isaj0)));
-            velec            = _mm_mul_pd(qq00,rinv00);
-            felec            = _mm_mul_pd(_mm_msub_pd(velec,rinv00,fgb),rinv00);
-
-            /* LENNARD-JONES DISPERSION/REPULSION */
-
-            rinvsix          = _mm_mul_pd(_mm_mul_pd(rinvsq00,rinvsq00),rinvsq00);
-            vvdw6            = _mm_mul_pd(c6_00,rinvsix);
-            vvdw12           = _mm_mul_pd(c12_00,_mm_mul_pd(rinvsix,rinvsix));
-            vvdw             = _mm_msub_pd( vvdw12,one_twelfth, _mm_mul_pd(vvdw6,one_sixth) );
-            fvdw             = _mm_mul_pd(_mm_sub_pd(vvdw12,vvdw6),rinvsq00);
-
-            /* Update potential sum for this i atom from the interaction with this j atom. */
-            velec            = _mm_unpacklo_pd(velec,_mm_setzero_pd());
-            velecsum         = _mm_add_pd(velecsum,velec);
-            vgb              = _mm_unpacklo_pd(vgb,_mm_setzero_pd());
-            vgbsum           = _mm_add_pd(vgbsum,vgb);
-            vvdw             = _mm_unpacklo_pd(vvdw,_mm_setzero_pd());
-            vvdwsum          = _mm_add_pd(vvdwsum,vvdw);
-
-            fscal            = _mm_add_pd(felec,fvdw);
-
-            fscal            = _mm_unpacklo_pd(fscal,_mm_setzero_pd());
-
-            /* Update vectorial force */
-            fix0             = _mm_macc_pd(dx00,fscal,fix0);
-            fiy0             = _mm_macc_pd(dy00,fscal,fiy0);
-            fiz0             = _mm_macc_pd(dz00,fscal,fiz0);
-            
-            gmx_mm_decrement_1rvec_1ptr_swizzle_pd(f+j_coord_offsetA,
-                                                   _mm_mul_pd(dx00,fscal),
-                                                   _mm_mul_pd(dy00,fscal),
-                                                   _mm_mul_pd(dz00,fscal));
-
-            /* Inner loop uses 74 flops */
-        }
-
-        /* End of innermost loop */
-
-        gmx_mm_update_iforce_1atom_swizzle_pd(fix0,fiy0,fiz0,
-                                              f+i_coord_offset,fshift+i_shift_offset);
-
-        ggid                        = gid[iidx];
-        /* Update potential energies */
-        gmx_mm_update_1pot_pd(velecsum,kernel_data->energygrp_elec+ggid);
-        gmx_mm_update_1pot_pd(vgbsum,kernel_data->energygrp_polarization+ggid);
-        gmx_mm_update_1pot_pd(vvdwsum,kernel_data->energygrp_vdw+ggid);
-        dvdasum = _mm_mul_pd(dvdasum, _mm_mul_pd(isai0,isai0));
-        gmx_mm_update_1pot_pd(dvdasum,dvda+inr);
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 10 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_VF,outeriter*10 + inneriter*74);
-}
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_avx_128_fma_double
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            LennardJones
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        Force
- */
-void
-nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_avx_128_fma_double
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
-     * just 0 for non-waters.
-     * Suffixes A,B refer to j loop unrolling done with SSE double precision, e.g. for the two different
-     * jnr indices corresponding to data put in the four positions in the SIMD register.
-     */
-    int              i_shift_offset,i_coord_offset,outeriter,inneriter;
-    int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
-    int              jnrA,jnrB;
-    int              j_coord_offsetA,j_coord_offsetB;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             rcutoff_scalar;
-    real             *shiftvec,*fshift,*x,*f;
-    __m128d          tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
-    int              vdwioffset0;
-    __m128d          ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0A,vdwjidx0B;
-    __m128d          jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    __m128d          dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
-    __m128d          velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    __m128i          gbitab;
-    __m128d          vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,dvdaj,gbeps,twogbeps,dvdatmp;
-    __m128d          minushalf = _mm_set1_pd(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    int              nvdwtype;
-    __m128d          rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
-    int              *vdwtype;
-    real             *vdwparam;
-    __m128d          one_sixth   = _mm_set1_pd(1.0/6.0);
-    __m128d          one_twelfth = _mm_set1_pd(1.0/12.0);
-    __m128i          vfitab;
-    __m128i          ifour       = _mm_set1_epi32(4);
-    __m128d          rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF,twovfeps;
-    real             *vftab;
-    __m128d          dummy_mask,cutoff_mask;
-    __m128d          signbit   = gmx_mm_castsi128_pd( _mm_set_epi32(0x80000000,0x00000000,0x80000000,0x00000000) );
-    __m128d          one     = _mm_set1_pd(1.0);
-    __m128d          two     = _mm_set1_pd(2.0);
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = _mm_set1_pd(fr->ic->epsfac);
-    charge           = mdatoms->chargeA;
-    nvdwtype         = fr->ntype;
-    vdwparam         = fr->nbfp;
-    vdwtype          = mdatoms->typeA;
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = _mm_set1_pd(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = _mm_set1_pd((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-
-    /* Avoid stupid compiler warnings */
-    jnrA = jnrB = 0;
-    j_coord_offsetA = 0;
-    j_coord_offsetB = 0;
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        gmx_mm_load_shift_and_1rvec_broadcast_pd(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
-
-        fix0             = _mm_setzero_pd();
-        fiy0             = _mm_setzero_pd();
-        fiz0             = _mm_setzero_pd();
-
-        /* Load parameters for i particles */
-        iq0              = _mm_mul_pd(facel,_mm_load1_pd(charge+inr+0));
-        isai0            = _mm_load1_pd(invsqrta+inr+0);
-        vdwioffset0      = 2*nvdwtype*vdwtype[inr+0];
-
-        dvdasum          = _mm_setzero_pd();
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrA             = jjnr[jidx];
-            jnrB             = jjnr[jidx+1];
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_2ptr_swizzle_pd(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_pd(ix0,jx0);
-            dy00             = _mm_sub_pd(iy0,jy0);
-            dz00             = _mm_sub_pd(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_pd(dx00,dy00,dz00);
-
-            rinv00           = avx128fma_invsqrt_d(rsq00);
-
-            rinvsq00         = _mm_mul_pd(rinv00,rinv00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm_load_2real_swizzle_pd(charge+jnrA+0,charge+jnrB+0);
-            isaj0            = gmx_mm_load_2real_swizzle_pd(invsqrta+jnrA+0,invsqrta+jnrB+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-            vdwjidx0B        = 2*vdwtype[jnrB+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_pd(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_pd(iq0,jq0);
-            gmx_mm_load_2pair_swizzle_pd(vdwparam+vdwioffset0+vdwjidx0A,
-                                         vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_pd(isai0,isaj0);
-            gbqqfactor       = _mm_xor_pd(signbit,_mm_mul_pd(qq00,_mm_mul_pd(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_pd(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_pd(r00,gbscale);
-            gbitab           = _mm_cvttpd_epi32(rt);
-#ifdef __XOP__
-            gbeps            = _mm_frcz_pd(rt);
-#else
-            gbeps            = _mm_sub_pd(rt,_mm_round_pd(rt, _MM_FROUND_FLOOR));
-#endif
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_pd( gbtab + _mm_extract_epi32(gbitab,0) );
-            F                = _mm_load_pd( gbtab + _mm_extract_epi32(gbitab,1) );
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( gbtab + _mm_extract_epi32(gbitab,0) +2);
-            H                = _mm_load_pd( gbtab + _mm_extract_epi32(gbitab,1) +2);
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Fp               = _mm_macc_pd(gbeps,_mm_macc_pd(gbeps,H,G),F);
-            VV               = _mm_macc_pd(gbeps,Fp,Y);
-            vgb              = _mm_mul_pd(gbqqfactor,VV);
-
-            twogbeps         = _mm_add_pd(gbeps,gbeps);
-            FF               = _mm_macc_pd(_mm_macc_pd(twogbeps,H,G),gbeps,Fp);
-            fgb              = _mm_mul_pd(gbqqfactor,_mm_mul_pd(FF,gbscale));
-            dvdatmp          = _mm_mul_pd(minushalf,_mm_macc_pd(fgb,r00,vgb));
-            dvdasum          = _mm_add_pd(dvdasum,dvdatmp);
-            gmx_mm_increment_2real_swizzle_pd(dvda+jnrA,dvda+jnrB,_mm_mul_pd(dvdatmp,_mm_mul_pd(isaj0,isaj0)));
-            velec            = _mm_mul_pd(qq00,rinv00);
-            felec            = _mm_mul_pd(_mm_msub_pd(velec,rinv00,fgb),rinv00);
-
-            /* LENNARD-JONES DISPERSION/REPULSION */
-
-            rinvsix          = _mm_mul_pd(_mm_mul_pd(rinvsq00,rinvsq00),rinvsq00);
-            fvdw             = _mm_mul_pd(_mm_msub_pd(c12_00,rinvsix,c6_00),_mm_mul_pd(rinvsix,rinvsq00));
-
-            fscal            = _mm_add_pd(felec,fvdw);
-
-            /* Update vectorial force */
-            fix0             = _mm_macc_pd(dx00,fscal,fix0);
-            fiy0             = _mm_macc_pd(dy00,fscal,fiy0);
-            fiz0             = _mm_macc_pd(dz00,fscal,fiz0);
-            
-            gmx_mm_decrement_1rvec_2ptr_swizzle_pd(f+j_coord_offsetA,f+j_coord_offsetB,
-                                                   _mm_mul_pd(dx00,fscal),
-                                                   _mm_mul_pd(dy00,fscal),
-                                                   _mm_mul_pd(dz00,fscal));
-
-            /* Inner loop uses 67 flops */
-        }
-
-        if(jidx<j_index_end)
-        {
-
-            jnrA             = jjnr[jidx];
-            j_coord_offsetA  = DIM*jnrA;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_1ptr_swizzle_pd(x+j_coord_offsetA,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_pd(ix0,jx0);
-            dy00             = _mm_sub_pd(iy0,jy0);
-            dz00             = _mm_sub_pd(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_pd(dx00,dy00,dz00);
-
-            rinv00           = avx128fma_invsqrt_d(rsq00);
-
-            rinvsq00         = _mm_mul_pd(rinv00,rinv00);
-
-            /* Load parameters for j particles */
-            jq0              = _mm_load_sd(charge+jnrA+0);
-            isaj0            = _mm_load_sd(invsqrta+jnrA+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_pd(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_pd(iq0,jq0);
-            gmx_mm_load_1pair_swizzle_pd(vdwparam+vdwioffset0+vdwjidx0A,&c6_00,&c12_00);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_pd(isai0,isaj0);
-            gbqqfactor       = _mm_xor_pd(signbit,_mm_mul_pd(qq00,_mm_mul_pd(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_pd(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_pd(r00,gbscale);
-            gbitab           = _mm_cvttpd_epi32(rt);
-#ifdef __XOP__
-            gbeps            = _mm_frcz_pd(rt);
-#else
-            gbeps            = _mm_sub_pd(rt,_mm_round_pd(rt, _MM_FROUND_FLOOR));
-#endif
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_pd( gbtab + _mm_extract_epi32(gbitab,0) );
-            F                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( gbtab + _mm_extract_epi32(gbitab,0) +2);
-            H                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Fp               = _mm_macc_pd(gbeps,_mm_macc_pd(gbeps,H,G),F);
-            VV               = _mm_macc_pd(gbeps,Fp,Y);
-            vgb              = _mm_mul_pd(gbqqfactor,VV);
-
-            twogbeps         = _mm_add_pd(gbeps,gbeps);
-            FF               = _mm_macc_pd(_mm_macc_pd(twogbeps,H,G),gbeps,Fp);
-            fgb              = _mm_mul_pd(gbqqfactor,_mm_mul_pd(FF,gbscale));
-            dvdatmp          = _mm_mul_pd(minushalf,_mm_macc_pd(fgb,r00,vgb));
-            dvdatmp          = _mm_unpacklo_pd(dvdatmp,_mm_setzero_pd());
-            dvdasum          = _mm_add_pd(dvdasum,dvdatmp);
-            gmx_mm_increment_1real_pd(dvda+jnrA,_mm_mul_pd(dvdatmp,_mm_mul_pd(isaj0,isaj0)));
-            velec            = _mm_mul_pd(qq00,rinv00);
-            felec            = _mm_mul_pd(_mm_msub_pd(velec,rinv00,fgb),rinv00);
-
-            /* LENNARD-JONES DISPERSION/REPULSION */
-
-            rinvsix          = _mm_mul_pd(_mm_mul_pd(rinvsq00,rinvsq00),rinvsq00);
-            fvdw             = _mm_mul_pd(_mm_msub_pd(c12_00,rinvsix,c6_00),_mm_mul_pd(rinvsix,rinvsq00));
-
-            fscal            = _mm_add_pd(felec,fvdw);
-
-            fscal            = _mm_unpacklo_pd(fscal,_mm_setzero_pd());
-
-            /* Update vectorial force */
-            fix0             = _mm_macc_pd(dx00,fscal,fix0);
-            fiy0             = _mm_macc_pd(dy00,fscal,fiy0);
-            fiz0             = _mm_macc_pd(dz00,fscal,fiz0);
-            
-            gmx_mm_decrement_1rvec_1ptr_swizzle_pd(f+j_coord_offsetA,
-                                                   _mm_mul_pd(dx00,fscal),
-                                                   _mm_mul_pd(dy00,fscal),
-                                                   _mm_mul_pd(dz00,fscal));
-
-            /* Inner loop uses 67 flops */
-        }
-
-        /* End of innermost loop */
-
-        gmx_mm_update_iforce_1atom_swizzle_pd(fix0,fiy0,fiz0,
-                                              f+i_coord_offset,fshift+i_shift_offset);
-
-        dvdasum = _mm_mul_pd(dvdasum, _mm_mul_pd(isai0,isai0));
-        gmx_mm_update_1pot_pd(dvdasum,dvda+inr);
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 7 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_F,outeriter*7 + inneriter*67);
-}
diff --git a/src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecGB_VdwNone_GeomP1P1_avx_128_fma_double.c b/src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_double/nb_kernel_ElecGB_VdwNone_GeomP1P1_avx_128_fma_double.c
deleted file mode 100644 (file)
index 7d3a9fd..0000000
+++ /dev/null
@@ -1,665 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
- * and including many others, as listed in the AUTHORS file in the
- * top-level source directory and at http://www.gromacs.org.
- *
- * GROMACS is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * GROMACS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GROMACS; if not, see
- * http://www.gnu.org/licenses, or write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
- *
- * If you want to redistribute modifications to GROMACS, please
- * consider that scientific software is very special. Version
- * control is crucial - bugs must be traceable. We will be happy to
- * consider code for inclusion in the official distribution, but
- * derived work must not be called official GROMACS. Details are found
- * in the README & COPYING files - if they are missing, get the
- * official version at http://www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the research papers on the package. Check out http://www.gromacs.org.
- */
-/*
- * Note: this file was generated by the GROMACS avx_128_fma_double kernel generator.
- */
-#include "gmxpre.h"
-
-#include "config.h"
-
-#include <math.h>
-
-#include "../nb_kernel.h"
-#include "gromacs/gmxlib/nrnb.h"
-
-#include "kernelutil_x86_avx_128_fma_double.h"
-
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_avx_128_fma_double
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            None
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        PotentialAndForce
- */
-void
-nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_avx_128_fma_double
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
-     * just 0 for non-waters.
-     * Suffixes A,B refer to j loop unrolling done with SSE double precision, e.g. for the two different
-     * jnr indices corresponding to data put in the four positions in the SIMD register.
-     */
-    int              i_shift_offset,i_coord_offset,outeriter,inneriter;
-    int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
-    int              jnrA,jnrB;
-    int              j_coord_offsetA,j_coord_offsetB;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             rcutoff_scalar;
-    real             *shiftvec,*fshift,*x,*f;
-    __m128d          tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
-    int              vdwioffset0;
-    __m128d          ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0A,vdwjidx0B;
-    __m128d          jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    __m128d          dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
-    __m128d          velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    __m128i          gbitab;
-    __m128d          vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,dvdaj,gbeps,twogbeps,dvdatmp;
-    __m128d          minushalf = _mm_set1_pd(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    __m128i          vfitab;
-    __m128i          ifour       = _mm_set1_epi32(4);
-    __m128d          rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF,twovfeps;
-    real             *vftab;
-    __m128d          dummy_mask,cutoff_mask;
-    __m128d          signbit   = gmx_mm_castsi128_pd( _mm_set_epi32(0x80000000,0x00000000,0x80000000,0x00000000) );
-    __m128d          one     = _mm_set1_pd(1.0);
-    __m128d          two     = _mm_set1_pd(2.0);
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = _mm_set1_pd(fr->ic->epsfac);
-    charge           = mdatoms->chargeA;
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = _mm_set1_pd(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = _mm_set1_pd((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-
-    /* Avoid stupid compiler warnings */
-    jnrA = jnrB = 0;
-    j_coord_offsetA = 0;
-    j_coord_offsetB = 0;
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        gmx_mm_load_shift_and_1rvec_broadcast_pd(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
-
-        fix0             = _mm_setzero_pd();
-        fiy0             = _mm_setzero_pd();
-        fiz0             = _mm_setzero_pd();
-
-        /* Load parameters for i particles */
-        iq0              = _mm_mul_pd(facel,_mm_load1_pd(charge+inr+0));
-        isai0            = _mm_load1_pd(invsqrta+inr+0);
-
-        /* Reset potential sums */
-        velecsum         = _mm_setzero_pd();
-        vgbsum           = _mm_setzero_pd();
-        dvdasum          = _mm_setzero_pd();
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrA             = jjnr[jidx];
-            jnrB             = jjnr[jidx+1];
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_2ptr_swizzle_pd(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_pd(ix0,jx0);
-            dy00             = _mm_sub_pd(iy0,jy0);
-            dz00             = _mm_sub_pd(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_pd(dx00,dy00,dz00);
-
-            rinv00           = avx128fma_invsqrt_d(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm_load_2real_swizzle_pd(charge+jnrA+0,charge+jnrB+0);
-            isaj0            = gmx_mm_load_2real_swizzle_pd(invsqrta+jnrA+0,invsqrta+jnrB+0);
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_pd(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_pd(iq0,jq0);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_pd(isai0,isaj0);
-            gbqqfactor       = _mm_xor_pd(signbit,_mm_mul_pd(qq00,_mm_mul_pd(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_pd(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_pd(r00,gbscale);
-            gbitab           = _mm_cvttpd_epi32(rt);
-#ifdef __XOP__
-            gbeps            = _mm_frcz_pd(rt);
-#else
-            gbeps            = _mm_sub_pd(rt,_mm_round_pd(rt, _MM_FROUND_FLOOR));
-#endif
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_pd( gbtab + _mm_extract_epi32(gbitab,0) );
-            F                = _mm_load_pd( gbtab + _mm_extract_epi32(gbitab,1) );
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( gbtab + _mm_extract_epi32(gbitab,0) +2);
-            H                = _mm_load_pd( gbtab + _mm_extract_epi32(gbitab,1) +2);
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Fp               = _mm_macc_pd(gbeps,_mm_macc_pd(gbeps,H,G),F);
-            VV               = _mm_macc_pd(gbeps,Fp,Y);
-            vgb              = _mm_mul_pd(gbqqfactor,VV);
-
-            twogbeps         = _mm_add_pd(gbeps,gbeps);
-            FF               = _mm_macc_pd(_mm_macc_pd(twogbeps,H,G),gbeps,Fp);
-            fgb              = _mm_mul_pd(gbqqfactor,_mm_mul_pd(FF,gbscale));
-            dvdatmp          = _mm_mul_pd(minushalf,_mm_macc_pd(fgb,r00,vgb));
-            dvdasum          = _mm_add_pd(dvdasum,dvdatmp);
-            gmx_mm_increment_2real_swizzle_pd(dvda+jnrA,dvda+jnrB,_mm_mul_pd(dvdatmp,_mm_mul_pd(isaj0,isaj0)));
-            velec            = _mm_mul_pd(qq00,rinv00);
-            felec            = _mm_mul_pd(_mm_msub_pd(velec,rinv00,fgb),rinv00);
-
-            /* Update potential sum for this i atom from the interaction with this j atom. */
-            velecsum         = _mm_add_pd(velecsum,velec);
-            vgbsum           = _mm_add_pd(vgbsum,vgb);
-
-            fscal            = felec;
-
-            /* Update vectorial force */
-            fix0             = _mm_macc_pd(dx00,fscal,fix0);
-            fiy0             = _mm_macc_pd(dy00,fscal,fiy0);
-            fiz0             = _mm_macc_pd(dz00,fscal,fiz0);
-            
-            gmx_mm_decrement_1rvec_2ptr_swizzle_pd(f+j_coord_offsetA,f+j_coord_offsetB,
-                                                   _mm_mul_pd(dx00,fscal),
-                                                   _mm_mul_pd(dy00,fscal),
-                                                   _mm_mul_pd(dz00,fscal));
-
-            /* Inner loop uses 61 flops */
-        }
-
-        if(jidx<j_index_end)
-        {
-
-            jnrA             = jjnr[jidx];
-            j_coord_offsetA  = DIM*jnrA;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_1ptr_swizzle_pd(x+j_coord_offsetA,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_pd(ix0,jx0);
-            dy00             = _mm_sub_pd(iy0,jy0);
-            dz00             = _mm_sub_pd(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_pd(dx00,dy00,dz00);
-
-            rinv00           = avx128fma_invsqrt_d(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = _mm_load_sd(charge+jnrA+0);
-            isaj0            = _mm_load_sd(invsqrta+jnrA+0);
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_pd(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_pd(iq0,jq0);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_pd(isai0,isaj0);
-            gbqqfactor       = _mm_xor_pd(signbit,_mm_mul_pd(qq00,_mm_mul_pd(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_pd(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_pd(r00,gbscale);
-            gbitab           = _mm_cvttpd_epi32(rt);
-#ifdef __XOP__
-            gbeps            = _mm_frcz_pd(rt);
-#else
-            gbeps            = _mm_sub_pd(rt,_mm_round_pd(rt, _MM_FROUND_FLOOR));
-#endif
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_pd( gbtab + _mm_extract_epi32(gbitab,0) );
-            F                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( gbtab + _mm_extract_epi32(gbitab,0) +2);
-            H                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Fp               = _mm_macc_pd(gbeps,_mm_macc_pd(gbeps,H,G),F);
-            VV               = _mm_macc_pd(gbeps,Fp,Y);
-            vgb              = _mm_mul_pd(gbqqfactor,VV);
-
-            twogbeps         = _mm_add_pd(gbeps,gbeps);
-            FF               = _mm_macc_pd(_mm_macc_pd(twogbeps,H,G),gbeps,Fp);
-            fgb              = _mm_mul_pd(gbqqfactor,_mm_mul_pd(FF,gbscale));
-            dvdatmp          = _mm_mul_pd(minushalf,_mm_macc_pd(fgb,r00,vgb));
-            dvdatmp          = _mm_unpacklo_pd(dvdatmp,_mm_setzero_pd());
-            dvdasum          = _mm_add_pd(dvdasum,dvdatmp);
-            gmx_mm_increment_1real_pd(dvda+jnrA,_mm_mul_pd(dvdatmp,_mm_mul_pd(isaj0,isaj0)));
-            velec            = _mm_mul_pd(qq00,rinv00);
-            felec            = _mm_mul_pd(_mm_msub_pd(velec,rinv00,fgb),rinv00);
-
-            /* Update potential sum for this i atom from the interaction with this j atom. */
-            velec            = _mm_unpacklo_pd(velec,_mm_setzero_pd());
-            velecsum         = _mm_add_pd(velecsum,velec);
-            vgb              = _mm_unpacklo_pd(vgb,_mm_setzero_pd());
-            vgbsum           = _mm_add_pd(vgbsum,vgb);
-
-            fscal            = felec;
-
-            fscal            = _mm_unpacklo_pd(fscal,_mm_setzero_pd());
-
-            /* Update vectorial force */
-            fix0             = _mm_macc_pd(dx00,fscal,fix0);
-            fiy0             = _mm_macc_pd(dy00,fscal,fiy0);
-            fiz0             = _mm_macc_pd(dz00,fscal,fiz0);
-            
-            gmx_mm_decrement_1rvec_1ptr_swizzle_pd(f+j_coord_offsetA,
-                                                   _mm_mul_pd(dx00,fscal),
-                                                   _mm_mul_pd(dy00,fscal),
-                                                   _mm_mul_pd(dz00,fscal));
-
-            /* Inner loop uses 61 flops */
-        }
-
-        /* End of innermost loop */
-
-        gmx_mm_update_iforce_1atom_swizzle_pd(fix0,fiy0,fiz0,
-                                              f+i_coord_offset,fshift+i_shift_offset);
-
-        ggid                        = gid[iidx];
-        /* Update potential energies */
-        gmx_mm_update_1pot_pd(velecsum,kernel_data->energygrp_elec+ggid);
-        gmx_mm_update_1pot_pd(vgbsum,kernel_data->energygrp_polarization+ggid);
-        dvdasum = _mm_mul_pd(dvdasum, _mm_mul_pd(isai0,isai0));
-        gmx_mm_update_1pot_pd(dvdasum,dvda+inr);
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 9 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VF,outeriter*9 + inneriter*61);
-}
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwNone_GeomP1P1_F_avx_128_fma_double
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            None
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        Force
- */
-void
-nb_kernel_ElecGB_VdwNone_GeomP1P1_F_avx_128_fma_double
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
-     * just 0 for non-waters.
-     * Suffixes A,B refer to j loop unrolling done with SSE double precision, e.g. for the two different
-     * jnr indices corresponding to data put in the four positions in the SIMD register.
-     */
-    int              i_shift_offset,i_coord_offset,outeriter,inneriter;
-    int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
-    int              jnrA,jnrB;
-    int              j_coord_offsetA,j_coord_offsetB;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             rcutoff_scalar;
-    real             *shiftvec,*fshift,*x,*f;
-    __m128d          tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
-    int              vdwioffset0;
-    __m128d          ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0A,vdwjidx0B;
-    __m128d          jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    __m128d          dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
-    __m128d          velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    __m128i          gbitab;
-    __m128d          vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,dvdaj,gbeps,twogbeps,dvdatmp;
-    __m128d          minushalf = _mm_set1_pd(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    __m128i          vfitab;
-    __m128i          ifour       = _mm_set1_epi32(4);
-    __m128d          rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF,twovfeps;
-    real             *vftab;
-    __m128d          dummy_mask,cutoff_mask;
-    __m128d          signbit   = gmx_mm_castsi128_pd( _mm_set_epi32(0x80000000,0x00000000,0x80000000,0x00000000) );
-    __m128d          one     = _mm_set1_pd(1.0);
-    __m128d          two     = _mm_set1_pd(2.0);
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = _mm_set1_pd(fr->ic->epsfac);
-    charge           = mdatoms->chargeA;
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = _mm_set1_pd(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = _mm_set1_pd((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-
-    /* Avoid stupid compiler warnings */
-    jnrA = jnrB = 0;
-    j_coord_offsetA = 0;
-    j_coord_offsetB = 0;
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        gmx_mm_load_shift_and_1rvec_broadcast_pd(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
-
-        fix0             = _mm_setzero_pd();
-        fiy0             = _mm_setzero_pd();
-        fiz0             = _mm_setzero_pd();
-
-        /* Load parameters for i particles */
-        iq0              = _mm_mul_pd(facel,_mm_load1_pd(charge+inr+0));
-        isai0            = _mm_load1_pd(invsqrta+inr+0);
-
-        dvdasum          = _mm_setzero_pd();
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrA             = jjnr[jidx];
-            jnrB             = jjnr[jidx+1];
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_2ptr_swizzle_pd(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_pd(ix0,jx0);
-            dy00             = _mm_sub_pd(iy0,jy0);
-            dz00             = _mm_sub_pd(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_pd(dx00,dy00,dz00);
-
-            rinv00           = avx128fma_invsqrt_d(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm_load_2real_swizzle_pd(charge+jnrA+0,charge+jnrB+0);
-            isaj0            = gmx_mm_load_2real_swizzle_pd(invsqrta+jnrA+0,invsqrta+jnrB+0);
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_pd(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_pd(iq0,jq0);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_pd(isai0,isaj0);
-            gbqqfactor       = _mm_xor_pd(signbit,_mm_mul_pd(qq00,_mm_mul_pd(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_pd(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_pd(r00,gbscale);
-            gbitab           = _mm_cvttpd_epi32(rt);
-#ifdef __XOP__
-            gbeps            = _mm_frcz_pd(rt);
-#else
-            gbeps            = _mm_sub_pd(rt,_mm_round_pd(rt, _MM_FROUND_FLOOR));
-#endif
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_pd( gbtab + _mm_extract_epi32(gbitab,0) );
-            F                = _mm_load_pd( gbtab + _mm_extract_epi32(gbitab,1) );
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( gbtab + _mm_extract_epi32(gbitab,0) +2);
-            H                = _mm_load_pd( gbtab + _mm_extract_epi32(gbitab,1) +2);
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Fp               = _mm_macc_pd(gbeps,_mm_macc_pd(gbeps,H,G),F);
-            VV               = _mm_macc_pd(gbeps,Fp,Y);
-            vgb              = _mm_mul_pd(gbqqfactor,VV);
-
-            twogbeps         = _mm_add_pd(gbeps,gbeps);
-            FF               = _mm_macc_pd(_mm_macc_pd(twogbeps,H,G),gbeps,Fp);
-            fgb              = _mm_mul_pd(gbqqfactor,_mm_mul_pd(FF,gbscale));
-            dvdatmp          = _mm_mul_pd(minushalf,_mm_macc_pd(fgb,r00,vgb));
-            dvdasum          = _mm_add_pd(dvdasum,dvdatmp);
-            gmx_mm_increment_2real_swizzle_pd(dvda+jnrA,dvda+jnrB,_mm_mul_pd(dvdatmp,_mm_mul_pd(isaj0,isaj0)));
-            velec            = _mm_mul_pd(qq00,rinv00);
-            felec            = _mm_mul_pd(_mm_msub_pd(velec,rinv00,fgb),rinv00);
-
-            fscal            = felec;
-
-            /* Update vectorial force */
-            fix0             = _mm_macc_pd(dx00,fscal,fix0);
-            fiy0             = _mm_macc_pd(dy00,fscal,fiy0);
-            fiz0             = _mm_macc_pd(dz00,fscal,fiz0);
-            
-            gmx_mm_decrement_1rvec_2ptr_swizzle_pd(f+j_coord_offsetA,f+j_coord_offsetB,
-                                                   _mm_mul_pd(dx00,fscal),
-                                                   _mm_mul_pd(dy00,fscal),
-                                                   _mm_mul_pd(dz00,fscal));
-
-            /* Inner loop uses 59 flops */
-        }
-
-        if(jidx<j_index_end)
-        {
-
-            jnrA             = jjnr[jidx];
-            j_coord_offsetA  = DIM*jnrA;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_1ptr_swizzle_pd(x+j_coord_offsetA,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_pd(ix0,jx0);
-            dy00             = _mm_sub_pd(iy0,jy0);
-            dz00             = _mm_sub_pd(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_pd(dx00,dy00,dz00);
-
-            rinv00           = avx128fma_invsqrt_d(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = _mm_load_sd(charge+jnrA+0);
-            isaj0            = _mm_load_sd(invsqrta+jnrA+0);
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_pd(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_pd(iq0,jq0);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_pd(isai0,isaj0);
-            gbqqfactor       = _mm_xor_pd(signbit,_mm_mul_pd(qq00,_mm_mul_pd(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_pd(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_pd(r00,gbscale);
-            gbitab           = _mm_cvttpd_epi32(rt);
-#ifdef __XOP__
-            gbeps            = _mm_frcz_pd(rt);
-#else
-            gbeps            = _mm_sub_pd(rt,_mm_round_pd(rt, _MM_FROUND_FLOOR));
-#endif
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_pd( gbtab + _mm_extract_epi32(gbitab,0) );
-            F                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( gbtab + _mm_extract_epi32(gbitab,0) +2);
-            H                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Fp               = _mm_macc_pd(gbeps,_mm_macc_pd(gbeps,H,G),F);
-            VV               = _mm_macc_pd(gbeps,Fp,Y);
-            vgb              = _mm_mul_pd(gbqqfactor,VV);
-
-            twogbeps         = _mm_add_pd(gbeps,gbeps);
-            FF               = _mm_macc_pd(_mm_macc_pd(twogbeps,H,G),gbeps,Fp);
-            fgb              = _mm_mul_pd(gbqqfactor,_mm_mul_pd(FF,gbscale));
-            dvdatmp          = _mm_mul_pd(minushalf,_mm_macc_pd(fgb,r00,vgb));
-            dvdatmp          = _mm_unpacklo_pd(dvdatmp,_mm_setzero_pd());
-            dvdasum          = _mm_add_pd(dvdasum,dvdatmp);
-            gmx_mm_increment_1real_pd(dvda+jnrA,_mm_mul_pd(dvdatmp,_mm_mul_pd(isaj0,isaj0)));
-            velec            = _mm_mul_pd(qq00,rinv00);
-            felec            = _mm_mul_pd(_mm_msub_pd(velec,rinv00,fgb),rinv00);
-
-            fscal            = felec;
-
-            fscal            = _mm_unpacklo_pd(fscal,_mm_setzero_pd());
-
-            /* Update vectorial force */
-            fix0             = _mm_macc_pd(dx00,fscal,fix0);
-            fiy0             = _mm_macc_pd(dy00,fscal,fiy0);
-            fiz0             = _mm_macc_pd(dz00,fscal,fiz0);
-            
-            gmx_mm_decrement_1rvec_1ptr_swizzle_pd(f+j_coord_offsetA,
-                                                   _mm_mul_pd(dx00,fscal),
-                                                   _mm_mul_pd(dy00,fscal),
-                                                   _mm_mul_pd(dz00,fscal));
-
-            /* Inner loop uses 59 flops */
-        }
-
-        /* End of innermost loop */
-
-        gmx_mm_update_iforce_1atom_swizzle_pd(fix0,fiy0,fiz0,
-                                              f+i_coord_offset,fshift+i_shift_offset);
-
-        dvdasum = _mm_mul_pd(dvdasum, _mm_mul_pd(isai0,isai0));
-        gmx_mm_update_1pot_pd(dvdasum,dvda+inr);
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 7 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_F,outeriter*7 + inneriter*59);
-}
index 224f4a4bd36ee21b31b44be939ab450e3bc3de8a..60775ca2e4a78ac2594caa0e91627631938fc33e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -51,6 +51,36 @@ nb_kernel_t nb_kernel_ElecNone_VdwLJSw_GeomP1P1_VF_avx_128_fma_double;
 nb_kernel_t nb_kernel_ElecNone_VdwLJSw_GeomP1P1_F_avx_128_fma_double;
 nb_kernel_t nb_kernel_ElecNone_VdwCSTab_GeomP1P1_VF_avx_128_fma_double;
 nb_kernel_t nb_kernel_ElecNone_VdwCSTab_GeomP1P1_F_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_avx_128_fma_double;
 nb_kernel_t nb_kernel_ElecEw_VdwLJEw_GeomP1P1_VF_avx_128_fma_double;
 nb_kernel_t nb_kernel_ElecEw_VdwLJEw_GeomP1P1_F_avx_128_fma_double;
 nb_kernel_t nb_kernel_ElecEw_VdwLJEw_GeomW3P1_VF_avx_128_fma_double;
@@ -141,72 +171,6 @@ nb_kernel_t nb_kernel_ElecEwSw_VdwNone_GeomW4P1_VF_avx_128_fma_double;
 nb_kernel_t nb_kernel_ElecEwSw_VdwNone_GeomW4P1_F_avx_128_fma_double;
 nb_kernel_t nb_kernel_ElecEwSw_VdwNone_GeomW4W4_VF_avx_128_fma_double;
 nb_kernel_t nb_kernel_ElecEwSw_VdwNone_GeomW4W4_F_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecGB_VdwNone_GeomP1P1_F_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_avx_128_fma_double;
-nb_kernel_t nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_avx_128_fma_double;
 nb_kernel_t nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_VF_avx_128_fma_double;
 nb_kernel_t nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_F_avx_128_fma_double;
 nb_kernel_t nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_VF_avx_128_fma_double;
@@ -277,6 +241,36 @@ nb_kernel_t nb_kernel_ElecRF_VdwCSTab_GeomW4P1_VF_avx_128_fma_double;
 nb_kernel_t nb_kernel_ElecRF_VdwCSTab_GeomW4P1_F_avx_128_fma_double;
 nb_kernel_t nb_kernel_ElecRF_VdwCSTab_GeomW4W4_VF_avx_128_fma_double;
 nb_kernel_t nb_kernel_ElecRF_VdwCSTab_GeomW4W4_F_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_avx_128_fma_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_avx_128_fma_double;
 
 
 nb_kernel_info_t
@@ -294,6 +288,36 @@ nb_kernel_info_t
     { nb_kernel_ElecNone_VdwLJSw_GeomP1P1_F_avx_128_fma_double, "nb_kernel_ElecNone_VdwLJSw_GeomP1P1_F_avx_128_fma_double", "avx_128_fma_double", "None", "None", "LennardJones", "PotentialSwitch", "ParticleParticle", "", "Force" },
     { nb_kernel_ElecNone_VdwCSTab_GeomP1P1_VF_avx_128_fma_double, "nb_kernel_ElecNone_VdwCSTab_GeomP1P1_VF_avx_128_fma_double", "avx_128_fma_double", "None", "None", "CubicSplineTable", "None", "ParticleParticle", "", "PotentialAndForce" },
     { nb_kernel_ElecNone_VdwCSTab_GeomP1P1_F_avx_128_fma_double, "nb_kernel_ElecNone_VdwCSTab_GeomP1P1_F_avx_128_fma_double", "avx_128_fma_double", "None", "None", "CubicSplineTable", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "LennardJones", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "LennardJones", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "LennardJones", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "LennardJones", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "LennardJones", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "LennardJones", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "LennardJones", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "LennardJones", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "LennardJones", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "LennardJones", "None", "Water4Water4", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "None", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "None", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "None", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "None", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "None", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "None", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "None", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "None", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "None", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "None", "None", "Water4Water4", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Water4", "", "Force" },
     { nb_kernel_ElecEw_VdwLJEw_GeomP1P1_VF_avx_128_fma_double, "nb_kernel_ElecEw_VdwLJEw_GeomP1P1_VF_avx_128_fma_double", "avx_128_fma_double", "Ewald", "None", "LJEwald", "None", "ParticleParticle", "", "PotentialAndForce" },
     { nb_kernel_ElecEw_VdwLJEw_GeomP1P1_F_avx_128_fma_double, "nb_kernel_ElecEw_VdwLJEw_GeomP1P1_F_avx_128_fma_double", "avx_128_fma_double", "Ewald", "None", "LJEwald", "None", "ParticleParticle", "", "Force" },
     { nb_kernel_ElecEw_VdwLJEw_GeomW3P1_VF_avx_128_fma_double, "nb_kernel_ElecEw_VdwLJEw_GeomW3P1_VF_avx_128_fma_double", "avx_128_fma_double", "Ewald", "None", "LJEwald", "None", "Water3Particle", "", "PotentialAndForce" },
@@ -384,72 +408,6 @@ nb_kernel_info_t
     { nb_kernel_ElecEwSw_VdwNone_GeomW4P1_F_avx_128_fma_double, "nb_kernel_ElecEwSw_VdwNone_GeomW4P1_F_avx_128_fma_double", "avx_128_fma_double", "Ewald", "PotentialSwitch", "None", "None", "Water4Particle", "", "Force" },
     { nb_kernel_ElecEwSw_VdwNone_GeomW4W4_VF_avx_128_fma_double, "nb_kernel_ElecEwSw_VdwNone_GeomW4W4_VF_avx_128_fma_double", "avx_128_fma_double", "Ewald", "PotentialSwitch", "None", "None", "Water4Water4", "", "PotentialAndForce" },
     { nb_kernel_ElecEwSw_VdwNone_GeomW4W4_F_avx_128_fma_double, "nb_kernel_ElecEwSw_VdwNone_GeomW4W4_F_avx_128_fma_double", "avx_128_fma_double", "Ewald", "PotentialSwitch", "None", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_avx_128_fma_double, "nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "LennardJones", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_avx_128_fma_double, "nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "LennardJones", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_avx_128_fma_double, "nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "LennardJones", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_avx_128_fma_double, "nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "LennardJones", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_avx_128_fma_double, "nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "LennardJones", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_avx_128_fma_double, "nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "LennardJones", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_avx_128_fma_double, "nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "LennardJones", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_avx_128_fma_double, "nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "LennardJones", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_avx_128_fma_double, "nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "LennardJones", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_avx_128_fma_double, "nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "LennardJones", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_avx_128_fma_double, "nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "None", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_avx_128_fma_double, "nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "None", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_avx_128_fma_double, "nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "None", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_avx_128_fma_double, "nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "None", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_avx_128_fma_double, "nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "None", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_avx_128_fma_double, "nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "None", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_avx_128_fma_double, "nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "None", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_avx_128_fma_double, "nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "None", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_avx_128_fma_double, "nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "None", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_avx_128_fma_double, "nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "None", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_avx_128_fma_double, "nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "CubicSplineTable", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_avx_128_fma_double, "nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "CubicSplineTable", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_avx_128_fma_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "CubicSplineTable", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_avx_128_fma_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "CubicSplineTable", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_avx_128_fma_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "CubicSplineTable", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_avx_128_fma_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "CubicSplineTable", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_avx_128_fma_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "CubicSplineTable", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_avx_128_fma_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "CubicSplineTable", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_avx_128_fma_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "CubicSplineTable", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_avx_128_fma_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "CubicSplineTable", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "LennardJones", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "LennardJones", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "LennardJones", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "LennardJones", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "LennardJones", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "LennardJones", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "LennardJones", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "LennardJones", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "LennardJones", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "LennardJones", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "None", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "None", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "None", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "None", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "None", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "None", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "None", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "None", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "None", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "None", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_avx_128_fma_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_avx_128_fma_double", "avx_128_fma_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_avx_128_fma_double, "nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_avx_128_fma_double", "avx_128_fma_double", "GeneralizedBorn", "None", "LennardJones", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_avx_128_fma_double, "nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_avx_128_fma_double", "avx_128_fma_double", "GeneralizedBorn", "None", "LennardJones", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_avx_128_fma_double, "nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_avx_128_fma_double", "avx_128_fma_double", "GeneralizedBorn", "None", "None", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecGB_VdwNone_GeomP1P1_F_avx_128_fma_double, "nb_kernel_ElecGB_VdwNone_GeomP1P1_F_avx_128_fma_double", "avx_128_fma_double", "GeneralizedBorn", "None", "None", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_avx_128_fma_double, "nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_avx_128_fma_double", "avx_128_fma_double", "GeneralizedBorn", "None", "CubicSplineTable", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_avx_128_fma_double, "nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_avx_128_fma_double", "avx_128_fma_double", "GeneralizedBorn", "None", "CubicSplineTable", "None", "ParticleParticle", "", "Force" },
     { nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_VF_avx_128_fma_double, "nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_VF_avx_128_fma_double", "avx_128_fma_double", "ReactionField", "ExactCutoff", "LennardJones", "PotentialShift", "ParticleParticle", "", "PotentialAndForce" },
     { nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_F_avx_128_fma_double, "nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_F_avx_128_fma_double", "avx_128_fma_double", "ReactionField", "ExactCutoff", "LennardJones", "PotentialShift", "ParticleParticle", "", "Force" },
     { nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_VF_avx_128_fma_double, "nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_VF_avx_128_fma_double", "avx_128_fma_double", "ReactionField", "ExactCutoff", "LennardJones", "PotentialShift", "Water3Particle", "", "PotentialAndForce" },
@@ -519,7 +477,37 @@ nb_kernel_info_t
     { nb_kernel_ElecRF_VdwCSTab_GeomW4P1_VF_avx_128_fma_double, "nb_kernel_ElecRF_VdwCSTab_GeomW4P1_VF_avx_128_fma_double", "avx_128_fma_double", "ReactionField", "None", "CubicSplineTable", "None", "Water4Particle", "", "PotentialAndForce" },
     { nb_kernel_ElecRF_VdwCSTab_GeomW4P1_F_avx_128_fma_double, "nb_kernel_ElecRF_VdwCSTab_GeomW4P1_F_avx_128_fma_double", "avx_128_fma_double", "ReactionField", "None", "CubicSplineTable", "None", "Water4Particle", "", "Force" },
     { nb_kernel_ElecRF_VdwCSTab_GeomW4W4_VF_avx_128_fma_double, "nb_kernel_ElecRF_VdwCSTab_GeomW4W4_VF_avx_128_fma_double", "avx_128_fma_double", "ReactionField", "None", "CubicSplineTable", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecRF_VdwCSTab_GeomW4W4_F_avx_128_fma_double, "nb_kernel_ElecRF_VdwCSTab_GeomW4W4_F_avx_128_fma_double", "avx_128_fma_double", "ReactionField", "None", "CubicSplineTable", "None", "Water4Water4", "", "Force" }
+    { nb_kernel_ElecRF_VdwCSTab_GeomW4W4_F_avx_128_fma_double, "nb_kernel_ElecRF_VdwCSTab_GeomW4W4_F_avx_128_fma_double", "avx_128_fma_double", "ReactionField", "None", "CubicSplineTable", "None", "Water4Water4", "", "Force" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_avx_128_fma_double, "nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "LennardJones", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_avx_128_fma_double, "nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "LennardJones", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_avx_128_fma_double, "nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "LennardJones", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_avx_128_fma_double, "nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "LennardJones", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_avx_128_fma_double, "nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "LennardJones", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_avx_128_fma_double, "nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "LennardJones", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_avx_128_fma_double, "nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "LennardJones", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_avx_128_fma_double, "nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "LennardJones", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_avx_128_fma_double, "nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "LennardJones", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_avx_128_fma_double, "nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "LennardJones", "None", "Water4Water4", "", "Force" },
+    { nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_avx_128_fma_double, "nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "None", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_avx_128_fma_double, "nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "None", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_avx_128_fma_double, "nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "None", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_avx_128_fma_double, "nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "None", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_avx_128_fma_double, "nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "None", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_avx_128_fma_double, "nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "None", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_avx_128_fma_double, "nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "None", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_avx_128_fma_double, "nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "None", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_avx_128_fma_double, "nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "None", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_avx_128_fma_double, "nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "None", "None", "Water4Water4", "", "Force" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_avx_128_fma_double, "nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "CubicSplineTable", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_avx_128_fma_double, "nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "CubicSplineTable", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_avx_128_fma_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "CubicSplineTable", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_avx_128_fma_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "CubicSplineTable", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_avx_128_fma_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "CubicSplineTable", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_avx_128_fma_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "CubicSplineTable", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_avx_128_fma_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "CubicSplineTable", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_avx_128_fma_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "CubicSplineTable", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_avx_128_fma_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "CubicSplineTable", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_avx_128_fma_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_avx_128_fma_double", "avx_128_fma_double", "Coulomb", "None", "CubicSplineTable", "None", "Water4Water4", "", "Force" }
 };
 
 int
index 0bbbec2976254116010b92b3e3d4d810cfe81f52..487ed3b6ff4e8e9d963899e2fd3fe2c870ff0fc9 100644 (file)
@@ -2,7 +2,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -128,12 +128,6 @@ void
     __m128d          velec,felec,velecsum,facel,crf,krf,krf2;
     real             *charge;
     /* #endif */
-    /* #if 'GeneralizedBorn' in KERNEL_ELEC */
-    __m128i          gbitab;
-    __m128d          vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,dvdaj,gbeps,twogbeps,dvdatmp;
-    __m128d          minushalf = _mm_set1_pd(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    /* #endif */
     /* #if KERNEL_VDW != 'None' */
     int              nvdwtype;
     __m128d          rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
@@ -142,7 +136,7 @@ void
     __m128d          one_sixth   = _mm_set1_pd(1.0/6.0);
     __m128d          one_twelfth = _mm_set1_pd(1.0/12.0);
     /* #endif */
-    /* #if 'Table' in KERNEL_ELEC or 'GeneralizedBorn' in KERNEL_ELEC or 'Table' in KERNEL_VDW */
+    /* #if 'Table' in KERNEL_ELEC or 'Table' in KERNEL_VDW */
     __m128i          vfitab;
     __m128i          ifour       = _mm_set1_epi32(4);
     __m128d          rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF,twovfeps;
@@ -226,14 +220,6 @@ void
      /*     #endif */
     /* #endif */
 
-    /* #if KERNEL_ELEC=='GeneralizedBorn' */
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = _mm_set1_pd(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = _mm_set1_pd((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-    /* #endif */
-
     /* #if 'Water' in GEOMETRY_I */
     /* Setup water-specific parameters */
     inr              = nlist->iinr[0];
@@ -360,9 +346,6 @@ void
         /*     #for I in PARTICLES_ELEC_I */
         iq{I}              = _mm_mul_pd(facel,_mm_load1_pd(charge+inr+{I}));
         /*         #define OUTERFLOPS OUTERFLOPS+1 */
-        /*         #if KERNEL_ELEC=='GeneralizedBorn' */
-        isai{I}            = _mm_load1_pd(invsqrta+inr+{I});
-        /*         #endif */
         /*     #endfor */
         /*     #for I in PARTICLES_VDW_I */
         vdwioffset{I}      = 2*nvdwtype*vdwtype[inr+{I}];
@@ -374,16 +357,10 @@ void
         /*     #if KERNEL_ELEC != 'None' */
         velecsum         = _mm_setzero_pd();
         /*     #endif */
-        /*     #if 'GeneralizedBorn' in KERNEL_ELEC */
-        vgbsum           = _mm_setzero_pd();
-        /*     #endif */
         /*     #if KERNEL_VDW != 'None' */
         vvdwsum          = _mm_setzero_pd();
         /*     #endif */
         /* #endif */
-        /*     #if 'GeneralizedBorn' in KERNEL_ELEC and 'Force' in KERNEL_VF */
-        dvdasum          = _mm_setzero_pd();
-        /*     #endif */
 
         /* #for ROUND in ['Loop','Epilogue'] */
 
@@ -490,13 +467,6 @@ void
             /*         #else */
             jq{J}              = _mm_load_sd(charge+jnrA+{J});
             /*         #endif */
-            /*         #if KERNEL_ELEC=='GeneralizedBorn' */
-            /*             #if ROUND =='Loop' */
-            isaj{J}            = gmx_mm_load_2real_swizzle_pd(invsqrta+jnrA+{J},invsqrta+jnrB+{J});
-            /*             #else */
-            isaj{J}            = _mm_load_sd(invsqrta+jnrA+{J});
-            /*             #endif */
-            /*         #endif */
             /*     #endfor */
             /*     #for J in PARTICLES_VDW_J */
             vdwjidx{J}A        = 2*vdwtype[jnrA+{J}];
@@ -607,68 +577,6 @@ void
             /*                 #define INNERFLOPS INNERFLOPS+3 */
             /*             #endif */
 
-            /*         #elif KERNEL_ELEC=='GeneralizedBorn' */
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_pd(isai{I},isaj{J});
-            gbqqfactor       = _mm_xor_pd(signbit,_mm_mul_pd(qq{I}{J},_mm_mul_pd(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_pd(isaprod,gbtabscale);
-            /*             #define INNERFLOPS INNERFLOPS+5 */
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_pd(r{I}{J},gbscale);
-            gbitab           = _mm_cvttpd_epi32(rt);
-#ifdef __XOP__
-            gbeps            = _mm_frcz_pd(rt);
-#else
-            gbeps            = _mm_sub_pd(rt,_mm_round_pd(rt, _MM_FROUND_FLOOR));
-#endif
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_pd( gbtab + _mm_extract_epi32(gbitab,0) );
-            /*             #if ROUND == 'Loop' */
-            F                = _mm_load_pd( gbtab + _mm_extract_epi32(gbitab,1) );
-            /*             #else */
-            F                = _mm_setzero_pd();
-            /*             #endif */
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( gbtab + _mm_extract_epi32(gbitab,0) +2);
-            /*             #if ROUND == 'Loop' */
-            H                = _mm_load_pd( gbtab + _mm_extract_epi32(gbitab,1) +2);
-            /*             #else */
-            H                = _mm_setzero_pd();
-            /*             #endif */
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Fp               = _mm_macc_pd(gbeps,_mm_macc_pd(gbeps,H,G),F);
-            VV               = _mm_macc_pd(gbeps,Fp,Y);
-            vgb              = _mm_mul_pd(gbqqfactor,VV);
-            /*             #define INNERFLOPS INNERFLOPS+10 */
-
-            /*             #if 'Force' in KERNEL_VF */
-            twogbeps         = _mm_add_pd(gbeps,gbeps);
-            FF               = _mm_macc_pd(_mm_macc_pd(twogbeps,H,G),gbeps,Fp);
-            fgb              = _mm_mul_pd(gbqqfactor,_mm_mul_pd(FF,gbscale));
-            dvdatmp          = _mm_mul_pd(minushalf,_mm_macc_pd(fgb,r{I}{J},vgb));
-            /*                 #if ROUND == 'Epilogue' */
-            dvdatmp          = _mm_unpacklo_pd(dvdatmp,_mm_setzero_pd());
-            /*                 #endif */
-            dvdasum          = _mm_add_pd(dvdasum,dvdatmp);
-            /*             #if ROUND == 'Loop' */
-            gmx_mm_increment_2real_swizzle_pd(dvda+jnrA,dvda+jnrB,_mm_mul_pd(dvdatmp,_mm_mul_pd(isaj{J},isaj{J})));
-            /*             #else */
-            gmx_mm_increment_1real_pd(dvda+jnrA,_mm_mul_pd(dvdatmp,_mm_mul_pd(isaj{J},isaj{J})));
-            /*             #endif */
-            /*                 #define INNERFLOPS INNERFLOPS+13 */
-            /*             #endif */
-            velec            = _mm_mul_pd(qq{I}{J},rinv{I}{J});
-            /*                 #define INNERFLOPS INNERFLOPS+1 */
-            /*             #if 'Force' in KERNEL_VF */
-            felec            = _mm_mul_pd(_mm_msub_pd(velec,rinv{I}{J},fgb),rinv{I}{J});
-            /*                 #define INNERFLOPS INNERFLOPS+3 */
-            /*             #endif */
-
             /*         #elif KERNEL_ELEC=='Ewald' */
             /* EWALD ELECTROSTATICS */
 
@@ -955,17 +863,6 @@ void
             /*             #endif */
             velecsum         = _mm_add_pd(velecsum,velec);
             /*             #define INNERFLOPS INNERFLOPS+1 */
-            /*             #if KERNEL_ELEC=='GeneralizedBorn' */
-            /*             #if 'exactcutoff' in INTERACTION_FLAGS[I][J] */
-            vgb              = _mm_and_pd(vgb,cutoff_mask);
-            /*                 #define INNERFLOPS INNERFLOPS+1 */
-            /*             #endif                                       */
-            /*             #if ROUND == 'Epilogue' */
-            vgb              = _mm_unpacklo_pd(vgb,_mm_setzero_pd());
-            /*             #endif */
-            vgbsum           = _mm_add_pd(vgbsum,vgb);
-            /*                 #define INNERFLOPS INNERFLOPS+1 */
-            /*             #endif */
             /*         #endif */
             /*         #if 'vdw' in INTERACTION_FLAGS[I][J] */
             /*             #if 'exactcutoff' in INTERACTION_FLAGS[I][J] */
@@ -1110,19 +1007,11 @@ void
         gmx_mm_update_1pot_pd(velecsum,kernel_data->energygrp_elec+ggid);
         /*         #define OUTERFLOPS OUTERFLOPS+1 */
         /*     #endif */
-        /*     #if 'GeneralizedBorn' in KERNEL_ELEC */
-        gmx_mm_update_1pot_pd(vgbsum,kernel_data->energygrp_polarization+ggid);
-        /*         #define OUTERFLOPS OUTERFLOPS+1 */
-        /*     #endif */
         /*     #if KERNEL_VDW != 'None' */
         gmx_mm_update_1pot_pd(vvdwsum,kernel_data->energygrp_vdw+ggid);
         /*         #define OUTERFLOPS OUTERFLOPS+1 */
         /*     #endif */
         /* #endif */
-        /*     #if 'GeneralizedBorn' in KERNEL_ELEC and 'Force' in KERNEL_VF */
-        dvdasum = _mm_mul_pd(dvdasum, _mm_mul_pd(isai{I},isai{I}));
-        gmx_mm_update_1pot_pd(dvdasum,dvda+inr);
-        /*     #endif */
 
         /* Increment number of inner iterations */
         inneriter                  += j_index_end - j_index_start;
index 8c43ad5cee52417f68157ee3b3c55b3410919c37..c7154c8d1ee69b18565d7eee38dc890fc0645a9c 100755 (executable)
@@ -105,7 +105,6 @@ ElectrostaticsList = {
     'None'                    : [],
     'Coulomb'                 : ['rinv','rinvsq'],
     'ReactionField'           : ['rinv','rinvsq'],
-    'GeneralizedBorn'         : ['rinv','r'],
     'CubicSplineTable'        : ['rinv','r','table'],
     'Ewald'                   : ['rinv','rinvsq','r'],
 }
@@ -190,7 +189,6 @@ Abbreviation = {
     'Coulomb'                 : 'Coul',
     'Ewald'                   : 'Ew',
     'ReactionField'           : 'RF',
-    'GeneralizedBorn'         : 'GB',
     'CubicSplineTable'        : 'CSTab',
     'LennardJones'            : 'LJ',
     'Buckingham'              : 'Bham',
@@ -269,7 +267,7 @@ def KeepKernel(KernelElec,KernelElecMod,KernelVdw,KernelVdwMod,KernelGeom,Kernel
         return 0
 
     # No need for LJ-only water optimization, or water optimization with implicit solvent.
-    if('Water' in KernelGeom[0] and (KernelElec=='None' or 'GeneralizedBorn' in KernelElec)):
+    if('Water' in KernelGeom[0] and KernelElec=='None'):
         return 0
 
     # Non-matching table settings are pointless
diff --git a/src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecGB_VdwCSTab_GeomP1P1_avx_128_fma_single.c b/src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecGB_VdwCSTab_GeomP1P1_avx_128_fma_single.c
deleted file mode 100644 (file)
index 1e7160b..0000000
+++ /dev/null
@@ -1,978 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
- * and including many others, as listed in the AUTHORS file in the
- * top-level source directory and at http://www.gromacs.org.
- *
- * GROMACS is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * GROMACS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GROMACS; if not, see
- * http://www.gnu.org/licenses, or write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
- *
- * If you want to redistribute modifications to GROMACS, please
- * consider that scientific software is very special. Version
- * control is crucial - bugs must be traceable. We will be happy to
- * consider code for inclusion in the official distribution, but
- * derived work must not be called official GROMACS. Details are found
- * in the README & COPYING files - if they are missing, get the
- * official version at http://www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the research papers on the package. Check out http://www.gromacs.org.
- */
-/*
- * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
- */
-#include "gmxpre.h"
-
-#include "config.h"
-
-#include <math.h>
-
-#include "../nb_kernel.h"
-#include "gromacs/gmxlib/nrnb.h"
-
-#include "kernelutil_x86_avx_128_fma_single.h"
-
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_avx_128_fma_single
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            CubicSplineTable
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        PotentialAndForce
- */
-void
-nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_avx_128_fma_single
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
-     * just 0 for non-waters.
-     * Suffixes A,B,C,D refer to j loop unrolling done with AVX_128, e.g. for the four different
-     * jnr indices corresponding to data put in the four positions in the SIMD register.
-     */
-    int              i_shift_offset,i_coord_offset,outeriter,inneriter;
-    int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
-    int              jnrA,jnrB,jnrC,jnrD;
-    int              jnrlistA,jnrlistB,jnrlistC,jnrlistD;
-    int              j_coord_offsetA,j_coord_offsetB,j_coord_offsetC,j_coord_offsetD;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             rcutoff_scalar;
-    real             *shiftvec,*fshift,*x,*f;
-    real             *fjptrA,*fjptrB,*fjptrC,*fjptrD;
-    real             scratch[4*DIM];
-    __m128           fscal,rcutoff,rcutoff2,jidxall;
-    int              vdwioffset0;
-    __m128           ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0A,vdwjidx0B,vdwjidx0C,vdwjidx0D;
-    __m128           jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    __m128           dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
-    __m128           velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    __m128i          gbitab;
-    __m128           vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,gbeps,twogbeps,dvdatmp;
-    __m128           minushalf = _mm_set1_ps(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    int              nvdwtype;
-    __m128           rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
-    int              *vdwtype;
-    real             *vdwparam;
-    __m128           one_sixth   = _mm_set1_ps(1.0/6.0);
-    __m128           one_twelfth = _mm_set1_ps(1.0/12.0);
-    __m128i          vfitab;
-    __m128i          ifour       = _mm_set1_epi32(4);
-    __m128           rt,vfeps,twovfeps,vftabscale,Y,F,G,H,Fp,VV,FF;
-    real             *vftab;
-    __m128           dummy_mask,cutoff_mask;
-    __m128           signbit = _mm_castsi128_ps( _mm_set1_epi32(0x80000000) );
-    __m128           one     = _mm_set1_ps(1.0);
-    __m128           two     = _mm_set1_ps(2.0);
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = _mm_set1_ps(fr->ic->epsfac);
-    charge           = mdatoms->chargeA;
-    nvdwtype         = fr->ntype;
-    vdwparam         = fr->nbfp;
-    vdwtype          = mdatoms->typeA;
-
-    vftab            = kernel_data->table_vdw->data;
-    vftabscale       = _mm_set1_ps(kernel_data->table_vdw->scale);
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = _mm_set1_ps(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = _mm_set1_ps((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-
-    /* Avoid stupid compiler warnings */
-    jnrA = jnrB = jnrC = jnrD = 0;
-    j_coord_offsetA = 0;
-    j_coord_offsetB = 0;
-    j_coord_offsetC = 0;
-    j_coord_offsetD = 0;
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    for(iidx=0;iidx<4*DIM;iidx++)
-    {
-        scratch[iidx] = 0.0;
-    }
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        gmx_mm_load_shift_and_1rvec_broadcast_ps(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
-
-        fix0             = _mm_setzero_ps();
-        fiy0             = _mm_setzero_ps();
-        fiz0             = _mm_setzero_ps();
-
-        /* Load parameters for i particles */
-        iq0              = _mm_mul_ps(facel,_mm_load1_ps(charge+inr+0));
-        isai0            = _mm_load1_ps(invsqrta+inr+0);
-        vdwioffset0      = 2*nvdwtype*vdwtype[inr+0];
-
-        /* Reset potential sums */
-        velecsum         = _mm_setzero_ps();
-        vgbsum           = _mm_setzero_ps();
-        vvdwsum          = _mm_setzero_ps();
-        dvdasum          = _mm_setzero_ps();
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end && jjnr[jidx+3]>=0; jidx+=4)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrA             = jjnr[jidx];
-            jnrB             = jjnr[jidx+1];
-            jnrC             = jjnr[jidx+2];
-            jnrD             = jjnr[jidx+3];
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              x+j_coord_offsetC,x+j_coord_offsetD,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_ps(ix0,jx0);
-            dy00             = _mm_sub_ps(iy0,jy0);
-            dz00             = _mm_sub_ps(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
-
-            rinv00           = avx128fma_invsqrt_f(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm_load_4real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
-                                                              charge+jnrC+0,charge+jnrD+0);
-            isaj0            = gmx_mm_load_4real_swizzle_ps(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                              invsqrta+jnrC+0,invsqrta+jnrD+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-            vdwjidx0B        = 2*vdwtype[jnrB+0];
-            vdwjidx0C        = 2*vdwtype[jnrC+0];
-            vdwjidx0D        = 2*vdwtype[jnrD+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_ps(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_ps(iq0,jq0);
-            gmx_mm_load_4pair_swizzle_ps(vdwparam+vdwioffset0+vdwjidx0A,
-                                         vdwparam+vdwioffset0+vdwjidx0B,
-                                         vdwparam+vdwioffset0+vdwjidx0C,
-                                         vdwparam+vdwioffset0+vdwjidx0D,
-                                         &c6_00,&c12_00);
-
-            /* Calculate table index by multiplying r with table scale and truncate to integer */
-            rt               = _mm_mul_ps(r00,vftabscale);
-            vfitab           = _mm_cvttps_epi32(rt);
-#ifdef __XOP__
-            vfeps            = _mm_frcz_ps(rt);
-#else
-            vfeps            = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR));
-#endif
-            twovfeps         = _mm_add_ps(vfeps,vfeps);
-            vfitab           = _mm_slli_epi32(vfitab,3);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_ps(isai0,isaj0);
-            gbqqfactor       = _mm_xor_ps(signbit,_mm_mul_ps(qq00,_mm_mul_ps(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_ps(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_ps(r00,gbscale);
-            gbitab           = _mm_cvttps_epi32(rt);
-#ifdef __XOP__
-            gbeps            = _mm_frcz_ps(rt);
-#else
-            gbeps            = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR));
-#endif
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,0) );
-            F                = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,1) );
-            G                = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,2) );
-            H                = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Fp               = _mm_macc_ps(gbeps,_mm_macc_ps(gbeps,H,G),F);
-            VV               = _mm_macc_ps(gbeps,Fp,Y);
-            vgb              = _mm_mul_ps(gbqqfactor,VV);
-
-            twogbeps         = _mm_add_ps(gbeps,gbeps);
-            FF               = _mm_macc_ps(_mm_macc_ps(twogbeps,H,G),gbeps,Fp);
-            fgb              = _mm_mul_ps(gbqqfactor,_mm_mul_ps(FF,gbscale));
-            dvdatmp          = _mm_mul_ps(minushalf,_mm_macc_ps(fgb,r00,vgb));
-            dvdasum          = _mm_add_ps(dvdasum,dvdatmp);
-            fjptrA           = dvda+jnrA;
-            fjptrB           = dvda+jnrB;
-            fjptrC           = dvda+jnrC;
-            fjptrD           = dvda+jnrD;
-            gmx_mm_increment_4real_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,_mm_mul_ps(dvdatmp,_mm_mul_ps(isaj0,isaj0)));
-            velec            = _mm_mul_ps(qq00,rinv00);
-            felec            = _mm_mul_ps(_mm_msub_ps(velec,rinv00,fgb),rinv00);
-
-            /* CUBIC SPLINE TABLE DISPERSION */
-            Y                = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,0) );
-            F                = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,1) );
-            G                = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,2) );
-            H                = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Fp               = _mm_macc_ps(vfeps,_mm_macc_ps(H,vfeps,G),F);
-            VV               = _mm_macc_ps(vfeps,Fp,Y);
-            vvdw6            = _mm_mul_ps(c6_00,VV);
-            FF               = _mm_macc_ps(vfeps,_mm_macc_ps(twovfeps,H,G),Fp);
-            fvdw6            = _mm_mul_ps(c6_00,FF);
-
-            /* CUBIC SPLINE TABLE REPULSION */
-            vfitab           = _mm_add_epi32(vfitab,ifour);
-            Y                = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,0) );
-            F                = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,1) );
-            G                = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,2) );
-            H                = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Fp               = _mm_macc_ps(vfeps,_mm_macc_ps(H,vfeps,G),F);
-            VV               = _mm_macc_ps(vfeps,Fp,Y);
-            vvdw12           = _mm_mul_ps(c12_00,VV);
-            FF               = _mm_macc_ps(vfeps,_mm_macc_ps(twovfeps,H,G),Fp);
-            fvdw12           = _mm_mul_ps(c12_00,FF);
-            vvdw             = _mm_add_ps(vvdw12,vvdw6);
-            fvdw             = _mm_xor_ps(signbit,_mm_mul_ps(_mm_add_ps(fvdw6,fvdw12),_mm_mul_ps(vftabscale,rinv00)));
-
-            /* Update potential sum for this i atom from the interaction with this j atom. */
-            velecsum         = _mm_add_ps(velecsum,velec);
-            vgbsum           = _mm_add_ps(vgbsum,vgb);
-            vvdwsum          = _mm_add_ps(vvdwsum,vvdw);
-
-            fscal            = _mm_add_ps(felec,fvdw);
-
-             /* Update vectorial force */
-            fix0             = _mm_macc_ps(dx00,fscal,fix0);
-            fiy0             = _mm_macc_ps(dy00,fscal,fiy0);
-            fiz0             = _mm_macc_ps(dz00,fscal,fiz0);
-
-            fjptrA             = f+j_coord_offsetA;
-            fjptrB             = f+j_coord_offsetB;
-            fjptrC             = f+j_coord_offsetC;
-            fjptrD             = f+j_coord_offsetD;
-            gmx_mm_decrement_1rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,
-                                                   _mm_mul_ps(dx00,fscal),
-                                                   _mm_mul_ps(dy00,fscal),
-                                                   _mm_mul_ps(dz00,fscal));
-
-            /* Inner loop uses 95 flops */
-        }
-
-        if(jidx<j_index_end)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrlistA         = jjnr[jidx];
-            jnrlistB         = jjnr[jidx+1];
-            jnrlistC         = jjnr[jidx+2];
-            jnrlistD         = jjnr[jidx+3];
-            /* Sign of each element will be negative for non-real atoms.
-             * This mask will be 0xFFFFFFFF for dummy entries and 0x0 for real ones,
-             * so use it as val = _mm_andnot_ps(mask,val) to clear dummy entries.
-             */
-            dummy_mask = gmx_mm_castsi128_ps(_mm_cmplt_epi32(_mm_loadu_si128((const __m128i *)(jjnr+jidx)),_mm_setzero_si128()));
-            jnrA       = (jnrlistA>=0) ? jnrlistA : 0;
-            jnrB       = (jnrlistB>=0) ? jnrlistB : 0;
-            jnrC       = (jnrlistC>=0) ? jnrlistC : 0;
-            jnrD       = (jnrlistD>=0) ? jnrlistD : 0;
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              x+j_coord_offsetC,x+j_coord_offsetD,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_ps(ix0,jx0);
-            dy00             = _mm_sub_ps(iy0,jy0);
-            dz00             = _mm_sub_ps(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
-
-            rinv00           = avx128fma_invsqrt_f(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm_load_4real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
-                                                              charge+jnrC+0,charge+jnrD+0);
-            isaj0            = gmx_mm_load_4real_swizzle_ps(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                              invsqrta+jnrC+0,invsqrta+jnrD+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-            vdwjidx0B        = 2*vdwtype[jnrB+0];
-            vdwjidx0C        = 2*vdwtype[jnrC+0];
-            vdwjidx0D        = 2*vdwtype[jnrD+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_ps(rsq00,rinv00);
-            r00              = _mm_andnot_ps(dummy_mask,r00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_ps(iq0,jq0);
-            gmx_mm_load_4pair_swizzle_ps(vdwparam+vdwioffset0+vdwjidx0A,
-                                         vdwparam+vdwioffset0+vdwjidx0B,
-                                         vdwparam+vdwioffset0+vdwjidx0C,
-                                         vdwparam+vdwioffset0+vdwjidx0D,
-                                         &c6_00,&c12_00);
-
-            /* Calculate table index by multiplying r with table scale and truncate to integer */
-            rt               = _mm_mul_ps(r00,vftabscale);
-            vfitab           = _mm_cvttps_epi32(rt);
-#ifdef __XOP__
-            vfeps            = _mm_frcz_ps(rt);
-#else
-            vfeps            = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR));
-#endif
-            twovfeps         = _mm_add_ps(vfeps,vfeps);
-            vfitab           = _mm_slli_epi32(vfitab,3);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_ps(isai0,isaj0);
-            gbqqfactor       = _mm_xor_ps(signbit,_mm_mul_ps(qq00,_mm_mul_ps(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_ps(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_ps(r00,gbscale);
-            gbitab           = _mm_cvttps_epi32(rt);
-#ifdef __XOP__
-            gbeps            = _mm_frcz_ps(rt);
-#else
-            gbeps            = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR));
-#endif
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,0) );
-            F                = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,1) );
-            G                = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,2) );
-            H                = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Fp               = _mm_macc_ps(gbeps,_mm_macc_ps(gbeps,H,G),F);
-            VV               = _mm_macc_ps(gbeps,Fp,Y);
-            vgb              = _mm_mul_ps(gbqqfactor,VV);
-
-            twogbeps         = _mm_add_ps(gbeps,gbeps);
-            FF               = _mm_macc_ps(_mm_macc_ps(twogbeps,H,G),gbeps,Fp);
-            fgb              = _mm_mul_ps(gbqqfactor,_mm_mul_ps(FF,gbscale));
-            dvdatmp          = _mm_mul_ps(minushalf,_mm_macc_ps(fgb,r00,vgb));
-            dvdatmp          = _mm_andnot_ps(dummy_mask,dvdatmp);
-            dvdasum          = _mm_add_ps(dvdasum,dvdatmp);
-            /* The pointers to scratch make sure that this code with compilers that take gmx_restrict seriously (e.g. icc 13) really can't screw things up. */
-            fjptrA             = (jnrlistA>=0) ? dvda+jnrA : scratch;
-            fjptrB             = (jnrlistB>=0) ? dvda+jnrB : scratch;
-            fjptrC             = (jnrlistC>=0) ? dvda+jnrC : scratch;
-            fjptrD             = (jnrlistD>=0) ? dvda+jnrD : scratch;
-            gmx_mm_increment_4real_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,_mm_mul_ps(dvdatmp,_mm_mul_ps(isaj0,isaj0)));
-            velec            = _mm_mul_ps(qq00,rinv00);
-            felec            = _mm_mul_ps(_mm_msub_ps(velec,rinv00,fgb),rinv00);
-
-            /* CUBIC SPLINE TABLE DISPERSION */
-            Y                = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,0) );
-            F                = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,1) );
-            G                = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,2) );
-            H                = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Fp               = _mm_macc_ps(vfeps,_mm_macc_ps(H,vfeps,G),F);
-            VV               = _mm_macc_ps(vfeps,Fp,Y);
-            vvdw6            = _mm_mul_ps(c6_00,VV);
-            FF               = _mm_macc_ps(vfeps,_mm_macc_ps(twovfeps,H,G),Fp);
-            fvdw6            = _mm_mul_ps(c6_00,FF);
-
-            /* CUBIC SPLINE TABLE REPULSION */
-            vfitab           = _mm_add_epi32(vfitab,ifour);
-            Y                = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,0) );
-            F                = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,1) );
-            G                = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,2) );
-            H                = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Fp               = _mm_macc_ps(vfeps,_mm_macc_ps(H,vfeps,G),F);
-            VV               = _mm_macc_ps(vfeps,Fp,Y);
-            vvdw12           = _mm_mul_ps(c12_00,VV);
-            FF               = _mm_macc_ps(vfeps,_mm_macc_ps(twovfeps,H,G),Fp);
-            fvdw12           = _mm_mul_ps(c12_00,FF);
-            vvdw             = _mm_add_ps(vvdw12,vvdw6);
-            fvdw             = _mm_xor_ps(signbit,_mm_mul_ps(_mm_add_ps(fvdw6,fvdw12),_mm_mul_ps(vftabscale,rinv00)));
-
-            /* Update potential sum for this i atom from the interaction with this j atom. */
-            velec            = _mm_andnot_ps(dummy_mask,velec);
-            velecsum         = _mm_add_ps(velecsum,velec);
-            vgb              = _mm_andnot_ps(dummy_mask,vgb);
-            vgbsum           = _mm_add_ps(vgbsum,vgb);
-            vvdw             = _mm_andnot_ps(dummy_mask,vvdw);
-            vvdwsum          = _mm_add_ps(vvdwsum,vvdw);
-
-            fscal            = _mm_add_ps(felec,fvdw);
-
-            fscal            = _mm_andnot_ps(dummy_mask,fscal);
-
-             /* Update vectorial force */
-            fix0             = _mm_macc_ps(dx00,fscal,fix0);
-            fiy0             = _mm_macc_ps(dy00,fscal,fiy0);
-            fiz0             = _mm_macc_ps(dz00,fscal,fiz0);
-
-            fjptrA             = (jnrlistA>=0) ? f+j_coord_offsetA : scratch;
-            fjptrB             = (jnrlistB>=0) ? f+j_coord_offsetB : scratch;
-            fjptrC             = (jnrlistC>=0) ? f+j_coord_offsetC : scratch;
-            fjptrD             = (jnrlistD>=0) ? f+j_coord_offsetD : scratch;
-            gmx_mm_decrement_1rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,
-                                                   _mm_mul_ps(dx00,fscal),
-                                                   _mm_mul_ps(dy00,fscal),
-                                                   _mm_mul_ps(dz00,fscal));
-
-            /* Inner loop uses 96 flops */
-        }
-
-        /* End of innermost loop */
-
-        gmx_mm_update_iforce_1atom_swizzle_ps(fix0,fiy0,fiz0,
-                                              f+i_coord_offset,fshift+i_shift_offset);
-
-        ggid                        = gid[iidx];
-        /* Update potential energies */
-        gmx_mm_update_1pot_ps(velecsum,kernel_data->energygrp_elec+ggid);
-        gmx_mm_update_1pot_ps(vgbsum,kernel_data->energygrp_polarization+ggid);
-        gmx_mm_update_1pot_ps(vvdwsum,kernel_data->energygrp_vdw+ggid);
-        dvdasum = _mm_mul_ps(dvdasum, _mm_mul_ps(isai0,isai0));
-        gmx_mm_update_1pot_ps(dvdasum,dvda+inr);
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 10 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_VF,outeriter*10 + inneriter*96);
-}
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_avx_128_fma_single
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            CubicSplineTable
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        Force
- */
-void
-nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_avx_128_fma_single
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
-     * just 0 for non-waters.
-     * Suffixes A,B,C,D refer to j loop unrolling done with AVX_128, e.g. for the four different
-     * jnr indices corresponding to data put in the four positions in the SIMD register.
-     */
-    int              i_shift_offset,i_coord_offset,outeriter,inneriter;
-    int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
-    int              jnrA,jnrB,jnrC,jnrD;
-    int              jnrlistA,jnrlistB,jnrlistC,jnrlistD;
-    int              j_coord_offsetA,j_coord_offsetB,j_coord_offsetC,j_coord_offsetD;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             rcutoff_scalar;
-    real             *shiftvec,*fshift,*x,*f;
-    real             *fjptrA,*fjptrB,*fjptrC,*fjptrD;
-    real             scratch[4*DIM];
-    __m128           fscal,rcutoff,rcutoff2,jidxall;
-    int              vdwioffset0;
-    __m128           ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0A,vdwjidx0B,vdwjidx0C,vdwjidx0D;
-    __m128           jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    __m128           dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
-    __m128           velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    __m128i          gbitab;
-    __m128           vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,gbeps,twogbeps,dvdatmp;
-    __m128           minushalf = _mm_set1_ps(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    int              nvdwtype;
-    __m128           rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
-    int              *vdwtype;
-    real             *vdwparam;
-    __m128           one_sixth   = _mm_set1_ps(1.0/6.0);
-    __m128           one_twelfth = _mm_set1_ps(1.0/12.0);
-    __m128i          vfitab;
-    __m128i          ifour       = _mm_set1_epi32(4);
-    __m128           rt,vfeps,twovfeps,vftabscale,Y,F,G,H,Fp,VV,FF;
-    real             *vftab;
-    __m128           dummy_mask,cutoff_mask;
-    __m128           signbit = _mm_castsi128_ps( _mm_set1_epi32(0x80000000) );
-    __m128           one     = _mm_set1_ps(1.0);
-    __m128           two     = _mm_set1_ps(2.0);
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = _mm_set1_ps(fr->ic->epsfac);
-    charge           = mdatoms->chargeA;
-    nvdwtype         = fr->ntype;
-    vdwparam         = fr->nbfp;
-    vdwtype          = mdatoms->typeA;
-
-    vftab            = kernel_data->table_vdw->data;
-    vftabscale       = _mm_set1_ps(kernel_data->table_vdw->scale);
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = _mm_set1_ps(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = _mm_set1_ps((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-
-    /* Avoid stupid compiler warnings */
-    jnrA = jnrB = jnrC = jnrD = 0;
-    j_coord_offsetA = 0;
-    j_coord_offsetB = 0;
-    j_coord_offsetC = 0;
-    j_coord_offsetD = 0;
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    for(iidx=0;iidx<4*DIM;iidx++)
-    {
-        scratch[iidx] = 0.0;
-    }
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        gmx_mm_load_shift_and_1rvec_broadcast_ps(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
-
-        fix0             = _mm_setzero_ps();
-        fiy0             = _mm_setzero_ps();
-        fiz0             = _mm_setzero_ps();
-
-        /* Load parameters for i particles */
-        iq0              = _mm_mul_ps(facel,_mm_load1_ps(charge+inr+0));
-        isai0            = _mm_load1_ps(invsqrta+inr+0);
-        vdwioffset0      = 2*nvdwtype*vdwtype[inr+0];
-
-        dvdasum          = _mm_setzero_ps();
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end && jjnr[jidx+3]>=0; jidx+=4)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrA             = jjnr[jidx];
-            jnrB             = jjnr[jidx+1];
-            jnrC             = jjnr[jidx+2];
-            jnrD             = jjnr[jidx+3];
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              x+j_coord_offsetC,x+j_coord_offsetD,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_ps(ix0,jx0);
-            dy00             = _mm_sub_ps(iy0,jy0);
-            dz00             = _mm_sub_ps(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
-
-            rinv00           = avx128fma_invsqrt_f(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm_load_4real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
-                                                              charge+jnrC+0,charge+jnrD+0);
-            isaj0            = gmx_mm_load_4real_swizzle_ps(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                              invsqrta+jnrC+0,invsqrta+jnrD+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-            vdwjidx0B        = 2*vdwtype[jnrB+0];
-            vdwjidx0C        = 2*vdwtype[jnrC+0];
-            vdwjidx0D        = 2*vdwtype[jnrD+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_ps(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_ps(iq0,jq0);
-            gmx_mm_load_4pair_swizzle_ps(vdwparam+vdwioffset0+vdwjidx0A,
-                                         vdwparam+vdwioffset0+vdwjidx0B,
-                                         vdwparam+vdwioffset0+vdwjidx0C,
-                                         vdwparam+vdwioffset0+vdwjidx0D,
-                                         &c6_00,&c12_00);
-
-            /* Calculate table index by multiplying r with table scale and truncate to integer */
-            rt               = _mm_mul_ps(r00,vftabscale);
-            vfitab           = _mm_cvttps_epi32(rt);
-#ifdef __XOP__
-            vfeps            = _mm_frcz_ps(rt);
-#else
-            vfeps            = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR));
-#endif
-            twovfeps         = _mm_add_ps(vfeps,vfeps);
-            vfitab           = _mm_slli_epi32(vfitab,3);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_ps(isai0,isaj0);
-            gbqqfactor       = _mm_xor_ps(signbit,_mm_mul_ps(qq00,_mm_mul_ps(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_ps(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_ps(r00,gbscale);
-            gbitab           = _mm_cvttps_epi32(rt);
-#ifdef __XOP__
-            gbeps            = _mm_frcz_ps(rt);
-#else
-            gbeps            = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR));
-#endif
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,0) );
-            F                = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,1) );
-            G                = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,2) );
-            H                = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Fp               = _mm_macc_ps(gbeps,_mm_macc_ps(gbeps,H,G),F);
-            VV               = _mm_macc_ps(gbeps,Fp,Y);
-            vgb              = _mm_mul_ps(gbqqfactor,VV);
-
-            twogbeps         = _mm_add_ps(gbeps,gbeps);
-            FF               = _mm_macc_ps(_mm_macc_ps(twogbeps,H,G),gbeps,Fp);
-            fgb              = _mm_mul_ps(gbqqfactor,_mm_mul_ps(FF,gbscale));
-            dvdatmp          = _mm_mul_ps(minushalf,_mm_macc_ps(fgb,r00,vgb));
-            dvdasum          = _mm_add_ps(dvdasum,dvdatmp);
-            fjptrA           = dvda+jnrA;
-            fjptrB           = dvda+jnrB;
-            fjptrC           = dvda+jnrC;
-            fjptrD           = dvda+jnrD;
-            gmx_mm_increment_4real_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,_mm_mul_ps(dvdatmp,_mm_mul_ps(isaj0,isaj0)));
-            velec            = _mm_mul_ps(qq00,rinv00);
-            felec            = _mm_mul_ps(_mm_msub_ps(velec,rinv00,fgb),rinv00);
-
-            /* CUBIC SPLINE TABLE DISPERSION */
-            Y                = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,0) );
-            F                = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,1) );
-            G                = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,2) );
-            H                = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Fp               = _mm_macc_ps(vfeps,_mm_macc_ps(H,vfeps,G),F);
-            FF               = _mm_macc_ps(vfeps,_mm_macc_ps(twovfeps,H,G),Fp);
-            fvdw6            = _mm_mul_ps(c6_00,FF);
-
-            /* CUBIC SPLINE TABLE REPULSION */
-            vfitab           = _mm_add_epi32(vfitab,ifour);
-            Y                = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,0) );
-            F                = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,1) );
-            G                = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,2) );
-            H                = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Fp               = _mm_macc_ps(vfeps,_mm_macc_ps(H,vfeps,G),F);
-            FF               = _mm_macc_ps(vfeps,_mm_macc_ps(twovfeps,H,G),Fp);
-            fvdw12           = _mm_mul_ps(c12_00,FF);
-            fvdw             = _mm_xor_ps(signbit,_mm_mul_ps(_mm_add_ps(fvdw6,fvdw12),_mm_mul_ps(vftabscale,rinv00)));
-
-            fscal            = _mm_add_ps(felec,fvdw);
-
-             /* Update vectorial force */
-            fix0             = _mm_macc_ps(dx00,fscal,fix0);
-            fiy0             = _mm_macc_ps(dy00,fscal,fiy0);
-            fiz0             = _mm_macc_ps(dz00,fscal,fiz0);
-
-            fjptrA             = f+j_coord_offsetA;
-            fjptrB             = f+j_coord_offsetB;
-            fjptrC             = f+j_coord_offsetC;
-            fjptrD             = f+j_coord_offsetD;
-            gmx_mm_decrement_1rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,
-                                                   _mm_mul_ps(dx00,fscal),
-                                                   _mm_mul_ps(dy00,fscal),
-                                                   _mm_mul_ps(dz00,fscal));
-
-            /* Inner loop uses 85 flops */
-        }
-
-        if(jidx<j_index_end)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrlistA         = jjnr[jidx];
-            jnrlistB         = jjnr[jidx+1];
-            jnrlistC         = jjnr[jidx+2];
-            jnrlistD         = jjnr[jidx+3];
-            /* Sign of each element will be negative for non-real atoms.
-             * This mask will be 0xFFFFFFFF for dummy entries and 0x0 for real ones,
-             * so use it as val = _mm_andnot_ps(mask,val) to clear dummy entries.
-             */
-            dummy_mask = gmx_mm_castsi128_ps(_mm_cmplt_epi32(_mm_loadu_si128((const __m128i *)(jjnr+jidx)),_mm_setzero_si128()));
-            jnrA       = (jnrlistA>=0) ? jnrlistA : 0;
-            jnrB       = (jnrlistB>=0) ? jnrlistB : 0;
-            jnrC       = (jnrlistC>=0) ? jnrlistC : 0;
-            jnrD       = (jnrlistD>=0) ? jnrlistD : 0;
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              x+j_coord_offsetC,x+j_coord_offsetD,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_ps(ix0,jx0);
-            dy00             = _mm_sub_ps(iy0,jy0);
-            dz00             = _mm_sub_ps(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
-
-            rinv00           = avx128fma_invsqrt_f(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm_load_4real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
-                                                              charge+jnrC+0,charge+jnrD+0);
-            isaj0            = gmx_mm_load_4real_swizzle_ps(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                              invsqrta+jnrC+0,invsqrta+jnrD+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-            vdwjidx0B        = 2*vdwtype[jnrB+0];
-            vdwjidx0C        = 2*vdwtype[jnrC+0];
-            vdwjidx0D        = 2*vdwtype[jnrD+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_ps(rsq00,rinv00);
-            r00              = _mm_andnot_ps(dummy_mask,r00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_ps(iq0,jq0);
-            gmx_mm_load_4pair_swizzle_ps(vdwparam+vdwioffset0+vdwjidx0A,
-                                         vdwparam+vdwioffset0+vdwjidx0B,
-                                         vdwparam+vdwioffset0+vdwjidx0C,
-                                         vdwparam+vdwioffset0+vdwjidx0D,
-                                         &c6_00,&c12_00);
-
-            /* Calculate table index by multiplying r with table scale and truncate to integer */
-            rt               = _mm_mul_ps(r00,vftabscale);
-            vfitab           = _mm_cvttps_epi32(rt);
-#ifdef __XOP__
-            vfeps            = _mm_frcz_ps(rt);
-#else
-            vfeps            = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR));
-#endif
-            twovfeps         = _mm_add_ps(vfeps,vfeps);
-            vfitab           = _mm_slli_epi32(vfitab,3);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_ps(isai0,isaj0);
-            gbqqfactor       = _mm_xor_ps(signbit,_mm_mul_ps(qq00,_mm_mul_ps(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_ps(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_ps(r00,gbscale);
-            gbitab           = _mm_cvttps_epi32(rt);
-#ifdef __XOP__
-            gbeps            = _mm_frcz_ps(rt);
-#else
-            gbeps            = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR));
-#endif
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,0) );
-            F                = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,1) );
-            G                = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,2) );
-            H                = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Fp               = _mm_macc_ps(gbeps,_mm_macc_ps(gbeps,H,G),F);
-            VV               = _mm_macc_ps(gbeps,Fp,Y);
-            vgb              = _mm_mul_ps(gbqqfactor,VV);
-
-            twogbeps         = _mm_add_ps(gbeps,gbeps);
-            FF               = _mm_macc_ps(_mm_macc_ps(twogbeps,H,G),gbeps,Fp);
-            fgb              = _mm_mul_ps(gbqqfactor,_mm_mul_ps(FF,gbscale));
-            dvdatmp          = _mm_mul_ps(minushalf,_mm_macc_ps(fgb,r00,vgb));
-            dvdatmp          = _mm_andnot_ps(dummy_mask,dvdatmp);
-            dvdasum          = _mm_add_ps(dvdasum,dvdatmp);
-            /* The pointers to scratch make sure that this code with compilers that take gmx_restrict seriously (e.g. icc 13) really can't screw things up. */
-            fjptrA             = (jnrlistA>=0) ? dvda+jnrA : scratch;
-            fjptrB             = (jnrlistB>=0) ? dvda+jnrB : scratch;
-            fjptrC             = (jnrlistC>=0) ? dvda+jnrC : scratch;
-            fjptrD             = (jnrlistD>=0) ? dvda+jnrD : scratch;
-            gmx_mm_increment_4real_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,_mm_mul_ps(dvdatmp,_mm_mul_ps(isaj0,isaj0)));
-            velec            = _mm_mul_ps(qq00,rinv00);
-            felec            = _mm_mul_ps(_mm_msub_ps(velec,rinv00,fgb),rinv00);
-
-            /* CUBIC SPLINE TABLE DISPERSION */
-            Y                = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,0) );
-            F                = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,1) );
-            G                = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,2) );
-            H                = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Fp               = _mm_macc_ps(vfeps,_mm_macc_ps(H,vfeps,G),F);
-            FF               = _mm_macc_ps(vfeps,_mm_macc_ps(twovfeps,H,G),Fp);
-            fvdw6            = _mm_mul_ps(c6_00,FF);
-
-            /* CUBIC SPLINE TABLE REPULSION */
-            vfitab           = _mm_add_epi32(vfitab,ifour);
-            Y                = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,0) );
-            F                = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,1) );
-            G                = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,2) );
-            H                = _mm_load_ps( vftab + _mm_extract_epi32(vfitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Fp               = _mm_macc_ps(vfeps,_mm_macc_ps(H,vfeps,G),F);
-            FF               = _mm_macc_ps(vfeps,_mm_macc_ps(twovfeps,H,G),Fp);
-            fvdw12           = _mm_mul_ps(c12_00,FF);
-            fvdw             = _mm_xor_ps(signbit,_mm_mul_ps(_mm_add_ps(fvdw6,fvdw12),_mm_mul_ps(vftabscale,rinv00)));
-
-            fscal            = _mm_add_ps(felec,fvdw);
-
-            fscal            = _mm_andnot_ps(dummy_mask,fscal);
-
-             /* Update vectorial force */
-            fix0             = _mm_macc_ps(dx00,fscal,fix0);
-            fiy0             = _mm_macc_ps(dy00,fscal,fiy0);
-            fiz0             = _mm_macc_ps(dz00,fscal,fiz0);
-
-            fjptrA             = (jnrlistA>=0) ? f+j_coord_offsetA : scratch;
-            fjptrB             = (jnrlistB>=0) ? f+j_coord_offsetB : scratch;
-            fjptrC             = (jnrlistC>=0) ? f+j_coord_offsetC : scratch;
-            fjptrD             = (jnrlistD>=0) ? f+j_coord_offsetD : scratch;
-            gmx_mm_decrement_1rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,
-                                                   _mm_mul_ps(dx00,fscal),
-                                                   _mm_mul_ps(dy00,fscal),
-                                                   _mm_mul_ps(dz00,fscal));
-
-            /* Inner loop uses 86 flops */
-        }
-
-        /* End of innermost loop */
-
-        gmx_mm_update_iforce_1atom_swizzle_ps(fix0,fiy0,fiz0,
-                                              f+i_coord_offset,fshift+i_shift_offset);
-
-        dvdasum = _mm_mul_ps(dvdasum, _mm_mul_ps(isai0,isai0));
-        gmx_mm_update_1pot_ps(dvdasum,dvda+inr);
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 7 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_F,outeriter*7 + inneriter*86);
-}
diff --git a/src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecGB_VdwLJ_GeomP1P1_avx_128_fma_single.c b/src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecGB_VdwLJ_GeomP1P1_avx_128_fma_single.c
deleted file mode 100644 (file)
index aa4c0b6..0000000
+++ /dev/null
@@ -1,864 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
- * and including many others, as listed in the AUTHORS file in the
- * top-level source directory and at http://www.gromacs.org.
- *
- * GROMACS is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * GROMACS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GROMACS; if not, see
- * http://www.gnu.org/licenses, or write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
- *
- * If you want to redistribute modifications to GROMACS, please
- * consider that scientific software is very special. Version
- * control is crucial - bugs must be traceable. We will be happy to
- * consider code for inclusion in the official distribution, but
- * derived work must not be called official GROMACS. Details are found
- * in the README & COPYING files - if they are missing, get the
- * official version at http://www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the research papers on the package. Check out http://www.gromacs.org.
- */
-/*
- * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
- */
-#include "gmxpre.h"
-
-#include "config.h"
-
-#include <math.h>
-
-#include "../nb_kernel.h"
-#include "gromacs/gmxlib/nrnb.h"
-
-#include "kernelutil_x86_avx_128_fma_single.h"
-
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_avx_128_fma_single
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            LennardJones
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        PotentialAndForce
- */
-void
-nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_avx_128_fma_single
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
-     * just 0 for non-waters.
-     * Suffixes A,B,C,D refer to j loop unrolling done with AVX_128, e.g. for the four different
-     * jnr indices corresponding to data put in the four positions in the SIMD register.
-     */
-    int              i_shift_offset,i_coord_offset,outeriter,inneriter;
-    int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
-    int              jnrA,jnrB,jnrC,jnrD;
-    int              jnrlistA,jnrlistB,jnrlistC,jnrlistD;
-    int              j_coord_offsetA,j_coord_offsetB,j_coord_offsetC,j_coord_offsetD;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             rcutoff_scalar;
-    real             *shiftvec,*fshift,*x,*f;
-    real             *fjptrA,*fjptrB,*fjptrC,*fjptrD;
-    real             scratch[4*DIM];
-    __m128           fscal,rcutoff,rcutoff2,jidxall;
-    int              vdwioffset0;
-    __m128           ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0A,vdwjidx0B,vdwjidx0C,vdwjidx0D;
-    __m128           jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    __m128           dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
-    __m128           velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    __m128i          gbitab;
-    __m128           vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,gbeps,twogbeps,dvdatmp;
-    __m128           minushalf = _mm_set1_ps(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    int              nvdwtype;
-    __m128           rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
-    int              *vdwtype;
-    real             *vdwparam;
-    __m128           one_sixth   = _mm_set1_ps(1.0/6.0);
-    __m128           one_twelfth = _mm_set1_ps(1.0/12.0);
-    __m128i          vfitab;
-    __m128i          ifour       = _mm_set1_epi32(4);
-    __m128           rt,vfeps,twovfeps,vftabscale,Y,F,G,H,Fp,VV,FF;
-    real             *vftab;
-    __m128           dummy_mask,cutoff_mask;
-    __m128           signbit = _mm_castsi128_ps( _mm_set1_epi32(0x80000000) );
-    __m128           one     = _mm_set1_ps(1.0);
-    __m128           two     = _mm_set1_ps(2.0);
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = _mm_set1_ps(fr->ic->epsfac);
-    charge           = mdatoms->chargeA;
-    nvdwtype         = fr->ntype;
-    vdwparam         = fr->nbfp;
-    vdwtype          = mdatoms->typeA;
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = _mm_set1_ps(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = _mm_set1_ps((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-
-    /* Avoid stupid compiler warnings */
-    jnrA = jnrB = jnrC = jnrD = 0;
-    j_coord_offsetA = 0;
-    j_coord_offsetB = 0;
-    j_coord_offsetC = 0;
-    j_coord_offsetD = 0;
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    for(iidx=0;iidx<4*DIM;iidx++)
-    {
-        scratch[iidx] = 0.0;
-    }
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        gmx_mm_load_shift_and_1rvec_broadcast_ps(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
-
-        fix0             = _mm_setzero_ps();
-        fiy0             = _mm_setzero_ps();
-        fiz0             = _mm_setzero_ps();
-
-        /* Load parameters for i particles */
-        iq0              = _mm_mul_ps(facel,_mm_load1_ps(charge+inr+0));
-        isai0            = _mm_load1_ps(invsqrta+inr+0);
-        vdwioffset0      = 2*nvdwtype*vdwtype[inr+0];
-
-        /* Reset potential sums */
-        velecsum         = _mm_setzero_ps();
-        vgbsum           = _mm_setzero_ps();
-        vvdwsum          = _mm_setzero_ps();
-        dvdasum          = _mm_setzero_ps();
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end && jjnr[jidx+3]>=0; jidx+=4)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrA             = jjnr[jidx];
-            jnrB             = jjnr[jidx+1];
-            jnrC             = jjnr[jidx+2];
-            jnrD             = jjnr[jidx+3];
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              x+j_coord_offsetC,x+j_coord_offsetD,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_ps(ix0,jx0);
-            dy00             = _mm_sub_ps(iy0,jy0);
-            dz00             = _mm_sub_ps(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
-
-            rinv00           = avx128fma_invsqrt_f(rsq00);
-
-            rinvsq00         = _mm_mul_ps(rinv00,rinv00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm_load_4real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
-                                                              charge+jnrC+0,charge+jnrD+0);
-            isaj0            = gmx_mm_load_4real_swizzle_ps(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                              invsqrta+jnrC+0,invsqrta+jnrD+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-            vdwjidx0B        = 2*vdwtype[jnrB+0];
-            vdwjidx0C        = 2*vdwtype[jnrC+0];
-            vdwjidx0D        = 2*vdwtype[jnrD+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_ps(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_ps(iq0,jq0);
-            gmx_mm_load_4pair_swizzle_ps(vdwparam+vdwioffset0+vdwjidx0A,
-                                         vdwparam+vdwioffset0+vdwjidx0B,
-                                         vdwparam+vdwioffset0+vdwjidx0C,
-                                         vdwparam+vdwioffset0+vdwjidx0D,
-                                         &c6_00,&c12_00);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_ps(isai0,isaj0);
-            gbqqfactor       = _mm_xor_ps(signbit,_mm_mul_ps(qq00,_mm_mul_ps(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_ps(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_ps(r00,gbscale);
-            gbitab           = _mm_cvttps_epi32(rt);
-#ifdef __XOP__
-            gbeps            = _mm_frcz_ps(rt);
-#else
-            gbeps            = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR));
-#endif
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,0) );
-            F                = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,1) );
-            G                = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,2) );
-            H                = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Fp               = _mm_macc_ps(gbeps,_mm_macc_ps(gbeps,H,G),F);
-            VV               = _mm_macc_ps(gbeps,Fp,Y);
-            vgb              = _mm_mul_ps(gbqqfactor,VV);
-
-            twogbeps         = _mm_add_ps(gbeps,gbeps);
-            FF               = _mm_macc_ps(_mm_macc_ps(twogbeps,H,G),gbeps,Fp);
-            fgb              = _mm_mul_ps(gbqqfactor,_mm_mul_ps(FF,gbscale));
-            dvdatmp          = _mm_mul_ps(minushalf,_mm_macc_ps(fgb,r00,vgb));
-            dvdasum          = _mm_add_ps(dvdasum,dvdatmp);
-            fjptrA           = dvda+jnrA;
-            fjptrB           = dvda+jnrB;
-            fjptrC           = dvda+jnrC;
-            fjptrD           = dvda+jnrD;
-            gmx_mm_increment_4real_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,_mm_mul_ps(dvdatmp,_mm_mul_ps(isaj0,isaj0)));
-            velec            = _mm_mul_ps(qq00,rinv00);
-            felec            = _mm_mul_ps(_mm_msub_ps(velec,rinv00,fgb),rinv00);
-
-            /* LENNARD-JONES DISPERSION/REPULSION */
-
-            rinvsix          = _mm_mul_ps(_mm_mul_ps(rinvsq00,rinvsq00),rinvsq00);
-            vvdw6            = _mm_mul_ps(c6_00,rinvsix);
-            vvdw12           = _mm_mul_ps(c12_00,_mm_mul_ps(rinvsix,rinvsix));
-            vvdw             = _mm_msub_ps(vvdw12,one_twelfth,_mm_mul_ps(vvdw6,one_sixth));
-            fvdw             = _mm_mul_ps(_mm_sub_ps(vvdw12,vvdw6),rinvsq00);
-
-            /* Update potential sum for this i atom from the interaction with this j atom. */
-            velecsum         = _mm_add_ps(velecsum,velec);
-            vgbsum           = _mm_add_ps(vgbsum,vgb);
-            vvdwsum          = _mm_add_ps(vvdwsum,vvdw);
-
-            fscal            = _mm_add_ps(felec,fvdw);
-
-             /* Update vectorial force */
-            fix0             = _mm_macc_ps(dx00,fscal,fix0);
-            fiy0             = _mm_macc_ps(dy00,fscal,fiy0);
-            fiz0             = _mm_macc_ps(dz00,fscal,fiz0);
-
-            fjptrA             = f+j_coord_offsetA;
-            fjptrB             = f+j_coord_offsetB;
-            fjptrC             = f+j_coord_offsetC;
-            fjptrD             = f+j_coord_offsetD;
-            gmx_mm_decrement_1rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,
-                                                   _mm_mul_ps(dx00,fscal),
-                                                   _mm_mul_ps(dy00,fscal),
-                                                   _mm_mul_ps(dz00,fscal));
-
-            /* Inner loop uses 74 flops */
-        }
-
-        if(jidx<j_index_end)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrlistA         = jjnr[jidx];
-            jnrlistB         = jjnr[jidx+1];
-            jnrlistC         = jjnr[jidx+2];
-            jnrlistD         = jjnr[jidx+3];
-            /* Sign of each element will be negative for non-real atoms.
-             * This mask will be 0xFFFFFFFF for dummy entries and 0x0 for real ones,
-             * so use it as val = _mm_andnot_ps(mask,val) to clear dummy entries.
-             */
-            dummy_mask = gmx_mm_castsi128_ps(_mm_cmplt_epi32(_mm_loadu_si128((const __m128i *)(jjnr+jidx)),_mm_setzero_si128()));
-            jnrA       = (jnrlistA>=0) ? jnrlistA : 0;
-            jnrB       = (jnrlistB>=0) ? jnrlistB : 0;
-            jnrC       = (jnrlistC>=0) ? jnrlistC : 0;
-            jnrD       = (jnrlistD>=0) ? jnrlistD : 0;
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              x+j_coord_offsetC,x+j_coord_offsetD,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_ps(ix0,jx0);
-            dy00             = _mm_sub_ps(iy0,jy0);
-            dz00             = _mm_sub_ps(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
-
-            rinv00           = avx128fma_invsqrt_f(rsq00);
-
-            rinvsq00         = _mm_mul_ps(rinv00,rinv00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm_load_4real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
-                                                              charge+jnrC+0,charge+jnrD+0);
-            isaj0            = gmx_mm_load_4real_swizzle_ps(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                              invsqrta+jnrC+0,invsqrta+jnrD+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-            vdwjidx0B        = 2*vdwtype[jnrB+0];
-            vdwjidx0C        = 2*vdwtype[jnrC+0];
-            vdwjidx0D        = 2*vdwtype[jnrD+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_ps(rsq00,rinv00);
-            r00              = _mm_andnot_ps(dummy_mask,r00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_ps(iq0,jq0);
-            gmx_mm_load_4pair_swizzle_ps(vdwparam+vdwioffset0+vdwjidx0A,
-                                         vdwparam+vdwioffset0+vdwjidx0B,
-                                         vdwparam+vdwioffset0+vdwjidx0C,
-                                         vdwparam+vdwioffset0+vdwjidx0D,
-                                         &c6_00,&c12_00);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_ps(isai0,isaj0);
-            gbqqfactor       = _mm_xor_ps(signbit,_mm_mul_ps(qq00,_mm_mul_ps(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_ps(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_ps(r00,gbscale);
-            gbitab           = _mm_cvttps_epi32(rt);
-#ifdef __XOP__
-            gbeps            = _mm_frcz_ps(rt);
-#else
-            gbeps            = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR));
-#endif
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,0) );
-            F                = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,1) );
-            G                = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,2) );
-            H                = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Fp               = _mm_macc_ps(gbeps,_mm_macc_ps(gbeps,H,G),F);
-            VV               = _mm_macc_ps(gbeps,Fp,Y);
-            vgb              = _mm_mul_ps(gbqqfactor,VV);
-
-            twogbeps         = _mm_add_ps(gbeps,gbeps);
-            FF               = _mm_macc_ps(_mm_macc_ps(twogbeps,H,G),gbeps,Fp);
-            fgb              = _mm_mul_ps(gbqqfactor,_mm_mul_ps(FF,gbscale));
-            dvdatmp          = _mm_mul_ps(minushalf,_mm_macc_ps(fgb,r00,vgb));
-            dvdatmp          = _mm_andnot_ps(dummy_mask,dvdatmp);
-            dvdasum          = _mm_add_ps(dvdasum,dvdatmp);
-            /* The pointers to scratch make sure that this code with compilers that take gmx_restrict seriously (e.g. icc 13) really can't screw things up. */
-            fjptrA             = (jnrlistA>=0) ? dvda+jnrA : scratch;
-            fjptrB             = (jnrlistB>=0) ? dvda+jnrB : scratch;
-            fjptrC             = (jnrlistC>=0) ? dvda+jnrC : scratch;
-            fjptrD             = (jnrlistD>=0) ? dvda+jnrD : scratch;
-            gmx_mm_increment_4real_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,_mm_mul_ps(dvdatmp,_mm_mul_ps(isaj0,isaj0)));
-            velec            = _mm_mul_ps(qq00,rinv00);
-            felec            = _mm_mul_ps(_mm_msub_ps(velec,rinv00,fgb),rinv00);
-
-            /* LENNARD-JONES DISPERSION/REPULSION */
-
-            rinvsix          = _mm_mul_ps(_mm_mul_ps(rinvsq00,rinvsq00),rinvsq00);
-            vvdw6            = _mm_mul_ps(c6_00,rinvsix);
-            vvdw12           = _mm_mul_ps(c12_00,_mm_mul_ps(rinvsix,rinvsix));
-            vvdw             = _mm_msub_ps(vvdw12,one_twelfth,_mm_mul_ps(vvdw6,one_sixth));
-            fvdw             = _mm_mul_ps(_mm_sub_ps(vvdw12,vvdw6),rinvsq00);
-
-            /* Update potential sum for this i atom from the interaction with this j atom. */
-            velec            = _mm_andnot_ps(dummy_mask,velec);
-            velecsum         = _mm_add_ps(velecsum,velec);
-            vgb              = _mm_andnot_ps(dummy_mask,vgb);
-            vgbsum           = _mm_add_ps(vgbsum,vgb);
-            vvdw             = _mm_andnot_ps(dummy_mask,vvdw);
-            vvdwsum          = _mm_add_ps(vvdwsum,vvdw);
-
-            fscal            = _mm_add_ps(felec,fvdw);
-
-            fscal            = _mm_andnot_ps(dummy_mask,fscal);
-
-             /* Update vectorial force */
-            fix0             = _mm_macc_ps(dx00,fscal,fix0);
-            fiy0             = _mm_macc_ps(dy00,fscal,fiy0);
-            fiz0             = _mm_macc_ps(dz00,fscal,fiz0);
-
-            fjptrA             = (jnrlistA>=0) ? f+j_coord_offsetA : scratch;
-            fjptrB             = (jnrlistB>=0) ? f+j_coord_offsetB : scratch;
-            fjptrC             = (jnrlistC>=0) ? f+j_coord_offsetC : scratch;
-            fjptrD             = (jnrlistD>=0) ? f+j_coord_offsetD : scratch;
-            gmx_mm_decrement_1rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,
-                                                   _mm_mul_ps(dx00,fscal),
-                                                   _mm_mul_ps(dy00,fscal),
-                                                   _mm_mul_ps(dz00,fscal));
-
-            /* Inner loop uses 75 flops */
-        }
-
-        /* End of innermost loop */
-
-        gmx_mm_update_iforce_1atom_swizzle_ps(fix0,fiy0,fiz0,
-                                              f+i_coord_offset,fshift+i_shift_offset);
-
-        ggid                        = gid[iidx];
-        /* Update potential energies */
-        gmx_mm_update_1pot_ps(velecsum,kernel_data->energygrp_elec+ggid);
-        gmx_mm_update_1pot_ps(vgbsum,kernel_data->energygrp_polarization+ggid);
-        gmx_mm_update_1pot_ps(vvdwsum,kernel_data->energygrp_vdw+ggid);
-        dvdasum = _mm_mul_ps(dvdasum, _mm_mul_ps(isai0,isai0));
-        gmx_mm_update_1pot_ps(dvdasum,dvda+inr);
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 10 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_VF,outeriter*10 + inneriter*75);
-}
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_avx_128_fma_single
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            LennardJones
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        Force
- */
-void
-nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_avx_128_fma_single
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
-     * just 0 for non-waters.
-     * Suffixes A,B,C,D refer to j loop unrolling done with AVX_128, e.g. for the four different
-     * jnr indices corresponding to data put in the four positions in the SIMD register.
-     */
-    int              i_shift_offset,i_coord_offset,outeriter,inneriter;
-    int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
-    int              jnrA,jnrB,jnrC,jnrD;
-    int              jnrlistA,jnrlistB,jnrlistC,jnrlistD;
-    int              j_coord_offsetA,j_coord_offsetB,j_coord_offsetC,j_coord_offsetD;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             rcutoff_scalar;
-    real             *shiftvec,*fshift,*x,*f;
-    real             *fjptrA,*fjptrB,*fjptrC,*fjptrD;
-    real             scratch[4*DIM];
-    __m128           fscal,rcutoff,rcutoff2,jidxall;
-    int              vdwioffset0;
-    __m128           ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0A,vdwjidx0B,vdwjidx0C,vdwjidx0D;
-    __m128           jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    __m128           dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
-    __m128           velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    __m128i          gbitab;
-    __m128           vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,gbeps,twogbeps,dvdatmp;
-    __m128           minushalf = _mm_set1_ps(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    int              nvdwtype;
-    __m128           rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
-    int              *vdwtype;
-    real             *vdwparam;
-    __m128           one_sixth   = _mm_set1_ps(1.0/6.0);
-    __m128           one_twelfth = _mm_set1_ps(1.0/12.0);
-    __m128i          vfitab;
-    __m128i          ifour       = _mm_set1_epi32(4);
-    __m128           rt,vfeps,twovfeps,vftabscale,Y,F,G,H,Fp,VV,FF;
-    real             *vftab;
-    __m128           dummy_mask,cutoff_mask;
-    __m128           signbit = _mm_castsi128_ps( _mm_set1_epi32(0x80000000) );
-    __m128           one     = _mm_set1_ps(1.0);
-    __m128           two     = _mm_set1_ps(2.0);
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = _mm_set1_ps(fr->ic->epsfac);
-    charge           = mdatoms->chargeA;
-    nvdwtype         = fr->ntype;
-    vdwparam         = fr->nbfp;
-    vdwtype          = mdatoms->typeA;
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = _mm_set1_ps(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = _mm_set1_ps((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-
-    /* Avoid stupid compiler warnings */
-    jnrA = jnrB = jnrC = jnrD = 0;
-    j_coord_offsetA = 0;
-    j_coord_offsetB = 0;
-    j_coord_offsetC = 0;
-    j_coord_offsetD = 0;
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    for(iidx=0;iidx<4*DIM;iidx++)
-    {
-        scratch[iidx] = 0.0;
-    }
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        gmx_mm_load_shift_and_1rvec_broadcast_ps(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
-
-        fix0             = _mm_setzero_ps();
-        fiy0             = _mm_setzero_ps();
-        fiz0             = _mm_setzero_ps();
-
-        /* Load parameters for i particles */
-        iq0              = _mm_mul_ps(facel,_mm_load1_ps(charge+inr+0));
-        isai0            = _mm_load1_ps(invsqrta+inr+0);
-        vdwioffset0      = 2*nvdwtype*vdwtype[inr+0];
-
-        dvdasum          = _mm_setzero_ps();
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end && jjnr[jidx+3]>=0; jidx+=4)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrA             = jjnr[jidx];
-            jnrB             = jjnr[jidx+1];
-            jnrC             = jjnr[jidx+2];
-            jnrD             = jjnr[jidx+3];
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              x+j_coord_offsetC,x+j_coord_offsetD,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_ps(ix0,jx0);
-            dy00             = _mm_sub_ps(iy0,jy0);
-            dz00             = _mm_sub_ps(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
-
-            rinv00           = avx128fma_invsqrt_f(rsq00);
-
-            rinvsq00         = _mm_mul_ps(rinv00,rinv00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm_load_4real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
-                                                              charge+jnrC+0,charge+jnrD+0);
-            isaj0            = gmx_mm_load_4real_swizzle_ps(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                              invsqrta+jnrC+0,invsqrta+jnrD+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-            vdwjidx0B        = 2*vdwtype[jnrB+0];
-            vdwjidx0C        = 2*vdwtype[jnrC+0];
-            vdwjidx0D        = 2*vdwtype[jnrD+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_ps(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_ps(iq0,jq0);
-            gmx_mm_load_4pair_swizzle_ps(vdwparam+vdwioffset0+vdwjidx0A,
-                                         vdwparam+vdwioffset0+vdwjidx0B,
-                                         vdwparam+vdwioffset0+vdwjidx0C,
-                                         vdwparam+vdwioffset0+vdwjidx0D,
-                                         &c6_00,&c12_00);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_ps(isai0,isaj0);
-            gbqqfactor       = _mm_xor_ps(signbit,_mm_mul_ps(qq00,_mm_mul_ps(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_ps(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_ps(r00,gbscale);
-            gbitab           = _mm_cvttps_epi32(rt);
-#ifdef __XOP__
-            gbeps            = _mm_frcz_ps(rt);
-#else
-            gbeps            = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR));
-#endif
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,0) );
-            F                = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,1) );
-            G                = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,2) );
-            H                = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Fp               = _mm_macc_ps(gbeps,_mm_macc_ps(gbeps,H,G),F);
-            VV               = _mm_macc_ps(gbeps,Fp,Y);
-            vgb              = _mm_mul_ps(gbqqfactor,VV);
-
-            twogbeps         = _mm_add_ps(gbeps,gbeps);
-            FF               = _mm_macc_ps(_mm_macc_ps(twogbeps,H,G),gbeps,Fp);
-            fgb              = _mm_mul_ps(gbqqfactor,_mm_mul_ps(FF,gbscale));
-            dvdatmp          = _mm_mul_ps(minushalf,_mm_macc_ps(fgb,r00,vgb));
-            dvdasum          = _mm_add_ps(dvdasum,dvdatmp);
-            fjptrA           = dvda+jnrA;
-            fjptrB           = dvda+jnrB;
-            fjptrC           = dvda+jnrC;
-            fjptrD           = dvda+jnrD;
-            gmx_mm_increment_4real_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,_mm_mul_ps(dvdatmp,_mm_mul_ps(isaj0,isaj0)));
-            velec            = _mm_mul_ps(qq00,rinv00);
-            felec            = _mm_mul_ps(_mm_msub_ps(velec,rinv00,fgb),rinv00);
-
-            /* LENNARD-JONES DISPERSION/REPULSION */
-
-            rinvsix          = _mm_mul_ps(_mm_mul_ps(rinvsq00,rinvsq00),rinvsq00);
-            fvdw             = _mm_mul_ps(_mm_msub_ps(c12_00,rinvsix,c6_00),_mm_mul_ps(rinvsix,rinvsq00));
-
-            fscal            = _mm_add_ps(felec,fvdw);
-
-             /* Update vectorial force */
-            fix0             = _mm_macc_ps(dx00,fscal,fix0);
-            fiy0             = _mm_macc_ps(dy00,fscal,fiy0);
-            fiz0             = _mm_macc_ps(dz00,fscal,fiz0);
-
-            fjptrA             = f+j_coord_offsetA;
-            fjptrB             = f+j_coord_offsetB;
-            fjptrC             = f+j_coord_offsetC;
-            fjptrD             = f+j_coord_offsetD;
-            gmx_mm_decrement_1rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,
-                                                   _mm_mul_ps(dx00,fscal),
-                                                   _mm_mul_ps(dy00,fscal),
-                                                   _mm_mul_ps(dz00,fscal));
-
-            /* Inner loop uses 67 flops */
-        }
-
-        if(jidx<j_index_end)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrlistA         = jjnr[jidx];
-            jnrlistB         = jjnr[jidx+1];
-            jnrlistC         = jjnr[jidx+2];
-            jnrlistD         = jjnr[jidx+3];
-            /* Sign of each element will be negative for non-real atoms.
-             * This mask will be 0xFFFFFFFF for dummy entries and 0x0 for real ones,
-             * so use it as val = _mm_andnot_ps(mask,val) to clear dummy entries.
-             */
-            dummy_mask = gmx_mm_castsi128_ps(_mm_cmplt_epi32(_mm_loadu_si128((const __m128i *)(jjnr+jidx)),_mm_setzero_si128()));
-            jnrA       = (jnrlistA>=0) ? jnrlistA : 0;
-            jnrB       = (jnrlistB>=0) ? jnrlistB : 0;
-            jnrC       = (jnrlistC>=0) ? jnrlistC : 0;
-            jnrD       = (jnrlistD>=0) ? jnrlistD : 0;
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              x+j_coord_offsetC,x+j_coord_offsetD,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_ps(ix0,jx0);
-            dy00             = _mm_sub_ps(iy0,jy0);
-            dz00             = _mm_sub_ps(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
-
-            rinv00           = avx128fma_invsqrt_f(rsq00);
-
-            rinvsq00         = _mm_mul_ps(rinv00,rinv00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm_load_4real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
-                                                              charge+jnrC+0,charge+jnrD+0);
-            isaj0            = gmx_mm_load_4real_swizzle_ps(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                              invsqrta+jnrC+0,invsqrta+jnrD+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-            vdwjidx0B        = 2*vdwtype[jnrB+0];
-            vdwjidx0C        = 2*vdwtype[jnrC+0];
-            vdwjidx0D        = 2*vdwtype[jnrD+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_ps(rsq00,rinv00);
-            r00              = _mm_andnot_ps(dummy_mask,r00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_ps(iq0,jq0);
-            gmx_mm_load_4pair_swizzle_ps(vdwparam+vdwioffset0+vdwjidx0A,
-                                         vdwparam+vdwioffset0+vdwjidx0B,
-                                         vdwparam+vdwioffset0+vdwjidx0C,
-                                         vdwparam+vdwioffset0+vdwjidx0D,
-                                         &c6_00,&c12_00);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_ps(isai0,isaj0);
-            gbqqfactor       = _mm_xor_ps(signbit,_mm_mul_ps(qq00,_mm_mul_ps(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_ps(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_ps(r00,gbscale);
-            gbitab           = _mm_cvttps_epi32(rt);
-#ifdef __XOP__
-            gbeps            = _mm_frcz_ps(rt);
-#else
-            gbeps            = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR));
-#endif
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,0) );
-            F                = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,1) );
-            G                = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,2) );
-            H                = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Fp               = _mm_macc_ps(gbeps,_mm_macc_ps(gbeps,H,G),F);
-            VV               = _mm_macc_ps(gbeps,Fp,Y);
-            vgb              = _mm_mul_ps(gbqqfactor,VV);
-
-            twogbeps         = _mm_add_ps(gbeps,gbeps);
-            FF               = _mm_macc_ps(_mm_macc_ps(twogbeps,H,G),gbeps,Fp);
-            fgb              = _mm_mul_ps(gbqqfactor,_mm_mul_ps(FF,gbscale));
-            dvdatmp          = _mm_mul_ps(minushalf,_mm_macc_ps(fgb,r00,vgb));
-            dvdatmp          = _mm_andnot_ps(dummy_mask,dvdatmp);
-            dvdasum          = _mm_add_ps(dvdasum,dvdatmp);
-            /* The pointers to scratch make sure that this code with compilers that take gmx_restrict seriously (e.g. icc 13) really can't screw things up. */
-            fjptrA             = (jnrlistA>=0) ? dvda+jnrA : scratch;
-            fjptrB             = (jnrlistB>=0) ? dvda+jnrB : scratch;
-            fjptrC             = (jnrlistC>=0) ? dvda+jnrC : scratch;
-            fjptrD             = (jnrlistD>=0) ? dvda+jnrD : scratch;
-            gmx_mm_increment_4real_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,_mm_mul_ps(dvdatmp,_mm_mul_ps(isaj0,isaj0)));
-            velec            = _mm_mul_ps(qq00,rinv00);
-            felec            = _mm_mul_ps(_mm_msub_ps(velec,rinv00,fgb),rinv00);
-
-            /* LENNARD-JONES DISPERSION/REPULSION */
-
-            rinvsix          = _mm_mul_ps(_mm_mul_ps(rinvsq00,rinvsq00),rinvsq00);
-            fvdw             = _mm_mul_ps(_mm_msub_ps(c12_00,rinvsix,c6_00),_mm_mul_ps(rinvsix,rinvsq00));
-
-            fscal            = _mm_add_ps(felec,fvdw);
-
-            fscal            = _mm_andnot_ps(dummy_mask,fscal);
-
-             /* Update vectorial force */
-            fix0             = _mm_macc_ps(dx00,fscal,fix0);
-            fiy0             = _mm_macc_ps(dy00,fscal,fiy0);
-            fiz0             = _mm_macc_ps(dz00,fscal,fiz0);
-
-            fjptrA             = (jnrlistA>=0) ? f+j_coord_offsetA : scratch;
-            fjptrB             = (jnrlistB>=0) ? f+j_coord_offsetB : scratch;
-            fjptrC             = (jnrlistC>=0) ? f+j_coord_offsetC : scratch;
-            fjptrD             = (jnrlistD>=0) ? f+j_coord_offsetD : scratch;
-            gmx_mm_decrement_1rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,
-                                                   _mm_mul_ps(dx00,fscal),
-                                                   _mm_mul_ps(dy00,fscal),
-                                                   _mm_mul_ps(dz00,fscal));
-
-            /* Inner loop uses 68 flops */
-        }
-
-        /* End of innermost loop */
-
-        gmx_mm_update_iforce_1atom_swizzle_ps(fix0,fiy0,fiz0,
-                                              f+i_coord_offset,fshift+i_shift_offset);
-
-        dvdasum = _mm_mul_ps(dvdasum, _mm_mul_ps(isai0,isai0));
-        gmx_mm_update_1pot_ps(dvdasum,dvda+inr);
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 7 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_F,outeriter*7 + inneriter*68);
-}
diff --git a/src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecGB_VdwNone_GeomP1P1_avx_128_fma_single.c b/src/gromacs/gmxlib/nonbonded/nb_kernel_avx_128_fma_single/nb_kernel_ElecGB_VdwNone_GeomP1P1_avx_128_fma_single.c
deleted file mode 100644 (file)
index 737a4e8..0000000
+++ /dev/null
@@ -1,769 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
- * and including many others, as listed in the AUTHORS file in the
- * top-level source directory and at http://www.gromacs.org.
- *
- * GROMACS is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * GROMACS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GROMACS; if not, see
- * http://www.gnu.org/licenses, or write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
- *
- * If you want to redistribute modifications to GROMACS, please
- * consider that scientific software is very special. Version
- * control is crucial - bugs must be traceable. We will be happy to
- * consider code for inclusion in the official distribution, but
- * derived work must not be called official GROMACS. Details are found
- * in the README & COPYING files - if they are missing, get the
- * official version at http://www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the research papers on the package. Check out http://www.gromacs.org.
- */
-/*
- * Note: this file was generated by the GROMACS avx_128_fma_single kernel generator.
- */
-#include "gmxpre.h"
-
-#include "config.h"
-
-#include <math.h>
-
-#include "../nb_kernel.h"
-#include "gromacs/gmxlib/nrnb.h"
-
-#include "kernelutil_x86_avx_128_fma_single.h"
-
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_avx_128_fma_single
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            None
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        PotentialAndForce
- */
-void
-nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_avx_128_fma_single
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
-     * just 0 for non-waters.
-     * Suffixes A,B,C,D refer to j loop unrolling done with AVX_128, e.g. for the four different
-     * jnr indices corresponding to data put in the four positions in the SIMD register.
-     */
-    int              i_shift_offset,i_coord_offset,outeriter,inneriter;
-    int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
-    int              jnrA,jnrB,jnrC,jnrD;
-    int              jnrlistA,jnrlistB,jnrlistC,jnrlistD;
-    int              j_coord_offsetA,j_coord_offsetB,j_coord_offsetC,j_coord_offsetD;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             rcutoff_scalar;
-    real             *shiftvec,*fshift,*x,*f;
-    real             *fjptrA,*fjptrB,*fjptrC,*fjptrD;
-    real             scratch[4*DIM];
-    __m128           fscal,rcutoff,rcutoff2,jidxall;
-    int              vdwioffset0;
-    __m128           ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0A,vdwjidx0B,vdwjidx0C,vdwjidx0D;
-    __m128           jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    __m128           dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
-    __m128           velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    __m128i          gbitab;
-    __m128           vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,gbeps,twogbeps,dvdatmp;
-    __m128           minushalf = _mm_set1_ps(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    __m128i          vfitab;
-    __m128i          ifour       = _mm_set1_epi32(4);
-    __m128           rt,vfeps,twovfeps,vftabscale,Y,F,G,H,Fp,VV,FF;
-    real             *vftab;
-    __m128           dummy_mask,cutoff_mask;
-    __m128           signbit = _mm_castsi128_ps( _mm_set1_epi32(0x80000000) );
-    __m128           one     = _mm_set1_ps(1.0);
-    __m128           two     = _mm_set1_ps(2.0);
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = _mm_set1_ps(fr->ic->epsfac);
-    charge           = mdatoms->chargeA;
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = _mm_set1_ps(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = _mm_set1_ps((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-
-    /* Avoid stupid compiler warnings */
-    jnrA = jnrB = jnrC = jnrD = 0;
-    j_coord_offsetA = 0;
-    j_coord_offsetB = 0;
-    j_coord_offsetC = 0;
-    j_coord_offsetD = 0;
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    for(iidx=0;iidx<4*DIM;iidx++)
-    {
-        scratch[iidx] = 0.0;
-    }
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        gmx_mm_load_shift_and_1rvec_broadcast_ps(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
-
-        fix0             = _mm_setzero_ps();
-        fiy0             = _mm_setzero_ps();
-        fiz0             = _mm_setzero_ps();
-
-        /* Load parameters for i particles */
-        iq0              = _mm_mul_ps(facel,_mm_load1_ps(charge+inr+0));
-        isai0            = _mm_load1_ps(invsqrta+inr+0);
-
-        /* Reset potential sums */
-        velecsum         = _mm_setzero_ps();
-        vgbsum           = _mm_setzero_ps();
-        dvdasum          = _mm_setzero_ps();
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end && jjnr[jidx+3]>=0; jidx+=4)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrA             = jjnr[jidx];
-            jnrB             = jjnr[jidx+1];
-            jnrC             = jjnr[jidx+2];
-            jnrD             = jjnr[jidx+3];
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              x+j_coord_offsetC,x+j_coord_offsetD,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_ps(ix0,jx0);
-            dy00             = _mm_sub_ps(iy0,jy0);
-            dz00             = _mm_sub_ps(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
-
-            rinv00           = avx128fma_invsqrt_f(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm_load_4real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
-                                                              charge+jnrC+0,charge+jnrD+0);
-            isaj0            = gmx_mm_load_4real_swizzle_ps(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                              invsqrta+jnrC+0,invsqrta+jnrD+0);
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_ps(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_ps(iq0,jq0);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_ps(isai0,isaj0);
-            gbqqfactor       = _mm_xor_ps(signbit,_mm_mul_ps(qq00,_mm_mul_ps(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_ps(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_ps(r00,gbscale);
-            gbitab           = _mm_cvttps_epi32(rt);
-#ifdef __XOP__
-            gbeps            = _mm_frcz_ps(rt);
-#else
-            gbeps            = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR));
-#endif
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,0) );
-            F                = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,1) );
-            G                = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,2) );
-            H                = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Fp               = _mm_macc_ps(gbeps,_mm_macc_ps(gbeps,H,G),F);
-            VV               = _mm_macc_ps(gbeps,Fp,Y);
-            vgb              = _mm_mul_ps(gbqqfactor,VV);
-
-            twogbeps         = _mm_add_ps(gbeps,gbeps);
-            FF               = _mm_macc_ps(_mm_macc_ps(twogbeps,H,G),gbeps,Fp);
-            fgb              = _mm_mul_ps(gbqqfactor,_mm_mul_ps(FF,gbscale));
-            dvdatmp          = _mm_mul_ps(minushalf,_mm_macc_ps(fgb,r00,vgb));
-            dvdasum          = _mm_add_ps(dvdasum,dvdatmp);
-            fjptrA           = dvda+jnrA;
-            fjptrB           = dvda+jnrB;
-            fjptrC           = dvda+jnrC;
-            fjptrD           = dvda+jnrD;
-            gmx_mm_increment_4real_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,_mm_mul_ps(dvdatmp,_mm_mul_ps(isaj0,isaj0)));
-            velec            = _mm_mul_ps(qq00,rinv00);
-            felec            = _mm_mul_ps(_mm_msub_ps(velec,rinv00,fgb),rinv00);
-
-            /* Update potential sum for this i atom from the interaction with this j atom. */
-            velecsum         = _mm_add_ps(velecsum,velec);
-            vgbsum           = _mm_add_ps(vgbsum,vgb);
-
-            fscal            = felec;
-
-             /* Update vectorial force */
-            fix0             = _mm_macc_ps(dx00,fscal,fix0);
-            fiy0             = _mm_macc_ps(dy00,fscal,fiy0);
-            fiz0             = _mm_macc_ps(dz00,fscal,fiz0);
-
-            fjptrA             = f+j_coord_offsetA;
-            fjptrB             = f+j_coord_offsetB;
-            fjptrC             = f+j_coord_offsetC;
-            fjptrD             = f+j_coord_offsetD;
-            gmx_mm_decrement_1rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,
-                                                   _mm_mul_ps(dx00,fscal),
-                                                   _mm_mul_ps(dy00,fscal),
-                                                   _mm_mul_ps(dz00,fscal));
-
-            /* Inner loop uses 61 flops */
-        }
-
-        if(jidx<j_index_end)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrlistA         = jjnr[jidx];
-            jnrlistB         = jjnr[jidx+1];
-            jnrlistC         = jjnr[jidx+2];
-            jnrlistD         = jjnr[jidx+3];
-            /* Sign of each element will be negative for non-real atoms.
-             * This mask will be 0xFFFFFFFF for dummy entries and 0x0 for real ones,
-             * so use it as val = _mm_andnot_ps(mask,val) to clear dummy entries.
-             */
-            dummy_mask = gmx_mm_castsi128_ps(_mm_cmplt_epi32(_mm_loadu_si128((const __m128i *)(jjnr+jidx)),_mm_setzero_si128()));
-            jnrA       = (jnrlistA>=0) ? jnrlistA : 0;
-            jnrB       = (jnrlistB>=0) ? jnrlistB : 0;
-            jnrC       = (jnrlistC>=0) ? jnrlistC : 0;
-            jnrD       = (jnrlistD>=0) ? jnrlistD : 0;
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              x+j_coord_offsetC,x+j_coord_offsetD,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_ps(ix0,jx0);
-            dy00             = _mm_sub_ps(iy0,jy0);
-            dz00             = _mm_sub_ps(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
-
-            rinv00           = avx128fma_invsqrt_f(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm_load_4real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
-                                                              charge+jnrC+0,charge+jnrD+0);
-            isaj0            = gmx_mm_load_4real_swizzle_ps(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                              invsqrta+jnrC+0,invsqrta+jnrD+0);
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_ps(rsq00,rinv00);
-            r00              = _mm_andnot_ps(dummy_mask,r00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_ps(iq0,jq0);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_ps(isai0,isaj0);
-            gbqqfactor       = _mm_xor_ps(signbit,_mm_mul_ps(qq00,_mm_mul_ps(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_ps(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_ps(r00,gbscale);
-            gbitab           = _mm_cvttps_epi32(rt);
-#ifdef __XOP__
-            gbeps            = _mm_frcz_ps(rt);
-#else
-            gbeps            = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR));
-#endif
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,0) );
-            F                = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,1) );
-            G                = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,2) );
-            H                = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Fp               = _mm_macc_ps(gbeps,_mm_macc_ps(gbeps,H,G),F);
-            VV               = _mm_macc_ps(gbeps,Fp,Y);
-            vgb              = _mm_mul_ps(gbqqfactor,VV);
-
-            twogbeps         = _mm_add_ps(gbeps,gbeps);
-            FF               = _mm_macc_ps(_mm_macc_ps(twogbeps,H,G),gbeps,Fp);
-            fgb              = _mm_mul_ps(gbqqfactor,_mm_mul_ps(FF,gbscale));
-            dvdatmp          = _mm_mul_ps(minushalf,_mm_macc_ps(fgb,r00,vgb));
-            dvdatmp          = _mm_andnot_ps(dummy_mask,dvdatmp);
-            dvdasum          = _mm_add_ps(dvdasum,dvdatmp);
-            /* The pointers to scratch make sure that this code with compilers that take gmx_restrict seriously (e.g. icc 13) really can't screw things up. */
-            fjptrA             = (jnrlistA>=0) ? dvda+jnrA : scratch;
-            fjptrB             = (jnrlistB>=0) ? dvda+jnrB : scratch;
-            fjptrC             = (jnrlistC>=0) ? dvda+jnrC : scratch;
-            fjptrD             = (jnrlistD>=0) ? dvda+jnrD : scratch;
-            gmx_mm_increment_4real_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,_mm_mul_ps(dvdatmp,_mm_mul_ps(isaj0,isaj0)));
-            velec            = _mm_mul_ps(qq00,rinv00);
-            felec            = _mm_mul_ps(_mm_msub_ps(velec,rinv00,fgb),rinv00);
-
-            /* Update potential sum for this i atom from the interaction with this j atom. */
-            velec            = _mm_andnot_ps(dummy_mask,velec);
-            velecsum         = _mm_add_ps(velecsum,velec);
-            vgb              = _mm_andnot_ps(dummy_mask,vgb);
-            vgbsum           = _mm_add_ps(vgbsum,vgb);
-
-            fscal            = felec;
-
-            fscal            = _mm_andnot_ps(dummy_mask,fscal);
-
-             /* Update vectorial force */
-            fix0             = _mm_macc_ps(dx00,fscal,fix0);
-            fiy0             = _mm_macc_ps(dy00,fscal,fiy0);
-            fiz0             = _mm_macc_ps(dz00,fscal,fiz0);
-
-            fjptrA             = (jnrlistA>=0) ? f+j_coord_offsetA : scratch;
-            fjptrB             = (jnrlistB>=0) ? f+j_coord_offsetB : scratch;
-            fjptrC             = (jnrlistC>=0) ? f+j_coord_offsetC : scratch;
-            fjptrD             = (jnrlistD>=0) ? f+j_coord_offsetD : scratch;
-            gmx_mm_decrement_1rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,
-                                                   _mm_mul_ps(dx00,fscal),
-                                                   _mm_mul_ps(dy00,fscal),
-                                                   _mm_mul_ps(dz00,fscal));
-
-            /* Inner loop uses 62 flops */
-        }
-
-        /* End of innermost loop */
-
-        gmx_mm_update_iforce_1atom_swizzle_ps(fix0,fiy0,fiz0,
-                                              f+i_coord_offset,fshift+i_shift_offset);
-
-        ggid                        = gid[iidx];
-        /* Update potential energies */
-        gmx_mm_update_1pot_ps(velecsum,kernel_data->energygrp_elec+ggid);
-        gmx_mm_update_1pot_ps(vgbsum,kernel_data->energygrp_polarization+ggid);
-        dvdasum = _mm_mul_ps(dvdasum, _mm_mul_ps(isai0,isai0));
-        gmx_mm_update_1pot_ps(dvdasum,dvda+inr);
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 9 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VF,outeriter*9 + inneriter*62);
-}
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwNone_GeomP1P1_F_avx_128_fma_single
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            None
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        Force
- */
-void
-nb_kernel_ElecGB_VdwNone_GeomP1P1_F_avx_128_fma_single
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
-     * just 0 for non-waters.
-     * Suffixes A,B,C,D refer to j loop unrolling done with AVX_128, e.g. for the four different
-     * jnr indices corresponding to data put in the four positions in the SIMD register.
-     */
-    int              i_shift_offset,i_coord_offset,outeriter,inneriter;
-    int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
-    int              jnrA,jnrB,jnrC,jnrD;
-    int              jnrlistA,jnrlistB,jnrlistC,jnrlistD;
-    int              j_coord_offsetA,j_coord_offsetB,j_coord_offsetC,j_coord_offsetD;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             rcutoff_scalar;
-    real             *shiftvec,*fshift,*x,*f;
-    real             *fjptrA,*fjptrB,*fjptrC,*fjptrD;
-    real             scratch[4*DIM];
-    __m128           fscal,rcutoff,rcutoff2,jidxall;
-    int              vdwioffset0;
-    __m128           ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0A,vdwjidx0B,vdwjidx0C,vdwjidx0D;
-    __m128           jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    __m128           dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
-    __m128           velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    __m128i          gbitab;
-    __m128           vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,gbeps,twogbeps,dvdatmp;
-    __m128           minushalf = _mm_set1_ps(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    __m128i          vfitab;
-    __m128i          ifour       = _mm_set1_epi32(4);
-    __m128           rt,vfeps,twovfeps,vftabscale,Y,F,G,H,Fp,VV,FF;
-    real             *vftab;
-    __m128           dummy_mask,cutoff_mask;
-    __m128           signbit = _mm_castsi128_ps( _mm_set1_epi32(0x80000000) );
-    __m128           one     = _mm_set1_ps(1.0);
-    __m128           two     = _mm_set1_ps(2.0);
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = _mm_set1_ps(fr->ic->epsfac);
-    charge           = mdatoms->chargeA;
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = _mm_set1_ps(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = _mm_set1_ps((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-
-    /* Avoid stupid compiler warnings */
-    jnrA = jnrB = jnrC = jnrD = 0;
-    j_coord_offsetA = 0;
-    j_coord_offsetB = 0;
-    j_coord_offsetC = 0;
-    j_coord_offsetD = 0;
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    for(iidx=0;iidx<4*DIM;iidx++)
-    {
-        scratch[iidx] = 0.0;
-    }
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        gmx_mm_load_shift_and_1rvec_broadcast_ps(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
-
-        fix0             = _mm_setzero_ps();
-        fiy0             = _mm_setzero_ps();
-        fiz0             = _mm_setzero_ps();
-
-        /* Load parameters for i particles */
-        iq0              = _mm_mul_ps(facel,_mm_load1_ps(charge+inr+0));
-        isai0            = _mm_load1_ps(invsqrta+inr+0);
-
-        dvdasum          = _mm_setzero_ps();
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end && jjnr[jidx+3]>=0; jidx+=4)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrA             = jjnr[jidx];
-            jnrB             = jjnr[jidx+1];
-            jnrC             = jjnr[jidx+2];
-            jnrD             = jjnr[jidx+3];
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              x+j_coord_offsetC,x+j_coord_offsetD,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_ps(ix0,jx0);
-            dy00             = _mm_sub_ps(iy0,jy0);
-            dz00             = _mm_sub_ps(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
-
-            rinv00           = avx128fma_invsqrt_f(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm_load_4real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
-                                                              charge+jnrC+0,charge+jnrD+0);
-            isaj0            = gmx_mm_load_4real_swizzle_ps(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                              invsqrta+jnrC+0,invsqrta+jnrD+0);
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_ps(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_ps(iq0,jq0);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_ps(isai0,isaj0);
-            gbqqfactor       = _mm_xor_ps(signbit,_mm_mul_ps(qq00,_mm_mul_ps(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_ps(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_ps(r00,gbscale);
-            gbitab           = _mm_cvttps_epi32(rt);
-#ifdef __XOP__
-            gbeps            = _mm_frcz_ps(rt);
-#else
-            gbeps            = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR));
-#endif
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,0) );
-            F                = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,1) );
-            G                = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,2) );
-            H                = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Fp               = _mm_macc_ps(gbeps,_mm_macc_ps(gbeps,H,G),F);
-            VV               = _mm_macc_ps(gbeps,Fp,Y);
-            vgb              = _mm_mul_ps(gbqqfactor,VV);
-
-            twogbeps         = _mm_add_ps(gbeps,gbeps);
-            FF               = _mm_macc_ps(_mm_macc_ps(twogbeps,H,G),gbeps,Fp);
-            fgb              = _mm_mul_ps(gbqqfactor,_mm_mul_ps(FF,gbscale));
-            dvdatmp          = _mm_mul_ps(minushalf,_mm_macc_ps(fgb,r00,vgb));
-            dvdasum          = _mm_add_ps(dvdasum,dvdatmp);
-            fjptrA           = dvda+jnrA;
-            fjptrB           = dvda+jnrB;
-            fjptrC           = dvda+jnrC;
-            fjptrD           = dvda+jnrD;
-            gmx_mm_increment_4real_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,_mm_mul_ps(dvdatmp,_mm_mul_ps(isaj0,isaj0)));
-            velec            = _mm_mul_ps(qq00,rinv00);
-            felec            = _mm_mul_ps(_mm_msub_ps(velec,rinv00,fgb),rinv00);
-
-            fscal            = felec;
-
-             /* Update vectorial force */
-            fix0             = _mm_macc_ps(dx00,fscal,fix0);
-            fiy0             = _mm_macc_ps(dy00,fscal,fiy0);
-            fiz0             = _mm_macc_ps(dz00,fscal,fiz0);
-
-            fjptrA             = f+j_coord_offsetA;
-            fjptrB             = f+j_coord_offsetB;
-            fjptrC             = f+j_coord_offsetC;
-            fjptrD             = f+j_coord_offsetD;
-            gmx_mm_decrement_1rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,
-                                                   _mm_mul_ps(dx00,fscal),
-                                                   _mm_mul_ps(dy00,fscal),
-                                                   _mm_mul_ps(dz00,fscal));
-
-            /* Inner loop uses 59 flops */
-        }
-
-        if(jidx<j_index_end)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrlistA         = jjnr[jidx];
-            jnrlistB         = jjnr[jidx+1];
-            jnrlistC         = jjnr[jidx+2];
-            jnrlistD         = jjnr[jidx+3];
-            /* Sign of each element will be negative for non-real atoms.
-             * This mask will be 0xFFFFFFFF for dummy entries and 0x0 for real ones,
-             * so use it as val = _mm_andnot_ps(mask,val) to clear dummy entries.
-             */
-            dummy_mask = gmx_mm_castsi128_ps(_mm_cmplt_epi32(_mm_loadu_si128((const __m128i *)(jjnr+jidx)),_mm_setzero_si128()));
-            jnrA       = (jnrlistA>=0) ? jnrlistA : 0;
-            jnrB       = (jnrlistB>=0) ? jnrlistB : 0;
-            jnrC       = (jnrlistC>=0) ? jnrlistC : 0;
-            jnrD       = (jnrlistD>=0) ? jnrlistD : 0;
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              x+j_coord_offsetC,x+j_coord_offsetD,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_ps(ix0,jx0);
-            dy00             = _mm_sub_ps(iy0,jy0);
-            dz00             = _mm_sub_ps(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
-
-            rinv00           = avx128fma_invsqrt_f(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm_load_4real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
-                                                              charge+jnrC+0,charge+jnrD+0);
-            isaj0            = gmx_mm_load_4real_swizzle_ps(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                              invsqrta+jnrC+0,invsqrta+jnrD+0);
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_ps(rsq00,rinv00);
-            r00              = _mm_andnot_ps(dummy_mask,r00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_ps(iq0,jq0);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_ps(isai0,isaj0);
-            gbqqfactor       = _mm_xor_ps(signbit,_mm_mul_ps(qq00,_mm_mul_ps(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_ps(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_ps(r00,gbscale);
-            gbitab           = _mm_cvttps_epi32(rt);
-#ifdef __XOP__
-            gbeps            = _mm_frcz_ps(rt);
-#else
-            gbeps            = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR));
-#endif
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,0) );
-            F                = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,1) );
-            G                = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,2) );
-            H                = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Fp               = _mm_macc_ps(gbeps,_mm_macc_ps(gbeps,H,G),F);
-            VV               = _mm_macc_ps(gbeps,Fp,Y);
-            vgb              = _mm_mul_ps(gbqqfactor,VV);
-
-            twogbeps         = _mm_add_ps(gbeps,gbeps);
-            FF               = _mm_macc_ps(_mm_macc_ps(twogbeps,H,G),gbeps,Fp);
-            fgb              = _mm_mul_ps(gbqqfactor,_mm_mul_ps(FF,gbscale));
-            dvdatmp          = _mm_mul_ps(minushalf,_mm_macc_ps(fgb,r00,vgb));
-            dvdatmp          = _mm_andnot_ps(dummy_mask,dvdatmp);
-            dvdasum          = _mm_add_ps(dvdasum,dvdatmp);
-            /* The pointers to scratch make sure that this code with compilers that take gmx_restrict seriously (e.g. icc 13) really can't screw things up. */
-            fjptrA             = (jnrlistA>=0) ? dvda+jnrA : scratch;
-            fjptrB             = (jnrlistB>=0) ? dvda+jnrB : scratch;
-            fjptrC             = (jnrlistC>=0) ? dvda+jnrC : scratch;
-            fjptrD             = (jnrlistD>=0) ? dvda+jnrD : scratch;
-            gmx_mm_increment_4real_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,_mm_mul_ps(dvdatmp,_mm_mul_ps(isaj0,isaj0)));
-            velec            = _mm_mul_ps(qq00,rinv00);
-            felec            = _mm_mul_ps(_mm_msub_ps(velec,rinv00,fgb),rinv00);
-
-            fscal            = felec;
-
-            fscal            = _mm_andnot_ps(dummy_mask,fscal);
-
-             /* Update vectorial force */
-            fix0             = _mm_macc_ps(dx00,fscal,fix0);
-            fiy0             = _mm_macc_ps(dy00,fscal,fiy0);
-            fiz0             = _mm_macc_ps(dz00,fscal,fiz0);
-
-            fjptrA             = (jnrlistA>=0) ? f+j_coord_offsetA : scratch;
-            fjptrB             = (jnrlistB>=0) ? f+j_coord_offsetB : scratch;
-            fjptrC             = (jnrlistC>=0) ? f+j_coord_offsetC : scratch;
-            fjptrD             = (jnrlistD>=0) ? f+j_coord_offsetD : scratch;
-            gmx_mm_decrement_1rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,
-                                                   _mm_mul_ps(dx00,fscal),
-                                                   _mm_mul_ps(dy00,fscal),
-                                                   _mm_mul_ps(dz00,fscal));
-
-            /* Inner loop uses 60 flops */
-        }
-
-        /* End of innermost loop */
-
-        gmx_mm_update_iforce_1atom_swizzle_ps(fix0,fiy0,fiz0,
-                                              f+i_coord_offset,fshift+i_shift_offset);
-
-        dvdasum = _mm_mul_ps(dvdasum, _mm_mul_ps(isai0,isai0));
-        gmx_mm_update_1pot_ps(dvdasum,dvda+inr);
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 7 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_F,outeriter*7 + inneriter*60);
-}
index c87976462a0620421043e59a1727760f43ccc2fb..6489837de042b99ac5b2d6156c681d8ef4bbb9be 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -51,6 +51,36 @@ nb_kernel_t nb_kernel_ElecNone_VdwLJSw_GeomP1P1_VF_avx_128_fma_single;
 nb_kernel_t nb_kernel_ElecNone_VdwLJSw_GeomP1P1_F_avx_128_fma_single;
 nb_kernel_t nb_kernel_ElecNone_VdwCSTab_GeomP1P1_VF_avx_128_fma_single;
 nb_kernel_t nb_kernel_ElecNone_VdwCSTab_GeomP1P1_F_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_avx_128_fma_single;
 nb_kernel_t nb_kernel_ElecEw_VdwLJEw_GeomP1P1_VF_avx_128_fma_single;
 nb_kernel_t nb_kernel_ElecEw_VdwLJEw_GeomP1P1_F_avx_128_fma_single;
 nb_kernel_t nb_kernel_ElecEw_VdwLJEw_GeomW3P1_VF_avx_128_fma_single;
@@ -141,72 +171,6 @@ nb_kernel_t nb_kernel_ElecEwSw_VdwNone_GeomW4P1_VF_avx_128_fma_single;
 nb_kernel_t nb_kernel_ElecEwSw_VdwNone_GeomW4P1_F_avx_128_fma_single;
 nb_kernel_t nb_kernel_ElecEwSw_VdwNone_GeomW4W4_VF_avx_128_fma_single;
 nb_kernel_t nb_kernel_ElecEwSw_VdwNone_GeomW4W4_F_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecGB_VdwNone_GeomP1P1_F_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_avx_128_fma_single;
-nb_kernel_t nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_avx_128_fma_single;
 nb_kernel_t nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_VF_avx_128_fma_single;
 nb_kernel_t nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_F_avx_128_fma_single;
 nb_kernel_t nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_VF_avx_128_fma_single;
@@ -277,6 +241,36 @@ nb_kernel_t nb_kernel_ElecRF_VdwCSTab_GeomW4P1_VF_avx_128_fma_single;
 nb_kernel_t nb_kernel_ElecRF_VdwCSTab_GeomW4P1_F_avx_128_fma_single;
 nb_kernel_t nb_kernel_ElecRF_VdwCSTab_GeomW4W4_VF_avx_128_fma_single;
 nb_kernel_t nb_kernel_ElecRF_VdwCSTab_GeomW4W4_F_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_avx_128_fma_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_avx_128_fma_single;
 
 
 nb_kernel_info_t
@@ -294,6 +288,36 @@ nb_kernel_info_t
     { nb_kernel_ElecNone_VdwLJSw_GeomP1P1_F_avx_128_fma_single, "nb_kernel_ElecNone_VdwLJSw_GeomP1P1_F_avx_128_fma_single", "avx_128_fma_single", "None", "None", "LennardJones", "PotentialSwitch", "ParticleParticle", "", "Force" },
     { nb_kernel_ElecNone_VdwCSTab_GeomP1P1_VF_avx_128_fma_single, "nb_kernel_ElecNone_VdwCSTab_GeomP1P1_VF_avx_128_fma_single", "avx_128_fma_single", "None", "None", "CubicSplineTable", "None", "ParticleParticle", "", "PotentialAndForce" },
     { nb_kernel_ElecNone_VdwCSTab_GeomP1P1_F_avx_128_fma_single, "nb_kernel_ElecNone_VdwCSTab_GeomP1P1_F_avx_128_fma_single", "avx_128_fma_single", "None", "None", "CubicSplineTable", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "LennardJones", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "LennardJones", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "LennardJones", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "LennardJones", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "LennardJones", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "LennardJones", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "LennardJones", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "LennardJones", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "LennardJones", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "LennardJones", "None", "Water4Water4", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "None", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "None", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "None", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "None", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "None", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "None", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "None", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "None", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "None", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "None", "None", "Water4Water4", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Water4", "", "Force" },
     { nb_kernel_ElecEw_VdwLJEw_GeomP1P1_VF_avx_128_fma_single, "nb_kernel_ElecEw_VdwLJEw_GeomP1P1_VF_avx_128_fma_single", "avx_128_fma_single", "Ewald", "None", "LJEwald", "None", "ParticleParticle", "", "PotentialAndForce" },
     { nb_kernel_ElecEw_VdwLJEw_GeomP1P1_F_avx_128_fma_single, "nb_kernel_ElecEw_VdwLJEw_GeomP1P1_F_avx_128_fma_single", "avx_128_fma_single", "Ewald", "None", "LJEwald", "None", "ParticleParticle", "", "Force" },
     { nb_kernel_ElecEw_VdwLJEw_GeomW3P1_VF_avx_128_fma_single, "nb_kernel_ElecEw_VdwLJEw_GeomW3P1_VF_avx_128_fma_single", "avx_128_fma_single", "Ewald", "None", "LJEwald", "None", "Water3Particle", "", "PotentialAndForce" },
@@ -384,72 +408,6 @@ nb_kernel_info_t
     { nb_kernel_ElecEwSw_VdwNone_GeomW4P1_F_avx_128_fma_single, "nb_kernel_ElecEwSw_VdwNone_GeomW4P1_F_avx_128_fma_single", "avx_128_fma_single", "Ewald", "PotentialSwitch", "None", "None", "Water4Particle", "", "Force" },
     { nb_kernel_ElecEwSw_VdwNone_GeomW4W4_VF_avx_128_fma_single, "nb_kernel_ElecEwSw_VdwNone_GeomW4W4_VF_avx_128_fma_single", "avx_128_fma_single", "Ewald", "PotentialSwitch", "None", "None", "Water4Water4", "", "PotentialAndForce" },
     { nb_kernel_ElecEwSw_VdwNone_GeomW4W4_F_avx_128_fma_single, "nb_kernel_ElecEwSw_VdwNone_GeomW4W4_F_avx_128_fma_single", "avx_128_fma_single", "Ewald", "PotentialSwitch", "None", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_avx_128_fma_single, "nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "LennardJones", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_avx_128_fma_single, "nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "LennardJones", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_avx_128_fma_single, "nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "LennardJones", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_avx_128_fma_single, "nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "LennardJones", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_avx_128_fma_single, "nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "LennardJones", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_avx_128_fma_single, "nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "LennardJones", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_avx_128_fma_single, "nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "LennardJones", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_avx_128_fma_single, "nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "LennardJones", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_avx_128_fma_single, "nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "LennardJones", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_avx_128_fma_single, "nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "LennardJones", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_avx_128_fma_single, "nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "None", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_avx_128_fma_single, "nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "None", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_avx_128_fma_single, "nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "None", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_avx_128_fma_single, "nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "None", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_avx_128_fma_single, "nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "None", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_avx_128_fma_single, "nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "None", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_avx_128_fma_single, "nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "None", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_avx_128_fma_single, "nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "None", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_avx_128_fma_single, "nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "None", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_avx_128_fma_single, "nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "None", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_avx_128_fma_single, "nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "CubicSplineTable", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_avx_128_fma_single, "nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "CubicSplineTable", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_avx_128_fma_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "CubicSplineTable", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_avx_128_fma_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "CubicSplineTable", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_avx_128_fma_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "CubicSplineTable", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_avx_128_fma_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "CubicSplineTable", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_avx_128_fma_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "CubicSplineTable", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_avx_128_fma_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "CubicSplineTable", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_avx_128_fma_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "CubicSplineTable", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_avx_128_fma_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "CubicSplineTable", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "LennardJones", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "LennardJones", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "LennardJones", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "LennardJones", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "LennardJones", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "LennardJones", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "LennardJones", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "LennardJones", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "LennardJones", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "LennardJones", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "None", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "None", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "None", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "None", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "None", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "None", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "None", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "None", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "None", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "None", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_avx_128_fma_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_avx_128_fma_single", "avx_128_fma_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_avx_128_fma_single, "nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_avx_128_fma_single", "avx_128_fma_single", "GeneralizedBorn", "None", "LennardJones", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_avx_128_fma_single, "nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_avx_128_fma_single", "avx_128_fma_single", "GeneralizedBorn", "None", "LennardJones", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_avx_128_fma_single, "nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_avx_128_fma_single", "avx_128_fma_single", "GeneralizedBorn", "None", "None", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecGB_VdwNone_GeomP1P1_F_avx_128_fma_single, "nb_kernel_ElecGB_VdwNone_GeomP1P1_F_avx_128_fma_single", "avx_128_fma_single", "GeneralizedBorn", "None", "None", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_avx_128_fma_single, "nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_avx_128_fma_single", "avx_128_fma_single", "GeneralizedBorn", "None", "CubicSplineTable", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_avx_128_fma_single, "nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_avx_128_fma_single", "avx_128_fma_single", "GeneralizedBorn", "None", "CubicSplineTable", "None", "ParticleParticle", "", "Force" },
     { nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_VF_avx_128_fma_single, "nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_VF_avx_128_fma_single", "avx_128_fma_single", "ReactionField", "ExactCutoff", "LennardJones", "PotentialShift", "ParticleParticle", "", "PotentialAndForce" },
     { nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_F_avx_128_fma_single, "nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_F_avx_128_fma_single", "avx_128_fma_single", "ReactionField", "ExactCutoff", "LennardJones", "PotentialShift", "ParticleParticle", "", "Force" },
     { nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_VF_avx_128_fma_single, "nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_VF_avx_128_fma_single", "avx_128_fma_single", "ReactionField", "ExactCutoff", "LennardJones", "PotentialShift", "Water3Particle", "", "PotentialAndForce" },
@@ -519,7 +477,37 @@ nb_kernel_info_t
     { nb_kernel_ElecRF_VdwCSTab_GeomW4P1_VF_avx_128_fma_single, "nb_kernel_ElecRF_VdwCSTab_GeomW4P1_VF_avx_128_fma_single", "avx_128_fma_single", "ReactionField", "None", "CubicSplineTable", "None", "Water4Particle", "", "PotentialAndForce" },
     { nb_kernel_ElecRF_VdwCSTab_GeomW4P1_F_avx_128_fma_single, "nb_kernel_ElecRF_VdwCSTab_GeomW4P1_F_avx_128_fma_single", "avx_128_fma_single", "ReactionField", "None", "CubicSplineTable", "None", "Water4Particle", "", "Force" },
     { nb_kernel_ElecRF_VdwCSTab_GeomW4W4_VF_avx_128_fma_single, "nb_kernel_ElecRF_VdwCSTab_GeomW4W4_VF_avx_128_fma_single", "avx_128_fma_single", "ReactionField", "None", "CubicSplineTable", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecRF_VdwCSTab_GeomW4W4_F_avx_128_fma_single, "nb_kernel_ElecRF_VdwCSTab_GeomW4W4_F_avx_128_fma_single", "avx_128_fma_single", "ReactionField", "None", "CubicSplineTable", "None", "Water4Water4", "", "Force" }
+    { nb_kernel_ElecRF_VdwCSTab_GeomW4W4_F_avx_128_fma_single, "nb_kernel_ElecRF_VdwCSTab_GeomW4W4_F_avx_128_fma_single", "avx_128_fma_single", "ReactionField", "None", "CubicSplineTable", "None", "Water4Water4", "", "Force" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_avx_128_fma_single, "nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "LennardJones", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_avx_128_fma_single, "nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "LennardJones", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_avx_128_fma_single, "nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "LennardJones", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_avx_128_fma_single, "nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "LennardJones", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_avx_128_fma_single, "nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "LennardJones", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_avx_128_fma_single, "nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "LennardJones", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_avx_128_fma_single, "nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "LennardJones", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_avx_128_fma_single, "nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "LennardJones", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_avx_128_fma_single, "nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "LennardJones", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_avx_128_fma_single, "nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "LennardJones", "None", "Water4Water4", "", "Force" },
+    { nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_avx_128_fma_single, "nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "None", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_avx_128_fma_single, "nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "None", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_avx_128_fma_single, "nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "None", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_avx_128_fma_single, "nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "None", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_avx_128_fma_single, "nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "None", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_avx_128_fma_single, "nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "None", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_avx_128_fma_single, "nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "None", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_avx_128_fma_single, "nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "None", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_avx_128_fma_single, "nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "None", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_avx_128_fma_single, "nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "None", "None", "Water4Water4", "", "Force" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_avx_128_fma_single, "nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "CubicSplineTable", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_avx_128_fma_single, "nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "CubicSplineTable", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_avx_128_fma_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "CubicSplineTable", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_avx_128_fma_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "CubicSplineTable", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_avx_128_fma_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "CubicSplineTable", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_avx_128_fma_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "CubicSplineTable", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_avx_128_fma_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "CubicSplineTable", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_avx_128_fma_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "CubicSplineTable", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_avx_128_fma_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "CubicSplineTable", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_avx_128_fma_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_avx_128_fma_single", "avx_128_fma_single", "Coulomb", "None", "CubicSplineTable", "None", "Water4Water4", "", "Force" }
 };
 
 int
index fc3469af5e95d1a4e21319cc7793656af1437b75..29d3517924bc63bb14bb1d8737457ffe2d629caf 100644 (file)
@@ -2,7 +2,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -131,12 +131,6 @@ void
     __m128           velec,felec,velecsum,facel,crf,krf,krf2;
     real             *charge;
     /* #endif */
-    /* #if 'GeneralizedBorn' in KERNEL_ELEC */
-    __m128i          gbitab;
-    __m128           vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,gbeps,twogbeps,dvdatmp;
-    __m128           minushalf = _mm_set1_ps(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    /* #endif */
     /* #if KERNEL_VDW != 'None' */
     int              nvdwtype;
     __m128           rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
@@ -145,7 +139,7 @@ void
     __m128           one_sixth   = _mm_set1_ps(1.0/6.0);
     __m128           one_twelfth = _mm_set1_ps(1.0/12.0);
     /* #endif */
-    /* #if 'Table' in KERNEL_ELEC or 'GeneralizedBorn' in KERNEL_ELEC or 'Table' in KERNEL_VDW */
+    /* #if 'Table' in KERNEL_ELEC or 'Table' in KERNEL_VDW */
     __m128i          vfitab;
     __m128i          ifour       = _mm_set1_epi32(4);
     __m128           rt,vfeps,twovfeps,vftabscale,Y,F,G,H,Fp,VV,FF;
@@ -233,14 +227,6 @@ void
      /*     #endif */
     /* #endif */
 
-    /* #if KERNEL_ELEC=='GeneralizedBorn' */
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = _mm_set1_ps(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = _mm_set1_ps((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-    /* #endif */
-
     /* #if 'Water' in GEOMETRY_I */
     /* Setup water-specific parameters */
     inr              = nlist->iinr[0];
@@ -374,9 +360,6 @@ void
         /*     #for I in PARTICLES_ELEC_I */
         iq{I}              = _mm_mul_ps(facel,_mm_load1_ps(charge+inr+{I}));
         /*         #define OUTERFLOPS OUTERFLOPS+1 */
-        /*         #if KERNEL_ELEC=='GeneralizedBorn' */
-        isai{I}            = _mm_load1_ps(invsqrta+inr+{I});
-        /*         #endif */
         /*     #endfor */
         /*     #for I in PARTICLES_VDW_I */
         vdwioffset{I}      = 2*nvdwtype*vdwtype[inr+{I}];
@@ -388,16 +371,10 @@ void
         /*     #if KERNEL_ELEC != 'None' */
         velecsum         = _mm_setzero_ps();
         /*     #endif */
-        /*     #if 'GeneralizedBorn' in KERNEL_ELEC */
-        vgbsum           = _mm_setzero_ps();
-        /*     #endif */
         /*     #if KERNEL_VDW != 'None' */
         vvdwsum          = _mm_setzero_ps();
         /*     #endif */
         /* #endif */
-        /*     #if 'GeneralizedBorn' in KERNEL_ELEC and 'Force' in KERNEL_VF */
-        dvdasum          = _mm_setzero_ps();
-        /*     #endif */
 
         /* #for ROUND in ['Loop','Epilogue'] */
 
@@ -502,10 +479,6 @@ void
             /*     #for J in PARTICLES_ELEC_J */
             jq{J}              = gmx_mm_load_4real_swizzle_ps(charge+jnrA+{J},charge+jnrB+{J},
                                                               charge+jnrC+{J},charge+jnrD+{J});
-            /*         #if KERNEL_ELEC=='GeneralizedBorn' */
-            isaj{J}            = gmx_mm_load_4real_swizzle_ps(invsqrta+jnrA+{J},invsqrta+jnrB+{J},
-                                                              invsqrta+jnrC+{J},invsqrta+jnrD+{J});
-            /*         #endif */
             /*     #endfor */
             /*     #for J in PARTICLES_VDW_J */
             vdwjidx{J}A        = 2*vdwtype[jnrA+{J}];
@@ -621,67 +594,6 @@ void
             /*                 #define INNERFLOPS INNERFLOPS+3 */
             /*             #endif */
 
-            /*         #elif KERNEL_ELEC=='GeneralizedBorn' */
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_ps(isai{I},isaj{J});
-            gbqqfactor       = _mm_xor_ps(signbit,_mm_mul_ps(qq{I}{J},_mm_mul_ps(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_ps(isaprod,gbtabscale);
-            /*             #define INNERFLOPS INNERFLOPS+5 */
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_ps(r{I}{J},gbscale);
-            gbitab           = _mm_cvttps_epi32(rt);
-#ifdef __XOP__
-            gbeps            = _mm_frcz_ps(rt);
-#else
-            gbeps            = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR));
-#endif
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,0) );
-            F                = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,1) );
-            G                = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,2) );
-            H                = _mm_load_ps( gbtab + _mm_extract_epi32(gbitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Fp               = _mm_macc_ps(gbeps,_mm_macc_ps(gbeps,H,G),F);
-            VV               = _mm_macc_ps(gbeps,Fp,Y);
-            vgb              = _mm_mul_ps(gbqqfactor,VV);
-            /*             #define INNERFLOPS INNERFLOPS+10 */
-
-            /*             #if 'Force' in KERNEL_VF */
-            twogbeps         = _mm_add_ps(gbeps,gbeps);
-            FF               = _mm_macc_ps(_mm_macc_ps(twogbeps,H,G),gbeps,Fp);
-            fgb              = _mm_mul_ps(gbqqfactor,_mm_mul_ps(FF,gbscale));
-            dvdatmp          = _mm_mul_ps(minushalf,_mm_macc_ps(fgb,r{I}{J},vgb));
-            /*                 #if ROUND == 'Epilogue' */
-            dvdatmp          = _mm_andnot_ps(dummy_mask,dvdatmp);
-            /*                 #endif */
-            dvdasum          = _mm_add_ps(dvdasum,dvdatmp);
-            /*                 #if ROUND == 'Loop' */
-            fjptrA           = dvda+jnrA;
-            fjptrB           = dvda+jnrB;
-            fjptrC           = dvda+jnrC;
-            fjptrD           = dvda+jnrD;
-            /*                 #else */
-            /* The pointers to scratch make sure that this code with compilers that take gmx_restrict seriously (e.g. icc 13) really can't screw things up. */
-            fjptrA             = (jnrlistA>=0) ? dvda+jnrA : scratch;
-            fjptrB             = (jnrlistB>=0) ? dvda+jnrB : scratch;
-            fjptrC             = (jnrlistC>=0) ? dvda+jnrC : scratch;
-            fjptrD             = (jnrlistD>=0) ? dvda+jnrD : scratch;
-            /*                 #endif */
-            gmx_mm_increment_4real_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,_mm_mul_ps(dvdatmp,_mm_mul_ps(isaj{J},isaj{J})));
-            /*                 #define INNERFLOPS INNERFLOPS+13 */
-            /*             #endif */
-            velec            = _mm_mul_ps(qq{I}{J},rinv{I}{J});
-            /*                 #define INNERFLOPS INNERFLOPS+1 */
-            /*             #if 'Force' in KERNEL_VF */
-            felec            = _mm_mul_ps(_mm_msub_ps(velec,rinv{I}{J},fgb),rinv{I}{J});
-            /*                 #define INNERFLOPS INNERFLOPS+3 */
-            /*             #endif */
-
             /*         #elif KERNEL_ELEC=='Ewald' */
             /* EWALD ELECTROSTATICS */
 
@@ -907,17 +819,6 @@ void
             /*             #endif */
             velecsum         = _mm_add_ps(velecsum,velec);
             /*             #define INNERFLOPS INNERFLOPS+1 */
-            /*             #if KERNEL_ELEC=='GeneralizedBorn' */
-            /*             #if 'exactcutoff' in INTERACTION_FLAGS[I][J] */
-            vgb              = _mm_and_ps(vgb,cutoff_mask);
-            /*                 #define INNERFLOPS INNERFLOPS+1 */
-            /*             #endif                                       */
-            /*             #if ROUND == 'Epilogue' */
-            vgb              = _mm_andnot_ps(dummy_mask,vgb);
-            /*             #endif */
-            vgbsum           = _mm_add_ps(vgbsum,vgb);
-            /*                 #define INNERFLOPS INNERFLOPS+1 */
-            /*             #endif */
             /*         #endif */
             /*         #if 'vdw' in INTERACTION_FLAGS[I][J] */
             /*     ## Note special check for TIP4P-TIP4P. Since we are cutting of all hydrogen interactions we also cut the LJ-only O-O interaction */
@@ -1070,19 +971,11 @@ void
         gmx_mm_update_1pot_ps(velecsum,kernel_data->energygrp_elec+ggid);
         /*         #define OUTERFLOPS OUTERFLOPS+1 */
         /*     #endif */
-        /*     #if 'GeneralizedBorn' in KERNEL_ELEC */
-        gmx_mm_update_1pot_ps(vgbsum,kernel_data->energygrp_polarization+ggid);
-        /*         #define OUTERFLOPS OUTERFLOPS+1 */
-        /*     #endif */
         /*     #if KERNEL_VDW != 'None' */
         gmx_mm_update_1pot_ps(vvdwsum,kernel_data->energygrp_vdw+ggid);
         /*         #define OUTERFLOPS OUTERFLOPS+1 */
         /*     #endif */
         /* #endif */
-        /*     #if 'GeneralizedBorn' in KERNEL_ELEC and 'Force' in KERNEL_VF */
-        dvdasum = _mm_mul_ps(dvdasum, _mm_mul_ps(isai{I},isai{I}));
-        gmx_mm_update_1pot_ps(dvdasum,dvda+inr);
-        /*     #endif */
 
         /* Increment number of inner iterations */
         inneriter                  += j_index_end - j_index_start;
index d413f37a963e6c481f7e07971e7708eada5d5723..0da02c54da60ab9ef7daccaa79074683bc64234a 100755 (executable)
@@ -105,7 +105,6 @@ ElectrostaticsList = {
     'None'                    : [],
     'Coulomb'                 : ['rinv','rinvsq'],
     'ReactionField'           : ['rinv','rinvsq'],
-    'GeneralizedBorn'         : ['rinv','r'],
     'CubicSplineTable'        : ['rinv','r','table'],
     'Ewald'                   : ['rinv','rinvsq','r'],
 }
@@ -190,7 +189,6 @@ Abbreviation = {
     'Coulomb'                 : 'Coul',
     'Ewald'                   : 'Ew',
     'ReactionField'           : 'RF',
-    'GeneralizedBorn'         : 'GB',
     'CubicSplineTable'        : 'CSTab',
     'LennardJones'            : 'LJ',
     'Buckingham'              : 'Bham',
@@ -269,7 +267,7 @@ def KeepKernel(KernelElec,KernelElecMod,KernelVdw,KernelVdwMod,KernelGeom,Kernel
         return 0
 
     # No need for LJ-only water optimization, or water optimization with implicit solvent.
-    if('Water' in KernelGeom[0] and (KernelElec=='None' or 'GeneralizedBorn' in KernelElec)):
+    if('Water' in KernelGeom[0] and KernelElec=='None'):
         return 0
 
     # Non-matching table settings are pointless
diff --git a/src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecGB_VdwCSTab_GeomP1P1_avx_256_double.c b/src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecGB_VdwCSTab_GeomP1P1_avx_256_double.c
deleted file mode 100644 (file)
index 8d3df8b..0000000
+++ /dev/null
@@ -1,972 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
- * and including many others, as listed in the AUTHORS file in the
- * top-level source directory and at http://www.gromacs.org.
- *
- * GROMACS is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * GROMACS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GROMACS; if not, see
- * http://www.gnu.org/licenses, or write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
- *
- * If you want to redistribute modifications to GROMACS, please
- * consider that scientific software is very special. Version
- * control is crucial - bugs must be traceable. We will be happy to
- * consider code for inclusion in the official distribution, but
- * derived work must not be called official GROMACS. Details are found
- * in the README & COPYING files - if they are missing, get the
- * official version at http://www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the research papers on the package. Check out http://www.gromacs.org.
- */
-/*
- * Note: this file was generated by the GROMACS avx_256_double kernel generator.
- */
-#include "gmxpre.h"
-
-#include "config.h"
-
-#include <math.h>
-
-#include "../nb_kernel.h"
-#include "gromacs/gmxlib/nrnb.h"
-
-#include "kernelutil_x86_avx_256_double.h"
-
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_avx_256_double
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            CubicSplineTable
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        PotentialAndForce
- */
-void
-nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_avx_256_double
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or 
-     * just 0 for non-waters.
-     * Suffixes A,B,C,D refer to j loop unrolling done with AVX, e.g. for the four different
-     * jnr indices corresponding to data put in the four positions in the SIMD register.
-     */
-    int              i_shift_offset,i_coord_offset,outeriter,inneriter;
-    int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
-    int              jnrA,jnrB,jnrC,jnrD;
-    int              jnrlistA,jnrlistB,jnrlistC,jnrlistD;
-    int              jnrlistE,jnrlistF,jnrlistG,jnrlistH;
-    int              j_coord_offsetA,j_coord_offsetB,j_coord_offsetC,j_coord_offsetD;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             rcutoff_scalar;
-    real             *shiftvec,*fshift,*x,*f;
-    real             *fjptrA,*fjptrB,*fjptrC,*fjptrD;
-    real             scratch[4*DIM];
-    __m256d          tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
-    real *           vdwioffsetptr0;
-    __m256d          ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0A,vdwjidx0B,vdwjidx0C,vdwjidx0D;
-    __m256d          jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    __m256d          dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
-    __m256d          velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    __m128i          gbitab;
-    __m256d          vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,gbeps,dvdatmp;
-    __m256d          minushalf = _mm256_set1_pd(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    int              nvdwtype;
-    __m256d          rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
-    int              *vdwtype;
-    real             *vdwparam;
-    __m256d          one_sixth   = _mm256_set1_pd(1.0/6.0);
-    __m256d          one_twelfth = _mm256_set1_pd(1.0/12.0);
-    __m128i          vfitab;
-    __m128i          ifour       = _mm_set1_epi32(4);
-    __m256d          rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF;
-    real             *vftab;
-    __m256d          dummy_mask,cutoff_mask;
-    __m128           tmpmask0,tmpmask1;
-    __m256d          signbit = _mm256_castsi256_pd( _mm256_set1_epi32(0x80000000) );
-    __m256d          one     = _mm256_set1_pd(1.0);
-    __m256d          two     = _mm256_set1_pd(2.0);
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = _mm256_set1_pd(fr->ic->epsfac);
-    charge           = mdatoms->chargeA;
-    nvdwtype         = fr->ntype;
-    vdwparam         = fr->nbfp;
-    vdwtype          = mdatoms->typeA;
-
-    vftab            = kernel_data->table_vdw->data;
-    vftabscale       = _mm256_set1_pd(kernel_data->table_vdw->scale);
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = _mm256_set1_pd(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = _mm256_set1_pd((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-
-    /* Avoid stupid compiler warnings */
-    jnrA = jnrB = jnrC = jnrD = 0;
-    j_coord_offsetA = 0;
-    j_coord_offsetB = 0;
-    j_coord_offsetC = 0;
-    j_coord_offsetD = 0;
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    for(iidx=0;iidx<4*DIM;iidx++)
-    {
-        scratch[iidx] = 0.0;
-    }
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        gmx_mm256_load_shift_and_1rvec_broadcast_pd(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
-
-        fix0             = _mm256_setzero_pd();
-        fiy0             = _mm256_setzero_pd();
-        fiz0             = _mm256_setzero_pd();
-
-        /* Load parameters for i particles */
-        iq0              = _mm256_mul_pd(facel,_mm256_set1_pd(charge[inr+0]));
-        isai0            = _mm256_set1_pd(invsqrta[inr+0]);
-        vdwioffsetptr0   = vdwparam+2*nvdwtype*vdwtype[inr+0];
-
-        /* Reset potential sums */
-        velecsum         = _mm256_setzero_pd();
-        vgbsum           = _mm256_setzero_pd();
-        vvdwsum          = _mm256_setzero_pd();
-        dvdasum          = _mm256_setzero_pd();
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end && jjnr[jidx+3]>=0; jidx+=4)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrA             = jjnr[jidx];
-            jnrB             = jjnr[jidx+1];
-            jnrC             = jjnr[jidx+2];
-            jnrD             = jjnr[jidx+3];
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-
-            /* load j atom coordinates */
-            gmx_mm256_load_1rvec_4ptr_swizzle_pd(x+j_coord_offsetA,x+j_coord_offsetB,
-                                                 x+j_coord_offsetC,x+j_coord_offsetD,
-                                                 &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm256_sub_pd(ix0,jx0);
-            dy00             = _mm256_sub_pd(iy0,jy0);
-            dz00             = _mm256_sub_pd(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm256_calc_rsq_pd(dx00,dy00,dz00);
-
-            rinv00           = avx256_invsqrt_d(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm256_load_4real_swizzle_pd(charge+jnrA+0,charge+jnrB+0,
-                                                                 charge+jnrC+0,charge+jnrD+0);
-            isaj0            = gmx_mm256_load_4real_swizzle_pd(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                                 invsqrta+jnrC+0,invsqrta+jnrD+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-            vdwjidx0B        = 2*vdwtype[jnrB+0];
-            vdwjidx0C        = 2*vdwtype[jnrC+0];
-            vdwjidx0D        = 2*vdwtype[jnrD+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm256_mul_pd(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm256_mul_pd(iq0,jq0);
-            gmx_mm256_load_4pair_swizzle_pd(vdwioffsetptr0+vdwjidx0A,
-                                            vdwioffsetptr0+vdwjidx0B,
-                                            vdwioffsetptr0+vdwjidx0C,
-                                            vdwioffsetptr0+vdwjidx0D,
-                                            &c6_00,&c12_00);
-
-            /* Calculate table index by multiplying r with table scale and truncate to integer */
-            rt               = _mm256_mul_pd(r00,vftabscale);
-            vfitab           = _mm256_cvttpd_epi32(rt);
-            vfeps            = _mm256_sub_pd(rt,_mm256_round_pd(rt, _MM_FROUND_FLOOR));
-            vfitab           = _mm_slli_epi32(vfitab,3);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm256_mul_pd(isai0,isaj0);
-            gbqqfactor       = _mm256_xor_pd(signbit,_mm256_mul_pd(qq00,_mm256_mul_pd(isaprod,gbinvepsdiff)));
-            gbscale          = _mm256_mul_pd(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm256_mul_pd(r00,gbscale);
-            gbitab           = _mm256_cvttpd_epi32(rt);
-            gbeps            = _mm256_sub_pd(rt,_mm256_round_pd(rt, _MM_FROUND_FLOOR));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-            Y                = _mm256_load_pd( gbtab + _mm_extract_epi32(gbitab,0) );
-            F                = _mm256_load_pd( gbtab + _mm_extract_epi32(gbitab,1) );
-            G                = _mm256_load_pd( gbtab + _mm_extract_epi32(gbitab,2) );
-            H                = _mm256_load_pd( gbtab + _mm_extract_epi32(gbitab,3) );
-            GMX_MM256_FULLTRANSPOSE4_PD(Y,F,G,H);
-            Heps             = _mm256_mul_pd(gbeps,H);
-            Fp               = _mm256_add_pd(F,_mm256_mul_pd(gbeps,_mm256_add_pd(G,Heps)));
-            VV               = _mm256_add_pd(Y,_mm256_mul_pd(gbeps,Fp));
-            vgb              = _mm256_mul_pd(gbqqfactor,VV);
-
-            FF               = _mm256_add_pd(Fp,_mm256_mul_pd(gbeps,_mm256_add_pd(G,_mm256_add_pd(Heps,Heps))));
-            fgb              = _mm256_mul_pd(gbqqfactor,_mm256_mul_pd(FF,gbscale));
-            dvdatmp          = _mm256_mul_pd(minushalf,_mm256_add_pd(vgb,_mm256_mul_pd(fgb,r00)));
-            dvdasum          = _mm256_add_pd(dvdasum,dvdatmp);
-            fjptrA           = dvda+jnrA;
-            fjptrB           = dvda+jnrB;
-            fjptrC           = dvda+jnrC;
-            fjptrD           = dvda+jnrD;
-            gmx_mm256_increment_4real_swizzle_pd(fjptrA,fjptrB,fjptrC,fjptrD,
-                                                 _mm256_mul_pd(dvdatmp,_mm256_mul_pd(isaj0,isaj0)));
-            velec            = _mm256_mul_pd(qq00,rinv00);
-            felec            = _mm256_mul_pd(_mm256_sub_pd(_mm256_mul_pd(velec,rinv00),fgb),rinv00);
-
-            /* CUBIC SPLINE TABLE DISPERSION */
-            Y                = _mm256_load_pd( vftab + _mm_extract_epi32(vfitab,0) );
-            F                = _mm256_load_pd( vftab + _mm_extract_epi32(vfitab,1) );
-            G                = _mm256_load_pd( vftab + _mm_extract_epi32(vfitab,2) );
-            H                = _mm256_load_pd( vftab + _mm_extract_epi32(vfitab,3) );
-            GMX_MM256_FULLTRANSPOSE4_PD(Y,F,G,H);
-            Heps             = _mm256_mul_pd(vfeps,H);
-            Fp               = _mm256_add_pd(F,_mm256_mul_pd(vfeps,_mm256_add_pd(G,Heps)));
-            VV               = _mm256_add_pd(Y,_mm256_mul_pd(vfeps,Fp));
-            vvdw6            = _mm256_mul_pd(c6_00,VV);
-            FF               = _mm256_add_pd(Fp,_mm256_mul_pd(vfeps,_mm256_add_pd(G,_mm256_add_pd(Heps,Heps))));
-            fvdw6            = _mm256_mul_pd(c6_00,FF);
-
-            /* CUBIC SPLINE TABLE REPULSION */
-            vfitab           = _mm_add_epi32(vfitab,ifour);
-            Y                = _mm256_load_pd( vftab + _mm_extract_epi32(vfitab,0) );
-            F                = _mm256_load_pd( vftab + _mm_extract_epi32(vfitab,1) );
-            G                = _mm256_load_pd( vftab + _mm_extract_epi32(vfitab,2) );
-            H                = _mm256_load_pd( vftab + _mm_extract_epi32(vfitab,3) );
-            GMX_MM256_FULLTRANSPOSE4_PD(Y,F,G,H);
-            Heps             = _mm256_mul_pd(vfeps,H);
-            Fp               = _mm256_add_pd(F,_mm256_mul_pd(vfeps,_mm256_add_pd(G,Heps)));
-            VV               = _mm256_add_pd(Y,_mm256_mul_pd(vfeps,Fp));
-            vvdw12           = _mm256_mul_pd(c12_00,VV);
-            FF               = _mm256_add_pd(Fp,_mm256_mul_pd(vfeps,_mm256_add_pd(G,_mm256_add_pd(Heps,Heps))));
-            fvdw12           = _mm256_mul_pd(c12_00,FF);
-            vvdw             = _mm256_add_pd(vvdw12,vvdw6);
-            fvdw             = _mm256_xor_pd(signbit,_mm256_mul_pd(_mm256_add_pd(fvdw6,fvdw12),_mm256_mul_pd(vftabscale,rinv00)));
-
-            /* Update potential sum for this i atom from the interaction with this j atom. */
-            velecsum         = _mm256_add_pd(velecsum,velec);
-            vgbsum           = _mm256_add_pd(vgbsum,vgb);
-            vvdwsum          = _mm256_add_pd(vvdwsum,vvdw);
-
-            fscal            = _mm256_add_pd(felec,fvdw);
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm256_mul_pd(fscal,dx00);
-            ty               = _mm256_mul_pd(fscal,dy00);
-            tz               = _mm256_mul_pd(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm256_add_pd(fix0,tx);
-            fiy0             = _mm256_add_pd(fiy0,ty);
-            fiz0             = _mm256_add_pd(fiz0,tz);
-
-            fjptrA             = f+j_coord_offsetA;
-            fjptrB             = f+j_coord_offsetB;
-            fjptrC             = f+j_coord_offsetC;
-            fjptrD             = f+j_coord_offsetD;
-            gmx_mm256_decrement_1rvec_4ptr_swizzle_pd(fjptrA,fjptrB,fjptrC,fjptrD,tx,ty,tz);
-
-            /* Inner loop uses 91 flops */
-        }
-
-        if(jidx<j_index_end)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrlistA         = jjnr[jidx];
-            jnrlistB         = jjnr[jidx+1];
-            jnrlistC         = jjnr[jidx+2];
-            jnrlistD         = jjnr[jidx+3];
-            /* Sign of each element will be negative for non-real atoms.
-             * This mask will be 0xFFFFFFFF for dummy entries and 0x0 for real ones,
-             * so use it as val = _mm_andnot_pd(mask,val) to clear dummy entries.
-             */
-            tmpmask0 = gmx_mm_castsi128_ps(_mm_cmplt_epi32(_mm_loadu_si128((const __m128i *)(jjnr+jidx)),_mm_setzero_si128()));
-
-            tmpmask1 = _mm_permute_ps(tmpmask0,_GMX_MM_PERMUTE(3,3,2,2));
-            tmpmask0 = _mm_permute_ps(tmpmask0,_GMX_MM_PERMUTE(1,1,0,0));
-            dummy_mask = _mm256_castps_pd(gmx_mm256_set_m128(tmpmask1,tmpmask0));
-
-            jnrA       = (jnrlistA>=0) ? jnrlistA : 0;
-            jnrB       = (jnrlistB>=0) ? jnrlistB : 0;
-            jnrC       = (jnrlistC>=0) ? jnrlistC : 0;
-            jnrD       = (jnrlistD>=0) ? jnrlistD : 0;
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-
-            /* load j atom coordinates */
-            gmx_mm256_load_1rvec_4ptr_swizzle_pd(x+j_coord_offsetA,x+j_coord_offsetB,
-                                                 x+j_coord_offsetC,x+j_coord_offsetD,
-                                                 &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm256_sub_pd(ix0,jx0);
-            dy00             = _mm256_sub_pd(iy0,jy0);
-            dz00             = _mm256_sub_pd(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm256_calc_rsq_pd(dx00,dy00,dz00);
-
-            rinv00           = avx256_invsqrt_d(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm256_load_4real_swizzle_pd(charge+jnrA+0,charge+jnrB+0,
-                                                                 charge+jnrC+0,charge+jnrD+0);
-            isaj0            = gmx_mm256_load_4real_swizzle_pd(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                                 invsqrta+jnrC+0,invsqrta+jnrD+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-            vdwjidx0B        = 2*vdwtype[jnrB+0];
-            vdwjidx0C        = 2*vdwtype[jnrC+0];
-            vdwjidx0D        = 2*vdwtype[jnrD+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm256_mul_pd(rsq00,rinv00);
-            r00              = _mm256_andnot_pd(dummy_mask,r00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm256_mul_pd(iq0,jq0);
-            gmx_mm256_load_4pair_swizzle_pd(vdwioffsetptr0+vdwjidx0A,
-                                            vdwioffsetptr0+vdwjidx0B,
-                                            vdwioffsetptr0+vdwjidx0C,
-                                            vdwioffsetptr0+vdwjidx0D,
-                                            &c6_00,&c12_00);
-
-            /* Calculate table index by multiplying r with table scale and truncate to integer */
-            rt               = _mm256_mul_pd(r00,vftabscale);
-            vfitab           = _mm256_cvttpd_epi32(rt);
-            vfeps            = _mm256_sub_pd(rt,_mm256_round_pd(rt, _MM_FROUND_FLOOR));
-            vfitab           = _mm_slli_epi32(vfitab,3);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm256_mul_pd(isai0,isaj0);
-            gbqqfactor       = _mm256_xor_pd(signbit,_mm256_mul_pd(qq00,_mm256_mul_pd(isaprod,gbinvepsdiff)));
-            gbscale          = _mm256_mul_pd(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm256_mul_pd(r00,gbscale);
-            gbitab           = _mm256_cvttpd_epi32(rt);
-            gbeps            = _mm256_sub_pd(rt,_mm256_round_pd(rt, _MM_FROUND_FLOOR));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-            Y                = _mm256_load_pd( gbtab + _mm_extract_epi32(gbitab,0) );
-            F                = _mm256_load_pd( gbtab + _mm_extract_epi32(gbitab,1) );
-            G                = _mm256_load_pd( gbtab + _mm_extract_epi32(gbitab,2) );
-            H                = _mm256_load_pd( gbtab + _mm_extract_epi32(gbitab,3) );
-            GMX_MM256_FULLTRANSPOSE4_PD(Y,F,G,H);
-            Heps             = _mm256_mul_pd(gbeps,H);
-            Fp               = _mm256_add_pd(F,_mm256_mul_pd(gbeps,_mm256_add_pd(G,Heps)));
-            VV               = _mm256_add_pd(Y,_mm256_mul_pd(gbeps,Fp));
-            vgb              = _mm256_mul_pd(gbqqfactor,VV);
-
-            FF               = _mm256_add_pd(Fp,_mm256_mul_pd(gbeps,_mm256_add_pd(G,_mm256_add_pd(Heps,Heps))));
-            fgb              = _mm256_mul_pd(gbqqfactor,_mm256_mul_pd(FF,gbscale));
-            dvdatmp          = _mm256_mul_pd(minushalf,_mm256_add_pd(vgb,_mm256_mul_pd(fgb,r00)));
-            dvdatmp          = _mm256_andnot_pd(dummy_mask,dvdatmp);
-            dvdasum          = _mm256_add_pd(dvdasum,dvdatmp);
-            /* The pointers to scratch make sure that this code with compilers that take gmx_restrict seriously (e.g. icc 13) really can't screw things up. */
-            fjptrA             = (jnrlistA>=0) ? dvda+jnrA : scratch;
-            fjptrB             = (jnrlistB>=0) ? dvda+jnrB : scratch;
-            fjptrC             = (jnrlistC>=0) ? dvda+jnrC : scratch;
-            fjptrD             = (jnrlistD>=0) ? dvda+jnrD : scratch;
-            gmx_mm256_increment_4real_swizzle_pd(fjptrA,fjptrB,fjptrC,fjptrD,
-                                                 _mm256_mul_pd(dvdatmp,_mm256_mul_pd(isaj0,isaj0)));
-            velec            = _mm256_mul_pd(qq00,rinv00);
-            felec            = _mm256_mul_pd(_mm256_sub_pd(_mm256_mul_pd(velec,rinv00),fgb),rinv00);
-
-            /* CUBIC SPLINE TABLE DISPERSION */
-            Y                = _mm256_load_pd( vftab + _mm_extract_epi32(vfitab,0) );
-            F                = _mm256_load_pd( vftab + _mm_extract_epi32(vfitab,1) );
-            G                = _mm256_load_pd( vftab + _mm_extract_epi32(vfitab,2) );
-            H                = _mm256_load_pd( vftab + _mm_extract_epi32(vfitab,3) );
-            GMX_MM256_FULLTRANSPOSE4_PD(Y,F,G,H);
-            Heps             = _mm256_mul_pd(vfeps,H);
-            Fp               = _mm256_add_pd(F,_mm256_mul_pd(vfeps,_mm256_add_pd(G,Heps)));
-            VV               = _mm256_add_pd(Y,_mm256_mul_pd(vfeps,Fp));
-            vvdw6            = _mm256_mul_pd(c6_00,VV);
-            FF               = _mm256_add_pd(Fp,_mm256_mul_pd(vfeps,_mm256_add_pd(G,_mm256_add_pd(Heps,Heps))));
-            fvdw6            = _mm256_mul_pd(c6_00,FF);
-
-            /* CUBIC SPLINE TABLE REPULSION */
-            vfitab           = _mm_add_epi32(vfitab,ifour);
-            Y                = _mm256_load_pd( vftab + _mm_extract_epi32(vfitab,0) );
-            F                = _mm256_load_pd( vftab + _mm_extract_epi32(vfitab,1) );
-            G                = _mm256_load_pd( vftab + _mm_extract_epi32(vfitab,2) );
-            H                = _mm256_load_pd( vftab + _mm_extract_epi32(vfitab,3) );
-            GMX_MM256_FULLTRANSPOSE4_PD(Y,F,G,H);
-            Heps             = _mm256_mul_pd(vfeps,H);
-            Fp               = _mm256_add_pd(F,_mm256_mul_pd(vfeps,_mm256_add_pd(G,Heps)));
-            VV               = _mm256_add_pd(Y,_mm256_mul_pd(vfeps,Fp));
-            vvdw12           = _mm256_mul_pd(c12_00,VV);
-            FF               = _mm256_add_pd(Fp,_mm256_mul_pd(vfeps,_mm256_add_pd(G,_mm256_add_pd(Heps,Heps))));
-            fvdw12           = _mm256_mul_pd(c12_00,FF);
-            vvdw             = _mm256_add_pd(vvdw12,vvdw6);
-            fvdw             = _mm256_xor_pd(signbit,_mm256_mul_pd(_mm256_add_pd(fvdw6,fvdw12),_mm256_mul_pd(vftabscale,rinv00)));
-
-            /* Update potential sum for this i atom from the interaction with this j atom. */
-            velec            = _mm256_andnot_pd(dummy_mask,velec);
-            velecsum         = _mm256_add_pd(velecsum,velec);
-            vgb              = _mm256_andnot_pd(dummy_mask,vgb);
-            vgbsum           = _mm256_add_pd(vgbsum,vgb);
-            vvdw             = _mm256_andnot_pd(dummy_mask,vvdw);
-            vvdwsum          = _mm256_add_pd(vvdwsum,vvdw);
-
-            fscal            = _mm256_add_pd(felec,fvdw);
-
-            fscal            = _mm256_andnot_pd(dummy_mask,fscal);
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm256_mul_pd(fscal,dx00);
-            ty               = _mm256_mul_pd(fscal,dy00);
-            tz               = _mm256_mul_pd(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm256_add_pd(fix0,tx);
-            fiy0             = _mm256_add_pd(fiy0,ty);
-            fiz0             = _mm256_add_pd(fiz0,tz);
-
-            fjptrA             = (jnrlistA>=0) ? f+j_coord_offsetA : scratch;
-            fjptrB             = (jnrlistB>=0) ? f+j_coord_offsetB : scratch;
-            fjptrC             = (jnrlistC>=0) ? f+j_coord_offsetC : scratch;
-            fjptrD             = (jnrlistD>=0) ? f+j_coord_offsetD : scratch;
-            gmx_mm256_decrement_1rvec_4ptr_swizzle_pd(fjptrA,fjptrB,fjptrC,fjptrD,tx,ty,tz);
-
-            /* Inner loop uses 92 flops */
-        }
-
-        /* End of innermost loop */
-
-        gmx_mm256_update_iforce_1atom_swizzle_pd(fix0,fiy0,fiz0,
-                                                 f+i_coord_offset,fshift+i_shift_offset);
-
-        ggid                        = gid[iidx];
-        /* Update potential energies */
-        gmx_mm256_update_1pot_pd(velecsum,kernel_data->energygrp_elec+ggid);
-        gmx_mm256_update_1pot_pd(vgbsum,kernel_data->energygrp_polarization+ggid);
-        gmx_mm256_update_1pot_pd(vvdwsum,kernel_data->energygrp_vdw+ggid);
-        dvdasum = _mm256_mul_pd(dvdasum, _mm256_mul_pd(isai0,isai0));
-        gmx_mm256_update_1pot_pd(dvdasum,dvda+inr);
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 10 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_VF,outeriter*10 + inneriter*92);
-}
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_avx_256_double
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            CubicSplineTable
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        Force
- */
-void
-nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_avx_256_double
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or 
-     * just 0 for non-waters.
-     * Suffixes A,B,C,D refer to j loop unrolling done with AVX, e.g. for the four different
-     * jnr indices corresponding to data put in the four positions in the SIMD register.
-     */
-    int              i_shift_offset,i_coord_offset,outeriter,inneriter;
-    int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
-    int              jnrA,jnrB,jnrC,jnrD;
-    int              jnrlistA,jnrlistB,jnrlistC,jnrlistD;
-    int              jnrlistE,jnrlistF,jnrlistG,jnrlistH;
-    int              j_coord_offsetA,j_coord_offsetB,j_coord_offsetC,j_coord_offsetD;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             rcutoff_scalar;
-    real             *shiftvec,*fshift,*x,*f;
-    real             *fjptrA,*fjptrB,*fjptrC,*fjptrD;
-    real             scratch[4*DIM];
-    __m256d          tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
-    real *           vdwioffsetptr0;
-    __m256d          ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0A,vdwjidx0B,vdwjidx0C,vdwjidx0D;
-    __m256d          jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    __m256d          dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
-    __m256d          velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    __m128i          gbitab;
-    __m256d          vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,gbeps,dvdatmp;
-    __m256d          minushalf = _mm256_set1_pd(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    int              nvdwtype;
-    __m256d          rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
-    int              *vdwtype;
-    real             *vdwparam;
-    __m256d          one_sixth   = _mm256_set1_pd(1.0/6.0);
-    __m256d          one_twelfth = _mm256_set1_pd(1.0/12.0);
-    __m128i          vfitab;
-    __m128i          ifour       = _mm_set1_epi32(4);
-    __m256d          rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF;
-    real             *vftab;
-    __m256d          dummy_mask,cutoff_mask;
-    __m128           tmpmask0,tmpmask1;
-    __m256d          signbit = _mm256_castsi256_pd( _mm256_set1_epi32(0x80000000) );
-    __m256d          one     = _mm256_set1_pd(1.0);
-    __m256d          two     = _mm256_set1_pd(2.0);
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = _mm256_set1_pd(fr->ic->epsfac);
-    charge           = mdatoms->chargeA;
-    nvdwtype         = fr->ntype;
-    vdwparam         = fr->nbfp;
-    vdwtype          = mdatoms->typeA;
-
-    vftab            = kernel_data->table_vdw->data;
-    vftabscale       = _mm256_set1_pd(kernel_data->table_vdw->scale);
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = _mm256_set1_pd(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = _mm256_set1_pd((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-
-    /* Avoid stupid compiler warnings */
-    jnrA = jnrB = jnrC = jnrD = 0;
-    j_coord_offsetA = 0;
-    j_coord_offsetB = 0;
-    j_coord_offsetC = 0;
-    j_coord_offsetD = 0;
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    for(iidx=0;iidx<4*DIM;iidx++)
-    {
-        scratch[iidx] = 0.0;
-    }
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        gmx_mm256_load_shift_and_1rvec_broadcast_pd(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
-
-        fix0             = _mm256_setzero_pd();
-        fiy0             = _mm256_setzero_pd();
-        fiz0             = _mm256_setzero_pd();
-
-        /* Load parameters for i particles */
-        iq0              = _mm256_mul_pd(facel,_mm256_set1_pd(charge[inr+0]));
-        isai0            = _mm256_set1_pd(invsqrta[inr+0]);
-        vdwioffsetptr0   = vdwparam+2*nvdwtype*vdwtype[inr+0];
-
-        dvdasum          = _mm256_setzero_pd();
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end && jjnr[jidx+3]>=0; jidx+=4)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrA             = jjnr[jidx];
-            jnrB             = jjnr[jidx+1];
-            jnrC             = jjnr[jidx+2];
-            jnrD             = jjnr[jidx+3];
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-
-            /* load j atom coordinates */
-            gmx_mm256_load_1rvec_4ptr_swizzle_pd(x+j_coord_offsetA,x+j_coord_offsetB,
-                                                 x+j_coord_offsetC,x+j_coord_offsetD,
-                                                 &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm256_sub_pd(ix0,jx0);
-            dy00             = _mm256_sub_pd(iy0,jy0);
-            dz00             = _mm256_sub_pd(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm256_calc_rsq_pd(dx00,dy00,dz00);
-
-            rinv00           = avx256_invsqrt_d(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm256_load_4real_swizzle_pd(charge+jnrA+0,charge+jnrB+0,
-                                                                 charge+jnrC+0,charge+jnrD+0);
-            isaj0            = gmx_mm256_load_4real_swizzle_pd(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                                 invsqrta+jnrC+0,invsqrta+jnrD+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-            vdwjidx0B        = 2*vdwtype[jnrB+0];
-            vdwjidx0C        = 2*vdwtype[jnrC+0];
-            vdwjidx0D        = 2*vdwtype[jnrD+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm256_mul_pd(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm256_mul_pd(iq0,jq0);
-            gmx_mm256_load_4pair_swizzle_pd(vdwioffsetptr0+vdwjidx0A,
-                                            vdwioffsetptr0+vdwjidx0B,
-                                            vdwioffsetptr0+vdwjidx0C,
-                                            vdwioffsetptr0+vdwjidx0D,
-                                            &c6_00,&c12_00);
-
-            /* Calculate table index by multiplying r with table scale and truncate to integer */
-            rt               = _mm256_mul_pd(r00,vftabscale);
-            vfitab           = _mm256_cvttpd_epi32(rt);
-            vfeps            = _mm256_sub_pd(rt,_mm256_round_pd(rt, _MM_FROUND_FLOOR));
-            vfitab           = _mm_slli_epi32(vfitab,3);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm256_mul_pd(isai0,isaj0);
-            gbqqfactor       = _mm256_xor_pd(signbit,_mm256_mul_pd(qq00,_mm256_mul_pd(isaprod,gbinvepsdiff)));
-            gbscale          = _mm256_mul_pd(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm256_mul_pd(r00,gbscale);
-            gbitab           = _mm256_cvttpd_epi32(rt);
-            gbeps            = _mm256_sub_pd(rt,_mm256_round_pd(rt, _MM_FROUND_FLOOR));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-            Y                = _mm256_load_pd( gbtab + _mm_extract_epi32(gbitab,0) );
-            F                = _mm256_load_pd( gbtab + _mm_extract_epi32(gbitab,1) );
-            G                = _mm256_load_pd( gbtab + _mm_extract_epi32(gbitab,2) );
-            H                = _mm256_load_pd( gbtab + _mm_extract_epi32(gbitab,3) );
-            GMX_MM256_FULLTRANSPOSE4_PD(Y,F,G,H);
-            Heps             = _mm256_mul_pd(gbeps,H);
-            Fp               = _mm256_add_pd(F,_mm256_mul_pd(gbeps,_mm256_add_pd(G,Heps)));
-            VV               = _mm256_add_pd(Y,_mm256_mul_pd(gbeps,Fp));
-            vgb              = _mm256_mul_pd(gbqqfactor,VV);
-
-            FF               = _mm256_add_pd(Fp,_mm256_mul_pd(gbeps,_mm256_add_pd(G,_mm256_add_pd(Heps,Heps))));
-            fgb              = _mm256_mul_pd(gbqqfactor,_mm256_mul_pd(FF,gbscale));
-            dvdatmp          = _mm256_mul_pd(minushalf,_mm256_add_pd(vgb,_mm256_mul_pd(fgb,r00)));
-            dvdasum          = _mm256_add_pd(dvdasum,dvdatmp);
-            fjptrA           = dvda+jnrA;
-            fjptrB           = dvda+jnrB;
-            fjptrC           = dvda+jnrC;
-            fjptrD           = dvda+jnrD;
-            gmx_mm256_increment_4real_swizzle_pd(fjptrA,fjptrB,fjptrC,fjptrD,
-                                                 _mm256_mul_pd(dvdatmp,_mm256_mul_pd(isaj0,isaj0)));
-            velec            = _mm256_mul_pd(qq00,rinv00);
-            felec            = _mm256_mul_pd(_mm256_sub_pd(_mm256_mul_pd(velec,rinv00),fgb),rinv00);
-
-            /* CUBIC SPLINE TABLE DISPERSION */
-            Y                = _mm256_load_pd( vftab + _mm_extract_epi32(vfitab,0) );
-            F                = _mm256_load_pd( vftab + _mm_extract_epi32(vfitab,1) );
-            G                = _mm256_load_pd( vftab + _mm_extract_epi32(vfitab,2) );
-            H                = _mm256_load_pd( vftab + _mm_extract_epi32(vfitab,3) );
-            GMX_MM256_FULLTRANSPOSE4_PD(Y,F,G,H);
-            Heps             = _mm256_mul_pd(vfeps,H);
-            Fp               = _mm256_add_pd(F,_mm256_mul_pd(vfeps,_mm256_add_pd(G,Heps)));
-            FF               = _mm256_add_pd(Fp,_mm256_mul_pd(vfeps,_mm256_add_pd(G,_mm256_add_pd(Heps,Heps))));
-            fvdw6            = _mm256_mul_pd(c6_00,FF);
-
-            /* CUBIC SPLINE TABLE REPULSION */
-            vfitab           = _mm_add_epi32(vfitab,ifour);
-            Y                = _mm256_load_pd( vftab + _mm_extract_epi32(vfitab,0) );
-            F                = _mm256_load_pd( vftab + _mm_extract_epi32(vfitab,1) );
-            G                = _mm256_load_pd( vftab + _mm_extract_epi32(vfitab,2) );
-            H                = _mm256_load_pd( vftab + _mm_extract_epi32(vfitab,3) );
-            GMX_MM256_FULLTRANSPOSE4_PD(Y,F,G,H);
-            Heps             = _mm256_mul_pd(vfeps,H);
-            Fp               = _mm256_add_pd(F,_mm256_mul_pd(vfeps,_mm256_add_pd(G,Heps)));
-            FF               = _mm256_add_pd(Fp,_mm256_mul_pd(vfeps,_mm256_add_pd(G,_mm256_add_pd(Heps,Heps))));
-            fvdw12           = _mm256_mul_pd(c12_00,FF);
-            fvdw             = _mm256_xor_pd(signbit,_mm256_mul_pd(_mm256_add_pd(fvdw6,fvdw12),_mm256_mul_pd(vftabscale,rinv00)));
-
-            fscal            = _mm256_add_pd(felec,fvdw);
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm256_mul_pd(fscal,dx00);
-            ty               = _mm256_mul_pd(fscal,dy00);
-            tz               = _mm256_mul_pd(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm256_add_pd(fix0,tx);
-            fiy0             = _mm256_add_pd(fiy0,ty);
-            fiz0             = _mm256_add_pd(fiz0,tz);
-
-            fjptrA             = f+j_coord_offsetA;
-            fjptrB             = f+j_coord_offsetB;
-            fjptrC             = f+j_coord_offsetC;
-            fjptrD             = f+j_coord_offsetD;
-            gmx_mm256_decrement_1rvec_4ptr_swizzle_pd(fjptrA,fjptrB,fjptrC,fjptrD,tx,ty,tz);
-
-            /* Inner loop uses 81 flops */
-        }
-
-        if(jidx<j_index_end)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrlistA         = jjnr[jidx];
-            jnrlistB         = jjnr[jidx+1];
-            jnrlistC         = jjnr[jidx+2];
-            jnrlistD         = jjnr[jidx+3];
-            /* Sign of each element will be negative for non-real atoms.
-             * This mask will be 0xFFFFFFFF for dummy entries and 0x0 for real ones,
-             * so use it as val = _mm_andnot_pd(mask,val) to clear dummy entries.
-             */
-            tmpmask0 = gmx_mm_castsi128_ps(_mm_cmplt_epi32(_mm_loadu_si128((const __m128i *)(jjnr+jidx)),_mm_setzero_si128()));
-
-            tmpmask1 = _mm_permute_ps(tmpmask0,_GMX_MM_PERMUTE(3,3,2,2));
-            tmpmask0 = _mm_permute_ps(tmpmask0,_GMX_MM_PERMUTE(1,1,0,0));
-            dummy_mask = _mm256_castps_pd(gmx_mm256_set_m128(tmpmask1,tmpmask0));
-
-            jnrA       = (jnrlistA>=0) ? jnrlistA : 0;
-            jnrB       = (jnrlistB>=0) ? jnrlistB : 0;
-            jnrC       = (jnrlistC>=0) ? jnrlistC : 0;
-            jnrD       = (jnrlistD>=0) ? jnrlistD : 0;
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-
-            /* load j atom coordinates */
-            gmx_mm256_load_1rvec_4ptr_swizzle_pd(x+j_coord_offsetA,x+j_coord_offsetB,
-                                                 x+j_coord_offsetC,x+j_coord_offsetD,
-                                                 &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm256_sub_pd(ix0,jx0);
-            dy00             = _mm256_sub_pd(iy0,jy0);
-            dz00             = _mm256_sub_pd(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm256_calc_rsq_pd(dx00,dy00,dz00);
-
-            rinv00           = avx256_invsqrt_d(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm256_load_4real_swizzle_pd(charge+jnrA+0,charge+jnrB+0,
-                                                                 charge+jnrC+0,charge+jnrD+0);
-            isaj0            = gmx_mm256_load_4real_swizzle_pd(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                                 invsqrta+jnrC+0,invsqrta+jnrD+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-            vdwjidx0B        = 2*vdwtype[jnrB+0];
-            vdwjidx0C        = 2*vdwtype[jnrC+0];
-            vdwjidx0D        = 2*vdwtype[jnrD+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm256_mul_pd(rsq00,rinv00);
-            r00              = _mm256_andnot_pd(dummy_mask,r00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm256_mul_pd(iq0,jq0);
-            gmx_mm256_load_4pair_swizzle_pd(vdwioffsetptr0+vdwjidx0A,
-                                            vdwioffsetptr0+vdwjidx0B,
-                                            vdwioffsetptr0+vdwjidx0C,
-                                            vdwioffsetptr0+vdwjidx0D,
-                                            &c6_00,&c12_00);
-
-            /* Calculate table index by multiplying r with table scale and truncate to integer */
-            rt               = _mm256_mul_pd(r00,vftabscale);
-            vfitab           = _mm256_cvttpd_epi32(rt);
-            vfeps            = _mm256_sub_pd(rt,_mm256_round_pd(rt, _MM_FROUND_FLOOR));
-            vfitab           = _mm_slli_epi32(vfitab,3);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm256_mul_pd(isai0,isaj0);
-            gbqqfactor       = _mm256_xor_pd(signbit,_mm256_mul_pd(qq00,_mm256_mul_pd(isaprod,gbinvepsdiff)));
-            gbscale          = _mm256_mul_pd(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm256_mul_pd(r00,gbscale);
-            gbitab           = _mm256_cvttpd_epi32(rt);
-            gbeps            = _mm256_sub_pd(rt,_mm256_round_pd(rt, _MM_FROUND_FLOOR));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-            Y                = _mm256_load_pd( gbtab + _mm_extract_epi32(gbitab,0) );
-            F                = _mm256_load_pd( gbtab + _mm_extract_epi32(gbitab,1) );
-            G                = _mm256_load_pd( gbtab + _mm_extract_epi32(gbitab,2) );
-            H                = _mm256_load_pd( gbtab + _mm_extract_epi32(gbitab,3) );
-            GMX_MM256_FULLTRANSPOSE4_PD(Y,F,G,H);
-            Heps             = _mm256_mul_pd(gbeps,H);
-            Fp               = _mm256_add_pd(F,_mm256_mul_pd(gbeps,_mm256_add_pd(G,Heps)));
-            VV               = _mm256_add_pd(Y,_mm256_mul_pd(gbeps,Fp));
-            vgb              = _mm256_mul_pd(gbqqfactor,VV);
-
-            FF               = _mm256_add_pd(Fp,_mm256_mul_pd(gbeps,_mm256_add_pd(G,_mm256_add_pd(Heps,Heps))));
-            fgb              = _mm256_mul_pd(gbqqfactor,_mm256_mul_pd(FF,gbscale));
-            dvdatmp          = _mm256_mul_pd(minushalf,_mm256_add_pd(vgb,_mm256_mul_pd(fgb,r00)));
-            dvdatmp          = _mm256_andnot_pd(dummy_mask,dvdatmp);
-            dvdasum          = _mm256_add_pd(dvdasum,dvdatmp);
-            /* The pointers to scratch make sure that this code with compilers that take gmx_restrict seriously (e.g. icc 13) really can't screw things up. */
-            fjptrA             = (jnrlistA>=0) ? dvda+jnrA : scratch;
-            fjptrB             = (jnrlistB>=0) ? dvda+jnrB : scratch;
-            fjptrC             = (jnrlistC>=0) ? dvda+jnrC : scratch;
-            fjptrD             = (jnrlistD>=0) ? dvda+jnrD : scratch;
-            gmx_mm256_increment_4real_swizzle_pd(fjptrA,fjptrB,fjptrC,fjptrD,
-                                                 _mm256_mul_pd(dvdatmp,_mm256_mul_pd(isaj0,isaj0)));
-            velec            = _mm256_mul_pd(qq00,rinv00);
-            felec            = _mm256_mul_pd(_mm256_sub_pd(_mm256_mul_pd(velec,rinv00),fgb),rinv00);
-
-            /* CUBIC SPLINE TABLE DISPERSION */
-            Y                = _mm256_load_pd( vftab + _mm_extract_epi32(vfitab,0) );
-            F                = _mm256_load_pd( vftab + _mm_extract_epi32(vfitab,1) );
-            G                = _mm256_load_pd( vftab + _mm_extract_epi32(vfitab,2) );
-            H                = _mm256_load_pd( vftab + _mm_extract_epi32(vfitab,3) );
-            GMX_MM256_FULLTRANSPOSE4_PD(Y,F,G,H);
-            Heps             = _mm256_mul_pd(vfeps,H);
-            Fp               = _mm256_add_pd(F,_mm256_mul_pd(vfeps,_mm256_add_pd(G,Heps)));
-            FF               = _mm256_add_pd(Fp,_mm256_mul_pd(vfeps,_mm256_add_pd(G,_mm256_add_pd(Heps,Heps))));
-            fvdw6            = _mm256_mul_pd(c6_00,FF);
-
-            /* CUBIC SPLINE TABLE REPULSION */
-            vfitab           = _mm_add_epi32(vfitab,ifour);
-            Y                = _mm256_load_pd( vftab + _mm_extract_epi32(vfitab,0) );
-            F                = _mm256_load_pd( vftab + _mm_extract_epi32(vfitab,1) );
-            G                = _mm256_load_pd( vftab + _mm_extract_epi32(vfitab,2) );
-            H                = _mm256_load_pd( vftab + _mm_extract_epi32(vfitab,3) );
-            GMX_MM256_FULLTRANSPOSE4_PD(Y,F,G,H);
-            Heps             = _mm256_mul_pd(vfeps,H);
-            Fp               = _mm256_add_pd(F,_mm256_mul_pd(vfeps,_mm256_add_pd(G,Heps)));
-            FF               = _mm256_add_pd(Fp,_mm256_mul_pd(vfeps,_mm256_add_pd(G,_mm256_add_pd(Heps,Heps))));
-            fvdw12           = _mm256_mul_pd(c12_00,FF);
-            fvdw             = _mm256_xor_pd(signbit,_mm256_mul_pd(_mm256_add_pd(fvdw6,fvdw12),_mm256_mul_pd(vftabscale,rinv00)));
-
-            fscal            = _mm256_add_pd(felec,fvdw);
-
-            fscal            = _mm256_andnot_pd(dummy_mask,fscal);
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm256_mul_pd(fscal,dx00);
-            ty               = _mm256_mul_pd(fscal,dy00);
-            tz               = _mm256_mul_pd(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm256_add_pd(fix0,tx);
-            fiy0             = _mm256_add_pd(fiy0,ty);
-            fiz0             = _mm256_add_pd(fiz0,tz);
-
-            fjptrA             = (jnrlistA>=0) ? f+j_coord_offsetA : scratch;
-            fjptrB             = (jnrlistB>=0) ? f+j_coord_offsetB : scratch;
-            fjptrC             = (jnrlistC>=0) ? f+j_coord_offsetC : scratch;
-            fjptrD             = (jnrlistD>=0) ? f+j_coord_offsetD : scratch;
-            gmx_mm256_decrement_1rvec_4ptr_swizzle_pd(fjptrA,fjptrB,fjptrC,fjptrD,tx,ty,tz);
-
-            /* Inner loop uses 82 flops */
-        }
-
-        /* End of innermost loop */
-
-        gmx_mm256_update_iforce_1atom_swizzle_pd(fix0,fiy0,fiz0,
-                                                 f+i_coord_offset,fshift+i_shift_offset);
-
-        dvdasum = _mm256_mul_pd(dvdasum, _mm256_mul_pd(isai0,isai0));
-        gmx_mm256_update_1pot_pd(dvdasum,dvda+inr);
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 7 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_F,outeriter*7 + inneriter*82);
-}
diff --git a/src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecGB_VdwLJ_GeomP1P1_avx_256_double.c b/src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecGB_VdwLJ_GeomP1P1_avx_256_double.c
deleted file mode 100644 (file)
index 132b4e6..0000000
+++ /dev/null
@@ -1,870 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
- * and including many others, as listed in the AUTHORS file in the
- * top-level source directory and at http://www.gromacs.org.
- *
- * GROMACS is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * GROMACS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GROMACS; if not, see
- * http://www.gnu.org/licenses, or write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
- *
- * If you want to redistribute modifications to GROMACS, please
- * consider that scientific software is very special. Version
- * control is crucial - bugs must be traceable. We will be happy to
- * consider code for inclusion in the official distribution, but
- * derived work must not be called official GROMACS. Details are found
- * in the README & COPYING files - if they are missing, get the
- * official version at http://www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the research papers on the package. Check out http://www.gromacs.org.
- */
-/*
- * Note: this file was generated by the GROMACS avx_256_double kernel generator.
- */
-#include "gmxpre.h"
-
-#include "config.h"
-
-#include <math.h>
-
-#include "../nb_kernel.h"
-#include "gromacs/gmxlib/nrnb.h"
-
-#include "kernelutil_x86_avx_256_double.h"
-
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_avx_256_double
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            LennardJones
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        PotentialAndForce
- */
-void
-nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_avx_256_double
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or 
-     * just 0 for non-waters.
-     * Suffixes A,B,C,D refer to j loop unrolling done with AVX, e.g. for the four different
-     * jnr indices corresponding to data put in the four positions in the SIMD register.
-     */
-    int              i_shift_offset,i_coord_offset,outeriter,inneriter;
-    int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
-    int              jnrA,jnrB,jnrC,jnrD;
-    int              jnrlistA,jnrlistB,jnrlistC,jnrlistD;
-    int              jnrlistE,jnrlistF,jnrlistG,jnrlistH;
-    int              j_coord_offsetA,j_coord_offsetB,j_coord_offsetC,j_coord_offsetD;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             rcutoff_scalar;
-    real             *shiftvec,*fshift,*x,*f;
-    real             *fjptrA,*fjptrB,*fjptrC,*fjptrD;
-    real             scratch[4*DIM];
-    __m256d          tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
-    real *           vdwioffsetptr0;
-    __m256d          ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0A,vdwjidx0B,vdwjidx0C,vdwjidx0D;
-    __m256d          jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    __m256d          dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
-    __m256d          velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    __m128i          gbitab;
-    __m256d          vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,gbeps,dvdatmp;
-    __m256d          minushalf = _mm256_set1_pd(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    int              nvdwtype;
-    __m256d          rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
-    int              *vdwtype;
-    real             *vdwparam;
-    __m256d          one_sixth   = _mm256_set1_pd(1.0/6.0);
-    __m256d          one_twelfth = _mm256_set1_pd(1.0/12.0);
-    __m128i          vfitab;
-    __m128i          ifour       = _mm_set1_epi32(4);
-    __m256d          rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF;
-    real             *vftab;
-    __m256d          dummy_mask,cutoff_mask;
-    __m128           tmpmask0,tmpmask1;
-    __m256d          signbit = _mm256_castsi256_pd( _mm256_set1_epi32(0x80000000) );
-    __m256d          one     = _mm256_set1_pd(1.0);
-    __m256d          two     = _mm256_set1_pd(2.0);
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = _mm256_set1_pd(fr->ic->epsfac);
-    charge           = mdatoms->chargeA;
-    nvdwtype         = fr->ntype;
-    vdwparam         = fr->nbfp;
-    vdwtype          = mdatoms->typeA;
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = _mm256_set1_pd(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = _mm256_set1_pd((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-
-    /* Avoid stupid compiler warnings */
-    jnrA = jnrB = jnrC = jnrD = 0;
-    j_coord_offsetA = 0;
-    j_coord_offsetB = 0;
-    j_coord_offsetC = 0;
-    j_coord_offsetD = 0;
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    for(iidx=0;iidx<4*DIM;iidx++)
-    {
-        scratch[iidx] = 0.0;
-    }
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        gmx_mm256_load_shift_and_1rvec_broadcast_pd(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
-
-        fix0             = _mm256_setzero_pd();
-        fiy0             = _mm256_setzero_pd();
-        fiz0             = _mm256_setzero_pd();
-
-        /* Load parameters for i particles */
-        iq0              = _mm256_mul_pd(facel,_mm256_set1_pd(charge[inr+0]));
-        isai0            = _mm256_set1_pd(invsqrta[inr+0]);
-        vdwioffsetptr0   = vdwparam+2*nvdwtype*vdwtype[inr+0];
-
-        /* Reset potential sums */
-        velecsum         = _mm256_setzero_pd();
-        vgbsum           = _mm256_setzero_pd();
-        vvdwsum          = _mm256_setzero_pd();
-        dvdasum          = _mm256_setzero_pd();
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end && jjnr[jidx+3]>=0; jidx+=4)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrA             = jjnr[jidx];
-            jnrB             = jjnr[jidx+1];
-            jnrC             = jjnr[jidx+2];
-            jnrD             = jjnr[jidx+3];
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-
-            /* load j atom coordinates */
-            gmx_mm256_load_1rvec_4ptr_swizzle_pd(x+j_coord_offsetA,x+j_coord_offsetB,
-                                                 x+j_coord_offsetC,x+j_coord_offsetD,
-                                                 &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm256_sub_pd(ix0,jx0);
-            dy00             = _mm256_sub_pd(iy0,jy0);
-            dz00             = _mm256_sub_pd(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm256_calc_rsq_pd(dx00,dy00,dz00);
-
-            rinv00           = avx256_invsqrt_d(rsq00);
-
-            rinvsq00         = _mm256_mul_pd(rinv00,rinv00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm256_load_4real_swizzle_pd(charge+jnrA+0,charge+jnrB+0,
-                                                                 charge+jnrC+0,charge+jnrD+0);
-            isaj0            = gmx_mm256_load_4real_swizzle_pd(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                                 invsqrta+jnrC+0,invsqrta+jnrD+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-            vdwjidx0B        = 2*vdwtype[jnrB+0];
-            vdwjidx0C        = 2*vdwtype[jnrC+0];
-            vdwjidx0D        = 2*vdwtype[jnrD+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm256_mul_pd(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm256_mul_pd(iq0,jq0);
-            gmx_mm256_load_4pair_swizzle_pd(vdwioffsetptr0+vdwjidx0A,
-                                            vdwioffsetptr0+vdwjidx0B,
-                                            vdwioffsetptr0+vdwjidx0C,
-                                            vdwioffsetptr0+vdwjidx0D,
-                                            &c6_00,&c12_00);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm256_mul_pd(isai0,isaj0);
-            gbqqfactor       = _mm256_xor_pd(signbit,_mm256_mul_pd(qq00,_mm256_mul_pd(isaprod,gbinvepsdiff)));
-            gbscale          = _mm256_mul_pd(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm256_mul_pd(r00,gbscale);
-            gbitab           = _mm256_cvttpd_epi32(rt);
-            gbeps            = _mm256_sub_pd(rt,_mm256_round_pd(rt, _MM_FROUND_FLOOR));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-            Y                = _mm256_load_pd( gbtab + _mm_extract_epi32(gbitab,0) );
-            F                = _mm256_load_pd( gbtab + _mm_extract_epi32(gbitab,1) );
-            G                = _mm256_load_pd( gbtab + _mm_extract_epi32(gbitab,2) );
-            H                = _mm256_load_pd( gbtab + _mm_extract_epi32(gbitab,3) );
-            GMX_MM256_FULLTRANSPOSE4_PD(Y,F,G,H);
-            Heps             = _mm256_mul_pd(gbeps,H);
-            Fp               = _mm256_add_pd(F,_mm256_mul_pd(gbeps,_mm256_add_pd(G,Heps)));
-            VV               = _mm256_add_pd(Y,_mm256_mul_pd(gbeps,Fp));
-            vgb              = _mm256_mul_pd(gbqqfactor,VV);
-
-            FF               = _mm256_add_pd(Fp,_mm256_mul_pd(gbeps,_mm256_add_pd(G,_mm256_add_pd(Heps,Heps))));
-            fgb              = _mm256_mul_pd(gbqqfactor,_mm256_mul_pd(FF,gbscale));
-            dvdatmp          = _mm256_mul_pd(minushalf,_mm256_add_pd(vgb,_mm256_mul_pd(fgb,r00)));
-            dvdasum          = _mm256_add_pd(dvdasum,dvdatmp);
-            fjptrA           = dvda+jnrA;
-            fjptrB           = dvda+jnrB;
-            fjptrC           = dvda+jnrC;
-            fjptrD           = dvda+jnrD;
-            gmx_mm256_increment_4real_swizzle_pd(fjptrA,fjptrB,fjptrC,fjptrD,
-                                                 _mm256_mul_pd(dvdatmp,_mm256_mul_pd(isaj0,isaj0)));
-            velec            = _mm256_mul_pd(qq00,rinv00);
-            felec            = _mm256_mul_pd(_mm256_sub_pd(_mm256_mul_pd(velec,rinv00),fgb),rinv00);
-
-            /* LENNARD-JONES DISPERSION/REPULSION */
-
-            rinvsix          = _mm256_mul_pd(_mm256_mul_pd(rinvsq00,rinvsq00),rinvsq00);
-            vvdw6            = _mm256_mul_pd(c6_00,rinvsix);
-            vvdw12           = _mm256_mul_pd(c12_00,_mm256_mul_pd(rinvsix,rinvsix));
-            vvdw             = _mm256_sub_pd( _mm256_mul_pd(vvdw12,one_twelfth) , _mm256_mul_pd(vvdw6,one_sixth) );
-            fvdw             = _mm256_mul_pd(_mm256_sub_pd(vvdw12,vvdw6),rinvsq00);
-
-            /* Update potential sum for this i atom from the interaction with this j atom. */
-            velecsum         = _mm256_add_pd(velecsum,velec);
-            vgbsum           = _mm256_add_pd(vgbsum,vgb);
-            vvdwsum          = _mm256_add_pd(vvdwsum,vvdw);
-
-            fscal            = _mm256_add_pd(felec,fvdw);
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm256_mul_pd(fscal,dx00);
-            ty               = _mm256_mul_pd(fscal,dy00);
-            tz               = _mm256_mul_pd(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm256_add_pd(fix0,tx);
-            fiy0             = _mm256_add_pd(fiy0,ty);
-            fiz0             = _mm256_add_pd(fiz0,tz);
-
-            fjptrA             = f+j_coord_offsetA;
-            fjptrB             = f+j_coord_offsetB;
-            fjptrC             = f+j_coord_offsetC;
-            fjptrD             = f+j_coord_offsetD;
-            gmx_mm256_decrement_1rvec_4ptr_swizzle_pd(fjptrA,fjptrB,fjptrC,fjptrD,tx,ty,tz);
-
-            /* Inner loop uses 70 flops */
-        }
-
-        if(jidx<j_index_end)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrlistA         = jjnr[jidx];
-            jnrlistB         = jjnr[jidx+1];
-            jnrlistC         = jjnr[jidx+2];
-            jnrlistD         = jjnr[jidx+3];
-            /* Sign of each element will be negative for non-real atoms.
-             * This mask will be 0xFFFFFFFF for dummy entries and 0x0 for real ones,
-             * so use it as val = _mm_andnot_pd(mask,val) to clear dummy entries.
-             */
-            tmpmask0 = gmx_mm_castsi128_ps(_mm_cmplt_epi32(_mm_loadu_si128((const __m128i *)(jjnr+jidx)),_mm_setzero_si128()));
-
-            tmpmask1 = _mm_permute_ps(tmpmask0,_GMX_MM_PERMUTE(3,3,2,2));
-            tmpmask0 = _mm_permute_ps(tmpmask0,_GMX_MM_PERMUTE(1,1,0,0));
-            dummy_mask = _mm256_castps_pd(gmx_mm256_set_m128(tmpmask1,tmpmask0));
-
-            jnrA       = (jnrlistA>=0) ? jnrlistA : 0;
-            jnrB       = (jnrlistB>=0) ? jnrlistB : 0;
-            jnrC       = (jnrlistC>=0) ? jnrlistC : 0;
-            jnrD       = (jnrlistD>=0) ? jnrlistD : 0;
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-
-            /* load j atom coordinates */
-            gmx_mm256_load_1rvec_4ptr_swizzle_pd(x+j_coord_offsetA,x+j_coord_offsetB,
-                                                 x+j_coord_offsetC,x+j_coord_offsetD,
-                                                 &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm256_sub_pd(ix0,jx0);
-            dy00             = _mm256_sub_pd(iy0,jy0);
-            dz00             = _mm256_sub_pd(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm256_calc_rsq_pd(dx00,dy00,dz00);
-
-            rinv00           = avx256_invsqrt_d(rsq00);
-
-            rinvsq00         = _mm256_mul_pd(rinv00,rinv00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm256_load_4real_swizzle_pd(charge+jnrA+0,charge+jnrB+0,
-                                                                 charge+jnrC+0,charge+jnrD+0);
-            isaj0            = gmx_mm256_load_4real_swizzle_pd(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                                 invsqrta+jnrC+0,invsqrta+jnrD+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-            vdwjidx0B        = 2*vdwtype[jnrB+0];
-            vdwjidx0C        = 2*vdwtype[jnrC+0];
-            vdwjidx0D        = 2*vdwtype[jnrD+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm256_mul_pd(rsq00,rinv00);
-            r00              = _mm256_andnot_pd(dummy_mask,r00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm256_mul_pd(iq0,jq0);
-            gmx_mm256_load_4pair_swizzle_pd(vdwioffsetptr0+vdwjidx0A,
-                                            vdwioffsetptr0+vdwjidx0B,
-                                            vdwioffsetptr0+vdwjidx0C,
-                                            vdwioffsetptr0+vdwjidx0D,
-                                            &c6_00,&c12_00);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm256_mul_pd(isai0,isaj0);
-            gbqqfactor       = _mm256_xor_pd(signbit,_mm256_mul_pd(qq00,_mm256_mul_pd(isaprod,gbinvepsdiff)));
-            gbscale          = _mm256_mul_pd(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm256_mul_pd(r00,gbscale);
-            gbitab           = _mm256_cvttpd_epi32(rt);
-            gbeps            = _mm256_sub_pd(rt,_mm256_round_pd(rt, _MM_FROUND_FLOOR));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-            Y                = _mm256_load_pd( gbtab + _mm_extract_epi32(gbitab,0) );
-            F                = _mm256_load_pd( gbtab + _mm_extract_epi32(gbitab,1) );
-            G                = _mm256_load_pd( gbtab + _mm_extract_epi32(gbitab,2) );
-            H                = _mm256_load_pd( gbtab + _mm_extract_epi32(gbitab,3) );
-            GMX_MM256_FULLTRANSPOSE4_PD(Y,F,G,H);
-            Heps             = _mm256_mul_pd(gbeps,H);
-            Fp               = _mm256_add_pd(F,_mm256_mul_pd(gbeps,_mm256_add_pd(G,Heps)));
-            VV               = _mm256_add_pd(Y,_mm256_mul_pd(gbeps,Fp));
-            vgb              = _mm256_mul_pd(gbqqfactor,VV);
-
-            FF               = _mm256_add_pd(Fp,_mm256_mul_pd(gbeps,_mm256_add_pd(G,_mm256_add_pd(Heps,Heps))));
-            fgb              = _mm256_mul_pd(gbqqfactor,_mm256_mul_pd(FF,gbscale));
-            dvdatmp          = _mm256_mul_pd(minushalf,_mm256_add_pd(vgb,_mm256_mul_pd(fgb,r00)));
-            dvdatmp          = _mm256_andnot_pd(dummy_mask,dvdatmp);
-            dvdasum          = _mm256_add_pd(dvdasum,dvdatmp);
-            /* The pointers to scratch make sure that this code with compilers that take gmx_restrict seriously (e.g. icc 13) really can't screw things up. */
-            fjptrA             = (jnrlistA>=0) ? dvda+jnrA : scratch;
-            fjptrB             = (jnrlistB>=0) ? dvda+jnrB : scratch;
-            fjptrC             = (jnrlistC>=0) ? dvda+jnrC : scratch;
-            fjptrD             = (jnrlistD>=0) ? dvda+jnrD : scratch;
-            gmx_mm256_increment_4real_swizzle_pd(fjptrA,fjptrB,fjptrC,fjptrD,
-                                                 _mm256_mul_pd(dvdatmp,_mm256_mul_pd(isaj0,isaj0)));
-            velec            = _mm256_mul_pd(qq00,rinv00);
-            felec            = _mm256_mul_pd(_mm256_sub_pd(_mm256_mul_pd(velec,rinv00),fgb),rinv00);
-
-            /* LENNARD-JONES DISPERSION/REPULSION */
-
-            rinvsix          = _mm256_mul_pd(_mm256_mul_pd(rinvsq00,rinvsq00),rinvsq00);
-            vvdw6            = _mm256_mul_pd(c6_00,rinvsix);
-            vvdw12           = _mm256_mul_pd(c12_00,_mm256_mul_pd(rinvsix,rinvsix));
-            vvdw             = _mm256_sub_pd( _mm256_mul_pd(vvdw12,one_twelfth) , _mm256_mul_pd(vvdw6,one_sixth) );
-            fvdw             = _mm256_mul_pd(_mm256_sub_pd(vvdw12,vvdw6),rinvsq00);
-
-            /* Update potential sum for this i atom from the interaction with this j atom. */
-            velec            = _mm256_andnot_pd(dummy_mask,velec);
-            velecsum         = _mm256_add_pd(velecsum,velec);
-            vgb              = _mm256_andnot_pd(dummy_mask,vgb);
-            vgbsum           = _mm256_add_pd(vgbsum,vgb);
-            vvdw             = _mm256_andnot_pd(dummy_mask,vvdw);
-            vvdwsum          = _mm256_add_pd(vvdwsum,vvdw);
-
-            fscal            = _mm256_add_pd(felec,fvdw);
-
-            fscal            = _mm256_andnot_pd(dummy_mask,fscal);
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm256_mul_pd(fscal,dx00);
-            ty               = _mm256_mul_pd(fscal,dy00);
-            tz               = _mm256_mul_pd(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm256_add_pd(fix0,tx);
-            fiy0             = _mm256_add_pd(fiy0,ty);
-            fiz0             = _mm256_add_pd(fiz0,tz);
-
-            fjptrA             = (jnrlistA>=0) ? f+j_coord_offsetA : scratch;
-            fjptrB             = (jnrlistB>=0) ? f+j_coord_offsetB : scratch;
-            fjptrC             = (jnrlistC>=0) ? f+j_coord_offsetC : scratch;
-            fjptrD             = (jnrlistD>=0) ? f+j_coord_offsetD : scratch;
-            gmx_mm256_decrement_1rvec_4ptr_swizzle_pd(fjptrA,fjptrB,fjptrC,fjptrD,tx,ty,tz);
-
-            /* Inner loop uses 71 flops */
-        }
-
-        /* End of innermost loop */
-
-        gmx_mm256_update_iforce_1atom_swizzle_pd(fix0,fiy0,fiz0,
-                                                 f+i_coord_offset,fshift+i_shift_offset);
-
-        ggid                        = gid[iidx];
-        /* Update potential energies */
-        gmx_mm256_update_1pot_pd(velecsum,kernel_data->energygrp_elec+ggid);
-        gmx_mm256_update_1pot_pd(vgbsum,kernel_data->energygrp_polarization+ggid);
-        gmx_mm256_update_1pot_pd(vvdwsum,kernel_data->energygrp_vdw+ggid);
-        dvdasum = _mm256_mul_pd(dvdasum, _mm256_mul_pd(isai0,isai0));
-        gmx_mm256_update_1pot_pd(dvdasum,dvda+inr);
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 10 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_VF,outeriter*10 + inneriter*71);
-}
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_avx_256_double
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            LennardJones
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        Force
- */
-void
-nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_avx_256_double
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or 
-     * just 0 for non-waters.
-     * Suffixes A,B,C,D refer to j loop unrolling done with AVX, e.g. for the four different
-     * jnr indices corresponding to data put in the four positions in the SIMD register.
-     */
-    int              i_shift_offset,i_coord_offset,outeriter,inneriter;
-    int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
-    int              jnrA,jnrB,jnrC,jnrD;
-    int              jnrlistA,jnrlistB,jnrlistC,jnrlistD;
-    int              jnrlistE,jnrlistF,jnrlistG,jnrlistH;
-    int              j_coord_offsetA,j_coord_offsetB,j_coord_offsetC,j_coord_offsetD;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             rcutoff_scalar;
-    real             *shiftvec,*fshift,*x,*f;
-    real             *fjptrA,*fjptrB,*fjptrC,*fjptrD;
-    real             scratch[4*DIM];
-    __m256d          tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
-    real *           vdwioffsetptr0;
-    __m256d          ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0A,vdwjidx0B,vdwjidx0C,vdwjidx0D;
-    __m256d          jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    __m256d          dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
-    __m256d          velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    __m128i          gbitab;
-    __m256d          vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,gbeps,dvdatmp;
-    __m256d          minushalf = _mm256_set1_pd(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    int              nvdwtype;
-    __m256d          rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
-    int              *vdwtype;
-    real             *vdwparam;
-    __m256d          one_sixth   = _mm256_set1_pd(1.0/6.0);
-    __m256d          one_twelfth = _mm256_set1_pd(1.0/12.0);
-    __m128i          vfitab;
-    __m128i          ifour       = _mm_set1_epi32(4);
-    __m256d          rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF;
-    real             *vftab;
-    __m256d          dummy_mask,cutoff_mask;
-    __m128           tmpmask0,tmpmask1;
-    __m256d          signbit = _mm256_castsi256_pd( _mm256_set1_epi32(0x80000000) );
-    __m256d          one     = _mm256_set1_pd(1.0);
-    __m256d          two     = _mm256_set1_pd(2.0);
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = _mm256_set1_pd(fr->ic->epsfac);
-    charge           = mdatoms->chargeA;
-    nvdwtype         = fr->ntype;
-    vdwparam         = fr->nbfp;
-    vdwtype          = mdatoms->typeA;
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = _mm256_set1_pd(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = _mm256_set1_pd((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-
-    /* Avoid stupid compiler warnings */
-    jnrA = jnrB = jnrC = jnrD = 0;
-    j_coord_offsetA = 0;
-    j_coord_offsetB = 0;
-    j_coord_offsetC = 0;
-    j_coord_offsetD = 0;
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    for(iidx=0;iidx<4*DIM;iidx++)
-    {
-        scratch[iidx] = 0.0;
-    }
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        gmx_mm256_load_shift_and_1rvec_broadcast_pd(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
-
-        fix0             = _mm256_setzero_pd();
-        fiy0             = _mm256_setzero_pd();
-        fiz0             = _mm256_setzero_pd();
-
-        /* Load parameters for i particles */
-        iq0              = _mm256_mul_pd(facel,_mm256_set1_pd(charge[inr+0]));
-        isai0            = _mm256_set1_pd(invsqrta[inr+0]);
-        vdwioffsetptr0   = vdwparam+2*nvdwtype*vdwtype[inr+0];
-
-        dvdasum          = _mm256_setzero_pd();
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end && jjnr[jidx+3]>=0; jidx+=4)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrA             = jjnr[jidx];
-            jnrB             = jjnr[jidx+1];
-            jnrC             = jjnr[jidx+2];
-            jnrD             = jjnr[jidx+3];
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-
-            /* load j atom coordinates */
-            gmx_mm256_load_1rvec_4ptr_swizzle_pd(x+j_coord_offsetA,x+j_coord_offsetB,
-                                                 x+j_coord_offsetC,x+j_coord_offsetD,
-                                                 &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm256_sub_pd(ix0,jx0);
-            dy00             = _mm256_sub_pd(iy0,jy0);
-            dz00             = _mm256_sub_pd(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm256_calc_rsq_pd(dx00,dy00,dz00);
-
-            rinv00           = avx256_invsqrt_d(rsq00);
-
-            rinvsq00         = _mm256_mul_pd(rinv00,rinv00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm256_load_4real_swizzle_pd(charge+jnrA+0,charge+jnrB+0,
-                                                                 charge+jnrC+0,charge+jnrD+0);
-            isaj0            = gmx_mm256_load_4real_swizzle_pd(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                                 invsqrta+jnrC+0,invsqrta+jnrD+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-            vdwjidx0B        = 2*vdwtype[jnrB+0];
-            vdwjidx0C        = 2*vdwtype[jnrC+0];
-            vdwjidx0D        = 2*vdwtype[jnrD+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm256_mul_pd(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm256_mul_pd(iq0,jq0);
-            gmx_mm256_load_4pair_swizzle_pd(vdwioffsetptr0+vdwjidx0A,
-                                            vdwioffsetptr0+vdwjidx0B,
-                                            vdwioffsetptr0+vdwjidx0C,
-                                            vdwioffsetptr0+vdwjidx0D,
-                                            &c6_00,&c12_00);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm256_mul_pd(isai0,isaj0);
-            gbqqfactor       = _mm256_xor_pd(signbit,_mm256_mul_pd(qq00,_mm256_mul_pd(isaprod,gbinvepsdiff)));
-            gbscale          = _mm256_mul_pd(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm256_mul_pd(r00,gbscale);
-            gbitab           = _mm256_cvttpd_epi32(rt);
-            gbeps            = _mm256_sub_pd(rt,_mm256_round_pd(rt, _MM_FROUND_FLOOR));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-            Y                = _mm256_load_pd( gbtab + _mm_extract_epi32(gbitab,0) );
-            F                = _mm256_load_pd( gbtab + _mm_extract_epi32(gbitab,1) );
-            G                = _mm256_load_pd( gbtab + _mm_extract_epi32(gbitab,2) );
-            H                = _mm256_load_pd( gbtab + _mm_extract_epi32(gbitab,3) );
-            GMX_MM256_FULLTRANSPOSE4_PD(Y,F,G,H);
-            Heps             = _mm256_mul_pd(gbeps,H);
-            Fp               = _mm256_add_pd(F,_mm256_mul_pd(gbeps,_mm256_add_pd(G,Heps)));
-            VV               = _mm256_add_pd(Y,_mm256_mul_pd(gbeps,Fp));
-            vgb              = _mm256_mul_pd(gbqqfactor,VV);
-
-            FF               = _mm256_add_pd(Fp,_mm256_mul_pd(gbeps,_mm256_add_pd(G,_mm256_add_pd(Heps,Heps))));
-            fgb              = _mm256_mul_pd(gbqqfactor,_mm256_mul_pd(FF,gbscale));
-            dvdatmp          = _mm256_mul_pd(minushalf,_mm256_add_pd(vgb,_mm256_mul_pd(fgb,r00)));
-            dvdasum          = _mm256_add_pd(dvdasum,dvdatmp);
-            fjptrA           = dvda+jnrA;
-            fjptrB           = dvda+jnrB;
-            fjptrC           = dvda+jnrC;
-            fjptrD           = dvda+jnrD;
-            gmx_mm256_increment_4real_swizzle_pd(fjptrA,fjptrB,fjptrC,fjptrD,
-                                                 _mm256_mul_pd(dvdatmp,_mm256_mul_pd(isaj0,isaj0)));
-            velec            = _mm256_mul_pd(qq00,rinv00);
-            felec            = _mm256_mul_pd(_mm256_sub_pd(_mm256_mul_pd(velec,rinv00),fgb),rinv00);
-
-            /* LENNARD-JONES DISPERSION/REPULSION */
-
-            rinvsix          = _mm256_mul_pd(_mm256_mul_pd(rinvsq00,rinvsq00),rinvsq00);
-            fvdw             = _mm256_mul_pd(_mm256_sub_pd(_mm256_mul_pd(c12_00,rinvsix),c6_00),_mm256_mul_pd(rinvsix,rinvsq00));
-
-            fscal            = _mm256_add_pd(felec,fvdw);
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm256_mul_pd(fscal,dx00);
-            ty               = _mm256_mul_pd(fscal,dy00);
-            tz               = _mm256_mul_pd(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm256_add_pd(fix0,tx);
-            fiy0             = _mm256_add_pd(fiy0,ty);
-            fiz0             = _mm256_add_pd(fiz0,tz);
-
-            fjptrA             = f+j_coord_offsetA;
-            fjptrB             = f+j_coord_offsetB;
-            fjptrC             = f+j_coord_offsetC;
-            fjptrD             = f+j_coord_offsetD;
-            gmx_mm256_decrement_1rvec_4ptr_swizzle_pd(fjptrA,fjptrB,fjptrC,fjptrD,tx,ty,tz);
-
-            /* Inner loop uses 63 flops */
-        }
-
-        if(jidx<j_index_end)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrlistA         = jjnr[jidx];
-            jnrlistB         = jjnr[jidx+1];
-            jnrlistC         = jjnr[jidx+2];
-            jnrlistD         = jjnr[jidx+3];
-            /* Sign of each element will be negative for non-real atoms.
-             * This mask will be 0xFFFFFFFF for dummy entries and 0x0 for real ones,
-             * so use it as val = _mm_andnot_pd(mask,val) to clear dummy entries.
-             */
-            tmpmask0 = gmx_mm_castsi128_ps(_mm_cmplt_epi32(_mm_loadu_si128((const __m128i *)(jjnr+jidx)),_mm_setzero_si128()));
-
-            tmpmask1 = _mm_permute_ps(tmpmask0,_GMX_MM_PERMUTE(3,3,2,2));
-            tmpmask0 = _mm_permute_ps(tmpmask0,_GMX_MM_PERMUTE(1,1,0,0));
-            dummy_mask = _mm256_castps_pd(gmx_mm256_set_m128(tmpmask1,tmpmask0));
-
-            jnrA       = (jnrlistA>=0) ? jnrlistA : 0;
-            jnrB       = (jnrlistB>=0) ? jnrlistB : 0;
-            jnrC       = (jnrlistC>=0) ? jnrlistC : 0;
-            jnrD       = (jnrlistD>=0) ? jnrlistD : 0;
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-
-            /* load j atom coordinates */
-            gmx_mm256_load_1rvec_4ptr_swizzle_pd(x+j_coord_offsetA,x+j_coord_offsetB,
-                                                 x+j_coord_offsetC,x+j_coord_offsetD,
-                                                 &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm256_sub_pd(ix0,jx0);
-            dy00             = _mm256_sub_pd(iy0,jy0);
-            dz00             = _mm256_sub_pd(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm256_calc_rsq_pd(dx00,dy00,dz00);
-
-            rinv00           = avx256_invsqrt_d(rsq00);
-
-            rinvsq00         = _mm256_mul_pd(rinv00,rinv00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm256_load_4real_swizzle_pd(charge+jnrA+0,charge+jnrB+0,
-                                                                 charge+jnrC+0,charge+jnrD+0);
-            isaj0            = gmx_mm256_load_4real_swizzle_pd(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                                 invsqrta+jnrC+0,invsqrta+jnrD+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-            vdwjidx0B        = 2*vdwtype[jnrB+0];
-            vdwjidx0C        = 2*vdwtype[jnrC+0];
-            vdwjidx0D        = 2*vdwtype[jnrD+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm256_mul_pd(rsq00,rinv00);
-            r00              = _mm256_andnot_pd(dummy_mask,r00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm256_mul_pd(iq0,jq0);
-            gmx_mm256_load_4pair_swizzle_pd(vdwioffsetptr0+vdwjidx0A,
-                                            vdwioffsetptr0+vdwjidx0B,
-                                            vdwioffsetptr0+vdwjidx0C,
-                                            vdwioffsetptr0+vdwjidx0D,
-                                            &c6_00,&c12_00);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm256_mul_pd(isai0,isaj0);
-            gbqqfactor       = _mm256_xor_pd(signbit,_mm256_mul_pd(qq00,_mm256_mul_pd(isaprod,gbinvepsdiff)));
-            gbscale          = _mm256_mul_pd(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm256_mul_pd(r00,gbscale);
-            gbitab           = _mm256_cvttpd_epi32(rt);
-            gbeps            = _mm256_sub_pd(rt,_mm256_round_pd(rt, _MM_FROUND_FLOOR));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-            Y                = _mm256_load_pd( gbtab + _mm_extract_epi32(gbitab,0) );
-            F                = _mm256_load_pd( gbtab + _mm_extract_epi32(gbitab,1) );
-            G                = _mm256_load_pd( gbtab + _mm_extract_epi32(gbitab,2) );
-            H                = _mm256_load_pd( gbtab + _mm_extract_epi32(gbitab,3) );
-            GMX_MM256_FULLTRANSPOSE4_PD(Y,F,G,H);
-            Heps             = _mm256_mul_pd(gbeps,H);
-            Fp               = _mm256_add_pd(F,_mm256_mul_pd(gbeps,_mm256_add_pd(G,Heps)));
-            VV               = _mm256_add_pd(Y,_mm256_mul_pd(gbeps,Fp));
-            vgb              = _mm256_mul_pd(gbqqfactor,VV);
-
-            FF               = _mm256_add_pd(Fp,_mm256_mul_pd(gbeps,_mm256_add_pd(G,_mm256_add_pd(Heps,Heps))));
-            fgb              = _mm256_mul_pd(gbqqfactor,_mm256_mul_pd(FF,gbscale));
-            dvdatmp          = _mm256_mul_pd(minushalf,_mm256_add_pd(vgb,_mm256_mul_pd(fgb,r00)));
-            dvdatmp          = _mm256_andnot_pd(dummy_mask,dvdatmp);
-            dvdasum          = _mm256_add_pd(dvdasum,dvdatmp);
-            /* The pointers to scratch make sure that this code with compilers that take gmx_restrict seriously (e.g. icc 13) really can't screw things up. */
-            fjptrA             = (jnrlistA>=0) ? dvda+jnrA : scratch;
-            fjptrB             = (jnrlistB>=0) ? dvda+jnrB : scratch;
-            fjptrC             = (jnrlistC>=0) ? dvda+jnrC : scratch;
-            fjptrD             = (jnrlistD>=0) ? dvda+jnrD : scratch;
-            gmx_mm256_increment_4real_swizzle_pd(fjptrA,fjptrB,fjptrC,fjptrD,
-                                                 _mm256_mul_pd(dvdatmp,_mm256_mul_pd(isaj0,isaj0)));
-            velec            = _mm256_mul_pd(qq00,rinv00);
-            felec            = _mm256_mul_pd(_mm256_sub_pd(_mm256_mul_pd(velec,rinv00),fgb),rinv00);
-
-            /* LENNARD-JONES DISPERSION/REPULSION */
-
-            rinvsix          = _mm256_mul_pd(_mm256_mul_pd(rinvsq00,rinvsq00),rinvsq00);
-            fvdw             = _mm256_mul_pd(_mm256_sub_pd(_mm256_mul_pd(c12_00,rinvsix),c6_00),_mm256_mul_pd(rinvsix,rinvsq00));
-
-            fscal            = _mm256_add_pd(felec,fvdw);
-
-            fscal            = _mm256_andnot_pd(dummy_mask,fscal);
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm256_mul_pd(fscal,dx00);
-            ty               = _mm256_mul_pd(fscal,dy00);
-            tz               = _mm256_mul_pd(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm256_add_pd(fix0,tx);
-            fiy0             = _mm256_add_pd(fiy0,ty);
-            fiz0             = _mm256_add_pd(fiz0,tz);
-
-            fjptrA             = (jnrlistA>=0) ? f+j_coord_offsetA : scratch;
-            fjptrB             = (jnrlistB>=0) ? f+j_coord_offsetB : scratch;
-            fjptrC             = (jnrlistC>=0) ? f+j_coord_offsetC : scratch;
-            fjptrD             = (jnrlistD>=0) ? f+j_coord_offsetD : scratch;
-            gmx_mm256_decrement_1rvec_4ptr_swizzle_pd(fjptrA,fjptrB,fjptrC,fjptrD,tx,ty,tz);
-
-            /* Inner loop uses 64 flops */
-        }
-
-        /* End of innermost loop */
-
-        gmx_mm256_update_iforce_1atom_swizzle_pd(fix0,fiy0,fiz0,
-                                                 f+i_coord_offset,fshift+i_shift_offset);
-
-        dvdasum = _mm256_mul_pd(dvdasum, _mm256_mul_pd(isai0,isai0));
-        gmx_mm256_update_1pot_pd(dvdasum,dvda+inr);
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 7 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_F,outeriter*7 + inneriter*64);
-}
diff --git a/src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecGB_VdwNone_GeomP1P1_avx_256_double.c b/src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_double/nb_kernel_ElecGB_VdwNone_GeomP1P1_avx_256_double.c
deleted file mode 100644 (file)
index a64785a..0000000
+++ /dev/null
@@ -1,775 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
- * and including many others, as listed in the AUTHORS file in the
- * top-level source directory and at http://www.gromacs.org.
- *
- * GROMACS is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * GROMACS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GROMACS; if not, see
- * http://www.gnu.org/licenses, or write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
- *
- * If you want to redistribute modifications to GROMACS, please
- * consider that scientific software is very special. Version
- * control is crucial - bugs must be traceable. We will be happy to
- * consider code for inclusion in the official distribution, but
- * derived work must not be called official GROMACS. Details are found
- * in the README & COPYING files - if they are missing, get the
- * official version at http://www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the research papers on the package. Check out http://www.gromacs.org.
- */
-/*
- * Note: this file was generated by the GROMACS avx_256_double kernel generator.
- */
-#include "gmxpre.h"
-
-#include "config.h"
-
-#include <math.h>
-
-#include "../nb_kernel.h"
-#include "gromacs/gmxlib/nrnb.h"
-
-#include "kernelutil_x86_avx_256_double.h"
-
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_avx_256_double
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            None
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        PotentialAndForce
- */
-void
-nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_avx_256_double
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or 
-     * just 0 for non-waters.
-     * Suffixes A,B,C,D refer to j loop unrolling done with AVX, e.g. for the four different
-     * jnr indices corresponding to data put in the four positions in the SIMD register.
-     */
-    int              i_shift_offset,i_coord_offset,outeriter,inneriter;
-    int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
-    int              jnrA,jnrB,jnrC,jnrD;
-    int              jnrlistA,jnrlistB,jnrlistC,jnrlistD;
-    int              jnrlistE,jnrlistF,jnrlistG,jnrlistH;
-    int              j_coord_offsetA,j_coord_offsetB,j_coord_offsetC,j_coord_offsetD;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             rcutoff_scalar;
-    real             *shiftvec,*fshift,*x,*f;
-    real             *fjptrA,*fjptrB,*fjptrC,*fjptrD;
-    real             scratch[4*DIM];
-    __m256d          tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
-    real *           vdwioffsetptr0;
-    __m256d          ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0A,vdwjidx0B,vdwjidx0C,vdwjidx0D;
-    __m256d          jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    __m256d          dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
-    __m256d          velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    __m128i          gbitab;
-    __m256d          vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,gbeps,dvdatmp;
-    __m256d          minushalf = _mm256_set1_pd(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    __m128i          vfitab;
-    __m128i          ifour       = _mm_set1_epi32(4);
-    __m256d          rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF;
-    real             *vftab;
-    __m256d          dummy_mask,cutoff_mask;
-    __m128           tmpmask0,tmpmask1;
-    __m256d          signbit = _mm256_castsi256_pd( _mm256_set1_epi32(0x80000000) );
-    __m256d          one     = _mm256_set1_pd(1.0);
-    __m256d          two     = _mm256_set1_pd(2.0);
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = _mm256_set1_pd(fr->ic->epsfac);
-    charge           = mdatoms->chargeA;
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = _mm256_set1_pd(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = _mm256_set1_pd((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-
-    /* Avoid stupid compiler warnings */
-    jnrA = jnrB = jnrC = jnrD = 0;
-    j_coord_offsetA = 0;
-    j_coord_offsetB = 0;
-    j_coord_offsetC = 0;
-    j_coord_offsetD = 0;
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    for(iidx=0;iidx<4*DIM;iidx++)
-    {
-        scratch[iidx] = 0.0;
-    }
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        gmx_mm256_load_shift_and_1rvec_broadcast_pd(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
-
-        fix0             = _mm256_setzero_pd();
-        fiy0             = _mm256_setzero_pd();
-        fiz0             = _mm256_setzero_pd();
-
-        /* Load parameters for i particles */
-        iq0              = _mm256_mul_pd(facel,_mm256_set1_pd(charge[inr+0]));
-        isai0            = _mm256_set1_pd(invsqrta[inr+0]);
-
-        /* Reset potential sums */
-        velecsum         = _mm256_setzero_pd();
-        vgbsum           = _mm256_setzero_pd();
-        dvdasum          = _mm256_setzero_pd();
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end && jjnr[jidx+3]>=0; jidx+=4)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrA             = jjnr[jidx];
-            jnrB             = jjnr[jidx+1];
-            jnrC             = jjnr[jidx+2];
-            jnrD             = jjnr[jidx+3];
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-
-            /* load j atom coordinates */
-            gmx_mm256_load_1rvec_4ptr_swizzle_pd(x+j_coord_offsetA,x+j_coord_offsetB,
-                                                 x+j_coord_offsetC,x+j_coord_offsetD,
-                                                 &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm256_sub_pd(ix0,jx0);
-            dy00             = _mm256_sub_pd(iy0,jy0);
-            dz00             = _mm256_sub_pd(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm256_calc_rsq_pd(dx00,dy00,dz00);
-
-            rinv00           = avx256_invsqrt_d(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm256_load_4real_swizzle_pd(charge+jnrA+0,charge+jnrB+0,
-                                                                 charge+jnrC+0,charge+jnrD+0);
-            isaj0            = gmx_mm256_load_4real_swizzle_pd(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                                 invsqrta+jnrC+0,invsqrta+jnrD+0);
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm256_mul_pd(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm256_mul_pd(iq0,jq0);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm256_mul_pd(isai0,isaj0);
-            gbqqfactor       = _mm256_xor_pd(signbit,_mm256_mul_pd(qq00,_mm256_mul_pd(isaprod,gbinvepsdiff)));
-            gbscale          = _mm256_mul_pd(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm256_mul_pd(r00,gbscale);
-            gbitab           = _mm256_cvttpd_epi32(rt);
-            gbeps            = _mm256_sub_pd(rt,_mm256_round_pd(rt, _MM_FROUND_FLOOR));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-            Y                = _mm256_load_pd( gbtab + _mm_extract_epi32(gbitab,0) );
-            F                = _mm256_load_pd( gbtab + _mm_extract_epi32(gbitab,1) );
-            G                = _mm256_load_pd( gbtab + _mm_extract_epi32(gbitab,2) );
-            H                = _mm256_load_pd( gbtab + _mm_extract_epi32(gbitab,3) );
-            GMX_MM256_FULLTRANSPOSE4_PD(Y,F,G,H);
-            Heps             = _mm256_mul_pd(gbeps,H);
-            Fp               = _mm256_add_pd(F,_mm256_mul_pd(gbeps,_mm256_add_pd(G,Heps)));
-            VV               = _mm256_add_pd(Y,_mm256_mul_pd(gbeps,Fp));
-            vgb              = _mm256_mul_pd(gbqqfactor,VV);
-
-            FF               = _mm256_add_pd(Fp,_mm256_mul_pd(gbeps,_mm256_add_pd(G,_mm256_add_pd(Heps,Heps))));
-            fgb              = _mm256_mul_pd(gbqqfactor,_mm256_mul_pd(FF,gbscale));
-            dvdatmp          = _mm256_mul_pd(minushalf,_mm256_add_pd(vgb,_mm256_mul_pd(fgb,r00)));
-            dvdasum          = _mm256_add_pd(dvdasum,dvdatmp);
-            fjptrA           = dvda+jnrA;
-            fjptrB           = dvda+jnrB;
-            fjptrC           = dvda+jnrC;
-            fjptrD           = dvda+jnrD;
-            gmx_mm256_increment_4real_swizzle_pd(fjptrA,fjptrB,fjptrC,fjptrD,
-                                                 _mm256_mul_pd(dvdatmp,_mm256_mul_pd(isaj0,isaj0)));
-            velec            = _mm256_mul_pd(qq00,rinv00);
-            felec            = _mm256_mul_pd(_mm256_sub_pd(_mm256_mul_pd(velec,rinv00),fgb),rinv00);
-
-            /* Update potential sum for this i atom from the interaction with this j atom. */
-            velecsum         = _mm256_add_pd(velecsum,velec);
-            vgbsum           = _mm256_add_pd(vgbsum,vgb);
-
-            fscal            = felec;
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm256_mul_pd(fscal,dx00);
-            ty               = _mm256_mul_pd(fscal,dy00);
-            tz               = _mm256_mul_pd(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm256_add_pd(fix0,tx);
-            fiy0             = _mm256_add_pd(fiy0,ty);
-            fiz0             = _mm256_add_pd(fiz0,tz);
-
-            fjptrA             = f+j_coord_offsetA;
-            fjptrB             = f+j_coord_offsetB;
-            fjptrC             = f+j_coord_offsetC;
-            fjptrD             = f+j_coord_offsetD;
-            gmx_mm256_decrement_1rvec_4ptr_swizzle_pd(fjptrA,fjptrB,fjptrC,fjptrD,tx,ty,tz);
-
-            /* Inner loop uses 57 flops */
-        }
-
-        if(jidx<j_index_end)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrlistA         = jjnr[jidx];
-            jnrlistB         = jjnr[jidx+1];
-            jnrlistC         = jjnr[jidx+2];
-            jnrlistD         = jjnr[jidx+3];
-            /* Sign of each element will be negative for non-real atoms.
-             * This mask will be 0xFFFFFFFF for dummy entries and 0x0 for real ones,
-             * so use it as val = _mm_andnot_pd(mask,val) to clear dummy entries.
-             */
-            tmpmask0 = gmx_mm_castsi128_ps(_mm_cmplt_epi32(_mm_loadu_si128((const __m128i *)(jjnr+jidx)),_mm_setzero_si128()));
-
-            tmpmask1 = _mm_permute_ps(tmpmask0,_GMX_MM_PERMUTE(3,3,2,2));
-            tmpmask0 = _mm_permute_ps(tmpmask0,_GMX_MM_PERMUTE(1,1,0,0));
-            dummy_mask = _mm256_castps_pd(gmx_mm256_set_m128(tmpmask1,tmpmask0));
-
-            jnrA       = (jnrlistA>=0) ? jnrlistA : 0;
-            jnrB       = (jnrlistB>=0) ? jnrlistB : 0;
-            jnrC       = (jnrlistC>=0) ? jnrlistC : 0;
-            jnrD       = (jnrlistD>=0) ? jnrlistD : 0;
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-
-            /* load j atom coordinates */
-            gmx_mm256_load_1rvec_4ptr_swizzle_pd(x+j_coord_offsetA,x+j_coord_offsetB,
-                                                 x+j_coord_offsetC,x+j_coord_offsetD,
-                                                 &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm256_sub_pd(ix0,jx0);
-            dy00             = _mm256_sub_pd(iy0,jy0);
-            dz00             = _mm256_sub_pd(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm256_calc_rsq_pd(dx00,dy00,dz00);
-
-            rinv00           = avx256_invsqrt_d(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm256_load_4real_swizzle_pd(charge+jnrA+0,charge+jnrB+0,
-                                                                 charge+jnrC+0,charge+jnrD+0);
-            isaj0            = gmx_mm256_load_4real_swizzle_pd(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                                 invsqrta+jnrC+0,invsqrta+jnrD+0);
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm256_mul_pd(rsq00,rinv00);
-            r00              = _mm256_andnot_pd(dummy_mask,r00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm256_mul_pd(iq0,jq0);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm256_mul_pd(isai0,isaj0);
-            gbqqfactor       = _mm256_xor_pd(signbit,_mm256_mul_pd(qq00,_mm256_mul_pd(isaprod,gbinvepsdiff)));
-            gbscale          = _mm256_mul_pd(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm256_mul_pd(r00,gbscale);
-            gbitab           = _mm256_cvttpd_epi32(rt);
-            gbeps            = _mm256_sub_pd(rt,_mm256_round_pd(rt, _MM_FROUND_FLOOR));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-            Y                = _mm256_load_pd( gbtab + _mm_extract_epi32(gbitab,0) );
-            F                = _mm256_load_pd( gbtab + _mm_extract_epi32(gbitab,1) );
-            G                = _mm256_load_pd( gbtab + _mm_extract_epi32(gbitab,2) );
-            H                = _mm256_load_pd( gbtab + _mm_extract_epi32(gbitab,3) );
-            GMX_MM256_FULLTRANSPOSE4_PD(Y,F,G,H);
-            Heps             = _mm256_mul_pd(gbeps,H);
-            Fp               = _mm256_add_pd(F,_mm256_mul_pd(gbeps,_mm256_add_pd(G,Heps)));
-            VV               = _mm256_add_pd(Y,_mm256_mul_pd(gbeps,Fp));
-            vgb              = _mm256_mul_pd(gbqqfactor,VV);
-
-            FF               = _mm256_add_pd(Fp,_mm256_mul_pd(gbeps,_mm256_add_pd(G,_mm256_add_pd(Heps,Heps))));
-            fgb              = _mm256_mul_pd(gbqqfactor,_mm256_mul_pd(FF,gbscale));
-            dvdatmp          = _mm256_mul_pd(minushalf,_mm256_add_pd(vgb,_mm256_mul_pd(fgb,r00)));
-            dvdatmp          = _mm256_andnot_pd(dummy_mask,dvdatmp);
-            dvdasum          = _mm256_add_pd(dvdasum,dvdatmp);
-            /* The pointers to scratch make sure that this code with compilers that take gmx_restrict seriously (e.g. icc 13) really can't screw things up. */
-            fjptrA             = (jnrlistA>=0) ? dvda+jnrA : scratch;
-            fjptrB             = (jnrlistB>=0) ? dvda+jnrB : scratch;
-            fjptrC             = (jnrlistC>=0) ? dvda+jnrC : scratch;
-            fjptrD             = (jnrlistD>=0) ? dvda+jnrD : scratch;
-            gmx_mm256_increment_4real_swizzle_pd(fjptrA,fjptrB,fjptrC,fjptrD,
-                                                 _mm256_mul_pd(dvdatmp,_mm256_mul_pd(isaj0,isaj0)));
-            velec            = _mm256_mul_pd(qq00,rinv00);
-            felec            = _mm256_mul_pd(_mm256_sub_pd(_mm256_mul_pd(velec,rinv00),fgb),rinv00);
-
-            /* Update potential sum for this i atom from the interaction with this j atom. */
-            velec            = _mm256_andnot_pd(dummy_mask,velec);
-            velecsum         = _mm256_add_pd(velecsum,velec);
-            vgb              = _mm256_andnot_pd(dummy_mask,vgb);
-            vgbsum           = _mm256_add_pd(vgbsum,vgb);
-
-            fscal            = felec;
-
-            fscal            = _mm256_andnot_pd(dummy_mask,fscal);
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm256_mul_pd(fscal,dx00);
-            ty               = _mm256_mul_pd(fscal,dy00);
-            tz               = _mm256_mul_pd(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm256_add_pd(fix0,tx);
-            fiy0             = _mm256_add_pd(fiy0,ty);
-            fiz0             = _mm256_add_pd(fiz0,tz);
-
-            fjptrA             = (jnrlistA>=0) ? f+j_coord_offsetA : scratch;
-            fjptrB             = (jnrlistB>=0) ? f+j_coord_offsetB : scratch;
-            fjptrC             = (jnrlistC>=0) ? f+j_coord_offsetC : scratch;
-            fjptrD             = (jnrlistD>=0) ? f+j_coord_offsetD : scratch;
-            gmx_mm256_decrement_1rvec_4ptr_swizzle_pd(fjptrA,fjptrB,fjptrC,fjptrD,tx,ty,tz);
-
-            /* Inner loop uses 58 flops */
-        }
-
-        /* End of innermost loop */
-
-        gmx_mm256_update_iforce_1atom_swizzle_pd(fix0,fiy0,fiz0,
-                                                 f+i_coord_offset,fshift+i_shift_offset);
-
-        ggid                        = gid[iidx];
-        /* Update potential energies */
-        gmx_mm256_update_1pot_pd(velecsum,kernel_data->energygrp_elec+ggid);
-        gmx_mm256_update_1pot_pd(vgbsum,kernel_data->energygrp_polarization+ggid);
-        dvdasum = _mm256_mul_pd(dvdasum, _mm256_mul_pd(isai0,isai0));
-        gmx_mm256_update_1pot_pd(dvdasum,dvda+inr);
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 9 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VF,outeriter*9 + inneriter*58);
-}
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwNone_GeomP1P1_F_avx_256_double
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            None
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        Force
- */
-void
-nb_kernel_ElecGB_VdwNone_GeomP1P1_F_avx_256_double
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or 
-     * just 0 for non-waters.
-     * Suffixes A,B,C,D refer to j loop unrolling done with AVX, e.g. for the four different
-     * jnr indices corresponding to data put in the four positions in the SIMD register.
-     */
-    int              i_shift_offset,i_coord_offset,outeriter,inneriter;
-    int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
-    int              jnrA,jnrB,jnrC,jnrD;
-    int              jnrlistA,jnrlistB,jnrlistC,jnrlistD;
-    int              jnrlistE,jnrlistF,jnrlistG,jnrlistH;
-    int              j_coord_offsetA,j_coord_offsetB,j_coord_offsetC,j_coord_offsetD;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             rcutoff_scalar;
-    real             *shiftvec,*fshift,*x,*f;
-    real             *fjptrA,*fjptrB,*fjptrC,*fjptrD;
-    real             scratch[4*DIM];
-    __m256d          tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
-    real *           vdwioffsetptr0;
-    __m256d          ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0A,vdwjidx0B,vdwjidx0C,vdwjidx0D;
-    __m256d          jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    __m256d          dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
-    __m256d          velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    __m128i          gbitab;
-    __m256d          vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,gbeps,dvdatmp;
-    __m256d          minushalf = _mm256_set1_pd(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    __m128i          vfitab;
-    __m128i          ifour       = _mm_set1_epi32(4);
-    __m256d          rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF;
-    real             *vftab;
-    __m256d          dummy_mask,cutoff_mask;
-    __m128           tmpmask0,tmpmask1;
-    __m256d          signbit = _mm256_castsi256_pd( _mm256_set1_epi32(0x80000000) );
-    __m256d          one     = _mm256_set1_pd(1.0);
-    __m256d          two     = _mm256_set1_pd(2.0);
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = _mm256_set1_pd(fr->ic->epsfac);
-    charge           = mdatoms->chargeA;
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = _mm256_set1_pd(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = _mm256_set1_pd((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-
-    /* Avoid stupid compiler warnings */
-    jnrA = jnrB = jnrC = jnrD = 0;
-    j_coord_offsetA = 0;
-    j_coord_offsetB = 0;
-    j_coord_offsetC = 0;
-    j_coord_offsetD = 0;
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    for(iidx=0;iidx<4*DIM;iidx++)
-    {
-        scratch[iidx] = 0.0;
-    }
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        gmx_mm256_load_shift_and_1rvec_broadcast_pd(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
-
-        fix0             = _mm256_setzero_pd();
-        fiy0             = _mm256_setzero_pd();
-        fiz0             = _mm256_setzero_pd();
-
-        /* Load parameters for i particles */
-        iq0              = _mm256_mul_pd(facel,_mm256_set1_pd(charge[inr+0]));
-        isai0            = _mm256_set1_pd(invsqrta[inr+0]);
-
-        dvdasum          = _mm256_setzero_pd();
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end && jjnr[jidx+3]>=0; jidx+=4)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrA             = jjnr[jidx];
-            jnrB             = jjnr[jidx+1];
-            jnrC             = jjnr[jidx+2];
-            jnrD             = jjnr[jidx+3];
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-
-            /* load j atom coordinates */
-            gmx_mm256_load_1rvec_4ptr_swizzle_pd(x+j_coord_offsetA,x+j_coord_offsetB,
-                                                 x+j_coord_offsetC,x+j_coord_offsetD,
-                                                 &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm256_sub_pd(ix0,jx0);
-            dy00             = _mm256_sub_pd(iy0,jy0);
-            dz00             = _mm256_sub_pd(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm256_calc_rsq_pd(dx00,dy00,dz00);
-
-            rinv00           = avx256_invsqrt_d(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm256_load_4real_swizzle_pd(charge+jnrA+0,charge+jnrB+0,
-                                                                 charge+jnrC+0,charge+jnrD+0);
-            isaj0            = gmx_mm256_load_4real_swizzle_pd(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                                 invsqrta+jnrC+0,invsqrta+jnrD+0);
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm256_mul_pd(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm256_mul_pd(iq0,jq0);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm256_mul_pd(isai0,isaj0);
-            gbqqfactor       = _mm256_xor_pd(signbit,_mm256_mul_pd(qq00,_mm256_mul_pd(isaprod,gbinvepsdiff)));
-            gbscale          = _mm256_mul_pd(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm256_mul_pd(r00,gbscale);
-            gbitab           = _mm256_cvttpd_epi32(rt);
-            gbeps            = _mm256_sub_pd(rt,_mm256_round_pd(rt, _MM_FROUND_FLOOR));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-            Y                = _mm256_load_pd( gbtab + _mm_extract_epi32(gbitab,0) );
-            F                = _mm256_load_pd( gbtab + _mm_extract_epi32(gbitab,1) );
-            G                = _mm256_load_pd( gbtab + _mm_extract_epi32(gbitab,2) );
-            H                = _mm256_load_pd( gbtab + _mm_extract_epi32(gbitab,3) );
-            GMX_MM256_FULLTRANSPOSE4_PD(Y,F,G,H);
-            Heps             = _mm256_mul_pd(gbeps,H);
-            Fp               = _mm256_add_pd(F,_mm256_mul_pd(gbeps,_mm256_add_pd(G,Heps)));
-            VV               = _mm256_add_pd(Y,_mm256_mul_pd(gbeps,Fp));
-            vgb              = _mm256_mul_pd(gbqqfactor,VV);
-
-            FF               = _mm256_add_pd(Fp,_mm256_mul_pd(gbeps,_mm256_add_pd(G,_mm256_add_pd(Heps,Heps))));
-            fgb              = _mm256_mul_pd(gbqqfactor,_mm256_mul_pd(FF,gbscale));
-            dvdatmp          = _mm256_mul_pd(minushalf,_mm256_add_pd(vgb,_mm256_mul_pd(fgb,r00)));
-            dvdasum          = _mm256_add_pd(dvdasum,dvdatmp);
-            fjptrA           = dvda+jnrA;
-            fjptrB           = dvda+jnrB;
-            fjptrC           = dvda+jnrC;
-            fjptrD           = dvda+jnrD;
-            gmx_mm256_increment_4real_swizzle_pd(fjptrA,fjptrB,fjptrC,fjptrD,
-                                                 _mm256_mul_pd(dvdatmp,_mm256_mul_pd(isaj0,isaj0)));
-            velec            = _mm256_mul_pd(qq00,rinv00);
-            felec            = _mm256_mul_pd(_mm256_sub_pd(_mm256_mul_pd(velec,rinv00),fgb),rinv00);
-
-            fscal            = felec;
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm256_mul_pd(fscal,dx00);
-            ty               = _mm256_mul_pd(fscal,dy00);
-            tz               = _mm256_mul_pd(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm256_add_pd(fix0,tx);
-            fiy0             = _mm256_add_pd(fiy0,ty);
-            fiz0             = _mm256_add_pd(fiz0,tz);
-
-            fjptrA             = f+j_coord_offsetA;
-            fjptrB             = f+j_coord_offsetB;
-            fjptrC             = f+j_coord_offsetC;
-            fjptrD             = f+j_coord_offsetD;
-            gmx_mm256_decrement_1rvec_4ptr_swizzle_pd(fjptrA,fjptrB,fjptrC,fjptrD,tx,ty,tz);
-
-            /* Inner loop uses 55 flops */
-        }
-
-        if(jidx<j_index_end)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrlistA         = jjnr[jidx];
-            jnrlistB         = jjnr[jidx+1];
-            jnrlistC         = jjnr[jidx+2];
-            jnrlistD         = jjnr[jidx+3];
-            /* Sign of each element will be negative for non-real atoms.
-             * This mask will be 0xFFFFFFFF for dummy entries and 0x0 for real ones,
-             * so use it as val = _mm_andnot_pd(mask,val) to clear dummy entries.
-             */
-            tmpmask0 = gmx_mm_castsi128_ps(_mm_cmplt_epi32(_mm_loadu_si128((const __m128i *)(jjnr+jidx)),_mm_setzero_si128()));
-
-            tmpmask1 = _mm_permute_ps(tmpmask0,_GMX_MM_PERMUTE(3,3,2,2));
-            tmpmask0 = _mm_permute_ps(tmpmask0,_GMX_MM_PERMUTE(1,1,0,0));
-            dummy_mask = _mm256_castps_pd(gmx_mm256_set_m128(tmpmask1,tmpmask0));
-
-            jnrA       = (jnrlistA>=0) ? jnrlistA : 0;
-            jnrB       = (jnrlistB>=0) ? jnrlistB : 0;
-            jnrC       = (jnrlistC>=0) ? jnrlistC : 0;
-            jnrD       = (jnrlistD>=0) ? jnrlistD : 0;
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-
-            /* load j atom coordinates */
-            gmx_mm256_load_1rvec_4ptr_swizzle_pd(x+j_coord_offsetA,x+j_coord_offsetB,
-                                                 x+j_coord_offsetC,x+j_coord_offsetD,
-                                                 &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm256_sub_pd(ix0,jx0);
-            dy00             = _mm256_sub_pd(iy0,jy0);
-            dz00             = _mm256_sub_pd(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm256_calc_rsq_pd(dx00,dy00,dz00);
-
-            rinv00           = avx256_invsqrt_d(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm256_load_4real_swizzle_pd(charge+jnrA+0,charge+jnrB+0,
-                                                                 charge+jnrC+0,charge+jnrD+0);
-            isaj0            = gmx_mm256_load_4real_swizzle_pd(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                                 invsqrta+jnrC+0,invsqrta+jnrD+0);
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm256_mul_pd(rsq00,rinv00);
-            r00              = _mm256_andnot_pd(dummy_mask,r00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm256_mul_pd(iq0,jq0);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm256_mul_pd(isai0,isaj0);
-            gbqqfactor       = _mm256_xor_pd(signbit,_mm256_mul_pd(qq00,_mm256_mul_pd(isaprod,gbinvepsdiff)));
-            gbscale          = _mm256_mul_pd(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm256_mul_pd(r00,gbscale);
-            gbitab           = _mm256_cvttpd_epi32(rt);
-            gbeps            = _mm256_sub_pd(rt,_mm256_round_pd(rt, _MM_FROUND_FLOOR));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-            Y                = _mm256_load_pd( gbtab + _mm_extract_epi32(gbitab,0) );
-            F                = _mm256_load_pd( gbtab + _mm_extract_epi32(gbitab,1) );
-            G                = _mm256_load_pd( gbtab + _mm_extract_epi32(gbitab,2) );
-            H                = _mm256_load_pd( gbtab + _mm_extract_epi32(gbitab,3) );
-            GMX_MM256_FULLTRANSPOSE4_PD(Y,F,G,H);
-            Heps             = _mm256_mul_pd(gbeps,H);
-            Fp               = _mm256_add_pd(F,_mm256_mul_pd(gbeps,_mm256_add_pd(G,Heps)));
-            VV               = _mm256_add_pd(Y,_mm256_mul_pd(gbeps,Fp));
-            vgb              = _mm256_mul_pd(gbqqfactor,VV);
-
-            FF               = _mm256_add_pd(Fp,_mm256_mul_pd(gbeps,_mm256_add_pd(G,_mm256_add_pd(Heps,Heps))));
-            fgb              = _mm256_mul_pd(gbqqfactor,_mm256_mul_pd(FF,gbscale));
-            dvdatmp          = _mm256_mul_pd(minushalf,_mm256_add_pd(vgb,_mm256_mul_pd(fgb,r00)));
-            dvdatmp          = _mm256_andnot_pd(dummy_mask,dvdatmp);
-            dvdasum          = _mm256_add_pd(dvdasum,dvdatmp);
-            /* The pointers to scratch make sure that this code with compilers that take gmx_restrict seriously (e.g. icc 13) really can't screw things up. */
-            fjptrA             = (jnrlistA>=0) ? dvda+jnrA : scratch;
-            fjptrB             = (jnrlistB>=0) ? dvda+jnrB : scratch;
-            fjptrC             = (jnrlistC>=0) ? dvda+jnrC : scratch;
-            fjptrD             = (jnrlistD>=0) ? dvda+jnrD : scratch;
-            gmx_mm256_increment_4real_swizzle_pd(fjptrA,fjptrB,fjptrC,fjptrD,
-                                                 _mm256_mul_pd(dvdatmp,_mm256_mul_pd(isaj0,isaj0)));
-            velec            = _mm256_mul_pd(qq00,rinv00);
-            felec            = _mm256_mul_pd(_mm256_sub_pd(_mm256_mul_pd(velec,rinv00),fgb),rinv00);
-
-            fscal            = felec;
-
-            fscal            = _mm256_andnot_pd(dummy_mask,fscal);
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm256_mul_pd(fscal,dx00);
-            ty               = _mm256_mul_pd(fscal,dy00);
-            tz               = _mm256_mul_pd(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm256_add_pd(fix0,tx);
-            fiy0             = _mm256_add_pd(fiy0,ty);
-            fiz0             = _mm256_add_pd(fiz0,tz);
-
-            fjptrA             = (jnrlistA>=0) ? f+j_coord_offsetA : scratch;
-            fjptrB             = (jnrlistB>=0) ? f+j_coord_offsetB : scratch;
-            fjptrC             = (jnrlistC>=0) ? f+j_coord_offsetC : scratch;
-            fjptrD             = (jnrlistD>=0) ? f+j_coord_offsetD : scratch;
-            gmx_mm256_decrement_1rvec_4ptr_swizzle_pd(fjptrA,fjptrB,fjptrC,fjptrD,tx,ty,tz);
-
-            /* Inner loop uses 56 flops */
-        }
-
-        /* End of innermost loop */
-
-        gmx_mm256_update_iforce_1atom_swizzle_pd(fix0,fiy0,fiz0,
-                                                 f+i_coord_offset,fshift+i_shift_offset);
-
-        dvdasum = _mm256_mul_pd(dvdasum, _mm256_mul_pd(isai0,isai0));
-        gmx_mm256_update_1pot_pd(dvdasum,dvda+inr);
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 7 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_F,outeriter*7 + inneriter*56);
-}
index 9265074e2738cc2572d916bea284faa3113875ab..b695cfff258f9f36c947192aa14c2b499acc8cca 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -51,6 +51,36 @@ nb_kernel_t nb_kernel_ElecNone_VdwLJSw_GeomP1P1_VF_avx_256_double;
 nb_kernel_t nb_kernel_ElecNone_VdwLJSw_GeomP1P1_F_avx_256_double;
 nb_kernel_t nb_kernel_ElecNone_VdwCSTab_GeomP1P1_VF_avx_256_double;
 nb_kernel_t nb_kernel_ElecNone_VdwCSTab_GeomP1P1_F_avx_256_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_avx_256_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_avx_256_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_avx_256_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_avx_256_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_avx_256_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_avx_256_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_avx_256_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_avx_256_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_avx_256_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_avx_256_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_avx_256_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_avx_256_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_avx_256_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_avx_256_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_avx_256_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_avx_256_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_avx_256_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_avx_256_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_avx_256_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_avx_256_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_avx_256_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_avx_256_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_avx_256_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_avx_256_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_avx_256_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_avx_256_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_avx_256_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_avx_256_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_avx_256_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_avx_256_double;
 nb_kernel_t nb_kernel_ElecEw_VdwLJEw_GeomP1P1_VF_avx_256_double;
 nb_kernel_t nb_kernel_ElecEw_VdwLJEw_GeomP1P1_F_avx_256_double;
 nb_kernel_t nb_kernel_ElecEw_VdwLJEw_GeomW3P1_VF_avx_256_double;
@@ -141,72 +171,6 @@ nb_kernel_t nb_kernel_ElecEwSw_VdwNone_GeomW4P1_VF_avx_256_double;
 nb_kernel_t nb_kernel_ElecEwSw_VdwNone_GeomW4P1_F_avx_256_double;
 nb_kernel_t nb_kernel_ElecEwSw_VdwNone_GeomW4W4_VF_avx_256_double;
 nb_kernel_t nb_kernel_ElecEwSw_VdwNone_GeomW4W4_F_avx_256_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_avx_256_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_avx_256_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_avx_256_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_avx_256_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_avx_256_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_avx_256_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_avx_256_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_avx_256_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_avx_256_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_avx_256_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_avx_256_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_avx_256_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_avx_256_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_avx_256_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_avx_256_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_avx_256_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_avx_256_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_avx_256_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_avx_256_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_avx_256_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_avx_256_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_avx_256_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_avx_256_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_avx_256_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_avx_256_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_avx_256_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_avx_256_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_avx_256_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_avx_256_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_avx_256_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_avx_256_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_avx_256_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_avx_256_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_avx_256_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_avx_256_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_avx_256_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_avx_256_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_avx_256_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_avx_256_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_avx_256_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_avx_256_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_avx_256_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_avx_256_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_avx_256_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_avx_256_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_avx_256_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_avx_256_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_avx_256_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_avx_256_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_avx_256_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_avx_256_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_avx_256_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_avx_256_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_avx_256_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_avx_256_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_avx_256_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_avx_256_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_avx_256_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_avx_256_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_avx_256_double;
-nb_kernel_t nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_avx_256_double;
-nb_kernel_t nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_avx_256_double;
-nb_kernel_t nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_avx_256_double;
-nb_kernel_t nb_kernel_ElecGB_VdwNone_GeomP1P1_F_avx_256_double;
-nb_kernel_t nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_avx_256_double;
-nb_kernel_t nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_avx_256_double;
 nb_kernel_t nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_VF_avx_256_double;
 nb_kernel_t nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_F_avx_256_double;
 nb_kernel_t nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_VF_avx_256_double;
@@ -277,6 +241,36 @@ nb_kernel_t nb_kernel_ElecRF_VdwCSTab_GeomW4P1_VF_avx_256_double;
 nb_kernel_t nb_kernel_ElecRF_VdwCSTab_GeomW4P1_F_avx_256_double;
 nb_kernel_t nb_kernel_ElecRF_VdwCSTab_GeomW4W4_VF_avx_256_double;
 nb_kernel_t nb_kernel_ElecRF_VdwCSTab_GeomW4W4_F_avx_256_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_avx_256_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_avx_256_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_avx_256_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_avx_256_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_avx_256_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_avx_256_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_avx_256_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_avx_256_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_avx_256_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_avx_256_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_avx_256_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_avx_256_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_avx_256_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_avx_256_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_avx_256_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_avx_256_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_avx_256_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_avx_256_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_avx_256_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_avx_256_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_avx_256_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_avx_256_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_avx_256_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_avx_256_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_avx_256_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_avx_256_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_avx_256_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_avx_256_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_avx_256_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_avx_256_double;
 
 
 nb_kernel_info_t
@@ -294,6 +288,36 @@ nb_kernel_info_t
     { nb_kernel_ElecNone_VdwLJSw_GeomP1P1_F_avx_256_double, "nb_kernel_ElecNone_VdwLJSw_GeomP1P1_F_avx_256_double", "avx_256_double", "None", "None", "LennardJones", "PotentialSwitch", "ParticleParticle", "", "Force" },
     { nb_kernel_ElecNone_VdwCSTab_GeomP1P1_VF_avx_256_double, "nb_kernel_ElecNone_VdwCSTab_GeomP1P1_VF_avx_256_double", "avx_256_double", "None", "None", "CubicSplineTable", "None", "ParticleParticle", "", "PotentialAndForce" },
     { nb_kernel_ElecNone_VdwCSTab_GeomP1P1_F_avx_256_double, "nb_kernel_ElecNone_VdwCSTab_GeomP1P1_F_avx_256_double", "avx_256_double", "None", "None", "CubicSplineTable", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_avx_256_double, "nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "LennardJones", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_avx_256_double, "nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "LennardJones", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_avx_256_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "LennardJones", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_avx_256_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "LennardJones", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_avx_256_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "LennardJones", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_avx_256_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "LennardJones", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_avx_256_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "LennardJones", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_avx_256_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "LennardJones", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_avx_256_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "LennardJones", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_avx_256_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "LennardJones", "None", "Water4Water4", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_avx_256_double, "nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "None", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_avx_256_double, "nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "None", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_avx_256_double, "nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "None", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_avx_256_double, "nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "None", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_avx_256_double, "nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "None", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_avx_256_double, "nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "None", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_avx_256_double, "nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "None", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_avx_256_double, "nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "None", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_avx_256_double, "nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "None", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_avx_256_double, "nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "None", "None", "Water4Water4", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_avx_256_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_avx_256_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_avx_256_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_avx_256_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_avx_256_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_avx_256_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_avx_256_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_avx_256_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_avx_256_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_avx_256_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Water4", "", "Force" },
     { nb_kernel_ElecEw_VdwLJEw_GeomP1P1_VF_avx_256_double, "nb_kernel_ElecEw_VdwLJEw_GeomP1P1_VF_avx_256_double", "avx_256_double", "Ewald", "None", "LJEwald", "None", "ParticleParticle", "", "PotentialAndForce" },
     { nb_kernel_ElecEw_VdwLJEw_GeomP1P1_F_avx_256_double, "nb_kernel_ElecEw_VdwLJEw_GeomP1P1_F_avx_256_double", "avx_256_double", "Ewald", "None", "LJEwald", "None", "ParticleParticle", "", "Force" },
     { nb_kernel_ElecEw_VdwLJEw_GeomW3P1_VF_avx_256_double, "nb_kernel_ElecEw_VdwLJEw_GeomW3P1_VF_avx_256_double", "avx_256_double", "Ewald", "None", "LJEwald", "None", "Water3Particle", "", "PotentialAndForce" },
@@ -384,72 +408,6 @@ nb_kernel_info_t
     { nb_kernel_ElecEwSw_VdwNone_GeomW4P1_F_avx_256_double, "nb_kernel_ElecEwSw_VdwNone_GeomW4P1_F_avx_256_double", "avx_256_double", "Ewald", "PotentialSwitch", "None", "None", "Water4Particle", "", "Force" },
     { nb_kernel_ElecEwSw_VdwNone_GeomW4W4_VF_avx_256_double, "nb_kernel_ElecEwSw_VdwNone_GeomW4W4_VF_avx_256_double", "avx_256_double", "Ewald", "PotentialSwitch", "None", "None", "Water4Water4", "", "PotentialAndForce" },
     { nb_kernel_ElecEwSw_VdwNone_GeomW4W4_F_avx_256_double, "nb_kernel_ElecEwSw_VdwNone_GeomW4W4_F_avx_256_double", "avx_256_double", "Ewald", "PotentialSwitch", "None", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_avx_256_double, "nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_avx_256_double", "avx_256_double", "Coulomb", "None", "LennardJones", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_avx_256_double, "nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_avx_256_double", "avx_256_double", "Coulomb", "None", "LennardJones", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_avx_256_double, "nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_avx_256_double", "avx_256_double", "Coulomb", "None", "LennardJones", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_avx_256_double, "nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_avx_256_double", "avx_256_double", "Coulomb", "None", "LennardJones", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_avx_256_double, "nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_avx_256_double", "avx_256_double", "Coulomb", "None", "LennardJones", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_avx_256_double, "nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_avx_256_double", "avx_256_double", "Coulomb", "None", "LennardJones", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_avx_256_double, "nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_avx_256_double", "avx_256_double", "Coulomb", "None", "LennardJones", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_avx_256_double, "nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_avx_256_double", "avx_256_double", "Coulomb", "None", "LennardJones", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_avx_256_double, "nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_avx_256_double", "avx_256_double", "Coulomb", "None", "LennardJones", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_avx_256_double, "nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_avx_256_double", "avx_256_double", "Coulomb", "None", "LennardJones", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_avx_256_double, "nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_avx_256_double", "avx_256_double", "Coulomb", "None", "None", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_avx_256_double, "nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_avx_256_double", "avx_256_double", "Coulomb", "None", "None", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_avx_256_double, "nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_avx_256_double", "avx_256_double", "Coulomb", "None", "None", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_avx_256_double, "nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_avx_256_double", "avx_256_double", "Coulomb", "None", "None", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_avx_256_double, "nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_avx_256_double", "avx_256_double", "Coulomb", "None", "None", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_avx_256_double, "nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_avx_256_double", "avx_256_double", "Coulomb", "None", "None", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_avx_256_double, "nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_avx_256_double", "avx_256_double", "Coulomb", "None", "None", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_avx_256_double, "nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_avx_256_double", "avx_256_double", "Coulomb", "None", "None", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_avx_256_double, "nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_avx_256_double", "avx_256_double", "Coulomb", "None", "None", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_avx_256_double, "nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_avx_256_double", "avx_256_double", "Coulomb", "None", "None", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_avx_256_double, "nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_avx_256_double", "avx_256_double", "Coulomb", "None", "CubicSplineTable", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_avx_256_double, "nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_avx_256_double", "avx_256_double", "Coulomb", "None", "CubicSplineTable", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_avx_256_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_avx_256_double", "avx_256_double", "Coulomb", "None", "CubicSplineTable", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_avx_256_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_avx_256_double", "avx_256_double", "Coulomb", "None", "CubicSplineTable", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_avx_256_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_avx_256_double", "avx_256_double", "Coulomb", "None", "CubicSplineTable", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_avx_256_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_avx_256_double", "avx_256_double", "Coulomb", "None", "CubicSplineTable", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_avx_256_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_avx_256_double", "avx_256_double", "Coulomb", "None", "CubicSplineTable", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_avx_256_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_avx_256_double", "avx_256_double", "Coulomb", "None", "CubicSplineTable", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_avx_256_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_avx_256_double", "avx_256_double", "Coulomb", "None", "CubicSplineTable", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_avx_256_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_avx_256_double", "avx_256_double", "Coulomb", "None", "CubicSplineTable", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_avx_256_double, "nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "LennardJones", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_avx_256_double, "nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "LennardJones", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_avx_256_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "LennardJones", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_avx_256_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "LennardJones", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_avx_256_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "LennardJones", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_avx_256_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "LennardJones", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_avx_256_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "LennardJones", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_avx_256_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "LennardJones", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_avx_256_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "LennardJones", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_avx_256_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "LennardJones", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_avx_256_double, "nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "None", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_avx_256_double, "nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "None", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_avx_256_double, "nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "None", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_avx_256_double, "nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "None", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_avx_256_double, "nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "None", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_avx_256_double, "nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "None", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_avx_256_double, "nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "None", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_avx_256_double, "nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "None", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_avx_256_double, "nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "None", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_avx_256_double, "nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "None", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_avx_256_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_avx_256_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_avx_256_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_avx_256_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_avx_256_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_avx_256_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_avx_256_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_avx_256_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_avx_256_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_avx_256_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_avx_256_double", "avx_256_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_avx_256_double, "nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_avx_256_double", "avx_256_double", "GeneralizedBorn", "None", "LennardJones", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_avx_256_double, "nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_avx_256_double", "avx_256_double", "GeneralizedBorn", "None", "LennardJones", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_avx_256_double, "nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_avx_256_double", "avx_256_double", "GeneralizedBorn", "None", "None", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecGB_VdwNone_GeomP1P1_F_avx_256_double, "nb_kernel_ElecGB_VdwNone_GeomP1P1_F_avx_256_double", "avx_256_double", "GeneralizedBorn", "None", "None", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_avx_256_double, "nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_avx_256_double", "avx_256_double", "GeneralizedBorn", "None", "CubicSplineTable", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_avx_256_double, "nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_avx_256_double", "avx_256_double", "GeneralizedBorn", "None", "CubicSplineTable", "None", "ParticleParticle", "", "Force" },
     { nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_VF_avx_256_double, "nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_VF_avx_256_double", "avx_256_double", "ReactionField", "ExactCutoff", "LennardJones", "PotentialShift", "ParticleParticle", "", "PotentialAndForce" },
     { nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_F_avx_256_double, "nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_F_avx_256_double", "avx_256_double", "ReactionField", "ExactCutoff", "LennardJones", "PotentialShift", "ParticleParticle", "", "Force" },
     { nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_VF_avx_256_double, "nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_VF_avx_256_double", "avx_256_double", "ReactionField", "ExactCutoff", "LennardJones", "PotentialShift", "Water3Particle", "", "PotentialAndForce" },
@@ -519,7 +477,37 @@ nb_kernel_info_t
     { nb_kernel_ElecRF_VdwCSTab_GeomW4P1_VF_avx_256_double, "nb_kernel_ElecRF_VdwCSTab_GeomW4P1_VF_avx_256_double", "avx_256_double", "ReactionField", "None", "CubicSplineTable", "None", "Water4Particle", "", "PotentialAndForce" },
     { nb_kernel_ElecRF_VdwCSTab_GeomW4P1_F_avx_256_double, "nb_kernel_ElecRF_VdwCSTab_GeomW4P1_F_avx_256_double", "avx_256_double", "ReactionField", "None", "CubicSplineTable", "None", "Water4Particle", "", "Force" },
     { nb_kernel_ElecRF_VdwCSTab_GeomW4W4_VF_avx_256_double, "nb_kernel_ElecRF_VdwCSTab_GeomW4W4_VF_avx_256_double", "avx_256_double", "ReactionField", "None", "CubicSplineTable", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecRF_VdwCSTab_GeomW4W4_F_avx_256_double, "nb_kernel_ElecRF_VdwCSTab_GeomW4W4_F_avx_256_double", "avx_256_double", "ReactionField", "None", "CubicSplineTable", "None", "Water4Water4", "", "Force" }
+    { nb_kernel_ElecRF_VdwCSTab_GeomW4W4_F_avx_256_double, "nb_kernel_ElecRF_VdwCSTab_GeomW4W4_F_avx_256_double", "avx_256_double", "ReactionField", "None", "CubicSplineTable", "None", "Water4Water4", "", "Force" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_avx_256_double, "nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_avx_256_double", "avx_256_double", "Coulomb", "None", "LennardJones", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_avx_256_double, "nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_avx_256_double", "avx_256_double", "Coulomb", "None", "LennardJones", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_avx_256_double, "nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_avx_256_double", "avx_256_double", "Coulomb", "None", "LennardJones", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_avx_256_double, "nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_avx_256_double", "avx_256_double", "Coulomb", "None", "LennardJones", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_avx_256_double, "nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_avx_256_double", "avx_256_double", "Coulomb", "None", "LennardJones", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_avx_256_double, "nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_avx_256_double", "avx_256_double", "Coulomb", "None", "LennardJones", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_avx_256_double, "nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_avx_256_double", "avx_256_double", "Coulomb", "None", "LennardJones", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_avx_256_double, "nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_avx_256_double", "avx_256_double", "Coulomb", "None", "LennardJones", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_avx_256_double, "nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_avx_256_double", "avx_256_double", "Coulomb", "None", "LennardJones", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_avx_256_double, "nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_avx_256_double", "avx_256_double", "Coulomb", "None", "LennardJones", "None", "Water4Water4", "", "Force" },
+    { nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_avx_256_double, "nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_avx_256_double", "avx_256_double", "Coulomb", "None", "None", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_avx_256_double, "nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_avx_256_double", "avx_256_double", "Coulomb", "None", "None", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_avx_256_double, "nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_avx_256_double", "avx_256_double", "Coulomb", "None", "None", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_avx_256_double, "nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_avx_256_double", "avx_256_double", "Coulomb", "None", "None", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_avx_256_double, "nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_avx_256_double", "avx_256_double", "Coulomb", "None", "None", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_avx_256_double, "nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_avx_256_double", "avx_256_double", "Coulomb", "None", "None", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_avx_256_double, "nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_avx_256_double", "avx_256_double", "Coulomb", "None", "None", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_avx_256_double, "nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_avx_256_double", "avx_256_double", "Coulomb", "None", "None", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_avx_256_double, "nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_avx_256_double", "avx_256_double", "Coulomb", "None", "None", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_avx_256_double, "nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_avx_256_double", "avx_256_double", "Coulomb", "None", "None", "None", "Water4Water4", "", "Force" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_avx_256_double, "nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_avx_256_double", "avx_256_double", "Coulomb", "None", "CubicSplineTable", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_avx_256_double, "nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_avx_256_double", "avx_256_double", "Coulomb", "None", "CubicSplineTable", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_avx_256_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_avx_256_double", "avx_256_double", "Coulomb", "None", "CubicSplineTable", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_avx_256_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_avx_256_double", "avx_256_double", "Coulomb", "None", "CubicSplineTable", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_avx_256_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_avx_256_double", "avx_256_double", "Coulomb", "None", "CubicSplineTable", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_avx_256_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_avx_256_double", "avx_256_double", "Coulomb", "None", "CubicSplineTable", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_avx_256_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_avx_256_double", "avx_256_double", "Coulomb", "None", "CubicSplineTable", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_avx_256_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_avx_256_double", "avx_256_double", "Coulomb", "None", "CubicSplineTable", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_avx_256_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_avx_256_double", "avx_256_double", "Coulomb", "None", "CubicSplineTable", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_avx_256_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_avx_256_double", "avx_256_double", "Coulomb", "None", "CubicSplineTable", "None", "Water4Water4", "", "Force" }
 };
 
 int
index a25ec0e3908bfd8de78d3bffcb773a09b289c95d..f0197c104db332de93f354edfa155736683db409 100644 (file)
@@ -2,7 +2,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -135,12 +135,6 @@ void
     __m256d          velec,felec,velecsum,facel,crf,krf,krf2;
     real             *charge;
     /* #endif */
-    /* #if 'GeneralizedBorn' in KERNEL_ELEC */
-    __m128i          gbitab;
-    __m256d          vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,gbeps,dvdatmp;
-    __m256d          minushalf = _mm256_set1_pd(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    /* #endif */
     /* #if KERNEL_VDW != 'None' */
     int              nvdwtype;
     __m256d          rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
@@ -149,7 +143,7 @@ void
     __m256d          one_sixth   = _mm256_set1_pd(1.0/6.0);
     __m256d          one_twelfth = _mm256_set1_pd(1.0/12.0);
     /* #endif */
-    /* #if 'Table' in KERNEL_ELEC or 'GeneralizedBorn' in KERNEL_ELEC or 'Table' in KERNEL_VDW */
+    /* #if 'Table' in KERNEL_ELEC or 'Table' in KERNEL_VDW */
     __m128i          vfitab;
     __m128i          ifour       = _mm_set1_epi32(4);
     __m256d          rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF;
@@ -239,14 +233,6 @@ void
      /*     #endif */
     /* #endif */
 
-    /* #if KERNEL_ELEC=='GeneralizedBorn' */
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = _mm256_set1_pd(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = _mm256_set1_pd((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-    /* #endif */
-
     /* #if 'Water' in GEOMETRY_I */
     /* Setup water-specific parameters */
     inr              = nlist->iinr[0];
@@ -383,9 +369,6 @@ void
         /*     #for I in PARTICLES_ELEC_I */
         iq{I}              = _mm256_mul_pd(facel,_mm256_set1_pd(charge[inr+{I}]));
         /*         #define OUTERFLOPS OUTERFLOPS+1 */
-        /*         #if KERNEL_ELEC=='GeneralizedBorn' */
-        isai{I}            = _mm256_set1_pd(invsqrta[inr+{I}]);
-        /*         #endif */
         /*     #endfor */
         /*     #for I in PARTICLES_VDW_I */
         vdwioffsetptr{I}   = vdwparam+2*nvdwtype*vdwtype[inr+{I}];
@@ -400,16 +383,10 @@ void
         /*     #if KERNEL_ELEC != 'None' */
         velecsum         = _mm256_setzero_pd();
         /*     #endif */
-        /*     #if 'GeneralizedBorn' in KERNEL_ELEC */
-        vgbsum           = _mm256_setzero_pd();
-        /*     #endif */
         /*     #if KERNEL_VDW != 'None' */
         vvdwsum          = _mm256_setzero_pd();
         /*     #endif */
         /* #endif */
-        /*     #if 'GeneralizedBorn' in KERNEL_ELEC and 'Force' in KERNEL_VF */
-        dvdasum          = _mm256_setzero_pd();
-        /*     #endif */
 
         /* #for ROUND in ['Loop','Epilogue'] */
 
@@ -519,10 +496,6 @@ void
             /*     #for J in PARTICLES_ELEC_J */
             jq{J}              = gmx_mm256_load_4real_swizzle_pd(charge+jnrA+{J},charge+jnrB+{J},
                                                                  charge+jnrC+{J},charge+jnrD+{J});
-            /*         #if KERNEL_ELEC=='GeneralizedBorn' */
-            isaj{J}            = gmx_mm256_load_4real_swizzle_pd(invsqrta+jnrA+{J},invsqrta+jnrB+{J},
-                                                                 invsqrta+jnrC+{J},invsqrta+jnrD+{J});
-            /*         #endif */
             /*     #endfor */
             /*     #for J in PARTICLES_VDW_J */
             vdwjidx{J}A        = 2*vdwtype[jnrA+{J}];
@@ -632,63 +605,6 @@ void
             /*                 #define INNERFLOPS INNERFLOPS+3 */
             /*             #endif */
 
-            /*         #elif KERNEL_ELEC=='GeneralizedBorn' */
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm256_mul_pd(isai{I},isaj{J});
-            gbqqfactor       = _mm256_xor_pd(signbit,_mm256_mul_pd(qq{I}{J},_mm256_mul_pd(isaprod,gbinvepsdiff)));
-            gbscale          = _mm256_mul_pd(isaprod,gbtabscale);
-            /*             #define INNERFLOPS INNERFLOPS+5 */
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm256_mul_pd(r{I}{J},gbscale);
-            gbitab           = _mm256_cvttpd_epi32(rt);
-            gbeps            = _mm256_sub_pd(rt,_mm256_round_pd(rt, _MM_FROUND_FLOOR));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-            Y                = _mm256_load_pd( gbtab + _mm_extract_epi32(gbitab,0) );
-            F                = _mm256_load_pd( gbtab + _mm_extract_epi32(gbitab,1) );
-            G                = _mm256_load_pd( gbtab + _mm_extract_epi32(gbitab,2) );
-            H                = _mm256_load_pd( gbtab + _mm_extract_epi32(gbitab,3) );
-            GMX_MM256_FULLTRANSPOSE4_PD(Y,F,G,H);
-            Heps             = _mm256_mul_pd(gbeps,H);
-            Fp               = _mm256_add_pd(F,_mm256_mul_pd(gbeps,_mm256_add_pd(G,Heps)));
-            VV               = _mm256_add_pd(Y,_mm256_mul_pd(gbeps,Fp));
-            vgb              = _mm256_mul_pd(gbqqfactor,VV);
-            /*             #define INNERFLOPS INNERFLOPS+10 */
-
-            /*             #if 'Force' in KERNEL_VF */
-            FF               = _mm256_add_pd(Fp,_mm256_mul_pd(gbeps,_mm256_add_pd(G,_mm256_add_pd(Heps,Heps))));
-            fgb              = _mm256_mul_pd(gbqqfactor,_mm256_mul_pd(FF,gbscale));
-            dvdatmp          = _mm256_mul_pd(minushalf,_mm256_add_pd(vgb,_mm256_mul_pd(fgb,r{I}{J})));
-            /*                 #if ROUND == 'Epilogue' */
-            dvdatmp          = _mm256_andnot_pd(dummy_mask,dvdatmp);
-            /*                 #endif */
-            dvdasum          = _mm256_add_pd(dvdasum,dvdatmp);
-            /*                 #if ROUND == 'Loop' */
-            fjptrA           = dvda+jnrA;
-            fjptrB           = dvda+jnrB;
-            fjptrC           = dvda+jnrC;
-            fjptrD           = dvda+jnrD;
-            /*                 #else */
-            /* The pointers to scratch make sure that this code with compilers that take gmx_restrict seriously (e.g. icc 13) really can't screw things up. */
-            fjptrA             = (jnrlistA>=0) ? dvda+jnrA : scratch;
-            fjptrB             = (jnrlistB>=0) ? dvda+jnrB : scratch;
-            fjptrC             = (jnrlistC>=0) ? dvda+jnrC : scratch;
-            fjptrD             = (jnrlistD>=0) ? dvda+jnrD : scratch;
-            /*                 #endif */
-            gmx_mm256_increment_4real_swizzle_pd(fjptrA,fjptrB,fjptrC,fjptrD,
-                                                 _mm256_mul_pd(dvdatmp,_mm256_mul_pd(isaj{J},isaj{J})));
-            /*                 #define INNERFLOPS INNERFLOPS+12 */
-            /*             #endif */
-            velec            = _mm256_mul_pd(qq{I}{J},rinv{I}{J});
-            /*                 #define INNERFLOPS INNERFLOPS+1 */
-            /*             #if 'Force' in KERNEL_VF */
-            felec            = _mm256_mul_pd(_mm256_sub_pd(_mm256_mul_pd(velec,rinv{I}{J}),fgb),rinv{I}{J});
-            /*                 #define INNERFLOPS INNERFLOPS+3 */
-            /*             #endif */
-
             /*         #elif KERNEL_ELEC=='Ewald' */
             /* EWALD ELECTROSTATICS */
 
@@ -935,17 +851,6 @@ void
             /*             #endif */
             velecsum         = _mm256_add_pd(velecsum,velec);
             /*             #define INNERFLOPS INNERFLOPS+1 */
-            /*             #if KERNEL_ELEC=='GeneralizedBorn' */
-            /*             #if 'exactcutoff' in INTERACTION_FLAGS[I][J] */
-            vgb              = _mm256_and_pd(vgb,cutoff_mask);
-            /*                 #define INNERFLOPS INNERFLOPS+1 */
-            /*             #endif                                       */
-            /*             #if ROUND == 'Epilogue' */
-            vgb              = _mm256_andnot_pd(dummy_mask,vgb);
-            /*             #endif */
-            vgbsum           = _mm256_add_pd(vgbsum,vgb);
-            /*                 #define INNERFLOPS INNERFLOPS+1 */
-            /*             #endif */
             /*         #endif */
             /*         #if 'vdw' in INTERACTION_FLAGS[I][J] */
             /*     ## Note special check for TIP4P-TIP4P. Since we are cutting of all hydrogen interactions we also cut the LJ-only O-O interaction */
@@ -1098,19 +1003,11 @@ void
         gmx_mm256_update_1pot_pd(velecsum,kernel_data->energygrp_elec+ggid);
         /*         #define OUTERFLOPS OUTERFLOPS+1 */
         /*     #endif */
-        /*     #if 'GeneralizedBorn' in KERNEL_ELEC */
-        gmx_mm256_update_1pot_pd(vgbsum,kernel_data->energygrp_polarization+ggid);
-        /*         #define OUTERFLOPS OUTERFLOPS+1 */
-        /*     #endif */
         /*     #if KERNEL_VDW != 'None' */
         gmx_mm256_update_1pot_pd(vvdwsum,kernel_data->energygrp_vdw+ggid);
         /*         #define OUTERFLOPS OUTERFLOPS+1 */
         /*     #endif */
         /* #endif */
-        /*     #if 'GeneralizedBorn' in KERNEL_ELEC and 'Force' in KERNEL_VF */
-        dvdasum = _mm256_mul_pd(dvdasum, _mm256_mul_pd(isai{I},isai{I}));
-        gmx_mm256_update_1pot_pd(dvdasum,dvda+inr);
-        /*     #endif */
 
         /* Increment number of inner iterations */
         inneriter                  += j_index_end - j_index_start;
index 87d2f565c1acbcb9986f1f0c7e5d6171cca69c6e..6b7b10f02f745c932d5f521848e7801e1c0198b0 100755 (executable)
@@ -105,7 +105,6 @@ ElectrostaticsList = {
     'None'                    : [],
     'Coulomb'                 : ['rinv','rinvsq'],
     'ReactionField'           : ['rinv','rinvsq'],
-    'GeneralizedBorn'         : ['rinv','r'],
     'CubicSplineTable'        : ['rinv','r','table'],
     'Ewald'                   : ['rinv','rinvsq','r'],
 }
@@ -190,7 +189,6 @@ Abbreviation = {
     'Coulomb'                 : 'Coul',
     'Ewald'                   : 'Ew',
     'ReactionField'           : 'RF',
-    'GeneralizedBorn'         : 'GB',
     'CubicSplineTable'        : 'CSTab',
     'LennardJones'            : 'LJ',
     'Buckingham'              : 'Bham',
@@ -269,7 +267,7 @@ def KeepKernel(KernelElec,KernelElecMod,KernelVdw,KernelVdwMod,KernelGeom,Kernel
         return 0
 
     # No need for LJ-only water optimization, or water optimization with implicit solvent.
-    if('Water' in KernelGeom[0] and (KernelElec=='None' or 'GeneralizedBorn' in KernelElec)):
+    if('Water' in KernelGeom[0] and KernelElec=='None'):
         return 0
 
     # Non-matching table settings are pointless
diff --git a/src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecGB_VdwCSTab_GeomP1P1_avx_256_single.c b/src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecGB_VdwCSTab_GeomP1P1_avx_256_single.c
deleted file mode 100644 (file)
index 7eb97ee..0000000
+++ /dev/null
@@ -1,1192 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
- * and including many others, as listed in the AUTHORS file in the
- * top-level source directory and at http://www.gromacs.org.
- *
- * GROMACS is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * GROMACS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GROMACS; if not, see
- * http://www.gnu.org/licenses, or write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
- *
- * If you want to redistribute modifications to GROMACS, please
- * consider that scientific software is very special. Version
- * control is crucial - bugs must be traceable. We will be happy to
- * consider code for inclusion in the official distribution, but
- * derived work must not be called official GROMACS. Details are found
- * in the README & COPYING files - if they are missing, get the
- * official version at http://www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the research papers on the package. Check out http://www.gromacs.org.
- */
-/*
- * Note: this file was generated by the GROMACS avx_256_single kernel generator.
- */
-#include "gmxpre.h"
-
-#include "config.h"
-
-#include <math.h>
-
-#include "../nb_kernel.h"
-#include "gromacs/gmxlib/nrnb.h"
-
-#include "kernelutil_x86_avx_256_single.h"
-
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_avx_256_single
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            CubicSplineTable
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        PotentialAndForce
- */
-void
-nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_avx_256_single
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or 
-     * just 0 for non-waters.
-     * Suffixes A,B,C,D,E,F,G,H refer to j loop unrolling done with AVX, e.g. for the eight different
-     * jnr indices corresponding to data put in the four positions in the SIMD register.
-     */
-    int              i_shift_offset,i_coord_offset,outeriter,inneriter;
-    int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
-    int              jnrA,jnrB,jnrC,jnrD;
-    int              jnrE,jnrF,jnrG,jnrH;
-    int              jnrlistA,jnrlistB,jnrlistC,jnrlistD;
-    int              jnrlistE,jnrlistF,jnrlistG,jnrlistH;
-    int              j_coord_offsetA,j_coord_offsetB,j_coord_offsetC,j_coord_offsetD;
-    int              j_coord_offsetE,j_coord_offsetF,j_coord_offsetG,j_coord_offsetH;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             rcutoff_scalar;
-    real             *shiftvec,*fshift,*x,*f;
-    real             *fjptrA,*fjptrB,*fjptrC,*fjptrD,*fjptrE,*fjptrF,*fjptrG,*fjptrH;
-    real             scratch[4*DIM];
-    __m256           tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
-    real *           vdwioffsetptr0;
-    __m256           ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0A,vdwjidx0B,vdwjidx0C,vdwjidx0D,vdwjidx0E,vdwjidx0F,vdwjidx0G,vdwjidx0H;
-    __m256           jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    __m256           dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
-    __m256           velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    __m256i          gbitab;
-    __m128i          gbitab_lo,gbitab_hi;
-    __m256           vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,gbeps,dvdatmp;
-    __m256           minushalf = _mm256_set1_ps(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    int              nvdwtype;
-    __m256           rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
-    int              *vdwtype;
-    real             *vdwparam;
-    __m256           one_sixth   = _mm256_set1_ps(1.0/6.0);
-    __m256           one_twelfth = _mm256_set1_ps(1.0/12.0);
-    __m256i          vfitab;
-    __m128i          vfitab_lo,vfitab_hi;
-    __m128i          ifour       = _mm_set1_epi32(4);
-    __m256           rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF;
-    real             *vftab;
-    __m256           dummy_mask,cutoff_mask;
-    __m256           signbit = _mm256_castsi256_ps( _mm256_set1_epi32(0x80000000) );
-    __m256           one     = _mm256_set1_ps(1.0);
-    __m256           two     = _mm256_set1_ps(2.0);
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = _mm256_set1_ps(fr->ic->epsfac);
-    charge           = mdatoms->chargeA;
-    nvdwtype         = fr->ntype;
-    vdwparam         = fr->nbfp;
-    vdwtype          = mdatoms->typeA;
-
-    vftab            = kernel_data->table_vdw->data;
-    vftabscale       = _mm256_set1_ps(kernel_data->table_vdw->scale);
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = _mm256_set1_ps(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = _mm256_set1_ps((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-
-    /* Avoid stupid compiler warnings */
-    jnrA = jnrB = jnrC = jnrD = jnrE = jnrF = jnrG = jnrH = 0;
-    j_coord_offsetA = 0;
-    j_coord_offsetB = 0;
-    j_coord_offsetC = 0;
-    j_coord_offsetD = 0;
-    j_coord_offsetE = 0;
-    j_coord_offsetF = 0;
-    j_coord_offsetG = 0;
-    j_coord_offsetH = 0;
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    for(iidx=0;iidx<4*DIM;iidx++)
-    {
-        scratch[iidx] = 0.0;
-    }
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        gmx_mm256_load_shift_and_1rvec_broadcast_ps(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
-
-        fix0             = _mm256_setzero_ps();
-        fiy0             = _mm256_setzero_ps();
-        fiz0             = _mm256_setzero_ps();
-
-        /* Load parameters for i particles */
-        iq0              = _mm256_mul_ps(facel,_mm256_set1_ps(charge[inr+0]));
-        isai0            = _mm256_set1_ps(invsqrta[inr+0]);
-        vdwioffsetptr0   = vdwparam+2*nvdwtype*vdwtype[inr+0];
-
-        /* Reset potential sums */
-        velecsum         = _mm256_setzero_ps();
-        vgbsum           = _mm256_setzero_ps();
-        vvdwsum          = _mm256_setzero_ps();
-        dvdasum          = _mm256_setzero_ps();
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end && jjnr[jidx+7]>=0; jidx+=8)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrA             = jjnr[jidx];
-            jnrB             = jjnr[jidx+1];
-            jnrC             = jjnr[jidx+2];
-            jnrD             = jjnr[jidx+3];
-            jnrE             = jjnr[jidx+4];
-            jnrF             = jjnr[jidx+5];
-            jnrG             = jjnr[jidx+6];
-            jnrH             = jjnr[jidx+7];
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-            j_coord_offsetE  = DIM*jnrE;
-            j_coord_offsetF  = DIM*jnrF;
-            j_coord_offsetG  = DIM*jnrG;
-            j_coord_offsetH  = DIM*jnrH;
-
-            /* load j atom coordinates */
-            gmx_mm256_load_1rvec_8ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
-                                                 x+j_coord_offsetC,x+j_coord_offsetD,
-                                                 x+j_coord_offsetE,x+j_coord_offsetF,
-                                                 x+j_coord_offsetG,x+j_coord_offsetH,
-                                                 &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm256_sub_ps(ix0,jx0);
-            dy00             = _mm256_sub_ps(iy0,jy0);
-            dz00             = _mm256_sub_ps(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm256_calc_rsq_ps(dx00,dy00,dz00);
-
-            rinv00           = avx256_invsqrt_f(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm256_load_8real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
-                                                                 charge+jnrC+0,charge+jnrD+0,
-                                                                 charge+jnrE+0,charge+jnrF+0,
-                                                                 charge+jnrG+0,charge+jnrH+0);
-            isaj0            = gmx_mm256_load_8real_swizzle_ps(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                                 invsqrta+jnrC+0,invsqrta+jnrD+0,
-                                                                 invsqrta+jnrE+0,invsqrta+jnrF+0,
-                                                                 invsqrta+jnrG+0,invsqrta+jnrH+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-            vdwjidx0B        = 2*vdwtype[jnrB+0];
-            vdwjidx0C        = 2*vdwtype[jnrC+0];
-            vdwjidx0D        = 2*vdwtype[jnrD+0];
-            vdwjidx0E        = 2*vdwtype[jnrE+0];
-            vdwjidx0F        = 2*vdwtype[jnrF+0];
-            vdwjidx0G        = 2*vdwtype[jnrG+0];
-            vdwjidx0H        = 2*vdwtype[jnrH+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm256_mul_ps(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm256_mul_ps(iq0,jq0);
-            gmx_mm256_load_8pair_swizzle_ps(vdwioffsetptr0+vdwjidx0A,
-                                            vdwioffsetptr0+vdwjidx0B,
-                                            vdwioffsetptr0+vdwjidx0C,
-                                            vdwioffsetptr0+vdwjidx0D,
-                                            vdwioffsetptr0+vdwjidx0E,
-                                            vdwioffsetptr0+vdwjidx0F,
-                                            vdwioffsetptr0+vdwjidx0G,
-                                            vdwioffsetptr0+vdwjidx0H,
-                                            &c6_00,&c12_00);
-
-            /* Calculate table index by multiplying r with table scale and truncate to integer */
-            rt               = _mm256_mul_ps(r00,vftabscale);
-            vfitab           = _mm256_cvttps_epi32(rt);
-            vfeps            = _mm256_sub_ps(rt,_mm256_round_ps(rt, _MM_FROUND_FLOOR));
-            /*         AVX1 does not support 256-bit integer operations, so now we go to 128-bit mode... */
-            vfitab_lo        = _mm256_extractf128_si256(vfitab,0x0);
-            vfitab_hi        = _mm256_extractf128_si256(vfitab,0x1);
-            vfitab_lo        = _mm_slli_epi32(vfitab_lo,3);
-            vfitab_hi        = _mm_slli_epi32(vfitab_hi,3);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm256_mul_ps(isai0,isaj0);
-            gbqqfactor       = _mm256_xor_ps(signbit,_mm256_mul_ps(qq00,_mm256_mul_ps(isaprod,gbinvepsdiff)));
-            gbscale          = _mm256_mul_ps(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm256_mul_ps(r00,gbscale);
-            gbitab           = _mm256_cvttps_epi32(rt);
-            gbeps            = _mm256_sub_ps(rt,_mm256_round_ps(rt, _MM_FROUND_FLOOR));
-            /*         AVX1 does not support 256-bit integer operations, so now we go to 128-bit mode... */
-            gbitab_lo        = _mm256_extractf128_si256(gbitab,0x0);
-            gbitab_hi        = _mm256_extractf128_si256(gbitab,0x1);
-            gbitab_lo        = _mm_slli_epi32(gbitab_lo,2);
-            gbitab_hi        = _mm_slli_epi32(gbitab_hi,2);
-            Y                = gmx_mm256_set_m128(_mm_load_ps(gbtab + _mm_extract_epi32(gbitab_hi,0)),
-                                                  _mm_load_ps(gbtab + _mm_extract_epi32(gbitab_lo,0)));
-            F                = gmx_mm256_set_m128(_mm_load_ps(gbtab + _mm_extract_epi32(gbitab_hi,1)),
-                                                  _mm_load_ps(gbtab + _mm_extract_epi32(gbitab_lo,1)));
-            G                = gmx_mm256_set_m128(_mm_load_ps(gbtab + _mm_extract_epi32(gbitab_hi,2)),
-                                                  _mm_load_ps(gbtab + _mm_extract_epi32(gbitab_lo,2)));
-            H                = gmx_mm256_set_m128(_mm_load_ps(gbtab + _mm_extract_epi32(gbitab_hi,3)),
-                                                  _mm_load_ps(gbtab + _mm_extract_epi32(gbitab_lo,3)));
-            GMX_MM256_HALFTRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm256_mul_ps(gbeps,H);
-            Fp               = _mm256_add_ps(F,_mm256_mul_ps(gbeps,_mm256_add_ps(G,Heps)));
-            VV               = _mm256_add_ps(Y,_mm256_mul_ps(gbeps,Fp));
-            vgb              = _mm256_mul_ps(gbqqfactor,VV);
-
-            FF               = _mm256_add_ps(Fp,_mm256_mul_ps(gbeps,_mm256_add_ps(G,_mm256_add_ps(Heps,Heps))));
-            fgb              = _mm256_mul_ps(gbqqfactor,_mm256_mul_ps(FF,gbscale));
-            dvdatmp          = _mm256_mul_ps(minushalf,_mm256_add_ps(vgb,_mm256_mul_ps(fgb,r00)));
-            dvdasum          = _mm256_add_ps(dvdasum,dvdatmp);
-            fjptrA           = dvda+jnrA;
-            fjptrB           = dvda+jnrB;
-            fjptrC           = dvda+jnrC;
-            fjptrD           = dvda+jnrD;
-            fjptrE           = dvda+jnrE;
-            fjptrF           = dvda+jnrF;
-            fjptrG           = dvda+jnrG;
-            fjptrH           = dvda+jnrH;
-            gmx_mm256_increment_8real_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,fjptrE,fjptrF,fjptrG,fjptrH,
-                                                 _mm256_mul_ps(dvdatmp,_mm256_mul_ps(isaj0,isaj0)));
-            velec            = _mm256_mul_ps(qq00,rinv00);
-            felec            = _mm256_mul_ps(_mm256_sub_ps(_mm256_mul_ps(velec,rinv00),fgb),rinv00);
-
-            /* CUBIC SPLINE TABLE DISPERSION */
-            Y                = gmx_mm256_set_m128(_mm_load_ps(vftab + _mm_extract_epi32(vfitab_hi,0)),
-                                                  _mm_load_ps(vftab + _mm_extract_epi32(vfitab_lo,0)));
-            F                = gmx_mm256_set_m128(_mm_load_ps(vftab + _mm_extract_epi32(vfitab_hi,1)),
-                                                  _mm_load_ps(vftab + _mm_extract_epi32(vfitab_lo,1)));
-            G                = gmx_mm256_set_m128(_mm_load_ps(vftab + _mm_extract_epi32(vfitab_hi,2)),
-                                                  _mm_load_ps(vftab + _mm_extract_epi32(vfitab_lo,2)));
-            H                = gmx_mm256_set_m128(_mm_load_ps(vftab + _mm_extract_epi32(vfitab_hi,3)),
-                                                  _mm_load_ps(vftab + _mm_extract_epi32(vfitab_lo,3)));
-            GMX_MM256_HALFTRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm256_mul_ps(vfeps,H);
-            Fp               = _mm256_add_ps(F,_mm256_mul_ps(vfeps,_mm256_add_ps(G,Heps)));
-            VV               = _mm256_add_ps(Y,_mm256_mul_ps(vfeps,Fp));
-            vvdw6            = _mm256_mul_ps(c6_00,VV);
-            FF               = _mm256_add_ps(Fp,_mm256_mul_ps(vfeps,_mm256_add_ps(G,_mm256_add_ps(Heps,Heps))));
-            fvdw6            = _mm256_mul_ps(c6_00,FF);
-
-            /* CUBIC SPLINE TABLE REPULSION */
-            vfitab_lo        = _mm_add_epi32(vfitab_lo,ifour);
-            vfitab_hi        = _mm_add_epi32(vfitab_hi,ifour);
-            Y                = gmx_mm256_set_m128(_mm_load_ps(vftab + _mm_extract_epi32(vfitab_hi,0)),
-                                                  _mm_load_ps(vftab + _mm_extract_epi32(vfitab_lo,0)));
-            F                = gmx_mm256_set_m128(_mm_load_ps(vftab + _mm_extract_epi32(vfitab_hi,1)),
-                                                  _mm_load_ps(vftab + _mm_extract_epi32(vfitab_lo,1)));
-            G                = gmx_mm256_set_m128(_mm_load_ps(vftab + _mm_extract_epi32(vfitab_hi,2)),
-                                                  _mm_load_ps(vftab + _mm_extract_epi32(vfitab_lo,2)));
-            H                = gmx_mm256_set_m128(_mm_load_ps(vftab + _mm_extract_epi32(vfitab_hi,3)),
-                                                  _mm_load_ps(vftab + _mm_extract_epi32(vfitab_lo,3)));
-            GMX_MM256_HALFTRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm256_mul_ps(vfeps,H);
-            Fp               = _mm256_add_ps(F,_mm256_mul_ps(vfeps,_mm256_add_ps(G,Heps)));
-            VV               = _mm256_add_ps(Y,_mm256_mul_ps(vfeps,Fp));
-            vvdw12           = _mm256_mul_ps(c12_00,VV);
-            FF               = _mm256_add_ps(Fp,_mm256_mul_ps(vfeps,_mm256_add_ps(G,_mm256_add_ps(Heps,Heps))));
-            fvdw12           = _mm256_mul_ps(c12_00,FF);
-            vvdw             = _mm256_add_ps(vvdw12,vvdw6);
-            fvdw             = _mm256_xor_ps(signbit,_mm256_mul_ps(_mm256_add_ps(fvdw6,fvdw12),_mm256_mul_ps(vftabscale,rinv00)));
-
-            /* Update potential sum for this i atom from the interaction with this j atom. */
-            velecsum         = _mm256_add_ps(velecsum,velec);
-            vgbsum           = _mm256_add_ps(vgbsum,vgb);
-            vvdwsum          = _mm256_add_ps(vvdwsum,vvdw);
-
-            fscal            = _mm256_add_ps(felec,fvdw);
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm256_mul_ps(fscal,dx00);
-            ty               = _mm256_mul_ps(fscal,dy00);
-            tz               = _mm256_mul_ps(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm256_add_ps(fix0,tx);
-            fiy0             = _mm256_add_ps(fiy0,ty);
-            fiz0             = _mm256_add_ps(fiz0,tz);
-
-            fjptrA             = f+j_coord_offsetA;
-            fjptrB             = f+j_coord_offsetB;
-            fjptrC             = f+j_coord_offsetC;
-            fjptrD             = f+j_coord_offsetD;
-            fjptrE             = f+j_coord_offsetE;
-            fjptrF             = f+j_coord_offsetF;
-            fjptrG             = f+j_coord_offsetG;
-            fjptrH             = f+j_coord_offsetH;
-            gmx_mm256_decrement_1rvec_8ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,fjptrE,fjptrF,fjptrG,fjptrH,tx,ty,tz);
-
-            /* Inner loop uses 91 flops */
-        }
-
-        if(jidx<j_index_end)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrlistA         = jjnr[jidx];
-            jnrlistB         = jjnr[jidx+1];
-            jnrlistC         = jjnr[jidx+2];
-            jnrlistD         = jjnr[jidx+3];
-            jnrlistE         = jjnr[jidx+4];
-            jnrlistF         = jjnr[jidx+5];
-            jnrlistG         = jjnr[jidx+6];
-            jnrlistH         = jjnr[jidx+7];
-            /* Sign of each element will be negative for non-real atoms.
-             * This mask will be 0xFFFFFFFF for dummy entries and 0x0 for real ones,
-             * so use it as val = _mm_andnot_ps(mask,val) to clear dummy entries.
-             */
-            dummy_mask = gmx_mm256_set_m128(gmx_mm_castsi128_ps(_mm_cmplt_epi32(_mm_loadu_si128((const __m128i *)(jjnr+jidx+4)),_mm_setzero_si128())),
-                                            gmx_mm_castsi128_ps(_mm_cmplt_epi32(_mm_loadu_si128((const __m128i *)(jjnr+jidx)),_mm_setzero_si128())));
-                                            
-            jnrA       = (jnrlistA>=0) ? jnrlistA : 0;
-            jnrB       = (jnrlistB>=0) ? jnrlistB : 0;
-            jnrC       = (jnrlistC>=0) ? jnrlistC : 0;
-            jnrD       = (jnrlistD>=0) ? jnrlistD : 0;
-            jnrE       = (jnrlistE>=0) ? jnrlistE : 0;
-            jnrF       = (jnrlistF>=0) ? jnrlistF : 0;
-            jnrG       = (jnrlistG>=0) ? jnrlistG : 0;
-            jnrH       = (jnrlistH>=0) ? jnrlistH : 0;
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-            j_coord_offsetE  = DIM*jnrE;
-            j_coord_offsetF  = DIM*jnrF;
-            j_coord_offsetG  = DIM*jnrG;
-            j_coord_offsetH  = DIM*jnrH;
-
-            /* load j atom coordinates */
-            gmx_mm256_load_1rvec_8ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
-                                                 x+j_coord_offsetC,x+j_coord_offsetD,
-                                                 x+j_coord_offsetE,x+j_coord_offsetF,
-                                                 x+j_coord_offsetG,x+j_coord_offsetH,
-                                                 &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm256_sub_ps(ix0,jx0);
-            dy00             = _mm256_sub_ps(iy0,jy0);
-            dz00             = _mm256_sub_ps(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm256_calc_rsq_ps(dx00,dy00,dz00);
-
-            rinv00           = avx256_invsqrt_f(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm256_load_8real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
-                                                                 charge+jnrC+0,charge+jnrD+0,
-                                                                 charge+jnrE+0,charge+jnrF+0,
-                                                                 charge+jnrG+0,charge+jnrH+0);
-            isaj0            = gmx_mm256_load_8real_swizzle_ps(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                                 invsqrta+jnrC+0,invsqrta+jnrD+0,
-                                                                 invsqrta+jnrE+0,invsqrta+jnrF+0,
-                                                                 invsqrta+jnrG+0,invsqrta+jnrH+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-            vdwjidx0B        = 2*vdwtype[jnrB+0];
-            vdwjidx0C        = 2*vdwtype[jnrC+0];
-            vdwjidx0D        = 2*vdwtype[jnrD+0];
-            vdwjidx0E        = 2*vdwtype[jnrE+0];
-            vdwjidx0F        = 2*vdwtype[jnrF+0];
-            vdwjidx0G        = 2*vdwtype[jnrG+0];
-            vdwjidx0H        = 2*vdwtype[jnrH+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm256_mul_ps(rsq00,rinv00);
-            r00              = _mm256_andnot_ps(dummy_mask,r00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm256_mul_ps(iq0,jq0);
-            gmx_mm256_load_8pair_swizzle_ps(vdwioffsetptr0+vdwjidx0A,
-                                            vdwioffsetptr0+vdwjidx0B,
-                                            vdwioffsetptr0+vdwjidx0C,
-                                            vdwioffsetptr0+vdwjidx0D,
-                                            vdwioffsetptr0+vdwjidx0E,
-                                            vdwioffsetptr0+vdwjidx0F,
-                                            vdwioffsetptr0+vdwjidx0G,
-                                            vdwioffsetptr0+vdwjidx0H,
-                                            &c6_00,&c12_00);
-
-            /* Calculate table index by multiplying r with table scale and truncate to integer */
-            rt               = _mm256_mul_ps(r00,vftabscale);
-            vfitab           = _mm256_cvttps_epi32(rt);
-            vfeps            = _mm256_sub_ps(rt,_mm256_round_ps(rt, _MM_FROUND_FLOOR));
-            /*         AVX1 does not support 256-bit integer operations, so now we go to 128-bit mode... */
-            vfitab_lo        = _mm256_extractf128_si256(vfitab,0x0);
-            vfitab_hi        = _mm256_extractf128_si256(vfitab,0x1);
-            vfitab_lo        = _mm_slli_epi32(vfitab_lo,3);
-            vfitab_hi        = _mm_slli_epi32(vfitab_hi,3);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm256_mul_ps(isai0,isaj0);
-            gbqqfactor       = _mm256_xor_ps(signbit,_mm256_mul_ps(qq00,_mm256_mul_ps(isaprod,gbinvepsdiff)));
-            gbscale          = _mm256_mul_ps(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm256_mul_ps(r00,gbscale);
-            gbitab           = _mm256_cvttps_epi32(rt);
-            gbeps            = _mm256_sub_ps(rt,_mm256_round_ps(rt, _MM_FROUND_FLOOR));
-            /*         AVX1 does not support 256-bit integer operations, so now we go to 128-bit mode... */
-            gbitab_lo        = _mm256_extractf128_si256(gbitab,0x0);
-            gbitab_hi        = _mm256_extractf128_si256(gbitab,0x1);
-            gbitab_lo        = _mm_slli_epi32(gbitab_lo,2);
-            gbitab_hi        = _mm_slli_epi32(gbitab_hi,2);
-            Y                = gmx_mm256_set_m128(_mm_load_ps(gbtab + _mm_extract_epi32(gbitab_hi,0)),
-                                                  _mm_load_ps(gbtab + _mm_extract_epi32(gbitab_lo,0)));
-            F                = gmx_mm256_set_m128(_mm_load_ps(gbtab + _mm_extract_epi32(gbitab_hi,1)),
-                                                  _mm_load_ps(gbtab + _mm_extract_epi32(gbitab_lo,1)));
-            G                = gmx_mm256_set_m128(_mm_load_ps(gbtab + _mm_extract_epi32(gbitab_hi,2)),
-                                                  _mm_load_ps(gbtab + _mm_extract_epi32(gbitab_lo,2)));
-            H                = gmx_mm256_set_m128(_mm_load_ps(gbtab + _mm_extract_epi32(gbitab_hi,3)),
-                                                  _mm_load_ps(gbtab + _mm_extract_epi32(gbitab_lo,3)));
-            GMX_MM256_HALFTRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm256_mul_ps(gbeps,H);
-            Fp               = _mm256_add_ps(F,_mm256_mul_ps(gbeps,_mm256_add_ps(G,Heps)));
-            VV               = _mm256_add_ps(Y,_mm256_mul_ps(gbeps,Fp));
-            vgb              = _mm256_mul_ps(gbqqfactor,VV);
-
-            FF               = _mm256_add_ps(Fp,_mm256_mul_ps(gbeps,_mm256_add_ps(G,_mm256_add_ps(Heps,Heps))));
-            fgb              = _mm256_mul_ps(gbqqfactor,_mm256_mul_ps(FF,gbscale));
-            dvdatmp          = _mm256_mul_ps(minushalf,_mm256_add_ps(vgb,_mm256_mul_ps(fgb,r00)));
-            dvdatmp          = _mm256_andnot_ps(dummy_mask,dvdatmp);
-            dvdasum          = _mm256_add_ps(dvdasum,dvdatmp);
-            /* The pointers to scratch make sure that this code with compilers that take gmx_restrict seriously (e.g. icc 13) really can't screw things up. */
-            fjptrA             = (jnrlistA>=0) ? dvda+jnrA : scratch;
-            fjptrB             = (jnrlistB>=0) ? dvda+jnrB : scratch;
-            fjptrC             = (jnrlistC>=0) ? dvda+jnrC : scratch;
-            fjptrD             = (jnrlistD>=0) ? dvda+jnrD : scratch;
-            fjptrE             = (jnrlistE>=0) ? dvda+jnrE : scratch;
-            fjptrF             = (jnrlistF>=0) ? dvda+jnrF : scratch;
-            fjptrG             = (jnrlistG>=0) ? dvda+jnrG : scratch;
-            fjptrH             = (jnrlistH>=0) ? dvda+jnrH : scratch;
-            gmx_mm256_increment_8real_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,fjptrE,fjptrF,fjptrG,fjptrH,
-                                                 _mm256_mul_ps(dvdatmp,_mm256_mul_ps(isaj0,isaj0)));
-            velec            = _mm256_mul_ps(qq00,rinv00);
-            felec            = _mm256_mul_ps(_mm256_sub_ps(_mm256_mul_ps(velec,rinv00),fgb),rinv00);
-
-            /* CUBIC SPLINE TABLE DISPERSION */
-            Y                = gmx_mm256_set_m128(_mm_load_ps(vftab + _mm_extract_epi32(vfitab_hi,0)),
-                                                  _mm_load_ps(vftab + _mm_extract_epi32(vfitab_lo,0)));
-            F                = gmx_mm256_set_m128(_mm_load_ps(vftab + _mm_extract_epi32(vfitab_hi,1)),
-                                                  _mm_load_ps(vftab + _mm_extract_epi32(vfitab_lo,1)));
-            G                = gmx_mm256_set_m128(_mm_load_ps(vftab + _mm_extract_epi32(vfitab_hi,2)),
-                                                  _mm_load_ps(vftab + _mm_extract_epi32(vfitab_lo,2)));
-            H                = gmx_mm256_set_m128(_mm_load_ps(vftab + _mm_extract_epi32(vfitab_hi,3)),
-                                                  _mm_load_ps(vftab + _mm_extract_epi32(vfitab_lo,3)));
-            GMX_MM256_HALFTRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm256_mul_ps(vfeps,H);
-            Fp               = _mm256_add_ps(F,_mm256_mul_ps(vfeps,_mm256_add_ps(G,Heps)));
-            VV               = _mm256_add_ps(Y,_mm256_mul_ps(vfeps,Fp));
-            vvdw6            = _mm256_mul_ps(c6_00,VV);
-            FF               = _mm256_add_ps(Fp,_mm256_mul_ps(vfeps,_mm256_add_ps(G,_mm256_add_ps(Heps,Heps))));
-            fvdw6            = _mm256_mul_ps(c6_00,FF);
-
-            /* CUBIC SPLINE TABLE REPULSION */
-            vfitab_lo        = _mm_add_epi32(vfitab_lo,ifour);
-            vfitab_hi        = _mm_add_epi32(vfitab_hi,ifour);
-            Y                = gmx_mm256_set_m128(_mm_load_ps(vftab + _mm_extract_epi32(vfitab_hi,0)),
-                                                  _mm_load_ps(vftab + _mm_extract_epi32(vfitab_lo,0)));
-            F                = gmx_mm256_set_m128(_mm_load_ps(vftab + _mm_extract_epi32(vfitab_hi,1)),
-                                                  _mm_load_ps(vftab + _mm_extract_epi32(vfitab_lo,1)));
-            G                = gmx_mm256_set_m128(_mm_load_ps(vftab + _mm_extract_epi32(vfitab_hi,2)),
-                                                  _mm_load_ps(vftab + _mm_extract_epi32(vfitab_lo,2)));
-            H                = gmx_mm256_set_m128(_mm_load_ps(vftab + _mm_extract_epi32(vfitab_hi,3)),
-                                                  _mm_load_ps(vftab + _mm_extract_epi32(vfitab_lo,3)));
-            GMX_MM256_HALFTRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm256_mul_ps(vfeps,H);
-            Fp               = _mm256_add_ps(F,_mm256_mul_ps(vfeps,_mm256_add_ps(G,Heps)));
-            VV               = _mm256_add_ps(Y,_mm256_mul_ps(vfeps,Fp));
-            vvdw12           = _mm256_mul_ps(c12_00,VV);
-            FF               = _mm256_add_ps(Fp,_mm256_mul_ps(vfeps,_mm256_add_ps(G,_mm256_add_ps(Heps,Heps))));
-            fvdw12           = _mm256_mul_ps(c12_00,FF);
-            vvdw             = _mm256_add_ps(vvdw12,vvdw6);
-            fvdw             = _mm256_xor_ps(signbit,_mm256_mul_ps(_mm256_add_ps(fvdw6,fvdw12),_mm256_mul_ps(vftabscale,rinv00)));
-
-            /* Update potential sum for this i atom from the interaction with this j atom. */
-            velec            = _mm256_andnot_ps(dummy_mask,velec);
-            velecsum         = _mm256_add_ps(velecsum,velec);
-            vgb              = _mm256_andnot_ps(dummy_mask,vgb);
-            vgbsum           = _mm256_add_ps(vgbsum,vgb);
-            vvdw             = _mm256_andnot_ps(dummy_mask,vvdw);
-            vvdwsum          = _mm256_add_ps(vvdwsum,vvdw);
-
-            fscal            = _mm256_add_ps(felec,fvdw);
-
-            fscal            = _mm256_andnot_ps(dummy_mask,fscal);
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm256_mul_ps(fscal,dx00);
-            ty               = _mm256_mul_ps(fscal,dy00);
-            tz               = _mm256_mul_ps(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm256_add_ps(fix0,tx);
-            fiy0             = _mm256_add_ps(fiy0,ty);
-            fiz0             = _mm256_add_ps(fiz0,tz);
-
-            fjptrA             = (jnrlistA>=0) ? f+j_coord_offsetA : scratch;
-            fjptrB             = (jnrlistB>=0) ? f+j_coord_offsetB : scratch;
-            fjptrC             = (jnrlistC>=0) ? f+j_coord_offsetC : scratch;
-            fjptrD             = (jnrlistD>=0) ? f+j_coord_offsetD : scratch;
-            fjptrE             = (jnrlistE>=0) ? f+j_coord_offsetE : scratch;
-            fjptrF             = (jnrlistF>=0) ? f+j_coord_offsetF : scratch;
-            fjptrG             = (jnrlistG>=0) ? f+j_coord_offsetG : scratch;
-            fjptrH             = (jnrlistH>=0) ? f+j_coord_offsetH : scratch;
-            gmx_mm256_decrement_1rvec_8ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,fjptrE,fjptrF,fjptrG,fjptrH,tx,ty,tz);
-
-            /* Inner loop uses 92 flops */
-        }
-
-        /* End of innermost loop */
-
-        gmx_mm256_update_iforce_1atom_swizzle_ps(fix0,fiy0,fiz0,
-                                                 f+i_coord_offset,fshift+i_shift_offset);
-
-        ggid                        = gid[iidx];
-        /* Update potential energies */
-        gmx_mm256_update_1pot_ps(velecsum,kernel_data->energygrp_elec+ggid);
-        gmx_mm256_update_1pot_ps(vgbsum,kernel_data->energygrp_polarization+ggid);
-        gmx_mm256_update_1pot_ps(vvdwsum,kernel_data->energygrp_vdw+ggid);
-        dvdasum = _mm256_mul_ps(dvdasum, _mm256_mul_ps(isai0,isai0));
-        gmx_mm256_update_1pot_ps(dvdasum,dvda+inr);
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 10 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_VF,outeriter*10 + inneriter*92);
-}
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_avx_256_single
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            CubicSplineTable
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        Force
- */
-void
-nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_avx_256_single
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or 
-     * just 0 for non-waters.
-     * Suffixes A,B,C,D,E,F,G,H refer to j loop unrolling done with AVX, e.g. for the eight different
-     * jnr indices corresponding to data put in the four positions in the SIMD register.
-     */
-    int              i_shift_offset,i_coord_offset,outeriter,inneriter;
-    int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
-    int              jnrA,jnrB,jnrC,jnrD;
-    int              jnrE,jnrF,jnrG,jnrH;
-    int              jnrlistA,jnrlistB,jnrlistC,jnrlistD;
-    int              jnrlistE,jnrlistF,jnrlistG,jnrlistH;
-    int              j_coord_offsetA,j_coord_offsetB,j_coord_offsetC,j_coord_offsetD;
-    int              j_coord_offsetE,j_coord_offsetF,j_coord_offsetG,j_coord_offsetH;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             rcutoff_scalar;
-    real             *shiftvec,*fshift,*x,*f;
-    real             *fjptrA,*fjptrB,*fjptrC,*fjptrD,*fjptrE,*fjptrF,*fjptrG,*fjptrH;
-    real             scratch[4*DIM];
-    __m256           tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
-    real *           vdwioffsetptr0;
-    __m256           ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0A,vdwjidx0B,vdwjidx0C,vdwjidx0D,vdwjidx0E,vdwjidx0F,vdwjidx0G,vdwjidx0H;
-    __m256           jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    __m256           dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
-    __m256           velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    __m256i          gbitab;
-    __m128i          gbitab_lo,gbitab_hi;
-    __m256           vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,gbeps,dvdatmp;
-    __m256           minushalf = _mm256_set1_ps(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    int              nvdwtype;
-    __m256           rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
-    int              *vdwtype;
-    real             *vdwparam;
-    __m256           one_sixth   = _mm256_set1_ps(1.0/6.0);
-    __m256           one_twelfth = _mm256_set1_ps(1.0/12.0);
-    __m256i          vfitab;
-    __m128i          vfitab_lo,vfitab_hi;
-    __m128i          ifour       = _mm_set1_epi32(4);
-    __m256           rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF;
-    real             *vftab;
-    __m256           dummy_mask,cutoff_mask;
-    __m256           signbit = _mm256_castsi256_ps( _mm256_set1_epi32(0x80000000) );
-    __m256           one     = _mm256_set1_ps(1.0);
-    __m256           two     = _mm256_set1_ps(2.0);
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = _mm256_set1_ps(fr->ic->epsfac);
-    charge           = mdatoms->chargeA;
-    nvdwtype         = fr->ntype;
-    vdwparam         = fr->nbfp;
-    vdwtype          = mdatoms->typeA;
-
-    vftab            = kernel_data->table_vdw->data;
-    vftabscale       = _mm256_set1_ps(kernel_data->table_vdw->scale);
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = _mm256_set1_ps(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = _mm256_set1_ps((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-
-    /* Avoid stupid compiler warnings */
-    jnrA = jnrB = jnrC = jnrD = jnrE = jnrF = jnrG = jnrH = 0;
-    j_coord_offsetA = 0;
-    j_coord_offsetB = 0;
-    j_coord_offsetC = 0;
-    j_coord_offsetD = 0;
-    j_coord_offsetE = 0;
-    j_coord_offsetF = 0;
-    j_coord_offsetG = 0;
-    j_coord_offsetH = 0;
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    for(iidx=0;iidx<4*DIM;iidx++)
-    {
-        scratch[iidx] = 0.0;
-    }
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        gmx_mm256_load_shift_and_1rvec_broadcast_ps(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
-
-        fix0             = _mm256_setzero_ps();
-        fiy0             = _mm256_setzero_ps();
-        fiz0             = _mm256_setzero_ps();
-
-        /* Load parameters for i particles */
-        iq0              = _mm256_mul_ps(facel,_mm256_set1_ps(charge[inr+0]));
-        isai0            = _mm256_set1_ps(invsqrta[inr+0]);
-        vdwioffsetptr0   = vdwparam+2*nvdwtype*vdwtype[inr+0];
-
-        dvdasum          = _mm256_setzero_ps();
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end && jjnr[jidx+7]>=0; jidx+=8)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrA             = jjnr[jidx];
-            jnrB             = jjnr[jidx+1];
-            jnrC             = jjnr[jidx+2];
-            jnrD             = jjnr[jidx+3];
-            jnrE             = jjnr[jidx+4];
-            jnrF             = jjnr[jidx+5];
-            jnrG             = jjnr[jidx+6];
-            jnrH             = jjnr[jidx+7];
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-            j_coord_offsetE  = DIM*jnrE;
-            j_coord_offsetF  = DIM*jnrF;
-            j_coord_offsetG  = DIM*jnrG;
-            j_coord_offsetH  = DIM*jnrH;
-
-            /* load j atom coordinates */
-            gmx_mm256_load_1rvec_8ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
-                                                 x+j_coord_offsetC,x+j_coord_offsetD,
-                                                 x+j_coord_offsetE,x+j_coord_offsetF,
-                                                 x+j_coord_offsetG,x+j_coord_offsetH,
-                                                 &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm256_sub_ps(ix0,jx0);
-            dy00             = _mm256_sub_ps(iy0,jy0);
-            dz00             = _mm256_sub_ps(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm256_calc_rsq_ps(dx00,dy00,dz00);
-
-            rinv00           = avx256_invsqrt_f(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm256_load_8real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
-                                                                 charge+jnrC+0,charge+jnrD+0,
-                                                                 charge+jnrE+0,charge+jnrF+0,
-                                                                 charge+jnrG+0,charge+jnrH+0);
-            isaj0            = gmx_mm256_load_8real_swizzle_ps(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                                 invsqrta+jnrC+0,invsqrta+jnrD+0,
-                                                                 invsqrta+jnrE+0,invsqrta+jnrF+0,
-                                                                 invsqrta+jnrG+0,invsqrta+jnrH+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-            vdwjidx0B        = 2*vdwtype[jnrB+0];
-            vdwjidx0C        = 2*vdwtype[jnrC+0];
-            vdwjidx0D        = 2*vdwtype[jnrD+0];
-            vdwjidx0E        = 2*vdwtype[jnrE+0];
-            vdwjidx0F        = 2*vdwtype[jnrF+0];
-            vdwjidx0G        = 2*vdwtype[jnrG+0];
-            vdwjidx0H        = 2*vdwtype[jnrH+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm256_mul_ps(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm256_mul_ps(iq0,jq0);
-            gmx_mm256_load_8pair_swizzle_ps(vdwioffsetptr0+vdwjidx0A,
-                                            vdwioffsetptr0+vdwjidx0B,
-                                            vdwioffsetptr0+vdwjidx0C,
-                                            vdwioffsetptr0+vdwjidx0D,
-                                            vdwioffsetptr0+vdwjidx0E,
-                                            vdwioffsetptr0+vdwjidx0F,
-                                            vdwioffsetptr0+vdwjidx0G,
-                                            vdwioffsetptr0+vdwjidx0H,
-                                            &c6_00,&c12_00);
-
-            /* Calculate table index by multiplying r with table scale and truncate to integer */
-            rt               = _mm256_mul_ps(r00,vftabscale);
-            vfitab           = _mm256_cvttps_epi32(rt);
-            vfeps            = _mm256_sub_ps(rt,_mm256_round_ps(rt, _MM_FROUND_FLOOR));
-            /*         AVX1 does not support 256-bit integer operations, so now we go to 128-bit mode... */
-            vfitab_lo        = _mm256_extractf128_si256(vfitab,0x0);
-            vfitab_hi        = _mm256_extractf128_si256(vfitab,0x1);
-            vfitab_lo        = _mm_slli_epi32(vfitab_lo,3);
-            vfitab_hi        = _mm_slli_epi32(vfitab_hi,3);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm256_mul_ps(isai0,isaj0);
-            gbqqfactor       = _mm256_xor_ps(signbit,_mm256_mul_ps(qq00,_mm256_mul_ps(isaprod,gbinvepsdiff)));
-            gbscale          = _mm256_mul_ps(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm256_mul_ps(r00,gbscale);
-            gbitab           = _mm256_cvttps_epi32(rt);
-            gbeps            = _mm256_sub_ps(rt,_mm256_round_ps(rt, _MM_FROUND_FLOOR));
-            /*         AVX1 does not support 256-bit integer operations, so now we go to 128-bit mode... */
-            gbitab_lo        = _mm256_extractf128_si256(gbitab,0x0);
-            gbitab_hi        = _mm256_extractf128_si256(gbitab,0x1);
-            gbitab_lo        = _mm_slli_epi32(gbitab_lo,2);
-            gbitab_hi        = _mm_slli_epi32(gbitab_hi,2);
-            Y                = gmx_mm256_set_m128(_mm_load_ps(gbtab + _mm_extract_epi32(gbitab_hi,0)),
-                                                  _mm_load_ps(gbtab + _mm_extract_epi32(gbitab_lo,0)));
-            F                = gmx_mm256_set_m128(_mm_load_ps(gbtab + _mm_extract_epi32(gbitab_hi,1)),
-                                                  _mm_load_ps(gbtab + _mm_extract_epi32(gbitab_lo,1)));
-            G                = gmx_mm256_set_m128(_mm_load_ps(gbtab + _mm_extract_epi32(gbitab_hi,2)),
-                                                  _mm_load_ps(gbtab + _mm_extract_epi32(gbitab_lo,2)));
-            H                = gmx_mm256_set_m128(_mm_load_ps(gbtab + _mm_extract_epi32(gbitab_hi,3)),
-                                                  _mm_load_ps(gbtab + _mm_extract_epi32(gbitab_lo,3)));
-            GMX_MM256_HALFTRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm256_mul_ps(gbeps,H);
-            Fp               = _mm256_add_ps(F,_mm256_mul_ps(gbeps,_mm256_add_ps(G,Heps)));
-            VV               = _mm256_add_ps(Y,_mm256_mul_ps(gbeps,Fp));
-            vgb              = _mm256_mul_ps(gbqqfactor,VV);
-
-            FF               = _mm256_add_ps(Fp,_mm256_mul_ps(gbeps,_mm256_add_ps(G,_mm256_add_ps(Heps,Heps))));
-            fgb              = _mm256_mul_ps(gbqqfactor,_mm256_mul_ps(FF,gbscale));
-            dvdatmp          = _mm256_mul_ps(minushalf,_mm256_add_ps(vgb,_mm256_mul_ps(fgb,r00)));
-            dvdasum          = _mm256_add_ps(dvdasum,dvdatmp);
-            fjptrA           = dvda+jnrA;
-            fjptrB           = dvda+jnrB;
-            fjptrC           = dvda+jnrC;
-            fjptrD           = dvda+jnrD;
-            fjptrE           = dvda+jnrE;
-            fjptrF           = dvda+jnrF;
-            fjptrG           = dvda+jnrG;
-            fjptrH           = dvda+jnrH;
-            gmx_mm256_increment_8real_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,fjptrE,fjptrF,fjptrG,fjptrH,
-                                                 _mm256_mul_ps(dvdatmp,_mm256_mul_ps(isaj0,isaj0)));
-            velec            = _mm256_mul_ps(qq00,rinv00);
-            felec            = _mm256_mul_ps(_mm256_sub_ps(_mm256_mul_ps(velec,rinv00),fgb),rinv00);
-
-            /* CUBIC SPLINE TABLE DISPERSION */
-            Y                = gmx_mm256_set_m128(_mm_load_ps(vftab + _mm_extract_epi32(vfitab_hi,0)),
-                                                  _mm_load_ps(vftab + _mm_extract_epi32(vfitab_lo,0)));
-            F                = gmx_mm256_set_m128(_mm_load_ps(vftab + _mm_extract_epi32(vfitab_hi,1)),
-                                                  _mm_load_ps(vftab + _mm_extract_epi32(vfitab_lo,1)));
-            G                = gmx_mm256_set_m128(_mm_load_ps(vftab + _mm_extract_epi32(vfitab_hi,2)),
-                                                  _mm_load_ps(vftab + _mm_extract_epi32(vfitab_lo,2)));
-            H                = gmx_mm256_set_m128(_mm_load_ps(vftab + _mm_extract_epi32(vfitab_hi,3)),
-                                                  _mm_load_ps(vftab + _mm_extract_epi32(vfitab_lo,3)));
-            GMX_MM256_HALFTRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm256_mul_ps(vfeps,H);
-            Fp               = _mm256_add_ps(F,_mm256_mul_ps(vfeps,_mm256_add_ps(G,Heps)));
-            FF               = _mm256_add_ps(Fp,_mm256_mul_ps(vfeps,_mm256_add_ps(G,_mm256_add_ps(Heps,Heps))));
-            fvdw6            = _mm256_mul_ps(c6_00,FF);
-
-            /* CUBIC SPLINE TABLE REPULSION */
-            vfitab_lo        = _mm_add_epi32(vfitab_lo,ifour);
-            vfitab_hi        = _mm_add_epi32(vfitab_hi,ifour);
-            Y                = gmx_mm256_set_m128(_mm_load_ps(vftab + _mm_extract_epi32(vfitab_hi,0)),
-                                                  _mm_load_ps(vftab + _mm_extract_epi32(vfitab_lo,0)));
-            F                = gmx_mm256_set_m128(_mm_load_ps(vftab + _mm_extract_epi32(vfitab_hi,1)),
-                                                  _mm_load_ps(vftab + _mm_extract_epi32(vfitab_lo,1)));
-            G                = gmx_mm256_set_m128(_mm_load_ps(vftab + _mm_extract_epi32(vfitab_hi,2)),
-                                                  _mm_load_ps(vftab + _mm_extract_epi32(vfitab_lo,2)));
-            H                = gmx_mm256_set_m128(_mm_load_ps(vftab + _mm_extract_epi32(vfitab_hi,3)),
-                                                  _mm_load_ps(vftab + _mm_extract_epi32(vfitab_lo,3)));
-            GMX_MM256_HALFTRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm256_mul_ps(vfeps,H);
-            Fp               = _mm256_add_ps(F,_mm256_mul_ps(vfeps,_mm256_add_ps(G,Heps)));
-            FF               = _mm256_add_ps(Fp,_mm256_mul_ps(vfeps,_mm256_add_ps(G,_mm256_add_ps(Heps,Heps))));
-            fvdw12           = _mm256_mul_ps(c12_00,FF);
-            fvdw             = _mm256_xor_ps(signbit,_mm256_mul_ps(_mm256_add_ps(fvdw6,fvdw12),_mm256_mul_ps(vftabscale,rinv00)));
-
-            fscal            = _mm256_add_ps(felec,fvdw);
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm256_mul_ps(fscal,dx00);
-            ty               = _mm256_mul_ps(fscal,dy00);
-            tz               = _mm256_mul_ps(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm256_add_ps(fix0,tx);
-            fiy0             = _mm256_add_ps(fiy0,ty);
-            fiz0             = _mm256_add_ps(fiz0,tz);
-
-            fjptrA             = f+j_coord_offsetA;
-            fjptrB             = f+j_coord_offsetB;
-            fjptrC             = f+j_coord_offsetC;
-            fjptrD             = f+j_coord_offsetD;
-            fjptrE             = f+j_coord_offsetE;
-            fjptrF             = f+j_coord_offsetF;
-            fjptrG             = f+j_coord_offsetG;
-            fjptrH             = f+j_coord_offsetH;
-            gmx_mm256_decrement_1rvec_8ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,fjptrE,fjptrF,fjptrG,fjptrH,tx,ty,tz);
-
-            /* Inner loop uses 81 flops */
-        }
-
-        if(jidx<j_index_end)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrlistA         = jjnr[jidx];
-            jnrlistB         = jjnr[jidx+1];
-            jnrlistC         = jjnr[jidx+2];
-            jnrlistD         = jjnr[jidx+3];
-            jnrlistE         = jjnr[jidx+4];
-            jnrlistF         = jjnr[jidx+5];
-            jnrlistG         = jjnr[jidx+6];
-            jnrlistH         = jjnr[jidx+7];
-            /* Sign of each element will be negative for non-real atoms.
-             * This mask will be 0xFFFFFFFF for dummy entries and 0x0 for real ones,
-             * so use it as val = _mm_andnot_ps(mask,val) to clear dummy entries.
-             */
-            dummy_mask = gmx_mm256_set_m128(gmx_mm_castsi128_ps(_mm_cmplt_epi32(_mm_loadu_si128((const __m128i *)(jjnr+jidx+4)),_mm_setzero_si128())),
-                                            gmx_mm_castsi128_ps(_mm_cmplt_epi32(_mm_loadu_si128((const __m128i *)(jjnr+jidx)),_mm_setzero_si128())));
-                                            
-            jnrA       = (jnrlistA>=0) ? jnrlistA : 0;
-            jnrB       = (jnrlistB>=0) ? jnrlistB : 0;
-            jnrC       = (jnrlistC>=0) ? jnrlistC : 0;
-            jnrD       = (jnrlistD>=0) ? jnrlistD : 0;
-            jnrE       = (jnrlistE>=0) ? jnrlistE : 0;
-            jnrF       = (jnrlistF>=0) ? jnrlistF : 0;
-            jnrG       = (jnrlistG>=0) ? jnrlistG : 0;
-            jnrH       = (jnrlistH>=0) ? jnrlistH : 0;
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-            j_coord_offsetE  = DIM*jnrE;
-            j_coord_offsetF  = DIM*jnrF;
-            j_coord_offsetG  = DIM*jnrG;
-            j_coord_offsetH  = DIM*jnrH;
-
-            /* load j atom coordinates */
-            gmx_mm256_load_1rvec_8ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
-                                                 x+j_coord_offsetC,x+j_coord_offsetD,
-                                                 x+j_coord_offsetE,x+j_coord_offsetF,
-                                                 x+j_coord_offsetG,x+j_coord_offsetH,
-                                                 &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm256_sub_ps(ix0,jx0);
-            dy00             = _mm256_sub_ps(iy0,jy0);
-            dz00             = _mm256_sub_ps(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm256_calc_rsq_ps(dx00,dy00,dz00);
-
-            rinv00           = avx256_invsqrt_f(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm256_load_8real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
-                                                                 charge+jnrC+0,charge+jnrD+0,
-                                                                 charge+jnrE+0,charge+jnrF+0,
-                                                                 charge+jnrG+0,charge+jnrH+0);
-            isaj0            = gmx_mm256_load_8real_swizzle_ps(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                                 invsqrta+jnrC+0,invsqrta+jnrD+0,
-                                                                 invsqrta+jnrE+0,invsqrta+jnrF+0,
-                                                                 invsqrta+jnrG+0,invsqrta+jnrH+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-            vdwjidx0B        = 2*vdwtype[jnrB+0];
-            vdwjidx0C        = 2*vdwtype[jnrC+0];
-            vdwjidx0D        = 2*vdwtype[jnrD+0];
-            vdwjidx0E        = 2*vdwtype[jnrE+0];
-            vdwjidx0F        = 2*vdwtype[jnrF+0];
-            vdwjidx0G        = 2*vdwtype[jnrG+0];
-            vdwjidx0H        = 2*vdwtype[jnrH+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm256_mul_ps(rsq00,rinv00);
-            r00              = _mm256_andnot_ps(dummy_mask,r00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm256_mul_ps(iq0,jq0);
-            gmx_mm256_load_8pair_swizzle_ps(vdwioffsetptr0+vdwjidx0A,
-                                            vdwioffsetptr0+vdwjidx0B,
-                                            vdwioffsetptr0+vdwjidx0C,
-                                            vdwioffsetptr0+vdwjidx0D,
-                                            vdwioffsetptr0+vdwjidx0E,
-                                            vdwioffsetptr0+vdwjidx0F,
-                                            vdwioffsetptr0+vdwjidx0G,
-                                            vdwioffsetptr0+vdwjidx0H,
-                                            &c6_00,&c12_00);
-
-            /* Calculate table index by multiplying r with table scale and truncate to integer */
-            rt               = _mm256_mul_ps(r00,vftabscale);
-            vfitab           = _mm256_cvttps_epi32(rt);
-            vfeps            = _mm256_sub_ps(rt,_mm256_round_ps(rt, _MM_FROUND_FLOOR));
-            /*         AVX1 does not support 256-bit integer operations, so now we go to 128-bit mode... */
-            vfitab_lo        = _mm256_extractf128_si256(vfitab,0x0);
-            vfitab_hi        = _mm256_extractf128_si256(vfitab,0x1);
-            vfitab_lo        = _mm_slli_epi32(vfitab_lo,3);
-            vfitab_hi        = _mm_slli_epi32(vfitab_hi,3);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm256_mul_ps(isai0,isaj0);
-            gbqqfactor       = _mm256_xor_ps(signbit,_mm256_mul_ps(qq00,_mm256_mul_ps(isaprod,gbinvepsdiff)));
-            gbscale          = _mm256_mul_ps(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm256_mul_ps(r00,gbscale);
-            gbitab           = _mm256_cvttps_epi32(rt);
-            gbeps            = _mm256_sub_ps(rt,_mm256_round_ps(rt, _MM_FROUND_FLOOR));
-            /*         AVX1 does not support 256-bit integer operations, so now we go to 128-bit mode... */
-            gbitab_lo        = _mm256_extractf128_si256(gbitab,0x0);
-            gbitab_hi        = _mm256_extractf128_si256(gbitab,0x1);
-            gbitab_lo        = _mm_slli_epi32(gbitab_lo,2);
-            gbitab_hi        = _mm_slli_epi32(gbitab_hi,2);
-            Y                = gmx_mm256_set_m128(_mm_load_ps(gbtab + _mm_extract_epi32(gbitab_hi,0)),
-                                                  _mm_load_ps(gbtab + _mm_extract_epi32(gbitab_lo,0)));
-            F                = gmx_mm256_set_m128(_mm_load_ps(gbtab + _mm_extract_epi32(gbitab_hi,1)),
-                                                  _mm_load_ps(gbtab + _mm_extract_epi32(gbitab_lo,1)));
-            G                = gmx_mm256_set_m128(_mm_load_ps(gbtab + _mm_extract_epi32(gbitab_hi,2)),
-                                                  _mm_load_ps(gbtab + _mm_extract_epi32(gbitab_lo,2)));
-            H                = gmx_mm256_set_m128(_mm_load_ps(gbtab + _mm_extract_epi32(gbitab_hi,3)),
-                                                  _mm_load_ps(gbtab + _mm_extract_epi32(gbitab_lo,3)));
-            GMX_MM256_HALFTRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm256_mul_ps(gbeps,H);
-            Fp               = _mm256_add_ps(F,_mm256_mul_ps(gbeps,_mm256_add_ps(G,Heps)));
-            VV               = _mm256_add_ps(Y,_mm256_mul_ps(gbeps,Fp));
-            vgb              = _mm256_mul_ps(gbqqfactor,VV);
-
-            FF               = _mm256_add_ps(Fp,_mm256_mul_ps(gbeps,_mm256_add_ps(G,_mm256_add_ps(Heps,Heps))));
-            fgb              = _mm256_mul_ps(gbqqfactor,_mm256_mul_ps(FF,gbscale));
-            dvdatmp          = _mm256_mul_ps(minushalf,_mm256_add_ps(vgb,_mm256_mul_ps(fgb,r00)));
-            dvdatmp          = _mm256_andnot_ps(dummy_mask,dvdatmp);
-            dvdasum          = _mm256_add_ps(dvdasum,dvdatmp);
-            /* The pointers to scratch make sure that this code with compilers that take gmx_restrict seriously (e.g. icc 13) really can't screw things up. */
-            fjptrA             = (jnrlistA>=0) ? dvda+jnrA : scratch;
-            fjptrB             = (jnrlistB>=0) ? dvda+jnrB : scratch;
-            fjptrC             = (jnrlistC>=0) ? dvda+jnrC : scratch;
-            fjptrD             = (jnrlistD>=0) ? dvda+jnrD : scratch;
-            fjptrE             = (jnrlistE>=0) ? dvda+jnrE : scratch;
-            fjptrF             = (jnrlistF>=0) ? dvda+jnrF : scratch;
-            fjptrG             = (jnrlistG>=0) ? dvda+jnrG : scratch;
-            fjptrH             = (jnrlistH>=0) ? dvda+jnrH : scratch;
-            gmx_mm256_increment_8real_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,fjptrE,fjptrF,fjptrG,fjptrH,
-                                                 _mm256_mul_ps(dvdatmp,_mm256_mul_ps(isaj0,isaj0)));
-            velec            = _mm256_mul_ps(qq00,rinv00);
-            felec            = _mm256_mul_ps(_mm256_sub_ps(_mm256_mul_ps(velec,rinv00),fgb),rinv00);
-
-            /* CUBIC SPLINE TABLE DISPERSION */
-            Y                = gmx_mm256_set_m128(_mm_load_ps(vftab + _mm_extract_epi32(vfitab_hi,0)),
-                                                  _mm_load_ps(vftab + _mm_extract_epi32(vfitab_lo,0)));
-            F                = gmx_mm256_set_m128(_mm_load_ps(vftab + _mm_extract_epi32(vfitab_hi,1)),
-                                                  _mm_load_ps(vftab + _mm_extract_epi32(vfitab_lo,1)));
-            G                = gmx_mm256_set_m128(_mm_load_ps(vftab + _mm_extract_epi32(vfitab_hi,2)),
-                                                  _mm_load_ps(vftab + _mm_extract_epi32(vfitab_lo,2)));
-            H                = gmx_mm256_set_m128(_mm_load_ps(vftab + _mm_extract_epi32(vfitab_hi,3)),
-                                                  _mm_load_ps(vftab + _mm_extract_epi32(vfitab_lo,3)));
-            GMX_MM256_HALFTRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm256_mul_ps(vfeps,H);
-            Fp               = _mm256_add_ps(F,_mm256_mul_ps(vfeps,_mm256_add_ps(G,Heps)));
-            FF               = _mm256_add_ps(Fp,_mm256_mul_ps(vfeps,_mm256_add_ps(G,_mm256_add_ps(Heps,Heps))));
-            fvdw6            = _mm256_mul_ps(c6_00,FF);
-
-            /* CUBIC SPLINE TABLE REPULSION */
-            vfitab_lo        = _mm_add_epi32(vfitab_lo,ifour);
-            vfitab_hi        = _mm_add_epi32(vfitab_hi,ifour);
-            Y                = gmx_mm256_set_m128(_mm_load_ps(vftab + _mm_extract_epi32(vfitab_hi,0)),
-                                                  _mm_load_ps(vftab + _mm_extract_epi32(vfitab_lo,0)));
-            F                = gmx_mm256_set_m128(_mm_load_ps(vftab + _mm_extract_epi32(vfitab_hi,1)),
-                                                  _mm_load_ps(vftab + _mm_extract_epi32(vfitab_lo,1)));
-            G                = gmx_mm256_set_m128(_mm_load_ps(vftab + _mm_extract_epi32(vfitab_hi,2)),
-                                                  _mm_load_ps(vftab + _mm_extract_epi32(vfitab_lo,2)));
-            H                = gmx_mm256_set_m128(_mm_load_ps(vftab + _mm_extract_epi32(vfitab_hi,3)),
-                                                  _mm_load_ps(vftab + _mm_extract_epi32(vfitab_lo,3)));
-            GMX_MM256_HALFTRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm256_mul_ps(vfeps,H);
-            Fp               = _mm256_add_ps(F,_mm256_mul_ps(vfeps,_mm256_add_ps(G,Heps)));
-            FF               = _mm256_add_ps(Fp,_mm256_mul_ps(vfeps,_mm256_add_ps(G,_mm256_add_ps(Heps,Heps))));
-            fvdw12           = _mm256_mul_ps(c12_00,FF);
-            fvdw             = _mm256_xor_ps(signbit,_mm256_mul_ps(_mm256_add_ps(fvdw6,fvdw12),_mm256_mul_ps(vftabscale,rinv00)));
-
-            fscal            = _mm256_add_ps(felec,fvdw);
-
-            fscal            = _mm256_andnot_ps(dummy_mask,fscal);
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm256_mul_ps(fscal,dx00);
-            ty               = _mm256_mul_ps(fscal,dy00);
-            tz               = _mm256_mul_ps(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm256_add_ps(fix0,tx);
-            fiy0             = _mm256_add_ps(fiy0,ty);
-            fiz0             = _mm256_add_ps(fiz0,tz);
-
-            fjptrA             = (jnrlistA>=0) ? f+j_coord_offsetA : scratch;
-            fjptrB             = (jnrlistB>=0) ? f+j_coord_offsetB : scratch;
-            fjptrC             = (jnrlistC>=0) ? f+j_coord_offsetC : scratch;
-            fjptrD             = (jnrlistD>=0) ? f+j_coord_offsetD : scratch;
-            fjptrE             = (jnrlistE>=0) ? f+j_coord_offsetE : scratch;
-            fjptrF             = (jnrlistF>=0) ? f+j_coord_offsetF : scratch;
-            fjptrG             = (jnrlistG>=0) ? f+j_coord_offsetG : scratch;
-            fjptrH             = (jnrlistH>=0) ? f+j_coord_offsetH : scratch;
-            gmx_mm256_decrement_1rvec_8ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,fjptrE,fjptrF,fjptrG,fjptrH,tx,ty,tz);
-
-            /* Inner loop uses 82 flops */
-        }
-
-        /* End of innermost loop */
-
-        gmx_mm256_update_iforce_1atom_swizzle_ps(fix0,fiy0,fiz0,
-                                                 f+i_coord_offset,fshift+i_shift_offset);
-
-        dvdasum = _mm256_mul_ps(dvdasum, _mm256_mul_ps(isai0,isai0));
-        gmx_mm256_update_1pot_ps(dvdasum,dvda+inr);
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 7 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_F,outeriter*7 + inneriter*82);
-}
diff --git a/src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecGB_VdwLJ_GeomP1P1_avx_256_single.c b/src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecGB_VdwLJ_GeomP1P1_avx_256_single.c
deleted file mode 100644 (file)
index 6dfbecb..0000000
+++ /dev/null
@@ -1,1038 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
- * and including many others, as listed in the AUTHORS file in the
- * top-level source directory and at http://www.gromacs.org.
- *
- * GROMACS is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * GROMACS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GROMACS; if not, see
- * http://www.gnu.org/licenses, or write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
- *
- * If you want to redistribute modifications to GROMACS, please
- * consider that scientific software is very special. Version
- * control is crucial - bugs must be traceable. We will be happy to
- * consider code for inclusion in the official distribution, but
- * derived work must not be called official GROMACS. Details are found
- * in the README & COPYING files - if they are missing, get the
- * official version at http://www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the research papers on the package. Check out http://www.gromacs.org.
- */
-/*
- * Note: this file was generated by the GROMACS avx_256_single kernel generator.
- */
-#include "gmxpre.h"
-
-#include "config.h"
-
-#include <math.h>
-
-#include "../nb_kernel.h"
-#include "gromacs/gmxlib/nrnb.h"
-
-#include "kernelutil_x86_avx_256_single.h"
-
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_avx_256_single
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            LennardJones
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        PotentialAndForce
- */
-void
-nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_avx_256_single
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or 
-     * just 0 for non-waters.
-     * Suffixes A,B,C,D,E,F,G,H refer to j loop unrolling done with AVX, e.g. for the eight different
-     * jnr indices corresponding to data put in the four positions in the SIMD register.
-     */
-    int              i_shift_offset,i_coord_offset,outeriter,inneriter;
-    int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
-    int              jnrA,jnrB,jnrC,jnrD;
-    int              jnrE,jnrF,jnrG,jnrH;
-    int              jnrlistA,jnrlistB,jnrlistC,jnrlistD;
-    int              jnrlistE,jnrlistF,jnrlistG,jnrlistH;
-    int              j_coord_offsetA,j_coord_offsetB,j_coord_offsetC,j_coord_offsetD;
-    int              j_coord_offsetE,j_coord_offsetF,j_coord_offsetG,j_coord_offsetH;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             rcutoff_scalar;
-    real             *shiftvec,*fshift,*x,*f;
-    real             *fjptrA,*fjptrB,*fjptrC,*fjptrD,*fjptrE,*fjptrF,*fjptrG,*fjptrH;
-    real             scratch[4*DIM];
-    __m256           tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
-    real *           vdwioffsetptr0;
-    __m256           ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0A,vdwjidx0B,vdwjidx0C,vdwjidx0D,vdwjidx0E,vdwjidx0F,vdwjidx0G,vdwjidx0H;
-    __m256           jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    __m256           dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
-    __m256           velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    __m256i          gbitab;
-    __m128i          gbitab_lo,gbitab_hi;
-    __m256           vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,gbeps,dvdatmp;
-    __m256           minushalf = _mm256_set1_ps(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    int              nvdwtype;
-    __m256           rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
-    int              *vdwtype;
-    real             *vdwparam;
-    __m256           one_sixth   = _mm256_set1_ps(1.0/6.0);
-    __m256           one_twelfth = _mm256_set1_ps(1.0/12.0);
-    __m256i          vfitab;
-    __m128i          vfitab_lo,vfitab_hi;
-    __m128i          ifour       = _mm_set1_epi32(4);
-    __m256           rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF;
-    real             *vftab;
-    __m256           dummy_mask,cutoff_mask;
-    __m256           signbit = _mm256_castsi256_ps( _mm256_set1_epi32(0x80000000) );
-    __m256           one     = _mm256_set1_ps(1.0);
-    __m256           two     = _mm256_set1_ps(2.0);
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = _mm256_set1_ps(fr->ic->epsfac);
-    charge           = mdatoms->chargeA;
-    nvdwtype         = fr->ntype;
-    vdwparam         = fr->nbfp;
-    vdwtype          = mdatoms->typeA;
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = _mm256_set1_ps(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = _mm256_set1_ps((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-
-    /* Avoid stupid compiler warnings */
-    jnrA = jnrB = jnrC = jnrD = jnrE = jnrF = jnrG = jnrH = 0;
-    j_coord_offsetA = 0;
-    j_coord_offsetB = 0;
-    j_coord_offsetC = 0;
-    j_coord_offsetD = 0;
-    j_coord_offsetE = 0;
-    j_coord_offsetF = 0;
-    j_coord_offsetG = 0;
-    j_coord_offsetH = 0;
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    for(iidx=0;iidx<4*DIM;iidx++)
-    {
-        scratch[iidx] = 0.0;
-    }
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        gmx_mm256_load_shift_and_1rvec_broadcast_ps(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
-
-        fix0             = _mm256_setzero_ps();
-        fiy0             = _mm256_setzero_ps();
-        fiz0             = _mm256_setzero_ps();
-
-        /* Load parameters for i particles */
-        iq0              = _mm256_mul_ps(facel,_mm256_set1_ps(charge[inr+0]));
-        isai0            = _mm256_set1_ps(invsqrta[inr+0]);
-        vdwioffsetptr0   = vdwparam+2*nvdwtype*vdwtype[inr+0];
-
-        /* Reset potential sums */
-        velecsum         = _mm256_setzero_ps();
-        vgbsum           = _mm256_setzero_ps();
-        vvdwsum          = _mm256_setzero_ps();
-        dvdasum          = _mm256_setzero_ps();
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end && jjnr[jidx+7]>=0; jidx+=8)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrA             = jjnr[jidx];
-            jnrB             = jjnr[jidx+1];
-            jnrC             = jjnr[jidx+2];
-            jnrD             = jjnr[jidx+3];
-            jnrE             = jjnr[jidx+4];
-            jnrF             = jjnr[jidx+5];
-            jnrG             = jjnr[jidx+6];
-            jnrH             = jjnr[jidx+7];
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-            j_coord_offsetE  = DIM*jnrE;
-            j_coord_offsetF  = DIM*jnrF;
-            j_coord_offsetG  = DIM*jnrG;
-            j_coord_offsetH  = DIM*jnrH;
-
-            /* load j atom coordinates */
-            gmx_mm256_load_1rvec_8ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
-                                                 x+j_coord_offsetC,x+j_coord_offsetD,
-                                                 x+j_coord_offsetE,x+j_coord_offsetF,
-                                                 x+j_coord_offsetG,x+j_coord_offsetH,
-                                                 &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm256_sub_ps(ix0,jx0);
-            dy00             = _mm256_sub_ps(iy0,jy0);
-            dz00             = _mm256_sub_ps(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm256_calc_rsq_ps(dx00,dy00,dz00);
-
-            rinv00           = avx256_invsqrt_f(rsq00);
-
-            rinvsq00         = _mm256_mul_ps(rinv00,rinv00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm256_load_8real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
-                                                                 charge+jnrC+0,charge+jnrD+0,
-                                                                 charge+jnrE+0,charge+jnrF+0,
-                                                                 charge+jnrG+0,charge+jnrH+0);
-            isaj0            = gmx_mm256_load_8real_swizzle_ps(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                                 invsqrta+jnrC+0,invsqrta+jnrD+0,
-                                                                 invsqrta+jnrE+0,invsqrta+jnrF+0,
-                                                                 invsqrta+jnrG+0,invsqrta+jnrH+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-            vdwjidx0B        = 2*vdwtype[jnrB+0];
-            vdwjidx0C        = 2*vdwtype[jnrC+0];
-            vdwjidx0D        = 2*vdwtype[jnrD+0];
-            vdwjidx0E        = 2*vdwtype[jnrE+0];
-            vdwjidx0F        = 2*vdwtype[jnrF+0];
-            vdwjidx0G        = 2*vdwtype[jnrG+0];
-            vdwjidx0H        = 2*vdwtype[jnrH+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm256_mul_ps(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm256_mul_ps(iq0,jq0);
-            gmx_mm256_load_8pair_swizzle_ps(vdwioffsetptr0+vdwjidx0A,
-                                            vdwioffsetptr0+vdwjidx0B,
-                                            vdwioffsetptr0+vdwjidx0C,
-                                            vdwioffsetptr0+vdwjidx0D,
-                                            vdwioffsetptr0+vdwjidx0E,
-                                            vdwioffsetptr0+vdwjidx0F,
-                                            vdwioffsetptr0+vdwjidx0G,
-                                            vdwioffsetptr0+vdwjidx0H,
-                                            &c6_00,&c12_00);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm256_mul_ps(isai0,isaj0);
-            gbqqfactor       = _mm256_xor_ps(signbit,_mm256_mul_ps(qq00,_mm256_mul_ps(isaprod,gbinvepsdiff)));
-            gbscale          = _mm256_mul_ps(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm256_mul_ps(r00,gbscale);
-            gbitab           = _mm256_cvttps_epi32(rt);
-            gbeps            = _mm256_sub_ps(rt,_mm256_round_ps(rt, _MM_FROUND_FLOOR));
-            /*         AVX1 does not support 256-bit integer operations, so now we go to 128-bit mode... */
-            gbitab_lo        = _mm256_extractf128_si256(gbitab,0x0);
-            gbitab_hi        = _mm256_extractf128_si256(gbitab,0x1);
-            gbitab_lo        = _mm_slli_epi32(gbitab_lo,2);
-            gbitab_hi        = _mm_slli_epi32(gbitab_hi,2);
-            Y                = gmx_mm256_set_m128(_mm_load_ps(gbtab + _mm_extract_epi32(gbitab_hi,0)),
-                                                  _mm_load_ps(gbtab + _mm_extract_epi32(gbitab_lo,0)));
-            F                = gmx_mm256_set_m128(_mm_load_ps(gbtab + _mm_extract_epi32(gbitab_hi,1)),
-                                                  _mm_load_ps(gbtab + _mm_extract_epi32(gbitab_lo,1)));
-            G                = gmx_mm256_set_m128(_mm_load_ps(gbtab + _mm_extract_epi32(gbitab_hi,2)),
-                                                  _mm_load_ps(gbtab + _mm_extract_epi32(gbitab_lo,2)));
-            H                = gmx_mm256_set_m128(_mm_load_ps(gbtab + _mm_extract_epi32(gbitab_hi,3)),
-                                                  _mm_load_ps(gbtab + _mm_extract_epi32(gbitab_lo,3)));
-            GMX_MM256_HALFTRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm256_mul_ps(gbeps,H);
-            Fp               = _mm256_add_ps(F,_mm256_mul_ps(gbeps,_mm256_add_ps(G,Heps)));
-            VV               = _mm256_add_ps(Y,_mm256_mul_ps(gbeps,Fp));
-            vgb              = _mm256_mul_ps(gbqqfactor,VV);
-
-            FF               = _mm256_add_ps(Fp,_mm256_mul_ps(gbeps,_mm256_add_ps(G,_mm256_add_ps(Heps,Heps))));
-            fgb              = _mm256_mul_ps(gbqqfactor,_mm256_mul_ps(FF,gbscale));
-            dvdatmp          = _mm256_mul_ps(minushalf,_mm256_add_ps(vgb,_mm256_mul_ps(fgb,r00)));
-            dvdasum          = _mm256_add_ps(dvdasum,dvdatmp);
-            fjptrA           = dvda+jnrA;
-            fjptrB           = dvda+jnrB;
-            fjptrC           = dvda+jnrC;
-            fjptrD           = dvda+jnrD;
-            fjptrE           = dvda+jnrE;
-            fjptrF           = dvda+jnrF;
-            fjptrG           = dvda+jnrG;
-            fjptrH           = dvda+jnrH;
-            gmx_mm256_increment_8real_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,fjptrE,fjptrF,fjptrG,fjptrH,
-                                                 _mm256_mul_ps(dvdatmp,_mm256_mul_ps(isaj0,isaj0)));
-            velec            = _mm256_mul_ps(qq00,rinv00);
-            felec            = _mm256_mul_ps(_mm256_sub_ps(_mm256_mul_ps(velec,rinv00),fgb),rinv00);
-
-            /* LENNARD-JONES DISPERSION/REPULSION */
-
-            rinvsix          = _mm256_mul_ps(_mm256_mul_ps(rinvsq00,rinvsq00),rinvsq00);
-            vvdw6            = _mm256_mul_ps(c6_00,rinvsix);
-            vvdw12           = _mm256_mul_ps(c12_00,_mm256_mul_ps(rinvsix,rinvsix));
-            vvdw             = _mm256_sub_ps( _mm256_mul_ps(vvdw12,one_twelfth) , _mm256_mul_ps(vvdw6,one_sixth) );
-            fvdw             = _mm256_mul_ps(_mm256_sub_ps(vvdw12,vvdw6),rinvsq00);
-
-            /* Update potential sum for this i atom from the interaction with this j atom. */
-            velecsum         = _mm256_add_ps(velecsum,velec);
-            vgbsum           = _mm256_add_ps(vgbsum,vgb);
-            vvdwsum          = _mm256_add_ps(vvdwsum,vvdw);
-
-            fscal            = _mm256_add_ps(felec,fvdw);
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm256_mul_ps(fscal,dx00);
-            ty               = _mm256_mul_ps(fscal,dy00);
-            tz               = _mm256_mul_ps(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm256_add_ps(fix0,tx);
-            fiy0             = _mm256_add_ps(fiy0,ty);
-            fiz0             = _mm256_add_ps(fiz0,tz);
-
-            fjptrA             = f+j_coord_offsetA;
-            fjptrB             = f+j_coord_offsetB;
-            fjptrC             = f+j_coord_offsetC;
-            fjptrD             = f+j_coord_offsetD;
-            fjptrE             = f+j_coord_offsetE;
-            fjptrF             = f+j_coord_offsetF;
-            fjptrG             = f+j_coord_offsetG;
-            fjptrH             = f+j_coord_offsetH;
-            gmx_mm256_decrement_1rvec_8ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,fjptrE,fjptrF,fjptrG,fjptrH,tx,ty,tz);
-
-            /* Inner loop uses 70 flops */
-        }
-
-        if(jidx<j_index_end)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrlistA         = jjnr[jidx];
-            jnrlistB         = jjnr[jidx+1];
-            jnrlistC         = jjnr[jidx+2];
-            jnrlistD         = jjnr[jidx+3];
-            jnrlistE         = jjnr[jidx+4];
-            jnrlistF         = jjnr[jidx+5];
-            jnrlistG         = jjnr[jidx+6];
-            jnrlistH         = jjnr[jidx+7];
-            /* Sign of each element will be negative for non-real atoms.
-             * This mask will be 0xFFFFFFFF for dummy entries and 0x0 for real ones,
-             * so use it as val = _mm_andnot_ps(mask,val) to clear dummy entries.
-             */
-            dummy_mask = gmx_mm256_set_m128(gmx_mm_castsi128_ps(_mm_cmplt_epi32(_mm_loadu_si128((const __m128i *)(jjnr+jidx+4)),_mm_setzero_si128())),
-                                            gmx_mm_castsi128_ps(_mm_cmplt_epi32(_mm_loadu_si128((const __m128i *)(jjnr+jidx)),_mm_setzero_si128())));
-                                            
-            jnrA       = (jnrlistA>=0) ? jnrlistA : 0;
-            jnrB       = (jnrlistB>=0) ? jnrlistB : 0;
-            jnrC       = (jnrlistC>=0) ? jnrlistC : 0;
-            jnrD       = (jnrlistD>=0) ? jnrlistD : 0;
-            jnrE       = (jnrlistE>=0) ? jnrlistE : 0;
-            jnrF       = (jnrlistF>=0) ? jnrlistF : 0;
-            jnrG       = (jnrlistG>=0) ? jnrlistG : 0;
-            jnrH       = (jnrlistH>=0) ? jnrlistH : 0;
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-            j_coord_offsetE  = DIM*jnrE;
-            j_coord_offsetF  = DIM*jnrF;
-            j_coord_offsetG  = DIM*jnrG;
-            j_coord_offsetH  = DIM*jnrH;
-
-            /* load j atom coordinates */
-            gmx_mm256_load_1rvec_8ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
-                                                 x+j_coord_offsetC,x+j_coord_offsetD,
-                                                 x+j_coord_offsetE,x+j_coord_offsetF,
-                                                 x+j_coord_offsetG,x+j_coord_offsetH,
-                                                 &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm256_sub_ps(ix0,jx0);
-            dy00             = _mm256_sub_ps(iy0,jy0);
-            dz00             = _mm256_sub_ps(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm256_calc_rsq_ps(dx00,dy00,dz00);
-
-            rinv00           = avx256_invsqrt_f(rsq00);
-
-            rinvsq00         = _mm256_mul_ps(rinv00,rinv00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm256_load_8real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
-                                                                 charge+jnrC+0,charge+jnrD+0,
-                                                                 charge+jnrE+0,charge+jnrF+0,
-                                                                 charge+jnrG+0,charge+jnrH+0);
-            isaj0            = gmx_mm256_load_8real_swizzle_ps(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                                 invsqrta+jnrC+0,invsqrta+jnrD+0,
-                                                                 invsqrta+jnrE+0,invsqrta+jnrF+0,
-                                                                 invsqrta+jnrG+0,invsqrta+jnrH+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-            vdwjidx0B        = 2*vdwtype[jnrB+0];
-            vdwjidx0C        = 2*vdwtype[jnrC+0];
-            vdwjidx0D        = 2*vdwtype[jnrD+0];
-            vdwjidx0E        = 2*vdwtype[jnrE+0];
-            vdwjidx0F        = 2*vdwtype[jnrF+0];
-            vdwjidx0G        = 2*vdwtype[jnrG+0];
-            vdwjidx0H        = 2*vdwtype[jnrH+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm256_mul_ps(rsq00,rinv00);
-            r00              = _mm256_andnot_ps(dummy_mask,r00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm256_mul_ps(iq0,jq0);
-            gmx_mm256_load_8pair_swizzle_ps(vdwioffsetptr0+vdwjidx0A,
-                                            vdwioffsetptr0+vdwjidx0B,
-                                            vdwioffsetptr0+vdwjidx0C,
-                                            vdwioffsetptr0+vdwjidx0D,
-                                            vdwioffsetptr0+vdwjidx0E,
-                                            vdwioffsetptr0+vdwjidx0F,
-                                            vdwioffsetptr0+vdwjidx0G,
-                                            vdwioffsetptr0+vdwjidx0H,
-                                            &c6_00,&c12_00);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm256_mul_ps(isai0,isaj0);
-            gbqqfactor       = _mm256_xor_ps(signbit,_mm256_mul_ps(qq00,_mm256_mul_ps(isaprod,gbinvepsdiff)));
-            gbscale          = _mm256_mul_ps(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm256_mul_ps(r00,gbscale);
-            gbitab           = _mm256_cvttps_epi32(rt);
-            gbeps            = _mm256_sub_ps(rt,_mm256_round_ps(rt, _MM_FROUND_FLOOR));
-            /*         AVX1 does not support 256-bit integer operations, so now we go to 128-bit mode... */
-            gbitab_lo        = _mm256_extractf128_si256(gbitab,0x0);
-            gbitab_hi        = _mm256_extractf128_si256(gbitab,0x1);
-            gbitab_lo        = _mm_slli_epi32(gbitab_lo,2);
-            gbitab_hi        = _mm_slli_epi32(gbitab_hi,2);
-            Y                = gmx_mm256_set_m128(_mm_load_ps(gbtab + _mm_extract_epi32(gbitab_hi,0)),
-                                                  _mm_load_ps(gbtab + _mm_extract_epi32(gbitab_lo,0)));
-            F                = gmx_mm256_set_m128(_mm_load_ps(gbtab + _mm_extract_epi32(gbitab_hi,1)),
-                                                  _mm_load_ps(gbtab + _mm_extract_epi32(gbitab_lo,1)));
-            G                = gmx_mm256_set_m128(_mm_load_ps(gbtab + _mm_extract_epi32(gbitab_hi,2)),
-                                                  _mm_load_ps(gbtab + _mm_extract_epi32(gbitab_lo,2)));
-            H                = gmx_mm256_set_m128(_mm_load_ps(gbtab + _mm_extract_epi32(gbitab_hi,3)),
-                                                  _mm_load_ps(gbtab + _mm_extract_epi32(gbitab_lo,3)));
-            GMX_MM256_HALFTRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm256_mul_ps(gbeps,H);
-            Fp               = _mm256_add_ps(F,_mm256_mul_ps(gbeps,_mm256_add_ps(G,Heps)));
-            VV               = _mm256_add_ps(Y,_mm256_mul_ps(gbeps,Fp));
-            vgb              = _mm256_mul_ps(gbqqfactor,VV);
-
-            FF               = _mm256_add_ps(Fp,_mm256_mul_ps(gbeps,_mm256_add_ps(G,_mm256_add_ps(Heps,Heps))));
-            fgb              = _mm256_mul_ps(gbqqfactor,_mm256_mul_ps(FF,gbscale));
-            dvdatmp          = _mm256_mul_ps(minushalf,_mm256_add_ps(vgb,_mm256_mul_ps(fgb,r00)));
-            dvdatmp          = _mm256_andnot_ps(dummy_mask,dvdatmp);
-            dvdasum          = _mm256_add_ps(dvdasum,dvdatmp);
-            /* The pointers to scratch make sure that this code with compilers that take gmx_restrict seriously (e.g. icc 13) really can't screw things up. */
-            fjptrA             = (jnrlistA>=0) ? dvda+jnrA : scratch;
-            fjptrB             = (jnrlistB>=0) ? dvda+jnrB : scratch;
-            fjptrC             = (jnrlistC>=0) ? dvda+jnrC : scratch;
-            fjptrD             = (jnrlistD>=0) ? dvda+jnrD : scratch;
-            fjptrE             = (jnrlistE>=0) ? dvda+jnrE : scratch;
-            fjptrF             = (jnrlistF>=0) ? dvda+jnrF : scratch;
-            fjptrG             = (jnrlistG>=0) ? dvda+jnrG : scratch;
-            fjptrH             = (jnrlistH>=0) ? dvda+jnrH : scratch;
-            gmx_mm256_increment_8real_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,fjptrE,fjptrF,fjptrG,fjptrH,
-                                                 _mm256_mul_ps(dvdatmp,_mm256_mul_ps(isaj0,isaj0)));
-            velec            = _mm256_mul_ps(qq00,rinv00);
-            felec            = _mm256_mul_ps(_mm256_sub_ps(_mm256_mul_ps(velec,rinv00),fgb),rinv00);
-
-            /* LENNARD-JONES DISPERSION/REPULSION */
-
-            rinvsix          = _mm256_mul_ps(_mm256_mul_ps(rinvsq00,rinvsq00),rinvsq00);
-            vvdw6            = _mm256_mul_ps(c6_00,rinvsix);
-            vvdw12           = _mm256_mul_ps(c12_00,_mm256_mul_ps(rinvsix,rinvsix));
-            vvdw             = _mm256_sub_ps( _mm256_mul_ps(vvdw12,one_twelfth) , _mm256_mul_ps(vvdw6,one_sixth) );
-            fvdw             = _mm256_mul_ps(_mm256_sub_ps(vvdw12,vvdw6),rinvsq00);
-
-            /* Update potential sum for this i atom from the interaction with this j atom. */
-            velec            = _mm256_andnot_ps(dummy_mask,velec);
-            velecsum         = _mm256_add_ps(velecsum,velec);
-            vgb              = _mm256_andnot_ps(dummy_mask,vgb);
-            vgbsum           = _mm256_add_ps(vgbsum,vgb);
-            vvdw             = _mm256_andnot_ps(dummy_mask,vvdw);
-            vvdwsum          = _mm256_add_ps(vvdwsum,vvdw);
-
-            fscal            = _mm256_add_ps(felec,fvdw);
-
-            fscal            = _mm256_andnot_ps(dummy_mask,fscal);
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm256_mul_ps(fscal,dx00);
-            ty               = _mm256_mul_ps(fscal,dy00);
-            tz               = _mm256_mul_ps(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm256_add_ps(fix0,tx);
-            fiy0             = _mm256_add_ps(fiy0,ty);
-            fiz0             = _mm256_add_ps(fiz0,tz);
-
-            fjptrA             = (jnrlistA>=0) ? f+j_coord_offsetA : scratch;
-            fjptrB             = (jnrlistB>=0) ? f+j_coord_offsetB : scratch;
-            fjptrC             = (jnrlistC>=0) ? f+j_coord_offsetC : scratch;
-            fjptrD             = (jnrlistD>=0) ? f+j_coord_offsetD : scratch;
-            fjptrE             = (jnrlistE>=0) ? f+j_coord_offsetE : scratch;
-            fjptrF             = (jnrlistF>=0) ? f+j_coord_offsetF : scratch;
-            fjptrG             = (jnrlistG>=0) ? f+j_coord_offsetG : scratch;
-            fjptrH             = (jnrlistH>=0) ? f+j_coord_offsetH : scratch;
-            gmx_mm256_decrement_1rvec_8ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,fjptrE,fjptrF,fjptrG,fjptrH,tx,ty,tz);
-
-            /* Inner loop uses 71 flops */
-        }
-
-        /* End of innermost loop */
-
-        gmx_mm256_update_iforce_1atom_swizzle_ps(fix0,fiy0,fiz0,
-                                                 f+i_coord_offset,fshift+i_shift_offset);
-
-        ggid                        = gid[iidx];
-        /* Update potential energies */
-        gmx_mm256_update_1pot_ps(velecsum,kernel_data->energygrp_elec+ggid);
-        gmx_mm256_update_1pot_ps(vgbsum,kernel_data->energygrp_polarization+ggid);
-        gmx_mm256_update_1pot_ps(vvdwsum,kernel_data->energygrp_vdw+ggid);
-        dvdasum = _mm256_mul_ps(dvdasum, _mm256_mul_ps(isai0,isai0));
-        gmx_mm256_update_1pot_ps(dvdasum,dvda+inr);
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 10 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_VF,outeriter*10 + inneriter*71);
-}
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_avx_256_single
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            LennardJones
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        Force
- */
-void
-nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_avx_256_single
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or 
-     * just 0 for non-waters.
-     * Suffixes A,B,C,D,E,F,G,H refer to j loop unrolling done with AVX, e.g. for the eight different
-     * jnr indices corresponding to data put in the four positions in the SIMD register.
-     */
-    int              i_shift_offset,i_coord_offset,outeriter,inneriter;
-    int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
-    int              jnrA,jnrB,jnrC,jnrD;
-    int              jnrE,jnrF,jnrG,jnrH;
-    int              jnrlistA,jnrlistB,jnrlistC,jnrlistD;
-    int              jnrlistE,jnrlistF,jnrlistG,jnrlistH;
-    int              j_coord_offsetA,j_coord_offsetB,j_coord_offsetC,j_coord_offsetD;
-    int              j_coord_offsetE,j_coord_offsetF,j_coord_offsetG,j_coord_offsetH;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             rcutoff_scalar;
-    real             *shiftvec,*fshift,*x,*f;
-    real             *fjptrA,*fjptrB,*fjptrC,*fjptrD,*fjptrE,*fjptrF,*fjptrG,*fjptrH;
-    real             scratch[4*DIM];
-    __m256           tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
-    real *           vdwioffsetptr0;
-    __m256           ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0A,vdwjidx0B,vdwjidx0C,vdwjidx0D,vdwjidx0E,vdwjidx0F,vdwjidx0G,vdwjidx0H;
-    __m256           jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    __m256           dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
-    __m256           velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    __m256i          gbitab;
-    __m128i          gbitab_lo,gbitab_hi;
-    __m256           vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,gbeps,dvdatmp;
-    __m256           minushalf = _mm256_set1_ps(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    int              nvdwtype;
-    __m256           rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
-    int              *vdwtype;
-    real             *vdwparam;
-    __m256           one_sixth   = _mm256_set1_ps(1.0/6.0);
-    __m256           one_twelfth = _mm256_set1_ps(1.0/12.0);
-    __m256i          vfitab;
-    __m128i          vfitab_lo,vfitab_hi;
-    __m128i          ifour       = _mm_set1_epi32(4);
-    __m256           rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF;
-    real             *vftab;
-    __m256           dummy_mask,cutoff_mask;
-    __m256           signbit = _mm256_castsi256_ps( _mm256_set1_epi32(0x80000000) );
-    __m256           one     = _mm256_set1_ps(1.0);
-    __m256           two     = _mm256_set1_ps(2.0);
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = _mm256_set1_ps(fr->ic->epsfac);
-    charge           = mdatoms->chargeA;
-    nvdwtype         = fr->ntype;
-    vdwparam         = fr->nbfp;
-    vdwtype          = mdatoms->typeA;
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = _mm256_set1_ps(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = _mm256_set1_ps((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-
-    /* Avoid stupid compiler warnings */
-    jnrA = jnrB = jnrC = jnrD = jnrE = jnrF = jnrG = jnrH = 0;
-    j_coord_offsetA = 0;
-    j_coord_offsetB = 0;
-    j_coord_offsetC = 0;
-    j_coord_offsetD = 0;
-    j_coord_offsetE = 0;
-    j_coord_offsetF = 0;
-    j_coord_offsetG = 0;
-    j_coord_offsetH = 0;
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    for(iidx=0;iidx<4*DIM;iidx++)
-    {
-        scratch[iidx] = 0.0;
-    }
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        gmx_mm256_load_shift_and_1rvec_broadcast_ps(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
-
-        fix0             = _mm256_setzero_ps();
-        fiy0             = _mm256_setzero_ps();
-        fiz0             = _mm256_setzero_ps();
-
-        /* Load parameters for i particles */
-        iq0              = _mm256_mul_ps(facel,_mm256_set1_ps(charge[inr+0]));
-        isai0            = _mm256_set1_ps(invsqrta[inr+0]);
-        vdwioffsetptr0   = vdwparam+2*nvdwtype*vdwtype[inr+0];
-
-        dvdasum          = _mm256_setzero_ps();
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end && jjnr[jidx+7]>=0; jidx+=8)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrA             = jjnr[jidx];
-            jnrB             = jjnr[jidx+1];
-            jnrC             = jjnr[jidx+2];
-            jnrD             = jjnr[jidx+3];
-            jnrE             = jjnr[jidx+4];
-            jnrF             = jjnr[jidx+5];
-            jnrG             = jjnr[jidx+6];
-            jnrH             = jjnr[jidx+7];
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-            j_coord_offsetE  = DIM*jnrE;
-            j_coord_offsetF  = DIM*jnrF;
-            j_coord_offsetG  = DIM*jnrG;
-            j_coord_offsetH  = DIM*jnrH;
-
-            /* load j atom coordinates */
-            gmx_mm256_load_1rvec_8ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
-                                                 x+j_coord_offsetC,x+j_coord_offsetD,
-                                                 x+j_coord_offsetE,x+j_coord_offsetF,
-                                                 x+j_coord_offsetG,x+j_coord_offsetH,
-                                                 &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm256_sub_ps(ix0,jx0);
-            dy00             = _mm256_sub_ps(iy0,jy0);
-            dz00             = _mm256_sub_ps(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm256_calc_rsq_ps(dx00,dy00,dz00);
-
-            rinv00           = avx256_invsqrt_f(rsq00);
-
-            rinvsq00         = _mm256_mul_ps(rinv00,rinv00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm256_load_8real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
-                                                                 charge+jnrC+0,charge+jnrD+0,
-                                                                 charge+jnrE+0,charge+jnrF+0,
-                                                                 charge+jnrG+0,charge+jnrH+0);
-            isaj0            = gmx_mm256_load_8real_swizzle_ps(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                                 invsqrta+jnrC+0,invsqrta+jnrD+0,
-                                                                 invsqrta+jnrE+0,invsqrta+jnrF+0,
-                                                                 invsqrta+jnrG+0,invsqrta+jnrH+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-            vdwjidx0B        = 2*vdwtype[jnrB+0];
-            vdwjidx0C        = 2*vdwtype[jnrC+0];
-            vdwjidx0D        = 2*vdwtype[jnrD+0];
-            vdwjidx0E        = 2*vdwtype[jnrE+0];
-            vdwjidx0F        = 2*vdwtype[jnrF+0];
-            vdwjidx0G        = 2*vdwtype[jnrG+0];
-            vdwjidx0H        = 2*vdwtype[jnrH+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm256_mul_ps(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm256_mul_ps(iq0,jq0);
-            gmx_mm256_load_8pair_swizzle_ps(vdwioffsetptr0+vdwjidx0A,
-                                            vdwioffsetptr0+vdwjidx0B,
-                                            vdwioffsetptr0+vdwjidx0C,
-                                            vdwioffsetptr0+vdwjidx0D,
-                                            vdwioffsetptr0+vdwjidx0E,
-                                            vdwioffsetptr0+vdwjidx0F,
-                                            vdwioffsetptr0+vdwjidx0G,
-                                            vdwioffsetptr0+vdwjidx0H,
-                                            &c6_00,&c12_00);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm256_mul_ps(isai0,isaj0);
-            gbqqfactor       = _mm256_xor_ps(signbit,_mm256_mul_ps(qq00,_mm256_mul_ps(isaprod,gbinvepsdiff)));
-            gbscale          = _mm256_mul_ps(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm256_mul_ps(r00,gbscale);
-            gbitab           = _mm256_cvttps_epi32(rt);
-            gbeps            = _mm256_sub_ps(rt,_mm256_round_ps(rt, _MM_FROUND_FLOOR));
-            /*         AVX1 does not support 256-bit integer operations, so now we go to 128-bit mode... */
-            gbitab_lo        = _mm256_extractf128_si256(gbitab,0x0);
-            gbitab_hi        = _mm256_extractf128_si256(gbitab,0x1);
-            gbitab_lo        = _mm_slli_epi32(gbitab_lo,2);
-            gbitab_hi        = _mm_slli_epi32(gbitab_hi,2);
-            Y                = gmx_mm256_set_m128(_mm_load_ps(gbtab + _mm_extract_epi32(gbitab_hi,0)),
-                                                  _mm_load_ps(gbtab + _mm_extract_epi32(gbitab_lo,0)));
-            F                = gmx_mm256_set_m128(_mm_load_ps(gbtab + _mm_extract_epi32(gbitab_hi,1)),
-                                                  _mm_load_ps(gbtab + _mm_extract_epi32(gbitab_lo,1)));
-            G                = gmx_mm256_set_m128(_mm_load_ps(gbtab + _mm_extract_epi32(gbitab_hi,2)),
-                                                  _mm_load_ps(gbtab + _mm_extract_epi32(gbitab_lo,2)));
-            H                = gmx_mm256_set_m128(_mm_load_ps(gbtab + _mm_extract_epi32(gbitab_hi,3)),
-                                                  _mm_load_ps(gbtab + _mm_extract_epi32(gbitab_lo,3)));
-            GMX_MM256_HALFTRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm256_mul_ps(gbeps,H);
-            Fp               = _mm256_add_ps(F,_mm256_mul_ps(gbeps,_mm256_add_ps(G,Heps)));
-            VV               = _mm256_add_ps(Y,_mm256_mul_ps(gbeps,Fp));
-            vgb              = _mm256_mul_ps(gbqqfactor,VV);
-
-            FF               = _mm256_add_ps(Fp,_mm256_mul_ps(gbeps,_mm256_add_ps(G,_mm256_add_ps(Heps,Heps))));
-            fgb              = _mm256_mul_ps(gbqqfactor,_mm256_mul_ps(FF,gbscale));
-            dvdatmp          = _mm256_mul_ps(minushalf,_mm256_add_ps(vgb,_mm256_mul_ps(fgb,r00)));
-            dvdasum          = _mm256_add_ps(dvdasum,dvdatmp);
-            fjptrA           = dvda+jnrA;
-            fjptrB           = dvda+jnrB;
-            fjptrC           = dvda+jnrC;
-            fjptrD           = dvda+jnrD;
-            fjptrE           = dvda+jnrE;
-            fjptrF           = dvda+jnrF;
-            fjptrG           = dvda+jnrG;
-            fjptrH           = dvda+jnrH;
-            gmx_mm256_increment_8real_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,fjptrE,fjptrF,fjptrG,fjptrH,
-                                                 _mm256_mul_ps(dvdatmp,_mm256_mul_ps(isaj0,isaj0)));
-            velec            = _mm256_mul_ps(qq00,rinv00);
-            felec            = _mm256_mul_ps(_mm256_sub_ps(_mm256_mul_ps(velec,rinv00),fgb),rinv00);
-
-            /* LENNARD-JONES DISPERSION/REPULSION */
-
-            rinvsix          = _mm256_mul_ps(_mm256_mul_ps(rinvsq00,rinvsq00),rinvsq00);
-            fvdw             = _mm256_mul_ps(_mm256_sub_ps(_mm256_mul_ps(c12_00,rinvsix),c6_00),_mm256_mul_ps(rinvsix,rinvsq00));
-
-            fscal            = _mm256_add_ps(felec,fvdw);
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm256_mul_ps(fscal,dx00);
-            ty               = _mm256_mul_ps(fscal,dy00);
-            tz               = _mm256_mul_ps(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm256_add_ps(fix0,tx);
-            fiy0             = _mm256_add_ps(fiy0,ty);
-            fiz0             = _mm256_add_ps(fiz0,tz);
-
-            fjptrA             = f+j_coord_offsetA;
-            fjptrB             = f+j_coord_offsetB;
-            fjptrC             = f+j_coord_offsetC;
-            fjptrD             = f+j_coord_offsetD;
-            fjptrE             = f+j_coord_offsetE;
-            fjptrF             = f+j_coord_offsetF;
-            fjptrG             = f+j_coord_offsetG;
-            fjptrH             = f+j_coord_offsetH;
-            gmx_mm256_decrement_1rvec_8ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,fjptrE,fjptrF,fjptrG,fjptrH,tx,ty,tz);
-
-            /* Inner loop uses 63 flops */
-        }
-
-        if(jidx<j_index_end)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrlistA         = jjnr[jidx];
-            jnrlistB         = jjnr[jidx+1];
-            jnrlistC         = jjnr[jidx+2];
-            jnrlistD         = jjnr[jidx+3];
-            jnrlistE         = jjnr[jidx+4];
-            jnrlistF         = jjnr[jidx+5];
-            jnrlistG         = jjnr[jidx+6];
-            jnrlistH         = jjnr[jidx+7];
-            /* Sign of each element will be negative for non-real atoms.
-             * This mask will be 0xFFFFFFFF for dummy entries and 0x0 for real ones,
-             * so use it as val = _mm_andnot_ps(mask,val) to clear dummy entries.
-             */
-            dummy_mask = gmx_mm256_set_m128(gmx_mm_castsi128_ps(_mm_cmplt_epi32(_mm_loadu_si128((const __m128i *)(jjnr+jidx+4)),_mm_setzero_si128())),
-                                            gmx_mm_castsi128_ps(_mm_cmplt_epi32(_mm_loadu_si128((const __m128i *)(jjnr+jidx)),_mm_setzero_si128())));
-                                            
-            jnrA       = (jnrlistA>=0) ? jnrlistA : 0;
-            jnrB       = (jnrlistB>=0) ? jnrlistB : 0;
-            jnrC       = (jnrlistC>=0) ? jnrlistC : 0;
-            jnrD       = (jnrlistD>=0) ? jnrlistD : 0;
-            jnrE       = (jnrlistE>=0) ? jnrlistE : 0;
-            jnrF       = (jnrlistF>=0) ? jnrlistF : 0;
-            jnrG       = (jnrlistG>=0) ? jnrlistG : 0;
-            jnrH       = (jnrlistH>=0) ? jnrlistH : 0;
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-            j_coord_offsetE  = DIM*jnrE;
-            j_coord_offsetF  = DIM*jnrF;
-            j_coord_offsetG  = DIM*jnrG;
-            j_coord_offsetH  = DIM*jnrH;
-
-            /* load j atom coordinates */
-            gmx_mm256_load_1rvec_8ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
-                                                 x+j_coord_offsetC,x+j_coord_offsetD,
-                                                 x+j_coord_offsetE,x+j_coord_offsetF,
-                                                 x+j_coord_offsetG,x+j_coord_offsetH,
-                                                 &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm256_sub_ps(ix0,jx0);
-            dy00             = _mm256_sub_ps(iy0,jy0);
-            dz00             = _mm256_sub_ps(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm256_calc_rsq_ps(dx00,dy00,dz00);
-
-            rinv00           = avx256_invsqrt_f(rsq00);
-
-            rinvsq00         = _mm256_mul_ps(rinv00,rinv00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm256_load_8real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
-                                                                 charge+jnrC+0,charge+jnrD+0,
-                                                                 charge+jnrE+0,charge+jnrF+0,
-                                                                 charge+jnrG+0,charge+jnrH+0);
-            isaj0            = gmx_mm256_load_8real_swizzle_ps(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                                 invsqrta+jnrC+0,invsqrta+jnrD+0,
-                                                                 invsqrta+jnrE+0,invsqrta+jnrF+0,
-                                                                 invsqrta+jnrG+0,invsqrta+jnrH+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-            vdwjidx0B        = 2*vdwtype[jnrB+0];
-            vdwjidx0C        = 2*vdwtype[jnrC+0];
-            vdwjidx0D        = 2*vdwtype[jnrD+0];
-            vdwjidx0E        = 2*vdwtype[jnrE+0];
-            vdwjidx0F        = 2*vdwtype[jnrF+0];
-            vdwjidx0G        = 2*vdwtype[jnrG+0];
-            vdwjidx0H        = 2*vdwtype[jnrH+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm256_mul_ps(rsq00,rinv00);
-            r00              = _mm256_andnot_ps(dummy_mask,r00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm256_mul_ps(iq0,jq0);
-            gmx_mm256_load_8pair_swizzle_ps(vdwioffsetptr0+vdwjidx0A,
-                                            vdwioffsetptr0+vdwjidx0B,
-                                            vdwioffsetptr0+vdwjidx0C,
-                                            vdwioffsetptr0+vdwjidx0D,
-                                            vdwioffsetptr0+vdwjidx0E,
-                                            vdwioffsetptr0+vdwjidx0F,
-                                            vdwioffsetptr0+vdwjidx0G,
-                                            vdwioffsetptr0+vdwjidx0H,
-                                            &c6_00,&c12_00);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm256_mul_ps(isai0,isaj0);
-            gbqqfactor       = _mm256_xor_ps(signbit,_mm256_mul_ps(qq00,_mm256_mul_ps(isaprod,gbinvepsdiff)));
-            gbscale          = _mm256_mul_ps(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm256_mul_ps(r00,gbscale);
-            gbitab           = _mm256_cvttps_epi32(rt);
-            gbeps            = _mm256_sub_ps(rt,_mm256_round_ps(rt, _MM_FROUND_FLOOR));
-            /*         AVX1 does not support 256-bit integer operations, so now we go to 128-bit mode... */
-            gbitab_lo        = _mm256_extractf128_si256(gbitab,0x0);
-            gbitab_hi        = _mm256_extractf128_si256(gbitab,0x1);
-            gbitab_lo        = _mm_slli_epi32(gbitab_lo,2);
-            gbitab_hi        = _mm_slli_epi32(gbitab_hi,2);
-            Y                = gmx_mm256_set_m128(_mm_load_ps(gbtab + _mm_extract_epi32(gbitab_hi,0)),
-                                                  _mm_load_ps(gbtab + _mm_extract_epi32(gbitab_lo,0)));
-            F                = gmx_mm256_set_m128(_mm_load_ps(gbtab + _mm_extract_epi32(gbitab_hi,1)),
-                                                  _mm_load_ps(gbtab + _mm_extract_epi32(gbitab_lo,1)));
-            G                = gmx_mm256_set_m128(_mm_load_ps(gbtab + _mm_extract_epi32(gbitab_hi,2)),
-                                                  _mm_load_ps(gbtab + _mm_extract_epi32(gbitab_lo,2)));
-            H                = gmx_mm256_set_m128(_mm_load_ps(gbtab + _mm_extract_epi32(gbitab_hi,3)),
-                                                  _mm_load_ps(gbtab + _mm_extract_epi32(gbitab_lo,3)));
-            GMX_MM256_HALFTRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm256_mul_ps(gbeps,H);
-            Fp               = _mm256_add_ps(F,_mm256_mul_ps(gbeps,_mm256_add_ps(G,Heps)));
-            VV               = _mm256_add_ps(Y,_mm256_mul_ps(gbeps,Fp));
-            vgb              = _mm256_mul_ps(gbqqfactor,VV);
-
-            FF               = _mm256_add_ps(Fp,_mm256_mul_ps(gbeps,_mm256_add_ps(G,_mm256_add_ps(Heps,Heps))));
-            fgb              = _mm256_mul_ps(gbqqfactor,_mm256_mul_ps(FF,gbscale));
-            dvdatmp          = _mm256_mul_ps(minushalf,_mm256_add_ps(vgb,_mm256_mul_ps(fgb,r00)));
-            dvdatmp          = _mm256_andnot_ps(dummy_mask,dvdatmp);
-            dvdasum          = _mm256_add_ps(dvdasum,dvdatmp);
-            /* The pointers to scratch make sure that this code with compilers that take gmx_restrict seriously (e.g. icc 13) really can't screw things up. */
-            fjptrA             = (jnrlistA>=0) ? dvda+jnrA : scratch;
-            fjptrB             = (jnrlistB>=0) ? dvda+jnrB : scratch;
-            fjptrC             = (jnrlistC>=0) ? dvda+jnrC : scratch;
-            fjptrD             = (jnrlistD>=0) ? dvda+jnrD : scratch;
-            fjptrE             = (jnrlistE>=0) ? dvda+jnrE : scratch;
-            fjptrF             = (jnrlistF>=0) ? dvda+jnrF : scratch;
-            fjptrG             = (jnrlistG>=0) ? dvda+jnrG : scratch;
-            fjptrH             = (jnrlistH>=0) ? dvda+jnrH : scratch;
-            gmx_mm256_increment_8real_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,fjptrE,fjptrF,fjptrG,fjptrH,
-                                                 _mm256_mul_ps(dvdatmp,_mm256_mul_ps(isaj0,isaj0)));
-            velec            = _mm256_mul_ps(qq00,rinv00);
-            felec            = _mm256_mul_ps(_mm256_sub_ps(_mm256_mul_ps(velec,rinv00),fgb),rinv00);
-
-            /* LENNARD-JONES DISPERSION/REPULSION */
-
-            rinvsix          = _mm256_mul_ps(_mm256_mul_ps(rinvsq00,rinvsq00),rinvsq00);
-            fvdw             = _mm256_mul_ps(_mm256_sub_ps(_mm256_mul_ps(c12_00,rinvsix),c6_00),_mm256_mul_ps(rinvsix,rinvsq00));
-
-            fscal            = _mm256_add_ps(felec,fvdw);
-
-            fscal            = _mm256_andnot_ps(dummy_mask,fscal);
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm256_mul_ps(fscal,dx00);
-            ty               = _mm256_mul_ps(fscal,dy00);
-            tz               = _mm256_mul_ps(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm256_add_ps(fix0,tx);
-            fiy0             = _mm256_add_ps(fiy0,ty);
-            fiz0             = _mm256_add_ps(fiz0,tz);
-
-            fjptrA             = (jnrlistA>=0) ? f+j_coord_offsetA : scratch;
-            fjptrB             = (jnrlistB>=0) ? f+j_coord_offsetB : scratch;
-            fjptrC             = (jnrlistC>=0) ? f+j_coord_offsetC : scratch;
-            fjptrD             = (jnrlistD>=0) ? f+j_coord_offsetD : scratch;
-            fjptrE             = (jnrlistE>=0) ? f+j_coord_offsetE : scratch;
-            fjptrF             = (jnrlistF>=0) ? f+j_coord_offsetF : scratch;
-            fjptrG             = (jnrlistG>=0) ? f+j_coord_offsetG : scratch;
-            fjptrH             = (jnrlistH>=0) ? f+j_coord_offsetH : scratch;
-            gmx_mm256_decrement_1rvec_8ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,fjptrE,fjptrF,fjptrG,fjptrH,tx,ty,tz);
-
-            /* Inner loop uses 64 flops */
-        }
-
-        /* End of innermost loop */
-
-        gmx_mm256_update_iforce_1atom_swizzle_ps(fix0,fiy0,fiz0,
-                                                 f+i_coord_offset,fshift+i_shift_offset);
-
-        dvdasum = _mm256_mul_ps(dvdasum, _mm256_mul_ps(isai0,isai0));
-        gmx_mm256_update_1pot_ps(dvdasum,dvda+inr);
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 7 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_F,outeriter*7 + inneriter*64);
-}
diff --git a/src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecGB_VdwNone_GeomP1P1_avx_256_single.c b/src/gromacs/gmxlib/nonbonded/nb_kernel_avx_256_single/nb_kernel_ElecGB_VdwNone_GeomP1P1_avx_256_single.c
deleted file mode 100644 (file)
index 3c4db3b..0000000
+++ /dev/null
@@ -1,911 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
- * and including many others, as listed in the AUTHORS file in the
- * top-level source directory and at http://www.gromacs.org.
- *
- * GROMACS is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * GROMACS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GROMACS; if not, see
- * http://www.gnu.org/licenses, or write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
- *
- * If you want to redistribute modifications to GROMACS, please
- * consider that scientific software is very special. Version
- * control is crucial - bugs must be traceable. We will be happy to
- * consider code for inclusion in the official distribution, but
- * derived work must not be called official GROMACS. Details are found
- * in the README & COPYING files - if they are missing, get the
- * official version at http://www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the research papers on the package. Check out http://www.gromacs.org.
- */
-/*
- * Note: this file was generated by the GROMACS avx_256_single kernel generator.
- */
-#include "gmxpre.h"
-
-#include "config.h"
-
-#include <math.h>
-
-#include "../nb_kernel.h"
-#include "gromacs/gmxlib/nrnb.h"
-
-#include "kernelutil_x86_avx_256_single.h"
-
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_avx_256_single
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            None
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        PotentialAndForce
- */
-void
-nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_avx_256_single
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or 
-     * just 0 for non-waters.
-     * Suffixes A,B,C,D,E,F,G,H refer to j loop unrolling done with AVX, e.g. for the eight different
-     * jnr indices corresponding to data put in the four positions in the SIMD register.
-     */
-    int              i_shift_offset,i_coord_offset,outeriter,inneriter;
-    int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
-    int              jnrA,jnrB,jnrC,jnrD;
-    int              jnrE,jnrF,jnrG,jnrH;
-    int              jnrlistA,jnrlistB,jnrlistC,jnrlistD;
-    int              jnrlistE,jnrlistF,jnrlistG,jnrlistH;
-    int              j_coord_offsetA,j_coord_offsetB,j_coord_offsetC,j_coord_offsetD;
-    int              j_coord_offsetE,j_coord_offsetF,j_coord_offsetG,j_coord_offsetH;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             rcutoff_scalar;
-    real             *shiftvec,*fshift,*x,*f;
-    real             *fjptrA,*fjptrB,*fjptrC,*fjptrD,*fjptrE,*fjptrF,*fjptrG,*fjptrH;
-    real             scratch[4*DIM];
-    __m256           tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
-    real *           vdwioffsetptr0;
-    __m256           ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0A,vdwjidx0B,vdwjidx0C,vdwjidx0D,vdwjidx0E,vdwjidx0F,vdwjidx0G,vdwjidx0H;
-    __m256           jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    __m256           dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
-    __m256           velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    __m256i          gbitab;
-    __m128i          gbitab_lo,gbitab_hi;
-    __m256           vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,gbeps,dvdatmp;
-    __m256           minushalf = _mm256_set1_ps(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    __m256i          vfitab;
-    __m128i          vfitab_lo,vfitab_hi;
-    __m128i          ifour       = _mm_set1_epi32(4);
-    __m256           rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF;
-    real             *vftab;
-    __m256           dummy_mask,cutoff_mask;
-    __m256           signbit = _mm256_castsi256_ps( _mm256_set1_epi32(0x80000000) );
-    __m256           one     = _mm256_set1_ps(1.0);
-    __m256           two     = _mm256_set1_ps(2.0);
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = _mm256_set1_ps(fr->ic->epsfac);
-    charge           = mdatoms->chargeA;
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = _mm256_set1_ps(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = _mm256_set1_ps((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-
-    /* Avoid stupid compiler warnings */
-    jnrA = jnrB = jnrC = jnrD = jnrE = jnrF = jnrG = jnrH = 0;
-    j_coord_offsetA = 0;
-    j_coord_offsetB = 0;
-    j_coord_offsetC = 0;
-    j_coord_offsetD = 0;
-    j_coord_offsetE = 0;
-    j_coord_offsetF = 0;
-    j_coord_offsetG = 0;
-    j_coord_offsetH = 0;
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    for(iidx=0;iidx<4*DIM;iidx++)
-    {
-        scratch[iidx] = 0.0;
-    }
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        gmx_mm256_load_shift_and_1rvec_broadcast_ps(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
-
-        fix0             = _mm256_setzero_ps();
-        fiy0             = _mm256_setzero_ps();
-        fiz0             = _mm256_setzero_ps();
-
-        /* Load parameters for i particles */
-        iq0              = _mm256_mul_ps(facel,_mm256_set1_ps(charge[inr+0]));
-        isai0            = _mm256_set1_ps(invsqrta[inr+0]);
-
-        /* Reset potential sums */
-        velecsum         = _mm256_setzero_ps();
-        vgbsum           = _mm256_setzero_ps();
-        dvdasum          = _mm256_setzero_ps();
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end && jjnr[jidx+7]>=0; jidx+=8)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrA             = jjnr[jidx];
-            jnrB             = jjnr[jidx+1];
-            jnrC             = jjnr[jidx+2];
-            jnrD             = jjnr[jidx+3];
-            jnrE             = jjnr[jidx+4];
-            jnrF             = jjnr[jidx+5];
-            jnrG             = jjnr[jidx+6];
-            jnrH             = jjnr[jidx+7];
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-            j_coord_offsetE  = DIM*jnrE;
-            j_coord_offsetF  = DIM*jnrF;
-            j_coord_offsetG  = DIM*jnrG;
-            j_coord_offsetH  = DIM*jnrH;
-
-            /* load j atom coordinates */
-            gmx_mm256_load_1rvec_8ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
-                                                 x+j_coord_offsetC,x+j_coord_offsetD,
-                                                 x+j_coord_offsetE,x+j_coord_offsetF,
-                                                 x+j_coord_offsetG,x+j_coord_offsetH,
-                                                 &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm256_sub_ps(ix0,jx0);
-            dy00             = _mm256_sub_ps(iy0,jy0);
-            dz00             = _mm256_sub_ps(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm256_calc_rsq_ps(dx00,dy00,dz00);
-
-            rinv00           = avx256_invsqrt_f(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm256_load_8real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
-                                                                 charge+jnrC+0,charge+jnrD+0,
-                                                                 charge+jnrE+0,charge+jnrF+0,
-                                                                 charge+jnrG+0,charge+jnrH+0);
-            isaj0            = gmx_mm256_load_8real_swizzle_ps(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                                 invsqrta+jnrC+0,invsqrta+jnrD+0,
-                                                                 invsqrta+jnrE+0,invsqrta+jnrF+0,
-                                                                 invsqrta+jnrG+0,invsqrta+jnrH+0);
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm256_mul_ps(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm256_mul_ps(iq0,jq0);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm256_mul_ps(isai0,isaj0);
-            gbqqfactor       = _mm256_xor_ps(signbit,_mm256_mul_ps(qq00,_mm256_mul_ps(isaprod,gbinvepsdiff)));
-            gbscale          = _mm256_mul_ps(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm256_mul_ps(r00,gbscale);
-            gbitab           = _mm256_cvttps_epi32(rt);
-            gbeps            = _mm256_sub_ps(rt,_mm256_round_ps(rt, _MM_FROUND_FLOOR));
-            /*         AVX1 does not support 256-bit integer operations, so now we go to 128-bit mode... */
-            gbitab_lo        = _mm256_extractf128_si256(gbitab,0x0);
-            gbitab_hi        = _mm256_extractf128_si256(gbitab,0x1);
-            gbitab_lo        = _mm_slli_epi32(gbitab_lo,2);
-            gbitab_hi        = _mm_slli_epi32(gbitab_hi,2);
-            Y                = gmx_mm256_set_m128(_mm_load_ps(gbtab + _mm_extract_epi32(gbitab_hi,0)),
-                                                  _mm_load_ps(gbtab + _mm_extract_epi32(gbitab_lo,0)));
-            F                = gmx_mm256_set_m128(_mm_load_ps(gbtab + _mm_extract_epi32(gbitab_hi,1)),
-                                                  _mm_load_ps(gbtab + _mm_extract_epi32(gbitab_lo,1)));
-            G                = gmx_mm256_set_m128(_mm_load_ps(gbtab + _mm_extract_epi32(gbitab_hi,2)),
-                                                  _mm_load_ps(gbtab + _mm_extract_epi32(gbitab_lo,2)));
-            H                = gmx_mm256_set_m128(_mm_load_ps(gbtab + _mm_extract_epi32(gbitab_hi,3)),
-                                                  _mm_load_ps(gbtab + _mm_extract_epi32(gbitab_lo,3)));
-            GMX_MM256_HALFTRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm256_mul_ps(gbeps,H);
-            Fp               = _mm256_add_ps(F,_mm256_mul_ps(gbeps,_mm256_add_ps(G,Heps)));
-            VV               = _mm256_add_ps(Y,_mm256_mul_ps(gbeps,Fp));
-            vgb              = _mm256_mul_ps(gbqqfactor,VV);
-
-            FF               = _mm256_add_ps(Fp,_mm256_mul_ps(gbeps,_mm256_add_ps(G,_mm256_add_ps(Heps,Heps))));
-            fgb              = _mm256_mul_ps(gbqqfactor,_mm256_mul_ps(FF,gbscale));
-            dvdatmp          = _mm256_mul_ps(minushalf,_mm256_add_ps(vgb,_mm256_mul_ps(fgb,r00)));
-            dvdasum          = _mm256_add_ps(dvdasum,dvdatmp);
-            fjptrA           = dvda+jnrA;
-            fjptrB           = dvda+jnrB;
-            fjptrC           = dvda+jnrC;
-            fjptrD           = dvda+jnrD;
-            fjptrE           = dvda+jnrE;
-            fjptrF           = dvda+jnrF;
-            fjptrG           = dvda+jnrG;
-            fjptrH           = dvda+jnrH;
-            gmx_mm256_increment_8real_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,fjptrE,fjptrF,fjptrG,fjptrH,
-                                                 _mm256_mul_ps(dvdatmp,_mm256_mul_ps(isaj0,isaj0)));
-            velec            = _mm256_mul_ps(qq00,rinv00);
-            felec            = _mm256_mul_ps(_mm256_sub_ps(_mm256_mul_ps(velec,rinv00),fgb),rinv00);
-
-            /* Update potential sum for this i atom from the interaction with this j atom. */
-            velecsum         = _mm256_add_ps(velecsum,velec);
-            vgbsum           = _mm256_add_ps(vgbsum,vgb);
-
-            fscal            = felec;
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm256_mul_ps(fscal,dx00);
-            ty               = _mm256_mul_ps(fscal,dy00);
-            tz               = _mm256_mul_ps(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm256_add_ps(fix0,tx);
-            fiy0             = _mm256_add_ps(fiy0,ty);
-            fiz0             = _mm256_add_ps(fiz0,tz);
-
-            fjptrA             = f+j_coord_offsetA;
-            fjptrB             = f+j_coord_offsetB;
-            fjptrC             = f+j_coord_offsetC;
-            fjptrD             = f+j_coord_offsetD;
-            fjptrE             = f+j_coord_offsetE;
-            fjptrF             = f+j_coord_offsetF;
-            fjptrG             = f+j_coord_offsetG;
-            fjptrH             = f+j_coord_offsetH;
-            gmx_mm256_decrement_1rvec_8ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,fjptrE,fjptrF,fjptrG,fjptrH,tx,ty,tz);
-
-            /* Inner loop uses 57 flops */
-        }
-
-        if(jidx<j_index_end)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrlistA         = jjnr[jidx];
-            jnrlistB         = jjnr[jidx+1];
-            jnrlistC         = jjnr[jidx+2];
-            jnrlistD         = jjnr[jidx+3];
-            jnrlistE         = jjnr[jidx+4];
-            jnrlistF         = jjnr[jidx+5];
-            jnrlistG         = jjnr[jidx+6];
-            jnrlistH         = jjnr[jidx+7];
-            /* Sign of each element will be negative for non-real atoms.
-             * This mask will be 0xFFFFFFFF for dummy entries and 0x0 for real ones,
-             * so use it as val = _mm_andnot_ps(mask,val) to clear dummy entries.
-             */
-            dummy_mask = gmx_mm256_set_m128(gmx_mm_castsi128_ps(_mm_cmplt_epi32(_mm_loadu_si128((const __m128i *)(jjnr+jidx+4)),_mm_setzero_si128())),
-                                            gmx_mm_castsi128_ps(_mm_cmplt_epi32(_mm_loadu_si128((const __m128i *)(jjnr+jidx)),_mm_setzero_si128())));
-                                            
-            jnrA       = (jnrlistA>=0) ? jnrlistA : 0;
-            jnrB       = (jnrlistB>=0) ? jnrlistB : 0;
-            jnrC       = (jnrlistC>=0) ? jnrlistC : 0;
-            jnrD       = (jnrlistD>=0) ? jnrlistD : 0;
-            jnrE       = (jnrlistE>=0) ? jnrlistE : 0;
-            jnrF       = (jnrlistF>=0) ? jnrlistF : 0;
-            jnrG       = (jnrlistG>=0) ? jnrlistG : 0;
-            jnrH       = (jnrlistH>=0) ? jnrlistH : 0;
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-            j_coord_offsetE  = DIM*jnrE;
-            j_coord_offsetF  = DIM*jnrF;
-            j_coord_offsetG  = DIM*jnrG;
-            j_coord_offsetH  = DIM*jnrH;
-
-            /* load j atom coordinates */
-            gmx_mm256_load_1rvec_8ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
-                                                 x+j_coord_offsetC,x+j_coord_offsetD,
-                                                 x+j_coord_offsetE,x+j_coord_offsetF,
-                                                 x+j_coord_offsetG,x+j_coord_offsetH,
-                                                 &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm256_sub_ps(ix0,jx0);
-            dy00             = _mm256_sub_ps(iy0,jy0);
-            dz00             = _mm256_sub_ps(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm256_calc_rsq_ps(dx00,dy00,dz00);
-
-            rinv00           = avx256_invsqrt_f(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm256_load_8real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
-                                                                 charge+jnrC+0,charge+jnrD+0,
-                                                                 charge+jnrE+0,charge+jnrF+0,
-                                                                 charge+jnrG+0,charge+jnrH+0);
-            isaj0            = gmx_mm256_load_8real_swizzle_ps(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                                 invsqrta+jnrC+0,invsqrta+jnrD+0,
-                                                                 invsqrta+jnrE+0,invsqrta+jnrF+0,
-                                                                 invsqrta+jnrG+0,invsqrta+jnrH+0);
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm256_mul_ps(rsq00,rinv00);
-            r00              = _mm256_andnot_ps(dummy_mask,r00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm256_mul_ps(iq0,jq0);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm256_mul_ps(isai0,isaj0);
-            gbqqfactor       = _mm256_xor_ps(signbit,_mm256_mul_ps(qq00,_mm256_mul_ps(isaprod,gbinvepsdiff)));
-            gbscale          = _mm256_mul_ps(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm256_mul_ps(r00,gbscale);
-            gbitab           = _mm256_cvttps_epi32(rt);
-            gbeps            = _mm256_sub_ps(rt,_mm256_round_ps(rt, _MM_FROUND_FLOOR));
-            /*         AVX1 does not support 256-bit integer operations, so now we go to 128-bit mode... */
-            gbitab_lo        = _mm256_extractf128_si256(gbitab,0x0);
-            gbitab_hi        = _mm256_extractf128_si256(gbitab,0x1);
-            gbitab_lo        = _mm_slli_epi32(gbitab_lo,2);
-            gbitab_hi        = _mm_slli_epi32(gbitab_hi,2);
-            Y                = gmx_mm256_set_m128(_mm_load_ps(gbtab + _mm_extract_epi32(gbitab_hi,0)),
-                                                  _mm_load_ps(gbtab + _mm_extract_epi32(gbitab_lo,0)));
-            F                = gmx_mm256_set_m128(_mm_load_ps(gbtab + _mm_extract_epi32(gbitab_hi,1)),
-                                                  _mm_load_ps(gbtab + _mm_extract_epi32(gbitab_lo,1)));
-            G                = gmx_mm256_set_m128(_mm_load_ps(gbtab + _mm_extract_epi32(gbitab_hi,2)),
-                                                  _mm_load_ps(gbtab + _mm_extract_epi32(gbitab_lo,2)));
-            H                = gmx_mm256_set_m128(_mm_load_ps(gbtab + _mm_extract_epi32(gbitab_hi,3)),
-                                                  _mm_load_ps(gbtab + _mm_extract_epi32(gbitab_lo,3)));
-            GMX_MM256_HALFTRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm256_mul_ps(gbeps,H);
-            Fp               = _mm256_add_ps(F,_mm256_mul_ps(gbeps,_mm256_add_ps(G,Heps)));
-            VV               = _mm256_add_ps(Y,_mm256_mul_ps(gbeps,Fp));
-            vgb              = _mm256_mul_ps(gbqqfactor,VV);
-
-            FF               = _mm256_add_ps(Fp,_mm256_mul_ps(gbeps,_mm256_add_ps(G,_mm256_add_ps(Heps,Heps))));
-            fgb              = _mm256_mul_ps(gbqqfactor,_mm256_mul_ps(FF,gbscale));
-            dvdatmp          = _mm256_mul_ps(minushalf,_mm256_add_ps(vgb,_mm256_mul_ps(fgb,r00)));
-            dvdatmp          = _mm256_andnot_ps(dummy_mask,dvdatmp);
-            dvdasum          = _mm256_add_ps(dvdasum,dvdatmp);
-            /* The pointers to scratch make sure that this code with compilers that take gmx_restrict seriously (e.g. icc 13) really can't screw things up. */
-            fjptrA             = (jnrlistA>=0) ? dvda+jnrA : scratch;
-            fjptrB             = (jnrlistB>=0) ? dvda+jnrB : scratch;
-            fjptrC             = (jnrlistC>=0) ? dvda+jnrC : scratch;
-            fjptrD             = (jnrlistD>=0) ? dvda+jnrD : scratch;
-            fjptrE             = (jnrlistE>=0) ? dvda+jnrE : scratch;
-            fjptrF             = (jnrlistF>=0) ? dvda+jnrF : scratch;
-            fjptrG             = (jnrlistG>=0) ? dvda+jnrG : scratch;
-            fjptrH             = (jnrlistH>=0) ? dvda+jnrH : scratch;
-            gmx_mm256_increment_8real_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,fjptrE,fjptrF,fjptrG,fjptrH,
-                                                 _mm256_mul_ps(dvdatmp,_mm256_mul_ps(isaj0,isaj0)));
-            velec            = _mm256_mul_ps(qq00,rinv00);
-            felec            = _mm256_mul_ps(_mm256_sub_ps(_mm256_mul_ps(velec,rinv00),fgb),rinv00);
-
-            /* Update potential sum for this i atom from the interaction with this j atom. */
-            velec            = _mm256_andnot_ps(dummy_mask,velec);
-            velecsum         = _mm256_add_ps(velecsum,velec);
-            vgb              = _mm256_andnot_ps(dummy_mask,vgb);
-            vgbsum           = _mm256_add_ps(vgbsum,vgb);
-
-            fscal            = felec;
-
-            fscal            = _mm256_andnot_ps(dummy_mask,fscal);
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm256_mul_ps(fscal,dx00);
-            ty               = _mm256_mul_ps(fscal,dy00);
-            tz               = _mm256_mul_ps(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm256_add_ps(fix0,tx);
-            fiy0             = _mm256_add_ps(fiy0,ty);
-            fiz0             = _mm256_add_ps(fiz0,tz);
-
-            fjptrA             = (jnrlistA>=0) ? f+j_coord_offsetA : scratch;
-            fjptrB             = (jnrlistB>=0) ? f+j_coord_offsetB : scratch;
-            fjptrC             = (jnrlistC>=0) ? f+j_coord_offsetC : scratch;
-            fjptrD             = (jnrlistD>=0) ? f+j_coord_offsetD : scratch;
-            fjptrE             = (jnrlistE>=0) ? f+j_coord_offsetE : scratch;
-            fjptrF             = (jnrlistF>=0) ? f+j_coord_offsetF : scratch;
-            fjptrG             = (jnrlistG>=0) ? f+j_coord_offsetG : scratch;
-            fjptrH             = (jnrlistH>=0) ? f+j_coord_offsetH : scratch;
-            gmx_mm256_decrement_1rvec_8ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,fjptrE,fjptrF,fjptrG,fjptrH,tx,ty,tz);
-
-            /* Inner loop uses 58 flops */
-        }
-
-        /* End of innermost loop */
-
-        gmx_mm256_update_iforce_1atom_swizzle_ps(fix0,fiy0,fiz0,
-                                                 f+i_coord_offset,fshift+i_shift_offset);
-
-        ggid                        = gid[iidx];
-        /* Update potential energies */
-        gmx_mm256_update_1pot_ps(velecsum,kernel_data->energygrp_elec+ggid);
-        gmx_mm256_update_1pot_ps(vgbsum,kernel_data->energygrp_polarization+ggid);
-        dvdasum = _mm256_mul_ps(dvdasum, _mm256_mul_ps(isai0,isai0));
-        gmx_mm256_update_1pot_ps(dvdasum,dvda+inr);
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 9 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VF,outeriter*9 + inneriter*58);
-}
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwNone_GeomP1P1_F_avx_256_single
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            None
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        Force
- */
-void
-nb_kernel_ElecGB_VdwNone_GeomP1P1_F_avx_256_single
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or 
-     * just 0 for non-waters.
-     * Suffixes A,B,C,D,E,F,G,H refer to j loop unrolling done with AVX, e.g. for the eight different
-     * jnr indices corresponding to data put in the four positions in the SIMD register.
-     */
-    int              i_shift_offset,i_coord_offset,outeriter,inneriter;
-    int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
-    int              jnrA,jnrB,jnrC,jnrD;
-    int              jnrE,jnrF,jnrG,jnrH;
-    int              jnrlistA,jnrlistB,jnrlistC,jnrlistD;
-    int              jnrlistE,jnrlistF,jnrlistG,jnrlistH;
-    int              j_coord_offsetA,j_coord_offsetB,j_coord_offsetC,j_coord_offsetD;
-    int              j_coord_offsetE,j_coord_offsetF,j_coord_offsetG,j_coord_offsetH;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             rcutoff_scalar;
-    real             *shiftvec,*fshift,*x,*f;
-    real             *fjptrA,*fjptrB,*fjptrC,*fjptrD,*fjptrE,*fjptrF,*fjptrG,*fjptrH;
-    real             scratch[4*DIM];
-    __m256           tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
-    real *           vdwioffsetptr0;
-    __m256           ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0A,vdwjidx0B,vdwjidx0C,vdwjidx0D,vdwjidx0E,vdwjidx0F,vdwjidx0G,vdwjidx0H;
-    __m256           jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    __m256           dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
-    __m256           velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    __m256i          gbitab;
-    __m128i          gbitab_lo,gbitab_hi;
-    __m256           vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,gbeps,dvdatmp;
-    __m256           minushalf = _mm256_set1_ps(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    __m256i          vfitab;
-    __m128i          vfitab_lo,vfitab_hi;
-    __m128i          ifour       = _mm_set1_epi32(4);
-    __m256           rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF;
-    real             *vftab;
-    __m256           dummy_mask,cutoff_mask;
-    __m256           signbit = _mm256_castsi256_ps( _mm256_set1_epi32(0x80000000) );
-    __m256           one     = _mm256_set1_ps(1.0);
-    __m256           two     = _mm256_set1_ps(2.0);
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = _mm256_set1_ps(fr->ic->epsfac);
-    charge           = mdatoms->chargeA;
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = _mm256_set1_ps(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = _mm256_set1_ps((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-
-    /* Avoid stupid compiler warnings */
-    jnrA = jnrB = jnrC = jnrD = jnrE = jnrF = jnrG = jnrH = 0;
-    j_coord_offsetA = 0;
-    j_coord_offsetB = 0;
-    j_coord_offsetC = 0;
-    j_coord_offsetD = 0;
-    j_coord_offsetE = 0;
-    j_coord_offsetF = 0;
-    j_coord_offsetG = 0;
-    j_coord_offsetH = 0;
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    for(iidx=0;iidx<4*DIM;iidx++)
-    {
-        scratch[iidx] = 0.0;
-    }
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        gmx_mm256_load_shift_and_1rvec_broadcast_ps(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
-
-        fix0             = _mm256_setzero_ps();
-        fiy0             = _mm256_setzero_ps();
-        fiz0             = _mm256_setzero_ps();
-
-        /* Load parameters for i particles */
-        iq0              = _mm256_mul_ps(facel,_mm256_set1_ps(charge[inr+0]));
-        isai0            = _mm256_set1_ps(invsqrta[inr+0]);
-
-        dvdasum          = _mm256_setzero_ps();
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end && jjnr[jidx+7]>=0; jidx+=8)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrA             = jjnr[jidx];
-            jnrB             = jjnr[jidx+1];
-            jnrC             = jjnr[jidx+2];
-            jnrD             = jjnr[jidx+3];
-            jnrE             = jjnr[jidx+4];
-            jnrF             = jjnr[jidx+5];
-            jnrG             = jjnr[jidx+6];
-            jnrH             = jjnr[jidx+7];
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-            j_coord_offsetE  = DIM*jnrE;
-            j_coord_offsetF  = DIM*jnrF;
-            j_coord_offsetG  = DIM*jnrG;
-            j_coord_offsetH  = DIM*jnrH;
-
-            /* load j atom coordinates */
-            gmx_mm256_load_1rvec_8ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
-                                                 x+j_coord_offsetC,x+j_coord_offsetD,
-                                                 x+j_coord_offsetE,x+j_coord_offsetF,
-                                                 x+j_coord_offsetG,x+j_coord_offsetH,
-                                                 &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm256_sub_ps(ix0,jx0);
-            dy00             = _mm256_sub_ps(iy0,jy0);
-            dz00             = _mm256_sub_ps(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm256_calc_rsq_ps(dx00,dy00,dz00);
-
-            rinv00           = avx256_invsqrt_f(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm256_load_8real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
-                                                                 charge+jnrC+0,charge+jnrD+0,
-                                                                 charge+jnrE+0,charge+jnrF+0,
-                                                                 charge+jnrG+0,charge+jnrH+0);
-            isaj0            = gmx_mm256_load_8real_swizzle_ps(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                                 invsqrta+jnrC+0,invsqrta+jnrD+0,
-                                                                 invsqrta+jnrE+0,invsqrta+jnrF+0,
-                                                                 invsqrta+jnrG+0,invsqrta+jnrH+0);
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm256_mul_ps(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm256_mul_ps(iq0,jq0);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm256_mul_ps(isai0,isaj0);
-            gbqqfactor       = _mm256_xor_ps(signbit,_mm256_mul_ps(qq00,_mm256_mul_ps(isaprod,gbinvepsdiff)));
-            gbscale          = _mm256_mul_ps(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm256_mul_ps(r00,gbscale);
-            gbitab           = _mm256_cvttps_epi32(rt);
-            gbeps            = _mm256_sub_ps(rt,_mm256_round_ps(rt, _MM_FROUND_FLOOR));
-            /*         AVX1 does not support 256-bit integer operations, so now we go to 128-bit mode... */
-            gbitab_lo        = _mm256_extractf128_si256(gbitab,0x0);
-            gbitab_hi        = _mm256_extractf128_si256(gbitab,0x1);
-            gbitab_lo        = _mm_slli_epi32(gbitab_lo,2);
-            gbitab_hi        = _mm_slli_epi32(gbitab_hi,2);
-            Y                = gmx_mm256_set_m128(_mm_load_ps(gbtab + _mm_extract_epi32(gbitab_hi,0)),
-                                                  _mm_load_ps(gbtab + _mm_extract_epi32(gbitab_lo,0)));
-            F                = gmx_mm256_set_m128(_mm_load_ps(gbtab + _mm_extract_epi32(gbitab_hi,1)),
-                                                  _mm_load_ps(gbtab + _mm_extract_epi32(gbitab_lo,1)));
-            G                = gmx_mm256_set_m128(_mm_load_ps(gbtab + _mm_extract_epi32(gbitab_hi,2)),
-                                                  _mm_load_ps(gbtab + _mm_extract_epi32(gbitab_lo,2)));
-            H                = gmx_mm256_set_m128(_mm_load_ps(gbtab + _mm_extract_epi32(gbitab_hi,3)),
-                                                  _mm_load_ps(gbtab + _mm_extract_epi32(gbitab_lo,3)));
-            GMX_MM256_HALFTRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm256_mul_ps(gbeps,H);
-            Fp               = _mm256_add_ps(F,_mm256_mul_ps(gbeps,_mm256_add_ps(G,Heps)));
-            VV               = _mm256_add_ps(Y,_mm256_mul_ps(gbeps,Fp));
-            vgb              = _mm256_mul_ps(gbqqfactor,VV);
-
-            FF               = _mm256_add_ps(Fp,_mm256_mul_ps(gbeps,_mm256_add_ps(G,_mm256_add_ps(Heps,Heps))));
-            fgb              = _mm256_mul_ps(gbqqfactor,_mm256_mul_ps(FF,gbscale));
-            dvdatmp          = _mm256_mul_ps(minushalf,_mm256_add_ps(vgb,_mm256_mul_ps(fgb,r00)));
-            dvdasum          = _mm256_add_ps(dvdasum,dvdatmp);
-            fjptrA           = dvda+jnrA;
-            fjptrB           = dvda+jnrB;
-            fjptrC           = dvda+jnrC;
-            fjptrD           = dvda+jnrD;
-            fjptrE           = dvda+jnrE;
-            fjptrF           = dvda+jnrF;
-            fjptrG           = dvda+jnrG;
-            fjptrH           = dvda+jnrH;
-            gmx_mm256_increment_8real_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,fjptrE,fjptrF,fjptrG,fjptrH,
-                                                 _mm256_mul_ps(dvdatmp,_mm256_mul_ps(isaj0,isaj0)));
-            velec            = _mm256_mul_ps(qq00,rinv00);
-            felec            = _mm256_mul_ps(_mm256_sub_ps(_mm256_mul_ps(velec,rinv00),fgb),rinv00);
-
-            fscal            = felec;
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm256_mul_ps(fscal,dx00);
-            ty               = _mm256_mul_ps(fscal,dy00);
-            tz               = _mm256_mul_ps(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm256_add_ps(fix0,tx);
-            fiy0             = _mm256_add_ps(fiy0,ty);
-            fiz0             = _mm256_add_ps(fiz0,tz);
-
-            fjptrA             = f+j_coord_offsetA;
-            fjptrB             = f+j_coord_offsetB;
-            fjptrC             = f+j_coord_offsetC;
-            fjptrD             = f+j_coord_offsetD;
-            fjptrE             = f+j_coord_offsetE;
-            fjptrF             = f+j_coord_offsetF;
-            fjptrG             = f+j_coord_offsetG;
-            fjptrH             = f+j_coord_offsetH;
-            gmx_mm256_decrement_1rvec_8ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,fjptrE,fjptrF,fjptrG,fjptrH,tx,ty,tz);
-
-            /* Inner loop uses 55 flops */
-        }
-
-        if(jidx<j_index_end)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrlistA         = jjnr[jidx];
-            jnrlistB         = jjnr[jidx+1];
-            jnrlistC         = jjnr[jidx+2];
-            jnrlistD         = jjnr[jidx+3];
-            jnrlistE         = jjnr[jidx+4];
-            jnrlistF         = jjnr[jidx+5];
-            jnrlistG         = jjnr[jidx+6];
-            jnrlistH         = jjnr[jidx+7];
-            /* Sign of each element will be negative for non-real atoms.
-             * This mask will be 0xFFFFFFFF for dummy entries and 0x0 for real ones,
-             * so use it as val = _mm_andnot_ps(mask,val) to clear dummy entries.
-             */
-            dummy_mask = gmx_mm256_set_m128(gmx_mm_castsi128_ps(_mm_cmplt_epi32(_mm_loadu_si128((const __m128i *)(jjnr+jidx+4)),_mm_setzero_si128())),
-                                            gmx_mm_castsi128_ps(_mm_cmplt_epi32(_mm_loadu_si128((const __m128i *)(jjnr+jidx)),_mm_setzero_si128())));
-                                            
-            jnrA       = (jnrlistA>=0) ? jnrlistA : 0;
-            jnrB       = (jnrlistB>=0) ? jnrlistB : 0;
-            jnrC       = (jnrlistC>=0) ? jnrlistC : 0;
-            jnrD       = (jnrlistD>=0) ? jnrlistD : 0;
-            jnrE       = (jnrlistE>=0) ? jnrlistE : 0;
-            jnrF       = (jnrlistF>=0) ? jnrlistF : 0;
-            jnrG       = (jnrlistG>=0) ? jnrlistG : 0;
-            jnrH       = (jnrlistH>=0) ? jnrlistH : 0;
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-            j_coord_offsetE  = DIM*jnrE;
-            j_coord_offsetF  = DIM*jnrF;
-            j_coord_offsetG  = DIM*jnrG;
-            j_coord_offsetH  = DIM*jnrH;
-
-            /* load j atom coordinates */
-            gmx_mm256_load_1rvec_8ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
-                                                 x+j_coord_offsetC,x+j_coord_offsetD,
-                                                 x+j_coord_offsetE,x+j_coord_offsetF,
-                                                 x+j_coord_offsetG,x+j_coord_offsetH,
-                                                 &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm256_sub_ps(ix0,jx0);
-            dy00             = _mm256_sub_ps(iy0,jy0);
-            dz00             = _mm256_sub_ps(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm256_calc_rsq_ps(dx00,dy00,dz00);
-
-            rinv00           = avx256_invsqrt_f(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm256_load_8real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
-                                                                 charge+jnrC+0,charge+jnrD+0,
-                                                                 charge+jnrE+0,charge+jnrF+0,
-                                                                 charge+jnrG+0,charge+jnrH+0);
-            isaj0            = gmx_mm256_load_8real_swizzle_ps(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                                 invsqrta+jnrC+0,invsqrta+jnrD+0,
-                                                                 invsqrta+jnrE+0,invsqrta+jnrF+0,
-                                                                 invsqrta+jnrG+0,invsqrta+jnrH+0);
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm256_mul_ps(rsq00,rinv00);
-            r00              = _mm256_andnot_ps(dummy_mask,r00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm256_mul_ps(iq0,jq0);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm256_mul_ps(isai0,isaj0);
-            gbqqfactor       = _mm256_xor_ps(signbit,_mm256_mul_ps(qq00,_mm256_mul_ps(isaprod,gbinvepsdiff)));
-            gbscale          = _mm256_mul_ps(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm256_mul_ps(r00,gbscale);
-            gbitab           = _mm256_cvttps_epi32(rt);
-            gbeps            = _mm256_sub_ps(rt,_mm256_round_ps(rt, _MM_FROUND_FLOOR));
-            /*         AVX1 does not support 256-bit integer operations, so now we go to 128-bit mode... */
-            gbitab_lo        = _mm256_extractf128_si256(gbitab,0x0);
-            gbitab_hi        = _mm256_extractf128_si256(gbitab,0x1);
-            gbitab_lo        = _mm_slli_epi32(gbitab_lo,2);
-            gbitab_hi        = _mm_slli_epi32(gbitab_hi,2);
-            Y                = gmx_mm256_set_m128(_mm_load_ps(gbtab + _mm_extract_epi32(gbitab_hi,0)),
-                                                  _mm_load_ps(gbtab + _mm_extract_epi32(gbitab_lo,0)));
-            F                = gmx_mm256_set_m128(_mm_load_ps(gbtab + _mm_extract_epi32(gbitab_hi,1)),
-                                                  _mm_load_ps(gbtab + _mm_extract_epi32(gbitab_lo,1)));
-            G                = gmx_mm256_set_m128(_mm_load_ps(gbtab + _mm_extract_epi32(gbitab_hi,2)),
-                                                  _mm_load_ps(gbtab + _mm_extract_epi32(gbitab_lo,2)));
-            H                = gmx_mm256_set_m128(_mm_load_ps(gbtab + _mm_extract_epi32(gbitab_hi,3)),
-                                                  _mm_load_ps(gbtab + _mm_extract_epi32(gbitab_lo,3)));
-            GMX_MM256_HALFTRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm256_mul_ps(gbeps,H);
-            Fp               = _mm256_add_ps(F,_mm256_mul_ps(gbeps,_mm256_add_ps(G,Heps)));
-            VV               = _mm256_add_ps(Y,_mm256_mul_ps(gbeps,Fp));
-            vgb              = _mm256_mul_ps(gbqqfactor,VV);
-
-            FF               = _mm256_add_ps(Fp,_mm256_mul_ps(gbeps,_mm256_add_ps(G,_mm256_add_ps(Heps,Heps))));
-            fgb              = _mm256_mul_ps(gbqqfactor,_mm256_mul_ps(FF,gbscale));
-            dvdatmp          = _mm256_mul_ps(minushalf,_mm256_add_ps(vgb,_mm256_mul_ps(fgb,r00)));
-            dvdatmp          = _mm256_andnot_ps(dummy_mask,dvdatmp);
-            dvdasum          = _mm256_add_ps(dvdasum,dvdatmp);
-            /* The pointers to scratch make sure that this code with compilers that take gmx_restrict seriously (e.g. icc 13) really can't screw things up. */
-            fjptrA             = (jnrlistA>=0) ? dvda+jnrA : scratch;
-            fjptrB             = (jnrlistB>=0) ? dvda+jnrB : scratch;
-            fjptrC             = (jnrlistC>=0) ? dvda+jnrC : scratch;
-            fjptrD             = (jnrlistD>=0) ? dvda+jnrD : scratch;
-            fjptrE             = (jnrlistE>=0) ? dvda+jnrE : scratch;
-            fjptrF             = (jnrlistF>=0) ? dvda+jnrF : scratch;
-            fjptrG             = (jnrlistG>=0) ? dvda+jnrG : scratch;
-            fjptrH             = (jnrlistH>=0) ? dvda+jnrH : scratch;
-            gmx_mm256_increment_8real_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,fjptrE,fjptrF,fjptrG,fjptrH,
-                                                 _mm256_mul_ps(dvdatmp,_mm256_mul_ps(isaj0,isaj0)));
-            velec            = _mm256_mul_ps(qq00,rinv00);
-            felec            = _mm256_mul_ps(_mm256_sub_ps(_mm256_mul_ps(velec,rinv00),fgb),rinv00);
-
-            fscal            = felec;
-
-            fscal            = _mm256_andnot_ps(dummy_mask,fscal);
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm256_mul_ps(fscal,dx00);
-            ty               = _mm256_mul_ps(fscal,dy00);
-            tz               = _mm256_mul_ps(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm256_add_ps(fix0,tx);
-            fiy0             = _mm256_add_ps(fiy0,ty);
-            fiz0             = _mm256_add_ps(fiz0,tz);
-
-            fjptrA             = (jnrlistA>=0) ? f+j_coord_offsetA : scratch;
-            fjptrB             = (jnrlistB>=0) ? f+j_coord_offsetB : scratch;
-            fjptrC             = (jnrlistC>=0) ? f+j_coord_offsetC : scratch;
-            fjptrD             = (jnrlistD>=0) ? f+j_coord_offsetD : scratch;
-            fjptrE             = (jnrlistE>=0) ? f+j_coord_offsetE : scratch;
-            fjptrF             = (jnrlistF>=0) ? f+j_coord_offsetF : scratch;
-            fjptrG             = (jnrlistG>=0) ? f+j_coord_offsetG : scratch;
-            fjptrH             = (jnrlistH>=0) ? f+j_coord_offsetH : scratch;
-            gmx_mm256_decrement_1rvec_8ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,fjptrE,fjptrF,fjptrG,fjptrH,tx,ty,tz);
-
-            /* Inner loop uses 56 flops */
-        }
-
-        /* End of innermost loop */
-
-        gmx_mm256_update_iforce_1atom_swizzle_ps(fix0,fiy0,fiz0,
-                                                 f+i_coord_offset,fshift+i_shift_offset);
-
-        dvdasum = _mm256_mul_ps(dvdasum, _mm256_mul_ps(isai0,isai0));
-        gmx_mm256_update_1pot_ps(dvdasum,dvda+inr);
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 7 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_F,outeriter*7 + inneriter*56);
-}
index b4debc8f40d957537eeb2e7982beefb63f81b269..5a70e185208e6bfcac4d07ff794b41629bf1cecd 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -51,6 +51,36 @@ nb_kernel_t nb_kernel_ElecNone_VdwLJSw_GeomP1P1_VF_avx_256_single;
 nb_kernel_t nb_kernel_ElecNone_VdwLJSw_GeomP1P1_F_avx_256_single;
 nb_kernel_t nb_kernel_ElecNone_VdwCSTab_GeomP1P1_VF_avx_256_single;
 nb_kernel_t nb_kernel_ElecNone_VdwCSTab_GeomP1P1_F_avx_256_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_avx_256_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_avx_256_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_avx_256_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_avx_256_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_avx_256_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_avx_256_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_avx_256_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_avx_256_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_avx_256_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_avx_256_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_avx_256_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_avx_256_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_avx_256_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_avx_256_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_avx_256_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_avx_256_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_avx_256_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_avx_256_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_avx_256_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_avx_256_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_avx_256_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_avx_256_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_avx_256_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_avx_256_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_avx_256_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_avx_256_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_avx_256_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_avx_256_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_avx_256_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_avx_256_single;
 nb_kernel_t nb_kernel_ElecEw_VdwLJEw_GeomP1P1_VF_avx_256_single;
 nb_kernel_t nb_kernel_ElecEw_VdwLJEw_GeomP1P1_F_avx_256_single;
 nb_kernel_t nb_kernel_ElecEw_VdwLJEw_GeomW3P1_VF_avx_256_single;
@@ -141,72 +171,6 @@ nb_kernel_t nb_kernel_ElecEwSw_VdwNone_GeomW4P1_VF_avx_256_single;
 nb_kernel_t nb_kernel_ElecEwSw_VdwNone_GeomW4P1_F_avx_256_single;
 nb_kernel_t nb_kernel_ElecEwSw_VdwNone_GeomW4W4_VF_avx_256_single;
 nb_kernel_t nb_kernel_ElecEwSw_VdwNone_GeomW4W4_F_avx_256_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_avx_256_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_avx_256_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_avx_256_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_avx_256_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_avx_256_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_avx_256_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_avx_256_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_avx_256_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_avx_256_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_avx_256_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_avx_256_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_avx_256_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_avx_256_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_avx_256_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_avx_256_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_avx_256_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_avx_256_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_avx_256_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_avx_256_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_avx_256_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_avx_256_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_avx_256_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_avx_256_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_avx_256_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_avx_256_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_avx_256_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_avx_256_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_avx_256_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_avx_256_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_avx_256_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_avx_256_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_avx_256_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_avx_256_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_avx_256_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_avx_256_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_avx_256_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_avx_256_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_avx_256_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_avx_256_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_avx_256_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_avx_256_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_avx_256_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_avx_256_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_avx_256_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_avx_256_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_avx_256_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_avx_256_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_avx_256_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_avx_256_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_avx_256_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_avx_256_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_avx_256_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_avx_256_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_avx_256_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_avx_256_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_avx_256_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_avx_256_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_avx_256_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_avx_256_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_avx_256_single;
-nb_kernel_t nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_avx_256_single;
-nb_kernel_t nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_avx_256_single;
-nb_kernel_t nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_avx_256_single;
-nb_kernel_t nb_kernel_ElecGB_VdwNone_GeomP1P1_F_avx_256_single;
-nb_kernel_t nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_avx_256_single;
-nb_kernel_t nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_avx_256_single;
 nb_kernel_t nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_VF_avx_256_single;
 nb_kernel_t nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_F_avx_256_single;
 nb_kernel_t nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_VF_avx_256_single;
@@ -277,6 +241,36 @@ nb_kernel_t nb_kernel_ElecRF_VdwCSTab_GeomW4P1_VF_avx_256_single;
 nb_kernel_t nb_kernel_ElecRF_VdwCSTab_GeomW4P1_F_avx_256_single;
 nb_kernel_t nb_kernel_ElecRF_VdwCSTab_GeomW4W4_VF_avx_256_single;
 nb_kernel_t nb_kernel_ElecRF_VdwCSTab_GeomW4W4_F_avx_256_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_avx_256_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_avx_256_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_avx_256_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_avx_256_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_avx_256_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_avx_256_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_avx_256_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_avx_256_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_avx_256_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_avx_256_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_avx_256_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_avx_256_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_avx_256_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_avx_256_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_avx_256_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_avx_256_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_avx_256_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_avx_256_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_avx_256_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_avx_256_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_avx_256_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_avx_256_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_avx_256_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_avx_256_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_avx_256_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_avx_256_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_avx_256_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_avx_256_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_avx_256_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_avx_256_single;
 
 
 nb_kernel_info_t
@@ -294,6 +288,36 @@ nb_kernel_info_t
     { nb_kernel_ElecNone_VdwLJSw_GeomP1P1_F_avx_256_single, "nb_kernel_ElecNone_VdwLJSw_GeomP1P1_F_avx_256_single", "avx_256_single", "None", "None", "LennardJones", "PotentialSwitch", "ParticleParticle", "", "Force" },
     { nb_kernel_ElecNone_VdwCSTab_GeomP1P1_VF_avx_256_single, "nb_kernel_ElecNone_VdwCSTab_GeomP1P1_VF_avx_256_single", "avx_256_single", "None", "None", "CubicSplineTable", "None", "ParticleParticle", "", "PotentialAndForce" },
     { nb_kernel_ElecNone_VdwCSTab_GeomP1P1_F_avx_256_single, "nb_kernel_ElecNone_VdwCSTab_GeomP1P1_F_avx_256_single", "avx_256_single", "None", "None", "CubicSplineTable", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_avx_256_single, "nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "LennardJones", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_avx_256_single, "nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "LennardJones", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_avx_256_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "LennardJones", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_avx_256_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "LennardJones", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_avx_256_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "LennardJones", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_avx_256_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "LennardJones", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_avx_256_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "LennardJones", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_avx_256_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "LennardJones", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_avx_256_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "LennardJones", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_avx_256_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "LennardJones", "None", "Water4Water4", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_avx_256_single, "nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "None", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_avx_256_single, "nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "None", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_avx_256_single, "nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "None", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_avx_256_single, "nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "None", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_avx_256_single, "nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "None", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_avx_256_single, "nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "None", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_avx_256_single, "nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "None", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_avx_256_single, "nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "None", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_avx_256_single, "nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "None", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_avx_256_single, "nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "None", "None", "Water4Water4", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_avx_256_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_avx_256_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_avx_256_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_avx_256_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_avx_256_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_avx_256_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_avx_256_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_avx_256_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_avx_256_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_avx_256_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Water4", "", "Force" },
     { nb_kernel_ElecEw_VdwLJEw_GeomP1P1_VF_avx_256_single, "nb_kernel_ElecEw_VdwLJEw_GeomP1P1_VF_avx_256_single", "avx_256_single", "Ewald", "None", "LJEwald", "None", "ParticleParticle", "", "PotentialAndForce" },
     { nb_kernel_ElecEw_VdwLJEw_GeomP1P1_F_avx_256_single, "nb_kernel_ElecEw_VdwLJEw_GeomP1P1_F_avx_256_single", "avx_256_single", "Ewald", "None", "LJEwald", "None", "ParticleParticle", "", "Force" },
     { nb_kernel_ElecEw_VdwLJEw_GeomW3P1_VF_avx_256_single, "nb_kernel_ElecEw_VdwLJEw_GeomW3P1_VF_avx_256_single", "avx_256_single", "Ewald", "None", "LJEwald", "None", "Water3Particle", "", "PotentialAndForce" },
@@ -384,72 +408,6 @@ nb_kernel_info_t
     { nb_kernel_ElecEwSw_VdwNone_GeomW4P1_F_avx_256_single, "nb_kernel_ElecEwSw_VdwNone_GeomW4P1_F_avx_256_single", "avx_256_single", "Ewald", "PotentialSwitch", "None", "None", "Water4Particle", "", "Force" },
     { nb_kernel_ElecEwSw_VdwNone_GeomW4W4_VF_avx_256_single, "nb_kernel_ElecEwSw_VdwNone_GeomW4W4_VF_avx_256_single", "avx_256_single", "Ewald", "PotentialSwitch", "None", "None", "Water4Water4", "", "PotentialAndForce" },
     { nb_kernel_ElecEwSw_VdwNone_GeomW4W4_F_avx_256_single, "nb_kernel_ElecEwSw_VdwNone_GeomW4W4_F_avx_256_single", "avx_256_single", "Ewald", "PotentialSwitch", "None", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_avx_256_single, "nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_avx_256_single", "avx_256_single", "Coulomb", "None", "LennardJones", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_avx_256_single, "nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_avx_256_single", "avx_256_single", "Coulomb", "None", "LennardJones", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_avx_256_single, "nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_avx_256_single", "avx_256_single", "Coulomb", "None", "LennardJones", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_avx_256_single, "nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_avx_256_single", "avx_256_single", "Coulomb", "None", "LennardJones", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_avx_256_single, "nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_avx_256_single", "avx_256_single", "Coulomb", "None", "LennardJones", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_avx_256_single, "nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_avx_256_single", "avx_256_single", "Coulomb", "None", "LennardJones", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_avx_256_single, "nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_avx_256_single", "avx_256_single", "Coulomb", "None", "LennardJones", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_avx_256_single, "nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_avx_256_single", "avx_256_single", "Coulomb", "None", "LennardJones", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_avx_256_single, "nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_avx_256_single", "avx_256_single", "Coulomb", "None", "LennardJones", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_avx_256_single, "nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_avx_256_single", "avx_256_single", "Coulomb", "None", "LennardJones", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_avx_256_single, "nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_avx_256_single", "avx_256_single", "Coulomb", "None", "None", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_avx_256_single, "nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_avx_256_single", "avx_256_single", "Coulomb", "None", "None", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_avx_256_single, "nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_avx_256_single", "avx_256_single", "Coulomb", "None", "None", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_avx_256_single, "nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_avx_256_single", "avx_256_single", "Coulomb", "None", "None", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_avx_256_single, "nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_avx_256_single", "avx_256_single", "Coulomb", "None", "None", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_avx_256_single, "nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_avx_256_single", "avx_256_single", "Coulomb", "None", "None", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_avx_256_single, "nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_avx_256_single", "avx_256_single", "Coulomb", "None", "None", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_avx_256_single, "nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_avx_256_single", "avx_256_single", "Coulomb", "None", "None", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_avx_256_single, "nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_avx_256_single", "avx_256_single", "Coulomb", "None", "None", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_avx_256_single, "nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_avx_256_single", "avx_256_single", "Coulomb", "None", "None", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_avx_256_single, "nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_avx_256_single", "avx_256_single", "Coulomb", "None", "CubicSplineTable", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_avx_256_single, "nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_avx_256_single", "avx_256_single", "Coulomb", "None", "CubicSplineTable", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_avx_256_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_avx_256_single", "avx_256_single", "Coulomb", "None", "CubicSplineTable", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_avx_256_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_avx_256_single", "avx_256_single", "Coulomb", "None", "CubicSplineTable", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_avx_256_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_avx_256_single", "avx_256_single", "Coulomb", "None", "CubicSplineTable", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_avx_256_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_avx_256_single", "avx_256_single", "Coulomb", "None", "CubicSplineTable", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_avx_256_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_avx_256_single", "avx_256_single", "Coulomb", "None", "CubicSplineTable", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_avx_256_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_avx_256_single", "avx_256_single", "Coulomb", "None", "CubicSplineTable", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_avx_256_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_avx_256_single", "avx_256_single", "Coulomb", "None", "CubicSplineTable", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_avx_256_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_avx_256_single", "avx_256_single", "Coulomb", "None", "CubicSplineTable", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_avx_256_single, "nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "LennardJones", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_avx_256_single, "nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "LennardJones", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_avx_256_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "LennardJones", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_avx_256_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "LennardJones", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_avx_256_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "LennardJones", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_avx_256_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "LennardJones", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_avx_256_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "LennardJones", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_avx_256_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "LennardJones", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_avx_256_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "LennardJones", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_avx_256_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "LennardJones", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_avx_256_single, "nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "None", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_avx_256_single, "nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "None", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_avx_256_single, "nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "None", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_avx_256_single, "nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "None", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_avx_256_single, "nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "None", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_avx_256_single, "nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "None", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_avx_256_single, "nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "None", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_avx_256_single, "nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "None", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_avx_256_single, "nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "None", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_avx_256_single, "nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "None", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_avx_256_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_avx_256_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_avx_256_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_avx_256_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_avx_256_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_avx_256_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_avx_256_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_avx_256_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_avx_256_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_avx_256_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_avx_256_single", "avx_256_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_avx_256_single, "nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_avx_256_single", "avx_256_single", "GeneralizedBorn", "None", "LennardJones", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_avx_256_single, "nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_avx_256_single", "avx_256_single", "GeneralizedBorn", "None", "LennardJones", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_avx_256_single, "nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_avx_256_single", "avx_256_single", "GeneralizedBorn", "None", "None", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecGB_VdwNone_GeomP1P1_F_avx_256_single, "nb_kernel_ElecGB_VdwNone_GeomP1P1_F_avx_256_single", "avx_256_single", "GeneralizedBorn", "None", "None", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_avx_256_single, "nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_avx_256_single", "avx_256_single", "GeneralizedBorn", "None", "CubicSplineTable", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_avx_256_single, "nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_avx_256_single", "avx_256_single", "GeneralizedBorn", "None", "CubicSplineTable", "None", "ParticleParticle", "", "Force" },
     { nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_VF_avx_256_single, "nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_VF_avx_256_single", "avx_256_single", "ReactionField", "ExactCutoff", "LennardJones", "PotentialShift", "ParticleParticle", "", "PotentialAndForce" },
     { nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_F_avx_256_single, "nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_F_avx_256_single", "avx_256_single", "ReactionField", "ExactCutoff", "LennardJones", "PotentialShift", "ParticleParticle", "", "Force" },
     { nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_VF_avx_256_single, "nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_VF_avx_256_single", "avx_256_single", "ReactionField", "ExactCutoff", "LennardJones", "PotentialShift", "Water3Particle", "", "PotentialAndForce" },
@@ -519,7 +477,37 @@ nb_kernel_info_t
     { nb_kernel_ElecRF_VdwCSTab_GeomW4P1_VF_avx_256_single, "nb_kernel_ElecRF_VdwCSTab_GeomW4P1_VF_avx_256_single", "avx_256_single", "ReactionField", "None", "CubicSplineTable", "None", "Water4Particle", "", "PotentialAndForce" },
     { nb_kernel_ElecRF_VdwCSTab_GeomW4P1_F_avx_256_single, "nb_kernel_ElecRF_VdwCSTab_GeomW4P1_F_avx_256_single", "avx_256_single", "ReactionField", "None", "CubicSplineTable", "None", "Water4Particle", "", "Force" },
     { nb_kernel_ElecRF_VdwCSTab_GeomW4W4_VF_avx_256_single, "nb_kernel_ElecRF_VdwCSTab_GeomW4W4_VF_avx_256_single", "avx_256_single", "ReactionField", "None", "CubicSplineTable", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecRF_VdwCSTab_GeomW4W4_F_avx_256_single, "nb_kernel_ElecRF_VdwCSTab_GeomW4W4_F_avx_256_single", "avx_256_single", "ReactionField", "None", "CubicSplineTable", "None", "Water4Water4", "", "Force" }
+    { nb_kernel_ElecRF_VdwCSTab_GeomW4W4_F_avx_256_single, "nb_kernel_ElecRF_VdwCSTab_GeomW4W4_F_avx_256_single", "avx_256_single", "ReactionField", "None", "CubicSplineTable", "None", "Water4Water4", "", "Force" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_avx_256_single, "nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_avx_256_single", "avx_256_single", "Coulomb", "None", "LennardJones", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_avx_256_single, "nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_avx_256_single", "avx_256_single", "Coulomb", "None", "LennardJones", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_avx_256_single, "nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_avx_256_single", "avx_256_single", "Coulomb", "None", "LennardJones", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_avx_256_single, "nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_avx_256_single", "avx_256_single", "Coulomb", "None", "LennardJones", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_avx_256_single, "nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_avx_256_single", "avx_256_single", "Coulomb", "None", "LennardJones", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_avx_256_single, "nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_avx_256_single", "avx_256_single", "Coulomb", "None", "LennardJones", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_avx_256_single, "nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_avx_256_single", "avx_256_single", "Coulomb", "None", "LennardJones", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_avx_256_single, "nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_avx_256_single", "avx_256_single", "Coulomb", "None", "LennardJones", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_avx_256_single, "nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_avx_256_single", "avx_256_single", "Coulomb", "None", "LennardJones", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_avx_256_single, "nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_avx_256_single", "avx_256_single", "Coulomb", "None", "LennardJones", "None", "Water4Water4", "", "Force" },
+    { nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_avx_256_single, "nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_avx_256_single", "avx_256_single", "Coulomb", "None", "None", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_avx_256_single, "nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_avx_256_single", "avx_256_single", "Coulomb", "None", "None", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_avx_256_single, "nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_avx_256_single", "avx_256_single", "Coulomb", "None", "None", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_avx_256_single, "nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_avx_256_single", "avx_256_single", "Coulomb", "None", "None", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_avx_256_single, "nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_avx_256_single", "avx_256_single", "Coulomb", "None", "None", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_avx_256_single, "nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_avx_256_single", "avx_256_single", "Coulomb", "None", "None", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_avx_256_single, "nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_avx_256_single", "avx_256_single", "Coulomb", "None", "None", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_avx_256_single, "nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_avx_256_single", "avx_256_single", "Coulomb", "None", "None", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_avx_256_single, "nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_avx_256_single", "avx_256_single", "Coulomb", "None", "None", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_avx_256_single, "nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_avx_256_single", "avx_256_single", "Coulomb", "None", "None", "None", "Water4Water4", "", "Force" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_avx_256_single, "nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_avx_256_single", "avx_256_single", "Coulomb", "None", "CubicSplineTable", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_avx_256_single, "nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_avx_256_single", "avx_256_single", "Coulomb", "None", "CubicSplineTable", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_avx_256_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_avx_256_single", "avx_256_single", "Coulomb", "None", "CubicSplineTable", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_avx_256_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_avx_256_single", "avx_256_single", "Coulomb", "None", "CubicSplineTable", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_avx_256_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_avx_256_single", "avx_256_single", "Coulomb", "None", "CubicSplineTable", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_avx_256_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_avx_256_single", "avx_256_single", "Coulomb", "None", "CubicSplineTable", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_avx_256_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_avx_256_single", "avx_256_single", "Coulomb", "None", "CubicSplineTable", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_avx_256_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_avx_256_single", "avx_256_single", "Coulomb", "None", "CubicSplineTable", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_avx_256_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_avx_256_single", "avx_256_single", "Coulomb", "None", "CubicSplineTable", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_avx_256_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_avx_256_single", "avx_256_single", "Coulomb", "None", "CubicSplineTable", "None", "Water4Water4", "", "Force" }
 };
 
 int
index 837fce7857680e389e568f6e2971626bc3b64ca4..d4c8e38f35730d2464a6dac892cef4135a5d2366 100644 (file)
@@ -2,7 +2,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -140,13 +140,6 @@ void
     __m256           velec,felec,velecsum,facel,crf,krf,krf2;
     real             *charge;
     /* #endif */
-    /* #if 'GeneralizedBorn' in KERNEL_ELEC */
-    __m256i          gbitab;
-    __m128i          gbitab_lo,gbitab_hi;
-    __m256           vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,gbeps,dvdatmp;
-    __m256           minushalf = _mm256_set1_ps(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    /* #endif */
     /* #if KERNEL_VDW != 'None' */
     int              nvdwtype;
     __m256           rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
@@ -155,7 +148,7 @@ void
     __m256           one_sixth   = _mm256_set1_ps(1.0/6.0);
     __m256           one_twelfth = _mm256_set1_ps(1.0/12.0);
     /* #endif */
-    /* #if 'Table' in KERNEL_ELEC or 'GeneralizedBorn' in KERNEL_ELEC or 'Table' in KERNEL_VDW */
+    /* #if 'Table' in KERNEL_ELEC or 'Table' in KERNEL_VDW */
     __m256i          vfitab;
     __m128i          vfitab_lo,vfitab_hi;
     __m128i          ifour       = _mm_set1_epi32(4);
@@ -246,14 +239,6 @@ void
      /*     #endif */
     /* #endif */
 
-    /* #if KERNEL_ELEC=='GeneralizedBorn' */
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = _mm256_set1_ps(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = _mm256_set1_ps((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-    /* #endif */
-
     /* #if 'Water' in GEOMETRY_I */
     /* Setup water-specific parameters */
     inr              = nlist->iinr[0];
@@ -394,9 +379,6 @@ void
         /*     #for I in PARTICLES_ELEC_I */
         iq{I}              = _mm256_mul_ps(facel,_mm256_set1_ps(charge[inr+{I}]));
         /*         #define OUTERFLOPS OUTERFLOPS+1 */
-        /*         #if KERNEL_ELEC=='GeneralizedBorn' */
-        isai{I}            = _mm256_set1_ps(invsqrta[inr+{I}]);
-        /*         #endif */
         /*     #endfor */
         /*     #for I in PARTICLES_VDW_I */
         vdwioffsetptr{I}   = vdwparam+2*nvdwtype*vdwtype[inr+{I}];
@@ -411,16 +393,10 @@ void
         /*     #if KERNEL_ELEC != 'None' */
         velecsum         = _mm256_setzero_ps();
         /*     #endif */
-        /*     #if 'GeneralizedBorn' in KERNEL_ELEC */
-        vgbsum           = _mm256_setzero_ps();
-        /*     #endif */
         /*     #if KERNEL_VDW != 'None' */
         vvdwsum          = _mm256_setzero_ps();
         /*     #endif */
         /* #endif */
-        /*     #if 'GeneralizedBorn' in KERNEL_ELEC and 'Force' in KERNEL_VF */
-        dvdasum          = _mm256_setzero_ps();
-        /*     #endif */
 
         /* #for ROUND in ['Loop','Epilogue'] */
 
@@ -553,12 +529,6 @@ void
                                                                  charge+jnrC+{J},charge+jnrD+{J},
                                                                  charge+jnrE+{J},charge+jnrF+{J},
                                                                  charge+jnrG+{J},charge+jnrH+{J});
-            /*         #if KERNEL_ELEC=='GeneralizedBorn' */
-            isaj{J}            = gmx_mm256_load_8real_swizzle_ps(invsqrta+jnrA+{J},invsqrta+jnrB+{J},
-                                                                 invsqrta+jnrC+{J},invsqrta+jnrD+{J},
-                                                                 invsqrta+jnrE+{J},invsqrta+jnrF+{J},
-                                                                 invsqrta+jnrG+{J},invsqrta+jnrH+{J});
-            /*         #endif */
             /*     #endfor */
             /*     #for J in PARTICLES_VDW_J */
             vdwjidx{J}A        = 2*vdwtype[jnrA+{J}];
@@ -686,79 +656,6 @@ void
             /*                 #define INNERFLOPS INNERFLOPS+3 */
             /*             #endif */
 
-            /*         #elif KERNEL_ELEC=='GeneralizedBorn' */
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm256_mul_ps(isai{I},isaj{J});
-            gbqqfactor       = _mm256_xor_ps(signbit,_mm256_mul_ps(qq{I}{J},_mm256_mul_ps(isaprod,gbinvepsdiff)));
-            gbscale          = _mm256_mul_ps(isaprod,gbtabscale);
-            /*             #define INNERFLOPS INNERFLOPS+5 */
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm256_mul_ps(r{I}{J},gbscale);
-            gbitab           = _mm256_cvttps_epi32(rt);
-            gbeps            = _mm256_sub_ps(rt,_mm256_round_ps(rt, _MM_FROUND_FLOOR));
-            /*         AVX1 does not support 256-bit integer operations, so now we go to 128-bit mode... */
-            gbitab_lo        = _mm256_extractf128_si256(gbitab,0x0);
-            gbitab_hi        = _mm256_extractf128_si256(gbitab,0x1);
-            gbitab_lo        = _mm_slli_epi32(gbitab_lo,2);
-            gbitab_hi        = _mm_slli_epi32(gbitab_hi,2);
-            Y                = gmx_mm256_set_m128(_mm_load_ps(gbtab + _mm_extract_epi32(gbitab_hi,0)),
-                                                  _mm_load_ps(gbtab + _mm_extract_epi32(gbitab_lo,0)));
-            F                = gmx_mm256_set_m128(_mm_load_ps(gbtab + _mm_extract_epi32(gbitab_hi,1)),
-                                                  _mm_load_ps(gbtab + _mm_extract_epi32(gbitab_lo,1)));
-            G                = gmx_mm256_set_m128(_mm_load_ps(gbtab + _mm_extract_epi32(gbitab_hi,2)),
-                                                  _mm_load_ps(gbtab + _mm_extract_epi32(gbitab_lo,2)));
-            H                = gmx_mm256_set_m128(_mm_load_ps(gbtab + _mm_extract_epi32(gbitab_hi,3)),
-                                                  _mm_load_ps(gbtab + _mm_extract_epi32(gbitab_lo,3)));
-            GMX_MM256_HALFTRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm256_mul_ps(gbeps,H);
-            Fp               = _mm256_add_ps(F,_mm256_mul_ps(gbeps,_mm256_add_ps(G,Heps)));
-            VV               = _mm256_add_ps(Y,_mm256_mul_ps(gbeps,Fp));
-            vgb              = _mm256_mul_ps(gbqqfactor,VV);
-            /*             #define INNERFLOPS INNERFLOPS+10 */
-
-            /*             #if 'Force' in KERNEL_VF */
-            FF               = _mm256_add_ps(Fp,_mm256_mul_ps(gbeps,_mm256_add_ps(G,_mm256_add_ps(Heps,Heps))));
-            fgb              = _mm256_mul_ps(gbqqfactor,_mm256_mul_ps(FF,gbscale));
-            dvdatmp          = _mm256_mul_ps(minushalf,_mm256_add_ps(vgb,_mm256_mul_ps(fgb,r{I}{J})));
-            /*                 #if ROUND == 'Epilogue' */
-            dvdatmp          = _mm256_andnot_ps(dummy_mask,dvdatmp);
-            /*                 #endif */
-            dvdasum          = _mm256_add_ps(dvdasum,dvdatmp);
-            /*                 #if ROUND == 'Loop' */
-            fjptrA           = dvda+jnrA;
-            fjptrB           = dvda+jnrB;
-            fjptrC           = dvda+jnrC;
-            fjptrD           = dvda+jnrD;
-            fjptrE           = dvda+jnrE;
-            fjptrF           = dvda+jnrF;
-            fjptrG           = dvda+jnrG;
-            fjptrH           = dvda+jnrH;
-            /*                 #else */
-            /* The pointers to scratch make sure that this code with compilers that take gmx_restrict seriously (e.g. icc 13) really can't screw things up. */
-            fjptrA             = (jnrlistA>=0) ? dvda+jnrA : scratch;
-            fjptrB             = (jnrlistB>=0) ? dvda+jnrB : scratch;
-            fjptrC             = (jnrlistC>=0) ? dvda+jnrC : scratch;
-            fjptrD             = (jnrlistD>=0) ? dvda+jnrD : scratch;
-            fjptrE             = (jnrlistE>=0) ? dvda+jnrE : scratch;
-            fjptrF             = (jnrlistF>=0) ? dvda+jnrF : scratch;
-            fjptrG             = (jnrlistG>=0) ? dvda+jnrG : scratch;
-            fjptrH             = (jnrlistH>=0) ? dvda+jnrH : scratch;
-            /*                 #endif */
-            gmx_mm256_increment_8real_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,fjptrE,fjptrF,fjptrG,fjptrH,
-                                                 _mm256_mul_ps(dvdatmp,_mm256_mul_ps(isaj{J},isaj{J})));
-            /*                 #define INNERFLOPS INNERFLOPS+12 */
-            /*             #endif */
-            velec            = _mm256_mul_ps(qq{I}{J},rinv{I}{J});
-            /*                 #define INNERFLOPS INNERFLOPS+1 */
-            /*             #if 'Force' in KERNEL_VF */
-            felec            = _mm256_mul_ps(_mm256_sub_ps(_mm256_mul_ps(velec,rinv{I}{J}),fgb),rinv{I}{J});
-            /*                 #define INNERFLOPS INNERFLOPS+3 */
-            /*             #endif */
-
             /*         #elif KERNEL_ELEC=='Ewald' */
             /* EWALD ELECTROSTATICS */
             
@@ -1005,17 +902,6 @@ void
             /*             #endif */
             velecsum         = _mm256_add_ps(velecsum,velec);
             /*             #define INNERFLOPS INNERFLOPS+1 */
-            /*             #if KERNEL_ELEC=='GeneralizedBorn' */
-            /*             #if 'exactcutoff' in INTERACTION_FLAGS[I][J] */
-            vgb              = _mm256_and_ps(vgb,cutoff_mask);
-            /*                 #define INNERFLOPS INNERFLOPS+1 */
-            /*             #endif                                       */
-            /*             #if ROUND == 'Epilogue' */
-            vgb              = _mm256_andnot_ps(dummy_mask,vgb);
-            /*             #endif */
-            vgbsum           = _mm256_add_ps(vgbsum,vgb);
-            /*                 #define INNERFLOPS INNERFLOPS+1 */
-            /*             #endif */
             /*         #endif */
             /*         #if 'vdw' in INTERACTION_FLAGS[I][J] */
             /*     ## Note special check for TIP4P-TIP4P. Since we are cutting of all hydrogen interactions we also cut the LJ-only O-O interaction */
@@ -1185,19 +1071,11 @@ void
         gmx_mm256_update_1pot_ps(velecsum,kernel_data->energygrp_elec+ggid);
         /*         #define OUTERFLOPS OUTERFLOPS+1 */
         /*     #endif */
-        /*     #if 'GeneralizedBorn' in KERNEL_ELEC */
-        gmx_mm256_update_1pot_ps(vgbsum,kernel_data->energygrp_polarization+ggid);
-        /*         #define OUTERFLOPS OUTERFLOPS+1 */
-        /*     #endif */
         /*     #if KERNEL_VDW != 'None' */
         gmx_mm256_update_1pot_ps(vvdwsum,kernel_data->energygrp_vdw+ggid);
         /*         #define OUTERFLOPS OUTERFLOPS+1 */
         /*     #endif */
         /* #endif */
-        /*     #if 'GeneralizedBorn' in KERNEL_ELEC and 'Force' in KERNEL_VF */
-        dvdasum = _mm256_mul_ps(dvdasum, _mm256_mul_ps(isai{I},isai{I}));
-        gmx_mm256_update_1pot_ps(dvdasum,dvda+inr);
-        /*     #endif */
 
         /* Increment number of inner iterations */
         inneriter                  += j_index_end - j_index_start;
index 867206735c8a6432577a8845dd4f833399ad14bc..cb9ffd4b3c2cfcc3c03c461bb5ca0ef4f474e54e 100755 (executable)
@@ -105,7 +105,6 @@ ElectrostaticsList = {
     'None'                    : [],
     'Coulomb'                 : ['rinv','rinvsq'],
     'ReactionField'           : ['rinv','rinvsq'],
-    'GeneralizedBorn'         : ['rinv','r'],
     'CubicSplineTable'        : ['rinv','r','table'],
     'Ewald'                   : ['rinv','rinvsq','r'],
 }
@@ -190,7 +189,6 @@ Abbreviation = {
     'Coulomb'                 : 'Coul',
     'Ewald'                   : 'Ew',
     'ReactionField'           : 'RF',
-    'GeneralizedBorn'         : 'GB',
     'CubicSplineTable'        : 'CSTab',
     'LennardJones'            : 'LJ',
     'Buckingham'              : 'Bham',
@@ -269,7 +267,7 @@ def KeepKernel(KernelElec,KernelElecMod,KernelVdw,KernelVdwMod,KernelGeom,Kernel
         return 0
 
     # No need for LJ-only water optimization, or water optimization with implicit solvent.
-    if('Water' in KernelGeom[0] and (KernelElec=='None' or 'GeneralizedBorn' in KernelElec)):
+    if('Water' in KernelGeom[0] and KernelElec=='None'):
         return 0
 
     # Non-matching table settings are pointless
diff --git a/src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecGB_VdwBham_GeomP1P1_c.c b/src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecGB_VdwBham_GeomP1P1_c.c
deleted file mode 100644 (file)
index 343dd09..0000000
+++ /dev/null
@@ -1,505 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 2012,2013,2014.2015,2017, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
- * and including many others, as listed in the AUTHORS file in the
- * top-level source directory and at http://www.gromacs.org.
- *
- * GROMACS is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * GROMACS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GROMACS; if not, see
- * http://www.gnu.org/licenses, or write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
- *
- * If you want to redistribute modifications to GROMACS, please
- * consider that scientific software is very special. Version
- * control is crucial - bugs must be traceable. We will be happy to
- * consider code for inclusion in the official distribution, but
- * derived work must not be called official GROMACS. Details are found
- * in the README & COPYING files - if they are missing, get the
- * official version at http://www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the research papers on the package. Check out http://www.gromacs.org.
- */
-/*
- * Note: this file was generated by the GROMACS c kernel generator.
- */
-#include "gmxpre.h"
-
-#include "config.h"
-
-#include <math.h>
-
-#include "../nb_kernel.h"
-#include "gromacs/gmxlib/nrnb.h"
-
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwBham_GeomP1P1_VF_c
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            Buckingham
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        PotentialAndForce
- */
-void
-nb_kernel_ElecGB_VdwBham_GeomP1P1_VF_c
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    int              i_shift_offset,i_coord_offset,j_coord_offset;
-    int              j_index_start,j_index_end;
-    int              nri,inr,ggid,iidx,jidx,jnr,outeriter,inneriter;
-    real             shX,shY,shZ,tx,ty,tz,fscal,rcutoff,rcutoff2;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             *shiftvec,*fshift,*x,*f;
-    int              vdwioffset0;
-    real             ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0;
-    real             jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    real             dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00,cexp1_00,cexp2_00;
-    real             velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    int              gbitab;
-    real             vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,dvdaj,gbeps,dvdatmp;
-    real             *invsqrta,*dvda,*gbtab;
-    int              nvdwtype;
-    real             rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,br,vvdwexp,sh_vdw_invrcut6;
-    int              *vdwtype;
-    real             *vdwparam;
-    int              vfitab;
-    real             rt,vfeps,vftabscale,Y,F,Geps,Heps2,Fp,VV,FF;
-    real             *vftab;
-
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = fr->ic->epsfac;
-    charge           = mdatoms->chargeA;
-    nvdwtype         = fr->ntype;
-    vdwparam         = fr->nbfp;
-    vdwtype          = mdatoms->typeA;
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = fr->gbtab->scale;
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = (1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent);
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-        shX              = shiftvec[i_shift_offset+XX];
-        shY              = shiftvec[i_shift_offset+YY];
-        shZ              = shiftvec[i_shift_offset+ZZ];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        ix0              = shX + x[i_coord_offset+DIM*0+XX];
-        iy0              = shY + x[i_coord_offset+DIM*0+YY];
-        iz0              = shZ + x[i_coord_offset+DIM*0+ZZ];
-
-        fix0             = 0.0;
-        fiy0             = 0.0;
-        fiz0             = 0.0;
-
-        /* Load parameters for i particles */
-        iq0              = facel*charge[inr+0];
-        isai0            = invsqrta[inr+0];
-        vdwioffset0      = 3*nvdwtype*vdwtype[inr+0];
-
-        /* Reset potential sums */
-        velecsum         = 0.0;
-        vgbsum           = 0.0;
-        vvdwsum          = 0.0;
-        dvdasum          = 0.0;
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end; jidx++)
-        {
-            /* Get j neighbor index, and coordinate index */
-            jnr              = jjnr[jidx];
-            j_coord_offset   = DIM*jnr;
-
-            /* load j atom coordinates */
-            jx0              = x[j_coord_offset+DIM*0+XX];
-            jy0              = x[j_coord_offset+DIM*0+YY];
-            jz0              = x[j_coord_offset+DIM*0+ZZ];
-
-            /* Calculate displacement vector */
-            dx00             = ix0 - jx0;
-            dy00             = iy0 - jy0;
-            dz00             = iz0 - jz0;
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = dx00*dx00+dy00*dy00+dz00*dz00;
-
-            rinv00           = 1.0/sqrt(rsq00);
-
-            rinvsq00         = rinv00*rinv00;
-
-            /* Load parameters for j particles */
-            jq0              = charge[jnr+0];
-            isaj0           = invsqrta[jnr+0];
-            vdwjidx0         = 3*vdwtype[jnr+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = rsq00*rinv00;
-
-            qq00             = iq0*jq0;
-            c6_00            = vdwparam[vdwioffset0+vdwjidx0];
-            cexp1_00         = vdwparam[vdwioffset0+vdwjidx0+1];
-            cexp2_00         = vdwparam[vdwioffset0+vdwjidx0+2];
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = isai0*isaj0;
-            gbqqfactor       = isaprod*(-qq00)*gbinvepsdiff;
-            gbscale          = isaprod*gbtabscale;
-            dvdaj            = dvda[jnr+0];
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = r00*gbscale;
-            gbitab           = rt;
-            gbeps            = rt-gbitab;
-            gbitab           = 4*gbitab;
-
-            Y                = gbtab[gbitab];
-            F                = gbtab[gbitab+1];
-            Geps             = gbeps*gbtab[gbitab+2];
-            Heps2            = gbeps*gbeps*gbtab[gbitab+3];
-            Fp               = F+Geps+Heps2;
-            VV               = Y+gbeps*Fp;
-            vgb              = gbqqfactor*VV;
-
-            FF               = Fp+Geps+2.0*Heps2;
-            fgb              = gbqqfactor*FF*gbscale;
-            dvdatmp          = -0.5*(vgb+fgb*r00);
-            dvdasum          = dvdasum + dvdatmp;
-            dvda[jnr]        = dvdaj+dvdatmp*isaj0*isaj0;
-            velec            = qq00*rinv00;
-            felec            = (velec*rinv00-fgb)*rinv00;
-
-            /* BUCKINGHAM DISPERSION/REPULSION */
-            rinvsix          = rinvsq00*rinvsq00*rinvsq00;
-            vvdw6            = c6_00*rinvsix;
-            br               = cexp2_00*r00;
-            vvdwexp          = cexp1_00*exp(-br);
-            vvdw             = vvdwexp - vvdw6*(1.0/6.0);
-            fvdw             = (br*vvdwexp-vvdw6)*rinvsq00;
-
-            /* Update potential sums from outer loop */
-            velecsum        += velec;
-            vgbsum          += vgb;
-            vvdwsum         += vvdw;
-
-            fscal            = felec+fvdw;
-
-            /* Calculate temporary vectorial force */
-            tx               = fscal*dx00;
-            ty               = fscal*dy00;
-            tz               = fscal*dz00;
-
-            /* Update vectorial force */
-            fix0            += tx;
-            fiy0            += ty;
-            fiz0            += tz;
-            f[j_coord_offset+DIM*0+XX] -= tx;
-            f[j_coord_offset+DIM*0+YY] -= ty;
-            f[j_coord_offset+DIM*0+ZZ] -= tz;
-
-            /* Inner loop uses 97 flops */
-        }
-        /* End of innermost loop */
-
-        tx = ty = tz = 0;
-        f[i_coord_offset+DIM*0+XX] += fix0;
-        f[i_coord_offset+DIM*0+YY] += fiy0;
-        f[i_coord_offset+DIM*0+ZZ] += fiz0;
-        tx                         += fix0;
-        ty                         += fiy0;
-        tz                         += fiz0;
-        fshift[i_shift_offset+XX]  += tx;
-        fshift[i_shift_offset+YY]  += ty;
-        fshift[i_shift_offset+ZZ]  += tz;
-
-        ggid                        = gid[iidx];
-        /* Update potential energies */
-        kernel_data->energygrp_elec[ggid] += velecsum;
-        kernel_data->energygrp_polarization[ggid] += vgbsum;
-        kernel_data->energygrp_vdw[ggid] += vvdwsum;
-        dvda[inr]                   = dvda[inr] + dvdasum*isai0*isai0;
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 16 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_VF,outeriter*16 + inneriter*97);
-}
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwBham_GeomP1P1_F_c
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            Buckingham
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        Force
- */
-void
-nb_kernel_ElecGB_VdwBham_GeomP1P1_F_c
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    int              i_shift_offset,i_coord_offset,j_coord_offset;
-    int              j_index_start,j_index_end;
-    int              nri,inr,ggid,iidx,jidx,jnr,outeriter,inneriter;
-    real             shX,shY,shZ,tx,ty,tz,fscal,rcutoff,rcutoff2;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             *shiftvec,*fshift,*x,*f;
-    int              vdwioffset0;
-    real             ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0;
-    real             jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    real             dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00,cexp1_00,cexp2_00;
-    real             velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    int              gbitab;
-    real             vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,dvdaj,gbeps,dvdatmp;
-    real             *invsqrta,*dvda,*gbtab;
-    int              nvdwtype;
-    real             rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,br,vvdwexp,sh_vdw_invrcut6;
-    int              *vdwtype;
-    real             *vdwparam;
-    int              vfitab;
-    real             rt,vfeps,vftabscale,Y,F,Geps,Heps2,Fp,VV,FF;
-    real             *vftab;
-
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = fr->ic->epsfac;
-    charge           = mdatoms->chargeA;
-    nvdwtype         = fr->ntype;
-    vdwparam         = fr->nbfp;
-    vdwtype          = mdatoms->typeA;
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = fr->gbtab->scale;
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = (1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent);
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-        shX              = shiftvec[i_shift_offset+XX];
-        shY              = shiftvec[i_shift_offset+YY];
-        shZ              = shiftvec[i_shift_offset+ZZ];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        ix0              = shX + x[i_coord_offset+DIM*0+XX];
-        iy0              = shY + x[i_coord_offset+DIM*0+YY];
-        iz0              = shZ + x[i_coord_offset+DIM*0+ZZ];
-
-        fix0             = 0.0;
-        fiy0             = 0.0;
-        fiz0             = 0.0;
-
-        /* Load parameters for i particles */
-        iq0              = facel*charge[inr+0];
-        isai0            = invsqrta[inr+0];
-        vdwioffset0      = 3*nvdwtype*vdwtype[inr+0];
-
-        dvdasum          = 0.0;
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end; jidx++)
-        {
-            /* Get j neighbor index, and coordinate index */
-            jnr              = jjnr[jidx];
-            j_coord_offset   = DIM*jnr;
-
-            /* load j atom coordinates */
-            jx0              = x[j_coord_offset+DIM*0+XX];
-            jy0              = x[j_coord_offset+DIM*0+YY];
-            jz0              = x[j_coord_offset+DIM*0+ZZ];
-
-            /* Calculate displacement vector */
-            dx00             = ix0 - jx0;
-            dy00             = iy0 - jy0;
-            dz00             = iz0 - jz0;
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = dx00*dx00+dy00*dy00+dz00*dz00;
-
-            rinv00           = 1.0/sqrt(rsq00);
-
-            rinvsq00         = rinv00*rinv00;
-
-            /* Load parameters for j particles */
-            jq0              = charge[jnr+0];
-            isaj0           = invsqrta[jnr+0];
-            vdwjidx0         = 3*vdwtype[jnr+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = rsq00*rinv00;
-
-            qq00             = iq0*jq0;
-            c6_00            = vdwparam[vdwioffset0+vdwjidx0];
-            cexp1_00         = vdwparam[vdwioffset0+vdwjidx0+1];
-            cexp2_00         = vdwparam[vdwioffset0+vdwjidx0+2];
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = isai0*isaj0;
-            gbqqfactor       = isaprod*(-qq00)*gbinvepsdiff;
-            gbscale          = isaprod*gbtabscale;
-            dvdaj            = dvda[jnr+0];
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = r00*gbscale;
-            gbitab           = rt;
-            gbeps            = rt-gbitab;
-            gbitab           = 4*gbitab;
-
-            Y                = gbtab[gbitab];
-            F                = gbtab[gbitab+1];
-            Geps             = gbeps*gbtab[gbitab+2];
-            Heps2            = gbeps*gbeps*gbtab[gbitab+3];
-            Fp               = F+Geps+Heps2;
-            VV               = Y+gbeps*Fp;
-            vgb              = gbqqfactor*VV;
-
-            FF               = Fp+Geps+2.0*Heps2;
-            fgb              = gbqqfactor*FF*gbscale;
-            dvdatmp          = -0.5*(vgb+fgb*r00);
-            dvdasum          = dvdasum + dvdatmp;
-            dvda[jnr]        = dvdaj+dvdatmp*isaj0*isaj0;
-            velec            = qq00*rinv00;
-            felec            = (velec*rinv00-fgb)*rinv00;
-
-            /* BUCKINGHAM DISPERSION/REPULSION */
-            rinvsix          = rinvsq00*rinvsq00*rinvsq00;
-            vvdw6            = c6_00*rinvsix;
-            br               = cexp2_00*r00;
-            vvdwexp          = cexp1_00*exp(-br);
-            fvdw             = (br*vvdwexp-vvdw6)*rinvsq00;
-
-            fscal            = felec+fvdw;
-
-            /* Calculate temporary vectorial force */
-            tx               = fscal*dx00;
-            ty               = fscal*dy00;
-            tz               = fscal*dz00;
-
-            /* Update vectorial force */
-            fix0            += tx;
-            fiy0            += ty;
-            fiz0            += tz;
-            f[j_coord_offset+DIM*0+XX] -= tx;
-            f[j_coord_offset+DIM*0+YY] -= ty;
-            f[j_coord_offset+DIM*0+ZZ] -= tz;
-
-            /* Inner loop uses 92 flops */
-        }
-        /* End of innermost loop */
-
-        tx = ty = tz = 0;
-        f[i_coord_offset+DIM*0+XX] += fix0;
-        f[i_coord_offset+DIM*0+YY] += fiy0;
-        f[i_coord_offset+DIM*0+ZZ] += fiz0;
-        tx                         += fix0;
-        ty                         += fiy0;
-        tz                         += fiz0;
-        fshift[i_shift_offset+XX]  += tx;
-        fshift[i_shift_offset+YY]  += ty;
-        fshift[i_shift_offset+ZZ]  += tz;
-
-        dvda[inr]                   = dvda[inr] + dvdasum*isai0*isai0;
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 13 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_F,outeriter*13 + inneriter*92);
-}
diff --git a/src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecGB_VdwCSTab_GeomP1P1_c.c b/src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecGB_VdwCSTab_GeomP1P1_c.c
deleted file mode 100644 (file)
index 83a453f..0000000
+++ /dev/null
@@ -1,545 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 2012,2013,2014.2015,2017, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
- * and including many others, as listed in the AUTHORS file in the
- * top-level source directory and at http://www.gromacs.org.
- *
- * GROMACS is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * GROMACS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GROMACS; if not, see
- * http://www.gnu.org/licenses, or write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
- *
- * If you want to redistribute modifications to GROMACS, please
- * consider that scientific software is very special. Version
- * control is crucial - bugs must be traceable. We will be happy to
- * consider code for inclusion in the official distribution, but
- * derived work must not be called official GROMACS. Details are found
- * in the README & COPYING files - if they are missing, get the
- * official version at http://www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the research papers on the package. Check out http://www.gromacs.org.
- */
-/*
- * Note: this file was generated by the GROMACS c kernel generator.
- */
-#include "gmxpre.h"
-
-#include "config.h"
-
-#include <math.h>
-
-#include "../nb_kernel.h"
-#include "gromacs/gmxlib/nrnb.h"
-
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_c
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            CubicSplineTable
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        PotentialAndForce
- */
-void
-nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_c
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    int              i_shift_offset,i_coord_offset,j_coord_offset;
-    int              j_index_start,j_index_end;
-    int              nri,inr,ggid,iidx,jidx,jnr,outeriter,inneriter;
-    real             shX,shY,shZ,tx,ty,tz,fscal,rcutoff,rcutoff2;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             *shiftvec,*fshift,*x,*f;
-    int              vdwioffset0;
-    real             ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0;
-    real             jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    real             dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00,cexp1_00,cexp2_00;
-    real             velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    int              gbitab;
-    real             vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,dvdaj,gbeps,dvdatmp;
-    real             *invsqrta,*dvda,*gbtab;
-    int              nvdwtype;
-    real             rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,br,vvdwexp,sh_vdw_invrcut6;
-    int              *vdwtype;
-    real             *vdwparam;
-    int              vfitab;
-    real             rt,vfeps,vftabscale,Y,F,Geps,Heps2,Fp,VV,FF;
-    real             *vftab;
-
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = fr->ic->epsfac;
-    charge           = mdatoms->chargeA;
-    nvdwtype         = fr->ntype;
-    vdwparam         = fr->nbfp;
-    vdwtype          = mdatoms->typeA;
-
-    vftab            = kernel_data->table_vdw->data;
-    vftabscale       = kernel_data->table_vdw->scale;
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = fr->gbtab->scale;
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = (1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent);
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-        shX              = shiftvec[i_shift_offset+XX];
-        shY              = shiftvec[i_shift_offset+YY];
-        shZ              = shiftvec[i_shift_offset+ZZ];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        ix0              = shX + x[i_coord_offset+DIM*0+XX];
-        iy0              = shY + x[i_coord_offset+DIM*0+YY];
-        iz0              = shZ + x[i_coord_offset+DIM*0+ZZ];
-
-        fix0             = 0.0;
-        fiy0             = 0.0;
-        fiz0             = 0.0;
-
-        /* Load parameters for i particles */
-        iq0              = facel*charge[inr+0];
-        isai0            = invsqrta[inr+0];
-        vdwioffset0      = 2*nvdwtype*vdwtype[inr+0];
-
-        /* Reset potential sums */
-        velecsum         = 0.0;
-        vgbsum           = 0.0;
-        vvdwsum          = 0.0;
-        dvdasum          = 0.0;
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end; jidx++)
-        {
-            /* Get j neighbor index, and coordinate index */
-            jnr              = jjnr[jidx];
-            j_coord_offset   = DIM*jnr;
-
-            /* load j atom coordinates */
-            jx0              = x[j_coord_offset+DIM*0+XX];
-            jy0              = x[j_coord_offset+DIM*0+YY];
-            jz0              = x[j_coord_offset+DIM*0+ZZ];
-
-            /* Calculate displacement vector */
-            dx00             = ix0 - jx0;
-            dy00             = iy0 - jy0;
-            dz00             = iz0 - jz0;
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = dx00*dx00+dy00*dy00+dz00*dz00;
-
-            rinv00           = 1.0/sqrt(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = charge[jnr+0];
-            isaj0           = invsqrta[jnr+0];
-            vdwjidx0         = 2*vdwtype[jnr+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = rsq00*rinv00;
-
-            qq00             = iq0*jq0;
-            c6_00            = vdwparam[vdwioffset0+vdwjidx0];
-            c12_00           = vdwparam[vdwioffset0+vdwjidx0+1];
-
-            /* Calculate table index by multiplying r with table scale and truncate to integer */
-            rt               = r00*vftabscale;
-            vfitab           = rt;
-            vfeps            = rt-vfitab;
-            vfitab           = 2*4*vfitab;
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = isai0*isaj0;
-            gbqqfactor       = isaprod*(-qq00)*gbinvepsdiff;
-            gbscale          = isaprod*gbtabscale;
-            dvdaj            = dvda[jnr+0];
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = r00*gbscale;
-            gbitab           = rt;
-            gbeps            = rt-gbitab;
-            gbitab           = 4*gbitab;
-
-            Y                = gbtab[gbitab];
-            F                = gbtab[gbitab+1];
-            Geps             = gbeps*gbtab[gbitab+2];
-            Heps2            = gbeps*gbeps*gbtab[gbitab+3];
-            Fp               = F+Geps+Heps2;
-            VV               = Y+gbeps*Fp;
-            vgb              = gbqqfactor*VV;
-
-            FF               = Fp+Geps+2.0*Heps2;
-            fgb              = gbqqfactor*FF*gbscale;
-            dvdatmp          = -0.5*(vgb+fgb*r00);
-            dvdasum          = dvdasum + dvdatmp;
-            dvda[jnr]        = dvdaj+dvdatmp*isaj0*isaj0;
-            velec            = qq00*rinv00;
-            felec            = (velec*rinv00-fgb)*rinv00;
-
-            /* CUBIC SPLINE TABLE DISPERSION */
-            vfitab          += 0;
-            Y                = vftab[vfitab];
-            F                = vftab[vfitab+1];
-            Geps             = vfeps*vftab[vfitab+2];
-            Heps2            = vfeps*vfeps*vftab[vfitab+3];
-            Fp               = F+Geps+Heps2;
-            VV               = Y+vfeps*Fp;
-            vvdw6            = c6_00*VV;
-            FF               = Fp+Geps+2.0*Heps2;
-            fvdw6            = c6_00*FF;
-
-            /* CUBIC SPLINE TABLE REPULSION */
-            Y                = vftab[vfitab+4];
-            F                = vftab[vfitab+5];
-            Geps             = vfeps*vftab[vfitab+6];
-            Heps2            = vfeps*vfeps*vftab[vfitab+7];
-            Fp               = F+Geps+Heps2;
-            VV               = Y+vfeps*Fp;
-            vvdw12           = c12_00*VV;
-            FF               = Fp+Geps+2.0*Heps2;
-            fvdw12           = c12_00*FF;
-            vvdw             = vvdw12+vvdw6;
-            fvdw             = -(fvdw6+fvdw12)*vftabscale*rinv00;
-
-            /* Update potential sums from outer loop */
-            velecsum        += velec;
-            vgbsum          += vgb;
-            vvdwsum         += vvdw;
-
-            fscal            = felec+fvdw;
-
-            /* Calculate temporary vectorial force */
-            tx               = fscal*dx00;
-            ty               = fscal*dy00;
-            tz               = fscal*dz00;
-
-            /* Update vectorial force */
-            fix0            += tx;
-            fiy0            += ty;
-            fiz0            += tz;
-            f[j_coord_offset+DIM*0+XX] -= tx;
-            f[j_coord_offset+DIM*0+YY] -= ty;
-            f[j_coord_offset+DIM*0+ZZ] -= tz;
-
-            /* Inner loop uses 91 flops */
-        }
-        /* End of innermost loop */
-
-        tx = ty = tz = 0;
-        f[i_coord_offset+DIM*0+XX] += fix0;
-        f[i_coord_offset+DIM*0+YY] += fiy0;
-        f[i_coord_offset+DIM*0+ZZ] += fiz0;
-        tx                         += fix0;
-        ty                         += fiy0;
-        tz                         += fiz0;
-        fshift[i_shift_offset+XX]  += tx;
-        fshift[i_shift_offset+YY]  += ty;
-        fshift[i_shift_offset+ZZ]  += tz;
-
-        ggid                        = gid[iidx];
-        /* Update potential energies */
-        kernel_data->energygrp_elec[ggid] += velecsum;
-        kernel_data->energygrp_polarization[ggid] += vgbsum;
-        kernel_data->energygrp_vdw[ggid] += vvdwsum;
-        dvda[inr]                   = dvda[inr] + dvdasum*isai0*isai0;
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 16 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_VF,outeriter*16 + inneriter*91);
-}
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_c
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            CubicSplineTable
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        Force
- */
-void
-nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_c
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    int              i_shift_offset,i_coord_offset,j_coord_offset;
-    int              j_index_start,j_index_end;
-    int              nri,inr,ggid,iidx,jidx,jnr,outeriter,inneriter;
-    real             shX,shY,shZ,tx,ty,tz,fscal,rcutoff,rcutoff2;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             *shiftvec,*fshift,*x,*f;
-    int              vdwioffset0;
-    real             ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0;
-    real             jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    real             dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00,cexp1_00,cexp2_00;
-    real             velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    int              gbitab;
-    real             vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,dvdaj,gbeps,dvdatmp;
-    real             *invsqrta,*dvda,*gbtab;
-    int              nvdwtype;
-    real             rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,br,vvdwexp,sh_vdw_invrcut6;
-    int              *vdwtype;
-    real             *vdwparam;
-    int              vfitab;
-    real             rt,vfeps,vftabscale,Y,F,Geps,Heps2,Fp,VV,FF;
-    real             *vftab;
-
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = fr->ic->epsfac;
-    charge           = mdatoms->chargeA;
-    nvdwtype         = fr->ntype;
-    vdwparam         = fr->nbfp;
-    vdwtype          = mdatoms->typeA;
-
-    vftab            = kernel_data->table_vdw->data;
-    vftabscale       = kernel_data->table_vdw->scale;
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = fr->gbtab->scale;
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = (1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent);
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-        shX              = shiftvec[i_shift_offset+XX];
-        shY              = shiftvec[i_shift_offset+YY];
-        shZ              = shiftvec[i_shift_offset+ZZ];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        ix0              = shX + x[i_coord_offset+DIM*0+XX];
-        iy0              = shY + x[i_coord_offset+DIM*0+YY];
-        iz0              = shZ + x[i_coord_offset+DIM*0+ZZ];
-
-        fix0             = 0.0;
-        fiy0             = 0.0;
-        fiz0             = 0.0;
-
-        /* Load parameters for i particles */
-        iq0              = facel*charge[inr+0];
-        isai0            = invsqrta[inr+0];
-        vdwioffset0      = 2*nvdwtype*vdwtype[inr+0];
-
-        dvdasum          = 0.0;
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end; jidx++)
-        {
-            /* Get j neighbor index, and coordinate index */
-            jnr              = jjnr[jidx];
-            j_coord_offset   = DIM*jnr;
-
-            /* load j atom coordinates */
-            jx0              = x[j_coord_offset+DIM*0+XX];
-            jy0              = x[j_coord_offset+DIM*0+YY];
-            jz0              = x[j_coord_offset+DIM*0+ZZ];
-
-            /* Calculate displacement vector */
-            dx00             = ix0 - jx0;
-            dy00             = iy0 - jy0;
-            dz00             = iz0 - jz0;
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = dx00*dx00+dy00*dy00+dz00*dz00;
-
-            rinv00           = 1.0/sqrt(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = charge[jnr+0];
-            isaj0           = invsqrta[jnr+0];
-            vdwjidx0         = 2*vdwtype[jnr+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = rsq00*rinv00;
-
-            qq00             = iq0*jq0;
-            c6_00            = vdwparam[vdwioffset0+vdwjidx0];
-            c12_00           = vdwparam[vdwioffset0+vdwjidx0+1];
-
-            /* Calculate table index by multiplying r with table scale and truncate to integer */
-            rt               = r00*vftabscale;
-            vfitab           = rt;
-            vfeps            = rt-vfitab;
-            vfitab           = 2*4*vfitab;
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = isai0*isaj0;
-            gbqqfactor       = isaprod*(-qq00)*gbinvepsdiff;
-            gbscale          = isaprod*gbtabscale;
-            dvdaj            = dvda[jnr+0];
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = r00*gbscale;
-            gbitab           = rt;
-            gbeps            = rt-gbitab;
-            gbitab           = 4*gbitab;
-
-            Y                = gbtab[gbitab];
-            F                = gbtab[gbitab+1];
-            Geps             = gbeps*gbtab[gbitab+2];
-            Heps2            = gbeps*gbeps*gbtab[gbitab+3];
-            Fp               = F+Geps+Heps2;
-            VV               = Y+gbeps*Fp;
-            vgb              = gbqqfactor*VV;
-
-            FF               = Fp+Geps+2.0*Heps2;
-            fgb              = gbqqfactor*FF*gbscale;
-            dvdatmp          = -0.5*(vgb+fgb*r00);
-            dvdasum          = dvdasum + dvdatmp;
-            dvda[jnr]        = dvdaj+dvdatmp*isaj0*isaj0;
-            velec            = qq00*rinv00;
-            felec            = (velec*rinv00-fgb)*rinv00;
-
-            /* CUBIC SPLINE TABLE DISPERSION */
-            vfitab          += 0;
-            F                = vftab[vfitab+1];
-            Geps             = vfeps*vftab[vfitab+2];
-            Heps2            = vfeps*vfeps*vftab[vfitab+3];
-            Fp               = F+Geps+Heps2;
-            FF               = Fp+Geps+2.0*Heps2;
-            fvdw6            = c6_00*FF;
-
-            /* CUBIC SPLINE TABLE REPULSION */
-            F                = vftab[vfitab+5];
-            Geps             = vfeps*vftab[vfitab+6];
-            Heps2            = vfeps*vfeps*vftab[vfitab+7];
-            Fp               = F+Geps+Heps2;
-            FF               = Fp+Geps+2.0*Heps2;
-            fvdw12           = c12_00*FF;
-            fvdw             = -(fvdw6+fvdw12)*vftabscale*rinv00;
-
-            fscal            = felec+fvdw;
-
-            /* Calculate temporary vectorial force */
-            tx               = fscal*dx00;
-            ty               = fscal*dy00;
-            tz               = fscal*dz00;
-
-            /* Update vectorial force */
-            fix0            += tx;
-            fiy0            += ty;
-            fiz0            += tz;
-            f[j_coord_offset+DIM*0+XX] -= tx;
-            f[j_coord_offset+DIM*0+YY] -= ty;
-            f[j_coord_offset+DIM*0+ZZ] -= tz;
-
-            /* Inner loop uses 81 flops */
-        }
-        /* End of innermost loop */
-
-        tx = ty = tz = 0;
-        f[i_coord_offset+DIM*0+XX] += fix0;
-        f[i_coord_offset+DIM*0+YY] += fiy0;
-        f[i_coord_offset+DIM*0+ZZ] += fiz0;
-        tx                         += fix0;
-        ty                         += fiy0;
-        tz                         += fiz0;
-        fshift[i_shift_offset+XX]  += tx;
-        fshift[i_shift_offset+YY]  += ty;
-        fshift[i_shift_offset+ZZ]  += tz;
-
-        dvda[inr]                   = dvda[inr] + dvdasum*isai0*isai0;
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 13 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_F,outeriter*13 + inneriter*81);
-}
diff --git a/src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecGB_VdwLJ_GeomP1P1_c.c b/src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecGB_VdwLJ_GeomP1P1_c.c
deleted file mode 100644 (file)
index bef7707..0000000
+++ /dev/null
@@ -1,501 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 2012,2013,2014.2015,2017, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
- * and including many others, as listed in the AUTHORS file in the
- * top-level source directory and at http://www.gromacs.org.
- *
- * GROMACS is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * GROMACS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GROMACS; if not, see
- * http://www.gnu.org/licenses, or write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
- *
- * If you want to redistribute modifications to GROMACS, please
- * consider that scientific software is very special. Version
- * control is crucial - bugs must be traceable. We will be happy to
- * consider code for inclusion in the official distribution, but
- * derived work must not be called official GROMACS. Details are found
- * in the README & COPYING files - if they are missing, get the
- * official version at http://www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the research papers on the package. Check out http://www.gromacs.org.
- */
-/*
- * Note: this file was generated by the GROMACS c kernel generator.
- */
-#include "gmxpre.h"
-
-#include "config.h"
-
-#include <math.h>
-
-#include "../nb_kernel.h"
-#include "gromacs/gmxlib/nrnb.h"
-
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_c
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            LennardJones
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        PotentialAndForce
- */
-void
-nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_c
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    int              i_shift_offset,i_coord_offset,j_coord_offset;
-    int              j_index_start,j_index_end;
-    int              nri,inr,ggid,iidx,jidx,jnr,outeriter,inneriter;
-    real             shX,shY,shZ,tx,ty,tz,fscal,rcutoff,rcutoff2;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             *shiftvec,*fshift,*x,*f;
-    int              vdwioffset0;
-    real             ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0;
-    real             jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    real             dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00,cexp1_00,cexp2_00;
-    real             velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    int              gbitab;
-    real             vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,dvdaj,gbeps,dvdatmp;
-    real             *invsqrta,*dvda,*gbtab;
-    int              nvdwtype;
-    real             rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,br,vvdwexp,sh_vdw_invrcut6;
-    int              *vdwtype;
-    real             *vdwparam;
-    int              vfitab;
-    real             rt,vfeps,vftabscale,Y,F,Geps,Heps2,Fp,VV,FF;
-    real             *vftab;
-
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = fr->ic->epsfac;
-    charge           = mdatoms->chargeA;
-    nvdwtype         = fr->ntype;
-    vdwparam         = fr->nbfp;
-    vdwtype          = mdatoms->typeA;
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = fr->gbtab->scale;
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = (1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent);
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-        shX              = shiftvec[i_shift_offset+XX];
-        shY              = shiftvec[i_shift_offset+YY];
-        shZ              = shiftvec[i_shift_offset+ZZ];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        ix0              = shX + x[i_coord_offset+DIM*0+XX];
-        iy0              = shY + x[i_coord_offset+DIM*0+YY];
-        iz0              = shZ + x[i_coord_offset+DIM*0+ZZ];
-
-        fix0             = 0.0;
-        fiy0             = 0.0;
-        fiz0             = 0.0;
-
-        /* Load parameters for i particles */
-        iq0              = facel*charge[inr+0];
-        isai0            = invsqrta[inr+0];
-        vdwioffset0      = 2*nvdwtype*vdwtype[inr+0];
-
-        /* Reset potential sums */
-        velecsum         = 0.0;
-        vgbsum           = 0.0;
-        vvdwsum          = 0.0;
-        dvdasum          = 0.0;
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end; jidx++)
-        {
-            /* Get j neighbor index, and coordinate index */
-            jnr              = jjnr[jidx];
-            j_coord_offset   = DIM*jnr;
-
-            /* load j atom coordinates */
-            jx0              = x[j_coord_offset+DIM*0+XX];
-            jy0              = x[j_coord_offset+DIM*0+YY];
-            jz0              = x[j_coord_offset+DIM*0+ZZ];
-
-            /* Calculate displacement vector */
-            dx00             = ix0 - jx0;
-            dy00             = iy0 - jy0;
-            dz00             = iz0 - jz0;
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = dx00*dx00+dy00*dy00+dz00*dz00;
-
-            rinv00           = 1.0/sqrt(rsq00);
-
-            rinvsq00         = rinv00*rinv00;
-
-            /* Load parameters for j particles */
-            jq0              = charge[jnr+0];
-            isaj0           = invsqrta[jnr+0];
-            vdwjidx0         = 2*vdwtype[jnr+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = rsq00*rinv00;
-
-            qq00             = iq0*jq0;
-            c6_00            = vdwparam[vdwioffset0+vdwjidx0];
-            c12_00           = vdwparam[vdwioffset0+vdwjidx0+1];
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = isai0*isaj0;
-            gbqqfactor       = isaprod*(-qq00)*gbinvepsdiff;
-            gbscale          = isaprod*gbtabscale;
-            dvdaj            = dvda[jnr+0];
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = r00*gbscale;
-            gbitab           = rt;
-            gbeps            = rt-gbitab;
-            gbitab           = 4*gbitab;
-
-            Y                = gbtab[gbitab];
-            F                = gbtab[gbitab+1];
-            Geps             = gbeps*gbtab[gbitab+2];
-            Heps2            = gbeps*gbeps*gbtab[gbitab+3];
-            Fp               = F+Geps+Heps2;
-            VV               = Y+gbeps*Fp;
-            vgb              = gbqqfactor*VV;
-
-            FF               = Fp+Geps+2.0*Heps2;
-            fgb              = gbqqfactor*FF*gbscale;
-            dvdatmp          = -0.5*(vgb+fgb*r00);
-            dvdasum          = dvdasum + dvdatmp;
-            dvda[jnr]        = dvdaj+dvdatmp*isaj0*isaj0;
-            velec            = qq00*rinv00;
-            felec            = (velec*rinv00-fgb)*rinv00;
-
-            /* LENNARD-JONES DISPERSION/REPULSION */
-
-            rinvsix          = rinvsq00*rinvsq00*rinvsq00;
-            vvdw6            = c6_00*rinvsix;
-            vvdw12           = c12_00*rinvsix*rinvsix;
-            vvdw             = vvdw12*(1.0/12.0) - vvdw6*(1.0/6.0);
-            fvdw             = (vvdw12-vvdw6)*rinvsq00;
-
-            /* Update potential sums from outer loop */
-            velecsum        += velec;
-            vgbsum          += vgb;
-            vvdwsum         += vvdw;
-
-            fscal            = felec+fvdw;
-
-            /* Calculate temporary vectorial force */
-            tx               = fscal*dx00;
-            ty               = fscal*dy00;
-            tz               = fscal*dz00;
-
-            /* Update vectorial force */
-            fix0            += tx;
-            fiy0            += ty;
-            fiz0            += tz;
-            f[j_coord_offset+DIM*0+XX] -= tx;
-            f[j_coord_offset+DIM*0+YY] -= ty;
-            f[j_coord_offset+DIM*0+ZZ] -= tz;
-
-            /* Inner loop uses 71 flops */
-        }
-        /* End of innermost loop */
-
-        tx = ty = tz = 0;
-        f[i_coord_offset+DIM*0+XX] += fix0;
-        f[i_coord_offset+DIM*0+YY] += fiy0;
-        f[i_coord_offset+DIM*0+ZZ] += fiz0;
-        tx                         += fix0;
-        ty                         += fiy0;
-        tz                         += fiz0;
-        fshift[i_shift_offset+XX]  += tx;
-        fshift[i_shift_offset+YY]  += ty;
-        fshift[i_shift_offset+ZZ]  += tz;
-
-        ggid                        = gid[iidx];
-        /* Update potential energies */
-        kernel_data->energygrp_elec[ggid] += velecsum;
-        kernel_data->energygrp_polarization[ggid] += vgbsum;
-        kernel_data->energygrp_vdw[ggid] += vvdwsum;
-        dvda[inr]                   = dvda[inr] + dvdasum*isai0*isai0;
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 16 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_VF,outeriter*16 + inneriter*71);
-}
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_c
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            LennardJones
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        Force
- */
-void
-nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_c
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    int              i_shift_offset,i_coord_offset,j_coord_offset;
-    int              j_index_start,j_index_end;
-    int              nri,inr,ggid,iidx,jidx,jnr,outeriter,inneriter;
-    real             shX,shY,shZ,tx,ty,tz,fscal,rcutoff,rcutoff2;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             *shiftvec,*fshift,*x,*f;
-    int              vdwioffset0;
-    real             ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0;
-    real             jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    real             dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00,cexp1_00,cexp2_00;
-    real             velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    int              gbitab;
-    real             vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,dvdaj,gbeps,dvdatmp;
-    real             *invsqrta,*dvda,*gbtab;
-    int              nvdwtype;
-    real             rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,br,vvdwexp,sh_vdw_invrcut6;
-    int              *vdwtype;
-    real             *vdwparam;
-    int              vfitab;
-    real             rt,vfeps,vftabscale,Y,F,Geps,Heps2,Fp,VV,FF;
-    real             *vftab;
-
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = fr->ic->epsfac;
-    charge           = mdatoms->chargeA;
-    nvdwtype         = fr->ntype;
-    vdwparam         = fr->nbfp;
-    vdwtype          = mdatoms->typeA;
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = fr->gbtab->scale;
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = (1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent);
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-        shX              = shiftvec[i_shift_offset+XX];
-        shY              = shiftvec[i_shift_offset+YY];
-        shZ              = shiftvec[i_shift_offset+ZZ];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        ix0              = shX + x[i_coord_offset+DIM*0+XX];
-        iy0              = shY + x[i_coord_offset+DIM*0+YY];
-        iz0              = shZ + x[i_coord_offset+DIM*0+ZZ];
-
-        fix0             = 0.0;
-        fiy0             = 0.0;
-        fiz0             = 0.0;
-
-        /* Load parameters for i particles */
-        iq0              = facel*charge[inr+0];
-        isai0            = invsqrta[inr+0];
-        vdwioffset0      = 2*nvdwtype*vdwtype[inr+0];
-
-        dvdasum          = 0.0;
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end; jidx++)
-        {
-            /* Get j neighbor index, and coordinate index */
-            jnr              = jjnr[jidx];
-            j_coord_offset   = DIM*jnr;
-
-            /* load j atom coordinates */
-            jx0              = x[j_coord_offset+DIM*0+XX];
-            jy0              = x[j_coord_offset+DIM*0+YY];
-            jz0              = x[j_coord_offset+DIM*0+ZZ];
-
-            /* Calculate displacement vector */
-            dx00             = ix0 - jx0;
-            dy00             = iy0 - jy0;
-            dz00             = iz0 - jz0;
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = dx00*dx00+dy00*dy00+dz00*dz00;
-
-            rinv00           = 1.0/sqrt(rsq00);
-
-            rinvsq00         = rinv00*rinv00;
-
-            /* Load parameters for j particles */
-            jq0              = charge[jnr+0];
-            isaj0           = invsqrta[jnr+0];
-            vdwjidx0         = 2*vdwtype[jnr+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = rsq00*rinv00;
-
-            qq00             = iq0*jq0;
-            c6_00            = vdwparam[vdwioffset0+vdwjidx0];
-            c12_00           = vdwparam[vdwioffset0+vdwjidx0+1];
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = isai0*isaj0;
-            gbqqfactor       = isaprod*(-qq00)*gbinvepsdiff;
-            gbscale          = isaprod*gbtabscale;
-            dvdaj            = dvda[jnr+0];
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = r00*gbscale;
-            gbitab           = rt;
-            gbeps            = rt-gbitab;
-            gbitab           = 4*gbitab;
-
-            Y                = gbtab[gbitab];
-            F                = gbtab[gbitab+1];
-            Geps             = gbeps*gbtab[gbitab+2];
-            Heps2            = gbeps*gbeps*gbtab[gbitab+3];
-            Fp               = F+Geps+Heps2;
-            VV               = Y+gbeps*Fp;
-            vgb              = gbqqfactor*VV;
-
-            FF               = Fp+Geps+2.0*Heps2;
-            fgb              = gbqqfactor*FF*gbscale;
-            dvdatmp          = -0.5*(vgb+fgb*r00);
-            dvdasum          = dvdasum + dvdatmp;
-            dvda[jnr]        = dvdaj+dvdatmp*isaj0*isaj0;
-            velec            = qq00*rinv00;
-            felec            = (velec*rinv00-fgb)*rinv00;
-
-            /* LENNARD-JONES DISPERSION/REPULSION */
-
-            rinvsix          = rinvsq00*rinvsq00*rinvsq00;
-            fvdw             = (c12_00*rinvsix-c6_00)*rinvsix*rinvsq00;
-
-            fscal            = felec+fvdw;
-
-            /* Calculate temporary vectorial force */
-            tx               = fscal*dx00;
-            ty               = fscal*dy00;
-            tz               = fscal*dz00;
-
-            /* Update vectorial force */
-            fix0            += tx;
-            fiy0            += ty;
-            fiz0            += tz;
-            f[j_coord_offset+DIM*0+XX] -= tx;
-            f[j_coord_offset+DIM*0+YY] -= ty;
-            f[j_coord_offset+DIM*0+ZZ] -= tz;
-
-            /* Inner loop uses 64 flops */
-        }
-        /* End of innermost loop */
-
-        tx = ty = tz = 0;
-        f[i_coord_offset+DIM*0+XX] += fix0;
-        f[i_coord_offset+DIM*0+YY] += fiy0;
-        f[i_coord_offset+DIM*0+ZZ] += fiz0;
-        tx                         += fix0;
-        ty                         += fiy0;
-        tz                         += fiz0;
-        fshift[i_shift_offset+XX]  += tx;
-        fshift[i_shift_offset+YY]  += ty;
-        fshift[i_shift_offset+ZZ]  += tz;
-
-        dvda[inr]                   = dvda[inr] + dvdasum*isai0*isai0;
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 13 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_F,outeriter*13 + inneriter*64);
-}
diff --git a/src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecGB_VdwNone_GeomP1P1_c.c b/src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_ElecGB_VdwNone_GeomP1P1_c.c
deleted file mode 100644 (file)
index b803724..0000000
+++ /dev/null
@@ -1,459 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 2012,2013,2014.2015,2017, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
- * and including many others, as listed in the AUTHORS file in the
- * top-level source directory and at http://www.gromacs.org.
- *
- * GROMACS is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * GROMACS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GROMACS; if not, see
- * http://www.gnu.org/licenses, or write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
- *
- * If you want to redistribute modifications to GROMACS, please
- * consider that scientific software is very special. Version
- * control is crucial - bugs must be traceable. We will be happy to
- * consider code for inclusion in the official distribution, but
- * derived work must not be called official GROMACS. Details are found
- * in the README & COPYING files - if they are missing, get the
- * official version at http://www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the research papers on the package. Check out http://www.gromacs.org.
- */
-/*
- * Note: this file was generated by the GROMACS c kernel generator.
- */
-#include "gmxpre.h"
-
-#include "config.h"
-
-#include <math.h>
-
-#include "../nb_kernel.h"
-#include "gromacs/gmxlib/nrnb.h"
-
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_c
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            None
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        PotentialAndForce
- */
-void
-nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_c
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    int              i_shift_offset,i_coord_offset,j_coord_offset;
-    int              j_index_start,j_index_end;
-    int              nri,inr,ggid,iidx,jidx,jnr,outeriter,inneriter;
-    real             shX,shY,shZ,tx,ty,tz,fscal,rcutoff,rcutoff2;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             *shiftvec,*fshift,*x,*f;
-    int              vdwioffset0;
-    real             ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0;
-    real             jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    real             dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00,cexp1_00,cexp2_00;
-    real             velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    int              gbitab;
-    real             vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,dvdaj,gbeps,dvdatmp;
-    real             *invsqrta,*dvda,*gbtab;
-    int              vfitab;
-    real             rt,vfeps,vftabscale,Y,F,Geps,Heps2,Fp,VV,FF;
-    real             *vftab;
-
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = fr->ic->epsfac;
-    charge           = mdatoms->chargeA;
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = fr->gbtab->scale;
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = (1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent);
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-        shX              = shiftvec[i_shift_offset+XX];
-        shY              = shiftvec[i_shift_offset+YY];
-        shZ              = shiftvec[i_shift_offset+ZZ];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        ix0              = shX + x[i_coord_offset+DIM*0+XX];
-        iy0              = shY + x[i_coord_offset+DIM*0+YY];
-        iz0              = shZ + x[i_coord_offset+DIM*0+ZZ];
-
-        fix0             = 0.0;
-        fiy0             = 0.0;
-        fiz0             = 0.0;
-
-        /* Load parameters for i particles */
-        iq0              = facel*charge[inr+0];
-        isai0            = invsqrta[inr+0];
-
-        /* Reset potential sums */
-        velecsum         = 0.0;
-        vgbsum           = 0.0;
-        dvdasum          = 0.0;
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end; jidx++)
-        {
-            /* Get j neighbor index, and coordinate index */
-            jnr              = jjnr[jidx];
-            j_coord_offset   = DIM*jnr;
-
-            /* load j atom coordinates */
-            jx0              = x[j_coord_offset+DIM*0+XX];
-            jy0              = x[j_coord_offset+DIM*0+YY];
-            jz0              = x[j_coord_offset+DIM*0+ZZ];
-
-            /* Calculate displacement vector */
-            dx00             = ix0 - jx0;
-            dy00             = iy0 - jy0;
-            dz00             = iz0 - jz0;
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = dx00*dx00+dy00*dy00+dz00*dz00;
-
-            rinv00           = 1.0/sqrt(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = charge[jnr+0];
-            isaj0           = invsqrta[jnr+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = rsq00*rinv00;
-
-            qq00             = iq0*jq0;
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = isai0*isaj0;
-            gbqqfactor       = isaprod*(-qq00)*gbinvepsdiff;
-            gbscale          = isaprod*gbtabscale;
-            dvdaj            = dvda[jnr+0];
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = r00*gbscale;
-            gbitab           = rt;
-            gbeps            = rt-gbitab;
-            gbitab           = 4*gbitab;
-
-            Y                = gbtab[gbitab];
-            F                = gbtab[gbitab+1];
-            Geps             = gbeps*gbtab[gbitab+2];
-            Heps2            = gbeps*gbeps*gbtab[gbitab+3];
-            Fp               = F+Geps+Heps2;
-            VV               = Y+gbeps*Fp;
-            vgb              = gbqqfactor*VV;
-
-            FF               = Fp+Geps+2.0*Heps2;
-            fgb              = gbqqfactor*FF*gbscale;
-            dvdatmp          = -0.5*(vgb+fgb*r00);
-            dvdasum          = dvdasum + dvdatmp;
-            dvda[jnr]        = dvdaj+dvdatmp*isaj0*isaj0;
-            velec            = qq00*rinv00;
-            felec            = (velec*rinv00-fgb)*rinv00;
-
-            /* Update potential sums from outer loop */
-            velecsum        += velec;
-            vgbsum          += vgb;
-
-            fscal            = felec;
-
-            /* Calculate temporary vectorial force */
-            tx               = fscal*dx00;
-            ty               = fscal*dy00;
-            tz               = fscal*dz00;
-
-            /* Update vectorial force */
-            fix0            += tx;
-            fiy0            += ty;
-            fiz0            += tz;
-            f[j_coord_offset+DIM*0+XX] -= tx;
-            f[j_coord_offset+DIM*0+YY] -= ty;
-            f[j_coord_offset+DIM*0+ZZ] -= tz;
-
-            /* Inner loop uses 58 flops */
-        }
-        /* End of innermost loop */
-
-        tx = ty = tz = 0;
-        f[i_coord_offset+DIM*0+XX] += fix0;
-        f[i_coord_offset+DIM*0+YY] += fiy0;
-        f[i_coord_offset+DIM*0+ZZ] += fiz0;
-        tx                         += fix0;
-        ty                         += fiy0;
-        tz                         += fiz0;
-        fshift[i_shift_offset+XX]  += tx;
-        fshift[i_shift_offset+YY]  += ty;
-        fshift[i_shift_offset+ZZ]  += tz;
-
-        ggid                        = gid[iidx];
-        /* Update potential energies */
-        kernel_data->energygrp_elec[ggid] += velecsum;
-        kernel_data->energygrp_polarization[ggid] += vgbsum;
-        dvda[inr]                   = dvda[inr] + dvdasum*isai0*isai0;
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 15 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VF,outeriter*15 + inneriter*58);
-}
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwNone_GeomP1P1_F_c
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            None
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        Force
- */
-void
-nb_kernel_ElecGB_VdwNone_GeomP1P1_F_c
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    int              i_shift_offset,i_coord_offset,j_coord_offset;
-    int              j_index_start,j_index_end;
-    int              nri,inr,ggid,iidx,jidx,jnr,outeriter,inneriter;
-    real             shX,shY,shZ,tx,ty,tz,fscal,rcutoff,rcutoff2;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             *shiftvec,*fshift,*x,*f;
-    int              vdwioffset0;
-    real             ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0;
-    real             jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    real             dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00,cexp1_00,cexp2_00;
-    real             velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    int              gbitab;
-    real             vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,dvdaj,gbeps,dvdatmp;
-    real             *invsqrta,*dvda,*gbtab;
-    int              vfitab;
-    real             rt,vfeps,vftabscale,Y,F,Geps,Heps2,Fp,VV,FF;
-    real             *vftab;
-
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = fr->ic->epsfac;
-    charge           = mdatoms->chargeA;
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = fr->gbtab->scale;
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = (1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent);
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-        shX              = shiftvec[i_shift_offset+XX];
-        shY              = shiftvec[i_shift_offset+YY];
-        shZ              = shiftvec[i_shift_offset+ZZ];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        ix0              = shX + x[i_coord_offset+DIM*0+XX];
-        iy0              = shY + x[i_coord_offset+DIM*0+YY];
-        iz0              = shZ + x[i_coord_offset+DIM*0+ZZ];
-
-        fix0             = 0.0;
-        fiy0             = 0.0;
-        fiz0             = 0.0;
-
-        /* Load parameters for i particles */
-        iq0              = facel*charge[inr+0];
-        isai0            = invsqrta[inr+0];
-
-        dvdasum          = 0.0;
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end; jidx++)
-        {
-            /* Get j neighbor index, and coordinate index */
-            jnr              = jjnr[jidx];
-            j_coord_offset   = DIM*jnr;
-
-            /* load j atom coordinates */
-            jx0              = x[j_coord_offset+DIM*0+XX];
-            jy0              = x[j_coord_offset+DIM*0+YY];
-            jz0              = x[j_coord_offset+DIM*0+ZZ];
-
-            /* Calculate displacement vector */
-            dx00             = ix0 - jx0;
-            dy00             = iy0 - jy0;
-            dz00             = iz0 - jz0;
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = dx00*dx00+dy00*dy00+dz00*dz00;
-
-            rinv00           = 1.0/sqrt(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = charge[jnr+0];
-            isaj0           = invsqrta[jnr+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = rsq00*rinv00;
-
-            qq00             = iq0*jq0;
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = isai0*isaj0;
-            gbqqfactor       = isaprod*(-qq00)*gbinvepsdiff;
-            gbscale          = isaprod*gbtabscale;
-            dvdaj            = dvda[jnr+0];
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = r00*gbscale;
-            gbitab           = rt;
-            gbeps            = rt-gbitab;
-            gbitab           = 4*gbitab;
-
-            Y                = gbtab[gbitab];
-            F                = gbtab[gbitab+1];
-            Geps             = gbeps*gbtab[gbitab+2];
-            Heps2            = gbeps*gbeps*gbtab[gbitab+3];
-            Fp               = F+Geps+Heps2;
-            VV               = Y+gbeps*Fp;
-            vgb              = gbqqfactor*VV;
-
-            FF               = Fp+Geps+2.0*Heps2;
-            fgb              = gbqqfactor*FF*gbscale;
-            dvdatmp          = -0.5*(vgb+fgb*r00);
-            dvdasum          = dvdasum + dvdatmp;
-            dvda[jnr]        = dvdaj+dvdatmp*isaj0*isaj0;
-            velec            = qq00*rinv00;
-            felec            = (velec*rinv00-fgb)*rinv00;
-
-            fscal            = felec;
-
-            /* Calculate temporary vectorial force */
-            tx               = fscal*dx00;
-            ty               = fscal*dy00;
-            tz               = fscal*dz00;
-
-            /* Update vectorial force */
-            fix0            += tx;
-            fiy0            += ty;
-            fiz0            += tz;
-            f[j_coord_offset+DIM*0+XX] -= tx;
-            f[j_coord_offset+DIM*0+YY] -= ty;
-            f[j_coord_offset+DIM*0+ZZ] -= tz;
-
-            /* Inner loop uses 56 flops */
-        }
-        /* End of innermost loop */
-
-        tx = ty = tz = 0;
-        f[i_coord_offset+DIM*0+XX] += fix0;
-        f[i_coord_offset+DIM*0+YY] += fiy0;
-        f[i_coord_offset+DIM*0+ZZ] += fiz0;
-        tx                         += fix0;
-        ty                         += fiy0;
-        tz                         += fiz0;
-        fshift[i_shift_offset+XX]  += tx;
-        fshift[i_shift_offset+YY]  += ty;
-        fshift[i_shift_offset+ZZ]  += tz;
-
-        dvda[inr]                   = dvda[inr] + dvdasum*isai0*isai0;
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 13 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_F,outeriter*13 + inneriter*56);
-}
similarity index 98%
rename from src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_allvsall.c
rename to src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_allvsall.cpp
index 71ea2135a8d97b9b8fe826f49795b41d1b893b0e..45ba18b20dff014a9000932b558a4ce4e428e8f4 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2009, The GROMACS Development Team.
- * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -116,7 +116,6 @@ setup_exclusions_and_indices(gmx_allvsall_data_t *   aadata,
     int nj0, nj1;
     int max_offset;
     int max_excl_offset;
-    int nj;
 
     /* This routine can appear to be a bit complex, but it is mostly book-keeping.
      * To enable the fast all-vs-all kernel we need to be able to stream through all coordinates
@@ -280,7 +279,7 @@ nb_kernel_allvsall(t_nblist gmx_unused *     nlist,
     natoms              = mdatoms->nr;
     ni0                 = 0;
     ni1                 = mdatoms->homenr;
-    aadata              = fr->AllvsAll_work;
+    aadata              = reinterpret_cast<gmx_allvsall_data_t *>(fr->AllvsAll_work);
     excl                = kernel_data->exclusions;
 
     Vc                  = kernel_data->energygrp_elec;
index c42bcde81cf1c9b7f3c1ed95837f704514053369..b52347f1a27db412bc87d4426979d25a532d6336 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #include "gromacs/mdtypes/mdatom.h"
 #include "gromacs/mdtypes/nblist.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 void
 nb_kernel_allvsall(t_nblist *                nlist,
                    rvec *                    x,
@@ -56,8 +52,4 @@ nb_kernel_allvsall(t_nblist *                nlist,
                    nb_kernel_data_t *        kernel_data,
                    t_nrnb *                  nrnb);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif
diff --git a/src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_allvsallgb.c b/src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_allvsallgb.c
deleted file mode 100644 (file)
index c1a2714..0000000
+++ /dev/null
@@ -1,528 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2009, The GROMACS Development Team.
- * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
- * and including many others, as listed in the AUTHORS file in the
- * top-level source directory and at http://www.gromacs.org.
- *
- * GROMACS is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * GROMACS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GROMACS; if not, see
- * http://www.gnu.org/licenses, or write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
- *
- * If you want to redistribute modifications to GROMACS, please
- * consider that scientific software is very special. Version
- * control is crucial - bugs must be traceable. We will be happy to
- * consider code for inclusion in the official distribution, but
- * derived work must not be called official GROMACS. Details are found
- * in the README & COPYING files - if they are missing, get the
- * official version at http://www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the research papers on the package. Check out http://www.gromacs.org.
- */
-#include "gmxpre.h"
-
-#include "nb_kernel_allvsallgb.h"
-
-#include "config.h"
-
-#include <math.h>
-
-#include "gromacs/gmxlib/nrnb.h"
-#include "gromacs/utility/real.h"
-#include "gromacs/utility/smalloc.h"
-
-typedef struct
-{
-    real **    pvdwparam;
-    int *      jindex;
-    int **     exclusion_mask;
-}
-gmx_allvsall_data_t;
-
-static int
-calc_maxoffset(int i, int natoms)
-{
-    int maxoffset;
-
-    if ((natoms % 2) == 1)
-    {
-        /* Odd number of atoms, easy */
-        maxoffset = natoms/2;
-    }
-    else if ((natoms % 4) == 0)
-    {
-        /* Multiple of four is hard */
-        if (i < natoms/2)
-        {
-            if ((i % 2) == 0)
-            {
-                maxoffset = natoms/2;
-            }
-            else
-            {
-                maxoffset = natoms/2-1;
-            }
-        }
-        else
-        {
-            if ((i % 2) == 1)
-            {
-                maxoffset = natoms/2;
-            }
-            else
-            {
-                maxoffset = natoms/2-1;
-            }
-        }
-    }
-    else
-    {
-        /* natoms/2 = odd */
-        if ((i % 2) == 0)
-        {
-            maxoffset = natoms/2;
-        }
-        else
-        {
-            maxoffset = natoms/2-1;
-        }
-    }
-
-    return maxoffset;
-}
-
-
-static void
-setup_exclusions_and_indices(gmx_allvsall_data_t *   aadata,
-                             t_blocka *              excl,
-                             int                     natoms)
-{
-    int i, j, k;
-    int nj0, nj1;
-    int max_offset;
-    int max_excl_offset;
-    int iexcl;
-    int nj;
-
-    /* This routine can appear to be a bit complex, but it is mostly book-keeping.
-     * To enable the fast all-vs-all kernel we need to be able to stream through all coordinates
-     * whether they should interact or not.
-     *
-     * To avoid looping over the exclusions, we create a simple mask that is 1 if the interaction
-     * should be present, otherwise 0. Since exclusions typically only occur when i & j are close,
-     * we create a jindex array with three elements per i atom: the starting point, the point to
-     * which we need to check exclusions, and the end point.
-     * This way we only have to allocate a short exclusion mask per i atom.
-     */
-
-    /* Allocate memory for our modified jindex array */
-    snew(aadata->jindex, 3*natoms);
-
-    /* Pointer to lists with exclusion masks */
-    snew(aadata->exclusion_mask, natoms);
-
-    for (i = 0; i < natoms; i++)
-    {
-        /* Start */
-        aadata->jindex[3*i]   = i+1;
-        max_offset            = calc_maxoffset(i, natoms);
-
-        /* Exclusions */
-        nj0   = excl->index[i];
-        nj1   = excl->index[i+1];
-
-        /* first check the max range */
-        max_excl_offset = -1;
-
-        for (j = nj0; j < nj1; j++)
-        {
-            iexcl = excl->a[j];
-
-            k = iexcl - i;
-
-            if (k+natoms <= max_offset)
-            {
-                k += natoms;
-            }
-
-            max_excl_offset = (k > max_excl_offset) ? k : max_excl_offset;
-        }
-
-        max_excl_offset = (max_offset < max_excl_offset) ? max_offset : max_excl_offset;
-
-        aadata->jindex[3*i+1] = i+1+max_excl_offset;
-
-        snew(aadata->exclusion_mask[i], max_excl_offset);
-        /* Include everything by default */
-        for (j = 0; j < max_excl_offset; j++)
-        {
-            /* Use all-ones to mark interactions that should be present, compatible with SSE */
-            aadata->exclusion_mask[i][j] = 0xFFFFFFFF;
-        }
-
-        /* Go through exclusions again */
-        for (j = nj0; j < nj1; j++)
-        {
-            iexcl = excl->a[j];
-
-            k = iexcl - i;
-
-            if (k+natoms <= max_offset)
-            {
-                k += natoms;
-            }
-
-            if (k > 0 && k <= max_excl_offset)
-            {
-                /* Excluded, kill it! */
-                aadata->exclusion_mask[i][k-1] = 0;
-            }
-        }
-
-        /* End */
-        aadata->jindex[3*i+2] = i+1+max_offset;
-    }
-}
-
-
-static void
-setup_aadata(gmx_allvsall_data_t **  p_aadata,
-             t_blocka *              excl,
-             int                     natoms,
-             int *                   type,
-             int                     ntype,
-             real *                  pvdwparam)
-{
-    int                  i, j, idx;
-    gmx_allvsall_data_t *aadata;
-    real                *p;
-
-    snew(aadata, 1);
-    *p_aadata = aadata;
-
-    /* Generate vdw params */
-    snew(aadata->pvdwparam, ntype);
-
-    for (i = 0; i < ntype; i++)
-    {
-        snew(aadata->pvdwparam[i], 2*natoms);
-        p = aadata->pvdwparam[i];
-
-        /* Lets keep it simple and use multiple steps - first create temp. c6/c12 arrays */
-        for (j = 0; j < natoms; j++)
-        {
-            idx             = i*ntype+type[j];
-            p[2*j]          = pvdwparam[2*idx];
-            p[2*j+1]        = pvdwparam[2*idx+1];
-        }
-    }
-
-    setup_exclusions_and_indices(aadata, excl, natoms);
-}
-
-
-
-void
-nb_kernel_allvsallgb(t_nblist gmx_unused *     nlist,
-                     rvec *                    xx,
-                     rvec *                    ff,
-                     struct t_forcerec *       fr,
-                     t_mdatoms *               mdatoms,
-                     nb_kernel_data_t *        kernel_data,
-                     t_nrnb *                  nrnb)
-{
-    gmx_allvsall_data_t *aadata;
-    int                  natoms;
-    int                  ni0, ni1;
-    int                  nj0, nj1, nj2;
-    int                  i, j, k;
-    real           *     charge;
-    int           *      type;
-    real                 facel;
-    real           *     pvdw;
-    int                  ggid;
-    int           *      mask;
-    real           *     GBtab;
-    real                 gbfactor;
-    real           *     invsqrta;
-    real           *     dvda;
-    real                 vgbtot, dvdasum;
-    int                  nnn, n0;
-
-    real                 ix, iy, iz, iq;
-    real                 fix, fiy, fiz;
-    real                 jx, jy, jz, qq;
-    real                 dx, dy, dz;
-    real                 tx, ty, tz;
-    real                 rsq, rinv, rinvsq, rinvsix;
-    real                 vcoul, vctot;
-    real                 c6, c12, Vvdw6, Vvdw12, Vvdwtot;
-    real                 fscal, dvdatmp, fijC, vgb;
-    real                 Y, F, Fp, Geps, Heps2, VV, FF, eps, eps2, r, rt;
-    real                 dvdaj, gbscale, isaprod, isai, isaj, gbtabscale;
-    real           *     f;
-    real           *     x;
-    t_blocka           * excl;
-    real           *     Vvdw;
-    real           *     Vc;
-    real           *     vpol;
-
-    x                   = xx[0];
-    f                   = ff[0];
-    charge              = mdatoms->chargeA;
-    type                = mdatoms->typeA;
-    gbfactor            = ((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-    facel               = fr->ic->epsfac;
-    GBtab               = fr->gbtab->data;
-    gbtabscale          = fr->gbtab->scale;
-    invsqrta            = fr->invsqrta;
-    dvda                = fr->dvda;
-    vpol                = kernel_data->energygrp_polarization;
-
-    natoms              = mdatoms->nr;
-    ni0                 = 0;
-    ni1                 = mdatoms->homenr;
-
-    aadata              = fr->AllvsAll_work;
-    excl                = kernel_data->exclusions;
-
-    Vc                  = kernel_data->energygrp_elec;
-    Vvdw                = kernel_data->energygrp_vdw;
-
-    if (aadata == NULL)
-    {
-        setup_aadata(&aadata, excl, natoms, type, fr->ntype, fr->nbfp);
-        fr->AllvsAll_work  = aadata;
-    }
-
-    for (i = ni0; i < ni1; i++)
-    {
-        /* We assume shifts are NOT used for all-vs-all interactions */
-
-        /* Load i atom data */
-        ix                = x[3*i];
-        iy                = x[3*i+1];
-        iz                = x[3*i+2];
-        iq                = facel*charge[i];
-
-        isai              = invsqrta[i];
-
-        pvdw              = aadata->pvdwparam[type[i]];
-
-        /* Zero the potential energy for this list */
-        Vvdwtot           = 0.0;
-        vctot             = 0.0;
-        vgbtot            = 0.0;
-        dvdasum           = 0.0;
-
-        /* Clear i atom forces */
-        fix               = 0.0;
-        fiy               = 0.0;
-        fiz               = 0.0;
-
-        /* Load limits for loop over neighbors */
-        nj0              = aadata->jindex[3*i];
-        nj1              = aadata->jindex[3*i+1];
-        nj2              = aadata->jindex[3*i+2];
-
-        mask             = aadata->exclusion_mask[i];
-
-        /* Prologue part, including exclusion mask */
-        for (j = nj0; j < nj1; j++, mask++)
-        {
-            if (*mask != 0)
-            {
-                k = j%natoms;
-
-                /* load j atom coordinates */
-                jx                = x[3*k];
-                jy                = x[3*k+1];
-                jz                = x[3*k+2];
-
-                /* Calculate distance */
-                dx                = ix - jx;
-                dy                = iy - jy;
-                dz                = iz - jz;
-                rsq               = dx*dx+dy*dy+dz*dz;
-
-                /* Calculate 1/r and 1/r2 */
-                rinv             = 1.0/sqrt(rsq);
-
-                /* Load parameters for j atom */
-                isaj              = invsqrta[k];
-                isaprod           = isai*isaj;
-                qq                = iq*charge[k];
-                vcoul             = qq*rinv;
-                fscal             = vcoul*rinv;
-                qq                = isaprod*(-qq)*gbfactor;
-                gbscale           = isaprod*gbtabscale;
-                c6                = pvdw[2*k];
-                c12               = pvdw[2*k+1];
-                rinvsq            = rinv*rinv;
-
-                /* Tabulated Generalized-Born interaction */
-                dvdaj            = dvda[k];
-                r                = rsq*rinv;
-
-                /* Calculate table index */
-                rt               = r*gbscale;
-                n0               = rt;
-                eps              = rt-n0;
-                eps2             = eps*eps;
-                nnn              = 4*n0;
-                Y                = GBtab[nnn];
-                F                = GBtab[nnn+1];
-                Geps             = eps*GBtab[nnn+2];
-                Heps2            = eps2*GBtab[nnn+3];
-                Fp               = F+Geps+Heps2;
-                VV               = Y+eps*Fp;
-                FF               = Fp+Geps+2.0*Heps2;
-                vgb              = qq*VV;
-                fijC             = qq*FF*gbscale;
-                dvdatmp          = -0.5*(vgb+fijC*r);
-                dvdasum          = dvdasum + dvdatmp;
-                dvda[k]          = dvdaj+dvdatmp*isaj*isaj;
-                vctot            = vctot + vcoul;
-                vgbtot           = vgbtot + vgb;
-
-                /* Lennard-Jones interaction */
-                rinvsix          = rinvsq*rinvsq*rinvsq;
-                Vvdw6            = c6*rinvsix;
-                Vvdw12           = c12*rinvsix*rinvsix;
-                Vvdwtot          = Vvdwtot+Vvdw12-Vvdw6;
-                fscal            = (12.0*Vvdw12-6.0*Vvdw6)*rinvsq-(fijC-fscal)*rinv;
-
-                /* Calculate temporary vectorial force */
-                tx                = fscal*dx;
-                ty                = fscal*dy;
-                tz                = fscal*dz;
-
-                /* Increment i atom force */
-                fix               = fix + tx;
-                fiy               = fiy + ty;
-                fiz               = fiz + tz;
-
-                /* Decrement j atom force */
-                f[3*k]            = f[3*k]   - tx;
-                f[3*k+1]          = f[3*k+1] - ty;
-                f[3*k+2]          = f[3*k+2] - tz;
-            }
-            /* Inner loop uses 38 flops/iteration */
-        }
-
-        /* Main part, no exclusions */
-        for (j = nj1; j < nj2; j++)
-        {
-            k = j%natoms;
-
-            /* load j atom coordinates */
-            jx                = x[3*k];
-            jy                = x[3*k+1];
-            jz                = x[3*k+2];
-
-            /* Calculate distance */
-            dx                = ix - jx;
-            dy                = iy - jy;
-            dz                = iz - jz;
-            rsq               = dx*dx+dy*dy+dz*dz;
-
-            /* Calculate 1/r and 1/r2 */
-            rinv             = 1.0/sqrt(rsq);
-
-            /* Load parameters for j atom */
-            isaj              = invsqrta[k];
-            isaprod           = isai*isaj;
-            qq                = iq*charge[k];
-            vcoul             = qq*rinv;
-            fscal             = vcoul*rinv;
-            qq                = isaprod*(-qq)*gbfactor;
-            gbscale           = isaprod*gbtabscale;
-            c6                = pvdw[2*k];
-            c12               = pvdw[2*k+1];
-            rinvsq            = rinv*rinv;
-
-            /* Tabulated Generalized-Born interaction */
-            dvdaj            = dvda[k];
-            r                = rsq*rinv;
-
-            /* Calculate table index */
-            rt               = r*gbscale;
-            n0               = rt;
-            eps              = rt-n0;
-            eps2             = eps*eps;
-            nnn              = 4*n0;
-            Y                = GBtab[nnn];
-            F                = GBtab[nnn+1];
-            Geps             = eps*GBtab[nnn+2];
-            Heps2            = eps2*GBtab[nnn+3];
-            Fp               = F+Geps+Heps2;
-            VV               = Y+eps*Fp;
-            FF               = Fp+Geps+2.0*Heps2;
-            vgb              = qq*VV;
-            fijC             = qq*FF*gbscale;
-            dvdatmp          = -0.5*(vgb+fijC*r);
-            dvdasum          = dvdasum + dvdatmp;
-            dvda[k]          = dvdaj+dvdatmp*isaj*isaj;
-            vctot            = vctot + vcoul;
-            vgbtot           = vgbtot + vgb;
-
-            /* Lennard-Jones interaction */
-            rinvsix          = rinvsq*rinvsq*rinvsq;
-            Vvdw6            = c6*rinvsix;
-            Vvdw12           = c12*rinvsix*rinvsix;
-            Vvdwtot          = Vvdwtot+Vvdw12-Vvdw6;
-            fscal            = (12.0*Vvdw12-6.0*Vvdw6)*rinvsq-(fijC-fscal)*rinv;
-
-            /* Calculate temporary vectorial force */
-            tx                = fscal*dx;
-            ty                = fscal*dy;
-            tz                = fscal*dz;
-
-            /* Increment i atom force */
-            fix               = fix + tx;
-            fiy               = fiy + ty;
-            fiz               = fiz + tz;
-
-            /* Decrement j atom force */
-            f[3*k]            = f[3*k]   - tx;
-            f[3*k+1]          = f[3*k+1] - ty;
-            f[3*k+2]          = f[3*k+2] - tz;
-
-            /* Inner loop uses 38 flops/iteration */
-        }
-
-        f[3*i]   += fix;
-        f[3*i+1] += fiy;
-        f[3*i+2] += fiz;
-
-        /* Add potential energies to the group for this list */
-        ggid             = 0;
-
-        Vc[ggid]         = Vc[ggid] + vctot;
-        Vvdw[ggid]       = Vvdw[ggid] + Vvdwtot;
-        vpol[ggid]       = vpol[ggid] + vgbtot;
-        dvda[i]          = dvda[i] + dvdasum*isai*isai;
-
-        /* Outer loop uses 6 flops/iteration */
-    }
-
-    /* 12 flops per outer iteration
-     * 19 flops per inner iteration
-     */
-    inc_nrnb(nrnb, eNR_NBKERNEL_ELEC_VDW_VF, (ni1-ni0)*12 + ((ni1-ni0)*natoms/2)*19);
-}
diff --git a/src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_allvsallgb.h b/src/gromacs/gmxlib/nonbonded/nb_kernel_c/nb_kernel_allvsallgb.h
deleted file mode 100644 (file)
index c50c3ae..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 2012,2014,2015,2017, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
- * and including many others, as listed in the AUTHORS file in the
- * top-level source directory and at http://www.gromacs.org.
- *
- * GROMACS is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * GROMACS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GROMACS; if not, see
- * http://www.gnu.org/licenses, or write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
- *
- * If you want to redistribute modifications to GROMACS, please
- * consider that scientific software is very special. Version
- * control is crucial - bugs must be traceable. We will be happy to
- * consider code for inclusion in the official distribution, but
- * derived work must not be called official GROMACS. Details are found
- * in the README & COPYING files - if they are missing, get the
- * official version at http://www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the research papers on the package. Check out http://www.gromacs.org.
- */
-#ifndef _NB_KERNEL_ALLVSALLGB_H
-#define _NB_KERNEL_ALLVSALLGB_H
-
-#include "config.h"
-
-#include "gromacs/gmxlib/nrnb.h"
-#include "gromacs/gmxlib/nonbonded/nb_kernel.h"
-#include "gromacs/math/vectypes.h"
-#include "gromacs/mdtypes/mdatom.h"
-#include "gromacs/mdtypes/nblist.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void
-nb_kernel_allvsallgb(t_nblist *                nlist,
-                     rvec *                    x,
-                     rvec *                    f,
-                     struct t_forcerec *       fr,
-                     t_mdatoms *               mdatoms,
-                     nb_kernel_data_t *        kernel_data,
-                     t_nrnb *                  nrnb);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
index 11c173e2a97eab0f24aafb5f53ac566d9bf3fa71..250ee29c48e072f8d746f50a077dbf282cf16cda 100644 (file)
@@ -57,6 +57,46 @@ nb_kernel_t nb_kernel_ElecNone_VdwBhamSh_GeomP1P1_VF_c;
 nb_kernel_t nb_kernel_ElecNone_VdwBhamSh_GeomP1P1_F_c;
 nb_kernel_t nb_kernel_ElecNone_VdwBhamSw_GeomP1P1_VF_c;
 nb_kernel_t nb_kernel_ElecNone_VdwBhamSw_GeomP1P1_F_c;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_c;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_c;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_c;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_c;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_c;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_c;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_c;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_c;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_c;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_c;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_c;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_c;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_c;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_c;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_c;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_c;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_c;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_c;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_c;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_c;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_c;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_c;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_c;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_c;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_c;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_c;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_c;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_c;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_c;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_c;
+nb_kernel_t nb_kernel_ElecCSTab_VdwBham_GeomP1P1_VF_c;
+nb_kernel_t nb_kernel_ElecCSTab_VdwBham_GeomP1P1_F_c;
+nb_kernel_t nb_kernel_ElecCSTab_VdwBham_GeomW3P1_VF_c;
+nb_kernel_t nb_kernel_ElecCSTab_VdwBham_GeomW3P1_F_c;
+nb_kernel_t nb_kernel_ElecCSTab_VdwBham_GeomW3W3_VF_c;
+nb_kernel_t nb_kernel_ElecCSTab_VdwBham_GeomW3W3_F_c;
+nb_kernel_t nb_kernel_ElecCSTab_VdwBham_GeomW4P1_VF_c;
+nb_kernel_t nb_kernel_ElecCSTab_VdwBham_GeomW4P1_F_c;
+nb_kernel_t nb_kernel_ElecCSTab_VdwBham_GeomW4W4_VF_c;
+nb_kernel_t nb_kernel_ElecCSTab_VdwBham_GeomW4W4_F_c;
 nb_kernel_t nb_kernel_ElecEw_VdwLJEw_GeomP1P1_VF_c;
 nb_kernel_t nb_kernel_ElecEw_VdwLJEw_GeomP1P1_F_c;
 nb_kernel_t nb_kernel_ElecEw_VdwLJEw_GeomW3P1_VF_c;
@@ -177,94 +217,6 @@ nb_kernel_t nb_kernel_ElecEwSw_VdwBhamSw_GeomW4P1_VF_c;
 nb_kernel_t nb_kernel_ElecEwSw_VdwBhamSw_GeomW4P1_F_c;
 nb_kernel_t nb_kernel_ElecEwSw_VdwBhamSw_GeomW4W4_VF_c;
 nb_kernel_t nb_kernel_ElecEwSw_VdwBhamSw_GeomW4W4_F_c;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_c;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_c;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_c;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_c;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_c;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_c;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_c;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_c;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_c;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_c;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_c;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_c;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_c;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_c;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_c;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_c;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_c;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_c;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_c;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_c;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_c;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_c;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_c;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_c;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_c;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_c;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_c;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_c;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_c;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_c;
-nb_kernel_t nb_kernel_ElecCoul_VdwBham_GeomP1P1_VF_c;
-nb_kernel_t nb_kernel_ElecCoul_VdwBham_GeomP1P1_F_c;
-nb_kernel_t nb_kernel_ElecCoul_VdwBham_GeomW3P1_VF_c;
-nb_kernel_t nb_kernel_ElecCoul_VdwBham_GeomW3P1_F_c;
-nb_kernel_t nb_kernel_ElecCoul_VdwBham_GeomW3W3_VF_c;
-nb_kernel_t nb_kernel_ElecCoul_VdwBham_GeomW3W3_F_c;
-nb_kernel_t nb_kernel_ElecCoul_VdwBham_GeomW4P1_VF_c;
-nb_kernel_t nb_kernel_ElecCoul_VdwBham_GeomW4P1_F_c;
-nb_kernel_t nb_kernel_ElecCoul_VdwBham_GeomW4W4_VF_c;
-nb_kernel_t nb_kernel_ElecCoul_VdwBham_GeomW4W4_F_c;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_c;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_c;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_c;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_c;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_c;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_c;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_c;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_c;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_c;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_c;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_c;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_c;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_c;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_c;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_c;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_c;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_c;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_c;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_c;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_c;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_c;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_c;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_c;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_c;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_c;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_c;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_c;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_c;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_c;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_c;
-nb_kernel_t nb_kernel_ElecCSTab_VdwBham_GeomP1P1_VF_c;
-nb_kernel_t nb_kernel_ElecCSTab_VdwBham_GeomP1P1_F_c;
-nb_kernel_t nb_kernel_ElecCSTab_VdwBham_GeomW3P1_VF_c;
-nb_kernel_t nb_kernel_ElecCSTab_VdwBham_GeomW3P1_F_c;
-nb_kernel_t nb_kernel_ElecCSTab_VdwBham_GeomW3W3_VF_c;
-nb_kernel_t nb_kernel_ElecCSTab_VdwBham_GeomW3W3_F_c;
-nb_kernel_t nb_kernel_ElecCSTab_VdwBham_GeomW4P1_VF_c;
-nb_kernel_t nb_kernel_ElecCSTab_VdwBham_GeomW4P1_F_c;
-nb_kernel_t nb_kernel_ElecCSTab_VdwBham_GeomW4W4_VF_c;
-nb_kernel_t nb_kernel_ElecCSTab_VdwBham_GeomW4W4_F_c;
-nb_kernel_t nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_c;
-nb_kernel_t nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_c;
-nb_kernel_t nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_c;
-nb_kernel_t nb_kernel_ElecGB_VdwNone_GeomP1P1_F_c;
-nb_kernel_t nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_c;
-nb_kernel_t nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_c;
-nb_kernel_t nb_kernel_ElecGB_VdwBham_GeomP1P1_VF_c;
-nb_kernel_t nb_kernel_ElecGB_VdwBham_GeomP1P1_F_c;
 nb_kernel_t nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_VF_c;
 nb_kernel_t nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_F_c;
 nb_kernel_t nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_VF_c;
@@ -365,6 +317,46 @@ nb_kernel_t nb_kernel_ElecRF_VdwBham_GeomW4P1_VF_c;
 nb_kernel_t nb_kernel_ElecRF_VdwBham_GeomW4P1_F_c;
 nb_kernel_t nb_kernel_ElecRF_VdwBham_GeomW4W4_VF_c;
 nb_kernel_t nb_kernel_ElecRF_VdwBham_GeomW4W4_F_c;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_c;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_c;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_c;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_c;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_c;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_c;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_c;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_c;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_c;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_c;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_c;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_c;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_c;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_c;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_c;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_c;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_c;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_c;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_c;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_c;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_c;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_c;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_c;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_c;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_c;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_c;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_c;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_c;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_c;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_c;
+nb_kernel_t nb_kernel_ElecCoul_VdwBham_GeomP1P1_VF_c;
+nb_kernel_t nb_kernel_ElecCoul_VdwBham_GeomP1P1_F_c;
+nb_kernel_t nb_kernel_ElecCoul_VdwBham_GeomW3P1_VF_c;
+nb_kernel_t nb_kernel_ElecCoul_VdwBham_GeomW3P1_F_c;
+nb_kernel_t nb_kernel_ElecCoul_VdwBham_GeomW3W3_VF_c;
+nb_kernel_t nb_kernel_ElecCoul_VdwBham_GeomW3W3_F_c;
+nb_kernel_t nb_kernel_ElecCoul_VdwBham_GeomW4P1_VF_c;
+nb_kernel_t nb_kernel_ElecCoul_VdwBham_GeomW4P1_F_c;
+nb_kernel_t nb_kernel_ElecCoul_VdwBham_GeomW4W4_VF_c;
+nb_kernel_t nb_kernel_ElecCoul_VdwBham_GeomW4W4_F_c;
 
 
 nb_kernel_info_t
@@ -388,6 +380,46 @@ nb_kernel_info_t
     { nb_kernel_ElecNone_VdwBhamSh_GeomP1P1_F_c, "nb_kernel_ElecNone_VdwBhamSh_GeomP1P1_F_c", "c", "None", "None", "Buckingham", "PotentialShift", "ParticleParticle", "", "Force" },
     { nb_kernel_ElecNone_VdwBhamSw_GeomP1P1_VF_c, "nb_kernel_ElecNone_VdwBhamSw_GeomP1P1_VF_c", "c", "None", "None", "Buckingham", "PotentialSwitch", "ParticleParticle", "", "PotentialAndForce" },
     { nb_kernel_ElecNone_VdwBhamSw_GeomP1P1_F_c, "nb_kernel_ElecNone_VdwBhamSw_GeomP1P1_F_c", "c", "None", "None", "Buckingham", "PotentialSwitch", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_c, "nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_c", "c", "CubicSplineTable", "None", "LennardJones", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_c, "nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_c", "c", "CubicSplineTable", "None", "LennardJones", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_c, "nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_c", "c", "CubicSplineTable", "None", "LennardJones", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_c, "nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_c", "c", "CubicSplineTable", "None", "LennardJones", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_c, "nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_c", "c", "CubicSplineTable", "None", "LennardJones", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_c, "nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_c", "c", "CubicSplineTable", "None", "LennardJones", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_c, "nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_c", "c", "CubicSplineTable", "None", "LennardJones", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_c, "nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_c", "c", "CubicSplineTable", "None", "LennardJones", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_c, "nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_c", "c", "CubicSplineTable", "None", "LennardJones", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_c, "nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_c", "c", "CubicSplineTable", "None", "LennardJones", "None", "Water4Water4", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_c, "nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_c", "c", "CubicSplineTable", "None", "None", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_c, "nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_c", "c", "CubicSplineTable", "None", "None", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_c, "nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_c", "c", "CubicSplineTable", "None", "None", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_c, "nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_c", "c", "CubicSplineTable", "None", "None", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_c, "nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_c", "c", "CubicSplineTable", "None", "None", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_c, "nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_c", "c", "CubicSplineTable", "None", "None", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_c, "nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_c", "c", "CubicSplineTable", "None", "None", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_c, "nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_c", "c", "CubicSplineTable", "None", "None", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_c, "nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_c", "c", "CubicSplineTable", "None", "None", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_c, "nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_c", "c", "CubicSplineTable", "None", "None", "None", "Water4Water4", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_c, "nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_c", "c", "CubicSplineTable", "None", "CubicSplineTable", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_c, "nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_c", "c", "CubicSplineTable", "None", "CubicSplineTable", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_c, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_c", "c", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_c, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_c", "c", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_c, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_c", "c", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_c, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_c", "c", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_c, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_c", "c", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_c, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_c", "c", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_c, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_c", "c", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_c, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_c", "c", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Water4", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwBham_GeomP1P1_VF_c, "nb_kernel_ElecCSTab_VdwBham_GeomP1P1_VF_c", "c", "CubicSplineTable", "None", "Buckingham", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwBham_GeomP1P1_F_c, "nb_kernel_ElecCSTab_VdwBham_GeomP1P1_F_c", "c", "CubicSplineTable", "None", "Buckingham", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwBham_GeomW3P1_VF_c, "nb_kernel_ElecCSTab_VdwBham_GeomW3P1_VF_c", "c", "CubicSplineTable", "None", "Buckingham", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwBham_GeomW3P1_F_c, "nb_kernel_ElecCSTab_VdwBham_GeomW3P1_F_c", "c", "CubicSplineTable", "None", "Buckingham", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwBham_GeomW3W3_VF_c, "nb_kernel_ElecCSTab_VdwBham_GeomW3W3_VF_c", "c", "CubicSplineTable", "None", "Buckingham", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwBham_GeomW3W3_F_c, "nb_kernel_ElecCSTab_VdwBham_GeomW3W3_F_c", "c", "CubicSplineTable", "None", "Buckingham", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwBham_GeomW4P1_VF_c, "nb_kernel_ElecCSTab_VdwBham_GeomW4P1_VF_c", "c", "CubicSplineTable", "None", "Buckingham", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwBham_GeomW4P1_F_c, "nb_kernel_ElecCSTab_VdwBham_GeomW4P1_F_c", "c", "CubicSplineTable", "None", "Buckingham", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwBham_GeomW4W4_VF_c, "nb_kernel_ElecCSTab_VdwBham_GeomW4W4_VF_c", "c", "CubicSplineTable", "None", "Buckingham", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwBham_GeomW4W4_F_c, "nb_kernel_ElecCSTab_VdwBham_GeomW4W4_F_c", "c", "CubicSplineTable", "None", "Buckingham", "None", "Water4Water4", "", "Force" },
     { nb_kernel_ElecEw_VdwLJEw_GeomP1P1_VF_c, "nb_kernel_ElecEw_VdwLJEw_GeomP1P1_VF_c", "c", "Ewald", "None", "LJEwald", "None", "ParticleParticle", "", "PotentialAndForce" },
     { nb_kernel_ElecEw_VdwLJEw_GeomP1P1_F_c, "nb_kernel_ElecEw_VdwLJEw_GeomP1P1_F_c", "c", "Ewald", "None", "LJEwald", "None", "ParticleParticle", "", "Force" },
     { nb_kernel_ElecEw_VdwLJEw_GeomW3P1_VF_c, "nb_kernel_ElecEw_VdwLJEw_GeomW3P1_VF_c", "c", "Ewald", "None", "LJEwald", "None", "Water3Particle", "", "PotentialAndForce" },
@@ -508,94 +540,6 @@ nb_kernel_info_t
     { nb_kernel_ElecEwSw_VdwBhamSw_GeomW4P1_F_c, "nb_kernel_ElecEwSw_VdwBhamSw_GeomW4P1_F_c", "c", "Ewald", "PotentialSwitch", "Buckingham", "PotentialSwitch", "Water4Particle", "", "Force" },
     { nb_kernel_ElecEwSw_VdwBhamSw_GeomW4W4_VF_c, "nb_kernel_ElecEwSw_VdwBhamSw_GeomW4W4_VF_c", "c", "Ewald", "PotentialSwitch", "Buckingham", "PotentialSwitch", "Water4Water4", "", "PotentialAndForce" },
     { nb_kernel_ElecEwSw_VdwBhamSw_GeomW4W4_F_c, "nb_kernel_ElecEwSw_VdwBhamSw_GeomW4W4_F_c", "c", "Ewald", "PotentialSwitch", "Buckingham", "PotentialSwitch", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_c, "nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_c", "c", "Coulomb", "None", "LennardJones", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_c, "nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_c", "c", "Coulomb", "None", "LennardJones", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_c, "nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_c", "c", "Coulomb", "None", "LennardJones", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_c, "nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_c", "c", "Coulomb", "None", "LennardJones", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_c, "nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_c", "c", "Coulomb", "None", "LennardJones", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_c, "nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_c", "c", "Coulomb", "None", "LennardJones", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_c, "nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_c", "c", "Coulomb", "None", "LennardJones", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_c, "nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_c", "c", "Coulomb", "None", "LennardJones", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_c, "nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_c", "c", "Coulomb", "None", "LennardJones", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_c, "nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_c", "c", "Coulomb", "None", "LennardJones", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_c, "nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_c", "c", "Coulomb", "None", "None", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_c, "nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_c", "c", "Coulomb", "None", "None", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_c, "nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_c", "c", "Coulomb", "None", "None", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_c, "nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_c", "c", "Coulomb", "None", "None", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_c, "nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_c", "c", "Coulomb", "None", "None", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_c, "nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_c", "c", "Coulomb", "None", "None", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_c, "nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_c", "c", "Coulomb", "None", "None", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_c, "nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_c", "c", "Coulomb", "None", "None", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_c, "nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_c", "c", "Coulomb", "None", "None", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_c, "nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_c", "c", "Coulomb", "None", "None", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_c, "nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_c", "c", "Coulomb", "None", "CubicSplineTable", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_c, "nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_c", "c", "Coulomb", "None", "CubicSplineTable", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_c, "nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_c", "c", "Coulomb", "None", "CubicSplineTable", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_c, "nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_c", "c", "Coulomb", "None", "CubicSplineTable", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_c, "nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_c", "c", "Coulomb", "None", "CubicSplineTable", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_c, "nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_c", "c", "Coulomb", "None", "CubicSplineTable", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_c, "nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_c", "c", "Coulomb", "None", "CubicSplineTable", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_c, "nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_c", "c", "Coulomb", "None", "CubicSplineTable", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_c, "nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_c", "c", "Coulomb", "None", "CubicSplineTable", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_c, "nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_c", "c", "Coulomb", "None", "CubicSplineTable", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCoul_VdwBham_GeomP1P1_VF_c, "nb_kernel_ElecCoul_VdwBham_GeomP1P1_VF_c", "c", "Coulomb", "None", "Buckingham", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwBham_GeomP1P1_F_c, "nb_kernel_ElecCoul_VdwBham_GeomP1P1_F_c", "c", "Coulomb", "None", "Buckingham", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwBham_GeomW3P1_VF_c, "nb_kernel_ElecCoul_VdwBham_GeomW3P1_VF_c", "c", "Coulomb", "None", "Buckingham", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwBham_GeomW3P1_F_c, "nb_kernel_ElecCoul_VdwBham_GeomW3P1_F_c", "c", "Coulomb", "None", "Buckingham", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwBham_GeomW3W3_VF_c, "nb_kernel_ElecCoul_VdwBham_GeomW3W3_VF_c", "c", "Coulomb", "None", "Buckingham", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwBham_GeomW3W3_F_c, "nb_kernel_ElecCoul_VdwBham_GeomW3W3_F_c", "c", "Coulomb", "None", "Buckingham", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCoul_VdwBham_GeomW4P1_VF_c, "nb_kernel_ElecCoul_VdwBham_GeomW4P1_VF_c", "c", "Coulomb", "None", "Buckingham", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwBham_GeomW4P1_F_c, "nb_kernel_ElecCoul_VdwBham_GeomW4P1_F_c", "c", "Coulomb", "None", "Buckingham", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwBham_GeomW4W4_VF_c, "nb_kernel_ElecCoul_VdwBham_GeomW4W4_VF_c", "c", "Coulomb", "None", "Buckingham", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwBham_GeomW4W4_F_c, "nb_kernel_ElecCoul_VdwBham_GeomW4W4_F_c", "c", "Coulomb", "None", "Buckingham", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_c, "nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_c", "c", "CubicSplineTable", "None", "LennardJones", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_c, "nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_c", "c", "CubicSplineTable", "None", "LennardJones", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_c, "nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_c", "c", "CubicSplineTable", "None", "LennardJones", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_c, "nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_c", "c", "CubicSplineTable", "None", "LennardJones", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_c, "nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_c", "c", "CubicSplineTable", "None", "LennardJones", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_c, "nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_c", "c", "CubicSplineTable", "None", "LennardJones", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_c, "nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_c", "c", "CubicSplineTable", "None", "LennardJones", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_c, "nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_c", "c", "CubicSplineTable", "None", "LennardJones", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_c, "nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_c", "c", "CubicSplineTable", "None", "LennardJones", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_c, "nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_c", "c", "CubicSplineTable", "None", "LennardJones", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_c, "nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_c", "c", "CubicSplineTable", "None", "None", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_c, "nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_c", "c", "CubicSplineTable", "None", "None", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_c, "nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_c", "c", "CubicSplineTable", "None", "None", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_c, "nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_c", "c", "CubicSplineTable", "None", "None", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_c, "nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_c", "c", "CubicSplineTable", "None", "None", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_c, "nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_c", "c", "CubicSplineTable", "None", "None", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_c, "nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_c", "c", "CubicSplineTable", "None", "None", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_c, "nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_c", "c", "CubicSplineTable", "None", "None", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_c, "nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_c", "c", "CubicSplineTable", "None", "None", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_c, "nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_c", "c", "CubicSplineTable", "None", "None", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_c, "nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_c", "c", "CubicSplineTable", "None", "CubicSplineTable", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_c, "nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_c", "c", "CubicSplineTable", "None", "CubicSplineTable", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_c, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_c", "c", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_c, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_c", "c", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_c, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_c", "c", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_c, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_c", "c", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_c, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_c", "c", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_c, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_c", "c", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_c, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_c", "c", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_c, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_c", "c", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwBham_GeomP1P1_VF_c, "nb_kernel_ElecCSTab_VdwBham_GeomP1P1_VF_c", "c", "CubicSplineTable", "None", "Buckingham", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwBham_GeomP1P1_F_c, "nb_kernel_ElecCSTab_VdwBham_GeomP1P1_F_c", "c", "CubicSplineTable", "None", "Buckingham", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwBham_GeomW3P1_VF_c, "nb_kernel_ElecCSTab_VdwBham_GeomW3P1_VF_c", "c", "CubicSplineTable", "None", "Buckingham", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwBham_GeomW3P1_F_c, "nb_kernel_ElecCSTab_VdwBham_GeomW3P1_F_c", "c", "CubicSplineTable", "None", "Buckingham", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwBham_GeomW3W3_VF_c, "nb_kernel_ElecCSTab_VdwBham_GeomW3W3_VF_c", "c", "CubicSplineTable", "None", "Buckingham", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwBham_GeomW3W3_F_c, "nb_kernel_ElecCSTab_VdwBham_GeomW3W3_F_c", "c", "CubicSplineTable", "None", "Buckingham", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwBham_GeomW4P1_VF_c, "nb_kernel_ElecCSTab_VdwBham_GeomW4P1_VF_c", "c", "CubicSplineTable", "None", "Buckingham", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwBham_GeomW4P1_F_c, "nb_kernel_ElecCSTab_VdwBham_GeomW4P1_F_c", "c", "CubicSplineTable", "None", "Buckingham", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwBham_GeomW4W4_VF_c, "nb_kernel_ElecCSTab_VdwBham_GeomW4W4_VF_c", "c", "CubicSplineTable", "None", "Buckingham", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwBham_GeomW4W4_F_c, "nb_kernel_ElecCSTab_VdwBham_GeomW4W4_F_c", "c", "CubicSplineTable", "None", "Buckingham", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_c, "nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_c", "c", "GeneralizedBorn", "None", "LennardJones", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_c, "nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_c", "c", "GeneralizedBorn", "None", "LennardJones", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_c, "nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_c", "c", "GeneralizedBorn", "None", "None", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecGB_VdwNone_GeomP1P1_F_c, "nb_kernel_ElecGB_VdwNone_GeomP1P1_F_c", "c", "GeneralizedBorn", "None", "None", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_c, "nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_c", "c", "GeneralizedBorn", "None", "CubicSplineTable", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_c, "nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_c", "c", "GeneralizedBorn", "None", "CubicSplineTable", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecGB_VdwBham_GeomP1P1_VF_c, "nb_kernel_ElecGB_VdwBham_GeomP1P1_VF_c", "c", "GeneralizedBorn", "None", "Buckingham", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecGB_VdwBham_GeomP1P1_F_c, "nb_kernel_ElecGB_VdwBham_GeomP1P1_F_c", "c", "GeneralizedBorn", "None", "Buckingham", "None", "ParticleParticle", "", "Force" },
     { nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_VF_c, "nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_VF_c", "c", "ReactionField", "ExactCutoff", "LennardJones", "PotentialShift", "ParticleParticle", "", "PotentialAndForce" },
     { nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_F_c, "nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_F_c", "c", "ReactionField", "ExactCutoff", "LennardJones", "PotentialShift", "ParticleParticle", "", "Force" },
     { nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_VF_c, "nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_VF_c", "c", "ReactionField", "ExactCutoff", "LennardJones", "PotentialShift", "Water3Particle", "", "PotentialAndForce" },
@@ -695,7 +639,47 @@ nb_kernel_info_t
     { nb_kernel_ElecRF_VdwBham_GeomW4P1_VF_c, "nb_kernel_ElecRF_VdwBham_GeomW4P1_VF_c", "c", "ReactionField", "None", "Buckingham", "None", "Water4Particle", "", "PotentialAndForce" },
     { nb_kernel_ElecRF_VdwBham_GeomW4P1_F_c, "nb_kernel_ElecRF_VdwBham_GeomW4P1_F_c", "c", "ReactionField", "None", "Buckingham", "None", "Water4Particle", "", "Force" },
     { nb_kernel_ElecRF_VdwBham_GeomW4W4_VF_c, "nb_kernel_ElecRF_VdwBham_GeomW4W4_VF_c", "c", "ReactionField", "None", "Buckingham", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecRF_VdwBham_GeomW4W4_F_c, "nb_kernel_ElecRF_VdwBham_GeomW4W4_F_c", "c", "ReactionField", "None", "Buckingham", "None", "Water4Water4", "", "Force" }
+    { nb_kernel_ElecRF_VdwBham_GeomW4W4_F_c, "nb_kernel_ElecRF_VdwBham_GeomW4W4_F_c", "c", "ReactionField", "None", "Buckingham", "None", "Water4Water4", "", "Force" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_c, "nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_c", "c", "Coulomb", "None", "LennardJones", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_c, "nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_c", "c", "Coulomb", "None", "LennardJones", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_c, "nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_c", "c", "Coulomb", "None", "LennardJones", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_c, "nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_c", "c", "Coulomb", "None", "LennardJones", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_c, "nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_c", "c", "Coulomb", "None", "LennardJones", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_c, "nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_c", "c", "Coulomb", "None", "LennardJones", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_c, "nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_c", "c", "Coulomb", "None", "LennardJones", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_c, "nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_c", "c", "Coulomb", "None", "LennardJones", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_c, "nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_c", "c", "Coulomb", "None", "LennardJones", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_c, "nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_c", "c", "Coulomb", "None", "LennardJones", "None", "Water4Water4", "", "Force" },
+    { nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_c, "nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_c", "c", "Coulomb", "None", "None", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_c, "nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_c", "c", "Coulomb", "None", "None", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_c, "nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_c", "c", "Coulomb", "None", "None", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_c, "nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_c", "c", "Coulomb", "None", "None", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_c, "nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_c", "c", "Coulomb", "None", "None", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_c, "nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_c", "c", "Coulomb", "None", "None", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_c, "nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_c", "c", "Coulomb", "None", "None", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_c, "nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_c", "c", "Coulomb", "None", "None", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_c, "nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_c", "c", "Coulomb", "None", "None", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_c, "nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_c", "c", "Coulomb", "None", "None", "None", "Water4Water4", "", "Force" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_c, "nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_c", "c", "Coulomb", "None", "CubicSplineTable", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_c, "nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_c", "c", "Coulomb", "None", "CubicSplineTable", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_c, "nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_c", "c", "Coulomb", "None", "CubicSplineTable", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_c, "nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_c", "c", "Coulomb", "None", "CubicSplineTable", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_c, "nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_c", "c", "Coulomb", "None", "CubicSplineTable", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_c, "nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_c", "c", "Coulomb", "None", "CubicSplineTable", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_c, "nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_c", "c", "Coulomb", "None", "CubicSplineTable", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_c, "nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_c", "c", "Coulomb", "None", "CubicSplineTable", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_c, "nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_c", "c", "Coulomb", "None", "CubicSplineTable", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_c, "nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_c", "c", "Coulomb", "None", "CubicSplineTable", "None", "Water4Water4", "", "Force" },
+    { nb_kernel_ElecCoul_VdwBham_GeomP1P1_VF_c, "nb_kernel_ElecCoul_VdwBham_GeomP1P1_VF_c", "c", "Coulomb", "None", "Buckingham", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwBham_GeomP1P1_F_c, "nb_kernel_ElecCoul_VdwBham_GeomP1P1_F_c", "c", "Coulomb", "None", "Buckingham", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwBham_GeomW3P1_VF_c, "nb_kernel_ElecCoul_VdwBham_GeomW3P1_VF_c", "c", "Coulomb", "None", "Buckingham", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwBham_GeomW3P1_F_c, "nb_kernel_ElecCoul_VdwBham_GeomW3P1_F_c", "c", "Coulomb", "None", "Buckingham", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwBham_GeomW3W3_VF_c, "nb_kernel_ElecCoul_VdwBham_GeomW3W3_VF_c", "c", "Coulomb", "None", "Buckingham", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwBham_GeomW3W3_F_c, "nb_kernel_ElecCoul_VdwBham_GeomW3W3_F_c", "c", "Coulomb", "None", "Buckingham", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCoul_VdwBham_GeomW4P1_VF_c, "nb_kernel_ElecCoul_VdwBham_GeomW4P1_VF_c", "c", "Coulomb", "None", "Buckingham", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwBham_GeomW4P1_F_c, "nb_kernel_ElecCoul_VdwBham_GeomW4P1_F_c", "c", "Coulomb", "None", "Buckingham", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwBham_GeomW4W4_VF_c, "nb_kernel_ElecCoul_VdwBham_GeomW4W4_VF_c", "c", "Coulomb", "None", "Buckingham", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwBham_GeomW4W4_F_c, "nb_kernel_ElecCoul_VdwBham_GeomW4W4_F_c", "c", "Coulomb", "None", "Buckingham", "None", "Water4Water4", "", "Force" }
 };
 
 int
index 20cf4af2efccda1cca085fbcbc26e2f535b62b77..27daeab0209bdd8d558ba68892989f498637533f 100644 (file)
@@ -2,7 +2,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -143,18 +143,13 @@ void
     real             velec,felec,velecsum,facel,crf,krf,krf2;
     real             *charge;
     /* #endif */
-    /* #if 'GeneralizedBorn' in KERNEL_ELEC */
-    int              gbitab;
-    real             vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,dvdaj,gbeps,dvdatmp;
-    real             *invsqrta,*dvda,*gbtab;
-    /* #endif */
     /* #if KERNEL_VDW != 'None' */
     int              nvdwtype;
     real             rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,br,vvdwexp,sh_vdw_invrcut6;
     int              *vdwtype;
     real             *vdwparam;
     /* #endif */
-    /* #if 'Table' in KERNEL_ELEC or 'GeneralizedBorn' in KERNEL_ELEC or 'Table' in KERNEL_VDW */
+    /* #if 'Table' in KERNEL_ELEC or 'Table' in KERNEL_VDW */
     int              vfitab;
     real             rt,vfeps,vftabscale,Y,F,Geps,Heps2,Fp,VV,FF;
     real             *vftab;
@@ -232,14 +227,6 @@ void
      /*     #endif */
     /* #endif */
 
-    /* #if KERNEL_ELEC=='GeneralizedBorn' */
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = fr->gbtab->scale;
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = (1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent);
-    /* #endif */
-
     /* #if 'Water' in GEOMETRY_I */
     /* Setup water-specific parameters */
     inr              = nlist->iinr[0];
@@ -358,9 +345,6 @@ void
         /*     #for I in PARTICLES_ELEC_I */
         iq{I}              = facel*charge[inr+{I}];
         /*         #define OUTERFLOPS OUTERFLOPS+1 */
-        /*         #if KERNEL_ELEC=='GeneralizedBorn' */
-        isai{I}            = invsqrta[inr+{I}];
-        /*         #endif */
         /*     #endfor */
         /*     #for I in PARTICLES_VDW_I */
         vdwioffset{I}      = {NVDWPARAM}*nvdwtype*vdwtype[inr+{I}];
@@ -372,16 +356,10 @@ void
         /*     #if KERNEL_ELEC != 'None' */
         velecsum         = 0.0;
         /*     #endif */
-        /*     #if 'GeneralizedBorn' in KERNEL_ELEC */
-        vgbsum           = 0.0;
-        /*     #endif */
         /*     #if KERNEL_VDW != 'None' */
         vvdwsum          = 0.0;
         /*     #endif */
         /* #endif */
-        /*     #if 'GeneralizedBorn' in KERNEL_ELEC and 'Force' in KERNEL_VF */
-        dvdasum          = 0.0;
-        /*     #endif */
 
         /* Start inner kernel loop */
         for(jidx=j_index_start; jidx<j_index_end; jidx++)
@@ -434,9 +412,6 @@ void
             /* Load parameters for j particles */
             /*     #for J in PARTICLES_ELEC_J */
             jq{J}              = charge[jnr+{J}];
-            /*         #if KERNEL_ELEC=='GeneralizedBorn' */
-            isaj{J}           = invsqrta[jnr+{J}];
-            /*         #endif */
             /*     #endfor */
             /*     #for J in PARTICLES_VDW_J */
             vdwjidx{J}         = {NVDWPARAM}*vdwtype[jnr+{J}];
@@ -520,47 +495,6 @@ void
             /*                 #define INNERFLOPS INNERFLOPS+3 */
             /*             #endif */
 
-            /*         #elif KERNEL_ELEC=='GeneralizedBorn' */
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = isai{I}*isaj{J};
-            gbqqfactor       = isaprod*(-qq{I}{J})*gbinvepsdiff;
-            gbscale          = isaprod*gbtabscale;
-            dvdaj            = dvda[jnr+{J}];
-            /*             #define INNERFLOPS INNERFLOPS+5 */
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = r{I}{J}*gbscale;
-            gbitab           = rt;
-            gbeps            = rt-gbitab;
-            gbitab           = 4*gbitab;
-
-            Y                = gbtab[gbitab];
-            F                = gbtab[gbitab+1];
-            Geps             = gbeps*gbtab[gbitab+2];
-            Heps2            = gbeps*gbeps*gbtab[gbitab+3];
-            Fp               = F+Geps+Heps2;
-            VV               = Y+gbeps*Fp;
-            vgb              = gbqqfactor*VV;
-            /*             #define INNERFLOPS INNERFLOPS+10 */
-
-            /*             #if 'Force' in KERNEL_VF */
-            FF               = Fp+Geps+2.0*Heps2;
-            fgb              = gbqqfactor*FF*gbscale;
-            dvdatmp          = -0.5*(vgb+fgb*r{I}{J});
-            dvdasum          = dvdasum + dvdatmp;
-            dvda[jnr]        = dvdaj+dvdatmp*isaj{J}*isaj{J};
-            /*                 #define INNERFLOPS INNERFLOPS+13 */
-            /*             #endif */
-            velec            = qq{I}{J}*rinv{I}{J};
-            /*                 #define INNERFLOPS INNERFLOPS+1 */
-            /*             #if 'Force' in KERNEL_VF */
-            felec            = (velec*rinv{I}{J}-fgb)*rinv{I}{J};
-            /*                 #define INNERFLOPS INNERFLOPS+3 */
-            /*             #endif */
-
             /*         #elif KERNEL_ELEC=='Ewald' */
             /* EWALD ELECTROSTATICS */
 
@@ -794,10 +728,6 @@ void
             /*         #if 'electrostatics' in INTERACTION_FLAGS[I][J] */
             velecsum        += velec;
             /*             #define INNERFLOPS INNERFLOPS+1 */
-            /*             #if KERNEL_ELEC=='GeneralizedBorn' */
-            vgbsum          += vgb;
-            /*                 #define INNERFLOPS INNERFLOPS+1 */
-            /*             #endif */
             /*         #endif */
             /*         #if 'vdw' in INTERACTION_FLAGS[I][J] */
             vvdwsum         += vvdw;
@@ -872,18 +802,11 @@ void
         kernel_data->energygrp_elec[ggid] += velecsum;
         /*         #define OUTERFLOPS OUTERFLOPS+1 */
         /*     #endif */
-        /*     #if 'GeneralizedBorn' in KERNEL_ELEC */
-        kernel_data->energygrp_polarization[ggid] += vgbsum;
-        /*         #define OUTERFLOPS OUTERFLOPS+1 */
-        /*     #endif */
         /*     #if KERNEL_VDW != 'None' */
         kernel_data->energygrp_vdw[ggid] += vvdwsum;
         /*         #define OUTERFLOPS OUTERFLOPS+1 */
         /*     #endif */
         /* #endif */
-        /*     #if 'GeneralizedBorn' in KERNEL_ELEC and 'Force' in KERNEL_VF */
-        dvda[inr]                   = dvda[inr] + dvdasum*isai{I}*isai{I};
-        /*     #endif */
 
         /* Increment number of inner iterations */
         inneriter                  += j_index_end - j_index_start;
index 8eafe8bb1192097a63763fcacf29cf5af1fc5eac..5cadde44568518ff8b38c23b07b227353df6653a 100755 (executable)
@@ -105,7 +105,6 @@ ElectrostaticsList = {
     'None'                    : [],
     'Coulomb'                 : ['rinv','rinvsq'],
     'ReactionField'           : ['rinv','rinvsq'],
-    'GeneralizedBorn'         : ['rinv','r'],
     'CubicSplineTable'        : ['rinv','r','table'],
     'Ewald'                   : ['rinv','rinvsq','r'],
 }
@@ -190,7 +189,6 @@ Abbreviation = {
     'Coulomb'                 : 'Coul',
     'Ewald'                   : 'Ew',
     'ReactionField'           : 'RF',
-    'GeneralizedBorn'         : 'GB',
     'CubicSplineTable'        : 'CSTab',
     'LennardJones'            : 'LJ',
     'Buckingham'              : 'Bham',
@@ -269,7 +267,7 @@ def KeepKernel(KernelElec,KernelElecMod,KernelVdw,KernelVdwMod,KernelGeom,Kernel
         return 0
 
     # No need for LJ-only water optimization, or water optimization with implicit solvent.
-    if('Water' in KernelGeom[0] and (KernelElec=='None' or 'GeneralizedBorn' in KernelElec)):
+    if('Water' in KernelGeom[0] and KernelElec=='None'):
         return 0
 
     # Non-matching table settings are pointless
diff --git a/src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecGB_VdwCSTab_GeomP1P1_sparc64_hpc_ace_double.c b/src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecGB_VdwCSTab_GeomP1P1_sparc64_hpc_ace_double.c
deleted file mode 100644 (file)
index 4b3e5b6..0000000
+++ /dev/null
@@ -1,820 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
- * and including many others, as listed in the AUTHORS file in the
- * top-level source directory and at http://www.gromacs.org.
- *
- * GROMACS is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * GROMACS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GROMACS; if not, see
- * http://www.gnu.org/licenses, or write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
- *
- * If you want to redistribute modifications to GROMACS, please
- * consider that scientific software is very special. Version
- * control is crucial - bugs must be traceable. We will be happy to
- * consider code for inclusion in the official distribution, but
- * derived work must not be called official GROMACS. Details are found
- * in the README & COPYING files - if they are missing, get the
- * official version at http://www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the research papers on the package. Check out http://www.gromacs.org.
- */
-/*
- * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
- */
-#include "gmxpre.h"
-
-#include "config.h"
-
-#include <math.h>
-
-#include "../nb_kernel.h"
-#include "gromacs/gmxlib/nrnb.h"
-
-#include "kernelutil_sparc64_hpc_ace_double.h"
-
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_sparc64_hpc_ace_double
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            CubicSplineTable
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        PotentialAndForce
- */
-void
-nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_sparc64_hpc_ace_double
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
-     * just 0 for non-waters.
-     * Suffixes A,B refer to j loop unrolling done with double precision SIMD, e.g. for the two different
-     * jnr indices corresponding to data put in the four positions in the SIMD register.
-     */
-    int              i_shift_offset,i_coord_offset,outeriter,inneriter;
-    int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
-    int              jnrA,jnrB;
-    int              j_coord_offsetA,j_coord_offsetB;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             rcutoff_scalar;
-    real             *shiftvec,*fshift,*x,*f;
-    _fjsp_v2r8       tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
-    int              vdwioffset0;
-    _fjsp_v2r8       ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0A,vdwjidx0B;
-    _fjsp_v2r8       jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    _fjsp_v2r8       dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
-    _fjsp_v2r8       velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    _fjsp_v2r8       vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,dvdaj,gbeps,twogbeps,dvdatmp;
-    _fjsp_v2r8       minushalf = gmx_fjsp_set1_v2r8(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    int              nvdwtype;
-    _fjsp_v2r8       rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
-    int              *vdwtype;
-    real             *vdwparam;
-    _fjsp_v2r8       one_sixth   = gmx_fjsp_set1_v2r8(1.0/6.0);
-    _fjsp_v2r8       one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
-    _fjsp_v2r8       rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF,twovfeps;
-    real             *vftab;
-    _fjsp_v2r8       itab_tmp;
-    _fjsp_v2r8       dummy_mask,cutoff_mask;
-    _fjsp_v2r8       one     = gmx_fjsp_set1_v2r8(1.0);
-    _fjsp_v2r8       two     = gmx_fjsp_set1_v2r8(2.0);
-    union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
-
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = gmx_fjsp_set1_v2r8(fr->ic->epsfac);
-    charge           = mdatoms->chargeA;
-    nvdwtype         = fr->ntype;
-    vdwparam         = fr->nbfp;
-    vdwtype          = mdatoms->typeA;
-
-    vftab            = kernel_data->table_vdw->data;
-    vftabscale       = gmx_fjsp_set1_v2r8(kernel_data->table_vdw->scale);
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = gmx_fjsp_set1_v2r8(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = gmx_fjsp_set1_v2r8((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-
-    /* Avoid stupid compiler warnings */
-    jnrA = jnrB = 0;
-    j_coord_offsetA = 0;
-    j_coord_offsetB = 0;
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        gmx_fjsp_load_shift_and_1rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
-
-        fix0             = _fjsp_setzero_v2r8();
-        fiy0             = _fjsp_setzero_v2r8();
-        fiz0             = _fjsp_setzero_v2r8();
-
-        /* Load parameters for i particles */
-        iq0              = _fjsp_mul_v2r8(facel,gmx_fjsp_load1_v2r8(charge+inr+0));
-        isai0            = gmx_fjsp_load1_v2r8(invsqrta+inr+0);
-        vdwioffset0      = 2*nvdwtype*vdwtype[inr+0];
-
-        /* Reset potential sums */
-        velecsum         = _fjsp_setzero_v2r8();
-        vgbsum           = _fjsp_setzero_v2r8();
-        vvdwsum          = _fjsp_setzero_v2r8();
-        dvdasum          = _fjsp_setzero_v2r8();
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrA             = jjnr[jidx];
-            jnrB             = jjnr[jidx+1];
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-
-            /* load j atom coordinates */
-            gmx_fjsp_load_1rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _fjsp_sub_v2r8(ix0,jx0);
-            dy00             = _fjsp_sub_v2r8(iy0,jy0);
-            dz00             = _fjsp_sub_v2r8(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
-
-            rinv00           = gmx_fjsp_invsqrt_v2r8(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_fjsp_load_2real_swizzle_v2r8(charge+jnrA+0,charge+jnrB+0);
-            isaj0            = gmx_fjsp_load_2real_swizzle_v2r8(invsqrta+jnrA+0,invsqrta+jnrB+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-            vdwjidx0B        = 2*vdwtype[jnrB+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _fjsp_mul_v2r8(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _fjsp_mul_v2r8(iq0,jq0);
-            gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
-                                         vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
-
-            /* Calculate table index by multiplying r with table scale and truncate to integer */
-            rt               = _fjsp_mul_v2r8(r00,vftabscale);
-            itab_tmp         = _fjsp_dtox_v2r8(rt);
-            vfeps            = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
-            twovfeps         = _fjsp_add_v2r8(vfeps,vfeps);
-            _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
-
-            vfconv.i[0]     *= 8;
-            vfconv.i[1]     *= 8;
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _fjsp_mul_v2r8(isai0,isaj0);
-            gbqqfactor       = _fjsp_neg_v2r8(_fjsp_mul_v2r8(qq00,_fjsp_mul_v2r8(isaprod,gbinvepsdiff)));
-            gbscale          = _fjsp_mul_v2r8(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _fjsp_mul_v2r8(r00,gbscale);
-            itab_tmp         = _fjsp_dtox_v2r8(rt);
-            gbeps            = _fjsp_sub_v2r8(rt,_fjsp_xtod_v2r8(itab_tmp));
-            _fjsp_store_v2r8(&gbconv.simd,itab_tmp);
-
-            Y                = _fjsp_load_v2r8( gbtab + 4*gbconv.i[0] );
-            F                = _fjsp_load_v2r8( gbtab + 4*gbconv.i[1] );
-            GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
-            G                = _fjsp_load_v2r8( gbtab + 4*gbconv.i[0] +2);
-            H                = _fjsp_load_v2r8( gbtab + 4*gbconv.i[1] +2);
-            GMX_FJSP_TRANSPOSE2_V2R8(G,H);
-            Fp               = _fjsp_madd_v2r8(gbeps,_fjsp_madd_v2r8(gbeps,H,G),F);
-            VV               = _fjsp_madd_v2r8(gbeps,Fp,Y);
-            vgb              = _fjsp_mul_v2r8(gbqqfactor,VV);
-
-            twogbeps         = _fjsp_add_v2r8(gbeps,gbeps);
-            FF               = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twogbeps,H,G),gbeps,Fp);
-            fgb              = _fjsp_mul_v2r8(gbqqfactor,_fjsp_mul_v2r8(FF,gbscale));
-            dvdatmp          = _fjsp_mul_v2r8(minushalf,_fjsp_madd_v2r8(fgb,r00,vgb));
-            dvdasum          = _fjsp_add_v2r8(dvdasum,dvdatmp);
-            gmx_fjsp_increment_2real_swizzle_v2r8(dvda+jnrA,dvda+jnrB,_fjsp_mul_v2r8(dvdatmp,_fjsp_mul_v2r8(isaj0,isaj0)));
-            velec            = _fjsp_mul_v2r8(qq00,rinv00);
-            felec            = _fjsp_mul_v2r8(_fjsp_msub_v2r8(velec,rinv00,fgb),rinv00);
-
-            /* CUBIC SPLINE TABLE DISPERSION */
-            Y                = _fjsp_load_v2r8( vftab + vfconv.i[0] );
-            F                = _fjsp_load_v2r8( vftab + vfconv.i[1] );
-            GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
-            G                = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
-            H                = _fjsp_load_v2r8( vftab + vfconv.i[1] + 2 );
-            GMX_FJSP_TRANSPOSE2_V2R8(G,H);
-            Fp               = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
-            VV               = _fjsp_madd_v2r8(vfeps,Fp,Y);
-            vvdw6            = _fjsp_mul_v2r8(c6_00,VV);
-            FF               = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
-            fvdw6            = _fjsp_mul_v2r8(c6_00,FF);
-
-            /* CUBIC SPLINE TABLE REPULSION */
-            Y                = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
-            F                = _fjsp_load_v2r8( vftab + vfconv.i[1] + 4 );
-            GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
-            G                = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
-            H                = _fjsp_load_v2r8( vftab + vfconv.i[1] + 6 );
-            GMX_FJSP_TRANSPOSE2_V2R8(G,H);
-            Fp               = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
-            VV               = _fjsp_madd_v2r8(vfeps,Fp,Y);
-            vvdw12           = _fjsp_mul_v2r8(c12_00,VV);
-            FF               = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
-            fvdw12           = _fjsp_mul_v2r8(c12_00,FF);
-            vvdw             = _fjsp_add_v2r8(vvdw12,vvdw6);
-            fvdw             = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
-
-            /* Update potential sum for this i atom from the interaction with this j atom. */
-            velecsum         = _fjsp_add_v2r8(velecsum,velec);
-            vgbsum           = _fjsp_add_v2r8(vgbsum,vgb);
-            vvdwsum          = _fjsp_add_v2r8(vvdwsum,vvdw);
-
-            fscal            = _fjsp_add_v2r8(felec,fvdw);
-
-            /* Update vectorial force */
-            fix0             = _fjsp_madd_v2r8(dx00,fscal,fix0);
-            fiy0             = _fjsp_madd_v2r8(dy00,fscal,fiy0);
-            fiz0             = _fjsp_madd_v2r8(dz00,fscal,fiz0);
-            
-            gmx_fjsp_decrement_fma_1rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fscal,dx00,dy00,dz00);
-
-            /* Inner loop uses 95 flops */
-        }
-
-        if(jidx<j_index_end)
-        {
-
-            jnrA             = jjnr[jidx];
-            j_coord_offsetA  = DIM*jnrA;
-
-            /* load j atom coordinates */
-            gmx_fjsp_load_1rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _fjsp_sub_v2r8(ix0,jx0);
-            dy00             = _fjsp_sub_v2r8(iy0,jy0);
-            dz00             = _fjsp_sub_v2r8(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
-
-            rinv00           = gmx_fjsp_invsqrt_v2r8(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(),charge+jnrA+0);
-            isaj0            = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(),invsqrta+jnrA+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _fjsp_mul_v2r8(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _fjsp_mul_v2r8(iq0,jq0);
-            gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
-                                         vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
-
-            /* Calculate table index by multiplying r with table scale and truncate to integer */
-            rt               = _fjsp_mul_v2r8(r00,vftabscale);
-            itab_tmp         = _fjsp_dtox_v2r8(rt);
-            vfeps            = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
-            twovfeps         = _fjsp_add_v2r8(vfeps,vfeps);
-            _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
-
-            vfconv.i[0]     *= 8;
-            vfconv.i[1]     *= 8;
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _fjsp_mul_v2r8(isai0,isaj0);
-            gbqqfactor       = _fjsp_neg_v2r8(_fjsp_mul_v2r8(qq00,_fjsp_mul_v2r8(isaprod,gbinvepsdiff)));
-            gbscale          = _fjsp_mul_v2r8(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _fjsp_mul_v2r8(r00,gbscale);
-            itab_tmp         = _fjsp_dtox_v2r8(rt);
-            gbeps            = _fjsp_sub_v2r8(rt,_fjsp_xtod_v2r8(itab_tmp));
-            _fjsp_store_v2r8(&gbconv.simd,itab_tmp);
-
-            Y                = _fjsp_load_v2r8( gbtab + 4*gbconv.i[0] );
-            F                = _fjsp_setzero_v2r8();
-            GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
-            G                = _fjsp_load_v2r8( gbtab + 4*gbconv.i[0] +2);
-            H                = _fjsp_setzero_v2r8();
-            GMX_FJSP_TRANSPOSE2_V2R8(G,H);
-            Fp               = _fjsp_madd_v2r8(gbeps,_fjsp_madd_v2r8(gbeps,H,G),F);
-            VV               = _fjsp_madd_v2r8(gbeps,Fp,Y);
-            vgb              = _fjsp_mul_v2r8(gbqqfactor,VV);
-
-            twogbeps         = _fjsp_add_v2r8(gbeps,gbeps);
-            FF               = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twogbeps,H,G),gbeps,Fp);
-            fgb              = _fjsp_mul_v2r8(gbqqfactor,_fjsp_mul_v2r8(FF,gbscale));
-            dvdatmp          = _fjsp_mul_v2r8(minushalf,_fjsp_madd_v2r8(fgb,r00,vgb));
-            dvdasum          = _fjsp_add_v2r8(dvdasum,dvdatmp);
-            gmx_fjsp_increment_1real_v2r8(dvda+jnrA,_fjsp_mul_v2r8(dvdatmp,_fjsp_mul_v2r8(isaj0,isaj0)));
-            velec            = _fjsp_mul_v2r8(qq00,rinv00);
-            felec            = _fjsp_mul_v2r8(_fjsp_msub_v2r8(velec,rinv00,fgb),rinv00);
-
-            /* CUBIC SPLINE TABLE DISPERSION */
-            Y                = _fjsp_load_v2r8( vftab + vfconv.i[0] );
-            F                = _fjsp_setzero_v2r8();
-            GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
-            G                = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
-            H                = _fjsp_setzero_v2r8();
-            GMX_FJSP_TRANSPOSE2_V2R8(G,H);
-            Fp               = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
-            VV               = _fjsp_madd_v2r8(vfeps,Fp,Y);
-            vvdw6            = _fjsp_mul_v2r8(c6_00,VV);
-            FF               = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
-            fvdw6            = _fjsp_mul_v2r8(c6_00,FF);
-
-            /* CUBIC SPLINE TABLE REPULSION */
-            Y                = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
-            F                = _fjsp_setzero_v2r8();
-            GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
-            G                = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
-            H                = _fjsp_setzero_v2r8();
-            GMX_FJSP_TRANSPOSE2_V2R8(G,H);
-            Fp               = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
-            VV               = _fjsp_madd_v2r8(vfeps,Fp,Y);
-            vvdw12           = _fjsp_mul_v2r8(c12_00,VV);
-            FF               = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
-            fvdw12           = _fjsp_mul_v2r8(c12_00,FF);
-            vvdw             = _fjsp_add_v2r8(vvdw12,vvdw6);
-            fvdw             = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
-
-            /* Update potential sum for this i atom from the interaction with this j atom. */
-            velec            = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
-            velecsum         = _fjsp_add_v2r8(velecsum,velec);
-            vgb              = _fjsp_unpacklo_v2r8(vgb,_fjsp_setzero_v2r8());
-            vgbsum           = _fjsp_add_v2r8(vgbsum,vgb);
-            vvdw             = _fjsp_unpacklo_v2r8(vvdw,_fjsp_setzero_v2r8());
-            vvdwsum          = _fjsp_add_v2r8(vvdwsum,vvdw);
-
-            fscal            = _fjsp_add_v2r8(felec,fvdw);
-
-            fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
-
-            /* Update vectorial force */
-            fix0             = _fjsp_madd_v2r8(dx00,fscal,fix0);
-            fiy0             = _fjsp_madd_v2r8(dy00,fscal,fiy0);
-            fiz0             = _fjsp_madd_v2r8(dz00,fscal,fiz0);
-            
-            gmx_fjsp_decrement_fma_1rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fscal,dx00,dy00,dz00);
-
-            /* Inner loop uses 95 flops */
-        }
-
-        /* End of innermost loop */
-
-        gmx_fjsp_update_iforce_1atom_swizzle_v2r8(fix0,fiy0,fiz0,
-                                              f+i_coord_offset,fshift+i_shift_offset);
-
-        ggid                        = gid[iidx];
-        /* Update potential energies */
-        gmx_fjsp_update_1pot_v2r8(velecsum,kernel_data->energygrp_elec+ggid);
-        gmx_fjsp_update_1pot_v2r8(vgbsum,kernel_data->energygrp_polarization+ggid);
-        gmx_fjsp_update_1pot_v2r8(vvdwsum,kernel_data->energygrp_vdw+ggid);
-        dvdasum = _fjsp_mul_v2r8(dvdasum, _fjsp_mul_v2r8(isai0,isai0));
-        gmx_fjsp_update_1pot_v2r8(dvdasum,dvda+inr);
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 10 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_VF,outeriter*10 + inneriter*95);
-}
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_sparc64_hpc_ace_double
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            CubicSplineTable
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        Force
- */
-void
-nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_sparc64_hpc_ace_double
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
-     * just 0 for non-waters.
-     * Suffixes A,B refer to j loop unrolling done with double precision SIMD, e.g. for the two different
-     * jnr indices corresponding to data put in the four positions in the SIMD register.
-     */
-    int              i_shift_offset,i_coord_offset,outeriter,inneriter;
-    int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
-    int              jnrA,jnrB;
-    int              j_coord_offsetA,j_coord_offsetB;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             rcutoff_scalar;
-    real             *shiftvec,*fshift,*x,*f;
-    _fjsp_v2r8       tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
-    int              vdwioffset0;
-    _fjsp_v2r8       ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0A,vdwjidx0B;
-    _fjsp_v2r8       jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    _fjsp_v2r8       dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
-    _fjsp_v2r8       velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    _fjsp_v2r8       vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,dvdaj,gbeps,twogbeps,dvdatmp;
-    _fjsp_v2r8       minushalf = gmx_fjsp_set1_v2r8(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    int              nvdwtype;
-    _fjsp_v2r8       rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
-    int              *vdwtype;
-    real             *vdwparam;
-    _fjsp_v2r8       one_sixth   = gmx_fjsp_set1_v2r8(1.0/6.0);
-    _fjsp_v2r8       one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
-    _fjsp_v2r8       rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF,twovfeps;
-    real             *vftab;
-    _fjsp_v2r8       itab_tmp;
-    _fjsp_v2r8       dummy_mask,cutoff_mask;
-    _fjsp_v2r8       one     = gmx_fjsp_set1_v2r8(1.0);
-    _fjsp_v2r8       two     = gmx_fjsp_set1_v2r8(2.0);
-    union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
-
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = gmx_fjsp_set1_v2r8(fr->ic->epsfac);
-    charge           = mdatoms->chargeA;
-    nvdwtype         = fr->ntype;
-    vdwparam         = fr->nbfp;
-    vdwtype          = mdatoms->typeA;
-
-    vftab            = kernel_data->table_vdw->data;
-    vftabscale       = gmx_fjsp_set1_v2r8(kernel_data->table_vdw->scale);
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = gmx_fjsp_set1_v2r8(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = gmx_fjsp_set1_v2r8((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-
-    /* Avoid stupid compiler warnings */
-    jnrA = jnrB = 0;
-    j_coord_offsetA = 0;
-    j_coord_offsetB = 0;
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        gmx_fjsp_load_shift_and_1rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
-
-        fix0             = _fjsp_setzero_v2r8();
-        fiy0             = _fjsp_setzero_v2r8();
-        fiz0             = _fjsp_setzero_v2r8();
-
-        /* Load parameters for i particles */
-        iq0              = _fjsp_mul_v2r8(facel,gmx_fjsp_load1_v2r8(charge+inr+0));
-        isai0            = gmx_fjsp_load1_v2r8(invsqrta+inr+0);
-        vdwioffset0      = 2*nvdwtype*vdwtype[inr+0];
-
-        dvdasum          = _fjsp_setzero_v2r8();
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrA             = jjnr[jidx];
-            jnrB             = jjnr[jidx+1];
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-
-            /* load j atom coordinates */
-            gmx_fjsp_load_1rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _fjsp_sub_v2r8(ix0,jx0);
-            dy00             = _fjsp_sub_v2r8(iy0,jy0);
-            dz00             = _fjsp_sub_v2r8(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
-
-            rinv00           = gmx_fjsp_invsqrt_v2r8(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_fjsp_load_2real_swizzle_v2r8(charge+jnrA+0,charge+jnrB+0);
-            isaj0            = gmx_fjsp_load_2real_swizzle_v2r8(invsqrta+jnrA+0,invsqrta+jnrB+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-            vdwjidx0B        = 2*vdwtype[jnrB+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _fjsp_mul_v2r8(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _fjsp_mul_v2r8(iq0,jq0);
-            gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
-                                         vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
-
-            /* Calculate table index by multiplying r with table scale and truncate to integer */
-            rt               = _fjsp_mul_v2r8(r00,vftabscale);
-            itab_tmp         = _fjsp_dtox_v2r8(rt);
-            vfeps            = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
-            twovfeps         = _fjsp_add_v2r8(vfeps,vfeps);
-            _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
-
-            vfconv.i[0]     *= 8;
-            vfconv.i[1]     *= 8;
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _fjsp_mul_v2r8(isai0,isaj0);
-            gbqqfactor       = _fjsp_neg_v2r8(_fjsp_mul_v2r8(qq00,_fjsp_mul_v2r8(isaprod,gbinvepsdiff)));
-            gbscale          = _fjsp_mul_v2r8(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _fjsp_mul_v2r8(r00,gbscale);
-            itab_tmp         = _fjsp_dtox_v2r8(rt);
-            gbeps            = _fjsp_sub_v2r8(rt,_fjsp_xtod_v2r8(itab_tmp));
-            _fjsp_store_v2r8(&gbconv.simd,itab_tmp);
-
-            Y                = _fjsp_load_v2r8( gbtab + 4*gbconv.i[0] );
-            F                = _fjsp_load_v2r8( gbtab + 4*gbconv.i[1] );
-            GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
-            G                = _fjsp_load_v2r8( gbtab + 4*gbconv.i[0] +2);
-            H                = _fjsp_load_v2r8( gbtab + 4*gbconv.i[1] +2);
-            GMX_FJSP_TRANSPOSE2_V2R8(G,H);
-            Fp               = _fjsp_madd_v2r8(gbeps,_fjsp_madd_v2r8(gbeps,H,G),F);
-            VV               = _fjsp_madd_v2r8(gbeps,Fp,Y);
-            vgb              = _fjsp_mul_v2r8(gbqqfactor,VV);
-
-            twogbeps         = _fjsp_add_v2r8(gbeps,gbeps);
-            FF               = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twogbeps,H,G),gbeps,Fp);
-            fgb              = _fjsp_mul_v2r8(gbqqfactor,_fjsp_mul_v2r8(FF,gbscale));
-            dvdatmp          = _fjsp_mul_v2r8(minushalf,_fjsp_madd_v2r8(fgb,r00,vgb));
-            dvdasum          = _fjsp_add_v2r8(dvdasum,dvdatmp);
-            gmx_fjsp_increment_2real_swizzle_v2r8(dvda+jnrA,dvda+jnrB,_fjsp_mul_v2r8(dvdatmp,_fjsp_mul_v2r8(isaj0,isaj0)));
-            velec            = _fjsp_mul_v2r8(qq00,rinv00);
-            felec            = _fjsp_mul_v2r8(_fjsp_msub_v2r8(velec,rinv00,fgb),rinv00);
-
-            /* CUBIC SPLINE TABLE DISPERSION */
-            Y                = _fjsp_load_v2r8( vftab + vfconv.i[0] );
-            F                = _fjsp_load_v2r8( vftab + vfconv.i[1] );
-            GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
-            G                = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
-            H                = _fjsp_load_v2r8( vftab + vfconv.i[1] + 2 );
-            GMX_FJSP_TRANSPOSE2_V2R8(G,H);
-            Fp               = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
-            FF               = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
-            fvdw6            = _fjsp_mul_v2r8(c6_00,FF);
-
-            /* CUBIC SPLINE TABLE REPULSION */
-            Y                = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
-            F                = _fjsp_load_v2r8( vftab + vfconv.i[1] + 4 );
-            GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
-            G                = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
-            H                = _fjsp_load_v2r8( vftab + vfconv.i[1] + 6 );
-            GMX_FJSP_TRANSPOSE2_V2R8(G,H);
-            Fp               = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
-            FF               = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
-            fvdw12           = _fjsp_mul_v2r8(c12_00,FF);
-            fvdw             = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
-
-            fscal            = _fjsp_add_v2r8(felec,fvdw);
-
-            /* Update vectorial force */
-            fix0             = _fjsp_madd_v2r8(dx00,fscal,fix0);
-            fiy0             = _fjsp_madd_v2r8(dy00,fscal,fiy0);
-            fiz0             = _fjsp_madd_v2r8(dz00,fscal,fiz0);
-            
-            gmx_fjsp_decrement_fma_1rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fscal,dx00,dy00,dz00);
-
-            /* Inner loop uses 85 flops */
-        }
-
-        if(jidx<j_index_end)
-        {
-
-            jnrA             = jjnr[jidx];
-            j_coord_offsetA  = DIM*jnrA;
-
-            /* load j atom coordinates */
-            gmx_fjsp_load_1rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _fjsp_sub_v2r8(ix0,jx0);
-            dy00             = _fjsp_sub_v2r8(iy0,jy0);
-            dz00             = _fjsp_sub_v2r8(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
-
-            rinv00           = gmx_fjsp_invsqrt_v2r8(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(),charge+jnrA+0);
-            isaj0            = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(),invsqrta+jnrA+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _fjsp_mul_v2r8(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _fjsp_mul_v2r8(iq0,jq0);
-            gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
-                                         vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
-
-            /* Calculate table index by multiplying r with table scale and truncate to integer */
-            rt               = _fjsp_mul_v2r8(r00,vftabscale);
-            itab_tmp         = _fjsp_dtox_v2r8(rt);
-            vfeps            = _fjsp_sub_v2r8(rt, _fjsp_xtod_v2r8(itab_tmp));
-            twovfeps         = _fjsp_add_v2r8(vfeps,vfeps);
-            _fjsp_store_v2r8(&vfconv.simd,itab_tmp);
-
-            vfconv.i[0]     *= 8;
-            vfconv.i[1]     *= 8;
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _fjsp_mul_v2r8(isai0,isaj0);
-            gbqqfactor       = _fjsp_neg_v2r8(_fjsp_mul_v2r8(qq00,_fjsp_mul_v2r8(isaprod,gbinvepsdiff)));
-            gbscale          = _fjsp_mul_v2r8(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _fjsp_mul_v2r8(r00,gbscale);
-            itab_tmp         = _fjsp_dtox_v2r8(rt);
-            gbeps            = _fjsp_sub_v2r8(rt,_fjsp_xtod_v2r8(itab_tmp));
-            _fjsp_store_v2r8(&gbconv.simd,itab_tmp);
-
-            Y                = _fjsp_load_v2r8( gbtab + 4*gbconv.i[0] );
-            F                = _fjsp_setzero_v2r8();
-            GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
-            G                = _fjsp_load_v2r8( gbtab + 4*gbconv.i[0] +2);
-            H                = _fjsp_setzero_v2r8();
-            GMX_FJSP_TRANSPOSE2_V2R8(G,H);
-            Fp               = _fjsp_madd_v2r8(gbeps,_fjsp_madd_v2r8(gbeps,H,G),F);
-            VV               = _fjsp_madd_v2r8(gbeps,Fp,Y);
-            vgb              = _fjsp_mul_v2r8(gbqqfactor,VV);
-
-            twogbeps         = _fjsp_add_v2r8(gbeps,gbeps);
-            FF               = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twogbeps,H,G),gbeps,Fp);
-            fgb              = _fjsp_mul_v2r8(gbqqfactor,_fjsp_mul_v2r8(FF,gbscale));
-            dvdatmp          = _fjsp_mul_v2r8(minushalf,_fjsp_madd_v2r8(fgb,r00,vgb));
-            dvdasum          = _fjsp_add_v2r8(dvdasum,dvdatmp);
-            gmx_fjsp_increment_1real_v2r8(dvda+jnrA,_fjsp_mul_v2r8(dvdatmp,_fjsp_mul_v2r8(isaj0,isaj0)));
-            velec            = _fjsp_mul_v2r8(qq00,rinv00);
-            felec            = _fjsp_mul_v2r8(_fjsp_msub_v2r8(velec,rinv00,fgb),rinv00);
-
-            /* CUBIC SPLINE TABLE DISPERSION */
-            Y                = _fjsp_load_v2r8( vftab + vfconv.i[0] );
-            F                = _fjsp_setzero_v2r8();
-            GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
-            G                = _fjsp_load_v2r8( vftab + vfconv.i[0] + 2 );
-            H                = _fjsp_setzero_v2r8();
-            GMX_FJSP_TRANSPOSE2_V2R8(G,H);
-            Fp               = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
-            FF               = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
-            fvdw6            = _fjsp_mul_v2r8(c6_00,FF);
-
-            /* CUBIC SPLINE TABLE REPULSION */
-            Y                = _fjsp_load_v2r8( vftab + vfconv.i[0] + 4 );
-            F                = _fjsp_setzero_v2r8();
-            GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
-            G                = _fjsp_load_v2r8( vftab + vfconv.i[0] + 6 );
-            H                = _fjsp_setzero_v2r8();
-            GMX_FJSP_TRANSPOSE2_V2R8(G,H);
-            Fp               = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(H,vfeps,G),F);
-            FF               = _fjsp_madd_v2r8(vfeps,_fjsp_madd_v2r8(twovfeps,H,G),Fp);
-            fvdw12           = _fjsp_mul_v2r8(c12_00,FF);
-            fvdw             = _fjsp_neg_v2r8(_fjsp_mul_v2r8(_fjsp_add_v2r8(fvdw6,fvdw12),_fjsp_mul_v2r8(vftabscale,rinv00)));
-
-            fscal            = _fjsp_add_v2r8(felec,fvdw);
-
-            fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
-
-            /* Update vectorial force */
-            fix0             = _fjsp_madd_v2r8(dx00,fscal,fix0);
-            fiy0             = _fjsp_madd_v2r8(dy00,fscal,fiy0);
-            fiz0             = _fjsp_madd_v2r8(dz00,fscal,fiz0);
-            
-            gmx_fjsp_decrement_fma_1rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fscal,dx00,dy00,dz00);
-
-            /* Inner loop uses 85 flops */
-        }
-
-        /* End of innermost loop */
-
-        gmx_fjsp_update_iforce_1atom_swizzle_v2r8(fix0,fiy0,fiz0,
-                                              f+i_coord_offset,fshift+i_shift_offset);
-
-        dvdasum = _fjsp_mul_v2r8(dvdasum, _fjsp_mul_v2r8(isai0,isai0));
-        gmx_fjsp_update_1pot_v2r8(dvdasum,dvda+inr);
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 7 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_F,outeriter*7 + inneriter*85);
-}
diff --git a/src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecGB_VdwLJ_GeomP1P1_sparc64_hpc_ace_double.c b/src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecGB_VdwLJ_GeomP1P1_sparc64_hpc_ace_double.c
deleted file mode 100644 (file)
index ccb3de7..0000000
+++ /dev/null
@@ -1,706 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
- * and including many others, as listed in the AUTHORS file in the
- * top-level source directory and at http://www.gromacs.org.
- *
- * GROMACS is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * GROMACS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GROMACS; if not, see
- * http://www.gnu.org/licenses, or write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
- *
- * If you want to redistribute modifications to GROMACS, please
- * consider that scientific software is very special. Version
- * control is crucial - bugs must be traceable. We will be happy to
- * consider code for inclusion in the official distribution, but
- * derived work must not be called official GROMACS. Details are found
- * in the README & COPYING files - if they are missing, get the
- * official version at http://www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the research papers on the package. Check out http://www.gromacs.org.
- */
-/*
- * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
- */
-#include "gmxpre.h"
-
-#include "config.h"
-
-#include <math.h>
-
-#include "../nb_kernel.h"
-#include "gromacs/gmxlib/nrnb.h"
-
-#include "kernelutil_sparc64_hpc_ace_double.h"
-
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_sparc64_hpc_ace_double
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            LennardJones
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        PotentialAndForce
- */
-void
-nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_sparc64_hpc_ace_double
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
-     * just 0 for non-waters.
-     * Suffixes A,B refer to j loop unrolling done with double precision SIMD, e.g. for the two different
-     * jnr indices corresponding to data put in the four positions in the SIMD register.
-     */
-    int              i_shift_offset,i_coord_offset,outeriter,inneriter;
-    int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
-    int              jnrA,jnrB;
-    int              j_coord_offsetA,j_coord_offsetB;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             rcutoff_scalar;
-    real             *shiftvec,*fshift,*x,*f;
-    _fjsp_v2r8       tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
-    int              vdwioffset0;
-    _fjsp_v2r8       ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0A,vdwjidx0B;
-    _fjsp_v2r8       jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    _fjsp_v2r8       dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
-    _fjsp_v2r8       velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    _fjsp_v2r8       vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,dvdaj,gbeps,twogbeps,dvdatmp;
-    _fjsp_v2r8       minushalf = gmx_fjsp_set1_v2r8(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    int              nvdwtype;
-    _fjsp_v2r8       rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
-    int              *vdwtype;
-    real             *vdwparam;
-    _fjsp_v2r8       one_sixth   = gmx_fjsp_set1_v2r8(1.0/6.0);
-    _fjsp_v2r8       one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
-    _fjsp_v2r8       rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF,twovfeps;
-    real             *vftab;
-    _fjsp_v2r8       itab_tmp;
-    _fjsp_v2r8       dummy_mask,cutoff_mask;
-    _fjsp_v2r8       one     = gmx_fjsp_set1_v2r8(1.0);
-    _fjsp_v2r8       two     = gmx_fjsp_set1_v2r8(2.0);
-    union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
-
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = gmx_fjsp_set1_v2r8(fr->ic->epsfac);
-    charge           = mdatoms->chargeA;
-    nvdwtype         = fr->ntype;
-    vdwparam         = fr->nbfp;
-    vdwtype          = mdatoms->typeA;
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = gmx_fjsp_set1_v2r8(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = gmx_fjsp_set1_v2r8((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-
-    /* Avoid stupid compiler warnings */
-    jnrA = jnrB = 0;
-    j_coord_offsetA = 0;
-    j_coord_offsetB = 0;
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        gmx_fjsp_load_shift_and_1rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
-
-        fix0             = _fjsp_setzero_v2r8();
-        fiy0             = _fjsp_setzero_v2r8();
-        fiz0             = _fjsp_setzero_v2r8();
-
-        /* Load parameters for i particles */
-        iq0              = _fjsp_mul_v2r8(facel,gmx_fjsp_load1_v2r8(charge+inr+0));
-        isai0            = gmx_fjsp_load1_v2r8(invsqrta+inr+0);
-        vdwioffset0      = 2*nvdwtype*vdwtype[inr+0];
-
-        /* Reset potential sums */
-        velecsum         = _fjsp_setzero_v2r8();
-        vgbsum           = _fjsp_setzero_v2r8();
-        vvdwsum          = _fjsp_setzero_v2r8();
-        dvdasum          = _fjsp_setzero_v2r8();
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrA             = jjnr[jidx];
-            jnrB             = jjnr[jidx+1];
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-
-            /* load j atom coordinates */
-            gmx_fjsp_load_1rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _fjsp_sub_v2r8(ix0,jx0);
-            dy00             = _fjsp_sub_v2r8(iy0,jy0);
-            dz00             = _fjsp_sub_v2r8(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
-
-            rinv00           = gmx_fjsp_invsqrt_v2r8(rsq00);
-
-            rinvsq00         = _fjsp_mul_v2r8(rinv00,rinv00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_fjsp_load_2real_swizzle_v2r8(charge+jnrA+0,charge+jnrB+0);
-            isaj0            = gmx_fjsp_load_2real_swizzle_v2r8(invsqrta+jnrA+0,invsqrta+jnrB+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-            vdwjidx0B        = 2*vdwtype[jnrB+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _fjsp_mul_v2r8(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _fjsp_mul_v2r8(iq0,jq0);
-            gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
-                                         vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _fjsp_mul_v2r8(isai0,isaj0);
-            gbqqfactor       = _fjsp_neg_v2r8(_fjsp_mul_v2r8(qq00,_fjsp_mul_v2r8(isaprod,gbinvepsdiff)));
-            gbscale          = _fjsp_mul_v2r8(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _fjsp_mul_v2r8(r00,gbscale);
-            itab_tmp         = _fjsp_dtox_v2r8(rt);
-            gbeps            = _fjsp_sub_v2r8(rt,_fjsp_xtod_v2r8(itab_tmp));
-            _fjsp_store_v2r8(&gbconv.simd,itab_tmp);
-
-            Y                = _fjsp_load_v2r8( gbtab + 4*gbconv.i[0] );
-            F                = _fjsp_load_v2r8( gbtab + 4*gbconv.i[1] );
-            GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
-            G                = _fjsp_load_v2r8( gbtab + 4*gbconv.i[0] +2);
-            H                = _fjsp_load_v2r8( gbtab + 4*gbconv.i[1] +2);
-            GMX_FJSP_TRANSPOSE2_V2R8(G,H);
-            Fp               = _fjsp_madd_v2r8(gbeps,_fjsp_madd_v2r8(gbeps,H,G),F);
-            VV               = _fjsp_madd_v2r8(gbeps,Fp,Y);
-            vgb              = _fjsp_mul_v2r8(gbqqfactor,VV);
-
-            twogbeps         = _fjsp_add_v2r8(gbeps,gbeps);
-            FF               = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twogbeps,H,G),gbeps,Fp);
-            fgb              = _fjsp_mul_v2r8(gbqqfactor,_fjsp_mul_v2r8(FF,gbscale));
-            dvdatmp          = _fjsp_mul_v2r8(minushalf,_fjsp_madd_v2r8(fgb,r00,vgb));
-            dvdasum          = _fjsp_add_v2r8(dvdasum,dvdatmp);
-            gmx_fjsp_increment_2real_swizzle_v2r8(dvda+jnrA,dvda+jnrB,_fjsp_mul_v2r8(dvdatmp,_fjsp_mul_v2r8(isaj0,isaj0)));
-            velec            = _fjsp_mul_v2r8(qq00,rinv00);
-            felec            = _fjsp_mul_v2r8(_fjsp_msub_v2r8(velec,rinv00,fgb),rinv00);
-
-            /* LENNARD-JONES DISPERSION/REPULSION */
-
-            rinvsix          = _fjsp_mul_v2r8(_fjsp_mul_v2r8(rinvsq00,rinvsq00),rinvsq00);
-            vvdw6            = _fjsp_mul_v2r8(c6_00,rinvsix);
-            vvdw12           = _fjsp_mul_v2r8(c12_00,_fjsp_mul_v2r8(rinvsix,rinvsix));
-            vvdw             = _fjsp_msub_v2r8( vvdw12,one_twelfth, _fjsp_mul_v2r8(vvdw6,one_sixth) );
-            fvdw             = _fjsp_mul_v2r8(_fjsp_sub_v2r8(vvdw12,vvdw6),rinvsq00);
-
-            /* Update potential sum for this i atom from the interaction with this j atom. */
-            velecsum         = _fjsp_add_v2r8(velecsum,velec);
-            vgbsum           = _fjsp_add_v2r8(vgbsum,vgb);
-            vvdwsum          = _fjsp_add_v2r8(vvdwsum,vvdw);
-
-            fscal            = _fjsp_add_v2r8(felec,fvdw);
-
-            /* Update vectorial force */
-            fix0             = _fjsp_madd_v2r8(dx00,fscal,fix0);
-            fiy0             = _fjsp_madd_v2r8(dy00,fscal,fiy0);
-            fiz0             = _fjsp_madd_v2r8(dz00,fscal,fiz0);
-            
-            gmx_fjsp_decrement_fma_1rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fscal,dx00,dy00,dz00);
-
-            /* Inner loop uses 74 flops */
-        }
-
-        if(jidx<j_index_end)
-        {
-
-            jnrA             = jjnr[jidx];
-            j_coord_offsetA  = DIM*jnrA;
-
-            /* load j atom coordinates */
-            gmx_fjsp_load_1rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _fjsp_sub_v2r8(ix0,jx0);
-            dy00             = _fjsp_sub_v2r8(iy0,jy0);
-            dz00             = _fjsp_sub_v2r8(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
-
-            rinv00           = gmx_fjsp_invsqrt_v2r8(rsq00);
-
-            rinvsq00         = _fjsp_mul_v2r8(rinv00,rinv00);
-
-            /* Load parameters for j particles */
-            jq0              = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(),charge+jnrA+0);
-            isaj0            = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(),invsqrta+jnrA+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _fjsp_mul_v2r8(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _fjsp_mul_v2r8(iq0,jq0);
-            gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
-                                         vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _fjsp_mul_v2r8(isai0,isaj0);
-            gbqqfactor       = _fjsp_neg_v2r8(_fjsp_mul_v2r8(qq00,_fjsp_mul_v2r8(isaprod,gbinvepsdiff)));
-            gbscale          = _fjsp_mul_v2r8(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _fjsp_mul_v2r8(r00,gbscale);
-            itab_tmp         = _fjsp_dtox_v2r8(rt);
-            gbeps            = _fjsp_sub_v2r8(rt,_fjsp_xtod_v2r8(itab_tmp));
-            _fjsp_store_v2r8(&gbconv.simd,itab_tmp);
-
-            Y                = _fjsp_load_v2r8( gbtab + 4*gbconv.i[0] );
-            F                = _fjsp_setzero_v2r8();
-            GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
-            G                = _fjsp_load_v2r8( gbtab + 4*gbconv.i[0] +2);
-            H                = _fjsp_setzero_v2r8();
-            GMX_FJSP_TRANSPOSE2_V2R8(G,H);
-            Fp               = _fjsp_madd_v2r8(gbeps,_fjsp_madd_v2r8(gbeps,H,G),F);
-            VV               = _fjsp_madd_v2r8(gbeps,Fp,Y);
-            vgb              = _fjsp_mul_v2r8(gbqqfactor,VV);
-
-            twogbeps         = _fjsp_add_v2r8(gbeps,gbeps);
-            FF               = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twogbeps,H,G),gbeps,Fp);
-            fgb              = _fjsp_mul_v2r8(gbqqfactor,_fjsp_mul_v2r8(FF,gbscale));
-            dvdatmp          = _fjsp_mul_v2r8(minushalf,_fjsp_madd_v2r8(fgb,r00,vgb));
-            dvdasum          = _fjsp_add_v2r8(dvdasum,dvdatmp);
-            gmx_fjsp_increment_1real_v2r8(dvda+jnrA,_fjsp_mul_v2r8(dvdatmp,_fjsp_mul_v2r8(isaj0,isaj0)));
-            velec            = _fjsp_mul_v2r8(qq00,rinv00);
-            felec            = _fjsp_mul_v2r8(_fjsp_msub_v2r8(velec,rinv00,fgb),rinv00);
-
-            /* LENNARD-JONES DISPERSION/REPULSION */
-
-            rinvsix          = _fjsp_mul_v2r8(_fjsp_mul_v2r8(rinvsq00,rinvsq00),rinvsq00);
-            vvdw6            = _fjsp_mul_v2r8(c6_00,rinvsix);
-            vvdw12           = _fjsp_mul_v2r8(c12_00,_fjsp_mul_v2r8(rinvsix,rinvsix));
-            vvdw             = _fjsp_msub_v2r8( vvdw12,one_twelfth, _fjsp_mul_v2r8(vvdw6,one_sixth) );
-            fvdw             = _fjsp_mul_v2r8(_fjsp_sub_v2r8(vvdw12,vvdw6),rinvsq00);
-
-            /* Update potential sum for this i atom from the interaction with this j atom. */
-            velec            = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
-            velecsum         = _fjsp_add_v2r8(velecsum,velec);
-            vgb              = _fjsp_unpacklo_v2r8(vgb,_fjsp_setzero_v2r8());
-            vgbsum           = _fjsp_add_v2r8(vgbsum,vgb);
-            vvdw             = _fjsp_unpacklo_v2r8(vvdw,_fjsp_setzero_v2r8());
-            vvdwsum          = _fjsp_add_v2r8(vvdwsum,vvdw);
-
-            fscal            = _fjsp_add_v2r8(felec,fvdw);
-
-            fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
-
-            /* Update vectorial force */
-            fix0             = _fjsp_madd_v2r8(dx00,fscal,fix0);
-            fiy0             = _fjsp_madd_v2r8(dy00,fscal,fiy0);
-            fiz0             = _fjsp_madd_v2r8(dz00,fscal,fiz0);
-            
-            gmx_fjsp_decrement_fma_1rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fscal,dx00,dy00,dz00);
-
-            /* Inner loop uses 74 flops */
-        }
-
-        /* End of innermost loop */
-
-        gmx_fjsp_update_iforce_1atom_swizzle_v2r8(fix0,fiy0,fiz0,
-                                              f+i_coord_offset,fshift+i_shift_offset);
-
-        ggid                        = gid[iidx];
-        /* Update potential energies */
-        gmx_fjsp_update_1pot_v2r8(velecsum,kernel_data->energygrp_elec+ggid);
-        gmx_fjsp_update_1pot_v2r8(vgbsum,kernel_data->energygrp_polarization+ggid);
-        gmx_fjsp_update_1pot_v2r8(vvdwsum,kernel_data->energygrp_vdw+ggid);
-        dvdasum = _fjsp_mul_v2r8(dvdasum, _fjsp_mul_v2r8(isai0,isai0));
-        gmx_fjsp_update_1pot_v2r8(dvdasum,dvda+inr);
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 10 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_VF,outeriter*10 + inneriter*74);
-}
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_sparc64_hpc_ace_double
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            LennardJones
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        Force
- */
-void
-nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_sparc64_hpc_ace_double
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
-     * just 0 for non-waters.
-     * Suffixes A,B refer to j loop unrolling done with double precision SIMD, e.g. for the two different
-     * jnr indices corresponding to data put in the four positions in the SIMD register.
-     */
-    int              i_shift_offset,i_coord_offset,outeriter,inneriter;
-    int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
-    int              jnrA,jnrB;
-    int              j_coord_offsetA,j_coord_offsetB;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             rcutoff_scalar;
-    real             *shiftvec,*fshift,*x,*f;
-    _fjsp_v2r8       tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
-    int              vdwioffset0;
-    _fjsp_v2r8       ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0A,vdwjidx0B;
-    _fjsp_v2r8       jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    _fjsp_v2r8       dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
-    _fjsp_v2r8       velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    _fjsp_v2r8       vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,dvdaj,gbeps,twogbeps,dvdatmp;
-    _fjsp_v2r8       minushalf = gmx_fjsp_set1_v2r8(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    int              nvdwtype;
-    _fjsp_v2r8       rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
-    int              *vdwtype;
-    real             *vdwparam;
-    _fjsp_v2r8       one_sixth   = gmx_fjsp_set1_v2r8(1.0/6.0);
-    _fjsp_v2r8       one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
-    _fjsp_v2r8       rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF,twovfeps;
-    real             *vftab;
-    _fjsp_v2r8       itab_tmp;
-    _fjsp_v2r8       dummy_mask,cutoff_mask;
-    _fjsp_v2r8       one     = gmx_fjsp_set1_v2r8(1.0);
-    _fjsp_v2r8       two     = gmx_fjsp_set1_v2r8(2.0);
-    union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
-
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = gmx_fjsp_set1_v2r8(fr->ic->epsfac);
-    charge           = mdatoms->chargeA;
-    nvdwtype         = fr->ntype;
-    vdwparam         = fr->nbfp;
-    vdwtype          = mdatoms->typeA;
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = gmx_fjsp_set1_v2r8(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = gmx_fjsp_set1_v2r8((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-
-    /* Avoid stupid compiler warnings */
-    jnrA = jnrB = 0;
-    j_coord_offsetA = 0;
-    j_coord_offsetB = 0;
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        gmx_fjsp_load_shift_and_1rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
-
-        fix0             = _fjsp_setzero_v2r8();
-        fiy0             = _fjsp_setzero_v2r8();
-        fiz0             = _fjsp_setzero_v2r8();
-
-        /* Load parameters for i particles */
-        iq0              = _fjsp_mul_v2r8(facel,gmx_fjsp_load1_v2r8(charge+inr+0));
-        isai0            = gmx_fjsp_load1_v2r8(invsqrta+inr+0);
-        vdwioffset0      = 2*nvdwtype*vdwtype[inr+0];
-
-        dvdasum          = _fjsp_setzero_v2r8();
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrA             = jjnr[jidx];
-            jnrB             = jjnr[jidx+1];
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-
-            /* load j atom coordinates */
-            gmx_fjsp_load_1rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _fjsp_sub_v2r8(ix0,jx0);
-            dy00             = _fjsp_sub_v2r8(iy0,jy0);
-            dz00             = _fjsp_sub_v2r8(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
-
-            rinv00           = gmx_fjsp_invsqrt_v2r8(rsq00);
-
-            rinvsq00         = _fjsp_mul_v2r8(rinv00,rinv00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_fjsp_load_2real_swizzle_v2r8(charge+jnrA+0,charge+jnrB+0);
-            isaj0            = gmx_fjsp_load_2real_swizzle_v2r8(invsqrta+jnrA+0,invsqrta+jnrB+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-            vdwjidx0B        = 2*vdwtype[jnrB+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _fjsp_mul_v2r8(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _fjsp_mul_v2r8(iq0,jq0);
-            gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
-                                         vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _fjsp_mul_v2r8(isai0,isaj0);
-            gbqqfactor       = _fjsp_neg_v2r8(_fjsp_mul_v2r8(qq00,_fjsp_mul_v2r8(isaprod,gbinvepsdiff)));
-            gbscale          = _fjsp_mul_v2r8(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _fjsp_mul_v2r8(r00,gbscale);
-            itab_tmp         = _fjsp_dtox_v2r8(rt);
-            gbeps            = _fjsp_sub_v2r8(rt,_fjsp_xtod_v2r8(itab_tmp));
-            _fjsp_store_v2r8(&gbconv.simd,itab_tmp);
-
-            Y                = _fjsp_load_v2r8( gbtab + 4*gbconv.i[0] );
-            F                = _fjsp_load_v2r8( gbtab + 4*gbconv.i[1] );
-            GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
-            G                = _fjsp_load_v2r8( gbtab + 4*gbconv.i[0] +2);
-            H                = _fjsp_load_v2r8( gbtab + 4*gbconv.i[1] +2);
-            GMX_FJSP_TRANSPOSE2_V2R8(G,H);
-            Fp               = _fjsp_madd_v2r8(gbeps,_fjsp_madd_v2r8(gbeps,H,G),F);
-            VV               = _fjsp_madd_v2r8(gbeps,Fp,Y);
-            vgb              = _fjsp_mul_v2r8(gbqqfactor,VV);
-
-            twogbeps         = _fjsp_add_v2r8(gbeps,gbeps);
-            FF               = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twogbeps,H,G),gbeps,Fp);
-            fgb              = _fjsp_mul_v2r8(gbqqfactor,_fjsp_mul_v2r8(FF,gbscale));
-            dvdatmp          = _fjsp_mul_v2r8(minushalf,_fjsp_madd_v2r8(fgb,r00,vgb));
-            dvdasum          = _fjsp_add_v2r8(dvdasum,dvdatmp);
-            gmx_fjsp_increment_2real_swizzle_v2r8(dvda+jnrA,dvda+jnrB,_fjsp_mul_v2r8(dvdatmp,_fjsp_mul_v2r8(isaj0,isaj0)));
-            velec            = _fjsp_mul_v2r8(qq00,rinv00);
-            felec            = _fjsp_mul_v2r8(_fjsp_msub_v2r8(velec,rinv00,fgb),rinv00);
-
-            /* LENNARD-JONES DISPERSION/REPULSION */
-
-            rinvsix          = _fjsp_mul_v2r8(_fjsp_mul_v2r8(rinvsq00,rinvsq00),rinvsq00);
-            fvdw             = _fjsp_mul_v2r8(_fjsp_msub_v2r8(c12_00,rinvsix,c6_00),_fjsp_mul_v2r8(rinvsix,rinvsq00));
-
-            fscal            = _fjsp_add_v2r8(felec,fvdw);
-
-            /* Update vectorial force */
-            fix0             = _fjsp_madd_v2r8(dx00,fscal,fix0);
-            fiy0             = _fjsp_madd_v2r8(dy00,fscal,fiy0);
-            fiz0             = _fjsp_madd_v2r8(dz00,fscal,fiz0);
-            
-            gmx_fjsp_decrement_fma_1rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fscal,dx00,dy00,dz00);
-
-            /* Inner loop uses 67 flops */
-        }
-
-        if(jidx<j_index_end)
-        {
-
-            jnrA             = jjnr[jidx];
-            j_coord_offsetA  = DIM*jnrA;
-
-            /* load j atom coordinates */
-            gmx_fjsp_load_1rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _fjsp_sub_v2r8(ix0,jx0);
-            dy00             = _fjsp_sub_v2r8(iy0,jy0);
-            dz00             = _fjsp_sub_v2r8(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
-
-            rinv00           = gmx_fjsp_invsqrt_v2r8(rsq00);
-
-            rinvsq00         = _fjsp_mul_v2r8(rinv00,rinv00);
-
-            /* Load parameters for j particles */
-            jq0              = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(),charge+jnrA+0);
-            isaj0            = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(),invsqrta+jnrA+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _fjsp_mul_v2r8(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _fjsp_mul_v2r8(iq0,jq0);
-            gmx_fjsp_load_2pair_swizzle_v2r8(vdwparam+vdwioffset0+vdwjidx0A,
-                                         vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _fjsp_mul_v2r8(isai0,isaj0);
-            gbqqfactor       = _fjsp_neg_v2r8(_fjsp_mul_v2r8(qq00,_fjsp_mul_v2r8(isaprod,gbinvepsdiff)));
-            gbscale          = _fjsp_mul_v2r8(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _fjsp_mul_v2r8(r00,gbscale);
-            itab_tmp         = _fjsp_dtox_v2r8(rt);
-            gbeps            = _fjsp_sub_v2r8(rt,_fjsp_xtod_v2r8(itab_tmp));
-            _fjsp_store_v2r8(&gbconv.simd,itab_tmp);
-
-            Y                = _fjsp_load_v2r8( gbtab + 4*gbconv.i[0] );
-            F                = _fjsp_setzero_v2r8();
-            GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
-            G                = _fjsp_load_v2r8( gbtab + 4*gbconv.i[0] +2);
-            H                = _fjsp_setzero_v2r8();
-            GMX_FJSP_TRANSPOSE2_V2R8(G,H);
-            Fp               = _fjsp_madd_v2r8(gbeps,_fjsp_madd_v2r8(gbeps,H,G),F);
-            VV               = _fjsp_madd_v2r8(gbeps,Fp,Y);
-            vgb              = _fjsp_mul_v2r8(gbqqfactor,VV);
-
-            twogbeps         = _fjsp_add_v2r8(gbeps,gbeps);
-            FF               = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twogbeps,H,G),gbeps,Fp);
-            fgb              = _fjsp_mul_v2r8(gbqqfactor,_fjsp_mul_v2r8(FF,gbscale));
-            dvdatmp          = _fjsp_mul_v2r8(minushalf,_fjsp_madd_v2r8(fgb,r00,vgb));
-            dvdasum          = _fjsp_add_v2r8(dvdasum,dvdatmp);
-            gmx_fjsp_increment_1real_v2r8(dvda+jnrA,_fjsp_mul_v2r8(dvdatmp,_fjsp_mul_v2r8(isaj0,isaj0)));
-            velec            = _fjsp_mul_v2r8(qq00,rinv00);
-            felec            = _fjsp_mul_v2r8(_fjsp_msub_v2r8(velec,rinv00,fgb),rinv00);
-
-            /* LENNARD-JONES DISPERSION/REPULSION */
-
-            rinvsix          = _fjsp_mul_v2r8(_fjsp_mul_v2r8(rinvsq00,rinvsq00),rinvsq00);
-            fvdw             = _fjsp_mul_v2r8(_fjsp_msub_v2r8(c12_00,rinvsix,c6_00),_fjsp_mul_v2r8(rinvsix,rinvsq00));
-
-            fscal            = _fjsp_add_v2r8(felec,fvdw);
-
-            fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
-
-            /* Update vectorial force */
-            fix0             = _fjsp_madd_v2r8(dx00,fscal,fix0);
-            fiy0             = _fjsp_madd_v2r8(dy00,fscal,fiy0);
-            fiz0             = _fjsp_madd_v2r8(dz00,fscal,fiz0);
-            
-            gmx_fjsp_decrement_fma_1rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fscal,dx00,dy00,dz00);
-
-            /* Inner loop uses 67 flops */
-        }
-
-        /* End of innermost loop */
-
-        gmx_fjsp_update_iforce_1atom_swizzle_v2r8(fix0,fiy0,fiz0,
-                                              f+i_coord_offset,fshift+i_shift_offset);
-
-        dvdasum = _fjsp_mul_v2r8(dvdasum, _fjsp_mul_v2r8(isai0,isai0));
-        gmx_fjsp_update_1pot_v2r8(dvdasum,dvda+inr);
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 7 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_F,outeriter*7 + inneriter*67);
-}
diff --git a/src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecGB_VdwNone_GeomP1P1_sparc64_hpc_ace_double.c b/src/gromacs/gmxlib/nonbonded/nb_kernel_sparc64_hpc_ace_double/nb_kernel_ElecGB_VdwNone_GeomP1P1_sparc64_hpc_ace_double.c
deleted file mode 100644 (file)
index 5d52647..0000000
+++ /dev/null
@@ -1,633 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
- * and including many others, as listed in the AUTHORS file in the
- * top-level source directory and at http://www.gromacs.org.
- *
- * GROMACS is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * GROMACS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GROMACS; if not, see
- * http://www.gnu.org/licenses, or write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
- *
- * If you want to redistribute modifications to GROMACS, please
- * consider that scientific software is very special. Version
- * control is crucial - bugs must be traceable. We will be happy to
- * consider code for inclusion in the official distribution, but
- * derived work must not be called official GROMACS. Details are found
- * in the README & COPYING files - if they are missing, get the
- * official version at http://www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the research papers on the package. Check out http://www.gromacs.org.
- */
-/*
- * Note: this file was generated by the GROMACS sparc64_hpc_ace_double kernel generator.
- */
-#include "gmxpre.h"
-
-#include "config.h"
-
-#include <math.h>
-
-#include "../nb_kernel.h"
-#include "gromacs/gmxlib/nrnb.h"
-
-#include "kernelutil_sparc64_hpc_ace_double.h"
-
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_sparc64_hpc_ace_double
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            None
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        PotentialAndForce
- */
-void
-nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_sparc64_hpc_ace_double
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
-     * just 0 for non-waters.
-     * Suffixes A,B refer to j loop unrolling done with double precision SIMD, e.g. for the two different
-     * jnr indices corresponding to data put in the four positions in the SIMD register.
-     */
-    int              i_shift_offset,i_coord_offset,outeriter,inneriter;
-    int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
-    int              jnrA,jnrB;
-    int              j_coord_offsetA,j_coord_offsetB;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             rcutoff_scalar;
-    real             *shiftvec,*fshift,*x,*f;
-    _fjsp_v2r8       tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
-    int              vdwioffset0;
-    _fjsp_v2r8       ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0A,vdwjidx0B;
-    _fjsp_v2r8       jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    _fjsp_v2r8       dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
-    _fjsp_v2r8       velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    _fjsp_v2r8       vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,dvdaj,gbeps,twogbeps,dvdatmp;
-    _fjsp_v2r8       minushalf = gmx_fjsp_set1_v2r8(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    _fjsp_v2r8       rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF,twovfeps;
-    real             *vftab;
-    _fjsp_v2r8       itab_tmp;
-    _fjsp_v2r8       dummy_mask,cutoff_mask;
-    _fjsp_v2r8       one     = gmx_fjsp_set1_v2r8(1.0);
-    _fjsp_v2r8       two     = gmx_fjsp_set1_v2r8(2.0);
-    union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
-
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = gmx_fjsp_set1_v2r8(fr->ic->epsfac);
-    charge           = mdatoms->chargeA;
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = gmx_fjsp_set1_v2r8(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = gmx_fjsp_set1_v2r8((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-
-    /* Avoid stupid compiler warnings */
-    jnrA = jnrB = 0;
-    j_coord_offsetA = 0;
-    j_coord_offsetB = 0;
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        gmx_fjsp_load_shift_and_1rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
-
-        fix0             = _fjsp_setzero_v2r8();
-        fiy0             = _fjsp_setzero_v2r8();
-        fiz0             = _fjsp_setzero_v2r8();
-
-        /* Load parameters for i particles */
-        iq0              = _fjsp_mul_v2r8(facel,gmx_fjsp_load1_v2r8(charge+inr+0));
-        isai0            = gmx_fjsp_load1_v2r8(invsqrta+inr+0);
-
-        /* Reset potential sums */
-        velecsum         = _fjsp_setzero_v2r8();
-        vgbsum           = _fjsp_setzero_v2r8();
-        dvdasum          = _fjsp_setzero_v2r8();
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrA             = jjnr[jidx];
-            jnrB             = jjnr[jidx+1];
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-
-            /* load j atom coordinates */
-            gmx_fjsp_load_1rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _fjsp_sub_v2r8(ix0,jx0);
-            dy00             = _fjsp_sub_v2r8(iy0,jy0);
-            dz00             = _fjsp_sub_v2r8(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
-
-            rinv00           = gmx_fjsp_invsqrt_v2r8(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_fjsp_load_2real_swizzle_v2r8(charge+jnrA+0,charge+jnrB+0);
-            isaj0            = gmx_fjsp_load_2real_swizzle_v2r8(invsqrta+jnrA+0,invsqrta+jnrB+0);
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _fjsp_mul_v2r8(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _fjsp_mul_v2r8(iq0,jq0);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _fjsp_mul_v2r8(isai0,isaj0);
-            gbqqfactor       = _fjsp_neg_v2r8(_fjsp_mul_v2r8(qq00,_fjsp_mul_v2r8(isaprod,gbinvepsdiff)));
-            gbscale          = _fjsp_mul_v2r8(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _fjsp_mul_v2r8(r00,gbscale);
-            itab_tmp         = _fjsp_dtox_v2r8(rt);
-            gbeps            = _fjsp_sub_v2r8(rt,_fjsp_xtod_v2r8(itab_tmp));
-            _fjsp_store_v2r8(&gbconv.simd,itab_tmp);
-
-            Y                = _fjsp_load_v2r8( gbtab + 4*gbconv.i[0] );
-            F                = _fjsp_load_v2r8( gbtab + 4*gbconv.i[1] );
-            GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
-            G                = _fjsp_load_v2r8( gbtab + 4*gbconv.i[0] +2);
-            H                = _fjsp_load_v2r8( gbtab + 4*gbconv.i[1] +2);
-            GMX_FJSP_TRANSPOSE2_V2R8(G,H);
-            Fp               = _fjsp_madd_v2r8(gbeps,_fjsp_madd_v2r8(gbeps,H,G),F);
-            VV               = _fjsp_madd_v2r8(gbeps,Fp,Y);
-            vgb              = _fjsp_mul_v2r8(gbqqfactor,VV);
-
-            twogbeps         = _fjsp_add_v2r8(gbeps,gbeps);
-            FF               = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twogbeps,H,G),gbeps,Fp);
-            fgb              = _fjsp_mul_v2r8(gbqqfactor,_fjsp_mul_v2r8(FF,gbscale));
-            dvdatmp          = _fjsp_mul_v2r8(minushalf,_fjsp_madd_v2r8(fgb,r00,vgb));
-            dvdasum          = _fjsp_add_v2r8(dvdasum,dvdatmp);
-            gmx_fjsp_increment_2real_swizzle_v2r8(dvda+jnrA,dvda+jnrB,_fjsp_mul_v2r8(dvdatmp,_fjsp_mul_v2r8(isaj0,isaj0)));
-            velec            = _fjsp_mul_v2r8(qq00,rinv00);
-            felec            = _fjsp_mul_v2r8(_fjsp_msub_v2r8(velec,rinv00,fgb),rinv00);
-
-            /* Update potential sum for this i atom from the interaction with this j atom. */
-            velecsum         = _fjsp_add_v2r8(velecsum,velec);
-            vgbsum           = _fjsp_add_v2r8(vgbsum,vgb);
-
-            fscal            = felec;
-
-            /* Update vectorial force */
-            fix0             = _fjsp_madd_v2r8(dx00,fscal,fix0);
-            fiy0             = _fjsp_madd_v2r8(dy00,fscal,fiy0);
-            fiz0             = _fjsp_madd_v2r8(dz00,fscal,fiz0);
-            
-            gmx_fjsp_decrement_fma_1rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fscal,dx00,dy00,dz00);
-
-            /* Inner loop uses 61 flops */
-        }
-
-        if(jidx<j_index_end)
-        {
-
-            jnrA             = jjnr[jidx];
-            j_coord_offsetA  = DIM*jnrA;
-
-            /* load j atom coordinates */
-            gmx_fjsp_load_1rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _fjsp_sub_v2r8(ix0,jx0);
-            dy00             = _fjsp_sub_v2r8(iy0,jy0);
-            dz00             = _fjsp_sub_v2r8(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
-
-            rinv00           = gmx_fjsp_invsqrt_v2r8(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(),charge+jnrA+0);
-            isaj0            = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(),invsqrta+jnrA+0);
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _fjsp_mul_v2r8(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _fjsp_mul_v2r8(iq0,jq0);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _fjsp_mul_v2r8(isai0,isaj0);
-            gbqqfactor       = _fjsp_neg_v2r8(_fjsp_mul_v2r8(qq00,_fjsp_mul_v2r8(isaprod,gbinvepsdiff)));
-            gbscale          = _fjsp_mul_v2r8(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _fjsp_mul_v2r8(r00,gbscale);
-            itab_tmp         = _fjsp_dtox_v2r8(rt);
-            gbeps            = _fjsp_sub_v2r8(rt,_fjsp_xtod_v2r8(itab_tmp));
-            _fjsp_store_v2r8(&gbconv.simd,itab_tmp);
-
-            Y                = _fjsp_load_v2r8( gbtab + 4*gbconv.i[0] );
-            F                = _fjsp_setzero_v2r8();
-            GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
-            G                = _fjsp_load_v2r8( gbtab + 4*gbconv.i[0] +2);
-            H                = _fjsp_setzero_v2r8();
-            GMX_FJSP_TRANSPOSE2_V2R8(G,H);
-            Fp               = _fjsp_madd_v2r8(gbeps,_fjsp_madd_v2r8(gbeps,H,G),F);
-            VV               = _fjsp_madd_v2r8(gbeps,Fp,Y);
-            vgb              = _fjsp_mul_v2r8(gbqqfactor,VV);
-
-            twogbeps         = _fjsp_add_v2r8(gbeps,gbeps);
-            FF               = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twogbeps,H,G),gbeps,Fp);
-            fgb              = _fjsp_mul_v2r8(gbqqfactor,_fjsp_mul_v2r8(FF,gbscale));
-            dvdatmp          = _fjsp_mul_v2r8(minushalf,_fjsp_madd_v2r8(fgb,r00,vgb));
-            dvdasum          = _fjsp_add_v2r8(dvdasum,dvdatmp);
-            gmx_fjsp_increment_1real_v2r8(dvda+jnrA,_fjsp_mul_v2r8(dvdatmp,_fjsp_mul_v2r8(isaj0,isaj0)));
-            velec            = _fjsp_mul_v2r8(qq00,rinv00);
-            felec            = _fjsp_mul_v2r8(_fjsp_msub_v2r8(velec,rinv00,fgb),rinv00);
-
-            /* Update potential sum for this i atom from the interaction with this j atom. */
-            velec            = _fjsp_unpacklo_v2r8(velec,_fjsp_setzero_v2r8());
-            velecsum         = _fjsp_add_v2r8(velecsum,velec);
-            vgb              = _fjsp_unpacklo_v2r8(vgb,_fjsp_setzero_v2r8());
-            vgbsum           = _fjsp_add_v2r8(vgbsum,vgb);
-
-            fscal            = felec;
-
-            fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
-
-            /* Update vectorial force */
-            fix0             = _fjsp_madd_v2r8(dx00,fscal,fix0);
-            fiy0             = _fjsp_madd_v2r8(dy00,fscal,fiy0);
-            fiz0             = _fjsp_madd_v2r8(dz00,fscal,fiz0);
-            
-            gmx_fjsp_decrement_fma_1rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fscal,dx00,dy00,dz00);
-
-            /* Inner loop uses 61 flops */
-        }
-
-        /* End of innermost loop */
-
-        gmx_fjsp_update_iforce_1atom_swizzle_v2r8(fix0,fiy0,fiz0,
-                                              f+i_coord_offset,fshift+i_shift_offset);
-
-        ggid                        = gid[iidx];
-        /* Update potential energies */
-        gmx_fjsp_update_1pot_v2r8(velecsum,kernel_data->energygrp_elec+ggid);
-        gmx_fjsp_update_1pot_v2r8(vgbsum,kernel_data->energygrp_polarization+ggid);
-        dvdasum = _fjsp_mul_v2r8(dvdasum, _fjsp_mul_v2r8(isai0,isai0));
-        gmx_fjsp_update_1pot_v2r8(dvdasum,dvda+inr);
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 9 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VF,outeriter*9 + inneriter*61);
-}
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwNone_GeomP1P1_F_sparc64_hpc_ace_double
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            None
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        Force
- */
-void
-nb_kernel_ElecGB_VdwNone_GeomP1P1_F_sparc64_hpc_ace_double
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
-     * just 0 for non-waters.
-     * Suffixes A,B refer to j loop unrolling done with double precision SIMD, e.g. for the two different
-     * jnr indices corresponding to data put in the four positions in the SIMD register.
-     */
-    int              i_shift_offset,i_coord_offset,outeriter,inneriter;
-    int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
-    int              jnrA,jnrB;
-    int              j_coord_offsetA,j_coord_offsetB;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             rcutoff_scalar;
-    real             *shiftvec,*fshift,*x,*f;
-    _fjsp_v2r8       tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
-    int              vdwioffset0;
-    _fjsp_v2r8       ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0A,vdwjidx0B;
-    _fjsp_v2r8       jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    _fjsp_v2r8       dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
-    _fjsp_v2r8       velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    _fjsp_v2r8       vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,dvdaj,gbeps,twogbeps,dvdatmp;
-    _fjsp_v2r8       minushalf = gmx_fjsp_set1_v2r8(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    _fjsp_v2r8       rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF,twovfeps;
-    real             *vftab;
-    _fjsp_v2r8       itab_tmp;
-    _fjsp_v2r8       dummy_mask,cutoff_mask;
-    _fjsp_v2r8       one     = gmx_fjsp_set1_v2r8(1.0);
-    _fjsp_v2r8       two     = gmx_fjsp_set1_v2r8(2.0);
-    union { _fjsp_v2r8 simd; long long int i[2]; } vfconv,gbconv,ewconv;
-
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = gmx_fjsp_set1_v2r8(fr->ic->epsfac);
-    charge           = mdatoms->chargeA;
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = gmx_fjsp_set1_v2r8(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = gmx_fjsp_set1_v2r8((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-
-    /* Avoid stupid compiler warnings */
-    jnrA = jnrB = 0;
-    j_coord_offsetA = 0;
-    j_coord_offsetB = 0;
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        gmx_fjsp_load_shift_and_1rvec_broadcast_v2r8(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
-
-        fix0             = _fjsp_setzero_v2r8();
-        fiy0             = _fjsp_setzero_v2r8();
-        fiz0             = _fjsp_setzero_v2r8();
-
-        /* Load parameters for i particles */
-        iq0              = _fjsp_mul_v2r8(facel,gmx_fjsp_load1_v2r8(charge+inr+0));
-        isai0            = gmx_fjsp_load1_v2r8(invsqrta+inr+0);
-
-        dvdasum          = _fjsp_setzero_v2r8();
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrA             = jjnr[jidx];
-            jnrB             = jjnr[jidx+1];
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-
-            /* load j atom coordinates */
-            gmx_fjsp_load_1rvec_2ptr_swizzle_v2r8(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _fjsp_sub_v2r8(ix0,jx0);
-            dy00             = _fjsp_sub_v2r8(iy0,jy0);
-            dz00             = _fjsp_sub_v2r8(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
-
-            rinv00           = gmx_fjsp_invsqrt_v2r8(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_fjsp_load_2real_swizzle_v2r8(charge+jnrA+0,charge+jnrB+0);
-            isaj0            = gmx_fjsp_load_2real_swizzle_v2r8(invsqrta+jnrA+0,invsqrta+jnrB+0);
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _fjsp_mul_v2r8(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _fjsp_mul_v2r8(iq0,jq0);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _fjsp_mul_v2r8(isai0,isaj0);
-            gbqqfactor       = _fjsp_neg_v2r8(_fjsp_mul_v2r8(qq00,_fjsp_mul_v2r8(isaprod,gbinvepsdiff)));
-            gbscale          = _fjsp_mul_v2r8(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _fjsp_mul_v2r8(r00,gbscale);
-            itab_tmp         = _fjsp_dtox_v2r8(rt);
-            gbeps            = _fjsp_sub_v2r8(rt,_fjsp_xtod_v2r8(itab_tmp));
-            _fjsp_store_v2r8(&gbconv.simd,itab_tmp);
-
-            Y                = _fjsp_load_v2r8( gbtab + 4*gbconv.i[0] );
-            F                = _fjsp_load_v2r8( gbtab + 4*gbconv.i[1] );
-            GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
-            G                = _fjsp_load_v2r8( gbtab + 4*gbconv.i[0] +2);
-            H                = _fjsp_load_v2r8( gbtab + 4*gbconv.i[1] +2);
-            GMX_FJSP_TRANSPOSE2_V2R8(G,H);
-            Fp               = _fjsp_madd_v2r8(gbeps,_fjsp_madd_v2r8(gbeps,H,G),F);
-            VV               = _fjsp_madd_v2r8(gbeps,Fp,Y);
-            vgb              = _fjsp_mul_v2r8(gbqqfactor,VV);
-
-            twogbeps         = _fjsp_add_v2r8(gbeps,gbeps);
-            FF               = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twogbeps,H,G),gbeps,Fp);
-            fgb              = _fjsp_mul_v2r8(gbqqfactor,_fjsp_mul_v2r8(FF,gbscale));
-            dvdatmp          = _fjsp_mul_v2r8(minushalf,_fjsp_madd_v2r8(fgb,r00,vgb));
-            dvdasum          = _fjsp_add_v2r8(dvdasum,dvdatmp);
-            gmx_fjsp_increment_2real_swizzle_v2r8(dvda+jnrA,dvda+jnrB,_fjsp_mul_v2r8(dvdatmp,_fjsp_mul_v2r8(isaj0,isaj0)));
-            velec            = _fjsp_mul_v2r8(qq00,rinv00);
-            felec            = _fjsp_mul_v2r8(_fjsp_msub_v2r8(velec,rinv00,fgb),rinv00);
-
-            fscal            = felec;
-
-            /* Update vectorial force */
-            fix0             = _fjsp_madd_v2r8(dx00,fscal,fix0);
-            fiy0             = _fjsp_madd_v2r8(dy00,fscal,fiy0);
-            fiz0             = _fjsp_madd_v2r8(dz00,fscal,fiz0);
-            
-            gmx_fjsp_decrement_fma_1rvec_2ptr_swizzle_v2r8(f+j_coord_offsetA,f+j_coord_offsetB,fscal,dx00,dy00,dz00);
-
-            /* Inner loop uses 59 flops */
-        }
-
-        if(jidx<j_index_end)
-        {
-
-            jnrA             = jjnr[jidx];
-            j_coord_offsetA  = DIM*jnrA;
-
-            /* load j atom coordinates */
-            gmx_fjsp_load_1rvec_1ptr_swizzle_v2r8(x+j_coord_offsetA,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _fjsp_sub_v2r8(ix0,jx0);
-            dy00             = _fjsp_sub_v2r8(iy0,jy0);
-            dz00             = _fjsp_sub_v2r8(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_fjsp_calc_rsq_v2r8(dx00,dy00,dz00);
-
-            rinv00           = gmx_fjsp_invsqrt_v2r8(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(),charge+jnrA+0);
-            isaj0            = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(),invsqrta+jnrA+0);
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _fjsp_mul_v2r8(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _fjsp_mul_v2r8(iq0,jq0);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _fjsp_mul_v2r8(isai0,isaj0);
-            gbqqfactor       = _fjsp_neg_v2r8(_fjsp_mul_v2r8(qq00,_fjsp_mul_v2r8(isaprod,gbinvepsdiff)));
-            gbscale          = _fjsp_mul_v2r8(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _fjsp_mul_v2r8(r00,gbscale);
-            itab_tmp         = _fjsp_dtox_v2r8(rt);
-            gbeps            = _fjsp_sub_v2r8(rt,_fjsp_xtod_v2r8(itab_tmp));
-            _fjsp_store_v2r8(&gbconv.simd,itab_tmp);
-
-            Y                = _fjsp_load_v2r8( gbtab + 4*gbconv.i[0] );
-            F                = _fjsp_setzero_v2r8();
-            GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
-            G                = _fjsp_load_v2r8( gbtab + 4*gbconv.i[0] +2);
-            H                = _fjsp_setzero_v2r8();
-            GMX_FJSP_TRANSPOSE2_V2R8(G,H);
-            Fp               = _fjsp_madd_v2r8(gbeps,_fjsp_madd_v2r8(gbeps,H,G),F);
-            VV               = _fjsp_madd_v2r8(gbeps,Fp,Y);
-            vgb              = _fjsp_mul_v2r8(gbqqfactor,VV);
-
-            twogbeps         = _fjsp_add_v2r8(gbeps,gbeps);
-            FF               = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twogbeps,H,G),gbeps,Fp);
-            fgb              = _fjsp_mul_v2r8(gbqqfactor,_fjsp_mul_v2r8(FF,gbscale));
-            dvdatmp          = _fjsp_mul_v2r8(minushalf,_fjsp_madd_v2r8(fgb,r00,vgb));
-            dvdasum          = _fjsp_add_v2r8(dvdasum,dvdatmp);
-            gmx_fjsp_increment_1real_v2r8(dvda+jnrA,_fjsp_mul_v2r8(dvdatmp,_fjsp_mul_v2r8(isaj0,isaj0)));
-            velec            = _fjsp_mul_v2r8(qq00,rinv00);
-            felec            = _fjsp_mul_v2r8(_fjsp_msub_v2r8(velec,rinv00,fgb),rinv00);
-
-            fscal            = felec;
-
-            fscal            = _fjsp_unpacklo_v2r8(fscal,_fjsp_setzero_v2r8());
-
-            /* Update vectorial force */
-            fix0             = _fjsp_madd_v2r8(dx00,fscal,fix0);
-            fiy0             = _fjsp_madd_v2r8(dy00,fscal,fiy0);
-            fiz0             = _fjsp_madd_v2r8(dz00,fscal,fiz0);
-            
-            gmx_fjsp_decrement_fma_1rvec_1ptr_swizzle_v2r8(f+j_coord_offsetA,fscal,dx00,dy00,dz00);
-
-            /* Inner loop uses 59 flops */
-        }
-
-        /* End of innermost loop */
-
-        gmx_fjsp_update_iforce_1atom_swizzle_v2r8(fix0,fiy0,fiz0,
-                                              f+i_coord_offset,fshift+i_shift_offset);
-
-        dvdasum = _fjsp_mul_v2r8(dvdasum, _fjsp_mul_v2r8(isai0,isai0));
-        gmx_fjsp_update_1pot_v2r8(dvdasum,dvda+inr);
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 7 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_F,outeriter*7 + inneriter*59);
-}
index 8b9f035c13b6409f406b37c716f869932af59be3..fe95d60267c848228cf336087c2a63f7a8e73c46 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -51,6 +51,36 @@ nb_kernel_t nb_kernel_ElecNone_VdwLJSw_GeomP1P1_VF_sparc64_hpc_ace_double;
 nb_kernel_t nb_kernel_ElecNone_VdwLJSw_GeomP1P1_F_sparc64_hpc_ace_double;
 nb_kernel_t nb_kernel_ElecNone_VdwCSTab_GeomP1P1_VF_sparc64_hpc_ace_double;
 nb_kernel_t nb_kernel_ElecNone_VdwCSTab_GeomP1P1_F_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_sparc64_hpc_ace_double;
 nb_kernel_t nb_kernel_ElecEw_VdwLJEw_GeomP1P1_VF_sparc64_hpc_ace_double;
 nb_kernel_t nb_kernel_ElecEw_VdwLJEw_GeomP1P1_F_sparc64_hpc_ace_double;
 nb_kernel_t nb_kernel_ElecEw_VdwLJEw_GeomW3P1_VF_sparc64_hpc_ace_double;
@@ -141,72 +171,6 @@ nb_kernel_t nb_kernel_ElecEwSw_VdwNone_GeomW4P1_VF_sparc64_hpc_ace_double;
 nb_kernel_t nb_kernel_ElecEwSw_VdwNone_GeomW4P1_F_sparc64_hpc_ace_double;
 nb_kernel_t nb_kernel_ElecEwSw_VdwNone_GeomW4W4_VF_sparc64_hpc_ace_double;
 nb_kernel_t nb_kernel_ElecEwSw_VdwNone_GeomW4W4_F_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecGB_VdwNone_GeomP1P1_F_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_sparc64_hpc_ace_double;
-nb_kernel_t nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_sparc64_hpc_ace_double;
 nb_kernel_t nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_VF_sparc64_hpc_ace_double;
 nb_kernel_t nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_F_sparc64_hpc_ace_double;
 nb_kernel_t nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_VF_sparc64_hpc_ace_double;
@@ -277,6 +241,36 @@ nb_kernel_t nb_kernel_ElecRF_VdwCSTab_GeomW4P1_VF_sparc64_hpc_ace_double;
 nb_kernel_t nb_kernel_ElecRF_VdwCSTab_GeomW4P1_F_sparc64_hpc_ace_double;
 nb_kernel_t nb_kernel_ElecRF_VdwCSTab_GeomW4W4_VF_sparc64_hpc_ace_double;
 nb_kernel_t nb_kernel_ElecRF_VdwCSTab_GeomW4W4_F_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_sparc64_hpc_ace_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_sparc64_hpc_ace_double;
 
 
 nb_kernel_info_t
@@ -294,6 +288,36 @@ nb_kernel_info_t
     { nb_kernel_ElecNone_VdwLJSw_GeomP1P1_F_sparc64_hpc_ace_double, "nb_kernel_ElecNone_VdwLJSw_GeomP1P1_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "None", "None", "LennardJones", "PotentialSwitch", "ParticleParticle", "", "Force" },
     { nb_kernel_ElecNone_VdwCSTab_GeomP1P1_VF_sparc64_hpc_ace_double, "nb_kernel_ElecNone_VdwCSTab_GeomP1P1_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "None", "None", "CubicSplineTable", "None", "ParticleParticle", "", "PotentialAndForce" },
     { nb_kernel_ElecNone_VdwCSTab_GeomP1P1_F_sparc64_hpc_ace_double, "nb_kernel_ElecNone_VdwCSTab_GeomP1P1_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "None", "None", "CubicSplineTable", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "LennardJones", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "LennardJones", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "LennardJones", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "LennardJones", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "LennardJones", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "LennardJones", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "LennardJones", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "LennardJones", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "LennardJones", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "LennardJones", "None", "Water4Water4", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "None", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "None", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "None", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "None", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "None", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "None", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "None", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "None", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "None", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "None", "None", "Water4Water4", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Water4", "", "Force" },
     { nb_kernel_ElecEw_VdwLJEw_GeomP1P1_VF_sparc64_hpc_ace_double, "nb_kernel_ElecEw_VdwLJEw_GeomP1P1_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Ewald", "None", "LJEwald", "None", "ParticleParticle", "", "PotentialAndForce" },
     { nb_kernel_ElecEw_VdwLJEw_GeomP1P1_F_sparc64_hpc_ace_double, "nb_kernel_ElecEw_VdwLJEw_GeomP1P1_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Ewald", "None", "LJEwald", "None", "ParticleParticle", "", "Force" },
     { nb_kernel_ElecEw_VdwLJEw_GeomW3P1_VF_sparc64_hpc_ace_double, "nb_kernel_ElecEw_VdwLJEw_GeomW3P1_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Ewald", "None", "LJEwald", "None", "Water3Particle", "", "PotentialAndForce" },
@@ -384,72 +408,6 @@ nb_kernel_info_t
     { nb_kernel_ElecEwSw_VdwNone_GeomW4P1_F_sparc64_hpc_ace_double, "nb_kernel_ElecEwSw_VdwNone_GeomW4P1_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Ewald", "PotentialSwitch", "None", "None", "Water4Particle", "", "Force" },
     { nb_kernel_ElecEwSw_VdwNone_GeomW4W4_VF_sparc64_hpc_ace_double, "nb_kernel_ElecEwSw_VdwNone_GeomW4W4_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Ewald", "PotentialSwitch", "None", "None", "Water4Water4", "", "PotentialAndForce" },
     { nb_kernel_ElecEwSw_VdwNone_GeomW4W4_F_sparc64_hpc_ace_double, "nb_kernel_ElecEwSw_VdwNone_GeomW4W4_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Ewald", "PotentialSwitch", "None", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "LennardJones", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "LennardJones", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "LennardJones", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "LennardJones", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "LennardJones", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "LennardJones", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "LennardJones", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "LennardJones", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "LennardJones", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "LennardJones", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "None", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "None", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "None", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "None", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "None", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "None", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "None", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "None", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "None", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "None", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "CubicSplineTable", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "CubicSplineTable", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "CubicSplineTable", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "CubicSplineTable", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "CubicSplineTable", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "CubicSplineTable", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "CubicSplineTable", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "CubicSplineTable", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "CubicSplineTable", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "CubicSplineTable", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "LennardJones", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "LennardJones", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "LennardJones", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "LennardJones", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "LennardJones", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "LennardJones", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "LennardJones", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "LennardJones", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "LennardJones", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "LennardJones", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "None", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "None", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "None", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "None", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "None", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "None", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "None", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "None", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "None", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "None", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_sparc64_hpc_ace_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_sparc64_hpc_ace_double, "nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "GeneralizedBorn", "None", "LennardJones", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_sparc64_hpc_ace_double, "nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "GeneralizedBorn", "None", "LennardJones", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_sparc64_hpc_ace_double, "nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "GeneralizedBorn", "None", "None", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecGB_VdwNone_GeomP1P1_F_sparc64_hpc_ace_double, "nb_kernel_ElecGB_VdwNone_GeomP1P1_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "GeneralizedBorn", "None", "None", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_sparc64_hpc_ace_double, "nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "GeneralizedBorn", "None", "CubicSplineTable", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_sparc64_hpc_ace_double, "nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "GeneralizedBorn", "None", "CubicSplineTable", "None", "ParticleParticle", "", "Force" },
     { nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_VF_sparc64_hpc_ace_double, "nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "ReactionField", "ExactCutoff", "LennardJones", "PotentialShift", "ParticleParticle", "", "PotentialAndForce" },
     { nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_F_sparc64_hpc_ace_double, "nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "ReactionField", "ExactCutoff", "LennardJones", "PotentialShift", "ParticleParticle", "", "Force" },
     { nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_VF_sparc64_hpc_ace_double, "nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "ReactionField", "ExactCutoff", "LennardJones", "PotentialShift", "Water3Particle", "", "PotentialAndForce" },
@@ -519,7 +477,37 @@ nb_kernel_info_t
     { nb_kernel_ElecRF_VdwCSTab_GeomW4P1_VF_sparc64_hpc_ace_double, "nb_kernel_ElecRF_VdwCSTab_GeomW4P1_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "ReactionField", "None", "CubicSplineTable", "None", "Water4Particle", "", "PotentialAndForce" },
     { nb_kernel_ElecRF_VdwCSTab_GeomW4P1_F_sparc64_hpc_ace_double, "nb_kernel_ElecRF_VdwCSTab_GeomW4P1_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "ReactionField", "None", "CubicSplineTable", "None", "Water4Particle", "", "Force" },
     { nb_kernel_ElecRF_VdwCSTab_GeomW4W4_VF_sparc64_hpc_ace_double, "nb_kernel_ElecRF_VdwCSTab_GeomW4W4_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "ReactionField", "None", "CubicSplineTable", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecRF_VdwCSTab_GeomW4W4_F_sparc64_hpc_ace_double, "nb_kernel_ElecRF_VdwCSTab_GeomW4W4_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "ReactionField", "None", "CubicSplineTable", "None", "Water4Water4", "", "Force" }
+    { nb_kernel_ElecRF_VdwCSTab_GeomW4W4_F_sparc64_hpc_ace_double, "nb_kernel_ElecRF_VdwCSTab_GeomW4W4_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "ReactionField", "None", "CubicSplineTable", "None", "Water4Water4", "", "Force" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "LennardJones", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "LennardJones", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "LennardJones", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "LennardJones", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "LennardJones", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "LennardJones", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "LennardJones", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "LennardJones", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "LennardJones", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "LennardJones", "None", "Water4Water4", "", "Force" },
+    { nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "None", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "None", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "None", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "None", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "None", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "None", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "None", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "None", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "None", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "None", "None", "Water4Water4", "", "Force" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "CubicSplineTable", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "CubicSplineTable", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "CubicSplineTable", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "CubicSplineTable", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "CubicSplineTable", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "CubicSplineTable", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "CubicSplineTable", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "CubicSplineTable", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "CubicSplineTable", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_sparc64_hpc_ace_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_sparc64_hpc_ace_double", "sparc64_hpc_ace_double", "Coulomb", "None", "CubicSplineTable", "None", "Water4Water4", "", "Force" }
 };
 
 int
index dd9cdf8e8cf05040f45273fb233ac877441e0959..d47dbd330358327efefeb6b0cc12ad104c1db34c 100644 (file)
@@ -2,7 +2,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -128,11 +128,6 @@ void
     _fjsp_v2r8       velec,felec,velecsum,facel,crf,krf,krf2;
     real             *charge;
     /* #endif */
-    /* #if 'GeneralizedBorn' in KERNEL_ELEC */
-    _fjsp_v2r8       vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,dvdaj,gbeps,twogbeps,dvdatmp;
-    _fjsp_v2r8       minushalf = gmx_fjsp_set1_v2r8(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    /* #endif */
     /* #if KERNEL_VDW != 'None' */
     int              nvdwtype;
     _fjsp_v2r8       rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
@@ -141,7 +136,7 @@ void
     _fjsp_v2r8       one_sixth   = gmx_fjsp_set1_v2r8(1.0/6.0);
     _fjsp_v2r8       one_twelfth = gmx_fjsp_set1_v2r8(1.0/12.0);
     /* #endif */
-    /* #if 'Table' in KERNEL_ELEC or 'GeneralizedBorn' in KERNEL_ELEC or 'Table' in KERNEL_VDW */
+    /* #if 'Table' in KERNEL_ELEC or 'Table' in KERNEL_VDW */
     _fjsp_v2r8       rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF,twovfeps;
     real             *vftab;
     /* #endif */
@@ -224,14 +219,6 @@ void
      /*     #endif */
     /* #endif */
 
-    /* #if KERNEL_ELEC=='GeneralizedBorn' */
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = gmx_fjsp_set1_v2r8(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = gmx_fjsp_set1_v2r8((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-    /* #endif */
-
     /* #if 'Water' in GEOMETRY_I */
     /* Setup water-specific parameters */
     inr              = nlist->iinr[0];
@@ -358,9 +345,6 @@ void
         /*     #for I in PARTICLES_ELEC_I */
         iq{I}              = _fjsp_mul_v2r8(facel,gmx_fjsp_load1_v2r8(charge+inr+{I}));
         /*         #define OUTERFLOPS OUTERFLOPS+1 */
-        /*         #if KERNEL_ELEC=='GeneralizedBorn' */
-        isai{I}            = gmx_fjsp_load1_v2r8(invsqrta+inr+{I});
-        /*         #endif */
         /*     #endfor */
         /*     #for I in PARTICLES_VDW_I */
         vdwioffset{I}      = 2*nvdwtype*vdwtype[inr+{I}];
@@ -372,16 +356,10 @@ void
         /*     #if KERNEL_ELEC != 'None' */
         velecsum         = _fjsp_setzero_v2r8();
         /*     #endif */
-        /*     #if 'GeneralizedBorn' in KERNEL_ELEC */
-        vgbsum           = _fjsp_setzero_v2r8();
-        /*     #endif */
         /*     #if KERNEL_VDW != 'None' */
         vvdwsum          = _fjsp_setzero_v2r8();
         /*     #endif */
         /* #endif */
-        /*     #if 'GeneralizedBorn' in KERNEL_ELEC and 'Force' in KERNEL_VF */
-        dvdasum          = _fjsp_setzero_v2r8();
-        /*     #endif */
 
         /* #for ROUND in ['Loop','Epilogue'] */
 
@@ -488,13 +466,6 @@ void
             /*         #else */
             jq{J}              = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(),charge+jnrA+{J});
             /*         #endif */
-            /*         #if KERNEL_ELEC=='GeneralizedBorn' */
-            /*             #if ROUND =='Loop' */
-            isaj{J}            = gmx_fjsp_load_2real_swizzle_v2r8(invsqrta+jnrA+{J},invsqrta+jnrB+{J});
-            /*             #else */
-            isaj{J}            = _fjsp_loadl_v2r8(_fjsp_setzero_v2r8(),invsqrta+jnrA+{J});
-            /*             #endif */
-            /*         #endif */
             /*     #endfor */
             /*     #for J in PARTICLES_VDW_J */
             vdwjidx{J}A        = 2*vdwtype[jnrA+{J}];
@@ -600,61 +571,6 @@ void
             /*                 #define INNERFLOPS INNERFLOPS+3 */
             /*             #endif */
 
-            /*         #elif KERNEL_ELEC=='GeneralizedBorn' */
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _fjsp_mul_v2r8(isai{I},isaj{J});
-            gbqqfactor       = _fjsp_neg_v2r8(_fjsp_mul_v2r8(qq{I}{J},_fjsp_mul_v2r8(isaprod,gbinvepsdiff)));
-            gbscale          = _fjsp_mul_v2r8(isaprod,gbtabscale);
-            /*             #define INNERFLOPS INNERFLOPS+5 */
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _fjsp_mul_v2r8(r{I}{J},gbscale);
-            itab_tmp         = _fjsp_dtox_v2r8(rt);
-            gbeps            = _fjsp_sub_v2r8(rt,_fjsp_xtod_v2r8(itab_tmp));
-            _fjsp_store_v2r8(&gbconv.simd,itab_tmp);
-
-            Y                = _fjsp_load_v2r8( gbtab + 4*gbconv.i[0] );
-            /*             #if ROUND == 'Loop' */
-            F                = _fjsp_load_v2r8( gbtab + 4*gbconv.i[1] );
-            /*             #else */
-            F                = _fjsp_setzero_v2r8();
-            /*             #endif */
-            GMX_FJSP_TRANSPOSE2_V2R8(Y,F);
-            G                = _fjsp_load_v2r8( gbtab + 4*gbconv.i[0] +2);
-            /*             #if ROUND == 'Loop' */
-            H                = _fjsp_load_v2r8( gbtab + 4*gbconv.i[1] +2);
-            /*             #else */
-            H                = _fjsp_setzero_v2r8();
-            /*             #endif */
-            GMX_FJSP_TRANSPOSE2_V2R8(G,H);
-            Fp               = _fjsp_madd_v2r8(gbeps,_fjsp_madd_v2r8(gbeps,H,G),F);
-            VV               = _fjsp_madd_v2r8(gbeps,Fp,Y);
-            vgb              = _fjsp_mul_v2r8(gbqqfactor,VV);
-            /*             #define INNERFLOPS INNERFLOPS+10 */
-
-            /*             #if 'Force' in KERNEL_VF */
-            twogbeps         = _fjsp_add_v2r8(gbeps,gbeps);
-            FF               = _fjsp_madd_v2r8(_fjsp_madd_v2r8(twogbeps,H,G),gbeps,Fp);
-            fgb              = _fjsp_mul_v2r8(gbqqfactor,_fjsp_mul_v2r8(FF,gbscale));
-            dvdatmp          = _fjsp_mul_v2r8(minushalf,_fjsp_madd_v2r8(fgb,r{I}{J},vgb));
-            dvdasum          = _fjsp_add_v2r8(dvdasum,dvdatmp);
-            /*             #if ROUND == 'Loop' */
-            gmx_fjsp_increment_2real_swizzle_v2r8(dvda+jnrA,dvda+jnrB,_fjsp_mul_v2r8(dvdatmp,_fjsp_mul_v2r8(isaj{J},isaj{J})));
-            /*             #else */
-            gmx_fjsp_increment_1real_v2r8(dvda+jnrA,_fjsp_mul_v2r8(dvdatmp,_fjsp_mul_v2r8(isaj{J},isaj{J})));
-            /*             #endif */
-            /*                 #define INNERFLOPS INNERFLOPS+13 */
-            /*             #endif */
-            velec            = _fjsp_mul_v2r8(qq{I}{J},rinv{I}{J});
-            /*                 #define INNERFLOPS INNERFLOPS+1 */
-            /*             #if 'Force' in KERNEL_VF */
-            felec            = _fjsp_mul_v2r8(_fjsp_msub_v2r8(velec,rinv{I}{J},fgb),rinv{I}{J});
-            /*                 #define INNERFLOPS INNERFLOPS+3 */
-            /*             #endif */
-
             /*         #elif KERNEL_ELEC=='Ewald' */
             /* EWALD ELECTROSTATICS */
 
@@ -937,17 +853,6 @@ void
             /*             #endif */
             velecsum         = _fjsp_add_v2r8(velecsum,velec);
             /*             #define INNERFLOPS INNERFLOPS+1 */
-            /*             #if KERNEL_ELEC=='GeneralizedBorn' */
-            /*             #if 'exactcutoff' in INTERACTION_FLAGS[I][J] */
-            vgb              = _fjsp_and_v2r8(vgb,cutoff_mask);
-            /*                 #define INNERFLOPS INNERFLOPS+1 */
-            /*             #endif                                       */
-            /*             #if ROUND == 'Epilogue' */
-            vgb              = _fjsp_unpacklo_v2r8(vgb,_fjsp_setzero_v2r8());
-            /*             #endif */
-            vgbsum           = _fjsp_add_v2r8(vgbsum,vgb);
-            /*                 #define INNERFLOPS INNERFLOPS+1 */
-            /*             #endif */
             /*         #endif */
             /*         #if 'vdw' in INTERACTION_FLAGS[I][J] */
             /*             #if 'exactcutoff' in INTERACTION_FLAGS[I][J] */
@@ -1086,19 +991,11 @@ void
         gmx_fjsp_update_1pot_v2r8(velecsum,kernel_data->energygrp_elec+ggid);
         /*         #define OUTERFLOPS OUTERFLOPS+1 */
         /*     #endif */
-        /*     #if 'GeneralizedBorn' in KERNEL_ELEC */
-        gmx_fjsp_update_1pot_v2r8(vgbsum,kernel_data->energygrp_polarization+ggid);
-        /*         #define OUTERFLOPS OUTERFLOPS+1 */
-        /*     #endif */
         /*     #if KERNEL_VDW != 'None' */
         gmx_fjsp_update_1pot_v2r8(vvdwsum,kernel_data->energygrp_vdw+ggid);
         /*         #define OUTERFLOPS OUTERFLOPS+1 */
         /*     #endif */
         /* #endif */
-        /*     #if 'GeneralizedBorn' in KERNEL_ELEC and 'Force' in KERNEL_VF */
-        dvdasum = _fjsp_mul_v2r8(dvdasum, _fjsp_mul_v2r8(isai{I},isai{I}));
-        gmx_fjsp_update_1pot_v2r8(dvdasum,dvda+inr);
-        /*     #endif */
 
         /* Increment number of inner iterations */
         inneriter                  += j_index_end - j_index_start;
index b65e23b1465859229ea26938909d2a5cd083690c..1ef2fe609ea4d9728e3c36d6ef756885621308a3 100755 (executable)
@@ -105,7 +105,6 @@ ElectrostaticsList = {
     'None'                    : [],
     'Coulomb'                 : ['rinv','rinvsq'],
     'ReactionField'           : ['rinv','rinvsq'],
-    'GeneralizedBorn'         : ['rinv','r'],
     'CubicSplineTable'        : ['rinv','r','table'],
     'Ewald'                   : ['rinv','rinvsq','r'],
 }
@@ -190,7 +189,6 @@ Abbreviation = {
     'Coulomb'                 : 'Coul',
     'Ewald'                   : 'Ew',
     'ReactionField'           : 'RF',
-    'GeneralizedBorn'         : 'GB',
     'CubicSplineTable'        : 'CSTab',
     'LennardJones'            : 'LJ',
     'Buckingham'              : 'Bham',
@@ -269,7 +267,7 @@ def KeepKernel(KernelElec,KernelElecMod,KernelVdw,KernelVdwMod,KernelGeom,Kernel
         return 0
 
     # No need for LJ-only water optimization, or water optimization with implicit solvent.
-    if('Water' in KernelGeom[0] and (KernelElec=='None' or 'GeneralizedBorn' in KernelElec)):
+    if('Water' in KernelGeom[0] and KernelElec=='None'):
         return 0
 
     # Non-matching table settings are pointless
diff --git a/src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecGB_VdwCSTab_GeomP1P1_sse2_double.c b/src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecGB_VdwCSTab_GeomP1P1_sse2_double.c
deleted file mode 100644 (file)
index 9f96a56..0000000
+++ /dev/null
@@ -1,838 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
- * and including many others, as listed in the AUTHORS file in the
- * top-level source directory and at http://www.gromacs.org.
- *
- * GROMACS is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * GROMACS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GROMACS; if not, see
- * http://www.gnu.org/licenses, or write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
- *
- * If you want to redistribute modifications to GROMACS, please
- * consider that scientific software is very special. Version
- * control is crucial - bugs must be traceable. We will be happy to
- * consider code for inclusion in the official distribution, but
- * derived work must not be called official GROMACS. Details are found
- * in the README & COPYING files - if they are missing, get the
- * official version at http://www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the research papers on the package. Check out http://www.gromacs.org.
- */
-/*
- * Note: this file was generated by the GROMACS sse2_double kernel generator.
- */
-#include "gmxpre.h"
-
-#include "config.h"
-
-#include <math.h>
-
-#include "../nb_kernel.h"
-#include "gromacs/gmxlib/nrnb.h"
-
-#include "kernelutil_x86_sse2_double.h"
-
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_sse2_double
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            CubicSplineTable
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        PotentialAndForce
- */
-void
-nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_sse2_double
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
-     * just 0 for non-waters.
-     * Suffixes A,B refer to j loop unrolling done with SSE double precision, e.g. for the two different
-     * jnr indices corresponding to data put in the four positions in the SIMD register.
-     */
-    int              i_shift_offset,i_coord_offset,outeriter,inneriter;
-    int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
-    int              jnrA,jnrB;
-    int              j_coord_offsetA,j_coord_offsetB;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             rcutoff_scalar;
-    real             *shiftvec,*fshift,*x,*f;
-    __m128d          tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
-    int              vdwioffset0;
-    __m128d          ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0A,vdwjidx0B;
-    __m128d          jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    __m128d          dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
-    __m128d          velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    __m128i          gbitab;
-    __m128d          vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,dvdaj,gbeps,dvdatmp;
-    __m128d          minushalf = _mm_set1_pd(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    int              nvdwtype;
-    __m128d          rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
-    int              *vdwtype;
-    real             *vdwparam;
-    __m128d          one_sixth   = _mm_set1_pd(1.0/6.0);
-    __m128d          one_twelfth = _mm_set1_pd(1.0/12.0);
-    __m128i          vfitab;
-    __m128i          ifour       = _mm_set1_epi32(4);
-    __m128d          rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF;
-    real             *vftab;
-    __m128d          dummy_mask,cutoff_mask;
-    __m128d          signbit   = gmx_mm_castsi128_pd( _mm_set_epi32(0x80000000,0x00000000,0x80000000,0x00000000) );
-    __m128d          one     = _mm_set1_pd(1.0);
-    __m128d          two     = _mm_set1_pd(2.0);
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = _mm_set1_pd(fr->ic->epsfac);
-    charge           = mdatoms->chargeA;
-    nvdwtype         = fr->ntype;
-    vdwparam         = fr->nbfp;
-    vdwtype          = mdatoms->typeA;
-
-    vftab            = kernel_data->table_vdw->data;
-    vftabscale       = _mm_set1_pd(kernel_data->table_vdw->scale);
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = _mm_set1_pd(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = _mm_set1_pd((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-
-    /* Avoid stupid compiler warnings */
-    jnrA = jnrB = 0;
-    j_coord_offsetA = 0;
-    j_coord_offsetB = 0;
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        gmx_mm_load_shift_and_1rvec_broadcast_pd(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
-
-        fix0             = _mm_setzero_pd();
-        fiy0             = _mm_setzero_pd();
-        fiz0             = _mm_setzero_pd();
-
-        /* Load parameters for i particles */
-        iq0              = _mm_mul_pd(facel,_mm_load1_pd(charge+inr+0));
-        isai0            = _mm_load1_pd(invsqrta+inr+0);
-        vdwioffset0      = 2*nvdwtype*vdwtype[inr+0];
-
-        /* Reset potential sums */
-        velecsum         = _mm_setzero_pd();
-        vgbsum           = _mm_setzero_pd();
-        vvdwsum          = _mm_setzero_pd();
-        dvdasum          = _mm_setzero_pd();
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrA             = jjnr[jidx];
-            jnrB             = jjnr[jidx+1];
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_2ptr_swizzle_pd(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_pd(ix0,jx0);
-            dy00             = _mm_sub_pd(iy0,jy0);
-            dz00             = _mm_sub_pd(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_pd(dx00,dy00,dz00);
-
-            rinv00           = sse2_invsqrt_d(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm_load_2real_swizzle_pd(charge+jnrA+0,charge+jnrB+0);
-            isaj0            = gmx_mm_load_2real_swizzle_pd(invsqrta+jnrA+0,invsqrta+jnrB+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-            vdwjidx0B        = 2*vdwtype[jnrB+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_pd(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_pd(iq0,jq0);
-            gmx_mm_load_2pair_swizzle_pd(vdwparam+vdwioffset0+vdwjidx0A,
-                                         vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
-
-            /* Calculate table index by multiplying r with table scale and truncate to integer */
-            rt               = _mm_mul_pd(r00,vftabscale);
-            vfitab           = _mm_cvttpd_epi32(rt);
-            vfeps            = _mm_sub_pd(rt,_mm_cvtepi32_pd(vfitab));
-            vfitab           = _mm_slli_epi32(vfitab,3);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_pd(isai0,isaj0);
-            gbqqfactor       = _mm_xor_pd(signbit,_mm_mul_pd(qq00,_mm_mul_pd(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_pd(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_pd(r00,gbscale);
-            gbitab           = _mm_cvttpd_epi32(rt);
-            gbeps            = _mm_sub_pd(rt,_mm_cvtepi32_pd(gbitab));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,0) );
-            F                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,1) );
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,0) +2);
-            H                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,1) +2);
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Heps             = _mm_mul_pd(gbeps,H);
-            Fp               = _mm_add_pd(F,_mm_mul_pd(gbeps,_mm_add_pd(G,Heps)));
-            VV               = _mm_add_pd(Y,_mm_mul_pd(gbeps,Fp));
-            vgb              = _mm_mul_pd(gbqqfactor,VV);
-
-            FF               = _mm_add_pd(Fp,_mm_mul_pd(gbeps,_mm_add_pd(G,_mm_add_pd(Heps,Heps))));
-            fgb              = _mm_mul_pd(gbqqfactor,_mm_mul_pd(FF,gbscale));
-            dvdatmp          = _mm_mul_pd(minushalf,_mm_add_pd(vgb,_mm_mul_pd(fgb,r00)));
-            dvdasum          = _mm_add_pd(dvdasum,dvdatmp);
-            gmx_mm_increment_2real_swizzle_pd(dvda+jnrA,dvda+jnrB,_mm_mul_pd(dvdatmp,_mm_mul_pd(isaj0,isaj0)));
-            velec            = _mm_mul_pd(qq00,rinv00);
-            felec            = _mm_mul_pd(_mm_sub_pd(_mm_mul_pd(velec,rinv00),fgb),rinv00);
-
-            /* CUBIC SPLINE TABLE DISPERSION */
-            Y                = _mm_load_pd( vftab + gmx_mm_extract_epi32(vfitab,0) );
-            F                = _mm_load_pd( vftab + gmx_mm_extract_epi32(vfitab,1) );
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( vftab + gmx_mm_extract_epi32(vfitab,0) +2);
-            H                = _mm_load_pd( vftab + gmx_mm_extract_epi32(vfitab,1) +2);
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Heps             = _mm_mul_pd(vfeps,H);
-            Fp               = _mm_add_pd(F,_mm_mul_pd(vfeps,_mm_add_pd(G,Heps)));
-            VV               = _mm_add_pd(Y,_mm_mul_pd(vfeps,Fp));
-            vvdw6            = _mm_mul_pd(c6_00,VV);
-            FF               = _mm_add_pd(Fp,_mm_mul_pd(vfeps,_mm_add_pd(G,_mm_add_pd(Heps,Heps))));
-            fvdw6            = _mm_mul_pd(c6_00,FF);
-
-            /* CUBIC SPLINE TABLE REPULSION */
-            vfitab           = _mm_add_epi32(vfitab,ifour);
-            Y                = _mm_load_pd( vftab + gmx_mm_extract_epi32(vfitab,0) );
-            F                = _mm_load_pd( vftab + gmx_mm_extract_epi32(vfitab,1) );
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( vftab + gmx_mm_extract_epi32(vfitab,0) +2);
-            H                = _mm_load_pd( vftab + gmx_mm_extract_epi32(vfitab,1) +2);
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Heps             = _mm_mul_pd(vfeps,H);
-            Fp               = _mm_add_pd(F,_mm_mul_pd(vfeps,_mm_add_pd(G,Heps)));
-            VV               = _mm_add_pd(Y,_mm_mul_pd(vfeps,Fp));
-            vvdw12           = _mm_mul_pd(c12_00,VV);
-            FF               = _mm_add_pd(Fp,_mm_mul_pd(vfeps,_mm_add_pd(G,_mm_add_pd(Heps,Heps))));
-            fvdw12           = _mm_mul_pd(c12_00,FF);
-            vvdw             = _mm_add_pd(vvdw12,vvdw6);
-            fvdw             = _mm_xor_pd(signbit,_mm_mul_pd(_mm_add_pd(fvdw6,fvdw12),_mm_mul_pd(vftabscale,rinv00)));
-
-            /* Update potential sum for this i atom from the interaction with this j atom. */
-            velecsum         = _mm_add_pd(velecsum,velec);
-            vgbsum           = _mm_add_pd(vgbsum,vgb);
-            vvdwsum          = _mm_add_pd(vvdwsum,vvdw);
-
-            fscal            = _mm_add_pd(felec,fvdw);
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm_mul_pd(fscal,dx00);
-            ty               = _mm_mul_pd(fscal,dy00);
-            tz               = _mm_mul_pd(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm_add_pd(fix0,tx);
-            fiy0             = _mm_add_pd(fiy0,ty);
-            fiz0             = _mm_add_pd(fiz0,tz);
-
-            gmx_mm_decrement_1rvec_2ptr_swizzle_pd(f+j_coord_offsetA,f+j_coord_offsetB,tx,ty,tz);
-
-            /* Inner loop uses 92 flops */
-        }
-
-        if(jidx<j_index_end)
-        {
-
-            jnrA             = jjnr[jidx];
-            j_coord_offsetA  = DIM*jnrA;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_1ptr_swizzle_pd(x+j_coord_offsetA,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_pd(ix0,jx0);
-            dy00             = _mm_sub_pd(iy0,jy0);
-            dz00             = _mm_sub_pd(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_pd(dx00,dy00,dz00);
-
-            rinv00           = sse2_invsqrt_d(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = _mm_load_sd(charge+jnrA+0);
-            isaj0            = _mm_load_sd(invsqrta+jnrA+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_pd(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_pd(iq0,jq0);
-            gmx_mm_load_1pair_swizzle_pd(vdwparam+vdwioffset0+vdwjidx0A,&c6_00,&c12_00);
-
-            /* Calculate table index by multiplying r with table scale and truncate to integer */
-            rt               = _mm_mul_pd(r00,vftabscale);
-            vfitab           = _mm_cvttpd_epi32(rt);
-            vfeps            = _mm_sub_pd(rt,_mm_cvtepi32_pd(vfitab));
-            vfitab           = _mm_slli_epi32(vfitab,3);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_pd(isai0,isaj0);
-            gbqqfactor       = _mm_xor_pd(signbit,_mm_mul_pd(qq00,_mm_mul_pd(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_pd(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_pd(r00,gbscale);
-            gbitab           = _mm_cvttpd_epi32(rt);
-            gbeps            = _mm_sub_pd(rt,_mm_cvtepi32_pd(gbitab));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,0) );
-            F                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,0) +2);
-            H                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Heps             = _mm_mul_pd(gbeps,H);
-            Fp               = _mm_add_pd(F,_mm_mul_pd(gbeps,_mm_add_pd(G,Heps)));
-            VV               = _mm_add_pd(Y,_mm_mul_pd(gbeps,Fp));
-            vgb              = _mm_mul_pd(gbqqfactor,VV);
-
-            FF               = _mm_add_pd(Fp,_mm_mul_pd(gbeps,_mm_add_pd(G,_mm_add_pd(Heps,Heps))));
-            fgb              = _mm_mul_pd(gbqqfactor,_mm_mul_pd(FF,gbscale));
-            dvdatmp          = _mm_mul_pd(minushalf,_mm_add_pd(vgb,_mm_mul_pd(fgb,r00)));
-            dvdatmp          = _mm_unpacklo_pd(dvdatmp,_mm_setzero_pd());
-            dvdasum          = _mm_add_pd(dvdasum,dvdatmp);
-            gmx_mm_increment_1real_pd(dvda+jnrA,_mm_mul_pd(dvdatmp,_mm_mul_pd(isaj0,isaj0)));
-            velec            = _mm_mul_pd(qq00,rinv00);
-            felec            = _mm_mul_pd(_mm_sub_pd(_mm_mul_pd(velec,rinv00),fgb),rinv00);
-
-            /* CUBIC SPLINE TABLE DISPERSION */
-            Y                = _mm_load_pd( vftab + gmx_mm_extract_epi32(vfitab,0) );
-            F                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( vftab + gmx_mm_extract_epi32(vfitab,0) +2);
-            H                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Heps             = _mm_mul_pd(vfeps,H);
-            Fp               = _mm_add_pd(F,_mm_mul_pd(vfeps,_mm_add_pd(G,Heps)));
-            VV               = _mm_add_pd(Y,_mm_mul_pd(vfeps,Fp));
-            vvdw6            = _mm_mul_pd(c6_00,VV);
-            FF               = _mm_add_pd(Fp,_mm_mul_pd(vfeps,_mm_add_pd(G,_mm_add_pd(Heps,Heps))));
-            fvdw6            = _mm_mul_pd(c6_00,FF);
-
-            /* CUBIC SPLINE TABLE REPULSION */
-            vfitab           = _mm_add_epi32(vfitab,ifour);
-            Y                = _mm_load_pd( vftab + gmx_mm_extract_epi32(vfitab,0) );
-            F                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( vftab + gmx_mm_extract_epi32(vfitab,0) +2);
-            H                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Heps             = _mm_mul_pd(vfeps,H);
-            Fp               = _mm_add_pd(F,_mm_mul_pd(vfeps,_mm_add_pd(G,Heps)));
-            VV               = _mm_add_pd(Y,_mm_mul_pd(vfeps,Fp));
-            vvdw12           = _mm_mul_pd(c12_00,VV);
-            FF               = _mm_add_pd(Fp,_mm_mul_pd(vfeps,_mm_add_pd(G,_mm_add_pd(Heps,Heps))));
-            fvdw12           = _mm_mul_pd(c12_00,FF);
-            vvdw             = _mm_add_pd(vvdw12,vvdw6);
-            fvdw             = _mm_xor_pd(signbit,_mm_mul_pd(_mm_add_pd(fvdw6,fvdw12),_mm_mul_pd(vftabscale,rinv00)));
-
-            /* Update potential sum for this i atom from the interaction with this j atom. */
-            velec            = _mm_unpacklo_pd(velec,_mm_setzero_pd());
-            velecsum         = _mm_add_pd(velecsum,velec);
-            vgb              = _mm_unpacklo_pd(vgb,_mm_setzero_pd());
-            vgbsum           = _mm_add_pd(vgbsum,vgb);
-            vvdw             = _mm_unpacklo_pd(vvdw,_mm_setzero_pd());
-            vvdwsum          = _mm_add_pd(vvdwsum,vvdw);
-
-            fscal            = _mm_add_pd(felec,fvdw);
-
-            fscal            = _mm_unpacklo_pd(fscal,_mm_setzero_pd());
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm_mul_pd(fscal,dx00);
-            ty               = _mm_mul_pd(fscal,dy00);
-            tz               = _mm_mul_pd(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm_add_pd(fix0,tx);
-            fiy0             = _mm_add_pd(fiy0,ty);
-            fiz0             = _mm_add_pd(fiz0,tz);
-
-            gmx_mm_decrement_1rvec_1ptr_swizzle_pd(f+j_coord_offsetA,tx,ty,tz);
-
-            /* Inner loop uses 92 flops */
-        }
-
-        /* End of innermost loop */
-
-        gmx_mm_update_iforce_1atom_swizzle_pd(fix0,fiy0,fiz0,
-                                              f+i_coord_offset,fshift+i_shift_offset);
-
-        ggid                        = gid[iidx];
-        /* Update potential energies */
-        gmx_mm_update_1pot_pd(velecsum,kernel_data->energygrp_elec+ggid);
-        gmx_mm_update_1pot_pd(vgbsum,kernel_data->energygrp_polarization+ggid);
-        gmx_mm_update_1pot_pd(vvdwsum,kernel_data->energygrp_vdw+ggid);
-        dvdasum = _mm_mul_pd(dvdasum, _mm_mul_pd(isai0,isai0));
-        gmx_mm_update_1pot_pd(dvdasum,dvda+inr);
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 10 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_VF,outeriter*10 + inneriter*92);
-}
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_sse2_double
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            CubicSplineTable
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        Force
- */
-void
-nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_sse2_double
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
-     * just 0 for non-waters.
-     * Suffixes A,B refer to j loop unrolling done with SSE double precision, e.g. for the two different
-     * jnr indices corresponding to data put in the four positions in the SIMD register.
-     */
-    int              i_shift_offset,i_coord_offset,outeriter,inneriter;
-    int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
-    int              jnrA,jnrB;
-    int              j_coord_offsetA,j_coord_offsetB;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             rcutoff_scalar;
-    real             *shiftvec,*fshift,*x,*f;
-    __m128d          tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
-    int              vdwioffset0;
-    __m128d          ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0A,vdwjidx0B;
-    __m128d          jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    __m128d          dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
-    __m128d          velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    __m128i          gbitab;
-    __m128d          vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,dvdaj,gbeps,dvdatmp;
-    __m128d          minushalf = _mm_set1_pd(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    int              nvdwtype;
-    __m128d          rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
-    int              *vdwtype;
-    real             *vdwparam;
-    __m128d          one_sixth   = _mm_set1_pd(1.0/6.0);
-    __m128d          one_twelfth = _mm_set1_pd(1.0/12.0);
-    __m128i          vfitab;
-    __m128i          ifour       = _mm_set1_epi32(4);
-    __m128d          rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF;
-    real             *vftab;
-    __m128d          dummy_mask,cutoff_mask;
-    __m128d          signbit   = gmx_mm_castsi128_pd( _mm_set_epi32(0x80000000,0x00000000,0x80000000,0x00000000) );
-    __m128d          one     = _mm_set1_pd(1.0);
-    __m128d          two     = _mm_set1_pd(2.0);
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = _mm_set1_pd(fr->ic->epsfac);
-    charge           = mdatoms->chargeA;
-    nvdwtype         = fr->ntype;
-    vdwparam         = fr->nbfp;
-    vdwtype          = mdatoms->typeA;
-
-    vftab            = kernel_data->table_vdw->data;
-    vftabscale       = _mm_set1_pd(kernel_data->table_vdw->scale);
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = _mm_set1_pd(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = _mm_set1_pd((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-
-    /* Avoid stupid compiler warnings */
-    jnrA = jnrB = 0;
-    j_coord_offsetA = 0;
-    j_coord_offsetB = 0;
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        gmx_mm_load_shift_and_1rvec_broadcast_pd(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
-
-        fix0             = _mm_setzero_pd();
-        fiy0             = _mm_setzero_pd();
-        fiz0             = _mm_setzero_pd();
-
-        /* Load parameters for i particles */
-        iq0              = _mm_mul_pd(facel,_mm_load1_pd(charge+inr+0));
-        isai0            = _mm_load1_pd(invsqrta+inr+0);
-        vdwioffset0      = 2*nvdwtype*vdwtype[inr+0];
-
-        dvdasum          = _mm_setzero_pd();
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrA             = jjnr[jidx];
-            jnrB             = jjnr[jidx+1];
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_2ptr_swizzle_pd(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_pd(ix0,jx0);
-            dy00             = _mm_sub_pd(iy0,jy0);
-            dz00             = _mm_sub_pd(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_pd(dx00,dy00,dz00);
-
-            rinv00           = sse2_invsqrt_d(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm_load_2real_swizzle_pd(charge+jnrA+0,charge+jnrB+0);
-            isaj0            = gmx_mm_load_2real_swizzle_pd(invsqrta+jnrA+0,invsqrta+jnrB+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-            vdwjidx0B        = 2*vdwtype[jnrB+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_pd(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_pd(iq0,jq0);
-            gmx_mm_load_2pair_swizzle_pd(vdwparam+vdwioffset0+vdwjidx0A,
-                                         vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
-
-            /* Calculate table index by multiplying r with table scale and truncate to integer */
-            rt               = _mm_mul_pd(r00,vftabscale);
-            vfitab           = _mm_cvttpd_epi32(rt);
-            vfeps            = _mm_sub_pd(rt,_mm_cvtepi32_pd(vfitab));
-            vfitab           = _mm_slli_epi32(vfitab,3);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_pd(isai0,isaj0);
-            gbqqfactor       = _mm_xor_pd(signbit,_mm_mul_pd(qq00,_mm_mul_pd(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_pd(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_pd(r00,gbscale);
-            gbitab           = _mm_cvttpd_epi32(rt);
-            gbeps            = _mm_sub_pd(rt,_mm_cvtepi32_pd(gbitab));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,0) );
-            F                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,1) );
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,0) +2);
-            H                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,1) +2);
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Heps             = _mm_mul_pd(gbeps,H);
-            Fp               = _mm_add_pd(F,_mm_mul_pd(gbeps,_mm_add_pd(G,Heps)));
-            VV               = _mm_add_pd(Y,_mm_mul_pd(gbeps,Fp));
-            vgb              = _mm_mul_pd(gbqqfactor,VV);
-
-            FF               = _mm_add_pd(Fp,_mm_mul_pd(gbeps,_mm_add_pd(G,_mm_add_pd(Heps,Heps))));
-            fgb              = _mm_mul_pd(gbqqfactor,_mm_mul_pd(FF,gbscale));
-            dvdatmp          = _mm_mul_pd(minushalf,_mm_add_pd(vgb,_mm_mul_pd(fgb,r00)));
-            dvdasum          = _mm_add_pd(dvdasum,dvdatmp);
-            gmx_mm_increment_2real_swizzle_pd(dvda+jnrA,dvda+jnrB,_mm_mul_pd(dvdatmp,_mm_mul_pd(isaj0,isaj0)));
-            velec            = _mm_mul_pd(qq00,rinv00);
-            felec            = _mm_mul_pd(_mm_sub_pd(_mm_mul_pd(velec,rinv00),fgb),rinv00);
-
-            /* CUBIC SPLINE TABLE DISPERSION */
-            Y                = _mm_load_pd( vftab + gmx_mm_extract_epi32(vfitab,0) );
-            F                = _mm_load_pd( vftab + gmx_mm_extract_epi32(vfitab,1) );
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( vftab + gmx_mm_extract_epi32(vfitab,0) +2);
-            H                = _mm_load_pd( vftab + gmx_mm_extract_epi32(vfitab,1) +2);
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Heps             = _mm_mul_pd(vfeps,H);
-            Fp               = _mm_add_pd(F,_mm_mul_pd(vfeps,_mm_add_pd(G,Heps)));
-            FF               = _mm_add_pd(Fp,_mm_mul_pd(vfeps,_mm_add_pd(G,_mm_add_pd(Heps,Heps))));
-            fvdw6            = _mm_mul_pd(c6_00,FF);
-
-            /* CUBIC SPLINE TABLE REPULSION */
-            vfitab           = _mm_add_epi32(vfitab,ifour);
-            Y                = _mm_load_pd( vftab + gmx_mm_extract_epi32(vfitab,0) );
-            F                = _mm_load_pd( vftab + gmx_mm_extract_epi32(vfitab,1) );
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( vftab + gmx_mm_extract_epi32(vfitab,0) +2);
-            H                = _mm_load_pd( vftab + gmx_mm_extract_epi32(vfitab,1) +2);
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Heps             = _mm_mul_pd(vfeps,H);
-            Fp               = _mm_add_pd(F,_mm_mul_pd(vfeps,_mm_add_pd(G,Heps)));
-            FF               = _mm_add_pd(Fp,_mm_mul_pd(vfeps,_mm_add_pd(G,_mm_add_pd(Heps,Heps))));
-            fvdw12           = _mm_mul_pd(c12_00,FF);
-            fvdw             = _mm_xor_pd(signbit,_mm_mul_pd(_mm_add_pd(fvdw6,fvdw12),_mm_mul_pd(vftabscale,rinv00)));
-
-            fscal            = _mm_add_pd(felec,fvdw);
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm_mul_pd(fscal,dx00);
-            ty               = _mm_mul_pd(fscal,dy00);
-            tz               = _mm_mul_pd(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm_add_pd(fix0,tx);
-            fiy0             = _mm_add_pd(fiy0,ty);
-            fiz0             = _mm_add_pd(fiz0,tz);
-
-            gmx_mm_decrement_1rvec_2ptr_swizzle_pd(f+j_coord_offsetA,f+j_coord_offsetB,tx,ty,tz);
-
-            /* Inner loop uses 82 flops */
-        }
-
-        if(jidx<j_index_end)
-        {
-
-            jnrA             = jjnr[jidx];
-            j_coord_offsetA  = DIM*jnrA;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_1ptr_swizzle_pd(x+j_coord_offsetA,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_pd(ix0,jx0);
-            dy00             = _mm_sub_pd(iy0,jy0);
-            dz00             = _mm_sub_pd(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_pd(dx00,dy00,dz00);
-
-            rinv00           = sse2_invsqrt_d(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = _mm_load_sd(charge+jnrA+0);
-            isaj0            = _mm_load_sd(invsqrta+jnrA+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_pd(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_pd(iq0,jq0);
-            gmx_mm_load_1pair_swizzle_pd(vdwparam+vdwioffset0+vdwjidx0A,&c6_00,&c12_00);
-
-            /* Calculate table index by multiplying r with table scale and truncate to integer */
-            rt               = _mm_mul_pd(r00,vftabscale);
-            vfitab           = _mm_cvttpd_epi32(rt);
-            vfeps            = _mm_sub_pd(rt,_mm_cvtepi32_pd(vfitab));
-            vfitab           = _mm_slli_epi32(vfitab,3);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_pd(isai0,isaj0);
-            gbqqfactor       = _mm_xor_pd(signbit,_mm_mul_pd(qq00,_mm_mul_pd(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_pd(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_pd(r00,gbscale);
-            gbitab           = _mm_cvttpd_epi32(rt);
-            gbeps            = _mm_sub_pd(rt,_mm_cvtepi32_pd(gbitab));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,0) );
-            F                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,0) +2);
-            H                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Heps             = _mm_mul_pd(gbeps,H);
-            Fp               = _mm_add_pd(F,_mm_mul_pd(gbeps,_mm_add_pd(G,Heps)));
-            VV               = _mm_add_pd(Y,_mm_mul_pd(gbeps,Fp));
-            vgb              = _mm_mul_pd(gbqqfactor,VV);
-
-            FF               = _mm_add_pd(Fp,_mm_mul_pd(gbeps,_mm_add_pd(G,_mm_add_pd(Heps,Heps))));
-            fgb              = _mm_mul_pd(gbqqfactor,_mm_mul_pd(FF,gbscale));
-            dvdatmp          = _mm_mul_pd(minushalf,_mm_add_pd(vgb,_mm_mul_pd(fgb,r00)));
-            dvdatmp          = _mm_unpacklo_pd(dvdatmp,_mm_setzero_pd());
-            dvdasum          = _mm_add_pd(dvdasum,dvdatmp);
-            gmx_mm_increment_1real_pd(dvda+jnrA,_mm_mul_pd(dvdatmp,_mm_mul_pd(isaj0,isaj0)));
-            velec            = _mm_mul_pd(qq00,rinv00);
-            felec            = _mm_mul_pd(_mm_sub_pd(_mm_mul_pd(velec,rinv00),fgb),rinv00);
-
-            /* CUBIC SPLINE TABLE DISPERSION */
-            Y                = _mm_load_pd( vftab + gmx_mm_extract_epi32(vfitab,0) );
-            F                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( vftab + gmx_mm_extract_epi32(vfitab,0) +2);
-            H                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Heps             = _mm_mul_pd(vfeps,H);
-            Fp               = _mm_add_pd(F,_mm_mul_pd(vfeps,_mm_add_pd(G,Heps)));
-            FF               = _mm_add_pd(Fp,_mm_mul_pd(vfeps,_mm_add_pd(G,_mm_add_pd(Heps,Heps))));
-            fvdw6            = _mm_mul_pd(c6_00,FF);
-
-            /* CUBIC SPLINE TABLE REPULSION */
-            vfitab           = _mm_add_epi32(vfitab,ifour);
-            Y                = _mm_load_pd( vftab + gmx_mm_extract_epi32(vfitab,0) );
-            F                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( vftab + gmx_mm_extract_epi32(vfitab,0) +2);
-            H                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Heps             = _mm_mul_pd(vfeps,H);
-            Fp               = _mm_add_pd(F,_mm_mul_pd(vfeps,_mm_add_pd(G,Heps)));
-            FF               = _mm_add_pd(Fp,_mm_mul_pd(vfeps,_mm_add_pd(G,_mm_add_pd(Heps,Heps))));
-            fvdw12           = _mm_mul_pd(c12_00,FF);
-            fvdw             = _mm_xor_pd(signbit,_mm_mul_pd(_mm_add_pd(fvdw6,fvdw12),_mm_mul_pd(vftabscale,rinv00)));
-
-            fscal            = _mm_add_pd(felec,fvdw);
-
-            fscal            = _mm_unpacklo_pd(fscal,_mm_setzero_pd());
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm_mul_pd(fscal,dx00);
-            ty               = _mm_mul_pd(fscal,dy00);
-            tz               = _mm_mul_pd(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm_add_pd(fix0,tx);
-            fiy0             = _mm_add_pd(fiy0,ty);
-            fiz0             = _mm_add_pd(fiz0,tz);
-
-            gmx_mm_decrement_1rvec_1ptr_swizzle_pd(f+j_coord_offsetA,tx,ty,tz);
-
-            /* Inner loop uses 82 flops */
-        }
-
-        /* End of innermost loop */
-
-        gmx_mm_update_iforce_1atom_swizzle_pd(fix0,fiy0,fiz0,
-                                              f+i_coord_offset,fshift+i_shift_offset);
-
-        dvdasum = _mm_mul_pd(dvdasum, _mm_mul_pd(isai0,isai0));
-        gmx_mm_update_1pot_pd(dvdasum,dvda+inr);
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 7 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_F,outeriter*7 + inneriter*82);
-}
diff --git a/src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecGB_VdwLJ_GeomP1P1_sse2_double.c b/src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecGB_VdwLJ_GeomP1P1_sse2_double.c
deleted file mode 100644 (file)
index 36956b4..0000000
+++ /dev/null
@@ -1,728 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
- * and including many others, as listed in the AUTHORS file in the
- * top-level source directory and at http://www.gromacs.org.
- *
- * GROMACS is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * GROMACS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GROMACS; if not, see
- * http://www.gnu.org/licenses, or write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
- *
- * If you want to redistribute modifications to GROMACS, please
- * consider that scientific software is very special. Version
- * control is crucial - bugs must be traceable. We will be happy to
- * consider code for inclusion in the official distribution, but
- * derived work must not be called official GROMACS. Details are found
- * in the README & COPYING files - if they are missing, get the
- * official version at http://www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the research papers on the package. Check out http://www.gromacs.org.
- */
-/*
- * Note: this file was generated by the GROMACS sse2_double kernel generator.
- */
-#include "gmxpre.h"
-
-#include "config.h"
-
-#include <math.h>
-
-#include "../nb_kernel.h"
-#include "gromacs/gmxlib/nrnb.h"
-
-#include "kernelutil_x86_sse2_double.h"
-
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_sse2_double
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            LennardJones
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        PotentialAndForce
- */
-void
-nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_sse2_double
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
-     * just 0 for non-waters.
-     * Suffixes A,B refer to j loop unrolling done with SSE double precision, e.g. for the two different
-     * jnr indices corresponding to data put in the four positions in the SIMD register.
-     */
-    int              i_shift_offset,i_coord_offset,outeriter,inneriter;
-    int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
-    int              jnrA,jnrB;
-    int              j_coord_offsetA,j_coord_offsetB;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             rcutoff_scalar;
-    real             *shiftvec,*fshift,*x,*f;
-    __m128d          tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
-    int              vdwioffset0;
-    __m128d          ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0A,vdwjidx0B;
-    __m128d          jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    __m128d          dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
-    __m128d          velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    __m128i          gbitab;
-    __m128d          vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,dvdaj,gbeps,dvdatmp;
-    __m128d          minushalf = _mm_set1_pd(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    int              nvdwtype;
-    __m128d          rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
-    int              *vdwtype;
-    real             *vdwparam;
-    __m128d          one_sixth   = _mm_set1_pd(1.0/6.0);
-    __m128d          one_twelfth = _mm_set1_pd(1.0/12.0);
-    __m128i          vfitab;
-    __m128i          ifour       = _mm_set1_epi32(4);
-    __m128d          rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF;
-    real             *vftab;
-    __m128d          dummy_mask,cutoff_mask;
-    __m128d          signbit   = gmx_mm_castsi128_pd( _mm_set_epi32(0x80000000,0x00000000,0x80000000,0x00000000) );
-    __m128d          one     = _mm_set1_pd(1.0);
-    __m128d          two     = _mm_set1_pd(2.0);
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = _mm_set1_pd(fr->ic->epsfac);
-    charge           = mdatoms->chargeA;
-    nvdwtype         = fr->ntype;
-    vdwparam         = fr->nbfp;
-    vdwtype          = mdatoms->typeA;
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = _mm_set1_pd(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = _mm_set1_pd((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-
-    /* Avoid stupid compiler warnings */
-    jnrA = jnrB = 0;
-    j_coord_offsetA = 0;
-    j_coord_offsetB = 0;
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        gmx_mm_load_shift_and_1rvec_broadcast_pd(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
-
-        fix0             = _mm_setzero_pd();
-        fiy0             = _mm_setzero_pd();
-        fiz0             = _mm_setzero_pd();
-
-        /* Load parameters for i particles */
-        iq0              = _mm_mul_pd(facel,_mm_load1_pd(charge+inr+0));
-        isai0            = _mm_load1_pd(invsqrta+inr+0);
-        vdwioffset0      = 2*nvdwtype*vdwtype[inr+0];
-
-        /* Reset potential sums */
-        velecsum         = _mm_setzero_pd();
-        vgbsum           = _mm_setzero_pd();
-        vvdwsum          = _mm_setzero_pd();
-        dvdasum          = _mm_setzero_pd();
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrA             = jjnr[jidx];
-            jnrB             = jjnr[jidx+1];
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_2ptr_swizzle_pd(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_pd(ix0,jx0);
-            dy00             = _mm_sub_pd(iy0,jy0);
-            dz00             = _mm_sub_pd(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_pd(dx00,dy00,dz00);
-
-            rinv00           = sse2_invsqrt_d(rsq00);
-
-            rinvsq00         = _mm_mul_pd(rinv00,rinv00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm_load_2real_swizzle_pd(charge+jnrA+0,charge+jnrB+0);
-            isaj0            = gmx_mm_load_2real_swizzle_pd(invsqrta+jnrA+0,invsqrta+jnrB+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-            vdwjidx0B        = 2*vdwtype[jnrB+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_pd(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_pd(iq0,jq0);
-            gmx_mm_load_2pair_swizzle_pd(vdwparam+vdwioffset0+vdwjidx0A,
-                                         vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_pd(isai0,isaj0);
-            gbqqfactor       = _mm_xor_pd(signbit,_mm_mul_pd(qq00,_mm_mul_pd(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_pd(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_pd(r00,gbscale);
-            gbitab           = _mm_cvttpd_epi32(rt);
-            gbeps            = _mm_sub_pd(rt,_mm_cvtepi32_pd(gbitab));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,0) );
-            F                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,1) );
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,0) +2);
-            H                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,1) +2);
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Heps             = _mm_mul_pd(gbeps,H);
-            Fp               = _mm_add_pd(F,_mm_mul_pd(gbeps,_mm_add_pd(G,Heps)));
-            VV               = _mm_add_pd(Y,_mm_mul_pd(gbeps,Fp));
-            vgb              = _mm_mul_pd(gbqqfactor,VV);
-
-            FF               = _mm_add_pd(Fp,_mm_mul_pd(gbeps,_mm_add_pd(G,_mm_add_pd(Heps,Heps))));
-            fgb              = _mm_mul_pd(gbqqfactor,_mm_mul_pd(FF,gbscale));
-            dvdatmp          = _mm_mul_pd(minushalf,_mm_add_pd(vgb,_mm_mul_pd(fgb,r00)));
-            dvdasum          = _mm_add_pd(dvdasum,dvdatmp);
-            gmx_mm_increment_2real_swizzle_pd(dvda+jnrA,dvda+jnrB,_mm_mul_pd(dvdatmp,_mm_mul_pd(isaj0,isaj0)));
-            velec            = _mm_mul_pd(qq00,rinv00);
-            felec            = _mm_mul_pd(_mm_sub_pd(_mm_mul_pd(velec,rinv00),fgb),rinv00);
-
-            /* LENNARD-JONES DISPERSION/REPULSION */
-
-            rinvsix          = _mm_mul_pd(_mm_mul_pd(rinvsq00,rinvsq00),rinvsq00);
-            vvdw6            = _mm_mul_pd(c6_00,rinvsix);
-            vvdw12           = _mm_mul_pd(c12_00,_mm_mul_pd(rinvsix,rinvsix));
-            vvdw             = _mm_sub_pd( _mm_mul_pd(vvdw12,one_twelfth) , _mm_mul_pd(vvdw6,one_sixth) );
-            fvdw             = _mm_mul_pd(_mm_sub_pd(vvdw12,vvdw6),rinvsq00);
-
-            /* Update potential sum for this i atom from the interaction with this j atom. */
-            velecsum         = _mm_add_pd(velecsum,velec);
-            vgbsum           = _mm_add_pd(vgbsum,vgb);
-            vvdwsum          = _mm_add_pd(vvdwsum,vvdw);
-
-            fscal            = _mm_add_pd(felec,fvdw);
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm_mul_pd(fscal,dx00);
-            ty               = _mm_mul_pd(fscal,dy00);
-            tz               = _mm_mul_pd(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm_add_pd(fix0,tx);
-            fiy0             = _mm_add_pd(fiy0,ty);
-            fiz0             = _mm_add_pd(fiz0,tz);
-
-            gmx_mm_decrement_1rvec_2ptr_swizzle_pd(f+j_coord_offsetA,f+j_coord_offsetB,tx,ty,tz);
-
-            /* Inner loop uses 71 flops */
-        }
-
-        if(jidx<j_index_end)
-        {
-
-            jnrA             = jjnr[jidx];
-            j_coord_offsetA  = DIM*jnrA;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_1ptr_swizzle_pd(x+j_coord_offsetA,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_pd(ix0,jx0);
-            dy00             = _mm_sub_pd(iy0,jy0);
-            dz00             = _mm_sub_pd(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_pd(dx00,dy00,dz00);
-
-            rinv00           = sse2_invsqrt_d(rsq00);
-
-            rinvsq00         = _mm_mul_pd(rinv00,rinv00);
-
-            /* Load parameters for j particles */
-            jq0              = _mm_load_sd(charge+jnrA+0);
-            isaj0            = _mm_load_sd(invsqrta+jnrA+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_pd(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_pd(iq0,jq0);
-            gmx_mm_load_1pair_swizzle_pd(vdwparam+vdwioffset0+vdwjidx0A,&c6_00,&c12_00);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_pd(isai0,isaj0);
-            gbqqfactor       = _mm_xor_pd(signbit,_mm_mul_pd(qq00,_mm_mul_pd(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_pd(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_pd(r00,gbscale);
-            gbitab           = _mm_cvttpd_epi32(rt);
-            gbeps            = _mm_sub_pd(rt,_mm_cvtepi32_pd(gbitab));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,0) );
-            F                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,0) +2);
-            H                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Heps             = _mm_mul_pd(gbeps,H);
-            Fp               = _mm_add_pd(F,_mm_mul_pd(gbeps,_mm_add_pd(G,Heps)));
-            VV               = _mm_add_pd(Y,_mm_mul_pd(gbeps,Fp));
-            vgb              = _mm_mul_pd(gbqqfactor,VV);
-
-            FF               = _mm_add_pd(Fp,_mm_mul_pd(gbeps,_mm_add_pd(G,_mm_add_pd(Heps,Heps))));
-            fgb              = _mm_mul_pd(gbqqfactor,_mm_mul_pd(FF,gbscale));
-            dvdatmp          = _mm_mul_pd(minushalf,_mm_add_pd(vgb,_mm_mul_pd(fgb,r00)));
-            dvdatmp          = _mm_unpacklo_pd(dvdatmp,_mm_setzero_pd());
-            dvdasum          = _mm_add_pd(dvdasum,dvdatmp);
-            gmx_mm_increment_1real_pd(dvda+jnrA,_mm_mul_pd(dvdatmp,_mm_mul_pd(isaj0,isaj0)));
-            velec            = _mm_mul_pd(qq00,rinv00);
-            felec            = _mm_mul_pd(_mm_sub_pd(_mm_mul_pd(velec,rinv00),fgb),rinv00);
-
-            /* LENNARD-JONES DISPERSION/REPULSION */
-
-            rinvsix          = _mm_mul_pd(_mm_mul_pd(rinvsq00,rinvsq00),rinvsq00);
-            vvdw6            = _mm_mul_pd(c6_00,rinvsix);
-            vvdw12           = _mm_mul_pd(c12_00,_mm_mul_pd(rinvsix,rinvsix));
-            vvdw             = _mm_sub_pd( _mm_mul_pd(vvdw12,one_twelfth) , _mm_mul_pd(vvdw6,one_sixth) );
-            fvdw             = _mm_mul_pd(_mm_sub_pd(vvdw12,vvdw6),rinvsq00);
-
-            /* Update potential sum for this i atom from the interaction with this j atom. */
-            velec            = _mm_unpacklo_pd(velec,_mm_setzero_pd());
-            velecsum         = _mm_add_pd(velecsum,velec);
-            vgb              = _mm_unpacklo_pd(vgb,_mm_setzero_pd());
-            vgbsum           = _mm_add_pd(vgbsum,vgb);
-            vvdw             = _mm_unpacklo_pd(vvdw,_mm_setzero_pd());
-            vvdwsum          = _mm_add_pd(vvdwsum,vvdw);
-
-            fscal            = _mm_add_pd(felec,fvdw);
-
-            fscal            = _mm_unpacklo_pd(fscal,_mm_setzero_pd());
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm_mul_pd(fscal,dx00);
-            ty               = _mm_mul_pd(fscal,dy00);
-            tz               = _mm_mul_pd(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm_add_pd(fix0,tx);
-            fiy0             = _mm_add_pd(fiy0,ty);
-            fiz0             = _mm_add_pd(fiz0,tz);
-
-            gmx_mm_decrement_1rvec_1ptr_swizzle_pd(f+j_coord_offsetA,tx,ty,tz);
-
-            /* Inner loop uses 71 flops */
-        }
-
-        /* End of innermost loop */
-
-        gmx_mm_update_iforce_1atom_swizzle_pd(fix0,fiy0,fiz0,
-                                              f+i_coord_offset,fshift+i_shift_offset);
-
-        ggid                        = gid[iidx];
-        /* Update potential energies */
-        gmx_mm_update_1pot_pd(velecsum,kernel_data->energygrp_elec+ggid);
-        gmx_mm_update_1pot_pd(vgbsum,kernel_data->energygrp_polarization+ggid);
-        gmx_mm_update_1pot_pd(vvdwsum,kernel_data->energygrp_vdw+ggid);
-        dvdasum = _mm_mul_pd(dvdasum, _mm_mul_pd(isai0,isai0));
-        gmx_mm_update_1pot_pd(dvdasum,dvda+inr);
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 10 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_VF,outeriter*10 + inneriter*71);
-}
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_sse2_double
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            LennardJones
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        Force
- */
-void
-nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_sse2_double
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
-     * just 0 for non-waters.
-     * Suffixes A,B refer to j loop unrolling done with SSE double precision, e.g. for the two different
-     * jnr indices corresponding to data put in the four positions in the SIMD register.
-     */
-    int              i_shift_offset,i_coord_offset,outeriter,inneriter;
-    int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
-    int              jnrA,jnrB;
-    int              j_coord_offsetA,j_coord_offsetB;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             rcutoff_scalar;
-    real             *shiftvec,*fshift,*x,*f;
-    __m128d          tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
-    int              vdwioffset0;
-    __m128d          ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0A,vdwjidx0B;
-    __m128d          jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    __m128d          dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
-    __m128d          velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    __m128i          gbitab;
-    __m128d          vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,dvdaj,gbeps,dvdatmp;
-    __m128d          minushalf = _mm_set1_pd(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    int              nvdwtype;
-    __m128d          rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
-    int              *vdwtype;
-    real             *vdwparam;
-    __m128d          one_sixth   = _mm_set1_pd(1.0/6.0);
-    __m128d          one_twelfth = _mm_set1_pd(1.0/12.0);
-    __m128i          vfitab;
-    __m128i          ifour       = _mm_set1_epi32(4);
-    __m128d          rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF;
-    real             *vftab;
-    __m128d          dummy_mask,cutoff_mask;
-    __m128d          signbit   = gmx_mm_castsi128_pd( _mm_set_epi32(0x80000000,0x00000000,0x80000000,0x00000000) );
-    __m128d          one     = _mm_set1_pd(1.0);
-    __m128d          two     = _mm_set1_pd(2.0);
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = _mm_set1_pd(fr->ic->epsfac);
-    charge           = mdatoms->chargeA;
-    nvdwtype         = fr->ntype;
-    vdwparam         = fr->nbfp;
-    vdwtype          = mdatoms->typeA;
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = _mm_set1_pd(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = _mm_set1_pd((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-
-    /* Avoid stupid compiler warnings */
-    jnrA = jnrB = 0;
-    j_coord_offsetA = 0;
-    j_coord_offsetB = 0;
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        gmx_mm_load_shift_and_1rvec_broadcast_pd(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
-
-        fix0             = _mm_setzero_pd();
-        fiy0             = _mm_setzero_pd();
-        fiz0             = _mm_setzero_pd();
-
-        /* Load parameters for i particles */
-        iq0              = _mm_mul_pd(facel,_mm_load1_pd(charge+inr+0));
-        isai0            = _mm_load1_pd(invsqrta+inr+0);
-        vdwioffset0      = 2*nvdwtype*vdwtype[inr+0];
-
-        dvdasum          = _mm_setzero_pd();
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrA             = jjnr[jidx];
-            jnrB             = jjnr[jidx+1];
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_2ptr_swizzle_pd(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_pd(ix0,jx0);
-            dy00             = _mm_sub_pd(iy0,jy0);
-            dz00             = _mm_sub_pd(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_pd(dx00,dy00,dz00);
-
-            rinv00           = sse2_invsqrt_d(rsq00);
-
-            rinvsq00         = _mm_mul_pd(rinv00,rinv00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm_load_2real_swizzle_pd(charge+jnrA+0,charge+jnrB+0);
-            isaj0            = gmx_mm_load_2real_swizzle_pd(invsqrta+jnrA+0,invsqrta+jnrB+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-            vdwjidx0B        = 2*vdwtype[jnrB+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_pd(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_pd(iq0,jq0);
-            gmx_mm_load_2pair_swizzle_pd(vdwparam+vdwioffset0+vdwjidx0A,
-                                         vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_pd(isai0,isaj0);
-            gbqqfactor       = _mm_xor_pd(signbit,_mm_mul_pd(qq00,_mm_mul_pd(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_pd(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_pd(r00,gbscale);
-            gbitab           = _mm_cvttpd_epi32(rt);
-            gbeps            = _mm_sub_pd(rt,_mm_cvtepi32_pd(gbitab));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,0) );
-            F                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,1) );
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,0) +2);
-            H                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,1) +2);
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Heps             = _mm_mul_pd(gbeps,H);
-            Fp               = _mm_add_pd(F,_mm_mul_pd(gbeps,_mm_add_pd(G,Heps)));
-            VV               = _mm_add_pd(Y,_mm_mul_pd(gbeps,Fp));
-            vgb              = _mm_mul_pd(gbqqfactor,VV);
-
-            FF               = _mm_add_pd(Fp,_mm_mul_pd(gbeps,_mm_add_pd(G,_mm_add_pd(Heps,Heps))));
-            fgb              = _mm_mul_pd(gbqqfactor,_mm_mul_pd(FF,gbscale));
-            dvdatmp          = _mm_mul_pd(minushalf,_mm_add_pd(vgb,_mm_mul_pd(fgb,r00)));
-            dvdasum          = _mm_add_pd(dvdasum,dvdatmp);
-            gmx_mm_increment_2real_swizzle_pd(dvda+jnrA,dvda+jnrB,_mm_mul_pd(dvdatmp,_mm_mul_pd(isaj0,isaj0)));
-            velec            = _mm_mul_pd(qq00,rinv00);
-            felec            = _mm_mul_pd(_mm_sub_pd(_mm_mul_pd(velec,rinv00),fgb),rinv00);
-
-            /* LENNARD-JONES DISPERSION/REPULSION */
-
-            rinvsix          = _mm_mul_pd(_mm_mul_pd(rinvsq00,rinvsq00),rinvsq00);
-            fvdw             = _mm_mul_pd(_mm_sub_pd(_mm_mul_pd(c12_00,rinvsix),c6_00),_mm_mul_pd(rinvsix,rinvsq00));
-
-            fscal            = _mm_add_pd(felec,fvdw);
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm_mul_pd(fscal,dx00);
-            ty               = _mm_mul_pd(fscal,dy00);
-            tz               = _mm_mul_pd(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm_add_pd(fix0,tx);
-            fiy0             = _mm_add_pd(fiy0,ty);
-            fiz0             = _mm_add_pd(fiz0,tz);
-
-            gmx_mm_decrement_1rvec_2ptr_swizzle_pd(f+j_coord_offsetA,f+j_coord_offsetB,tx,ty,tz);
-
-            /* Inner loop uses 64 flops */
-        }
-
-        if(jidx<j_index_end)
-        {
-
-            jnrA             = jjnr[jidx];
-            j_coord_offsetA  = DIM*jnrA;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_1ptr_swizzle_pd(x+j_coord_offsetA,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_pd(ix0,jx0);
-            dy00             = _mm_sub_pd(iy0,jy0);
-            dz00             = _mm_sub_pd(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_pd(dx00,dy00,dz00);
-
-            rinv00           = sse2_invsqrt_d(rsq00);
-
-            rinvsq00         = _mm_mul_pd(rinv00,rinv00);
-
-            /* Load parameters for j particles */
-            jq0              = _mm_load_sd(charge+jnrA+0);
-            isaj0            = _mm_load_sd(invsqrta+jnrA+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_pd(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_pd(iq0,jq0);
-            gmx_mm_load_1pair_swizzle_pd(vdwparam+vdwioffset0+vdwjidx0A,&c6_00,&c12_00);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_pd(isai0,isaj0);
-            gbqqfactor       = _mm_xor_pd(signbit,_mm_mul_pd(qq00,_mm_mul_pd(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_pd(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_pd(r00,gbscale);
-            gbitab           = _mm_cvttpd_epi32(rt);
-            gbeps            = _mm_sub_pd(rt,_mm_cvtepi32_pd(gbitab));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,0) );
-            F                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,0) +2);
-            H                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Heps             = _mm_mul_pd(gbeps,H);
-            Fp               = _mm_add_pd(F,_mm_mul_pd(gbeps,_mm_add_pd(G,Heps)));
-            VV               = _mm_add_pd(Y,_mm_mul_pd(gbeps,Fp));
-            vgb              = _mm_mul_pd(gbqqfactor,VV);
-
-            FF               = _mm_add_pd(Fp,_mm_mul_pd(gbeps,_mm_add_pd(G,_mm_add_pd(Heps,Heps))));
-            fgb              = _mm_mul_pd(gbqqfactor,_mm_mul_pd(FF,gbscale));
-            dvdatmp          = _mm_mul_pd(minushalf,_mm_add_pd(vgb,_mm_mul_pd(fgb,r00)));
-            dvdatmp          = _mm_unpacklo_pd(dvdatmp,_mm_setzero_pd());
-            dvdasum          = _mm_add_pd(dvdasum,dvdatmp);
-            gmx_mm_increment_1real_pd(dvda+jnrA,_mm_mul_pd(dvdatmp,_mm_mul_pd(isaj0,isaj0)));
-            velec            = _mm_mul_pd(qq00,rinv00);
-            felec            = _mm_mul_pd(_mm_sub_pd(_mm_mul_pd(velec,rinv00),fgb),rinv00);
-
-            /* LENNARD-JONES DISPERSION/REPULSION */
-
-            rinvsix          = _mm_mul_pd(_mm_mul_pd(rinvsq00,rinvsq00),rinvsq00);
-            fvdw             = _mm_mul_pd(_mm_sub_pd(_mm_mul_pd(c12_00,rinvsix),c6_00),_mm_mul_pd(rinvsix,rinvsq00));
-
-            fscal            = _mm_add_pd(felec,fvdw);
-
-            fscal            = _mm_unpacklo_pd(fscal,_mm_setzero_pd());
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm_mul_pd(fscal,dx00);
-            ty               = _mm_mul_pd(fscal,dy00);
-            tz               = _mm_mul_pd(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm_add_pd(fix0,tx);
-            fiy0             = _mm_add_pd(fiy0,ty);
-            fiz0             = _mm_add_pd(fiz0,tz);
-
-            gmx_mm_decrement_1rvec_1ptr_swizzle_pd(f+j_coord_offsetA,tx,ty,tz);
-
-            /* Inner loop uses 64 flops */
-        }
-
-        /* End of innermost loop */
-
-        gmx_mm_update_iforce_1atom_swizzle_pd(fix0,fiy0,fiz0,
-                                              f+i_coord_offset,fshift+i_shift_offset);
-
-        dvdasum = _mm_mul_pd(dvdasum, _mm_mul_pd(isai0,isai0));
-        gmx_mm_update_1pot_pd(dvdasum,dvda+inr);
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 7 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_F,outeriter*7 + inneriter*64);
-}
diff --git a/src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecGB_VdwNone_GeomP1P1_sse2_double.c b/src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_double/nb_kernel_ElecGB_VdwNone_GeomP1P1_sse2_double.c
deleted file mode 100644 (file)
index b8c4480..0000000
+++ /dev/null
@@ -1,657 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
- * and including many others, as listed in the AUTHORS file in the
- * top-level source directory and at http://www.gromacs.org.
- *
- * GROMACS is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * GROMACS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GROMACS; if not, see
- * http://www.gnu.org/licenses, or write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
- *
- * If you want to redistribute modifications to GROMACS, please
- * consider that scientific software is very special. Version
- * control is crucial - bugs must be traceable. We will be happy to
- * consider code for inclusion in the official distribution, but
- * derived work must not be called official GROMACS. Details are found
- * in the README & COPYING files - if they are missing, get the
- * official version at http://www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the research papers on the package. Check out http://www.gromacs.org.
- */
-/*
- * Note: this file was generated by the GROMACS sse2_double kernel generator.
- */
-#include "gmxpre.h"
-
-#include "config.h"
-
-#include <math.h>
-
-#include "../nb_kernel.h"
-#include "gromacs/gmxlib/nrnb.h"
-
-#include "kernelutil_x86_sse2_double.h"
-
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_sse2_double
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            None
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        PotentialAndForce
- */
-void
-nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_sse2_double
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
-     * just 0 for non-waters.
-     * Suffixes A,B refer to j loop unrolling done with SSE double precision, e.g. for the two different
-     * jnr indices corresponding to data put in the four positions in the SIMD register.
-     */
-    int              i_shift_offset,i_coord_offset,outeriter,inneriter;
-    int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
-    int              jnrA,jnrB;
-    int              j_coord_offsetA,j_coord_offsetB;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             rcutoff_scalar;
-    real             *shiftvec,*fshift,*x,*f;
-    __m128d          tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
-    int              vdwioffset0;
-    __m128d          ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0A,vdwjidx0B;
-    __m128d          jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    __m128d          dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
-    __m128d          velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    __m128i          gbitab;
-    __m128d          vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,dvdaj,gbeps,dvdatmp;
-    __m128d          minushalf = _mm_set1_pd(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    __m128i          vfitab;
-    __m128i          ifour       = _mm_set1_epi32(4);
-    __m128d          rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF;
-    real             *vftab;
-    __m128d          dummy_mask,cutoff_mask;
-    __m128d          signbit   = gmx_mm_castsi128_pd( _mm_set_epi32(0x80000000,0x00000000,0x80000000,0x00000000) );
-    __m128d          one     = _mm_set1_pd(1.0);
-    __m128d          two     = _mm_set1_pd(2.0);
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = _mm_set1_pd(fr->ic->epsfac);
-    charge           = mdatoms->chargeA;
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = _mm_set1_pd(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = _mm_set1_pd((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-
-    /* Avoid stupid compiler warnings */
-    jnrA = jnrB = 0;
-    j_coord_offsetA = 0;
-    j_coord_offsetB = 0;
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        gmx_mm_load_shift_and_1rvec_broadcast_pd(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
-
-        fix0             = _mm_setzero_pd();
-        fiy0             = _mm_setzero_pd();
-        fiz0             = _mm_setzero_pd();
-
-        /* Load parameters for i particles */
-        iq0              = _mm_mul_pd(facel,_mm_load1_pd(charge+inr+0));
-        isai0            = _mm_load1_pd(invsqrta+inr+0);
-
-        /* Reset potential sums */
-        velecsum         = _mm_setzero_pd();
-        vgbsum           = _mm_setzero_pd();
-        dvdasum          = _mm_setzero_pd();
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrA             = jjnr[jidx];
-            jnrB             = jjnr[jidx+1];
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_2ptr_swizzle_pd(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_pd(ix0,jx0);
-            dy00             = _mm_sub_pd(iy0,jy0);
-            dz00             = _mm_sub_pd(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_pd(dx00,dy00,dz00);
-
-            rinv00           = sse2_invsqrt_d(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm_load_2real_swizzle_pd(charge+jnrA+0,charge+jnrB+0);
-            isaj0            = gmx_mm_load_2real_swizzle_pd(invsqrta+jnrA+0,invsqrta+jnrB+0);
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_pd(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_pd(iq0,jq0);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_pd(isai0,isaj0);
-            gbqqfactor       = _mm_xor_pd(signbit,_mm_mul_pd(qq00,_mm_mul_pd(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_pd(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_pd(r00,gbscale);
-            gbitab           = _mm_cvttpd_epi32(rt);
-            gbeps            = _mm_sub_pd(rt,_mm_cvtepi32_pd(gbitab));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,0) );
-            F                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,1) );
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,0) +2);
-            H                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,1) +2);
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Heps             = _mm_mul_pd(gbeps,H);
-            Fp               = _mm_add_pd(F,_mm_mul_pd(gbeps,_mm_add_pd(G,Heps)));
-            VV               = _mm_add_pd(Y,_mm_mul_pd(gbeps,Fp));
-            vgb              = _mm_mul_pd(gbqqfactor,VV);
-
-            FF               = _mm_add_pd(Fp,_mm_mul_pd(gbeps,_mm_add_pd(G,_mm_add_pd(Heps,Heps))));
-            fgb              = _mm_mul_pd(gbqqfactor,_mm_mul_pd(FF,gbscale));
-            dvdatmp          = _mm_mul_pd(minushalf,_mm_add_pd(vgb,_mm_mul_pd(fgb,r00)));
-            dvdasum          = _mm_add_pd(dvdasum,dvdatmp);
-            gmx_mm_increment_2real_swizzle_pd(dvda+jnrA,dvda+jnrB,_mm_mul_pd(dvdatmp,_mm_mul_pd(isaj0,isaj0)));
-            velec            = _mm_mul_pd(qq00,rinv00);
-            felec            = _mm_mul_pd(_mm_sub_pd(_mm_mul_pd(velec,rinv00),fgb),rinv00);
-
-            /* Update potential sum for this i atom from the interaction with this j atom. */
-            velecsum         = _mm_add_pd(velecsum,velec);
-            vgbsum           = _mm_add_pd(vgbsum,vgb);
-
-            fscal            = felec;
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm_mul_pd(fscal,dx00);
-            ty               = _mm_mul_pd(fscal,dy00);
-            tz               = _mm_mul_pd(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm_add_pd(fix0,tx);
-            fiy0             = _mm_add_pd(fiy0,ty);
-            fiz0             = _mm_add_pd(fiz0,tz);
-
-            gmx_mm_decrement_1rvec_2ptr_swizzle_pd(f+j_coord_offsetA,f+j_coord_offsetB,tx,ty,tz);
-
-            /* Inner loop uses 58 flops */
-        }
-
-        if(jidx<j_index_end)
-        {
-
-            jnrA             = jjnr[jidx];
-            j_coord_offsetA  = DIM*jnrA;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_1ptr_swizzle_pd(x+j_coord_offsetA,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_pd(ix0,jx0);
-            dy00             = _mm_sub_pd(iy0,jy0);
-            dz00             = _mm_sub_pd(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_pd(dx00,dy00,dz00);
-
-            rinv00           = sse2_invsqrt_d(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = _mm_load_sd(charge+jnrA+0);
-            isaj0            = _mm_load_sd(invsqrta+jnrA+0);
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_pd(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_pd(iq0,jq0);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_pd(isai0,isaj0);
-            gbqqfactor       = _mm_xor_pd(signbit,_mm_mul_pd(qq00,_mm_mul_pd(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_pd(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_pd(r00,gbscale);
-            gbitab           = _mm_cvttpd_epi32(rt);
-            gbeps            = _mm_sub_pd(rt,_mm_cvtepi32_pd(gbitab));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,0) );
-            F                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,0) +2);
-            H                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Heps             = _mm_mul_pd(gbeps,H);
-            Fp               = _mm_add_pd(F,_mm_mul_pd(gbeps,_mm_add_pd(G,Heps)));
-            VV               = _mm_add_pd(Y,_mm_mul_pd(gbeps,Fp));
-            vgb              = _mm_mul_pd(gbqqfactor,VV);
-
-            FF               = _mm_add_pd(Fp,_mm_mul_pd(gbeps,_mm_add_pd(G,_mm_add_pd(Heps,Heps))));
-            fgb              = _mm_mul_pd(gbqqfactor,_mm_mul_pd(FF,gbscale));
-            dvdatmp          = _mm_mul_pd(minushalf,_mm_add_pd(vgb,_mm_mul_pd(fgb,r00)));
-            dvdatmp          = _mm_unpacklo_pd(dvdatmp,_mm_setzero_pd());
-            dvdasum          = _mm_add_pd(dvdasum,dvdatmp);
-            gmx_mm_increment_1real_pd(dvda+jnrA,_mm_mul_pd(dvdatmp,_mm_mul_pd(isaj0,isaj0)));
-            velec            = _mm_mul_pd(qq00,rinv00);
-            felec            = _mm_mul_pd(_mm_sub_pd(_mm_mul_pd(velec,rinv00),fgb),rinv00);
-
-            /* Update potential sum for this i atom from the interaction with this j atom. */
-            velec            = _mm_unpacklo_pd(velec,_mm_setzero_pd());
-            velecsum         = _mm_add_pd(velecsum,velec);
-            vgb              = _mm_unpacklo_pd(vgb,_mm_setzero_pd());
-            vgbsum           = _mm_add_pd(vgbsum,vgb);
-
-            fscal            = felec;
-
-            fscal            = _mm_unpacklo_pd(fscal,_mm_setzero_pd());
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm_mul_pd(fscal,dx00);
-            ty               = _mm_mul_pd(fscal,dy00);
-            tz               = _mm_mul_pd(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm_add_pd(fix0,tx);
-            fiy0             = _mm_add_pd(fiy0,ty);
-            fiz0             = _mm_add_pd(fiz0,tz);
-
-            gmx_mm_decrement_1rvec_1ptr_swizzle_pd(f+j_coord_offsetA,tx,ty,tz);
-
-            /* Inner loop uses 58 flops */
-        }
-
-        /* End of innermost loop */
-
-        gmx_mm_update_iforce_1atom_swizzle_pd(fix0,fiy0,fiz0,
-                                              f+i_coord_offset,fshift+i_shift_offset);
-
-        ggid                        = gid[iidx];
-        /* Update potential energies */
-        gmx_mm_update_1pot_pd(velecsum,kernel_data->energygrp_elec+ggid);
-        gmx_mm_update_1pot_pd(vgbsum,kernel_data->energygrp_polarization+ggid);
-        dvdasum = _mm_mul_pd(dvdasum, _mm_mul_pd(isai0,isai0));
-        gmx_mm_update_1pot_pd(dvdasum,dvda+inr);
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 9 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VF,outeriter*9 + inneriter*58);
-}
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwNone_GeomP1P1_F_sse2_double
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            None
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        Force
- */
-void
-nb_kernel_ElecGB_VdwNone_GeomP1P1_F_sse2_double
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
-     * just 0 for non-waters.
-     * Suffixes A,B refer to j loop unrolling done with SSE double precision, e.g. for the two different
-     * jnr indices corresponding to data put in the four positions in the SIMD register.
-     */
-    int              i_shift_offset,i_coord_offset,outeriter,inneriter;
-    int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
-    int              jnrA,jnrB;
-    int              j_coord_offsetA,j_coord_offsetB;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             rcutoff_scalar;
-    real             *shiftvec,*fshift,*x,*f;
-    __m128d          tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
-    int              vdwioffset0;
-    __m128d          ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0A,vdwjidx0B;
-    __m128d          jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    __m128d          dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
-    __m128d          velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    __m128i          gbitab;
-    __m128d          vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,dvdaj,gbeps,dvdatmp;
-    __m128d          minushalf = _mm_set1_pd(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    __m128i          vfitab;
-    __m128i          ifour       = _mm_set1_epi32(4);
-    __m128d          rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF;
-    real             *vftab;
-    __m128d          dummy_mask,cutoff_mask;
-    __m128d          signbit   = gmx_mm_castsi128_pd( _mm_set_epi32(0x80000000,0x00000000,0x80000000,0x00000000) );
-    __m128d          one     = _mm_set1_pd(1.0);
-    __m128d          two     = _mm_set1_pd(2.0);
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = _mm_set1_pd(fr->ic->epsfac);
-    charge           = mdatoms->chargeA;
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = _mm_set1_pd(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = _mm_set1_pd((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-
-    /* Avoid stupid compiler warnings */
-    jnrA = jnrB = 0;
-    j_coord_offsetA = 0;
-    j_coord_offsetB = 0;
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        gmx_mm_load_shift_and_1rvec_broadcast_pd(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
-
-        fix0             = _mm_setzero_pd();
-        fiy0             = _mm_setzero_pd();
-        fiz0             = _mm_setzero_pd();
-
-        /* Load parameters for i particles */
-        iq0              = _mm_mul_pd(facel,_mm_load1_pd(charge+inr+0));
-        isai0            = _mm_load1_pd(invsqrta+inr+0);
-
-        dvdasum          = _mm_setzero_pd();
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrA             = jjnr[jidx];
-            jnrB             = jjnr[jidx+1];
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_2ptr_swizzle_pd(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_pd(ix0,jx0);
-            dy00             = _mm_sub_pd(iy0,jy0);
-            dz00             = _mm_sub_pd(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_pd(dx00,dy00,dz00);
-
-            rinv00           = sse2_invsqrt_d(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm_load_2real_swizzle_pd(charge+jnrA+0,charge+jnrB+0);
-            isaj0            = gmx_mm_load_2real_swizzle_pd(invsqrta+jnrA+0,invsqrta+jnrB+0);
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_pd(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_pd(iq0,jq0);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_pd(isai0,isaj0);
-            gbqqfactor       = _mm_xor_pd(signbit,_mm_mul_pd(qq00,_mm_mul_pd(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_pd(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_pd(r00,gbscale);
-            gbitab           = _mm_cvttpd_epi32(rt);
-            gbeps            = _mm_sub_pd(rt,_mm_cvtepi32_pd(gbitab));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,0) );
-            F                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,1) );
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,0) +2);
-            H                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,1) +2);
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Heps             = _mm_mul_pd(gbeps,H);
-            Fp               = _mm_add_pd(F,_mm_mul_pd(gbeps,_mm_add_pd(G,Heps)));
-            VV               = _mm_add_pd(Y,_mm_mul_pd(gbeps,Fp));
-            vgb              = _mm_mul_pd(gbqqfactor,VV);
-
-            FF               = _mm_add_pd(Fp,_mm_mul_pd(gbeps,_mm_add_pd(G,_mm_add_pd(Heps,Heps))));
-            fgb              = _mm_mul_pd(gbqqfactor,_mm_mul_pd(FF,gbscale));
-            dvdatmp          = _mm_mul_pd(minushalf,_mm_add_pd(vgb,_mm_mul_pd(fgb,r00)));
-            dvdasum          = _mm_add_pd(dvdasum,dvdatmp);
-            gmx_mm_increment_2real_swizzle_pd(dvda+jnrA,dvda+jnrB,_mm_mul_pd(dvdatmp,_mm_mul_pd(isaj0,isaj0)));
-            velec            = _mm_mul_pd(qq00,rinv00);
-            felec            = _mm_mul_pd(_mm_sub_pd(_mm_mul_pd(velec,rinv00),fgb),rinv00);
-
-            fscal            = felec;
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm_mul_pd(fscal,dx00);
-            ty               = _mm_mul_pd(fscal,dy00);
-            tz               = _mm_mul_pd(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm_add_pd(fix0,tx);
-            fiy0             = _mm_add_pd(fiy0,ty);
-            fiz0             = _mm_add_pd(fiz0,tz);
-
-            gmx_mm_decrement_1rvec_2ptr_swizzle_pd(f+j_coord_offsetA,f+j_coord_offsetB,tx,ty,tz);
-
-            /* Inner loop uses 56 flops */
-        }
-
-        if(jidx<j_index_end)
-        {
-
-            jnrA             = jjnr[jidx];
-            j_coord_offsetA  = DIM*jnrA;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_1ptr_swizzle_pd(x+j_coord_offsetA,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_pd(ix0,jx0);
-            dy00             = _mm_sub_pd(iy0,jy0);
-            dz00             = _mm_sub_pd(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_pd(dx00,dy00,dz00);
-
-            rinv00           = sse2_invsqrt_d(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = _mm_load_sd(charge+jnrA+0);
-            isaj0            = _mm_load_sd(invsqrta+jnrA+0);
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_pd(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_pd(iq0,jq0);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_pd(isai0,isaj0);
-            gbqqfactor       = _mm_xor_pd(signbit,_mm_mul_pd(qq00,_mm_mul_pd(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_pd(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_pd(r00,gbscale);
-            gbitab           = _mm_cvttpd_epi32(rt);
-            gbeps            = _mm_sub_pd(rt,_mm_cvtepi32_pd(gbitab));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,0) );
-            F                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,0) +2);
-            H                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Heps             = _mm_mul_pd(gbeps,H);
-            Fp               = _mm_add_pd(F,_mm_mul_pd(gbeps,_mm_add_pd(G,Heps)));
-            VV               = _mm_add_pd(Y,_mm_mul_pd(gbeps,Fp));
-            vgb              = _mm_mul_pd(gbqqfactor,VV);
-
-            FF               = _mm_add_pd(Fp,_mm_mul_pd(gbeps,_mm_add_pd(G,_mm_add_pd(Heps,Heps))));
-            fgb              = _mm_mul_pd(gbqqfactor,_mm_mul_pd(FF,gbscale));
-            dvdatmp          = _mm_mul_pd(minushalf,_mm_add_pd(vgb,_mm_mul_pd(fgb,r00)));
-            dvdatmp          = _mm_unpacklo_pd(dvdatmp,_mm_setzero_pd());
-            dvdasum          = _mm_add_pd(dvdasum,dvdatmp);
-            gmx_mm_increment_1real_pd(dvda+jnrA,_mm_mul_pd(dvdatmp,_mm_mul_pd(isaj0,isaj0)));
-            velec            = _mm_mul_pd(qq00,rinv00);
-            felec            = _mm_mul_pd(_mm_sub_pd(_mm_mul_pd(velec,rinv00),fgb),rinv00);
-
-            fscal            = felec;
-
-            fscal            = _mm_unpacklo_pd(fscal,_mm_setzero_pd());
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm_mul_pd(fscal,dx00);
-            ty               = _mm_mul_pd(fscal,dy00);
-            tz               = _mm_mul_pd(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm_add_pd(fix0,tx);
-            fiy0             = _mm_add_pd(fiy0,ty);
-            fiz0             = _mm_add_pd(fiz0,tz);
-
-            gmx_mm_decrement_1rvec_1ptr_swizzle_pd(f+j_coord_offsetA,tx,ty,tz);
-
-            /* Inner loop uses 56 flops */
-        }
-
-        /* End of innermost loop */
-
-        gmx_mm_update_iforce_1atom_swizzle_pd(fix0,fiy0,fiz0,
-                                              f+i_coord_offset,fshift+i_shift_offset);
-
-        dvdasum = _mm_mul_pd(dvdasum, _mm_mul_pd(isai0,isai0));
-        gmx_mm_update_1pot_pd(dvdasum,dvda+inr);
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 7 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_F,outeriter*7 + inneriter*56);
-}
index 29bd977bac7bf177db725ebdb2ecda6b6ca14780..ba3fb0cb56bf154744f155f25d5f22654a5bb600 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -51,6 +51,36 @@ nb_kernel_t nb_kernel_ElecNone_VdwLJSw_GeomP1P1_VF_sse2_double;
 nb_kernel_t nb_kernel_ElecNone_VdwLJSw_GeomP1P1_F_sse2_double;
 nb_kernel_t nb_kernel_ElecNone_VdwCSTab_GeomP1P1_VF_sse2_double;
 nb_kernel_t nb_kernel_ElecNone_VdwCSTab_GeomP1P1_F_sse2_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_sse2_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_sse2_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_sse2_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_sse2_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_sse2_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_sse2_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_sse2_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_sse2_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_sse2_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_sse2_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_sse2_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_sse2_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_sse2_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_sse2_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_sse2_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_sse2_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_sse2_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_sse2_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_sse2_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_sse2_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_sse2_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_sse2_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_sse2_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_sse2_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_sse2_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_sse2_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_sse2_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_sse2_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_sse2_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_sse2_double;
 nb_kernel_t nb_kernel_ElecEw_VdwLJEw_GeomP1P1_VF_sse2_double;
 nb_kernel_t nb_kernel_ElecEw_VdwLJEw_GeomP1P1_F_sse2_double;
 nb_kernel_t nb_kernel_ElecEw_VdwLJEw_GeomW3P1_VF_sse2_double;
@@ -141,72 +171,6 @@ nb_kernel_t nb_kernel_ElecEwSw_VdwNone_GeomW4P1_VF_sse2_double;
 nb_kernel_t nb_kernel_ElecEwSw_VdwNone_GeomW4P1_F_sse2_double;
 nb_kernel_t nb_kernel_ElecEwSw_VdwNone_GeomW4W4_VF_sse2_double;
 nb_kernel_t nb_kernel_ElecEwSw_VdwNone_GeomW4W4_F_sse2_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_sse2_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_sse2_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_sse2_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_sse2_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_sse2_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_sse2_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_sse2_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_sse2_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_sse2_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_sse2_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_sse2_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_sse2_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_sse2_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_sse2_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_sse2_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_sse2_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_sse2_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_sse2_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_sse2_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_sse2_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_sse2_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_sse2_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_sse2_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_sse2_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_sse2_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_sse2_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_sse2_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_sse2_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_sse2_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_sse2_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_sse2_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_sse2_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_sse2_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_sse2_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_sse2_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_sse2_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_sse2_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_sse2_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_sse2_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_sse2_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_sse2_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_sse2_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_sse2_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_sse2_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_sse2_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_sse2_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_sse2_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_sse2_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_sse2_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_sse2_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_sse2_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_sse2_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_sse2_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_sse2_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_sse2_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_sse2_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_sse2_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_sse2_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_sse2_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_sse2_double;
-nb_kernel_t nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_sse2_double;
-nb_kernel_t nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_sse2_double;
-nb_kernel_t nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_sse2_double;
-nb_kernel_t nb_kernel_ElecGB_VdwNone_GeomP1P1_F_sse2_double;
-nb_kernel_t nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_sse2_double;
-nb_kernel_t nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_sse2_double;
 nb_kernel_t nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_VF_sse2_double;
 nb_kernel_t nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_F_sse2_double;
 nb_kernel_t nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_VF_sse2_double;
@@ -277,6 +241,36 @@ nb_kernel_t nb_kernel_ElecRF_VdwCSTab_GeomW4P1_VF_sse2_double;
 nb_kernel_t nb_kernel_ElecRF_VdwCSTab_GeomW4P1_F_sse2_double;
 nb_kernel_t nb_kernel_ElecRF_VdwCSTab_GeomW4W4_VF_sse2_double;
 nb_kernel_t nb_kernel_ElecRF_VdwCSTab_GeomW4W4_F_sse2_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_sse2_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_sse2_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_sse2_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_sse2_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_sse2_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_sse2_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_sse2_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_sse2_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_sse2_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_sse2_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_sse2_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_sse2_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_sse2_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_sse2_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_sse2_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_sse2_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_sse2_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_sse2_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_sse2_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_sse2_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_sse2_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_sse2_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_sse2_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_sse2_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_sse2_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_sse2_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_sse2_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_sse2_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_sse2_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_sse2_double;
 
 
 nb_kernel_info_t
@@ -294,6 +288,36 @@ nb_kernel_info_t
     { nb_kernel_ElecNone_VdwLJSw_GeomP1P1_F_sse2_double, "nb_kernel_ElecNone_VdwLJSw_GeomP1P1_F_sse2_double", "sse2_double", "None", "None", "LennardJones", "PotentialSwitch", "ParticleParticle", "", "Force" },
     { nb_kernel_ElecNone_VdwCSTab_GeomP1P1_VF_sse2_double, "nb_kernel_ElecNone_VdwCSTab_GeomP1P1_VF_sse2_double", "sse2_double", "None", "None", "CubicSplineTable", "None", "ParticleParticle", "", "PotentialAndForce" },
     { nb_kernel_ElecNone_VdwCSTab_GeomP1P1_F_sse2_double, "nb_kernel_ElecNone_VdwCSTab_GeomP1P1_F_sse2_double", "sse2_double", "None", "None", "CubicSplineTable", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_sse2_double, "nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_sse2_double", "sse2_double", "CubicSplineTable", "None", "LennardJones", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_sse2_double, "nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_sse2_double", "sse2_double", "CubicSplineTable", "None", "LennardJones", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_sse2_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_sse2_double", "sse2_double", "CubicSplineTable", "None", "LennardJones", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_sse2_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_sse2_double", "sse2_double", "CubicSplineTable", "None", "LennardJones", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_sse2_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_sse2_double", "sse2_double", "CubicSplineTable", "None", "LennardJones", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_sse2_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_sse2_double", "sse2_double", "CubicSplineTable", "None", "LennardJones", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_sse2_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_sse2_double", "sse2_double", "CubicSplineTable", "None", "LennardJones", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_sse2_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_sse2_double", "sse2_double", "CubicSplineTable", "None", "LennardJones", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_sse2_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_sse2_double", "sse2_double", "CubicSplineTable", "None", "LennardJones", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_sse2_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_sse2_double", "sse2_double", "CubicSplineTable", "None", "LennardJones", "None", "Water4Water4", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_sse2_double, "nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_sse2_double", "sse2_double", "CubicSplineTable", "None", "None", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_sse2_double, "nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_sse2_double", "sse2_double", "CubicSplineTable", "None", "None", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_sse2_double, "nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_sse2_double", "sse2_double", "CubicSplineTable", "None", "None", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_sse2_double, "nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_sse2_double", "sse2_double", "CubicSplineTable", "None", "None", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_sse2_double, "nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_sse2_double", "sse2_double", "CubicSplineTable", "None", "None", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_sse2_double, "nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_sse2_double", "sse2_double", "CubicSplineTable", "None", "None", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_sse2_double, "nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_sse2_double", "sse2_double", "CubicSplineTable", "None", "None", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_sse2_double, "nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_sse2_double", "sse2_double", "CubicSplineTable", "None", "None", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_sse2_double, "nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_sse2_double", "sse2_double", "CubicSplineTable", "None", "None", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_sse2_double, "nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_sse2_double", "sse2_double", "CubicSplineTable", "None", "None", "None", "Water4Water4", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_sse2_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_sse2_double", "sse2_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_sse2_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_sse2_double", "sse2_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_sse2_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_sse2_double", "sse2_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_sse2_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_sse2_double", "sse2_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_sse2_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_sse2_double", "sse2_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_sse2_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_sse2_double", "sse2_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_sse2_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_sse2_double", "sse2_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_sse2_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_sse2_double", "sse2_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_sse2_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_sse2_double", "sse2_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_sse2_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_sse2_double", "sse2_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Water4", "", "Force" },
     { nb_kernel_ElecEw_VdwLJEw_GeomP1P1_VF_sse2_double, "nb_kernel_ElecEw_VdwLJEw_GeomP1P1_VF_sse2_double", "sse2_double", "Ewald", "None", "LJEwald", "None", "ParticleParticle", "", "PotentialAndForce" },
     { nb_kernel_ElecEw_VdwLJEw_GeomP1P1_F_sse2_double, "nb_kernel_ElecEw_VdwLJEw_GeomP1P1_F_sse2_double", "sse2_double", "Ewald", "None", "LJEwald", "None", "ParticleParticle", "", "Force" },
     { nb_kernel_ElecEw_VdwLJEw_GeomW3P1_VF_sse2_double, "nb_kernel_ElecEw_VdwLJEw_GeomW3P1_VF_sse2_double", "sse2_double", "Ewald", "None", "LJEwald", "None", "Water3Particle", "", "PotentialAndForce" },
@@ -384,72 +408,6 @@ nb_kernel_info_t
     { nb_kernel_ElecEwSw_VdwNone_GeomW4P1_F_sse2_double, "nb_kernel_ElecEwSw_VdwNone_GeomW4P1_F_sse2_double", "sse2_double", "Ewald", "PotentialSwitch", "None", "None", "Water4Particle", "", "Force" },
     { nb_kernel_ElecEwSw_VdwNone_GeomW4W4_VF_sse2_double, "nb_kernel_ElecEwSw_VdwNone_GeomW4W4_VF_sse2_double", "sse2_double", "Ewald", "PotentialSwitch", "None", "None", "Water4Water4", "", "PotentialAndForce" },
     { nb_kernel_ElecEwSw_VdwNone_GeomW4W4_F_sse2_double, "nb_kernel_ElecEwSw_VdwNone_GeomW4W4_F_sse2_double", "sse2_double", "Ewald", "PotentialSwitch", "None", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_sse2_double, "nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_sse2_double", "sse2_double", "Coulomb", "None", "LennardJones", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_sse2_double, "nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_sse2_double", "sse2_double", "Coulomb", "None", "LennardJones", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_sse2_double, "nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_sse2_double", "sse2_double", "Coulomb", "None", "LennardJones", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_sse2_double, "nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_sse2_double", "sse2_double", "Coulomb", "None", "LennardJones", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_sse2_double, "nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_sse2_double", "sse2_double", "Coulomb", "None", "LennardJones", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_sse2_double, "nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_sse2_double", "sse2_double", "Coulomb", "None", "LennardJones", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_sse2_double, "nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_sse2_double", "sse2_double", "Coulomb", "None", "LennardJones", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_sse2_double, "nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_sse2_double", "sse2_double", "Coulomb", "None", "LennardJones", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_sse2_double, "nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_sse2_double", "sse2_double", "Coulomb", "None", "LennardJones", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_sse2_double, "nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_sse2_double", "sse2_double", "Coulomb", "None", "LennardJones", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_sse2_double, "nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_sse2_double", "sse2_double", "Coulomb", "None", "None", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_sse2_double, "nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_sse2_double", "sse2_double", "Coulomb", "None", "None", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_sse2_double, "nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_sse2_double", "sse2_double", "Coulomb", "None", "None", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_sse2_double, "nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_sse2_double", "sse2_double", "Coulomb", "None", "None", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_sse2_double, "nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_sse2_double", "sse2_double", "Coulomb", "None", "None", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_sse2_double, "nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_sse2_double", "sse2_double", "Coulomb", "None", "None", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_sse2_double, "nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_sse2_double", "sse2_double", "Coulomb", "None", "None", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_sse2_double, "nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_sse2_double", "sse2_double", "Coulomb", "None", "None", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_sse2_double, "nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_sse2_double", "sse2_double", "Coulomb", "None", "None", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_sse2_double, "nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_sse2_double", "sse2_double", "Coulomb", "None", "None", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_sse2_double, "nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_sse2_double", "sse2_double", "Coulomb", "None", "CubicSplineTable", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_sse2_double, "nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_sse2_double", "sse2_double", "Coulomb", "None", "CubicSplineTable", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_sse2_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_sse2_double", "sse2_double", "Coulomb", "None", "CubicSplineTable", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_sse2_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_sse2_double", "sse2_double", "Coulomb", "None", "CubicSplineTable", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_sse2_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_sse2_double", "sse2_double", "Coulomb", "None", "CubicSplineTable", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_sse2_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_sse2_double", "sse2_double", "Coulomb", "None", "CubicSplineTable", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_sse2_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_sse2_double", "sse2_double", "Coulomb", "None", "CubicSplineTable", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_sse2_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_sse2_double", "sse2_double", "Coulomb", "None", "CubicSplineTable", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_sse2_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_sse2_double", "sse2_double", "Coulomb", "None", "CubicSplineTable", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_sse2_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_sse2_double", "sse2_double", "Coulomb", "None", "CubicSplineTable", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_sse2_double, "nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_sse2_double", "sse2_double", "CubicSplineTable", "None", "LennardJones", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_sse2_double, "nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_sse2_double", "sse2_double", "CubicSplineTable", "None", "LennardJones", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_sse2_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_sse2_double", "sse2_double", "CubicSplineTable", "None", "LennardJones", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_sse2_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_sse2_double", "sse2_double", "CubicSplineTable", "None", "LennardJones", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_sse2_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_sse2_double", "sse2_double", "CubicSplineTable", "None", "LennardJones", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_sse2_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_sse2_double", "sse2_double", "CubicSplineTable", "None", "LennardJones", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_sse2_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_sse2_double", "sse2_double", "CubicSplineTable", "None", "LennardJones", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_sse2_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_sse2_double", "sse2_double", "CubicSplineTable", "None", "LennardJones", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_sse2_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_sse2_double", "sse2_double", "CubicSplineTable", "None", "LennardJones", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_sse2_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_sse2_double", "sse2_double", "CubicSplineTable", "None", "LennardJones", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_sse2_double, "nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_sse2_double", "sse2_double", "CubicSplineTable", "None", "None", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_sse2_double, "nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_sse2_double", "sse2_double", "CubicSplineTable", "None", "None", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_sse2_double, "nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_sse2_double", "sse2_double", "CubicSplineTable", "None", "None", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_sse2_double, "nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_sse2_double", "sse2_double", "CubicSplineTable", "None", "None", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_sse2_double, "nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_sse2_double", "sse2_double", "CubicSplineTable", "None", "None", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_sse2_double, "nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_sse2_double", "sse2_double", "CubicSplineTable", "None", "None", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_sse2_double, "nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_sse2_double", "sse2_double", "CubicSplineTable", "None", "None", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_sse2_double, "nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_sse2_double", "sse2_double", "CubicSplineTable", "None", "None", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_sse2_double, "nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_sse2_double", "sse2_double", "CubicSplineTable", "None", "None", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_sse2_double, "nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_sse2_double", "sse2_double", "CubicSplineTable", "None", "None", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_sse2_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_sse2_double", "sse2_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_sse2_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_sse2_double", "sse2_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_sse2_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_sse2_double", "sse2_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_sse2_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_sse2_double", "sse2_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_sse2_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_sse2_double", "sse2_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_sse2_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_sse2_double", "sse2_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_sse2_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_sse2_double", "sse2_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_sse2_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_sse2_double", "sse2_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_sse2_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_sse2_double", "sse2_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_sse2_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_sse2_double", "sse2_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_sse2_double, "nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_sse2_double", "sse2_double", "GeneralizedBorn", "None", "LennardJones", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_sse2_double, "nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_sse2_double", "sse2_double", "GeneralizedBorn", "None", "LennardJones", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_sse2_double, "nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_sse2_double", "sse2_double", "GeneralizedBorn", "None", "None", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecGB_VdwNone_GeomP1P1_F_sse2_double, "nb_kernel_ElecGB_VdwNone_GeomP1P1_F_sse2_double", "sse2_double", "GeneralizedBorn", "None", "None", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_sse2_double, "nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_sse2_double", "sse2_double", "GeneralizedBorn", "None", "CubicSplineTable", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_sse2_double, "nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_sse2_double", "sse2_double", "GeneralizedBorn", "None", "CubicSplineTable", "None", "ParticleParticle", "", "Force" },
     { nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_VF_sse2_double, "nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_VF_sse2_double", "sse2_double", "ReactionField", "ExactCutoff", "LennardJones", "PotentialShift", "ParticleParticle", "", "PotentialAndForce" },
     { nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_F_sse2_double, "nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_F_sse2_double", "sse2_double", "ReactionField", "ExactCutoff", "LennardJones", "PotentialShift", "ParticleParticle", "", "Force" },
     { nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_VF_sse2_double, "nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_VF_sse2_double", "sse2_double", "ReactionField", "ExactCutoff", "LennardJones", "PotentialShift", "Water3Particle", "", "PotentialAndForce" },
@@ -519,7 +477,37 @@ nb_kernel_info_t
     { nb_kernel_ElecRF_VdwCSTab_GeomW4P1_VF_sse2_double, "nb_kernel_ElecRF_VdwCSTab_GeomW4P1_VF_sse2_double", "sse2_double", "ReactionField", "None", "CubicSplineTable", "None", "Water4Particle", "", "PotentialAndForce" },
     { nb_kernel_ElecRF_VdwCSTab_GeomW4P1_F_sse2_double, "nb_kernel_ElecRF_VdwCSTab_GeomW4P1_F_sse2_double", "sse2_double", "ReactionField", "None", "CubicSplineTable", "None", "Water4Particle", "", "Force" },
     { nb_kernel_ElecRF_VdwCSTab_GeomW4W4_VF_sse2_double, "nb_kernel_ElecRF_VdwCSTab_GeomW4W4_VF_sse2_double", "sse2_double", "ReactionField", "None", "CubicSplineTable", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecRF_VdwCSTab_GeomW4W4_F_sse2_double, "nb_kernel_ElecRF_VdwCSTab_GeomW4W4_F_sse2_double", "sse2_double", "ReactionField", "None", "CubicSplineTable", "None", "Water4Water4", "", "Force" }
+    { nb_kernel_ElecRF_VdwCSTab_GeomW4W4_F_sse2_double, "nb_kernel_ElecRF_VdwCSTab_GeomW4W4_F_sse2_double", "sse2_double", "ReactionField", "None", "CubicSplineTable", "None", "Water4Water4", "", "Force" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_sse2_double, "nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_sse2_double", "sse2_double", "Coulomb", "None", "LennardJones", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_sse2_double, "nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_sse2_double", "sse2_double", "Coulomb", "None", "LennardJones", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_sse2_double, "nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_sse2_double", "sse2_double", "Coulomb", "None", "LennardJones", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_sse2_double, "nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_sse2_double", "sse2_double", "Coulomb", "None", "LennardJones", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_sse2_double, "nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_sse2_double", "sse2_double", "Coulomb", "None", "LennardJones", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_sse2_double, "nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_sse2_double", "sse2_double", "Coulomb", "None", "LennardJones", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_sse2_double, "nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_sse2_double", "sse2_double", "Coulomb", "None", "LennardJones", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_sse2_double, "nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_sse2_double", "sse2_double", "Coulomb", "None", "LennardJones", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_sse2_double, "nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_sse2_double", "sse2_double", "Coulomb", "None", "LennardJones", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_sse2_double, "nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_sse2_double", "sse2_double", "Coulomb", "None", "LennardJones", "None", "Water4Water4", "", "Force" },
+    { nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_sse2_double, "nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_sse2_double", "sse2_double", "Coulomb", "None", "None", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_sse2_double, "nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_sse2_double", "sse2_double", "Coulomb", "None", "None", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_sse2_double, "nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_sse2_double", "sse2_double", "Coulomb", "None", "None", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_sse2_double, "nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_sse2_double", "sse2_double", "Coulomb", "None", "None", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_sse2_double, "nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_sse2_double", "sse2_double", "Coulomb", "None", "None", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_sse2_double, "nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_sse2_double", "sse2_double", "Coulomb", "None", "None", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_sse2_double, "nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_sse2_double", "sse2_double", "Coulomb", "None", "None", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_sse2_double, "nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_sse2_double", "sse2_double", "Coulomb", "None", "None", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_sse2_double, "nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_sse2_double", "sse2_double", "Coulomb", "None", "None", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_sse2_double, "nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_sse2_double", "sse2_double", "Coulomb", "None", "None", "None", "Water4Water4", "", "Force" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_sse2_double, "nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_sse2_double", "sse2_double", "Coulomb", "None", "CubicSplineTable", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_sse2_double, "nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_sse2_double", "sse2_double", "Coulomb", "None", "CubicSplineTable", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_sse2_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_sse2_double", "sse2_double", "Coulomb", "None", "CubicSplineTable", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_sse2_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_sse2_double", "sse2_double", "Coulomb", "None", "CubicSplineTable", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_sse2_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_sse2_double", "sse2_double", "Coulomb", "None", "CubicSplineTable", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_sse2_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_sse2_double", "sse2_double", "Coulomb", "None", "CubicSplineTable", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_sse2_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_sse2_double", "sse2_double", "Coulomb", "None", "CubicSplineTable", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_sse2_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_sse2_double", "sse2_double", "Coulomb", "None", "CubicSplineTable", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_sse2_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_sse2_double", "sse2_double", "Coulomb", "None", "CubicSplineTable", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_sse2_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_sse2_double", "sse2_double", "Coulomb", "None", "CubicSplineTable", "None", "Water4Water4", "", "Force" }
 };
 
 int
index 15932a11d2b71bdc87ee1fcc0cd66bf0b40c04d5..a59b3432e8f4007416e90dce84c8ca1fd1364199 100644 (file)
@@ -2,7 +2,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -128,12 +128,6 @@ void
     __m128d          velec,felec,velecsum,facel,crf,krf,krf2;
     real             *charge;
     /* #endif */
-    /* #if 'GeneralizedBorn' in KERNEL_ELEC */
-    __m128i          gbitab;
-    __m128d          vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,dvdaj,gbeps,dvdatmp;
-    __m128d          minushalf = _mm_set1_pd(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    /* #endif */
     /* #if KERNEL_VDW != 'None' */
     int              nvdwtype;
     __m128d          rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
@@ -142,7 +136,7 @@ void
     __m128d          one_sixth   = _mm_set1_pd(1.0/6.0);
     __m128d          one_twelfth = _mm_set1_pd(1.0/12.0);
     /* #endif */
-    /* #if 'Table' in KERNEL_ELEC or 'GeneralizedBorn' in KERNEL_ELEC or 'Table' in KERNEL_VDW */
+    /* #if 'Table' in KERNEL_ELEC or 'Table' in KERNEL_VDW */
     __m128i          vfitab;
     __m128i          ifour       = _mm_set1_epi32(4);
     __m128d          rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF;
@@ -226,14 +220,6 @@ void
      /*     #endif */
     /* #endif */
 
-    /* #if KERNEL_ELEC=='GeneralizedBorn' */
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = _mm_set1_pd(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = _mm_set1_pd((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-    /* #endif */
-
     /* #if 'Water' in GEOMETRY_I */
     /* Setup water-specific parameters */
     inr              = nlist->iinr[0];
@@ -360,9 +346,6 @@ void
         /*     #for I in PARTICLES_ELEC_I */
         iq{I}              = _mm_mul_pd(facel,_mm_load1_pd(charge+inr+{I}));
         /*         #define OUTERFLOPS OUTERFLOPS+1 */
-        /*         #if KERNEL_ELEC=='GeneralizedBorn' */
-        isai{I}            = _mm_load1_pd(invsqrta+inr+{I});
-        /*         #endif */
         /*     #endfor */
         /*     #for I in PARTICLES_VDW_I */
         vdwioffset{I}      = 2*nvdwtype*vdwtype[inr+{I}];
@@ -374,16 +357,10 @@ void
         /*     #if KERNEL_ELEC != 'None' */
         velecsum         = _mm_setzero_pd();
         /*     #endif */
-        /*     #if 'GeneralizedBorn' in KERNEL_ELEC */
-        vgbsum           = _mm_setzero_pd();
-        /*     #endif */
         /*     #if KERNEL_VDW != 'None' */
         vvdwsum          = _mm_setzero_pd();
         /*     #endif */
         /* #endif */
-        /*     #if 'GeneralizedBorn' in KERNEL_ELEC and 'Force' in KERNEL_VF */
-        dvdasum          = _mm_setzero_pd();
-        /*     #endif */
 
         /* #for ROUND in ['Loop','Epilogue'] */
 
@@ -490,13 +467,6 @@ void
             /*         #else */
             jq{J}              = _mm_load_sd(charge+jnrA+{J});
             /*         #endif */
-            /*         #if KERNEL_ELEC=='GeneralizedBorn' */
-            /*             #if ROUND =='Loop' */
-            isaj{J}            = gmx_mm_load_2real_swizzle_pd(invsqrta+jnrA+{J},invsqrta+jnrB+{J});
-            /*             #else */
-            isaj{J}            = _mm_load_sd(invsqrta+jnrA+{J});
-            /*             #endif */
-            /*         #endif */
             /*     #endfor */
             /*     #for J in PARTICLES_VDW_J */
             vdwjidx{J}A        = 2*vdwtype[jnrA+{J}];
@@ -604,64 +574,6 @@ void
             /*                 #define INNERFLOPS INNERFLOPS+3 */
             /*             #endif */
 
-            /*         #elif KERNEL_ELEC=='GeneralizedBorn' */
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_pd(isai{I},isaj{J});
-            gbqqfactor       = _mm_xor_pd(signbit,_mm_mul_pd(qq{I}{J},_mm_mul_pd(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_pd(isaprod,gbtabscale);
-            /*             #define INNERFLOPS INNERFLOPS+5 */
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_pd(r{I}{J},gbscale);
-            gbitab           = _mm_cvttpd_epi32(rt);
-            gbeps            = _mm_sub_pd(rt,_mm_cvtepi32_pd(gbitab));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,0) );
-            /*             #if ROUND == 'Loop' */
-            F                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,1) );
-            /*             #else */
-            F                = _mm_setzero_pd();
-            /*             #endif */
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,0) +2);
-            /*             #if ROUND == 'Loop' */
-            H                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,1) +2);
-            /*             #else */
-            H                = _mm_setzero_pd();
-            /*             #endif */
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Heps             = _mm_mul_pd(gbeps,H);
-            Fp               = _mm_add_pd(F,_mm_mul_pd(gbeps,_mm_add_pd(G,Heps)));
-            VV               = _mm_add_pd(Y,_mm_mul_pd(gbeps,Fp));
-            vgb              = _mm_mul_pd(gbqqfactor,VV);
-            /*             #define INNERFLOPS INNERFLOPS+10 */
-
-            /*             #if 'Force' in KERNEL_VF */
-            FF               = _mm_add_pd(Fp,_mm_mul_pd(gbeps,_mm_add_pd(G,_mm_add_pd(Heps,Heps))));
-            fgb              = _mm_mul_pd(gbqqfactor,_mm_mul_pd(FF,gbscale));
-            dvdatmp          = _mm_mul_pd(minushalf,_mm_add_pd(vgb,_mm_mul_pd(fgb,r{I}{J})));
-            /*                 #if ROUND == 'Epilogue' */
-            dvdatmp          = _mm_unpacklo_pd(dvdatmp,_mm_setzero_pd());
-            /*                 #endif */
-            dvdasum          = _mm_add_pd(dvdasum,dvdatmp);
-            /*             #if ROUND == 'Loop' */
-            gmx_mm_increment_2real_swizzle_pd(dvda+jnrA,dvda+jnrB,_mm_mul_pd(dvdatmp,_mm_mul_pd(isaj{J},isaj{J})));
-            /*             #else */
-            gmx_mm_increment_1real_pd(dvda+jnrA,_mm_mul_pd(dvdatmp,_mm_mul_pd(isaj{J},isaj{J})));
-            /*             #endif */
-            /*                 #define INNERFLOPS INNERFLOPS+13 */
-            /*             #endif */
-            velec            = _mm_mul_pd(qq{I}{J},rinv{I}{J});
-            /*                 #define INNERFLOPS INNERFLOPS+1 */
-            /*             #if 'Force' in KERNEL_VF */
-            felec            = _mm_mul_pd(_mm_sub_pd(_mm_mul_pd(velec,rinv{I}{J}),fgb),rinv{I}{J});
-            /*                 #define INNERFLOPS INNERFLOPS+3 */
-            /*             #endif */
-
             /*         #elif KERNEL_ELEC=='Ewald' */
             /* EWALD ELECTROSTATICS */
 
@@ -946,17 +858,6 @@ void
             /*             #endif */
             velecsum         = _mm_add_pd(velecsum,velec);
             /*             #define INNERFLOPS INNERFLOPS+1 */
-            /*             #if KERNEL_ELEC=='GeneralizedBorn' */
-            /*             #if 'exactcutoff' in INTERACTION_FLAGS[I][J] */
-            vgb              = _mm_and_pd(vgb,cutoff_mask);
-            /*                 #define INNERFLOPS INNERFLOPS+1 */
-            /*             #endif                                       */
-            /*             #if ROUND == 'Epilogue' */
-            vgb              = _mm_unpacklo_pd(vgb,_mm_setzero_pd());
-            /*             #endif */
-            vgbsum           = _mm_add_pd(vgbsum,vgb);
-            /*                 #define INNERFLOPS INNERFLOPS+1 */
-            /*             #endif */
             /*         #endif */
             /*         #if 'vdw' in INTERACTION_FLAGS[I][J] */
             /*             #if 'exactcutoff' in INTERACTION_FLAGS[I][J] */
@@ -1097,19 +998,11 @@ void
         gmx_mm_update_1pot_pd(velecsum,kernel_data->energygrp_elec+ggid);
         /*         #define OUTERFLOPS OUTERFLOPS+1 */
         /*     #endif */
-        /*     #if 'GeneralizedBorn' in KERNEL_ELEC */
-        gmx_mm_update_1pot_pd(vgbsum,kernel_data->energygrp_polarization+ggid);
-        /*         #define OUTERFLOPS OUTERFLOPS+1 */
-        /*     #endif */
         /*     #if KERNEL_VDW != 'None' */
         gmx_mm_update_1pot_pd(vvdwsum,kernel_data->energygrp_vdw+ggid);
         /*         #define OUTERFLOPS OUTERFLOPS+1 */
         /*     #endif */
         /* #endif */
-        /*     #if 'GeneralizedBorn' in KERNEL_ELEC and 'Force' in KERNEL_VF */
-        dvdasum = _mm_mul_pd(dvdasum, _mm_mul_pd(isai{I},isai{I}));
-        gmx_mm_update_1pot_pd(dvdasum,dvda+inr);
-        /*     #endif */
 
         /* Increment number of inner iterations */
         inneriter                  += j_index_end - j_index_start;
index 404fea6554b9c7a318c589590a70276edd59a426..d9cebccf130d3054566f6f58dfa939b91fc627c1 100755 (executable)
@@ -105,7 +105,6 @@ ElectrostaticsList = {
     'None'                    : [],
     'Coulomb'                 : ['rinv','rinvsq'],
     'ReactionField'           : ['rinv','rinvsq'],
-    'GeneralizedBorn'         : ['rinv','r'],
     'CubicSplineTable'        : ['rinv','r','table'],
     'Ewald'                   : ['rinv','rinvsq','r'],
 }
@@ -190,7 +189,6 @@ Abbreviation = {
     'Coulomb'                 : 'Coul',
     'Ewald'                   : 'Ew',
     'ReactionField'           : 'RF',
-    'GeneralizedBorn'         : 'GB',
     'CubicSplineTable'        : 'CSTab',
     'LennardJones'            : 'LJ',
     'Buckingham'              : 'Bham',
@@ -269,7 +267,7 @@ def KeepKernel(KernelElec,KernelElecMod,KernelVdw,KernelVdwMod,KernelGeom,Kernel
         return 0
 
     # No need for LJ-only water optimization, or water optimization with implicit solvent.
-    if('Water' in KernelGeom[0] and (KernelElec=='None' or 'GeneralizedBorn' in KernelElec)):
+    if('Water' in KernelGeom[0] and KernelElec=='None'):
         return 0
 
     # Non-matching table settings are pointless
diff --git a/src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecGB_VdwCSTab_GeomP1P1_sse2_single.c b/src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecGB_VdwCSTab_GeomP1P1_sse2_single.c
deleted file mode 100644 (file)
index 2dd1b08..0000000
+++ /dev/null
@@ -1,958 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
- * and including many others, as listed in the AUTHORS file in the
- * top-level source directory and at http://www.gromacs.org.
- *
- * GROMACS is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * GROMACS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GROMACS; if not, see
- * http://www.gnu.org/licenses, or write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
- *
- * If you want to redistribute modifications to GROMACS, please
- * consider that scientific software is very special. Version
- * control is crucial - bugs must be traceable. We will be happy to
- * consider code for inclusion in the official distribution, but
- * derived work must not be called official GROMACS. Details are found
- * in the README & COPYING files - if they are missing, get the
- * official version at http://www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the research papers on the package. Check out http://www.gromacs.org.
- */
-/*
- * Note: this file was generated by the GROMACS sse2_single kernel generator.
- */
-#include "gmxpre.h"
-
-#include "config.h"
-
-#include <math.h>
-
-#include "../nb_kernel.h"
-#include "gromacs/gmxlib/nrnb.h"
-
-#include "kernelutil_x86_sse2_single.h"
-
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_sse2_single
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            CubicSplineTable
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        PotentialAndForce
- */
-void
-nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_sse2_single
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or 
-     * just 0 for non-waters.
-     * Suffixes A,B,C,D refer to j loop unrolling done with SSE, e.g. for the four different
-     * jnr indices corresponding to data put in the four positions in the SIMD register.
-     */
-    int              i_shift_offset,i_coord_offset,outeriter,inneriter;
-    int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
-    int              jnrA,jnrB,jnrC,jnrD;
-    int              jnrlistA,jnrlistB,jnrlistC,jnrlistD;
-    int              j_coord_offsetA,j_coord_offsetB,j_coord_offsetC,j_coord_offsetD;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             rcutoff_scalar;
-    real             *shiftvec,*fshift,*x,*f;
-    real             *fjptrA,*fjptrB,*fjptrC,*fjptrD;
-    real             scratch[4*DIM];
-    __m128           tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
-    int              vdwioffset0;
-    __m128           ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0A,vdwjidx0B,vdwjidx0C,vdwjidx0D;
-    __m128           jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    __m128           dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
-    __m128           velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    __m128i          gbitab;
-    __m128           vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,gbeps,dvdatmp;
-    __m128           minushalf = _mm_set1_ps(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    int              nvdwtype;
-    __m128           rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
-    int              *vdwtype;
-    real             *vdwparam;
-    __m128           one_sixth   = _mm_set1_ps(1.0/6.0);
-    __m128           one_twelfth = _mm_set1_ps(1.0/12.0);
-    __m128i          vfitab;
-    __m128i          ifour       = _mm_set1_epi32(4);
-    __m128           rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF;
-    real             *vftab;
-    __m128           dummy_mask,cutoff_mask;
-    __m128           signbit = _mm_castsi128_ps( _mm_set1_epi32(0x80000000) );
-    __m128           one     = _mm_set1_ps(1.0);
-    __m128           two     = _mm_set1_ps(2.0);
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = _mm_set1_ps(fr->ic->epsfac);
-    charge           = mdatoms->chargeA;
-    nvdwtype         = fr->ntype;
-    vdwparam         = fr->nbfp;
-    vdwtype          = mdatoms->typeA;
-
-    vftab            = kernel_data->table_vdw->data;
-    vftabscale       = _mm_set1_ps(kernel_data->table_vdw->scale);
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = _mm_set1_ps(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = _mm_set1_ps((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-
-    /* Avoid stupid compiler warnings */
-    jnrA = jnrB = jnrC = jnrD = 0;
-    j_coord_offsetA = 0;
-    j_coord_offsetB = 0;
-    j_coord_offsetC = 0;
-    j_coord_offsetD = 0;
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    for(iidx=0;iidx<4*DIM;iidx++)
-    {
-        scratch[iidx] = 0.0;
-    }  
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        gmx_mm_load_shift_and_1rvec_broadcast_ps(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
-        
-        fix0             = _mm_setzero_ps();
-        fiy0             = _mm_setzero_ps();
-        fiz0             = _mm_setzero_ps();
-
-        /* Load parameters for i particles */
-        iq0              = _mm_mul_ps(facel,_mm_load1_ps(charge+inr+0));
-        isai0            = _mm_load1_ps(invsqrta+inr+0);
-        vdwioffset0      = 2*nvdwtype*vdwtype[inr+0];
-
-        /* Reset potential sums */
-        velecsum         = _mm_setzero_ps();
-        vgbsum           = _mm_setzero_ps();
-        vvdwsum          = _mm_setzero_ps();
-        dvdasum          = _mm_setzero_ps();
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end && jjnr[jidx+3]>=0; jidx+=4)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrA             = jjnr[jidx];
-            jnrB             = jjnr[jidx+1];
-            jnrC             = jjnr[jidx+2];
-            jnrD             = jjnr[jidx+3];
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              x+j_coord_offsetC,x+j_coord_offsetD,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_ps(ix0,jx0);
-            dy00             = _mm_sub_ps(iy0,jy0);
-            dz00             = _mm_sub_ps(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
-
-            rinv00           = sse2_invsqrt_f(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm_load_4real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
-                                                              charge+jnrC+0,charge+jnrD+0);
-            isaj0            = gmx_mm_load_4real_swizzle_ps(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                              invsqrta+jnrC+0,invsqrta+jnrD+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-            vdwjidx0B        = 2*vdwtype[jnrB+0];
-            vdwjidx0C        = 2*vdwtype[jnrC+0];
-            vdwjidx0D        = 2*vdwtype[jnrD+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_ps(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_ps(iq0,jq0);
-            gmx_mm_load_4pair_swizzle_ps(vdwparam+vdwioffset0+vdwjidx0A,
-                                         vdwparam+vdwioffset0+vdwjidx0B,
-                                         vdwparam+vdwioffset0+vdwjidx0C,
-                                         vdwparam+vdwioffset0+vdwjidx0D,
-                                         &c6_00,&c12_00);
-
-            /* Calculate table index by multiplying r with table scale and truncate to integer */
-            rt               = _mm_mul_ps(r00,vftabscale);
-            vfitab           = _mm_cvttps_epi32(rt);
-            vfeps            = _mm_sub_ps(rt,_mm_cvtepi32_ps(vfitab));
-            vfitab           = _mm_slli_epi32(vfitab,3);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_ps(isai0,isaj0);
-            gbqqfactor       = _mm_xor_ps(signbit,_mm_mul_ps(qq00,_mm_mul_ps(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_ps(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_ps(r00,gbscale);
-            gbitab           = _mm_cvttps_epi32(rt);
-            gbeps            = _mm_sub_ps(rt,_mm_cvtepi32_ps(gbitab));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,0) );
-            F                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,1) );
-            G                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,2) );
-            H                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm_mul_ps(gbeps,H);
-            Fp               = _mm_add_ps(F,_mm_mul_ps(gbeps,_mm_add_ps(G,Heps)));
-            VV               = _mm_add_ps(Y,_mm_mul_ps(gbeps,Fp));
-            vgb              = _mm_mul_ps(gbqqfactor,VV);
-
-            FF               = _mm_add_ps(Fp,_mm_mul_ps(gbeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
-            fgb              = _mm_mul_ps(gbqqfactor,_mm_mul_ps(FF,gbscale));
-            dvdatmp          = _mm_mul_ps(minushalf,_mm_add_ps(vgb,_mm_mul_ps(fgb,r00)));
-            dvdasum          = _mm_add_ps(dvdasum,dvdatmp);
-            fjptrA           = dvda+jnrA;
-            fjptrB           = dvda+jnrB;
-            fjptrC           = dvda+jnrC;
-            fjptrD           = dvda+jnrD;
-            gmx_mm_increment_4real_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,_mm_mul_ps(dvdatmp,_mm_mul_ps(isaj0,isaj0)));
-            velec            = _mm_mul_ps(qq00,rinv00);
-            felec            = _mm_mul_ps(_mm_sub_ps(_mm_mul_ps(velec,rinv00),fgb),rinv00);
-
-            /* CUBIC SPLINE TABLE DISPERSION */
-            Y                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0) );
-            F                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1) );
-            G                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2) );
-            H                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm_mul_ps(vfeps,H);
-            Fp               = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
-            VV               = _mm_add_ps(Y,_mm_mul_ps(vfeps,Fp));
-            vvdw6            = _mm_mul_ps(c6_00,VV);
-            FF               = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
-            fvdw6            = _mm_mul_ps(c6_00,FF);
-
-            /* CUBIC SPLINE TABLE REPULSION */
-            vfitab           = _mm_add_epi32(vfitab,ifour);
-            Y                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0) );
-            F                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1) );
-            G                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2) );
-            H                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm_mul_ps(vfeps,H);
-            Fp               = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
-            VV               = _mm_add_ps(Y,_mm_mul_ps(vfeps,Fp));
-            vvdw12           = _mm_mul_ps(c12_00,VV);
-            FF               = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
-            fvdw12           = _mm_mul_ps(c12_00,FF);
-            vvdw             = _mm_add_ps(vvdw12,vvdw6);
-            fvdw             = _mm_xor_ps(signbit,_mm_mul_ps(_mm_add_ps(fvdw6,fvdw12),_mm_mul_ps(vftabscale,rinv00)));
-
-            /* Update potential sum for this i atom from the interaction with this j atom. */
-            velecsum         = _mm_add_ps(velecsum,velec);
-            vgbsum           = _mm_add_ps(vgbsum,vgb);
-            vvdwsum          = _mm_add_ps(vvdwsum,vvdw);
-
-            fscal            = _mm_add_ps(felec,fvdw);
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm_mul_ps(fscal,dx00);
-            ty               = _mm_mul_ps(fscal,dy00);
-            tz               = _mm_mul_ps(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm_add_ps(fix0,tx);
-            fiy0             = _mm_add_ps(fiy0,ty);
-            fiz0             = _mm_add_ps(fiz0,tz);
-
-            fjptrA             = f+j_coord_offsetA;
-            fjptrB             = f+j_coord_offsetB;
-            fjptrC             = f+j_coord_offsetC;
-            fjptrD             = f+j_coord_offsetD;
-            gmx_mm_decrement_1rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,tx,ty,tz);
-            
-            /* Inner loop uses 92 flops */
-        }
-
-        if(jidx<j_index_end)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrlistA         = jjnr[jidx];
-            jnrlistB         = jjnr[jidx+1];
-            jnrlistC         = jjnr[jidx+2];
-            jnrlistD         = jjnr[jidx+3];
-            /* Sign of each element will be negative for non-real atoms.
-             * This mask will be 0xFFFFFFFF for dummy entries and 0x0 for real ones,
-             * so use it as val = _mm_andnot_ps(mask,val) to clear dummy entries.
-             */
-            dummy_mask = gmx_mm_castsi128_ps(_mm_cmplt_epi32(_mm_loadu_si128((const __m128i *)(jjnr+jidx)),_mm_setzero_si128()));
-            jnrA       = (jnrlistA>=0) ? jnrlistA : 0;
-            jnrB       = (jnrlistB>=0) ? jnrlistB : 0;
-            jnrC       = (jnrlistC>=0) ? jnrlistC : 0;
-            jnrD       = (jnrlistD>=0) ? jnrlistD : 0;
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              x+j_coord_offsetC,x+j_coord_offsetD,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_ps(ix0,jx0);
-            dy00             = _mm_sub_ps(iy0,jy0);
-            dz00             = _mm_sub_ps(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
-
-            rinv00           = sse2_invsqrt_f(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm_load_4real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
-                                                              charge+jnrC+0,charge+jnrD+0);
-            isaj0            = gmx_mm_load_4real_swizzle_ps(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                              invsqrta+jnrC+0,invsqrta+jnrD+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-            vdwjidx0B        = 2*vdwtype[jnrB+0];
-            vdwjidx0C        = 2*vdwtype[jnrC+0];
-            vdwjidx0D        = 2*vdwtype[jnrD+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_ps(rsq00,rinv00);
-            r00              = _mm_andnot_ps(dummy_mask,r00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_ps(iq0,jq0);
-            gmx_mm_load_4pair_swizzle_ps(vdwparam+vdwioffset0+vdwjidx0A,
-                                         vdwparam+vdwioffset0+vdwjidx0B,
-                                         vdwparam+vdwioffset0+vdwjidx0C,
-                                         vdwparam+vdwioffset0+vdwjidx0D,
-                                         &c6_00,&c12_00);
-
-            /* Calculate table index by multiplying r with table scale and truncate to integer */
-            rt               = _mm_mul_ps(r00,vftabscale);
-            vfitab           = _mm_cvttps_epi32(rt);
-            vfeps            = _mm_sub_ps(rt,_mm_cvtepi32_ps(vfitab));
-            vfitab           = _mm_slli_epi32(vfitab,3);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_ps(isai0,isaj0);
-            gbqqfactor       = _mm_xor_ps(signbit,_mm_mul_ps(qq00,_mm_mul_ps(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_ps(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_ps(r00,gbscale);
-            gbitab           = _mm_cvttps_epi32(rt);
-            gbeps            = _mm_sub_ps(rt,_mm_cvtepi32_ps(gbitab));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,0) );
-            F                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,1) );
-            G                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,2) );
-            H                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm_mul_ps(gbeps,H);
-            Fp               = _mm_add_ps(F,_mm_mul_ps(gbeps,_mm_add_ps(G,Heps)));
-            VV               = _mm_add_ps(Y,_mm_mul_ps(gbeps,Fp));
-            vgb              = _mm_mul_ps(gbqqfactor,VV);
-
-            FF               = _mm_add_ps(Fp,_mm_mul_ps(gbeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
-            fgb              = _mm_mul_ps(gbqqfactor,_mm_mul_ps(FF,gbscale));
-            dvdatmp          = _mm_mul_ps(minushalf,_mm_add_ps(vgb,_mm_mul_ps(fgb,r00)));
-            dvdatmp          = _mm_andnot_ps(dummy_mask,dvdatmp);
-            dvdasum          = _mm_add_ps(dvdasum,dvdatmp);
-            /* The pointers to scratch make sure that this code with compilers that take gmx_restrict seriously (e.g. icc 13) really can't screw things up. */
-            fjptrA             = (jnrlistA>=0) ? dvda+jnrA : scratch;
-            fjptrB             = (jnrlistB>=0) ? dvda+jnrB : scratch;
-            fjptrC             = (jnrlistC>=0) ? dvda+jnrC : scratch;
-            fjptrD             = (jnrlistD>=0) ? dvda+jnrD : scratch;
-            gmx_mm_increment_4real_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,_mm_mul_ps(dvdatmp,_mm_mul_ps(isaj0,isaj0)));
-            velec            = _mm_mul_ps(qq00,rinv00);
-            felec            = _mm_mul_ps(_mm_sub_ps(_mm_mul_ps(velec,rinv00),fgb),rinv00);
-
-            /* CUBIC SPLINE TABLE DISPERSION */
-            Y                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0) );
-            F                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1) );
-            G                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2) );
-            H                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm_mul_ps(vfeps,H);
-            Fp               = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
-            VV               = _mm_add_ps(Y,_mm_mul_ps(vfeps,Fp));
-            vvdw6            = _mm_mul_ps(c6_00,VV);
-            FF               = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
-            fvdw6            = _mm_mul_ps(c6_00,FF);
-
-            /* CUBIC SPLINE TABLE REPULSION */
-            vfitab           = _mm_add_epi32(vfitab,ifour);
-            Y                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0) );
-            F                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1) );
-            G                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2) );
-            H                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm_mul_ps(vfeps,H);
-            Fp               = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
-            VV               = _mm_add_ps(Y,_mm_mul_ps(vfeps,Fp));
-            vvdw12           = _mm_mul_ps(c12_00,VV);
-            FF               = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
-            fvdw12           = _mm_mul_ps(c12_00,FF);
-            vvdw             = _mm_add_ps(vvdw12,vvdw6);
-            fvdw             = _mm_xor_ps(signbit,_mm_mul_ps(_mm_add_ps(fvdw6,fvdw12),_mm_mul_ps(vftabscale,rinv00)));
-
-            /* Update potential sum for this i atom from the interaction with this j atom. */
-            velec            = _mm_andnot_ps(dummy_mask,velec);
-            velecsum         = _mm_add_ps(velecsum,velec);
-            vgb              = _mm_andnot_ps(dummy_mask,vgb);
-            vgbsum           = _mm_add_ps(vgbsum,vgb);
-            vvdw             = _mm_andnot_ps(dummy_mask,vvdw);
-            vvdwsum          = _mm_add_ps(vvdwsum,vvdw);
-
-            fscal            = _mm_add_ps(felec,fvdw);
-
-            fscal            = _mm_andnot_ps(dummy_mask,fscal);
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm_mul_ps(fscal,dx00);
-            ty               = _mm_mul_ps(fscal,dy00);
-            tz               = _mm_mul_ps(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm_add_ps(fix0,tx);
-            fiy0             = _mm_add_ps(fiy0,ty);
-            fiz0             = _mm_add_ps(fiz0,tz);
-
-            fjptrA             = (jnrlistA>=0) ? f+j_coord_offsetA : scratch;
-            fjptrB             = (jnrlistB>=0) ? f+j_coord_offsetB : scratch;
-            fjptrC             = (jnrlistC>=0) ? f+j_coord_offsetC : scratch;
-            fjptrD             = (jnrlistD>=0) ? f+j_coord_offsetD : scratch;
-            gmx_mm_decrement_1rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,tx,ty,tz);
-            
-            /* Inner loop uses 93 flops */
-        }
-
-        /* End of innermost loop */
-
-        gmx_mm_update_iforce_1atom_swizzle_ps(fix0,fiy0,fiz0,
-                                              f+i_coord_offset,fshift+i_shift_offset);
-
-        ggid                        = gid[iidx];
-        /* Update potential energies */
-        gmx_mm_update_1pot_ps(velecsum,kernel_data->energygrp_elec+ggid);
-        gmx_mm_update_1pot_ps(vgbsum,kernel_data->energygrp_polarization+ggid);
-        gmx_mm_update_1pot_ps(vvdwsum,kernel_data->energygrp_vdw+ggid);
-        dvdasum = _mm_mul_ps(dvdasum, _mm_mul_ps(isai0,isai0));
-        gmx_mm_update_1pot_ps(dvdasum,dvda+inr);
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 10 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_VF,outeriter*10 + inneriter*93);
-}
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_sse2_single
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            CubicSplineTable
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        Force
- */
-void
-nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_sse2_single
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or 
-     * just 0 for non-waters.
-     * Suffixes A,B,C,D refer to j loop unrolling done with SSE, e.g. for the four different
-     * jnr indices corresponding to data put in the four positions in the SIMD register.
-     */
-    int              i_shift_offset,i_coord_offset,outeriter,inneriter;
-    int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
-    int              jnrA,jnrB,jnrC,jnrD;
-    int              jnrlistA,jnrlistB,jnrlistC,jnrlistD;
-    int              j_coord_offsetA,j_coord_offsetB,j_coord_offsetC,j_coord_offsetD;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             rcutoff_scalar;
-    real             *shiftvec,*fshift,*x,*f;
-    real             *fjptrA,*fjptrB,*fjptrC,*fjptrD;
-    real             scratch[4*DIM];
-    __m128           tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
-    int              vdwioffset0;
-    __m128           ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0A,vdwjidx0B,vdwjidx0C,vdwjidx0D;
-    __m128           jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    __m128           dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
-    __m128           velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    __m128i          gbitab;
-    __m128           vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,gbeps,dvdatmp;
-    __m128           minushalf = _mm_set1_ps(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    int              nvdwtype;
-    __m128           rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
-    int              *vdwtype;
-    real             *vdwparam;
-    __m128           one_sixth   = _mm_set1_ps(1.0/6.0);
-    __m128           one_twelfth = _mm_set1_ps(1.0/12.0);
-    __m128i          vfitab;
-    __m128i          ifour       = _mm_set1_epi32(4);
-    __m128           rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF;
-    real             *vftab;
-    __m128           dummy_mask,cutoff_mask;
-    __m128           signbit = _mm_castsi128_ps( _mm_set1_epi32(0x80000000) );
-    __m128           one     = _mm_set1_ps(1.0);
-    __m128           two     = _mm_set1_ps(2.0);
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = _mm_set1_ps(fr->ic->epsfac);
-    charge           = mdatoms->chargeA;
-    nvdwtype         = fr->ntype;
-    vdwparam         = fr->nbfp;
-    vdwtype          = mdatoms->typeA;
-
-    vftab            = kernel_data->table_vdw->data;
-    vftabscale       = _mm_set1_ps(kernel_data->table_vdw->scale);
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = _mm_set1_ps(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = _mm_set1_ps((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-
-    /* Avoid stupid compiler warnings */
-    jnrA = jnrB = jnrC = jnrD = 0;
-    j_coord_offsetA = 0;
-    j_coord_offsetB = 0;
-    j_coord_offsetC = 0;
-    j_coord_offsetD = 0;
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    for(iidx=0;iidx<4*DIM;iidx++)
-    {
-        scratch[iidx] = 0.0;
-    }  
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        gmx_mm_load_shift_and_1rvec_broadcast_ps(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
-        
-        fix0             = _mm_setzero_ps();
-        fiy0             = _mm_setzero_ps();
-        fiz0             = _mm_setzero_ps();
-
-        /* Load parameters for i particles */
-        iq0              = _mm_mul_ps(facel,_mm_load1_ps(charge+inr+0));
-        isai0            = _mm_load1_ps(invsqrta+inr+0);
-        vdwioffset0      = 2*nvdwtype*vdwtype[inr+0];
-
-        dvdasum          = _mm_setzero_ps();
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end && jjnr[jidx+3]>=0; jidx+=4)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrA             = jjnr[jidx];
-            jnrB             = jjnr[jidx+1];
-            jnrC             = jjnr[jidx+2];
-            jnrD             = jjnr[jidx+3];
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              x+j_coord_offsetC,x+j_coord_offsetD,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_ps(ix0,jx0);
-            dy00             = _mm_sub_ps(iy0,jy0);
-            dz00             = _mm_sub_ps(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
-
-            rinv00           = sse2_invsqrt_f(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm_load_4real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
-                                                              charge+jnrC+0,charge+jnrD+0);
-            isaj0            = gmx_mm_load_4real_swizzle_ps(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                              invsqrta+jnrC+0,invsqrta+jnrD+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-            vdwjidx0B        = 2*vdwtype[jnrB+0];
-            vdwjidx0C        = 2*vdwtype[jnrC+0];
-            vdwjidx0D        = 2*vdwtype[jnrD+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_ps(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_ps(iq0,jq0);
-            gmx_mm_load_4pair_swizzle_ps(vdwparam+vdwioffset0+vdwjidx0A,
-                                         vdwparam+vdwioffset0+vdwjidx0B,
-                                         vdwparam+vdwioffset0+vdwjidx0C,
-                                         vdwparam+vdwioffset0+vdwjidx0D,
-                                         &c6_00,&c12_00);
-
-            /* Calculate table index by multiplying r with table scale and truncate to integer */
-            rt               = _mm_mul_ps(r00,vftabscale);
-            vfitab           = _mm_cvttps_epi32(rt);
-            vfeps            = _mm_sub_ps(rt,_mm_cvtepi32_ps(vfitab));
-            vfitab           = _mm_slli_epi32(vfitab,3);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_ps(isai0,isaj0);
-            gbqqfactor       = _mm_xor_ps(signbit,_mm_mul_ps(qq00,_mm_mul_ps(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_ps(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_ps(r00,gbscale);
-            gbitab           = _mm_cvttps_epi32(rt);
-            gbeps            = _mm_sub_ps(rt,_mm_cvtepi32_ps(gbitab));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,0) );
-            F                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,1) );
-            G                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,2) );
-            H                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm_mul_ps(gbeps,H);
-            Fp               = _mm_add_ps(F,_mm_mul_ps(gbeps,_mm_add_ps(G,Heps)));
-            VV               = _mm_add_ps(Y,_mm_mul_ps(gbeps,Fp));
-            vgb              = _mm_mul_ps(gbqqfactor,VV);
-
-            FF               = _mm_add_ps(Fp,_mm_mul_ps(gbeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
-            fgb              = _mm_mul_ps(gbqqfactor,_mm_mul_ps(FF,gbscale));
-            dvdatmp          = _mm_mul_ps(minushalf,_mm_add_ps(vgb,_mm_mul_ps(fgb,r00)));
-            dvdasum          = _mm_add_ps(dvdasum,dvdatmp);
-            fjptrA           = dvda+jnrA;
-            fjptrB           = dvda+jnrB;
-            fjptrC           = dvda+jnrC;
-            fjptrD           = dvda+jnrD;
-            gmx_mm_increment_4real_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,_mm_mul_ps(dvdatmp,_mm_mul_ps(isaj0,isaj0)));
-            velec            = _mm_mul_ps(qq00,rinv00);
-            felec            = _mm_mul_ps(_mm_sub_ps(_mm_mul_ps(velec,rinv00),fgb),rinv00);
-
-            /* CUBIC SPLINE TABLE DISPERSION */
-            Y                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0) );
-            F                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1) );
-            G                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2) );
-            H                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm_mul_ps(vfeps,H);
-            Fp               = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
-            FF               = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
-            fvdw6            = _mm_mul_ps(c6_00,FF);
-
-            /* CUBIC SPLINE TABLE REPULSION */
-            vfitab           = _mm_add_epi32(vfitab,ifour);
-            Y                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0) );
-            F                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1) );
-            G                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2) );
-            H                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm_mul_ps(vfeps,H);
-            Fp               = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
-            FF               = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
-            fvdw12           = _mm_mul_ps(c12_00,FF);
-            fvdw             = _mm_xor_ps(signbit,_mm_mul_ps(_mm_add_ps(fvdw6,fvdw12),_mm_mul_ps(vftabscale,rinv00)));
-
-            fscal            = _mm_add_ps(felec,fvdw);
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm_mul_ps(fscal,dx00);
-            ty               = _mm_mul_ps(fscal,dy00);
-            tz               = _mm_mul_ps(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm_add_ps(fix0,tx);
-            fiy0             = _mm_add_ps(fiy0,ty);
-            fiz0             = _mm_add_ps(fiz0,tz);
-
-            fjptrA             = f+j_coord_offsetA;
-            fjptrB             = f+j_coord_offsetB;
-            fjptrC             = f+j_coord_offsetC;
-            fjptrD             = f+j_coord_offsetD;
-            gmx_mm_decrement_1rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,tx,ty,tz);
-            
-            /* Inner loop uses 82 flops */
-        }
-
-        if(jidx<j_index_end)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrlistA         = jjnr[jidx];
-            jnrlistB         = jjnr[jidx+1];
-            jnrlistC         = jjnr[jidx+2];
-            jnrlistD         = jjnr[jidx+3];
-            /* Sign of each element will be negative for non-real atoms.
-             * This mask will be 0xFFFFFFFF for dummy entries and 0x0 for real ones,
-             * so use it as val = _mm_andnot_ps(mask,val) to clear dummy entries.
-             */
-            dummy_mask = gmx_mm_castsi128_ps(_mm_cmplt_epi32(_mm_loadu_si128((const __m128i *)(jjnr+jidx)),_mm_setzero_si128()));
-            jnrA       = (jnrlistA>=0) ? jnrlistA : 0;
-            jnrB       = (jnrlistB>=0) ? jnrlistB : 0;
-            jnrC       = (jnrlistC>=0) ? jnrlistC : 0;
-            jnrD       = (jnrlistD>=0) ? jnrlistD : 0;
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              x+j_coord_offsetC,x+j_coord_offsetD,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_ps(ix0,jx0);
-            dy00             = _mm_sub_ps(iy0,jy0);
-            dz00             = _mm_sub_ps(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
-
-            rinv00           = sse2_invsqrt_f(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm_load_4real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
-                                                              charge+jnrC+0,charge+jnrD+0);
-            isaj0            = gmx_mm_load_4real_swizzle_ps(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                              invsqrta+jnrC+0,invsqrta+jnrD+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-            vdwjidx0B        = 2*vdwtype[jnrB+0];
-            vdwjidx0C        = 2*vdwtype[jnrC+0];
-            vdwjidx0D        = 2*vdwtype[jnrD+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_ps(rsq00,rinv00);
-            r00              = _mm_andnot_ps(dummy_mask,r00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_ps(iq0,jq0);
-            gmx_mm_load_4pair_swizzle_ps(vdwparam+vdwioffset0+vdwjidx0A,
-                                         vdwparam+vdwioffset0+vdwjidx0B,
-                                         vdwparam+vdwioffset0+vdwjidx0C,
-                                         vdwparam+vdwioffset0+vdwjidx0D,
-                                         &c6_00,&c12_00);
-
-            /* Calculate table index by multiplying r with table scale and truncate to integer */
-            rt               = _mm_mul_ps(r00,vftabscale);
-            vfitab           = _mm_cvttps_epi32(rt);
-            vfeps            = _mm_sub_ps(rt,_mm_cvtepi32_ps(vfitab));
-            vfitab           = _mm_slli_epi32(vfitab,3);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_ps(isai0,isaj0);
-            gbqqfactor       = _mm_xor_ps(signbit,_mm_mul_ps(qq00,_mm_mul_ps(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_ps(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_ps(r00,gbscale);
-            gbitab           = _mm_cvttps_epi32(rt);
-            gbeps            = _mm_sub_ps(rt,_mm_cvtepi32_ps(gbitab));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,0) );
-            F                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,1) );
-            G                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,2) );
-            H                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm_mul_ps(gbeps,H);
-            Fp               = _mm_add_ps(F,_mm_mul_ps(gbeps,_mm_add_ps(G,Heps)));
-            VV               = _mm_add_ps(Y,_mm_mul_ps(gbeps,Fp));
-            vgb              = _mm_mul_ps(gbqqfactor,VV);
-
-            FF               = _mm_add_ps(Fp,_mm_mul_ps(gbeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
-            fgb              = _mm_mul_ps(gbqqfactor,_mm_mul_ps(FF,gbscale));
-            dvdatmp          = _mm_mul_ps(minushalf,_mm_add_ps(vgb,_mm_mul_ps(fgb,r00)));
-            dvdatmp          = _mm_andnot_ps(dummy_mask,dvdatmp);
-            dvdasum          = _mm_add_ps(dvdasum,dvdatmp);
-            /* The pointers to scratch make sure that this code with compilers that take gmx_restrict seriously (e.g. icc 13) really can't screw things up. */
-            fjptrA             = (jnrlistA>=0) ? dvda+jnrA : scratch;
-            fjptrB             = (jnrlistB>=0) ? dvda+jnrB : scratch;
-            fjptrC             = (jnrlistC>=0) ? dvda+jnrC : scratch;
-            fjptrD             = (jnrlistD>=0) ? dvda+jnrD : scratch;
-            gmx_mm_increment_4real_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,_mm_mul_ps(dvdatmp,_mm_mul_ps(isaj0,isaj0)));
-            velec            = _mm_mul_ps(qq00,rinv00);
-            felec            = _mm_mul_ps(_mm_sub_ps(_mm_mul_ps(velec,rinv00),fgb),rinv00);
-
-            /* CUBIC SPLINE TABLE DISPERSION */
-            Y                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0) );
-            F                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1) );
-            G                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2) );
-            H                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm_mul_ps(vfeps,H);
-            Fp               = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
-            FF               = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
-            fvdw6            = _mm_mul_ps(c6_00,FF);
-
-            /* CUBIC SPLINE TABLE REPULSION */
-            vfitab           = _mm_add_epi32(vfitab,ifour);
-            Y                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0) );
-            F                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1) );
-            G                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2) );
-            H                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm_mul_ps(vfeps,H);
-            Fp               = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
-            FF               = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
-            fvdw12           = _mm_mul_ps(c12_00,FF);
-            fvdw             = _mm_xor_ps(signbit,_mm_mul_ps(_mm_add_ps(fvdw6,fvdw12),_mm_mul_ps(vftabscale,rinv00)));
-
-            fscal            = _mm_add_ps(felec,fvdw);
-
-            fscal            = _mm_andnot_ps(dummy_mask,fscal);
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm_mul_ps(fscal,dx00);
-            ty               = _mm_mul_ps(fscal,dy00);
-            tz               = _mm_mul_ps(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm_add_ps(fix0,tx);
-            fiy0             = _mm_add_ps(fiy0,ty);
-            fiz0             = _mm_add_ps(fiz0,tz);
-
-            fjptrA             = (jnrlistA>=0) ? f+j_coord_offsetA : scratch;
-            fjptrB             = (jnrlistB>=0) ? f+j_coord_offsetB : scratch;
-            fjptrC             = (jnrlistC>=0) ? f+j_coord_offsetC : scratch;
-            fjptrD             = (jnrlistD>=0) ? f+j_coord_offsetD : scratch;
-            gmx_mm_decrement_1rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,tx,ty,tz);
-            
-            /* Inner loop uses 83 flops */
-        }
-
-        /* End of innermost loop */
-
-        gmx_mm_update_iforce_1atom_swizzle_ps(fix0,fiy0,fiz0,
-                                              f+i_coord_offset,fshift+i_shift_offset);
-
-        dvdasum = _mm_mul_ps(dvdasum, _mm_mul_ps(isai0,isai0));
-        gmx_mm_update_1pot_ps(dvdasum,dvda+inr);
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 7 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_F,outeriter*7 + inneriter*83);
-}
diff --git a/src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecGB_VdwLJ_GeomP1P1_sse2_single.c b/src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecGB_VdwLJ_GeomP1P1_sse2_single.c
deleted file mode 100644 (file)
index 137dd21..0000000
+++ /dev/null
@@ -1,856 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
- * and including many others, as listed in the AUTHORS file in the
- * top-level source directory and at http://www.gromacs.org.
- *
- * GROMACS is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * GROMACS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GROMACS; if not, see
- * http://www.gnu.org/licenses, or write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
- *
- * If you want to redistribute modifications to GROMACS, please
- * consider that scientific software is very special. Version
- * control is crucial - bugs must be traceable. We will be happy to
- * consider code for inclusion in the official distribution, but
- * derived work must not be called official GROMACS. Details are found
- * in the README & COPYING files - if they are missing, get the
- * official version at http://www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the research papers on the package. Check out http://www.gromacs.org.
- */
-/*
- * Note: this file was generated by the GROMACS sse2_single kernel generator.
- */
-#include "gmxpre.h"
-
-#include "config.h"
-
-#include <math.h>
-
-#include "../nb_kernel.h"
-#include "gromacs/gmxlib/nrnb.h"
-
-#include "kernelutil_x86_sse2_single.h"
-
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_sse2_single
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            LennardJones
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        PotentialAndForce
- */
-void
-nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_sse2_single
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or 
-     * just 0 for non-waters.
-     * Suffixes A,B,C,D refer to j loop unrolling done with SSE, e.g. for the four different
-     * jnr indices corresponding to data put in the four positions in the SIMD register.
-     */
-    int              i_shift_offset,i_coord_offset,outeriter,inneriter;
-    int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
-    int              jnrA,jnrB,jnrC,jnrD;
-    int              jnrlistA,jnrlistB,jnrlistC,jnrlistD;
-    int              j_coord_offsetA,j_coord_offsetB,j_coord_offsetC,j_coord_offsetD;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             rcutoff_scalar;
-    real             *shiftvec,*fshift,*x,*f;
-    real             *fjptrA,*fjptrB,*fjptrC,*fjptrD;
-    real             scratch[4*DIM];
-    __m128           tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
-    int              vdwioffset0;
-    __m128           ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0A,vdwjidx0B,vdwjidx0C,vdwjidx0D;
-    __m128           jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    __m128           dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
-    __m128           velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    __m128i          gbitab;
-    __m128           vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,gbeps,dvdatmp;
-    __m128           minushalf = _mm_set1_ps(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    int              nvdwtype;
-    __m128           rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
-    int              *vdwtype;
-    real             *vdwparam;
-    __m128           one_sixth   = _mm_set1_ps(1.0/6.0);
-    __m128           one_twelfth = _mm_set1_ps(1.0/12.0);
-    __m128i          vfitab;
-    __m128i          ifour       = _mm_set1_epi32(4);
-    __m128           rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF;
-    real             *vftab;
-    __m128           dummy_mask,cutoff_mask;
-    __m128           signbit = _mm_castsi128_ps( _mm_set1_epi32(0x80000000) );
-    __m128           one     = _mm_set1_ps(1.0);
-    __m128           two     = _mm_set1_ps(2.0);
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = _mm_set1_ps(fr->ic->epsfac);
-    charge           = mdatoms->chargeA;
-    nvdwtype         = fr->ntype;
-    vdwparam         = fr->nbfp;
-    vdwtype          = mdatoms->typeA;
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = _mm_set1_ps(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = _mm_set1_ps((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-
-    /* Avoid stupid compiler warnings */
-    jnrA = jnrB = jnrC = jnrD = 0;
-    j_coord_offsetA = 0;
-    j_coord_offsetB = 0;
-    j_coord_offsetC = 0;
-    j_coord_offsetD = 0;
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    for(iidx=0;iidx<4*DIM;iidx++)
-    {
-        scratch[iidx] = 0.0;
-    }  
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        gmx_mm_load_shift_and_1rvec_broadcast_ps(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
-        
-        fix0             = _mm_setzero_ps();
-        fiy0             = _mm_setzero_ps();
-        fiz0             = _mm_setzero_ps();
-
-        /* Load parameters for i particles */
-        iq0              = _mm_mul_ps(facel,_mm_load1_ps(charge+inr+0));
-        isai0            = _mm_load1_ps(invsqrta+inr+0);
-        vdwioffset0      = 2*nvdwtype*vdwtype[inr+0];
-
-        /* Reset potential sums */
-        velecsum         = _mm_setzero_ps();
-        vgbsum           = _mm_setzero_ps();
-        vvdwsum          = _mm_setzero_ps();
-        dvdasum          = _mm_setzero_ps();
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end && jjnr[jidx+3]>=0; jidx+=4)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrA             = jjnr[jidx];
-            jnrB             = jjnr[jidx+1];
-            jnrC             = jjnr[jidx+2];
-            jnrD             = jjnr[jidx+3];
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              x+j_coord_offsetC,x+j_coord_offsetD,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_ps(ix0,jx0);
-            dy00             = _mm_sub_ps(iy0,jy0);
-            dz00             = _mm_sub_ps(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
-
-            rinv00           = sse2_invsqrt_f(rsq00);
-
-            rinvsq00         = _mm_mul_ps(rinv00,rinv00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm_load_4real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
-                                                              charge+jnrC+0,charge+jnrD+0);
-            isaj0            = gmx_mm_load_4real_swizzle_ps(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                              invsqrta+jnrC+0,invsqrta+jnrD+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-            vdwjidx0B        = 2*vdwtype[jnrB+0];
-            vdwjidx0C        = 2*vdwtype[jnrC+0];
-            vdwjidx0D        = 2*vdwtype[jnrD+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_ps(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_ps(iq0,jq0);
-            gmx_mm_load_4pair_swizzle_ps(vdwparam+vdwioffset0+vdwjidx0A,
-                                         vdwparam+vdwioffset0+vdwjidx0B,
-                                         vdwparam+vdwioffset0+vdwjidx0C,
-                                         vdwparam+vdwioffset0+vdwjidx0D,
-                                         &c6_00,&c12_00);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_ps(isai0,isaj0);
-            gbqqfactor       = _mm_xor_ps(signbit,_mm_mul_ps(qq00,_mm_mul_ps(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_ps(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_ps(r00,gbscale);
-            gbitab           = _mm_cvttps_epi32(rt);
-            gbeps            = _mm_sub_ps(rt,_mm_cvtepi32_ps(gbitab));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,0) );
-            F                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,1) );
-            G                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,2) );
-            H                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm_mul_ps(gbeps,H);
-            Fp               = _mm_add_ps(F,_mm_mul_ps(gbeps,_mm_add_ps(G,Heps)));
-            VV               = _mm_add_ps(Y,_mm_mul_ps(gbeps,Fp));
-            vgb              = _mm_mul_ps(gbqqfactor,VV);
-
-            FF               = _mm_add_ps(Fp,_mm_mul_ps(gbeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
-            fgb              = _mm_mul_ps(gbqqfactor,_mm_mul_ps(FF,gbscale));
-            dvdatmp          = _mm_mul_ps(minushalf,_mm_add_ps(vgb,_mm_mul_ps(fgb,r00)));
-            dvdasum          = _mm_add_ps(dvdasum,dvdatmp);
-            fjptrA           = dvda+jnrA;
-            fjptrB           = dvda+jnrB;
-            fjptrC           = dvda+jnrC;
-            fjptrD           = dvda+jnrD;
-            gmx_mm_increment_4real_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,_mm_mul_ps(dvdatmp,_mm_mul_ps(isaj0,isaj0)));
-            velec            = _mm_mul_ps(qq00,rinv00);
-            felec            = _mm_mul_ps(_mm_sub_ps(_mm_mul_ps(velec,rinv00),fgb),rinv00);
-
-            /* LENNARD-JONES DISPERSION/REPULSION */
-
-            rinvsix          = _mm_mul_ps(_mm_mul_ps(rinvsq00,rinvsq00),rinvsq00);
-            vvdw6            = _mm_mul_ps(c6_00,rinvsix);
-            vvdw12           = _mm_mul_ps(c12_00,_mm_mul_ps(rinvsix,rinvsix));
-            vvdw             = _mm_sub_ps( _mm_mul_ps(vvdw12,one_twelfth) , _mm_mul_ps(vvdw6,one_sixth) );
-            fvdw             = _mm_mul_ps(_mm_sub_ps(vvdw12,vvdw6),rinvsq00);
-
-            /* Update potential sum for this i atom from the interaction with this j atom. */
-            velecsum         = _mm_add_ps(velecsum,velec);
-            vgbsum           = _mm_add_ps(vgbsum,vgb);
-            vvdwsum          = _mm_add_ps(vvdwsum,vvdw);
-
-            fscal            = _mm_add_ps(felec,fvdw);
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm_mul_ps(fscal,dx00);
-            ty               = _mm_mul_ps(fscal,dy00);
-            tz               = _mm_mul_ps(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm_add_ps(fix0,tx);
-            fiy0             = _mm_add_ps(fiy0,ty);
-            fiz0             = _mm_add_ps(fiz0,tz);
-
-            fjptrA             = f+j_coord_offsetA;
-            fjptrB             = f+j_coord_offsetB;
-            fjptrC             = f+j_coord_offsetC;
-            fjptrD             = f+j_coord_offsetD;
-            gmx_mm_decrement_1rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,tx,ty,tz);
-            
-            /* Inner loop uses 71 flops */
-        }
-
-        if(jidx<j_index_end)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrlistA         = jjnr[jidx];
-            jnrlistB         = jjnr[jidx+1];
-            jnrlistC         = jjnr[jidx+2];
-            jnrlistD         = jjnr[jidx+3];
-            /* Sign of each element will be negative for non-real atoms.
-             * This mask will be 0xFFFFFFFF for dummy entries and 0x0 for real ones,
-             * so use it as val = _mm_andnot_ps(mask,val) to clear dummy entries.
-             */
-            dummy_mask = gmx_mm_castsi128_ps(_mm_cmplt_epi32(_mm_loadu_si128((const __m128i *)(jjnr+jidx)),_mm_setzero_si128()));
-            jnrA       = (jnrlistA>=0) ? jnrlistA : 0;
-            jnrB       = (jnrlistB>=0) ? jnrlistB : 0;
-            jnrC       = (jnrlistC>=0) ? jnrlistC : 0;
-            jnrD       = (jnrlistD>=0) ? jnrlistD : 0;
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              x+j_coord_offsetC,x+j_coord_offsetD,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_ps(ix0,jx0);
-            dy00             = _mm_sub_ps(iy0,jy0);
-            dz00             = _mm_sub_ps(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
-
-            rinv00           = sse2_invsqrt_f(rsq00);
-
-            rinvsq00         = _mm_mul_ps(rinv00,rinv00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm_load_4real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
-                                                              charge+jnrC+0,charge+jnrD+0);
-            isaj0            = gmx_mm_load_4real_swizzle_ps(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                              invsqrta+jnrC+0,invsqrta+jnrD+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-            vdwjidx0B        = 2*vdwtype[jnrB+0];
-            vdwjidx0C        = 2*vdwtype[jnrC+0];
-            vdwjidx0D        = 2*vdwtype[jnrD+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_ps(rsq00,rinv00);
-            r00              = _mm_andnot_ps(dummy_mask,r00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_ps(iq0,jq0);
-            gmx_mm_load_4pair_swizzle_ps(vdwparam+vdwioffset0+vdwjidx0A,
-                                         vdwparam+vdwioffset0+vdwjidx0B,
-                                         vdwparam+vdwioffset0+vdwjidx0C,
-                                         vdwparam+vdwioffset0+vdwjidx0D,
-                                         &c6_00,&c12_00);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_ps(isai0,isaj0);
-            gbqqfactor       = _mm_xor_ps(signbit,_mm_mul_ps(qq00,_mm_mul_ps(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_ps(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_ps(r00,gbscale);
-            gbitab           = _mm_cvttps_epi32(rt);
-            gbeps            = _mm_sub_ps(rt,_mm_cvtepi32_ps(gbitab));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,0) );
-            F                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,1) );
-            G                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,2) );
-            H                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm_mul_ps(gbeps,H);
-            Fp               = _mm_add_ps(F,_mm_mul_ps(gbeps,_mm_add_ps(G,Heps)));
-            VV               = _mm_add_ps(Y,_mm_mul_ps(gbeps,Fp));
-            vgb              = _mm_mul_ps(gbqqfactor,VV);
-
-            FF               = _mm_add_ps(Fp,_mm_mul_ps(gbeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
-            fgb              = _mm_mul_ps(gbqqfactor,_mm_mul_ps(FF,gbscale));
-            dvdatmp          = _mm_mul_ps(minushalf,_mm_add_ps(vgb,_mm_mul_ps(fgb,r00)));
-            dvdatmp          = _mm_andnot_ps(dummy_mask,dvdatmp);
-            dvdasum          = _mm_add_ps(dvdasum,dvdatmp);
-            /* The pointers to scratch make sure that this code with compilers that take gmx_restrict seriously (e.g. icc 13) really can't screw things up. */
-            fjptrA             = (jnrlistA>=0) ? dvda+jnrA : scratch;
-            fjptrB             = (jnrlistB>=0) ? dvda+jnrB : scratch;
-            fjptrC             = (jnrlistC>=0) ? dvda+jnrC : scratch;
-            fjptrD             = (jnrlistD>=0) ? dvda+jnrD : scratch;
-            gmx_mm_increment_4real_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,_mm_mul_ps(dvdatmp,_mm_mul_ps(isaj0,isaj0)));
-            velec            = _mm_mul_ps(qq00,rinv00);
-            felec            = _mm_mul_ps(_mm_sub_ps(_mm_mul_ps(velec,rinv00),fgb),rinv00);
-
-            /* LENNARD-JONES DISPERSION/REPULSION */
-
-            rinvsix          = _mm_mul_ps(_mm_mul_ps(rinvsq00,rinvsq00),rinvsq00);
-            vvdw6            = _mm_mul_ps(c6_00,rinvsix);
-            vvdw12           = _mm_mul_ps(c12_00,_mm_mul_ps(rinvsix,rinvsix));
-            vvdw             = _mm_sub_ps( _mm_mul_ps(vvdw12,one_twelfth) , _mm_mul_ps(vvdw6,one_sixth) );
-            fvdw             = _mm_mul_ps(_mm_sub_ps(vvdw12,vvdw6),rinvsq00);
-
-            /* Update potential sum for this i atom from the interaction with this j atom. */
-            velec            = _mm_andnot_ps(dummy_mask,velec);
-            velecsum         = _mm_add_ps(velecsum,velec);
-            vgb              = _mm_andnot_ps(dummy_mask,vgb);
-            vgbsum           = _mm_add_ps(vgbsum,vgb);
-            vvdw             = _mm_andnot_ps(dummy_mask,vvdw);
-            vvdwsum          = _mm_add_ps(vvdwsum,vvdw);
-
-            fscal            = _mm_add_ps(felec,fvdw);
-
-            fscal            = _mm_andnot_ps(dummy_mask,fscal);
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm_mul_ps(fscal,dx00);
-            ty               = _mm_mul_ps(fscal,dy00);
-            tz               = _mm_mul_ps(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm_add_ps(fix0,tx);
-            fiy0             = _mm_add_ps(fiy0,ty);
-            fiz0             = _mm_add_ps(fiz0,tz);
-
-            fjptrA             = (jnrlistA>=0) ? f+j_coord_offsetA : scratch;
-            fjptrB             = (jnrlistB>=0) ? f+j_coord_offsetB : scratch;
-            fjptrC             = (jnrlistC>=0) ? f+j_coord_offsetC : scratch;
-            fjptrD             = (jnrlistD>=0) ? f+j_coord_offsetD : scratch;
-            gmx_mm_decrement_1rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,tx,ty,tz);
-            
-            /* Inner loop uses 72 flops */
-        }
-
-        /* End of innermost loop */
-
-        gmx_mm_update_iforce_1atom_swizzle_ps(fix0,fiy0,fiz0,
-                                              f+i_coord_offset,fshift+i_shift_offset);
-
-        ggid                        = gid[iidx];
-        /* Update potential energies */
-        gmx_mm_update_1pot_ps(velecsum,kernel_data->energygrp_elec+ggid);
-        gmx_mm_update_1pot_ps(vgbsum,kernel_data->energygrp_polarization+ggid);
-        gmx_mm_update_1pot_ps(vvdwsum,kernel_data->energygrp_vdw+ggid);
-        dvdasum = _mm_mul_ps(dvdasum, _mm_mul_ps(isai0,isai0));
-        gmx_mm_update_1pot_ps(dvdasum,dvda+inr);
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 10 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_VF,outeriter*10 + inneriter*72);
-}
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_sse2_single
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            LennardJones
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        Force
- */
-void
-nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_sse2_single
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or 
-     * just 0 for non-waters.
-     * Suffixes A,B,C,D refer to j loop unrolling done with SSE, e.g. for the four different
-     * jnr indices corresponding to data put in the four positions in the SIMD register.
-     */
-    int              i_shift_offset,i_coord_offset,outeriter,inneriter;
-    int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
-    int              jnrA,jnrB,jnrC,jnrD;
-    int              jnrlistA,jnrlistB,jnrlistC,jnrlistD;
-    int              j_coord_offsetA,j_coord_offsetB,j_coord_offsetC,j_coord_offsetD;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             rcutoff_scalar;
-    real             *shiftvec,*fshift,*x,*f;
-    real             *fjptrA,*fjptrB,*fjptrC,*fjptrD;
-    real             scratch[4*DIM];
-    __m128           tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
-    int              vdwioffset0;
-    __m128           ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0A,vdwjidx0B,vdwjidx0C,vdwjidx0D;
-    __m128           jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    __m128           dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
-    __m128           velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    __m128i          gbitab;
-    __m128           vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,gbeps,dvdatmp;
-    __m128           minushalf = _mm_set1_ps(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    int              nvdwtype;
-    __m128           rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
-    int              *vdwtype;
-    real             *vdwparam;
-    __m128           one_sixth   = _mm_set1_ps(1.0/6.0);
-    __m128           one_twelfth = _mm_set1_ps(1.0/12.0);
-    __m128i          vfitab;
-    __m128i          ifour       = _mm_set1_epi32(4);
-    __m128           rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF;
-    real             *vftab;
-    __m128           dummy_mask,cutoff_mask;
-    __m128           signbit = _mm_castsi128_ps( _mm_set1_epi32(0x80000000) );
-    __m128           one     = _mm_set1_ps(1.0);
-    __m128           two     = _mm_set1_ps(2.0);
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = _mm_set1_ps(fr->ic->epsfac);
-    charge           = mdatoms->chargeA;
-    nvdwtype         = fr->ntype;
-    vdwparam         = fr->nbfp;
-    vdwtype          = mdatoms->typeA;
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = _mm_set1_ps(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = _mm_set1_ps((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-
-    /* Avoid stupid compiler warnings */
-    jnrA = jnrB = jnrC = jnrD = 0;
-    j_coord_offsetA = 0;
-    j_coord_offsetB = 0;
-    j_coord_offsetC = 0;
-    j_coord_offsetD = 0;
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    for(iidx=0;iidx<4*DIM;iidx++)
-    {
-        scratch[iidx] = 0.0;
-    }  
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        gmx_mm_load_shift_and_1rvec_broadcast_ps(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
-        
-        fix0             = _mm_setzero_ps();
-        fiy0             = _mm_setzero_ps();
-        fiz0             = _mm_setzero_ps();
-
-        /* Load parameters for i particles */
-        iq0              = _mm_mul_ps(facel,_mm_load1_ps(charge+inr+0));
-        isai0            = _mm_load1_ps(invsqrta+inr+0);
-        vdwioffset0      = 2*nvdwtype*vdwtype[inr+0];
-
-        dvdasum          = _mm_setzero_ps();
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end && jjnr[jidx+3]>=0; jidx+=4)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrA             = jjnr[jidx];
-            jnrB             = jjnr[jidx+1];
-            jnrC             = jjnr[jidx+2];
-            jnrD             = jjnr[jidx+3];
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              x+j_coord_offsetC,x+j_coord_offsetD,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_ps(ix0,jx0);
-            dy00             = _mm_sub_ps(iy0,jy0);
-            dz00             = _mm_sub_ps(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
-
-            rinv00           = sse2_invsqrt_f(rsq00);
-
-            rinvsq00         = _mm_mul_ps(rinv00,rinv00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm_load_4real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
-                                                              charge+jnrC+0,charge+jnrD+0);
-            isaj0            = gmx_mm_load_4real_swizzle_ps(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                              invsqrta+jnrC+0,invsqrta+jnrD+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-            vdwjidx0B        = 2*vdwtype[jnrB+0];
-            vdwjidx0C        = 2*vdwtype[jnrC+0];
-            vdwjidx0D        = 2*vdwtype[jnrD+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_ps(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_ps(iq0,jq0);
-            gmx_mm_load_4pair_swizzle_ps(vdwparam+vdwioffset0+vdwjidx0A,
-                                         vdwparam+vdwioffset0+vdwjidx0B,
-                                         vdwparam+vdwioffset0+vdwjidx0C,
-                                         vdwparam+vdwioffset0+vdwjidx0D,
-                                         &c6_00,&c12_00);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_ps(isai0,isaj0);
-            gbqqfactor       = _mm_xor_ps(signbit,_mm_mul_ps(qq00,_mm_mul_ps(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_ps(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_ps(r00,gbscale);
-            gbitab           = _mm_cvttps_epi32(rt);
-            gbeps            = _mm_sub_ps(rt,_mm_cvtepi32_ps(gbitab));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,0) );
-            F                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,1) );
-            G                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,2) );
-            H                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm_mul_ps(gbeps,H);
-            Fp               = _mm_add_ps(F,_mm_mul_ps(gbeps,_mm_add_ps(G,Heps)));
-            VV               = _mm_add_ps(Y,_mm_mul_ps(gbeps,Fp));
-            vgb              = _mm_mul_ps(gbqqfactor,VV);
-
-            FF               = _mm_add_ps(Fp,_mm_mul_ps(gbeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
-            fgb              = _mm_mul_ps(gbqqfactor,_mm_mul_ps(FF,gbscale));
-            dvdatmp          = _mm_mul_ps(minushalf,_mm_add_ps(vgb,_mm_mul_ps(fgb,r00)));
-            dvdasum          = _mm_add_ps(dvdasum,dvdatmp);
-            fjptrA           = dvda+jnrA;
-            fjptrB           = dvda+jnrB;
-            fjptrC           = dvda+jnrC;
-            fjptrD           = dvda+jnrD;
-            gmx_mm_increment_4real_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,_mm_mul_ps(dvdatmp,_mm_mul_ps(isaj0,isaj0)));
-            velec            = _mm_mul_ps(qq00,rinv00);
-            felec            = _mm_mul_ps(_mm_sub_ps(_mm_mul_ps(velec,rinv00),fgb),rinv00);
-
-            /* LENNARD-JONES DISPERSION/REPULSION */
-
-            rinvsix          = _mm_mul_ps(_mm_mul_ps(rinvsq00,rinvsq00),rinvsq00);
-            fvdw             = _mm_mul_ps(_mm_sub_ps(_mm_mul_ps(c12_00,rinvsix),c6_00),_mm_mul_ps(rinvsix,rinvsq00));
-
-            fscal            = _mm_add_ps(felec,fvdw);
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm_mul_ps(fscal,dx00);
-            ty               = _mm_mul_ps(fscal,dy00);
-            tz               = _mm_mul_ps(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm_add_ps(fix0,tx);
-            fiy0             = _mm_add_ps(fiy0,ty);
-            fiz0             = _mm_add_ps(fiz0,tz);
-
-            fjptrA             = f+j_coord_offsetA;
-            fjptrB             = f+j_coord_offsetB;
-            fjptrC             = f+j_coord_offsetC;
-            fjptrD             = f+j_coord_offsetD;
-            gmx_mm_decrement_1rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,tx,ty,tz);
-            
-            /* Inner loop uses 64 flops */
-        }
-
-        if(jidx<j_index_end)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrlistA         = jjnr[jidx];
-            jnrlistB         = jjnr[jidx+1];
-            jnrlistC         = jjnr[jidx+2];
-            jnrlistD         = jjnr[jidx+3];
-            /* Sign of each element will be negative for non-real atoms.
-             * This mask will be 0xFFFFFFFF for dummy entries and 0x0 for real ones,
-             * so use it as val = _mm_andnot_ps(mask,val) to clear dummy entries.
-             */
-            dummy_mask = gmx_mm_castsi128_ps(_mm_cmplt_epi32(_mm_loadu_si128((const __m128i *)(jjnr+jidx)),_mm_setzero_si128()));
-            jnrA       = (jnrlistA>=0) ? jnrlistA : 0;
-            jnrB       = (jnrlistB>=0) ? jnrlistB : 0;
-            jnrC       = (jnrlistC>=0) ? jnrlistC : 0;
-            jnrD       = (jnrlistD>=0) ? jnrlistD : 0;
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              x+j_coord_offsetC,x+j_coord_offsetD,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_ps(ix0,jx0);
-            dy00             = _mm_sub_ps(iy0,jy0);
-            dz00             = _mm_sub_ps(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
-
-            rinv00           = sse2_invsqrt_f(rsq00);
-
-            rinvsq00         = _mm_mul_ps(rinv00,rinv00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm_load_4real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
-                                                              charge+jnrC+0,charge+jnrD+0);
-            isaj0            = gmx_mm_load_4real_swizzle_ps(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                              invsqrta+jnrC+0,invsqrta+jnrD+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-            vdwjidx0B        = 2*vdwtype[jnrB+0];
-            vdwjidx0C        = 2*vdwtype[jnrC+0];
-            vdwjidx0D        = 2*vdwtype[jnrD+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_ps(rsq00,rinv00);
-            r00              = _mm_andnot_ps(dummy_mask,r00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_ps(iq0,jq0);
-            gmx_mm_load_4pair_swizzle_ps(vdwparam+vdwioffset0+vdwjidx0A,
-                                         vdwparam+vdwioffset0+vdwjidx0B,
-                                         vdwparam+vdwioffset0+vdwjidx0C,
-                                         vdwparam+vdwioffset0+vdwjidx0D,
-                                         &c6_00,&c12_00);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_ps(isai0,isaj0);
-            gbqqfactor       = _mm_xor_ps(signbit,_mm_mul_ps(qq00,_mm_mul_ps(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_ps(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_ps(r00,gbscale);
-            gbitab           = _mm_cvttps_epi32(rt);
-            gbeps            = _mm_sub_ps(rt,_mm_cvtepi32_ps(gbitab));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,0) );
-            F                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,1) );
-            G                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,2) );
-            H                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm_mul_ps(gbeps,H);
-            Fp               = _mm_add_ps(F,_mm_mul_ps(gbeps,_mm_add_ps(G,Heps)));
-            VV               = _mm_add_ps(Y,_mm_mul_ps(gbeps,Fp));
-            vgb              = _mm_mul_ps(gbqqfactor,VV);
-
-            FF               = _mm_add_ps(Fp,_mm_mul_ps(gbeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
-            fgb              = _mm_mul_ps(gbqqfactor,_mm_mul_ps(FF,gbscale));
-            dvdatmp          = _mm_mul_ps(minushalf,_mm_add_ps(vgb,_mm_mul_ps(fgb,r00)));
-            dvdatmp          = _mm_andnot_ps(dummy_mask,dvdatmp);
-            dvdasum          = _mm_add_ps(dvdasum,dvdatmp);
-            /* The pointers to scratch make sure that this code with compilers that take gmx_restrict seriously (e.g. icc 13) really can't screw things up. */
-            fjptrA             = (jnrlistA>=0) ? dvda+jnrA : scratch;
-            fjptrB             = (jnrlistB>=0) ? dvda+jnrB : scratch;
-            fjptrC             = (jnrlistC>=0) ? dvda+jnrC : scratch;
-            fjptrD             = (jnrlistD>=0) ? dvda+jnrD : scratch;
-            gmx_mm_increment_4real_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,_mm_mul_ps(dvdatmp,_mm_mul_ps(isaj0,isaj0)));
-            velec            = _mm_mul_ps(qq00,rinv00);
-            felec            = _mm_mul_ps(_mm_sub_ps(_mm_mul_ps(velec,rinv00),fgb),rinv00);
-
-            /* LENNARD-JONES DISPERSION/REPULSION */
-
-            rinvsix          = _mm_mul_ps(_mm_mul_ps(rinvsq00,rinvsq00),rinvsq00);
-            fvdw             = _mm_mul_ps(_mm_sub_ps(_mm_mul_ps(c12_00,rinvsix),c6_00),_mm_mul_ps(rinvsix,rinvsq00));
-
-            fscal            = _mm_add_ps(felec,fvdw);
-
-            fscal            = _mm_andnot_ps(dummy_mask,fscal);
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm_mul_ps(fscal,dx00);
-            ty               = _mm_mul_ps(fscal,dy00);
-            tz               = _mm_mul_ps(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm_add_ps(fix0,tx);
-            fiy0             = _mm_add_ps(fiy0,ty);
-            fiz0             = _mm_add_ps(fiz0,tz);
-
-            fjptrA             = (jnrlistA>=0) ? f+j_coord_offsetA : scratch;
-            fjptrB             = (jnrlistB>=0) ? f+j_coord_offsetB : scratch;
-            fjptrC             = (jnrlistC>=0) ? f+j_coord_offsetC : scratch;
-            fjptrD             = (jnrlistD>=0) ? f+j_coord_offsetD : scratch;
-            gmx_mm_decrement_1rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,tx,ty,tz);
-            
-            /* Inner loop uses 65 flops */
-        }
-
-        /* End of innermost loop */
-
-        gmx_mm_update_iforce_1atom_swizzle_ps(fix0,fiy0,fiz0,
-                                              f+i_coord_offset,fshift+i_shift_offset);
-
-        dvdasum = _mm_mul_ps(dvdasum, _mm_mul_ps(isai0,isai0));
-        gmx_mm_update_1pot_ps(dvdasum,dvda+inr);
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 7 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_F,outeriter*7 + inneriter*65);
-}
diff --git a/src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecGB_VdwNone_GeomP1P1_sse2_single.c b/src/gromacs/gmxlib/nonbonded/nb_kernel_sse2_single/nb_kernel_ElecGB_VdwNone_GeomP1P1_sse2_single.c
deleted file mode 100644 (file)
index 36268cd..0000000
+++ /dev/null
@@ -1,761 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
- * and including many others, as listed in the AUTHORS file in the
- * top-level source directory and at http://www.gromacs.org.
- *
- * GROMACS is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * GROMACS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GROMACS; if not, see
- * http://www.gnu.org/licenses, or write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
- *
- * If you want to redistribute modifications to GROMACS, please
- * consider that scientific software is very special. Version
- * control is crucial - bugs must be traceable. We will be happy to
- * consider code for inclusion in the official distribution, but
- * derived work must not be called official GROMACS. Details are found
- * in the README & COPYING files - if they are missing, get the
- * official version at http://www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the research papers on the package. Check out http://www.gromacs.org.
- */
-/*
- * Note: this file was generated by the GROMACS sse2_single kernel generator.
- */
-#include "gmxpre.h"
-
-#include "config.h"
-
-#include <math.h>
-
-#include "../nb_kernel.h"
-#include "gromacs/gmxlib/nrnb.h"
-
-#include "kernelutil_x86_sse2_single.h"
-
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_sse2_single
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            None
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        PotentialAndForce
- */
-void
-nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_sse2_single
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or 
-     * just 0 for non-waters.
-     * Suffixes A,B,C,D refer to j loop unrolling done with SSE, e.g. for the four different
-     * jnr indices corresponding to data put in the four positions in the SIMD register.
-     */
-    int              i_shift_offset,i_coord_offset,outeriter,inneriter;
-    int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
-    int              jnrA,jnrB,jnrC,jnrD;
-    int              jnrlistA,jnrlistB,jnrlistC,jnrlistD;
-    int              j_coord_offsetA,j_coord_offsetB,j_coord_offsetC,j_coord_offsetD;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             rcutoff_scalar;
-    real             *shiftvec,*fshift,*x,*f;
-    real             *fjptrA,*fjptrB,*fjptrC,*fjptrD;
-    real             scratch[4*DIM];
-    __m128           tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
-    int              vdwioffset0;
-    __m128           ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0A,vdwjidx0B,vdwjidx0C,vdwjidx0D;
-    __m128           jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    __m128           dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
-    __m128           velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    __m128i          gbitab;
-    __m128           vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,gbeps,dvdatmp;
-    __m128           minushalf = _mm_set1_ps(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    __m128i          vfitab;
-    __m128i          ifour       = _mm_set1_epi32(4);
-    __m128           rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF;
-    real             *vftab;
-    __m128           dummy_mask,cutoff_mask;
-    __m128           signbit = _mm_castsi128_ps( _mm_set1_epi32(0x80000000) );
-    __m128           one     = _mm_set1_ps(1.0);
-    __m128           two     = _mm_set1_ps(2.0);
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = _mm_set1_ps(fr->ic->epsfac);
-    charge           = mdatoms->chargeA;
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = _mm_set1_ps(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = _mm_set1_ps((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-
-    /* Avoid stupid compiler warnings */
-    jnrA = jnrB = jnrC = jnrD = 0;
-    j_coord_offsetA = 0;
-    j_coord_offsetB = 0;
-    j_coord_offsetC = 0;
-    j_coord_offsetD = 0;
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    for(iidx=0;iidx<4*DIM;iidx++)
-    {
-        scratch[iidx] = 0.0;
-    }  
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        gmx_mm_load_shift_and_1rvec_broadcast_ps(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
-        
-        fix0             = _mm_setzero_ps();
-        fiy0             = _mm_setzero_ps();
-        fiz0             = _mm_setzero_ps();
-
-        /* Load parameters for i particles */
-        iq0              = _mm_mul_ps(facel,_mm_load1_ps(charge+inr+0));
-        isai0            = _mm_load1_ps(invsqrta+inr+0);
-
-        /* Reset potential sums */
-        velecsum         = _mm_setzero_ps();
-        vgbsum           = _mm_setzero_ps();
-        dvdasum          = _mm_setzero_ps();
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end && jjnr[jidx+3]>=0; jidx+=4)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrA             = jjnr[jidx];
-            jnrB             = jjnr[jidx+1];
-            jnrC             = jjnr[jidx+2];
-            jnrD             = jjnr[jidx+3];
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              x+j_coord_offsetC,x+j_coord_offsetD,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_ps(ix0,jx0);
-            dy00             = _mm_sub_ps(iy0,jy0);
-            dz00             = _mm_sub_ps(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
-
-            rinv00           = sse2_invsqrt_f(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm_load_4real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
-                                                              charge+jnrC+0,charge+jnrD+0);
-            isaj0            = gmx_mm_load_4real_swizzle_ps(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                              invsqrta+jnrC+0,invsqrta+jnrD+0);
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_ps(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_ps(iq0,jq0);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_ps(isai0,isaj0);
-            gbqqfactor       = _mm_xor_ps(signbit,_mm_mul_ps(qq00,_mm_mul_ps(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_ps(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_ps(r00,gbscale);
-            gbitab           = _mm_cvttps_epi32(rt);
-            gbeps            = _mm_sub_ps(rt,_mm_cvtepi32_ps(gbitab));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,0) );
-            F                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,1) );
-            G                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,2) );
-            H                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm_mul_ps(gbeps,H);
-            Fp               = _mm_add_ps(F,_mm_mul_ps(gbeps,_mm_add_ps(G,Heps)));
-            VV               = _mm_add_ps(Y,_mm_mul_ps(gbeps,Fp));
-            vgb              = _mm_mul_ps(gbqqfactor,VV);
-
-            FF               = _mm_add_ps(Fp,_mm_mul_ps(gbeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
-            fgb              = _mm_mul_ps(gbqqfactor,_mm_mul_ps(FF,gbscale));
-            dvdatmp          = _mm_mul_ps(minushalf,_mm_add_ps(vgb,_mm_mul_ps(fgb,r00)));
-            dvdasum          = _mm_add_ps(dvdasum,dvdatmp);
-            fjptrA           = dvda+jnrA;
-            fjptrB           = dvda+jnrB;
-            fjptrC           = dvda+jnrC;
-            fjptrD           = dvda+jnrD;
-            gmx_mm_increment_4real_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,_mm_mul_ps(dvdatmp,_mm_mul_ps(isaj0,isaj0)));
-            velec            = _mm_mul_ps(qq00,rinv00);
-            felec            = _mm_mul_ps(_mm_sub_ps(_mm_mul_ps(velec,rinv00),fgb),rinv00);
-
-            /* Update potential sum for this i atom from the interaction with this j atom. */
-            velecsum         = _mm_add_ps(velecsum,velec);
-            vgbsum           = _mm_add_ps(vgbsum,vgb);
-
-            fscal            = felec;
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm_mul_ps(fscal,dx00);
-            ty               = _mm_mul_ps(fscal,dy00);
-            tz               = _mm_mul_ps(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm_add_ps(fix0,tx);
-            fiy0             = _mm_add_ps(fiy0,ty);
-            fiz0             = _mm_add_ps(fiz0,tz);
-
-            fjptrA             = f+j_coord_offsetA;
-            fjptrB             = f+j_coord_offsetB;
-            fjptrC             = f+j_coord_offsetC;
-            fjptrD             = f+j_coord_offsetD;
-            gmx_mm_decrement_1rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,tx,ty,tz);
-            
-            /* Inner loop uses 58 flops */
-        }
-
-        if(jidx<j_index_end)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrlistA         = jjnr[jidx];
-            jnrlistB         = jjnr[jidx+1];
-            jnrlistC         = jjnr[jidx+2];
-            jnrlistD         = jjnr[jidx+3];
-            /* Sign of each element will be negative for non-real atoms.
-             * This mask will be 0xFFFFFFFF for dummy entries and 0x0 for real ones,
-             * so use it as val = _mm_andnot_ps(mask,val) to clear dummy entries.
-             */
-            dummy_mask = gmx_mm_castsi128_ps(_mm_cmplt_epi32(_mm_loadu_si128((const __m128i *)(jjnr+jidx)),_mm_setzero_si128()));
-            jnrA       = (jnrlistA>=0) ? jnrlistA : 0;
-            jnrB       = (jnrlistB>=0) ? jnrlistB : 0;
-            jnrC       = (jnrlistC>=0) ? jnrlistC : 0;
-            jnrD       = (jnrlistD>=0) ? jnrlistD : 0;
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              x+j_coord_offsetC,x+j_coord_offsetD,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_ps(ix0,jx0);
-            dy00             = _mm_sub_ps(iy0,jy0);
-            dz00             = _mm_sub_ps(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
-
-            rinv00           = sse2_invsqrt_f(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm_load_4real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
-                                                              charge+jnrC+0,charge+jnrD+0);
-            isaj0            = gmx_mm_load_4real_swizzle_ps(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                              invsqrta+jnrC+0,invsqrta+jnrD+0);
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_ps(rsq00,rinv00);
-            r00              = _mm_andnot_ps(dummy_mask,r00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_ps(iq0,jq0);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_ps(isai0,isaj0);
-            gbqqfactor       = _mm_xor_ps(signbit,_mm_mul_ps(qq00,_mm_mul_ps(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_ps(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_ps(r00,gbscale);
-            gbitab           = _mm_cvttps_epi32(rt);
-            gbeps            = _mm_sub_ps(rt,_mm_cvtepi32_ps(gbitab));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,0) );
-            F                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,1) );
-            G                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,2) );
-            H                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm_mul_ps(gbeps,H);
-            Fp               = _mm_add_ps(F,_mm_mul_ps(gbeps,_mm_add_ps(G,Heps)));
-            VV               = _mm_add_ps(Y,_mm_mul_ps(gbeps,Fp));
-            vgb              = _mm_mul_ps(gbqqfactor,VV);
-
-            FF               = _mm_add_ps(Fp,_mm_mul_ps(gbeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
-            fgb              = _mm_mul_ps(gbqqfactor,_mm_mul_ps(FF,gbscale));
-            dvdatmp          = _mm_mul_ps(minushalf,_mm_add_ps(vgb,_mm_mul_ps(fgb,r00)));
-            dvdatmp          = _mm_andnot_ps(dummy_mask,dvdatmp);
-            dvdasum          = _mm_add_ps(dvdasum,dvdatmp);
-            /* The pointers to scratch make sure that this code with compilers that take gmx_restrict seriously (e.g. icc 13) really can't screw things up. */
-            fjptrA             = (jnrlistA>=0) ? dvda+jnrA : scratch;
-            fjptrB             = (jnrlistB>=0) ? dvda+jnrB : scratch;
-            fjptrC             = (jnrlistC>=0) ? dvda+jnrC : scratch;
-            fjptrD             = (jnrlistD>=0) ? dvda+jnrD : scratch;
-            gmx_mm_increment_4real_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,_mm_mul_ps(dvdatmp,_mm_mul_ps(isaj0,isaj0)));
-            velec            = _mm_mul_ps(qq00,rinv00);
-            felec            = _mm_mul_ps(_mm_sub_ps(_mm_mul_ps(velec,rinv00),fgb),rinv00);
-
-            /* Update potential sum for this i atom from the interaction with this j atom. */
-            velec            = _mm_andnot_ps(dummy_mask,velec);
-            velecsum         = _mm_add_ps(velecsum,velec);
-            vgb              = _mm_andnot_ps(dummy_mask,vgb);
-            vgbsum           = _mm_add_ps(vgbsum,vgb);
-
-            fscal            = felec;
-
-            fscal            = _mm_andnot_ps(dummy_mask,fscal);
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm_mul_ps(fscal,dx00);
-            ty               = _mm_mul_ps(fscal,dy00);
-            tz               = _mm_mul_ps(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm_add_ps(fix0,tx);
-            fiy0             = _mm_add_ps(fiy0,ty);
-            fiz0             = _mm_add_ps(fiz0,tz);
-
-            fjptrA             = (jnrlistA>=0) ? f+j_coord_offsetA : scratch;
-            fjptrB             = (jnrlistB>=0) ? f+j_coord_offsetB : scratch;
-            fjptrC             = (jnrlistC>=0) ? f+j_coord_offsetC : scratch;
-            fjptrD             = (jnrlistD>=0) ? f+j_coord_offsetD : scratch;
-            gmx_mm_decrement_1rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,tx,ty,tz);
-            
-            /* Inner loop uses 59 flops */
-        }
-
-        /* End of innermost loop */
-
-        gmx_mm_update_iforce_1atom_swizzle_ps(fix0,fiy0,fiz0,
-                                              f+i_coord_offset,fshift+i_shift_offset);
-
-        ggid                        = gid[iidx];
-        /* Update potential energies */
-        gmx_mm_update_1pot_ps(velecsum,kernel_data->energygrp_elec+ggid);
-        gmx_mm_update_1pot_ps(vgbsum,kernel_data->energygrp_polarization+ggid);
-        dvdasum = _mm_mul_ps(dvdasum, _mm_mul_ps(isai0,isai0));
-        gmx_mm_update_1pot_ps(dvdasum,dvda+inr);
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 9 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VF,outeriter*9 + inneriter*59);
-}
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwNone_GeomP1P1_F_sse2_single
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            None
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        Force
- */
-void
-nb_kernel_ElecGB_VdwNone_GeomP1P1_F_sse2_single
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or 
-     * just 0 for non-waters.
-     * Suffixes A,B,C,D refer to j loop unrolling done with SSE, e.g. for the four different
-     * jnr indices corresponding to data put in the four positions in the SIMD register.
-     */
-    int              i_shift_offset,i_coord_offset,outeriter,inneriter;
-    int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
-    int              jnrA,jnrB,jnrC,jnrD;
-    int              jnrlistA,jnrlistB,jnrlistC,jnrlistD;
-    int              j_coord_offsetA,j_coord_offsetB,j_coord_offsetC,j_coord_offsetD;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             rcutoff_scalar;
-    real             *shiftvec,*fshift,*x,*f;
-    real             *fjptrA,*fjptrB,*fjptrC,*fjptrD;
-    real             scratch[4*DIM];
-    __m128           tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
-    int              vdwioffset0;
-    __m128           ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0A,vdwjidx0B,vdwjidx0C,vdwjidx0D;
-    __m128           jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    __m128           dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
-    __m128           velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    __m128i          gbitab;
-    __m128           vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,gbeps,dvdatmp;
-    __m128           minushalf = _mm_set1_ps(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    __m128i          vfitab;
-    __m128i          ifour       = _mm_set1_epi32(4);
-    __m128           rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF;
-    real             *vftab;
-    __m128           dummy_mask,cutoff_mask;
-    __m128           signbit = _mm_castsi128_ps( _mm_set1_epi32(0x80000000) );
-    __m128           one     = _mm_set1_ps(1.0);
-    __m128           two     = _mm_set1_ps(2.0);
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = _mm_set1_ps(fr->ic->epsfac);
-    charge           = mdatoms->chargeA;
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = _mm_set1_ps(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = _mm_set1_ps((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-
-    /* Avoid stupid compiler warnings */
-    jnrA = jnrB = jnrC = jnrD = 0;
-    j_coord_offsetA = 0;
-    j_coord_offsetB = 0;
-    j_coord_offsetC = 0;
-    j_coord_offsetD = 0;
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    for(iidx=0;iidx<4*DIM;iidx++)
-    {
-        scratch[iidx] = 0.0;
-    }  
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        gmx_mm_load_shift_and_1rvec_broadcast_ps(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
-        
-        fix0             = _mm_setzero_ps();
-        fiy0             = _mm_setzero_ps();
-        fiz0             = _mm_setzero_ps();
-
-        /* Load parameters for i particles */
-        iq0              = _mm_mul_ps(facel,_mm_load1_ps(charge+inr+0));
-        isai0            = _mm_load1_ps(invsqrta+inr+0);
-
-        dvdasum          = _mm_setzero_ps();
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end && jjnr[jidx+3]>=0; jidx+=4)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrA             = jjnr[jidx];
-            jnrB             = jjnr[jidx+1];
-            jnrC             = jjnr[jidx+2];
-            jnrD             = jjnr[jidx+3];
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              x+j_coord_offsetC,x+j_coord_offsetD,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_ps(ix0,jx0);
-            dy00             = _mm_sub_ps(iy0,jy0);
-            dz00             = _mm_sub_ps(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
-
-            rinv00           = sse2_invsqrt_f(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm_load_4real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
-                                                              charge+jnrC+0,charge+jnrD+0);
-            isaj0            = gmx_mm_load_4real_swizzle_ps(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                              invsqrta+jnrC+0,invsqrta+jnrD+0);
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_ps(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_ps(iq0,jq0);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_ps(isai0,isaj0);
-            gbqqfactor       = _mm_xor_ps(signbit,_mm_mul_ps(qq00,_mm_mul_ps(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_ps(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_ps(r00,gbscale);
-            gbitab           = _mm_cvttps_epi32(rt);
-            gbeps            = _mm_sub_ps(rt,_mm_cvtepi32_ps(gbitab));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,0) );
-            F                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,1) );
-            G                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,2) );
-            H                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm_mul_ps(gbeps,H);
-            Fp               = _mm_add_ps(F,_mm_mul_ps(gbeps,_mm_add_ps(G,Heps)));
-            VV               = _mm_add_ps(Y,_mm_mul_ps(gbeps,Fp));
-            vgb              = _mm_mul_ps(gbqqfactor,VV);
-
-            FF               = _mm_add_ps(Fp,_mm_mul_ps(gbeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
-            fgb              = _mm_mul_ps(gbqqfactor,_mm_mul_ps(FF,gbscale));
-            dvdatmp          = _mm_mul_ps(minushalf,_mm_add_ps(vgb,_mm_mul_ps(fgb,r00)));
-            dvdasum          = _mm_add_ps(dvdasum,dvdatmp);
-            fjptrA           = dvda+jnrA;
-            fjptrB           = dvda+jnrB;
-            fjptrC           = dvda+jnrC;
-            fjptrD           = dvda+jnrD;
-            gmx_mm_increment_4real_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,_mm_mul_ps(dvdatmp,_mm_mul_ps(isaj0,isaj0)));
-            velec            = _mm_mul_ps(qq00,rinv00);
-            felec            = _mm_mul_ps(_mm_sub_ps(_mm_mul_ps(velec,rinv00),fgb),rinv00);
-
-            fscal            = felec;
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm_mul_ps(fscal,dx00);
-            ty               = _mm_mul_ps(fscal,dy00);
-            tz               = _mm_mul_ps(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm_add_ps(fix0,tx);
-            fiy0             = _mm_add_ps(fiy0,ty);
-            fiz0             = _mm_add_ps(fiz0,tz);
-
-            fjptrA             = f+j_coord_offsetA;
-            fjptrB             = f+j_coord_offsetB;
-            fjptrC             = f+j_coord_offsetC;
-            fjptrD             = f+j_coord_offsetD;
-            gmx_mm_decrement_1rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,tx,ty,tz);
-            
-            /* Inner loop uses 56 flops */
-        }
-
-        if(jidx<j_index_end)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrlistA         = jjnr[jidx];
-            jnrlistB         = jjnr[jidx+1];
-            jnrlistC         = jjnr[jidx+2];
-            jnrlistD         = jjnr[jidx+3];
-            /* Sign of each element will be negative for non-real atoms.
-             * This mask will be 0xFFFFFFFF for dummy entries and 0x0 for real ones,
-             * so use it as val = _mm_andnot_ps(mask,val) to clear dummy entries.
-             */
-            dummy_mask = gmx_mm_castsi128_ps(_mm_cmplt_epi32(_mm_loadu_si128((const __m128i *)(jjnr+jidx)),_mm_setzero_si128()));
-            jnrA       = (jnrlistA>=0) ? jnrlistA : 0;
-            jnrB       = (jnrlistB>=0) ? jnrlistB : 0;
-            jnrC       = (jnrlistC>=0) ? jnrlistC : 0;
-            jnrD       = (jnrlistD>=0) ? jnrlistD : 0;
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              x+j_coord_offsetC,x+j_coord_offsetD,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_ps(ix0,jx0);
-            dy00             = _mm_sub_ps(iy0,jy0);
-            dz00             = _mm_sub_ps(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
-
-            rinv00           = sse2_invsqrt_f(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm_load_4real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
-                                                              charge+jnrC+0,charge+jnrD+0);
-            isaj0            = gmx_mm_load_4real_swizzle_ps(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                              invsqrta+jnrC+0,invsqrta+jnrD+0);
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_ps(rsq00,rinv00);
-            r00              = _mm_andnot_ps(dummy_mask,r00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_ps(iq0,jq0);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_ps(isai0,isaj0);
-            gbqqfactor       = _mm_xor_ps(signbit,_mm_mul_ps(qq00,_mm_mul_ps(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_ps(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_ps(r00,gbscale);
-            gbitab           = _mm_cvttps_epi32(rt);
-            gbeps            = _mm_sub_ps(rt,_mm_cvtepi32_ps(gbitab));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,0) );
-            F                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,1) );
-            G                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,2) );
-            H                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm_mul_ps(gbeps,H);
-            Fp               = _mm_add_ps(F,_mm_mul_ps(gbeps,_mm_add_ps(G,Heps)));
-            VV               = _mm_add_ps(Y,_mm_mul_ps(gbeps,Fp));
-            vgb              = _mm_mul_ps(gbqqfactor,VV);
-
-            FF               = _mm_add_ps(Fp,_mm_mul_ps(gbeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
-            fgb              = _mm_mul_ps(gbqqfactor,_mm_mul_ps(FF,gbscale));
-            dvdatmp          = _mm_mul_ps(minushalf,_mm_add_ps(vgb,_mm_mul_ps(fgb,r00)));
-            dvdatmp          = _mm_andnot_ps(dummy_mask,dvdatmp);
-            dvdasum          = _mm_add_ps(dvdasum,dvdatmp);
-            /* The pointers to scratch make sure that this code with compilers that take gmx_restrict seriously (e.g. icc 13) really can't screw things up. */
-            fjptrA             = (jnrlistA>=0) ? dvda+jnrA : scratch;
-            fjptrB             = (jnrlistB>=0) ? dvda+jnrB : scratch;
-            fjptrC             = (jnrlistC>=0) ? dvda+jnrC : scratch;
-            fjptrD             = (jnrlistD>=0) ? dvda+jnrD : scratch;
-            gmx_mm_increment_4real_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,_mm_mul_ps(dvdatmp,_mm_mul_ps(isaj0,isaj0)));
-            velec            = _mm_mul_ps(qq00,rinv00);
-            felec            = _mm_mul_ps(_mm_sub_ps(_mm_mul_ps(velec,rinv00),fgb),rinv00);
-
-            fscal            = felec;
-
-            fscal            = _mm_andnot_ps(dummy_mask,fscal);
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm_mul_ps(fscal,dx00);
-            ty               = _mm_mul_ps(fscal,dy00);
-            tz               = _mm_mul_ps(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm_add_ps(fix0,tx);
-            fiy0             = _mm_add_ps(fiy0,ty);
-            fiz0             = _mm_add_ps(fiz0,tz);
-
-            fjptrA             = (jnrlistA>=0) ? f+j_coord_offsetA : scratch;
-            fjptrB             = (jnrlistB>=0) ? f+j_coord_offsetB : scratch;
-            fjptrC             = (jnrlistC>=0) ? f+j_coord_offsetC : scratch;
-            fjptrD             = (jnrlistD>=0) ? f+j_coord_offsetD : scratch;
-            gmx_mm_decrement_1rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,tx,ty,tz);
-            
-            /* Inner loop uses 57 flops */
-        }
-
-        /* End of innermost loop */
-
-        gmx_mm_update_iforce_1atom_swizzle_ps(fix0,fiy0,fiz0,
-                                              f+i_coord_offset,fshift+i_shift_offset);
-
-        dvdasum = _mm_mul_ps(dvdasum, _mm_mul_ps(isai0,isai0));
-        gmx_mm_update_1pot_ps(dvdasum,dvda+inr);
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 7 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_F,outeriter*7 + inneriter*57);
-}
index 324c1cee561c515277d2e9d42f512733c3de19cf..7ecc4a33da62327e5397b0283777266a898d837b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -51,6 +51,36 @@ nb_kernel_t nb_kernel_ElecNone_VdwLJSw_GeomP1P1_VF_sse2_single;
 nb_kernel_t nb_kernel_ElecNone_VdwLJSw_GeomP1P1_F_sse2_single;
 nb_kernel_t nb_kernel_ElecNone_VdwCSTab_GeomP1P1_VF_sse2_single;
 nb_kernel_t nb_kernel_ElecNone_VdwCSTab_GeomP1P1_F_sse2_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_sse2_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_sse2_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_sse2_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_sse2_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_sse2_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_sse2_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_sse2_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_sse2_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_sse2_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_sse2_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_sse2_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_sse2_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_sse2_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_sse2_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_sse2_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_sse2_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_sse2_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_sse2_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_sse2_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_sse2_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_sse2_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_sse2_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_sse2_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_sse2_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_sse2_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_sse2_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_sse2_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_sse2_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_sse2_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_sse2_single;
 nb_kernel_t nb_kernel_ElecEw_VdwLJEw_GeomP1P1_VF_sse2_single;
 nb_kernel_t nb_kernel_ElecEw_VdwLJEw_GeomP1P1_F_sse2_single;
 nb_kernel_t nb_kernel_ElecEw_VdwLJEw_GeomW3P1_VF_sse2_single;
@@ -141,72 +171,6 @@ nb_kernel_t nb_kernel_ElecEwSw_VdwNone_GeomW4P1_VF_sse2_single;
 nb_kernel_t nb_kernel_ElecEwSw_VdwNone_GeomW4P1_F_sse2_single;
 nb_kernel_t nb_kernel_ElecEwSw_VdwNone_GeomW4W4_VF_sse2_single;
 nb_kernel_t nb_kernel_ElecEwSw_VdwNone_GeomW4W4_F_sse2_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_sse2_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_sse2_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_sse2_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_sse2_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_sse2_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_sse2_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_sse2_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_sse2_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_sse2_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_sse2_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_sse2_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_sse2_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_sse2_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_sse2_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_sse2_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_sse2_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_sse2_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_sse2_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_sse2_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_sse2_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_sse2_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_sse2_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_sse2_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_sse2_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_sse2_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_sse2_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_sse2_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_sse2_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_sse2_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_sse2_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_sse2_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_sse2_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_sse2_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_sse2_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_sse2_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_sse2_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_sse2_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_sse2_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_sse2_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_sse2_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_sse2_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_sse2_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_sse2_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_sse2_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_sse2_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_sse2_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_sse2_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_sse2_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_sse2_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_sse2_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_sse2_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_sse2_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_sse2_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_sse2_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_sse2_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_sse2_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_sse2_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_sse2_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_sse2_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_sse2_single;
-nb_kernel_t nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_sse2_single;
-nb_kernel_t nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_sse2_single;
-nb_kernel_t nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_sse2_single;
-nb_kernel_t nb_kernel_ElecGB_VdwNone_GeomP1P1_F_sse2_single;
-nb_kernel_t nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_sse2_single;
-nb_kernel_t nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_sse2_single;
 nb_kernel_t nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_VF_sse2_single;
 nb_kernel_t nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_F_sse2_single;
 nb_kernel_t nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_VF_sse2_single;
@@ -277,6 +241,36 @@ nb_kernel_t nb_kernel_ElecRF_VdwCSTab_GeomW4P1_VF_sse2_single;
 nb_kernel_t nb_kernel_ElecRF_VdwCSTab_GeomW4P1_F_sse2_single;
 nb_kernel_t nb_kernel_ElecRF_VdwCSTab_GeomW4W4_VF_sse2_single;
 nb_kernel_t nb_kernel_ElecRF_VdwCSTab_GeomW4W4_F_sse2_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_sse2_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_sse2_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_sse2_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_sse2_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_sse2_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_sse2_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_sse2_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_sse2_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_sse2_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_sse2_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_sse2_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_sse2_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_sse2_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_sse2_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_sse2_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_sse2_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_sse2_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_sse2_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_sse2_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_sse2_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_sse2_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_sse2_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_sse2_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_sse2_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_sse2_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_sse2_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_sse2_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_sse2_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_sse2_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_sse2_single;
 
 
 nb_kernel_info_t
@@ -294,6 +288,36 @@ nb_kernel_info_t
     { nb_kernel_ElecNone_VdwLJSw_GeomP1P1_F_sse2_single, "nb_kernel_ElecNone_VdwLJSw_GeomP1P1_F_sse2_single", "sse2_single", "None", "None", "LennardJones", "PotentialSwitch", "ParticleParticle", "", "Force" },
     { nb_kernel_ElecNone_VdwCSTab_GeomP1P1_VF_sse2_single, "nb_kernel_ElecNone_VdwCSTab_GeomP1P1_VF_sse2_single", "sse2_single", "None", "None", "CubicSplineTable", "None", "ParticleParticle", "", "PotentialAndForce" },
     { nb_kernel_ElecNone_VdwCSTab_GeomP1P1_F_sse2_single, "nb_kernel_ElecNone_VdwCSTab_GeomP1P1_F_sse2_single", "sse2_single", "None", "None", "CubicSplineTable", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_sse2_single, "nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_sse2_single", "sse2_single", "CubicSplineTable", "None", "LennardJones", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_sse2_single, "nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_sse2_single", "sse2_single", "CubicSplineTable", "None", "LennardJones", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_sse2_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_sse2_single", "sse2_single", "CubicSplineTable", "None", "LennardJones", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_sse2_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_sse2_single", "sse2_single", "CubicSplineTable", "None", "LennardJones", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_sse2_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_sse2_single", "sse2_single", "CubicSplineTable", "None", "LennardJones", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_sse2_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_sse2_single", "sse2_single", "CubicSplineTable", "None", "LennardJones", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_sse2_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_sse2_single", "sse2_single", "CubicSplineTable", "None", "LennardJones", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_sse2_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_sse2_single", "sse2_single", "CubicSplineTable", "None", "LennardJones", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_sse2_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_sse2_single", "sse2_single", "CubicSplineTable", "None", "LennardJones", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_sse2_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_sse2_single", "sse2_single", "CubicSplineTable", "None", "LennardJones", "None", "Water4Water4", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_sse2_single, "nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_sse2_single", "sse2_single", "CubicSplineTable", "None", "None", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_sse2_single, "nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_sse2_single", "sse2_single", "CubicSplineTable", "None", "None", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_sse2_single, "nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_sse2_single", "sse2_single", "CubicSplineTable", "None", "None", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_sse2_single, "nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_sse2_single", "sse2_single", "CubicSplineTable", "None", "None", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_sse2_single, "nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_sse2_single", "sse2_single", "CubicSplineTable", "None", "None", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_sse2_single, "nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_sse2_single", "sse2_single", "CubicSplineTable", "None", "None", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_sse2_single, "nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_sse2_single", "sse2_single", "CubicSplineTable", "None", "None", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_sse2_single, "nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_sse2_single", "sse2_single", "CubicSplineTable", "None", "None", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_sse2_single, "nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_sse2_single", "sse2_single", "CubicSplineTable", "None", "None", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_sse2_single, "nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_sse2_single", "sse2_single", "CubicSplineTable", "None", "None", "None", "Water4Water4", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_sse2_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_sse2_single", "sse2_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_sse2_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_sse2_single", "sse2_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_sse2_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_sse2_single", "sse2_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_sse2_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_sse2_single", "sse2_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_sse2_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_sse2_single", "sse2_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_sse2_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_sse2_single", "sse2_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_sse2_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_sse2_single", "sse2_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_sse2_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_sse2_single", "sse2_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_sse2_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_sse2_single", "sse2_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_sse2_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_sse2_single", "sse2_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Water4", "", "Force" },
     { nb_kernel_ElecEw_VdwLJEw_GeomP1P1_VF_sse2_single, "nb_kernel_ElecEw_VdwLJEw_GeomP1P1_VF_sse2_single", "sse2_single", "Ewald", "None", "LJEwald", "None", "ParticleParticle", "", "PotentialAndForce" },
     { nb_kernel_ElecEw_VdwLJEw_GeomP1P1_F_sse2_single, "nb_kernel_ElecEw_VdwLJEw_GeomP1P1_F_sse2_single", "sse2_single", "Ewald", "None", "LJEwald", "None", "ParticleParticle", "", "Force" },
     { nb_kernel_ElecEw_VdwLJEw_GeomW3P1_VF_sse2_single, "nb_kernel_ElecEw_VdwLJEw_GeomW3P1_VF_sse2_single", "sse2_single", "Ewald", "None", "LJEwald", "None", "Water3Particle", "", "PotentialAndForce" },
@@ -384,72 +408,6 @@ nb_kernel_info_t
     { nb_kernel_ElecEwSw_VdwNone_GeomW4P1_F_sse2_single, "nb_kernel_ElecEwSw_VdwNone_GeomW4P1_F_sse2_single", "sse2_single", "Ewald", "PotentialSwitch", "None", "None", "Water4Particle", "", "Force" },
     { nb_kernel_ElecEwSw_VdwNone_GeomW4W4_VF_sse2_single, "nb_kernel_ElecEwSw_VdwNone_GeomW4W4_VF_sse2_single", "sse2_single", "Ewald", "PotentialSwitch", "None", "None", "Water4Water4", "", "PotentialAndForce" },
     { nb_kernel_ElecEwSw_VdwNone_GeomW4W4_F_sse2_single, "nb_kernel_ElecEwSw_VdwNone_GeomW4W4_F_sse2_single", "sse2_single", "Ewald", "PotentialSwitch", "None", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_sse2_single, "nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_sse2_single", "sse2_single", "Coulomb", "None", "LennardJones", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_sse2_single, "nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_sse2_single", "sse2_single", "Coulomb", "None", "LennardJones", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_sse2_single, "nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_sse2_single", "sse2_single", "Coulomb", "None", "LennardJones", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_sse2_single, "nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_sse2_single", "sse2_single", "Coulomb", "None", "LennardJones", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_sse2_single, "nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_sse2_single", "sse2_single", "Coulomb", "None", "LennardJones", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_sse2_single, "nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_sse2_single", "sse2_single", "Coulomb", "None", "LennardJones", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_sse2_single, "nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_sse2_single", "sse2_single", "Coulomb", "None", "LennardJones", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_sse2_single, "nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_sse2_single", "sse2_single", "Coulomb", "None", "LennardJones", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_sse2_single, "nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_sse2_single", "sse2_single", "Coulomb", "None", "LennardJones", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_sse2_single, "nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_sse2_single", "sse2_single", "Coulomb", "None", "LennardJones", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_sse2_single, "nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_sse2_single", "sse2_single", "Coulomb", "None", "None", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_sse2_single, "nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_sse2_single", "sse2_single", "Coulomb", "None", "None", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_sse2_single, "nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_sse2_single", "sse2_single", "Coulomb", "None", "None", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_sse2_single, "nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_sse2_single", "sse2_single", "Coulomb", "None", "None", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_sse2_single, "nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_sse2_single", "sse2_single", "Coulomb", "None", "None", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_sse2_single, "nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_sse2_single", "sse2_single", "Coulomb", "None", "None", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_sse2_single, "nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_sse2_single", "sse2_single", "Coulomb", "None", "None", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_sse2_single, "nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_sse2_single", "sse2_single", "Coulomb", "None", "None", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_sse2_single, "nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_sse2_single", "sse2_single", "Coulomb", "None", "None", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_sse2_single, "nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_sse2_single", "sse2_single", "Coulomb", "None", "None", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_sse2_single, "nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_sse2_single", "sse2_single", "Coulomb", "None", "CubicSplineTable", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_sse2_single, "nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_sse2_single", "sse2_single", "Coulomb", "None", "CubicSplineTable", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_sse2_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_sse2_single", "sse2_single", "Coulomb", "None", "CubicSplineTable", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_sse2_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_sse2_single", "sse2_single", "Coulomb", "None", "CubicSplineTable", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_sse2_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_sse2_single", "sse2_single", "Coulomb", "None", "CubicSplineTable", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_sse2_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_sse2_single", "sse2_single", "Coulomb", "None", "CubicSplineTable", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_sse2_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_sse2_single", "sse2_single", "Coulomb", "None", "CubicSplineTable", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_sse2_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_sse2_single", "sse2_single", "Coulomb", "None", "CubicSplineTable", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_sse2_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_sse2_single", "sse2_single", "Coulomb", "None", "CubicSplineTable", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_sse2_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_sse2_single", "sse2_single", "Coulomb", "None", "CubicSplineTable", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_sse2_single, "nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_sse2_single", "sse2_single", "CubicSplineTable", "None", "LennardJones", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_sse2_single, "nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_sse2_single", "sse2_single", "CubicSplineTable", "None", "LennardJones", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_sse2_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_sse2_single", "sse2_single", "CubicSplineTable", "None", "LennardJones", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_sse2_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_sse2_single", "sse2_single", "CubicSplineTable", "None", "LennardJones", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_sse2_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_sse2_single", "sse2_single", "CubicSplineTable", "None", "LennardJones", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_sse2_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_sse2_single", "sse2_single", "CubicSplineTable", "None", "LennardJones", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_sse2_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_sse2_single", "sse2_single", "CubicSplineTable", "None", "LennardJones", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_sse2_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_sse2_single", "sse2_single", "CubicSplineTable", "None", "LennardJones", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_sse2_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_sse2_single", "sse2_single", "CubicSplineTable", "None", "LennardJones", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_sse2_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_sse2_single", "sse2_single", "CubicSplineTable", "None", "LennardJones", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_sse2_single, "nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_sse2_single", "sse2_single", "CubicSplineTable", "None", "None", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_sse2_single, "nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_sse2_single", "sse2_single", "CubicSplineTable", "None", "None", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_sse2_single, "nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_sse2_single", "sse2_single", "CubicSplineTable", "None", "None", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_sse2_single, "nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_sse2_single", "sse2_single", "CubicSplineTable", "None", "None", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_sse2_single, "nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_sse2_single", "sse2_single", "CubicSplineTable", "None", "None", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_sse2_single, "nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_sse2_single", "sse2_single", "CubicSplineTable", "None", "None", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_sse2_single, "nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_sse2_single", "sse2_single", "CubicSplineTable", "None", "None", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_sse2_single, "nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_sse2_single", "sse2_single", "CubicSplineTable", "None", "None", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_sse2_single, "nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_sse2_single", "sse2_single", "CubicSplineTable", "None", "None", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_sse2_single, "nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_sse2_single", "sse2_single", "CubicSplineTable", "None", "None", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_sse2_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_sse2_single", "sse2_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_sse2_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_sse2_single", "sse2_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_sse2_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_sse2_single", "sse2_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_sse2_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_sse2_single", "sse2_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_sse2_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_sse2_single", "sse2_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_sse2_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_sse2_single", "sse2_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_sse2_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_sse2_single", "sse2_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_sse2_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_sse2_single", "sse2_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_sse2_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_sse2_single", "sse2_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_sse2_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_sse2_single", "sse2_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_sse2_single, "nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_sse2_single", "sse2_single", "GeneralizedBorn", "None", "LennardJones", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_sse2_single, "nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_sse2_single", "sse2_single", "GeneralizedBorn", "None", "LennardJones", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_sse2_single, "nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_sse2_single", "sse2_single", "GeneralizedBorn", "None", "None", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecGB_VdwNone_GeomP1P1_F_sse2_single, "nb_kernel_ElecGB_VdwNone_GeomP1P1_F_sse2_single", "sse2_single", "GeneralizedBorn", "None", "None", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_sse2_single, "nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_sse2_single", "sse2_single", "GeneralizedBorn", "None", "CubicSplineTable", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_sse2_single, "nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_sse2_single", "sse2_single", "GeneralizedBorn", "None", "CubicSplineTable", "None", "ParticleParticle", "", "Force" },
     { nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_VF_sse2_single, "nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_VF_sse2_single", "sse2_single", "ReactionField", "ExactCutoff", "LennardJones", "PotentialShift", "ParticleParticle", "", "PotentialAndForce" },
     { nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_F_sse2_single, "nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_F_sse2_single", "sse2_single", "ReactionField", "ExactCutoff", "LennardJones", "PotentialShift", "ParticleParticle", "", "Force" },
     { nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_VF_sse2_single, "nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_VF_sse2_single", "sse2_single", "ReactionField", "ExactCutoff", "LennardJones", "PotentialShift", "Water3Particle", "", "PotentialAndForce" },
@@ -519,7 +477,37 @@ nb_kernel_info_t
     { nb_kernel_ElecRF_VdwCSTab_GeomW4P1_VF_sse2_single, "nb_kernel_ElecRF_VdwCSTab_GeomW4P1_VF_sse2_single", "sse2_single", "ReactionField", "None", "CubicSplineTable", "None", "Water4Particle", "", "PotentialAndForce" },
     { nb_kernel_ElecRF_VdwCSTab_GeomW4P1_F_sse2_single, "nb_kernel_ElecRF_VdwCSTab_GeomW4P1_F_sse2_single", "sse2_single", "ReactionField", "None", "CubicSplineTable", "None", "Water4Particle", "", "Force" },
     { nb_kernel_ElecRF_VdwCSTab_GeomW4W4_VF_sse2_single, "nb_kernel_ElecRF_VdwCSTab_GeomW4W4_VF_sse2_single", "sse2_single", "ReactionField", "None", "CubicSplineTable", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecRF_VdwCSTab_GeomW4W4_F_sse2_single, "nb_kernel_ElecRF_VdwCSTab_GeomW4W4_F_sse2_single", "sse2_single", "ReactionField", "None", "CubicSplineTable", "None", "Water4Water4", "", "Force" }
+    { nb_kernel_ElecRF_VdwCSTab_GeomW4W4_F_sse2_single, "nb_kernel_ElecRF_VdwCSTab_GeomW4W4_F_sse2_single", "sse2_single", "ReactionField", "None", "CubicSplineTable", "None", "Water4Water4", "", "Force" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_sse2_single, "nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_sse2_single", "sse2_single", "Coulomb", "None", "LennardJones", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_sse2_single, "nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_sse2_single", "sse2_single", "Coulomb", "None", "LennardJones", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_sse2_single, "nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_sse2_single", "sse2_single", "Coulomb", "None", "LennardJones", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_sse2_single, "nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_sse2_single", "sse2_single", "Coulomb", "None", "LennardJones", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_sse2_single, "nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_sse2_single", "sse2_single", "Coulomb", "None", "LennardJones", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_sse2_single, "nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_sse2_single", "sse2_single", "Coulomb", "None", "LennardJones", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_sse2_single, "nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_sse2_single", "sse2_single", "Coulomb", "None", "LennardJones", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_sse2_single, "nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_sse2_single", "sse2_single", "Coulomb", "None", "LennardJones", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_sse2_single, "nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_sse2_single", "sse2_single", "Coulomb", "None", "LennardJones", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_sse2_single, "nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_sse2_single", "sse2_single", "Coulomb", "None", "LennardJones", "None", "Water4Water4", "", "Force" },
+    { nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_sse2_single, "nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_sse2_single", "sse2_single", "Coulomb", "None", "None", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_sse2_single, "nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_sse2_single", "sse2_single", "Coulomb", "None", "None", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_sse2_single, "nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_sse2_single", "sse2_single", "Coulomb", "None", "None", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_sse2_single, "nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_sse2_single", "sse2_single", "Coulomb", "None", "None", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_sse2_single, "nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_sse2_single", "sse2_single", "Coulomb", "None", "None", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_sse2_single, "nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_sse2_single", "sse2_single", "Coulomb", "None", "None", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_sse2_single, "nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_sse2_single", "sse2_single", "Coulomb", "None", "None", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_sse2_single, "nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_sse2_single", "sse2_single", "Coulomb", "None", "None", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_sse2_single, "nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_sse2_single", "sse2_single", "Coulomb", "None", "None", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_sse2_single, "nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_sse2_single", "sse2_single", "Coulomb", "None", "None", "None", "Water4Water4", "", "Force" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_sse2_single, "nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_sse2_single", "sse2_single", "Coulomb", "None", "CubicSplineTable", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_sse2_single, "nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_sse2_single", "sse2_single", "Coulomb", "None", "CubicSplineTable", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_sse2_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_sse2_single", "sse2_single", "Coulomb", "None", "CubicSplineTable", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_sse2_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_sse2_single", "sse2_single", "Coulomb", "None", "CubicSplineTable", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_sse2_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_sse2_single", "sse2_single", "Coulomb", "None", "CubicSplineTable", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_sse2_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_sse2_single", "sse2_single", "Coulomb", "None", "CubicSplineTable", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_sse2_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_sse2_single", "sse2_single", "Coulomb", "None", "CubicSplineTable", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_sse2_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_sse2_single", "sse2_single", "Coulomb", "None", "CubicSplineTable", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_sse2_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_sse2_single", "sse2_single", "Coulomb", "None", "CubicSplineTable", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_sse2_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_sse2_single", "sse2_single", "Coulomb", "None", "CubicSplineTable", "None", "Water4Water4", "", "Force" }
 };
 
 int
index 2ee376dcac34a53d927a66fa2259fb0edf6f8f53..556215e2dfc4ee5a917295d71adc591d7eec760d 100644 (file)
@@ -2,7 +2,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -131,12 +131,6 @@ void
     __m128           velec,felec,velecsum,facel,crf,krf,krf2;
     real             *charge;
     /* #endif */
-    /* #if 'GeneralizedBorn' in KERNEL_ELEC */
-    __m128i          gbitab;
-    __m128           vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,gbeps,dvdatmp;
-    __m128           minushalf = _mm_set1_ps(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    /* #endif */
     /* #if KERNEL_VDW != 'None' */
     int              nvdwtype;
     __m128           rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
@@ -145,7 +139,7 @@ void
     __m128           one_sixth   = _mm_set1_ps(1.0/6.0);
     __m128           one_twelfth = _mm_set1_ps(1.0/12.0);
     /* #endif */
-    /* #if 'Table' in KERNEL_ELEC or 'GeneralizedBorn' in KERNEL_ELEC or 'Table' in KERNEL_VDW */
+    /* #if 'Table' in KERNEL_ELEC or 'Table' in KERNEL_VDW */
     __m128i          vfitab;
     __m128i          ifour       = _mm_set1_epi32(4);
     __m128           rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF;
@@ -229,14 +223,6 @@ void
      /*     #endif */
     /* #endif */
 
-    /* #if KERNEL_ELEC=='GeneralizedBorn' */
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = _mm_set1_ps(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = _mm_set1_ps((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-    /* #endif */
-
     /* #if 'Water' in GEOMETRY_I */
     /* Setup water-specific parameters */
     inr              = nlist->iinr[0];
@@ -370,9 +356,6 @@ void
         /*     #for I in PARTICLES_ELEC_I */
         iq{I}              = _mm_mul_ps(facel,_mm_load1_ps(charge+inr+{I}));
         /*         #define OUTERFLOPS OUTERFLOPS+1 */
-        /*         #if KERNEL_ELEC=='GeneralizedBorn' */
-        isai{I}            = _mm_load1_ps(invsqrta+inr+{I});
-        /*         #endif */
         /*     #endfor */
         /*     #for I in PARTICLES_VDW_I */
         vdwioffset{I}      = 2*nvdwtype*vdwtype[inr+{I}];
@@ -384,16 +367,10 @@ void
         /*     #if KERNEL_ELEC != 'None' */
         velecsum         = _mm_setzero_ps();
         /*     #endif */
-        /*     #if 'GeneralizedBorn' in KERNEL_ELEC */
-        vgbsum           = _mm_setzero_ps();
-        /*     #endif */
         /*     #if KERNEL_VDW != 'None' */
         vvdwsum          = _mm_setzero_ps();
         /*     #endif */
         /* #endif */
-        /*     #if 'GeneralizedBorn' in KERNEL_ELEC and 'Force' in KERNEL_VF */
-        dvdasum          = _mm_setzero_ps();
-        /*     #endif */
 
         /* #for ROUND in ['Loop','Epilogue'] */
 
@@ -498,10 +475,6 @@ void
             /*     #for J in PARTICLES_ELEC_J */
             jq{J}              = gmx_mm_load_4real_swizzle_ps(charge+jnrA+{J},charge+jnrB+{J},
                                                               charge+jnrC+{J},charge+jnrD+{J});
-            /*         #if KERNEL_ELEC=='GeneralizedBorn' */
-            isaj{J}            = gmx_mm_load_4real_swizzle_ps(invsqrta+jnrA+{J},invsqrta+jnrB+{J},
-                                                              invsqrta+jnrC+{J},invsqrta+jnrD+{J});
-            /*         #endif */
             /*     #endfor */
             /*     #for J in PARTICLES_VDW_J */
             vdwjidx{J}A        = 2*vdwtype[jnrA+{J}];
@@ -610,63 +583,6 @@ void
             /*                 #define INNERFLOPS INNERFLOPS+3 */
             /*             #endif */
 
-            /*         #elif KERNEL_ELEC=='GeneralizedBorn' */
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_ps(isai{I},isaj{J});
-            gbqqfactor       = _mm_xor_ps(signbit,_mm_mul_ps(qq{I}{J},_mm_mul_ps(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_ps(isaprod,gbtabscale);
-            /*             #define INNERFLOPS INNERFLOPS+5 */
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_ps(r{I}{J},gbscale);
-            gbitab           = _mm_cvttps_epi32(rt);
-            gbeps            = _mm_sub_ps(rt,_mm_cvtepi32_ps(gbitab));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,0) );
-            F                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,1) );
-            G                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,2) );
-            H                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm_mul_ps(gbeps,H);
-            Fp               = _mm_add_ps(F,_mm_mul_ps(gbeps,_mm_add_ps(G,Heps)));
-            VV               = _mm_add_ps(Y,_mm_mul_ps(gbeps,Fp));
-            vgb              = _mm_mul_ps(gbqqfactor,VV);
-            /*             #define INNERFLOPS INNERFLOPS+10 */
-
-            /*             #if 'Force' in KERNEL_VF */
-            FF               = _mm_add_ps(Fp,_mm_mul_ps(gbeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
-            fgb              = _mm_mul_ps(gbqqfactor,_mm_mul_ps(FF,gbscale));
-            dvdatmp          = _mm_mul_ps(minushalf,_mm_add_ps(vgb,_mm_mul_ps(fgb,r{I}{J})));
-            /*                 #if ROUND == 'Epilogue' */
-            dvdatmp          = _mm_andnot_ps(dummy_mask,dvdatmp);
-            /*                 #endif */
-            dvdasum          = _mm_add_ps(dvdasum,dvdatmp);
-            /*                 #if ROUND == 'Loop' */
-            fjptrA           = dvda+jnrA;
-            fjptrB           = dvda+jnrB;
-            fjptrC           = dvda+jnrC;
-            fjptrD           = dvda+jnrD;
-            /*                 #else */
-            /* The pointers to scratch make sure that this code with compilers that take gmx_restrict seriously (e.g. icc 13) really can't screw things up. */
-            fjptrA             = (jnrlistA>=0) ? dvda+jnrA : scratch;
-            fjptrB             = (jnrlistB>=0) ? dvda+jnrB : scratch;
-            fjptrC             = (jnrlistC>=0) ? dvda+jnrC : scratch;
-            fjptrD             = (jnrlistD>=0) ? dvda+jnrD : scratch;
-            /*                 #endif */
-            gmx_mm_increment_4real_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,_mm_mul_ps(dvdatmp,_mm_mul_ps(isaj{J},isaj{J})));
-            /*                 #define INNERFLOPS INNERFLOPS+13 */
-            /*             #endif */
-            velec            = _mm_mul_ps(qq{I}{J},rinv{I}{J});
-            /*                 #define INNERFLOPS INNERFLOPS+1 */
-            /*             #if 'Force' in KERNEL_VF */
-            felec            = _mm_mul_ps(_mm_sub_ps(_mm_mul_ps(velec,rinv{I}{J}),fgb),rinv{I}{J});
-            /*                 #define INNERFLOPS INNERFLOPS+3 */
-            /*             #endif */
-
             /*         #elif KERNEL_ELEC=='Ewald' */
             /* EWALD ELECTROSTATICS */
 
@@ -913,17 +829,6 @@ void
             /*             #endif */
             velecsum         = _mm_add_ps(velecsum,velec);
             /*             #define INNERFLOPS INNERFLOPS+1 */
-            /*             #if KERNEL_ELEC=='GeneralizedBorn' */
-            /*             #if 'exactcutoff' in INTERACTION_FLAGS[I][J] */
-            vgb              = _mm_and_ps(vgb,cutoff_mask);
-            /*                 #define INNERFLOPS INNERFLOPS+1 */
-            /*             #endif                                       */
-            /*             #if ROUND == 'Epilogue' */
-            vgb              = _mm_andnot_ps(dummy_mask,vgb);
-            /*             #endif */
-            vgbsum           = _mm_add_ps(vgbsum,vgb);
-            /*                 #define INNERFLOPS INNERFLOPS+1 */
-            /*             #endif */
             /*         #endif */
             /*         #if 'vdw' in INTERACTION_FLAGS[I][J] */
             /*     ## Note special check for TIP4P-TIP4P. Since we are cutting of all hydrogen interactions we also cut the LJ-only O-O interaction */
@@ -1075,19 +980,11 @@ void
         gmx_mm_update_1pot_ps(velecsum,kernel_data->energygrp_elec+ggid);
         /*         #define OUTERFLOPS OUTERFLOPS+1 */
         /*     #endif */
-        /*     #if 'GeneralizedBorn' in KERNEL_ELEC */
-        gmx_mm_update_1pot_ps(vgbsum,kernel_data->energygrp_polarization+ggid);
-        /*         #define OUTERFLOPS OUTERFLOPS+1 */
-        /*     #endif */
         /*     #if KERNEL_VDW != 'None' */
         gmx_mm_update_1pot_ps(vvdwsum,kernel_data->energygrp_vdw+ggid);
         /*         #define OUTERFLOPS OUTERFLOPS+1 */
         /*     #endif */
         /* #endif */
-        /*     #if 'GeneralizedBorn' in KERNEL_ELEC and 'Force' in KERNEL_VF */
-        dvdasum = _mm_mul_ps(dvdasum, _mm_mul_ps(isai{I},isai{I}));
-        gmx_mm_update_1pot_ps(dvdasum,dvda+inr);
-        /*     #endif */
 
         /* Increment number of inner iterations */
         inneriter                  += j_index_end - j_index_start;
index f534eab25ef5dbda789ef246363c88fd3665a3cd..89e572f85aa3b45e15469e19d15fccab2abb67de 100755 (executable)
@@ -105,7 +105,6 @@ ElectrostaticsList = {
     'None'                    : [],
     'Coulomb'                 : ['rinv','rinvsq'],
     'ReactionField'           : ['rinv','rinvsq'],
-    'GeneralizedBorn'         : ['rinv','r'],
     'CubicSplineTable'        : ['rinv','r','table'],
     'Ewald'                   : ['rinv','rinvsq','r'],
 }
@@ -190,7 +189,6 @@ Abbreviation = {
     'Coulomb'                 : 'Coul',
     'Ewald'                   : 'Ew',
     'ReactionField'           : 'RF',
-    'GeneralizedBorn'         : 'GB',
     'CubicSplineTable'        : 'CSTab',
     'LennardJones'            : 'LJ',
     'Buckingham'              : 'Bham',
@@ -269,7 +267,7 @@ def KeepKernel(KernelElec,KernelElecMod,KernelVdw,KernelVdwMod,KernelGeom,Kernel
         return 0
 
     # No need for LJ-only water optimization, or water optimization with implicit solvent.
-    if('Water' in KernelGeom[0] and (KernelElec=='None' or 'GeneralizedBorn' in KernelElec)):
+    if('Water' in KernelGeom[0] and KernelElec=='None'):
         return 0
 
     # Non-matching table settings are pointless
diff --git a/src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecGB_VdwCSTab_GeomP1P1_sse4_1_double.c b/src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecGB_VdwCSTab_GeomP1P1_sse4_1_double.c
deleted file mode 100644 (file)
index 316e11e..0000000
+++ /dev/null
@@ -1,838 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
- * and including many others, as listed in the AUTHORS file in the
- * top-level source directory and at http://www.gromacs.org.
- *
- * GROMACS is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * GROMACS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GROMACS; if not, see
- * http://www.gnu.org/licenses, or write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
- *
- * If you want to redistribute modifications to GROMACS, please
- * consider that scientific software is very special. Version
- * control is crucial - bugs must be traceable. We will be happy to
- * consider code for inclusion in the official distribution, but
- * derived work must not be called official GROMACS. Details are found
- * in the README & COPYING files - if they are missing, get the
- * official version at http://www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the research papers on the package. Check out http://www.gromacs.org.
- */
-/*
- * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
- */
-#include "gmxpre.h"
-
-#include "config.h"
-
-#include <math.h>
-
-#include "../nb_kernel.h"
-#include "gromacs/gmxlib/nrnb.h"
-
-#include "kernelutil_x86_sse4_1_double.h"
-
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_sse4_1_double
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            CubicSplineTable
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        PotentialAndForce
- */
-void
-nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_sse4_1_double
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
-     * just 0 for non-waters.
-     * Suffixes A,B refer to j loop unrolling done with SSE double precision, e.g. for the two different
-     * jnr indices corresponding to data put in the four positions in the SIMD register.
-     */
-    int              i_shift_offset,i_coord_offset,outeriter,inneriter;
-    int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
-    int              jnrA,jnrB;
-    int              j_coord_offsetA,j_coord_offsetB;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             rcutoff_scalar;
-    real             *shiftvec,*fshift,*x,*f;
-    __m128d          tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
-    int              vdwioffset0;
-    __m128d          ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0A,vdwjidx0B;
-    __m128d          jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    __m128d          dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
-    __m128d          velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    __m128i          gbitab;
-    __m128d          vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,dvdaj,gbeps,dvdatmp;
-    __m128d          minushalf = _mm_set1_pd(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    int              nvdwtype;
-    __m128d          rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
-    int              *vdwtype;
-    real             *vdwparam;
-    __m128d          one_sixth   = _mm_set1_pd(1.0/6.0);
-    __m128d          one_twelfth = _mm_set1_pd(1.0/12.0);
-    __m128i          vfitab;
-    __m128i          ifour       = _mm_set1_epi32(4);
-    __m128d          rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF;
-    real             *vftab;
-    __m128d          dummy_mask,cutoff_mask;
-    __m128d          signbit   = gmx_mm_castsi128_pd( _mm_set_epi32(0x80000000,0x00000000,0x80000000,0x00000000) );
-    __m128d          one     = _mm_set1_pd(1.0);
-    __m128d          two     = _mm_set1_pd(2.0);
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = _mm_set1_pd(fr->ic->epsfac);
-    charge           = mdatoms->chargeA;
-    nvdwtype         = fr->ntype;
-    vdwparam         = fr->nbfp;
-    vdwtype          = mdatoms->typeA;
-
-    vftab            = kernel_data->table_vdw->data;
-    vftabscale       = _mm_set1_pd(kernel_data->table_vdw->scale);
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = _mm_set1_pd(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = _mm_set1_pd((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-
-    /* Avoid stupid compiler warnings */
-    jnrA = jnrB = 0;
-    j_coord_offsetA = 0;
-    j_coord_offsetB = 0;
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        gmx_mm_load_shift_and_1rvec_broadcast_pd(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
-
-        fix0             = _mm_setzero_pd();
-        fiy0             = _mm_setzero_pd();
-        fiz0             = _mm_setzero_pd();
-
-        /* Load parameters for i particles */
-        iq0              = _mm_mul_pd(facel,_mm_load1_pd(charge+inr+0));
-        isai0            = _mm_load1_pd(invsqrta+inr+0);
-        vdwioffset0      = 2*nvdwtype*vdwtype[inr+0];
-
-        /* Reset potential sums */
-        velecsum         = _mm_setzero_pd();
-        vgbsum           = _mm_setzero_pd();
-        vvdwsum          = _mm_setzero_pd();
-        dvdasum          = _mm_setzero_pd();
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrA             = jjnr[jidx];
-            jnrB             = jjnr[jidx+1];
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_2ptr_swizzle_pd(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_pd(ix0,jx0);
-            dy00             = _mm_sub_pd(iy0,jy0);
-            dz00             = _mm_sub_pd(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_pd(dx00,dy00,dz00);
-
-            rinv00           = sse41_invsqrt_d(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm_load_2real_swizzle_pd(charge+jnrA+0,charge+jnrB+0);
-            isaj0            = gmx_mm_load_2real_swizzle_pd(invsqrta+jnrA+0,invsqrta+jnrB+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-            vdwjidx0B        = 2*vdwtype[jnrB+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_pd(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_pd(iq0,jq0);
-            gmx_mm_load_2pair_swizzle_pd(vdwparam+vdwioffset0+vdwjidx0A,
-                                         vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
-
-            /* Calculate table index by multiplying r with table scale and truncate to integer */
-            rt               = _mm_mul_pd(r00,vftabscale);
-            vfitab           = _mm_cvttpd_epi32(rt);
-            vfeps            = _mm_sub_pd(rt,_mm_round_pd(rt, _MM_FROUND_FLOOR));
-            vfitab           = _mm_slli_epi32(vfitab,3);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_pd(isai0,isaj0);
-            gbqqfactor       = _mm_xor_pd(signbit,_mm_mul_pd(qq00,_mm_mul_pd(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_pd(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_pd(r00,gbscale);
-            gbitab           = _mm_cvttpd_epi32(rt);
-            gbeps            = _mm_sub_pd(rt,_mm_round_pd(rt, _MM_FROUND_FLOOR));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,0) );
-            F                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,1) );
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,0) +2);
-            H                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,1) +2);
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Heps             = _mm_mul_pd(gbeps,H);
-            Fp               = _mm_add_pd(F,_mm_mul_pd(gbeps,_mm_add_pd(G,Heps)));
-            VV               = _mm_add_pd(Y,_mm_mul_pd(gbeps,Fp));
-            vgb              = _mm_mul_pd(gbqqfactor,VV);
-
-            FF               = _mm_add_pd(Fp,_mm_mul_pd(gbeps,_mm_add_pd(G,_mm_add_pd(Heps,Heps))));
-            fgb              = _mm_mul_pd(gbqqfactor,_mm_mul_pd(FF,gbscale));
-            dvdatmp          = _mm_mul_pd(minushalf,_mm_add_pd(vgb,_mm_mul_pd(fgb,r00)));
-            dvdasum          = _mm_add_pd(dvdasum,dvdatmp);
-            gmx_mm_increment_2real_swizzle_pd(dvda+jnrA,dvda+jnrB,_mm_mul_pd(dvdatmp,_mm_mul_pd(isaj0,isaj0)));
-            velec            = _mm_mul_pd(qq00,rinv00);
-            felec            = _mm_mul_pd(_mm_sub_pd(_mm_mul_pd(velec,rinv00),fgb),rinv00);
-
-            /* CUBIC SPLINE TABLE DISPERSION */
-            Y                = _mm_load_pd( vftab + gmx_mm_extract_epi32(vfitab,0) );
-            F                = _mm_load_pd( vftab + gmx_mm_extract_epi32(vfitab,1) );
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( vftab + gmx_mm_extract_epi32(vfitab,0) +2);
-            H                = _mm_load_pd( vftab + gmx_mm_extract_epi32(vfitab,1) +2);
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Heps             = _mm_mul_pd(vfeps,H);
-            Fp               = _mm_add_pd(F,_mm_mul_pd(vfeps,_mm_add_pd(G,Heps)));
-            VV               = _mm_add_pd(Y,_mm_mul_pd(vfeps,Fp));
-            vvdw6            = _mm_mul_pd(c6_00,VV);
-            FF               = _mm_add_pd(Fp,_mm_mul_pd(vfeps,_mm_add_pd(G,_mm_add_pd(Heps,Heps))));
-            fvdw6            = _mm_mul_pd(c6_00,FF);
-
-            /* CUBIC SPLINE TABLE REPULSION */
-            vfitab           = _mm_add_epi32(vfitab,ifour);
-            Y                = _mm_load_pd( vftab + gmx_mm_extract_epi32(vfitab,0) );
-            F                = _mm_load_pd( vftab + gmx_mm_extract_epi32(vfitab,1) );
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( vftab + gmx_mm_extract_epi32(vfitab,0) +2);
-            H                = _mm_load_pd( vftab + gmx_mm_extract_epi32(vfitab,1) +2);
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Heps             = _mm_mul_pd(vfeps,H);
-            Fp               = _mm_add_pd(F,_mm_mul_pd(vfeps,_mm_add_pd(G,Heps)));
-            VV               = _mm_add_pd(Y,_mm_mul_pd(vfeps,Fp));
-            vvdw12           = _mm_mul_pd(c12_00,VV);
-            FF               = _mm_add_pd(Fp,_mm_mul_pd(vfeps,_mm_add_pd(G,_mm_add_pd(Heps,Heps))));
-            fvdw12           = _mm_mul_pd(c12_00,FF);
-            vvdw             = _mm_add_pd(vvdw12,vvdw6);
-            fvdw             = _mm_xor_pd(signbit,_mm_mul_pd(_mm_add_pd(fvdw6,fvdw12),_mm_mul_pd(vftabscale,rinv00)));
-
-            /* Update potential sum for this i atom from the interaction with this j atom. */
-            velecsum         = _mm_add_pd(velecsum,velec);
-            vgbsum           = _mm_add_pd(vgbsum,vgb);
-            vvdwsum          = _mm_add_pd(vvdwsum,vvdw);
-
-            fscal            = _mm_add_pd(felec,fvdw);
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm_mul_pd(fscal,dx00);
-            ty               = _mm_mul_pd(fscal,dy00);
-            tz               = _mm_mul_pd(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm_add_pd(fix0,tx);
-            fiy0             = _mm_add_pd(fiy0,ty);
-            fiz0             = _mm_add_pd(fiz0,tz);
-
-            gmx_mm_decrement_1rvec_2ptr_swizzle_pd(f+j_coord_offsetA,f+j_coord_offsetB,tx,ty,tz);
-
-            /* Inner loop uses 92 flops */
-        }
-
-        if(jidx<j_index_end)
-        {
-
-            jnrA             = jjnr[jidx];
-            j_coord_offsetA  = DIM*jnrA;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_1ptr_swizzle_pd(x+j_coord_offsetA,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_pd(ix0,jx0);
-            dy00             = _mm_sub_pd(iy0,jy0);
-            dz00             = _mm_sub_pd(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_pd(dx00,dy00,dz00);
-
-            rinv00           = sse41_invsqrt_d(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = _mm_load_sd(charge+jnrA+0);
-            isaj0            = _mm_load_sd(invsqrta+jnrA+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_pd(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_pd(iq0,jq0);
-            gmx_mm_load_1pair_swizzle_pd(vdwparam+vdwioffset0+vdwjidx0A,&c6_00,&c12_00);
-
-            /* Calculate table index by multiplying r with table scale and truncate to integer */
-            rt               = _mm_mul_pd(r00,vftabscale);
-            vfitab           = _mm_cvttpd_epi32(rt);
-            vfeps            = _mm_sub_pd(rt,_mm_round_pd(rt, _MM_FROUND_FLOOR));
-            vfitab           = _mm_slli_epi32(vfitab,3);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_pd(isai0,isaj0);
-            gbqqfactor       = _mm_xor_pd(signbit,_mm_mul_pd(qq00,_mm_mul_pd(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_pd(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_pd(r00,gbscale);
-            gbitab           = _mm_cvttpd_epi32(rt);
-            gbeps            = _mm_sub_pd(rt,_mm_round_pd(rt, _MM_FROUND_FLOOR));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,0) );
-            F                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,0) +2);
-            H                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Heps             = _mm_mul_pd(gbeps,H);
-            Fp               = _mm_add_pd(F,_mm_mul_pd(gbeps,_mm_add_pd(G,Heps)));
-            VV               = _mm_add_pd(Y,_mm_mul_pd(gbeps,Fp));
-            vgb              = _mm_mul_pd(gbqqfactor,VV);
-
-            FF               = _mm_add_pd(Fp,_mm_mul_pd(gbeps,_mm_add_pd(G,_mm_add_pd(Heps,Heps))));
-            fgb              = _mm_mul_pd(gbqqfactor,_mm_mul_pd(FF,gbscale));
-            dvdatmp          = _mm_mul_pd(minushalf,_mm_add_pd(vgb,_mm_mul_pd(fgb,r00)));
-            dvdatmp          = _mm_unpacklo_pd(dvdatmp,_mm_setzero_pd());
-            dvdasum          = _mm_add_pd(dvdasum,dvdatmp);
-            gmx_mm_increment_1real_pd(dvda+jnrA,_mm_mul_pd(dvdatmp,_mm_mul_pd(isaj0,isaj0)));
-            velec            = _mm_mul_pd(qq00,rinv00);
-            felec            = _mm_mul_pd(_mm_sub_pd(_mm_mul_pd(velec,rinv00),fgb),rinv00);
-
-            /* CUBIC SPLINE TABLE DISPERSION */
-            Y                = _mm_load_pd( vftab + gmx_mm_extract_epi32(vfitab,0) );
-            F                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( vftab + gmx_mm_extract_epi32(vfitab,0) +2);
-            H                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Heps             = _mm_mul_pd(vfeps,H);
-            Fp               = _mm_add_pd(F,_mm_mul_pd(vfeps,_mm_add_pd(G,Heps)));
-            VV               = _mm_add_pd(Y,_mm_mul_pd(vfeps,Fp));
-            vvdw6            = _mm_mul_pd(c6_00,VV);
-            FF               = _mm_add_pd(Fp,_mm_mul_pd(vfeps,_mm_add_pd(G,_mm_add_pd(Heps,Heps))));
-            fvdw6            = _mm_mul_pd(c6_00,FF);
-
-            /* CUBIC SPLINE TABLE REPULSION */
-            vfitab           = _mm_add_epi32(vfitab,ifour);
-            Y                = _mm_load_pd( vftab + gmx_mm_extract_epi32(vfitab,0) );
-            F                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( vftab + gmx_mm_extract_epi32(vfitab,0) +2);
-            H                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Heps             = _mm_mul_pd(vfeps,H);
-            Fp               = _mm_add_pd(F,_mm_mul_pd(vfeps,_mm_add_pd(G,Heps)));
-            VV               = _mm_add_pd(Y,_mm_mul_pd(vfeps,Fp));
-            vvdw12           = _mm_mul_pd(c12_00,VV);
-            FF               = _mm_add_pd(Fp,_mm_mul_pd(vfeps,_mm_add_pd(G,_mm_add_pd(Heps,Heps))));
-            fvdw12           = _mm_mul_pd(c12_00,FF);
-            vvdw             = _mm_add_pd(vvdw12,vvdw6);
-            fvdw             = _mm_xor_pd(signbit,_mm_mul_pd(_mm_add_pd(fvdw6,fvdw12),_mm_mul_pd(vftabscale,rinv00)));
-
-            /* Update potential sum for this i atom from the interaction with this j atom. */
-            velec            = _mm_unpacklo_pd(velec,_mm_setzero_pd());
-            velecsum         = _mm_add_pd(velecsum,velec);
-            vgb              = _mm_unpacklo_pd(vgb,_mm_setzero_pd());
-            vgbsum           = _mm_add_pd(vgbsum,vgb);
-            vvdw             = _mm_unpacklo_pd(vvdw,_mm_setzero_pd());
-            vvdwsum          = _mm_add_pd(vvdwsum,vvdw);
-
-            fscal            = _mm_add_pd(felec,fvdw);
-
-            fscal            = _mm_unpacklo_pd(fscal,_mm_setzero_pd());
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm_mul_pd(fscal,dx00);
-            ty               = _mm_mul_pd(fscal,dy00);
-            tz               = _mm_mul_pd(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm_add_pd(fix0,tx);
-            fiy0             = _mm_add_pd(fiy0,ty);
-            fiz0             = _mm_add_pd(fiz0,tz);
-
-            gmx_mm_decrement_1rvec_1ptr_swizzle_pd(f+j_coord_offsetA,tx,ty,tz);
-
-            /* Inner loop uses 92 flops */
-        }
-
-        /* End of innermost loop */
-
-        gmx_mm_update_iforce_1atom_swizzle_pd(fix0,fiy0,fiz0,
-                                              f+i_coord_offset,fshift+i_shift_offset);
-
-        ggid                        = gid[iidx];
-        /* Update potential energies */
-        gmx_mm_update_1pot_pd(velecsum,kernel_data->energygrp_elec+ggid);
-        gmx_mm_update_1pot_pd(vgbsum,kernel_data->energygrp_polarization+ggid);
-        gmx_mm_update_1pot_pd(vvdwsum,kernel_data->energygrp_vdw+ggid);
-        dvdasum = _mm_mul_pd(dvdasum, _mm_mul_pd(isai0,isai0));
-        gmx_mm_update_1pot_pd(dvdasum,dvda+inr);
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 10 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_VF,outeriter*10 + inneriter*92);
-}
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_sse4_1_double
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            CubicSplineTable
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        Force
- */
-void
-nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_sse4_1_double
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
-     * just 0 for non-waters.
-     * Suffixes A,B refer to j loop unrolling done with SSE double precision, e.g. for the two different
-     * jnr indices corresponding to data put in the four positions in the SIMD register.
-     */
-    int              i_shift_offset,i_coord_offset,outeriter,inneriter;
-    int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
-    int              jnrA,jnrB;
-    int              j_coord_offsetA,j_coord_offsetB;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             rcutoff_scalar;
-    real             *shiftvec,*fshift,*x,*f;
-    __m128d          tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
-    int              vdwioffset0;
-    __m128d          ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0A,vdwjidx0B;
-    __m128d          jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    __m128d          dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
-    __m128d          velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    __m128i          gbitab;
-    __m128d          vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,dvdaj,gbeps,dvdatmp;
-    __m128d          minushalf = _mm_set1_pd(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    int              nvdwtype;
-    __m128d          rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
-    int              *vdwtype;
-    real             *vdwparam;
-    __m128d          one_sixth   = _mm_set1_pd(1.0/6.0);
-    __m128d          one_twelfth = _mm_set1_pd(1.0/12.0);
-    __m128i          vfitab;
-    __m128i          ifour       = _mm_set1_epi32(4);
-    __m128d          rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF;
-    real             *vftab;
-    __m128d          dummy_mask,cutoff_mask;
-    __m128d          signbit   = gmx_mm_castsi128_pd( _mm_set_epi32(0x80000000,0x00000000,0x80000000,0x00000000) );
-    __m128d          one     = _mm_set1_pd(1.0);
-    __m128d          two     = _mm_set1_pd(2.0);
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = _mm_set1_pd(fr->ic->epsfac);
-    charge           = mdatoms->chargeA;
-    nvdwtype         = fr->ntype;
-    vdwparam         = fr->nbfp;
-    vdwtype          = mdatoms->typeA;
-
-    vftab            = kernel_data->table_vdw->data;
-    vftabscale       = _mm_set1_pd(kernel_data->table_vdw->scale);
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = _mm_set1_pd(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = _mm_set1_pd((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-
-    /* Avoid stupid compiler warnings */
-    jnrA = jnrB = 0;
-    j_coord_offsetA = 0;
-    j_coord_offsetB = 0;
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        gmx_mm_load_shift_and_1rvec_broadcast_pd(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
-
-        fix0             = _mm_setzero_pd();
-        fiy0             = _mm_setzero_pd();
-        fiz0             = _mm_setzero_pd();
-
-        /* Load parameters for i particles */
-        iq0              = _mm_mul_pd(facel,_mm_load1_pd(charge+inr+0));
-        isai0            = _mm_load1_pd(invsqrta+inr+0);
-        vdwioffset0      = 2*nvdwtype*vdwtype[inr+0];
-
-        dvdasum          = _mm_setzero_pd();
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrA             = jjnr[jidx];
-            jnrB             = jjnr[jidx+1];
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_2ptr_swizzle_pd(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_pd(ix0,jx0);
-            dy00             = _mm_sub_pd(iy0,jy0);
-            dz00             = _mm_sub_pd(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_pd(dx00,dy00,dz00);
-
-            rinv00           = sse41_invsqrt_d(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm_load_2real_swizzle_pd(charge+jnrA+0,charge+jnrB+0);
-            isaj0            = gmx_mm_load_2real_swizzle_pd(invsqrta+jnrA+0,invsqrta+jnrB+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-            vdwjidx0B        = 2*vdwtype[jnrB+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_pd(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_pd(iq0,jq0);
-            gmx_mm_load_2pair_swizzle_pd(vdwparam+vdwioffset0+vdwjidx0A,
-                                         vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
-
-            /* Calculate table index by multiplying r with table scale and truncate to integer */
-            rt               = _mm_mul_pd(r00,vftabscale);
-            vfitab           = _mm_cvttpd_epi32(rt);
-            vfeps            = _mm_sub_pd(rt,_mm_round_pd(rt, _MM_FROUND_FLOOR));
-            vfitab           = _mm_slli_epi32(vfitab,3);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_pd(isai0,isaj0);
-            gbqqfactor       = _mm_xor_pd(signbit,_mm_mul_pd(qq00,_mm_mul_pd(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_pd(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_pd(r00,gbscale);
-            gbitab           = _mm_cvttpd_epi32(rt);
-            gbeps            = _mm_sub_pd(rt,_mm_round_pd(rt, _MM_FROUND_FLOOR));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,0) );
-            F                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,1) );
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,0) +2);
-            H                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,1) +2);
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Heps             = _mm_mul_pd(gbeps,H);
-            Fp               = _mm_add_pd(F,_mm_mul_pd(gbeps,_mm_add_pd(G,Heps)));
-            VV               = _mm_add_pd(Y,_mm_mul_pd(gbeps,Fp));
-            vgb              = _mm_mul_pd(gbqqfactor,VV);
-
-            FF               = _mm_add_pd(Fp,_mm_mul_pd(gbeps,_mm_add_pd(G,_mm_add_pd(Heps,Heps))));
-            fgb              = _mm_mul_pd(gbqqfactor,_mm_mul_pd(FF,gbscale));
-            dvdatmp          = _mm_mul_pd(minushalf,_mm_add_pd(vgb,_mm_mul_pd(fgb,r00)));
-            dvdasum          = _mm_add_pd(dvdasum,dvdatmp);
-            gmx_mm_increment_2real_swizzle_pd(dvda+jnrA,dvda+jnrB,_mm_mul_pd(dvdatmp,_mm_mul_pd(isaj0,isaj0)));
-            velec            = _mm_mul_pd(qq00,rinv00);
-            felec            = _mm_mul_pd(_mm_sub_pd(_mm_mul_pd(velec,rinv00),fgb),rinv00);
-
-            /* CUBIC SPLINE TABLE DISPERSION */
-            Y                = _mm_load_pd( vftab + gmx_mm_extract_epi32(vfitab,0) );
-            F                = _mm_load_pd( vftab + gmx_mm_extract_epi32(vfitab,1) );
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( vftab + gmx_mm_extract_epi32(vfitab,0) +2);
-            H                = _mm_load_pd( vftab + gmx_mm_extract_epi32(vfitab,1) +2);
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Heps             = _mm_mul_pd(vfeps,H);
-            Fp               = _mm_add_pd(F,_mm_mul_pd(vfeps,_mm_add_pd(G,Heps)));
-            FF               = _mm_add_pd(Fp,_mm_mul_pd(vfeps,_mm_add_pd(G,_mm_add_pd(Heps,Heps))));
-            fvdw6            = _mm_mul_pd(c6_00,FF);
-
-            /* CUBIC SPLINE TABLE REPULSION */
-            vfitab           = _mm_add_epi32(vfitab,ifour);
-            Y                = _mm_load_pd( vftab + gmx_mm_extract_epi32(vfitab,0) );
-            F                = _mm_load_pd( vftab + gmx_mm_extract_epi32(vfitab,1) );
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( vftab + gmx_mm_extract_epi32(vfitab,0) +2);
-            H                = _mm_load_pd( vftab + gmx_mm_extract_epi32(vfitab,1) +2);
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Heps             = _mm_mul_pd(vfeps,H);
-            Fp               = _mm_add_pd(F,_mm_mul_pd(vfeps,_mm_add_pd(G,Heps)));
-            FF               = _mm_add_pd(Fp,_mm_mul_pd(vfeps,_mm_add_pd(G,_mm_add_pd(Heps,Heps))));
-            fvdw12           = _mm_mul_pd(c12_00,FF);
-            fvdw             = _mm_xor_pd(signbit,_mm_mul_pd(_mm_add_pd(fvdw6,fvdw12),_mm_mul_pd(vftabscale,rinv00)));
-
-            fscal            = _mm_add_pd(felec,fvdw);
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm_mul_pd(fscal,dx00);
-            ty               = _mm_mul_pd(fscal,dy00);
-            tz               = _mm_mul_pd(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm_add_pd(fix0,tx);
-            fiy0             = _mm_add_pd(fiy0,ty);
-            fiz0             = _mm_add_pd(fiz0,tz);
-
-            gmx_mm_decrement_1rvec_2ptr_swizzle_pd(f+j_coord_offsetA,f+j_coord_offsetB,tx,ty,tz);
-
-            /* Inner loop uses 82 flops */
-        }
-
-        if(jidx<j_index_end)
-        {
-
-            jnrA             = jjnr[jidx];
-            j_coord_offsetA  = DIM*jnrA;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_1ptr_swizzle_pd(x+j_coord_offsetA,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_pd(ix0,jx0);
-            dy00             = _mm_sub_pd(iy0,jy0);
-            dz00             = _mm_sub_pd(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_pd(dx00,dy00,dz00);
-
-            rinv00           = sse41_invsqrt_d(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = _mm_load_sd(charge+jnrA+0);
-            isaj0            = _mm_load_sd(invsqrta+jnrA+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_pd(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_pd(iq0,jq0);
-            gmx_mm_load_1pair_swizzle_pd(vdwparam+vdwioffset0+vdwjidx0A,&c6_00,&c12_00);
-
-            /* Calculate table index by multiplying r with table scale and truncate to integer */
-            rt               = _mm_mul_pd(r00,vftabscale);
-            vfitab           = _mm_cvttpd_epi32(rt);
-            vfeps            = _mm_sub_pd(rt,_mm_round_pd(rt, _MM_FROUND_FLOOR));
-            vfitab           = _mm_slli_epi32(vfitab,3);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_pd(isai0,isaj0);
-            gbqqfactor       = _mm_xor_pd(signbit,_mm_mul_pd(qq00,_mm_mul_pd(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_pd(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_pd(r00,gbscale);
-            gbitab           = _mm_cvttpd_epi32(rt);
-            gbeps            = _mm_sub_pd(rt,_mm_round_pd(rt, _MM_FROUND_FLOOR));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,0) );
-            F                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,0) +2);
-            H                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Heps             = _mm_mul_pd(gbeps,H);
-            Fp               = _mm_add_pd(F,_mm_mul_pd(gbeps,_mm_add_pd(G,Heps)));
-            VV               = _mm_add_pd(Y,_mm_mul_pd(gbeps,Fp));
-            vgb              = _mm_mul_pd(gbqqfactor,VV);
-
-            FF               = _mm_add_pd(Fp,_mm_mul_pd(gbeps,_mm_add_pd(G,_mm_add_pd(Heps,Heps))));
-            fgb              = _mm_mul_pd(gbqqfactor,_mm_mul_pd(FF,gbscale));
-            dvdatmp          = _mm_mul_pd(minushalf,_mm_add_pd(vgb,_mm_mul_pd(fgb,r00)));
-            dvdatmp          = _mm_unpacklo_pd(dvdatmp,_mm_setzero_pd());
-            dvdasum          = _mm_add_pd(dvdasum,dvdatmp);
-            gmx_mm_increment_1real_pd(dvda+jnrA,_mm_mul_pd(dvdatmp,_mm_mul_pd(isaj0,isaj0)));
-            velec            = _mm_mul_pd(qq00,rinv00);
-            felec            = _mm_mul_pd(_mm_sub_pd(_mm_mul_pd(velec,rinv00),fgb),rinv00);
-
-            /* CUBIC SPLINE TABLE DISPERSION */
-            Y                = _mm_load_pd( vftab + gmx_mm_extract_epi32(vfitab,0) );
-            F                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( vftab + gmx_mm_extract_epi32(vfitab,0) +2);
-            H                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Heps             = _mm_mul_pd(vfeps,H);
-            Fp               = _mm_add_pd(F,_mm_mul_pd(vfeps,_mm_add_pd(G,Heps)));
-            FF               = _mm_add_pd(Fp,_mm_mul_pd(vfeps,_mm_add_pd(G,_mm_add_pd(Heps,Heps))));
-            fvdw6            = _mm_mul_pd(c6_00,FF);
-
-            /* CUBIC SPLINE TABLE REPULSION */
-            vfitab           = _mm_add_epi32(vfitab,ifour);
-            Y                = _mm_load_pd( vftab + gmx_mm_extract_epi32(vfitab,0) );
-            F                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( vftab + gmx_mm_extract_epi32(vfitab,0) +2);
-            H                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Heps             = _mm_mul_pd(vfeps,H);
-            Fp               = _mm_add_pd(F,_mm_mul_pd(vfeps,_mm_add_pd(G,Heps)));
-            FF               = _mm_add_pd(Fp,_mm_mul_pd(vfeps,_mm_add_pd(G,_mm_add_pd(Heps,Heps))));
-            fvdw12           = _mm_mul_pd(c12_00,FF);
-            fvdw             = _mm_xor_pd(signbit,_mm_mul_pd(_mm_add_pd(fvdw6,fvdw12),_mm_mul_pd(vftabscale,rinv00)));
-
-            fscal            = _mm_add_pd(felec,fvdw);
-
-            fscal            = _mm_unpacklo_pd(fscal,_mm_setzero_pd());
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm_mul_pd(fscal,dx00);
-            ty               = _mm_mul_pd(fscal,dy00);
-            tz               = _mm_mul_pd(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm_add_pd(fix0,tx);
-            fiy0             = _mm_add_pd(fiy0,ty);
-            fiz0             = _mm_add_pd(fiz0,tz);
-
-            gmx_mm_decrement_1rvec_1ptr_swizzle_pd(f+j_coord_offsetA,tx,ty,tz);
-
-            /* Inner loop uses 82 flops */
-        }
-
-        /* End of innermost loop */
-
-        gmx_mm_update_iforce_1atom_swizzle_pd(fix0,fiy0,fiz0,
-                                              f+i_coord_offset,fshift+i_shift_offset);
-
-        dvdasum = _mm_mul_pd(dvdasum, _mm_mul_pd(isai0,isai0));
-        gmx_mm_update_1pot_pd(dvdasum,dvda+inr);
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 7 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_F,outeriter*7 + inneriter*82);
-}
diff --git a/src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecGB_VdwLJ_GeomP1P1_sse4_1_double.c b/src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecGB_VdwLJ_GeomP1P1_sse4_1_double.c
deleted file mode 100644 (file)
index 3a00b01..0000000
+++ /dev/null
@@ -1,728 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
- * and including many others, as listed in the AUTHORS file in the
- * top-level source directory and at http://www.gromacs.org.
- *
- * GROMACS is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * GROMACS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GROMACS; if not, see
- * http://www.gnu.org/licenses, or write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
- *
- * If you want to redistribute modifications to GROMACS, please
- * consider that scientific software is very special. Version
- * control is crucial - bugs must be traceable. We will be happy to
- * consider code for inclusion in the official distribution, but
- * derived work must not be called official GROMACS. Details are found
- * in the README & COPYING files - if they are missing, get the
- * official version at http://www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the research papers on the package. Check out http://www.gromacs.org.
- */
-/*
- * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
- */
-#include "gmxpre.h"
-
-#include "config.h"
-
-#include <math.h>
-
-#include "../nb_kernel.h"
-#include "gromacs/gmxlib/nrnb.h"
-
-#include "kernelutil_x86_sse4_1_double.h"
-
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_sse4_1_double
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            LennardJones
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        PotentialAndForce
- */
-void
-nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_sse4_1_double
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
-     * just 0 for non-waters.
-     * Suffixes A,B refer to j loop unrolling done with SSE double precision, e.g. for the two different
-     * jnr indices corresponding to data put in the four positions in the SIMD register.
-     */
-    int              i_shift_offset,i_coord_offset,outeriter,inneriter;
-    int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
-    int              jnrA,jnrB;
-    int              j_coord_offsetA,j_coord_offsetB;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             rcutoff_scalar;
-    real             *shiftvec,*fshift,*x,*f;
-    __m128d          tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
-    int              vdwioffset0;
-    __m128d          ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0A,vdwjidx0B;
-    __m128d          jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    __m128d          dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
-    __m128d          velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    __m128i          gbitab;
-    __m128d          vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,dvdaj,gbeps,dvdatmp;
-    __m128d          minushalf = _mm_set1_pd(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    int              nvdwtype;
-    __m128d          rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
-    int              *vdwtype;
-    real             *vdwparam;
-    __m128d          one_sixth   = _mm_set1_pd(1.0/6.0);
-    __m128d          one_twelfth = _mm_set1_pd(1.0/12.0);
-    __m128i          vfitab;
-    __m128i          ifour       = _mm_set1_epi32(4);
-    __m128d          rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF;
-    real             *vftab;
-    __m128d          dummy_mask,cutoff_mask;
-    __m128d          signbit   = gmx_mm_castsi128_pd( _mm_set_epi32(0x80000000,0x00000000,0x80000000,0x00000000) );
-    __m128d          one     = _mm_set1_pd(1.0);
-    __m128d          two     = _mm_set1_pd(2.0);
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = _mm_set1_pd(fr->ic->epsfac);
-    charge           = mdatoms->chargeA;
-    nvdwtype         = fr->ntype;
-    vdwparam         = fr->nbfp;
-    vdwtype          = mdatoms->typeA;
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = _mm_set1_pd(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = _mm_set1_pd((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-
-    /* Avoid stupid compiler warnings */
-    jnrA = jnrB = 0;
-    j_coord_offsetA = 0;
-    j_coord_offsetB = 0;
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        gmx_mm_load_shift_and_1rvec_broadcast_pd(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
-
-        fix0             = _mm_setzero_pd();
-        fiy0             = _mm_setzero_pd();
-        fiz0             = _mm_setzero_pd();
-
-        /* Load parameters for i particles */
-        iq0              = _mm_mul_pd(facel,_mm_load1_pd(charge+inr+0));
-        isai0            = _mm_load1_pd(invsqrta+inr+0);
-        vdwioffset0      = 2*nvdwtype*vdwtype[inr+0];
-
-        /* Reset potential sums */
-        velecsum         = _mm_setzero_pd();
-        vgbsum           = _mm_setzero_pd();
-        vvdwsum          = _mm_setzero_pd();
-        dvdasum          = _mm_setzero_pd();
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrA             = jjnr[jidx];
-            jnrB             = jjnr[jidx+1];
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_2ptr_swizzle_pd(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_pd(ix0,jx0);
-            dy00             = _mm_sub_pd(iy0,jy0);
-            dz00             = _mm_sub_pd(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_pd(dx00,dy00,dz00);
-
-            rinv00           = sse41_invsqrt_d(rsq00);
-
-            rinvsq00         = _mm_mul_pd(rinv00,rinv00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm_load_2real_swizzle_pd(charge+jnrA+0,charge+jnrB+0);
-            isaj0            = gmx_mm_load_2real_swizzle_pd(invsqrta+jnrA+0,invsqrta+jnrB+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-            vdwjidx0B        = 2*vdwtype[jnrB+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_pd(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_pd(iq0,jq0);
-            gmx_mm_load_2pair_swizzle_pd(vdwparam+vdwioffset0+vdwjidx0A,
-                                         vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_pd(isai0,isaj0);
-            gbqqfactor       = _mm_xor_pd(signbit,_mm_mul_pd(qq00,_mm_mul_pd(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_pd(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_pd(r00,gbscale);
-            gbitab           = _mm_cvttpd_epi32(rt);
-            gbeps            = _mm_sub_pd(rt,_mm_round_pd(rt, _MM_FROUND_FLOOR));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,0) );
-            F                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,1) );
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,0) +2);
-            H                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,1) +2);
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Heps             = _mm_mul_pd(gbeps,H);
-            Fp               = _mm_add_pd(F,_mm_mul_pd(gbeps,_mm_add_pd(G,Heps)));
-            VV               = _mm_add_pd(Y,_mm_mul_pd(gbeps,Fp));
-            vgb              = _mm_mul_pd(gbqqfactor,VV);
-
-            FF               = _mm_add_pd(Fp,_mm_mul_pd(gbeps,_mm_add_pd(G,_mm_add_pd(Heps,Heps))));
-            fgb              = _mm_mul_pd(gbqqfactor,_mm_mul_pd(FF,gbscale));
-            dvdatmp          = _mm_mul_pd(minushalf,_mm_add_pd(vgb,_mm_mul_pd(fgb,r00)));
-            dvdasum          = _mm_add_pd(dvdasum,dvdatmp);
-            gmx_mm_increment_2real_swizzle_pd(dvda+jnrA,dvda+jnrB,_mm_mul_pd(dvdatmp,_mm_mul_pd(isaj0,isaj0)));
-            velec            = _mm_mul_pd(qq00,rinv00);
-            felec            = _mm_mul_pd(_mm_sub_pd(_mm_mul_pd(velec,rinv00),fgb),rinv00);
-
-            /* LENNARD-JONES DISPERSION/REPULSION */
-
-            rinvsix          = _mm_mul_pd(_mm_mul_pd(rinvsq00,rinvsq00),rinvsq00);
-            vvdw6            = _mm_mul_pd(c6_00,rinvsix);
-            vvdw12           = _mm_mul_pd(c12_00,_mm_mul_pd(rinvsix,rinvsix));
-            vvdw             = _mm_sub_pd( _mm_mul_pd(vvdw12,one_twelfth) , _mm_mul_pd(vvdw6,one_sixth) );
-            fvdw             = _mm_mul_pd(_mm_sub_pd(vvdw12,vvdw6),rinvsq00);
-
-            /* Update potential sum for this i atom from the interaction with this j atom. */
-            velecsum         = _mm_add_pd(velecsum,velec);
-            vgbsum           = _mm_add_pd(vgbsum,vgb);
-            vvdwsum          = _mm_add_pd(vvdwsum,vvdw);
-
-            fscal            = _mm_add_pd(felec,fvdw);
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm_mul_pd(fscal,dx00);
-            ty               = _mm_mul_pd(fscal,dy00);
-            tz               = _mm_mul_pd(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm_add_pd(fix0,tx);
-            fiy0             = _mm_add_pd(fiy0,ty);
-            fiz0             = _mm_add_pd(fiz0,tz);
-
-            gmx_mm_decrement_1rvec_2ptr_swizzle_pd(f+j_coord_offsetA,f+j_coord_offsetB,tx,ty,tz);
-
-            /* Inner loop uses 71 flops */
-        }
-
-        if(jidx<j_index_end)
-        {
-
-            jnrA             = jjnr[jidx];
-            j_coord_offsetA  = DIM*jnrA;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_1ptr_swizzle_pd(x+j_coord_offsetA,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_pd(ix0,jx0);
-            dy00             = _mm_sub_pd(iy0,jy0);
-            dz00             = _mm_sub_pd(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_pd(dx00,dy00,dz00);
-
-            rinv00           = sse41_invsqrt_d(rsq00);
-
-            rinvsq00         = _mm_mul_pd(rinv00,rinv00);
-
-            /* Load parameters for j particles */
-            jq0              = _mm_load_sd(charge+jnrA+0);
-            isaj0            = _mm_load_sd(invsqrta+jnrA+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_pd(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_pd(iq0,jq0);
-            gmx_mm_load_1pair_swizzle_pd(vdwparam+vdwioffset0+vdwjidx0A,&c6_00,&c12_00);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_pd(isai0,isaj0);
-            gbqqfactor       = _mm_xor_pd(signbit,_mm_mul_pd(qq00,_mm_mul_pd(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_pd(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_pd(r00,gbscale);
-            gbitab           = _mm_cvttpd_epi32(rt);
-            gbeps            = _mm_sub_pd(rt,_mm_round_pd(rt, _MM_FROUND_FLOOR));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,0) );
-            F                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,0) +2);
-            H                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Heps             = _mm_mul_pd(gbeps,H);
-            Fp               = _mm_add_pd(F,_mm_mul_pd(gbeps,_mm_add_pd(G,Heps)));
-            VV               = _mm_add_pd(Y,_mm_mul_pd(gbeps,Fp));
-            vgb              = _mm_mul_pd(gbqqfactor,VV);
-
-            FF               = _mm_add_pd(Fp,_mm_mul_pd(gbeps,_mm_add_pd(G,_mm_add_pd(Heps,Heps))));
-            fgb              = _mm_mul_pd(gbqqfactor,_mm_mul_pd(FF,gbscale));
-            dvdatmp          = _mm_mul_pd(minushalf,_mm_add_pd(vgb,_mm_mul_pd(fgb,r00)));
-            dvdatmp          = _mm_unpacklo_pd(dvdatmp,_mm_setzero_pd());
-            dvdasum          = _mm_add_pd(dvdasum,dvdatmp);
-            gmx_mm_increment_1real_pd(dvda+jnrA,_mm_mul_pd(dvdatmp,_mm_mul_pd(isaj0,isaj0)));
-            velec            = _mm_mul_pd(qq00,rinv00);
-            felec            = _mm_mul_pd(_mm_sub_pd(_mm_mul_pd(velec,rinv00),fgb),rinv00);
-
-            /* LENNARD-JONES DISPERSION/REPULSION */
-
-            rinvsix          = _mm_mul_pd(_mm_mul_pd(rinvsq00,rinvsq00),rinvsq00);
-            vvdw6            = _mm_mul_pd(c6_00,rinvsix);
-            vvdw12           = _mm_mul_pd(c12_00,_mm_mul_pd(rinvsix,rinvsix));
-            vvdw             = _mm_sub_pd( _mm_mul_pd(vvdw12,one_twelfth) , _mm_mul_pd(vvdw6,one_sixth) );
-            fvdw             = _mm_mul_pd(_mm_sub_pd(vvdw12,vvdw6),rinvsq00);
-
-            /* Update potential sum for this i atom from the interaction with this j atom. */
-            velec            = _mm_unpacklo_pd(velec,_mm_setzero_pd());
-            velecsum         = _mm_add_pd(velecsum,velec);
-            vgb              = _mm_unpacklo_pd(vgb,_mm_setzero_pd());
-            vgbsum           = _mm_add_pd(vgbsum,vgb);
-            vvdw             = _mm_unpacklo_pd(vvdw,_mm_setzero_pd());
-            vvdwsum          = _mm_add_pd(vvdwsum,vvdw);
-
-            fscal            = _mm_add_pd(felec,fvdw);
-
-            fscal            = _mm_unpacklo_pd(fscal,_mm_setzero_pd());
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm_mul_pd(fscal,dx00);
-            ty               = _mm_mul_pd(fscal,dy00);
-            tz               = _mm_mul_pd(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm_add_pd(fix0,tx);
-            fiy0             = _mm_add_pd(fiy0,ty);
-            fiz0             = _mm_add_pd(fiz0,tz);
-
-            gmx_mm_decrement_1rvec_1ptr_swizzle_pd(f+j_coord_offsetA,tx,ty,tz);
-
-            /* Inner loop uses 71 flops */
-        }
-
-        /* End of innermost loop */
-
-        gmx_mm_update_iforce_1atom_swizzle_pd(fix0,fiy0,fiz0,
-                                              f+i_coord_offset,fshift+i_shift_offset);
-
-        ggid                        = gid[iidx];
-        /* Update potential energies */
-        gmx_mm_update_1pot_pd(velecsum,kernel_data->energygrp_elec+ggid);
-        gmx_mm_update_1pot_pd(vgbsum,kernel_data->energygrp_polarization+ggid);
-        gmx_mm_update_1pot_pd(vvdwsum,kernel_data->energygrp_vdw+ggid);
-        dvdasum = _mm_mul_pd(dvdasum, _mm_mul_pd(isai0,isai0));
-        gmx_mm_update_1pot_pd(dvdasum,dvda+inr);
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 10 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_VF,outeriter*10 + inneriter*71);
-}
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_sse4_1_double
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            LennardJones
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        Force
- */
-void
-nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_sse4_1_double
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
-     * just 0 for non-waters.
-     * Suffixes A,B refer to j loop unrolling done with SSE double precision, e.g. for the two different
-     * jnr indices corresponding to data put in the four positions in the SIMD register.
-     */
-    int              i_shift_offset,i_coord_offset,outeriter,inneriter;
-    int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
-    int              jnrA,jnrB;
-    int              j_coord_offsetA,j_coord_offsetB;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             rcutoff_scalar;
-    real             *shiftvec,*fshift,*x,*f;
-    __m128d          tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
-    int              vdwioffset0;
-    __m128d          ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0A,vdwjidx0B;
-    __m128d          jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    __m128d          dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
-    __m128d          velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    __m128i          gbitab;
-    __m128d          vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,dvdaj,gbeps,dvdatmp;
-    __m128d          minushalf = _mm_set1_pd(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    int              nvdwtype;
-    __m128d          rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
-    int              *vdwtype;
-    real             *vdwparam;
-    __m128d          one_sixth   = _mm_set1_pd(1.0/6.0);
-    __m128d          one_twelfth = _mm_set1_pd(1.0/12.0);
-    __m128i          vfitab;
-    __m128i          ifour       = _mm_set1_epi32(4);
-    __m128d          rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF;
-    real             *vftab;
-    __m128d          dummy_mask,cutoff_mask;
-    __m128d          signbit   = gmx_mm_castsi128_pd( _mm_set_epi32(0x80000000,0x00000000,0x80000000,0x00000000) );
-    __m128d          one     = _mm_set1_pd(1.0);
-    __m128d          two     = _mm_set1_pd(2.0);
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = _mm_set1_pd(fr->ic->epsfac);
-    charge           = mdatoms->chargeA;
-    nvdwtype         = fr->ntype;
-    vdwparam         = fr->nbfp;
-    vdwtype          = mdatoms->typeA;
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = _mm_set1_pd(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = _mm_set1_pd((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-
-    /* Avoid stupid compiler warnings */
-    jnrA = jnrB = 0;
-    j_coord_offsetA = 0;
-    j_coord_offsetB = 0;
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        gmx_mm_load_shift_and_1rvec_broadcast_pd(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
-
-        fix0             = _mm_setzero_pd();
-        fiy0             = _mm_setzero_pd();
-        fiz0             = _mm_setzero_pd();
-
-        /* Load parameters for i particles */
-        iq0              = _mm_mul_pd(facel,_mm_load1_pd(charge+inr+0));
-        isai0            = _mm_load1_pd(invsqrta+inr+0);
-        vdwioffset0      = 2*nvdwtype*vdwtype[inr+0];
-
-        dvdasum          = _mm_setzero_pd();
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrA             = jjnr[jidx];
-            jnrB             = jjnr[jidx+1];
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_2ptr_swizzle_pd(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_pd(ix0,jx0);
-            dy00             = _mm_sub_pd(iy0,jy0);
-            dz00             = _mm_sub_pd(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_pd(dx00,dy00,dz00);
-
-            rinv00           = sse41_invsqrt_d(rsq00);
-
-            rinvsq00         = _mm_mul_pd(rinv00,rinv00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm_load_2real_swizzle_pd(charge+jnrA+0,charge+jnrB+0);
-            isaj0            = gmx_mm_load_2real_swizzle_pd(invsqrta+jnrA+0,invsqrta+jnrB+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-            vdwjidx0B        = 2*vdwtype[jnrB+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_pd(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_pd(iq0,jq0);
-            gmx_mm_load_2pair_swizzle_pd(vdwparam+vdwioffset0+vdwjidx0A,
-                                         vdwparam+vdwioffset0+vdwjidx0B,&c6_00,&c12_00);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_pd(isai0,isaj0);
-            gbqqfactor       = _mm_xor_pd(signbit,_mm_mul_pd(qq00,_mm_mul_pd(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_pd(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_pd(r00,gbscale);
-            gbitab           = _mm_cvttpd_epi32(rt);
-            gbeps            = _mm_sub_pd(rt,_mm_round_pd(rt, _MM_FROUND_FLOOR));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,0) );
-            F                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,1) );
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,0) +2);
-            H                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,1) +2);
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Heps             = _mm_mul_pd(gbeps,H);
-            Fp               = _mm_add_pd(F,_mm_mul_pd(gbeps,_mm_add_pd(G,Heps)));
-            VV               = _mm_add_pd(Y,_mm_mul_pd(gbeps,Fp));
-            vgb              = _mm_mul_pd(gbqqfactor,VV);
-
-            FF               = _mm_add_pd(Fp,_mm_mul_pd(gbeps,_mm_add_pd(G,_mm_add_pd(Heps,Heps))));
-            fgb              = _mm_mul_pd(gbqqfactor,_mm_mul_pd(FF,gbscale));
-            dvdatmp          = _mm_mul_pd(minushalf,_mm_add_pd(vgb,_mm_mul_pd(fgb,r00)));
-            dvdasum          = _mm_add_pd(dvdasum,dvdatmp);
-            gmx_mm_increment_2real_swizzle_pd(dvda+jnrA,dvda+jnrB,_mm_mul_pd(dvdatmp,_mm_mul_pd(isaj0,isaj0)));
-            velec            = _mm_mul_pd(qq00,rinv00);
-            felec            = _mm_mul_pd(_mm_sub_pd(_mm_mul_pd(velec,rinv00),fgb),rinv00);
-
-            /* LENNARD-JONES DISPERSION/REPULSION */
-
-            rinvsix          = _mm_mul_pd(_mm_mul_pd(rinvsq00,rinvsq00),rinvsq00);
-            fvdw             = _mm_mul_pd(_mm_sub_pd(_mm_mul_pd(c12_00,rinvsix),c6_00),_mm_mul_pd(rinvsix,rinvsq00));
-
-            fscal            = _mm_add_pd(felec,fvdw);
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm_mul_pd(fscal,dx00);
-            ty               = _mm_mul_pd(fscal,dy00);
-            tz               = _mm_mul_pd(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm_add_pd(fix0,tx);
-            fiy0             = _mm_add_pd(fiy0,ty);
-            fiz0             = _mm_add_pd(fiz0,tz);
-
-            gmx_mm_decrement_1rvec_2ptr_swizzle_pd(f+j_coord_offsetA,f+j_coord_offsetB,tx,ty,tz);
-
-            /* Inner loop uses 64 flops */
-        }
-
-        if(jidx<j_index_end)
-        {
-
-            jnrA             = jjnr[jidx];
-            j_coord_offsetA  = DIM*jnrA;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_1ptr_swizzle_pd(x+j_coord_offsetA,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_pd(ix0,jx0);
-            dy00             = _mm_sub_pd(iy0,jy0);
-            dz00             = _mm_sub_pd(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_pd(dx00,dy00,dz00);
-
-            rinv00           = sse41_invsqrt_d(rsq00);
-
-            rinvsq00         = _mm_mul_pd(rinv00,rinv00);
-
-            /* Load parameters for j particles */
-            jq0              = _mm_load_sd(charge+jnrA+0);
-            isaj0            = _mm_load_sd(invsqrta+jnrA+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_pd(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_pd(iq0,jq0);
-            gmx_mm_load_1pair_swizzle_pd(vdwparam+vdwioffset0+vdwjidx0A,&c6_00,&c12_00);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_pd(isai0,isaj0);
-            gbqqfactor       = _mm_xor_pd(signbit,_mm_mul_pd(qq00,_mm_mul_pd(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_pd(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_pd(r00,gbscale);
-            gbitab           = _mm_cvttpd_epi32(rt);
-            gbeps            = _mm_sub_pd(rt,_mm_round_pd(rt, _MM_FROUND_FLOOR));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,0) );
-            F                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,0) +2);
-            H                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Heps             = _mm_mul_pd(gbeps,H);
-            Fp               = _mm_add_pd(F,_mm_mul_pd(gbeps,_mm_add_pd(G,Heps)));
-            VV               = _mm_add_pd(Y,_mm_mul_pd(gbeps,Fp));
-            vgb              = _mm_mul_pd(gbqqfactor,VV);
-
-            FF               = _mm_add_pd(Fp,_mm_mul_pd(gbeps,_mm_add_pd(G,_mm_add_pd(Heps,Heps))));
-            fgb              = _mm_mul_pd(gbqqfactor,_mm_mul_pd(FF,gbscale));
-            dvdatmp          = _mm_mul_pd(minushalf,_mm_add_pd(vgb,_mm_mul_pd(fgb,r00)));
-            dvdatmp          = _mm_unpacklo_pd(dvdatmp,_mm_setzero_pd());
-            dvdasum          = _mm_add_pd(dvdasum,dvdatmp);
-            gmx_mm_increment_1real_pd(dvda+jnrA,_mm_mul_pd(dvdatmp,_mm_mul_pd(isaj0,isaj0)));
-            velec            = _mm_mul_pd(qq00,rinv00);
-            felec            = _mm_mul_pd(_mm_sub_pd(_mm_mul_pd(velec,rinv00),fgb),rinv00);
-
-            /* LENNARD-JONES DISPERSION/REPULSION */
-
-            rinvsix          = _mm_mul_pd(_mm_mul_pd(rinvsq00,rinvsq00),rinvsq00);
-            fvdw             = _mm_mul_pd(_mm_sub_pd(_mm_mul_pd(c12_00,rinvsix),c6_00),_mm_mul_pd(rinvsix,rinvsq00));
-
-            fscal            = _mm_add_pd(felec,fvdw);
-
-            fscal            = _mm_unpacklo_pd(fscal,_mm_setzero_pd());
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm_mul_pd(fscal,dx00);
-            ty               = _mm_mul_pd(fscal,dy00);
-            tz               = _mm_mul_pd(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm_add_pd(fix0,tx);
-            fiy0             = _mm_add_pd(fiy0,ty);
-            fiz0             = _mm_add_pd(fiz0,tz);
-
-            gmx_mm_decrement_1rvec_1ptr_swizzle_pd(f+j_coord_offsetA,tx,ty,tz);
-
-            /* Inner loop uses 64 flops */
-        }
-
-        /* End of innermost loop */
-
-        gmx_mm_update_iforce_1atom_swizzle_pd(fix0,fiy0,fiz0,
-                                              f+i_coord_offset,fshift+i_shift_offset);
-
-        dvdasum = _mm_mul_pd(dvdasum, _mm_mul_pd(isai0,isai0));
-        gmx_mm_update_1pot_pd(dvdasum,dvda+inr);
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 7 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_F,outeriter*7 + inneriter*64);
-}
diff --git a/src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecGB_VdwNone_GeomP1P1_sse4_1_double.c b/src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_double/nb_kernel_ElecGB_VdwNone_GeomP1P1_sse4_1_double.c
deleted file mode 100644 (file)
index b78bfe8..0000000
+++ /dev/null
@@ -1,657 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
- * and including many others, as listed in the AUTHORS file in the
- * top-level source directory and at http://www.gromacs.org.
- *
- * GROMACS is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * GROMACS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GROMACS; if not, see
- * http://www.gnu.org/licenses, or write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
- *
- * If you want to redistribute modifications to GROMACS, please
- * consider that scientific software is very special. Version
- * control is crucial - bugs must be traceable. We will be happy to
- * consider code for inclusion in the official distribution, but
- * derived work must not be called official GROMACS. Details are found
- * in the README & COPYING files - if they are missing, get the
- * official version at http://www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the research papers on the package. Check out http://www.gromacs.org.
- */
-/*
- * Note: this file was generated by the GROMACS sse4_1_double kernel generator.
- */
-#include "gmxpre.h"
-
-#include "config.h"
-
-#include <math.h>
-
-#include "../nb_kernel.h"
-#include "gromacs/gmxlib/nrnb.h"
-
-#include "kernelutil_x86_sse4_1_double.h"
-
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_sse4_1_double
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            None
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        PotentialAndForce
- */
-void
-nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_sse4_1_double
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
-     * just 0 for non-waters.
-     * Suffixes A,B refer to j loop unrolling done with SSE double precision, e.g. for the two different
-     * jnr indices corresponding to data put in the four positions in the SIMD register.
-     */
-    int              i_shift_offset,i_coord_offset,outeriter,inneriter;
-    int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
-    int              jnrA,jnrB;
-    int              j_coord_offsetA,j_coord_offsetB;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             rcutoff_scalar;
-    real             *shiftvec,*fshift,*x,*f;
-    __m128d          tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
-    int              vdwioffset0;
-    __m128d          ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0A,vdwjidx0B;
-    __m128d          jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    __m128d          dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
-    __m128d          velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    __m128i          gbitab;
-    __m128d          vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,dvdaj,gbeps,dvdatmp;
-    __m128d          minushalf = _mm_set1_pd(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    __m128i          vfitab;
-    __m128i          ifour       = _mm_set1_epi32(4);
-    __m128d          rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF;
-    real             *vftab;
-    __m128d          dummy_mask,cutoff_mask;
-    __m128d          signbit   = gmx_mm_castsi128_pd( _mm_set_epi32(0x80000000,0x00000000,0x80000000,0x00000000) );
-    __m128d          one     = _mm_set1_pd(1.0);
-    __m128d          two     = _mm_set1_pd(2.0);
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = _mm_set1_pd(fr->ic->epsfac);
-    charge           = mdatoms->chargeA;
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = _mm_set1_pd(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = _mm_set1_pd((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-
-    /* Avoid stupid compiler warnings */
-    jnrA = jnrB = 0;
-    j_coord_offsetA = 0;
-    j_coord_offsetB = 0;
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        gmx_mm_load_shift_and_1rvec_broadcast_pd(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
-
-        fix0             = _mm_setzero_pd();
-        fiy0             = _mm_setzero_pd();
-        fiz0             = _mm_setzero_pd();
-
-        /* Load parameters for i particles */
-        iq0              = _mm_mul_pd(facel,_mm_load1_pd(charge+inr+0));
-        isai0            = _mm_load1_pd(invsqrta+inr+0);
-
-        /* Reset potential sums */
-        velecsum         = _mm_setzero_pd();
-        vgbsum           = _mm_setzero_pd();
-        dvdasum          = _mm_setzero_pd();
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrA             = jjnr[jidx];
-            jnrB             = jjnr[jidx+1];
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_2ptr_swizzle_pd(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_pd(ix0,jx0);
-            dy00             = _mm_sub_pd(iy0,jy0);
-            dz00             = _mm_sub_pd(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_pd(dx00,dy00,dz00);
-
-            rinv00           = sse41_invsqrt_d(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm_load_2real_swizzle_pd(charge+jnrA+0,charge+jnrB+0);
-            isaj0            = gmx_mm_load_2real_swizzle_pd(invsqrta+jnrA+0,invsqrta+jnrB+0);
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_pd(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_pd(iq0,jq0);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_pd(isai0,isaj0);
-            gbqqfactor       = _mm_xor_pd(signbit,_mm_mul_pd(qq00,_mm_mul_pd(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_pd(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_pd(r00,gbscale);
-            gbitab           = _mm_cvttpd_epi32(rt);
-            gbeps            = _mm_sub_pd(rt,_mm_round_pd(rt, _MM_FROUND_FLOOR));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,0) );
-            F                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,1) );
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,0) +2);
-            H                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,1) +2);
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Heps             = _mm_mul_pd(gbeps,H);
-            Fp               = _mm_add_pd(F,_mm_mul_pd(gbeps,_mm_add_pd(G,Heps)));
-            VV               = _mm_add_pd(Y,_mm_mul_pd(gbeps,Fp));
-            vgb              = _mm_mul_pd(gbqqfactor,VV);
-
-            FF               = _mm_add_pd(Fp,_mm_mul_pd(gbeps,_mm_add_pd(G,_mm_add_pd(Heps,Heps))));
-            fgb              = _mm_mul_pd(gbqqfactor,_mm_mul_pd(FF,gbscale));
-            dvdatmp          = _mm_mul_pd(minushalf,_mm_add_pd(vgb,_mm_mul_pd(fgb,r00)));
-            dvdasum          = _mm_add_pd(dvdasum,dvdatmp);
-            gmx_mm_increment_2real_swizzle_pd(dvda+jnrA,dvda+jnrB,_mm_mul_pd(dvdatmp,_mm_mul_pd(isaj0,isaj0)));
-            velec            = _mm_mul_pd(qq00,rinv00);
-            felec            = _mm_mul_pd(_mm_sub_pd(_mm_mul_pd(velec,rinv00),fgb),rinv00);
-
-            /* Update potential sum for this i atom from the interaction with this j atom. */
-            velecsum         = _mm_add_pd(velecsum,velec);
-            vgbsum           = _mm_add_pd(vgbsum,vgb);
-
-            fscal            = felec;
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm_mul_pd(fscal,dx00);
-            ty               = _mm_mul_pd(fscal,dy00);
-            tz               = _mm_mul_pd(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm_add_pd(fix0,tx);
-            fiy0             = _mm_add_pd(fiy0,ty);
-            fiz0             = _mm_add_pd(fiz0,tz);
-
-            gmx_mm_decrement_1rvec_2ptr_swizzle_pd(f+j_coord_offsetA,f+j_coord_offsetB,tx,ty,tz);
-
-            /* Inner loop uses 58 flops */
-        }
-
-        if(jidx<j_index_end)
-        {
-
-            jnrA             = jjnr[jidx];
-            j_coord_offsetA  = DIM*jnrA;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_1ptr_swizzle_pd(x+j_coord_offsetA,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_pd(ix0,jx0);
-            dy00             = _mm_sub_pd(iy0,jy0);
-            dz00             = _mm_sub_pd(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_pd(dx00,dy00,dz00);
-
-            rinv00           = sse41_invsqrt_d(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = _mm_load_sd(charge+jnrA+0);
-            isaj0            = _mm_load_sd(invsqrta+jnrA+0);
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_pd(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_pd(iq0,jq0);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_pd(isai0,isaj0);
-            gbqqfactor       = _mm_xor_pd(signbit,_mm_mul_pd(qq00,_mm_mul_pd(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_pd(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_pd(r00,gbscale);
-            gbitab           = _mm_cvttpd_epi32(rt);
-            gbeps            = _mm_sub_pd(rt,_mm_round_pd(rt, _MM_FROUND_FLOOR));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,0) );
-            F                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,0) +2);
-            H                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Heps             = _mm_mul_pd(gbeps,H);
-            Fp               = _mm_add_pd(F,_mm_mul_pd(gbeps,_mm_add_pd(G,Heps)));
-            VV               = _mm_add_pd(Y,_mm_mul_pd(gbeps,Fp));
-            vgb              = _mm_mul_pd(gbqqfactor,VV);
-
-            FF               = _mm_add_pd(Fp,_mm_mul_pd(gbeps,_mm_add_pd(G,_mm_add_pd(Heps,Heps))));
-            fgb              = _mm_mul_pd(gbqqfactor,_mm_mul_pd(FF,gbscale));
-            dvdatmp          = _mm_mul_pd(minushalf,_mm_add_pd(vgb,_mm_mul_pd(fgb,r00)));
-            dvdatmp          = _mm_unpacklo_pd(dvdatmp,_mm_setzero_pd());
-            dvdasum          = _mm_add_pd(dvdasum,dvdatmp);
-            gmx_mm_increment_1real_pd(dvda+jnrA,_mm_mul_pd(dvdatmp,_mm_mul_pd(isaj0,isaj0)));
-            velec            = _mm_mul_pd(qq00,rinv00);
-            felec            = _mm_mul_pd(_mm_sub_pd(_mm_mul_pd(velec,rinv00),fgb),rinv00);
-
-            /* Update potential sum for this i atom from the interaction with this j atom. */
-            velec            = _mm_unpacklo_pd(velec,_mm_setzero_pd());
-            velecsum         = _mm_add_pd(velecsum,velec);
-            vgb              = _mm_unpacklo_pd(vgb,_mm_setzero_pd());
-            vgbsum           = _mm_add_pd(vgbsum,vgb);
-
-            fscal            = felec;
-
-            fscal            = _mm_unpacklo_pd(fscal,_mm_setzero_pd());
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm_mul_pd(fscal,dx00);
-            ty               = _mm_mul_pd(fscal,dy00);
-            tz               = _mm_mul_pd(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm_add_pd(fix0,tx);
-            fiy0             = _mm_add_pd(fiy0,ty);
-            fiz0             = _mm_add_pd(fiz0,tz);
-
-            gmx_mm_decrement_1rvec_1ptr_swizzle_pd(f+j_coord_offsetA,tx,ty,tz);
-
-            /* Inner loop uses 58 flops */
-        }
-
-        /* End of innermost loop */
-
-        gmx_mm_update_iforce_1atom_swizzle_pd(fix0,fiy0,fiz0,
-                                              f+i_coord_offset,fshift+i_shift_offset);
-
-        ggid                        = gid[iidx];
-        /* Update potential energies */
-        gmx_mm_update_1pot_pd(velecsum,kernel_data->energygrp_elec+ggid);
-        gmx_mm_update_1pot_pd(vgbsum,kernel_data->energygrp_polarization+ggid);
-        dvdasum = _mm_mul_pd(dvdasum, _mm_mul_pd(isai0,isai0));
-        gmx_mm_update_1pot_pd(dvdasum,dvda+inr);
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 9 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VF,outeriter*9 + inneriter*58);
-}
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwNone_GeomP1P1_F_sse4_1_double
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            None
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        Force
- */
-void
-nb_kernel_ElecGB_VdwNone_GeomP1P1_F_sse4_1_double
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or
-     * just 0 for non-waters.
-     * Suffixes A,B refer to j loop unrolling done with SSE double precision, e.g. for the two different
-     * jnr indices corresponding to data put in the four positions in the SIMD register.
-     */
-    int              i_shift_offset,i_coord_offset,outeriter,inneriter;
-    int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
-    int              jnrA,jnrB;
-    int              j_coord_offsetA,j_coord_offsetB;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             rcutoff_scalar;
-    real             *shiftvec,*fshift,*x,*f;
-    __m128d          tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
-    int              vdwioffset0;
-    __m128d          ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0A,vdwjidx0B;
-    __m128d          jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    __m128d          dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
-    __m128d          velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    __m128i          gbitab;
-    __m128d          vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,dvdaj,gbeps,dvdatmp;
-    __m128d          minushalf = _mm_set1_pd(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    __m128i          vfitab;
-    __m128i          ifour       = _mm_set1_epi32(4);
-    __m128d          rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF;
-    real             *vftab;
-    __m128d          dummy_mask,cutoff_mask;
-    __m128d          signbit   = gmx_mm_castsi128_pd( _mm_set_epi32(0x80000000,0x00000000,0x80000000,0x00000000) );
-    __m128d          one     = _mm_set1_pd(1.0);
-    __m128d          two     = _mm_set1_pd(2.0);
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = _mm_set1_pd(fr->ic->epsfac);
-    charge           = mdatoms->chargeA;
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = _mm_set1_pd(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = _mm_set1_pd((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-
-    /* Avoid stupid compiler warnings */
-    jnrA = jnrB = 0;
-    j_coord_offsetA = 0;
-    j_coord_offsetB = 0;
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        gmx_mm_load_shift_and_1rvec_broadcast_pd(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
-
-        fix0             = _mm_setzero_pd();
-        fiy0             = _mm_setzero_pd();
-        fiz0             = _mm_setzero_pd();
-
-        /* Load parameters for i particles */
-        iq0              = _mm_mul_pd(facel,_mm_load1_pd(charge+inr+0));
-        isai0            = _mm_load1_pd(invsqrta+inr+0);
-
-        dvdasum          = _mm_setzero_pd();
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end-1; jidx+=2)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrA             = jjnr[jidx];
-            jnrB             = jjnr[jidx+1];
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_2ptr_swizzle_pd(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_pd(ix0,jx0);
-            dy00             = _mm_sub_pd(iy0,jy0);
-            dz00             = _mm_sub_pd(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_pd(dx00,dy00,dz00);
-
-            rinv00           = sse41_invsqrt_d(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm_load_2real_swizzle_pd(charge+jnrA+0,charge+jnrB+0);
-            isaj0            = gmx_mm_load_2real_swizzle_pd(invsqrta+jnrA+0,invsqrta+jnrB+0);
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_pd(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_pd(iq0,jq0);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_pd(isai0,isaj0);
-            gbqqfactor       = _mm_xor_pd(signbit,_mm_mul_pd(qq00,_mm_mul_pd(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_pd(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_pd(r00,gbscale);
-            gbitab           = _mm_cvttpd_epi32(rt);
-            gbeps            = _mm_sub_pd(rt,_mm_round_pd(rt, _MM_FROUND_FLOOR));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,0) );
-            F                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,1) );
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,0) +2);
-            H                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,1) +2);
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Heps             = _mm_mul_pd(gbeps,H);
-            Fp               = _mm_add_pd(F,_mm_mul_pd(gbeps,_mm_add_pd(G,Heps)));
-            VV               = _mm_add_pd(Y,_mm_mul_pd(gbeps,Fp));
-            vgb              = _mm_mul_pd(gbqqfactor,VV);
-
-            FF               = _mm_add_pd(Fp,_mm_mul_pd(gbeps,_mm_add_pd(G,_mm_add_pd(Heps,Heps))));
-            fgb              = _mm_mul_pd(gbqqfactor,_mm_mul_pd(FF,gbscale));
-            dvdatmp          = _mm_mul_pd(minushalf,_mm_add_pd(vgb,_mm_mul_pd(fgb,r00)));
-            dvdasum          = _mm_add_pd(dvdasum,dvdatmp);
-            gmx_mm_increment_2real_swizzle_pd(dvda+jnrA,dvda+jnrB,_mm_mul_pd(dvdatmp,_mm_mul_pd(isaj0,isaj0)));
-            velec            = _mm_mul_pd(qq00,rinv00);
-            felec            = _mm_mul_pd(_mm_sub_pd(_mm_mul_pd(velec,rinv00),fgb),rinv00);
-
-            fscal            = felec;
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm_mul_pd(fscal,dx00);
-            ty               = _mm_mul_pd(fscal,dy00);
-            tz               = _mm_mul_pd(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm_add_pd(fix0,tx);
-            fiy0             = _mm_add_pd(fiy0,ty);
-            fiz0             = _mm_add_pd(fiz0,tz);
-
-            gmx_mm_decrement_1rvec_2ptr_swizzle_pd(f+j_coord_offsetA,f+j_coord_offsetB,tx,ty,tz);
-
-            /* Inner loop uses 56 flops */
-        }
-
-        if(jidx<j_index_end)
-        {
-
-            jnrA             = jjnr[jidx];
-            j_coord_offsetA  = DIM*jnrA;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_1ptr_swizzle_pd(x+j_coord_offsetA,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_pd(ix0,jx0);
-            dy00             = _mm_sub_pd(iy0,jy0);
-            dz00             = _mm_sub_pd(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_pd(dx00,dy00,dz00);
-
-            rinv00           = sse41_invsqrt_d(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = _mm_load_sd(charge+jnrA+0);
-            isaj0            = _mm_load_sd(invsqrta+jnrA+0);
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_pd(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_pd(iq0,jq0);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_pd(isai0,isaj0);
-            gbqqfactor       = _mm_xor_pd(signbit,_mm_mul_pd(qq00,_mm_mul_pd(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_pd(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_pd(r00,gbscale);
-            gbitab           = _mm_cvttpd_epi32(rt);
-            gbeps            = _mm_sub_pd(rt,_mm_round_pd(rt, _MM_FROUND_FLOOR));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,0) );
-            F                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,0) +2);
-            H                = _mm_setzero_pd();
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Heps             = _mm_mul_pd(gbeps,H);
-            Fp               = _mm_add_pd(F,_mm_mul_pd(gbeps,_mm_add_pd(G,Heps)));
-            VV               = _mm_add_pd(Y,_mm_mul_pd(gbeps,Fp));
-            vgb              = _mm_mul_pd(gbqqfactor,VV);
-
-            FF               = _mm_add_pd(Fp,_mm_mul_pd(gbeps,_mm_add_pd(G,_mm_add_pd(Heps,Heps))));
-            fgb              = _mm_mul_pd(gbqqfactor,_mm_mul_pd(FF,gbscale));
-            dvdatmp          = _mm_mul_pd(minushalf,_mm_add_pd(vgb,_mm_mul_pd(fgb,r00)));
-            dvdatmp          = _mm_unpacklo_pd(dvdatmp,_mm_setzero_pd());
-            dvdasum          = _mm_add_pd(dvdasum,dvdatmp);
-            gmx_mm_increment_1real_pd(dvda+jnrA,_mm_mul_pd(dvdatmp,_mm_mul_pd(isaj0,isaj0)));
-            velec            = _mm_mul_pd(qq00,rinv00);
-            felec            = _mm_mul_pd(_mm_sub_pd(_mm_mul_pd(velec,rinv00),fgb),rinv00);
-
-            fscal            = felec;
-
-            fscal            = _mm_unpacklo_pd(fscal,_mm_setzero_pd());
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm_mul_pd(fscal,dx00);
-            ty               = _mm_mul_pd(fscal,dy00);
-            tz               = _mm_mul_pd(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm_add_pd(fix0,tx);
-            fiy0             = _mm_add_pd(fiy0,ty);
-            fiz0             = _mm_add_pd(fiz0,tz);
-
-            gmx_mm_decrement_1rvec_1ptr_swizzle_pd(f+j_coord_offsetA,tx,ty,tz);
-
-            /* Inner loop uses 56 flops */
-        }
-
-        /* End of innermost loop */
-
-        gmx_mm_update_iforce_1atom_swizzle_pd(fix0,fiy0,fiz0,
-                                              f+i_coord_offset,fshift+i_shift_offset);
-
-        dvdasum = _mm_mul_pd(dvdasum, _mm_mul_pd(isai0,isai0));
-        gmx_mm_update_1pot_pd(dvdasum,dvda+inr);
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 7 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_F,outeriter*7 + inneriter*56);
-}
index 99801883935159f30b835b335637a32bf36f52ce..533c80963cd173073b638632343e8a5793dd5800 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -51,6 +51,36 @@ nb_kernel_t nb_kernel_ElecNone_VdwLJSw_GeomP1P1_VF_sse4_1_double;
 nb_kernel_t nb_kernel_ElecNone_VdwLJSw_GeomP1P1_F_sse4_1_double;
 nb_kernel_t nb_kernel_ElecNone_VdwCSTab_GeomP1P1_VF_sse4_1_double;
 nb_kernel_t nb_kernel_ElecNone_VdwCSTab_GeomP1P1_F_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_sse4_1_double;
 nb_kernel_t nb_kernel_ElecEw_VdwLJEw_GeomP1P1_VF_sse4_1_double;
 nb_kernel_t nb_kernel_ElecEw_VdwLJEw_GeomP1P1_F_sse4_1_double;
 nb_kernel_t nb_kernel_ElecEw_VdwLJEw_GeomW3P1_VF_sse4_1_double;
@@ -141,72 +171,6 @@ nb_kernel_t nb_kernel_ElecEwSw_VdwNone_GeomW4P1_VF_sse4_1_double;
 nb_kernel_t nb_kernel_ElecEwSw_VdwNone_GeomW4P1_F_sse4_1_double;
 nb_kernel_t nb_kernel_ElecEwSw_VdwNone_GeomW4W4_VF_sse4_1_double;
 nb_kernel_t nb_kernel_ElecEwSw_VdwNone_GeomW4W4_F_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_sse4_1_double;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_sse4_1_double;
-nb_kernel_t nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_sse4_1_double;
-nb_kernel_t nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_sse4_1_double;
-nb_kernel_t nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_sse4_1_double;
-nb_kernel_t nb_kernel_ElecGB_VdwNone_GeomP1P1_F_sse4_1_double;
-nb_kernel_t nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_sse4_1_double;
-nb_kernel_t nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_sse4_1_double;
 nb_kernel_t nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_VF_sse4_1_double;
 nb_kernel_t nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_F_sse4_1_double;
 nb_kernel_t nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_VF_sse4_1_double;
@@ -277,6 +241,36 @@ nb_kernel_t nb_kernel_ElecRF_VdwCSTab_GeomW4P1_VF_sse4_1_double;
 nb_kernel_t nb_kernel_ElecRF_VdwCSTab_GeomW4P1_F_sse4_1_double;
 nb_kernel_t nb_kernel_ElecRF_VdwCSTab_GeomW4W4_VF_sse4_1_double;
 nb_kernel_t nb_kernel_ElecRF_VdwCSTab_GeomW4W4_F_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_sse4_1_double;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_sse4_1_double;
 
 
 nb_kernel_info_t
@@ -294,6 +288,36 @@ nb_kernel_info_t
     { nb_kernel_ElecNone_VdwLJSw_GeomP1P1_F_sse4_1_double, "nb_kernel_ElecNone_VdwLJSw_GeomP1P1_F_sse4_1_double", "sse4_1_double", "None", "None", "LennardJones", "PotentialSwitch", "ParticleParticle", "", "Force" },
     { nb_kernel_ElecNone_VdwCSTab_GeomP1P1_VF_sse4_1_double, "nb_kernel_ElecNone_VdwCSTab_GeomP1P1_VF_sse4_1_double", "sse4_1_double", "None", "None", "CubicSplineTable", "None", "ParticleParticle", "", "PotentialAndForce" },
     { nb_kernel_ElecNone_VdwCSTab_GeomP1P1_F_sse4_1_double, "nb_kernel_ElecNone_VdwCSTab_GeomP1P1_F_sse4_1_double", "sse4_1_double", "None", "None", "CubicSplineTable", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_sse4_1_double, "nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "LennardJones", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_sse4_1_double, "nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "LennardJones", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_sse4_1_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "LennardJones", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_sse4_1_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "LennardJones", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_sse4_1_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "LennardJones", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_sse4_1_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "LennardJones", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_sse4_1_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "LennardJones", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_sse4_1_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "LennardJones", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_sse4_1_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "LennardJones", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_sse4_1_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "LennardJones", "None", "Water4Water4", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_sse4_1_double, "nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "None", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_sse4_1_double, "nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "None", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_sse4_1_double, "nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "None", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_sse4_1_double, "nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "None", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_sse4_1_double, "nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "None", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_sse4_1_double, "nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "None", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_sse4_1_double, "nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "None", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_sse4_1_double, "nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "None", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_sse4_1_double, "nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "None", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_sse4_1_double, "nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "None", "None", "Water4Water4", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_sse4_1_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_sse4_1_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_sse4_1_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_sse4_1_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_sse4_1_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_sse4_1_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_sse4_1_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_sse4_1_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_sse4_1_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_sse4_1_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Water4", "", "Force" },
     { nb_kernel_ElecEw_VdwLJEw_GeomP1P1_VF_sse4_1_double, "nb_kernel_ElecEw_VdwLJEw_GeomP1P1_VF_sse4_1_double", "sse4_1_double", "Ewald", "None", "LJEwald", "None", "ParticleParticle", "", "PotentialAndForce" },
     { nb_kernel_ElecEw_VdwLJEw_GeomP1P1_F_sse4_1_double, "nb_kernel_ElecEw_VdwLJEw_GeomP1P1_F_sse4_1_double", "sse4_1_double", "Ewald", "None", "LJEwald", "None", "ParticleParticle", "", "Force" },
     { nb_kernel_ElecEw_VdwLJEw_GeomW3P1_VF_sse4_1_double, "nb_kernel_ElecEw_VdwLJEw_GeomW3P1_VF_sse4_1_double", "sse4_1_double", "Ewald", "None", "LJEwald", "None", "Water3Particle", "", "PotentialAndForce" },
@@ -384,72 +408,6 @@ nb_kernel_info_t
     { nb_kernel_ElecEwSw_VdwNone_GeomW4P1_F_sse4_1_double, "nb_kernel_ElecEwSw_VdwNone_GeomW4P1_F_sse4_1_double", "sse4_1_double", "Ewald", "PotentialSwitch", "None", "None", "Water4Particle", "", "Force" },
     { nb_kernel_ElecEwSw_VdwNone_GeomW4W4_VF_sse4_1_double, "nb_kernel_ElecEwSw_VdwNone_GeomW4W4_VF_sse4_1_double", "sse4_1_double", "Ewald", "PotentialSwitch", "None", "None", "Water4Water4", "", "PotentialAndForce" },
     { nb_kernel_ElecEwSw_VdwNone_GeomW4W4_F_sse4_1_double, "nb_kernel_ElecEwSw_VdwNone_GeomW4W4_F_sse4_1_double", "sse4_1_double", "Ewald", "PotentialSwitch", "None", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_sse4_1_double, "nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_sse4_1_double", "sse4_1_double", "Coulomb", "None", "LennardJones", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_sse4_1_double, "nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_sse4_1_double", "sse4_1_double", "Coulomb", "None", "LennardJones", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_sse4_1_double, "nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_sse4_1_double", "sse4_1_double", "Coulomb", "None", "LennardJones", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_sse4_1_double, "nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_sse4_1_double", "sse4_1_double", "Coulomb", "None", "LennardJones", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_sse4_1_double, "nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_sse4_1_double", "sse4_1_double", "Coulomb", "None", "LennardJones", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_sse4_1_double, "nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_sse4_1_double", "sse4_1_double", "Coulomb", "None", "LennardJones", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_sse4_1_double, "nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_sse4_1_double", "sse4_1_double", "Coulomb", "None", "LennardJones", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_sse4_1_double, "nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_sse4_1_double", "sse4_1_double", "Coulomb", "None", "LennardJones", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_sse4_1_double, "nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_sse4_1_double", "sse4_1_double", "Coulomb", "None", "LennardJones", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_sse4_1_double, "nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_sse4_1_double", "sse4_1_double", "Coulomb", "None", "LennardJones", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_sse4_1_double, "nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_sse4_1_double", "sse4_1_double", "Coulomb", "None", "None", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_sse4_1_double, "nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_sse4_1_double", "sse4_1_double", "Coulomb", "None", "None", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_sse4_1_double, "nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_sse4_1_double", "sse4_1_double", "Coulomb", "None", "None", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_sse4_1_double, "nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_sse4_1_double", "sse4_1_double", "Coulomb", "None", "None", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_sse4_1_double, "nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_sse4_1_double", "sse4_1_double", "Coulomb", "None", "None", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_sse4_1_double, "nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_sse4_1_double", "sse4_1_double", "Coulomb", "None", "None", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_sse4_1_double, "nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_sse4_1_double", "sse4_1_double", "Coulomb", "None", "None", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_sse4_1_double, "nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_sse4_1_double", "sse4_1_double", "Coulomb", "None", "None", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_sse4_1_double, "nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_sse4_1_double", "sse4_1_double", "Coulomb", "None", "None", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_sse4_1_double, "nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_sse4_1_double", "sse4_1_double", "Coulomb", "None", "None", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_sse4_1_double, "nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_sse4_1_double", "sse4_1_double", "Coulomb", "None", "CubicSplineTable", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_sse4_1_double, "nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_sse4_1_double", "sse4_1_double", "Coulomb", "None", "CubicSplineTable", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_sse4_1_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_sse4_1_double", "sse4_1_double", "Coulomb", "None", "CubicSplineTable", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_sse4_1_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_sse4_1_double", "sse4_1_double", "Coulomb", "None", "CubicSplineTable", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_sse4_1_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_sse4_1_double", "sse4_1_double", "Coulomb", "None", "CubicSplineTable", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_sse4_1_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_sse4_1_double", "sse4_1_double", "Coulomb", "None", "CubicSplineTable", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_sse4_1_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_sse4_1_double", "sse4_1_double", "Coulomb", "None", "CubicSplineTable", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_sse4_1_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_sse4_1_double", "sse4_1_double", "Coulomb", "None", "CubicSplineTable", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_sse4_1_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_sse4_1_double", "sse4_1_double", "Coulomb", "None", "CubicSplineTable", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_sse4_1_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_sse4_1_double", "sse4_1_double", "Coulomb", "None", "CubicSplineTable", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_sse4_1_double, "nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "LennardJones", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_sse4_1_double, "nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "LennardJones", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_sse4_1_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "LennardJones", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_sse4_1_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "LennardJones", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_sse4_1_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "LennardJones", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_sse4_1_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "LennardJones", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_sse4_1_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "LennardJones", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_sse4_1_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "LennardJones", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_sse4_1_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "LennardJones", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_sse4_1_double, "nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "LennardJones", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_sse4_1_double, "nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "None", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_sse4_1_double, "nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "None", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_sse4_1_double, "nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "None", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_sse4_1_double, "nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "None", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_sse4_1_double, "nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "None", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_sse4_1_double, "nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "None", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_sse4_1_double, "nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "None", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_sse4_1_double, "nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "None", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_sse4_1_double, "nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "None", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_sse4_1_double, "nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "None", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_sse4_1_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_sse4_1_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_sse4_1_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_sse4_1_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_sse4_1_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_sse4_1_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_sse4_1_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_sse4_1_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_sse4_1_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_sse4_1_double, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_sse4_1_double", "sse4_1_double", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_sse4_1_double, "nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_sse4_1_double", "sse4_1_double", "GeneralizedBorn", "None", "LennardJones", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_sse4_1_double, "nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_sse4_1_double", "sse4_1_double", "GeneralizedBorn", "None", "LennardJones", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_sse4_1_double, "nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_sse4_1_double", "sse4_1_double", "GeneralizedBorn", "None", "None", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecGB_VdwNone_GeomP1P1_F_sse4_1_double, "nb_kernel_ElecGB_VdwNone_GeomP1P1_F_sse4_1_double", "sse4_1_double", "GeneralizedBorn", "None", "None", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_sse4_1_double, "nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_sse4_1_double", "sse4_1_double", "GeneralizedBorn", "None", "CubicSplineTable", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_sse4_1_double, "nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_sse4_1_double", "sse4_1_double", "GeneralizedBorn", "None", "CubicSplineTable", "None", "ParticleParticle", "", "Force" },
     { nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_VF_sse4_1_double, "nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_VF_sse4_1_double", "sse4_1_double", "ReactionField", "ExactCutoff", "LennardJones", "PotentialShift", "ParticleParticle", "", "PotentialAndForce" },
     { nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_F_sse4_1_double, "nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_F_sse4_1_double", "sse4_1_double", "ReactionField", "ExactCutoff", "LennardJones", "PotentialShift", "ParticleParticle", "", "Force" },
     { nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_VF_sse4_1_double, "nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_VF_sse4_1_double", "sse4_1_double", "ReactionField", "ExactCutoff", "LennardJones", "PotentialShift", "Water3Particle", "", "PotentialAndForce" },
@@ -519,7 +477,37 @@ nb_kernel_info_t
     { nb_kernel_ElecRF_VdwCSTab_GeomW4P1_VF_sse4_1_double, "nb_kernel_ElecRF_VdwCSTab_GeomW4P1_VF_sse4_1_double", "sse4_1_double", "ReactionField", "None", "CubicSplineTable", "None", "Water4Particle", "", "PotentialAndForce" },
     { nb_kernel_ElecRF_VdwCSTab_GeomW4P1_F_sse4_1_double, "nb_kernel_ElecRF_VdwCSTab_GeomW4P1_F_sse4_1_double", "sse4_1_double", "ReactionField", "None", "CubicSplineTable", "None", "Water4Particle", "", "Force" },
     { nb_kernel_ElecRF_VdwCSTab_GeomW4W4_VF_sse4_1_double, "nb_kernel_ElecRF_VdwCSTab_GeomW4W4_VF_sse4_1_double", "sse4_1_double", "ReactionField", "None", "CubicSplineTable", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecRF_VdwCSTab_GeomW4W4_F_sse4_1_double, "nb_kernel_ElecRF_VdwCSTab_GeomW4W4_F_sse4_1_double", "sse4_1_double", "ReactionField", "None", "CubicSplineTable", "None", "Water4Water4", "", "Force" }
+    { nb_kernel_ElecRF_VdwCSTab_GeomW4W4_F_sse4_1_double, "nb_kernel_ElecRF_VdwCSTab_GeomW4W4_F_sse4_1_double", "sse4_1_double", "ReactionField", "None", "CubicSplineTable", "None", "Water4Water4", "", "Force" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_sse4_1_double, "nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_sse4_1_double", "sse4_1_double", "Coulomb", "None", "LennardJones", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_sse4_1_double, "nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_sse4_1_double", "sse4_1_double", "Coulomb", "None", "LennardJones", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_sse4_1_double, "nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_sse4_1_double", "sse4_1_double", "Coulomb", "None", "LennardJones", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_sse4_1_double, "nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_sse4_1_double", "sse4_1_double", "Coulomb", "None", "LennardJones", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_sse4_1_double, "nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_sse4_1_double", "sse4_1_double", "Coulomb", "None", "LennardJones", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_sse4_1_double, "nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_sse4_1_double", "sse4_1_double", "Coulomb", "None", "LennardJones", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_sse4_1_double, "nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_sse4_1_double", "sse4_1_double", "Coulomb", "None", "LennardJones", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_sse4_1_double, "nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_sse4_1_double", "sse4_1_double", "Coulomb", "None", "LennardJones", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_sse4_1_double, "nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_sse4_1_double", "sse4_1_double", "Coulomb", "None", "LennardJones", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_sse4_1_double, "nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_sse4_1_double", "sse4_1_double", "Coulomb", "None", "LennardJones", "None", "Water4Water4", "", "Force" },
+    { nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_sse4_1_double, "nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_sse4_1_double", "sse4_1_double", "Coulomb", "None", "None", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_sse4_1_double, "nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_sse4_1_double", "sse4_1_double", "Coulomb", "None", "None", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_sse4_1_double, "nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_sse4_1_double", "sse4_1_double", "Coulomb", "None", "None", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_sse4_1_double, "nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_sse4_1_double", "sse4_1_double", "Coulomb", "None", "None", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_sse4_1_double, "nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_sse4_1_double", "sse4_1_double", "Coulomb", "None", "None", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_sse4_1_double, "nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_sse4_1_double", "sse4_1_double", "Coulomb", "None", "None", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_sse4_1_double, "nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_sse4_1_double", "sse4_1_double", "Coulomb", "None", "None", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_sse4_1_double, "nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_sse4_1_double", "sse4_1_double", "Coulomb", "None", "None", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_sse4_1_double, "nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_sse4_1_double", "sse4_1_double", "Coulomb", "None", "None", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_sse4_1_double, "nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_sse4_1_double", "sse4_1_double", "Coulomb", "None", "None", "None", "Water4Water4", "", "Force" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_sse4_1_double, "nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_sse4_1_double", "sse4_1_double", "Coulomb", "None", "CubicSplineTable", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_sse4_1_double, "nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_sse4_1_double", "sse4_1_double", "Coulomb", "None", "CubicSplineTable", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_sse4_1_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_sse4_1_double", "sse4_1_double", "Coulomb", "None", "CubicSplineTable", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_sse4_1_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_sse4_1_double", "sse4_1_double", "Coulomb", "None", "CubicSplineTable", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_sse4_1_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_sse4_1_double", "sse4_1_double", "Coulomb", "None", "CubicSplineTable", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_sse4_1_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_sse4_1_double", "sse4_1_double", "Coulomb", "None", "CubicSplineTable", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_sse4_1_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_sse4_1_double", "sse4_1_double", "Coulomb", "None", "CubicSplineTable", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_sse4_1_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_sse4_1_double", "sse4_1_double", "Coulomb", "None", "CubicSplineTable", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_sse4_1_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_sse4_1_double", "sse4_1_double", "Coulomb", "None", "CubicSplineTable", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_sse4_1_double, "nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_sse4_1_double", "sse4_1_double", "Coulomb", "None", "CubicSplineTable", "None", "Water4Water4", "", "Force" }
 };
 
 int
index 2115c8ef5e0b4e7c04617c3c5a102a2579966df5..2fc4881f0e900a1cb1a7af8d0680a798d47fd393 100644 (file)
@@ -2,7 +2,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -128,12 +128,6 @@ void
     __m128d          velec,felec,velecsum,facel,crf,krf,krf2;
     real             *charge;
     /* #endif */
-    /* #if 'GeneralizedBorn' in KERNEL_ELEC */
-    __m128i          gbitab;
-    __m128d          vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,dvdaj,gbeps,dvdatmp;
-    __m128d          minushalf = _mm_set1_pd(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    /* #endif */
     /* #if KERNEL_VDW != 'None' */
     int              nvdwtype;
     __m128d          rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
@@ -142,7 +136,7 @@ void
     __m128d          one_sixth   = _mm_set1_pd(1.0/6.0);
     __m128d          one_twelfth = _mm_set1_pd(1.0/12.0);
     /* #endif */
-    /* #if 'Table' in KERNEL_ELEC or 'GeneralizedBorn' in KERNEL_ELEC or 'Table' in KERNEL_VDW */
+    /* #if 'Table' in KERNEL_ELEC or 'Table' in KERNEL_VDW */
     __m128i          vfitab;
     __m128i          ifour       = _mm_set1_epi32(4);
     __m128d          rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF;
@@ -226,14 +220,6 @@ void
      /*     #endif */
     /* #endif */
 
-    /* #if KERNEL_ELEC=='GeneralizedBorn' */
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = _mm_set1_pd(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = _mm_set1_pd((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-    /* #endif */
-
     /* #if 'Water' in GEOMETRY_I */
     /* Setup water-specific parameters */
     inr              = nlist->iinr[0];
@@ -360,9 +346,6 @@ void
         /*     #for I in PARTICLES_ELEC_I */
         iq{I}              = _mm_mul_pd(facel,_mm_load1_pd(charge+inr+{I}));
         /*         #define OUTERFLOPS OUTERFLOPS+1 */
-        /*         #if KERNEL_ELEC=='GeneralizedBorn' */
-        isai{I}            = _mm_load1_pd(invsqrta+inr+{I});
-        /*         #endif */
         /*     #endfor */
         /*     #for I in PARTICLES_VDW_I */
         vdwioffset{I}      = 2*nvdwtype*vdwtype[inr+{I}];
@@ -374,16 +357,10 @@ void
         /*     #if KERNEL_ELEC != 'None' */
         velecsum         = _mm_setzero_pd();
         /*     #endif */
-        /*     #if 'GeneralizedBorn' in KERNEL_ELEC */
-        vgbsum           = _mm_setzero_pd();
-        /*     #endif */
         /*     #if KERNEL_VDW != 'None' */
         vvdwsum          = _mm_setzero_pd();
         /*     #endif */
         /* #endif */
-        /*     #if 'GeneralizedBorn' in KERNEL_ELEC and 'Force' in KERNEL_VF */
-        dvdasum          = _mm_setzero_pd();
-        /*     #endif */
 
         /* #for ROUND in ['Loop','Epilogue'] */
 
@@ -490,13 +467,6 @@ void
             /*         #else */
             jq{J}              = _mm_load_sd(charge+jnrA+{J});
             /*         #endif */
-            /*         #if KERNEL_ELEC=='GeneralizedBorn' */
-            /*             #if ROUND =='Loop' */
-            isaj{J}            = gmx_mm_load_2real_swizzle_pd(invsqrta+jnrA+{J},invsqrta+jnrB+{J});
-            /*             #else */
-            isaj{J}            = _mm_load_sd(invsqrta+jnrA+{J});
-            /*             #endif */
-            /*         #endif */
             /*     #endfor */
             /*     #for J in PARTICLES_VDW_J */
             vdwjidx{J}A        = 2*vdwtype[jnrA+{J}];
@@ -603,64 +573,6 @@ void
             /*                 #define INNERFLOPS INNERFLOPS+3 */
             /*             #endif */
 
-            /*         #elif KERNEL_ELEC=='GeneralizedBorn' */
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_pd(isai{I},isaj{J});
-            gbqqfactor       = _mm_xor_pd(signbit,_mm_mul_pd(qq{I}{J},_mm_mul_pd(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_pd(isaprod,gbtabscale);
-            /*             #define INNERFLOPS INNERFLOPS+5 */
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_pd(r{I}{J},gbscale);
-            gbitab           = _mm_cvttpd_epi32(rt);
-            gbeps            = _mm_sub_pd(rt,_mm_round_pd(rt, _MM_FROUND_FLOOR));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-
-            Y                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,0) );
-            /*             #if ROUND == 'Loop' */
-            F                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,1) );
-            /*             #else */
-            F                = _mm_setzero_pd();
-            /*             #endif */
-            GMX_MM_TRANSPOSE2_PD(Y,F);
-            G                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,0) +2);
-            /*             #if ROUND == 'Loop' */
-            H                = _mm_load_pd( gbtab + gmx_mm_extract_epi32(gbitab,1) +2);
-            /*             #else */
-            H                = _mm_setzero_pd();
-            /*             #endif */
-            GMX_MM_TRANSPOSE2_PD(G,H);
-            Heps             = _mm_mul_pd(gbeps,H);
-            Fp               = _mm_add_pd(F,_mm_mul_pd(gbeps,_mm_add_pd(G,Heps)));
-            VV               = _mm_add_pd(Y,_mm_mul_pd(gbeps,Fp));
-            vgb              = _mm_mul_pd(gbqqfactor,VV);
-            /*             #define INNERFLOPS INNERFLOPS+10 */
-
-            /*             #if 'Force' in KERNEL_VF */
-            FF               = _mm_add_pd(Fp,_mm_mul_pd(gbeps,_mm_add_pd(G,_mm_add_pd(Heps,Heps))));
-            fgb              = _mm_mul_pd(gbqqfactor,_mm_mul_pd(FF,gbscale));
-            dvdatmp          = _mm_mul_pd(minushalf,_mm_add_pd(vgb,_mm_mul_pd(fgb,r{I}{J})));
-            /*                 #if ROUND == 'Epilogue' */
-            dvdatmp          = _mm_unpacklo_pd(dvdatmp,_mm_setzero_pd());
-            /*                 #endif */
-            dvdasum          = _mm_add_pd(dvdasum,dvdatmp);
-            /*             #if ROUND == 'Loop' */
-            gmx_mm_increment_2real_swizzle_pd(dvda+jnrA,dvda+jnrB,_mm_mul_pd(dvdatmp,_mm_mul_pd(isaj{J},isaj{J})));
-            /*             #else */
-            gmx_mm_increment_1real_pd(dvda+jnrA,_mm_mul_pd(dvdatmp,_mm_mul_pd(isaj{J},isaj{J})));
-            /*             #endif */
-            /*                 #define INNERFLOPS INNERFLOPS+13 */
-            /*             #endif */
-            velec            = _mm_mul_pd(qq{I}{J},rinv{I}{J});
-            /*                 #define INNERFLOPS INNERFLOPS+1 */
-            /*             #if 'Force' in KERNEL_VF */
-            felec            = _mm_mul_pd(_mm_sub_pd(_mm_mul_pd(velec,rinv{I}{J}),fgb),rinv{I}{J});
-            /*                 #define INNERFLOPS INNERFLOPS+3 */
-            /*             #endif */
-
             /*         #elif KERNEL_ELEC=='Ewald' */
             /* EWALD ELECTROSTATICS */
 
@@ -946,17 +858,6 @@ void
             /*             #endif */
             velecsum         = _mm_add_pd(velecsum,velec);
             /*             #define INNERFLOPS INNERFLOPS+1 */
-            /*             #if KERNEL_ELEC=='GeneralizedBorn' */
-            /*             #if 'exactcutoff' in INTERACTION_FLAGS[I][J] */
-            vgb              = _mm_and_pd(vgb,cutoff_mask);
-            /*                 #define INNERFLOPS INNERFLOPS+1 */
-            /*             #endif                                       */
-            /*             #if ROUND == 'Epilogue' */
-            vgb              = _mm_unpacklo_pd(vgb,_mm_setzero_pd());
-            /*             #endif */
-            vgbsum           = _mm_add_pd(vgbsum,vgb);
-            /*                 #define INNERFLOPS INNERFLOPS+1 */
-            /*             #endif */
             /*         #endif */
             /*         #if 'vdw' in INTERACTION_FLAGS[I][J] */
             /*             #if 'exactcutoff' in INTERACTION_FLAGS[I][J] */
@@ -1097,19 +998,11 @@ void
         gmx_mm_update_1pot_pd(velecsum,kernel_data->energygrp_elec+ggid);
         /*         #define OUTERFLOPS OUTERFLOPS+1 */
         /*     #endif */
-        /*     #if 'GeneralizedBorn' in KERNEL_ELEC */
-        gmx_mm_update_1pot_pd(vgbsum,kernel_data->energygrp_polarization+ggid);
-        /*         #define OUTERFLOPS OUTERFLOPS+1 */
-        /*     #endif */
         /*     #if KERNEL_VDW != 'None' */
         gmx_mm_update_1pot_pd(vvdwsum,kernel_data->energygrp_vdw+ggid);
         /*         #define OUTERFLOPS OUTERFLOPS+1 */
         /*     #endif */
         /* #endif */
-        /*     #if 'GeneralizedBorn' in KERNEL_ELEC and 'Force' in KERNEL_VF */
-        dvdasum = _mm_mul_pd(dvdasum, _mm_mul_pd(isai{I},isai{I}));
-        gmx_mm_update_1pot_pd(dvdasum,dvda+inr);
-        /*     #endif */
 
         /* Increment number of inner iterations */
         inneriter                  += j_index_end - j_index_start;
index 21d7767d230d69294f4294de23d1ff0f11260b81..956a9c9b1232a11bd2f184fb3b9d29ef38e30e04 100755 (executable)
@@ -105,7 +105,6 @@ ElectrostaticsList = {
     'None'                    : [],
     'Coulomb'                 : ['rinv','rinvsq'],
     'ReactionField'           : ['rinv','rinvsq'],
-    'GeneralizedBorn'         : ['rinv','r'],
     'CubicSplineTable'        : ['rinv','r','table'],
     'Ewald'                   : ['rinv','rinvsq','r'],
 }
@@ -190,7 +189,6 @@ Abbreviation = {
     'Coulomb'                 : 'Coul',
     'Ewald'                   : 'Ew',
     'ReactionField'           : 'RF',
-    'GeneralizedBorn'         : 'GB',
     'CubicSplineTable'        : 'CSTab',
     'LennardJones'            : 'LJ',
     'Buckingham'              : 'Bham',
@@ -269,7 +267,7 @@ def KeepKernel(KernelElec,KernelElecMod,KernelVdw,KernelVdwMod,KernelGeom,Kernel
         return 0
 
     # No need for LJ-only water optimization, or water optimization with implicit solvent.
-    if('Water' in KernelGeom[0] and (KernelElec=='None' or 'GeneralizedBorn' in KernelElec)):
+    if('Water' in KernelGeom[0] and KernelElec=='None'):
         return 0
 
     # Non-matching table settings are pointless
diff --git a/src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecGB_VdwCSTab_GeomP1P1_sse4_1_single.c b/src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecGB_VdwCSTab_GeomP1P1_sse4_1_single.c
deleted file mode 100644 (file)
index 88351ac..0000000
+++ /dev/null
@@ -1,954 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
- * and including many others, as listed in the AUTHORS file in the
- * top-level source directory and at http://www.gromacs.org.
- *
- * GROMACS is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * GROMACS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GROMACS; if not, see
- * http://www.gnu.org/licenses, or write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
- *
- * If you want to redistribute modifications to GROMACS, please
- * consider that scientific software is very special. Version
- * control is crucial - bugs must be traceable. We will be happy to
- * consider code for inclusion in the official distribution, but
- * derived work must not be called official GROMACS. Details are found
- * in the README & COPYING files - if they are missing, get the
- * official version at http://www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the research papers on the package. Check out http://www.gromacs.org.
- */
-/*
- * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
- */
-#include "gmxpre.h"
-
-#include "config.h"
-
-#include <math.h>
-
-#include "../nb_kernel.h"
-#include "gromacs/gmxlib/nrnb.h"
-
-#include "kernelutil_x86_sse4_1_single.h"
-
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_sse4_1_single
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            CubicSplineTable
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        PotentialAndForce
- */
-void
-nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_sse4_1_single
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or 
-     * just 0 for non-waters.
-     * Suffixes A,B,C,D refer to j loop unrolling done with SSE, e.g. for the four different
-     * jnr indices corresponding to data put in the four positions in the SIMD register.
-     */
-    int              i_shift_offset,i_coord_offset,outeriter,inneriter;
-    int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
-    int              jnrA,jnrB,jnrC,jnrD;
-    int              jnrlistA,jnrlistB,jnrlistC,jnrlistD;
-    int              j_coord_offsetA,j_coord_offsetB,j_coord_offsetC,j_coord_offsetD;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             rcutoff_scalar;
-    real             *shiftvec,*fshift,*x,*f;
-    real             *fjptrA,*fjptrB,*fjptrC,*fjptrD;
-    real             scratch[4*DIM];
-    __m128           tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
-    int              vdwioffset0;
-    __m128           ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0A,vdwjidx0B,vdwjidx0C,vdwjidx0D;
-    __m128           jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    __m128           dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
-    __m128           velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    __m128i          gbitab;
-    __m128           vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,gbeps,dvdatmp;
-    __m128           minushalf = _mm_set1_ps(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    int              nvdwtype;
-    __m128           rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
-    int              *vdwtype;
-    real             *vdwparam;
-    __m128           one_sixth   = _mm_set1_ps(1.0/6.0);
-    __m128           one_twelfth = _mm_set1_ps(1.0/12.0);
-    __m128i          vfitab;
-    __m128i          ifour       = _mm_set1_epi32(4);
-    __m128           rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF;
-    real             *vftab;
-    __m128           dummy_mask,cutoff_mask;
-    __m128           signbit = _mm_castsi128_ps( _mm_set1_epi32(0x80000000) );
-    __m128           one     = _mm_set1_ps(1.0);
-    __m128           two     = _mm_set1_ps(2.0);
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = _mm_set1_ps(fr->ic->epsfac);
-    charge           = mdatoms->chargeA;
-    nvdwtype         = fr->ntype;
-    vdwparam         = fr->nbfp;
-    vdwtype          = mdatoms->typeA;
-
-    vftab            = kernel_data->table_vdw->data;
-    vftabscale       = _mm_set1_ps(kernel_data->table_vdw->scale);
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = _mm_set1_ps(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = _mm_set1_ps((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-
-    /* Avoid stupid compiler warnings */
-    jnrA = jnrB = jnrC = jnrD = 0;
-    j_coord_offsetA = 0;
-    j_coord_offsetB = 0;
-    j_coord_offsetC = 0;
-    j_coord_offsetD = 0;
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    for(iidx=0;iidx<4*DIM;iidx++)
-    {
-        scratch[iidx] = 0.0;
-    }
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        gmx_mm_load_shift_and_1rvec_broadcast_ps(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
-
-        fix0             = _mm_setzero_ps();
-        fiy0             = _mm_setzero_ps();
-        fiz0             = _mm_setzero_ps();
-
-        /* Load parameters for i particles */
-        iq0              = _mm_mul_ps(facel,_mm_load1_ps(charge+inr+0));
-        isai0            = _mm_load1_ps(invsqrta+inr+0);
-        vdwioffset0      = 2*nvdwtype*vdwtype[inr+0];
-
-        /* Reset potential sums */
-        velecsum         = _mm_setzero_ps();
-        vgbsum           = _mm_setzero_ps();
-        vvdwsum          = _mm_setzero_ps();
-        dvdasum          = _mm_setzero_ps();
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end && jjnr[jidx+3]>=0; jidx+=4)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrA             = jjnr[jidx];
-            jnrB             = jjnr[jidx+1];
-            jnrC             = jjnr[jidx+2];
-            jnrD             = jjnr[jidx+3];
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              x+j_coord_offsetC,x+j_coord_offsetD,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_ps(ix0,jx0);
-            dy00             = _mm_sub_ps(iy0,jy0);
-            dz00             = _mm_sub_ps(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
-
-            rinv00           = sse41_invsqrt_f(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm_load_4real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
-                                                              charge+jnrC+0,charge+jnrD+0);
-            isaj0            = gmx_mm_load_4real_swizzle_ps(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                              invsqrta+jnrC+0,invsqrta+jnrD+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-            vdwjidx0B        = 2*vdwtype[jnrB+0];
-            vdwjidx0C        = 2*vdwtype[jnrC+0];
-            vdwjidx0D        = 2*vdwtype[jnrD+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_ps(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_ps(iq0,jq0);
-            gmx_mm_load_4pair_swizzle_ps(vdwparam+vdwioffset0+vdwjidx0A,
-                                         vdwparam+vdwioffset0+vdwjidx0B,
-                                         vdwparam+vdwioffset0+vdwjidx0C,
-                                         vdwparam+vdwioffset0+vdwjidx0D,
-                                         &c6_00,&c12_00);
-
-            /* Calculate table index by multiplying r with table scale and truncate to integer */
-            rt               = _mm_mul_ps(r00,vftabscale);
-            vfitab           = _mm_cvttps_epi32(rt);
-            vfeps            = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR));
-            vfitab           = _mm_slli_epi32(vfitab,3);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_ps(isai0,isaj0);
-            gbqqfactor       = _mm_xor_ps(signbit,_mm_mul_ps(qq00,_mm_mul_ps(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_ps(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_ps(r00,gbscale);
-            gbitab           = _mm_cvttps_epi32(rt);
-            gbeps            = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-            Y                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,0) );
-            F                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,1) );
-            G                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,2) );
-            H                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm_mul_ps(gbeps,H);
-            Fp               = _mm_add_ps(F,_mm_mul_ps(gbeps,_mm_add_ps(G,Heps)));
-            VV               = _mm_add_ps(Y,_mm_mul_ps(gbeps,Fp));
-            vgb              = _mm_mul_ps(gbqqfactor,VV);
-
-            FF               = _mm_add_ps(Fp,_mm_mul_ps(gbeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
-            fgb              = _mm_mul_ps(gbqqfactor,_mm_mul_ps(FF,gbscale));
-            dvdatmp          = _mm_mul_ps(minushalf,_mm_add_ps(vgb,_mm_mul_ps(fgb,r00)));
-            dvdasum          = _mm_add_ps(dvdasum,dvdatmp);
-            fjptrA           = dvda+jnrA;
-            fjptrB           = dvda+jnrB;
-            fjptrC           = dvda+jnrC;
-            fjptrD           = dvda+jnrD;
-            gmx_mm_increment_4real_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,_mm_mul_ps(dvdatmp,_mm_mul_ps(isaj0,isaj0)));
-            velec            = _mm_mul_ps(qq00,rinv00);
-            felec            = _mm_mul_ps(_mm_sub_ps(_mm_mul_ps(velec,rinv00),fgb),rinv00);
-
-            /* CUBIC SPLINE TABLE DISPERSION */
-            Y                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0) );
-            F                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1) );
-            G                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2) );
-            H                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm_mul_ps(vfeps,H);
-            Fp               = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
-            VV               = _mm_add_ps(Y,_mm_mul_ps(vfeps,Fp));
-            vvdw6            = _mm_mul_ps(c6_00,VV);
-            FF               = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
-            fvdw6            = _mm_mul_ps(c6_00,FF);
-
-            /* CUBIC SPLINE TABLE REPULSION */
-            vfitab           = _mm_add_epi32(vfitab,ifour);
-            Y                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0) );
-            F                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1) );
-            G                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2) );
-            H                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm_mul_ps(vfeps,H);
-            Fp               = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
-            VV               = _mm_add_ps(Y,_mm_mul_ps(vfeps,Fp));
-            vvdw12           = _mm_mul_ps(c12_00,VV);
-            FF               = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
-            fvdw12           = _mm_mul_ps(c12_00,FF);
-            vvdw             = _mm_add_ps(vvdw12,vvdw6);
-            fvdw             = _mm_xor_ps(signbit,_mm_mul_ps(_mm_add_ps(fvdw6,fvdw12),_mm_mul_ps(vftabscale,rinv00)));
-
-            /* Update potential sum for this i atom from the interaction with this j atom. */
-            velecsum         = _mm_add_ps(velecsum,velec);
-            vgbsum           = _mm_add_ps(vgbsum,vgb);
-            vvdwsum          = _mm_add_ps(vvdwsum,vvdw);
-
-            fscal            = _mm_add_ps(felec,fvdw);
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm_mul_ps(fscal,dx00);
-            ty               = _mm_mul_ps(fscal,dy00);
-            tz               = _mm_mul_ps(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm_add_ps(fix0,tx);
-            fiy0             = _mm_add_ps(fiy0,ty);
-            fiz0             = _mm_add_ps(fiz0,tz);
-
-            fjptrA             = f+j_coord_offsetA;
-            fjptrB             = f+j_coord_offsetB;
-            fjptrC             = f+j_coord_offsetC;
-            fjptrD             = f+j_coord_offsetD;
-            gmx_mm_decrement_1rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,tx,ty,tz);
-
-            /* Inner loop uses 92 flops */
-        }
-
-        if(jidx<j_index_end)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrlistA         = jjnr[jidx];
-            jnrlistB         = jjnr[jidx+1];
-            jnrlistC         = jjnr[jidx+2];
-            jnrlistD         = jjnr[jidx+3];
-            /* Sign of each element will be negative for non-real atoms.
-             * This mask will be 0xFFFFFFFF for dummy entries and 0x0 for real ones,
-             * so use it as val = _mm_andnot_ps(mask,val) to clear dummy entries.
-             */
-            dummy_mask = gmx_mm_castsi128_ps(_mm_cmplt_epi32(_mm_loadu_si128((const __m128i *)(jjnr+jidx)),_mm_setzero_si128()));
-            jnrA       = (jnrlistA>=0) ? jnrlistA : 0;
-            jnrB       = (jnrlistB>=0) ? jnrlistB : 0;
-            jnrC       = (jnrlistC>=0) ? jnrlistC : 0;
-            jnrD       = (jnrlistD>=0) ? jnrlistD : 0;
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              x+j_coord_offsetC,x+j_coord_offsetD,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_ps(ix0,jx0);
-            dy00             = _mm_sub_ps(iy0,jy0);
-            dz00             = _mm_sub_ps(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
-
-            rinv00           = sse41_invsqrt_f(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm_load_4real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
-                                                              charge+jnrC+0,charge+jnrD+0);
-            isaj0            = gmx_mm_load_4real_swizzle_ps(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                              invsqrta+jnrC+0,invsqrta+jnrD+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-            vdwjidx0B        = 2*vdwtype[jnrB+0];
-            vdwjidx0C        = 2*vdwtype[jnrC+0];
-            vdwjidx0D        = 2*vdwtype[jnrD+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_ps(rsq00,rinv00);
-            r00              = _mm_andnot_ps(dummy_mask,r00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_ps(iq0,jq0);
-            gmx_mm_load_4pair_swizzle_ps(vdwparam+vdwioffset0+vdwjidx0A,
-                                         vdwparam+vdwioffset0+vdwjidx0B,
-                                         vdwparam+vdwioffset0+vdwjidx0C,
-                                         vdwparam+vdwioffset0+vdwjidx0D,
-                                         &c6_00,&c12_00);
-
-            /* Calculate table index by multiplying r with table scale and truncate to integer */
-            rt               = _mm_mul_ps(r00,vftabscale);
-            vfitab           = _mm_cvttps_epi32(rt);
-            vfeps            = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR));
-            vfitab           = _mm_slli_epi32(vfitab,3);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_ps(isai0,isaj0);
-            gbqqfactor       = _mm_xor_ps(signbit,_mm_mul_ps(qq00,_mm_mul_ps(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_ps(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_ps(r00,gbscale);
-            gbitab           = _mm_cvttps_epi32(rt);
-            gbeps            = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-            Y                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,0) );
-            F                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,1) );
-            G                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,2) );
-            H                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm_mul_ps(gbeps,H);
-            Fp               = _mm_add_ps(F,_mm_mul_ps(gbeps,_mm_add_ps(G,Heps)));
-            VV               = _mm_add_ps(Y,_mm_mul_ps(gbeps,Fp));
-            vgb              = _mm_mul_ps(gbqqfactor,VV);
-
-            FF               = _mm_add_ps(Fp,_mm_mul_ps(gbeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
-            fgb              = _mm_mul_ps(gbqqfactor,_mm_mul_ps(FF,gbscale));
-            dvdatmp          = _mm_mul_ps(minushalf,_mm_add_ps(vgb,_mm_mul_ps(fgb,r00)));
-            dvdatmp          = _mm_andnot_ps(dummy_mask,dvdatmp);
-            dvdasum          = _mm_add_ps(dvdasum,dvdatmp);
-            /* The pointers to scratch make sure that this code with compilers that take gmx_restrict seriously (e.g. icc 13) really can't screw things up. */
-            fjptrA             = (jnrlistA>=0) ? dvda+jnrA : scratch;
-            fjptrB             = (jnrlistB>=0) ? dvda+jnrB : scratch;
-            fjptrC             = (jnrlistC>=0) ? dvda+jnrC : scratch;
-            fjptrD             = (jnrlistD>=0) ? dvda+jnrD : scratch;
-            gmx_mm_increment_4real_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,_mm_mul_ps(dvdatmp,_mm_mul_ps(isaj0,isaj0)));
-            velec            = _mm_mul_ps(qq00,rinv00);
-            felec            = _mm_mul_ps(_mm_sub_ps(_mm_mul_ps(velec,rinv00),fgb),rinv00);
-
-            /* CUBIC SPLINE TABLE DISPERSION */
-            Y                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0) );
-            F                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1) );
-            G                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2) );
-            H                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm_mul_ps(vfeps,H);
-            Fp               = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
-            VV               = _mm_add_ps(Y,_mm_mul_ps(vfeps,Fp));
-            vvdw6            = _mm_mul_ps(c6_00,VV);
-            FF               = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
-            fvdw6            = _mm_mul_ps(c6_00,FF);
-
-            /* CUBIC SPLINE TABLE REPULSION */
-            vfitab           = _mm_add_epi32(vfitab,ifour);
-            Y                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0) );
-            F                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1) );
-            G                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2) );
-            H                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm_mul_ps(vfeps,H);
-            Fp               = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
-            VV               = _mm_add_ps(Y,_mm_mul_ps(vfeps,Fp));
-            vvdw12           = _mm_mul_ps(c12_00,VV);
-            FF               = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
-            fvdw12           = _mm_mul_ps(c12_00,FF);
-            vvdw             = _mm_add_ps(vvdw12,vvdw6);
-            fvdw             = _mm_xor_ps(signbit,_mm_mul_ps(_mm_add_ps(fvdw6,fvdw12),_mm_mul_ps(vftabscale,rinv00)));
-
-            /* Update potential sum for this i atom from the interaction with this j atom. */
-            velec            = _mm_andnot_ps(dummy_mask,velec);
-            velecsum         = _mm_add_ps(velecsum,velec);
-            vgb              = _mm_andnot_ps(dummy_mask,vgb);
-            vgbsum           = _mm_add_ps(vgbsum,vgb);
-            vvdw             = _mm_andnot_ps(dummy_mask,vvdw);
-            vvdwsum          = _mm_add_ps(vvdwsum,vvdw);
-
-            fscal            = _mm_add_ps(felec,fvdw);
-
-            fscal            = _mm_andnot_ps(dummy_mask,fscal);
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm_mul_ps(fscal,dx00);
-            ty               = _mm_mul_ps(fscal,dy00);
-            tz               = _mm_mul_ps(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm_add_ps(fix0,tx);
-            fiy0             = _mm_add_ps(fiy0,ty);
-            fiz0             = _mm_add_ps(fiz0,tz);
-
-            fjptrA             = (jnrlistA>=0) ? f+j_coord_offsetA : scratch;
-            fjptrB             = (jnrlistB>=0) ? f+j_coord_offsetB : scratch;
-            fjptrC             = (jnrlistC>=0) ? f+j_coord_offsetC : scratch;
-            fjptrD             = (jnrlistD>=0) ? f+j_coord_offsetD : scratch;
-            gmx_mm_decrement_1rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,tx,ty,tz);
-
-            /* Inner loop uses 93 flops */
-        }
-
-        /* End of innermost loop */
-
-        gmx_mm_update_iforce_1atom_swizzle_ps(fix0,fiy0,fiz0,
-                                              f+i_coord_offset,fshift+i_shift_offset);
-
-        ggid                        = gid[iidx];
-        /* Update potential energies */
-        gmx_mm_update_1pot_ps(velecsum,kernel_data->energygrp_elec+ggid);
-        gmx_mm_update_1pot_ps(vgbsum,kernel_data->energygrp_polarization+ggid);
-        gmx_mm_update_1pot_ps(vvdwsum,kernel_data->energygrp_vdw+ggid);
-        dvdasum = _mm_mul_ps(dvdasum, _mm_mul_ps(isai0,isai0));
-        gmx_mm_update_1pot_ps(dvdasum,dvda+inr);
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 10 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_VF,outeriter*10 + inneriter*93);
-}
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_sse4_1_single
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            CubicSplineTable
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        Force
- */
-void
-nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_sse4_1_single
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or 
-     * just 0 for non-waters.
-     * Suffixes A,B,C,D refer to j loop unrolling done with SSE, e.g. for the four different
-     * jnr indices corresponding to data put in the four positions in the SIMD register.
-     */
-    int              i_shift_offset,i_coord_offset,outeriter,inneriter;
-    int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
-    int              jnrA,jnrB,jnrC,jnrD;
-    int              jnrlistA,jnrlistB,jnrlistC,jnrlistD;
-    int              j_coord_offsetA,j_coord_offsetB,j_coord_offsetC,j_coord_offsetD;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             rcutoff_scalar;
-    real             *shiftvec,*fshift,*x,*f;
-    real             *fjptrA,*fjptrB,*fjptrC,*fjptrD;
-    real             scratch[4*DIM];
-    __m128           tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
-    int              vdwioffset0;
-    __m128           ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0A,vdwjidx0B,vdwjidx0C,vdwjidx0D;
-    __m128           jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    __m128           dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
-    __m128           velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    __m128i          gbitab;
-    __m128           vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,gbeps,dvdatmp;
-    __m128           minushalf = _mm_set1_ps(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    int              nvdwtype;
-    __m128           rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
-    int              *vdwtype;
-    real             *vdwparam;
-    __m128           one_sixth   = _mm_set1_ps(1.0/6.0);
-    __m128           one_twelfth = _mm_set1_ps(1.0/12.0);
-    __m128i          vfitab;
-    __m128i          ifour       = _mm_set1_epi32(4);
-    __m128           rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF;
-    real             *vftab;
-    __m128           dummy_mask,cutoff_mask;
-    __m128           signbit = _mm_castsi128_ps( _mm_set1_epi32(0x80000000) );
-    __m128           one     = _mm_set1_ps(1.0);
-    __m128           two     = _mm_set1_ps(2.0);
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = _mm_set1_ps(fr->ic->epsfac);
-    charge           = mdatoms->chargeA;
-    nvdwtype         = fr->ntype;
-    vdwparam         = fr->nbfp;
-    vdwtype          = mdatoms->typeA;
-
-    vftab            = kernel_data->table_vdw->data;
-    vftabscale       = _mm_set1_ps(kernel_data->table_vdw->scale);
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = _mm_set1_ps(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = _mm_set1_ps((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-
-    /* Avoid stupid compiler warnings */
-    jnrA = jnrB = jnrC = jnrD = 0;
-    j_coord_offsetA = 0;
-    j_coord_offsetB = 0;
-    j_coord_offsetC = 0;
-    j_coord_offsetD = 0;
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    for(iidx=0;iidx<4*DIM;iidx++)
-    {
-        scratch[iidx] = 0.0;
-    }
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        gmx_mm_load_shift_and_1rvec_broadcast_ps(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
-
-        fix0             = _mm_setzero_ps();
-        fiy0             = _mm_setzero_ps();
-        fiz0             = _mm_setzero_ps();
-
-        /* Load parameters for i particles */
-        iq0              = _mm_mul_ps(facel,_mm_load1_ps(charge+inr+0));
-        isai0            = _mm_load1_ps(invsqrta+inr+0);
-        vdwioffset0      = 2*nvdwtype*vdwtype[inr+0];
-
-        dvdasum          = _mm_setzero_ps();
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end && jjnr[jidx+3]>=0; jidx+=4)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrA             = jjnr[jidx];
-            jnrB             = jjnr[jidx+1];
-            jnrC             = jjnr[jidx+2];
-            jnrD             = jjnr[jidx+3];
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              x+j_coord_offsetC,x+j_coord_offsetD,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_ps(ix0,jx0);
-            dy00             = _mm_sub_ps(iy0,jy0);
-            dz00             = _mm_sub_ps(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
-
-            rinv00           = sse41_invsqrt_f(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm_load_4real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
-                                                              charge+jnrC+0,charge+jnrD+0);
-            isaj0            = gmx_mm_load_4real_swizzle_ps(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                              invsqrta+jnrC+0,invsqrta+jnrD+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-            vdwjidx0B        = 2*vdwtype[jnrB+0];
-            vdwjidx0C        = 2*vdwtype[jnrC+0];
-            vdwjidx0D        = 2*vdwtype[jnrD+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_ps(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_ps(iq0,jq0);
-            gmx_mm_load_4pair_swizzle_ps(vdwparam+vdwioffset0+vdwjidx0A,
-                                         vdwparam+vdwioffset0+vdwjidx0B,
-                                         vdwparam+vdwioffset0+vdwjidx0C,
-                                         vdwparam+vdwioffset0+vdwjidx0D,
-                                         &c6_00,&c12_00);
-
-            /* Calculate table index by multiplying r with table scale and truncate to integer */
-            rt               = _mm_mul_ps(r00,vftabscale);
-            vfitab           = _mm_cvttps_epi32(rt);
-            vfeps            = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR));
-            vfitab           = _mm_slli_epi32(vfitab,3);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_ps(isai0,isaj0);
-            gbqqfactor       = _mm_xor_ps(signbit,_mm_mul_ps(qq00,_mm_mul_ps(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_ps(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_ps(r00,gbscale);
-            gbitab           = _mm_cvttps_epi32(rt);
-            gbeps            = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-            Y                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,0) );
-            F                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,1) );
-            G                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,2) );
-            H                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm_mul_ps(gbeps,H);
-            Fp               = _mm_add_ps(F,_mm_mul_ps(gbeps,_mm_add_ps(G,Heps)));
-            VV               = _mm_add_ps(Y,_mm_mul_ps(gbeps,Fp));
-            vgb              = _mm_mul_ps(gbqqfactor,VV);
-
-            FF               = _mm_add_ps(Fp,_mm_mul_ps(gbeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
-            fgb              = _mm_mul_ps(gbqqfactor,_mm_mul_ps(FF,gbscale));
-            dvdatmp          = _mm_mul_ps(minushalf,_mm_add_ps(vgb,_mm_mul_ps(fgb,r00)));
-            dvdasum          = _mm_add_ps(dvdasum,dvdatmp);
-            fjptrA           = dvda+jnrA;
-            fjptrB           = dvda+jnrB;
-            fjptrC           = dvda+jnrC;
-            fjptrD           = dvda+jnrD;
-            gmx_mm_increment_4real_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,_mm_mul_ps(dvdatmp,_mm_mul_ps(isaj0,isaj0)));
-            velec            = _mm_mul_ps(qq00,rinv00);
-            felec            = _mm_mul_ps(_mm_sub_ps(_mm_mul_ps(velec,rinv00),fgb),rinv00);
-
-            /* CUBIC SPLINE TABLE DISPERSION */
-            Y                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0) );
-            F                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1) );
-            G                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2) );
-            H                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm_mul_ps(vfeps,H);
-            Fp               = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
-            FF               = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
-            fvdw6            = _mm_mul_ps(c6_00,FF);
-
-            /* CUBIC SPLINE TABLE REPULSION */
-            vfitab           = _mm_add_epi32(vfitab,ifour);
-            Y                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0) );
-            F                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1) );
-            G                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2) );
-            H                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm_mul_ps(vfeps,H);
-            Fp               = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
-            FF               = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
-            fvdw12           = _mm_mul_ps(c12_00,FF);
-            fvdw             = _mm_xor_ps(signbit,_mm_mul_ps(_mm_add_ps(fvdw6,fvdw12),_mm_mul_ps(vftabscale,rinv00)));
-
-            fscal            = _mm_add_ps(felec,fvdw);
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm_mul_ps(fscal,dx00);
-            ty               = _mm_mul_ps(fscal,dy00);
-            tz               = _mm_mul_ps(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm_add_ps(fix0,tx);
-            fiy0             = _mm_add_ps(fiy0,ty);
-            fiz0             = _mm_add_ps(fiz0,tz);
-
-            fjptrA             = f+j_coord_offsetA;
-            fjptrB             = f+j_coord_offsetB;
-            fjptrC             = f+j_coord_offsetC;
-            fjptrD             = f+j_coord_offsetD;
-            gmx_mm_decrement_1rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,tx,ty,tz);
-
-            /* Inner loop uses 82 flops */
-        }
-
-        if(jidx<j_index_end)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrlistA         = jjnr[jidx];
-            jnrlistB         = jjnr[jidx+1];
-            jnrlistC         = jjnr[jidx+2];
-            jnrlistD         = jjnr[jidx+3];
-            /* Sign of each element will be negative for non-real atoms.
-             * This mask will be 0xFFFFFFFF for dummy entries and 0x0 for real ones,
-             * so use it as val = _mm_andnot_ps(mask,val) to clear dummy entries.
-             */
-            dummy_mask = gmx_mm_castsi128_ps(_mm_cmplt_epi32(_mm_loadu_si128((const __m128i *)(jjnr+jidx)),_mm_setzero_si128()));
-            jnrA       = (jnrlistA>=0) ? jnrlistA : 0;
-            jnrB       = (jnrlistB>=0) ? jnrlistB : 0;
-            jnrC       = (jnrlistC>=0) ? jnrlistC : 0;
-            jnrD       = (jnrlistD>=0) ? jnrlistD : 0;
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              x+j_coord_offsetC,x+j_coord_offsetD,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_ps(ix0,jx0);
-            dy00             = _mm_sub_ps(iy0,jy0);
-            dz00             = _mm_sub_ps(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
-
-            rinv00           = sse41_invsqrt_f(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm_load_4real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
-                                                              charge+jnrC+0,charge+jnrD+0);
-            isaj0            = gmx_mm_load_4real_swizzle_ps(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                              invsqrta+jnrC+0,invsqrta+jnrD+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-            vdwjidx0B        = 2*vdwtype[jnrB+0];
-            vdwjidx0C        = 2*vdwtype[jnrC+0];
-            vdwjidx0D        = 2*vdwtype[jnrD+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_ps(rsq00,rinv00);
-            r00              = _mm_andnot_ps(dummy_mask,r00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_ps(iq0,jq0);
-            gmx_mm_load_4pair_swizzle_ps(vdwparam+vdwioffset0+vdwjidx0A,
-                                         vdwparam+vdwioffset0+vdwjidx0B,
-                                         vdwparam+vdwioffset0+vdwjidx0C,
-                                         vdwparam+vdwioffset0+vdwjidx0D,
-                                         &c6_00,&c12_00);
-
-            /* Calculate table index by multiplying r with table scale and truncate to integer */
-            rt               = _mm_mul_ps(r00,vftabscale);
-            vfitab           = _mm_cvttps_epi32(rt);
-            vfeps            = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR));
-            vfitab           = _mm_slli_epi32(vfitab,3);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_ps(isai0,isaj0);
-            gbqqfactor       = _mm_xor_ps(signbit,_mm_mul_ps(qq00,_mm_mul_ps(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_ps(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_ps(r00,gbscale);
-            gbitab           = _mm_cvttps_epi32(rt);
-            gbeps            = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-            Y                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,0) );
-            F                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,1) );
-            G                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,2) );
-            H                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm_mul_ps(gbeps,H);
-            Fp               = _mm_add_ps(F,_mm_mul_ps(gbeps,_mm_add_ps(G,Heps)));
-            VV               = _mm_add_ps(Y,_mm_mul_ps(gbeps,Fp));
-            vgb              = _mm_mul_ps(gbqqfactor,VV);
-
-            FF               = _mm_add_ps(Fp,_mm_mul_ps(gbeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
-            fgb              = _mm_mul_ps(gbqqfactor,_mm_mul_ps(FF,gbscale));
-            dvdatmp          = _mm_mul_ps(minushalf,_mm_add_ps(vgb,_mm_mul_ps(fgb,r00)));
-            dvdatmp          = _mm_andnot_ps(dummy_mask,dvdatmp);
-            dvdasum          = _mm_add_ps(dvdasum,dvdatmp);
-            /* The pointers to scratch make sure that this code with compilers that take gmx_restrict seriously (e.g. icc 13) really can't screw things up. */
-            fjptrA             = (jnrlistA>=0) ? dvda+jnrA : scratch;
-            fjptrB             = (jnrlistB>=0) ? dvda+jnrB : scratch;
-            fjptrC             = (jnrlistC>=0) ? dvda+jnrC : scratch;
-            fjptrD             = (jnrlistD>=0) ? dvda+jnrD : scratch;
-            gmx_mm_increment_4real_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,_mm_mul_ps(dvdatmp,_mm_mul_ps(isaj0,isaj0)));
-            velec            = _mm_mul_ps(qq00,rinv00);
-            felec            = _mm_mul_ps(_mm_sub_ps(_mm_mul_ps(velec,rinv00),fgb),rinv00);
-
-            /* CUBIC SPLINE TABLE DISPERSION */
-            Y                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0) );
-            F                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1) );
-            G                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2) );
-            H                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm_mul_ps(vfeps,H);
-            Fp               = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
-            FF               = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
-            fvdw6            = _mm_mul_ps(c6_00,FF);
-
-            /* CUBIC SPLINE TABLE REPULSION */
-            vfitab           = _mm_add_epi32(vfitab,ifour);
-            Y                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,0) );
-            F                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,1) );
-            G                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,2) );
-            H                = _mm_load_ps( vftab + gmx_mm_extract_epi32(vfitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm_mul_ps(vfeps,H);
-            Fp               = _mm_add_ps(F,_mm_mul_ps(vfeps,_mm_add_ps(G,Heps)));
-            FF               = _mm_add_ps(Fp,_mm_mul_ps(vfeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
-            fvdw12           = _mm_mul_ps(c12_00,FF);
-            fvdw             = _mm_xor_ps(signbit,_mm_mul_ps(_mm_add_ps(fvdw6,fvdw12),_mm_mul_ps(vftabscale,rinv00)));
-
-            fscal            = _mm_add_ps(felec,fvdw);
-
-            fscal            = _mm_andnot_ps(dummy_mask,fscal);
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm_mul_ps(fscal,dx00);
-            ty               = _mm_mul_ps(fscal,dy00);
-            tz               = _mm_mul_ps(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm_add_ps(fix0,tx);
-            fiy0             = _mm_add_ps(fiy0,ty);
-            fiz0             = _mm_add_ps(fiz0,tz);
-
-            fjptrA             = (jnrlistA>=0) ? f+j_coord_offsetA : scratch;
-            fjptrB             = (jnrlistB>=0) ? f+j_coord_offsetB : scratch;
-            fjptrC             = (jnrlistC>=0) ? f+j_coord_offsetC : scratch;
-            fjptrD             = (jnrlistD>=0) ? f+j_coord_offsetD : scratch;
-            gmx_mm_decrement_1rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,tx,ty,tz);
-
-            /* Inner loop uses 83 flops */
-        }
-
-        /* End of innermost loop */
-
-        gmx_mm_update_iforce_1atom_swizzle_ps(fix0,fiy0,fiz0,
-                                              f+i_coord_offset,fshift+i_shift_offset);
-
-        dvdasum = _mm_mul_ps(dvdasum, _mm_mul_ps(isai0,isai0));
-        gmx_mm_update_1pot_ps(dvdasum,dvda+inr);
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 7 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_F,outeriter*7 + inneriter*83);
-}
diff --git a/src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecGB_VdwLJ_GeomP1P1_sse4_1_single.c b/src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecGB_VdwLJ_GeomP1P1_sse4_1_single.c
deleted file mode 100644 (file)
index 8437ac2..0000000
+++ /dev/null
@@ -1,852 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
- * and including many others, as listed in the AUTHORS file in the
- * top-level source directory and at http://www.gromacs.org.
- *
- * GROMACS is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * GROMACS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GROMACS; if not, see
- * http://www.gnu.org/licenses, or write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
- *
- * If you want to redistribute modifications to GROMACS, please
- * consider that scientific software is very special. Version
- * control is crucial - bugs must be traceable. We will be happy to
- * consider code for inclusion in the official distribution, but
- * derived work must not be called official GROMACS. Details are found
- * in the README & COPYING files - if they are missing, get the
- * official version at http://www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the research papers on the package. Check out http://www.gromacs.org.
- */
-/*
- * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
- */
-#include "gmxpre.h"
-
-#include "config.h"
-
-#include <math.h>
-
-#include "../nb_kernel.h"
-#include "gromacs/gmxlib/nrnb.h"
-
-#include "kernelutil_x86_sse4_1_single.h"
-
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_sse4_1_single
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            LennardJones
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        PotentialAndForce
- */
-void
-nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_sse4_1_single
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or 
-     * just 0 for non-waters.
-     * Suffixes A,B,C,D refer to j loop unrolling done with SSE, e.g. for the four different
-     * jnr indices corresponding to data put in the four positions in the SIMD register.
-     */
-    int              i_shift_offset,i_coord_offset,outeriter,inneriter;
-    int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
-    int              jnrA,jnrB,jnrC,jnrD;
-    int              jnrlistA,jnrlistB,jnrlistC,jnrlistD;
-    int              j_coord_offsetA,j_coord_offsetB,j_coord_offsetC,j_coord_offsetD;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             rcutoff_scalar;
-    real             *shiftvec,*fshift,*x,*f;
-    real             *fjptrA,*fjptrB,*fjptrC,*fjptrD;
-    real             scratch[4*DIM];
-    __m128           tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
-    int              vdwioffset0;
-    __m128           ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0A,vdwjidx0B,vdwjidx0C,vdwjidx0D;
-    __m128           jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    __m128           dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
-    __m128           velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    __m128i          gbitab;
-    __m128           vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,gbeps,dvdatmp;
-    __m128           minushalf = _mm_set1_ps(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    int              nvdwtype;
-    __m128           rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
-    int              *vdwtype;
-    real             *vdwparam;
-    __m128           one_sixth   = _mm_set1_ps(1.0/6.0);
-    __m128           one_twelfth = _mm_set1_ps(1.0/12.0);
-    __m128i          vfitab;
-    __m128i          ifour       = _mm_set1_epi32(4);
-    __m128           rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF;
-    real             *vftab;
-    __m128           dummy_mask,cutoff_mask;
-    __m128           signbit = _mm_castsi128_ps( _mm_set1_epi32(0x80000000) );
-    __m128           one     = _mm_set1_ps(1.0);
-    __m128           two     = _mm_set1_ps(2.0);
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = _mm_set1_ps(fr->ic->epsfac);
-    charge           = mdatoms->chargeA;
-    nvdwtype         = fr->ntype;
-    vdwparam         = fr->nbfp;
-    vdwtype          = mdatoms->typeA;
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = _mm_set1_ps(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = _mm_set1_ps((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-
-    /* Avoid stupid compiler warnings */
-    jnrA = jnrB = jnrC = jnrD = 0;
-    j_coord_offsetA = 0;
-    j_coord_offsetB = 0;
-    j_coord_offsetC = 0;
-    j_coord_offsetD = 0;
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    for(iidx=0;iidx<4*DIM;iidx++)
-    {
-        scratch[iidx] = 0.0;
-    }
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        gmx_mm_load_shift_and_1rvec_broadcast_ps(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
-
-        fix0             = _mm_setzero_ps();
-        fiy0             = _mm_setzero_ps();
-        fiz0             = _mm_setzero_ps();
-
-        /* Load parameters for i particles */
-        iq0              = _mm_mul_ps(facel,_mm_load1_ps(charge+inr+0));
-        isai0            = _mm_load1_ps(invsqrta+inr+0);
-        vdwioffset0      = 2*nvdwtype*vdwtype[inr+0];
-
-        /* Reset potential sums */
-        velecsum         = _mm_setzero_ps();
-        vgbsum           = _mm_setzero_ps();
-        vvdwsum          = _mm_setzero_ps();
-        dvdasum          = _mm_setzero_ps();
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end && jjnr[jidx+3]>=0; jidx+=4)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrA             = jjnr[jidx];
-            jnrB             = jjnr[jidx+1];
-            jnrC             = jjnr[jidx+2];
-            jnrD             = jjnr[jidx+3];
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              x+j_coord_offsetC,x+j_coord_offsetD,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_ps(ix0,jx0);
-            dy00             = _mm_sub_ps(iy0,jy0);
-            dz00             = _mm_sub_ps(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
-
-            rinv00           = sse41_invsqrt_f(rsq00);
-
-            rinvsq00         = _mm_mul_ps(rinv00,rinv00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm_load_4real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
-                                                              charge+jnrC+0,charge+jnrD+0);
-            isaj0            = gmx_mm_load_4real_swizzle_ps(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                              invsqrta+jnrC+0,invsqrta+jnrD+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-            vdwjidx0B        = 2*vdwtype[jnrB+0];
-            vdwjidx0C        = 2*vdwtype[jnrC+0];
-            vdwjidx0D        = 2*vdwtype[jnrD+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_ps(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_ps(iq0,jq0);
-            gmx_mm_load_4pair_swizzle_ps(vdwparam+vdwioffset0+vdwjidx0A,
-                                         vdwparam+vdwioffset0+vdwjidx0B,
-                                         vdwparam+vdwioffset0+vdwjidx0C,
-                                         vdwparam+vdwioffset0+vdwjidx0D,
-                                         &c6_00,&c12_00);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_ps(isai0,isaj0);
-            gbqqfactor       = _mm_xor_ps(signbit,_mm_mul_ps(qq00,_mm_mul_ps(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_ps(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_ps(r00,gbscale);
-            gbitab           = _mm_cvttps_epi32(rt);
-            gbeps            = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-            Y                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,0) );
-            F                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,1) );
-            G                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,2) );
-            H                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm_mul_ps(gbeps,H);
-            Fp               = _mm_add_ps(F,_mm_mul_ps(gbeps,_mm_add_ps(G,Heps)));
-            VV               = _mm_add_ps(Y,_mm_mul_ps(gbeps,Fp));
-            vgb              = _mm_mul_ps(gbqqfactor,VV);
-
-            FF               = _mm_add_ps(Fp,_mm_mul_ps(gbeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
-            fgb              = _mm_mul_ps(gbqqfactor,_mm_mul_ps(FF,gbscale));
-            dvdatmp          = _mm_mul_ps(minushalf,_mm_add_ps(vgb,_mm_mul_ps(fgb,r00)));
-            dvdasum          = _mm_add_ps(dvdasum,dvdatmp);
-            fjptrA           = dvda+jnrA;
-            fjptrB           = dvda+jnrB;
-            fjptrC           = dvda+jnrC;
-            fjptrD           = dvda+jnrD;
-            gmx_mm_increment_4real_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,_mm_mul_ps(dvdatmp,_mm_mul_ps(isaj0,isaj0)));
-            velec            = _mm_mul_ps(qq00,rinv00);
-            felec            = _mm_mul_ps(_mm_sub_ps(_mm_mul_ps(velec,rinv00),fgb),rinv00);
-
-            /* LENNARD-JONES DISPERSION/REPULSION */
-
-            rinvsix          = _mm_mul_ps(_mm_mul_ps(rinvsq00,rinvsq00),rinvsq00);
-            vvdw6            = _mm_mul_ps(c6_00,rinvsix);
-            vvdw12           = _mm_mul_ps(c12_00,_mm_mul_ps(rinvsix,rinvsix));
-            vvdw             = _mm_sub_ps( _mm_mul_ps(vvdw12,one_twelfth) , _mm_mul_ps(vvdw6,one_sixth) );
-            fvdw             = _mm_mul_ps(_mm_sub_ps(vvdw12,vvdw6),rinvsq00);
-
-            /* Update potential sum for this i atom from the interaction with this j atom. */
-            velecsum         = _mm_add_ps(velecsum,velec);
-            vgbsum           = _mm_add_ps(vgbsum,vgb);
-            vvdwsum          = _mm_add_ps(vvdwsum,vvdw);
-
-            fscal            = _mm_add_ps(felec,fvdw);
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm_mul_ps(fscal,dx00);
-            ty               = _mm_mul_ps(fscal,dy00);
-            tz               = _mm_mul_ps(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm_add_ps(fix0,tx);
-            fiy0             = _mm_add_ps(fiy0,ty);
-            fiz0             = _mm_add_ps(fiz0,tz);
-
-            fjptrA             = f+j_coord_offsetA;
-            fjptrB             = f+j_coord_offsetB;
-            fjptrC             = f+j_coord_offsetC;
-            fjptrD             = f+j_coord_offsetD;
-            gmx_mm_decrement_1rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,tx,ty,tz);
-
-            /* Inner loop uses 71 flops */
-        }
-
-        if(jidx<j_index_end)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrlistA         = jjnr[jidx];
-            jnrlistB         = jjnr[jidx+1];
-            jnrlistC         = jjnr[jidx+2];
-            jnrlistD         = jjnr[jidx+3];
-            /* Sign of each element will be negative for non-real atoms.
-             * This mask will be 0xFFFFFFFF for dummy entries and 0x0 for real ones,
-             * so use it as val = _mm_andnot_ps(mask,val) to clear dummy entries.
-             */
-            dummy_mask = gmx_mm_castsi128_ps(_mm_cmplt_epi32(_mm_loadu_si128((const __m128i *)(jjnr+jidx)),_mm_setzero_si128()));
-            jnrA       = (jnrlistA>=0) ? jnrlistA : 0;
-            jnrB       = (jnrlistB>=0) ? jnrlistB : 0;
-            jnrC       = (jnrlistC>=0) ? jnrlistC : 0;
-            jnrD       = (jnrlistD>=0) ? jnrlistD : 0;
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              x+j_coord_offsetC,x+j_coord_offsetD,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_ps(ix0,jx0);
-            dy00             = _mm_sub_ps(iy0,jy0);
-            dz00             = _mm_sub_ps(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
-
-            rinv00           = sse41_invsqrt_f(rsq00);
-
-            rinvsq00         = _mm_mul_ps(rinv00,rinv00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm_load_4real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
-                                                              charge+jnrC+0,charge+jnrD+0);
-            isaj0            = gmx_mm_load_4real_swizzle_ps(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                              invsqrta+jnrC+0,invsqrta+jnrD+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-            vdwjidx0B        = 2*vdwtype[jnrB+0];
-            vdwjidx0C        = 2*vdwtype[jnrC+0];
-            vdwjidx0D        = 2*vdwtype[jnrD+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_ps(rsq00,rinv00);
-            r00              = _mm_andnot_ps(dummy_mask,r00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_ps(iq0,jq0);
-            gmx_mm_load_4pair_swizzle_ps(vdwparam+vdwioffset0+vdwjidx0A,
-                                         vdwparam+vdwioffset0+vdwjidx0B,
-                                         vdwparam+vdwioffset0+vdwjidx0C,
-                                         vdwparam+vdwioffset0+vdwjidx0D,
-                                         &c6_00,&c12_00);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_ps(isai0,isaj0);
-            gbqqfactor       = _mm_xor_ps(signbit,_mm_mul_ps(qq00,_mm_mul_ps(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_ps(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_ps(r00,gbscale);
-            gbitab           = _mm_cvttps_epi32(rt);
-            gbeps            = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-            Y                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,0) );
-            F                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,1) );
-            G                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,2) );
-            H                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm_mul_ps(gbeps,H);
-            Fp               = _mm_add_ps(F,_mm_mul_ps(gbeps,_mm_add_ps(G,Heps)));
-            VV               = _mm_add_ps(Y,_mm_mul_ps(gbeps,Fp));
-            vgb              = _mm_mul_ps(gbqqfactor,VV);
-
-            FF               = _mm_add_ps(Fp,_mm_mul_ps(gbeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
-            fgb              = _mm_mul_ps(gbqqfactor,_mm_mul_ps(FF,gbscale));
-            dvdatmp          = _mm_mul_ps(minushalf,_mm_add_ps(vgb,_mm_mul_ps(fgb,r00)));
-            dvdatmp          = _mm_andnot_ps(dummy_mask,dvdatmp);
-            dvdasum          = _mm_add_ps(dvdasum,dvdatmp);
-            /* The pointers to scratch make sure that this code with compilers that take gmx_restrict seriously (e.g. icc 13) really can't screw things up. */
-            fjptrA             = (jnrlistA>=0) ? dvda+jnrA : scratch;
-            fjptrB             = (jnrlistB>=0) ? dvda+jnrB : scratch;
-            fjptrC             = (jnrlistC>=0) ? dvda+jnrC : scratch;
-            fjptrD             = (jnrlistD>=0) ? dvda+jnrD : scratch;
-            gmx_mm_increment_4real_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,_mm_mul_ps(dvdatmp,_mm_mul_ps(isaj0,isaj0)));
-            velec            = _mm_mul_ps(qq00,rinv00);
-            felec            = _mm_mul_ps(_mm_sub_ps(_mm_mul_ps(velec,rinv00),fgb),rinv00);
-
-            /* LENNARD-JONES DISPERSION/REPULSION */
-
-            rinvsix          = _mm_mul_ps(_mm_mul_ps(rinvsq00,rinvsq00),rinvsq00);
-            vvdw6            = _mm_mul_ps(c6_00,rinvsix);
-            vvdw12           = _mm_mul_ps(c12_00,_mm_mul_ps(rinvsix,rinvsix));
-            vvdw             = _mm_sub_ps( _mm_mul_ps(vvdw12,one_twelfth) , _mm_mul_ps(vvdw6,one_sixth) );
-            fvdw             = _mm_mul_ps(_mm_sub_ps(vvdw12,vvdw6),rinvsq00);
-
-            /* Update potential sum for this i atom from the interaction with this j atom. */
-            velec            = _mm_andnot_ps(dummy_mask,velec);
-            velecsum         = _mm_add_ps(velecsum,velec);
-            vgb              = _mm_andnot_ps(dummy_mask,vgb);
-            vgbsum           = _mm_add_ps(vgbsum,vgb);
-            vvdw             = _mm_andnot_ps(dummy_mask,vvdw);
-            vvdwsum          = _mm_add_ps(vvdwsum,vvdw);
-
-            fscal            = _mm_add_ps(felec,fvdw);
-
-            fscal            = _mm_andnot_ps(dummy_mask,fscal);
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm_mul_ps(fscal,dx00);
-            ty               = _mm_mul_ps(fscal,dy00);
-            tz               = _mm_mul_ps(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm_add_ps(fix0,tx);
-            fiy0             = _mm_add_ps(fiy0,ty);
-            fiz0             = _mm_add_ps(fiz0,tz);
-
-            fjptrA             = (jnrlistA>=0) ? f+j_coord_offsetA : scratch;
-            fjptrB             = (jnrlistB>=0) ? f+j_coord_offsetB : scratch;
-            fjptrC             = (jnrlistC>=0) ? f+j_coord_offsetC : scratch;
-            fjptrD             = (jnrlistD>=0) ? f+j_coord_offsetD : scratch;
-            gmx_mm_decrement_1rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,tx,ty,tz);
-
-            /* Inner loop uses 72 flops */
-        }
-
-        /* End of innermost loop */
-
-        gmx_mm_update_iforce_1atom_swizzle_ps(fix0,fiy0,fiz0,
-                                              f+i_coord_offset,fshift+i_shift_offset);
-
-        ggid                        = gid[iidx];
-        /* Update potential energies */
-        gmx_mm_update_1pot_ps(velecsum,kernel_data->energygrp_elec+ggid);
-        gmx_mm_update_1pot_ps(vgbsum,kernel_data->energygrp_polarization+ggid);
-        gmx_mm_update_1pot_ps(vvdwsum,kernel_data->energygrp_vdw+ggid);
-        dvdasum = _mm_mul_ps(dvdasum, _mm_mul_ps(isai0,isai0));
-        gmx_mm_update_1pot_ps(dvdasum,dvda+inr);
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 10 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_VF,outeriter*10 + inneriter*72);
-}
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_sse4_1_single
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            LennardJones
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        Force
- */
-void
-nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_sse4_1_single
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or 
-     * just 0 for non-waters.
-     * Suffixes A,B,C,D refer to j loop unrolling done with SSE, e.g. for the four different
-     * jnr indices corresponding to data put in the four positions in the SIMD register.
-     */
-    int              i_shift_offset,i_coord_offset,outeriter,inneriter;
-    int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
-    int              jnrA,jnrB,jnrC,jnrD;
-    int              jnrlistA,jnrlistB,jnrlistC,jnrlistD;
-    int              j_coord_offsetA,j_coord_offsetB,j_coord_offsetC,j_coord_offsetD;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             rcutoff_scalar;
-    real             *shiftvec,*fshift,*x,*f;
-    real             *fjptrA,*fjptrB,*fjptrC,*fjptrD;
-    real             scratch[4*DIM];
-    __m128           tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
-    int              vdwioffset0;
-    __m128           ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0A,vdwjidx0B,vdwjidx0C,vdwjidx0D;
-    __m128           jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    __m128           dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
-    __m128           velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    __m128i          gbitab;
-    __m128           vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,gbeps,dvdatmp;
-    __m128           minushalf = _mm_set1_ps(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    int              nvdwtype;
-    __m128           rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
-    int              *vdwtype;
-    real             *vdwparam;
-    __m128           one_sixth   = _mm_set1_ps(1.0/6.0);
-    __m128           one_twelfth = _mm_set1_ps(1.0/12.0);
-    __m128i          vfitab;
-    __m128i          ifour       = _mm_set1_epi32(4);
-    __m128           rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF;
-    real             *vftab;
-    __m128           dummy_mask,cutoff_mask;
-    __m128           signbit = _mm_castsi128_ps( _mm_set1_epi32(0x80000000) );
-    __m128           one     = _mm_set1_ps(1.0);
-    __m128           two     = _mm_set1_ps(2.0);
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = _mm_set1_ps(fr->ic->epsfac);
-    charge           = mdatoms->chargeA;
-    nvdwtype         = fr->ntype;
-    vdwparam         = fr->nbfp;
-    vdwtype          = mdatoms->typeA;
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = _mm_set1_ps(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = _mm_set1_ps((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-
-    /* Avoid stupid compiler warnings */
-    jnrA = jnrB = jnrC = jnrD = 0;
-    j_coord_offsetA = 0;
-    j_coord_offsetB = 0;
-    j_coord_offsetC = 0;
-    j_coord_offsetD = 0;
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    for(iidx=0;iidx<4*DIM;iidx++)
-    {
-        scratch[iidx] = 0.0;
-    }
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        gmx_mm_load_shift_and_1rvec_broadcast_ps(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
-
-        fix0             = _mm_setzero_ps();
-        fiy0             = _mm_setzero_ps();
-        fiz0             = _mm_setzero_ps();
-
-        /* Load parameters for i particles */
-        iq0              = _mm_mul_ps(facel,_mm_load1_ps(charge+inr+0));
-        isai0            = _mm_load1_ps(invsqrta+inr+0);
-        vdwioffset0      = 2*nvdwtype*vdwtype[inr+0];
-
-        dvdasum          = _mm_setzero_ps();
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end && jjnr[jidx+3]>=0; jidx+=4)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrA             = jjnr[jidx];
-            jnrB             = jjnr[jidx+1];
-            jnrC             = jjnr[jidx+2];
-            jnrD             = jjnr[jidx+3];
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              x+j_coord_offsetC,x+j_coord_offsetD,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_ps(ix0,jx0);
-            dy00             = _mm_sub_ps(iy0,jy0);
-            dz00             = _mm_sub_ps(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
-
-            rinv00           = sse41_invsqrt_f(rsq00);
-
-            rinvsq00         = _mm_mul_ps(rinv00,rinv00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm_load_4real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
-                                                              charge+jnrC+0,charge+jnrD+0);
-            isaj0            = gmx_mm_load_4real_swizzle_ps(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                              invsqrta+jnrC+0,invsqrta+jnrD+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-            vdwjidx0B        = 2*vdwtype[jnrB+0];
-            vdwjidx0C        = 2*vdwtype[jnrC+0];
-            vdwjidx0D        = 2*vdwtype[jnrD+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_ps(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_ps(iq0,jq0);
-            gmx_mm_load_4pair_swizzle_ps(vdwparam+vdwioffset0+vdwjidx0A,
-                                         vdwparam+vdwioffset0+vdwjidx0B,
-                                         vdwparam+vdwioffset0+vdwjidx0C,
-                                         vdwparam+vdwioffset0+vdwjidx0D,
-                                         &c6_00,&c12_00);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_ps(isai0,isaj0);
-            gbqqfactor       = _mm_xor_ps(signbit,_mm_mul_ps(qq00,_mm_mul_ps(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_ps(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_ps(r00,gbscale);
-            gbitab           = _mm_cvttps_epi32(rt);
-            gbeps            = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-            Y                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,0) );
-            F                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,1) );
-            G                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,2) );
-            H                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm_mul_ps(gbeps,H);
-            Fp               = _mm_add_ps(F,_mm_mul_ps(gbeps,_mm_add_ps(G,Heps)));
-            VV               = _mm_add_ps(Y,_mm_mul_ps(gbeps,Fp));
-            vgb              = _mm_mul_ps(gbqqfactor,VV);
-
-            FF               = _mm_add_ps(Fp,_mm_mul_ps(gbeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
-            fgb              = _mm_mul_ps(gbqqfactor,_mm_mul_ps(FF,gbscale));
-            dvdatmp          = _mm_mul_ps(minushalf,_mm_add_ps(vgb,_mm_mul_ps(fgb,r00)));
-            dvdasum          = _mm_add_ps(dvdasum,dvdatmp);
-            fjptrA           = dvda+jnrA;
-            fjptrB           = dvda+jnrB;
-            fjptrC           = dvda+jnrC;
-            fjptrD           = dvda+jnrD;
-            gmx_mm_increment_4real_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,_mm_mul_ps(dvdatmp,_mm_mul_ps(isaj0,isaj0)));
-            velec            = _mm_mul_ps(qq00,rinv00);
-            felec            = _mm_mul_ps(_mm_sub_ps(_mm_mul_ps(velec,rinv00),fgb),rinv00);
-
-            /* LENNARD-JONES DISPERSION/REPULSION */
-
-            rinvsix          = _mm_mul_ps(_mm_mul_ps(rinvsq00,rinvsq00),rinvsq00);
-            fvdw             = _mm_mul_ps(_mm_sub_ps(_mm_mul_ps(c12_00,rinvsix),c6_00),_mm_mul_ps(rinvsix,rinvsq00));
-
-            fscal            = _mm_add_ps(felec,fvdw);
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm_mul_ps(fscal,dx00);
-            ty               = _mm_mul_ps(fscal,dy00);
-            tz               = _mm_mul_ps(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm_add_ps(fix0,tx);
-            fiy0             = _mm_add_ps(fiy0,ty);
-            fiz0             = _mm_add_ps(fiz0,tz);
-
-            fjptrA             = f+j_coord_offsetA;
-            fjptrB             = f+j_coord_offsetB;
-            fjptrC             = f+j_coord_offsetC;
-            fjptrD             = f+j_coord_offsetD;
-            gmx_mm_decrement_1rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,tx,ty,tz);
-
-            /* Inner loop uses 64 flops */
-        }
-
-        if(jidx<j_index_end)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrlistA         = jjnr[jidx];
-            jnrlistB         = jjnr[jidx+1];
-            jnrlistC         = jjnr[jidx+2];
-            jnrlistD         = jjnr[jidx+3];
-            /* Sign of each element will be negative for non-real atoms.
-             * This mask will be 0xFFFFFFFF for dummy entries and 0x0 for real ones,
-             * so use it as val = _mm_andnot_ps(mask,val) to clear dummy entries.
-             */
-            dummy_mask = gmx_mm_castsi128_ps(_mm_cmplt_epi32(_mm_loadu_si128((const __m128i *)(jjnr+jidx)),_mm_setzero_si128()));
-            jnrA       = (jnrlistA>=0) ? jnrlistA : 0;
-            jnrB       = (jnrlistB>=0) ? jnrlistB : 0;
-            jnrC       = (jnrlistC>=0) ? jnrlistC : 0;
-            jnrD       = (jnrlistD>=0) ? jnrlistD : 0;
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              x+j_coord_offsetC,x+j_coord_offsetD,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_ps(ix0,jx0);
-            dy00             = _mm_sub_ps(iy0,jy0);
-            dz00             = _mm_sub_ps(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
-
-            rinv00           = sse41_invsqrt_f(rsq00);
-
-            rinvsq00         = _mm_mul_ps(rinv00,rinv00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm_load_4real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
-                                                              charge+jnrC+0,charge+jnrD+0);
-            isaj0            = gmx_mm_load_4real_swizzle_ps(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                              invsqrta+jnrC+0,invsqrta+jnrD+0);
-            vdwjidx0A        = 2*vdwtype[jnrA+0];
-            vdwjidx0B        = 2*vdwtype[jnrB+0];
-            vdwjidx0C        = 2*vdwtype[jnrC+0];
-            vdwjidx0D        = 2*vdwtype[jnrD+0];
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_ps(rsq00,rinv00);
-            r00              = _mm_andnot_ps(dummy_mask,r00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_ps(iq0,jq0);
-            gmx_mm_load_4pair_swizzle_ps(vdwparam+vdwioffset0+vdwjidx0A,
-                                         vdwparam+vdwioffset0+vdwjidx0B,
-                                         vdwparam+vdwioffset0+vdwjidx0C,
-                                         vdwparam+vdwioffset0+vdwjidx0D,
-                                         &c6_00,&c12_00);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_ps(isai0,isaj0);
-            gbqqfactor       = _mm_xor_ps(signbit,_mm_mul_ps(qq00,_mm_mul_ps(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_ps(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_ps(r00,gbscale);
-            gbitab           = _mm_cvttps_epi32(rt);
-            gbeps            = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-            Y                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,0) );
-            F                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,1) );
-            G                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,2) );
-            H                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm_mul_ps(gbeps,H);
-            Fp               = _mm_add_ps(F,_mm_mul_ps(gbeps,_mm_add_ps(G,Heps)));
-            VV               = _mm_add_ps(Y,_mm_mul_ps(gbeps,Fp));
-            vgb              = _mm_mul_ps(gbqqfactor,VV);
-
-            FF               = _mm_add_ps(Fp,_mm_mul_ps(gbeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
-            fgb              = _mm_mul_ps(gbqqfactor,_mm_mul_ps(FF,gbscale));
-            dvdatmp          = _mm_mul_ps(minushalf,_mm_add_ps(vgb,_mm_mul_ps(fgb,r00)));
-            dvdatmp          = _mm_andnot_ps(dummy_mask,dvdatmp);
-            dvdasum          = _mm_add_ps(dvdasum,dvdatmp);
-            /* The pointers to scratch make sure that this code with compilers that take gmx_restrict seriously (e.g. icc 13) really can't screw things up. */
-            fjptrA             = (jnrlistA>=0) ? dvda+jnrA : scratch;
-            fjptrB             = (jnrlistB>=0) ? dvda+jnrB : scratch;
-            fjptrC             = (jnrlistC>=0) ? dvda+jnrC : scratch;
-            fjptrD             = (jnrlistD>=0) ? dvda+jnrD : scratch;
-            gmx_mm_increment_4real_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,_mm_mul_ps(dvdatmp,_mm_mul_ps(isaj0,isaj0)));
-            velec            = _mm_mul_ps(qq00,rinv00);
-            felec            = _mm_mul_ps(_mm_sub_ps(_mm_mul_ps(velec,rinv00),fgb),rinv00);
-
-            /* LENNARD-JONES DISPERSION/REPULSION */
-
-            rinvsix          = _mm_mul_ps(_mm_mul_ps(rinvsq00,rinvsq00),rinvsq00);
-            fvdw             = _mm_mul_ps(_mm_sub_ps(_mm_mul_ps(c12_00,rinvsix),c6_00),_mm_mul_ps(rinvsix,rinvsq00));
-
-            fscal            = _mm_add_ps(felec,fvdw);
-
-            fscal            = _mm_andnot_ps(dummy_mask,fscal);
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm_mul_ps(fscal,dx00);
-            ty               = _mm_mul_ps(fscal,dy00);
-            tz               = _mm_mul_ps(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm_add_ps(fix0,tx);
-            fiy0             = _mm_add_ps(fiy0,ty);
-            fiz0             = _mm_add_ps(fiz0,tz);
-
-            fjptrA             = (jnrlistA>=0) ? f+j_coord_offsetA : scratch;
-            fjptrB             = (jnrlistB>=0) ? f+j_coord_offsetB : scratch;
-            fjptrC             = (jnrlistC>=0) ? f+j_coord_offsetC : scratch;
-            fjptrD             = (jnrlistD>=0) ? f+j_coord_offsetD : scratch;
-            gmx_mm_decrement_1rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,tx,ty,tz);
-
-            /* Inner loop uses 65 flops */
-        }
-
-        /* End of innermost loop */
-
-        gmx_mm_update_iforce_1atom_swizzle_ps(fix0,fiy0,fiz0,
-                                              f+i_coord_offset,fshift+i_shift_offset);
-
-        dvdasum = _mm_mul_ps(dvdasum, _mm_mul_ps(isai0,isai0));
-        gmx_mm_update_1pot_ps(dvdasum,dvda+inr);
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 7 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VDW_F,outeriter*7 + inneriter*65);
-}
diff --git a/src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecGB_VdwNone_GeomP1P1_sse4_1_single.c b/src/gromacs/gmxlib/nonbonded/nb_kernel_sse4_1_single/nb_kernel_ElecGB_VdwNone_GeomP1P1_sse4_1_single.c
deleted file mode 100644 (file)
index 3b150dd..0000000
+++ /dev/null
@@ -1,757 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
- * and including many others, as listed in the AUTHORS file in the
- * top-level source directory and at http://www.gromacs.org.
- *
- * GROMACS is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * GROMACS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GROMACS; if not, see
- * http://www.gnu.org/licenses, or write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
- *
- * If you want to redistribute modifications to GROMACS, please
- * consider that scientific software is very special. Version
- * control is crucial - bugs must be traceable. We will be happy to
- * consider code for inclusion in the official distribution, but
- * derived work must not be called official GROMACS. Details are found
- * in the README & COPYING files - if they are missing, get the
- * official version at http://www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the research papers on the package. Check out http://www.gromacs.org.
- */
-/*
- * Note: this file was generated by the GROMACS sse4_1_single kernel generator.
- */
-#include "gmxpre.h"
-
-#include "config.h"
-
-#include <math.h>
-
-#include "../nb_kernel.h"
-#include "gromacs/gmxlib/nrnb.h"
-
-#include "kernelutil_x86_sse4_1_single.h"
-
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_sse4_1_single
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            None
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        PotentialAndForce
- */
-void
-nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_sse4_1_single
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or 
-     * just 0 for non-waters.
-     * Suffixes A,B,C,D refer to j loop unrolling done with SSE, e.g. for the four different
-     * jnr indices corresponding to data put in the four positions in the SIMD register.
-     */
-    int              i_shift_offset,i_coord_offset,outeriter,inneriter;
-    int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
-    int              jnrA,jnrB,jnrC,jnrD;
-    int              jnrlistA,jnrlistB,jnrlistC,jnrlistD;
-    int              j_coord_offsetA,j_coord_offsetB,j_coord_offsetC,j_coord_offsetD;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             rcutoff_scalar;
-    real             *shiftvec,*fshift,*x,*f;
-    real             *fjptrA,*fjptrB,*fjptrC,*fjptrD;
-    real             scratch[4*DIM];
-    __m128           tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
-    int              vdwioffset0;
-    __m128           ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0A,vdwjidx0B,vdwjidx0C,vdwjidx0D;
-    __m128           jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    __m128           dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
-    __m128           velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    __m128i          gbitab;
-    __m128           vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,gbeps,dvdatmp;
-    __m128           minushalf = _mm_set1_ps(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    __m128i          vfitab;
-    __m128i          ifour       = _mm_set1_epi32(4);
-    __m128           rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF;
-    real             *vftab;
-    __m128           dummy_mask,cutoff_mask;
-    __m128           signbit = _mm_castsi128_ps( _mm_set1_epi32(0x80000000) );
-    __m128           one     = _mm_set1_ps(1.0);
-    __m128           two     = _mm_set1_ps(2.0);
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = _mm_set1_ps(fr->ic->epsfac);
-    charge           = mdatoms->chargeA;
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = _mm_set1_ps(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = _mm_set1_ps((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-
-    /* Avoid stupid compiler warnings */
-    jnrA = jnrB = jnrC = jnrD = 0;
-    j_coord_offsetA = 0;
-    j_coord_offsetB = 0;
-    j_coord_offsetC = 0;
-    j_coord_offsetD = 0;
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    for(iidx=0;iidx<4*DIM;iidx++)
-    {
-        scratch[iidx] = 0.0;
-    }
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        gmx_mm_load_shift_and_1rvec_broadcast_ps(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
-
-        fix0             = _mm_setzero_ps();
-        fiy0             = _mm_setzero_ps();
-        fiz0             = _mm_setzero_ps();
-
-        /* Load parameters for i particles */
-        iq0              = _mm_mul_ps(facel,_mm_load1_ps(charge+inr+0));
-        isai0            = _mm_load1_ps(invsqrta+inr+0);
-
-        /* Reset potential sums */
-        velecsum         = _mm_setzero_ps();
-        vgbsum           = _mm_setzero_ps();
-        dvdasum          = _mm_setzero_ps();
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end && jjnr[jidx+3]>=0; jidx+=4)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrA             = jjnr[jidx];
-            jnrB             = jjnr[jidx+1];
-            jnrC             = jjnr[jidx+2];
-            jnrD             = jjnr[jidx+3];
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              x+j_coord_offsetC,x+j_coord_offsetD,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_ps(ix0,jx0);
-            dy00             = _mm_sub_ps(iy0,jy0);
-            dz00             = _mm_sub_ps(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
-
-            rinv00           = sse41_invsqrt_f(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm_load_4real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
-                                                              charge+jnrC+0,charge+jnrD+0);
-            isaj0            = gmx_mm_load_4real_swizzle_ps(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                              invsqrta+jnrC+0,invsqrta+jnrD+0);
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_ps(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_ps(iq0,jq0);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_ps(isai0,isaj0);
-            gbqqfactor       = _mm_xor_ps(signbit,_mm_mul_ps(qq00,_mm_mul_ps(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_ps(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_ps(r00,gbscale);
-            gbitab           = _mm_cvttps_epi32(rt);
-            gbeps            = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-            Y                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,0) );
-            F                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,1) );
-            G                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,2) );
-            H                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm_mul_ps(gbeps,H);
-            Fp               = _mm_add_ps(F,_mm_mul_ps(gbeps,_mm_add_ps(G,Heps)));
-            VV               = _mm_add_ps(Y,_mm_mul_ps(gbeps,Fp));
-            vgb              = _mm_mul_ps(gbqqfactor,VV);
-
-            FF               = _mm_add_ps(Fp,_mm_mul_ps(gbeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
-            fgb              = _mm_mul_ps(gbqqfactor,_mm_mul_ps(FF,gbscale));
-            dvdatmp          = _mm_mul_ps(minushalf,_mm_add_ps(vgb,_mm_mul_ps(fgb,r00)));
-            dvdasum          = _mm_add_ps(dvdasum,dvdatmp);
-            fjptrA           = dvda+jnrA;
-            fjptrB           = dvda+jnrB;
-            fjptrC           = dvda+jnrC;
-            fjptrD           = dvda+jnrD;
-            gmx_mm_increment_4real_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,_mm_mul_ps(dvdatmp,_mm_mul_ps(isaj0,isaj0)));
-            velec            = _mm_mul_ps(qq00,rinv00);
-            felec            = _mm_mul_ps(_mm_sub_ps(_mm_mul_ps(velec,rinv00),fgb),rinv00);
-
-            /* Update potential sum for this i atom from the interaction with this j atom. */
-            velecsum         = _mm_add_ps(velecsum,velec);
-            vgbsum           = _mm_add_ps(vgbsum,vgb);
-
-            fscal            = felec;
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm_mul_ps(fscal,dx00);
-            ty               = _mm_mul_ps(fscal,dy00);
-            tz               = _mm_mul_ps(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm_add_ps(fix0,tx);
-            fiy0             = _mm_add_ps(fiy0,ty);
-            fiz0             = _mm_add_ps(fiz0,tz);
-
-            fjptrA             = f+j_coord_offsetA;
-            fjptrB             = f+j_coord_offsetB;
-            fjptrC             = f+j_coord_offsetC;
-            fjptrD             = f+j_coord_offsetD;
-            gmx_mm_decrement_1rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,tx,ty,tz);
-
-            /* Inner loop uses 58 flops */
-        }
-
-        if(jidx<j_index_end)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrlistA         = jjnr[jidx];
-            jnrlistB         = jjnr[jidx+1];
-            jnrlistC         = jjnr[jidx+2];
-            jnrlistD         = jjnr[jidx+3];
-            /* Sign of each element will be negative for non-real atoms.
-             * This mask will be 0xFFFFFFFF for dummy entries and 0x0 for real ones,
-             * so use it as val = _mm_andnot_ps(mask,val) to clear dummy entries.
-             */
-            dummy_mask = gmx_mm_castsi128_ps(_mm_cmplt_epi32(_mm_loadu_si128((const __m128i *)(jjnr+jidx)),_mm_setzero_si128()));
-            jnrA       = (jnrlistA>=0) ? jnrlistA : 0;
-            jnrB       = (jnrlistB>=0) ? jnrlistB : 0;
-            jnrC       = (jnrlistC>=0) ? jnrlistC : 0;
-            jnrD       = (jnrlistD>=0) ? jnrlistD : 0;
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              x+j_coord_offsetC,x+j_coord_offsetD,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_ps(ix0,jx0);
-            dy00             = _mm_sub_ps(iy0,jy0);
-            dz00             = _mm_sub_ps(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
-
-            rinv00           = sse41_invsqrt_f(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm_load_4real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
-                                                              charge+jnrC+0,charge+jnrD+0);
-            isaj0            = gmx_mm_load_4real_swizzle_ps(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                              invsqrta+jnrC+0,invsqrta+jnrD+0);
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_ps(rsq00,rinv00);
-            r00              = _mm_andnot_ps(dummy_mask,r00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_ps(iq0,jq0);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_ps(isai0,isaj0);
-            gbqqfactor       = _mm_xor_ps(signbit,_mm_mul_ps(qq00,_mm_mul_ps(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_ps(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_ps(r00,gbscale);
-            gbitab           = _mm_cvttps_epi32(rt);
-            gbeps            = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-            Y                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,0) );
-            F                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,1) );
-            G                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,2) );
-            H                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm_mul_ps(gbeps,H);
-            Fp               = _mm_add_ps(F,_mm_mul_ps(gbeps,_mm_add_ps(G,Heps)));
-            VV               = _mm_add_ps(Y,_mm_mul_ps(gbeps,Fp));
-            vgb              = _mm_mul_ps(gbqqfactor,VV);
-
-            FF               = _mm_add_ps(Fp,_mm_mul_ps(gbeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
-            fgb              = _mm_mul_ps(gbqqfactor,_mm_mul_ps(FF,gbscale));
-            dvdatmp          = _mm_mul_ps(minushalf,_mm_add_ps(vgb,_mm_mul_ps(fgb,r00)));
-            dvdatmp          = _mm_andnot_ps(dummy_mask,dvdatmp);
-            dvdasum          = _mm_add_ps(dvdasum,dvdatmp);
-            /* The pointers to scratch make sure that this code with compilers that take gmx_restrict seriously (e.g. icc 13) really can't screw things up. */
-            fjptrA             = (jnrlistA>=0) ? dvda+jnrA : scratch;
-            fjptrB             = (jnrlistB>=0) ? dvda+jnrB : scratch;
-            fjptrC             = (jnrlistC>=0) ? dvda+jnrC : scratch;
-            fjptrD             = (jnrlistD>=0) ? dvda+jnrD : scratch;
-            gmx_mm_increment_4real_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,_mm_mul_ps(dvdatmp,_mm_mul_ps(isaj0,isaj0)));
-            velec            = _mm_mul_ps(qq00,rinv00);
-            felec            = _mm_mul_ps(_mm_sub_ps(_mm_mul_ps(velec,rinv00),fgb),rinv00);
-
-            /* Update potential sum for this i atom from the interaction with this j atom. */
-            velec            = _mm_andnot_ps(dummy_mask,velec);
-            velecsum         = _mm_add_ps(velecsum,velec);
-            vgb              = _mm_andnot_ps(dummy_mask,vgb);
-            vgbsum           = _mm_add_ps(vgbsum,vgb);
-
-            fscal            = felec;
-
-            fscal            = _mm_andnot_ps(dummy_mask,fscal);
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm_mul_ps(fscal,dx00);
-            ty               = _mm_mul_ps(fscal,dy00);
-            tz               = _mm_mul_ps(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm_add_ps(fix0,tx);
-            fiy0             = _mm_add_ps(fiy0,ty);
-            fiz0             = _mm_add_ps(fiz0,tz);
-
-            fjptrA             = (jnrlistA>=0) ? f+j_coord_offsetA : scratch;
-            fjptrB             = (jnrlistB>=0) ? f+j_coord_offsetB : scratch;
-            fjptrC             = (jnrlistC>=0) ? f+j_coord_offsetC : scratch;
-            fjptrD             = (jnrlistD>=0) ? f+j_coord_offsetD : scratch;
-            gmx_mm_decrement_1rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,tx,ty,tz);
-
-            /* Inner loop uses 59 flops */
-        }
-
-        /* End of innermost loop */
-
-        gmx_mm_update_iforce_1atom_swizzle_ps(fix0,fiy0,fiz0,
-                                              f+i_coord_offset,fshift+i_shift_offset);
-
-        ggid                        = gid[iidx];
-        /* Update potential energies */
-        gmx_mm_update_1pot_ps(velecsum,kernel_data->energygrp_elec+ggid);
-        gmx_mm_update_1pot_ps(vgbsum,kernel_data->energygrp_polarization+ggid);
-        dvdasum = _mm_mul_ps(dvdasum, _mm_mul_ps(isai0,isai0));
-        gmx_mm_update_1pot_ps(dvdasum,dvda+inr);
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 9 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_VF,outeriter*9 + inneriter*59);
-}
-/*
- * Gromacs nonbonded kernel:   nb_kernel_ElecGB_VdwNone_GeomP1P1_F_sse4_1_single
- * Electrostatics interaction: GeneralizedBorn
- * VdW interaction:            None
- * Geometry:                   Particle-Particle
- * Calculate force/pot:        Force
- */
-void
-nb_kernel_ElecGB_VdwNone_GeomP1P1_F_sse4_1_single
-                    (t_nblist                    * gmx_restrict       nlist,
-                     rvec                        * gmx_restrict          xx,
-                     rvec                        * gmx_restrict          ff,
-                     struct t_forcerec           * gmx_restrict          fr,
-                     t_mdatoms                   * gmx_restrict     mdatoms,
-                     nb_kernel_data_t gmx_unused * gmx_restrict kernel_data,
-                     t_nrnb                      * gmx_restrict        nrnb)
-{
-    /* Suffixes 0,1,2,3 refer to particle indices for waters in the inner or outer loop, or 
-     * just 0 for non-waters.
-     * Suffixes A,B,C,D refer to j loop unrolling done with SSE, e.g. for the four different
-     * jnr indices corresponding to data put in the four positions in the SIMD register.
-     */
-    int              i_shift_offset,i_coord_offset,outeriter,inneriter;
-    int              j_index_start,j_index_end,jidx,nri,inr,ggid,iidx;
-    int              jnrA,jnrB,jnrC,jnrD;
-    int              jnrlistA,jnrlistB,jnrlistC,jnrlistD;
-    int              j_coord_offsetA,j_coord_offsetB,j_coord_offsetC,j_coord_offsetD;
-    int              *iinr,*jindex,*jjnr,*shiftidx,*gid;
-    real             rcutoff_scalar;
-    real             *shiftvec,*fshift,*x,*f;
-    real             *fjptrA,*fjptrB,*fjptrC,*fjptrD;
-    real             scratch[4*DIM];
-    __m128           tx,ty,tz,fscal,rcutoff,rcutoff2,jidxall;
-    int              vdwioffset0;
-    __m128           ix0,iy0,iz0,fix0,fiy0,fiz0,iq0,isai0;
-    int              vdwjidx0A,vdwjidx0B,vdwjidx0C,vdwjidx0D;
-    __m128           jx0,jy0,jz0,fjx0,fjy0,fjz0,jq0,isaj0;
-    __m128           dx00,dy00,dz00,rsq00,rinv00,rinvsq00,r00,qq00,c6_00,c12_00;
-    __m128           velec,felec,velecsum,facel,crf,krf,krf2;
-    real             *charge;
-    __m128i          gbitab;
-    __m128           vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,gbeps,dvdatmp;
-    __m128           minushalf = _mm_set1_ps(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    __m128i          vfitab;
-    __m128i          ifour       = _mm_set1_epi32(4);
-    __m128           rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF;
-    real             *vftab;
-    __m128           dummy_mask,cutoff_mask;
-    __m128           signbit = _mm_castsi128_ps( _mm_set1_epi32(0x80000000) );
-    __m128           one     = _mm_set1_ps(1.0);
-    __m128           two     = _mm_set1_ps(2.0);
-    x                = xx[0];
-    f                = ff[0];
-
-    nri              = nlist->nri;
-    iinr             = nlist->iinr;
-    jindex           = nlist->jindex;
-    jjnr             = nlist->jjnr;
-    shiftidx         = nlist->shift;
-    gid              = nlist->gid;
-    shiftvec         = fr->shift_vec[0];
-    fshift           = fr->fshift[0];
-    facel            = _mm_set1_ps(fr->ic->epsfac);
-    charge           = mdatoms->chargeA;
-
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = _mm_set1_ps(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = _mm_set1_ps((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-
-    /* Avoid stupid compiler warnings */
-    jnrA = jnrB = jnrC = jnrD = 0;
-    j_coord_offsetA = 0;
-    j_coord_offsetB = 0;
-    j_coord_offsetC = 0;
-    j_coord_offsetD = 0;
-
-    outeriter        = 0;
-    inneriter        = 0;
-
-    for(iidx=0;iidx<4*DIM;iidx++)
-    {
-        scratch[iidx] = 0.0;
-    }
-
-    /* Start outer loop over neighborlists */
-    for(iidx=0; iidx<nri; iidx++)
-    {
-        /* Load shift vector for this list */
-        i_shift_offset   = DIM*shiftidx[iidx];
-
-        /* Load limits for loop over neighbors */
-        j_index_start    = jindex[iidx];
-        j_index_end      = jindex[iidx+1];
-
-        /* Get outer coordinate index */
-        inr              = iinr[iidx];
-        i_coord_offset   = DIM*inr;
-
-        /* Load i particle coords and add shift vector */
-        gmx_mm_load_shift_and_1rvec_broadcast_ps(shiftvec+i_shift_offset,x+i_coord_offset,&ix0,&iy0,&iz0);
-
-        fix0             = _mm_setzero_ps();
-        fiy0             = _mm_setzero_ps();
-        fiz0             = _mm_setzero_ps();
-
-        /* Load parameters for i particles */
-        iq0              = _mm_mul_ps(facel,_mm_load1_ps(charge+inr+0));
-        isai0            = _mm_load1_ps(invsqrta+inr+0);
-
-        dvdasum          = _mm_setzero_ps();
-
-        /* Start inner kernel loop */
-        for(jidx=j_index_start; jidx<j_index_end && jjnr[jidx+3]>=0; jidx+=4)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrA             = jjnr[jidx];
-            jnrB             = jjnr[jidx+1];
-            jnrC             = jjnr[jidx+2];
-            jnrD             = jjnr[jidx+3];
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              x+j_coord_offsetC,x+j_coord_offsetD,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_ps(ix0,jx0);
-            dy00             = _mm_sub_ps(iy0,jy0);
-            dz00             = _mm_sub_ps(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
-
-            rinv00           = sse41_invsqrt_f(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm_load_4real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
-                                                              charge+jnrC+0,charge+jnrD+0);
-            isaj0            = gmx_mm_load_4real_swizzle_ps(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                              invsqrta+jnrC+0,invsqrta+jnrD+0);
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_ps(rsq00,rinv00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_ps(iq0,jq0);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_ps(isai0,isaj0);
-            gbqqfactor       = _mm_xor_ps(signbit,_mm_mul_ps(qq00,_mm_mul_ps(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_ps(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_ps(r00,gbscale);
-            gbitab           = _mm_cvttps_epi32(rt);
-            gbeps            = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-            Y                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,0) );
-            F                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,1) );
-            G                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,2) );
-            H                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm_mul_ps(gbeps,H);
-            Fp               = _mm_add_ps(F,_mm_mul_ps(gbeps,_mm_add_ps(G,Heps)));
-            VV               = _mm_add_ps(Y,_mm_mul_ps(gbeps,Fp));
-            vgb              = _mm_mul_ps(gbqqfactor,VV);
-
-            FF               = _mm_add_ps(Fp,_mm_mul_ps(gbeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
-            fgb              = _mm_mul_ps(gbqqfactor,_mm_mul_ps(FF,gbscale));
-            dvdatmp          = _mm_mul_ps(minushalf,_mm_add_ps(vgb,_mm_mul_ps(fgb,r00)));
-            dvdasum          = _mm_add_ps(dvdasum,dvdatmp);
-            fjptrA           = dvda+jnrA;
-            fjptrB           = dvda+jnrB;
-            fjptrC           = dvda+jnrC;
-            fjptrD           = dvda+jnrD;
-            gmx_mm_increment_4real_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,_mm_mul_ps(dvdatmp,_mm_mul_ps(isaj0,isaj0)));
-            velec            = _mm_mul_ps(qq00,rinv00);
-            felec            = _mm_mul_ps(_mm_sub_ps(_mm_mul_ps(velec,rinv00),fgb),rinv00);
-
-            fscal            = felec;
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm_mul_ps(fscal,dx00);
-            ty               = _mm_mul_ps(fscal,dy00);
-            tz               = _mm_mul_ps(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm_add_ps(fix0,tx);
-            fiy0             = _mm_add_ps(fiy0,ty);
-            fiz0             = _mm_add_ps(fiz0,tz);
-
-            fjptrA             = f+j_coord_offsetA;
-            fjptrB             = f+j_coord_offsetB;
-            fjptrC             = f+j_coord_offsetC;
-            fjptrD             = f+j_coord_offsetD;
-            gmx_mm_decrement_1rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,tx,ty,tz);
-
-            /* Inner loop uses 56 flops */
-        }
-
-        if(jidx<j_index_end)
-        {
-
-            /* Get j neighbor index, and coordinate index */
-            jnrlistA         = jjnr[jidx];
-            jnrlistB         = jjnr[jidx+1];
-            jnrlistC         = jjnr[jidx+2];
-            jnrlistD         = jjnr[jidx+3];
-            /* Sign of each element will be negative for non-real atoms.
-             * This mask will be 0xFFFFFFFF for dummy entries and 0x0 for real ones,
-             * so use it as val = _mm_andnot_ps(mask,val) to clear dummy entries.
-             */
-            dummy_mask = gmx_mm_castsi128_ps(_mm_cmplt_epi32(_mm_loadu_si128((const __m128i *)(jjnr+jidx)),_mm_setzero_si128()));
-            jnrA       = (jnrlistA>=0) ? jnrlistA : 0;
-            jnrB       = (jnrlistB>=0) ? jnrlistB : 0;
-            jnrC       = (jnrlistC>=0) ? jnrlistC : 0;
-            jnrD       = (jnrlistD>=0) ? jnrlistD : 0;
-            j_coord_offsetA  = DIM*jnrA;
-            j_coord_offsetB  = DIM*jnrB;
-            j_coord_offsetC  = DIM*jnrC;
-            j_coord_offsetD  = DIM*jnrD;
-
-            /* load j atom coordinates */
-            gmx_mm_load_1rvec_4ptr_swizzle_ps(x+j_coord_offsetA,x+j_coord_offsetB,
-                                              x+j_coord_offsetC,x+j_coord_offsetD,
-                                              &jx0,&jy0,&jz0);
-
-            /* Calculate displacement vector */
-            dx00             = _mm_sub_ps(ix0,jx0);
-            dy00             = _mm_sub_ps(iy0,jy0);
-            dz00             = _mm_sub_ps(iz0,jz0);
-
-            /* Calculate squared distance and things based on it */
-            rsq00            = gmx_mm_calc_rsq_ps(dx00,dy00,dz00);
-
-            rinv00           = sse41_invsqrt_f(rsq00);
-
-            /* Load parameters for j particles */
-            jq0              = gmx_mm_load_4real_swizzle_ps(charge+jnrA+0,charge+jnrB+0,
-                                                              charge+jnrC+0,charge+jnrD+0);
-            isaj0            = gmx_mm_load_4real_swizzle_ps(invsqrta+jnrA+0,invsqrta+jnrB+0,
-                                                              invsqrta+jnrC+0,invsqrta+jnrD+0);
-
-            /**************************
-             * CALCULATE INTERACTIONS *
-             **************************/
-
-            r00              = _mm_mul_ps(rsq00,rinv00);
-            r00              = _mm_andnot_ps(dummy_mask,r00);
-
-            /* Compute parameters for interactions between i and j atoms */
-            qq00             = _mm_mul_ps(iq0,jq0);
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_ps(isai0,isaj0);
-            gbqqfactor       = _mm_xor_ps(signbit,_mm_mul_ps(qq00,_mm_mul_ps(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_ps(isaprod,gbtabscale);
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_ps(r00,gbscale);
-            gbitab           = _mm_cvttps_epi32(rt);
-            gbeps            = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-            Y                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,0) );
-            F                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,1) );
-            G                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,2) );
-            H                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm_mul_ps(gbeps,H);
-            Fp               = _mm_add_ps(F,_mm_mul_ps(gbeps,_mm_add_ps(G,Heps)));
-            VV               = _mm_add_ps(Y,_mm_mul_ps(gbeps,Fp));
-            vgb              = _mm_mul_ps(gbqqfactor,VV);
-
-            FF               = _mm_add_ps(Fp,_mm_mul_ps(gbeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
-            fgb              = _mm_mul_ps(gbqqfactor,_mm_mul_ps(FF,gbscale));
-            dvdatmp          = _mm_mul_ps(minushalf,_mm_add_ps(vgb,_mm_mul_ps(fgb,r00)));
-            dvdatmp          = _mm_andnot_ps(dummy_mask,dvdatmp);
-            dvdasum          = _mm_add_ps(dvdasum,dvdatmp);
-            /* The pointers to scratch make sure that this code with compilers that take gmx_restrict seriously (e.g. icc 13) really can't screw things up. */
-            fjptrA             = (jnrlistA>=0) ? dvda+jnrA : scratch;
-            fjptrB             = (jnrlistB>=0) ? dvda+jnrB : scratch;
-            fjptrC             = (jnrlistC>=0) ? dvda+jnrC : scratch;
-            fjptrD             = (jnrlistD>=0) ? dvda+jnrD : scratch;
-            gmx_mm_increment_4real_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,_mm_mul_ps(dvdatmp,_mm_mul_ps(isaj0,isaj0)));
-            velec            = _mm_mul_ps(qq00,rinv00);
-            felec            = _mm_mul_ps(_mm_sub_ps(_mm_mul_ps(velec,rinv00),fgb),rinv00);
-
-            fscal            = felec;
-
-            fscal            = _mm_andnot_ps(dummy_mask,fscal);
-
-            /* Calculate temporary vectorial force */
-            tx               = _mm_mul_ps(fscal,dx00);
-            ty               = _mm_mul_ps(fscal,dy00);
-            tz               = _mm_mul_ps(fscal,dz00);
-
-            /* Update vectorial force */
-            fix0             = _mm_add_ps(fix0,tx);
-            fiy0             = _mm_add_ps(fiy0,ty);
-            fiz0             = _mm_add_ps(fiz0,tz);
-
-            fjptrA             = (jnrlistA>=0) ? f+j_coord_offsetA : scratch;
-            fjptrB             = (jnrlistB>=0) ? f+j_coord_offsetB : scratch;
-            fjptrC             = (jnrlistC>=0) ? f+j_coord_offsetC : scratch;
-            fjptrD             = (jnrlistD>=0) ? f+j_coord_offsetD : scratch;
-            gmx_mm_decrement_1rvec_4ptr_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,tx,ty,tz);
-
-            /* Inner loop uses 57 flops */
-        }
-
-        /* End of innermost loop */
-
-        gmx_mm_update_iforce_1atom_swizzle_ps(fix0,fiy0,fiz0,
-                                              f+i_coord_offset,fshift+i_shift_offset);
-
-        dvdasum = _mm_mul_ps(dvdasum, _mm_mul_ps(isai0,isai0));
-        gmx_mm_update_1pot_ps(dvdasum,dvda+inr);
-
-        /* Increment number of inner iterations */
-        inneriter                  += j_index_end - j_index_start;
-
-        /* Outer loop uses 7 flops */
-    }
-
-    /* Increment number of outer iterations */
-    outeriter        += nri;
-
-    /* Update outer/inner flops */
-
-    inc_nrnb(nrnb,eNR_NBKERNEL_ELEC_F,outeriter*7 + inneriter*57);
-}
index e2f9d452a5fb81d56d231abe3274e83dd3b86518..c339914a02910ea6e9a0538463d454fc8228ad58 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -51,6 +51,36 @@ nb_kernel_t nb_kernel_ElecNone_VdwLJSw_GeomP1P1_VF_sse4_1_single;
 nb_kernel_t nb_kernel_ElecNone_VdwLJSw_GeomP1P1_F_sse4_1_single;
 nb_kernel_t nb_kernel_ElecNone_VdwCSTab_GeomP1P1_VF_sse4_1_single;
 nb_kernel_t nb_kernel_ElecNone_VdwCSTab_GeomP1P1_F_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_sse4_1_single;
 nb_kernel_t nb_kernel_ElecEw_VdwLJEw_GeomP1P1_VF_sse4_1_single;
 nb_kernel_t nb_kernel_ElecEw_VdwLJEw_GeomP1P1_F_sse4_1_single;
 nb_kernel_t nb_kernel_ElecEw_VdwLJEw_GeomW3P1_VF_sse4_1_single;
@@ -141,72 +171,6 @@ nb_kernel_t nb_kernel_ElecEwSw_VdwNone_GeomW4P1_VF_sse4_1_single;
 nb_kernel_t nb_kernel_ElecEwSw_VdwNone_GeomW4P1_F_sse4_1_single;
 nb_kernel_t nb_kernel_ElecEwSw_VdwNone_GeomW4W4_VF_sse4_1_single;
 nb_kernel_t nb_kernel_ElecEwSw_VdwNone_GeomW4W4_F_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_sse4_1_single;
-nb_kernel_t nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_sse4_1_single;
-nb_kernel_t nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_sse4_1_single;
-nb_kernel_t nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_sse4_1_single;
-nb_kernel_t nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_sse4_1_single;
-nb_kernel_t nb_kernel_ElecGB_VdwNone_GeomP1P1_F_sse4_1_single;
-nb_kernel_t nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_sse4_1_single;
-nb_kernel_t nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_sse4_1_single;
 nb_kernel_t nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_VF_sse4_1_single;
 nb_kernel_t nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_F_sse4_1_single;
 nb_kernel_t nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_VF_sse4_1_single;
@@ -277,6 +241,36 @@ nb_kernel_t nb_kernel_ElecRF_VdwCSTab_GeomW4P1_VF_sse4_1_single;
 nb_kernel_t nb_kernel_ElecRF_VdwCSTab_GeomW4P1_F_sse4_1_single;
 nb_kernel_t nb_kernel_ElecRF_VdwCSTab_GeomW4W4_VF_sse4_1_single;
 nb_kernel_t nb_kernel_ElecRF_VdwCSTab_GeomW4W4_F_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_sse4_1_single;
+nb_kernel_t nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_sse4_1_single;
 
 
 nb_kernel_info_t
@@ -294,6 +288,36 @@ nb_kernel_info_t
     { nb_kernel_ElecNone_VdwLJSw_GeomP1P1_F_sse4_1_single, "nb_kernel_ElecNone_VdwLJSw_GeomP1P1_F_sse4_1_single", "sse4_1_single", "None", "None", "LennardJones", "PotentialSwitch", "ParticleParticle", "", "Force" },
     { nb_kernel_ElecNone_VdwCSTab_GeomP1P1_VF_sse4_1_single, "nb_kernel_ElecNone_VdwCSTab_GeomP1P1_VF_sse4_1_single", "sse4_1_single", "None", "None", "CubicSplineTable", "None", "ParticleParticle", "", "PotentialAndForce" },
     { nb_kernel_ElecNone_VdwCSTab_GeomP1P1_F_sse4_1_single, "nb_kernel_ElecNone_VdwCSTab_GeomP1P1_F_sse4_1_single", "sse4_1_single", "None", "None", "CubicSplineTable", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_sse4_1_single, "nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "LennardJones", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_sse4_1_single, "nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "LennardJones", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_sse4_1_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "LennardJones", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_sse4_1_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "LennardJones", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_sse4_1_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "LennardJones", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_sse4_1_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "LennardJones", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_sse4_1_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "LennardJones", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_sse4_1_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "LennardJones", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_sse4_1_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "LennardJones", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_sse4_1_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "LennardJones", "None", "Water4Water4", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_sse4_1_single, "nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "None", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_sse4_1_single, "nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "None", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_sse4_1_single, "nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "None", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_sse4_1_single, "nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "None", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_sse4_1_single, "nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "None", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_sse4_1_single, "nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "None", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_sse4_1_single, "nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "None", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_sse4_1_single, "nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "None", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_sse4_1_single, "nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "None", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_sse4_1_single, "nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "None", "None", "Water4Water4", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_sse4_1_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_sse4_1_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_sse4_1_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_sse4_1_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_sse4_1_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_sse4_1_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_sse4_1_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_sse4_1_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_sse4_1_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_sse4_1_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Water4", "", "Force" },
     { nb_kernel_ElecEw_VdwLJEw_GeomP1P1_VF_sse4_1_single, "nb_kernel_ElecEw_VdwLJEw_GeomP1P1_VF_sse4_1_single", "sse4_1_single", "Ewald", "None", "LJEwald", "None", "ParticleParticle", "", "PotentialAndForce" },
     { nb_kernel_ElecEw_VdwLJEw_GeomP1P1_F_sse4_1_single, "nb_kernel_ElecEw_VdwLJEw_GeomP1P1_F_sse4_1_single", "sse4_1_single", "Ewald", "None", "LJEwald", "None", "ParticleParticle", "", "Force" },
     { nb_kernel_ElecEw_VdwLJEw_GeomW3P1_VF_sse4_1_single, "nb_kernel_ElecEw_VdwLJEw_GeomW3P1_VF_sse4_1_single", "sse4_1_single", "Ewald", "None", "LJEwald", "None", "Water3Particle", "", "PotentialAndForce" },
@@ -384,72 +408,6 @@ nb_kernel_info_t
     { nb_kernel_ElecEwSw_VdwNone_GeomW4P1_F_sse4_1_single, "nb_kernel_ElecEwSw_VdwNone_GeomW4P1_F_sse4_1_single", "sse4_1_single", "Ewald", "PotentialSwitch", "None", "None", "Water4Particle", "", "Force" },
     { nb_kernel_ElecEwSw_VdwNone_GeomW4W4_VF_sse4_1_single, "nb_kernel_ElecEwSw_VdwNone_GeomW4W4_VF_sse4_1_single", "sse4_1_single", "Ewald", "PotentialSwitch", "None", "None", "Water4Water4", "", "PotentialAndForce" },
     { nb_kernel_ElecEwSw_VdwNone_GeomW4W4_F_sse4_1_single, "nb_kernel_ElecEwSw_VdwNone_GeomW4W4_F_sse4_1_single", "sse4_1_single", "Ewald", "PotentialSwitch", "None", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_sse4_1_single, "nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_sse4_1_single", "sse4_1_single", "Coulomb", "None", "LennardJones", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_sse4_1_single, "nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_sse4_1_single", "sse4_1_single", "Coulomb", "None", "LennardJones", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_sse4_1_single, "nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_sse4_1_single", "sse4_1_single", "Coulomb", "None", "LennardJones", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_sse4_1_single, "nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_sse4_1_single", "sse4_1_single", "Coulomb", "None", "LennardJones", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_sse4_1_single, "nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_sse4_1_single", "sse4_1_single", "Coulomb", "None", "LennardJones", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_sse4_1_single, "nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_sse4_1_single", "sse4_1_single", "Coulomb", "None", "LennardJones", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_sse4_1_single, "nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_sse4_1_single", "sse4_1_single", "Coulomb", "None", "LennardJones", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_sse4_1_single, "nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_sse4_1_single", "sse4_1_single", "Coulomb", "None", "LennardJones", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_sse4_1_single, "nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_sse4_1_single", "sse4_1_single", "Coulomb", "None", "LennardJones", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_sse4_1_single, "nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_sse4_1_single", "sse4_1_single", "Coulomb", "None", "LennardJones", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_sse4_1_single, "nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_sse4_1_single", "sse4_1_single", "Coulomb", "None", "None", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_sse4_1_single, "nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_sse4_1_single", "sse4_1_single", "Coulomb", "None", "None", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_sse4_1_single, "nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_sse4_1_single", "sse4_1_single", "Coulomb", "None", "None", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_sse4_1_single, "nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_sse4_1_single", "sse4_1_single", "Coulomb", "None", "None", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_sse4_1_single, "nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_sse4_1_single", "sse4_1_single", "Coulomb", "None", "None", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_sse4_1_single, "nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_sse4_1_single", "sse4_1_single", "Coulomb", "None", "None", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_sse4_1_single, "nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_sse4_1_single", "sse4_1_single", "Coulomb", "None", "None", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_sse4_1_single, "nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_sse4_1_single", "sse4_1_single", "Coulomb", "None", "None", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_sse4_1_single, "nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_sse4_1_single", "sse4_1_single", "Coulomb", "None", "None", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_sse4_1_single, "nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_sse4_1_single", "sse4_1_single", "Coulomb", "None", "None", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_sse4_1_single, "nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_sse4_1_single", "sse4_1_single", "Coulomb", "None", "CubicSplineTable", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_sse4_1_single, "nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_sse4_1_single", "sse4_1_single", "Coulomb", "None", "CubicSplineTable", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_sse4_1_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_sse4_1_single", "sse4_1_single", "Coulomb", "None", "CubicSplineTable", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_sse4_1_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_sse4_1_single", "sse4_1_single", "Coulomb", "None", "CubicSplineTable", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_sse4_1_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_sse4_1_single", "sse4_1_single", "Coulomb", "None", "CubicSplineTable", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_sse4_1_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_sse4_1_single", "sse4_1_single", "Coulomb", "None", "CubicSplineTable", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_sse4_1_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_sse4_1_single", "sse4_1_single", "Coulomb", "None", "CubicSplineTable", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_sse4_1_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_sse4_1_single", "sse4_1_single", "Coulomb", "None", "CubicSplineTable", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_sse4_1_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_sse4_1_single", "sse4_1_single", "Coulomb", "None", "CubicSplineTable", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_sse4_1_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_sse4_1_single", "sse4_1_single", "Coulomb", "None", "CubicSplineTable", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_sse4_1_single, "nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_VF_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "LennardJones", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_sse4_1_single, "nb_kernel_ElecCSTab_VdwLJ_GeomP1P1_F_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "LennardJones", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_sse4_1_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_VF_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "LennardJones", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_sse4_1_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW3P1_F_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "LennardJones", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_sse4_1_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_VF_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "LennardJones", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_sse4_1_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW3W3_F_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "LennardJones", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_sse4_1_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_VF_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "LennardJones", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_sse4_1_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW4P1_F_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "LennardJones", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_sse4_1_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_VF_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "LennardJones", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_sse4_1_single, "nb_kernel_ElecCSTab_VdwLJ_GeomW4W4_F_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "LennardJones", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_sse4_1_single, "nb_kernel_ElecCSTab_VdwNone_GeomP1P1_VF_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "None", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_sse4_1_single, "nb_kernel_ElecCSTab_VdwNone_GeomP1P1_F_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "None", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_sse4_1_single, "nb_kernel_ElecCSTab_VdwNone_GeomW3P1_VF_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "None", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_sse4_1_single, "nb_kernel_ElecCSTab_VdwNone_GeomW3P1_F_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "None", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_sse4_1_single, "nb_kernel_ElecCSTab_VdwNone_GeomW3W3_VF_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "None", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_sse4_1_single, "nb_kernel_ElecCSTab_VdwNone_GeomW3W3_F_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "None", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_sse4_1_single, "nb_kernel_ElecCSTab_VdwNone_GeomW4P1_VF_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "None", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_sse4_1_single, "nb_kernel_ElecCSTab_VdwNone_GeomW4P1_F_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "None", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_sse4_1_single, "nb_kernel_ElecCSTab_VdwNone_GeomW4W4_VF_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "None", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_sse4_1_single, "nb_kernel_ElecCSTab_VdwNone_GeomW4W4_F_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "None", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_sse4_1_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_VF_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_sse4_1_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomP1P1_F_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_sse4_1_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_VF_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_sse4_1_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3P1_F_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_sse4_1_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_VF_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Water3", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_sse4_1_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW3W3_F_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water3Water3", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_sse4_1_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_VF_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Particle", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_sse4_1_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4P1_F_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Particle", "", "Force" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_sse4_1_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_VF_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_sse4_1_single, "nb_kernel_ElecCSTab_VdwCSTab_GeomW4W4_F_sse4_1_single", "sse4_1_single", "CubicSplineTable", "None", "CubicSplineTable", "None", "Water4Water4", "", "Force" },
-    { nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_sse4_1_single, "nb_kernel_ElecGB_VdwLJ_GeomP1P1_VF_sse4_1_single", "sse4_1_single", "GeneralizedBorn", "None", "LennardJones", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_sse4_1_single, "nb_kernel_ElecGB_VdwLJ_GeomP1P1_F_sse4_1_single", "sse4_1_single", "GeneralizedBorn", "None", "LennardJones", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_sse4_1_single, "nb_kernel_ElecGB_VdwNone_GeomP1P1_VF_sse4_1_single", "sse4_1_single", "GeneralizedBorn", "None", "None", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecGB_VdwNone_GeomP1P1_F_sse4_1_single, "nb_kernel_ElecGB_VdwNone_GeomP1P1_F_sse4_1_single", "sse4_1_single", "GeneralizedBorn", "None", "None", "None", "ParticleParticle", "", "Force" },
-    { nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_sse4_1_single, "nb_kernel_ElecGB_VdwCSTab_GeomP1P1_VF_sse4_1_single", "sse4_1_single", "GeneralizedBorn", "None", "CubicSplineTable", "None", "ParticleParticle", "", "PotentialAndForce" },
-    { nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_sse4_1_single, "nb_kernel_ElecGB_VdwCSTab_GeomP1P1_F_sse4_1_single", "sse4_1_single", "GeneralizedBorn", "None", "CubicSplineTable", "None", "ParticleParticle", "", "Force" },
     { nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_VF_sse4_1_single, "nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_VF_sse4_1_single", "sse4_1_single", "ReactionField", "ExactCutoff", "LennardJones", "PotentialShift", "ParticleParticle", "", "PotentialAndForce" },
     { nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_F_sse4_1_single, "nb_kernel_ElecRFCut_VdwLJSh_GeomP1P1_F_sse4_1_single", "sse4_1_single", "ReactionField", "ExactCutoff", "LennardJones", "PotentialShift", "ParticleParticle", "", "Force" },
     { nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_VF_sse4_1_single, "nb_kernel_ElecRFCut_VdwLJSh_GeomW3P1_VF_sse4_1_single", "sse4_1_single", "ReactionField", "ExactCutoff", "LennardJones", "PotentialShift", "Water3Particle", "", "PotentialAndForce" },
@@ -519,7 +477,37 @@ nb_kernel_info_t
     { nb_kernel_ElecRF_VdwCSTab_GeomW4P1_VF_sse4_1_single, "nb_kernel_ElecRF_VdwCSTab_GeomW4P1_VF_sse4_1_single", "sse4_1_single", "ReactionField", "None", "CubicSplineTable", "None", "Water4Particle", "", "PotentialAndForce" },
     { nb_kernel_ElecRF_VdwCSTab_GeomW4P1_F_sse4_1_single, "nb_kernel_ElecRF_VdwCSTab_GeomW4P1_F_sse4_1_single", "sse4_1_single", "ReactionField", "None", "CubicSplineTable", "None", "Water4Particle", "", "Force" },
     { nb_kernel_ElecRF_VdwCSTab_GeomW4W4_VF_sse4_1_single, "nb_kernel_ElecRF_VdwCSTab_GeomW4W4_VF_sse4_1_single", "sse4_1_single", "ReactionField", "None", "CubicSplineTable", "None", "Water4Water4", "", "PotentialAndForce" },
-    { nb_kernel_ElecRF_VdwCSTab_GeomW4W4_F_sse4_1_single, "nb_kernel_ElecRF_VdwCSTab_GeomW4W4_F_sse4_1_single", "sse4_1_single", "ReactionField", "None", "CubicSplineTable", "None", "Water4Water4", "", "Force" }
+    { nb_kernel_ElecRF_VdwCSTab_GeomW4W4_F_sse4_1_single, "nb_kernel_ElecRF_VdwCSTab_GeomW4W4_F_sse4_1_single", "sse4_1_single", "ReactionField", "None", "CubicSplineTable", "None", "Water4Water4", "", "Force" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_sse4_1_single, "nb_kernel_ElecCoul_VdwLJ_GeomP1P1_VF_sse4_1_single", "sse4_1_single", "Coulomb", "None", "LennardJones", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_sse4_1_single, "nb_kernel_ElecCoul_VdwLJ_GeomP1P1_F_sse4_1_single", "sse4_1_single", "Coulomb", "None", "LennardJones", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_sse4_1_single, "nb_kernel_ElecCoul_VdwLJ_GeomW3P1_VF_sse4_1_single", "sse4_1_single", "Coulomb", "None", "LennardJones", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_sse4_1_single, "nb_kernel_ElecCoul_VdwLJ_GeomW3P1_F_sse4_1_single", "sse4_1_single", "Coulomb", "None", "LennardJones", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_sse4_1_single, "nb_kernel_ElecCoul_VdwLJ_GeomW3W3_VF_sse4_1_single", "sse4_1_single", "Coulomb", "None", "LennardJones", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_sse4_1_single, "nb_kernel_ElecCoul_VdwLJ_GeomW3W3_F_sse4_1_single", "sse4_1_single", "Coulomb", "None", "LennardJones", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_sse4_1_single, "nb_kernel_ElecCoul_VdwLJ_GeomW4P1_VF_sse4_1_single", "sse4_1_single", "Coulomb", "None", "LennardJones", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_sse4_1_single, "nb_kernel_ElecCoul_VdwLJ_GeomW4P1_F_sse4_1_single", "sse4_1_single", "Coulomb", "None", "LennardJones", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_sse4_1_single, "nb_kernel_ElecCoul_VdwLJ_GeomW4W4_VF_sse4_1_single", "sse4_1_single", "Coulomb", "None", "LennardJones", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_sse4_1_single, "nb_kernel_ElecCoul_VdwLJ_GeomW4W4_F_sse4_1_single", "sse4_1_single", "Coulomb", "None", "LennardJones", "None", "Water4Water4", "", "Force" },
+    { nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_sse4_1_single, "nb_kernel_ElecCoul_VdwNone_GeomP1P1_VF_sse4_1_single", "sse4_1_single", "Coulomb", "None", "None", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_sse4_1_single, "nb_kernel_ElecCoul_VdwNone_GeomP1P1_F_sse4_1_single", "sse4_1_single", "Coulomb", "None", "None", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_sse4_1_single, "nb_kernel_ElecCoul_VdwNone_GeomW3P1_VF_sse4_1_single", "sse4_1_single", "Coulomb", "None", "None", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_sse4_1_single, "nb_kernel_ElecCoul_VdwNone_GeomW3P1_F_sse4_1_single", "sse4_1_single", "Coulomb", "None", "None", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_sse4_1_single, "nb_kernel_ElecCoul_VdwNone_GeomW3W3_VF_sse4_1_single", "sse4_1_single", "Coulomb", "None", "None", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_sse4_1_single, "nb_kernel_ElecCoul_VdwNone_GeomW3W3_F_sse4_1_single", "sse4_1_single", "Coulomb", "None", "None", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_sse4_1_single, "nb_kernel_ElecCoul_VdwNone_GeomW4P1_VF_sse4_1_single", "sse4_1_single", "Coulomb", "None", "None", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_sse4_1_single, "nb_kernel_ElecCoul_VdwNone_GeomW4P1_F_sse4_1_single", "sse4_1_single", "Coulomb", "None", "None", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_sse4_1_single, "nb_kernel_ElecCoul_VdwNone_GeomW4W4_VF_sse4_1_single", "sse4_1_single", "Coulomb", "None", "None", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_sse4_1_single, "nb_kernel_ElecCoul_VdwNone_GeomW4W4_F_sse4_1_single", "sse4_1_single", "Coulomb", "None", "None", "None", "Water4Water4", "", "Force" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_sse4_1_single, "nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_VF_sse4_1_single", "sse4_1_single", "Coulomb", "None", "CubicSplineTable", "None", "ParticleParticle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_sse4_1_single, "nb_kernel_ElecCoul_VdwCSTab_GeomP1P1_F_sse4_1_single", "sse4_1_single", "Coulomb", "None", "CubicSplineTable", "None", "ParticleParticle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_sse4_1_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_VF_sse4_1_single", "sse4_1_single", "Coulomb", "None", "CubicSplineTable", "None", "Water3Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_sse4_1_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW3P1_F_sse4_1_single", "sse4_1_single", "Coulomb", "None", "CubicSplineTable", "None", "Water3Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_sse4_1_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_VF_sse4_1_single", "sse4_1_single", "Coulomb", "None", "CubicSplineTable", "None", "Water3Water3", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_sse4_1_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW3W3_F_sse4_1_single", "sse4_1_single", "Coulomb", "None", "CubicSplineTable", "None", "Water3Water3", "", "Force" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_sse4_1_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_VF_sse4_1_single", "sse4_1_single", "Coulomb", "None", "CubicSplineTable", "None", "Water4Particle", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_sse4_1_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW4P1_F_sse4_1_single", "sse4_1_single", "Coulomb", "None", "CubicSplineTable", "None", "Water4Particle", "", "Force" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_sse4_1_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_VF_sse4_1_single", "sse4_1_single", "Coulomb", "None", "CubicSplineTable", "None", "Water4Water4", "", "PotentialAndForce" },
+    { nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_sse4_1_single, "nb_kernel_ElecCoul_VdwCSTab_GeomW4W4_F_sse4_1_single", "sse4_1_single", "Coulomb", "None", "CubicSplineTable", "None", "Water4Water4", "", "Force" }
 };
 
 int
index f66ab5e5da6ef30a02b2f72bb1473477d820a3cb..39050e6121abb6e82ebb738a1fa9b084a9d2a6e1 100644 (file)
@@ -2,7 +2,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -131,12 +131,6 @@ void
     __m128           velec,felec,velecsum,facel,crf,krf,krf2;
     real             *charge;
     /* #endif */
-    /* #if 'GeneralizedBorn' in KERNEL_ELEC */
-    __m128i          gbitab;
-    __m128           vgb,fgb,vgbsum,dvdasum,gbscale,gbtabscale,isaprod,gbqqfactor,gbinvepsdiff,gbeps,dvdatmp;
-    __m128           minushalf = _mm_set1_ps(-0.5);
-    real             *invsqrta,*dvda,*gbtab;
-    /* #endif */
     /* #if KERNEL_VDW != 'None' */
     int              nvdwtype;
     __m128           rinvsix,rvdw,vvdw,vvdw6,vvdw12,fvdw,fvdw6,fvdw12,vvdwsum,sh_vdw_invrcut6;
@@ -145,7 +139,7 @@ void
     __m128           one_sixth   = _mm_set1_ps(1.0/6.0);
     __m128           one_twelfth = _mm_set1_ps(1.0/12.0);
     /* #endif */
-    /* #if 'Table' in KERNEL_ELEC or 'GeneralizedBorn' in KERNEL_ELEC or 'Table' in KERNEL_VDW */
+    /* #if 'Table' in KERNEL_ELEC or 'Table' in KERNEL_VDW */
     __m128i          vfitab;
     __m128i          ifour       = _mm_set1_epi32(4);
     __m128           rt,vfeps,vftabscale,Y,F,G,H,Heps,Fp,VV,FF;
@@ -229,14 +223,6 @@ void
      /*     #endif */
     /* #endif */
 
-    /* #if KERNEL_ELEC=='GeneralizedBorn' */
-    invsqrta         = fr->invsqrta;
-    dvda             = fr->dvda;
-    gbtabscale       = _mm_set1_ps(fr->gbtab->scale);
-    gbtab            = fr->gbtab->data;
-    gbinvepsdiff     = _mm_set1_ps((1.0/fr->ic->epsilon_r) - (1.0/fr->gb_epsilon_solvent));
-    /* #endif */
-
     /* #if 'Water' in GEOMETRY_I */
     /* Setup water-specific parameters */
     inr              = nlist->iinr[0];
@@ -370,9 +356,6 @@ void
         /*     #for I in PARTICLES_ELEC_I */
         iq{I}              = _mm_mul_ps(facel,_mm_load1_ps(charge+inr+{I}));
         /*         #define OUTERFLOPS OUTERFLOPS+1 */
-        /*         #if KERNEL_ELEC=='GeneralizedBorn' */
-        isai{I}            = _mm_load1_ps(invsqrta+inr+{I});
-        /*         #endif */
         /*     #endfor */
         /*     #for I in PARTICLES_VDW_I */
         vdwioffset{I}      = 2*nvdwtype*vdwtype[inr+{I}];
@@ -384,16 +367,10 @@ void
         /*     #if KERNEL_ELEC != 'None' */
         velecsum         = _mm_setzero_ps();
         /*     #endif */
-        /*     #if 'GeneralizedBorn' in KERNEL_ELEC */
-        vgbsum           = _mm_setzero_ps();
-        /*     #endif */
         /*     #if KERNEL_VDW != 'None' */
         vvdwsum          = _mm_setzero_ps();
         /*     #endif */
         /* #endif */
-        /*     #if 'GeneralizedBorn' in KERNEL_ELEC and 'Force' in KERNEL_VF */
-        dvdasum          = _mm_setzero_ps();
-        /*     #endif */
 
         /* #for ROUND in ['Loop','Epilogue'] */
 
@@ -498,10 +475,6 @@ void
             /*     #for J in PARTICLES_ELEC_J */
             jq{J}              = gmx_mm_load_4real_swizzle_ps(charge+jnrA+{J},charge+jnrB+{J},
                                                               charge+jnrC+{J},charge+jnrD+{J});
-            /*         #if KERNEL_ELEC=='GeneralizedBorn' */
-            isaj{J}            = gmx_mm_load_4real_swizzle_ps(invsqrta+jnrA+{J},invsqrta+jnrB+{J},
-                                                              invsqrta+jnrC+{J},invsqrta+jnrD+{J});
-            /*         #endif */
             /*     #endfor */
             /*     #for J in PARTICLES_VDW_J */
             vdwjidx{J}A        = 2*vdwtype[jnrA+{J}];
@@ -611,62 +584,6 @@ void
             /*                 #define INNERFLOPS INNERFLOPS+3 */
             /*             #endif */
 
-            /*         #elif KERNEL_ELEC=='GeneralizedBorn' */
-
-            /* GENERALIZED BORN AND COULOMB ELECTROSTATICS */
-            isaprod          = _mm_mul_ps(isai{I},isaj{J});
-            gbqqfactor       = _mm_xor_ps(signbit,_mm_mul_ps(qq{I}{J},_mm_mul_ps(isaprod,gbinvepsdiff)));
-            gbscale          = _mm_mul_ps(isaprod,gbtabscale);
-            /*             #define INNERFLOPS INNERFLOPS+5 */
-
-            /* Calculate generalized born table index - this is a separate table from the normal one,
-             * but we use the same procedure by multiplying r with scale and truncating to integer.
-             */
-            rt               = _mm_mul_ps(r{I}{J},gbscale);
-            gbitab           = _mm_cvttps_epi32(rt);
-            gbeps            = _mm_sub_ps(rt,_mm_round_ps(rt, _MM_FROUND_FLOOR));
-            gbitab           = _mm_slli_epi32(gbitab,2);
-            Y                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,0) );
-            F                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,1) );
-            G                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,2) );
-            H                = _mm_load_ps( gbtab + gmx_mm_extract_epi32(gbitab,3) );
-            _MM_TRANSPOSE4_PS(Y,F,G,H);
-            Heps             = _mm_mul_ps(gbeps,H);
-            Fp               = _mm_add_ps(F,_mm_mul_ps(gbeps,_mm_add_ps(G,Heps)));
-            VV               = _mm_add_ps(Y,_mm_mul_ps(gbeps,Fp));
-            vgb              = _mm_mul_ps(gbqqfactor,VV);
-            /*             #define INNERFLOPS INNERFLOPS+10 */
-
-            /*             #if 'Force' in KERNEL_VF */
-            FF               = _mm_add_ps(Fp,_mm_mul_ps(gbeps,_mm_add_ps(G,_mm_add_ps(Heps,Heps))));
-            fgb              = _mm_mul_ps(gbqqfactor,_mm_mul_ps(FF,gbscale));
-            dvdatmp          = _mm_mul_ps(minushalf,_mm_add_ps(vgb,_mm_mul_ps(fgb,r{I}{J})));
-            /*                 #if ROUND == 'Epilogue' */
-            dvdatmp          = _mm_andnot_ps(dummy_mask,dvdatmp);
-            /*                 #endif */
-            dvdasum          = _mm_add_ps(dvdasum,dvdatmp);
-            /*                 #if ROUND == 'Loop' */
-            fjptrA           = dvda+jnrA;
-            fjptrB           = dvda+jnrB;
-            fjptrC           = dvda+jnrC;
-            fjptrD           = dvda+jnrD;
-            /*                 #else */
-            /* The pointers to scratch make sure that this code with compilers that take gmx_restrict seriously (e.g. icc 13) really can't screw things up. */
-            fjptrA             = (jnrlistA>=0) ? dvda+jnrA : scratch;
-            fjptrB             = (jnrlistB>=0) ? dvda+jnrB : scratch;
-            fjptrC             = (jnrlistC>=0) ? dvda+jnrC : scratch;
-            fjptrD             = (jnrlistD>=0) ? dvda+jnrD : scratch;
-            /*                 #endif */
-            gmx_mm_increment_4real_swizzle_ps(fjptrA,fjptrB,fjptrC,fjptrD,_mm_mul_ps(dvdatmp,_mm_mul_ps(isaj{J},isaj{J})));
-            /*                 #define INNERFLOPS INNERFLOPS+13 */
-            /*             #endif */
-            velec            = _mm_mul_ps(qq{I}{J},rinv{I}{J});
-            /*                 #define INNERFLOPS INNERFLOPS+1 */
-            /*             #if 'Force' in KERNEL_VF */
-            felec            = _mm_mul_ps(_mm_sub_ps(_mm_mul_ps(velec,rinv{I}{J}),fgb),rinv{I}{J});
-            /*                 #define INNERFLOPS INNERFLOPS+3 */
-            /*             #endif */
-
             /*         #elif KERNEL_ELEC=='Ewald' */
             /* EWALD ELECTROSTATICS */
 
@@ -913,17 +830,6 @@ void
             /*             #endif */
             velecsum         = _mm_add_ps(velecsum,velec);
             /*             #define INNERFLOPS INNERFLOPS+1 */
-            /*             #if KERNEL_ELEC=='GeneralizedBorn' */
-            /*             #if 'exactcutoff' in INTERACTION_FLAGS[I][J] */
-            vgb              = _mm_and_ps(vgb,cutoff_mask);
-            /*                 #define INNERFLOPS INNERFLOPS+1 */
-            /*             #endif                                       */
-            /*             #if ROUND == 'Epilogue' */
-            vgb              = _mm_andnot_ps(dummy_mask,vgb);
-            /*             #endif */
-            vgbsum           = _mm_add_ps(vgbsum,vgb);
-            /*                 #define INNERFLOPS INNERFLOPS+1 */
-            /*             #endif */
             /*         #endif */
             /*         #if 'vdw' in INTERACTION_FLAGS[I][J] */
             /*     ## Note special check for TIP4P-TIP4P. Since we are cutting of all hydrogen interactions we also cut the LJ-only O-O interaction */
@@ -1075,19 +981,11 @@ void
         gmx_mm_update_1pot_ps(velecsum,kernel_data->energygrp_elec+ggid);
         /*         #define OUTERFLOPS OUTERFLOPS+1 */
         /*     #endif */
-        /*     #if 'GeneralizedBorn' in KERNEL_ELEC */
-        gmx_mm_update_1pot_ps(vgbsum,kernel_data->energygrp_polarization+ggid);
-        /*         #define OUTERFLOPS OUTERFLOPS+1 */
-        /*     #endif */
         /*     #if KERNEL_VDW != 'None' */
         gmx_mm_update_1pot_ps(vvdwsum,kernel_data->energygrp_vdw+ggid);
         /*         #define OUTERFLOPS OUTERFLOPS+1 */
         /*     #endif */
         /* #endif */
-        /*     #if 'GeneralizedBorn' in KERNEL_ELEC and 'Force' in KERNEL_VF */
-        dvdasum = _mm_mul_ps(dvdasum, _mm_mul_ps(isai{I},isai{I}));
-        gmx_mm_update_1pot_ps(dvdasum,dvda+inr);
-        /*     #endif */
 
         /* Increment number of inner iterations */
         inneriter                  += j_index_end - j_index_start;
index 2d683c34cb9a636229660b3c049383540bc50344..aba9e8f7355dafa82660dfa68346a7c75184617c 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -388,7 +388,6 @@ void do_nonbonded(t_forcerec *fr,
                 }
                 kernel_data.energygrp_elec          = grppener->ener[egCOULSR];
                 kernel_data.energygrp_vdw           = grppener->ener[fr->bBHAM ? egBHAMSR : egLJSR];
-                kernel_data.energygrp_polarization  = grppener->ener[egGB];
                 nlist = nblists->nlist_sr;
                 f                                   = f_shortrange;
             }
index 4bc3f67230888a05c9d20651976d2411cd33997d..ba5ec1da26525a10d2abfb9ad3d5fa58018cbf6a 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -85,7 +85,6 @@ static const t_nrnb_data nbdata[eNRNB] = {
     { "NB Generic charge grp kernel",    1 },
     { "NB Free energy kernel",           1 },
     { "NB All-vs-all",                   1 },
-    { "NB All-vs-all, GB",               1 },
 
     { "Pair Search distance check",      9 }, /* nbnxn pair dist. check */
     /* nbnxn kernel flops are based on inner-loops without exclusion checks.
@@ -120,12 +119,6 @@ static const t_nrnb_data nbdata[eNRNB] = {
     { "NxN LJ add LJ Ewald [F]",        36 }, /* extra cost for LJ Ewald */
     { "NxN LJ add LJ Ewald [V&F]",      33 },
     { "1,4 nonbonded interactions",     90 },
-    { "Born radii (Still)",             47 },
-    { "Born radii (HCT/OBC)",          183 },
-    { "Born force chain rule",          15 },
-    { "All-vs-All Still radii",          1 },
-    { "All-vs-All HCT/OBC radii",        1 },
-    { "All-vs-All Born chain rule",      1 },
     { "Calc Weights",                   36 },
     { "Spread Q",                        6 },
     { "Spread Q Bspline",                2 },
@@ -189,7 +182,6 @@ static const t_nrnb_data nbdata[eNRNB] = {
     { "Virtual Site 4fd",              110 },
     { "Virtual Site 4fdn",             254 },
     { "Virtual Site N",                 15 },
-    { "Mixed Generalized Born stuff",   10 },
     { "CMAP",                         1700 }, // Estimate!
     { "Urey-Bradley",                  183 },
     { "Cross-Bond-Bond",               163 },
@@ -334,7 +326,7 @@ void print_flop(FILE *out, t_nrnb *nrnb, double *nbfs, double *mflop)
     const char   *myline = "-----------------------------------------------------------------------------";
 
     *nbfs = 0.0;
-    for (i = 0; (i < eNR_NBKERNEL_ALLVSALLGB); i++)
+    for (i = 0; (i < eNR_NBKERNEL_TOTAL_NR); i++)
     {
         if (std::strstr(nbdata[i].name, "W3-W3") != nullptr)
         {
@@ -574,7 +566,7 @@ void pr_load(FILE *log, t_commrec *cr, t_nrnb nrnb[])
     {
         add_nrnb(av, av, &(nrnb[i]));
         /* Cost due to forces */
-        for (j = 0; (j < eNR_NBKERNEL_ALLVSALLGB); j++)
+        for (j = 0; (j < eNR_NBKERNEL_TOTAL_NR); j++)
         {
             ftot[i] += nrnb[i].n[j]*cost_nrnb(j);
         }
index 5cc1d8a7d53e453007f35ed570bf2613e3b25c98..53ee66765dd3cb26d785aff48f75144abf80ae4f 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -75,8 +75,8 @@ enum
     eNR_NBKERNEL_GENERIC_CG,
     eNR_NBKERNEL_FREE_ENERGY,               /* Add other generic kernels _before_ the free energy one */
 
-    eNR_NBKERNEL_ALLVSALL,
-    eNR_NBKERNEL_ALLVSALLGB,
+    eNR_NBKERNEL_TOTAL_NR,
+    eNR_NBKERNEL_ALLVSALL = eNR_NBKERNEL_TOTAL_NR, // Reuse the symbolic constant that indicates the last kernel
 
     eNR_NBNXN_DIST2,
     eNR_NBNXN_LJ_RF,          eNR_NBNXN_LJ_RF_E,
@@ -90,10 +90,6 @@ enum
     eNR_NBNXN_ADD_LJ_PSW,     eNR_NBNXN_ADD_LJ_PSW_E,
     eNR_NBNXN_ADD_LJ_EWALD,   eNR_NBNXN_ADD_LJ_EWALD_E,
     eNR_NB14,
-    eNR_BORN_RADII_STILL,     eNR_BORN_RADII_HCT_OBC,
-    eNR_BORN_CHAINRULE,
-    eNR_BORN_AVA_RADII_STILL, eNR_BORN_AVA_RADII_HCT_OBC,
-    eNR_BORN_AVA_CHAINRULE,
     eNR_WEIGHTS,              eNR_SPREAD,               eNR_SPREADBSP,
     eNR_GATHERF,              eNR_GATHERFBSP,           eNR_FFT,
     eNR_CONV,                 eNR_SOLVEPME, eNR_NS,      eNR_RESETX,
@@ -115,7 +111,7 @@ enum
     eNR_SHAKE_RIJ,            eNR_CONSTR_VIR,           eNR_SETTLE,
     eNR_VSITE2,               eNR_VSITE3,               eNR_VSITE3FD,
     eNR_VSITE3FAD,            eNR_VSITE3OUT,            eNR_VSITE4FD,
-    eNR_VSITE4FDN,            eNR_VSITEN,               eNR_GB,
+    eNR_VSITE4FDN,            eNR_VSITEN,
     eNR_CMAP,                 eNR_UREY_BRADLEY,         eNR_CROSS_BOND_BOND,
     eNR_CROSS_BOND_ANGLE,
     eNRNB
index 0a2f123d115652568d67ea7e3c861ea1041f52a0..619e55b8266398e0bd7d7b957ed2880a24f612f9 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -442,14 +442,9 @@ assign_param(t_functype ftype, t_iparams *newparam,
             newparam->cmap.cmapA = static_cast<int>(old[0]);
             newparam->cmap.cmapB = static_cast<int>(old[1]);
             break;
-        case F_GB12:
-        case F_GB13:
-        case F_GB14:
-            newparam->gb.sar  = old[0];
-            newparam->gb.st   = old[1];
-            newparam->gb.pi   = old[2];
-            newparam->gb.gbr  = old[3];
-            newparam->gb.bmlt = old[4];
+        case F_GB12_NOLONGERUSED:
+        case F_GB13_NOLONGERUSED:
+        case F_GB14_NOLONGERUSED:
             break;
         default:
             gmx_fatal(FARGS, "unknown function type %d in %s line %d",
@@ -478,26 +473,9 @@ static int enter_params(gmx_ffparams_t *ffparams, t_functype ftype,
         {
             if (ffparams->functype[type] == ftype)
             {
-                if (F_GB13 == ftype)
+                if (memcmp(&newparam, &ffparams->iparams[type], (size_t)sizeof(newparam)) == 0)
                 {
-                    /* Occasionally, the way the 1-3 reference distance is
-                     * computed can lead to non-binary-identical results, but I
-                     * don't know why. */
-                    if ((gmx_within_tol(newparam.gb.sar,  ffparams->iparams[type].gb.sar,  1e-6)) &&
-                        (gmx_within_tol(newparam.gb.st,   ffparams->iparams[type].gb.st,   1e-6)) &&
-                        (gmx_within_tol(newparam.gb.pi,   ffparams->iparams[type].gb.pi,   1e-6)) &&
-                        (gmx_within_tol(newparam.gb.gbr,  ffparams->iparams[type].gb.gbr,  1e-6)) &&
-                        (gmx_within_tol(newparam.gb.bmlt, ffparams->iparams[type].gb.bmlt, 1e-6)))
-                    {
-                        return type;
-                    }
-                }
-                else
-                {
-                    if (memcmp(&newparam, &ffparams->iparams[type], (size_t)sizeof(newparam)) == 0)
-                    {
-                        return type;
-                    }
+                    return type;
                 }
             }
         }
index 68538e842636e5c4a841583c3cae4f34413abebb..50f7d7f1246c06065c9a74544c5a8069db39e64b 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2011,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2011,2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -59,11 +59,6 @@ typedef struct gpp_atomtype {
     char          ***atomname;     /* Names of the atomtypes           */
     t_param         *nb;           /* Nonbonded force default params   */
     int             *bondatomtype; /* The bond_atomtype for each atomtype  */
-    real            *radius;       /* Radius for GBSA stuff                */
-    real            *vol;          /* Effective volume for GBSA            */
-    real            *surftens;     /* Surface tension with water, for GBSA */
-    real            *gb_radius;    /* Radius for Still model               */
-    real            *S_hct;        /* Overlap factor for HCT model         */
     int             *atomnumber;   /* Atomic number, used for QM/MM        */
 } t_gpp_atomtype;
 
@@ -168,56 +163,6 @@ int get_atomtype_atomnumber(int nt, gpp_atomtype_t ga)
     return ga->atomnumber[nt];
 }
 
-real get_atomtype_radius(int nt, gpp_atomtype_t ga)
-{
-    if ((nt < 0) || (nt >= ga->nr))
-    {
-        return NOTSET;
-    }
-
-    return ga->radius[nt];
-}
-
-real get_atomtype_vol(int nt, gpp_atomtype_t ga)
-{
-    if ((nt < 0) || (nt >= ga->nr))
-    {
-        return NOTSET;
-    }
-
-    return ga->vol[nt];
-}
-
-real get_atomtype_surftens(int nt, gpp_atomtype_t ga)
-{
-    if ((nt < 0) || (nt >= ga->nr))
-    {
-        return NOTSET;
-    }
-
-    return ga->surftens[nt];
-}
-
-real get_atomtype_gb_radius(int nt, gpp_atomtype_t ga)
-{
-    if ((nt < 0) || (nt >= ga->nr))
-    {
-        return NOTSET;
-    }
-
-    return ga->gb_radius[nt];
-}
-
-real get_atomtype_S_hct(int nt, gpp_atomtype_t ga)
-{
-    if ((nt < 0) || (nt >= ga->nr))
-    {
-        return NOTSET;
-    }
-
-    return ga->S_hct[nt];
-}
-
 real get_atomtype_nbparam(int nt, int param, gpp_atomtype_t ga)
 {
     if ((nt < 0) || (nt >= ga->nr))
@@ -242,41 +187,14 @@ gpp_atomtype_t init_atomtype(void)
     ga->atomname     = nullptr;
     ga->nb           = nullptr;
     ga->bondatomtype = nullptr;
-    ga->radius       = nullptr;
-    ga->vol          = nullptr;
-    ga->surftens     = nullptr;
     ga->atomnumber   = nullptr;
-    ga->gb_radius    = nullptr;
-    ga->S_hct        = nullptr;
 
     return ga;
 }
 
-int
-set_atomtype_gbparam(gpp_atomtype_t ga, int i,
-                     real radius, real vol, real surftens,
-                     real gb_radius, real S_hct)
-{
-    if ( (i < 0) || (i >= ga->nr))
-    {
-        return NOTSET;
-    }
-
-    ga->radius[i]    = radius;
-    ga->vol[i]       = vol;
-    ga->surftens[i]  = surftens;
-    ga->gb_radius[i] = gb_radius;
-    ga->S_hct[i]     = S_hct;
-
-    return i;
-}
-
-
 int set_atomtype(int nt, gpp_atomtype_t ga, t_symtab *tab,
                  t_atom *a, const char *name, t_param *nb,
-                 int bondatomtype,
-                 real radius, real vol, real surftens, int atomnumber,
-                 real gb_radius, real S_hct)
+                 int bondatomtype, int atomnumber)
 {
     if ((nt < 0) || (nt >= ga->nr))
     {
@@ -287,21 +205,14 @@ int set_atomtype(int nt, gpp_atomtype_t ga, t_symtab *tab,
     ga->atomname[nt]     = put_symtab(tab, name);
     ga->nb[nt]           = *nb;
     ga->bondatomtype[nt] = bondatomtype;
-    ga->radius[nt]       = radius;
-    ga->vol[nt]          = vol;
-    ga->surftens[nt]     = surftens;
     ga->atomnumber[nt]   = atomnumber;
-    ga->gb_radius[nt]    = gb_radius;
-    ga->S_hct[nt]        = S_hct;
 
     return nt;
 }
 
 int add_atomtype(gpp_atomtype_t ga, t_symtab *tab,
                  t_atom *a, const char *name, t_param *nb,
-                 int bondatomtype,
-                 real radius, real vol, real surftens, int atomnumber,
-                 real gb_radius, real S_hct)
+                 int bondatomtype, int atomnumber)
 {
     int i;
 
@@ -323,15 +234,9 @@ int add_atomtype(gpp_atomtype_t ga, t_symtab *tab,
         srenew(ga->atomname, ga->nr);
         srenew(ga->nb, ga->nr);
         srenew(ga->bondatomtype, ga->nr);
-        srenew(ga->radius, ga->nr);
-        srenew(ga->vol, ga->nr);
-        srenew(ga->surftens, ga->nr);
         srenew(ga->atomnumber, ga->nr);
-        srenew(ga->gb_radius, ga->nr);
-        srenew(ga->S_hct, ga->nr);
 
-        return set_atomtype(ga->nr-1, ga, tab, a, name, nb, bondatomtype, radius,
-                            vol, surftens, atomnumber, gb_radius, S_hct);
+        return set_atomtype(ga->nr-1, ga, tab, a, name, nb, bondatomtype, atomnumber);
     }
     else
     {
@@ -364,11 +269,6 @@ void done_atomtype(gpp_atomtype_t ga)
     sfree(ga->atomname);
     sfree(ga->nb);
     sfree(ga->bondatomtype);
-    sfree(ga->radius);
-    sfree(ga->vol);
-    sfree(ga->gb_radius);
-    sfree(ga->S_hct);
-    sfree(ga->surftens);
     sfree(ga->atomnumber);
     ga->nr = 0;
     sfree(ga);
@@ -404,15 +304,10 @@ static int search_atomtypes(gpp_atomtype_t ga, int *n, int typelist[],
                 bFound = (param[ntype*typelist[i]+j].c[k] == param[ntype*thistype+j].c[k]);
             }
 
-            /* Check radius, volume, surftens */
+            /* Check atomnumber */
             tli    = typelist[i];
             bFound = bFound &&
-                (get_atomtype_radius(tli, ga) == get_atomtype_radius(thistype, ga)) &&
-                (get_atomtype_vol(tli, ga) == get_atomtype_vol(thistype, ga)) &&
-                (get_atomtype_surftens(tli, ga) == get_atomtype_surftens(thistype, ga)) &&
-                (get_atomtype_atomnumber(tli, ga) == get_atomtype_atomnumber(thistype, ga)) &&
-                (get_atomtype_gb_radius(tli, ga) == get_atomtype_gb_radius(thistype, ga)) &&
-                (get_atomtype_S_hct(tli, ga) == get_atomtype_S_hct(thistype, ga));
+                (get_atomtype_atomnumber(tli, ga) == get_atomtype_atomnumber(thistype, ga));
         }
         if (bFound)
         {
@@ -446,11 +341,6 @@ void renum_atype(t_params plist[], gmx_mtop_t *mtop,
     t_atoms    *atoms;
     t_param    *nbsnew;
     int        *typelist;
-    real       *new_radius;
-    real       *new_vol;
-    real       *new_surftens;
-    real       *new_gb_radius;
-    real       *new_S_hct;
     int        *new_atomnumber;
     char     ***new_atomname;
 
@@ -467,10 +357,6 @@ void renum_atype(t_params plist[], gmx_mtop_t *mtop,
      * ones with identical nonbonded interactions, in addition
      * to removing unused ones.
      *
-     * With Generalized-Born electrostatics, or implicit solvent
-     * we also check that the atomtype radius, effective_volume
-     * and surface tension match.
-     *
      * With QM/MM we also check that the atom numbers match
      */
 
@@ -512,12 +398,7 @@ void renum_atype(t_params plist[], gmx_mtop_t *mtop,
         }
     }
 
-    snew(new_radius, nat);
-    snew(new_vol, nat);
-    snew(new_surftens, nat);
     snew(new_atomnumber, nat);
-    snew(new_gb_radius, nat);
-    snew(new_S_hct, nat);
     snew(new_atomname, nat);
 
     /* We now have a list of unique atomtypes in typelist */
@@ -544,12 +425,7 @@ void renum_atype(t_params plist[], gmx_mtop_t *mtop,
                 nbsnew[k].c[l] = plist[ftype].param[ntype*mi+mj].c[l];
             }
         }
-        new_radius[i]     = get_atomtype_radius(mi, ga);
-        new_vol[i]        = get_atomtype_vol(mi, ga);
-        new_surftens[i]   = get_atomtype_surftens(mi, ga);
         new_atomnumber[i] = get_atomtype_atomnumber(mi, ga);
-        new_gb_radius[i]  = get_atomtype_gb_radius(mi, ga);
-        new_S_hct[i]      = get_atomtype_S_hct(mi, ga);
         new_atomname[i]   = ga->atomname[mi];
     }
 
@@ -563,21 +439,11 @@ void renum_atype(t_params plist[], gmx_mtop_t *mtop,
     plist[ftype].nr     = i;
     mtop->ffparams.atnr = nat;
 
-    sfree(ga->radius);
-    sfree(ga->vol);
-    sfree(ga->surftens);
     sfree(ga->atomnumber);
-    sfree(ga->gb_radius);
-    sfree(ga->S_hct);
     /* Dangling atomname pointers ? */
     sfree(ga->atomname);
 
-    ga->radius     = new_radius;
-    ga->vol        = new_vol;
-    ga->surftens   = new_surftens;
     ga->atomnumber = new_atomnumber;
-    ga->gb_radius  = new_gb_radius;
-    ga->S_hct      = new_S_hct;
     ga->atomname   = new_atomname;
 
     ga->nr = nat;
@@ -593,20 +459,10 @@ void copy_atomtype_atomtypes(gpp_atomtype_t ga, t_atomtypes *atomtypes)
     /* Copy the atomtype data to the topology atomtype list */
     ntype         = get_atomtype_ntypes(ga);
     atomtypes->nr = ntype;
-    snew(atomtypes->radius, ntype);
-    snew(atomtypes->vol, ntype);
-    snew(atomtypes->surftens, ntype);
     snew(atomtypes->atomnumber, ntype);
-    snew(atomtypes->gb_radius, ntype);
-    snew(atomtypes->S_hct, ntype);
 
     for (i = 0; i < ntype; i++)
     {
-        atomtypes->radius[i]     = ga->radius[i];
-        atomtypes->vol[i]        = ga->vol[i];
-        atomtypes->surftens[i]   = ga->surftens[i];
         atomtypes->atomnumber[i] = ga->atomnumber[i];
-        atomtypes->gb_radius[i]  = ga->gb_radius[i];
-        atomtypes->S_hct[i]      = ga->S_hct[i];
     }
 }
index 8197540305cb64cb8caf2fed45cd4dde8533abf8..66edce1ee2059f86a47130a878bcaea2ab2f832e 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2011,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2011,2014,2015,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -60,11 +60,6 @@ real get_atomtype_massA(int nt, gpp_atomtype_t at);
 real get_atomtype_massB(int nt, gpp_atomtype_t at);
 real get_atomtype_qA(int nt, gpp_atomtype_t at);
 real get_atomtype_qB(int nt, gpp_atomtype_t at);
-real get_atomtype_radius(int nt, gpp_atomtype_t at);
-real get_atomtype_vol(int nt, gpp_atomtype_t at);
-real get_atomtype_surftens(int nt, gpp_atomtype_t at);
-real get_atomtype_gb_radius(int nt, gpp_atomtype_t at);
-real get_atomtype_S_hct(int nt, gpp_atomtype_t at);
 int get_atomtype_ptype(int nt, gpp_atomtype_t at);
 int get_atomtype_batype(int nt, gpp_atomtype_t at);
 int get_atomtype_atomnumber(int nt, gpp_atomtype_t at);
@@ -82,22 +77,13 @@ void done_atomtype(gpp_atomtype_t at);
 
 int set_atomtype(int nt, gpp_atomtype_t at, struct t_symtab *tab,
                  t_atom *a, const char *name, t_param *nb,
-                 int bondatomtype,
-                 real radius, real vol, real surftens, int atomnumber,
-                 real gb_radius, real S_hct);
+                 int bondatomtype, int atomnumber);
 /* Set the values of an existing atom type nt. Returns nt on success or
    NOTSET on error. */
 
-int
-set_atomtype_gbparam(gpp_atomtype_t at, int i,
-                     real radius, real vol, real surftens,
-                     real gb_radius, real S_hct);
-
 int add_atomtype(gpp_atomtype_t at, struct t_symtab *tab,
                  t_atom *a, const char *name, t_param *nb,
-                 int bondatomtype,
-                 real radius, real vol, real surftens, int atomnumber,
-                 real gb_radius, real S_hct);
+                 int bondatomtype, int atomnumber);
 /* Add a complete new atom type to an existing atomtype structure. Returns
    the number of the atom type. */
 
index 30cbe16288dbf5f2a5a459d4fe059e73d5011887..2133aa71948eaf57ac8f0afa65990d955cb299b3 100644 (file)
@@ -77,7 +77,6 @@
 #include "gromacs/mdlib/calc_verletbuf.h"
 #include "gromacs/mdlib/compute_io.h"
 #include "gromacs/mdlib/constr.h"
-#include "gromacs/mdlib/genborn.h"
 #include "gromacs/mdlib/perf_est.h"
 #include "gromacs/mdlib/sim_util.h"
 #include "gromacs/mdrunutility/mdmodules.h"
@@ -520,23 +519,16 @@ new_status(const char *topfile, const char *topppfile, const char *confin,
     gmx_molblock_t *molblock, *molbs;
     int             mb, i, nrmols, nmismatch;
     char            buf[STRLEN];
-    gmx_bool        bGB = FALSE;
     char            warn_buf[STRLEN];
 
     init_mtop(sys);
 
-    /* Set gmx_boolean for GB */
-    if (ir->implicit_solvent)
-    {
-        bGB = TRUE;
-    }
-
     /* TOPOLOGY processing */
     sys->name = do_top(bVerbose, topfile, topppfile, opts, bZero, &(sys->symtab),
                        plist, comb, reppow, fudgeQQ,
                        atype, &nrmols, &molinfo, intermolecular_interactions,
                        ir,
-                       &nmolblock, &molblock, bGB,
+                       &nmolblock, &molblock,
                        wi);
 
     sys->nmolblock = 0;
@@ -1270,73 +1262,6 @@ static int count_constraints(gmx_mtop_t *mtop, t_molinfo *mi, warninp_t wi)
     return count;
 }
 
-static void check_gbsa_params_charged(gmx_mtop_t *sys, gpp_atomtype_t atype)
-{
-    int            i, nmiss, natoms, mt;
-    real           q;
-    const t_atoms *atoms;
-
-    nmiss = 0;
-    for (mt = 0; mt < sys->nmoltype; mt++)
-    {
-        atoms  = &sys->moltype[mt].atoms;
-        natoms = atoms->nr;
-
-        for (i = 0; i < natoms; i++)
-        {
-            q = atoms->atom[i].q;
-            if ((get_atomtype_radius(atoms->atom[i].type, atype)    == 0  ||
-                 get_atomtype_vol(atoms->atom[i].type, atype)       == 0  ||
-                 get_atomtype_surftens(atoms->atom[i].type, atype)  == 0  ||
-                 get_atomtype_gb_radius(atoms->atom[i].type, atype) == 0  ||
-                 get_atomtype_S_hct(atoms->atom[i].type, atype)     == 0) &&
-                q != 0)
-            {
-                fprintf(stderr, "\nGB parameter(s) zero for atom type '%s' while charge is %g\n",
-                        get_atomtype_name(atoms->atom[i].type, atype), q);
-                nmiss++;
-            }
-        }
-    }
-
-    if (nmiss > 0)
-    {
-        gmx_fatal(FARGS, "Can't do GB electrostatics; the implicit_genborn_params section of the forcefield has parameters with value zero for %d atomtypes that occur as charged atoms.", nmiss);
-    }
-}
-
-
-static void check_gbsa_params(gpp_atomtype_t atype)
-{
-    int  nmiss, i;
-
-    /* If we are doing GBSA, check that we got the parameters we need
-     * This checking is to see if there are GBSA paratmeters for all
-     * atoms in the force field. To go around this for testing purposes
-     * comment out the nerror++ counter temporarily
-     */
-    nmiss = 0;
-    for (i = 0; i < get_atomtype_ntypes(atype); i++)
-    {
-        if (get_atomtype_radius(i, atype)    < 0 ||
-            get_atomtype_vol(i, atype)       < 0 ||
-            get_atomtype_surftens(i, atype)  < 0 ||
-            get_atomtype_gb_radius(i, atype) < 0 ||
-            get_atomtype_S_hct(i, atype)     < 0)
-        {
-            fprintf(stderr, "\nGB parameter(s) missing or negative for atom type '%s'\n",
-                    get_atomtype_name(i, atype));
-            nmiss++;
-        }
-    }
-
-    if (nmiss > 0)
-    {
-        gmx_fatal(FARGS, "Can't do GB electrostatics; the implicit_genborn_params section of the forcefield is missing parameters for %d atomtypes or they might be negative.", nmiss);
-    }
-
-}
-
 static real calc_temp(const gmx_mtop_t *mtop,
                       const t_inputrec *ir,
                       rvec             *v)
@@ -2061,15 +1986,9 @@ int gmx_grompp(int argc, char *argv[])
         get_atomtype_ntypes(atype);
     }
 
-    if (ir->implicit_solvent != eisNO)
+    if (ir->implicit_solvent)
     {
-        /* Now we have renumbered the atom types, we can check the GBSA params */
-        check_gbsa_params(atype);
-
-        /* Check that all atoms that have charge and/or LJ-parameters also have
-         * sensible GB-parameters
-         */
-        check_gbsa_params_charged(sys, atype);
+        gmx_fatal(FARGS, "Implicit solvation is no longer supported");
     }
 
     /* PELA: Copy the atomtype data to the topology atomtype list */
index 25f770f7f068bcc1f4ef6c0e46f618e0efedc982..3b7d145a8ce813005a1ab20705b5b526be822d17 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2008, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -343,7 +343,7 @@ int nm2type(int nnm, t_nm2type nm2t[], struct t_symtab *tab, t_atoms *atoms,
                 atoms->atom[i].qB = alpha;
                 atoms->atom[i].m  = atoms->atom[i].mB = mm;
                 k                 = add_atomtype(atype, tab, &(atoms->atom[i]), type, param,
-                                                 atoms->atom[i].type, 0, 0, 0, atomnr, 0, 0);
+                                                 atoms->atom[i].type, atomnr);
             }
             atoms->atom[i].type  = k;
             atoms->atom[i].typeB = k;
index eab0056b1077520b863530be1661866f0e63e43b..8286170b7dd75f26ab725a817728c6353ac73e23 100644 (file)
@@ -370,11 +370,6 @@ void check_ir(const char *mdparin, t_inputrec *ir, t_gromppopts *opts,
             warning_error(wi, warn_buf);
         }
 
-        if (ir->implicit_solvent != eisNO)
-        {
-            warning_error(wi, "Implicit solvent is not (yet) supported with the with Verlet lists.");
-        }
-
         if (EEL_USER(ir->coulombtype))
         {
             sprintf(warn_buf, "Coulomb type %s is not supported with the verlet scheme", eel_names[ir->coulombtype]);
@@ -1050,12 +1045,6 @@ void check_ir(const char *mdparin, t_inputrec *ir, t_gromppopts *opts,
         warning(wi, warn_buf);
     }
 
-    if (ir->epsilon_r != 1 && ir->implicit_solvent == eisGBSA)
-    {
-        sprintf(warn_buf, "epsilon-r = %g with GB implicit solvent, will use this value for inner dielectric", ir->epsilon_r);
-        warning_note(wi, warn_buf);
-    }
-
     if (EEL_RF(ir->coulombtype) && ir->epsilon_rf == 1 && ir->epsilon_r != 1)
     {
         sprintf(warn_buf, "epsilon-r = %g and epsilon-rf = 1 with reaction field, proceeding assuming old format and exchanging epsilon-r and epsilon-rf", ir->epsilon_r);
@@ -1067,9 +1056,9 @@ void check_ir(const char *mdparin, t_inputrec *ir, t_gromppopts *opts,
     if (ir->epsilon_r == 0)
     {
         sprintf(err_buf,
-                "It is pointless to use long-range or Generalized Born electrostatics with infinite relative permittivity."
+                "It is pointless to use long-range electrostatics with infinite relative permittivity."
                 "Since you are effectively turning of electrostatics, a plain cutoff will be much faster.");
-        CHECK(EEL_FULL(ir->coulombtype) || ir->implicit_solvent == eisGBSA);
+        CHECK(EEL_FULL(ir->coulombtype));
     }
 
     if (getenv("GMX_DO_GALACTIC_DYNAMICS") == nullptr)
@@ -1333,60 +1322,6 @@ void check_ir(const char *mdparin, t_inputrec *ir, t_gromppopts *opts,
         warning_error(wi, warn_buf);
     }
 
-    if (ir->sa_algorithm == esaSTILL)
-    {
-        sprintf(err_buf, "Still SA algorithm not available yet, use %s or %s instead\n", esa_names[esaAPPROX], esa_names[esaNO]);
-        CHECK(ir->sa_algorithm == esaSTILL);
-    }
-
-    if (ir->implicit_solvent == eisGBSA)
-    {
-        sprintf(err_buf, "With GBSA implicit solvent, rgbradii must be equal to rlist.");
-        CHECK(ir->rgbradii != ir->rlist);
-
-        if (ir->coulombtype != eelCUT)
-        {
-            sprintf(err_buf, "With GBSA, coulombtype must be equal to %s\n", eel_names[eelCUT]);
-            CHECK(ir->coulombtype != eelCUT);
-        }
-        if (ir->vdwtype != evdwCUT)
-        {
-            sprintf(err_buf, "With GBSA, vdw-type must be equal to %s\n", evdw_names[evdwCUT]);
-            CHECK(ir->vdwtype != evdwCUT);
-        }
-        if (ir->nstgbradii < 1)
-        {
-            sprintf(warn_buf, "Using GBSA with nstgbradii<1, setting nstgbradii=1");
-            warning_note(wi, warn_buf);
-            ir->nstgbradii = 1;
-        }
-        if (ir->sa_algorithm == esaNO)
-        {
-            sprintf(warn_buf, "No SA (non-polar) calculation requested together with GB. Are you sure this is what you want?\n");
-            warning_note(wi, warn_buf);
-        }
-        if (ir->sa_surface_tension < 0 && ir->sa_algorithm != esaNO)
-        {
-            sprintf(warn_buf, "Value of sa_surface_tension is < 0. Changing it to 2.05016 or 2.25936 kJ/nm^2/mol for Still and HCT/OBC respectively\n");
-            warning_note(wi, warn_buf);
-
-            if (ir->gb_algorithm == egbSTILL)
-            {
-                ir->sa_surface_tension = 0.0049 * CAL2JOULE * 100;
-            }
-            else
-            {
-                ir->sa_surface_tension = 0.0054 * CAL2JOULE * 100;
-            }
-        }
-        if (ir->sa_surface_tension == 0 && ir->sa_algorithm != esaNO)
-        {
-            sprintf(err_buf, "Surface tension set to 0 while SA-calculation requested\n");
-            CHECK(ir->sa_surface_tension == 0 && ir->sa_algorithm != esaNO);
-        }
-
-    }
-
     if (ir->bQMMM)
     {
         if (ir->cutoff_scheme != ecutsGROUP)
@@ -1834,6 +1769,8 @@ void get_ir(const char *mdparin, const char *mdparout,
     t_lambda   *fep    = ir->fepvals;
     t_expanded *expand = ir->expandedvals;
 
+    const char *no_names[] = { "no", nullptr };
+
     init_inputrec_strings();
     gmx::TextInputFile stream(mdparin);
     inp = read_inpfile(&stream, mdparin, &ninp, wi);
@@ -1878,6 +1815,17 @@ void get_ir(const char *mdparin, const char *mdparout,
     REM_TYPE("rlistlong");
     REM_TYPE("nstcalclr");
     REM_TYPE("pull-print-com2");
+    REM_TYPE("gb-algorithm");
+    REM_TYPE("nstgbradii");
+    REM_TYPE("rgbradii");
+    REM_TYPE("gb-epsilon-solvent");
+    REM_TYPE("gb-saltconc");
+    REM_TYPE("gb-obc-alpha");
+    REM_TYPE("gb-obc-beta");
+    REM_TYPE("gb-obc-gamma");
+    REM_TYPE("gb-dielectric-offset");
+    REM_TYPE("sa-algorithm");
+    REM_TYPE("sa-surface-tension");
 
     /* replace the following commands with the clearer new versions*/
     REPL_TYPE("unconstrained-start", "continuation");
@@ -2008,30 +1956,10 @@ void get_ir(const char *mdparin, const char *mdparout,
     EETYPE("ewald-geometry", ir->ewald_geometry, eewg_names);
     RTYPE ("epsilon-surface", ir->epsilon_surface, 0.0);
 
-    CCTYPE("IMPLICIT SOLVENT ALGORITHM");
-    EETYPE("implicit-solvent", ir->implicit_solvent, eis_names);
-
-    CCTYPE ("GENERALIZED BORN ELECTROSTATICS");
-    CTYPE ("Algorithm for calculating Born radii");
-    EETYPE("gb-algorithm", ir->gb_algorithm, egb_names);
-    CTYPE ("Frequency of calculating the Born radii inside rlist");
-    ITYPE ("nstgbradii", ir->nstgbradii, 1);
-    CTYPE ("Cutoff for Born radii calculation; the contribution from atoms");
-    CTYPE ("between rlist and rgbradii is updated every nstlist steps");
-    RTYPE ("rgbradii",  ir->rgbradii, 1.0);
-    CTYPE ("Dielectric coefficient of the implicit solvent");
-    RTYPE ("gb-epsilon-solvent", ir->gb_epsilon_solvent, 80.0);
-    CTYPE ("Salt concentration in M for Generalized Born models");
-    RTYPE ("gb-saltconc",  ir->gb_saltconc, 0.0);
-    CTYPE ("Scaling factors used in the OBC GB model. Default values are OBC(II)");
-    RTYPE ("gb-obc-alpha", ir->gb_obc_alpha, 1.0);
-    RTYPE ("gb-obc-beta", ir->gb_obc_beta, 0.8);
-    RTYPE ("gb-obc-gamma", ir->gb_obc_gamma, 4.85);
-    RTYPE ("gb-dielectric-offset", ir->gb_dielectric_offset, 0.009);
-    EETYPE("sa-algorithm", ir->sa_algorithm, esa_names);
-    CTYPE ("Surface tension (kJ/mol/nm^2) for the SA (nonpolar surface) part of GBSA");
-    CTYPE ("The value -1 will set default value for Still/HCT/OBC GB-models.");
-    RTYPE ("sa-surface-tension", ir->sa_surface_tension, -1);
+    /* Implicit solvation is no longer supported, but we need grompp
+       to be able to refuse old .mdp files that would have built a tpr
+       to run it. Thus, only "no" is accepted. */
+    EETYPE("implicit-solvent", ir->implicit_solvent, no_names);
 
     /* Coupling stuff */
     CCTYPE ("OPTIONS FOR WEAK COUPLING ALGORITHMS");
@@ -2362,8 +2290,9 @@ void get_ir(const char *mdparin, const char *mdparout,
         RTYPE("threshold", ir->swap->threshold, 1.0);
     }
 
-    /* AdResS is no longer supported, but we need mdrun to be able to refuse to run old AdResS .tpr files */
-    EETYPE("adress", ir->bAdress, yesno_names);
+    /* AdResS is no longer supported, but we need grompp to be able to
+       refuse to process old .mdp files that used it. */
+    EETYPE("adress", ir->bAdress, no_names);
 
     /* User defined thingies */
     CCTYPE ("User defined thingies");
@@ -4228,7 +4157,7 @@ void triple_check(const char *mdparin, t_inputrec *ir, gmx_mtop_t *sys,
     }
     else
     {
-        if (ir->coulombtype == eelCUT && ir->rcoulomb > 0 && !ir->implicit_solvent)
+        if (ir->coulombtype == eelCUT && ir->rcoulomb > 0)
         {
             sprintf(err_buf,
                     "You are using a plain Coulomb cut-off, which might produce artifacts.\n"
index 689eae682f8b61b5e6c052289527eb5c57e85f07..4304dbda00aa56706700c0f0b08a4a2d179b3500 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -90,7 +90,7 @@ gpp_atomtype_t read_atype(const char *ffdir, t_symtab *tab)
             if (sscanf(buf, "%s%lf", name, &m) == 2)
             {
                 a->m = m;
-                add_atomtype(at, tab, a, name, nb, 0, 0.0, 0.0, 0.0, 0, 0.0, 0.0 );
+                add_atomtype(at, tab, a, name, nb, 0, 0);
                 fprintf(stderr, "\rAtomtype %d", ++nratt);
                 fflush(stderr);
             }
index f266dc156dd25a426cfa51e2fab4878bf454e66c..4b72470dec36f67b769cde621b5124d91d018a37 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2017, by the GROMACS development team, led by
+ * Copyright (c) 2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -71,8 +71,7 @@ namespace test
 class GetIrTest : public ::testing::Test
 {
     public:
-        GetIrTest() : fileManager_(), data_(), checker_(data_.rootChecker()),
-                      ir_(), mdModules_(), opts_(),
+        GetIrTest() : fileManager_(), ir_(), mdModules_(), opts_(),
                       wi_(init_warning(FALSE, 0)), wiGuard_(wi_)
 
         {
@@ -99,17 +98,19 @@ class GetIrTest : public ::testing::Test
 
             get_ir(inputMdpFilename.c_str(), outputMdpFilename.c_str(),
                    &mdModules_, &ir_, &opts_, WriteMdpHeader::no, wi_);
-            bool failure = warning_errors_exist(wi_);
-            checker_.checkBoolean(failure, "Error parsing mdp file");
+
+            // Now check
+            bool                 failure = warning_errors_exist(wi_);
+            TestReferenceData    data;
+            TestReferenceChecker checker(data.rootChecker());
+            checker.checkBoolean(failure, "Error parsing mdp file");
             warning_reset(wi_);
 
             auto outputMdpContents = TextReader::readFileToString(outputMdpFilename);
-            checker_.checkString(outputMdpContents, "OutputMdpFile");
+            checker.checkString(outputMdpContents, "OutputMdpFile");
         }
 
         TestFileManager                    fileManager_;
-        TestReferenceData                  data_;
-        TestReferenceChecker               checker_;
         t_inputrec                         ir_;
         MDModules                          mdModules_;
         t_gromppopts                       opts_;
@@ -182,5 +183,23 @@ TEST_F(GetIrTest, ProducesOutputFromElectricFieldOscillating)
     runTest(inputMdpFile);
 }
 
+TEST_F(GetIrTest, TerminatesOnDuplicateOldAndNewKeys)
+{
+    const char *inputMdpFile[] = {"verlet-buffer-drift = 1.3", "verlet-buffer-tolerance = 2.7"};
+    EXPECT_DEATH_IF_SUPPORTED(runTest(joinStrings(inputMdpFile, "\n")), "A parameter is present with both");
+}
+
+TEST_F(GetIrTest, ImplicitSolventNoWorks)
+{
+    const char *inputMdpFile = "implicit-solvent = no";
+    runTest(inputMdpFile);
+}
+
+TEST_F(GetIrTest, ImplicitSolventYesWorks)
+{
+    const char *inputMdpFile = "implicit-solvent = yes";
+    EXPECT_DEATH_IF_SUPPORTED(runTest(inputMdpFile), "Invalid enum");
+}
+
 } // namespace
 } // namespace
index 8d2b356f90c2baa056c78d909090ed6e5e74c2e8..c0edc1f5e23bbd3d6feb492d3c55d7fa5cd9ed80 100644 (file)
@@ -117,31 +117,7 @@ ewald-rtol-lj            = 0.001
 lj-pme-comb-rule         = Geometric
 ewald-geometry           = 3d
 epsilon-surface          = 0
-
-; IMPLICIT SOLVENT ALGORITHM
-implicit-solvent         = No
-
-; GENERALIZED BORN ELECTROSTATICS
-; Algorithm for calculating Born radii
-gb-algorithm             = Still
-; Frequency of calculating the Born radii inside rlist
-nstgbradii               = 1
-; Cutoff for Born radii calculation; the contribution from atoms
-; between rlist and rgbradii is updated every nstlist steps
-rgbradii                 = 1
-; Dielectric coefficient of the implicit solvent
-gb-epsilon-solvent       = 80
-; Salt concentration in M for Generalized Born models
-gb-saltconc              = 0
-; Scaling factors used in the OBC GB model. Default values are OBC(II)
-gb-obc-alpha             = 1
-gb-obc-beta              = 0.8
-gb-obc-gamma             = 4.85
-gb-dielectric-offset     = 0.009
-sa-algorithm             = Ace-approximation
-; Surface tension (kJ/mol/nm^2) for the SA (nonpolar surface) part of GBSA
-; The value -1 will set default value for Still/HCT/OBC GB-models.
-sa-surface-tension       = -1
+implicit-solvent         = no
 
 ; OPTIONS FOR WEAK COUPLING ALGORITHMS
 ; Temperature coupling  
index 27684c38d66603ac2c82f435224dfca92a86cf78..538864d80b4f277563b948d07118fd96d97ef8e2 100644 (file)
@@ -117,31 +117,7 @@ ewald-rtol-lj            = 0.001
 lj-pme-comb-rule         = Geometric
 ewald-geometry           = 3d
 epsilon-surface          = 0
-
-; IMPLICIT SOLVENT ALGORITHM
-implicit-solvent         = No
-
-; GENERALIZED BORN ELECTROSTATICS
-; Algorithm for calculating Born radii
-gb-algorithm             = Still
-; Frequency of calculating the Born radii inside rlist
-nstgbradii               = 1
-; Cutoff for Born radii calculation; the contribution from atoms
-; between rlist and rgbradii is updated every nstlist steps
-rgbradii                 = 1
-; Dielectric coefficient of the implicit solvent
-gb-epsilon-solvent       = 80
-; Salt concentration in M for Generalized Born models
-gb-saltconc              = 0
-; Scaling factors used in the OBC GB model. Default values are OBC(II)
-gb-obc-alpha             = 1
-gb-obc-beta              = 0.8
-gb-obc-gamma             = 4.85
-gb-dielectric-offset     = 0.009
-sa-algorithm             = Ace-approximation
-; Surface tension (kJ/mol/nm^2) for the SA (nonpolar surface) part of GBSA
-; The value -1 will set default value for Still/HCT/OBC GB-models.
-sa-surface-tension       = -1
+implicit-solvent         = no
 
 ; OPTIONS FOR WEAK COUPLING ALGORITHMS
 ; Temperature coupling  
index 0d8780d26b13d97422a3e708f53eab48fd36c410..cc6a71bdc678a736d4fe52493ba992faef50c556 100644 (file)
@@ -117,31 +117,7 @@ ewald-rtol-lj            = 0.001
 lj-pme-comb-rule         = Geometric
 ewald-geometry           = 3d
 epsilon-surface          = 0
-
-; IMPLICIT SOLVENT ALGORITHM
-implicit-solvent         = No
-
-; GENERALIZED BORN ELECTROSTATICS
-; Algorithm for calculating Born radii
-gb-algorithm             = Still
-; Frequency of calculating the Born radii inside rlist
-nstgbradii               = 1
-; Cutoff for Born radii calculation; the contribution from atoms
-; between rlist and rgbradii is updated every nstlist steps
-rgbradii                 = 1
-; Dielectric coefficient of the implicit solvent
-gb-epsilon-solvent       = 80
-; Salt concentration in M for Generalized Born models
-gb-saltconc              = 0
-; Scaling factors used in the OBC GB model. Default values are OBC(II)
-gb-obc-alpha             = 1
-gb-obc-beta              = 0.8
-gb-obc-gamma             = 4.85
-gb-dielectric-offset     = 0.009
-sa-algorithm             = Ace-approximation
-; Surface tension (kJ/mol/nm^2) for the SA (nonpolar surface) part of GBSA
-; The value -1 will set default value for Still/HCT/OBC GB-models.
-sa-surface-tension       = -1
+implicit-solvent         = no
 
 ; OPTIONS FOR WEAK COUPLING ALGORITHMS
 ; Temperature coupling  
similarity index 74%
rename from src/programs/mdrun/tests/alanine_vsite.mdp
rename to src/gromacs/gmxpreprocess/tests/refdata/GetIrTest_ImplicitSolventNoWorks.xml
index c51feaeb8699c9b7d83008fb8f3a494ab4b9022a..c0edc1f5e23bbd3d6feb492d3c55d7fa5cd9ed80 100644 (file)
@@ -1,3 +1,8 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Bool Name="Error parsing mdp file">false</Bool>
+  <String Name="OutputMdpFile">
 ; VARIOUS PREPROCESSING OPTIONS
 ; Preprocessor information: use cpp syntax.
 ; e.g.: -I/home/joe/doe -I/home/mary/roe
@@ -9,8 +14,8 @@ define                   =
 integrator               = md
 ; Start time and timestep in ps
 tinit                    = 0
-dt                       = 0.005
-nsteps                   = 20
+dt                       = 0.001
+nsteps                   = 0
 ; For exact run continuation or redoing part of a run
 init-step                = 0
 ; Part index is updated automatically on checkpointing (keeps files separate)
@@ -25,7 +30,7 @@ comm-grps                =
 ; LANGEVIN DYNAMICS OPTIONS
 ; Friction coefficient (amu/ps) and random seed
 bd-fric                  = 0
-ld-seed                  = 1993
+ld-seed                  = -1
 
 ; ENERGY MINIMIZATION OPTIONS
 ; Force tolerance and initial step-size
@@ -44,25 +49,26 @@ rtpi                     = 0.05
 
 ; OUTPUT CONTROL OPTIONS
 ; Output frequency for coords (x), velocities (v) and forces (f)
-nstxout                  = 20
-nstvout                  = 20
-nstfout                  = 20
+nstxout                  = 0
+nstvout                  = 0
+nstfout                  = 0
 ; Output frequency for energies to log file and energy file
-nstlog                   = 0
+nstlog                   = 1000
 nstcalcenergy            = 100
-nstenergy                = 100
+nstenergy                = 1000
 ; Output frequency and precision for .xtc file
-nstxtcout                = 0
-xtc-precision            = 1000
-; This selects the subset of atoms for the .xtc file. You can
-; select multiple groups. By default all atoms will be written.
-xtc-grps                 = 
+nstxout-compressed       = 0
+compressed-x-precision   = 1000
+; This selects the subset of atoms for the compressed
+; trajectory file. You can select multiple groups. By
+; default, all atoms will be written.
+compressed-x-grps        = 
 ; Selection of energy groups
 energygrps               = 
 
 ; NEIGHBORSEARCHING PARAMETERS
-; cut-off scheme (group: using charge groups, Verlet: particle based cut-offs)
-cutoff-scheme            = verlet
+; cut-off scheme (Verlet: particle based cut-offs, group: using charge groups)
+cutoff-scheme            = Verlet
 ; nblist update frequency
 nstlist                  = 10
 ; ns algorithm (simple or grid)
@@ -70,21 +76,19 @@ ns-type                  = Grid
 ; Periodic boundary conditions: xyz, no, xy
 pbc                      = xyz
 periodic-molecules       = no
-; Allowed energy drift due to the Verlet buffer in kJ/mol/ps per atom,
+; Allowed energy error due to the Verlet buffer in kJ/mol/ps per atom,
 ; a value of -1 means: use rlist
-verlet-buffer-drift      = -1
+verlet-buffer-tolerance  = 0.005
 ; nblist cut-off        
-rlist                    = 0.9
+rlist                    = 1
 ; long-range cut-off for switched potentials
-rlistlong                = -1
-nstcalclr                = -1
 
 ; OPTIONS FOR ELECTROSTATICS AND VDW
 ; Method for doing electrostatics
-coulombtype              = PME
+coulombtype              = Cut-off
 coulomb-modifier         = Potential-shift-Verlet
 rcoulomb-switch          = 0
-rcoulomb                 = 0.85
+rcoulomb                 = 1
 ; Relative dielectric constant for the medium and the reaction field
 epsilon-r                = 1
 epsilon-rf               = 0
@@ -93,70 +97,47 @@ vdw-type                 = Cut-off
 vdw-modifier             = Potential-shift-Verlet
 ; cut-off lengths       
 rvdw-switch              = 0
-rvdw                     = 0.85
+rvdw                     = 1
 ; Apply long range dispersion corrections for Energy and Pressure
 DispCorr                 = No
 ; Extension of the potential lookup tables beyond the cut-off
 table-extension          = 1
-; Seperate tables between energy group pairs
+; Separate tables between energy group pairs
 energygrp-table          = 
 ; Spacing for the PME/PPPM FFT grid
 fourierspacing           = 0.12
 ; FFT grid size, when a value is 0 fourierspacing will be used
-fourier_nx               = 24
-fourier_ny               = 24
-fourier_nz               = 24
+fourier-nx               = 0
+fourier-ny               = 0
+fourier-nz               = 0
 ; EWALD/PME/PPPM parameters
 pme-order                = 4
 ewald-rtol               = 1e-05
+ewald-rtol-lj            = 0.001
+lj-pme-comb-rule         = Geometric
 ewald-geometry           = 3d
 epsilon-surface          = 0
-optimize-fft             = no
-
-; IMPLICIT SOLVENT ALGORITHM
-implicit-solvent         = No
-
-; GENERALIZED BORN ELECTROSTATICS
-; Algorithm for calculating Born radii
-gb-algorithm             = Still
-; Frequency of calculating the Born radii inside rlist
-nstgbradii               = 1
-; Cutoff for Born radii calculation; the contribution from atoms
-; between rlist and rgbradii is updated every nstlist steps
-rgbradii                 = 1
-; Dielectric coefficient of the implicit solvent
-gb-epsilon-solvent       = 80
-; Salt concentration in M for Generalized Born models
-gb-saltconc              = 0
-; Scaling factors used in the OBC GB model. Default values are OBC(II)
-gb-obc-alpha             = 1
-gb-obc-beta              = 0.8
-gb-obc-gamma             = 4.85
-gb-dielectric-offset     = 0.009
-sa-algorithm             = Ace-approximation
-; Surface tension (kJ/mol/nm^2) for the SA (nonpolar surface) part of GBSA
-; The value -1 will set default value for Still/HCT/OBC GB-models.
-sa-surface-tension       = -1
+implicit-solvent         = no
 
 ; OPTIONS FOR WEAK COUPLING ALGORITHMS
 ; Temperature coupling  
-tcoupl                   = v-rescale
+tcoupl                   = No
 nsttcouple               = -1
 nh-chain-length          = 10
 print-nose-hoover-chain-variables = no
 ; Groups to couple separately
-tc_grps                  = system
+tc-grps                  = 
 ; Time constant (ps) and reference temperature (K)
-tau_t                    = 0.1
-ref_t                    = 300
+tau-t                    = 
+ref-t                    = 
 ; pressure coupling     
-Pcoupl                   = Berendsen
+pcoupl                   = No
 pcoupltype               = Isotropic
 nstpcouple               = -1
 ; Time constant (ps), compressibility (1/bar) and reference P (bar)
-tau_p                    = 1
-compressibility          = 4.5e-5
-ref_p                    = 1
+tau-p                    = 1
+compressibility          = 
+ref-p                    = 
 ; Scaling of reference coordinates, No, All or COM
 refcoord-scaling         = No
 
@@ -198,10 +179,10 @@ annealing-temp           =
 ; GENERATE VELOCITIES FOR STARTUP RUN
 gen-vel                  = no
 gen-temp                 = 300
-gen-seed                 = 173529
+gen-seed                 = -1
 
 ; OPTIONS FOR BONDS    
-constraints              = all-bonds
+constraints              = none
 ; Type of constraint algorithm
 constraint-algorithm     = Lincs
 ; Do not constrain the start configuration
@@ -211,11 +192,11 @@ Shake-SOR                = no
 ; Relative tolerance of shake
 shake-tol                = 0.0001
 ; Highest order in the expansion of the constraint coupling matrix
-lincs_order              = 2
+lincs-order              = 4
 ; Number of iterations in the final step of LINCS. 1 is fine for
 ; normal simulations, but use 2 to conserve energy in NVE runs.
 ; For energy minimization with constraints it should be 4 to 8.
-lincs_iter               = 5
+lincs-iter               = 1
 ; Lincs will write a warning to the stderr if in one step a bond
 ; rotates over more degrees than
 lincs-warnangle          = 30
@@ -236,13 +217,18 @@ wall-density             =
 wall-ewald-zfac          = 3
 
 ; COM PULLING          
-; Pull type: no, umbrella, constraint or constant-force
 pull                     = no
 
+; AWH biasing          
+awh                      = no
+
 ; ENFORCED ROTATION    
 ; Enforced rotation: No or Yes
 rotation                 = no
 
+; Group to display and/or manipulate in interactive MD session
+IMD-group                = 
+
 ; NMR refinement stuff 
 ; Distance restraints type: No, Simple or Ensemble
 disre                    = No
@@ -270,9 +256,9 @@ couple-lambda0           = vdw-q
 couple-lambda1           = vdw-q
 couple-intramol          = no
 init-lambda              = -1
-init-lambda-state        = 0
+init-lambda-state        = -1
 delta-lambda             = 0
-nstdhdl                  = 100
+nstdhdl                  = 50
 fep-lambdas              = 
 mass-lambdas             = 
 coul-lambdas             = 
@@ -280,6 +266,7 @@ vdw-lambdas              =
 bonded-lambdas           = 
 restraint-lambdas        = 
 temperature-lambdas      = 
+calc-lambda-neighbors    = 1
 init-lambda-weights      = 
 dhdl-print-energy        = no
 sc-alpha                 = 0
@@ -306,17 +293,9 @@ simulated-tempering-scaling = geometric
 sim-temp-low             = 300
 sim-temp-high            = 300
 
-; Electric fields      
-; Format is number of terms (int) and for all terms an amplitude (real)
-; and a phase angle (real)
-E-x                      = 
-E-xt                     = 
-E-y                      = 
-E-yt                     = 
-E-z                      = 
-E-zt                     = 
-
-; AdResS parameters    
+; Ion/water position swapping for computational electrophysiology setups
+; Swap positions along direction: no, X, Y, Z
+swapcoords               = no
 adress                   = no
 
 ; User defined thingies
@@ -330,3 +309,13 @@ userreal1                = 0
 userreal2                = 0
 userreal3                = 0
 userreal4                = 0
+; Electric fields
+; Format for electric-field-x, etc. is: four real variables:
+; amplitude (V/nm), frequency omega (1/ps), time for the pulse peak (ps),
+; and sigma (ps) width of the pulse. Omega = 0 means static field,
+; sigma = 0 means no pulse, leaving the field to be a cosine function.
+electric-field-x         = 0 0 0 0
+electric-field-y         = 0 0 0 0
+electric-field-z         = 0 0 0 0
+</String>
+</ReferenceData>
index 353f36905d68dfe72ec122f4d2aae02d76b6fb41..9f2bcabde7cdd6e175e538aa3b9507ab903a4f17 100644 (file)
@@ -117,31 +117,7 @@ ewald-rtol-lj            = 0.001
 lj-pme-comb-rule         = Geometric
 ewald-geometry           = 3d
 epsilon-surface          = 0
-
-; IMPLICIT SOLVENT ALGORITHM
-implicit-solvent         = No
-
-; GENERALIZED BORN ELECTROSTATICS
-; Algorithm for calculating Born radii
-gb-algorithm             = Still
-; Frequency of calculating the Born radii inside rlist
-nstgbradii               = 1
-; Cutoff for Born radii calculation; the contribution from atoms
-; between rlist and rgbradii is updated every nstlist steps
-rgbradii                 = 1
-; Dielectric coefficient of the implicit solvent
-gb-epsilon-solvent       = 80
-; Salt concentration in M for Generalized Born models
-gb-saltconc              = 0
-; Scaling factors used in the OBC GB model. Default values are OBC(II)
-gb-obc-alpha             = 1
-gb-obc-beta              = 0.8
-gb-obc-gamma             = 4.85
-gb-dielectric-offset     = 0.009
-sa-algorithm             = Ace-approximation
-; Surface tension (kJ/mol/nm^2) for the SA (nonpolar surface) part of GBSA
-; The value -1 will set default value for Still/HCT/OBC GB-models.
-sa-surface-tension       = -1
+implicit-solvent         = no
 
 ; OPTIONS FOR WEAK COUPLING ALGORITHMS
 ; Temperature coupling  
index 538ebd3da91d9a16151a6fe346b3c3c833810c5a..8b52b14d80417c7e7a905c50367ced90d6d53861 100644 (file)
@@ -117,31 +117,7 @@ ewald-rtol-lj            = 0.001
 lj-pme-comb-rule         = Geometric
 ewald-geometry           = 3d
 epsilon-surface          = 0
-
-; IMPLICIT SOLVENT ALGORITHM
-implicit-solvent         = No
-
-; GENERALIZED BORN ELECTROSTATICS
-; Algorithm for calculating Born radii
-gb-algorithm             = Still
-; Frequency of calculating the Born radii inside rlist
-nstgbradii               = 1
-; Cutoff for Born radii calculation; the contribution from atoms
-; between rlist and rgbradii is updated every nstlist steps
-rgbradii                 = 1
-; Dielectric coefficient of the implicit solvent
-gb-epsilon-solvent       = 80
-; Salt concentration in M for Generalized Born models
-gb-saltconc              = 0
-; Scaling factors used in the OBC GB model. Default values are OBC(II)
-gb-obc-alpha             = 1
-gb-obc-beta              = 0.8
-gb-obc-gamma             = 4.85
-gb-dielectric-offset     = 0.009
-sa-algorithm             = Ace-approximation
-; Surface tension (kJ/mol/nm^2) for the SA (nonpolar surface) part of GBSA
-; The value -1 will set default value for Still/HCT/OBC GB-models.
-sa-surface-tension       = -1
+implicit-solvent         = no
 
 ; OPTIONS FOR WEAK COUPLING ALGORITHMS
 ; Temperature coupling  
index 0de50f50c759766b09aa5de648d7ff94d2beeabf..4b2df698fa3c7346b1efce445a9a3a080305a02c 100644 (file)
@@ -117,31 +117,7 @@ ewald-rtol-lj            = 0.001
 lj-pme-comb-rule         = Geometric
 ewald-geometry           = 3d
 epsilon-surface          = 0
-
-; IMPLICIT SOLVENT ALGORITHM
-implicit-solvent         = No
-
-; GENERALIZED BORN ELECTROSTATICS
-; Algorithm for calculating Born radii
-gb-algorithm             = Still
-; Frequency of calculating the Born radii inside rlist
-nstgbradii               = 1
-; Cutoff for Born radii calculation; the contribution from atoms
-; between rlist and rgbradii is updated every nstlist steps
-rgbradii                 = 1
-; Dielectric coefficient of the implicit solvent
-gb-epsilon-solvent       = 80
-; Salt concentration in M for Generalized Born models
-gb-saltconc              = 0
-; Scaling factors used in the OBC GB model. Default values are OBC(II)
-gb-obc-alpha             = 1
-gb-obc-beta              = 0.8
-gb-obc-gamma             = 4.85
-gb-dielectric-offset     = 0.009
-sa-algorithm             = Ace-approximation
-; Surface tension (kJ/mol/nm^2) for the SA (nonpolar surface) part of GBSA
-; The value -1 will set default value for Still/HCT/OBC GB-models.
-sa-surface-tension       = -1
+implicit-solvent         = no
 
 ; OPTIONS FOR WEAK COUPLING ALGORITHMS
 ; Temperature coupling  
index 8d2b356f90c2baa056c78d909090ed6e5e74c2e8..c0edc1f5e23bbd3d6feb492d3c55d7fa5cd9ed80 100644 (file)
@@ -117,31 +117,7 @@ ewald-rtol-lj            = 0.001
 lj-pme-comb-rule         = Geometric
 ewald-geometry           = 3d
 epsilon-surface          = 0
-
-; IMPLICIT SOLVENT ALGORITHM
-implicit-solvent         = No
-
-; GENERALIZED BORN ELECTROSTATICS
-; Algorithm for calculating Born radii
-gb-algorithm             = Still
-; Frequency of calculating the Born radii inside rlist
-nstgbradii               = 1
-; Cutoff for Born radii calculation; the contribution from atoms
-; between rlist and rgbradii is updated every nstlist steps
-rgbradii                 = 1
-; Dielectric coefficient of the implicit solvent
-gb-epsilon-solvent       = 80
-; Salt concentration in M for Generalized Born models
-gb-saltconc              = 0
-; Scaling factors used in the OBC GB model. Default values are OBC(II)
-gb-obc-alpha             = 1
-gb-obc-beta              = 0.8
-gb-obc-gamma             = 4.85
-gb-dielectric-offset     = 0.009
-sa-algorithm             = Ace-approximation
-; Surface tension (kJ/mol/nm^2) for the SA (nonpolar surface) part of GBSA
-; The value -1 will set default value for Still/HCT/OBC GB-models.
-sa-surface-tension       = -1
+implicit-solvent         = no
 
 ; OPTIONS FOR WEAK COUPLING ALGORITHMS
 ; Temperature coupling  
index b955ba2d91ad3dfd5dedff082b2af3d4e3c5ed9f..7bbc43e320b964c366a0f89026650d54bc615270 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -366,6 +366,13 @@ void DS_Init(DirStack **DS)
         set_nec(&(necessary[d_angletypes]), d_atomtypes, d_none);
         set_nec(&(necessary[d_dihedraltypes]), d_atomtypes, d_none);
         set_nec(&(necessary[d_nonbond_params]), d_atomtypes, d_none);
+        // Note that the content of the next two directives are
+        // ignored, but if grompp reads them in old force field files,
+        // it still needs to understand that they are in a valid place
+        // in the .top structure. It doesn't have to require them to
+        // be in the same place that was valid in old versions (ie. child
+        // directive of [atomtypes]) but any relevant case will
+        // satisfy that.
         set_nec(&(necessary[d_implicit_genborn_params]), d_atomtypes, d_none);
         set_nec(&(necessary[d_implicit_surface_params]), d_atomtypes, d_none);
         set_nec(&(necessary[d_cmaptypes]), d_atomtypes, d_none);
index 3bd8f90e3f9a38e997b1aebfde18fe9a6fc5f8a4..9c466cc29aa8a5f6e48b04d6f5bceafe78602f89 100644 (file)
@@ -65,7 +65,6 @@
 #include "gromacs/gmxpreprocess/vsite_parm.h"
 #include "gromacs/math/units.h"
 #include "gromacs/math/utilities.h"
-#include "gromacs/mdlib/genborn.h"
 #include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/mdtypes/md_enums.h"
 #include "gromacs/pbcutil/pbc.h"
@@ -396,182 +395,6 @@ static char ** cpp_opts(const char *define, const char *include,
 }
 
 
-static int
-find_gb_bondlength(t_params *plist, int ai, int aj, real *length)
-{
-    int i, j, a1, a2;
-
-    int found = 0;
-    int status;
-
-    for (i = 0; i < F_NRE && !found; i++)
-    {
-        if (IS_CHEMBOND(i))
-        {
-            for (j = 0; j < plist[i].nr; j++)
-            {
-                a1 = plist[i].param[j].a[0];
-                a2 = plist[i].param[j].a[1];
-
-                if ( (a1 == ai && a2 == aj) || (a1 == aj && a2 == ai))
-                {
-                    /* Equilibrium bond distance */
-                    *length = plist[i].param[j].c[0];
-                    found   = 1;
-                }
-            }
-        }
-    }
-    status = !found;
-
-    return status;
-}
-
-
-static int
-find_gb_anglelength(t_params *plist, int ai, int ak, real *length)
-{
-    int  i, j, a1, a2, a3;
-    real r12, r23, a123;
-    int  found = 0;
-    int  status, status1, status2;
-
-    r12 = r23 = 0;
-
-    for (i = 0; i < F_NRE && !found; i++)
-    {
-        if (IS_ANGLE(i))
-        {
-            for (j = 0; j < plist[i].nr; j++)
-            {
-                a1 = plist[i].param[j].a[0];
-                a2 = plist[i].param[j].a[1];
-                a3 = plist[i].param[j].a[2];
-
-                /* We dont care what the middle atom is, but use it below */
-                if ( (a1 == ai && a3 == ak) || (a1 == ak && a3 == ai) )
-                {
-                    /* Equilibrium bond distance */
-                    a123 = plist[i].param[j].c[0];
-                    /* Use middle atom to find reference distances r12 and r23 */
-                    status1 = find_gb_bondlength(plist, a1, a2, &r12);
-                    status2 = find_gb_bondlength(plist, a2, a3, &r23);
-
-                    if (status1 == 0 && status2 == 0)
-                    {
-                        /* cosine theorem to get r13 */
-                        *length = std::sqrt(r12*r12+r23*r23-(2*r12*r23*cos(a123/RAD2DEG)));
-                        found   = 1;
-                    }
-                }
-            }
-        }
-    }
-    status = !found;
-
-    return status;
-}
-
-static int
-generate_gb_exclusion_interactions(t_molinfo *mi, gpp_atomtype_t atype, t_nextnb *nnb)
-{
-    int          j, n, ai, aj, ti, tj;
-    int          ftype;
-    t_param      param;
-    t_params *   plist;
-    t_atoms *    at;
-    real         radiusi, radiusj;
-    real         gb_radiusi, gb_radiusj;
-    real         param_c2, param_c4;
-    real         distance;
-
-    plist = mi->plist;
-    at    = &mi->atoms;
-
-    for (n = 1; n <= nnb->nrex; n++)
-    {
-        switch (n)
-        {
-            case 1:
-                ftype    = F_GB12;
-                param_c2 = STILL_P2;
-                param_c4 = 0.8875;
-                break;
-            case 2:
-                ftype    = F_GB13;
-                param_c2 = STILL_P3;
-                param_c4 = 0.3516;
-                break;
-            default:
-                /* Put all higher-order exclusions into 1,4 list so we dont miss them */
-                ftype    = F_GB14;
-                param_c2 = STILL_P3;
-                param_c4 = 0.3516;
-                break;
-        }
-
-        for (ai = 0; ai < nnb->nr; ai++)
-        {
-            ti         = at->atom[ai].type;
-            radiusi    = get_atomtype_radius(ti, atype);
-            gb_radiusi = get_atomtype_gb_radius(ti, atype);
-
-            for (j = 0; j < nnb->nrexcl[ai][n]; j++)
-            {
-                aj = nnb->a[ai][n][j];
-
-                /* Only add the interactions once */
-                if (aj > ai)
-                {
-                    tj         = at->atom[aj].type;
-                    radiusj    = get_atomtype_radius(tj, atype);
-                    gb_radiusj = get_atomtype_gb_radius(tj, atype);
-
-                    /* There is an exclusion of type "ftype" between atoms ai and aj */
-                    param.a[0] = ai;
-                    param.a[1] = aj;
-
-                    /* Reference distance, not used for 1-4 interactions */
-                    switch (ftype)
-                    {
-                        case F_GB12:
-                            if (find_gb_bondlength(plist, ai, aj, &distance) != 0)
-                            {
-                                gmx_fatal(FARGS, "Cannot find bond length for atoms %d-%d", ai, aj);
-                            }
-                            break;
-                        case F_GB13:
-                            if (find_gb_anglelength(plist, ai, aj, &distance) != 0)
-                            {
-                                gmx_fatal(FARGS, "Cannot find length for atoms %d-%d involved in angle", ai, aj);
-                            }
-                            break;
-                        default:
-                            distance = -1;
-                            break;
-                    }
-                    /* Assign GB parameters */
-                    /* Sum of radii */
-                    param.c[0] = radiusi+radiusj;
-                    /* Reference distance distance */
-                    param.c[1] = distance;
-                    /* Still parameter */
-                    param.c[2] = param_c2;
-                    /* GB radius */
-                    param.c[3] = gb_radiusi+gb_radiusj;
-                    /* Parameter */
-                    param.c[4] = param_c4;
-
-                    /* Add it to the parameter list */
-                    add_param_to_list(&plist[ftype], &param);
-                }
-            }
-        }
-    }
-    return 0;
-}
-
-
 static void make_atoms_sys(int nmolb, const gmx_molblock_t *molb,
                            const t_molinfo *molinfo,
                            t_atoms *atoms)
@@ -615,7 +438,6 @@ static char **read_topol(const char *infile, const char *outfile,
                          int         *nmolblock,
                          gmx_molblock_t **molblock,
                          gmx_bool        bFEP,
-                         gmx_bool        bGenborn,
                          gmx_bool        bZero,
                          gmx_bool        usingFullRangeElectrostatics,
                          warninp_t       wi)
@@ -917,11 +739,15 @@ static char **read_topol(const char *infile, const char *outfile,
                          */
 
                         case d_implicit_genborn_params:
-                            push_gb_params(atype, pline, wi);
+                            // Skip this line, so old topologies with
+                            // GB parameters can be read.
                             break;
 
                         case d_implicit_surface_params:
-                            gmx_fatal(FARGS, "Implicit surface directive not supported yet.");
+                            // Skip this line, so that any topologies
+                            // with surface parameters can be read
+                            // (even though these were never formally
+                            // supported).
                             break;
 
                         case d_cmaptypes:
@@ -1068,14 +894,6 @@ static char **read_topol(const char *infile, const char *outfile,
 
 
 
-                                /* nnb contains information about first,2nd,3rd bonded neighbors.
-                                 * Use this to generate GB 1-2,1-3,1-4 interactions when necessary.
-                                 */
-                                if (bGenborn == TRUE)
-                                {
-                                    generate_gb_exclusion_interactions(mi0, atype, &nnb);
-                                }
-
                                 done_nnb(&nnb);
 
                                 if (bCouple)
@@ -1184,7 +1002,6 @@ char **do_top(gmx_bool          bVerbose,
               const t_inputrec *ir,
               int              *nmolblock,
               gmx_molblock_t  **molblock,
-              gmx_bool          bGenborn,
               warninp_t         wi)
 {
     /* Tmpfile might contain a long path */
@@ -1209,7 +1026,7 @@ char **do_top(gmx_bool          bVerbose,
                        nrmols, molinfo, intermolecular_interactions,
                        plist, combination_rule, repulsion_power,
                        opts, fudgeQQ, nmolblock, molblock,
-                       ir->efep != efepNO, bGenborn, bZero,
+                       ir->efep != efepNO, bZero,
                        EEL_FULL(ir->coulombtype), wi);
 
     if ((*combination_rule != eCOMB_GEOMETRIC) &&
index 4023f8fceb031ae6a01206c2197cff3801fc7bfd..bb79551e6223fab9a73a211b7f4ce865b72e8cca 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015,2016,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -68,7 +68,6 @@ char **do_top(gmx_bool          bVerbose,
               const t_inputrec *ir,
               int              *nmolblock,
               gmx_molblock_t  **molblock,
-              gmx_bool          bGB,
               warninp_t         wi);
 
 /* This routine expects sys->molt[m].ilist to be of size F_NRE and ordered. */
index 24381dcd06b9ae59476340ec8f62a1556fe61d17..c49ad80a76786209ea265bb92d1ac2e75008be4a 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -238,7 +238,6 @@ void push_at (t_symtab *symtab, gpp_atomtype_t at, t_bond_atomtype bat,
     char       type[STRLEN], btype[STRLEN], ptype[STRLEN];
     double     m, q;
     double     c[MAXFORCEPARAM];
-    double     radius, vol, surftens, gb_radius, S_hct;
     char       tmpfield[12][100]; /* Max 12 fields of width 100 */
     char       errbuf[STRLEN];
     t_atom    *atom;
@@ -308,12 +307,7 @@ void push_at (t_symtab *symtab, gpp_atomtype_t at, t_bond_atomtype bat,
     }
 
     /* optional fields */
-    surftens  = -1;
-    vol       = -1;
-    radius    = -1;
-    gb_radius = -1;
     atomnr    = -1;
-    S_hct     = -1;
 
     switch (nb_funct)
     {
@@ -325,9 +319,8 @@ void push_at (t_symtab *symtab, gpp_atomtype_t at, t_bond_atomtype bat,
             {
                 if (have_bonded_type)
                 {
-                    nread = sscanf(line, "%s%s%d%lf%lf%s%lf%lf%lf%lf%lf%lf",
-                                   type, btype, &atomnr, &m, &q, ptype, &c[0], &c[1],
-                                   &radius, &vol, &surftens, &gb_radius);
+                    nread = sscanf(line, "%s%s%d%lf%lf%s%lf%lf",
+                                   type, btype, &atomnr, &m, &q, ptype, &c[0], &c[1]);
                     if (nread < 8)
                     {
                         too_few(wi);
@@ -337,9 +330,8 @@ void push_at (t_symtab *symtab, gpp_atomtype_t at, t_bond_atomtype bat,
                 else
                 {
                     /* have_atomic_number && !have_bonded_type */
-                    nread = sscanf(line, "%s%d%lf%lf%s%lf%lf%lf%lf%lf%lf",
-                                   type, &atomnr, &m, &q, ptype, &c[0], &c[1],
-                                   &radius, &vol, &surftens, &gb_radius);
+                    nread = sscanf(line, "%s%d%lf%lf%s%lf%lf",
+                                   type, &atomnr, &m, &q, ptype, &c[0], &c[1]);
                     if (nread < 7)
                     {
                         too_few(wi);
@@ -352,9 +344,8 @@ void push_at (t_symtab *symtab, gpp_atomtype_t at, t_bond_atomtype bat,
                 if (have_bonded_type)
                 {
                     /* !have_atomic_number && have_bonded_type */
-                    nread = sscanf(line, "%s%s%lf%lf%s%lf%lf%lf%lf%lf%lf",
-                                   type, btype, &m, &q, ptype, &c[0], &c[1],
-                                   &radius, &vol, &surftens, &gb_radius);
+                    nread = sscanf(line, "%s%s%lf%lf%s%lf%lf",
+                                   type, btype, &m, &q, ptype, &c[0], &c[1]);
                     if (nread < 7)
                     {
                         too_few(wi);
@@ -364,9 +355,8 @@ void push_at (t_symtab *symtab, gpp_atomtype_t at, t_bond_atomtype bat,
                 else
                 {
                     /* !have_atomic_number && !have_bonded_type */
-                    nread = sscanf(line, "%s%lf%lf%s%lf%lf%lf%lf%lf%lf",
-                                   type, &m, &q, ptype, &c[0], &c[1],
-                                   &radius, &vol, &surftens, &gb_radius);
+                    nread = sscanf(line, "%s%lf%lf%s%lf%lf",
+                                   type, &m, &q, ptype, &c[0], &c[1]);
                     if (nread < 6)
                     {
                         too_few(wi);
@@ -394,9 +384,8 @@ void push_at (t_symtab *symtab, gpp_atomtype_t at, t_bond_atomtype bat,
             {
                 if (have_bonded_type)
                 {
-                    nread = sscanf(line, "%s%s%d%lf%lf%s%lf%lf%lf%lf%lf%lf%lf",
-                                   type, btype, &atomnr, &m, &q, ptype, &c[0], &c[1], &c[2],
-                                   &radius, &vol, &surftens, &gb_radius);
+                    nread = sscanf(line, "%s%s%d%lf%lf%s%lf%lf%lf",
+                                   type, btype, &atomnr, &m, &q, ptype, &c[0], &c[1], &c[2]);
                     if (nread < 9)
                     {
                         too_few(wi);
@@ -406,9 +395,8 @@ void push_at (t_symtab *symtab, gpp_atomtype_t at, t_bond_atomtype bat,
                 else
                 {
                     /* have_atomic_number && !have_bonded_type */
-                    nread = sscanf(line, "%s%d%lf%lf%s%lf%lf%lf%lf%lf%lf%lf",
-                                   type, &atomnr, &m, &q, ptype, &c[0], &c[1], &c[2],
-                                   &radius, &vol, &surftens, &gb_radius);
+                    nread = sscanf(line, "%s%d%lf%lf%s%lf%lf%lf",
+                                   type, &atomnr, &m, &q, ptype, &c[0], &c[1], &c[2]);
                     if (nread < 8)
                     {
                         too_few(wi);
@@ -421,9 +409,8 @@ void push_at (t_symtab *symtab, gpp_atomtype_t at, t_bond_atomtype bat,
                 if (have_bonded_type)
                 {
                     /* !have_atomic_number && have_bonded_type */
-                    nread = sscanf(line, "%s%s%lf%lf%s%lf%lf%lf%lf%lf%lf%lf",
-                                   type, btype, &m, &q, ptype, &c[0], &c[1], &c[2],
-                                   &radius, &vol, &surftens, &gb_radius);
+                    nread = sscanf(line, "%s%s%lf%lf%s%lf%lf%lf",
+                                   type, btype, &m, &q, ptype, &c[0], &c[1], &c[2]);
                     if (nread < 8)
                     {
                         too_few(wi);
@@ -433,9 +420,8 @@ void push_at (t_symtab *symtab, gpp_atomtype_t at, t_bond_atomtype bat,
                 else
                 {
                     /* !have_atomic_number && !have_bonded_type */
-                    nread = sscanf(line, "%s%lf%lf%s%lf%lf%lf%lf%lf%lf%lf",
-                                   type, &m, &q, ptype, &c[0], &c[1], &c[2],
-                                   &radius, &vol, &surftens, &gb_radius);
+                    nread = sscanf(line, "%s%lf%lf%s%lf%lf%lf",
+                                   type, &m, &q, ptype, &c[0], &c[1], &c[2]);
                     if (nread < 7)
                     {
                         too_few(wi);
@@ -517,15 +503,14 @@ void push_at (t_symtab *symtab, gpp_atomtype_t at, t_bond_atomtype bat,
         sprintf(errbuf, "Overriding atomtype %s", type);
         warning(wi, errbuf);
         if ((nr = set_atomtype(nr, at, symtab, atom, type, param, batype_nr,
-                               radius, vol, surftens, atomnr, gb_radius, S_hct)) == NOTSET)
+                               atomnr)) == NOTSET)
         {
             sprintf(errbuf, "Replacing atomtype %s failed", type);
             warning_error_and_exit(wi, errbuf, FARGS);
         }
     }
     else if ((add_atomtype(at, symtab, atom, type, param,
-                           batype_nr, radius, vol,
-                           surftens, atomnr, gb_radius, S_hct)) == NOTSET)
+                           batype_nr, atomnr)) == NOTSET)
     {
         sprintf(errbuf, "Adding atomtype %s failed", type);
         warning_error_and_exit(wi, errbuf, FARGS);
@@ -1082,33 +1067,6 @@ void push_nbt(directive d, t_nbparam **nbt, gpp_atomtype_t atype,
     }
 }
 
-void
-push_gb_params (gpp_atomtype_t at, char *line,
-                warninp_t wi)
-{
-    int    atype;
-    double radius, vol, surftens, gb_radius, S_hct;
-    char   atypename[STRLEN];
-    char   errbuf[STRLEN];
-
-    if ( (sscanf(line, "%s%lf%lf%lf%lf%lf", atypename, &radius, &vol, &surftens, &gb_radius, &S_hct)) != 6)
-    {
-        sprintf(errbuf, "Too few gb parameters for type %s\n", atypename);
-        warning(wi, errbuf);
-    }
-
-    /* Search for atomtype */
-    atype = get_atomtype_type(atypename, at);
-
-    if (atype == NOTSET)
-    {
-        printf("Couldn't find topology match for atomtype %s\n", atypename);
-        abort();
-    }
-
-    set_atomtype_gbparam(at, atype, radius, vol, surftens, gb_radius, S_hct);
-}
-
 void
 push_cmaptype(directive d, t_params bt[], int nral, gpp_atomtype_t at,
               t_bond_atomtype bat, char *line,
@@ -2633,7 +2591,7 @@ int add_atomtype_decoupled(t_symtab *symtab, gpp_atomtype_t at,
         param.c[i] = 0.0;
     }
 
-    nr = add_atomtype(at, symtab, &atom, "decoupled", &param, -1, 0.0, 0.0, 0.0, 0, 0, 0);
+    nr = add_atomtype(at, symtab, &atom, "decoupled", &param, -1, 0);
 
     /* Add space in the non-bonded parameters matrix */
     realloc_nb_params(at, nbparam, pair);
index 24619f23989e36714e490636d73f5b86f476359b..3c6e2bc57fbf934ba111f0c6245b24b80e96e99b 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -76,11 +76,6 @@ void push_nbt(directive d, t_nbparam **nbt, gpp_atomtype_t atype,
               char *plines, int nb_funct,
               warninp_t wi);
 
-void
-push_gb_params(gpp_atomtype_t atype,
-               char          *line,
-               warninp_t      wi);
-
 void push_atom(struct t_symtab *symtab,
                t_block         *cgs,
                t_atoms         *at,
index 6e84f4a3afd0aefbc688074c45a4bbfb74d1cbaa..01766cfca83f688955b217efecba8df4269944f6 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -532,7 +532,7 @@ void print_bondeds(FILE *out, int natoms, directive d,
     {
         char buf[12];
         sprintf(buf, "%4d", (i+1));
-        add_atomtype(atype, &stab, a, buf, param, 0, 0, 0, 0, 0, 0, 0);
+        add_atomtype(atype, &stab, a, buf, param, 0, 0);
     }
     print_bt(out, d, atype, ftype, fsubtype, plist, TRUE);
 
index e1bf50cc3b473678fc423f3bf9c5471985640e58..8ae0a20a08f5fb9b366367f1db2d3bc20cea957e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -140,13 +140,14 @@ T gmx_shfl_down_sync(const unsigned int activeMask,
 
 /*! \brief Allow disabling CUDA textures using the GMX_DISABLE_CUDA_TEXTURES macro.
  *
- *  Disable texture support-missing in clang (all versions up to <=5.0-dev as of writing).
+ *  Only texture objects supported, disable textures for <= CC 2.0 (but not in host code).
+ *  Disable texture support missing in clang (all versions up to <=5.0-dev as of writing).
  *
  *  This option will not influence functionality. All features using textures ought
  *  to have fallback for texture-less reads (direct/LDG loads), all new code needs
  *  to provide fallback code.
  */
-#if defined(GMX_DISABLE_CUDA_TEXTURES) || (defined(__clang__) && defined(__CUDA__))
+#if defined(GMX_DISABLE_CUDA_TEXTURES) || (GMX_PTX_ARCH > 0 && GMX_PTX_ARCH < 300) || (defined(__clang__) && defined(__CUDA__))
 #define DISABLE_CUDA_TEXTURES 1
 #else
 #define DISABLE_CUDA_TEXTURES 0
index 002a7c6109b703f20407e35150356b8da7c0fc6d..daebe3be29c299c659423e79a5772b519d1f7990 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2017, by the GROMACS development team, led by
+ * Copyright (c) 2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -56,43 +56,31 @@ __device__ __forceinline__ T LDG(const T* ptr)
 #endif
 }
 
-/*! \brief Fetch the value by \p index from the texture object or reference.
- * Fetching from the object is the preferred behaviour on CC >= 3.0.
+/*! \brief Fetch the value by \p index from the texture object.
  *
  * \tparam[in] T        Raw data type
  * \param[in] texObj    Table texture object
- * \param[in] texRef    Table texture reference
  * \param[in] index     Non-negative element index
  * \returns             The value from the table at \p index
  */
 template <typename T>
 static __forceinline__ __device__
 T fetchFromTexture(const cudaTextureObject_t texObj,
-                   const struct texture<T, 1, cudaReadModeElementType> texRef,
-                   int index)
+                   int                       index)
 {
     assert(index >= 0);
     assert(!c_disableCudaTextures);
-    T result;
-#if GMX_PTX_ARCH >= 300  // Preferring texture objects on any new arch
-    GMX_UNUSED_VALUE(texRef);
-    result = tex1Dfetch<T>(texObj, index);
-#else
-    GMX_UNUSED_VALUE(texObj);
-    result = tex1Dfetch(texRef, index);
-#endif
-    return result;
+    return tex1Dfetch<T>(texObj, index);
 }
 
 /*! \brief Fetch the value by \p index from the parameter lookup table.
  *
  *  Depending on what is supported, it fetches parameters either
- *  using direct load, texture objects, or texture references.
+ *  using direct load or texture objects.
  *
  * \tparam[in] T        Raw data type
  * \param[in] d_ptr     Device pointer to the raw table memory
  * \param[in] texObj    Table texture object
- * \param[in] texRef    Table texture reference
  * \param[in] index     Non-negative element index
  * \returns             The value from the table at \p index
  */
@@ -100,10 +88,7 @@ template <typename T>
 static __forceinline__ __device__
 T fetchFromParamLookupTable(const T                  *d_ptr,
                             const cudaTextureObject_t texObj,
-#if DISABLE_CUDA_TEXTURES == 0
-                            const struct texture<T, 1, cudaReadModeElementType> texRef,
-#endif
-                            int index)
+                            int                       index)
 {
     assert(index >= 0);
     T result;
@@ -112,7 +97,7 @@ T fetchFromParamLookupTable(const T                  *d_ptr,
     result = LDG(d_ptr + index);
 #else
     GMX_UNUSED_VALUE(d_ptr);
-    result = fetchFromTexture<T>(texObj, texRef, index);
+    result = fetchFromTexture<T>(texObj, index);
 #endif
     return result;
 }
index 5c92eb4d279b74f7b7456392f0dee70ea3a7a836..53e204a2ab111cc8313d4572b5e79f9837e35d04 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -261,38 +261,12 @@ static void setup1DTexture(cudaTextureObject_t &texObj,
     CU_RET_ERR(stat, "cudaCreateTextureObject failed");
 }
 
-/*! \brief Set up texture reference for an array of type T.
- *
- * Set up texture object for an array of type T and bind it to the device memory
- * \p d_ptr points to.
- *
- * \tparam[in] T        Raw data type
- * \param[out] texObj   texture reference to initialize
- * \param[in]  d_ptr    pointer to device global memory to bind \p texObj to
- * \param[in]  sizeInBytes  size of memory area to bind \p texObj to
- */
-template <typename T>
-static void setup1DTexture(const struct texture<T, 1, cudaReadModeElementType> *texRef,
-                           const void                                          *d_ptr,
-                           size_t                                              sizeInBytes)
-{
-    assert(!c_disableCudaTextures);
-
-    cudaError_t           stat;
-    cudaChannelFormatDesc cd;
-
-    cd   = cudaCreateChannelDesc<T>();
-    stat = cudaBindTexture(nullptr, texRef, d_ptr, &cd, sizeInBytes);
-    CU_RET_ERR(stat, "cudaBindTexture failed");
-}
-
 template <typename T>
 void initParamLookupTable(T                        * &d_ptr,
-                          cudaTextureObject_t       &texObj,
-                          const struct texture<T, 1, cudaReadModeElementType> *texRef,
-                          const T                   *h_ptr,
-                          int                        numElem,
-                          const gmx_device_info_t   *devInfo)
+                          cudaTextureObject_t        &texObj,
+                          const T                    *h_ptr,
+                          int                         numElem,
+                          const gmx_device_info_t    *devInfo)
 {
     const size_t sizeInBytes = numElem * sizeof(*d_ptr);
     cudaError_t  stat        = cudaMalloc((void **)&d_ptr, sizeInBytes);
@@ -305,17 +279,12 @@ void initParamLookupTable(T                        * &d_ptr,
         {
             setup1DTexture<T>(texObj, d_ptr, sizeInBytes);
         }
-        else
-        {
-            setup1DTexture<T>(texRef, d_ptr, sizeInBytes);
-        }
     }
 }
 
 template <typename T>
 void destroyParamLookupTable(T                       *d_ptr,
                              cudaTextureObject_t      texObj,
-                             const struct texture<T, 1, cudaReadModeElementType> *texRef,
                              const gmx_device_info_t *devInfo)
 {
     if (!c_disableCudaTextures)
@@ -324,10 +293,6 @@ void destroyParamLookupTable(T                       *d_ptr,
         {
             CU_RET_ERR(cudaDestroyTextureObject(texObj), "cudaDestroyTextureObject on texObj failed");
         }
-        else
-        {
-            CU_RET_ERR(cudaUnbindTexture(texRef), "cudaUnbindTexture on texRef failed");
-        }
     }
     CU_RET_ERR(cudaFree(d_ptr), "cudaFree failed");
 }
@@ -336,7 +301,7 @@ void destroyParamLookupTable(T                       *d_ptr,
  * One should also verify that the result of cudaCreateChannelDesc<T>() during texture setup
  * looks reasonable, when instantiating the templates for new types - just in case.
  */
-template void initParamLookupTable<float>(float * &, cudaTextureObject_t &, const texture<float, 1, cudaReadModeElementType> *, const float *, int, const gmx_device_info_t *);
-template void destroyParamLookupTable<float>(float *, cudaTextureObject_t, const texture<float, 1, cudaReadModeElementType> *, const gmx_device_info_t *);
-template void initParamLookupTable<int>(int * &, cudaTextureObject_t &, const texture<int, 1, cudaReadModeElementType> *, const int *, int, const gmx_device_info_t *);
-template void destroyParamLookupTable<int>(int *, cudaTextureObject_t, const texture<int, 1, cudaReadModeElementType> *, const gmx_device_info_t *);
+template void initParamLookupTable<float>(float * &, cudaTextureObject_t &, const float *, int, const gmx_device_info_t *);
+template void destroyParamLookupTable<float>(float *, cudaTextureObject_t, const gmx_device_info_t *);
+template void initParamLookupTable<int>(int * &, cudaTextureObject_t &, const int *, int, const gmx_device_info_t *);
+template void destroyParamLookupTable<int>(int *, cudaTextureObject_t, const gmx_device_info_t *);
index b4cca13bb546d5d098b29a2db9aca738242b4160..d74ecd4d8dea253fe7c4663428294a5890a396bc 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -215,8 +215,7 @@ void cu_realloc_buffered(void **d_dest, void *h_src,
 
 // TODO: the 2 functions below are pretty much a constructor/destructor of a simple
 // GPU table object. There is also almost self-contained fetchFromParamLookupTable()
-// in cuda_kernel_utils.cuh. They could all live in a separate class/struct file,
-// granted storing static texture references in there does not pose problems.
+// in cuda_kernel_utils.cuh. They could all live in a separate class/struct file.
 
 /*! \brief Initialize parameter lookup table.
  *
@@ -226,34 +225,30 @@ void cu_realloc_buffered(void **d_dest, void *h_src,
  * \tparam[in] T         Raw data type
  * \param[out] d_ptr     device pointer to the memory to be allocated
  * \param[out] texObj    texture object to be initialized
- * \param[out] texRef    texture reference to be initialized
  * \param[in]  h_ptr     pointer to the host memory to be uploaded to the device
  * \param[in]  numElem   number of elements in the h_ptr
  * \param[in]  devInfo   pointer to the info struct of the device in use
  */
 template <typename T>
 void initParamLookupTable(T                        * &d_ptr,
-                          cudaTextureObject_t       &texObj,
-                          const struct texture<T, 1, cudaReadModeElementType> *texRef,
-                          const T                   *h_ptr,
-                          int                        numElem,
-                          const gmx_device_info_t   *devInfo);
+                          cudaTextureObject_t        &texObj,
+                          const T                    *h_ptr,
+                          int                         numElem,
+                          const gmx_device_info_t    *devInfo);
 
 /*! \brief Destroy parameter lookup table.
  *
- * Unbinds texture reference/object, deallocates device memory.
+ * Unbinds texture object, deallocates device memory.
  *
  * \tparam[in] T         Raw data type
  * \param[in]  d_ptr     Device pointer to the memory to be deallocated
  * \param[in]  texObj    Texture object to be deinitialized
- * \param[in]  texRef    Texture reference to be deinitialized
  * \param[in]  devInfo   Pointer to the info struct of the device in use
  */
 template <typename T>
-void destroyParamLookupTable(T                         *d_ptr,
-                             cudaTextureObject_t        texObj,
-                             const struct texture<T, 1, cudaReadModeElementType> *texRef,
-                             const gmx_device_info_t   *devInfo);
+void destroyParamLookupTable(T                       *d_ptr,
+                             cudaTextureObject_t      texObj,
+                             const gmx_device_info_t *devInfo);
 
 /*! \brief Add a triplets stored in a float3 to an rvec variable.
  *
@@ -302,4 +297,19 @@ static inline bool haveStreamTasksCompleted(cudaStream_t s)
     return true;
 }
 
+/*! \brief Free a device-side buffer.
+ * TODO: fully replace cu_free_buffered with this.
+ *
+ * \param[in] buffer  Pointer to the buffer to free.
+ */
+template <typename DeviceBuffer>
+void freeDeviceBuffer(DeviceBuffer *buffer)
+{
+    GMX_ASSERT(buffer, "needs a buffer pointer");
+    if (*buffer)
+    {
+        GMX_RELEASE_ASSERT(cudaFree(*buffer) == cudaSuccess, "cudaFree failed");
+    }
+}
+
 #endif
index 9ca379ee96366cf64016c78b09fdafd5891fcad5..2df4709ab4755440375242777b30326fe470cbaa 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2010,2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
index 1a5ced2c0ba7640bebb8d1bccdd8f948edfb5367..c364363ed6efe173ec0ef518e192c61906a98ecd 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2010, The GROMACS development team.
- * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
index b709c1206e2c7900f2718c35606af9ca92137809..17321f7c62381f964033759a47c9b6af6ea774d5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #define GMX_GPU_UTILS_GPUREGIONTIMER_CUH
 
 #include "gromacs/gpu_utils/cudautils.cuh"
+#include "gromacs/gpu_utils/gputraits.cuh"
 
 #include "gpuregiontimer.h"
 
-template <> struct GpuTraits<GpuFramework::CUDA>
-{
-    using CommandStream = cudaStream_t;
-    using CommandEvent  = void;
-};
-
-//! Short-hand for external use
-using             GpuRegionTimer = GpuRegionTimerWrapper<GpuFramework::CUDA>;
-
-template <> class GpuRegionTimerImpl<GpuFramework::CUDA>
+/*! \libinternal \brief
+ * This is a GPU region timing implementation for CUDA.
+ * It provides methods for measuring the last timespan.
+ * Copying/assignment is disabled since the underlying timing events are owned by this.
+ */
+class GpuRegionTimerImpl
 {
-    //! Short-hand
-    using       CommandStream = typename GpuTraits<GpuFramework::CUDA>::CommandStream;
     //! The underlying timing event pair - the beginning and the end of the timespan
     cudaEvent_t eventStart_, eventStop_;
 
@@ -72,23 +67,31 @@ template <> class GpuRegionTimerImpl<GpuFramework::CUDA>
             CU_RET_ERR(cudaEventCreate(&eventStart_, eventFlags), "GPU timing creation failure");
             CU_RET_ERR(cudaEventCreate(&eventStop_, eventFlags), "GPU timing creation failure");
         }
-
         ~GpuRegionTimerImpl()
         {
             CU_RET_ERR(cudaEventDestroy(eventStart_), "GPU timing destruction failure");
             CU_RET_ERR(cudaEventDestroy(eventStop_), "GPU timing destruction failure");
         }
+        //! No copying
+        GpuRegionTimerImpl(const GpuRegionTimerImpl &)       = delete;
+        //! No assignment
+        GpuRegionTimerImpl &operator = (GpuRegionTimerImpl &&) = delete;
+        //! Moving is disabled but can be considered in the future if needed
+        GpuRegionTimerImpl(GpuRegionTimerImpl &&)            = delete;
 
+        /*! \brief Will be called before the region start. */
         inline void openTimingRegion(CommandStream s)
         {
             CU_RET_ERR(cudaEventRecord(eventStart_, s), "GPU timing recording failure");
         }
 
+        /*! \brief Will be called after the region end. */
         inline void closeTimingRegion(CommandStream s)
         {
             CU_RET_ERR(cudaEventRecord(eventStop_, s), "GPU timing recording failure");
         }
 
+        /*! \brief Returns the last measured region timespan (in milliseconds) and calls reset() */
         inline double getLastRangeTime()
         {
             float milliseconds = 0.0;
@@ -97,7 +100,11 @@ template <> class GpuRegionTimerImpl<GpuFramework::CUDA>
             return milliseconds;
         }
 
+        /*! \brief Resets internal state */
         inline void reset(){}
 };
 
+//! Short-hand for external use
+using GpuRegionTimer = GpuRegionTimerWrapper<GpuRegionTimerImpl>;
+
 #endif
index e453a5e18b2c7712c6024b3032c470537cc1b4d3..64c2a7918b53a2f4d15f29dce19ca38e46327297 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -54,62 +54,6 @@ static const bool c_debugTimerState = false;
 static const bool c_debugTimerState = true;
 #endif
 
-/*! \libinternal \brief
- * Enumeration of possible GPU build-paths.
- * \todo Move somewhere general?
- */
-enum class GpuFramework
-{
-    CUDA,
-    OpenCL
-};
-
-/*! \libinternal \brief
- * GPU build-path traits such as types.
- * \todo Move somewhere general?
- */
-template <GpuFramework> struct GpuTraits
-{
-    using CommandStream      = void; //!< GPU command stream
-    using CommandEvent       = void; //!< Single command call timing event - used in OpenCL
-};
-
-/*! \libinternal \brief
- * This is a GPU region timing implementation interface.
- * It should provide methods for measuring the last timespan.
- * Copying/assignment is disabled since the underlying timing events are owned by this.
- */
-template <GpuFramework framework> class GpuRegionTimerImpl
-{
-    //! Short-hands
-    using CommandStream = typename GpuTraits<framework>::CommandStream;
-    using CommandEvent  = typename GpuTraits<framework>::CommandEvent;
-
-    public:
-
-        GpuRegionTimerImpl()  = default;
-        ~GpuRegionTimerImpl() = default;
-        //! No copying
-        GpuRegionTimerImpl(const GpuRegionTimerImpl &)       = delete;
-        //! No assignment
-        GpuRegionTimerImpl &operator=(GpuRegionTimerImpl &&) = delete;
-        //! Moving is disabled but can be considered in the future if needed
-        GpuRegionTimerImpl(GpuRegionTimerImpl &&)            = delete;
-
-        /*! \brief Will be called before the region start. */
-        inline void openTimingRegion(CommandStream) = 0;
-        /*! \brief Will be called after the region end. */
-        inline void closeTimingRegion(CommandStream) = 0;
-        /*! \brief Resets any internal state if needed */
-        inline void reset() = 0;
-        /*! \brief Returns the last measured region timespan (in milliseconds) and calls reset() */
-        inline double getLastRangeTime() = 0;
-        /*! \brief Returns a new raw timing event
-         * for passing into individual GPU API calls
-         * within the region if the API requires it (e.g. on OpenCL). */
-        inline CommandEvent *fetchNextEvent() = 0;
-};
-
 /*! \libinternal \brief
  * This is a GPU region timing wrapper class.
  * It allows for host-side tracking of the accumulated execution timespans in GPU code
@@ -118,11 +62,8 @@ template <GpuFramework framework> class GpuRegionTimerImpl
  * as far as current implementation allows (see TODO in getLastRangeTime() for a disabled check).
  * Internally it uses GpuRegionTimerImpl for measuring regions.
  */
-template <GpuFramework framework> class GpuRegionTimerWrapper
+template <typename GpuRegionTimerImpl> class GpuRegionTimerWrapper
 {
-    //! Short-hands
-    using CommandStream = typename GpuTraits<framework>::CommandStream;
-    using CommandEvent  = typename GpuTraits<framework>::CommandEvent;
     //! The timer state used for debug-only assertions
     enum class TimerState
     {
@@ -132,11 +73,11 @@ template <GpuFramework framework> class GpuRegionTimerWrapper
     } debugState_ = TimerState::Idle;
 
     //! The number of times the timespan has been measured
-    unsigned int                  callCount_ = 0;
+    unsigned int       callCount_ = 0;
     //! The accumulated duration of the timespans measured (milliseconds)
-    double                        totalMilliseconds_ = 0.0;
+    double             totalMilliseconds_ = 0.0;
     //! The underlying region timer implementation
-    GpuRegionTimerImpl<framework> impl_;
+    GpuRegionTimerImpl impl_;
 
     public:
 
index fc64d04e96e18752607130dcad23cee6df3656ce..91e9e8de23bdf8faeebc28217caea500c4aa5e9f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 
 #include <array>
 
+#include "gromacs/gpu_utils/gputraits_ocl.h"
 #include "gromacs/gpu_utils/oclutils.h"
 
 #include "gpuregiontimer.h"
 
-template <> struct GpuTraits<GpuFramework::OpenCL>
-{
-    using CommandStream = cl_command_queue;
-    using CommandEvent  = cl_event;
-};
-
-//! Short-hand for external use
-using GpuRegionTimer = GpuRegionTimerWrapper<GpuFramework::OpenCL>;
-
+/*! \libinternal \brief
+ * This is a GPU region timing implementation for OpenCL.
+ * It provides methods for measuring the last timespan.
+ * Copying/assignment is disabled since the underlying timing events are owned by this.
+ */
 // cppcheck-suppress noConstructor
-template <> class GpuRegionTimerImpl<GpuFramework::OpenCL>
+class GpuRegionTimerImpl
 {
-    //! Short-hands
-    using CommandStream = typename GpuTraits<GpuFramework::OpenCL>::CommandStream;
-    using CommandEvent  = typename GpuTraits<GpuFramework::OpenCL>::CommandEvent;
-
     /*! \brief The underlying individual timing events array.
      * The maximum size is chosen arbitrarily to work with current code, and can be changed.
      * There is simply no need for run-time resizing, and it's unlikely we'll ever need more than 10.
@@ -76,9 +69,22 @@ template <> class GpuRegionTimerImpl<GpuFramework::OpenCL>
 
     public:
 
+        GpuRegionTimerImpl()  = default;
+        ~GpuRegionTimerImpl() = default;
+        //! No copying
+        GpuRegionTimerImpl(const GpuRegionTimerImpl &)       = delete;
+        //! No assignment
+        GpuRegionTimerImpl &operator=(GpuRegionTimerImpl &&) = delete;
+        //! Moving is disabled but can be considered in the future if needed
+        GpuRegionTimerImpl(GpuRegionTimerImpl &&)            = delete;
+
+        /*! \brief Will be called before the region start. */
         inline void openTimingRegion(CommandStream){}
+
+        /*! \brief Will be called after the region end. */
         inline void closeTimingRegion(CommandStream){}
 
+        /*! \brief Returns the last measured region timespan (in milliseconds) and calls reset() */
         inline double getLastRangeTime()
         {
             double milliseconds = 0.0;
@@ -102,6 +108,7 @@ template <> class GpuRegionTimerImpl<GpuFramework::OpenCL>
             return milliseconds;
         }
 
+        /*! \brief Resets internal state */
         inline void reset()
         {
             for (size_t i = 0; i < currentEvent_; i++)
@@ -116,6 +123,10 @@ template <> class GpuRegionTimerImpl<GpuFramework::OpenCL>
             events_.fill(nullptr);
         }
 
+        /*! \brief Returns a new raw timing event
+         * for passing into individual GPU API calls
+         * within the region if the API requires it (e.g. on OpenCL).
+         */
         inline CommandEvent *fetchNextEvent()
         {
             GMX_ASSERT(currentEvent_ < events_.size(), "Increase c_maxEventNumber_ if needed");
@@ -125,4 +136,7 @@ template <> class GpuRegionTimerImpl<GpuFramework::OpenCL>
         }
 };
 
+//! Short-hand for external use
+using GpuRegionTimer = GpuRegionTimerWrapper<GpuRegionTimerImpl>;
+
 #endif
similarity index 75%
rename from src/gromacs/simd/impl_ibm_qpx/impl_ibm_qpx_general.h
rename to src/gromacs/gpu_utils/gputraits.cuh
index d2c318a923585f0fd79246e3c86a5395f57cabf9..9e96830a202949635af0eeac6aefc70d060386d7 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
+#ifndef GMX_GPU_UTILS_GPUTRAITS_CUH
+#define GMX_GPU_UTILS_GPUTRAITS_CUH
 
-#ifndef GMX_SIMD_IMPLEMENTATION_IBM_QPX_GENERAL_H
-#define GMX_SIMD_IMPLEMENTATION_IBM_QPX_GENERAL_H
+/*! \libinternal \file
+ *  \brief Declares the CUDA type traits.
+ *  \author Aleksei Iupinov <a.yupinov@gmail.com>
+ *
+ * \inlibraryapi
+ */
 
-namespace gmx
-{
+//! \brief GPU command stream
+using CommandStream = cudaStream_t;
+//! \brief Single GPU call timing event - meaningless in CUDA
+using CommandEvent  = void;
+//! \brief A device-side buffer of ValueTypes
+template<typename ValueType>
+using DeviceBuffer  = ValueType *;
 
-static inline void
-simdPrefetch(const void * m)
-{
-#if defined __GNUC__
-    __builtin_prefetch(m);
 #endif
-}
-
-}      // namespace gmx
-
-#endif // GMX_SIMD_IMPLEMENTATION_IBM_QPX_GENERAL_H
similarity index 73%
rename from src/gromacs/simd/impl_ibm_qpx/impl_ibm_qpx.h
rename to src/gromacs/gpu_utils/gputraits_ocl.h
index 899bef3c18cec17d1a35cf2ed0ccd9843ea1515b..9d8575788d77cfe9c93d557f0b14a3f54cb638c9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * To help us fund GROMACS development, we humbly ask that you cite
  * the research papers on the package. Check out http://www.gromacs.org.
  */
+#ifndef GMX_GPU_UTILS_GPUTRAITS_OCL_H
+#define GMX_GPU_UTILS_GPUTRAITS_OCL_H
 
-#ifndef GMX_SIMD_IMPLEMENTATION_IBM_QPX_H
-#define GMX_SIMD_IMPLEMENTATION_IBM_QPX_H
+/*! \libinternal \file
+ *  \brief Declares the OpenCL type traits.
+ *  \author Aleksei Iupinov <a.yupinov@gmail.com>
+ *
+ * \inlibraryapi
+ */
+
+#include "gromacs/gpu_utils/gmxopencl.h"
 
-#include "impl_ibm_qpx_definitions.h"
-#include "impl_ibm_qpx_general.h"
-#include "impl_ibm_qpx_simd4_double.h"
-#include "impl_ibm_qpx_simd4_float.h"
-#include "impl_ibm_qpx_simd_double.h"
-#include "impl_ibm_qpx_simd_float.h"
-#include "impl_ibm_qpx_util_double.h"
-#include "impl_ibm_qpx_util_float.h"
+//! \brief GPU command stream
+using CommandStream = cl_command_queue;
+//! \brief Single GPU call timing event
+using CommandEvent  = cl_event;
+//! \brief A device-side buffer of ValueTypes
+template<typename ValueType>
+using DeviceBuffer  = cl_mem;
 
-#endif // GMX_SIMD_IMPLEMENTATION_IBM_QPX_H
+#endif
index 2b2c82a88aaee9c0587c313105f3d9fc247586b0..e4bc91b320430a01089f9eb854320126d8a92ee4 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -177,4 +177,19 @@ static inline bool haveStreamTasksCompleted(cl_command_queue gmx_unused s)
     return false;
 }
 
+/*! \brief Free a device-side buffer.
+ * TODO: fully replace free_ocl_buffer and ocl_free_buffered with this.
+ *
+ * \param[in] buffer  Pointer to the buffer to free.
+ */
+template <typename DeviceBuffer>
+void freeDeviceBuffer(DeviceBuffer *buffer)
+{
+    GMX_ASSERT(buffer, "needs a buffer pointer");
+    if (*buffer)
+    {
+        GMX_RELEASE_ASSERT(clReleaseMemObject(*buffer) == CL_SUCCESS, "clReleaseMemObject failed");
+    }
+}
+
 #endif
index 03abbf8784524e8d40ff89ca87a1e6831429568f..7d7a7536a00df99ab49c0d68d36e2fc59c38a023 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2017, by the GROMACS development team, led by
+ * Copyright (c) 2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
index f6d1643a9e27b86a22cbe8099a5f66d1d5dbdf35..7366aaf344eb49f5da0db49c44d1275660536648 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2017, by the GROMACS development team, led by
+ * Copyright (c) 2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
index fc897a077cea4f5b6dba54c5d0edc28608f44a4a..34d5b082a18f06b30761f0bda77d3a8c2dfc653e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2017, by the GROMACS development team, led by
+ * Copyright (c) 2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
index 6f16a041c52b165ef2cddfd43e975f314a1f3fbe..d5123641aef6366572d81cd9fd7968ab75ae3ef0 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -945,82 +945,87 @@ CpuInfo CpuInfo::detect()
     return result;
 }
 
-
 CpuInfo::CpuInfo()
     : vendor_(CpuInfo::Vendor::Unknown), brandString_("Unknown CPU brand"),
       family_(0), model_(0), stepping_(0)
 {
 }
 
-
-const std::map<CpuInfo::Vendor, std::string>
-CpuInfo::s_vendorStrings_ =
+const std::string &CpuInfo::vendorString() const
 {
-    { CpuInfo::Vendor::Unknown, "Unknown vendor"                  },
-    { CpuInfo::Vendor::Intel, "Intel"                             },
-    { CpuInfo::Vendor::Amd, "AMD"                                 },
-    { CpuInfo::Vendor::Fujitsu, "Fujitsu"                         },
-    { CpuInfo::Vendor::Ibm, "IBM"                                 },
-    { CpuInfo::Vendor::Arm, "ARM"                                 },
-    { CpuInfo::Vendor::Oracle, "Oracle"                           },
-};
-
-
-const std::map<CpuInfo::Feature, std::string>
-CpuInfo::s_featureStrings_ =
+    static const std::map<Vendor, std::string> vendorStrings =
+    {
+        { Vendor::Unknown, "Unknown vendor"                  },
+        { Vendor::Intel, "Intel"                             },
+        { Vendor::Amd, "AMD"                                 },
+        { Vendor::Fujitsu, "Fujitsu"                         },
+        { Vendor::Ibm, "IBM"                                 },
+        { Vendor::Arm, "ARM"                                 },
+        { Vendor::Oracle, "Oracle"                           },
+    };
+
+    return vendorStrings.at(vendor_);
+}
+
+
+const std::string &CpuInfo::featureString(Feature f)
 {
-    { CpuInfo::Feature::X86_Aes, "aes"                            },
-    { CpuInfo::Feature::X86_Amd, "amd"                            },
-    { CpuInfo::Feature::X86_Apic, "apic"                          },
-    { CpuInfo::Feature::X86_Avx, "avx"                            },
-    { CpuInfo::Feature::X86_Avx2, "avx2"                          },
-    { CpuInfo::Feature::X86_Avx512F, "avx512f"                    },
-    { CpuInfo::Feature::X86_Avx512PF, "avx512pf"                  },
-    { CpuInfo::Feature::X86_Avx512ER, "avx512er"                  },
-    { CpuInfo::Feature::X86_Avx512CD, "avx512cd"                  },
-    { CpuInfo::Feature::X86_Avx512BW, "avx512bw"                  },
-    { CpuInfo::Feature::X86_Avx512VL, "avx512vl"                  },
-    { CpuInfo::Feature::X86_Clfsh, "clfsh"                        },
-    { CpuInfo::Feature::X86_Cmov, "cmov"                          },
-    { CpuInfo::Feature::X86_Cx8, "cx8"                            },
-    { CpuInfo::Feature::X86_Cx16, "cx16"                          },
-    { CpuInfo::Feature::X86_F16C, "f16c"                          },
-    { CpuInfo::Feature::X86_Fma, "fma"                            },
-    { CpuInfo::Feature::X86_Fma4, "fma4"                          },
-    { CpuInfo::Feature::X86_Hle, "hle"                            },
-    { CpuInfo::Feature::X86_Htt, "htt"                            },
-    { CpuInfo::Feature::X86_Intel, "intel"                        },
-    { CpuInfo::Feature::X86_Lahf, "lahf"                          },
-    { CpuInfo::Feature::X86_MisalignSse, "misalignsse"            },
-    { CpuInfo::Feature::X86_Mmx, "mmx"                            },
-    { CpuInfo::Feature::X86_Msr, "msr"                            },
-    { CpuInfo::Feature::X86_NonstopTsc, "nonstop_tsc"             },
-    { CpuInfo::Feature::X86_Pcid, "pcid"                          },
-    { CpuInfo::Feature::X86_Pclmuldq, "pclmuldq"                  },
-    { CpuInfo::Feature::X86_Pdcm, "pdcm"                          },
-    { CpuInfo::Feature::X86_PDPE1GB, "pdpe1gb"                    },
-    { CpuInfo::Feature::X86_Popcnt, "popcnt"                      },
-    { CpuInfo::Feature::X86_Pse, "pse"                            },
-    { CpuInfo::Feature::X86_Rdrnd, "rdrnd"                        },
-    { CpuInfo::Feature::X86_Rdtscp, "rdtscp"                      },
-    { CpuInfo::Feature::X86_Rtm, "rtm"                            },
-    { CpuInfo::Feature::X86_Sha, "sha"                            },
-    { CpuInfo::Feature::X86_Sse2, "sse2"                          },
-    { CpuInfo::Feature::X86_Sse3, "sse3"                          },
-    { CpuInfo::Feature::X86_Sse4A, "sse4a"                        },
-    { CpuInfo::Feature::X86_Sse4_1, "sse4.1"                      },
-    { CpuInfo::Feature::X86_Sse4_2, "sse4.2"                      },
-    { CpuInfo::Feature::X86_Ssse3, "ssse3"                        },
-    { CpuInfo::Feature::X86_Tdt, "tdt"                            },
-    { CpuInfo::Feature::X86_X2Apic, "x2apic"                      },
-    { CpuInfo::Feature::X86_Xop, "xop"                            },
-    { CpuInfo::Feature::Arm_Neon, "neon"                          },
-    { CpuInfo::Feature::Arm_NeonAsimd, "neon_asimd"               },
-    { CpuInfo::Feature::Ibm_Qpx, "qpx"                            },
-    { CpuInfo::Feature::Ibm_Vmx, "vmx"                            },
-    { CpuInfo::Feature::Ibm_Vsx, "vsx"                            },
-    { CpuInfo::Feature::Fujitsu_HpcAce, "hpc-ace"                 }
-};
+    static const std::map<Feature, std::string> featureStrings =
+    {
+        { Feature::X86_Aes, "aes"                            },
+        { Feature::X86_Amd, "amd"                            },
+        { Feature::X86_Apic, "apic"                          },
+        { Feature::X86_Avx, "avx"                            },
+        { Feature::X86_Avx2, "avx2"                          },
+        { Feature::X86_Avx512F, "avx512f"                    },
+        { Feature::X86_Avx512PF, "avx512pf"                  },
+        { Feature::X86_Avx512ER, "avx512er"                  },
+        { Feature::X86_Avx512CD, "avx512cd"                  },
+        { Feature::X86_Avx512BW, "avx512bw"                  },
+        { Feature::X86_Avx512VL, "avx512vl"                  },
+        { Feature::X86_Clfsh, "clfsh"                        },
+        { Feature::X86_Cmov, "cmov"                          },
+        { Feature::X86_Cx8, "cx8"                            },
+        { Feature::X86_Cx16, "cx16"                          },
+        { Feature::X86_F16C, "f16c"                          },
+        { Feature::X86_Fma, "fma"                            },
+        { Feature::X86_Fma4, "fma4"                          },
+        { Feature::X86_Hle, "hle"                            },
+        { Feature::X86_Htt, "htt"                            },
+        { Feature::X86_Intel, "intel"                        },
+        { Feature::X86_Lahf, "lahf"                          },
+        { Feature::X86_MisalignSse, "misalignsse"            },
+        { Feature::X86_Mmx, "mmx"                            },
+        { Feature::X86_Msr, "msr"                            },
+        { Feature::X86_NonstopTsc, "nonstop_tsc"             },
+        { Feature::X86_Pcid, "pcid"                          },
+        { Feature::X86_Pclmuldq, "pclmuldq"                  },
+        { Feature::X86_Pdcm, "pdcm"                          },
+        { Feature::X86_PDPE1GB, "pdpe1gb"                    },
+        { Feature::X86_Popcnt, "popcnt"                      },
+        { Feature::X86_Pse, "pse"                            },
+        { Feature::X86_Rdrnd, "rdrnd"                        },
+        { Feature::X86_Rdtscp, "rdtscp"                      },
+        { Feature::X86_Rtm, "rtm"                            },
+        { Feature::X86_Sha, "sha"                            },
+        { Feature::X86_Sse2, "sse2"                          },
+        { Feature::X86_Sse3, "sse3"                          },
+        { Feature::X86_Sse4A, "sse4a"                        },
+        { Feature::X86_Sse4_1, "sse4.1"                      },
+        { Feature::X86_Sse4_2, "sse4.2"                      },
+        { Feature::X86_Ssse3, "ssse3"                        },
+        { Feature::X86_Tdt, "tdt"                            },
+        { Feature::X86_X2Apic, "x2apic"                      },
+        { Feature::X86_Xop, "xop"                            },
+        { Feature::Arm_Neon, "neon"                          },
+        { Feature::Arm_NeonAsimd, "neon_asimd"               },
+        { Feature::Ibm_Qpx, "qpx"                            },
+        { Feature::Ibm_Vmx, "vmx"                            },
+        { Feature::Ibm_Vsx, "vsx"                            },
+        { Feature::Fujitsu_HpcAce, "hpc-ace"                 }
+    };
+    return featureStrings.at(f);
+}
 
 
 bool
index 33c7875850875e14a20930f9fa1b9660c79d80b6..021686e85590a74f97574fa810942ecb6b80fffe 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -144,7 +144,7 @@ class CpuInfo
             X86_Xop,         //!< AMD extended instructions, only AMD for now
             Arm_Neon,        //!< 32-bit ARM NEON
             Arm_NeonAsimd,   //!< 64-bit ARM AArch64 Advanced SIMD
-            Ibm_Qpx,         //!< IBM QPX SIMD (BlueGene/Q and later)
+            Ibm_Qpx,         //!< IBM QPX SIMD (BlueGene/Q)
             Ibm_Vmx,         //!< IBM VMX SIMD (Altivec on Power6 and later)
             Ibm_Vsx,         //!< IBM VSX SIMD (Power7 and later)
             Fujitsu_HpcAce   //!< Fujitsu Sparc64 HPC-ACE
@@ -190,11 +190,7 @@ class CpuInfo
          *          map of vendor names. This can only happen if we extend the enum
          *          type but forget to add the string with the vendor name.
          */
-        const std::string &
-        vendorString() const
-        {
-            return s_vendorStrings_.at(vendor_);
-        }
+        const std::string &vendorString() const;
 
         /*! \brief String description of processor */
         const std::string &
@@ -231,11 +227,7 @@ class CpuInfo
          *          map of feature names. This can only happen if we extend the enum
          *          type but forget to add the string with the feature name.
          */
-        static const std::string &
-        featureString(Feature f)
-        {
-            return s_featureStrings_.at(f);
-        }
+        static const std::string &featureString(Feature f);
 
         /*! \brief Set of all supported features on this processor
          *
@@ -279,8 +271,6 @@ class CpuInfo
         int                                          stepping_;          //!<  Minor version of current cpu
         std::set<Feature>                            features_;          //!< Set of features supported on this cpu
         std::vector<LogicalProcessor>                logicalProcessors_; //!< Simple logical processor topology
-        static const std::map<Vendor, std::string>   s_vendorStrings_;   //!< Text description of each vendor
-        static const std::map<Feature, std::string>  s_featureStrings_;  //!< Text description of each feature
 };                                                                       // class CpuInfo
 
 /*! \brief Return true if the CPU is an Intel x86 Nehalem
index f72237eab67ebfe9328168d1a4505161528b5bb7..2f234e645ef45f795252b946871d7a32756e5ef6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -108,7 +108,7 @@ static int                            n_hwinfo = 0;
 static tMPI_Thread_mutex_t            hw_info_lock = TMPI_THREAD_MUTEX_INITIALIZER;
 
 //! Detect GPUs, if that makes sense to attempt.
-static void gmx_detect_gpus(const gmx::MDLogger &mdlog, const t_commrec *cr)
+static void gmx_detect_gpus(const gmx::MDLogger &mdlog)
 {
 #if GMX_LIB_MPI
     int              rank_world;
@@ -147,20 +147,20 @@ static void gmx_detect_gpus(const gmx::MDLogger &mdlog, const t_commrec *cr)
         MPI_Comm_rank(physicalnode_comm, &rankOnNode);
         isMasterRankOfNode = (rankOnNode == 0);
     }
-    GMX_UNUSED_VALUE(cr);
 #else
-    // Here there should be only one process, because if we are using
-    // thread-MPI, only one thread is active so far. So we check this.
-    GMX_RELEASE_ASSERT(cr->nnodes == 1 && cr->sim_nodeid == 0, "Only a single (master) process should execute here");
+    // We choose to run the detection only once with thread-MPI and
+    // use reference counting on the results of the detection to
+    // enforce it. But we can assert that this is true.
+    GMX_RELEASE_ASSERT(n_hwinfo == 0, "Cannot run GPU detection on non-master thread-MPI ranks");
     isMasterRankOfNode = true;
 #endif
 
-    /*  With CUDA detect only on one rank per host, with OpenCL need do
-     *  the detection on all PP ranks */
-    bool isOpenclPpRank = ((GMX_GPU == GMX_GPU_OPENCL) && thisRankHasDuty(cr, DUTY_PP));
-
-    bool gpusCanBeDetected = false;
-    if (isMasterRankOfNode || isOpenclPpRank)
+    /* The OpenCL support requires us to run detection on all ranks.
+     * With CUDA we don't need to, and prefer to detect on one rank
+     * and send the information to the other ranks over MPI. */
+    bool allRanksMustDetectGpus = (GMX_GPU == GMX_GPU_OPENCL);
+    bool gpusCanBeDetected      = false;
+    if (isMasterRankOfNode || allRanksMustDetectGpus)
     {
         std::string errorMessage;
         gpusCanBeDetected = canDetectGpus(&errorMessage);
@@ -182,7 +182,7 @@ static void gmx_detect_gpus(const gmx::MDLogger &mdlog, const t_commrec *cr)
     }
 
 #if GMX_LIB_MPI
-    if (!isOpenclPpRank)
+    if (!allRanksMustDetectGpus)
     {
         /* Broadcast the GPU info to the other ranks within this node */
         MPI_Bcast(&hwinfo_g->gpu_info.n_dev, 1, MPI_INT, 0, physicalnode_comm);
@@ -474,7 +474,7 @@ hardwareTopologyDoubleCheckDetection(const gmx::MDLogger gmx_unused         &mdl
 #endif
 }
 
-gmx_hw_info_t *gmx_detect_hardware(const gmx::MDLogger &mdlog, const t_commrec *cr)
+gmx_hw_info_t *gmx_detect_hardware(const gmx::MDLogger &mdlog)
 {
     int ret;
 
@@ -509,7 +509,7 @@ gmx_hw_info_t *gmx_detect_hardware(const gmx::MDLogger &mdlog, const t_commrec *
         hwinfo_g->gpu_info.n_dev_compatible = 0;
         hwinfo_g->gpu_info.gpu_dev          = nullptr;
 
-        gmx_detect_gpus(mdlog, cr);
+        gmx_detect_gpus(mdlog);
         gmx_collect_hardware_mpi(*hwinfo_g->cpuInfo);
     }
     /* increase the reference counter */
index 331aa73bf1594c1e835d3d2337d3d2e06b507d1f..5ba14eb52be7104d734c4f38bc873fa744d204cd 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #ifndef GMX_HARDWARE_DETECTHARDWARE_H
 #define GMX_HARDWARE_DETECTHARDWARE_H
 
-#include <cstdio>
-
-#include <string>
-#include <vector>
-
-#include "gromacs/utility/basedefinitions.h"
-
 struct gmx_gpu_info_t;
 struct gmx_hw_info_t;
-struct gmx_hw_opt_t;
-struct t_commrec;
 
 namespace gmx
 {
@@ -58,9 +49,10 @@ class MDLogger;
  * then run consistency checks afterwards. The results will also be made
  * available on all nodes.
  * Caller is responsible for calling gmx_hardware_info_free() when finished.
+ *
+ * May do communication on MPI_COMM_WORLD when compiled with real MPI.
  */
-gmx_hw_info_t *gmx_detect_hardware(const gmx::MDLogger &mdlog,
-                                   const t_commrec     *cr);
+gmx_hw_info_t *gmx_detect_hardware(const gmx::MDLogger &mdlog);
 
 /*! \brief Free the hwinfo structure */
 void gmx_hardware_info_free();
@@ -68,6 +60,6 @@ void gmx_hardware_info_free();
 //! Return whether compatible GPUs were found.
 bool compatibleGpusFound(const gmx_gpu_info_t &gpu_info);
 
-#endif
-
 } // namespace gmx
+
+#endif
index 76c9830c1eb1191a51b5b4f0f5deb2cc2959710b..f6f1eb6c69b60a9525b765f93b9ed594fe98a060 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -355,6 +355,7 @@ static std::string detected_hardware_string(const gmx_hw_info_t *hwinfo,
 }
 
 void gmx_print_detected_hardware(FILE *fplog, const t_commrec *cr,
+                                 const gmx_multisim_t *ms,
                                  const gmx::MDLogger &mdlog,
                                  const gmx_hw_info_t *hwinfo)
 {
@@ -378,7 +379,7 @@ void gmx_print_detected_hardware(FILE *fplog, const t_commrec *cr,
      */
     if (cpuInfo.supportLevel() >= gmx::CpuInfo::SupportLevel::Features)
     {
-        gmx::simdCheck(static_cast<gmx::SimdType>(hwinfo->simd_suggest_min), fplog, MULTIMASTER(cr));
+        gmx::simdCheck(static_cast<gmx::SimdType>(hwinfo->simd_suggest_min), fplog, isMasterSimMasterRank(ms, cr));
     }
 
     /* For RDTSCP we only check on our local node and skip the MPI reduction */
index 9bc77254c0828970f876cdfc918ab517ddd5838d..c70a3b7e68fe4aff1df3d01d0d2fb61facdc28d2 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -38,6 +38,7 @@
 #include <cstdio>
 
 struct gmx_hw_info_t;
+struct gmx_multisim_t;
 struct t_commrec;
 
 namespace gmx
@@ -49,6 +50,7 @@ class MDLogger;
  * and to stderr the master rank.
  */
 void gmx_print_detected_hardware(FILE *fplog, const t_commrec *cr,
+                                 const gmx_multisim_t *ms,
                                  const gmx::MDLogger &mdlog,
                                  const gmx_hw_info_t *hwinfo);
 
index 1d2d157bedc9b753c845f9a80353249ee75297ca..2a5c4e73ca491a5b43f442b2aae82ec94eccfb86 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -756,7 +756,7 @@ static void keep_old_values(t_gmx_IMD_setup *IMDsetup)
 
 
 /*! \brief Returns TRUE if any component of the two rvecs differs. */
-static gmx_inline gmx_bool rvecs_differ(const rvec v1, const rvec v2)
+static inline gmx_bool rvecs_differ(const rvec v1, const rvec v2)
 {
     int i;
 
@@ -1287,6 +1287,7 @@ static void imd_check_integrator_parallel(t_inputrec *ir, t_commrec *cr)
 
 void init_IMD(t_inputrec             *ir,
               t_commrec              *cr,
+              const gmx_multisim_t   *ms,
               gmx_mtop_t             *top_global,
               FILE                   *fplog,
               int                     defnstimd,
@@ -1308,6 +1309,9 @@ void init_IMD(t_inputrec             *ir,
     {
         return;
     }
+    // TODO many of these error conditions were we can't do what the
+    // user asked for should be handled with a fatal error, not just a
+    // warning.
 
     const ImdOptions &options = mdrunOptions.imdOptions;
 
@@ -1319,7 +1323,7 @@ void init_IMD(t_inputrec             *ir,
         if (options.wait || options.terminatable || options.pull)
         {
             /* Multiple simulations or replica exchange */
-            if (MULTISIM(cr))
+            if (isMultiSim(ms))
             {
                 fprintf(stderr, "%s Cannot use IMD for multiple simulations or replica exchange.\n", IMDstr);
             }
index 089174a68a5b5d7293b50756bf09726bcf4b0f16..30e29eb16d551f4c7f794d9f23db2b486e53baf3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -76,6 +76,7 @@
 struct gmx_domdec_t;
 struct gmx_enerdata_t;
 struct gmx_mtop_t;
+struct gmx_multisim_t;
 struct gmx_output_env_t;
 struct gmx_wallcycle;
 struct MdrunOptions;
@@ -129,6 +130,7 @@ void dd_make_local_IMD_atoms(gmx_bool bIMD, gmx_domdec_t *dd, t_IMD *imd);
  * \param ir           The inputrec structure containing the MD input parameters
  *                     including a pointer to the IMD data structure.
  * \param cr           Information structure for MPI communication.
+ * \param ms           Handler for multi-simulations.
  * \param top_global   The topology of the whole system.
  * \param fplog        General output file, normally md.log.
  * \param defnstimd    Default IMD update (=communication) frequency.
@@ -138,7 +140,9 @@ void dd_make_local_IMD_atoms(gmx_bool bIMD, gmx_domdec_t *dd, t_IMD *imd);
  * \param oenv         Output options.
  * \param mdrunOptions Options for mdrun.
  */
-void init_IMD(t_inputrec *ir, t_commrec *cr, gmx_mtop_t *top_global,
+void init_IMD(t_inputrec *ir, t_commrec *cr,
+              const gmx_multisim_t *ms,
+              gmx_mtop_t *top_global,
               FILE *fplog, int defnstimd, rvec x[],
               int nfile, const t_filenm fnm[], const gmx_output_env_t *oenv,
               const MdrunOptions &mdrunOptions);
index 85e4151eb378c10fc8bf52ba0267eb4f00fda48c..ade866903ed909c8093275b49e818841743dfdcd 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -44,7 +44,7 @@
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/smalloc.h"
 
-static gmx_inline
+static inline
 void do_rotate(double **a, int i, int j, int k, int l, double tau, double s)
 {
     double g, h;
index ae7070487a6a6ad5688c8825cc95cae0e48384a1..c776c92f8fdaaddf4d407531ca611ab2e074ca10 100644 (file)
@@ -1552,7 +1552,7 @@ real dih_angle(const rvec xi, const rvec xj, const rvec xk, const rvec xl,
  * also calculates the pre-factor required for the dihedral force update.
  * Note that bv and buf should be register aligned.
  */
-static gmx_inline void
+static inline void
 dih_angle_simd(const rvec *x,
                const int *ai, const int *aj, const int *ak, const int *al,
                const real *pbc_simd,
@@ -1774,7 +1774,7 @@ do_dih_fup_noshiftf(int i, int j, int k, int l, real ddphi,
 
 #if GMX_SIMD_HAVE_REAL
 /* As do_dih_fup_noshiftf above, but with SIMD and pre-calculated pre-factors */
-static gmx_inline void gmx_simdcall
+static inline void gmx_simdcall
 do_dih_fup_noshiftf_simd(const int *ai, const int *aj, const int *ak, const int *al,
                          SimdReal p, SimdReal q,
                          SimdReal f_i_x,  SimdReal f_i_y,  SimdReal f_i_z,
index ef37baed90606ef4b42f3256b931725bbe412fce..913ea1f24b4cd7fc5b1cda7a36a1da0d24a74a0a 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -69,6 +69,7 @@
 
 void init_disres(FILE *fplog, const gmx_mtop_t *mtop,
                  t_inputrec *ir, const t_commrec *cr,
+                 const gmx_multisim_t *ms,
                  t_fcdata *fcd, t_state *state, gmx_bool bIsREMD)
 {
     int                  fa, nmol, npair, np;
@@ -203,7 +204,7 @@ void init_disres(FILE *fplog, const gmx_mtop_t *mtop,
     dd->Rtav_6 = &(dd->Rt_6[dd->nres]);
 
     ptr = getenv("GMX_DISRE_ENSEMBLE_SIZE");
-    if (cr && cr->ms != nullptr && ptr != nullptr && !bIsREMD)
+    if (cr && ms != nullptr && ptr != nullptr && !bIsREMD)
     {
 #if GMX_MPI
         dd->nsystems = 0;
@@ -217,7 +218,7 @@ void init_disres(FILE *fplog, const gmx_mtop_t *mtop,
          * than one processor per simulation system. */
         if (MASTER(cr))
         {
-            check_multi_int(fplog, cr->ms, dd->nsystems,
+            check_multi_int(fplog, ms, dd->nsystems,
                             "the number of systems per ensemble",
                             FALSE);
         }
@@ -227,9 +228,9 @@ void init_disres(FILE *fplog, const gmx_mtop_t *mtop,
          * of ms->nsim. But this required an extra communicator which
          * was stored in t_fcdata. This pulled in mpi.h in nearly all C files.
          */
-        if (!(cr->ms->nsim == 1 || cr->ms->nsim == dd->nsystems))
+        if (!(ms->nsim == 1 || ms->nsim == dd->nsystems))
         {
-            gmx_fatal(FARGS, "GMX_DISRE_ENSEMBLE_SIZE (%d) is not equal to 1 or the number of systems (option -multi) %d", dd->nsystems, cr->ms->nsim);
+            gmx_fatal(FARGS, "GMX_DISRE_ENSEMBLE_SIZE (%d) is not equal to 1 or the number of systems (option -multidir) %d", dd->nsystems, ms->nsim);
         }
         if (fplog)
         {
@@ -237,7 +238,7 @@ void init_disres(FILE *fplog, const gmx_mtop_t *mtop,
             for (int i = 0; i < dd->nsystems; i++)
             {
                 fprintf(fplog, " %d",
-                        (cr->ms->sim/dd->nsystems)*dd->nsystems+i);
+                        (ms->sim/dd->nsystems)*dd->nsystems+i);
             }
             fprintf(fplog, "\n");
         }
@@ -269,9 +270,9 @@ void init_disres(FILE *fplog, const gmx_mtop_t *mtop,
          * checks from appropriate processes (since check_multi_int is
          * too broken to check whether the communication will
          * succeed...) */
-        if (cr && cr->ms && dd->nsystems > 1 && MASTER(cr))
+        if (cr && ms && dd->nsystems > 1 && MASTER(cr))
         {
-            check_multi_int(fplog, cr->ms, fcd->disres.nres,
+            check_multi_int(fplog, ms, fcd->disres.nres,
                             "the number of distance restraints",
                             FALSE);
         }
@@ -281,6 +282,7 @@ void init_disres(FILE *fplog, const gmx_mtop_t *mtop,
 }
 
 void calc_disres_R_6(const t_commrec *cr,
+                     const gmx_multisim_t *ms,
                      int nfa, const t_iatom forceatoms[],
                      const rvec x[], const t_pbc *pbc,
                      t_fcdata *fcd, history_t *hist)
@@ -380,8 +382,8 @@ void calc_disres_R_6(const t_commrec *cr,
             Rtav_6[res] *= invn;
         }
 
-        GMX_ASSERT(cr != NULL && cr->ms != NULL, "We need multisim with nsystems>1");
-        gmx_sum_sim(2*dd->nres, dd->Rt_6, cr->ms);
+        GMX_ASSERT(cr != NULL && ms != NULL, "We need multisim with nsystems>1");
+        gmx_sum_sim(2*dd->nres, dd->Rt_6, ms);
 
         if (DOMAINDECOMP(cr))
         {
index 7c1bb1062d9e661f701ffdfd94fe0f671c516516..bc95d13d0c5139399efe2af782bfba27caa5ce0e 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -50,6 +50,7 @@
 #include "gromacs/utility/basedefinitions.h"
 
 struct gmx_mtop_t;
+struct gmx_multisim_t;
 class history_t;
 struct t_commrec;
 struct t_inputrec;
@@ -63,11 +64,12 @@ class t_state;
  * of iatoms in the ilist of the idef struct.
  * When time averaging is used, the history is initialized in state,
  * unless it was read before from a checkpoint file.
- * The implementation of distance restraints with -multi
+ * The implementation of distance restraints with -multidir
  * must differ according to whether REMD is active.
  */
 void init_disres(FILE *fplog, const gmx_mtop_t *mtop,
                  t_inputrec *ir, const t_commrec *cr,
+                 const gmx_multisim_t *ms,
                  t_fcdata *fcd, t_state *state, gmx_bool bIsREMD);
 
 /*! \brief
@@ -75,6 +77,7 @@ void init_disres(FILE *fplog, const gmx_mtop_t *mtop,
  * and the ensemble averaged r^-6 (inst. and time averaged) for all restraints
  */
 void calc_disres_R_6(const t_commrec *cr,
+                     const gmx_multisim_t *ms,
                      int nfa, const t_iatom *fa,
                      const rvec *x, const t_pbc *pbc,
                      t_fcdata *fcd, history_t *hist);
index 62114b806bc8767a98897b19b74a465a10352a43..32a8bc97ecb4f044e94b0b3bd1788dd24b1a1a1e 100644 (file)
@@ -405,8 +405,7 @@ ftype_is_bonded_potential(int ftype)
 {
     return
         (interaction_function[ftype].flags & IF_BOND) &&
-        !(ftype == F_CONNBONDS || ftype == F_POSRES || ftype == F_FBPOSRES) &&
-        (ftype < F_GB12 || ftype > F_GB14);
+        !(ftype == F_CONNBONDS || ftype == F_POSRES || ftype == F_FBPOSRES);
 }
 
 /*! \brief Compute the bonded part of the listed forces, parallelized over threads
@@ -478,6 +477,7 @@ calcBondedForces(const t_idef     *idef,
 }
 
 void calc_listed(const t_commrec             *cr,
+                 const gmx_multisim_t *ms,
                  struct gmx_wallcycle        *wcycle,
                  const t_idef *idef,
                  const rvec x[], history_t *hist,
@@ -547,14 +547,14 @@ void calc_listed(const t_commrec             *cr,
              */
             GMX_RELEASE_ASSERT(fr->ePBC == epbcNONE || g != nullptr, "With orientation restraints molecules should be whole");
             enerd->term[F_ORIRESDEV] =
-                calc_orires_dev(cr->ms, idef->il[F_ORIRES].nr,
+                calc_orires_dev(ms, idef->il[F_ORIRES].nr,
                                 idef->il[F_ORIRES].iatoms,
                                 idef->iparams, md, x,
                                 pbc_null, fcd, hist);
         }
         if (fcd->disres.nres > 0)
         {
-            calc_disres_R_6(cr,
+            calc_disres_R_6(cr, ms,
                             idef->il[F_DISRES].nr,
                             idef->il[F_DISRES].iatoms,
                             x, pbc_null,
@@ -671,6 +671,7 @@ do_force_listed(struct gmx_wallcycle        *wcycle,
                 matrix                       box,
                 const t_lambda              *fepvals,
                 const t_commrec             *cr,
+                const gmx_multisim_t        *ms,
                 const t_idef                *idef,
                 const rvec                   x[],
                 history_t                   *hist,
@@ -700,7 +701,7 @@ do_force_listed(struct gmx_wallcycle        *wcycle,
         /* Not enough flops to bother counting */
         set_pbc(&pbc_full, fr->ePBC, box);
     }
-    calc_listed(cr, wcycle, idef, x, hist,
+    calc_listed(cr, ms, wcycle, idef, x, hist,
                 forceForUseWithShiftForces, forceWithVirial,
                 fr, pbc, &pbc_full,
                 graph, enerd, nrnb, lambda, md, fcd,
index 910128217c50e7d51ffe4aa7b067099bb7af3ad1..6fd13ac0deb0185e0a8b931a7fe616eeff7bb647 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -71,6 +71,7 @@
 
 struct gmx_enerdata_t;
 struct gmx_grppairener_t;
+struct gmx_multisim_t;
 class history_t;
 struct t_commrec;
 struct t_fcdata;
@@ -101,6 +102,7 @@ ftype_is_bonded_potential(int ftype);
  * Note that pbc_full is used only for position restraints, and is
  * not initialized if there are none. */
 void calc_listed(const t_commrec *cr,
+                 const gmx_multisim_t *ms,
                  struct gmx_wallcycle *wcycle,
                  const t_idef *idef,
                  const rvec x[], history_t *hist,
@@ -134,6 +136,7 @@ do_force_listed(struct gmx_wallcycle           *wcycle,
                 matrix                          box,
                 const t_lambda                 *fepvals,
                 const t_commrec                *cr,
+                const gmx_multisim_t           *ms,
                 const t_idef                   *idef,
                 const rvec                      x[],
                 history_t                      *hist,
index 4dd0f54b4f357f27b55b7700e3e6c4b6c557bd26..8f437a31bf9310994c24921cf267d6d515fd7490 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 // TODO This implementation of ensemble orientation restraints is nasty because
 // a user can't just do multi-sim with single-sim orientation restraints.
 
-void init_orires(FILE             *fplog,
-                 const gmx_mtop_t *mtop,
-                 const t_inputrec *ir,
-                 const t_commrec  *cr,
-                 t_state          *globalState,
-                 t_oriresdata     *od)
+void init_orires(FILE                 *fplog,
+                 const gmx_mtop_t     *mtop,
+                 const t_inputrec     *ir,
+                 const t_commrec      *cr,
+                 const gmx_multisim_t *ms,
+                 t_state              *globalState,
+                 t_oriresdata         *od)
 {
     od->nr = gmx_mtop_ftype_count(mtop, F_ORIRES);
     if (0 == od->nr)
@@ -152,7 +153,6 @@ void init_orires(FILE             *fplog,
      */
     snew(od->Dinsl, od->nr);
 
-    const gmx_multisim_t *ms = cr->ms;
     if (ms)
     {
         snew(od->Dins, od->nr);
@@ -232,7 +232,8 @@ void init_orires(FILE             *fplog,
         {
             /* Not correct for free-energy with changing masses */
             od->mref[j] = atom->m;
-            if (ms == nullptr || MASTERSIM(ms))
+            // Note that only one rank per sim is supported.
+            if (isMasterSim(ms))
             {
                 copy_rvec(globalState->x[i], od->xref[j]);
                 for (int d = 0; d < DIM; d++)
@@ -245,7 +246,7 @@ void init_orires(FILE             *fplog,
         }
     }
     svmul(1.0/mtot, com, com);
-    if (ms == nullptr || MASTERSIM(ms))
+    if (isMasterSim(ms))
     {
         for (int j = 0; j < od->nref; j++)
         {
index c248e928804021e6cbb38eae869245483f1d0c0b..0491c9b59af5e97be2588e77b76fc7dd70319586 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2010,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2010,2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -66,12 +66,13 @@ class t_state;
  * on the master rank (which is the only rank, since orientation
  * restraints can not run in parallel).
  */
-void init_orires(FILE             *fplog,
-                 const gmx_mtop_t *mtop,
-                 const t_inputrec *ir,
-                 const t_commrec  *cr,
-                 t_state          *globalState,
-                 t_oriresdata     *od);
+void init_orires(FILE                 *fplog,
+                 const gmx_mtop_t     *mtop,
+                 const t_inputrec     *ir,
+                 const t_commrec      *cr,
+                 const gmx_multisim_t *ms,
+                 t_state              *globalState,
+                 t_oriresdata         *od);
 
 /*! \brief
  * Calculates the time averaged D matrices, the S matrix for each experiment.
index dd4b061a1f0e4ff3412db11a4a6f8a350e017480..fdc2279c20983c9a7eeae6f7195316ae3c190ac5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
index 4977cf3acf8593f43fda614368be60712ebf82e6..6a570aacc54f7b65c96427651de5179f90045cf1 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -769,23 +769,7 @@ static void bc_molblock(const t_commrec *cr, gmx_molblock_t *molb)
 
 static void bc_atomtypes(const t_commrec *cr, t_atomtypes *atomtypes)
 {
-    int nr;
-
     block_bc(cr, atomtypes->nr);
-
-    nr = atomtypes->nr;
-
-    snew_bc(cr, atomtypes->radius, nr);
-    snew_bc(cr, atomtypes->vol, nr);
-    snew_bc(cr, atomtypes->surftens, nr);
-    snew_bc(cr, atomtypes->gb_radius, nr);
-    snew_bc(cr, atomtypes->S_hct, nr);
-
-    nblock_bc(cr, nr, atomtypes->radius);
-    nblock_bc(cr, nr, atomtypes->vol);
-    nblock_bc(cr, nr, atomtypes->surftens);
-    nblock_bc(cr, nr, atomtypes->gb_radius);
-    nblock_bc(cr, nr, atomtypes->S_hct);
 }
 
 /*! \brief Broadcasts ir and mtop from the master to all nodes in
index 6b272513ac7ca69b5b825667eaca202d77b47c80..ce37d40a8e3cce74584d84a80756c9fbd74a3306 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -58,6 +58,7 @@
 #include "gromacs/mdtypes/commrec.h"
 #include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/mdtypes/md_enums.h"
+#include "gromacs/mdtypes/mdatom.h"
 #include "gromacs/pbcutil/pbc.h"
 #include "gromacs/pbcutil/pbc-simd.h"
 #include "gromacs/simd/simd.h"
@@ -2327,6 +2328,7 @@ gmx_bool constrain_lincs(FILE *fplog, gmx_bool bLog, gmx_bool bEner,
                          gmx_int64_t step,
                          struct gmx_lincsdata *lincsd, t_mdatoms *md,
                          t_commrec *cr,
+                         const gmx_multisim_t *ms,
                          rvec *x, rvec *xprime, rvec *min_proj,
                          matrix box, t_pbc *pbc,
                          real lambda, real *dvdlambda,
@@ -2475,9 +2477,9 @@ gmx_bool constrain_lincs(FILE *fplog, gmx_bool bLog, gmx_bool bEner,
             {
                 cconerr(lincsd, xprime, pbc,
                         &ncons_loc, &p_ssd, &p_max, &p_imax);
-                if (MULTISIM(cr))
+                if (isMultiSim(ms))
                 {
-                    sprintf(buf3, " in simulation %d", cr->ms->sim);
+                    sprintf(buf3, " in simulation %d", ms->sim);
                 }
                 else
                 {
index 452c156ff02f4b184f7e5fc745d65eab1add2513..bed36a16648e42becb3513388035c04a2e3ad1ea 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -60,6 +60,7 @@
 #include "gromacs/mdtypes/commrec.h"
 #include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/mdtypes/md_enums.h"
+#include "gromacs/mdtypes/mdatom.h"
 #include "gromacs/mdtypes/state.h"
 #include "gromacs/pbcutil/pbc.h"
 #include "gromacs/pulling/pull.h"
@@ -275,6 +276,7 @@ gmx_bool constrain(FILE *fplog, gmx_bool bLog, gmx_bool bEner,
                    struct gmx_constr *constr,
                    t_idef *idef, t_inputrec *ir,
                    t_commrec *cr,
+                   const gmx_multisim_t *ms,
                    gmx_int64_t step, int delta_step,
                    real step_scaling,
                    t_mdatoms *md,
@@ -386,7 +388,7 @@ gmx_bool constrain(FILE *fplog, gmx_bool bLog, gmx_bool bEner,
 
     if (constr->lincsd != nullptr)
     {
-        bOK = constrain_lincs(fplog, bLog, bEner, ir, step, constr->lincsd, md, cr,
+        bOK = constrain_lincs(fplog, bLog, bEner, ir, step, constr->lincsd, md, cr, ms,
                               x, xprime, min_proj,
                               box, pbc_null, lambda, dvdlambda,
                               invdt, v, vir != nullptr, vir_r_m_dr,
index fb3c8e8e4f68e465850dd7124a32ae5098982e02..738d51b9d71989d60b6cee7e06b1b1d297165d9a 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -44,6 +44,7 @@
 #include "gromacs/topology/topology.h"
 #include "gromacs/utility/real.h"
 
+struct gmx_multisim_t;
 struct t_inputrec;
 
 /* Abstract type for LINCS that is defined only in the file that uses it */
@@ -163,7 +164,8 @@ gmx_bool constrain(FILE *log, gmx_bool bLog, gmx_bool bEner,
                    gmx_constr_t constr,
                    t_idef *idef,
                    t_inputrec *ir,
-                   struct t_commrec *cr,
+                   t_commrec *cr,
+                   const gmx_multisim_t *ms,
                    gmx_int64_t step, int delta_step,
                    real step_scaling,
                    t_mdatoms *md,
@@ -287,6 +289,7 @@ constrain_lincs(FILE *log, gmx_bool bLog, gmx_bool bEner,
                 gmx_int64_t step,
                 gmx_lincsdata_t lincsd, t_mdatoms *md,
                 struct t_commrec *cr,
+                const gmx_multisim_t *ms,
                 rvec *x, rvec *xprime, rvec *min_proj,
                 matrix box, struct t_pbc *pbc,
                 real lambda, real *dvdlambda,
index d65405c3a9942d52ca7d8b99c004b984470ec17f..0fa7e3c7221e6b2d56814b73954ac082c2221640 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
index cd1b2981de77bce2f68d876c924630fc9443ae80..e4330ed5ba89302638569e3e9194713f49af9226 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -60,6 +60,7 @@
 #include "gromacs/mdlib/update.h"
 #include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/mdtypes/md_enums.h"
+#include "gromacs/mdtypes/mdatom.h"
 #include "gromacs/mdtypes/state.h"
 #include "gromacs/random/threefry.h"
 #include "gromacs/random/uniformrealdistribution.h"
index f01ea4d333a52e51e9f192758e13b44295114843..15221b313de3c4c201ed0ba883ca1ef74a8f877b 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -57,7 +57,6 @@
 #include "gromacs/math/vec.h"
 #include "gromacs/math/vecdump.h"
 #include "gromacs/mdlib/forcerec-threading.h"
-#include "gromacs/mdlib/genborn.h"
 #include "gromacs/mdlib/mdrun.h"
 #include "gromacs/mdlib/ns.h"
 #include "gromacs/mdlib/qmmm.h"
@@ -137,6 +136,7 @@ static void reduceEwaldThreadOuput(int nthreads, ewald_corr_thread_t *ewc_t)
 
 void do_force_lowlevel(t_forcerec *fr,      t_inputrec *ir,
                        t_idef     *idef,    t_commrec  *cr,
+                       const gmx_multisim_t *ms,
                        t_nrnb     *nrnb,    gmx_wallcycle_t wcycle,
                        t_mdatoms  *md,
                        rvec       x[],      history_t  *hist,
@@ -144,9 +144,6 @@ void do_force_lowlevel(t_forcerec *fr,      t_inputrec *ir,
                        gmx::ForceWithVirial *forceWithVirial,
                        gmx_enerdata_t *enerd,
                        t_fcdata   *fcd,
-                       gmx_localtop_t *top,
-                       gmx_genborn_t *born,
-                       gmx_bool       bBornRadii,
                        matrix     box,
                        t_lambda   *fepvals,
                        real       *lambda,
@@ -201,24 +198,6 @@ void do_force_lowlevel(t_forcerec *fr,      t_inputrec *ir,
         enerd->dvdl_lin[efptVDW] += dvdl_walls;
     }
 
-    /* If doing GB, reset dvda and calculate the Born radii */
-    if (ir->implicit_solvent)
-    {
-        wallcycle_sub_start(wcycle, ewcsNONBONDED);
-
-        for (i = 0; i < born->nr; i++)
-        {
-            fr->dvda[i] = 0;
-        }
-
-        if (bBornRadii)
-        {
-            calc_gb_rad(cr, fr, ir, top, x, fr->gblist, born, md, nrnb);
-        }
-
-        wallcycle_sub_stop(wcycle, ewcsNONBONDED);
-    }
-
     where();
     /* We only do non-bonded calculation with group scheme here, the verlet
      * calls are done from do_force_cutsVERLET(). */
@@ -273,17 +252,6 @@ void do_force_lowlevel(t_forcerec *fr,      t_inputrec *ir,
         where();
     }
 
-    /* If we are doing GB, calculate bonded forces and apply corrections
-     * to the solvation forces */
-    /* MRS: Eventually, many need to include free energy contribution here! */
-    if (ir->implicit_solvent)
-    {
-        wallcycle_sub_start(wcycle, ewcsLISTED);
-        calc_gb_forces(cr, md, born, top, x, forceForUseWithShiftForces, fr, idef,
-                       ir->gb_algorithm, ir->sa_algorithm, nrnb, &pbc, graph, enerd);
-        wallcycle_sub_stop(wcycle, ewcsLISTED);
-    }
-
 #if GMX_MPI
     if (TAKETIME)
     {
@@ -359,7 +327,7 @@ void do_force_lowlevel(t_forcerec *fr,      t_inputrec *ir,
                    TRUE, box);
     }
 
-    do_force_listed(wcycle, box, ir->fepvals, cr,
+    do_force_listed(wcycle, box, ir->fepvals, cr, ms,
                     idef, (const rvec *) x, hist,
                     forceForUseWithShiftForces, forceWithVirial,
                     fr, &pbc, graph, enerd, nrnb, lambda, md, fcd,
@@ -703,8 +671,6 @@ void sum_epot(gmx_grppairener_t *grpp, real *epot)
     epot[F_LJ]       = sum_v(grpp->nener, grpp->ener[egLJSR]);
     epot[F_LJ14]     = sum_v(grpp->nener, grpp->ener[egLJ14]);
     epot[F_COUL14]   = sum_v(grpp->nener, grpp->ener[egCOUL14]);
-    /* We have already added 1-2,1-3, and 1-4 terms to F_GBPOL */
-    epot[F_GBPOL]   += sum_v(grpp->nener, grpp->ener[egGB]);
 
 /* lattice part of LR doesnt belong to any group
  * and has been added earlier
index 2d83e17a252b8e66234483d3d2f65fa0732f01ed..86dcc2af4854239a5802d15f2067cc4017be61b6 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -49,6 +49,7 @@ struct gmx_device_info_t;
 struct gmx_edsam;
 struct gmx_gpu_info_t;
 struct gmx_groups_t;
+struct gmx_multisim_t;
 struct gmx_vsite_t;
 class history_t;
 struct nonbonded_verlet_t;
@@ -151,6 +152,7 @@ void set_avcsixtwelve(FILE *fplog, t_forcerec *fr,
                       const gmx_mtop_t *mtop);
 
 void do_force(FILE *log, t_commrec *cr,
+              const gmx_multisim_t *ms,
               t_inputrec *inputrec,
               gmx_int64_t step, struct t_nrnb *nrnb, gmx_wallcycle_t wcycle,
               gmx_localtop_t *top,
@@ -164,7 +166,6 @@ void do_force(FILE *log, t_commrec *cr,
               t_forcerec *fr,
               gmx_vsite_t *vsite, rvec mu_tot,
               double t, struct gmx_edsam *ed,
-              gmx_bool bBornRadii,
               int flags,
               DdOpenBalanceRegionBeforeForceComputation ddOpenBalanceRegion,
               DdCloseBalanceRegionAfterForceComputation ddCloseBalanceRegion);
@@ -193,6 +194,7 @@ void do_force_lowlevel(t_forcerec   *fr,
                        t_inputrec   *ir,
                        t_idef       *idef,
                        t_commrec    *cr,
+                       const gmx_multisim_t *ms,
                        t_nrnb       *nrnb,
                        gmx_wallcycle_t wcycle,
                        t_mdatoms    *md,
@@ -202,9 +204,6 @@ void do_force_lowlevel(t_forcerec   *fr,
                        gmx::ForceWithVirial *forceWithVirial,
                        gmx_enerdata_t *enerd,
                        t_fcdata     *fcd,
-                       gmx_localtop_t *top,
-                       gmx_genborn_t *born,
-                       gmx_bool         bBornRadii,
                        matrix       box,
                        t_lambda     *fepvals,
                        real         *lambda,
@@ -216,6 +215,7 @@ void do_force_lowlevel(t_forcerec   *fr,
 /* Call all the force routines */
 
 void free_gpu_resources(const t_forcerec            *fr,
-                        const t_commrec             *cr);
+                        const t_commrec             *cr,
+                        const gmx_multisim_t        *ms);
 
 #endif
index 49b690d75d63511a4626b507829a33592d92ff3d..d96b3c24be2119b5c91f358373aa1dc45612fdd1 100644 (file)
@@ -1539,10 +1539,6 @@ gmx_bool can_use_allvsall(const t_inputrec *ir, gmx_bool bPrintNote, t_commrec *
             ir->vdwtype == evdwCUT    &&
             ir->coulombtype == eelCUT &&
             ir->efep == efepNO        &&
-            (ir->implicit_solvent == eisNO ||
-             (ir->implicit_solvent == eisGBSA && (ir->gb_algorithm == egbSTILL ||
-                                                  ir->gb_algorithm == egbHCT   ||
-                                                  ir->gb_algorithm == egbOBC))) &&
             getenv("GMX_NO_ALLVSALL") == nullptr
         );
 
@@ -1661,11 +1657,10 @@ static void pick_nbnxn_kernel_cpu(const t_inputrec gmx_unused    *ir,
          * Since table lookup's don't parallelize with SIMD, analytical
          * will probably always be faster for a SIMD width of 8 or more.
          * With FMA analytical is sometimes faster for a width if 4 as well.
-         * On BlueGene/Q, this is faster regardless of precision.
          * In single precision, this is faster on Bulldozer.
          */
 #if GMX_SIMD_REAL_WIDTH >= 8 || \
-        (GMX_SIMD_REAL_WIDTH >= 4 && GMX_SIMD_HAVE_FMA && !GMX_DOUBLE) || GMX_SIMD_IBM_QPX
+        (GMX_SIMD_REAL_WIDTH >= 4 && GMX_SIMD_HAVE_FMA && !GMX_DOUBLE)
         /* On AMD Zen, tabulated Ewald kernels are faster on all 4 combinations
          * of single or double precision and 128 or 256-bit AVX2.
          */
@@ -2276,25 +2271,6 @@ static void init_nb_verlet(const gmx::MDLogger     &mdlog,
                        cr->nodeid,
                        (nbv->ngrp > 1));
 
-        /* With tMPI + GPUs some ranks may be sharing GPU(s) and therefore
-         * also sharing texture references. To keep the code simple, we don't
-         * treat texture references as shared resources, but this means that
-         * the coulomb_tab and nbfp texture refs will get updated by multiple threads.
-         * Hence, to ensure that the non-bonded kernels don't start before all
-         * texture binding operations are finished, we need to wait for all ranks
-         * to arrive here before continuing.
-         *
-         * Note that we could omit this barrier if GPUs are not shared (or
-         * texture objects are used), but as this is initialization code, there
-         * is no point in complicating things.
-         */
-#if GMX_THREAD_MPI
-        if (PAR(cr))
-        {
-            gmx_barrier(cr);
-        }
-#endif  /* GMX_THREAD_MPI */
-
         if ((env = getenv("GMX_NB_MIN_CI")) != nullptr)
         {
             char *end;
@@ -2347,7 +2323,7 @@ void init_forcerec(FILE                    *fp,
                    gmx_bool                 bNoSolvOpt,
                    real                     print_force)
 {
-    int            i, m, negp_pp, negptable, egi, egj;
+    int            m, negp_pp, negptable, egi, egj;
     real           rtab;
     char          *env;
     double         dbl;
@@ -2492,7 +2468,6 @@ void init_forcerec(FILE                    *fp,
     /* Check if we can/should do all-vs-all kernels */
     fr->bAllvsAll       = can_use_allvsall(ir, FALSE, nullptr, nullptr);
     fr->AllvsAll_work   = nullptr;
-    fr->AllvsAll_workgb = nullptr;
 
     /* All-vs-all kernels have not been implemented in 4.6 and later.
      * See Redmine #1249. */
@@ -2527,20 +2502,6 @@ void init_forcerec(FILE                    *fp,
         {
             fprintf(fp, "\n%s\n", note);
         }
-
-        if (GMX_TARGET_BGQ)
-        {
-            GMX_LOG(mdlog.warning).asParagraph()
-                .appendText("There is no SIMD implementation of the group scheme kernels on "
-                            "BlueGene/Q. You will observe better performance from using the "
-                            "Verlet cut-off scheme.");
-        }
-    }
-    if (GMX_TARGET_BGQ)
-    {
-        GMX_LOG(mdlog.info).asParagraph().
-            appendText("The support for the BlueGene/Q platform is deprecated, and may be removed "
-                       "in a future version.");
     }
 
     /* Determine if we will do PBC for distances in bonded interactions */
@@ -2607,7 +2568,6 @@ void init_forcerec(FILE                    *fp,
             fr->bMolPBC = dd_bonded_molpbc(cr->dd, fr->ePBC);
         }
     }
-    fr->bGB = (ir->implicit_solvent == eisGBSA);
 
     fr->rc_scaling = ir->refcoord_scaling;
     copy_rvec(ir->posres_com, fr->posres_com);
@@ -2634,7 +2594,7 @@ void init_forcerec(FILE                    *fp,
     switch (ic->eeltype)
     {
         case eelCUT:
-            fr->nbkernel_elec_interaction = (fr->bGB) ? GMX_NBKERNEL_ELEC_GENERALIZEDBORN : GMX_NBKERNEL_ELEC_COULOMB;
+            fr->nbkernel_elec_interaction = GMX_NBKERNEL_ELEC_COULOMB;
             break;
 
         case eelRF:
@@ -2892,63 +2852,9 @@ void init_forcerec(FILE                    *fp,
         set_avcsixtwelve(fp, fr, mtop);
     }
 
-    fr->gb_epsilon_solvent = ir->gb_epsilon_solvent;
-
-    /* Copy the GBSA data (radius, volume and surftens for each
-     * atomtype) from the topology atomtype section to forcerec.
-     */
-    snew(fr->atype_radius, fr->ntype);
-    snew(fr->atype_vol, fr->ntype);
-    snew(fr->atype_surftens, fr->ntype);
-    snew(fr->atype_gb_radius, fr->ntype);
-    snew(fr->atype_S_hct, fr->ntype);
-
-    if (mtop->atomtypes.nr > 0)
-    {
-        for (i = 0; i < fr->ntype; i++)
-        {
-            fr->atype_radius[i] = mtop->atomtypes.radius[i];
-        }
-        for (i = 0; i < fr->ntype; i++)
-        {
-            fr->atype_vol[i] = mtop->atomtypes.vol[i];
-        }
-        for (i = 0; i < fr->ntype; i++)
-        {
-            fr->atype_surftens[i] = mtop->atomtypes.surftens[i];
-        }
-        for (i = 0; i < fr->ntype; i++)
-        {
-            fr->atype_gb_radius[i] = mtop->atomtypes.gb_radius[i];
-        }
-        for (i = 0; i < fr->ntype; i++)
-        {
-            fr->atype_S_hct[i] = mtop->atomtypes.S_hct[i];
-        }
-    }
-
-    /* Generate the GB table if needed */
-    if (fr->bGB)
+    if (ir->implicit_solvent)
     {
-        GMX_LOG(mdlog.info).asParagraph().
-            appendText("The support for implicit solvent is deprecated, and may be removed "
-                       "in a future version.");
-#if GMX_DOUBLE
-        fr->gbtabscale = 2000;
-#else
-        fr->gbtabscale = 500;
-#endif
-
-        fr->gbtabr = 100;
-        fr->gbtab  = make_gb_table(fr);
-
-        init_gb(&fr->born, fr, ir, mtop, ir->gb_algorithm);
-
-        /* Copy local gb data (for dd, this is done in dd_partition_system) */
-        if (!DOMAINDECOMP(cr))
-        {
-            make_local_gb(cr, fr->born, ir->gb_algorithm);
-        }
+        gmx_fatal(FARGS, "Implict solvation is no longer supported.");
     }
 
     /* Construct tables for the group scheme. A little unnecessary to
@@ -3198,7 +3104,8 @@ void init_forcerec(FILE                    *fp,
  * that it's not needed anymore (with a shared GPU run).
  */
 void free_gpu_resources(const t_forcerec        *fr,
-                        const t_commrec         *cr)
+                        const t_commrec         *cr,
+                        const gmx_multisim_t    *ms)
 {
     bool isPPrankUsingGPU = fr && fr->nbv && fr->nbv->bUseGPU;
 
@@ -3221,7 +3128,7 @@ void free_gpu_resources(const t_forcerec        *fr,
      * Note: it is safe to not call the barrier on the ranks which do not use GPU,
      * but it is easier and more futureproof to call it on the whole node.
      */
-    if (GMX_THREAD_MPI && (PAR(cr) || MULTISIM(cr)))
+    if (GMX_THREAD_MPI && (PAR(cr) || isMultiSim(ms)))
     {
         gmx_barrier_physical_node(cr);
     }
index 85a438335349e9e57c3812a35e168575171a8bd3..af7e5d77e8fbfeeeb188bdfd25e6907c682d6215 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -38,7 +38,6 @@
 #define GMX_MDLIB_FORCEREC_H
 
 #include "gromacs/mdlib/force_flags.h"
-#include "gromacs/mdlib/genborn.h"
 #include "gromacs/mdlib/tgroup.h"
 #include "gromacs/mdlib/vsite.h"
 #include "gromacs/mdtypes/forcerec.h"
@@ -49,6 +48,7 @@ struct gmx_hw_info_t;
 struct t_commrec;
 struct t_fcdata;
 struct t_filenm;
+struct t_inputrec;
 
 namespace gmx
 {
diff --git a/src/gromacs/mdlib/genborn.cpp b/src/gromacs/mdlib/genborn.cpp
deleted file mode 100644 (file)
index 7d9cc0f..0000000
+++ /dev/null
@@ -1,1713 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2008, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
- * and including many others, as listed in the AUTHORS file in the
- * top-level source directory and at http://www.gromacs.org.
- *
- * GROMACS is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * GROMACS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GROMACS; if not, see
- * http://www.gnu.org/licenses, or write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
- *
- * If you want to redistribute modifications to GROMACS, please
- * consider that scientific software is very special. Version
- * control is crucial - bugs must be traceable. We will be happy to
- * consider code for inclusion in the official distribution, but
- * derived work must not be called official GROMACS. Details are found
- * in the README & COPYING files - if they are missing, get the
- * official version at http://www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the research papers on the package. Check out http://www.gromacs.org.
- */
-
-#include "gmxpre.h"
-
-#include "genborn.h"
-
-#include <string.h>
-
-#include <cmath>
-
-#include <algorithm>
-
-#include "gromacs/domdec/domdec.h"
-#include "gromacs/domdec/domdec_struct.h"
-#include "gromacs/fileio/pdbio.h"
-#include "gromacs/gmxlib/network.h"
-#include "gromacs/gmxlib/nrnb.h"
-#include "gromacs/math/functions.h"
-#include "gromacs/math/units.h"
-#include "gromacs/math/vec.h"
-#include "gromacs/mdlib/genborn_allvsall.h"
-#include "gromacs/mdtypes/commrec.h"
-#include "gromacs/mdtypes/inputrec.h"
-#include "gromacs/mdtypes/md_enums.h"
-#include "gromacs/mdtypes/nblist.h"
-#include "gromacs/pbcutil/ishift.h"
-#include "gromacs/pbcutil/mshift.h"
-#include "gromacs/pbcutil/pbc.h"
-#include "gromacs/topology/mtop_util.h"
-#include "gromacs/utility/fatalerror.h"
-#include "gromacs/utility/gmxmpi.h"
-#include "gromacs/utility/smalloc.h"
-
-
-typedef struct {
-    int  shift;
-    int  naj;
-    int *aj;
-    int  aj_nalloc;
-} gbtmpnbl_t;
-
-typedef struct gbtmpnbls {
-    int         nlist;
-    gbtmpnbl_t *list;
-    int         list_nalloc;
-} t_gbtmpnbls;
-
-/* This function is exactly the same as the one in listed-forces/bonded.cpp. The reason
- * it is copied here is that the bonded gb-interactions are evaluated
- * not in calc_bonds, but rather in calc_gb_forces
- */
-static int pbc_rvec_sub(const t_pbc *pbc, const rvec xi, const rvec xj, rvec dx)
-{
-    if (pbc)
-    {
-        return pbc_dx_aiuc(pbc, xi, xj, dx);
-    }
-    else
-    {
-        rvec_sub(xi, xj, dx);
-        return CENTRAL;
-    }
-}
-
-static int init_gb_nblist(int natoms, t_nblist *nl)
-{
-    nl->maxnri      = natoms*4;
-    nl->maxnrj      = 0;
-    nl->nri         = 0;
-    nl->nrj         = 0;
-    nl->iinr        = nullptr;
-    nl->gid         = nullptr;
-    nl->shift       = nullptr;
-    nl->jindex      = nullptr;
-    nl->jjnr        = nullptr;
-    /*nl->nltype      = nltype;*/
-
-    srenew(nl->iinr,   nl->maxnri);
-    srenew(nl->gid,    nl->maxnri);
-    srenew(nl->shift,  nl->maxnri);
-    srenew(nl->jindex, nl->maxnri+1);
-
-    nl->jindex[0] = 0;
-
-    return 0;
-}
-
-
-static int init_gb_still(const t_atomtypes *atype, t_idef *idef, t_atoms *atoms,
-                         gmx_genborn_t *born, int natoms)
-{
-
-    int   i, j, m, ia, ib;
-    real  r, ri, rj, ri2, rj2, r3, r4, ratio, term, h, doffset;
-
-    real *vsol;
-    real *gp;
-
-    snew(vsol, natoms);
-    snew(gp, natoms);
-    snew(born->gpol_still_work, natoms+3);
-
-    doffset = born->gb_doffset;
-
-    for (i = 0; i < natoms; i++)
-    {
-        born->gpol_globalindex[i]              = born->vsolv_globalindex[i] =
-                born->gb_radius_globalindex[i] = 0;
-    }
-
-    /* Compute atomic solvation volumes for Still method */
-    for (i = 0; i < natoms; i++)
-    {
-        ri = atype->gb_radius[atoms->atom[i].type];
-        born->gb_radius_globalindex[i] = ri;
-        r3 = ri*ri*ri;
-        born->vsolv_globalindex[i] = (4*M_PI/3)*r3;
-    }
-
-    for (j = 0; j < idef->il[F_GB12].nr; j += 3)
-    {
-        m  = idef->il[F_GB12].iatoms[j];
-        ia = idef->il[F_GB12].iatoms[j+1];
-        ib = idef->il[F_GB12].iatoms[j+2];
-
-        r = 1.01*idef->iparams[m].gb.st;
-
-        ri   = atype->gb_radius[atoms->atom[ia].type];
-        rj   = atype->gb_radius[atoms->atom[ib].type];
-
-        ri2  = ri*ri;
-        rj2  = rj*rj;
-
-        ratio  = (rj2-ri2-r*r)/(2*ri*r);
-        h      = ri*(1+ratio);
-        term   = (M_PI/3.0)*h*h*(3.0*ri-h);
-
-        born->vsolv_globalindex[ia] -= term;
-
-        ratio  = (ri2-rj2-r*r)/(2*rj*r);
-        h      = rj*(1+ratio);
-        term   = (M_PI/3.0)*h*h*(3.0*rj-h);
-
-        born->vsolv_globalindex[ib] -= term;
-    }
-
-    /* Get the self-, 1-2 and 1-3 polarization energies for analytical Still
-       method */
-    /* Self */
-    for (j = 0; j < natoms; j++)
-    {
-        if (born->use_globalindex[j] == 1)
-        {
-            born->gpol_globalindex[j] = -0.5*ONE_4PI_EPS0/
-                (atype->gb_radius[atoms->atom[j].type]-doffset+STILL_P1);
-        }
-    }
-
-    /* 1-2 */
-    for (j = 0; j < idef->il[F_GB12].nr; j += 3)
-    {
-        m  = idef->il[F_GB12].iatoms[j];
-        ia = idef->il[F_GB12].iatoms[j+1];
-        ib = idef->il[F_GB12].iatoms[j+2];
-
-        r = idef->iparams[m].gb.st;
-
-        r4 = r*r*r*r;
-
-        born->gpol_globalindex[ia] = born->gpol_globalindex[ia]+
-            STILL_P2*born->vsolv_globalindex[ib]/r4;
-        born->gpol_globalindex[ib] = born->gpol_globalindex[ib]+
-            STILL_P2*born->vsolv_globalindex[ia]/r4;
-    }
-
-    /* 1-3 */
-    for (j = 0; j < idef->il[F_GB13].nr; j += 3)
-    {
-        m  = idef->il[F_GB13].iatoms[j];
-        ia = idef->il[F_GB13].iatoms[j+1];
-        ib = idef->il[F_GB13].iatoms[j+2];
-
-        r  = idef->iparams[m].gb.st;
-        r4 = r*r*r*r;
-
-        born->gpol_globalindex[ia] = born->gpol_globalindex[ia]+
-            STILL_P3*born->vsolv_globalindex[ib]/r4;
-        born->gpol_globalindex[ib] = born->gpol_globalindex[ib]+
-            STILL_P3*born->vsolv_globalindex[ia]/r4;
-    }
-
-    sfree(vsol);
-    sfree(gp);
-
-    return 0;
-}
-
-/* Initialize all GB datastructs and compute polarization energies */
-int init_gb(gmx_genborn_t **p_born,
-            t_forcerec *fr, const t_inputrec *ir,
-            const gmx_mtop_t *mtop, int gb_algorithm)
-{
-    int             i, jj, natoms;
-    real            rai, sk, doffset;
-
-    t_atoms         atoms;
-    gmx_genborn_t  *born;
-    gmx_localtop_t *localtop;
-
-    natoms   = mtop->natoms;
-
-    atoms    = gmx_mtop_global_atoms(mtop);
-    localtop = gmx_mtop_generate_local_top(mtop, ir->efep != efepNO);
-
-    snew(born, 1);
-    *p_born = born;
-
-    born->nr  = natoms;
-
-    snew(born->drobc, natoms);
-    snew(born->bRad,  natoms);
-
-    /* Allocate memory for the global data arrays */
-    snew(born->param_globalindex, natoms+3);
-    snew(born->gpol_globalindex,  natoms+3);
-    snew(born->vsolv_globalindex, natoms+3);
-    snew(born->gb_radius_globalindex, natoms+3);
-    snew(born->use_globalindex,    natoms+3);
-
-    snew(fr->invsqrta, natoms);
-    snew(fr->dvda,     natoms);
-
-    fr->dadx              = nullptr;
-    fr->dadx_rawptr       = nullptr;
-    fr->nalloc_dadx       = 0;
-    born->gpol_still_work = nullptr;
-    born->gpol_hct_work   = nullptr;
-
-    /* snew(born->asurf,natoms); */
-    /* snew(born->dasurf,natoms); */
-
-    /* Initialize the gb neighbourlist */
-    snew(fr->gblist, 1);
-    init_gb_nblist(natoms, fr->gblist);
-
-    /* Do the Vsites exclusions (if any) */
-    for (i = 0; i < natoms; i++)
-    {
-        jj = atoms.atom[i].type;
-        if (mtop->atomtypes.gb_radius[atoms.atom[i].type] > 0)
-        {
-            born->use_globalindex[i] = 1;
-        }
-        else
-        {
-            born->use_globalindex[i] = 0;
-        }
-
-        /* If we have a Vsite, put vs_globalindex[i]=0 */
-        if (C6 (fr->nbfp, fr->ntype, jj, jj) == 0 &&
-            C12(fr->nbfp, fr->ntype, jj, jj) == 0 &&
-            atoms.atom[i].q == 0)
-        {
-            born->use_globalindex[i] = 0;
-        }
-    }
-
-    /* Copy algorithm parameters from inputrecord to local structure */
-    born->obc_alpha          = ir->gb_obc_alpha;
-    born->obc_beta           = ir->gb_obc_beta;
-    born->obc_gamma          = ir->gb_obc_gamma;
-    born->gb_doffset         = ir->gb_dielectric_offset;
-    born->gb_epsilon_solvent = ir->gb_epsilon_solvent;
-    born->epsilon_r          = ir->epsilon_r;
-
-    doffset = born->gb_doffset;
-
-    /* Set the surface tension */
-    born->sa_surface_tension = ir->sa_surface_tension;
-
-    /* If Still model, initialise the polarisation energies */
-    if (gb_algorithm == egbSTILL)
-    {
-        init_gb_still(&(mtop->atomtypes), &(localtop->idef), &atoms,
-                      born, natoms);
-    }
-
-
-    /* If HCT/OBC,  precalculate the sk*atype->S_hct factors */
-    else if (gb_algorithm == egbHCT || gb_algorithm == egbOBC)
-    {
-
-        snew(born->gpol_hct_work, natoms+3);
-
-        for (i = 0; i < natoms; i++)
-        {
-            if (born->use_globalindex[i] == 1)
-            {
-                rai = mtop->atomtypes.gb_radius[atoms.atom[i].type]-doffset;
-                sk  = rai * mtop->atomtypes.S_hct[atoms.atom[i].type];
-                born->param_globalindex[i]     = sk;
-                born->gb_radius_globalindex[i] = rai;
-            }
-            else
-            {
-                born->param_globalindex[i]     = 0;
-                born->gb_radius_globalindex[i] = 0;
-            }
-        }
-    }
-
-    /* Allocate memory for work arrays for temporary use */
-    snew(born->work, natoms+4);
-    snew(born->count, natoms);
-    snew(born->nblist_work, natoms);
-
-    /* Domain decomposition specific stuff */
-    born->nalloc = 0;
-
-    return 0;
-}
-
-
-
-static int
-calc_gb_rad_still(t_commrec *cr, t_forcerec *fr, gmx_localtop_t *top,
-                  rvec x[], t_nblist *nl,
-                  gmx_genborn_t *born, t_mdatoms *md)
-{
-    int  i, k, n, nj0, nj1, ai, aj;
-    int  shift;
-    real shX, shY, shZ;
-    real gpi, dr2, idr4, rvdw, ratio, ccf, theta, term, rai, raj;
-    real ix1, iy1, iz1, jx1, jy1, jz1, dx11, dy11, dz11;
-    real rinv, idr2, idr6, vaj, dccf, cosq, sinq, prod, gpi2;
-    real factor;
-    real vai, prod_ai, icf4, icf6;
-
-    factor  = 0.5*ONE_4PI_EPS0;
-    n       = 0;
-
-    for (i = 0; i < born->nr; i++)
-    {
-        born->gpol_still_work[i] = 0;
-    }
-
-    for (i = 0; i < nl->nri; i++)
-    {
-        ai      = nl->iinr[i];
-
-        nj0     = nl->jindex[i];
-        nj1     = nl->jindex[i+1];
-
-        /* Load shifts for this list */
-        shift   = nl->shift[i];
-        shX     = fr->shift_vec[shift][0];
-        shY     = fr->shift_vec[shift][1];
-        shZ     = fr->shift_vec[shift][2];
-
-        gpi     = 0;
-
-        rai     = top->atomtypes.gb_radius[md->typeA[ai]];
-        vai     = born->vsolv[ai];
-        prod_ai = STILL_P4*vai;
-
-        /* Load atom i coordinates, add shift vectors */
-        ix1     = shX + x[ai][0];
-        iy1     = shY + x[ai][1];
-        iz1     = shZ + x[ai][2];
-
-        for (k = nj0; k < nj1 && nl->jjnr[k] >= 0; k++)
-        {
-            aj    = nl->jjnr[k];
-            jx1   = x[aj][0];
-            jy1   = x[aj][1];
-            jz1   = x[aj][2];
-
-            dx11  = ix1-jx1;
-            dy11  = iy1-jy1;
-            dz11  = iz1-jz1;
-
-            dr2   = dx11*dx11+dy11*dy11+dz11*dz11;
-            rinv  = gmx::invsqrt(dr2);
-            idr2  = rinv*rinv;
-            idr4  = idr2*idr2;
-            idr6  = idr4*idr2;
-
-            raj = top->atomtypes.gb_radius[md->typeA[aj]];
-
-            rvdw  = rai + raj;
-
-            ratio = dr2 / (rvdw * rvdw);
-            vaj   = born->vsolv[aj];
-
-            if (ratio > STILL_P5INV)
-            {
-                ccf  = 1.0;
-                dccf = 0.0;
-            }
-            else
-            {
-                theta = ratio*STILL_PIP5;
-                cosq  = cos(theta);
-                term  = 0.5*(1.0-cosq);
-                ccf   = term*term;
-                sinq  = 1.0 - cosq*cosq;
-                dccf  = 2.0*term*sinq*gmx::invsqrt(sinq)*theta;
-            }
-
-            prod                       = STILL_P4*vaj;
-            icf4                       = ccf*idr4;
-            icf6                       = (4*ccf-dccf)*idr6;
-            born->gpol_still_work[aj] += prod_ai*icf4;
-            gpi                        = gpi+prod*icf4;
-
-            /* Save ai->aj and aj->ai chain rule terms */
-            fr->dadx[n++]   = prod*icf6;
-            fr->dadx[n++]   = prod_ai*icf6;
-        }
-        born->gpol_still_work[ai] += gpi;
-    }
-
-    /* Parallel summations */
-    if (DOMAINDECOMP(cr))
-    {
-        dd_atom_sum_real(cr->dd, born->gpol_still_work);
-    }
-
-    /* Calculate the radii */
-    for (i = 0; i < fr->natoms_force; i++) /* PELA born->nr */
-    {
-        if (born->use[i] != 0)
-        {
-            gpi             = born->gpol[i]+born->gpol_still_work[i];
-            gpi2            = gpi * gpi;
-            born->bRad[i]   = factor*gmx::invsqrt(gpi2);
-            fr->invsqrta[i] = gmx::invsqrt(born->bRad[i]);
-        }
-    }
-
-    /* Extra communication required for DD */
-    if (DOMAINDECOMP(cr))
-    {
-        dd_atom_spread_real(cr->dd, born->bRad);
-        dd_atom_spread_real(cr->dd, fr->invsqrta);
-    }
-
-    return 0;
-
-}
-
-
-static int
-calc_gb_rad_hct(t_commrec *cr, t_forcerec *fr, gmx_localtop_t *top,
-                rvec x[], t_nblist *nl,
-                gmx_genborn_t *born, t_mdatoms *md)
-{
-    int   i, k, n, ai, aj, nj0, nj1;
-    int   shift;
-    real  shX, shY, shZ;
-    real  rai, raj, dr2, dr, sk, sk_ai, sk2, sk2_ai, lij, uij, diff2, tmp, sum_ai;
-    real  rad, min_rad, rinv, rai_inv;
-    real  ix1, iy1, iz1, jx1, jy1, jz1, dx11, dy11, dz11;
-    real  lij2, uij2, lij3, uij3, t1, t2, t3;
-    real  lij_inv, dlij, sk2_rinv, prod, log_term;
-    real  doffset, raj_inv, dadx_val;
-    real *gb_radius;
-
-    doffset   = born->gb_doffset;
-    gb_radius = born->gb_radius;
-
-    for (i = 0; i < born->nr; i++)
-    {
-        born->gpol_hct_work[i] = 0;
-    }
-
-    /* Keep the compiler happy */
-    n    = 0;
-
-    for (i = 0; i < nl->nri; i++)
-    {
-        ai     = nl->iinr[i];
-
-        nj0    = nl->jindex[i];
-        nj1    = nl->jindex[i+1];
-
-        /* Load shifts for this list */
-        shift   = nl->shift[i];
-        shX     = fr->shift_vec[shift][0];
-        shY     = fr->shift_vec[shift][1];
-        shZ     = fr->shift_vec[shift][2];
-
-        rai     = gb_radius[ai];
-        rai_inv = 1.0/rai;
-
-        sk_ai   = born->param[ai];
-        sk2_ai  = sk_ai*sk_ai;
-
-        /* Load atom i coordinates, add shift vectors */
-        ix1     = shX + x[ai][0];
-        iy1     = shY + x[ai][1];
-        iz1     = shZ + x[ai][2];
-
-        sum_ai  = 0;
-
-        for (k = nj0; k < nj1 && nl->jjnr[k] >= 0; k++)
-        {
-            aj    = nl->jjnr[k];
-
-            jx1   = x[aj][0];
-            jy1   = x[aj][1];
-            jz1   = x[aj][2];
-
-            dx11  = ix1 - jx1;
-            dy11  = iy1 - jy1;
-            dz11  = iz1 - jz1;
-
-            dr2   = dx11*dx11+dy11*dy11+dz11*dz11;
-            rinv  = gmx::invsqrt(dr2);
-            dr    = rinv*dr2;
-
-            sk    = born->param[aj];
-            raj   = gb_radius[aj];
-
-            /* aj -> ai interaction */
-            if (rai < dr+sk)
-            {
-                lij     = 1.0/(dr-sk);
-                dlij    = 1.0;
-
-                if (rai > dr-sk)
-                {
-                    lij  = rai_inv;
-                    dlij = 0.0;
-                }
-
-                lij2     = lij*lij;
-                lij3     = lij2*lij;
-
-                uij      = 1.0/(dr+sk);
-                uij2     = uij*uij;
-                uij3     = uij2*uij;
-
-                diff2    = uij2-lij2;
-
-                lij_inv  = gmx::invsqrt(lij2);
-                sk2      = sk*sk;
-                sk2_rinv = sk2*rinv;
-                prod     = 0.25*sk2_rinv;
-
-                log_term = std::log(uij*lij_inv);
-
-                tmp      = lij-uij + 0.25*dr*diff2 + (0.5*rinv)*log_term +
-                    prod*(-diff2);
-
-                if (rai < sk-dr)
-                {
-                    tmp = tmp + 2.0 * (rai_inv-lij);
-                }
-
-                t1 = 0.5*lij2 + prod*lij3 - 0.25*(lij*rinv+lij3*dr);
-                t2 = -0.5*uij2 - 0.25*sk2_rinv*uij3 + 0.25*(uij*rinv+uij3*dr);
-                t3 = 0.125*(1.0+sk2_rinv*rinv)*(-diff2)+0.25*log_term*rinv*rinv;
-
-                dadx_val = (dlij*t1+t2+t3)*rinv; /* rb2 is moved to chainrule */
-                /* fr->dadx[n++] = (dlij*t1+duij*t2+t3)*rinv; */
-                /* rb2 is moved to chainrule    */
-
-                sum_ai += 0.5*tmp;
-            }
-            else
-            {
-                dadx_val = 0.0;
-            }
-            fr->dadx[n++] = dadx_val;
-
-
-            /* ai -> aj interaction */
-            if (raj < dr + sk_ai)
-            {
-                lij     = 1.0/(dr-sk_ai);
-                dlij    = 1.0;
-                raj_inv = 1.0/raj;
-
-                if (raj > dr-sk_ai)
-                {
-                    lij  = raj_inv;
-                    dlij = 0.0;
-                }
-
-                lij2     = lij  * lij;
-                lij3     = lij2 * lij;
-
-                uij      = 1.0/(dr+sk_ai);
-                uij2     = uij  * uij;
-                uij3     = uij2 * uij;
-
-                diff2    = uij2-lij2;
-
-                lij_inv  = gmx::invsqrt(lij2);
-                sk2      =  sk2_ai; /* sk2_ai = sk_ai * sk_ai in i loop above */
-                sk2_rinv = sk2*rinv;
-                prod     = 0.25 * sk2_rinv;
-
-                /* log_term = table_log(uij*lij_inv,born->log_table,
-                   LOG_TABLE_ACCURACY); */
-                log_term = std::log(uij*lij_inv);
-
-                tmp      = lij-uij + 0.25*dr*diff2 + (0.5*rinv)*log_term +
-                    prod*(-diff2);
-
-                if (raj < sk_ai-dr)
-                {
-                    tmp     = tmp + 2.0 * (raj_inv-lij);
-                }
-
-                /* duij = 1.0 */
-                t1      = 0.5*lij2 + prod*lij3 - 0.25*(lij*rinv+lij3*dr);
-                t2      = -0.5*uij2 - 0.25*sk2_rinv*uij3 + 0.25*(uij*rinv+uij3*dr);
-                t3      = 0.125*(1.0+sk2_rinv*rinv)*(-diff2)+0.25*log_term*rinv*rinv;
-
-                dadx_val = (dlij*t1+t2+t3)*rinv; /* rb2 is moved to chainrule    */
-                /* fr->dadx[n++] = (dlij*t1+duij*t2+t3)*rinv; */ /* rb2 is moved to chainrule    */
-
-                born->gpol_hct_work[aj] += 0.5*tmp;
-            }
-            else
-            {
-                dadx_val = 0.0;
-            }
-            fr->dadx[n++] = dadx_val;
-        }
-
-        born->gpol_hct_work[ai] += sum_ai;
-    }
-
-    /* Parallel summations */
-    if (DOMAINDECOMP(cr))
-    {
-        dd_atom_sum_real(cr->dd, born->gpol_hct_work);
-    }
-
-    for (i = 0; i < fr->natoms_force; i++) /* PELA born->nr */
-    {
-        if (born->use[i] != 0)
-        {
-            rai     = top->atomtypes.gb_radius[md->typeA[i]]-doffset;
-            sum_ai  = 1.0/rai - born->gpol_hct_work[i];
-            min_rad = rai + doffset;
-            rad     = 1.0/sum_ai;
-
-            born->bRad[i]   = std::max(rad, min_rad);
-            fr->invsqrta[i] = gmx::invsqrt(born->bRad[i]);
-        }
-    }
-
-    /* Extra communication required for DD */
-    if (DOMAINDECOMP(cr))
-    {
-        dd_atom_spread_real(cr->dd, born->bRad);
-        dd_atom_spread_real(cr->dd, fr->invsqrta);
-    }
-
-
-    return 0;
-}
-
-static int
-calc_gb_rad_obc(t_commrec *cr, t_forcerec *fr, gmx_localtop_t *top,
-                rvec x[], t_nblist *nl, gmx_genborn_t *born, t_mdatoms *md)
-{
-    int   i, k, ai, aj, nj0, nj1, n;
-    int   shift;
-    real  shX, shY, shZ;
-    real  rai, raj, dr2, dr, sk, sk2, lij, uij, diff2, tmp, sum_ai;
-    real  sum_ai2, sum_ai3, tsum, tchain, rinv, rai_inv, lij_inv, rai_inv2;
-    real  log_term, prod, sk2_rinv, sk_ai, sk2_ai;
-    real  ix1, iy1, iz1, jx1, jy1, jz1, dx11, dy11, dz11;
-    real  lij2, uij2, lij3, uij3, dlij, t1, t2, t3;
-    real  doffset, raj_inv, dadx_val;
-    real *gb_radius;
-
-    /* Keep the compiler happy */
-    n    = 0;
-
-    doffset   = born->gb_doffset;
-    gb_radius = born->gb_radius;
-
-    for (i = 0; i < born->nr; i++)
-    {
-        born->gpol_hct_work[i] = 0;
-    }
-
-    for (i = 0; i < nl->nri; i++)
-    {
-        ai      = nl->iinr[i];
-
-        nj0     = nl->jindex[i];
-        nj1     = nl->jindex[i+1];
-
-        /* Load shifts for this list */
-        shift   = nl->shift[i];
-        shX     = fr->shift_vec[shift][0];
-        shY     = fr->shift_vec[shift][1];
-        shZ     = fr->shift_vec[shift][2];
-
-        rai      = gb_radius[ai];
-        rai_inv  = 1.0/rai;
-
-        sk_ai    = born->param[ai];
-        sk2_ai   = sk_ai*sk_ai;
-
-        /* Load atom i coordinates, add shift vectors */
-        ix1      = shX + x[ai][0];
-        iy1      = shY + x[ai][1];
-        iz1      = shZ + x[ai][2];
-
-        sum_ai   = 0;
-
-        for (k = nj0; k < nj1 && nl->jjnr[k] >= 0; k++)
-        {
-            aj    = nl->jjnr[k];
-
-            jx1   = x[aj][0];
-            jy1   = x[aj][1];
-            jz1   = x[aj][2];
-
-            dx11  = ix1 - jx1;
-            dy11  = iy1 - jy1;
-            dz11  = iz1 - jz1;
-
-            dr2   = dx11*dx11+dy11*dy11+dz11*dz11;
-            rinv  = gmx::invsqrt(dr2);
-            dr    = dr2*rinv;
-
-            /* sk is precalculated in init_gb() */
-            sk    = born->param[aj];
-            raj   = gb_radius[aj];
-
-            /* aj -> ai interaction */
-            if (rai < dr+sk)
-            {
-                lij       = 1.0/(dr-sk);
-                dlij      = 1.0;
-
-                if (rai > dr-sk)
-                {
-                    lij  = rai_inv;
-                    dlij = 0.0;
-                }
-
-                uij      = 1.0/(dr+sk);
-                lij2     = lij  * lij;
-                lij3     = lij2 * lij;
-                uij2     = uij  * uij;
-                uij3     = uij2 * uij;
-
-                diff2    = uij2-lij2;
-
-                lij_inv  = gmx::invsqrt(lij2);
-                sk2      = sk*sk;
-                sk2_rinv = sk2*rinv;
-                prod     = 0.25*sk2_rinv;
-
-                log_term = std::log(uij*lij_inv);
-
-                tmp      = lij-uij + 0.25*dr*diff2 + (0.5*rinv)*log_term + prod*(-diff2);
-
-                if (rai < sk-dr)
-                {
-                    tmp = tmp + 2.0 * (rai_inv-lij);
-                }
-
-                /* duij    = 1.0; */
-                t1      = 0.5*lij2 + prod*lij3 - 0.25*(lij*rinv+lij3*dr);
-                t2      = -0.5*uij2 - 0.25*sk2_rinv*uij3 + 0.25*(uij*rinv+uij3*dr);
-                t3      = 0.125*(1.0+sk2_rinv*rinv)*(-diff2)+0.25*log_term*rinv*rinv;
-
-                dadx_val = (dlij*t1+t2+t3)*rinv; /* rb2 is moved to chainrule    */
-
-                sum_ai += 0.5*tmp;
-            }
-            else
-            {
-                dadx_val = 0.0;
-            }
-            fr->dadx[n++] = dadx_val;
-
-            /* ai -> aj interaction */
-            if (raj < dr + sk_ai)
-            {
-                lij     = 1.0/(dr-sk_ai);
-                dlij    = 1.0;
-                raj_inv = 1.0/raj;
-
-                if (raj > dr-sk_ai)
-                {
-                    lij  = raj_inv;
-                    dlij = 0.0;
-                }
-
-                lij2     = lij  * lij;
-                lij3     = lij2 * lij;
-
-                uij      = 1.0/(dr+sk_ai);
-                uij2     = uij  * uij;
-                uij3     = uij2 * uij;
-
-                diff2    = uij2-lij2;
-
-                lij_inv  = gmx::invsqrt(lij2);
-                sk2      =  sk2_ai; /* sk2_ai = sk_ai * sk_ai in i loop above */
-                sk2_rinv = sk2*rinv;
-                prod     = 0.25 * sk2_rinv;
-
-                /* log_term = table_log(uij*lij_inv,born->log_table,LOG_TABLE_ACCURACY); */
-                log_term = std::log(uij*lij_inv);
-
-                tmp      = lij-uij + 0.25*dr*diff2 + (0.5*rinv)*log_term + prod*(-diff2);
-
-                if (raj < sk_ai-dr)
-                {
-                    tmp     = tmp + 2.0 * (raj_inv-lij);
-                }
-
-                t1      = 0.5*lij2 + prod*lij3 - 0.25*(lij*rinv+lij3*dr);
-                t2      = -0.5*uij2 - 0.25*sk2_rinv*uij3 + 0.25*(uij*rinv+uij3*dr);
-                t3      = 0.125*(1.0+sk2_rinv*rinv)*(-diff2)+0.25*log_term*rinv*rinv;
-
-                dadx_val = (dlij*t1+t2+t3)*rinv; /* rb2 is moved to chainrule    */
-
-                born->gpol_hct_work[aj] += 0.5*tmp;
-
-            }
-            else
-            {
-                dadx_val = 0.0;
-            }
-            fr->dadx[n++] = dadx_val;
-
-        }
-        born->gpol_hct_work[ai] += sum_ai;
-
-    }
-
-    /* Parallel summations */
-    if (DOMAINDECOMP(cr))
-    {
-        dd_atom_sum_real(cr->dd, born->gpol_hct_work);
-    }
-
-    for (i = 0; i < fr->natoms_force; i++) /* PELA born->nr */
-    {
-        if (born->use[i] != 0)
-        {
-            rai        = top->atomtypes.gb_radius[md->typeA[i]];
-            rai_inv2   = 1.0/rai;
-            rai        = rai-doffset;
-            rai_inv    = 1.0/rai;
-            sum_ai     = rai * born->gpol_hct_work[i];
-            sum_ai2    = sum_ai  * sum_ai;
-            sum_ai3    = sum_ai2 * sum_ai;
-
-            tsum          = tanh(born->obc_alpha*sum_ai-born->obc_beta*sum_ai2+born->obc_gamma*sum_ai3);
-            born->bRad[i] = rai_inv - tsum*rai_inv2;
-            born->bRad[i] = 1.0 / born->bRad[i];
-
-            fr->invsqrta[i] = gmx::invsqrt(born->bRad[i]);
-
-            tchain         = rai * (born->obc_alpha-2*born->obc_beta*sum_ai+3*born->obc_gamma*sum_ai2);
-            born->drobc[i] = (1.0-tsum*tsum)*tchain*rai_inv2;
-        }
-    }
-
-    /* Extra (local) communication required for DD */
-    if (DOMAINDECOMP(cr))
-    {
-        dd_atom_spread_real(cr->dd, born->bRad);
-        dd_atom_spread_real(cr->dd, fr->invsqrta);
-        dd_atom_spread_real(cr->dd, born->drobc);
-    }
-
-    return 0;
-
-}
-
-
-
-int calc_gb_rad(t_commrec *cr, t_forcerec *fr, t_inputrec *ir, gmx_localtop_t *top,
-                rvec x[], t_nblist *nl, gmx_genborn_t *born, t_mdatoms *md, t_nrnb     *nrnb)
-{
-    int   cnt;
-    int   ndadx;
-
-    if (fr->bAllvsAll && fr->dadx == nullptr)
-    {
-        /* We might need up to 8 atoms of padding before and after,
-         * and another 4 units to guarantee SSE alignment.
-         */
-        fr->nalloc_dadx = 2*(md->homenr+12)*(md->nr/2+1+12);
-        snew(fr->dadx_rawptr, fr->nalloc_dadx);
-        fr->dadx = (real *) (((size_t) fr->dadx_rawptr + 16) & (~((size_t) 15)));
-    }
-    else
-    {
-        /* In the SSE-enabled gb-loops, when writing to dadx, we
-         * always write 2*4 elements at a time, even in the case with only
-         * 1-3 j particles, where we only really need to write 2*(1-3)
-         * elements. This is because we want dadx to be aligned to a 16-
-         * byte boundary, and being able to use _mm_store/load_ps
-         */
-        ndadx = 2 * (nl->nrj + 3*nl->nri);
-
-        /* First, reallocate the dadx array, we need 3 extra for SSE */
-        if (ndadx + 3 > fr->nalloc_dadx)
-        {
-            fr->nalloc_dadx = over_alloc_large(ndadx) + 3;
-            srenew(fr->dadx_rawptr, fr->nalloc_dadx);
-            fr->dadx = (real *) (((size_t) fr->dadx_rawptr + 16) & (~((size_t) 15)));
-        }
-    }
-
-    if (fr->bAllvsAll)
-    {
-        cnt = md->homenr*(md->nr/2+1);
-
-        if (ir->gb_algorithm == egbSTILL)
-        {
-            genborn_allvsall_calc_still_radii(fr, md, born, top, x[0], &fr->AllvsAll_workgb);
-            /* 13 flops in outer loop, 47 flops in inner loop */
-            inc_nrnb(nrnb, eNR_BORN_AVA_RADII_STILL, md->homenr*13+cnt*47);
-        }
-        else if (ir->gb_algorithm == egbHCT || ir->gb_algorithm == egbOBC)
-        {
-            genborn_allvsall_calc_hct_obc_radii(fr, md, born, ir->gb_algorithm, top, x[0], &fr->AllvsAll_workgb);
-            /* 24 flops in outer loop, 183 in inner */
-            inc_nrnb(nrnb, eNR_BORN_AVA_RADII_HCT_OBC, md->homenr*24+cnt*183);
-        }
-        else
-        {
-            gmx_fatal(FARGS, "Bad gb algorithm for all-vs-all interactions");
-        }
-        return 0;
-    }
-
-    /* Switch for determining which algorithm to use for Born radii calculation */
-#if GMX_DOUBLE
-
-    switch (ir->gb_algorithm)
-    {
-        case egbSTILL:
-            calc_gb_rad_still(cr, fr, top, x, nl, born, md);
-            break;
-        case egbHCT:
-            calc_gb_rad_hct(cr, fr, top, x, nl, born, md);
-            break;
-        case egbOBC:
-            calc_gb_rad_obc(cr, fr, top, x, nl, born, md);
-            break;
-
-        default:
-            gmx_fatal(FARGS, "Unknown double precision algorithm for Born radii calculation: %d", ir->gb_algorithm);
-    }
-
-#else
-
-    switch (ir->gb_algorithm)
-    {
-        case egbSTILL:
-            calc_gb_rad_still(cr, fr, top, x, nl, born, md);
-            break;
-        case egbHCT:
-            calc_gb_rad_hct(cr, fr, top, x, nl, born, md);
-            break;
-        case egbOBC:
-            calc_gb_rad_obc(cr, fr, top, x, nl, born, md);
-            break;
-
-        default:
-            gmx_fatal(FARGS, "Unknown algorithm for Born radii calculation: %d", ir->gb_algorithm);
-    }
-
-#endif /* Double or single precision */
-
-    if (fr->bAllvsAll == FALSE)
-    {
-        switch (ir->gb_algorithm)
-        {
-            case egbSTILL:
-                /* 17 flops per outer loop iteration, 47 flops per inner loop */
-                inc_nrnb(nrnb, eNR_BORN_RADII_STILL, nl->nri*17+nl->nrj*47);
-                break;
-            case egbHCT:
-            case egbOBC:
-                /* 61 (assuming 10 for tanh) flops for outer loop iteration, 183 flops per inner loop */
-                inc_nrnb(nrnb, eNR_BORN_RADII_HCT_OBC, nl->nri*61+nl->nrj*183);
-                break;
-
-            default:
-                break;
-        }
-    }
-
-    return 0;
-}
-
-
-
-real gb_bonds_tab(rvec x[], rvec f[], rvec fshift[], real *charge, real *p_gbtabscale,
-                  real *invsqrta, real *dvda, real *GBtab, t_idef *idef, real epsilon_r,
-                  real gb_epsilon_solvent, real facel, const t_pbc *pbc, const t_graph *graph)
-{
-    int      i, j, n0, m, nnn, ai, aj;
-    int      ki;
-
-    real     isai, isaj;
-    real     r, rsq11;
-    real     rinv11, iq;
-    real     isaprod, qq, gbscale, gbtabscale, Y, F, Geps, Heps2, Fp, VV, FF, rt, eps, eps2;
-    real     vgb, fgb, fijC, dvdatmp, fscal;
-    real     vctot;
-
-    rvec     dx;
-    ivec     dt;
-
-    t_iatom *forceatoms;
-
-    /* Scale the electrostatics by gb_epsilon_solvent */
-    facel = facel * ((1.0/epsilon_r) - 1.0/gb_epsilon_solvent);
-
-    gbtabscale = *p_gbtabscale;
-    vctot      = 0.0;
-
-    for (j = F_GB12; j <= F_GB14; j++)
-    {
-        forceatoms = idef->il[j].iatoms;
-
-        for (i = 0; i < idef->il[j].nr; )
-        {
-            /* To avoid reading in the interaction type, we just increment i to pass over
-             * the types in the forceatoms array, this saves some memory accesses
-             */
-            i++;
-            ai            = forceatoms[i++];
-            aj            = forceatoms[i++];
-
-            ki            = pbc_rvec_sub(pbc, x[ai], x[aj], dx);
-            rsq11         = iprod(dx, dx);
-
-            isai          = invsqrta[ai];
-            iq            = (-1)*facel*charge[ai];
-
-            rinv11        = gmx::invsqrt(rsq11);
-            isaj          = invsqrta[aj];
-            isaprod       = isai*isaj;
-            qq            = isaprod*iq*charge[aj];
-            gbscale       = isaprod*gbtabscale;
-            r             = rsq11*rinv11;
-            rt            = r*gbscale;
-            n0            = static_cast<int>(rt);
-            eps           = rt-n0;
-            eps2          = eps*eps;
-            nnn           = 4*n0;
-            Y             = GBtab[nnn];
-            F             = GBtab[nnn+1];
-            Geps          = eps*GBtab[nnn+2];
-            Heps2         = eps2*GBtab[nnn+3];
-            Fp            = F+Geps+Heps2;
-            VV            = Y+eps*Fp;
-            FF            = Fp+Geps+2.0*Heps2;
-            vgb           = qq*VV;
-            fijC          = qq*FF*gbscale;
-            dvdatmp       = -(vgb+fijC*r)*0.5;
-            dvda[aj]      = dvda[aj] + dvdatmp*isaj*isaj;
-            dvda[ai]      = dvda[ai] + dvdatmp*isai*isai;
-            vctot         = vctot + vgb;
-            fgb           = -(fijC)*rinv11;
-
-            if (graph)
-            {
-                ivec_sub(SHIFT_IVEC(graph, ai), SHIFT_IVEC(graph, aj), dt);
-                ki = IVEC2IS(dt);
-            }
-
-            for (m = 0; (m < DIM); m++)             /*  15             */
-            {
-                fscal               = fgb*dx[m];
-                f[ai][m]           += fscal;
-                f[aj][m]           -= fscal;
-                fshift[ki][m]      += fscal;
-                fshift[CENTRAL][m] -= fscal;
-            }
-        }
-    }
-
-    return vctot;
-}
-
-static real calc_gb_selfcorrections(t_commrec *cr, int natoms,
-                                    real *charge, gmx_genborn_t *born, real *dvda, double facel)
-{
-    int  i, ai, at0, at1;
-    real rai, e, derb, q, q2, fi, rai_inv, vtot;
-
-    if (DOMAINDECOMP(cr))
-    {
-        at0 = 0;
-        at1 = cr->dd->nat_home;
-    }
-    else
-    {
-        at0 = 0;
-        at1 = natoms;
-
-    }
-
-    /* Scale the electrostatics by gb_epsilon_solvent */
-    facel = facel * ((1.0/born->epsilon_r) - 1.0/born->gb_epsilon_solvent);
-
-    vtot = 0.0;
-
-    /* Apply self corrections */
-    for (i = at0; i < at1; i++)
-    {
-        ai       = i;
-
-        if (born->use[ai] == 1)
-        {
-            rai       = born->bRad[ai];
-            rai_inv   = 1.0/rai;
-            q         = charge[ai];
-            q2        = q*q;
-            fi        = facel*q2;
-            e         = fi*rai_inv;
-            derb      = 0.5*e*rai_inv*rai_inv;
-            dvda[ai] += derb*rai;
-            vtot     -= 0.5*e;
-        }
-    }
-
-    return vtot;
-
-}
-
-static real calc_gb_nonpolar(t_commrec *cr, t_forcerec *fr, int natoms, gmx_genborn_t *born, gmx_localtop_t *top,
-                             real *dvda, t_mdatoms *md)
-{
-    int  ai, i, at0, at1;
-    real e, es, rai, term, probe, tmp, factor;
-    real rbi_inv, rbi_inv2;
-
-    if (DOMAINDECOMP(cr))
-    {
-        at0 = 0;
-        at1 = cr->dd->nat_home;
-    }
-    else
-    {
-        at0 = 0;
-        at1 = natoms;
-    }
-
-    /* factor is the surface tension */
-    factor = born->sa_surface_tension;
-
-    es    = 0;
-    probe = 0.14;
-    term  = M_PI*4;
-
-    for (i = at0; i < at1; i++)
-    {
-        ai        = i;
-
-        if (born->use[ai] == 1)
-        {
-            rai       = top->atomtypes.gb_radius[md->typeA[ai]];
-            rbi_inv   = fr->invsqrta[ai];
-            rbi_inv2  = rbi_inv * rbi_inv;
-            tmp       = (rai*rbi_inv2)*(rai*rbi_inv2);
-            tmp       = tmp*tmp*tmp;
-            e         = factor*term*(rai+probe)*(rai+probe)*tmp;
-            dvda[ai]  = dvda[ai] - 6*e*rbi_inv2;
-            es        = es + e;
-        }
-    }
-
-    return es;
-}
-
-
-
-static real calc_gb_chainrule(int natoms, t_nblist *nl, real *dadx, real *dvda, rvec x[], rvec t[], rvec fshift[],
-                              rvec shift_vec[], int gb_algorithm, gmx_genborn_t *born)
-{
-    int          i, k, n, ai, aj, nj0, nj1, n0, n1;
-    int          shift;
-    real         shX, shY, shZ;
-    real         fgb, rbi, fix1, fiy1, fiz1;
-    real         ix1, iy1, iz1, jx1, jy1, jz1, dx11, dy11, dz11;
-    real         tx, ty, tz, rbai, rbaj, fgb_ai;
-    real        *rb;
-
-    n  = 0;
-    rb = born->work;
-
-    n0 = 0;
-    n1 = natoms;
-
-    if (gb_algorithm == egbSTILL)
-    {
-        for (i = n0; i < n1; i++)
-        {
-            rbi   = born->bRad[i];
-            rb[i] = (2 * rbi * rbi * dvda[i])/ONE_4PI_EPS0;
-        }
-    }
-    else if (gb_algorithm == egbHCT)
-    {
-        for (i = n0; i < n1; i++)
-        {
-            rbi   = born->bRad[i];
-            rb[i] = rbi * rbi * dvda[i];
-        }
-    }
-    else if (gb_algorithm == egbOBC)
-    {
-        for (i = n0; i < n1; i++)
-        {
-            rbi   = born->bRad[i];
-            rb[i] = rbi * rbi * born->drobc[i] * dvda[i];
-        }
-    }
-
-    for (i = 0; i < nl->nri; i++)
-    {
-        ai   = nl->iinr[i];
-
-        nj0  = nl->jindex[i];
-        nj1  = nl->jindex[i+1];
-
-        /* Load shifts for this list */
-        shift   = nl->shift[i];
-        shX     = shift_vec[shift][0];
-        shY     = shift_vec[shift][1];
-        shZ     = shift_vec[shift][2];
-
-        /* Load atom i coordinates, add shift vectors */
-        ix1  = shX + x[ai][0];
-        iy1  = shY + x[ai][1];
-        iz1  = shZ + x[ai][2];
-
-        fix1 = 0;
-        fiy1 = 0;
-        fiz1 = 0;
-
-        rbai = rb[ai];
-
-        for (k = nj0; k < nj1 && nl->jjnr[k] >= 0; k++)
-        {
-            aj = nl->jjnr[k];
-
-            jx1     = x[aj][0];
-            jy1     = x[aj][1];
-            jz1     = x[aj][2];
-
-            dx11    = ix1 - jx1;
-            dy11    = iy1 - jy1;
-            dz11    = iz1 - jz1;
-
-            rbaj    = rb[aj];
-
-            fgb     = rbai*dadx[n++];
-            fgb_ai  = rbaj*dadx[n++];
-
-            /* Total force between ai and aj is the sum of ai->aj and aj->ai */
-            fgb     = fgb + fgb_ai;
-
-            tx      = fgb * dx11;
-            ty      = fgb * dy11;
-            tz      = fgb * dz11;
-
-            fix1    = fix1 + tx;
-            fiy1    = fiy1 + ty;
-            fiz1    = fiz1 + tz;
-
-            /* Update force on atom aj */
-            t[aj][0] = t[aj][0] - tx;
-            t[aj][1] = t[aj][1] - ty;
-            t[aj][2] = t[aj][2] - tz;
-        }
-
-        /* Update force and shift forces on atom ai */
-        t[ai][0] = t[ai][0] + fix1;
-        t[ai][1] = t[ai][1] + fiy1;
-        t[ai][2] = t[ai][2] + fiz1;
-
-        fshift[shift][0] = fshift[shift][0] + fix1;
-        fshift[shift][1] = fshift[shift][1] + fiy1;
-        fshift[shift][2] = fshift[shift][2] + fiz1;
-
-    }
-
-    return 0;
-}
-
-
-void
-calc_gb_forces(t_commrec *cr, t_mdatoms *md, gmx_genborn_t *born, gmx_localtop_t *top,
-               rvec x[], rvec f[], t_forcerec *fr, t_idef *idef, int gb_algorithm, int sa_algorithm, t_nrnb *nrnb,
-               const t_pbc *pbc, const t_graph *graph, gmx_enerdata_t *enerd)
-{
-    int  cnt;
-
-    /* PBC or not? */
-    const t_pbc *pbc_null;
-
-    if (fr->bMolPBC)
-    {
-        pbc_null = pbc;
-    }
-    else
-    {
-        pbc_null = nullptr;
-    }
-
-    if (sa_algorithm == esaAPPROX)
-    {
-        /* Do a simple ACE type approximation for the non-polar solvation */
-        enerd->term[F_NPSOLVATION] += calc_gb_nonpolar(cr, fr, born->nr, born, top, fr->dvda, md);
-    }
-
-    /* Calculate the bonded GB-interactions using either table or analytical formula */
-    enerd->term[F_GBPOL]       += gb_bonds_tab(x, f, fr->fshift, md->chargeA, &(fr->gbtabscale),
-                                               fr->invsqrta, fr->dvda, fr->gbtab->data, idef, born->epsilon_r, born->gb_epsilon_solvent, fr->ic->epsfac, pbc_null, graph);
-
-    /* Calculate self corrections to the GB energies - currently only A state used! (FIXME) */
-    enerd->term[F_GBPOL]       += calc_gb_selfcorrections(cr, born->nr, md->chargeA, born, fr->dvda, fr->ic->epsfac);
-
-    /* If parallel, sum the derivative of the potential w.r.t the born radii */
-    if (DOMAINDECOMP(cr))
-    {
-        dd_atom_sum_real(cr->dd, fr->dvda);
-        dd_atom_spread_real(cr->dd, fr->dvda);
-    }
-
-    if (fr->bAllvsAll)
-    {
-        genborn_allvsall_calc_chainrule(fr, md, born, x[0], f[0], gb_algorithm, fr->AllvsAll_workgb);
-        cnt = md->homenr*(md->nr/2+1);
-        /* 9 flops for outer loop, 15 for inner */
-        inc_nrnb(nrnb, eNR_BORN_AVA_CHAINRULE, md->homenr*9+cnt*15);
-        return;
-    }
-
-    calc_gb_chainrule(fr->natoms_force, fr->gblist, fr->dadx, fr->dvda,
-                      x, f, fr->fshift, fr->shift_vec, gb_algorithm, born);
-
-    if (!fr->bAllvsAll)
-    {
-        /* 9 flops for outer loop, 15 for inner */
-        inc_nrnb(nrnb, eNR_BORN_CHAINRULE, fr->gblist->nri*9+fr->gblist->nrj*15);
-    }
-}
-
-static void add_j_to_gblist(gbtmpnbl_t *list, int aj)
-{
-    if (list->naj >= list->aj_nalloc)
-    {
-        list->aj_nalloc = over_alloc_large(list->naj+1);
-        srenew(list->aj, list->aj_nalloc);
-    }
-
-    list->aj[list->naj++] = aj;
-}
-
-static gbtmpnbl_t *find_gbtmplist(struct gbtmpnbls *lists, int shift)
-{
-    int ind, i;
-
-    /* Search the list with the same shift, if there is one */
-    ind = 0;
-    while (ind < lists->nlist && shift != lists->list[ind].shift)
-    {
-        ind++;
-    }
-    if (ind == lists->nlist)
-    {
-        if (lists->nlist == lists->list_nalloc)
-        {
-            lists->list_nalloc++;
-            srenew(lists->list, lists->list_nalloc);
-            for (i = lists->nlist; i < lists->list_nalloc; i++)
-            {
-                lists->list[i].aj        = nullptr;
-                lists->list[i].aj_nalloc = 0;
-            }
-
-        }
-
-        lists->list[lists->nlist].shift = shift;
-        lists->list[lists->nlist].naj   = 0;
-        lists->nlist++;
-    }
-
-    return &lists->list[ind];
-}
-
-static void add_bondeds_to_gblist(t_ilist *il,
-                                  gmx_bool bMolPBC, t_pbc *pbc, t_graph *g, rvec *x,
-                                  struct gbtmpnbls *nls)
-{
-    int         ind, j, ai, aj, found;
-    rvec        dx;
-    ivec        dt;
-    gbtmpnbl_t *list;
-
-    for (ind = 0; ind < il->nr; ind += 3)
-    {
-        ai = il->iatoms[ind+1];
-        aj = il->iatoms[ind+2];
-
-        int shift = CENTRAL;
-        if (g != nullptr)
-        {
-            rvec_sub(x[ai], x[aj], dx);
-            ivec_sub(SHIFT_IVEC(g, ai), SHIFT_IVEC(g, aj), dt);
-            shift = IVEC2IS(dt);
-        }
-        else if (bMolPBC)
-        {
-            shift = pbc_dx_aiuc(pbc, x[ai], x[aj], dx);
-        }
-
-        /* Find the list for this shift or create one */
-        list = find_gbtmplist(&nls[ai], shift);
-
-        found = 0;
-
-        /* So that we do not add the same bond twice.
-         * This happens with some constraints between 1-3 atoms
-         * that are in the bond-list but should not be in the GB nb-list */
-        for (j = 0; j < list->naj; j++)
-        {
-            if (list->aj[j] == aj)
-            {
-                found = 1;
-            }
-        }
-
-        if (found == 0)
-        {
-            if (ai == aj)
-            {
-                gmx_incons("ai == aj");
-            }
-
-            add_j_to_gblist(list, aj);
-        }
-    }
-}
-
-
-int make_gb_nblist(t_commrec *cr, int gb_algorithm,
-                   rvec x[], matrix box,
-                   t_forcerec *fr, t_idef *idef, t_graph *graph, gmx_genborn_t *born)
-{
-    int               i, j, k, n, nj0, nj1, ai, shift, s;
-    t_nblist         *nblist;
-    t_pbc             pbc;
-
-    struct gbtmpnbls *nls;
-    gbtmpnbl_t       *list = nullptr;
-
-    set_pbc(&pbc, fr->ePBC, box);
-    nls   = born->nblist_work;
-
-    for (i = 0; i < born->nr; i++)
-    {
-        nls[i].nlist = 0;
-    }
-
-    if (fr->bMolPBC)
-    {
-        set_pbc_dd(&pbc, fr->ePBC, cr->dd->nc, TRUE, box);
-    }
-
-    switch (gb_algorithm)
-    {
-        case egbHCT:
-        case egbOBC:
-            /* Loop over 1-2, 1-3 and 1-4 interactions */
-            for (j = F_GB12; j <= F_GB14; j++)
-            {
-                add_bondeds_to_gblist(&idef->il[j], fr->bMolPBC, &pbc, graph, x, nls);
-            }
-            break;
-        case egbSTILL:
-            /* Loop over 1-4 interactions */
-            add_bondeds_to_gblist(&idef->il[F_GB14], fr->bMolPBC, &pbc, graph, x, nls);
-            break;
-        default:
-            gmx_incons("Unknown GB algorithm");
-    }
-
-    /* Loop over the VDWQQ and VDW nblists to set up the nonbonded part of the GB list */
-    for (n = 0; (n < fr->nnblists); n++)
-    {
-        for (i = 0; (i < eNL_NR); i++)
-        {
-            nblist = &(fr->nblists[n].nlist_sr[i]);
-
-            if (nblist->nri > 0 && (i == eNL_VDWQQ || i == eNL_QQ))
-            {
-                for (j = 0; j < nblist->nri; j++)
-                {
-                    ai    = nblist->iinr[j];
-                    shift = nblist->shift[j];
-
-                    /* Find the list for this shift or create one */
-                    list = find_gbtmplist(&nls[ai], shift);
-
-                    nj0 = nblist->jindex[j];
-                    nj1 = nblist->jindex[j+1];
-
-                    /* Add all the j-atoms in the non-bonded list to the GB list */
-                    for (k = nj0; k < nj1; k++)
-                    {
-                        add_j_to_gblist(list, nblist->jjnr[k]);
-                    }
-                }
-            }
-        }
-    }
-
-    /* Zero out some counters */
-    fr->gblist->nri = 0;
-    fr->gblist->nrj = 0;
-
-    fr->gblist->jindex[0] = fr->gblist->nri;
-
-    for (i = 0; i < fr->natoms_force; i++)
-    {
-        for (s = 0; s < nls[i].nlist; s++)
-        {
-            list = &nls[i].list[s];
-
-            /* Only add those atoms that actually have neighbours */
-            if (born->use[i] != 0)
-            {
-                fr->gblist->iinr[fr->gblist->nri]  = i;
-                fr->gblist->shift[fr->gblist->nri] = list->shift;
-                fr->gblist->nri++;
-
-                for (k = 0; k < list->naj; k++)
-                {
-                    /* Memory allocation for jjnr */
-                    if (fr->gblist->nrj >= fr->gblist->maxnrj)
-                    {
-                        fr->gblist->maxnrj += over_alloc_large(fr->gblist->maxnrj);
-
-                        if (debug)
-                        {
-                            fprintf(debug, "Increasing GB neighbourlist j size to %d\n", fr->gblist->maxnrj);
-                        }
-
-                        srenew(fr->gblist->jjnr, fr->gblist->maxnrj);
-                    }
-
-                    /* Put in list */
-                    if (i == list->aj[k])
-                    {
-                        gmx_incons("i == list->aj[k]");
-                    }
-                    fr->gblist->jjnr[fr->gblist->nrj++] = list->aj[k];
-                }
-
-                fr->gblist->jindex[fr->gblist->nri] = fr->gblist->nrj;
-            }
-        }
-    }
-
-    return 0;
-}
-
-void make_local_gb(const t_commrec *cr, gmx_genborn_t *born, int gb_algorithm)
-{
-    int           i, at0, at1;
-    gmx_domdec_t *dd = nullptr;
-
-    if (DOMAINDECOMP(cr))
-    {
-        dd  = cr->dd;
-        at0 = 0;
-        at1 = dd->nat_tot;
-    }
-    else
-    {
-        /* Single node, just copy pointers and return */
-        if (gb_algorithm == egbSTILL)
-        {
-            born->gpol      = born->gpol_globalindex;
-            born->vsolv     = born->vsolv_globalindex;
-            born->gb_radius = born->gb_radius_globalindex;
-        }
-        else
-        {
-            born->param     = born->param_globalindex;
-            born->gb_radius = born->gb_radius_globalindex;
-        }
-
-        born->use = born->use_globalindex;
-
-        return;
-    }
-
-    /* Reallocation of local arrays if necessary */
-    /* fr->natoms_force is equal to dd->nat_tot */
-    if (DOMAINDECOMP(cr) && dd->nat_tot > born->nalloc)
-    {
-        int nalloc;
-
-        nalloc = dd->nat_tot;
-
-        /* Arrays specific to different gb algorithms */
-        if (gb_algorithm == egbSTILL)
-        {
-            srenew(born->gpol,  nalloc+3);
-            srenew(born->vsolv, nalloc+3);
-            srenew(born->gb_radius, nalloc+3);
-            for (i = born->nalloc; (i < nalloc+3); i++)
-            {
-                born->gpol[i]      = 0;
-                born->vsolv[i]     = 0;
-                born->gb_radius[i] = 0;
-            }
-        }
-        else
-        {
-            srenew(born->param, nalloc+3);
-            srenew(born->gb_radius, nalloc+3);
-            for (i = born->nalloc; (i < nalloc+3); i++)
-            {
-                born->param[i]     = 0;
-                born->gb_radius[i] = 0;
-            }
-        }
-
-        /* All gb-algorithms use the array for vsites exclusions */
-        srenew(born->use,    nalloc+3);
-        for (i = born->nalloc; (i < nalloc+3); i++)
-        {
-            born->use[i] = 0;
-        }
-
-        born->nalloc = nalloc;
-    }
-
-    /* With dd, copy algorithm specific arrays */
-    if (gb_algorithm == egbSTILL)
-    {
-        for (i = at0; i < at1; i++)
-        {
-            born->gpol[i]      = born->gpol_globalindex[dd->gatindex[i]];
-            born->vsolv[i]     = born->vsolv_globalindex[dd->gatindex[i]];
-            born->gb_radius[i] = born->gb_radius_globalindex[dd->gatindex[i]];
-            born->use[i]       = born->use_globalindex[dd->gatindex[i]];
-        }
-    }
-    else
-    {
-        for (i = at0; i < at1; i++)
-        {
-            born->param[i]     = born->param_globalindex[dd->gatindex[i]];
-            born->gb_radius[i] = born->gb_radius_globalindex[dd->gatindex[i]];
-            born->use[i]       = born->use_globalindex[dd->gatindex[i]];
-        }
-    }
-}
diff --git a/src/gromacs/mdlib/genborn.h b/src/gromacs/mdlib/genborn.h
deleted file mode 100644 (file)
index a631788..0000000
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2008, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
- * and including many others, as listed in the AUTHORS file in the
- * top-level source directory and at http://www.gromacs.org.
- *
- * GROMACS is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * GROMACS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GROMACS; if not, see
- * http://www.gnu.org/licenses, or write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
- *
- * If you want to redistribute modifications to GROMACS, please
- * consider that scientific software is very special. Version
- * control is crucial - bugs must be traceable. We will be happy to
- * consider code for inclusion in the official distribution, but
- * derived work must not be called official GROMACS. Details are found
- * in the README & COPYING files - if they are missing, get the
- * official version at http://www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the research papers on the package. Check out http://www.gromacs.org.
- */
-#ifndef GMX_MDLIB_GENBORN_H
-#define GMX_MDLIB_GENBORN_H
-
-#include "gromacs/math/utilities.h"
-#include "gromacs/math/vectypes.h"
-
-struct gmx_genborn_t;
-struct gmx_enerdata_t;
-struct gmx_localtop_t;
-struct gmx_mtop_t;
-struct t_commrec;
-struct t_forcerec;
-struct t_graph;
-struct t_idef;
-struct t_inputrec;
-struct t_mdatoms;
-struct t_nblist;
-struct t_nrnb;
-struct t_pbc;
-
-typedef struct
-{
-    int  nbonds;
-    int  bond[10];
-    real length[10];
-} genborn_bonds_t;
-
-typedef struct gbtmpnbls *gbtmpnbls_t;
-
-/* Struct to hold all the information for GB */
-typedef struct gmx_genborn_t
-{
-    int nr;                   /* number of atoms, length of arrays below */
-    int n12;                  /* number of 1-2 (bond) interactions       */
-    int n13;                  /* number of 1-3 (angle) terms             */
-    int n14;                  /* number of 1-4 (torsion) terms           */
-    int nalloc;               /* Allocation of local arrays (with DD)    */
-
-
-    /* Arrays below that end with _globalindex are used for setting up initial values of
-     * all gb parameters and values. They all have length natoms, which for DD is the
-     * global atom number.
-     * Values are then taken from these arrays to local copies, that have names without
-     * _globalindex, in the routine make_local_gb(), which is called once for single
-     * node runs, and for DD at every call to dd_partition_system
-     */
-
-    real       *gpol;              /* Atomic polarisation energies */
-    real       *gpol_globalindex;  /*  */
-    real       *gpol_still_work;   /* Work array for Still model */
-    real       *gpol_hct_work;     /* Work array for HCT/OBC models */
-    real       *bRad;              /* Atomic Born radii */
-    real       *vsolv;             /* Atomic solvation volumes */
-    real       *vsolv_globalindex; /*  */
-    real       *gb_radius;         /* Radius info, copied from atomtypes */
-    real       *gb_radius_globalindex;
-
-    int        *use;                /* Array that till if this atom does GB */
-    int        *use_globalindex;    /* Global array for parallelization */
-
-    real        es;                 /* Solvation energy and derivatives */
-    real       *asurf;              /* Atomic surface area */
-    rvec       *dasurf;             /* Surface area derivatives */
-    real        as;                 /* Total surface area */
-
-    real       *drobc;              /* Parameters for OBC chain rule calculation */
-    real       *param;              /* Precomputed factor rai*atype->S_hct for HCT/OBC */
-    real       *param_globalindex;  /*  */
-
-    real       *log_table;          /* Table for logarithm lookup */
-
-    real        obc_alpha;          /* OBC parameters */
-    real        obc_beta;           /* OBC parameters */
-    real        obc_gamma;          /* OBC parameters */
-    real        gb_doffset;         /* Dielectric offset for Still/HCT/OBC */
-    real        gb_epsilon_solvent; /*   */
-    real        epsilon_r;          /* Used for inner dielectric */
-
-    real        sa_surface_tension; /* Surface tension for non-polar solvation */
-
-    real       *work;               /* Used for parallel summation and in the chain rule, length natoms         */
-    real       *buf;                /* Used for parallel summation and in the chain rule, length natoms         */
-    int        *count;              /* Used for setting up the special gb nblist, length natoms                 */
-    gbtmpnbls_t nblist_work;        /* Used for setting up the special gb nblist, dim natoms*nblist_work_nalloc */
-    int         nblist_work_nalloc; /* Length of second dimension of nblist_work                                */
-}
-gmx_genborn_t;
-/* Still parameters - make sure to edit in genborn_sse.c too if you change these! */
-#define STILL_P1  0.073*0.1              /* length        */
-#define STILL_P2  0.921*0.1*CAL2JOULE    /* energy*length */
-#define STILL_P3  6.211*0.1*CAL2JOULE    /* energy*length */
-#define STILL_P4  15.236*0.1*CAL2JOULE
-#define STILL_P5  1.254
-
-#define STILL_P5INV (1.0/STILL_P5)
-#define STILL_PIP5  (M_PI*STILL_P5)
-
-
-/* Initialise GB stuff */
-int init_gb(struct gmx_genborn_t **p_born,
-            struct t_forcerec *fr, const struct t_inputrec *ir,
-            const gmx_mtop_t *mtop, int gb_algorithm);
-
-
-/* Born radii calculations, both with and without SSE acceleration */
-int calc_gb_rad(struct t_commrec *cr, struct t_forcerec *fr, struct t_inputrec *ir, gmx_localtop_t *top, rvec x[], t_nblist *nl, struct gmx_genborn_t *born, t_mdatoms *md, t_nrnb     *nrnb);
-
-
-
-/* Bonded GB interactions */
-real gb_bonds_tab(rvec x[], rvec f[], rvec fshift[], real *charge, real *p_gbtabscale,
-                  real *invsqrta, real *dvda, real *GBtab, t_idef *idef, real epsilon_r,
-                  real gb_epsilon_solvent, real facel, const struct t_pbc *pbc,
-                  const struct t_graph *graph);
-
-
-
-
-/* Functions for calculating adjustments due to ie chain rule terms */
-void
-calc_gb_forces(struct t_commrec *cr, t_mdatoms *md, struct gmx_genborn_t *born, gmx_localtop_t *top,
-               rvec x[], rvec f[], struct t_forcerec *fr, t_idef *idef, int gb_algorithm, int sa_algorithm, t_nrnb *nrnb,
-               const struct t_pbc *pbc, const struct t_graph *graph, struct gmx_enerdata_t *enerd);
-
-
-int
-make_gb_nblist(struct t_commrec *cr, int gb_algorithm,
-               rvec x[], matrix box,
-               struct t_forcerec *fr, t_idef *idef, struct t_graph *graph, struct gmx_genborn_t *born);
-
-void
-make_local_gb(const struct t_commrec *cr, struct gmx_genborn_t *born, int gb_algorithm);
-
-#endif
diff --git a/src/gromacs/mdlib/genborn_allvsall.cpp b/src/gromacs/mdlib/genborn_allvsall.cpp
deleted file mode 100644 (file)
index 1d96860..0000000
+++ /dev/null
@@ -1,1108 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2009, The GROMACS Development Team.
- * Copyright (c) 2010,2014,2015,2017, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
- * and including many others, as listed in the AUTHORS file in the
- * top-level source directory and at http://www.gromacs.org.
- *
- * GROMACS is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * GROMACS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GROMACS; if not, see
- * http://www.gnu.org/licenses, or write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
- *
- * If you want to redistribute modifications to GROMACS, please
- * consider that scientific software is very special. Version
- * control is crucial - bugs must be traceable. We will be happy to
- * consider code for inclusion in the official distribution, but
- * derived work must not be called official GROMACS. Details are found
- * in the README & COPYING files - if they are missing, get the
- * official version at http://www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the research papers on the package. Check out http://www.gromacs.org.
- */
-#include "gmxpre.h"
-
-#include "genborn_allvsall.h"
-
-#include <cmath>
-
-#include <algorithm>
-
-#include "gromacs/gmxlib/network.h"
-#include "gromacs/math/functions.h"
-#include "gromacs/math/units.h"
-#include "gromacs/math/vec.h"
-#include "gromacs/mdlib/genborn.h"
-#include "gromacs/mdtypes/forcerec.h"
-#include "gromacs/mdtypes/md_enums.h"
-#include "gromacs/mdtypes/mdatom.h"
-#include "gromacs/topology/topology.h"
-#include "gromacs/utility/smalloc.h"
-
-
-typedef struct
-{
-    int *      jindex_gb;
-    int **     exclusion_mask_gb;
-}
-gmx_allvsallgb2_data_t;
-
-static int
-calc_maxoffset(int i, int natoms)
-{
-    int maxoffset;
-
-    if ((natoms % 2) == 1)
-    {
-        /* Odd number of atoms, easy */
-        maxoffset = natoms/2;
-    }
-    else if ((natoms % 4) == 0)
-    {
-        /* Multiple of four is hard */
-        if (i < natoms/2)
-        {
-            if ((i % 2) == 0)
-            {
-                maxoffset = natoms/2;
-            }
-            else
-            {
-                maxoffset = natoms/2-1;
-            }
-        }
-        else
-        {
-            if ((i % 2) == 1)
-            {
-                maxoffset = natoms/2;
-            }
-            else
-            {
-                maxoffset = natoms/2-1;
-            }
-        }
-    }
-    else
-    {
-        /* natoms/2 = odd */
-        if ((i % 2) == 0)
-        {
-            maxoffset = natoms/2;
-        }
-        else
-        {
-            maxoffset = natoms/2-1;
-        }
-    }
-
-    return maxoffset;
-}
-
-static void
-setup_gb_exclusions_and_indices(gmx_allvsallgb2_data_t     *   aadata,
-                                t_ilist     *                  ilist,
-                                int                            natoms,
-                                gmx_bool                       bInclude12,
-                                gmx_bool                       bInclude13,
-                                gmx_bool                       bInclude14)
-{
-    int i, j, k;
-    int a1, a2;
-    int max_offset;
-    int max_excl_offset;
-
-    /* This routine can appear to be a bit complex, but it is mostly book-keeping.
-     * To enable the fast all-vs-all kernel we need to be able to stream through all coordinates
-     * whether they should interact or not.
-     *
-     * To avoid looping over the exclusions, we create a simple mask that is 1 if the interaction
-     * should be present, otherwise 0. Since exclusions typically only occur when i & j are close,
-     * we create a jindex array with three elements per i atom: the starting point, the point to
-     * which we need to check exclusions, and the end point.
-     * This way we only have to allocate a short exclusion mask per i atom.
-     */
-
-    /* Allocate memory for jindex arrays */
-    snew(aadata->jindex_gb, 3*natoms);
-
-    /* Pointer to lists with exclusion masks */
-    snew(aadata->exclusion_mask_gb, natoms);
-
-    for (i = 0; i < natoms; i++)
-    {
-        /* Start */
-        aadata->jindex_gb[3*i]       = i+1;
-        max_offset                   = calc_maxoffset(i, natoms);
-
-        /* first check the max range of atoms to EXCLUDE */
-        max_excl_offset = 0;
-        if (!bInclude12)
-        {
-            for (j = 0; j < ilist[F_GB12].nr; j += 3)
-            {
-                a1 = ilist[F_GB12].iatoms[j+1];
-                a2 = ilist[F_GB12].iatoms[j+2];
-
-                if (a1 == i)
-                {
-                    k = a2-a1;
-                }
-                else if (a2 == i)
-                {
-                    k = a1+natoms-a2;
-                }
-                else
-                {
-                    continue;
-                }
-                if (k > 0 && k <= max_offset)
-                {
-                    max_excl_offset = std::max(k, max_excl_offset);
-                }
-            }
-        }
-        if (!bInclude13)
-        {
-            for (j = 0; j < ilist[F_GB13].nr; j += 3)
-            {
-                a1 = ilist[F_GB13].iatoms[j+1];
-                a2 = ilist[F_GB13].iatoms[j+2];
-
-
-                if (a1 == i)
-                {
-                    k = a2-a1;
-                }
-                else if (a2 == i)
-                {
-                    k = a1+natoms-a2;
-                }
-                else
-                {
-                    continue;
-                }
-                if (k > 0 && k <= max_offset)
-                {
-                    max_excl_offset = std::max(k, max_excl_offset);
-                }
-            }
-        }
-        if (!bInclude14)
-        {
-            for (j = 0; j < ilist[F_GB14].nr; j += 3)
-            {
-                a1 = ilist[F_GB14].iatoms[j+1];
-                a2 = ilist[F_GB14].iatoms[j+2];
-
-
-                if (a1 == i)
-                {
-                    k = a2-a1;
-                }
-                else if (a2 == i)
-                {
-                    k = a1+natoms-a2;
-                }
-                else
-                {
-                    continue;
-                }
-                if (k > 0 && k <= max_offset)
-                {
-                    max_excl_offset = std::max(k, max_excl_offset);
-                }
-            }
-        }
-        max_excl_offset = std::min(max_offset, max_excl_offset);
-
-        aadata->jindex_gb[3*i+1] = i+1+max_excl_offset;
-
-        snew(aadata->exclusion_mask_gb[i], max_excl_offset);
-
-        /* Include everything by default */
-        for (j = 0; j < max_excl_offset; j++)
-        {
-            /* Use all-ones to mark interactions that should be present, compatible with SSE */
-            aadata->exclusion_mask_gb[i][j] = 0xFFFFFFFF;
-        }
-        /* Go through exclusions again */
-        if (!bInclude12)
-        {
-            for (j = 0; j < ilist[F_GB12].nr; j += 3)
-            {
-                a1 = ilist[F_GB12].iatoms[j+1];
-                a2 = ilist[F_GB12].iatoms[j+2];
-
-                if (a1 == i)
-                {
-                    k = a2-a1;
-                }
-                else if (a2 == i)
-                {
-                    k = a1+natoms-a2;
-                }
-                else
-                {
-                    continue;
-                }
-                if (k > 0 && k <= max_offset)
-                {
-                    aadata->exclusion_mask_gb[i][k-1] = 0;
-                }
-            }
-        }
-        if (!bInclude13)
-        {
-            for (j = 0; j < ilist[F_GB13].nr; j += 3)
-            {
-                a1 = ilist[F_GB13].iatoms[j+1];
-                a2 = ilist[F_GB13].iatoms[j+2];
-
-                if (a1 == i)
-                {
-                    k = a2-a1;
-                }
-                else if (a2 == i)
-                {
-                    k = a1+natoms-a2;
-                }
-                else
-                {
-                    continue;
-                }
-                if (k > 0 && k <= max_offset)
-                {
-                    aadata->exclusion_mask_gb[i][k-1] = 0;
-                }
-            }
-        }
-        if (!bInclude14)
-        {
-            for (j = 0; j < ilist[F_GB14].nr; j += 3)
-            {
-                a1 = ilist[F_GB14].iatoms[j+1];
-                a2 = ilist[F_GB14].iatoms[j+2];
-
-                if (a1 == i)
-                {
-                    k = a2-a1;
-                }
-                else if (a2 == i)
-                {
-                    k = a1+natoms-a2;
-                }
-                else
-                {
-                    continue;
-                }
-                if (k > 0 && k <= max_offset)
-                {
-                    aadata->exclusion_mask_gb[i][k-1] = 0;
-                }
-            }
-        }
-
-        /* End */
-
-        /* End */
-        aadata->jindex_gb[3*i+2] = i+1+max_offset;
-    }
-}
-
-
-static void
-genborn_allvsall_setup(gmx_allvsallgb2_data_t     **  p_aadata,
-                       t_ilist     *                  ilist,
-                       int                            natoms,
-                       gmx_bool                       bInclude12,
-                       gmx_bool                       bInclude13,
-                       gmx_bool                       bInclude14)
-{
-    gmx_allvsallgb2_data_t *aadata;
-
-    snew(aadata, 1);
-    *p_aadata = aadata;
-
-    setup_gb_exclusions_and_indices(aadata, ilist, natoms, bInclude12, bInclude13, bInclude14);
-}
-
-
-
-int
-genborn_allvsall_calc_still_radii(t_forcerec *           fr,
-                                  t_mdatoms *            mdatoms,
-                                  gmx_genborn_t *        born,
-                                  gmx_localtop_t *       top,
-                                  real *                 x,
-                                  void *                 work)
-{
-    gmx_allvsallgb2_data_t *aadata;
-    int                     natoms;
-    int                     ni0, ni1;
-    int                     nj0, nj1, nj2;
-    int                     i, j, k, n;
-    int              *      mask;
-
-    real                    ix, iy, iz;
-    real                    jx, jy, jz;
-    real                    dx, dy, dz;
-    real                    rsq, rinv;
-    real                    gpi, rai, vai;
-    real                    prod_ai;
-    real                    irsq, idr4, idr6;
-    real                    raj, rvdw, ratio;
-    real                    vaj, ccf, dccf, theta, cosq;
-    real                    term, prod, icf4, icf6, gpi2, factor, sinq;
-
-    natoms              = mdatoms->nr;
-    ni0                 = 0;
-    ni1                 = mdatoms->homenr;
-    factor              = 0.5*ONE_4PI_EPS0;
-    n                   = 0;
-
-    aadata = *((gmx_allvsallgb2_data_t **)work);
-
-    if (aadata == nullptr)
-    {
-        genborn_allvsall_setup(&aadata, top->idef.il, mdatoms->nr,
-                               FALSE, FALSE, TRUE);
-        *((gmx_allvsallgb2_data_t **)work) = aadata;
-    }
-
-
-    for (i = 0; i < born->nr; i++)
-    {
-        born->gpol_still_work[i] = 0;
-    }
-
-
-    for (i = ni0; i < ni1; i++)
-    {
-        /* We assume shifts are NOT used for all-vs-all interactions */
-
-        /* Load i atom data */
-        ix                = x[3*i];
-        iy                = x[3*i+1];
-        iz                = x[3*i+2];
-
-        gpi               = 0.0;
-
-        rai     = top->atomtypes.gb_radius[mdatoms->typeA[i]];
-        vai     = born->vsolv[i];
-        prod_ai = STILL_P4*vai;
-
-        /* Load limits for loop over neighbors */
-        nj0              = aadata->jindex_gb[3*i];
-        nj1              = aadata->jindex_gb[3*i+1];
-        nj2              = aadata->jindex_gb[3*i+2];
-
-        mask             = aadata->exclusion_mask_gb[i];
-
-        /* Prologue part, including exclusion mask */
-        for (j = nj0; j < nj1; j++, mask++)
-        {
-            if (*mask != 0)
-            {
-                k = j%natoms;
-
-                /* load j atom coordinates */
-                jx                = x[3*k];
-                jy                = x[3*k+1];
-                jz                = x[3*k+2];
-
-                /* Calculate distance */
-                dx                = ix - jx;
-                dy                = iy - jy;
-                dz                = iz - jz;
-                rsq               = dx*dx+dy*dy+dz*dz;
-
-                /* Calculate 1/r and 1/r2 */
-                rinv              = gmx::invsqrt(rsq);
-                irsq              = rinv*rinv;
-                idr4              = irsq*irsq;
-                idr6              = idr4*irsq;
-
-                raj = top->atomtypes.gb_radius[mdatoms->typeA[k]];
-
-                rvdw  = rai + raj;
-
-                ratio = rsq / (rvdw * rvdw);
-                vaj   = born->vsolv[k];
-
-
-                if (ratio > STILL_P5INV)
-                {
-                    ccf  = 1.0;
-                    dccf = 0.0;
-                }
-                else
-                {
-                    theta = ratio*STILL_PIP5;
-                    cosq  = cos(theta);
-                    term  = 0.5*(1.0-cosq);
-                    ccf   = term*term;
-                    sinq  = 1.0 - cosq*cosq;
-                    dccf  = 2.0*term*sinq*gmx::invsqrt(sinq)*theta;
-                }
-
-                prod          = STILL_P4*vaj;
-                icf4          = ccf*idr4;
-                icf6          = (4*ccf-dccf)*idr6;
-
-                born->gpol_still_work[k] += prod_ai*icf4;
-                gpi                       = gpi+prod*icf4;
-
-                /* Save ai->aj and aj->ai chain rule terms */
-                fr->dadx[n++]   = prod*icf6;
-                fr->dadx[n++]   = prod_ai*icf6;
-
-                /* 27 flops, plus one cos(x) - estimate at 20 flops  => 47 */
-
-            }
-        }
-
-        /* Main part, no exclusions */
-        for (j = nj1; j < nj2; j++)
-        {
-            k = j%natoms;
-
-            /* load j atom coordinates */
-            jx                = x[3*k];
-            jy                = x[3*k+1];
-            jz                = x[3*k+2];
-
-            /* Calculate distance */
-            dx                = ix - jx;
-            dy                = iy - jy;
-            dz                = iz - jz;
-            rsq               = dx*dx+dy*dy+dz*dz;
-
-            /* Calculate 1/r and 1/r2 */
-            rinv              = gmx::invsqrt(rsq);
-            irsq              = rinv*rinv;
-            idr4              = irsq*irsq;
-            idr6              = idr4*irsq;
-
-            raj = top->atomtypes.gb_radius[mdatoms->typeA[k]];
-
-            rvdw  = rai + raj;
-
-            ratio = rsq / (rvdw * rvdw);
-            vaj   = born->vsolv[k];
-
-            if (ratio > STILL_P5INV)
-            {
-                ccf  = 1.0;
-                dccf = 0.0;
-            }
-            else
-            {
-                theta = ratio*STILL_PIP5;
-                cosq  = cos(theta);
-                term  = 0.5*(1.0-cosq);
-                ccf   = term*term;
-                sinq  = 1.0 - cosq*cosq;
-                dccf  = 2.0*term*sinq*gmx::invsqrt(sinq)*theta;
-            }
-
-            prod          = STILL_P4*vaj;
-            icf4          = ccf*idr4;
-            icf6          = (4*ccf-dccf)*idr6;
-
-            born->gpol_still_work[k] += prod_ai*icf4;
-            gpi                       = gpi+prod*icf4;
-
-            /* Save ai->aj and aj->ai chain rule terms */
-            fr->dadx[n++]   = prod*icf6;
-            fr->dadx[n++]   = prod_ai*icf6;
-        }
-        born->gpol_still_work[i] += gpi;
-    }
-
-    /* Parallel summations would go here if ever implemented with DD */
-
-    /* Calculate the radii */
-    for (i = 0; i < natoms; i++)
-    {
-        if (born->use[i] != 0)
-        {
-            gpi             = born->gpol[i]+born->gpol_still_work[i];
-            gpi2            = gpi * gpi;
-            born->bRad[i]   = factor*gmx::invsqrt(gpi2);
-            fr->invsqrta[i] = gmx::invsqrt(born->bRad[i]);
-        }
-    }
-
-    return 0;
-}
-
-
-
-int
-genborn_allvsall_calc_hct_obc_radii(t_forcerec *           fr,
-                                    t_mdatoms *            mdatoms,
-                                    gmx_genborn_t *        born,
-                                    int                    gb_algorithm,
-                                    gmx_localtop_t *       top,
-                                    real *                 x,
-                                    void *                 work)
-{
-    gmx_allvsallgb2_data_t *aadata;
-    int                     natoms;
-    int                     ni0, ni1;
-    int                     nj0, nj1, nj2;
-    int                     i, j, k, n;
-    int              *      mask;
-
-    real                    ix, iy, iz;
-    real                    jx, jy, jz;
-    real                    dx, dy, dz;
-    real                    rsq, rinv;
-    real                    prod, raj;
-    real                    rai, doffset, rai_inv, rai_inv2, sk_ai, sk2_ai, sum_ai;
-    real                    dr, sk, lij, dlij, lij2, lij3, uij2, uij3, diff2, uij, log_term;
-    real                    lij_inv, sk2, sk2_rinv, tmp, t1, t2, t3, raj_inv, sum_ai2, sum_ai3, tsum;
-    real                    tchain;
-    real                    dadxi, dadxj;
-    real                    rad, min_rad;
-
-    natoms              = mdatoms->nr;
-    ni0                 = 0;
-    ni1                 = mdatoms->homenr;
-
-    n       = 0;
-    doffset = born->gb_doffset;
-
-    aadata = *((gmx_allvsallgb2_data_t **)work);
-
-    if (aadata == nullptr)
-    {
-        genborn_allvsall_setup(&aadata, top->idef.il, mdatoms->nr,
-                               TRUE, TRUE, TRUE);
-        *((gmx_allvsallgb2_data_t **)work) = aadata;
-    }
-
-    for (i = 0; i < born->nr; i++)
-    {
-        born->gpol_hct_work[i] = 0;
-    }
-
-    for (i = ni0; i < ni1; i++)
-    {
-        /* We assume shifts are NOT used for all-vs-all interactions */
-
-        /* Load i atom data */
-        ix                = x[3*i];
-        iy                = x[3*i+1];
-        iz                = x[3*i+2];
-
-        rai      = top->atomtypes.gb_radius[mdatoms->typeA[i]]-doffset;
-        rai_inv  = 1.0/rai;
-
-        sk_ai    = born->param[i];
-        sk2_ai   = sk_ai*sk_ai;
-
-        sum_ai   = 0;
-
-        /* Load limits for loop over neighbors */
-        nj0              = aadata->jindex_gb[3*i];
-        nj1              = aadata->jindex_gb[3*i+1];
-        nj2              = aadata->jindex_gb[3*i+2];
-
-        mask             = aadata->exclusion_mask_gb[i];
-
-        /* Prologue part, including exclusion mask */
-        for (j = nj0; j < nj1; j++, mask++)
-        {
-            if (*mask != 0)
-            {
-                k = j%natoms;
-
-                /* load j atom coordinates */
-                jx                = x[3*k];
-                jy                = x[3*k+1];
-                jz                = x[3*k+2];
-
-                /* Calculate distance */
-                dx                = ix - jx;
-                dy                = iy - jy;
-                dz                = iz - jz;
-                rsq               = dx*dx+dy*dy+dz*dz;
-
-                /* Calculate 1/r and 1/r2 */
-                rinv              = gmx::invsqrt(rsq);
-                dr                = rsq*rinv;
-
-                /* sk is precalculated in init_gb() */
-                sk    = born->param[k];
-                raj   = top->atomtypes.gb_radius[mdatoms->typeA[k]]-doffset;
-
-                /* aj -> ai interaction */
-
-
-                if (rai < dr+sk)
-                {
-                    lij       = 1.0/(dr-sk);
-                    dlij      = 1.0;
-
-                    if (rai > dr-sk)
-                    {
-                        lij  = rai_inv;
-                        dlij = 0.0;
-                    }
-
-                    uij      = 1.0/(dr+sk);
-                    lij2     = lij  * lij;
-                    lij3     = lij2 * lij;
-                    uij2     = uij  * uij;
-                    uij3     = uij2 * uij;
-
-                    diff2    = uij2-lij2;
-
-                    lij_inv  = gmx::invsqrt(lij2);
-                    sk2      = sk*sk;
-                    sk2_rinv = sk2*rinv;
-                    prod     = 0.25*sk2_rinv;
-
-                    log_term = std::log(uij*lij_inv);
-                    /* log_term = table_log(uij*lij_inv,born->log_table,LOG_TABLE_ACCURACY); */
-                    tmp      = lij-uij + 0.25*dr*diff2 + (0.5*rinv)*log_term + prod*(-diff2);
-
-                    if (rai < sk-dr)
-                    {
-                        tmp = tmp + 2.0 * (rai_inv-lij);
-                    }
-
-                    t1      = 0.5*lij2 + prod*lij3 - 0.25*(lij*rinv+lij3*dr);
-                    t2      = -0.5*uij2 - prod*uij3 + 0.25*(uij*rinv+uij3*dr);
-
-                    t3      = 0.125*(1.0+sk2_rinv*rinv)*(-diff2)+0.25*log_term*rinv*rinv;
-
-                    dadxi = (dlij*t1+t2+t3)*rinv;
-
-                    sum_ai += 0.5*tmp;
-                }
-                else
-                {
-                    dadxi = 0.0;
-                }
-
-                /* ai -> aj interaction */
-                if (raj < dr + sk_ai)
-                {
-                    lij     = 1.0/(dr-sk_ai);
-                    dlij    = 1.0;
-                    raj_inv = 1.0/raj;
-
-                    if (raj > dr-sk_ai)
-                    {
-                        lij  = raj_inv;
-                        dlij = 0.0;
-                    }
-
-                    lij2     = lij  * lij;
-                    lij3     = lij2 * lij;
-
-                    uij      = 1.0/(dr+sk_ai);
-                    uij2     = uij  * uij;
-                    uij3     = uij2 * uij;
-
-                    diff2    = uij2-lij2;
-
-                    lij_inv  = gmx::invsqrt(lij2);
-                    sk2      =  sk2_ai; /* sk2_ai = sk_ai * sk_ai in i loop above */
-                    sk2_rinv = sk2*rinv;
-                    prod     = 0.25 * sk2_rinv;
-
-                    /* log_term = table_log(uij*lij_inv,born->log_table,LOG_TABLE_ACCURACY); */
-                    log_term = std::log(uij*lij_inv);
-
-                    tmp      = lij-uij + 0.25*dr*diff2 + (0.5*rinv)*log_term + prod*(-diff2);
-
-                    if (raj < sk_ai-dr)
-                    {
-                        tmp     = tmp + 2.0 * (raj_inv-lij);
-                    }
-
-                    t1      = 0.5*lij2 + prod*lij3 - 0.25*(lij*rinv+lij3*dr);
-                    t2      = -0.5*uij2 - 0.25*sk2_rinv*uij3 + 0.25*(uij*rinv+uij3*dr);
-                    t3      = 0.125*(1.0+sk2_rinv*rinv)*(-diff2)+0.25*log_term*rinv*rinv;
-
-                    dadxj = (dlij*t1+t2+t3)*rinv; /* rb2 is moved to chainrule */
-
-                    born->gpol_hct_work[k] += 0.5*tmp;
-                }
-                else
-                {
-                    dadxj = 0.0;
-                }
-                fr->dadx[n++] = dadxi;
-                fr->dadx[n++] = dadxj;
-
-            }
-        }
-
-        /* Main part, no exclusions */
-        for (j = nj1; j < nj2; j++)
-        {
-            k = j%natoms;
-
-            /* load j atom coordinates */
-            jx                = x[3*k];
-            jy                = x[3*k+1];
-            jz                = x[3*k+2];
-
-            /* Calculate distance */
-            dx                = ix - jx;
-            dy                = iy - jy;
-            dz                = iz - jz;
-            rsq               = dx*dx+dy*dy+dz*dz;
-
-            /* Calculate 1/r and 1/r2 */
-            rinv              = gmx::invsqrt(rsq);
-            dr                = rsq*rinv;
-
-            /* sk is precalculated in init_gb() */
-            sk    = born->param[k];
-            raj   = top->atomtypes.gb_radius[mdatoms->typeA[k]]-doffset;
-
-            /* aj -> ai interaction */
-            if (rai < dr+sk)
-            {
-                lij       = 1.0/(dr-sk);
-                dlij      = 1.0;
-
-                if (rai > dr-sk)
-                {
-                    lij  = rai_inv;
-                    dlij = 0.0;
-                }
-
-                uij      = 1.0/(dr+sk);
-                lij2     = lij  * lij;
-                lij3     = lij2 * lij;
-                uij2     = uij  * uij;
-                uij3     = uij2 * uij;
-
-                diff2    = uij2-lij2;
-
-                lij_inv  = gmx::invsqrt(lij2);
-                sk2      = sk*sk;
-                sk2_rinv = sk2*rinv;
-                prod     = 0.25*sk2_rinv;
-
-                log_term = std::log(uij*lij_inv);
-                /* log_term = table_log(uij*lij_inv,born->log_table,LOG_TABLE_ACCURACY); */
-                tmp      = lij-uij + 0.25*dr*diff2 + (0.5*rinv)*log_term + prod*(-diff2);
-
-                if (rai < sk-dr)
-                {
-                    tmp = tmp + 2.0 * (rai_inv-lij);
-                }
-
-                /* duij    = 1.0; */
-                t1      = 0.5*lij2 + prod*lij3 - 0.25*(lij*rinv+lij3*dr);
-                t2      = -0.5*uij2 - 0.25*sk2_rinv*uij3 + 0.25*(uij*rinv+uij3*dr);
-                t3      = 0.125*(1.0+sk2_rinv*rinv)*(-diff2)+0.25*log_term*rinv*rinv;
-
-                dadxi = (dlij*t1+t2+t3)*rinv; /* rb2 is moved to chainrule     */
-
-                sum_ai += 0.5*tmp;
-            }
-            else
-            {
-                dadxi = 0.0;
-            }
-
-            /* ai -> aj interaction */
-            if (raj < dr + sk_ai)
-            {
-                lij     = 1.0/(dr-sk_ai);
-                dlij    = 1.0;
-                raj_inv = 1.0/raj;
-
-                if (raj > dr-sk_ai)
-                {
-                    lij  = raj_inv;
-                    dlij = 0.0;
-                }
-
-                lij2     = lij  * lij;
-                lij3     = lij2 * lij;
-
-                uij      = 1.0/(dr+sk_ai);
-                uij2     = uij  * uij;
-                uij3     = uij2 * uij;
-
-                diff2    = uij2-lij2;
-
-                lij_inv  = gmx::invsqrt(lij2);
-                sk2      =  sk2_ai; /* sk2_ai = sk_ai * sk_ai in i loop above */
-                sk2_rinv = sk2*rinv;
-                prod     = 0.25 * sk2_rinv;
-
-                /* log_term = table_log(uij*lij_inv,born->log_table,LOG_TABLE_ACCURACY); */
-                log_term = std::log(uij*lij_inv);
-
-                tmp      = lij-uij + 0.25*dr*diff2 + (0.5*rinv)*log_term + prod*(-diff2);
-
-                if (raj < sk_ai-dr)
-                {
-                    tmp     = tmp + 2.0 * (raj_inv-lij);
-                }
-
-                t1      = 0.5*lij2 + prod*lij3 - 0.25*(lij*rinv+lij3*dr);
-                t2      = -0.5*uij2 - 0.25*sk2_rinv*uij3 + 0.25*(uij*rinv+uij3*dr);
-                t3      = 0.125*(1.0+sk2_rinv*rinv)*(-diff2)+0.25*log_term*rinv*rinv;
-
-                dadxj = (dlij*t1+t2+t3)*rinv; /* rb2 is moved to chainrule     */
-
-                born->gpol_hct_work[k] += 0.5*tmp;
-            }
-            else
-            {
-                dadxj = 0.0;
-            }
-            fr->dadx[n++] = dadxi;
-            fr->dadx[n++] = dadxj;
-        }
-        born->gpol_hct_work[i] += sum_ai;
-    }
-
-    /* Parallel summations would go here if ever implemented with DD */
-
-    if (gb_algorithm == egbHCT)
-    {
-        /* HCT */
-        for (i = 0; i < natoms; i++)
-        {
-            if (born->use[i] != 0)
-            {
-                rai     = top->atomtypes.gb_radius[mdatoms->typeA[i]]-born->gb_doffset;
-                sum_ai  = 1.0/rai - born->gpol_hct_work[i];
-                min_rad = rai + born->gb_doffset;
-                rad     = 1.0/sum_ai;
-
-                born->bRad[i]   = std::max(rad, min_rad);
-                fr->invsqrta[i] = gmx::invsqrt(born->bRad[i]);
-            }
-        }
-
-    }
-    else
-    {
-        /* OBC */
-        /* Calculate the radii */
-        for (i = 0; i < natoms; i++)
-        {
-            if (born->use[i] != 0)
-            {
-                rai        = top->atomtypes.gb_radius[mdatoms->typeA[i]];
-                rai_inv2   = 1.0/rai;
-                rai        = rai-doffset;
-                rai_inv    = 1.0/rai;
-                sum_ai     = rai * born->gpol_hct_work[i];
-                sum_ai2    = sum_ai  * sum_ai;
-                sum_ai3    = sum_ai2 * sum_ai;
-
-                tsum          = tanh(born->obc_alpha*sum_ai-born->obc_beta*sum_ai2+born->obc_gamma*sum_ai3);
-                born->bRad[i] = rai_inv - tsum*rai_inv2;
-                born->bRad[i] = 1.0 / born->bRad[i];
-
-                fr->invsqrta[i] = gmx::invsqrt(born->bRad[i]);
-
-                tchain         = rai * (born->obc_alpha-2*born->obc_beta*sum_ai+3*born->obc_gamma*sum_ai2);
-                born->drobc[i] = (1.0-tsum*tsum)*tchain*rai_inv2;
-            }
-        }
-    }
-    return 0;
-}
-
-
-
-
-
-int
-genborn_allvsall_calc_chainrule(t_forcerec *           fr,
-                                t_mdatoms *            mdatoms,
-                                gmx_genborn_t *        born,
-                                real *                 x,
-                                real *                 f,
-                                int                    gb_algorithm,
-                                void *                 work)
-{
-    gmx_allvsallgb2_data_t *aadata;
-    int                     natoms;
-    int                     ni0, ni1;
-    int                     nj0, nj1, nj2;
-    int                     i, j, k, n;
-    int                     idx;
-    int              *      mask;
-
-    real                    ix, iy, iz;
-    real                    fix, fiy, fiz;
-    real                    jx, jy, jz;
-    real                    dx, dy, dz;
-    real                    tx, ty, tz;
-    real                    rbai, rbaj, fgb, fgb_ai, rbi;
-    real              *     rb;
-    real              *     dadx;
-
-    natoms              = mdatoms->nr;
-    ni0                 = 0;
-    ni1                 = mdatoms->homenr;
-    dadx                = fr->dadx;
-
-    aadata = (gmx_allvsallgb2_data_t *)work;
-
-    n  = 0;
-    rb = born->work;
-
-    /* Loop to get the proper form for the Born radius term */
-    if (gb_algorithm == egbSTILL)
-    {
-        for (i = 0; i < natoms; i++)
-        {
-            rbi   = born->bRad[i];
-            rb[i] = (2 * rbi * rbi * fr->dvda[i])/ONE_4PI_EPS0;
-        }
-    }
-    else if (gb_algorithm == egbHCT)
-    {
-        for (i = 0; i < natoms; i++)
-        {
-            rbi   = born->bRad[i];
-            rb[i] = rbi * rbi * fr->dvda[i];
-        }
-    }
-    else if (gb_algorithm == egbOBC)
-    {
-        for (idx = 0; idx < natoms; idx++)
-        {
-            rbi     = born->bRad[idx];
-            rb[idx] = rbi * rbi * born->drobc[idx] * fr->dvda[idx];
-        }
-    }
-
-    for (i = ni0; i < ni1; i++)
-    {
-        /* We assume shifts are NOT used for all-vs-all interactions */
-
-        /* Load i atom data */
-        ix                = x[3*i];
-        iy                = x[3*i+1];
-        iz                = x[3*i+2];
-
-        fix               = 0;
-        fiy               = 0;
-        fiz               = 0;
-
-        rbai              = rb[i];
-
-        /* Load limits for loop over neighbors */
-        nj0              = aadata->jindex_gb[3*i];
-        nj1              = aadata->jindex_gb[3*i+1];
-        nj2              = aadata->jindex_gb[3*i+2];
-
-        mask             = aadata->exclusion_mask_gb[i];
-
-        /* Prologue part, including exclusion mask */
-        for (j = nj0; j < nj1; j++, mask++)
-        {
-            if (*mask != 0)
-            {
-                k = j%natoms;
-
-                /* load j atom coordinates */
-                jx                = x[3*k];
-                jy                = x[3*k+1];
-                jz                = x[3*k+2];
-
-                /* Calculate distance */
-                dx                = ix - jx;
-                dy                = iy - jy;
-                dz                = iz - jz;
-
-                rbaj              = rb[k];
-
-                fgb     = rbai*dadx[n++];
-                fgb_ai  = rbaj*dadx[n++];
-
-                /* Total force between ai and aj is the sum of ai->aj and aj->ai */
-                fgb     = fgb + fgb_ai;
-
-                tx      = fgb * dx;
-                ty      = fgb * dy;
-                tz      = fgb * dz;
-
-                fix     = fix + tx;
-                fiy     = fiy + ty;
-                fiz     = fiz + tz;
-
-                /* Update force on atom aj */
-                f[3*k]   = f[3*k] - tx;
-                f[3*k+1] = f[3*k+1] - ty;
-                f[3*k+2] = f[3*k+2] - tz;
-            }
-        }
-
-        /* Main part, no exclusions */
-        for (j = nj1; j < nj2; j++)
-        {
-            k = j%natoms;
-
-            /* load j atom coordinates */
-            jx                = x[3*k];
-            jy                = x[3*k+1];
-            jz                = x[3*k+2];
-
-            /* Calculate distance */
-            dx                = ix - jx;
-            dy                = iy - jy;
-            dz                = iz - jz;
-
-            rbaj              = rb[k];
-
-            fgb     = rbai*dadx[n++];
-            fgb_ai  = rbaj*dadx[n++];
-
-            /* Total force between ai and aj is the sum of ai->aj and aj->ai */
-            fgb     = fgb + fgb_ai;
-
-            tx      = fgb * dx;
-            ty      = fgb * dy;
-            tz      = fgb * dz;
-
-            fix     = fix + tx;
-            fiy     = fiy + ty;
-            fiz     = fiz + tz;
-
-            /* Update force on atom aj */
-            f[3*k]   = f[3*k] - tx;
-            f[3*k+1] = f[3*k+1] - ty;
-            f[3*k+2] = f[3*k+2] - tz;
-        }
-        /* Update force and shift forces on atom ai */
-        f[3*i]   = f[3*i] + fix;
-        f[3*i+1] = f[3*i+1] + fiy;
-        f[3*i+2] = f[3*i+2] + fiz;
-    }
-
-    return 0;
-}
diff --git a/src/gromacs/mdlib/genborn_allvsall.h b/src/gromacs/mdlib/genborn_allvsall.h
deleted file mode 100644 (file)
index da0f3fa..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2009, The GROMACS Development Team.
- * Copyright (c) 2010,2014,2015, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
- * and including many others, as listed in the AUTHORS file in the
- * top-level source directory and at http://www.gromacs.org.
- *
- * GROMACS is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * GROMACS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GROMACS; if not, see
- * http://www.gnu.org/licenses, or write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
- *
- * If you want to redistribute modifications to GROMACS, please
- * consider that scientific software is very special. Version
- * control is crucial - bugs must be traceable. We will be happy to
- * consider code for inclusion in the official distribution, but
- * derived work must not be called official GROMACS. Details are found
- * in the README & COPYING files - if they are missing, get the
- * official version at http://www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the research papers on the package. Check out http://www.gromacs.org.
- */
-#ifndef _GENBORN_ALLVSALL_H
-#define _GENBORN_ALLVSALL_H
-
-#include "gromacs/utility/real.h"
-
-struct gmx_genborn_t;
-struct gmx_localtop_t;
-struct t_forcerec;
-struct t_mdatoms;
-
-int
-genborn_allvsall_calc_still_radii(struct t_forcerec *           fr,
-                                  t_mdatoms        *            mdatoms,
-                                  gmx_genborn_t        *        born,
-                                  gmx_localtop_t        *       top,
-                                  real        *                 x,
-                                  void        *                 work);
-
-int
-genborn_allvsall_calc_hct_obc_radii(struct t_forcerec *           fr,
-                                    t_mdatoms        *            mdatoms,
-                                    gmx_genborn_t        *        born,
-                                    int                           gb_algorithm,
-                                    gmx_localtop_t        *       top,
-                                    real        *                 x,
-                                    void        *                 work);
-
-int
-genborn_allvsall_calc_chainrule(struct t_forcerec *           fr,
-                                t_mdatoms        *            mdatoms,
-                                gmx_genborn_t        *        born,
-                                real        *                 x,
-                                real        *                 f,
-                                int                           gb_algorithm,
-                                void        *                 work);
-
-#endif
index 4f04591d38e7ed7e76999682b397d4afe90cb742..d8df2950446a29187303b94c54f2f16ab88c3ed8 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
index 272c69797e5c7a92893c02b73326c9c58ac418c2..5def900acb4d3c60db7f4e5fd7eb83ca39e6d1c7 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -55,6 +55,7 @@
 class energyhistory_t;
 struct gmx_mtop_t;
 struct gmx_membed_t;
+struct gmx_multisim_t;
 struct gmx_output_env_t;
 struct MdrunOptions;
 struct ObservablesHistory;
@@ -75,6 +76,7 @@ class MDAtoms;
  *
  * \param[in] fplog               Log file for output
  * \param[in] cr                  Communication record
+ * \param[in] ms                  Handle to multi-simulation handler.
  * \param[in] mdlog               Log writer for important output
  * \param[in] nfile               Number of files
  * \param[in] fnm                 Filename structure array
@@ -96,7 +98,9 @@ class MDAtoms;
  * \param[in] membed              Membrane embedding data structure
  * \param[in] walltime_accounting More timing information
  */
-typedef double integrator_t (FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
+typedef double integrator_t (FILE *fplog, t_commrec *cr,
+                             const gmx_multisim_t *ms,
+                             const gmx::MDLogger &mdlog,
                              int nfile, const t_filenm fnm[],
                              const gmx_output_env_t *oenv,
                              const MdrunOptions &mdrunOptions,
index 06fef9dbf8ed645fbaed30dcd3a211334a6a75d3..642542c0d89e325f5b9321cc3f21d11542a1e8e5 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -55,6 +55,7 @@
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/futil.h"
+#include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/gmxmpi.h"
 #include "gromacs/utility/path.h"
 #include "gromacs/utility/programcontext.h"
@@ -238,50 +239,53 @@ void gmx_log_close(FILE *fp)
 }
 
 // TODO move this to multi-sim module
-void init_multisystem(t_commrec *cr, int nsim, char **multidirs,
-                      int nfile, const t_filenm fnm[])
+gmx_multisim_t *init_multisystem(MPI_Comm comm, int nsim, char **multidirs)
 {
     gmx_multisim_t *ms;
-    int             nnodes, nnodpersim, sim, i;
 #if GMX_MPI
     MPI_Group       mpi_group_world;
     int            *rank;
 #endif
 
-#if !GMX_MPI
-    if (nsim > 1)
+    if (nsim <= 1)
     {
-        gmx_fatal(FARGS, "This binary is compiled without MPI support, can not do multiple simulations.");
+        return nullptr;
     }
-#endif
+    if (!GMX_LIB_MPI && nsim > 1)
+    {
+        gmx_fatal(FARGS, "mdrun -multidir is only supported when GROMACS has been "
+                  "configured with a proper external MPI library.");
+    }
+    GMX_RELEASE_ASSERT(multidirs, "Must have multiple directories for -multisim");
 
-    nnodes  = cr->nnodes;
-    if (nnodes % nsim != 0)
+#if GMX_MPI
+    int numRanks;
+    MPI_Comm_size(comm, &numRanks);
+    if (numRanks % nsim != 0)
     {
-        gmx_fatal(FARGS, "The number of ranks (%d) is not a multiple of the number of simulations (%d)", nnodes, nsim);
+        gmx_fatal(FARGS, "The number of ranks (%d) is not a multiple of the number of simulations (%d)", numRanks, nsim);
     }
 
-    nnodpersim = nnodes/nsim;
-    sim        = cr->nodeid/nnodpersim;
+    int numRanksPerSim = numRanks/nsim;
+    int rankWithinComm;
+    MPI_Comm_rank(comm, &rankWithinComm);
 
     if (debug)
     {
-        fprintf(debug, "We have %d simulations, %d ranks per simulation, local simulation is %d\n", nsim, nnodpersim, sim);
+        fprintf(debug, "We have %d simulations, %d ranks per simulation, local simulation is %d\n", nsim, numRanksPerSim, rankWithinComm/numRanksPerSim);
     }
 
-    snew(ms, 1);
-    cr->ms   = ms;
+    ms       = new gmx_multisim_t;
     ms->nsim = nsim;
-    ms->sim  = sim;
-#if GMX_MPI
+    ms->sim  = rankWithinComm/numRanksPerSim;
     /* Create a communicator for the master nodes */
     snew(rank, ms->nsim);
-    for (i = 0; i < ms->nsim; i++)
+    for (int i = 0; i < ms->nsim; i++)
     {
-        rank[i] = i*nnodpersim;
+        rank[i] = i*numRanksPerSim;
     }
-    MPI_Comm_group(MPI_COMM_WORLD, &mpi_group_world);
-    MPI_Group_incl(mpi_group_world, nsim, rank, &ms->mpi_group_masters);
+    MPI_Comm_group(comm, &mpi_group_world);
+    MPI_Group_incl(mpi_group_world, ms->nsim, rank, &ms->mpi_group_masters);
     sfree(rank);
     MPI_Comm_create(MPI_COMM_WORLD, ms->mpi_group_masters,
                     &ms->mpi_comm_masters);
@@ -299,60 +303,21 @@ void init_multisystem(t_commrec *cr, int nsim, char **multidirs,
     ms->mpb->dbuf_alloc  = 0;
 #endif
 
+    // TODO This should throw upon error
+    gmx_chdir(multidirs[ms->sim]);
+#else
+    GMX_UNUSED_VALUE(comm);
+    ms = nullptr;
 #endif
 
-    /* Reduce the intra-simulation communication */
-    cr->sim_nodeid = cr->nodeid % nnodpersim;
-    cr->nnodes     = nnodpersim;
-#if GMX_MPI
-    MPI_Comm_split(MPI_COMM_WORLD, sim, cr->sim_nodeid, &cr->mpi_comm_mysim);
-    cr->mpi_comm_mygroup = cr->mpi_comm_mysim;
-    cr->nodeid           = cr->sim_nodeid;
-#endif
-
-    if (debug)
-    {
-        fprintf(debug, "This is simulation %d", cr->ms->sim);
-        if (PAR(cr))
-        {
-            fprintf(debug, ", local number of ranks %d, local rank ID %d",
-                    cr->nnodes, cr->sim_nodeid);
-        }
-        fprintf(debug, "\n\n");
-    }
+    return ms;
+}
 
-    if (multidirs)
-    {
-        if (debug)
-        {
-            fprintf(debug, "Changing to directory %s\n", multidirs[cr->ms->sim]);
-        }
-        gmx_chdir(multidirs[cr->ms->sim]);
-    }
-    else
+void done_multisim(gmx_multisim_t *ms)
+{
+    if (nullptr != ms)
     {
-        try
-        {
-            std::string rankString = gmx::formatString("%d", cr->ms->sim);
-            /* Patch output and tpx, cpt and rerun input file names */
-            for (i = 0; (i < nfile); i++)
-            {
-                /* Because of possible multiple extensions per type we must look
-                 * at the actual file name for rerun. */
-                if (is_output(&fnm[i]) ||
-                    fnm[i].ftp == efTPR || fnm[i].ftp == efCPT ||
-                    strcmp(fnm[i].opt, "-rerun") == 0)
-                {
-                    std::string newFileName = gmx::Path::concatenateBeforeExtension(fnm[i].fns[0], rankString);
-                    sfree(fnm[i].fns[0]);
-                    fnm[i].fns[0] = gmx_strdup(newFileName.c_str());
-                }
-            }
-        }
-        catch (gmx::GromacsException &e)
-        {
-            e.prependContext(gmx::formatString("Failed to modify mdrun -multi filename to add per-simulation suffix. You could perhaps reorganize your files and try mdrun -multidir.\n"));
-            throw;
-        }
+        done_mpi_in_place_buf(ms->mpb);
+        delete ms;
     }
 }
index 23c100987d268b3a00f9dca091aaacfee31ad392..f7c77b87d835d945cd7b2a7abada6c5bb0761ffd 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -40,6 +40,7 @@
 #include <stdio.h>
 
 #include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/gmxmpi.h"
 
 struct gmx_multisim_t;
 struct t_commrec;
@@ -60,17 +61,19 @@ void check_multi_int(FILE *log, const gmx_multisim_t *ms,
 void check_multi_int64(FILE *log, const gmx_multisim_t *ms,
                        gmx_int64_t val, const char *name,
                        gmx_bool bQuiet);
-/* Check if val is the same on all processors for a mdrun -multi run
+/* Check if val is the same on all processors for a mdrun -multidir run
  * The string name is used to print to the log file and in a fatal error
  * if the val's don't match. If bQuiet is true and the check passes,
  * no output is written.
  */
 
-void init_multisystem(t_commrec *cr, int nsim, char **multidirs,
-                      int nfile, const t_filenm fnm[]);
+gmx_multisim_t *init_multisystem(MPI_Comm comm, int nsim, char **multidirs);
 /* Splits the communication into nsim separate simulations
  * and creates a communication structure between the master
  * these simulations.
  */
 
+//! Cleans up multi-system handler.
+void done_multisim(gmx_multisim_t *ms);
+
 #endif
index 72d90484dbd69c3d0169f73a104ec29b4881fde6..b25a37cf3e95d5ebfdf5fb3a445b8b7a6f3bbb67 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
index ddee3c679219a8ea3b25edd9c4d5511a46d48d56..e6b092da974e4384e2f71d782f4bbc5174fba0d3 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
index d18e8be1577f4b193b7fda3911f9beaf92953e21..b7c3513a4c67abaecb049e8be8cb70f03922a082 100644 (file)
@@ -241,18 +241,6 @@ t_mdebin *init_mdebin(ener_file_t       fp_ene,
         {
             md->bEner[i] = TRUE;
         }
-        else if ((i == F_GBPOL) && ir->implicit_solvent == eisGBSA)
-        {
-            md->bEner[i] = TRUE;
-        }
-        else if ((i == F_NPSOLVATION) && ir->implicit_solvent == eisGBSA && (ir->sa_algorithm != esaNO))
-        {
-            md->bEner[i] = TRUE;
-        }
-        else if ((i == F_GB12) || (i == F_GB13) || (i == F_GB14))
-        {
-            md->bEner[i] = FALSE;
-        }
         else if ((i == F_ETOT) || (i == F_EKIN) || (i == F_TEMP))
         {
             md->bEner[i] = EI_DYNAMICS(ir->eI);
index 9d91152c84b77ce2767bf55521e3c0a91f43b03a..f82d63f54b991febbc15831d66eec85bbe15e0c5 100644 (file)
@@ -54,6 +54,7 @@
 #include "gromacs/mdtypes/md_enums.h"
 #include "gromacs/mdtypes/state.h"
 #include "gromacs/timing/wallcycle.h"
+#include "gromacs/topology/topology.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/pleasecite.h"
 #include "gromacs/utility/smalloc.h"
index 4f435041daf92404ee1874defc07c87eb9e0863d..b4a1dbd2173962a759fb9f88be0c2d87405582a2 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #ifndef GMX_MDLIB_MDSETUP_H
 #define GMX_MDLIB_MDSETUP_H
 
-#include "gromacs/mdlib/mdatoms.h"
-#include "gromacs/mdlib/shellfc.h"
-#include "gromacs/mdlib/vsite.h"
-#include "gromacs/mdtypes/commrec.h"
-#include "gromacs/mdtypes/forcerec.h"
-#include "gromacs/mdtypes/inputrec.h"
-#include "gromacs/pbcutil/mshift.h"
-#include "gromacs/topology/topology.h"
+struct gmx_localtop_t;
+struct gmx_mtop_t;
+struct gmx_shellfc_t;
+struct gmx_vsite_t;
+struct t_commrec;
+struct t_forcerec;
+struct t_graph;
+struct t_inputrec;
+
+namespace gmx
+{
+class MDAtoms;
+}
 
 /*! \brief Sets atom data for several MD algorithms
  *
index a27575016d14266131847ff9d5e0c6bf55b85ba2..7362424b0eafe7135318cb95ad03658a916786a9 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -322,7 +322,9 @@ static void get_state_f_norm_max(t_commrec *cr,
 
 //! Initialize the energy minimization
 static void init_em(FILE *fplog, const char *title,
-                    t_commrec *cr, gmx::IMDOutputProvider *outputProvider,
+                    t_commrec *cr,
+                    const gmx_multisim_t *ms,
+                    gmx::IMDOutputProvider *outputProvider,
                     t_inputrec *ir,
                     const MdrunOptions &mdrunOptions,
                     t_state *state_global, gmx_mtop_t *top_global,
@@ -353,7 +355,7 @@ static void init_em(FILE *fplog, const char *title,
     init_nrnb(nrnb);
 
     /* Interactive molecular dynamics */
-    init_IMD(ir, cr, top_global, fplog, 1,
+    init_IMD(ir, cr, ms, top_global, fplog, 1,
              MASTER(cr) ? as_rvec_array(state_global->x.data()) : nullptr,
              nfile, fnm, nullptr, mdrunOptions);
 
@@ -440,7 +442,7 @@ static void init_em(FILE *fplog, const char *title,
             /* Constrain the starting coordinates */
             dvdl_constr = 0;
             constrain(PAR(cr) ? nullptr : fplog, TRUE, TRUE, constr, &(*top)->idef,
-                      ir, cr, -1, 0, 1.0, mdatoms,
+                      ir, cr, ms, -1, 0, 1.0, mdatoms,
                       as_rvec_array(ems->s.x.data()),
                       as_rvec_array(ems->s.x.data()),
                       nullptr,
@@ -560,7 +562,9 @@ static void write_em_traj(FILE *fplog, t_commrec *cr,
 //! \brief Do one minimization step
 //
 // \returns true when the step succeeded, false when a constraint error occurred
-static bool do_em_step(t_commrec *cr, t_inputrec *ir, t_mdatoms *md,
+static bool do_em_step(t_commrec *cr,
+                       const gmx_multisim_t *ms,
+                       t_inputrec *ir, t_mdatoms *md,
                        gmx_bool bMolPBC,
                        em_state_t *ems1, real a, const PaddedRVecVector *force,
                        em_state_t *ems2,
@@ -673,7 +677,7 @@ static bool do_em_step(t_commrec *cr, t_inputrec *ir, t_mdatoms *md,
         dvdl_constr = 0;
         validStep   =
             constrain(nullptr, TRUE, TRUE, constr, &top->idef,
-                      ir, cr, count, 0, 1.0, md,
+                      ir, cr, ms, count, 0, 1.0, md,
                       as_rvec_array(s1->x.data()), as_rvec_array(s2->x.data()),
                       nullptr, bMolPBC, s2->box,
                       s2->lambda[efptBONDED], &dvdl_constr,
@@ -710,6 +714,7 @@ static void em_dd_partition_system(FILE *fplog, int step, t_commrec *cr,
 
 //! De one energy evaluation
 static void evaluate_energy(FILE *fplog, t_commrec *cr,
+                            const gmx_multisim_t *ms,
                             gmx_mtop_t *top_global,
                             em_state_t *ems, gmx_localtop_t *top,
                             t_inputrec *inputrec,
@@ -765,11 +770,11 @@ static void evaluate_energy(FILE *fplog, t_commrec *cr,
     /* do_force always puts the charge groups in the box and shifts again
      * We do not unshift, so molecules are always whole in congrad.c
      */
-    do_force(fplog, cr, inputrec,
+    do_force(fplog, cr, ms, inputrec,
              count, nrnb, wcycle, top, &top_global->groups,
              ems->s.box, ems->s.x, &ems->s.hist,
              ems->f, force_vir, mdAtoms->mdatoms(), enerd, fcd,
-             ems->s.lambda, graph, fr, vsite, mu_tot, t, nullptr, TRUE,
+             ems->s.lambda, graph, fr, vsite, mu_tot, t, nullptr,
              GMX_FORCE_STATECHANGED | GMX_FORCE_ALLFORCES |
              GMX_FORCE_VIRIAL | GMX_FORCE_ENERGY |
              (bNS ? GMX_FORCE_NS : 0),
@@ -816,7 +821,7 @@ static void evaluate_energy(FILE *fplog, t_commrec *cr,
         dvdl_constr = 0;
         rvec *f_rvec = as_rvec_array(ems->f.data());
         constrain(nullptr, FALSE, FALSE, constr, &top->idef,
-                  inputrec, cr, count, 0, 1.0, mdAtoms->mdatoms(),
+                  inputrec, cr, ms, count, 0, 1.0, mdAtoms->mdatoms(),
                   as_rvec_array(ems->s.x.data()), f_rvec, f_rvec,
                   fr->bMolPBC, ems->s.box,
                   ems->s.lambda[efptBONDED], &dvdl_constr,
@@ -975,7 +980,9 @@ namespace gmx
 {
 
 /*! \brief Do conjugate gradients minimization
-    \copydoc integrator_t(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
+    \copydoc integrator_t(FILE *fplog, t_commrec *cr,
+                           const gmx_multi_sim_t *,
+                           const gmx::MDLogger &mdlog,
                            int nfile, const t_filenm fnm[],
                            const gmx_output_env_t *oenv,
                            const MdrunOptions &mdrunOptions,
@@ -992,7 +999,9 @@ namespace gmx
                            gmx_membed_t gmx_unused *membed,
                            gmx_walltime_accounting_t walltime_accounting)
  */
-double do_cg(FILE *fplog, t_commrec *cr, const gmx::MDLogger gmx_unused &mdlog,
+double do_cg(FILE *fplog, t_commrec *cr,
+             const gmx_multisim_t *ms,
+             const gmx::MDLogger gmx_unused &mdlog,
              int nfile, const t_filenm fnm[],
              const gmx_output_env_t gmx_unused *oenv,
              const MdrunOptions &mdrunOptions,
@@ -1043,7 +1052,7 @@ double do_cg(FILE *fplog, t_commrec *cr, const gmx::MDLogger gmx_unused &mdlog,
     em_state_t *s_c   = &s3;
 
     /* Init em and store the local state in s_min */
-    init_em(fplog, CG, cr, outputProvider, inputrec, mdrunOptions,
+    init_em(fplog, CG, cr, ms, outputProvider, inputrec, mdrunOptions,
             state_global, top_global, s_min, &top,
             nrnb, mu_tot, fr, &enerd, &graph, mdAtoms, &gstat,
             vsite, constr, nullptr,
@@ -1068,7 +1077,7 @@ double do_cg(FILE *fplog, t_commrec *cr, const gmx::MDLogger gmx_unused &mdlog,
     /* do_force always puts the charge groups in the box and shifts again
      * We do not unshift, so molecules are always whole in congrad.c
      */
-    evaluate_energy(fplog, cr,
+    evaluate_energy(fplog, cr, ms,
                     top_global, s_min, top,
                     inputrec, nrnb, wcycle, gstat,
                     vsite, constr, fcd, graph, mdAtoms, fr,
@@ -1241,12 +1250,12 @@ double do_cg(FILE *fplog, t_commrec *cr, const gmx::MDLogger gmx_unused &mdlog,
         }
 
         /* Take a trial step (new coords in s_c) */
-        do_em_step(cr, inputrec, mdatoms, fr->bMolPBC, s_min, c, &s_min->s.cg_p, s_c,
+        do_em_step(cr, ms, inputrec, mdatoms, fr->bMolPBC, s_min, c, &s_min->s.cg_p, s_c,
                    constr, top, nrnb, wcycle, -1);
 
         neval++;
         /* Calculate energy for the trial step */
-        evaluate_energy(fplog, cr,
+        evaluate_energy(fplog, cr, ms,
                         top_global, s_c, top,
                         inputrec, nrnb, wcycle, gstat,
                         vsite, constr, fcd, graph, mdAtoms, fr,
@@ -1350,12 +1359,12 @@ double do_cg(FILE *fplog, t_commrec *cr, const gmx::MDLogger gmx_unused &mdlog,
                 }
 
                 /* Take a trial step to this new point - new coords in s_b */
-                do_em_step(cr, inputrec, mdatoms, fr->bMolPBC, s_min, b, &s_min->s.cg_p, s_b,
+                do_em_step(cr, ms, inputrec, mdatoms, fr->bMolPBC, s_min, b, &s_min->s.cg_p, s_b,
                            constr, top, nrnb, wcycle, -1);
 
                 neval++;
                 /* Calculate energy for the trial step */
-                evaluate_energy(fplog, cr,
+                evaluate_energy(fplog, cr, ms,
                                 top_global, s_b, top,
                                 inputrec, nrnb, wcycle, gstat,
                                 vsite, constr, fcd, graph, mdAtoms, fr,
@@ -1620,7 +1629,9 @@ double do_cg(FILE *fplog, t_commrec *cr, const gmx::MDLogger gmx_unused &mdlog,
 
 
 /*! \brief Do L-BFGS conjugate gradients minimization
-    \copydoc integrator_t(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
+    \copydoc integrator_t(FILE *fplog, t_commrec *cr,
+                          const gmx_multi_sim_t *,
+                          const gmx::MDLogger &mdlog,
                           int nfile, const t_filenm fnm[],
                           const gmx_output_env_t *oenv,
                           const MdrunOptions &mdrunOptions,
@@ -1637,7 +1648,9 @@ double do_cg(FILE *fplog, t_commrec *cr, const gmx::MDLogger gmx_unused &mdlog,
                           gmx_membed_t gmx_unused *membed,
                           gmx_walltime_accounting_t walltime_accounting)
  */
-double do_lbfgs(FILE *fplog, t_commrec *cr, const gmx::MDLogger gmx_unused &mdlog,
+double do_lbfgs(FILE *fplog, t_commrec *cr,
+                const gmx_multisim_t *ms,
+                const gmx::MDLogger gmx_unused &mdlog,
                 int nfile, const t_filenm fnm[],
                 const gmx_output_env_t gmx_unused *oenv,
                 const MdrunOptions &mdrunOptions,
@@ -1712,7 +1725,7 @@ double do_lbfgs(FILE *fplog, t_commrec *cr, const gmx::MDLogger gmx_unused &mdlo
     neval = 0;
 
     /* Init em */
-    init_em(fplog, LBFGS, cr, outputProvider, inputrec, mdrunOptions,
+    init_em(fplog, LBFGS, cr, ms, outputProvider, inputrec, mdrunOptions,
             state_global, top_global, &ems, &top,
             nrnb, mu_tot, fr, &enerd, &graph, mdAtoms, &gstat,
             vsite, constr, nullptr,
@@ -1774,7 +1787,7 @@ double do_lbfgs(FILE *fplog, t_commrec *cr, const gmx::MDLogger gmx_unused &mdlo
      * We do not unshift, so molecules are always whole
      */
     neval++;
-    evaluate_energy(fplog, cr,
+    evaluate_energy(fplog, cr, ms,
                     top_global, &ems, top,
                     inputrec, nrnb, wcycle, gstat,
                     vsite, constr, fcd, graph, mdAtoms, fr,
@@ -1980,7 +1993,7 @@ double do_lbfgs(FILE *fplog, t_commrec *cr, const gmx::MDLogger gmx_unused &mdlo
 
         neval++;
         // Calculate energy for the trial step in position C
-        evaluate_energy(fplog, cr,
+        evaluate_energy(fplog, cr, ms,
                         top_global, sc, top,
                         inputrec, nrnb, wcycle, gstat,
                         vsite, constr, fcd, graph, mdAtoms, fr,
@@ -2071,7 +2084,7 @@ double do_lbfgs(FILE *fplog, t_commrec *cr, const gmx::MDLogger gmx_unused &mdlo
 
                 neval++;
                 // Calculate energy for the trial step in point B
-                evaluate_energy(fplog, cr,
+                evaluate_energy(fplog, cr, ms,
                                 top_global, sb, top,
                                 inputrec, nrnb, wcycle, gstat,
                                 vsite, constr, fcd, graph, mdAtoms, fr,
@@ -2386,7 +2399,9 @@ double do_lbfgs(FILE *fplog, t_commrec *cr, const gmx::MDLogger gmx_unused &mdlo
 }   /* That's all folks */
 
 /*! \brief Do steepest descents minimization
-    \copydoc integrator_t(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
+    \copydoc integrator_t(FILE *fplog, t_commrec *cr,
+                          const gmx_multi_sim_t *,
+                          const gmx::MDLogger &mdlog,
                           int nfile, const t_filenm fnm[],
                           const gmx_output_env_t *oenv,
                           const MdrunOptions &mdrunOptions,
@@ -2402,7 +2417,9 @@ double do_lbfgs(FILE *fplog, t_commrec *cr, const gmx::MDLogger gmx_unused &mdlo
                           const ReplicaExchangeParameters &replExParams,
                           gmx_walltime_accounting_t walltime_accounting)
  */
-double do_steep(FILE *fplog, t_commrec *cr, const gmx::MDLogger gmx_unused &mdlog,
+double do_steep(FILE *fplog, t_commrec *cr,
+                const gmx_multisim_t *ms,
+                const gmx::MDLogger gmx_unused &mdlog,
                 int nfile, const t_filenm fnm[],
                 const gmx_output_env_t gmx_unused *oenv,
                 const MdrunOptions &mdrunOptions,
@@ -2442,7 +2459,7 @@ double do_steep(FILE *fplog, t_commrec *cr, const gmx::MDLogger gmx_unused &mdlo
     em_state_t *s_try = &s1;
 
     /* Init em and store the local state in s_try */
-    init_em(fplog, SD, cr, outputProvider, inputrec, mdrunOptions,
+    init_em(fplog, SD, cr, ms, outputProvider, inputrec, mdrunOptions,
             state_global, top_global, s_try, &top,
             nrnb, mu_tot, fr, &enerd, &graph, mdAtoms, &gstat,
             vsite, constr, nullptr,
@@ -2488,14 +2505,14 @@ double do_steep(FILE *fplog, t_commrec *cr, const gmx::MDLogger gmx_unused &mdlo
         if (count > 0)
         {
             validStep =
-                do_em_step(cr, inputrec, mdatoms, fr->bMolPBC,
+                do_em_step(cr, ms, inputrec, mdatoms, fr->bMolPBC,
                            s_min, stepsize, &s_min->f, s_try,
                            constr, top, nrnb, wcycle, count);
         }
 
         if (validStep)
         {
-            evaluate_energy(fplog, cr,
+            evaluate_energy(fplog, cr, ms,
                             top_global, s_try, top,
                             inputrec, nrnb, wcycle, gstat,
                             vsite, constr, fcd, graph, mdAtoms, fr,
@@ -2652,7 +2669,9 @@ double do_steep(FILE *fplog, t_commrec *cr, const gmx::MDLogger gmx_unused &mdlo
 }   /* That's all folks */
 
 /*! \brief Do normal modes analysis
-    \copydoc integrator_t(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
+    \copydoc integrator_t(FILE *fplog, t_commrec *cr,
+                          const gmx_multi_sim_t *,
+                          const gmx::MDLogger &mdlog,
                           int nfile, const t_filenm fnm[],
                           const gmx_output_env_t *oenv,
                           const MdrunOptions &mdrunOptions,
@@ -2668,7 +2687,9 @@ double do_steep(FILE *fplog, t_commrec *cr, const gmx::MDLogger gmx_unused &mdlo
                           const ReplicaExchangeParameters &replExParams,
                           gmx_walltime_accounting_t walltime_accounting)
  */
-double do_nm(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
+double do_nm(FILE *fplog, t_commrec *cr,
+             const gmx_multisim_t *ms,
+             const gmx::MDLogger &mdlog,
              int nfile, const t_filenm fnm[],
              const gmx_output_env_t gmx_unused *oenv,
              const MdrunOptions &mdrunOptions,
@@ -2717,7 +2738,7 @@ double do_nm(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
     em_state_t     state_work {};
 
     /* Init em and store the local state in state_minimum */
-    init_em(fplog, NM, cr, outputProvider, inputrec, mdrunOptions,
+    init_em(fplog, NM, cr, ms, outputProvider, inputrec, mdrunOptions,
             state_global, top_global, &state_work, &top,
             nrnb, mu_tot, fr, &enerd, &graph, mdAtoms, &gstat,
             vsite, constr, &shellfc,
@@ -2796,7 +2817,7 @@ double do_nm(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
 
     /* Make evaluate_energy do a single node force calculation */
     cr->nnodes = 1;
-    evaluate_energy(fplog, cr,
+    evaluate_energy(fplog, cr, ms,
                     top_global, &state_work, top,
                     inputrec, nrnb, wcycle, gstat,
                     vsite, constr, fcd, graph, mdAtoms, fr,
@@ -2832,7 +2853,6 @@ double do_nm(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
         size_t atom = atom_index[aid];
         for (size_t d = 0; d < DIM; d++)
         {
-            gmx_bool    bBornRadii  = FALSE;
             gmx_int64_t step        = 0;
             int         force_flags = GMX_FORCE_STATECHANGED | GMX_FORCE_ALLFORCES;
             double      t           = 0;
@@ -2855,13 +2875,13 @@ double do_nm(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
                 if (shellfc)
                 {
                     /* Now is the time to relax the shells */
-                    (void) relax_shell_flexcon(fplog, cr, mdrunOptions.verbose, step,
+                    (void) relax_shell_flexcon(fplog, cr, ms, mdrunOptions.verbose, step,
                                                inputrec, bNS, force_flags,
                                                top,
                                                constr, enerd, fcd,
                                                &state_work.s, &state_work.f, vir, mdatoms,
                                                nrnb, wcycle, graph, &top_global->groups,
-                                               shellfc, fr, bBornRadii, t, mu_tot,
+                                               shellfc, fr, t, mu_tot,
                                                vsite,
                                                DdOpenBalanceRegionBeforeForceComputation::no,
                                                DdCloseBalanceRegionAfterForceComputation::no);
@@ -2870,7 +2890,7 @@ double do_nm(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
                 }
                 else
                 {
-                    evaluate_energy(fplog, cr,
+                    evaluate_energy(fplog, cr, ms,
                                     top_global, &state_work, top,
                                     inputrec, nrnb, wcycle, gstat,
                                     vsite, constr, fcd, graph, mdAtoms, fr,
index 42a5a244142315bb9837a82d77809f1f33d7da58..1d37c91145bf51f75d057adac2e86ccf7bb508ec 100644 (file)
 #include "gromacs/mdlib/nbnxn_internal.h"
 #include "gromacs/mdlib/nbnxn_search.h"
 #include "gromacs/mdlib/nbnxn_util.h"
+#include "gromacs/mdtypes/forcerec.h" // only for GET_CGINFO_*
+#include "gromacs/mdtypes/mdatom.h"
 #include "gromacs/pbcutil/ishift.h"
 #include "gromacs/simd/simd.h"
+#include "gromacs/timing/wallcycle.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/gmxomp.h"
@@ -1057,8 +1060,12 @@ void nbnxn_atomdata_copy_x_to_nbat_x(const nbnxn_search_t nbs,
                                      int                  locality,
                                      gmx_bool             FillLocal,
                                      rvec                *x,
-                                     nbnxn_atomdata_t    *nbat)
+                                     nbnxn_atomdata_t    *nbat,
+                                     gmx_wallcycle       *wcycle)
 {
+    wallcycle_start(wcycle, ewcNB_XF_BUF_OPS);
+    wallcycle_sub_start(wcycle, ewcsNB_X_BUF_OPS);
+
     int g0 = 0, g1 = 0;
     int nth, th;
 
@@ -1127,6 +1134,9 @@ void nbnxn_atomdata_copy_x_to_nbat_x(const nbnxn_search_t nbs,
         }
         GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
     }
+
+    wallcycle_sub_stop(wcycle, ewcsNB_X_BUF_OPS);
+    wallcycle_stop(wcycle, ewcNB_XF_BUF_OPS);
 }
 
 static void
@@ -1323,7 +1333,7 @@ nbnxn_atomdata_add_nbat_f_to_f_part(const nbnxn_search_t nbs,
     }
 }
 
-static gmx_inline unsigned char reverse_bits(unsigned char b)
+static inline unsigned char reverse_bits(unsigned char b)
 {
     /* http://graphics.stanford.edu/~seander/bithacks.html#ReverseByteWith64BitsDiv */
     return (b * 0x0202020202ULL & 0x010884422010ULL) % 1023;
@@ -1514,8 +1524,12 @@ static void nbnxn_atomdata_add_nbat_f_to_f_stdreduce(const nbnxn_atomdata_t *nba
 void nbnxn_atomdata_add_nbat_f_to_f(const nbnxn_search_t    nbs,
                                     int                     locality,
                                     const nbnxn_atomdata_t *nbat,
-                                    rvec                   *f)
+                                    rvec                   *f,
+                                    gmx_wallcycle          *wcycle)
 {
+    wallcycle_start(wcycle, ewcNB_XF_BUF_OPS);
+    wallcycle_sub_start(wcycle, ewcsNB_F_BUF_OPS);
+
     int a0 = 0, na = 0;
 
     nbs_cycle_start(&nbs->cc[enbsCCreducef]);
@@ -1573,6 +1587,9 @@ void nbnxn_atomdata_add_nbat_f_to_f(const nbnxn_search_t    nbs,
     }
 
     nbs_cycle_stop(&nbs->cc[enbsCCreducef]);
+
+    wallcycle_sub_stop(wcycle, ewcsNB_F_BUF_OPS);
+    wallcycle_stop(wcycle, ewcNB_XF_BUF_OPS);
 }
 
 /* Adds the shift forces from nbnxn_atomdata_t to fshift */
index d1d594e9e5f15915ebe405d6a9b8b860a0e4e288..d6c7eaf017b9e904afb72917589b8b81fd7719c9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -49,6 +49,7 @@ class MDLogger;
 }
 
 struct t_mdatoms;
+struct gmx_wallcycle;
 
 /* Default nbnxn allocation routine, allocates 32 byte aligned,
  * which works for plain C and aligned SSE and AVX loads/stores.
@@ -112,13 +113,15 @@ void nbnxn_atomdata_copy_x_to_nbat_x(const nbnxn_search_t nbs,
                                      int                  locality,
                                      gmx_bool             FillLocal,
                                      rvec                *x,
-                                     nbnxn_atomdata_t    *nbat);
+                                     nbnxn_atomdata_t    *nbat,
+                                     gmx_wallcycle       *wcycle);
 
 /* Add the forces stored in nbat to f, zeros the forces in nbat */
 void nbnxn_atomdata_add_nbat_f_to_f(const nbnxn_search_t    nbs,
                                     int                     locality,
                                     const nbnxn_atomdata_t *nbat,
-                                    rvec                   *f);
+                                    rvec                   *f,
+                                    gmx_wallcycle          *wcycle);
 
 /* Add the fshift force stored in nbat to fshift */
 void nbnxn_atomdata_add_nbat_fshift_to_fshift(const nbnxn_atomdata_t *nbat,
index 1bca13b767d5d98a2f7bcb124521f514bbe889b2..7010ae6dc296dfab736743a1e3ba8fb7516ea80b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 
 #include "nbnxn_cuda_types.h"
 
-/*
- * Texture references are created at compile-time and need to be declared
- * at file scope as global variables (see http://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#texture-reference-api).
- * The texture references below are used in two translation units;
- * we declare them here along the kernels that use them (when compiling legacy Fermi kernels),
- * and provide getters (see below) used by the data_mgmt module where the
- * textures are bound/unbound.
- * (In principle we could do it the other way arond, but that would likely require
- * device linking and we'd rather avoid technical hurdles.)
- */
-/*! Texture reference for LJ C6/C12 parameters; bound to cu_nbparam_t.nbfp */
-texture<float, 1, cudaReadModeElementType> nbfp_texref;
-
-/*! Texture reference for LJ-PME parameters; bound to cu_nbparam_t.nbfp_comb */
-texture<float, 1, cudaReadModeElementType> nbfp_comb_texref;
-
-/*! Texture reference for Ewald coulomb force table; bound to cu_nbparam_t.coulomb_tab */
-texture<float, 1, cudaReadModeElementType> coulomb_tab_texref;
-
 
 /***** The kernel declarations/definitions come here *****/
 
@@ -124,14 +105,6 @@ texture<float, 1, cudaReadModeElementType> coulomb_tab_texref;
 #include "gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel_VF_noprune.cu"
 #include "gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel_VF_prune.cu"
 #include "gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel_pruneonly.cu"
-#else
-/* Prevent compilation in multiple compilation unit mode for CC 2.x. Although we have
- * build-time checks to prevent this, the user could manually tweaks nvcc flags
- * which would lead to buggy kernels getting compiled.
- */
-#if GMX_PTX_ARCH > 0 && GMX_PTX_ARCH <= 210 && !defined(__clang__)
-#error Due to an CUDA nvcc compiler bug, the CUDA non-bonded module can not be compiled with multiple compilation units for CC 2.x devices. If you have changed the nvcc flags manually, either use the GMX_CUDA_TARGET_* variables instead or set GMX_CUDA_NB_SINGLE_COMPILATION_UNIT=ON CMake option.
-#endif
 #endif /* GMX_CUDA_NB_SINGLE_COMPILATION_UNIT */
 
 
@@ -728,21 +701,6 @@ void nbnxn_gpu_launch_cpyback(gmx_nbnxn_cuda_t       *nb,
     }
 }
 
-const struct texture<float, 1, cudaReadModeElementType> &nbnxn_cuda_get_nbfp_texref()
-{
-    return nbfp_texref;
-}
-
-const struct texture<float, 1, cudaReadModeElementType> &nbnxn_cuda_get_nbfp_comb_texref()
-{
-    return nbfp_comb_texref;
-}
-
-const struct texture<float, 1, cudaReadModeElementType> &nbnxn_cuda_get_coulomb_tab_texref()
-{
-    return coulomb_tab_texref;
-}
-
 void nbnxn_cuda_set_cacheconfig(const gmx_device_info_t *devinfo)
 {
     cudaError_t stat;
index 2b6920a8424fc0fe628e2a3f0f81871e44c441ff..c61fe210dcdd8040ef5b466aa38105363dec2e03 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2017, by the GROMACS development team, led by
+ * Copyright (c) 2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 
 //! Set up the cache configuration for the non-bonded kernels.
 void nbnxn_cuda_set_cacheconfig(const gmx_device_info_t *devinfo);
-/*! \brief Return the reference to the nbfp texture.
- *
- *  Note: it can return junk when c_disableCudaTextures==false, but we don't
- *  assert on that condition because the data_mgmt module ends up calling this
- *  function even if texture references are not used.
- */
-const struct texture<float, 1, cudaReadModeElementType> &nbnxn_cuda_get_nbfp_texref();
-/*! \brief Return the reference to the nbfp_comb texture.
- *
- *  Note: it can return junk when c_disableCudaTextures==false, but we don't
- *  assert on that condition because the data_mgmt module ends up calling this
- *  function even if texture references are not used.
- */
-const struct texture<float, 1, cudaReadModeElementType> &nbnxn_cuda_get_nbfp_comb_texref();
-/*! \brief Return the reference to the coulomb_tab texture.
- *
- *  Note: it can return junk when c_disableCudaTextures==false, but we don't
- *  assert on that condition because the data_mgmt module ends up calling this
- *  function even if texture references are not used.
- */
-const struct texture<float, 1, cudaReadModeElementType> &nbnxn_cuda_get_coulomb_tab_texref();
 
 #endif
index fe86c52557037f991e11667d988d9dc6d6f04d4d..ea5375667d0c3783b65f48804d36937538572fcb 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -112,7 +112,6 @@ static void init_ewald_coulomb_force_table(const interaction_const_t *ic,
 
     nbp->coulomb_tab_scale = ic->tabq_scale;
     initParamLookupTable(nbp->coulomb_tab, nbp->coulomb_tab_texobj,
-                         &nbnxn_cuda_get_coulomb_tab_texref(),
                          ic->tabq_coul_F, ic->tabq_size, dev_info);
 }
 
@@ -327,7 +326,6 @@ static void init_nbparam(cu_nbparam_t              *nbp,
     if (!useLjCombRule(nbp))
     {
         initParamLookupTable(nbp->nbfp, nbp->nbfp_texobj,
-                             &nbnxn_cuda_get_nbfp_texref(),
                              nbat->nbfp, 2*ntypes*ntypes, dev_info);
     }
 
@@ -335,7 +333,6 @@ static void init_nbparam(cu_nbparam_t              *nbp,
     if (ic->vdwtype == evdwPME)
     {
         initParamLookupTable(nbp->nbfp_comb, nbp->nbfp_comb_texobj,
-                             &nbnxn_cuda_get_nbfp_comb_texref(),
                              nbat->nbfp_comb, 2*ntypes, dev_info);
     }
 }
@@ -728,7 +725,7 @@ static void nbnxn_cuda_free_nbparam_table(cu_nbparam_t            *nbparam,
     if (nbparam->eeltype == eelCuEWALD_TAB || nbparam->eeltype == eelCuEWALD_TAB_TWIN)
     {
         destroyParamLookupTable(nbparam->coulomb_tab, nbparam->coulomb_tab_texobj,
-                                &nbnxn_cuda_get_coulomb_tab_texref(), dev_info);
+                                dev_info);
     }
 }
 
@@ -737,7 +734,6 @@ void nbnxn_gpu_free(gmx_nbnxn_cuda_t *nb)
     cudaError_t      stat;
     cu_atomdata_t   *atdat;
     cu_nbparam_t    *nbparam;
-    cu_plist_t      *plist, *plist_nl;
 
     if (nb == NULL)
     {
@@ -746,8 +742,6 @@ void nbnxn_gpu_free(gmx_nbnxn_cuda_t *nb)
 
     atdat       = nb->atdat;
     nbparam     = nb->nbparam;
-    plist       = nb->plist[eintLocal];
-    plist_nl    = nb->plist[eintNonlocal];
 
     nbnxn_cuda_free_nbparam_table(nbparam, nb->dev_info);
 
@@ -770,14 +764,14 @@ void nbnxn_gpu_free(gmx_nbnxn_cuda_t *nb)
     if (!useLjCombRule(nb->nbparam))
     {
         destroyParamLookupTable(nbparam->nbfp, nbparam->nbfp_texobj,
-                                &nbnxn_cuda_get_nbfp_texref(), nb->dev_info);
+                                nb->dev_info);
 
     }
 
     if (nbparam->vdwtype == evdwCuEWALDGEOM || nbparam->vdwtype == evdwCuEWALDLB)
     {
         destroyParamLookupTable(nbparam->nbfp_comb, nbparam->nbfp_comb_texobj,
-                                &nbnxn_cuda_get_nbfp_comb_texref(), nb->dev_info);
+                                nb->dev_info);
     }
 
     stat = cudaFree(atdat->shift_vec);
@@ -795,25 +789,25 @@ void nbnxn_gpu_free(gmx_nbnxn_cuda_t *nb)
     cu_free_buffered(atdat->atom_types, &atdat->ntypes);
     cu_free_buffered(atdat->lj_comb);
 
-    cu_free_buffered(plist->sci, &plist->nsci, &plist->sci_nalloc);
-    cu_free_buffered(plist->cj4, &plist->ncj4, &plist->cj4_nalloc);
-    cu_free_buffered(plist->imask, &plist->nimask, &plist->imask_nalloc);
-    cu_free_buffered(plist->excl, &plist->nexcl, &plist->excl_nalloc);
+    /* Free plist */
+    auto *plist = nb->plist[eintLocal];
+    freeDeviceBuffer(&plist->sci);
+    freeDeviceBuffer(&plist->cj4);
+    freeDeviceBuffer(&plist->imask);
+    freeDeviceBuffer(&plist->excl);
+    sfree(plist);
     if (nb->bUseTwoStreams)
     {
-        cu_free_buffered(plist_nl->sci, &plist_nl->nsci, &plist_nl->sci_nalloc);
-        cu_free_buffered(plist_nl->cj4, &plist_nl->ncj4, &plist_nl->cj4_nalloc);
-        cu_free_buffered(plist_nl->imask, &plist_nl->nimask, &plist_nl->imask_nalloc);
-        cu_free_buffered(plist_nl->excl, &plist_nl->nexcl, &plist->excl_nalloc);
+        auto *plist_nl = nb->plist[eintNonlocal];
+        freeDeviceBuffer(&plist_nl->sci);
+        freeDeviceBuffer(&plist_nl->cj4);
+        freeDeviceBuffer(&plist_nl->imask);
+        freeDeviceBuffer(&plist_nl->excl);
+        sfree(plist_nl);
     }
 
     sfree(atdat);
     sfree(nbparam);
-    sfree(plist);
-    if (nb->bUseTwoStreams)
-    {
-        sfree(plist_nl);
-    }
     sfree(nb->timings);
     sfree(nb);
 
index 6eaa496483dbaf726b2f1747b0974959e1ef50d3..4fa0c8833d664fce21ebe733b387800c4f4ac2c3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -272,11 +272,7 @@ __global__ void NB_KERNEL_FUNC_NAME(nbnxn_kernel, _F_cuda)
 #endif
 
 #ifdef LJ_EWALD
-    #if DISABLE_CUDA_TEXTURES
             E_lj += LDG(&nbparam.nbfp[atom_types[(sci*c_numClPerSupercl + i)*c_clSize + tidxi]*(ntypes + 1)*2]);
-    #else
-            E_lj += tex1Dfetch(nbfp_texref, atom_types[(sci*c_numClPerSupercl + i)*c_clSize + tidxi]*(ntypes + 1)*2);
-    #endif
 #endif
         }
 
index 2626bf101dc6a79838d6a154da1a3598a46e82fc..082bab0ac76b69df964eb645808186a2070aa32f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #ifndef NBNXN_CUDA_KERNEL_UTILS_CUH
 #define NBNXN_CUDA_KERNEL_UTILS_CUH
 
-/* Use texture objects if supported by the target hardware (and in host pass). */
-#if GMX_PTX_ARCH >= 300 || GMX_PTX_ARCH == 0
-/* Note: convenience macro, needs to be undef-ed at the end of the file. */
-#define USE_TEXOBJ
-#endif
-
 /*! \brief Log of the i and j cluster size.
  *  change this together with c_clSize !*/
 static const int          c_clSizeLog2  = 3;
@@ -233,11 +227,7 @@ float calculate_lj_ewald_c6grid(const cu_nbparam_t nbparam,
 #if DISABLE_CUDA_TEXTURES
     return LDG(&nbparam.nbfp_comb[2*typei]) * LDG(&nbparam.nbfp_comb[2*typej]);
 #else
-#ifdef USE_TEXOBJ
     return tex1Dfetch<float>(nbparam.nbfp_comb_texobj, 2*typei) * tex1Dfetch<float>(nbparam.nbfp_comb_texobj, 2*typej);
-#else
-    return tex1Dfetch(nbfp_comb_texref, 2*typei) * tex1Dfetch(nbfp_comb_texref, 2*typej);
-#endif /* USE_TEXOBJ */
 #endif /* DISABLE_CUDA_TEXTURES */
 }
 
@@ -320,13 +310,8 @@ float2 fetch_nbfp_comb_c6_c12(const cu_nbparam_t nbparam,
 #else
     /* NOTE: as we always do 8-byte aligned loads, we could
        fetch float2 here too just as above. */
-#ifdef USE_TEXOBJ
     c6c12.x = tex1Dfetch<float>(nbparam.nbfp_comb_texobj, 2*type);
     c6c12.y = tex1Dfetch<float>(nbparam.nbfp_comb_texobj, 2*type + 1);
-#else
-    c6c12.x = tex1Dfetch(nbfp_comb_texref, 2*type);
-    c6c12.y = tex1Dfetch(nbfp_comb_texref, 2*type + 1);
-#endif /* USE_TEXOBJ */
 #endif /* DISABLE_CUDA_TEXTURES */
 
     return c6c12;
@@ -399,13 +384,8 @@ float2 fetch_coulomb_force_r(const cu_nbparam_t nbparam,
     d.x = LDG(&nbparam.coulomb_tab[index]);
     d.y = LDG(&nbparam.coulomb_tab[index + 1]);
 #else
-#ifdef USE_TEXOBJ
     d.x = tex1Dfetch<float>(nbparam.coulomb_tab_texobj, index);
     d.y = tex1Dfetch<float>(nbparam.coulomb_tab_texobj, index + 1);
-#else
-    d.x =  tex1Dfetch(coulomb_tab_texref, index);
-    d.y =  tex1Dfetch(coulomb_tab_texref, index + 1);
-#endif // USE_TEXOBJ
 #endif // DISABLE_CUDA_TEXTURES
 
     return d;
@@ -461,13 +441,8 @@ void fetch_nbfp_c6_c12(float               &c6,
 #else
     /* NOTE: as we always do 8-byte aligned loads, we could
        fetch float2 here too just as above. */
-#ifdef USE_TEXOBJ
     c6  = tex1Dfetch<float>(nbparam.nbfp_texobj, 2*baseIndex);
     c12 = tex1Dfetch<float>(nbparam.nbfp_texobj, 2*baseIndex + 1);
-#else
-    c6  = tex1Dfetch(nbfp_texref, 2*baseIndex);
-    c12 = tex1Dfetch(nbfp_texref, 2*baseIndex + 1);
-#endif
 #endif // DISABLE_CUDA_TEXTURES
 }
 
@@ -765,6 +740,4 @@ void reduce_energy_warp_shfl(float E_lj, float E_el,
 }
 #endif /* GMX_PTX_ARCH */
 
-#undef USE_TEXOBJ
-
 #endif /* NBNXN_CUDA_KERNEL_UTILS_CUH */
index a9be593e841510ab9989c47f4ea4f09b4da507ae..65406cc462e3491b6ef6facc93a300da3a4702fa 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -52,7 +52,7 @@
  *  \ingroup module_mdlib
  */
 
-/* Use the standard non-Fermi kernel in host pass too (to avoid texref API calls). */
+/* Use the standard (non-Fermi) kernel in host pass too. */
 #if GMX_PTX_ARCH >= 300 || GMX_PTX_ARCH == 0
 #define FLAVOR_LEVEL_GENERATOR "gromacs/mdlib/nbnxn_cuda/nbnxn_cuda_kernel.cuh"
 #else
index 06a2dba7a23857da824d81bb9393ce23edab4d12..c155d5bdba6bc02ec97f6cd9ebb5219868f54994 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2012, The GROMACS development team.
- * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -113,7 +113,6 @@ enum evdwCu {
 /* All structs prefixed with "cu_" hold data used in GPU calculations and
  * are passed to the kernels, except cu_timers_t. */
 /*! \cond */
-typedef struct cu_plist     cu_plist_t;
 typedef struct cu_atomdata  cu_atomdata_t;
 typedef struct cu_nbparam   cu_nbparam_t;
 typedef struct nb_staging   nb_staging_t;
@@ -202,30 +201,7 @@ struct cu_nbparam
 /** \internal
  * \brief Pair list data.
  */
-struct cu_plist
-{
-    int              na_c;         /**< number of atoms per cluster                  */
-
-    int              nsci;         /**< size of sci, # of i clusters in the list     */
-    int              sci_nalloc;   /**< allocation size of sci                       */
-    nbnxn_sci_t     *sci;          /**< list of i-cluster ("super-clusters")         */
-
-    int              ncj4;         /**< total # of 4*j clusters                      */
-    int              cj4_nalloc;   /**< allocation size of cj4                       */
-    nbnxn_cj4_t     *cj4;          /**< 4*j cluster list, contains j cluster number
-                                        and index into the i cluster list            */
-    int              nimask;       /**< # of 4*j clusters * # of warps               */
-    int              imask_nalloc; /**< allocation size of imask                     */
-    unsigned int    *imask;        /**< imask for 2 warps for each 4*j cluster group */
-    nbnxn_excl_t    *excl;         /**< atom interaction bits                        */
-    int              nexcl;        /**< count for excl                               */
-    int              excl_nalloc;  /**< allocation size of excl                      */
-
-    /* parameter+variables for normal and rolling pruning */
-    bool             haveFreshList;          /**< true after search, indictes that initial pruning with outer prunning is needed */
-    int              rollingPruningNumParts; /**< the number of parts/steps over which one cyle of roling pruning takes places */
-    int              rollingPruningPart;     /**< the next part to which the roling pruning needs to be applied */
-};
+using cu_plist_t = gpu_plist;
 
 /** \internal
  * \brief Typedef of actual timer type.
index e4d86421cdfb69867319f3bb8efb8c18444e58d0..ab836f843797e223d2fcf530f655408347869646 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2017, by the GROMACS development team, led by
+ * Copyright (c) 2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -44,6 +44,8 @@
 
 #include "config.h"
 
+#include "gromacs/mdlib/nbnxn_pairlist.h"
+
 #if GMX_GPU == GMX_GPU_OPENCL
 #include "gromacs/gpu_utils/gpuregiontimer_ocl.h"
 #endif
@@ -72,4 +74,29 @@ struct nbnxn_gpu_timers_t
     bool           didRollingPrune[2]; /**< true when we timed rolling pruning (at the previous step) and the timings need to be accounted for */
 };
 
+struct gpu_plist
+{
+    int                        na_c;         /**< number of atoms per cluster                  */
+
+    int                        nsci;         /**< size of sci, # of i clusters in the list     */
+    int                        sci_nalloc;   /**< allocation size of sci                       */
+    DeviceBuffer<nbnxn_sci_t>  sci;          /**< list of i-cluster ("super-clusters")         */
+
+    int                        ncj4;         /**< total # of 4*j clusters                      */
+    int                        cj4_nalloc;   /**< allocation size of cj4                       */
+    DeviceBuffer<nbnxn_cj4_t>  cj4;          /**< 4*j cluster list, contains j cluster number
+                                                and index into the i cluster list            */
+    int                        nimask;       /**< # of 4*j clusters * # of warps               */
+    int                        imask_nalloc; /**< allocation size of imask                     */
+    DeviceBuffer<unsigned int> imask;        /**< imask for 2 warps for each 4*j cluster group */
+    DeviceBuffer<nbnxn_excl_t> excl;         /**< atom interaction bits                        */
+    int                        nexcl;        /**< count for excl                               */
+    int                        excl_nalloc;  /**< allocation size of excl                      */
+
+    /* parameter+variables for normal and rolling pruning */
+    bool             haveFreshList;          /**< true after search, indictes that initial pruning with outer prunning is needed */
+    int              rollingPruningNumParts; /**< the number of parts/steps over which one cyle of roling pruning takes places */
+    int              rollingPruningPart;     /**< the next part to which the roling pruning needs to be applied */
+};
+
 #endif
index 7347ddc018dc5a5eb588d7cf17baf606a8a8d119..d3aaf34603795006e56d484aafb57a86c1d8a6af 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -54,6 +54,7 @@
 #include "gromacs/mdlib/nbnxn_internal.h"
 #include "gromacs/mdlib/nbnxn_search.h"
 #include "gromacs/mdlib/nbnxn_util.h"
+#include "gromacs/mdtypes/forcerec.h" // only for GET_CGINFO_*
 #include "gromacs/simd/simd.h"
 #include "gromacs/simd/vector_operations.h"
 #include "gromacs/utility/exceptions.h"
index 553af256a72303adc3ffeff09efee97cf085084c..927c934343e8d7192a036a7f64f609d9e2563dd5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -66,7 +66,7 @@ static const int c_packX8 = 8;
 #define STRIDE_P8         (DIM*c_packX8)
 
 /* Returns the index in a coordinate array corresponding to atom a */
-template<int packSize> static gmx_inline int atom_to_x_index(int a)
+template<int packSize> static inline int atom_to_x_index(int a)
 {
     return DIM*(a & ~(packSize - 1)) + (a & (packSize - 1));
 }
index 8d75fdb2d702486c0f6fd7490e8277f4d94783d8..5baf7f1aedec70a1575823f137734a7674b752b8 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -37,7 +37,6 @@
 #include "gromacs/simd/simd.h"
 #include "gromacs/simd/simd_math.h"
 #include "gromacs/simd/vector_operations.h"
-#include "gromacs/utility/basedefinitions.h"
 #ifdef CALC_COUL_EWALD
 #include "gromacs/math/utilities.h"
 #endif
@@ -74,7 +73,7 @@ using namespace gmx;
 /* As add_ener_grp, but for two groups of UNROLLJ/2 stored in
  * a single SIMD register.
  */
-static gmx_inline void
+static inline void
 add_ener_grp_halves(SimdReal e_S, real *v0, real *v1, const int *offset_jj)
 {
     for (int jj = 0; jj < (UNROLLJ/2); jj++)
@@ -92,7 +91,7 @@ typedef SimdReal     SimdBitMask;
 #endif
 
 
-static gmx_inline void gmx_simdcall
+static inline void gmx_simdcall
 gmx_load_simd_2xnn_interactions(int                  excl,
                                 SimdBitMask          filter_S0,
                                 SimdBitMask          filter_S2,
index ff968573b6636f9b42d54ab19238324a17446eb5..844f55d7f58ddc3860b640e30c7318ebee5bbd04 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
index b2960bce4a2a2db7874ee1a736aacc2a6d7bcdc2..ae56ddbf3be5fe52547f4e42283473c9b05f9efa 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
index 4b1f3646a20cfd618b1ef164de54b0ef32aef9be..4ed2ae9b493a69b89e7c43647e06c67fbfdc2574 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -73,7 +73,7 @@ using namespace gmx;
 
 #ifdef UNROLLJ
 /* Add energy register to possibly multiple terms in the energy array */
-static gmx_inline void add_ener_grp(SimdReal e_S, real *v, const int *offset_jj)
+static inline void add_ener_grp(SimdReal e_S, real *v, const int *offset_jj)
 {
     int jj;
 
@@ -97,7 +97,7 @@ typedef SimdInt32    SimdBitMask;
 typedef SimdReal     SimdBitMask;
 #endif
 
-static gmx_inline void gmx_simdcall
+static inline void gmx_simdcall
 gmx_load_simd_4xn_interactions(int                               excl,
                                SimdBitMask gmx_unused            filter_S0,
                                SimdBitMask gmx_unused            filter_S1,
index 782a3fbb69294ead586db6b1f302a3c9b53215c1..a3169fe83b8fc5ec30499ac758f37cca30b115d5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
index 8ca51262935a17d90fd7f24df379a8a2ce719caf..696d53a7fac0c40363c73692559199a7d119cf05 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
index c5615ceb00c8d964e590a4f82697616ecaf27dc4..02f89e06eae6bbe890968a33cbdd41595b6cdfa6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -69,6 +69,7 @@
 
 #include "thread_mpi/atomic.h"
 
+#include "gromacs/gpu_utils/gputraits_ocl.h"
 #include "gromacs/gpu_utils/oclutils.h"
 #include "gromacs/hardware/hw_info.h"
 #include "gromacs/mdlib/force_flags.h"
@@ -88,9 +89,6 @@
 #include "nbnxn_ocl_internal.h"
 #include "nbnxn_ocl_types.h"
 
-#if defined TEXOBJ_SUPPORTED && __CUDA_ARCH__ >= 300
-#define USE_TEXOBJ
-#endif
 
 /*! \brief Convenience constants */
 //@{
index 559fcfd461595c555d6b5c7eca7993ac30f56987..189c06944f064df9659a349f20d12e2088594198 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -1180,18 +1180,20 @@ void nbnxn_gpu_free(gmx_nbnxn_ocl_t *nb)
     sfree(nb->nbparam);
 
     /* Free plist */
-    free_ocl_buffer(&(nb->plist[eintLocal]->sci));
-    free_ocl_buffer(&(nb->plist[eintLocal]->cj4));
-    free_ocl_buffer(&(nb->plist[eintLocal]->imask));
-    free_ocl_buffer(&(nb->plist[eintLocal]->excl));
-    sfree(nb->plist[eintLocal]);
+    auto *plist = nb->plist[eintLocal];
+    freeDeviceBuffer(&plist->sci);
+    freeDeviceBuffer(&plist->cj4);
+    freeDeviceBuffer(&plist->imask);
+    freeDeviceBuffer(&plist->excl);
+    sfree(plist);
     if (nb->bUseTwoStreams)
     {
-        free_ocl_buffer(&(nb->plist[eintNonlocal]->sci));
-        free_ocl_buffer(&(nb->plist[eintNonlocal]->cj4));
-        free_ocl_buffer(&(nb->plist[eintNonlocal]->imask));
-        free_ocl_buffer(&(nb->plist[eintNonlocal]->excl));
-        sfree(nb->plist[eintNonlocal]);
+        auto *plist_nl = nb->plist[eintNonlocal];
+        freeDeviceBuffer(&plist_nl->sci);
+        freeDeviceBuffer(&plist_nl->cj4);
+        freeDeviceBuffer(&plist_nl->imask);
+        freeDeviceBuffer(&plist_nl->excl);
+        sfree(plist_nl);
     }
 
     /* Free nbst */
index 36a32b9e274a7baa5e8c53eb5e2b6cff5b5b82f6..6fb9fe6770b9b67708d587176ed2f310dd7c1262 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -540,11 +540,7 @@ __global float *restrict fshift,            /* stores float3 values */     /* OU
                                 F_invr  += qi * qj_f * (int_bit*inv_r2*inv_r + pmecorrF(beta2*r2)*beta3);
 #elif defined EL_EWALD_TAB
                                 F_invr  += qi * qj_f * (int_bit*inv_r2 -
-#ifdef USE_TEXOBJ
-                                                        interpolate_coulomb_force_r(nbparam->coulomb_tab_texobj, r2 * inv_r, coulomb_tab_scale)
-#else
                                                         interpolate_coulomb_force_r(coulomb_tab_climg2d, r2 * inv_r, coulomb_tab_scale)
-#endif /* USE_TEXOBJ */
                                                         ) * inv_r;
 #endif /* EL_EWALD_ANA/TAB */
 
index ba522a2b960c6c617cd5208c0b123377fa779520..0afbdee6c8fe50c4319fa39524b9e78c73ca6411 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -543,11 +543,7 @@ __global float *restrict fshift,            /* stores float3 values */     /* OU
                                 F_invr  += qi * qj_f * (int_bit*inv_r2*inv_r + pmecorrF(beta2*r2)*beta3);
 #elif defined EL_EWALD_TAB
                                 F_invr  += qi * qj_f * (int_bit*inv_r2 -
-#ifdef USE_TEXOBJ
-                                                        interpolate_coulomb_force_r(nbparam->coulomb_tab_texobj, r2 * inv_r, coulomb_tab_scale)
-#else
                                                         interpolate_coulomb_force_r(coulomb_tab_climg2d, r2 * inv_r, coulomb_tab_scale)
-#endif /* USE_TEXOBJ */
                                                         ) * inv_r;
 #endif /* EL_EWALD_ANA/TAB */
 
index a7366c879bfa5a8e63a1e54a1fc2b5c243fea99a..be440d9f962d5d7672fabcde82c631c5e58ff200 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -533,11 +533,7 @@ __global float *restrict fshift,            /* stores float3 values */     /* OU
                                 F_invr  += qi * qj_f * (int_bit*inv_r2*inv_r + pmecorrF(beta2*r2)*beta3);
 #elif defined EL_EWALD_TAB
                                 F_invr  += qi * qj_f * (int_bit*inv_r2 -
-#ifdef USE_TEXOBJ
-                                                        interpolate_coulomb_force_r(nbparam->coulomb_tab_texobj, r2 * inv_r, coulomb_tab_scale)
-#else
                                                         interpolate_coulomb_force_r(coulomb_tab_climg2d, r2 * inv_r, coulomb_tab_scale)
-#endif /* USE_TEXOBJ */
                                                         ) * inv_r;
 #endif /* EL_EWALD_ANA/TAB */
 
index 4d428afa84df431edaea965de04a53ce3cc8354d..a3e02bf73c201b5183ab1b97270b0cff68842287 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -46,6 +46,7 @@
 #define NBNXN_OPENCL_TYPES_H
 
 #include "gromacs/gpu_utils/gmxopencl.h"
+#include "gromacs/gpu_utils/gputraits_ocl.h"
 #include "gromacs/gpu_utils/oclutils.h"
 #include "gromacs/mdlib/nbnxn_gpu_types_common.h"
 #include "gromacs/mdlib/nbnxn_pairlist.h"
@@ -261,34 +262,7 @@ typedef struct cl_nbparam_params
 /*! \internal
  * \brief Pair list data.
  */
-typedef struct cl_plist
-{
-    int              na_c;         /**< number of atoms per cluster                  */
-
-    int              nsci;         /**< size of sci, # of i clusters in the list     */
-    int              sci_nalloc;   /**< allocation size of sci                       */
-    cl_mem           sci;          /**< list of i-cluster ("super-clusters").
-                                        It contains elements of type nbnxn_sci_t     */
-
-    int              ncj4;         /**< total # of 4*j clusters                      */
-    int              cj4_nalloc;   /**< allocation size of cj4                       */
-    cl_mem           cj4;          /**< 4*j cluster list, contains j cluster number and
-                                        index into the i cluster list.
-                                        It contains elements of type nbnxn_cj4_t     */
-    int              nimask;       /**< # of 4*j clusters * # of warps               */
-    int              imask_nalloc; /**< allocation size of imask                     */
-    cl_mem           imask;        /**< imask for 2 warps for each 4*j cluster group */
-    cl_mem           excl;         /**< atom interaction bits
-                                        It contains elements of type nbnxn_excl_t    */
-    int              nexcl;        /**< count for excl                               */
-    int              excl_nalloc;  /**< allocation size of excl                      */
-
-    /* parameter+variables for normal and rolling pruning */
-    bool             haveFreshList;          /**< true after search, indictes that initial pruning with outer prunning is needed */
-    int              rollingPruningNumParts; /**< the number of parts/steps over which one cyle of roling pruning takes places */
-    int              rollingPruningPart;     /**< the next part to which the roling pruning needs to be applied */
-}cl_plist_t;
-
+using cl_plist_t = gpu_plist;
 
 /** \internal
  * \brief Typedef of actual timer type.
index 7429963fea5530699940771a35834df097bafb64..dddb8ba89e205b5f3db5949482844b0304950381 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -66,6 +66,7 @@
 #include "gromacs/pbcutil/pbc.h"
 #include "gromacs/simd/simd.h"
 #include "gromacs/simd/vector_operations.h"
+#include "gromacs/topology/block.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/gmxomp.h"
@@ -552,7 +553,7 @@ static void subc_bb_dist2_simd4_xxxx(const float *bb_j,
 
 
 /* Returns if any atom pair from two clusters is within distance sqrt(rlist2) */
-static gmx_inline gmx_bool
+static inline gmx_bool
 clusterpair_in_range(const nbnxn_list_work_t *work,
                      int si,
                      int csj, int stride, const real *x_j,
@@ -1624,7 +1625,7 @@ setExclusionsForSimpleIentry(const nbnxn_search_t  nbs,
 }
 
 /* Add a new i-entry to the FEP list and copy the i-properties */
-static gmx_inline void fep_list_new_nri_copy(t_nblist *nlist)
+static inline void fep_list_new_nri_copy(t_nblist *nlist)
 {
     /* Add a new i-entry */
     nlist->nri++;
@@ -1836,19 +1837,19 @@ static void make_fep_list(const nbnxn_search_t    nbs,
 }
 
 /* Return the index of atom a within a cluster */
-static gmx_inline int cj_mod_cj4(int cj)
+static inline int cj_mod_cj4(int cj)
 {
     return cj & (c_nbnxnGpuJgroupSize - 1);
 }
 
 /* Convert a j-cluster to a cj4 group */
-static gmx_inline int cj_to_cj4(int cj)
+static inline int cj_to_cj4(int cj)
 {
     return cj/c_nbnxnGpuJgroupSize;
 }
 
 /* Return the index of an j-atom within a warp */
-static gmx_inline int a_mod_wj(int a)
+static inline int a_mod_wj(int a)
 {
     return a & (c_nbnxnGpuClusterSize/c_nbnxnGpuClusterpairSplit - 1);
 }
@@ -2428,9 +2429,9 @@ static void clear_pairlist_fep(t_nblist *nl)
 }
 
 /* Sets a simple list i-cell bounding box, including PBC shift */
-static gmx_inline void set_icell_bb_simple(const nbnxn_bb_t *bb, int ci,
-                                           real shx, real shy, real shz,
-                                           nbnxn_bb_t *bb_ci)
+static inline void set_icell_bb_simple(const nbnxn_bb_t *bb, int ci,
+                                       real shx, real shy, real shz,
+                                       nbnxn_bb_t *bb_ci)
 {
     bb_ci->lower[BB_X] = bb[ci].lower[BB_X] + shx;
     bb_ci->lower[BB_Y] = bb[ci].lower[BB_Y] + shy;
index 6d1430584f638d3fe3ff09cc84f38879a3d31672..3d2ec0fbe6274997996aff097e5574fffba48ca2 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -42,7 +42,7 @@ using namespace gmx; // TODO: Remove when this file is moved into gmx namespace
 #endif
 
 /* Copies PBC shifted i-cell packed atom coordinates to working array */
-static gmx_inline void
+static inline void
 icell_set_x_simd_2xnn(int ci,
                       real shx, real shy, real shz,
                       int gmx_unused stride, const real *x,
@@ -77,7 +77,7 @@ icell_set_x_simd_2xnn(int ci,
  * \param[in]     rbb2                The squared cut-off for putting cluster-pairs in the list based on bounding box distance only
  * \param[in,out] numDistanceChecks   The number of distance checks performed
  */
-static gmx_inline void
+static inline void
 makeClusterListSimd2xnn(const nbnxn_grid_t *      gridj,
                         nbnxn_pairlist_t *        nbl,
                         int                       icluster,
index 5432c3ccfb27b264992ae40660af6093ad4df7a6..36598d33980cdf557c1ed0f21f90114a951602ff 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -42,7 +42,7 @@ using namespace gmx; // TODO: Remove when this file is moved into gmx namespace
 #endif
 
 /* Copies PBC shifted i-cell packed atom coordinates to working array */
-static gmx_inline void
+static inline void
 icell_set_x_simd_4xn(int ci,
                      real shx, real shy, real shz,
                      int gmx_unused stride, const real *x,
@@ -83,7 +83,7 @@ icell_set_x_simd_4xn(int ci,
  * \param[in]     rbb2                The squared cut-off for putting cluster-pairs in the list based on bounding box distance only
  * \param[in,out] numDistanceChecks   The number of distance checks performed
  */
-static gmx_inline void
+static inline void
 makeClusterListSimd4xn(const nbnxn_grid_t *      gridj,
                        nbnxn_pairlist_t *        nbl,
                        int                       icluster,
index dd4271c7b105d6317d393d71b56211ca1a24deb9..28bedf67d5aaf40cf13bfe21ecf5888b862be2a6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -52,7 +52,7 @@ extern "C" {
 /* Returns the base-2 log of n.
  * Generates a fatal error when n is not an integer power of 2.
  */
-static gmx_inline int get_2log(int n)
+static inline int get_2log(int n)
 {
     int log2;
 
@@ -70,7 +70,7 @@ static gmx_inline int get_2log(int n)
 }
 
 /* Returns the nbnxn i-cluster size in atoms for the nbnxn kernel type */
-static gmx_inline int nbnxn_kernel_to_cluster_i_size(int nb_kernel_type)
+static inline int nbnxn_kernel_to_cluster_i_size(int nb_kernel_type)
 {
     switch (nb_kernel_type)
     {
@@ -93,7 +93,7 @@ static gmx_inline int nbnxn_kernel_to_cluster_i_size(int nb_kernel_type)
 }
 
 /* Returns the nbnxn i-cluster size in atoms for the nbnxn kernel type */
-static gmx_inline int nbnxn_kernel_to_cluster_j_size(int nb_kernel_type)
+static inline int nbnxn_kernel_to_cluster_j_size(int nb_kernel_type)
 {
     int nbnxn_simd_width = 0;
     int cj_size          = 0;
index acefed5c6a3ad87dcf966c62310904806e6b88a6..bf661a252861d3e79eb0b5ff68e9f69bde616c50 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -342,7 +342,7 @@ static void reset_neighbor_lists(t_forcerec *fr)
 
 
 
-static gmx_inline void new_i_nblist(t_nblist *nlist, int i_atom, int shift, int gid)
+static inline void new_i_nblist(t_nblist *nlist, int i_atom, int shift, int gid)
 {
     int    nri = nlist->nri;
 
@@ -387,7 +387,7 @@ static gmx_inline void new_i_nblist(t_nblist *nlist, int i_atom, int shift, int
     }
 }
 
-static gmx_inline void close_i_nblist(t_nblist *nlist)
+static inline void close_i_nblist(t_nblist *nlist)
 {
     int nri = nlist->nri;
     int len;
@@ -417,7 +417,7 @@ static gmx_inline void close_i_nblist(t_nblist *nlist)
     }
 }
 
-static gmx_inline void close_nblist(t_nblist *nlist)
+static inline void close_nblist(t_nblist *nlist)
 {
     /* Only close this nblist when it has been initialized.
      * Avoid the creation of i-lists with no j-particles.
@@ -439,7 +439,7 @@ static gmx_inline void close_nblist(t_nblist *nlist)
     }
 }
 
-static gmx_inline void close_neighbor_lists(t_forcerec *fr, gmx_bool bMakeQMMMnblist)
+static inline void close_neighbor_lists(t_forcerec *fr, gmx_bool bMakeQMMMnblist)
 {
     int n, i;
 
@@ -458,7 +458,7 @@ static gmx_inline void close_neighbor_lists(t_forcerec *fr, gmx_bool bMakeQMMMnb
 }
 
 
-static gmx_inline void add_j_to_nblist(t_nblist *nlist, int j_atom)
+static inline void add_j_to_nblist(t_nblist *nlist, int j_atom)
 {
     int nrj = nlist->nrj;
 
@@ -479,9 +479,9 @@ static gmx_inline void add_j_to_nblist(t_nblist *nlist, int j_atom)
     nlist->nrj++;
 }
 
-static gmx_inline void add_j_to_nblist_cg(t_nblist *nlist,
-                                          int j_start, int j_end,
-                                          t_excl *bexcl, gmx_bool i_is_j)
+static inline void add_j_to_nblist_cg(t_nblist *nlist,
+                                      int j_start, int j_end,
+                                      t_excl *bexcl, gmx_bool i_is_j)
 {
     int nrj = nlist->nrj;
     int j;
@@ -1540,9 +1540,9 @@ static int ns_simple_core(t_forcerec *fr,
  *
  ************************************************/
 
-static gmx_inline void get_dx_dd(int Nx, real gridx, real rc2, int xgi, real x,
-                                 int ncpddc, int shift_min, int shift_max,
-                                 int *g0, int *g1, real *dcx2)
+static inline void get_dx_dd(int Nx, real gridx, real rc2, int xgi, real x,
+                             int ncpddc, int shift_min, int shift_max,
+                             int *g0, int *g1, real *dcx2)
 {
     real dcx, tmp;
     int  g_min, g_max, shift_home;
index 1252a1a66bb4148fce0b65c4b98beea6135c2f76..8bada3b28959ed1215e0fa34a51d8875a2a836fc 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -51,6 +51,7 @@
 #include "gromacs/fileio/pdbio.h"
 #include "gromacs/gmxlib/network.h"
 #include "gromacs/math/vec.h"
+#include "gromacs/mdtypes/forcerec.h"
 #include "gromacs/pbcutil/pbc.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/futil.h"
index f953a5a6aab0e16263432c5367cb1c53164c5ff4..82fc85b380a38660a738f89ce2bcec3dd11c7a50 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2008, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -893,7 +893,9 @@ static void dump_shells(FILE *fp, gmx::ArrayRef<gmx::RVec> x, gmx::ArrayRef<gmx:
 
 static void init_adir(FILE *log, gmx_shellfc_t *shfc,
                       gmx_constr_t constr, t_idef *idef, t_inputrec *ir,
-                      t_commrec *cr, int dd_ac1,
+                      t_commrec *cr,
+                      const gmx_multisim_t *ms,
+                      int dd_ac1,
                       gmx_int64_t step, t_mdatoms *md, int end,
                       rvec *x_old, rvec *x_init, rvec *x,
                       rvec *f, rvec *acc_dir,
@@ -946,11 +948,11 @@ static void init_adir(FILE *log, gmx_shellfc_t *shfc,
             }
         }
     }
-    constrain(log, FALSE, FALSE, constr, idef, ir, cr, step, 0, 1.0, md,
+    constrain(log, FALSE, FALSE, constr, idef, ir, cr, ms, step, 0, 1.0, md,
               x, xnold, nullptr, bMolPBC, box,
               lambda[efptBONDED], &(dvdlambda[efptBONDED]),
               nullptr, nullptr, nrnb, econqCoord);
-    constrain(log, FALSE, FALSE, constr, idef, ir, cr, step, 0, 1.0, md,
+    constrain(log, FALSE, FALSE, constr, idef, ir, cr, ms, step, 0, 1.0, md,
               x, xnew, nullptr, bMolPBC, box,
               lambda[efptBONDED], &(dvdlambda[efptBONDED]),
               nullptr, nullptr, nrnb, econqCoord);
@@ -967,13 +969,15 @@ static void init_adir(FILE *log, gmx_shellfc_t *shfc,
     }
 
     /* Project the acceleration on the old bond directions */
-    constrain(log, FALSE, FALSE, constr, idef, ir, cr, step, 0, 1.0, md,
+    constrain(log, FALSE, FALSE, constr, idef, ir, cr, ms, step, 0, 1.0, md,
               x_old, xnew, acc_dir, bMolPBC, box,
               lambda[efptBONDED], &(dvdlambda[efptBONDED]),
               nullptr, nullptr, nrnb, econqDeriv_FlexCon);
 }
 
-void relax_shell_flexcon(FILE *fplog, t_commrec *cr, gmx_bool bVerbose,
+void relax_shell_flexcon(FILE *fplog, t_commrec *cr,
+                         const gmx_multisim_t *ms,
+                         gmx_bool bVerbose,
                          gmx_int64_t mdstep, t_inputrec *inputrec,
                          gmx_bool bDoNS, int force_flags,
                          gmx_localtop_t *top,
@@ -987,7 +991,6 @@ void relax_shell_flexcon(FILE *fplog, t_commrec *cr, gmx_bool bVerbose,
                          gmx_groups_t *groups,
                          gmx_shellfc_t *shfc,
                          t_forcerec *fr,
-                         gmx_bool bBornRadii,
                          double t, rvec mu_tot,
                          gmx_vsite_t *vsite,
                          DdOpenBalanceRegionBeforeForceComputation ddOpenBalanceRegion,
@@ -1117,11 +1120,11 @@ void relax_shell_flexcon(FILE *fplog, t_commrec *cr, gmx_bool bVerbose,
     {
         pr_rvecs(debug, 0, "x b4 do_force", as_rvec_array(state->x.data()), homenr);
     }
-    do_force(fplog, cr, inputrec, mdstep, nrnb, wcycle, top, groups,
+    do_force(fplog, cr, ms, inputrec, mdstep, nrnb, wcycle, top, groups,
              state->box, state->x, &state->hist,
              force[Min], force_vir, md, enerd, fcd,
              state->lambda, graph,
-             fr, vsite, mu_tot, t, nullptr, bBornRadii,
+             fr, vsite, mu_tot, t, nullptr,
              (bDoNS ? GMX_FORCE_NS : 0) | force_flags,
              ddOpenBalanceRegion, ddCloseBalanceRegion);
 
@@ -1129,7 +1132,7 @@ void relax_shell_flexcon(FILE *fplog, t_commrec *cr, gmx_bool bVerbose,
     if (nflexcon)
     {
         init_adir(fplog, shfc,
-                  constr, idef, inputrec, cr, dd_ac1, mdstep, md, end,
+                  constr, idef, inputrec, cr, ms, dd_ac1, mdstep, md, end,
                   shfc->x_old, as_rvec_array(state->x.data()), as_rvec_array(state->x.data()), as_rvec_array(force[Min].data()),
                   shfc->acc_dir,
                   fr->bMolPBC, state->box, state->lambda, &dum, nrnb);
@@ -1198,7 +1201,7 @@ void relax_shell_flexcon(FILE *fplog, t_commrec *cr, gmx_bool bVerbose,
         if (nflexcon)
         {
             init_adir(fplog, shfc,
-                      constr, idef, inputrec, cr, dd_ac1, mdstep, md, end,
+                      constr, idef, inputrec, cr, ms, dd_ac1, mdstep, md, end,
                       x_old, as_rvec_array(state->x.data()), as_rvec_array(pos[Min].data()), as_rvec_array(force[Min].data()), acc_dir,
                       fr->bMolPBC, state->box, state->lambda, &dum, nrnb);
 
@@ -1220,11 +1223,11 @@ void relax_shell_flexcon(FILE *fplog, t_commrec *cr, gmx_bool bVerbose,
             pr_rvecs(debug, 0, "RELAX: pos[Try]  ", as_rvec_array(pos[Try].data()), homenr);
         }
         /* Try the new positions */
-        do_force(fplog, cr, inputrec, 1, nrnb, wcycle,
+        do_force(fplog, cr, ms, inputrec, 1, nrnb, wcycle,
                  top, groups, state->box, pos[Try], &state->hist,
                  force[Try], force_vir,
                  md, enerd, fcd, state->lambda, graph,
-                 fr, vsite, mu_tot, t, nullptr, bBornRadii,
+                 fr, vsite, mu_tot, t, nullptr,
                  force_flags,
                  ddOpenBalanceRegion, ddCloseBalanceRegion);
 
@@ -1237,7 +1240,7 @@ void relax_shell_flexcon(FILE *fplog, t_commrec *cr, gmx_bool bVerbose,
         if (nflexcon)
         {
             init_adir(fplog, shfc,
-                      constr, idef, inputrec, cr, dd_ac1, mdstep, md, end,
+                      constr, idef, inputrec, cr, ms, dd_ac1, mdstep, md, end,
                       x_old, as_rvec_array(state->x.data()), as_rvec_array(pos[Try].data()), as_rvec_array(force[Try].data()), acc_dir,
                       fr->bMolPBC, state->box, state->lambda, &dum, nrnb);
 
index c092a1f37a4b118db44da51a98423c8c92927689..b8ddae55338efc67a6d593fa84392a2c7001cd68 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2008, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -47,6 +47,7 @@
 struct gmx_constr;
 struct gmx_enerdata_t;
 struct gmx_groups_t;
+struct gmx_multisim_t;
 struct gmx_shellfc_t;
 struct gmx_mtop_t;
 struct t_forcerec;
@@ -67,7 +68,9 @@ void make_local_shells(t_commrec *cr, t_mdatoms *md,
                        gmx_shellfc_t *shfc);
 
 /* Optimize shell positions */
-void relax_shell_flexcon(FILE *log, t_commrec *cr, gmx_bool bVerbose,
+void relax_shell_flexcon(FILE *log, t_commrec *cr,
+                         const gmx_multisim_t *ms,
+                         gmx_bool bVerbose,
                          gmx_int64_t mdstep, t_inputrec *inputrec,
                          gmx_bool bDoNS, int force_flags,
                          gmx_localtop_t *top,
@@ -81,7 +84,6 @@ void relax_shell_flexcon(FILE *log, t_commrec *cr, gmx_bool bVerbose,
                          gmx_groups_t *groups,
                          gmx_shellfc_t *shfc,
                          t_forcerec *fr,
-                         gmx_bool bBornRadii,
                          double t, rvec mu_tot,
                          gmx_vsite_t *vsite,
                          DdOpenBalanceRegionBeforeForceComputation ddOpenBalanceRegion,
index ee757e41813383d99063be53eb3a16f466be1a9e..4413195c3f4a1a483bae68d944c44a197670d758 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -73,7 +73,6 @@
 #include "gromacs/mdlib/constr.h"
 #include "gromacs/mdlib/force.h"
 #include "gromacs/mdlib/forcerec.h"
-#include "gromacs/mdlib/genborn.h"
 #include "gromacs/mdlib/gmx_omp_nthreads.h"
 #include "gromacs/mdlib/mdrun.h"
 #include "gromacs/mdlib/nb_verlet.h"
@@ -385,14 +384,12 @@ static void post_process_forces(t_commrec *cr,
              * This is parallellized. MPI communication is performed
              * if the constructing atoms aren't local.
              */
-            wallcycle_start(wcycle, ewcVSITESPREAD);
             matrix virial = { { 0 } };
             spread_vsite_f(vsite, x, fDirectVir, nullptr,
                            (flags & GMX_FORCE_VIRIAL), virial,
                            nrnb,
-                           &top->idef, fr->ePBC, fr->bMolPBC, graph, box, cr);
+                           &top->idef, fr->ePBC, fr->bMolPBC, graph, box, cr, wcycle);
             forceWithVirial->addVirialContribution(virial);
-            wallcycle_stop(wcycle, ewcVSITESPREAD);
         }
 
         if (flags & GMX_FORCE_VIRIAL)
@@ -674,7 +671,7 @@ gmx_bool use_GPU(const nonbonded_verlet_t *nbv)
     return nbv != nullptr && nbv->bUseGPU;
 }
 
-static gmx_inline void clear_rvecs_omp(int n, rvec v[])
+static inline void clear_rvecs_omp(int n, rvec v[])
 {
     int nth = gmx_omp_nthreads_get_simple_rvec_task(emntDefault, n);
 
@@ -992,12 +989,8 @@ static void alternatePmeNbGpuWaitReduce(nonbonded_verlet_t             *nbv,
                 wallcycle_start(wcycle, ewcWAIT_GPU_NB_L);
                 wallcycle_stop(wcycle, ewcWAIT_GPU_NB_L);
 
-                wallcycle_start(wcycle, ewcNB_XF_BUF_OPS);
-                wallcycle_sub_start(wcycle, ewcsNB_F_BUF_OPS);
                 nbnxn_atomdata_add_nbat_f_to_f(nbv->nbs, eatLocal,
-                                               nbv->nbat, as_rvec_array(force->data()));
-                wallcycle_sub_stop(wcycle, ewcsNB_F_BUF_OPS);
-                wallcycle_stop(wcycle, ewcNB_XF_BUF_OPS);
+                                               nbv->nbat, as_rvec_array(force->data()), wcycle);
             }
         }
     }
@@ -1040,6 +1033,7 @@ static inline void launchGpuRollingPruning(const t_commrec          *cr,
 }
 
 static void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
+                                const gmx_multisim_t *ms,
                                 t_inputrec *inputrec,
                                 gmx_int64_t step, t_nrnb *nrnb, gmx_wallcycle_t wcycle,
                                 gmx_localtop_t *top,
@@ -1053,7 +1047,6 @@ static void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
                                 t_forcerec *fr, interaction_const_t *ic,
                                 gmx_vsite_t *vsite, rvec mu_tot,
                                 double t, gmx_edsam_t ed,
-                                gmx_bool bBornRadii,
                                 int flags,
                                 DdOpenBalanceRegionBeforeForceComputation ddOpenBalanceRegion,
                                 DdCloseBalanceRegionAfterForceComputation ddCloseBalanceRegion)
@@ -1156,12 +1149,10 @@ static void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
          * and domain decomposition does not use the graph,
          * we do not need to worry about shifting.
          */
-        wallcycle_start(wcycle, ewcPP_PMESENDX);
         gmx_pme_send_coordinates(cr, box, as_rvec_array(x.data()),
                                  lambda[efptCOUL], lambda[efptVDW],
                                  (flags & (GMX_FORCE_VIRIAL | GMX_FORCE_ENERGY)),
-                                 step);
-        wallcycle_stop(wcycle, ewcPP_PMESENDX);
+                                 step, wcycle);
     }
 #endif /* GMX_MPI */
 
@@ -1258,12 +1249,8 @@ static void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
     }
     else
     {
-        wallcycle_start(wcycle, ewcNB_XF_BUF_OPS);
-        wallcycle_sub_start(wcycle, ewcsNB_X_BUF_OPS);
         nbnxn_atomdata_copy_x_to_nbat_x(nbv->nbs, eatLocal, FALSE, as_rvec_array(x.data()),
-                                        nbv->nbat);
-        wallcycle_sub_stop(wcycle, ewcsNB_X_BUF_OPS);
-        wallcycle_stop(wcycle, ewcNB_XF_BUF_OPS);
+                                        nbv->nbat, wcycle);
     }
 
     if (bUseGPU)
@@ -1326,16 +1313,10 @@ static void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
         }
         else
         {
-            wallcycle_start(wcycle, ewcMOVEX);
-            dd_move_x(cr->dd, box, as_rvec_array(x.data()));
-            wallcycle_stop(wcycle, ewcMOVEX);
+            dd_move_x(cr->dd, box, as_rvec_array(x.data()), wcycle);
 
-            wallcycle_start(wcycle, ewcNB_XF_BUF_OPS);
-            wallcycle_sub_start(wcycle, ewcsNB_X_BUF_OPS);
             nbnxn_atomdata_copy_x_to_nbat_x(nbv->nbs, eatNonlocal, FALSE, as_rvec_array(x.data()),
-                                            nbv->nbat);
-            wallcycle_sub_stop(wcycle, ewcsNB_X_BUF_OPS);
-            wallcycle_stop(wcycle, ewcNB_XF_BUF_OPS);
+                                            nbv->nbat, wcycle);
         }
 
         if (bUseGPU)
@@ -1511,11 +1492,9 @@ static void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
          * communication with calculation with domain decomposition.
          */
         wallcycle_stop(wcycle, ewcFORCE);
-        wallcycle_start(wcycle, ewcNB_XF_BUF_OPS);
-        wallcycle_sub_start(wcycle, ewcsNB_F_BUF_OPS);
-        nbnxn_atomdata_add_nbat_f_to_f(nbv->nbs, eatAll, nbv->nbat, f);
-        wallcycle_sub_stop(wcycle, ewcsNB_F_BUF_OPS);
-        wallcycle_stop(wcycle, ewcNB_XF_BUF_OPS);
+
+        nbnxn_atomdata_add_nbat_f_to_f(nbv->nbs, eatAll, nbv->nbat, f, wcycle);
+
         wallcycle_start_nocount(wcycle, ewcFORCE);
 
         /* if there are multiple fshift output buffers reduce them */
@@ -1537,10 +1516,9 @@ static void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
 
     /* Compute the bonded and non-bonded energies and optionally forces */
     do_force_lowlevel(fr, inputrec, &(top->idef),
-                      cr, nrnb, wcycle, mdatoms,
-                      as_rvec_array(x.data()), hist, f, &forceWithVirial, enerd, fcd, top, fr->born,
-                      bBornRadii, box,
-                      inputrec->fepvals, lambda, graph, &(top->excls), fr->mu_tot,
+                      cr, ms, nrnb, wcycle, mdatoms,
+                      as_rvec_array(x.data()), hist, f, &forceWithVirial, enerd, fcd,
+                      box, inputrec->fepvals, lambda, graph, &(top->excls), fr->mu_tot,
                       flags, &cycles_pme);
 
     wallcycle_stop(wcycle, ewcFORCE);
@@ -1571,16 +1549,13 @@ static void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
                              step, nrnb, wcycle);
                 wallcycle_stop(wcycle, ewcFORCE);
             }
-            wallcycle_start(wcycle, ewcNB_XF_BUF_OPS);
-            wallcycle_sub_start(wcycle, ewcsNB_F_BUF_OPS);
+
             /* skip the reduction if there was no non-local work to do */
             if (nbv->grp[eintNonlocal].nbl_lists.nbl[0]->nsci > 0)
             {
                 nbnxn_atomdata_add_nbat_f_to_f(nbv->nbs, eatNonlocal,
-                                               nbv->nbat, f);
+                                               nbv->nbat, f, wcycle);
             }
-            wallcycle_sub_stop(wcycle, ewcsNB_F_BUF_OPS);
-            wallcycle_stop(wcycle, ewcNB_XF_BUF_OPS);
         }
     }
 
@@ -1597,9 +1572,7 @@ static void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
         }
         if (bDoForces)
         {
-            wallcycle_start(wcycle, ewcMOVEF);
-            dd_move_f(cr->dd, f, fr->fshift);
-            wallcycle_stop(wcycle, ewcMOVEF);
+            dd_move_f(cr->dd, f, fr->fshift, wcycle);
         }
     }
 
@@ -1687,12 +1660,8 @@ static void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
      * on the non-alternating path. */
     if (bUseOrEmulGPU && !alternateGpuWait)
     {
-        wallcycle_start(wcycle, ewcNB_XF_BUF_OPS);
-        wallcycle_sub_start(wcycle, ewcsNB_F_BUF_OPS);
         nbnxn_atomdata_add_nbat_f_to_f(nbv->nbs, eatLocal,
-                                       nbv->nbat, f);
-        wallcycle_sub_stop(wcycle, ewcsNB_F_BUF_OPS);
-        wallcycle_stop(wcycle, ewcNB_XF_BUF_OPS);
+                                       nbv->nbat, f, wcycle);
     }
 
     if (DOMAINDECOMP(cr))
@@ -1707,10 +1676,8 @@ static void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
          */
         if (vsite && !(fr->haveDirectVirialContributions && !(flags & GMX_FORCE_VIRIAL)))
         {
-            wallcycle_start(wcycle, ewcVSITESPREAD);
             spread_vsite_f(vsite, as_rvec_array(x.data()), f, fr->fshift, FALSE, nullptr, nrnb,
-                           &top->idef, fr->ePBC, fr->bMolPBC, graph, box, cr);
-            wallcycle_stop(wcycle, ewcVSITESPREAD);
+                           &top->idef, fr->ePBC, fr->bMolPBC, graph, box, cr, wcycle);
         }
 
         if (flags & GMX_FORCE_VIRIAL)
@@ -1750,6 +1717,7 @@ static void do_force_cutsVERLET(FILE *fplog, t_commrec *cr,
 }
 
 static void do_force_cutsGROUP(FILE *fplog, t_commrec *cr,
+                               const gmx_multisim_t *ms,
                                t_inputrec *inputrec,
                                gmx_int64_t step, t_nrnb *nrnb, gmx_wallcycle_t wcycle,
                                gmx_localtop_t *top,
@@ -1762,7 +1730,6 @@ static void do_force_cutsGROUP(FILE *fplog, t_commrec *cr,
                                real *lambda, t_graph *graph,
                                t_forcerec *fr, gmx_vsite_t *vsite, rvec mu_tot,
                                double t, gmx_edsam_t ed,
-                               gmx_bool bBornRadii,
                                int flags,
                                DdOpenBalanceRegionBeforeForceComputation ddOpenBalanceRegion,
                                DdCloseBalanceRegionAfterForceComputation ddCloseBalanceRegion)
@@ -1855,21 +1822,18 @@ static void do_force_cutsGROUP(FILE *fplog, t_commrec *cr,
          * and domain decomposition does not use the graph,
          * we do not need to worry about shifting.
          */
-        wallcycle_start(wcycle, ewcPP_PMESENDX);
         gmx_pme_send_coordinates(cr, box, as_rvec_array(x.data()),
                                  lambda[efptCOUL], lambda[efptVDW],
                                  (flags & (GMX_FORCE_VIRIAL | GMX_FORCE_ENERGY)),
-                                 step);
-        wallcycle_stop(wcycle, ewcPP_PMESENDX);
+                                 step, wcycle);
     }
 #endif /* GMX_MPI */
 
     /* Communicate coordinates and sum dipole if necessary */
     if (DOMAINDECOMP(cr))
     {
-        wallcycle_start(wcycle, ewcMOVEX);
-        dd_move_x(cr->dd, box, as_rvec_array(x.data()));
-        wallcycle_stop(wcycle, ewcMOVEX);
+        dd_move_x(cr->dd, box, as_rvec_array(x.data()), wcycle);
+
         /* No GPU support, no move_x overlap, so reopen the balance region here */
         if (ddOpenBalanceRegion == DdOpenBalanceRegionBeforeForceComputation::yes)
         {
@@ -1930,12 +1894,6 @@ static void do_force_cutsGROUP(FILE *fplog, t_commrec *cr,
         wallcycle_stop(wcycle, ewcNS);
     }
 
-    if (inputrec->implicit_solvent && bNS)
-    {
-        make_gb_nblist(cr, inputrec->gb_algorithm,
-                       as_rvec_array(x.data()), box, fr, &top->idef, graph, fr->born);
-    }
-
     if (DOMAINDECOMP(cr) && !thisRankHasDuty(cr, DUTY_PME))
     {
         wallcycle_start(wcycle, ewcPPDURINGPME);
@@ -1991,10 +1949,9 @@ static void do_force_cutsGROUP(FILE *fplog, t_commrec *cr,
 
     /* Compute the bonded and non-bonded energies and optionally forces */
     do_force_lowlevel(fr, inputrec, &(top->idef),
-                      cr, nrnb, wcycle, mdatoms,
-                      as_rvec_array(x.data()), hist, f, &forceWithVirial, enerd, fcd, top, fr->born,
-                      bBornRadii, box,
-                      inputrec->fepvals, lambda,
+                      cr, ms, nrnb, wcycle, mdatoms,
+                      as_rvec_array(x.data()), hist, f, &forceWithVirial, enerd, fcd,
+                      box, inputrec->fepvals, lambda,
                       graph, &(top->excls), fr->mu_tot,
                       flags,
                       &cycles_pme);
@@ -2021,8 +1978,7 @@ static void do_force_cutsGROUP(FILE *fplog, t_commrec *cr,
         /* Communicate the forces */
         if (DOMAINDECOMP(cr))
         {
-            wallcycle_start(wcycle, ewcMOVEF);
-            dd_move_f(cr->dd, f, fr->fshift);
+            dd_move_f(cr->dd, f, fr->fshift, wcycle);
             /* Do we need to communicate the separate force array
              * for terms that do not contribute to the single sum virial?
              * Position restraints and electric fields do not introduce
@@ -2033,9 +1989,8 @@ static void do_force_cutsGROUP(FILE *fplog, t_commrec *cr,
             if (EEL_FULL(fr->ic->eeltype) && cr->dd->n_intercg_excl &&
                 (flags & GMX_FORCE_VIRIAL))
             {
-                dd_move_f(cr->dd, as_rvec_array(forceWithVirial.force_.data()), nullptr);
+                dd_move_f(cr->dd, as_rvec_array(forceWithVirial.force_.data()), nullptr, wcycle);
             }
-            wallcycle_stop(wcycle, ewcMOVEF);
         }
 
         /* If we have NoVirSum forces, but we do not calculate the virial,
@@ -2043,10 +1998,8 @@ static void do_force_cutsGROUP(FILE *fplog, t_commrec *cr,
          */
         if (vsite && !(fr->haveDirectVirialContributions && !(flags & GMX_FORCE_VIRIAL)))
         {
-            wallcycle_start(wcycle, ewcVSITESPREAD);
             spread_vsite_f(vsite, as_rvec_array(x.data()), f, fr->fshift, FALSE, nullptr, nrnb,
-                           &top->idef, fr->ePBC, fr->bMolPBC, graph, box, cr);
-            wallcycle_stop(wcycle, ewcVSITESPREAD);
+                           &top->idef, fr->ePBC, fr->bMolPBC, graph, box, cr, wcycle);
         }
 
         if (flags & GMX_FORCE_VIRIAL)
@@ -2087,6 +2040,7 @@ static void do_force_cutsGROUP(FILE *fplog, t_commrec *cr,
 }
 
 void do_force(FILE *fplog, t_commrec *cr,
+              const gmx_multisim_t *ms,
               t_inputrec *inputrec,
               gmx_int64_t step, t_nrnb *nrnb, gmx_wallcycle_t wcycle,
               gmx_localtop_t *top,
@@ -2100,7 +2054,6 @@ void do_force(FILE *fplog, t_commrec *cr,
               t_forcerec *fr,
               gmx_vsite_t *vsite, rvec mu_tot,
               double t, gmx_edsam_t ed,
-              gmx_bool bBornRadii,
               int flags,
               DdOpenBalanceRegionBeforeForceComputation ddOpenBalanceRegion,
               DdCloseBalanceRegionAfterForceComputation ddCloseBalanceRegion)
@@ -2117,7 +2070,7 @@ void do_force(FILE *fplog, t_commrec *cr,
     switch (inputrec->cutoff_scheme)
     {
         case ecutsVERLET:
-            do_force_cutsVERLET(fplog, cr, inputrec,
+            do_force_cutsVERLET(fplog, cr, ms, inputrec,
                                 step, nrnb, wcycle,
                                 top,
                                 groups,
@@ -2129,13 +2082,12 @@ void do_force(FILE *fplog, t_commrec *cr,
                                 fr, fr->ic,
                                 vsite, mu_tot,
                                 t, ed,
-                                bBornRadii,
                                 flags,
                                 ddOpenBalanceRegion,
                                 ddCloseBalanceRegion);
             break;
         case ecutsGROUP:
-            do_force_cutsGROUP(fplog, cr, inputrec,
+            do_force_cutsGROUP(fplog, cr, ms, inputrec,
                                step, nrnb, wcycle,
                                top,
                                groups,
@@ -2146,7 +2098,6 @@ void do_force(FILE *fplog, t_commrec *cr,
                                lambda.data(), graph,
                                fr, vsite, mu_tot,
                                t, ed,
-                               bBornRadii,
                                flags,
                                ddOpenBalanceRegion,
                                ddCloseBalanceRegion);
@@ -2170,7 +2121,9 @@ void do_force(FILE *fplog, t_commrec *cr,
 
 void do_constrain_first(FILE *fplog, gmx_constr_t constr,
                         t_inputrec *ir, t_mdatoms *md,
-                        t_state *state, t_commrec *cr, t_nrnb *nrnb,
+                        t_state *state, t_commrec *cr,
+                        const gmx_multisim_t *ms,
+                        t_nrnb *nrnb,
                         t_forcerec *fr, gmx_localtop_t *top)
 {
     int             i, m, start, end;
@@ -2204,7 +2157,7 @@ void do_constrain_first(FILE *fplog, gmx_constr_t constr,
 
     /* constrain the current position */
     constrain(nullptr, TRUE, FALSE, constr, &(top->idef),
-              ir, cr, step, 0, 1.0, md,
+              ir, cr, ms, step, 0, 1.0, md,
               as_rvec_array(state->x.data()), as_rvec_array(state->x.data()), nullptr,
               fr->bMolPBC, state->box,
               state->lambda[efptBONDED], &dvdl_dum,
@@ -2214,7 +2167,7 @@ void do_constrain_first(FILE *fplog, gmx_constr_t constr,
         /* constrain the inital velocity, and save it */
         /* also may be useful if we need the ekin from the halfstep for velocity verlet */
         constrain(nullptr, TRUE, FALSE, constr, &(top->idef),
-                  ir, cr, step, 0, 1.0, md,
+                  ir, cr, ms, step, 0, 1.0, md,
                   as_rvec_array(state->x.data()), as_rvec_array(state->v.data()), as_rvec_array(state->v.data()),
                   fr->bMolPBC, state->box,
                   state->lambda[efptBONDED], &dvdl_dum,
@@ -2244,7 +2197,7 @@ void do_constrain_first(FILE *fplog, gmx_constr_t constr,
         }
         dvdl_dum = 0;
         constrain(nullptr, TRUE, FALSE, constr, &(top->idef),
-                  ir, cr, step, -1, 1.0, md,
+                  ir, cr, ms, step, -1, 1.0, md,
                   as_rvec_array(state->x.data()), savex, nullptr,
                   fr->bMolPBC, state->box,
                   state->lambda[efptBONDED], &dvdl_dum,
index 92ba77015f6f156276b814d98dc99b4c38895c8d..bb28aa0f2e0d1cb5918615b8a8849565520b38e8 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -47,6 +47,7 @@
 
 struct gmx_constr;
 struct gmx_localtop_t;
+struct gmx_multisim_t;
 struct gmx_output_env_t;
 struct gmx_update_t;
 struct MdrunOptions;
@@ -138,7 +139,9 @@ void initialize_lambdas(FILE *fplog, t_inputrec *ir, int *fep_state, gmx::ArrayR
 
 void do_constrain_first(FILE *log, gmx_constr *constr,
                         t_inputrec *inputrec, t_mdatoms *md,
-                        t_state *state, t_commrec *cr, t_nrnb *nrnb,
+                        t_state *state, t_commrec *cr,
+                        const gmx_multisim_t *ms,
+                        t_nrnb *nrnb,
                         t_forcerec *fr, gmx_localtop_t *top);
 
 void init_md(FILE *fplog,
index 4def33c34549f6037f0b5de5c159ef553d3a69f7..aa0a63f137b39747d18f9db8681a640722e0deeb 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 namespace gmx
 {
 
-SimulationSignaller::SimulationSignaller(SimulationSignals *signals,
-                                         const t_commrec   *cr,
-                                         bool               doInterSim,
-                                         bool               doIntraSim)
-    : signals_(signals), cr_(cr),
+SimulationSignaller::SimulationSignaller(SimulationSignals    *signals,
+                                         const t_commrec      *cr,
+                                         const gmx_multisim_t *ms,
+                                         bool                  doInterSim,
+                                         bool                  doIntraSim)
+    : signals_(signals), cr_(cr), ms_(ms),
       doInterSim_(doInterSim),
       doIntraSim_(doInterSim || doIntraSim),
       mpiBuffer_ {}
@@ -102,11 +103,11 @@ SimulationSignaller::signalInterSim()
     // multi-simulation begin active should already have issued an
     // error at mdrun time in release mode, so there's no need for a
     // release-mode assertion.
-    GMX_ASSERT(MULTISIM(cr_) != nullptr, "Cannot do inter-simulation signalling without a multi-simulation");
+    GMX_ASSERT(isMultiSim(ms_), "Cannot do inter-simulation signalling without a multi-simulation");
     if (MASTER(cr_))
     {
         // Communicate the signals between the simulations.
-        gmx_sum_sim(eglsNR, mpiBuffer_.data(), cr_->ms);
+        gmx_sum_sim(eglsNR, mpiBuffer_.data(), ms_);
     }
     // Communicate the signals from the master to the others.
     gmx_bcast(eglsNR*sizeof(mpiBuffer_[0]), mpiBuffer_.data(), cr_);
index 794908c98091e2bede8a6d6bd9e9d2b9610a9503..151a0d68b327217c6e4ce5ed157f528d51389df4 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2011,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2011,2014,2015,2016,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -56,6 +56,7 @@
 
 #include "gromacs/utility/real.h"
 
+struct gmx_multisim_t;
 struct t_commrec;
 
 //! Kinds of simulation conditions to signal about.
@@ -113,10 +114,11 @@ class SimulationSignaller
 {
     public:
         //! Constructor
-        SimulationSignaller(SimulationSignals *signals,
-                            const t_commrec   *cr,
-                            bool               doInterSim,
-                            bool               doIntraSim);
+        SimulationSignaller(SimulationSignals    *signals,
+                            const t_commrec      *cr,
+                            const gmx_multisim_t *ms,
+                            bool                  doInterSim,
+                            bool                  doIntraSim);
         /*! \brief Return a reference to an array of signal values to communicate.
          *
          * \return If intra-sim signalling will take place, fill and
@@ -147,6 +149,8 @@ class SimulationSignaller
         SimulationSignals       *signals_;
         //! Communication object.
         const t_commrec         *cr_;
+        //! Multi-sim handler.
+        const gmx_multisim_t    *ms_;
         //! Do inter-sim communication at this step.
         bool                     doInterSim_;
         //! Do intra-sim communication at this step.
index d3fb7ce6fb90e83643be61fc63d0c584ed50e96d..591a701d9f89d3f1524b589a3a47d6a778286e4b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2016, by the GROMACS development team, led by
+ * Copyright (c) 2016,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -56,7 +56,7 @@ namespace test
 //! Check that a null signaller can be called without problems
 TEST(NullSignalTest, NullSignallerWorks)
 {
-    SimulationSignaller signaller(nullptr, nullptr, false, false);
+    SimulationSignaller signaller(nullptr, nullptr, nullptr, false, false);
     EXPECT_EQ(0, signaller.getCommunicationBuffer().size());
     signaller.finalizeSignals();
 }
@@ -77,7 +77,7 @@ class SignalTest : public ::testing::Test
 
 TEST_F(SignalTest, NoSignalPropagatesIfNoSignallingTakesPlace)
 {
-    SimulationSignaller signaller(&signals_, nullptr, false, false);
+    SimulationSignaller signaller(&signals_, nullptr, nullptr, false, false);
     EXPECT_EQ(0, signaller.getCommunicationBuffer().size());
     signaller.finalizeSignals();
     EXPECT_EQ(1, signals_[0].sig);
@@ -90,7 +90,7 @@ TEST_F(SignalTest, NoSignalPropagatesIfNoSignallingTakesPlace)
 
 TEST_F(SignalTest, LocalIntraSimSignalPropagatesWhenIntraSimSignalTakesPlace)
 {
-    SimulationSignaller signaller(&signals_, nullptr, false, true);
+    SimulationSignaller signaller(&signals_, nullptr, nullptr, false, true);
     EXPECT_NE(0, signaller.getCommunicationBuffer().size());
     signaller.finalizeSignals();
     EXPECT_EQ(0, signals_[0].sig);
@@ -103,7 +103,7 @@ TEST_F(SignalTest, LocalIntraSimSignalPropagatesWhenIntraSimSignalTakesPlace)
 
 TEST_F(SignalTest, LocalIntraSimSignalPropagatesWhenInterSimTakesPlace)
 {
-    SimulationSignaller signaller(&signals_, nullptr, true, false);
+    SimulationSignaller signaller(&signals_, nullptr, nullptr, true, false);
     EXPECT_NE(0, signaller.getCommunicationBuffer().size());
     // Can't call finalizeSignals without a full commrec
     signaller.setSignals();
@@ -117,7 +117,7 @@ TEST_F(SignalTest, LocalIntraSimSignalPropagatesWhenInterSimTakesPlace)
 
 TEST_F(SignalTest, LocalIntraSimSignalPropagatesWhenBothTakePlace)
 {
-    SimulationSignaller signaller(&signals_, nullptr, true, true);
+    SimulationSignaller signaller(&signals_, nullptr, nullptr, true, true);
     EXPECT_NE(0, signaller.getCommunicationBuffer().size());
     // Can't call finalizeSignals without a full commrec
     signaller.setSignals();
@@ -132,7 +132,7 @@ TEST_F(SignalTest, LocalIntraSimSignalPropagatesWhenBothTakePlace)
 TEST_F(SignalTest, NonLocalSignalDoesntPropagateWhenIntraSimSignalTakesPlace)
 {
     signals_[0].isLocal = false;
-    SimulationSignaller signaller(&signals_, nullptr, false, true);
+    SimulationSignaller signaller(&signals_, nullptr, nullptr, false, true);
     EXPECT_NE(0, signaller.getCommunicationBuffer().size());
     signaller.finalizeSignals();
     EXPECT_EQ(1, signals_[0].sig);
@@ -146,7 +146,7 @@ TEST_F(SignalTest, NonLocalSignalDoesntPropagateWhenIntraSimSignalTakesPlace)
 TEST_F(SignalTest, NonLocalSignalPropagatesWhenInterSimSignalTakesPlace)
 {
     signals_[0].isLocal = false;
-    SimulationSignaller signaller(&signals_, nullptr, true, false);
+    SimulationSignaller signaller(&signals_, nullptr, nullptr, true, false);
     EXPECT_NE(0, signaller.getCommunicationBuffer().size());
     // Can't call finalizeSignals without a full commrec
     signaller.setSignals();
@@ -161,7 +161,7 @@ TEST_F(SignalTest, NonLocalSignalPropagatesWhenInterSimSignalTakesPlace)
 TEST_F(SignalTest, NonLocalSignalPropagatesWhenBothTakePlace)
 {
     signals_[0].isLocal = false;
-    SimulationSignaller signaller(&signals_, nullptr, true, true);
+    SimulationSignaller signaller(&signals_, nullptr, nullptr, true, true);
     EXPECT_NE(0, signaller.getCommunicationBuffer().size());
     // Can't call finalizeSignals without a full commrec
     signaller.setSignals();
index 79e5ca7379ee2d30dfc48bfcf8fb828a13e24a9e..97a882c2d491a5e6a33453ddfc51be5092e43b2a 100644 (file)
@@ -127,7 +127,9 @@ namespace gmx
 {
 
 /*! \brief Do test particle insertion.
-    \copydoc integrator_t (FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
+    \copydoc integrator_t (FILE *fplog, t_commrec *cr,
+                           const gmx_multi_sim_t *,
+                           const gmx::MDLogger &mdlog,
                            int nfile, const t_filenm fnm[],
                            const gmx_output_env_t *oenv,
                            const MdrunOptions &mdrunOptions,
@@ -144,7 +146,9 @@ namespace gmx
                            gmx_membed_t gmx_unused *membed,
                            gmx_walltime_accounting_t walltime_accounting)
  */
-double do_tpi(FILE *fplog, t_commrec *cr, const gmx::MDLogger gmx_unused &mdlog,
+double do_tpi(FILE *fplog, t_commrec *cr,
+              const gmx_multisim_t *ms,
+              const gmx::MDLogger gmx_unused &mdlog,
               int nfile, const t_filenm fnm[],
               const gmx_output_env_t *oenv,
               const MdrunOptions &mdrunOptions,
@@ -659,12 +663,12 @@ double do_tpi(FILE *fplog, t_commrec *cr, const gmx::MDLogger gmx_unused &mdlog,
              * out of the box. */
             /* Make do_force do a single node force calculation */
             cr->nnodes = 1;
-            do_force(fplog, cr, inputrec,
+            do_force(fplog, cr, ms, inputrec,
                      step, nrnb, wcycle, top, &top_global->groups,
                      state_global->box, state_global->x, &state_global->hist,
                      f, force_vir, mdatoms, enerd, fcd,
                      state_global->lambda,
-                     nullptr, fr, nullptr, mu_tot, t, nullptr, FALSE,
+                     nullptr, fr, nullptr, mu_tot, t, nullptr,
                      GMX_FORCE_NONBONDED | GMX_FORCE_ENERGY |
                      (bNS ? GMX_FORCE_DYNAMICBOX | GMX_FORCE_NS : 0) |
                      (bStateChanged ? GMX_FORCE_STATECHANGED : 0),
index 6fc8aa4bbf8e0f181b1f8bf9e563e6b55a721af6..1cab82b2695e1726920a1e8ebdcbe6787d0eca3c 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -1553,6 +1553,7 @@ void update_constraints(FILE                          *fplog,
                         t_idef                        *idef,
                         tensor                         vir_part,
                         t_commrec                     *cr,
+                        const gmx_multisim_t          *ms,
                         t_nrnb                        *nrnb,
                         gmx_wallcycle_t                wcycle,
                         gmx_update_t                  *upd,
@@ -1611,7 +1612,7 @@ void update_constraints(FILE                          *fplog,
         if (EI_VV(inputrec->eI) && bFirstHalf)
         {
             constrain(nullptr, bLog, bEner, constr, idef,
-                      inputrec, cr, step, 1, 1.0, md,
+                      inputrec, cr, ms, step, 1, 1.0, md,
                       as_rvec_array(state->x.data()), as_rvec_array(state->v.data()), as_rvec_array(state->v.data()),
                       bMolPBC, state->box,
                       state->lambda[efptBONDED], dvdlambda,
@@ -1620,7 +1621,7 @@ void update_constraints(FILE                          *fplog,
         else
         {
             constrain(nullptr, bLog, bEner, constr, idef,
-                      inputrec, cr, step, 1, 1.0, md,
+                      inputrec, cr, ms, step, 1, 1.0, md,
                       as_rvec_array(state->x.data()), as_rvec_array(upd->xp.data()), nullptr,
                       bMolPBC, state->box,
                       state->lambda[efptBONDED], dvdlambda,
@@ -1681,7 +1682,7 @@ void update_constraints(FILE                          *fplog,
             wallcycle_start(wcycle, ewcCONSTR);
 
             constrain(nullptr, bLog, bEner, constr, idef,
-                      inputrec, cr, step, 1, 0.5, md,
+                      inputrec, cr, ms, step, 1, 0.5, md,
                       as_rvec_array(state->x.data()), as_rvec_array(upd->xp.data()), nullptr,
                       bMolPBC, state->box,
                       state->lambda[efptBONDED], dvdlambda,
index 742ec58e823e735f078e7ab2e877fbaf7a0d92ab..d29ec47f52f0088ac66654580fc4fb10c2155166 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -48,6 +48,7 @@ class ekinstate_t;
 struct gmx_constr;
 struct gmx_ekindata_t;
 struct gmx_enerdata_t;
+struct gmx_multisim_t;
 struct t_extmass;
 struct t_fcdata;
 struct t_graph;
@@ -144,6 +145,7 @@ void update_constraints(FILE                    *fplog,
                         t_idef                  *idef,
                         tensor                   vir_part,
                         t_commrec               *cr,
+                        const gmx_multisim_t    *ms,
                         t_nrnb                  *nrnb,
                         gmx_wallcycle_t          wcycle,
                         gmx_update_t            *upd,
index 5f1021e87fc088dab3cdba9957cab5927ef82648..38fd2e8ef6535d00df0542a7047b70ed7806b2dd 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #include "gromacs/math/vec.h"
 #include "gromacs/mdlib/gmx_omp_nthreads.h"
 #include "gromacs/mdtypes/commrec.h"
+#include "gromacs/mdtypes/mdatom.h"
 #include "gromacs/pbcutil/ishift.h"
 #include "gromacs/pbcutil/mshift.h"
 #include "gromacs/pbcutil/pbc.h"
+#include "gromacs/timing/wallcycle.h"
 #include "gromacs/topology/ifunc.h"
 #include "gromacs/topology/mtop_util.h"
+#include "gromacs/topology/topology.h"
 #include "gromacs/utility/exceptions.h"
 #include "gromacs/utility/fatalerror.h"
 #include "gromacs/utility/gmxassert.h"
 #include "gromacs/utility/gmxomp.h"
 #include "gromacs/utility/smalloc.h"
 
-
 /* The strategy used here for assigning virtual sites to (thread-)tasks
  * is as follows:
  *
@@ -1615,8 +1617,9 @@ void spread_vsite_f(const gmx_vsite_t *vsite,
                     gmx_bool VirCorr, matrix vir,
                     t_nrnb *nrnb, const t_idef *idef,
                     int ePBC, gmx_bool bMolPBC, const t_graph *g, const matrix box,
-                    t_commrec *cr)
+                    t_commrec *cr, gmx_wallcycle *wcycle)
 {
+    wallcycle_start(wcycle, ewcVSITESPREAD);
     const bool useDomdec = vsite->useDomdec;
     GMX_ASSERT(!useDomdec || (cr != nullptr && DOMAINDECOMP(cr)), "When vsites are set up with domain decomposition, we need a valid commrec");
 
@@ -1817,6 +1820,8 @@ void spread_vsite_f(const gmx_vsite_t *vsite,
     inc_nrnb(nrnb, eNR_VSITE4FD, vsite_count(idef->il, F_VSITE4FD));
     inc_nrnb(nrnb, eNR_VSITE4FDN, vsite_count(idef->il, F_VSITE4FDN));
     inc_nrnb(nrnb, eNR_VSITEN,   vsite_count(idef->il, F_VSITEN));
+
+    wallcycle_stop(wcycle, ewcVSITESPREAD);
 }
 
 /*! \brief Returns the an array with charge-group indices for each atom
@@ -2106,8 +2111,8 @@ gmx_vsite_t *initVsite(const gmx_mtop_t &mtop,
     return vsite;
 }
 
-static gmx_inline void flagAtom(InterdependentTask *idTask, int atom,
-                                int thread, int nthread, int natperthread)
+static inline void flagAtom(InterdependentTask *idTask, int atom,
+                            int thread, int nthread, int natperthread)
 {
     if (!idTask->use[atom])
     {
index b45930848980d982ae1d16e396690ab8ae68f8db..ae84408b81d59602615f1069ebe2b22c84fc6d87 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -51,6 +51,7 @@ struct t_graph;
 struct t_ilist;
 struct t_mdatoms;
 struct t_nrnb;
+struct gmx_wallcycle;
 
 typedef struct gmx_vsite_t {
     gmx_bool             bHaveChargeGroups;    /* Do we have charge groups?               */
@@ -102,7 +103,7 @@ void spread_vsite_f(const gmx_vsite_t *vsite,
                     gmx_bool VirCorr, matrix vir,
                     t_nrnb *nrnb, const t_idef *idef,
                     int ePBC, gmx_bool bMolPBC, const t_graph *g, const matrix box,
-                    t_commrec *cr);
+                    t_commrec *cr, gmx_wallcycle *wcycle);
 /* Spread the force operating on the vsite atoms on the surrounding atoms.
  * If fshift!=NULL also update the shift forces.
  * If VirCorr=TRUE add the virial correction for non-linear vsite constructs
index 6ef0c7256981dd43ebf39b5c7339165a34adffc1..e21ef66c803b3d65ae6660c36e9269ca3ccad2b5 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -108,9 +108,6 @@ read_checkpoint_data(const char *filename, int *simulation_part,
                      bool *bDoAppendFiles)
 {
     t_fileio            *fp;
-    int                  nfiles;
-    gmx_file_position_t *outputfiles;
-    int                  nexist, f;
     char                *fn, suf_up[STRLEN];
 
     *bDoAppendFiles = FALSE;
@@ -126,22 +123,22 @@ read_checkpoint_data(const char *filename, int *simulation_part,
         }
         else
         {
+            std::vector<gmx_file_position_t> outputfiles;
             read_checkpoint_simulation_part_and_filenames(fp,
                                                           simulation_part,
-                                                          &nfiles,
                                                           &outputfiles);
 
             if (bTryToAppendFiles)
             {
-                nexist = 0;
-                for (f = 0; f < nfiles; f++)
+                std::size_t nexist = 0;
+                for (const auto &outputfile : outputfiles)
                 {
-                    if (exist_output_file(outputfiles[f].filename, nfile, fnm))
+                    if (exist_output_file(outputfile.filename, nfile, fnm))
                     {
                         nexist++;
                     }
                 }
-                if (nexist == nfiles)
+                if (nexist == outputfiles.size())
                 {
                     *bDoAppendFiles = bTryToAppendFiles;
                 }
@@ -157,27 +154,27 @@ read_checkpoint_data(const char *filename, int *simulation_part,
                             "are not present or not named as the output files by the current program:\n",
                             filename);
                     fprintf(stderr, "Expect output files present:\n");
-                    for (f = 0; f < nfiles; f++)
+                    for (const auto &outputfile : outputfiles)
                     {
-                        if (exist_output_file(outputfiles[f].filename,
+                        if (exist_output_file(outputfile.filename,
                                               nfile, fnm))
                         {
-                            fprintf(stderr, "  %s\n", outputfiles[f].filename);
+                            fprintf(stderr, "  %s\n", outputfile.filename);
                         }
                     }
                     fprintf(stderr, "\n");
                     fprintf(stderr, "Expected output files not present or named differently:\n");
-                    for (f = 0; f < nfiles; f++)
+                    for (const auto &outputfile : outputfiles)
                     {
-                        if (!exist_output_file(outputfiles[f].filename,
+                        if (!exist_output_file(outputfile.filename,
                                                nfile, fnm))
                         {
-                            fprintf(stderr, "  %s\n", outputfiles[f].filename);
+                            fprintf(stderr, "  %s\n", outputfile.filename);
                         }
                     }
 
                     gmx_fatal(FARGS,
-                              "File appending requested, but %d of the %d output files are not present or are named differently. "
+                              "File appending requested, but %zu of the %zu output files are not present or are named differently. "
                               "For safety reasons, GROMACS-2016 and later only allows file appending to be used when all files "
                               "have the same names as they had in the original run. "
                               "Checkpointing is merely intended for plain continuation of runs. "
@@ -188,13 +185,13 @@ read_checkpoint_data(const char *filename, int *simulation_part,
                               "If the files are not available, you "
                               "can add the -noappend flag to mdrun and write separate new parts. "
                               "For mere concatenation of files, you should use the gmx trjcat tool instead.",
-                              nfiles-nexist, nfiles);
+                              outputfiles.size()-nexist, outputfiles.size());
                 }
             }
 
             if (*bDoAppendFiles)
             {
-                if (nfiles == 0)
+                if (outputfiles.empty())
                 {
                     gmx_fatal(FARGS, "File appending requested, but no output file information is stored in the checkpoint file");
                 }
@@ -212,8 +209,6 @@ read_checkpoint_data(const char *filename, int *simulation_part,
                 *bAddPart = (strstr(fn, part_suffix) != nullptr ||
                              strstr(fn, suf_up) != nullptr);
             }
-
-            sfree(outputfiles);
         }
     }
     if (PAR(cr))
@@ -231,12 +226,13 @@ read_checkpoint_data(const char *filename, int *simulation_part,
 
 /* This routine cannot print tons of data, since it is called before the log file is opened. */
 void
-handleRestart(t_commrec *cr,
-              gmx_bool   bTryToAppendFiles,
-              const int  NFILE,
-              t_filenm   fnm[],
-              bool      *bDoAppendFiles,
-              bool      *bStartFromCpt)
+handleRestart(t_commrec            *cr,
+              const gmx_multisim_t *ms,
+              gmx_bool              bTryToAppendFiles,
+              const int             NFILE,
+              t_filenm              fnm[],
+              bool                 *bDoAppendFiles,
+              bool                 *bStartFromCpt)
 {
     gmx_bool        bAddPart;
     int             sim_part, sim_part_fn;
@@ -255,7 +251,7 @@ handleRestart(t_commrec *cr,
                              &sim_part_fn, cr,
                              bTryToAppendFiles, NFILE, fnm,
                              part_suffix, &bAddPart, bDoAppendFiles);
-        if (sim_part_fn == 0 && MULTIMASTER(cr))
+        if (sim_part_fn == 0 && isMasterSimMasterRank(ms, cr))
         {
             fprintf(stdout, "No previous checkpoint file present with -cpi option, assuming this is a new run.\n");
         }
@@ -264,9 +260,13 @@ handleRestart(t_commrec *cr,
             sim_part = sim_part_fn + 1;
         }
 
-        if (MULTISIM(cr) && MASTER(cr))
+        // Master ranks of multi simulations should check that the
+        // simulation part number is consistent across the
+        // simulations.
+        if (isMultiSim(ms) && MASTER(cr))
         {
-            if (MULTIMASTER(cr))
+            // Only the master simulation should report on problems.
+            if (isMasterSimMasterRank(ms, cr))
             {
                 /* Log file is not yet available, so if there's a
                  * problem we can only write to stderr. */
@@ -276,7 +276,7 @@ handleRestart(t_commrec *cr,
             {
                 fpmulti = nullptr;
             }
-            check_multi_int(fpmulti, cr->ms, sim_part, "simulation part", TRUE);
+            check_multi_int(fpmulti, ms, sim_part, "simulation part", TRUE);
         }
     }
     else
@@ -301,7 +301,7 @@ handleRestart(t_commrec *cr,
         sprintf(suffix, "%s%04d", part_suffix, sim_part_fn);
 
         add_suffix_to_output_names(fnm, NFILE, suffix);
-        if (MULTIMASTER(cr))
+        if (isMasterSimMasterRank(ms, cr))
         {
             fprintf(stdout, "Checkpoint file is from part %d, new output files will be suffixed '%s'.\n", sim_part-1, suffix);
         }
index 350f78d248bb4a0042ece19434e34e220d2b9638..dd6a3b350dd24448fe222beef0bb5445c429ba0c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #ifndef GMX_MDRUNUTILITY_HANDLERESTART_H
 #define GMX_MDRUNUTILITY_HANDLERESTART_H
 
-#include "gromacs/mdtypes/commrec.h"
 #include "gromacs/utility/basedefinitions.h"
 
+struct gmx_multisim_t;
+struct t_commrec;
 struct t_filenm;
 
 /*! \brief Handle startup of mdrun, particularly regarding -cpi and -append
@@ -80,6 +81,7 @@ struct t_filenm;
  * and/or simulations.
  *
  * \param[in]    cr                 Communication structure
+ * \param[in]    ms                 Handles multi-simulations.
  * \param[in]    bTryToAppendFiles  Whether appending is requested (from mdrun)
  * \param[in]    NFILE              Size of fnm struct
  * \param[inout] fnm                Filename parameters to mdrun
@@ -90,11 +92,12 @@ struct t_filenm;
  * \param[out]   bStartFromCpt      True on return if we found the checkpoint
  *                                  and will use it to restart.
  */
-void handleRestart(t_commrec *cr,
-                   gmx_bool   bTryToAppendFiles,
-                   const int  NFILE,
-                   t_filenm   fnm[],
-                   bool      *bDoAppendFiles,
-                   bool      *bStartFromCpt);
+void handleRestart(t_commrec            *cr,
+                   const gmx_multisim_t *ms,
+                   gmx_bool              bTryToAppendFiles,
+                   const int             NFILE,
+                   t_filenm              fnm[],
+                   bool                 *bDoAppendFiles,
+                   bool                 *bStartFromCpt);
 
 #endif
index cf1521a120727eb39938bef55322d195111eaffc..e3d78db24f651d409ce5b123650ec42bc2570b05 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -165,14 +165,20 @@ class ThreadAffinityTestHelper
             }
         }
 
-        void setAffinity(int nthread_local)
+        void setAffinity(int numThreadsOnThisRank)
         {
             if (hwTop_ == nullptr)
             {
                 setLogicalProcessorCount(1);
             }
+            int numThreadsOnThisNode, indexWithinNodeOfFirstThreadOnThisRank;
+            analyzeThreadsOnThisNode(cr_, nullptr, &affinityAccess_,
+                                     numThreadsOnThisRank,
+                                     &numThreadsOnThisNode,
+                                     &indexWithinNodeOfFirstThreadOnThisRank);
             gmx_set_thread_affinity(logHelper_.logger(), cr_, &hwOpt_, *hwTop_,
-                                    nthread_local, &affinityAccess_);
+                                    numThreadsOnThisRank, numThreadsOnThisNode,
+                                    indexWithinNodeOfFirstThreadOnThisRank, &affinityAccess_);
         }
 
     private:
index bf2d352efc8b7429ad76ea01226b68a94ee5472c..b316c4aa00e639b8c8f7b1558c2c7530b74f2fdd 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -265,7 +265,7 @@ get_thread_affinity_layout(const gmx::MDLogger &mdlog,
     return validLayout;
 }
 
-static bool set_affinity(const t_commrec *cr, int nthread_local, int thread0_id_node,
+static bool set_affinity(const t_commrec *cr, int nthread_local, int intraNodeThreadOffset,
                          int offset, int core_pinning_stride, int *localityOrder,
                          gmx::IThreadAffinityAccess *affinityAccess)
 {
@@ -287,7 +287,7 @@ static bool set_affinity(const t_commrec *cr, int nthread_local, int thread0_id_
             int      index, core;
 
             thread_id      = gmx_omp_get_thread_num();
-            thread_id_node = thread0_id_node + thread_id;
+            thread_id_node = intraNodeThreadOffset + thread_id;
             index          = offset + thread_id_node*core_pinning_stride;
             if (localityOrder != nullptr)
             {
@@ -354,6 +354,46 @@ static bool set_affinity(const t_commrec *cr, int nthread_local, int thread0_id_
     return allAffinitiesSet;
 }
 
+void analyzeThreadsOnThisNode(const t_commrec            *cr,
+                              const gmx_multisim_t       *ms,
+                              gmx::IThreadAffinityAccess *affinityAccess,
+                              int                         numThreadsOnThisRank,
+                              int                        *numThreadsOnThisNode,
+                              int                        *intraNodeThreadOffset)
+{
+    *intraNodeThreadOffset                  = 0;
+    *numThreadsOnThisNode                   = numThreadsOnThisRank;
+#if GMX_MPI
+    if (PAR(cr) || isMultiSim(ms))
+    {
+        if (affinityAccess == nullptr)
+        {
+            affinityAccess = &g_defaultAffinityAccess;
+        }
+
+        /* We need to determine a scan of the thread counts in this
+         * compute node.
+         */
+        MPI_Comm comm_intra;
+
+        MPI_Comm_split(MPI_COMM_WORLD,
+                       affinityAccess->physicalNodeId(), cr->rank_intranode,
+                       &comm_intra);
+        MPI_Scan(&numThreadsOnThisRank, intraNodeThreadOffset, 1, MPI_INT, MPI_SUM, comm_intra);
+        /* MPI_Scan is inclusive, but here we need exclusive */
+        *intraNodeThreadOffset -= numThreadsOnThisRank;
+        /* Get the total number of threads on this physical node */
+        MPI_Allreduce(&numThreadsOnThisRank, numThreadsOnThisNode, 1, MPI_INT, MPI_SUM, comm_intra);
+        MPI_Comm_free(&comm_intra);
+    }
+#else
+    GMX_UNUSED_VALUE(cr);
+    GMX_UNUSED_VALUE(ms);
+    GMX_UNUSED_VALUE(affinityAccess);
+#endif
+
+}
+
 /* Set CPU affinity. Can be important for performance.
    On some systems (e.g. Cray) CPU Affinity is set by default.
    But default assigning doesn't work (well) with only some ranks
@@ -368,11 +408,12 @@ gmx_set_thread_affinity(const gmx::MDLogger         &mdlog,
                         const t_commrec             *cr,
                         const gmx_hw_opt_t          *hw_opt,
                         const gmx::HardwareTopology &hwTop,
-                        int                          nthread_local,
+                        int                          numThreadsOnThisRank,
+                        int                          numThreadsOnThisNode,
+                        int                          intraNodeThreadOffset,
                         gmx::IThreadAffinityAccess  *affinityAccess)
 {
-    int        thread0_id_node, nthread_node;
-    int *      localityOrder = nullptr;
+    int *localityOrder = nullptr;
 
     if (hw_opt->thread_affinity == threadaffOFF)
     {
@@ -390,39 +431,16 @@ gmx_set_thread_affinity(const gmx::MDLogger         &mdlog,
      * want to support. */
     if (!affinityAccess->isThreadAffinitySupported())
     {
-        /* we know Mac OS & BlueGene do not support setting thread affinity, so there's
+        /* we know Mac OS does not support setting thread affinity, so there's
            no point in warning the user in that case. In any other case
            the user might be able to do something about it. */
-#if !defined(__APPLE__) && !defined(__bg__)
+#if !defined(__APPLE__)
         GMX_LOG(mdlog.warning).asParagraph().appendText(
                 "NOTE: Cannot set thread affinities on the current platform.");
 #endif  /* __APPLE__ */
         return;
     }
 
-    /* map the current process to cores */
-    thread0_id_node = 0;
-    nthread_node    = nthread_local;
-#if GMX_MPI
-    if (PAR(cr) || MULTISIM(cr))
-    {
-        /* We need to determine a scan of the thread counts in this
-         * compute node.
-         */
-        MPI_Comm comm_intra;
-
-        MPI_Comm_split(MPI_COMM_WORLD,
-                       affinityAccess->physicalNodeId(), cr->rank_intranode,
-                       &comm_intra);
-        MPI_Scan(&nthread_local, &thread0_id_node, 1, MPI_INT, MPI_SUM, comm_intra);
-        /* MPI_Scan is inclusive, but here we need exclusive */
-        thread0_id_node -= nthread_local;
-        /* Get the total number of threads on this physical node */
-        MPI_Allreduce(&nthread_local, &nthread_node, 1, MPI_INT, MPI_SUM, comm_intra);
-        MPI_Comm_free(&comm_intra);
-    }
-#endif
-
     int  offset              = hw_opt->core_pinning_offset;
     int  core_pinning_stride = hw_opt->core_pinning_stride;
     if (offset != 0)
@@ -435,7 +453,7 @@ gmx_set_thread_affinity(const gmx::MDLogger         &mdlog,
          !hw_opt->totNumThreadsIsAuto);
     bool issuedWarning;
     bool validLayout
-        = get_thread_affinity_layout(mdlog, cr, hwTop, nthread_node,
+        = get_thread_affinity_layout(mdlog, cr, hwTop, numThreadsOnThisNode,
                                      affinityIsAutoAndNumThreadsIsNotAuto,
                                      offset, &core_pinning_stride, &localityOrder,
                                      &issuedWarning);
@@ -444,7 +462,7 @@ gmx_set_thread_affinity(const gmx::MDLogger         &mdlog,
     bool                    allAffinitiesSet;
     if (validLayout)
     {
-        allAffinitiesSet = set_affinity(cr, nthread_local, thread0_id_node,
+        allAffinitiesSet = set_affinity(cr, numThreadsOnThisRank, intraNodeThreadOffset,
                                         offset, core_pinning_stride, localityOrder,
                                         affinityAccess);
     }
index 5511c82e0d2f3a35d82c33707ab6be1829adc949..499aecb52e3c5b466eead7e2ecfb38f04334fd26 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -47,6 +47,7 @@
 #include "gromacs/utility/basedefinitions.h"
 
 struct gmx_hw_opt_t;
+struct gmx_multisim_t;
 struct t_commrec;
 
 namespace gmx
@@ -68,15 +69,49 @@ class IThreadAffinityAccess
 
 } // namespace gmx
 
+/*! \brief Communicates within physical nodes to discover the
+ * distribution of threads over ranks.
+ *
+ * See gmx_set_thread_affinity(), which consumes this output.
+ *
+ * \param[in]  cr                     Communication handler.
+ * \param[in]  ms                     Multi-simulation handler.
+ * \param[in]  affinityAccess         Interface for low-level access to affinity details.
+ * \param[in]  numThreadsOnThisRank   The number of threads on this rank.
+ * \param[out] numThreadsOnThisNode   On exit, the number of threads on all ranks of this node.
+ * \param[out] intraNodeThreadOffset  On exit, the index of the first hardware thread of this rank
+ *   in the set of all the threads of all MPI ranks within a node (ordered by MPI rank ID).
+ */
+void analyzeThreadsOnThisNode(const t_commrec            *cr,
+                              const gmx_multisim_t       *ms,
+                              gmx::IThreadAffinityAccess *affinityAccess,
+                              int                         numThreadsOnThisRank,
+                              int                        *numThreadsOnThisNode,
+                              int                        *intraNodeThreadOffset);
+
 /*! \brief
  * Sets the thread affinity using the requested setting stored in hw_opt.
+ *
+ * See analyzeThreadsOnThisNode(), which prepares some of the input.
+ *
+ * \param[out] mdlog                  Logger.
+ * \param[in]  cr                     Communication handler.
+ * \param[in]  hw_opt                 Accesses user choices for thread affinity handling.
+ * \param[in]  hwTop                  Detected hardware topology.
+ * \param[in]  numThreadsOnThisRank   The number of threads on this rank.
+ * \param[in]  numThreadsOnThisNode   The number of threads on all ranks of this node.
+ * \param[in]  intraNodeThreadOffset  The index of the first hardware thread of this rank
+ *   in the set of all the threads of all MPI ranks within a node (ordered by MPI rank ID).
+ * \param[in]  affinityAccess         Interface for low-level access to affinity details.
  */
 void
 gmx_set_thread_affinity(const gmx::MDLogger         &mdlog,
                         const t_commrec             *cr,
                         const gmx_hw_opt_t          *hw_opt,
                         const gmx::HardwareTopology &hwTop,
-                        int                          nthread_local,
+                        int                          numThreadsOnThisRank,
+                        int                          numThreadsOnThisNode,
+                        int                          intraNodeThreadOffset,
                         gmx::IThreadAffinityAccess  *affinityAccess);
 
 /*! \brief
index 0345f1edd33a67a330fc5d0645811f23b8d466ff..15fdd97fd00dad3d17d9f7e2aa3c58612ae8fece 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -63,14 +63,17 @@ typedef struct {
     int              dbuf_alloc;
 } mpi_in_place_buf_t;
 
-struct gmx_multisim_t {
-    int       nsim;
-    int       sim;
-    MPI_Group mpi_group_masters;
-    MPI_Comm  mpi_comm_masters;
+void done_mpi_in_place_buf(mpi_in_place_buf_t *buf);
+
+struct gmx_multisim_t
+{
+    int       nsim              = 1;
+    int       sim               = 0;
+    MPI_Group mpi_group_masters = MPI_GROUP_NULL;
+    MPI_Comm  mpi_comm_masters  = MPI_COMM_NULL;
     /* these buffers are used as destination buffers if MPI_IN_PLACE isn't
        supported.*/
-    mpi_in_place_buf_t *mpb;
+    mpi_in_place_buf_t *mpb = nullptr;
 };
 
 #define DUTY_PP  (1<<0)
@@ -110,8 +113,6 @@ struct t_commrec {
                                            */
     int            nrank_intranode;       /* nr of ranks on this physical node */
     int            rank_intranode;        /* our rank on this physical node */
-    int            nrank_pp_intranode;    /* as nrank_intranode, for particle-particle only */
-    int            rank_pp_intranode;     /* as rank_intranode, for particle-particle only */
 
     gmx_nodecomm_t nc;
 
@@ -123,8 +124,6 @@ struct t_commrec {
      */
     int                    duty;
 
-    gmx_multisim_t        *ms;
-
     /* these buffers are used as destination buffers if MPI_IN_PLACE isn't
        supported.*/
     mpi_in_place_buf_t *mpb;
@@ -179,13 +178,25 @@ inline bool thisRankHasDuty(const t_commrec *cr, int duty)
  * than one domain, not just that the dd algorithm is active. */
 #define DOMAINDECOMP(cr)   (((cr)->dd != NULL) && PAR(cr))
 
-//! Are we doing multiple independent simulations
-#define MULTISIM(cr)       ((cr)->ms)
+//! Are we doing multiple independent simulations?
+static bool inline isMultiSim(const gmx_multisim_t *ms)
+{
+    return ms != nullptr;
+}
 
-//! Are we the master node of a multisimulation
-#define MASTERSIM(ms)      ((ms)->sim == 0)
+//! Are we the master simulation of a possible multi-simulation?
+static bool inline isMasterSim(const gmx_multisim_t *ms)
+{
+    return !isMultiSim(ms) || ms->sim == 0;
+}
 
-//! The master of all (the node that prints the remaining run time etc.)
-#define MULTIMASTER(cr)    (SIMMASTER(cr) && (!MULTISIM(cr) || MASTERSIM((cr)->ms)))
+/*! \brief Are we the master rank (of the master simulation, for a multi-sim).
+ *
+ * This rank prints the remaining run time etc. */
+static bool inline isMasterSimMasterRank(const gmx_multisim_t *ms,
+                                         const t_commrec      *cr)
+{
+    return (SIMMASTER(cr) && isMasterSim(ms));
+}
 
 #endif
index ce3b8b341f39fc2eb3c401855e0ae9bb719d6c88..e4e41decf93ea0ed23eb0c7fe29261b279e6fccc 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -50,7 +50,6 @@
 struct ForceProviders;
 
 /* Abstract type for PME that is defined only in the routine that use them. */
-struct gmx_genborn_t;
 struct gmx_ns_t;
 struct gmx_pme_t;
 struct nonbonded_verlet_t;
@@ -110,14 +109,10 @@ extern "C" {
 enum {
     enbvdwNONE, enbvdwLJ, enbvdwBHAM, enbvdwTAB, enbvdwNR
 };
-/* OOR is "one over r" -- standard coul */
-enum {
-    enbcoulNONE, enbcoulOOR, enbcoulRF, enbcoulTAB, enbcoulGB, enbcoulFEWALD, enbcoulNR
-};
 
 enum {
     egCOULSR, egLJSR, egBHAMSR,
-    egCOUL14, egLJ14, egGB, egNR
+    egCOUL14, egLJ14, egNR
 };
 extern const char *egrp_nm[egNR+1];
 
@@ -192,7 +187,6 @@ struct t_forcerec {
     gmx_bool bAllvsAll;
     /* Private work data */
     void    *AllvsAll_work;
-    void    *AllvsAll_workgb;
 
     /* Cut-Off stuff.
      * Infinite cut-off's will be GMX_CUTOFF_INF (unlike in t_inputrec: 0).
@@ -320,46 +314,6 @@ struct t_forcerec {
     /* Shell molecular dynamics flexible constraints */
     real fc_stepsize;
 
-    /* Generalized born implicit solvent */
-    gmx_bool              bGB;
-    /* Generalized born stuff */
-    real                  gb_epsilon_solvent;
-    /* Table data for GB */
-    struct t_forcetable  *gbtab;
-    /* VdW radius for each atomtype (dim is thus ntype) */
-    real                 *atype_radius;
-    /* Effective radius (derived from effective volume) for each type */
-    real                 *atype_vol;
-    /* Implicit solvent - surface tension for each atomtype */
-    real                 *atype_surftens;
-    /* Implicit solvent - radius for GB calculation */
-    real                 *atype_gb_radius;
-    /* Implicit solvent - overlap for HCT model */
-    real                 *atype_S_hct;
-    /* Generalized born interaction data */
-    struct gmx_genborn_t *born;
-
-    /* Table scale for GB */
-    real gbtabscale;
-    /* Table range for GB */
-    real gbtabr;
-    /* GB neighborlists (the sr list will contain for each atom all other atoms
-     * (for use in the SA calculation) and the lr list will contain
-     * for each atom all atoms 1-4 or greater (for use in the GB calculation)
-     */
-    struct t_nblist *gblist_sr;
-    struct t_nblist *gblist_lr;
-    struct t_nblist *gblist;
-
-    /* Inverse square root of the Born radii for implicit solvent */
-    real *invsqrta;
-    /* Derivatives of the potential with respect to the Born radii */
-    real *dvda;
-    /* Derivatives of the Born radii with respect to coordinates */
-    real *dadx;
-    real *dadx_rawptr;
-    int   nalloc_dadx; /* Allocated size of dadx */
-
     /* If > 0 signals Test Particle Insertion,
      * the value is the number of atoms of the molecule to insert
      * Only the energy difference due to the addition of the last molecule
index b02f97fc44955ce72508e682388f5ceba13e7d41..4a437fe19aee7389933cb04fe802f6ae0e517e8a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2017, by the GROMACS development team, led by
+ * Copyright (c) 2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -89,7 +89,7 @@ class IMDOutputProvider
         virtual void finishOutput() = 0;
 
     protected:
-        ~IMDOutputProvider() {}
+        virtual ~IMDOutputProvider() {}
 };
 
 } // namespace gmx
index 665e6563c4a3bbfe47306f1e7858762bea51d592..e42cfe2385f763b346edb0ec5ccc58855b969b16 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2010, The GROMACS development team.
- * Copyright (c) 2012,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -927,22 +927,6 @@ void pr_inputrec(FILE *fp, int indent, const char *title, const t_inputrec *ir,
         PR("ewald-geometry", ir->ewald_geometry);
         PR("epsilon-surface", ir->epsilon_surface);
 
-        /* Implicit solvent */
-        PS("implicit-solvent", EIMPLICITSOL(ir->implicit_solvent));
-
-        /* Generalized born electrostatics */
-        PS("gb-algorithm", EGBALGORITHM(ir->gb_algorithm));
-        PI("nstgbradii", ir->nstgbradii);
-        PR("rgbradii", ir->rgbradii);
-        PR("gb-epsilon-solvent", ir->gb_epsilon_solvent);
-        PR("gb-saltconc", ir->gb_saltconc);
-        PR("gb-obc-alpha", ir->gb_obc_alpha);
-        PR("gb-obc-beta", ir->gb_obc_beta);
-        PR("gb-obc-gamma", ir->gb_obc_gamma);
-        PR("gb-dielectric-offset", ir->gb_dielectric_offset);
-        PS("sa-algorithm", ESAALGORITHM(ir->sa_algorithm));
-        PR("sa-surface-tension", ir->sa_surface_tension);
-
         /* Options for weak coupling algorithms */
         PS("tcoupl", ETCOUPLTYPE(ir->etc));
         PI("nsttcouple", ir->nsttcouple);
@@ -1343,18 +1327,6 @@ void cmp_inputrec(FILE *fp, const t_inputrec *ir1, const t_inputrec *ir2, real f
     cmp_real(fp, "inputrec->epsilon_r", -1, ir1->epsilon_r, ir2->epsilon_r, ftol, abstol);
     cmp_real(fp, "inputrec->epsilon_rf", -1, ir1->epsilon_rf, ir2->epsilon_rf, ftol, abstol);
     cmp_real(fp, "inputrec->tabext", -1, ir1->tabext, ir2->tabext, ftol, abstol);
-    cmp_int(fp, "inputrec->implicit_solvent", -1, ir1->implicit_solvent, ir2->implicit_solvent);
-    cmp_int(fp, "inputrec->gb_algorithm", -1, ir1->gb_algorithm, ir2->gb_algorithm);
-    cmp_int(fp, "inputrec->nstgbradii", -1, ir1->nstgbradii, ir2->nstgbradii);
-    cmp_real(fp, "inputrec->rgbradii", -1, ir1->rgbradii, ir2->rgbradii, ftol, abstol);
-    cmp_real(fp, "inputrec->gb_saltconc", -1, ir1->gb_saltconc, ir2->gb_saltconc, ftol, abstol);
-    cmp_real(fp, "inputrec->gb_epsilon_solvent", -1, ir1->gb_epsilon_solvent, ir2->gb_epsilon_solvent, ftol, abstol);
-    cmp_real(fp, "inputrec->gb_obc_alpha", -1, ir1->gb_obc_alpha, ir2->gb_obc_alpha, ftol, abstol);
-    cmp_real(fp, "inputrec->gb_obc_beta", -1, ir1->gb_obc_beta, ir2->gb_obc_beta, ftol, abstol);
-    cmp_real(fp, "inputrec->gb_obc_gamma", -1, ir1->gb_obc_gamma, ir2->gb_obc_gamma, ftol, abstol);
-    cmp_real(fp, "inputrec->gb_dielectric_offset", -1, ir1->gb_dielectric_offset, ir2->gb_dielectric_offset, ftol, abstol);
-    cmp_int(fp, "inputrec->sa_algorithm", -1, ir1->sa_algorithm, ir2->sa_algorithm);
-    cmp_real(fp, "inputrec->sa_surface_tension", -1, ir1->sa_surface_tension, ir2->sa_surface_tension, ftol, abstol);
 
     cmp_int(fp, "inputrec->eDispCorr", -1, ir1->eDispCorr, ir2->eDispCorr);
     cmp_real(fp, "inputrec->shake_tol", -1, ir1->shake_tol, ir2->shake_tol, ftol, abstol);
@@ -1466,8 +1438,7 @@ gmx_bool inputrecNeedMutot(const t_inputrec *ir)
 
 gmx_bool inputrecExclForces(const t_inputrec *ir)
 {
-    return (EEL_FULL(ir->coulombtype) || (EEL_RF(ir->coulombtype)) ||
-            ir->implicit_solvent != eisNO);
+    return (EEL_FULL(ir->coulombtype) || (EEL_RF(ir->coulombtype)));
 }
 
 gmx_bool inputrecNptTrotter(const t_inputrec *ir)
index 4094bc02fd4b1ac61b20305ae559a2b4271a60cd..87a715980e9839967543dc0b880e22e71c1937e2 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -297,18 +297,7 @@ struct t_inputrec
     real            rcoulomb;                /* Coulomb cutoff (nm)                            */
     real            epsilon_r;               /* relative dielectric constant                 */
     real            epsilon_rf;              /* relative dielectric constant of the RF       */
-    int             implicit_solvent;        /* No (=explicit water), or GBSA solvent models */
-    int             gb_algorithm;            /* Algorithm to use for calculation Born radii  */
-    int             nstgbradii;              /* Frequency of updating Generalized Born radii */
-    real            rgbradii;                /* Cutoff for GB radii calculation              */
-    real            gb_saltconc;             /* Salt concentration (M) for GBSA models       */
-    real            gb_epsilon_solvent;      /* dielectric coeff. of implicit solvent     */
-    real            gb_obc_alpha;            /* 1st scaling factor for Bashford-Case GB      */
-    real            gb_obc_beta;             /* 2nd scaling factor for Bashford-Case GB      */
-    real            gb_obc_gamma;            /* 3rd scaling factor for Bashford-Case GB      */
-    real            gb_dielectric_offset;    /* Dielectric offset for Still/HCT/OBC     */
-    int             sa_algorithm;            /* Algorithm for SA part of GBSA                */
-    real            sa_surface_tension;      /* Energy factor for SA part of GBSA */
+    bool            implicit_solvent;        /* Always false (no longer supported            */
     int             vdwtype;                 /* Type of Van der Waals treatment              */
     int             vdw_modifier;            /* Modify the VdW interaction                   */
     real            rvdw_switch;             /* Van der Waals switch range start (nm)        */
index e47f1e0a0f2934083c4a8750770257b18f98be46..de4e0c362d99eb1c215e58193a066baa581c617d 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -79,7 +79,7 @@ const char *erefscaling_names[erscNR+1] = {
 const char *eel_names[eelNR+1] = {
     "Cut-off", "Reaction-Field", "Generalized-Reaction-Field",
     "PME", "Ewald", "P3M-AD", "Poisson", "Switch", "Shift", "User",
-    "Generalized-Born", "Reaction-Field-nec", "Encad-shift",
+    "Generalized-Born (unused)", "Reaction-Field-nec", "Encad-shift",
     "PME-User", "PME-Switch", "PME-User-Switch",
     "Reaction-Field-zero", nullptr
 };
@@ -189,18 +189,6 @@ const char *eann_names[eannNR+1] = {
     "No", "Single", "Periodic", nullptr
 };
 
-const char *eis_names[eisNR+1] = {
-    "No", "GBSA", nullptr
-};
-
-const char *egb_names[egbNR+1] = {
-    "Still", "HCT", "OBC", nullptr
-};
-
-const char *esa_names[esaNR+1] = {
-    "Ace-approximation", "None", "Still", nullptr
-};
-
 const char *ewt_names[ewtNR+1] = {
     "9-3", "10-4", "table", "12-6", nullptr
 };
@@ -257,7 +245,7 @@ const char *gmx_nblist_interaction_names[GMX_NBLIST_INTERACTION_NR+1] = {
 
 const char *gmx_nbkernel_elec_names[GMX_NBKERNEL_ELEC_NR+1] =
 {
-    "None", "Coulomb", "Reaction-Field", "Cubic-Spline-Table", "Generalized-Born", "Ewald", nullptr
+    "None", "Coulomb", "Reaction-Field", "Cubic-Spline-Table", "Ewald", nullptr
 };
 
 const char *gmx_nbkernel_vdw_names[GMX_NBKERNEL_VDW_NR+1] =
index a0c1565499ac2e13322617e72690f4b2db5f5eac..af5587036130d4a08748617b3399310621067e96 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -159,12 +159,7 @@ extern const char *eintmod_names[eintmodNR+1];
 //! Macro to select the correct string for modifiers
 #define INTMODIFIER(e) enum_name(e, eintmodNR, eintmod_names)
 
-/*! \brief Cut-off treatment for Coulomb
- *
- * eelNOTUSED1 used to be GB, but to enable generalized born with different
- * forms of electrostatics (RF, switch, etc.) in the future it is now selected
- * separately (through the implicit_solvent option).
- */
+/*! \brief Cut-off treatment for Coulomb */
 enum {
     eelCUT,     eelRF,     eelGRF,   eelPME,  eelEWALD,  eelP3M_AD,
     eelPOISSON, eelSWITCH, eelSHIFT, eelUSER, eelGB_NOTUSED, eelRF_NEC_UNSUPPORTED, eelENCADSHIFT,
@@ -469,33 +464,6 @@ extern const char *eann_names[eannNR+1];
 //! And macro for simulated annealing string
 #define EANNEAL(e)      enum_name(e, eannNR, eann_names)
 
-//! Implicit solvent algorithms.
-enum {
-    eisNO, eisGBSA, eisNR
-};
-//! String corresponding to implicit solvent.
-extern const char *eis_names[eisNR+1];
-//! Macro for implicit solvent string.
-#define EIMPLICITSOL(e) enum_name(e, eisNR, eis_names)
-
-//! Algorithms for calculating GB radii.
-enum {
-    egbSTILL, egbHCT, egbOBC, egbNR
-};
-//! String for GB algorithm name.
-extern const char *egb_names[egbNR+1];
-//! Macro for GB string.
-#define EGBALGORITHM(e) enum_name(e, egbNR, egb_names)
-
-//! Surface area algorithm for implicit solvent.
-enum {
-    esaAPPROX, esaNO, esaSTILL, esaNR
-};
-//! String corresponding to surface area algorithm.
-extern const char *esa_names[esaNR+1];
-//! brief Macro for SA algorithm string.
-#define ESAALGORITHM(e) enum_name(e, esaNR, esa_names)
-
 //! Wall types.
 enum {
     ewt93, ewt104, ewtTABLE, ewt126, ewtNR
@@ -636,7 +604,6 @@ enum gmx_nbkernel_elec
     GMX_NBKERNEL_ELEC_COULOMB,
     GMX_NBKERNEL_ELEC_REACTIONFIELD,
     GMX_NBKERNEL_ELEC_CUBICSPLINETABLE,
-    GMX_NBKERNEL_ELEC_GENERALIZEDBORN,
     GMX_NBKERNEL_ELEC_EWALD,
     GMX_NBKERNEL_ELEC_NR
 };
index 709901e113f8a0fcf6f38e5f9d3d3d864ef85247..ee7c438cc009be8ba1eee2598281c85440bf2f63 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -83,7 +83,7 @@ void set_pbc_simd(const t_pbc *pbc,
  * without PBC. But on modern processors the overhead of this, often called,
  * routine should be low. On e.g. Intel Haswell/Broadwell it takes 8 cycles.
  */
-static gmx_inline void gmx_simdcall
+static inline void gmx_simdcall
 pbc_correct_dx_simd(SimdReal         *dx,
                     SimdReal         *dy,
                     SimdReal         *dz,
@@ -116,7 +116,7 @@ pbc_correct_dx_simd(SimdReal         *dx,
  * when all atoms are in the unit-cell (aiuc).
  * This is the SIMD equivalent of the scalar version declared in pbc.h.
  */
-static gmx_inline void gmx_simdcall
+static inline void gmx_simdcall
 pbc_dx_aiuc(const real       *pbc_simd,
             const SimdReal   *x1,
             const SimdReal   *x2,
index d7126ba0f41d34f20e83216760e0185ac12e2412..2f90fc5b4ecb22b7b36ff77768138e73d8d5d6d4 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2008, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -60,6 +60,7 @@
 #include "gromacs/mdlib/groupcoord.h"
 #include "gromacs/mdlib/mdrun.h"
 #include "gromacs/mdlib/sim_util.h"
+#include "gromacs/mdtypes/commrec.h"
 #include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/mdtypes/md_enums.h"
 #include "gromacs/mdtypes/state.h"
@@ -319,13 +320,13 @@ static real get_fitangle(t_rotgrp *rotg, gmx_enfrotgrp_t erg)
 
 
 /* Reduce potential angle fit data for this group at this time step? */
-static gmx_inline gmx_bool bPotAngle(t_rot *rot, t_rotgrp *rotg, gmx_int64_t step)
+static inline gmx_bool bPotAngle(t_rot *rot, t_rotgrp *rotg, gmx_int64_t step)
 {
     return ( (erotgFitPOT == rotg->eFittype) && (do_per_step(step, rot->nstsout) || do_per_step(step, rot->nstrout)) );
 }
 
 /* Reduce slab torqe data for this group at this time step? */
-static gmx_inline gmx_bool bSlabTau(t_rot *rot, t_rotgrp *rotg, gmx_int64_t step)
+static inline gmx_bool bSlabTau(t_rot *rot, t_rotgrp *rotg, gmx_int64_t step)
 {
     return ( (ISFLEX(rotg)) && do_per_step(step, rot->nstsout) );
 }
@@ -572,13 +573,13 @@ static double calc_beta_max(real min_gaussian, real slab_dist)
 }
 
 
-static gmx_inline real calc_beta(rvec curr_x, t_rotgrp *rotg, int n)
+static inline real calc_beta(rvec curr_x, t_rotgrp *rotg, int n)
 {
     return iprod(curr_x, rotg->vec) - rotg->slab_dist * n;
 }
 
 
-static gmx_inline real gaussian_weight(rvec curr_x, t_rotgrp *rotg, int n)
+static inline real gaussian_weight(rvec curr_x, t_rotgrp *rotg, int n)
 {
     const real norm = GAUSS_NORM;
     real       sigma;
@@ -735,7 +736,7 @@ static void calc_rotmat(
 
 
 /* Calculates torque on the rotation axis tau = position x force */
-static gmx_inline real torque(
+static inline real torque(
         rvec rotvec,  /* rotation vector; MUST be normalized!                 */
         rvec force,   /* force                                                */
         rvec x,       /* position of atom on which the force acts             */
@@ -1612,7 +1613,7 @@ static void flex_fit_angle_perslab(
 
 
 /* Shift x with is */
-static gmx_inline void shift_single_coord(const matrix box, rvec x, const ivec is)
+static inline void shift_single_coord(const matrix box, rvec x, const ivec is)
 {
     int tx, ty, tz;
 
@@ -1639,7 +1640,7 @@ static gmx_inline void shift_single_coord(const matrix box, rvec x, const ivec i
 /* Determine the 'home' slab of this atom which is the
  * slab with the highest Gaussian weight of all */
 #define round(a) (int)(a+0.5)
-static gmx_inline int get_homeslab(
+static inline int get_homeslab(
         rvec curr_x,   /* The position for which the home slab shall be determined */
         rvec rotvec,   /* The rotation vector */
         real slabdist) /* The slab distance */
@@ -2464,7 +2465,7 @@ static void get_firstlast_atom_per_slab(t_rotgrp *rotg)
  * x_last * v - n*Delta_x >= -beta_max
  *
  */
-static gmx_inline int get_first_slab(
+static inline int get_first_slab(
         t_rotgrp *rotg,      /* The rotation group (inputrec data) */
         real      max_beta,  /* The max_beta value, instead of min_gaussian */
         rvec      firstatom) /* First atom after sorting along the rotation vector v */
@@ -2474,7 +2475,7 @@ static gmx_inline int get_first_slab(
 }
 
 
-static gmx_inline int get_last_slab(
+static inline int get_last_slab(
         t_rotgrp *rotg,     /* The rotation group (inputrec data) */
         real      max_beta, /* The max_beta value, instead of min_gaussian */
         rvec      lastatom) /* Last atom along v */
@@ -2637,7 +2638,7 @@ static void angle(t_rotgrp *rotg,
  * dr = dr - (dr.v)v
  * Note that v must be of unit length.
  */
-static gmx_inline void project_onto_plane(rvec dr, const rvec v)
+static inline void project_onto_plane(rvec dr, const rvec v)
 {
     rvec tmp;
 
@@ -3342,7 +3343,7 @@ static void get_firstlast_slab_ref(t_rotgrp *rotg, real mc[], int ref_firstindex
 /* Special version of copy_rvec:
  * During the copy procedure of xcurr to b, the correct PBC image is chosen
  * such that the copied vector ends up near its reference position xref */
-static gmx_inline void copy_correct_pbc_image(
+static inline void copy_correct_pbc_image(
         const rvec   xcurr,  /* copy vector xcurr ...                */
         rvec         b,      /* ... to b ...                         */
         const rvec   xref,   /* choosing the PBC image such that b ends up near xref */
index b03a33b6f75301e51c520a081b5ec5c65f1251fb..a221cf4e9f7f575e3b0cf211e5d3b0e44614bda1 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2015,2016,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -48,7 +48,9 @@ namespace gmx
 // the table in all files using it, unless the user has requested a different
 // precision or resolution.
 template<>
-const std::vector<real> TabulatedNormalDistribution<real, c_TabulatedNormalDistributionDefaultBits>::c_table_ = TabulatedNormalDistribution<real, c_TabulatedNormalDistributionDefaultBits>::makeTable();
+const std::array<real, 1<<c_TabulatedNormalDistributionDefaultBits>
+TabulatedNormalDistribution<real, c_TabulatedNormalDistributionDefaultBits>::c_table_ =
+    TabulatedNormalDistribution<real, c_TabulatedNormalDistributionDefaultBits>::makeTable();
 #else
 // Avoid compiler warnings about no public symbols
 void TabulatedNormalDistributionDummy(){}
index 34eb2be9e0f564c73f81216072c720b8f085e001..52f064ff5a4a442d4a6fa372ac46baad84f61703 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2015,2016,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -48,8 +48,8 @@
 
 #include <cmath>
 
+#include <array>
 #include <limits>
-#include <vector>
 
 #include "gromacs/math/functions.h"
 #include "gromacs/math/utilities.h"
@@ -163,14 +163,14 @@ class TabulatedNormalDistribution
 
         /*! \brief Fill the table with values for the normal distribution
          *
-         *  This routine returns a new a std::vector with the table data.
+         *  This routine returns a new a std::array with the table data.
          *
          *  This routine is used to help construct objects of this class,
          *  and is exposed only to permit testing. Normal code should not
          *  need to call this function.
          */
         static const
-        std::vector<RealType>
+        std::array<RealType, 1<<tableBits>
         // cppcheck-suppress unusedPrivateFunction
         makeTable()
         {
@@ -179,11 +179,11 @@ class TabulatedNormalDistribution
              * We avoid integrating a gaussian numerically, since that leads to
              * some loss-of-precision which also accumulates so it is worse for
              * larger indices in the table. */
-            std::size_t            tableSize        = 1 << tableBits;
-            std::size_t            halfSize         = tableSize/2;
-            double                 invHalfSize      = 1.0/halfSize;
+            constexpr std::size_t            tableSize        = 1 << tableBits;
+            constexpr std::size_t            halfSize         = tableSize/2;
+            constexpr double                 invHalfSize      = 1.0/halfSize;
 
-            std::vector<RealType>  table(tableSize);
+            std::array<RealType, tableSize>  table;
 
             // Fill in all but the extremal entries of the table
             for (std::size_t i = 0; i < halfSize-1; i++)
@@ -360,7 +360,7 @@ class TabulatedNormalDistribution
         /*! \brief Parameters of normal distribution (mean and stddev) */
         param_type                                                   param_;
         /*! \brief Array with tabluated values of normal distribution */
-        static const std::vector<RealType>                           c_table_;
+        static const std::array<RealType, 1 << tableBits>            c_table_;
         /*! \brief Saved output from random engine, shifted tableBits right each time */
         gmx_uint64_t                                                 savedRandomBits_;
         /*! \brief Number of valid bits remaining i savedRandomBits_ */
@@ -376,15 +376,15 @@ class TabulatedNormalDistribution
 #if !defined(_MSC_VER) && !defined(DOXYGEN)
 // Declaration of template specialization
 template<>
-const std::vector<real> TabulatedNormalDistribution<real, c_TabulatedNormalDistributionDefaultBits>::c_table_;
+const std::array<real, 1<<c_TabulatedNormalDistributionDefaultBits> TabulatedNormalDistribution<real, c_TabulatedNormalDistributionDefaultBits>::c_table_;
 
 extern template
-const std::vector<real> TabulatedNormalDistribution<real, c_TabulatedNormalDistributionDefaultBits>::c_table_;
+const std::array<real, 1<<c_TabulatedNormalDistributionDefaultBits> TabulatedNormalDistribution<real, c_TabulatedNormalDistributionDefaultBits>::c_table_;
 #endif
 
 // Instantiation for all tables without specialization
 template<class RealType, unsigned int tableBits>
-const std::vector<RealType> TabulatedNormalDistribution<RealType, tableBits>::c_table_ = TabulatedNormalDistribution<RealType, tableBits>::makeTable();
+const std::array<RealType, 1<<tableBits> TabulatedNormalDistribution<RealType, tableBits>::c_table_ = TabulatedNormalDistribution<RealType, tableBits>::makeTable();
 
 }      // namespace gmx
 
index 45fba634039ee54ba90321bd1ae24b358b8e814b..0d02da7f02a751217d0b2fa3cd03ca063b173a9b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2015,2016,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -153,7 +153,7 @@ TEST(TabulatedNormalDistributionTest, AltParam)
 
 TEST(TabulatedNormalDistributionTableTest, HasValidProperties)
 {
-    std::vector<real> table = TabulatedNormalDistribution<real>::makeTable();
+    auto table = TabulatedNormalDistribution<real>::makeTable();
 
     EXPECT_EQ(table.size() % 2, 0) << "Table must have even number of entries";
 
index 388c44654ed016942c5f760876c5d7fc1661e080..6e767c5aaabd35a1797e5f9445bedc6680ff7cee 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
index 2648fef615562224fca6880ac25111d0c7025d68..93aaed2561fb24041eb3538f5ff12199da0894c4 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
index c7b807d2d2fa5632979395414267559c2fbd2478..20ab5bceeabe25e8ff7479e9d209d0074121566f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
index ec54d0ee6837779d75de9a2c8b53a90b8f8394fd..4377c00618364bfc39f31196d9a737b994c0a717 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 
 #include <arm_neon.h>
 
-#include "gromacs/utility/basedefinitions.h"
-
 #include "impl_arm_neon_asimd_simd_double.h"
 
 namespace gmx
 {
 
 template <int align>
-static gmx_inline void gmx_simdcall
+static inline void gmx_simdcall
 gatherLoadTranspose(const double *        base,
                     const std::int32_t    offset[],
                     SimdDouble *          v0,
@@ -77,7 +75,7 @@ gatherLoadTranspose(const double *        base,
 }
 
 template <int align>
-static gmx_inline void gmx_simdcall
+static inline void gmx_simdcall
 gatherLoadTranspose(const double *        base,
                     const std::int32_t    offset[],
                     SimdDouble *          v0,
@@ -98,7 +96,7 @@ gatherLoadTranspose(const double *        base,
 static const int c_simdBestPairAlignmentDouble = 2;
 
 template <int align>
-static gmx_inline void gmx_simdcall
+static inline void gmx_simdcall
 gatherLoadUTranspose(const double *        base,
                      const std::int32_t    offset[],
                      SimdDouble *          v0,
@@ -120,7 +118,7 @@ gatherLoadUTranspose(const double *        base,
 }
 
 template <int align>
-static gmx_inline void gmx_simdcall
+static inline void gmx_simdcall
 transposeScatterStoreU(double *             base,
                        const std::int32_t   offset[],
                        SimdDouble           v0,
@@ -140,7 +138,7 @@ transposeScatterStoreU(double *             base,
 }
 
 template <int align>
-static gmx_inline void gmx_simdcall
+static inline void gmx_simdcall
 transposeScatterIncrU(double *             base,
                       const std::int32_t   offset[],
                       SimdDouble           v0,
@@ -173,7 +171,7 @@ transposeScatterIncrU(double *             base,
 }
 
 template <int align>
-static gmx_inline void gmx_simdcall
+static inline void gmx_simdcall
 transposeScatterDecrU(double *             base,
                       const std::int32_t   offset[],
                       SimdDouble           v0,
@@ -205,7 +203,7 @@ transposeScatterDecrU(double *             base,
     vst1_f64(base + align * offset[1] + 2, t3);
 }
 
-static gmx_inline void gmx_simdcall
+static inline void gmx_simdcall
 expandScalarsToTriplets(SimdDouble    scalar,
                         SimdDouble *  triplets0,
                         SimdDouble *  triplets1,
@@ -217,7 +215,7 @@ expandScalarsToTriplets(SimdDouble    scalar,
 }
 
 template <int align>
-static gmx_inline void gmx_simdcall
+static inline void gmx_simdcall
 gatherLoadBySimdIntTranspose(const double *  base,
                              SimdDInt32      offset,
                              SimdDouble *    v0,
@@ -236,7 +234,7 @@ gatherLoadBySimdIntTranspose(const double *  base,
 
 
 template <int align>
-static gmx_inline void gmx_simdcall
+static inline void gmx_simdcall
 gatherLoadBySimdIntTranspose(const double *  base,
                              SimdDInt32      offset,
                              SimdDouble *    v0,
@@ -252,7 +250,7 @@ gatherLoadBySimdIntTranspose(const double *  base,
 }
 
 template <int align>
-static gmx_inline void gmx_simdcall
+static inline void gmx_simdcall
 gatherLoadUBySimdIntTranspose(const double *  base,
                               SimdDInt32      offset,
                               SimdDouble *    v0,
@@ -271,7 +269,7 @@ gatherLoadUBySimdIntTranspose(const double *  base,
 }
 
 
-static gmx_inline double gmx_simdcall
+static inline double gmx_simdcall
 reduceIncr4ReturnSum(double *    m,
                      SimdDouble  v0,
                      SimdDouble  v1,
diff --git a/src/gromacs/simd/impl_ibm_qpx/impl_ibm_qpx_definitions.h b/src/gromacs/simd/impl_ibm_qpx/impl_ibm_qpx_definitions.h
deleted file mode 100644 (file)
index 9912800..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 2014,2015,2017, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
- * and including many others, as listed in the AUTHORS file in the
- * top-level source directory and at http://www.gromacs.org.
- *
- * GROMACS is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * GROMACS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GROMACS; if not, see
- * http://www.gnu.org/licenses, or write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
- *
- * If you want to redistribute modifications to GROMACS, please
- * consider that scientific software is very special. Version
- * control is crucial - bugs must be traceable. We will be happy to
- * consider code for inclusion in the official distribution, but
- * derived work must not be called official GROMACS. Details are found
- * in the README & COPYING files - if they are missing, get the
- * official version at http://www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the research papers on the package. Check out http://www.gromacs.org.
- */
-
-#ifndef GMX_SIMD_IMPLEMENTATION_IBM_QPX_DEFINITIONS_H
-#define GMX_SIMD_IMPLEMENTATION_IBM_QPX_DEFINITIONS_H
-
-#define GMX_SIMD                                1
-#define GMX_SIMD_HAVE_FLOAT                     1
-#define GMX_SIMD_HAVE_DOUBLE                    1
-#define GMX_SIMD_HAVE_LOADU                     0
-#define GMX_SIMD_HAVE_STOREU                    0
-#define GMX_SIMD_HAVE_LOGICAL                   0
-#define GMX_SIMD_HAVE_FMA                       1
-#define GMX_SIMD_HAVE_FINT32_EXTRACT            0
-#define GMX_SIMD_HAVE_FINT32_LOGICAL            0
-#define GMX_SIMD_HAVE_FINT32_ARITHMETICS        0
-#define GMX_SIMD_HAVE_DINT32_EXTRACT            0
-#define GMX_SIMD_HAVE_DINT32_LOGICAL            0
-#define GMX_SIMD_HAVE_DINT32_ARITHMETICS        0
-#define GMX_SIMD_HAVE_NATIVE_COPYSIGN_FLOAT     1
-#define GMX_SIMD_HAVE_NATIVE_RSQRT_ITER_FLOAT   0
-#define GMX_SIMD_HAVE_NATIVE_RCP_ITER_FLOAT     0
-#define GMX_SIMD_HAVE_NATIVE_LOG_FLOAT          0
-#define GMX_SIMD_HAVE_NATIVE_EXP2_FLOAT         0
-#define GMX_SIMD_HAVE_NATIVE_EXP_FLOAT          0
-#define GMX_SIMD_HAVE_NATIVE_COPYSIGN_DOUBLE    1
-#define GMX_SIMD_HAVE_NATIVE_RSQRT_ITER_DOUBLE  0
-#define GMX_SIMD_HAVE_NATIVE_RCP_ITER_DOUBLE    0
-#define GMX_SIMD_HAVE_NATIVE_LOG_DOUBLE         0
-#define GMX_SIMD_HAVE_NATIVE_EXP2_DOUBLE        0
-#define GMX_SIMD_HAVE_NATIVE_EXP_DOUBLE         0
-#define GMX_SIMD_HAVE_GATHER_LOADU_BYSIMDINT_TRANSPOSE_FLOAT    0
-#define GMX_SIMD_HAVE_GATHER_LOADU_BYSIMDINT_TRANSPOSE_DOUBLE   0
-#define GMX_SIMD_HAVE_HSIMD_UTIL_FLOAT          0 // No need for half-simd, width is 4
-#define GMX_SIMD_HAVE_HSIMD_UTIL_DOUBLE         0 // No need for half-simd, width is 4
-
-#define GMX_SIMD4_HAVE_FLOAT                    1
-#define GMX_SIMD4_HAVE_DOUBLE                   1
-
-// Implementation details
-#define GMX_SIMD_FLOAT_WIDTH                    4
-#define GMX_SIMD_DOUBLE_WIDTH                   4
-#define GMX_SIMD_FINT32_WIDTH                   4
-#define GMX_SIMD_DINT32_WIDTH                   4
-#define GMX_SIMD4_WIDTH                         4
-#define GMX_SIMD_ALIGNMENT                     32 // Bytes (4*double)
-#define GMX_SIMD_RSQRT_BITS                    14
-#define GMX_SIMD_RCP_BITS                      14
-
-#endif // GMX_SIMD_IMPLEMENTATION_IBM_QPX_DEFINITIONS_H
diff --git a/src/gromacs/simd/impl_ibm_qpx/impl_ibm_qpx_simd4_double.h b/src/gromacs/simd/impl_ibm_qpx/impl_ibm_qpx_simd4_double.h
deleted file mode 100644 (file)
index e3e146b..0000000
+++ /dev/null
@@ -1,352 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 2014,2015,2016,2017, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
- * and including many others, as listed in the AUTHORS file in the
- * top-level source directory and at http://www.gromacs.org.
- *
- * GROMACS is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * GROMACS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GROMACS; if not, see
- * http://www.gnu.org/licenses, or write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
- *
- * If you want to redistribute modifications to GROMACS, please
- * consider that scientific software is very special. Version
- * control is crucial - bugs must be traceable. We will be happy to
- * consider code for inclusion in the official distribution, but
- * derived work must not be called official GROMACS. Details are found
- * in the README & COPYING files - if they are missing, get the
- * official version at http://www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the research papers on the package. Check out http://www.gromacs.org.
- */
-
-#ifndef GMX_SIMD_IMPLEMENTATION_IBM_QPX_SIMD4_DOUBLE_H
-#define GMX_SIMD_IMPLEMENTATION_IBM_QPX_SIMD4_DOUBLE_H
-
-#include "config.h"
-
-#include "config.h"
-
-// Assert is buggy on xlc with high optimization, so we skip it for QPX
-// TODO Add back the asserts for bgclang
-#include <cstddef>
-
-#ifdef __clang__
-#include <qpxmath.h>
-#endif
-
-namespace gmx
-{
-
-class Simd4Double
-{
-    public:
-        Simd4Double() {}
-
-        Simd4Double(double d) : simdInternal_(vec_splats(d)) {}
-
-        // Internal utility constructor to simplify return statements
-        Simd4Double(vector4double simd) : simdInternal_(simd) {}
-
-        vector4double  simdInternal_;
-};
-
-class Simd4DBool
-{
-    public:
-        Simd4DBool() {}
-
-        //! \brief Construct from scalar bool
-        Simd4DBool(bool b) : simdInternal_(vec_splats(b ? 1.0 : -1.0)) {}
-
-        // Internal utility constructor to simplify return statements
-        Simd4DBool(vector4double simd) : simdInternal_(simd) {}
-
-        vector4double  simdInternal_;
-};
-
-static inline Simd4Double gmx_simdcall
-load4(const double *m)
-{
-#ifdef NDEBUG
-    return {
-               vec_ld(0, const_cast<double *>(m))
-    };
-#else
-    return {
-               vec_lda(0, const_cast<double *>(m))
-    };
-#endif
-}
-
-static inline void gmx_simdcall
-store4(double *m, Simd4Double a)
-{
-#ifdef NDEBUG
-    vec_st(a.simdInternal_, 0, m);
-#else
-    vec_sta(a.simdInternal_, 0, m);
-#endif
-}
-
-static inline Simd4Double gmx_simdcall
-simd4SetZeroD()
-{
-    return {
-               vec_splats(0.0)
-    };
-}
-
-static inline Simd4Double gmx_simdcall
-operator+(Simd4Double a, Simd4Double b)
-{
-    return {
-               vec_add(a.simdInternal_, b.simdInternal_)
-    };
-}
-
-static inline Simd4Double gmx_simdcall
-operator-(Simd4Double a, Simd4Double b)
-{
-    return {
-               vec_sub(a.simdInternal_, b.simdInternal_)
-    };
-}
-
-static inline Simd4Double gmx_simdcall
-operator-(Simd4Double x)
-{
-    return {
-               vec_neg(x.simdInternal_)
-    };
-}
-
-static inline Simd4Double gmx_simdcall
-operator*(Simd4Double a, Simd4Double b)
-{
-    return {
-               vec_mul(a.simdInternal_, b.simdInternal_)
-    };
-}
-
-static inline Simd4Double gmx_simdcall
-fma(Simd4Double a, Simd4Double b, Simd4Double c)
-{
-    return {
-               vec_madd(a.simdInternal_, b.simdInternal_, c.simdInternal_)
-    };
-}
-
-static inline Simd4Double gmx_simdcall
-fms(Simd4Double a, Simd4Double b, Simd4Double c)
-{
-    return {
-               vec_msub(a.simdInternal_, b.simdInternal_, c.simdInternal_)
-    };
-}
-
-static inline Simd4Double gmx_simdcall
-fnma(Simd4Double a, Simd4Double b, Simd4Double c)
-{
-    return {
-               vec_nmsub(a.simdInternal_, b.simdInternal_, c.simdInternal_)
-    };
-}
-
-static inline Simd4Double gmx_simdcall
-fnms(Simd4Double a, Simd4Double b, Simd4Double c)
-{
-    return {
-               vec_nmadd(a.simdInternal_, b.simdInternal_, c.simdInternal_)
-    };
-}
-
-static inline Simd4Double gmx_simdcall
-rsqrt(Simd4Double x)
-{
-    return {
-               vec_rsqrte(x.simdInternal_)
-    };
-}
-
-static inline Simd4Double gmx_simdcall
-abs(Simd4Double x)
-{
-    return {
-               vec_abs( x.simdInternal_ )
-    };
-}
-
-static inline Simd4Double gmx_simdcall
-max(Simd4Double a, Simd4Double b)
-{
-    return {
-               vec_sel(b.simdInternal_, a.simdInternal_, vec_sub(a.simdInternal_, b.simdInternal_))
-    };
-}
-
-static inline Simd4Double gmx_simdcall
-min(Simd4Double a, Simd4Double b)
-{
-    return {
-               vec_sel(b.simdInternal_, a.simdInternal_, vec_sub(b.simdInternal_, a.simdInternal_))
-    };
-}
-
-static inline Simd4Double gmx_simdcall
-round(Simd4Double x)
-{
-    // Note: It is critical to use vec_cfid(vec_ctid(a)) for the implementation
-    // here, since vec_round() does not adhere to the FP control
-    // word rounding scheme. We rely on float-to-float and float-to-integer
-    // rounding being the same for half-way values in a few algorithms.
-
-    return {
-               vec_cfid(vec_ctid(x.simdInternal_))
-    };
-}
-
-static inline Simd4Double gmx_simdcall
-trunc(Simd4Double x)
-{
-    return {
-               vec_trunc(x.simdInternal_)
-    };
-}
-
-static inline double gmx_simdcall
-dotProduct(Simd4Double a, Simd4Double b)
-{
-    vector4double dp_sh0 = vec_mul(a.simdInternal_, b.simdInternal_);
-    vector4double dp_sh1 = vec_sldw(dp_sh0, dp_sh0, 1);
-    vector4double dp_sh2 = vec_sldw(dp_sh0, dp_sh0, 2);
-    vector4double dp     = vec_add(dp_sh2, vec_add(dp_sh0, dp_sh1));
-
-    return vec_extract(dp, 0);
-}
-
-static inline void gmx_simdcall
-transpose(Simd4Double * v0, Simd4Double * v1,
-          Simd4Double * v2, Simd4Double * v3)
-{
-    vector4double t0 = vec_perm(v0->simdInternal_, v2->simdInternal_, vec_gpci(00415));
-    vector4double t1 = vec_perm(v0->simdInternal_, v2->simdInternal_, vec_gpci(02637));
-    vector4double t2 = vec_perm(v1->simdInternal_, v3->simdInternal_, vec_gpci(00415));
-    vector4double t3 = vec_perm(v1->simdInternal_, v3->simdInternal_, vec_gpci(02637));
-    v0->simdInternal_ = vec_perm(t0, t2, vec_gpci(00415));
-    v1->simdInternal_ = vec_perm(t0, t2, vec_gpci(02637));
-    v2->simdInternal_ = vec_perm(t1, t3, vec_gpci(00415));
-    v3->simdInternal_ = vec_perm(t1, t3, vec_gpci(02637));
-}
-
-static inline Simd4DBool gmx_simdcall
-operator==(Simd4Double a, Simd4Double b)
-{
-    return {
-               vec_cmpeq(a.simdInternal_, b.simdInternal_)
-    };
-}
-
-static inline Simd4DBool gmx_simdcall
-operator!=(Simd4Double a, Simd4Double b)
-{
-    return {
-               vec_not(vec_cmpeq(a.simdInternal_, b.simdInternal_))
-    };
-}
-
-static inline Simd4DBool gmx_simdcall
-operator<(Simd4Double a, Simd4Double b)
-{
-    return {
-               vec_cmplt(a.simdInternal_, b.simdInternal_)
-    };
-}
-
-static inline Simd4DBool gmx_simdcall
-operator<=(Simd4Double a, Simd4Double b)
-{
-    return {
-               vec_or(vec_cmplt(a.simdInternal_, b.simdInternal_), vec_cmpeq(a.simdInternal_, b.simdInternal_))
-    };
-}
-
-static inline Simd4DBool gmx_simdcall
-operator&&(Simd4DBool a, Simd4DBool b)
-{
-    return {
-               vec_and(a.simdInternal_, b.simdInternal_)
-    };
-}
-
-static inline Simd4DBool gmx_simdcall
-operator||(Simd4DBool a, Simd4DBool b)
-{
-    return {
-               vec_or(a.simdInternal_, b.simdInternal_)
-    };
-}
-
-static inline bool gmx_simdcall
-anyTrue(Simd4DBool a)
-{
-    vector4double b = vec_sldw(a.simdInternal_, a.simdInternal_, 2);
-
-    a.simdInternal_ = vec_or(a.simdInternal_, b);
-    b               = vec_sldw(a.simdInternal_, a.simdInternal_, 1);
-    b               = vec_or(a.simdInternal_, b);
-    return (vec_extract(b, 0) > 0);
-}
-
-static inline Simd4Double gmx_simdcall
-selectByMask(Simd4Double a, Simd4DBool m)
-{
-    return {
-               vec_sel(vec_splats(0.0), a.simdInternal_, m.simdInternal_)
-    };
-}
-
-static inline Simd4Double gmx_simdcall
-selectByNotMask(Simd4Double a, Simd4DBool m)
-{
-    return {
-               vec_sel(a.simdInternal_, vec_splats(0.0), m.simdInternal_)
-    };
-}
-
-static inline Simd4Double gmx_simdcall
-blend(Simd4Double a, Simd4Double b, Simd4DBool sel)
-{
-    return {
-               vec_sel(a.simdInternal_, b.simdInternal_, sel.simdInternal_)
-    };
-}
-
-static inline double gmx_simdcall
-reduce(Simd4Double x)
-{
-    vector4double y = vec_sldw(x.simdInternal_, x.simdInternal_, 2);
-    vector4double z;
-
-    y = vec_add(y, x.simdInternal_);
-    z = vec_sldw(y, y, 1);
-    y = vec_add(y, z);
-    return vec_extract(y, 0);
-}
-
-}      // namespace gmx
-
-#endif // GMX_SIMD_IMPLEMENTATION_IBM_QPX_SIMD4_DOUBLE_H
diff --git a/src/gromacs/simd/impl_ibm_qpx/impl_ibm_qpx_simd4_float.h b/src/gromacs/simd/impl_ibm_qpx/impl_ibm_qpx_simd4_float.h
deleted file mode 100644 (file)
index c04e004..0000000
+++ /dev/null
@@ -1,349 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 2014,2015, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
- * and including many others, as listed in the AUTHORS file in the
- * top-level source directory and at http://www.gromacs.org.
- *
- * GROMACS is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * GROMACS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GROMACS; if not, see
- * http://www.gnu.org/licenses, or write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
- *
- * If you want to redistribute modifications to GROMACS, please
- * consider that scientific software is very special. Version
- * control is crucial - bugs must be traceable. We will be happy to
- * consider code for inclusion in the official distribution, but
- * derived work must not be called official GROMACS. Details are found
- * in the README & COPYING files - if they are missing, get the
- * official version at http://www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the research papers on the package. Check out http://www.gromacs.org.
- */
-
-#ifndef GMX_SIMD_IMPLEMENTATION_IBM_QPX_SIMD4_FLOAT_H
-#define GMX_SIMD_IMPLEMENTATION_IBM_QPX_SIMD4_FLOAT_H
-
-#include "config.h"
-
-// Assert is buggy on xlc with high optimization, so we skip it for QPX
-#include <cstddef>
-
-#ifdef __clang__
-#include <qpxmath.h>
-#endif
-
-namespace gmx
-{
-
-class Simd4Float
-{
-    public:
-        Simd4Float() {}
-
-        Simd4Float(float d) : simdInternal_(vec_splats(d)) {}
-
-        // Internal utility constructor to simplify return statements
-        Simd4Float(vector4double simd) : simdInternal_(simd) {}
-
-        vector4double  simdInternal_;
-};
-
-class Simd4FBool
-{
-    public:
-        Simd4FBool() {}
-
-        //! \brief Construct from scalar bool
-        Simd4FBool(bool b) : simdInternal_(vec_splats(b ? 1.0 : -1.0)) {}
-
-        // Internal utility constructor to simplify return statements
-        Simd4FBool(vector4double simd) : simdInternal_(simd) {}
-
-        vector4double  simdInternal_;
-};
-
-static inline Simd4Float gmx_simdcall
-load4(const float *m)
-{
-#ifdef NDEBUG
-    return {
-               vec_ld(0, const_cast<float *>(m))
-    };
-#else
-    return {
-               vec_lda(0, const_cast<float *>(m))
-    };
-#endif
-}
-
-static inline void gmx_simdcall
-store4(float *m, Simd4Float a)
-{
-#ifdef NDEBUG
-    vec_st(a.simdInternal_, 0, m);
-#else
-    vec_sta(a.simdInternal_, 0, m);
-#endif
-}
-
-static inline Simd4Float gmx_simdcall
-simd4SetZeroF()
-{
-    return {
-               vec_splats(0.0)
-    };
-}
-
-static inline Simd4Float gmx_simdcall
-operator+(Simd4Float a, Simd4Float b)
-{
-    return {
-               vec_add(a.simdInternal_, b.simdInternal_)
-    };
-}
-
-static inline Simd4Float gmx_simdcall
-operator-(Simd4Float a, Simd4Float b)
-{
-    return {
-               vec_sub(a.simdInternal_, b.simdInternal_)
-    };
-}
-
-static inline Simd4Float gmx_simdcall
-operator-(Simd4Float x)
-{
-    return {
-               vec_neg(x.simdInternal_)
-    };
-}
-
-static inline Simd4Float gmx_simdcall
-operator*(Simd4Float a, Simd4Float b)
-{
-    return {
-               vec_mul(a.simdInternal_, b.simdInternal_)
-    };
-}
-
-static inline Simd4Float gmx_simdcall
-fma(Simd4Float a, Simd4Float b, Simd4Float c)
-{
-    return {
-               vec_madd(a.simdInternal_, b.simdInternal_, c.simdInternal_)
-    };
-}
-
-static inline Simd4Float gmx_simdcall
-fms(Simd4Float a, Simd4Float b, Simd4Float c)
-{
-    return {
-               vec_msub(a.simdInternal_, b.simdInternal_, c.simdInternal_)
-    };
-}
-
-static inline Simd4Float gmx_simdcall
-fnma(Simd4Float a, Simd4Float b, Simd4Float c)
-{
-    return {
-               vec_nmsub(a.simdInternal_, b.simdInternal_, c.simdInternal_)
-    };
-}
-
-static inline Simd4Float gmx_simdcall
-fnms(Simd4Float a, Simd4Float b, Simd4Float c)
-{
-    return {
-               vec_nmadd(a.simdInternal_, b.simdInternal_, c.simdInternal_)
-    };
-}
-
-static inline Simd4Float gmx_simdcall
-rsqrt(Simd4Float x)
-{
-    return {
-               vec_rsqrte(x.simdInternal_)
-    };
-}
-
-static inline Simd4Float gmx_simdcall
-abs(Simd4Float x)
-{
-    return {
-               vec_abs( x.simdInternal_ )
-    };
-}
-
-static inline Simd4Float gmx_simdcall
-max(Simd4Float a, Simd4Float b)
-{
-    return {
-               vec_sel(b.simdInternal_, a.simdInternal_, vec_sub(a.simdInternal_, b.simdInternal_))
-    };
-}
-
-static inline Simd4Float gmx_simdcall
-min(Simd4Float a, Simd4Float b)
-{
-    return {
-               vec_sel(b.simdInternal_, a.simdInternal_, vec_sub(b.simdInternal_, a.simdInternal_))
-    };
-}
-
-static inline Simd4Float gmx_simdcall
-round(Simd4Float x)
-{
-    // Note: It is critical to use vec_cfid(vec_ctid(a)) for the implementation
-    // here, since vec_round() does not adhere to the FP control
-    // word rounding scheme. We rely on float-to-float and float-to-integer
-    // rounding being the same for half-way values in a few algorithms.
-
-    return {
-               vec_cfid(vec_ctid(x.simdInternal_))
-    };
-}
-
-static inline Simd4Float gmx_simdcall
-trunc(Simd4Float x)
-{
-    return {
-               vec_trunc(x.simdInternal_)
-    };
-}
-
-static inline float gmx_simdcall
-dotProduct(Simd4Float a, Simd4Float b)
-{
-    vector4double dp_sh0 = vec_mul(a.simdInternal_, b.simdInternal_);
-    vector4double dp_sh1 = vec_sldw(dp_sh0, dp_sh0, 1);
-    vector4double dp_sh2 = vec_sldw(dp_sh0, dp_sh0, 2);
-    vector4double dp     = vec_add(dp_sh2, vec_add(dp_sh0, dp_sh1));
-
-    return vec_extract(dp, 0);
-}
-
-static inline void gmx_simdcall
-transpose(Simd4Float * v0, Simd4Float * v1,
-          Simd4Float * v2, Simd4Float * v3)
-{
-    vector4double t0 = vec_perm(v0->simdInternal_, v2->simdInternal_, vec_gpci(00415));
-    vector4double t1 = vec_perm(v0->simdInternal_, v2->simdInternal_, vec_gpci(02637));
-    vector4double t2 = vec_perm(v1->simdInternal_, v3->simdInternal_, vec_gpci(00415));
-    vector4double t3 = vec_perm(v1->simdInternal_, v3->simdInternal_, vec_gpci(02637));
-    v0->simdInternal_ = vec_perm(t0, t2, vec_gpci(00415));
-    v1->simdInternal_ = vec_perm(t0, t2, vec_gpci(02637));
-    v2->simdInternal_ = vec_perm(t1, t3, vec_gpci(00415));
-    v3->simdInternal_ = vec_perm(t1, t3, vec_gpci(02637));
-}
-
-static inline Simd4FBool gmx_simdcall
-operator==(Simd4Float a, Simd4Float b)
-{
-    return {
-               vec_cmpeq(a.simdInternal_, b.simdInternal_)
-    };
-}
-
-static inline Simd4FBool gmx_simdcall
-operator!=(Simd4Float a, Simd4Float b)
-{
-    return {
-               vec_not(vec_cmpeq(a.simdInternal_, b.simdInternal_))
-    };
-}
-
-static inline Simd4FBool gmx_simdcall
-operator<(Simd4Float a, Simd4Float b)
-{
-    return {
-               vec_cmplt(a.simdInternal_, b.simdInternal_)
-    };
-}
-
-static inline Simd4FBool gmx_simdcall
-operator<=(Simd4Float a, Simd4Float b)
-{
-    return {
-               vec_or(vec_cmplt(a.simdInternal_, b.simdInternal_), vec_cmpeq(a.simdInternal_, b.simdInternal_))
-    };
-}
-
-static inline Simd4FBool gmx_simdcall
-operator&&(Simd4FBool a, Simd4FBool b)
-{
-    return {
-               vec_and(a.simdInternal_, b.simdInternal_)
-    };
-}
-
-static inline Simd4FBool gmx_simdcall
-operator||(Simd4FBool a, Simd4FBool b)
-{
-    return {
-               vec_or(a.simdInternal_, b.simdInternal_)
-    };
-}
-
-static inline bool gmx_simdcall
-anyTrue(Simd4FBool a)
-{
-    vector4double b = vec_sldw(a.simdInternal_, a.simdInternal_, 2);
-
-    a.simdInternal_ = vec_or(a.simdInternal_, b);
-    b               = vec_sldw(a.simdInternal_, a.simdInternal_, 1);
-    b               = vec_or(a.simdInternal_, b);
-    return (vec_extract(b, 0) > 0);
-}
-
-static inline Simd4Float gmx_simdcall
-selectByMask(Simd4Float a, Simd4FBool m)
-{
-    return {
-               vec_sel(vec_splats(0.0), a.simdInternal_, m.simdInternal_)
-    };
-}
-
-static inline Simd4Float gmx_simdcall
-selectByNotMask(Simd4Float a, Simd4FBool m)
-{
-    return {
-               vec_sel(a.simdInternal_, vec_splats(0.0), m.simdInternal_)
-    };
-}
-
-static inline Simd4Float gmx_simdcall
-blend(Simd4Float a, Simd4Float b, Simd4FBool sel)
-{
-    return {
-               vec_sel(a.simdInternal_, b.simdInternal_, sel.simdInternal_)
-    };
-}
-
-static inline float gmx_simdcall
-reduce(Simd4Float x)
-{
-    vector4double y = vec_sldw(x.simdInternal_, x.simdInternal_, 2);
-    vector4double z;
-
-    y = vec_add(y, x.simdInternal_);
-    z = vec_sldw(y, y, 1);
-    y = vec_add(y, z);
-    return vec_extract(y, 0);
-}
-
-}      // namespace gmx
-
-#endif // GMX_SIMD_IMPLEMENTATION_IBM_QPX_SIMD4_FLOAT_H
diff --git a/src/gromacs/simd/impl_ibm_qpx/impl_ibm_qpx_simd_double.h b/src/gromacs/simd/impl_ibm_qpx/impl_ibm_qpx_simd_double.h
deleted file mode 100644 (file)
index 16a2f8f..0000000
+++ /dev/null
@@ -1,516 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 2014,2015,2016,2017, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
- * and including many others, as listed in the AUTHORS file in the
- * top-level source directory and at http://www.gromacs.org.
- *
- * GROMACS is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * GROMACS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GROMACS; if not, see
- * http://www.gnu.org/licenses, or write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
- *
- * If you want to redistribute modifications to GROMACS, please
- * consider that scientific software is very special. Version
- * control is crucial - bugs must be traceable. We will be happy to
- * consider code for inclusion in the official distribution, but
- * derived work must not be called official GROMACS. Details are found
- * in the README & COPYING files - if they are missing, get the
- * official version at http://www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the research papers on the package. Check out http://www.gromacs.org.
- */
-
-#ifndef GMX_SIMD_IMPLEMENTATION_IBM_QPX_SIMD_DOUBLE_H
-#define GMX_SIMD_IMPLEMENTATION_IBM_QPX_SIMD_DOUBLE_H
-
-#include "config.h"
-
-// Assert is buggy on xlc with high optimization, so we skip it for QPX
-#include <cmath>
-#include <cstddef>
-#include <cstdint>
-
-#ifdef __clang__
-#include <qpxmath.h>
-#endif
-
-#include "gromacs/math/utilities.h"
-#include "gromacs/utility/basedefinitions.h"
-
-#include "impl_ibm_qpx_simd_float.h"
-
-namespace gmx
-{
-
-class SimdDouble
-{
-    public:
-        SimdDouble() {}
-
-        SimdDouble(double d) : simdInternal_(vec_splats(d)) {}
-
-        // Internal utility constructor to simplify return statements
-        SimdDouble(vector4double simd) : simdInternal_(simd) {}
-
-        vector4double  simdInternal_;
-};
-
-class SimdDInt32
-{
-    public:
-        SimdDInt32() {}
-
-        SimdDInt32(std::int32_t i)
-        {
-            alignas(GMX_SIMD_ALIGNMENT) std::int32_t  idata[GMX_SIMD_DINT32_WIDTH];
-            idata[0]      = i;
-            simdInternal_ = vec_splat(vec_ldia(0, idata), 0);
-        }
-
-        // Internal utility constructor to simplify return statements
-        SimdDInt32(vector4double simd) : simdInternal_(simd) {}
-
-        vector4double  simdInternal_;
-};
-
-class SimdDBool
-{
-    public:
-        SimdDBool() {}
-
-        SimdDBool(bool b) : simdInternal_(vec_splats(b ? 1.0 : -1.0)) {}
-
-        // Internal utility constructor to simplify return statements
-        SimdDBool(vector4double simd) : simdInternal_(simd) {}
-
-        vector4double  simdInternal_;
-};
-
-static inline SimdDouble gmx_simdcall
-simdLoad(const double *m, SimdDoubleTag = {})
-{
-#ifdef NDEBUG
-    return {
-               vec_ld(0, const_cast<double *>(m))
-    };
-#else
-    return {
-               vec_lda(0, const_cast<double *>(m))
-    };
-#endif
-}
-
-static inline void gmx_simdcall
-store(double *m, SimdDouble a)
-{
-#ifdef NDEBUG
-    vec_st(a.simdInternal_, 0, m);
-#else
-    vec_sta(a.simdInternal_, 0, m);
-#endif
-}
-
-static inline SimdDouble gmx_simdcall
-setZeroD()
-{
-    return {
-               vec_splats(0.0)
-    };
-}
-
-static inline SimdDInt32 gmx_simdcall
-simdLoad(const std::int32_t * m, SimdDInt32Tag)
-{
-#ifdef NDEBUG
-    return {
-               vec_ldia(0, const_cast<int *>(m))
-    };
-#else
-    return {
-               vec_ldiaa(0, const_cast<int *>(m))
-    };
-#endif
-}
-
-static inline void gmx_simdcall
-store(std::int32_t * m, SimdDInt32 a)
-{
-    vec_st(a.simdInternal_, 0, m);
-}
-
-static inline SimdDInt32 gmx_simdcall
-setZeroDI()
-{
-    return {
-               vec_splats(0.0)
-    };
-}
-
-static inline SimdDouble gmx_simdcall
-operator+(SimdDouble a, SimdDouble b)
-{
-    return {
-               vec_add(a.simdInternal_, b.simdInternal_)
-    };
-}
-
-static inline SimdDouble gmx_simdcall
-operator-(SimdDouble a, SimdDouble b)
-{
-    return {
-               vec_sub(a.simdInternal_, b.simdInternal_)
-    };
-}
-
-static inline SimdDouble gmx_simdcall
-operator-(SimdDouble x)
-{
-    return {
-               vec_neg(x.simdInternal_)
-    };
-}
-
-static inline SimdDouble gmx_simdcall
-operator*(SimdDouble a, SimdDouble b)
-{
-    return {
-               vec_mul(a.simdInternal_, b.simdInternal_)
-    };
-}
-
-static inline SimdDouble gmx_simdcall
-fma(SimdDouble a, SimdDouble b, SimdDouble c)
-{
-    return {
-               vec_madd(a.simdInternal_, b.simdInternal_, c.simdInternal_)
-    };
-}
-
-static inline SimdDouble gmx_simdcall
-fms(SimdDouble a, SimdDouble b, SimdDouble c)
-{
-    return {
-               vec_msub(a.simdInternal_, b.simdInternal_, c.simdInternal_)
-    };
-}
-
-static inline SimdDouble gmx_simdcall
-fnma(SimdDouble a, SimdDouble b, SimdDouble c)
-{
-    return {
-               vec_nmsub(a.simdInternal_, b.simdInternal_, c.simdInternal_)
-    };
-}
-
-static inline SimdDouble gmx_simdcall
-fnms(SimdDouble a, SimdDouble b, SimdDouble c)
-{
-    return {
-               vec_nmadd(a.simdInternal_, b.simdInternal_, c.simdInternal_)
-    };
-}
-
-static inline SimdDouble gmx_simdcall
-rsqrt(SimdDouble x)
-{
-    return {
-               vec_rsqrte(x.simdInternal_)
-    };
-}
-
-static inline SimdDouble gmx_simdcall
-rcp(SimdDouble x)
-{
-    return {
-               vec_re(x.simdInternal_)
-    };
-}
-
-static inline SimdDouble gmx_simdcall
-maskAdd(SimdDouble a, SimdDouble b, SimdDBool m)
-{
-    return {
-               vec_add(a.simdInternal_, vec_sel(vec_splats(0.0), b.simdInternal_, m.simdInternal_))
-    };
-}
-
-static inline SimdDouble gmx_simdcall
-maskzMul(SimdDouble a, SimdDouble b, SimdDBool m)
-{
-    return {
-               vec_sel(vec_splats(0.0), vec_mul(a.simdInternal_, b.simdInternal_), m.simdInternal_)
-    };
-}
-
-static inline SimdDouble
-maskzFma(SimdDouble a, SimdDouble b, SimdDouble c, SimdDBool m)
-{
-    return {
-               vec_sel(vec_splats(0.0), vec_madd(a.simdInternal_, b.simdInternal_, c.simdInternal_), m.simdInternal_)
-    };
-}
-
-static inline SimdDouble
-maskzRsqrt(SimdDouble x, SimdDBool m)
-{
-#ifndef NDEBUG
-    x.simdInternal_ = vec_sel(vec_splats(1.0), x.simdInternal_, m.simdInternal_);
-#endif
-    return {
-               vec_sel(vec_splats(0.0), vec_rsqrte(x.simdInternal_), m.simdInternal_)
-    };
-}
-
-static inline SimdDouble
-maskzRcp(SimdDouble x, SimdDBool m)
-{
-#ifndef NDEBUG
-    x.simdInternal_ = vec_sel(vec_splats(1.0), x.simdInternal_, m.simdInternal_);
-#endif
-    return {
-               vec_sel(vec_splats(0.0), vec_re(x.simdInternal_), m.simdInternal_)
-    };
-}
-
-static inline SimdDouble gmx_simdcall
-abs(SimdDouble x)
-{
-    return {
-               vec_abs( x.simdInternal_ )
-    };
-}
-
-static inline SimdDouble gmx_simdcall
-max(SimdDouble a, SimdDouble b)
-{
-    return {
-               vec_sel(b.simdInternal_, a.simdInternal_, vec_sub(a.simdInternal_, b.simdInternal_))
-    };
-}
-
-static inline SimdDouble gmx_simdcall
-min(SimdDouble a, SimdDouble b)
-{
-    return {
-               vec_sel(b.simdInternal_, a.simdInternal_, vec_sub(b.simdInternal_, a.simdInternal_))
-    };
-}
-
-static inline SimdDouble gmx_simdcall
-round(SimdDouble x)
-{
-    // Note: It is critical to use vec_cfid(vec_ctid(a)) for the implementation
-    // here, since vec_round() does not adhere to the FP control
-    // word rounding scheme. We rely on float-to-float and float-to-integer
-    // rounding being the same for half-way values in a few algorithms.
-    return {
-               vec_cfid(vec_ctid(x.simdInternal_))
-    };
-}
-
-static inline SimdDouble gmx_simdcall
-trunc(SimdDouble x)
-{
-    return {
-               vec_trunc(x.simdInternal_)
-    };
-}
-
-static inline SimdDouble
-frexp(SimdDouble value, SimdDInt32 * exponent)
-{
-    alignas(GMX_SIMD_ALIGNMENT) double        rdata[GMX_SIMD_DOUBLE_WIDTH];
-    alignas(GMX_SIMD_ALIGNMENT) std::int32_t  idata[GMX_SIMD_DOUBLE_WIDTH];
-
-    vec_st(value.simdInternal_, 0, rdata);
-
-    for (std::size_t i = 0; i < GMX_SIMD_DOUBLE_WIDTH; i++)
-    {
-        rdata[i] = std::frexp(rdata[i], idata + i);
-    }
-
-    exponent->simdInternal_ = vec_ldia(0, idata);
-    value.simdInternal_     = vec_ld(0, rdata);
-
-    return value;
-}
-
-template <MathOptimization opt = MathOptimization::Safe>
-static inline SimdDouble
-ldexp(SimdDouble value, SimdDInt32 exponent)
-{
-    alignas(GMX_SIMD_ALIGNMENT) double        rdata[GMX_SIMD_DOUBLE_WIDTH];
-    alignas(GMX_SIMD_ALIGNMENT) std::int32_t  idata[GMX_SIMD_DOUBLE_WIDTH];
-
-    vec_st(value.simdInternal_,    0, rdata);
-    vec_st(exponent.simdInternal_, 0, idata);
-
-    for (std::size_t i = 0; i < GMX_SIMD_DOUBLE_WIDTH; i++)
-    {
-        rdata[i] = std::ldexp(rdata[i], idata[i]);
-    }
-
-    value.simdInternal_     = vec_ld(0, rdata);
-
-    return value;
-}
-
-static inline double gmx_simdcall
-reduce(SimdDouble x)
-{
-    vector4double y = vec_sldw(x.simdInternal_, x.simdInternal_, 2);
-    vector4double z;
-
-    y = vec_add(y, x.simdInternal_);
-    z = vec_sldw(y, y, 1);
-    y = vec_add(y, z);
-    return vec_extract(y, 0);
-}
-
-static inline SimdDBool gmx_simdcall
-operator==(SimdDouble a, SimdDouble b)
-{
-    return {
-               vec_cmpeq(a.simdInternal_, b.simdInternal_)
-    };
-}
-
-static inline SimdDBool gmx_simdcall
-operator!=(SimdDouble a, SimdDouble b)
-{
-    return {
-               vec_not(vec_cmpeq(a.simdInternal_, b.simdInternal_))
-    };
-}
-
-static inline SimdDBool gmx_simdcall
-operator<(SimdDouble a, SimdDouble b)
-{
-    return {
-               vec_cmplt(a.simdInternal_, b.simdInternal_)
-    };
-}
-
-static inline SimdDBool gmx_simdcall
-operator<=(SimdDouble a, SimdDouble b)
-{
-    return {
-               vec_or(vec_cmplt(a.simdInternal_, b.simdInternal_), vec_cmpeq(a.simdInternal_, b.simdInternal_))
-    };
-}
-
-static inline SimdDBool gmx_simdcall
-operator&&(SimdDBool a, SimdDBool b)
-{
-    return {
-               vec_and(a.simdInternal_, b.simdInternal_)
-    };
-}
-
-static inline SimdDBool gmx_simdcall
-operator||(SimdDBool a, SimdDBool b)
-{
-    return {
-               vec_or(a.simdInternal_, b.simdInternal_)
-    };
-}
-
-static inline bool gmx_simdcall
-anyTrue(SimdDBool a)
-{
-    vector4double b = vec_sldw(a.simdInternal_, a.simdInternal_, 2);
-
-    a.simdInternal_ = vec_or(a.simdInternal_, b);
-    b               = vec_sldw(a.simdInternal_, a.simdInternal_, 1);
-    b               = vec_or(a.simdInternal_, b);
-    return (vec_extract(b, 0) > 0);
-}
-
-static inline SimdDouble gmx_simdcall
-selectByMask(SimdDouble a, SimdDBool m)
-{
-    return {
-               vec_sel(vec_splats(0.0), a.simdInternal_, m.simdInternal_)
-    };
-}
-
-static inline SimdDouble gmx_simdcall
-selectByNotMask(SimdDouble a, SimdDBool m)
-{
-    return {
-               vec_sel(a.simdInternal_, vec_splats(0.0), m.simdInternal_)
-    };
-}
-
-static inline SimdDouble gmx_simdcall
-blend(SimdDouble a, SimdDouble b, SimdDBool sel)
-{
-    return {
-               vec_sel(a.simdInternal_, b.simdInternal_, sel.simdInternal_)
-    };
-}
-
-static inline SimdDInt32 gmx_simdcall
-cvtR2I(SimdDouble a)
-{
-    return {
-               vec_ctiw(a.simdInternal_)
-    };
-}
-
-static inline SimdDInt32 gmx_simdcall
-cvttR2I(SimdDouble a)
-{
-    return {
-               vec_ctiwz(a.simdInternal_)
-    };
-}
-
-static inline SimdDouble gmx_simdcall
-cvtI2R(SimdDInt32 a)
-{
-    return {
-               vec_cfid(a.simdInternal_)
-    };
-}
-
-static inline SimdDouble gmx_simdcall
-cvtF2D(SimdFloat f)
-{
-    return {
-               f.simdInternal_
-    };
-}
-
-static inline SimdFloat gmx_simdcall
-cvtD2F(SimdDouble d)
-{
-    return {
-               d.simdInternal_
-    };
-}
-
-static inline SimdDouble gmx_simdcall
-copysign(SimdDouble x, SimdDouble y)
-{
-    return {
-               vec_cpsgn(y.simdInternal_, x.simdInternal_)
-    };
-}
-
-}      // namespace gmx
-
-#endif // GMX_SIMD_IMPLEMENTATION_IBM_QPX_SIMD_DOUBLE_H
diff --git a/src/gromacs/simd/impl_ibm_qpx/impl_ibm_qpx_simd_float.h b/src/gromacs/simd/impl_ibm_qpx/impl_ibm_qpx_simd_float.h
deleted file mode 100644 (file)
index 83b74d1..0000000
+++ /dev/null
@@ -1,497 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 2014,2015,2016,2017, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
- * and including many others, as listed in the AUTHORS file in the
- * top-level source directory and at http://www.gromacs.org.
- *
- * GROMACS is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * GROMACS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GROMACS; if not, see
- * http://www.gnu.org/licenses, or write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
- *
- * If you want to redistribute modifications to GROMACS, please
- * consider that scientific software is very special. Version
- * control is crucial - bugs must be traceable. We will be happy to
- * consider code for inclusion in the official distribution, but
- * derived work must not be called official GROMACS. Details are found
- * in the README & COPYING files - if they are missing, get the
- * official version at http://www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the research papers on the package. Check out http://www.gromacs.org.
- */
-
-#ifndef GMX_SIMD_IMPLEMENTATION_IBM_QPX_SIMD_FLOAT_H
-#define GMX_SIMD_IMPLEMENTATION_IBM_QPX_SIMD_FLOAT_H
-
-#include "config.h"
-
-// Assert is buggy on xlc with high optimization, so we skip it for QPX
-#include <cstddef>
-#include <cstdint>
-
-#ifdef __clang__
-#include <qpxmath.h>
-#endif
-
-#include "gromacs/math/utilities.h"
-#include "gromacs/utility/basedefinitions.h"
-
-namespace gmx
-{
-
-class SimdFloat
-{
-    public:
-        SimdFloat() {}
-
-        SimdFloat(float f) : simdInternal_(vec_splats(f)) {}
-
-        // Internal utility constructor to simplify return statements
-        SimdFloat(vector4double simd) : simdInternal_(simd) {}
-
-        vector4double  simdInternal_;
-};
-
-class SimdFInt32
-{
-    public:
-        SimdFInt32() {}
-
-        SimdFInt32(std::int32_t i)
-        {
-            alignas(GMX_SIMD_ALIGNMENT) std::int32_t idata[GMX_SIMD_FINT32_WIDTH];
-            idata[0]      = i;
-            simdInternal_ = vec_splat(vec_ldia(0, idata), 0);
-        }
-
-        // Internal utility constructor to simplify return statements
-        SimdFInt32(vector4double simd) : simdInternal_(simd) {}
-
-        vector4double  simdInternal_;
-};
-
-class SimdFBool
-{
-    public:
-        SimdFBool() {}
-
-        SimdFBool(bool b) : simdInternal_(vec_splats(b ? 1.0 : -1.0)) {}
-
-        // Internal utility constructor to simplify return statements
-        SimdFBool(vector4double simd) : simdInternal_(simd) {}
-
-        vector4double  simdInternal_;
-};
-
-static inline SimdFloat gmx_simdcall
-simdLoad(const float *m, SimdFloatTag = {})
-{
-#ifdef NDEBUG
-    return {
-               vec_ld(0, const_cast<float *>(m))
-    };
-#else
-    return {
-               vec_lda(0, const_cast<float *>(m))
-    };
-#endif
-}
-
-static inline void gmx_simdcall
-store(float *m, SimdFloat a)
-{
-#ifdef NDEBUG
-    vec_st(a.simdInternal_, 0, m);
-#else
-    vec_sta(a.simdInternal_, 0, m);
-#endif
-}
-
-static inline SimdFloat gmx_simdcall
-setZeroF()
-{
-    return {
-               vec_splats(0.0)
-    };
-}
-
-static inline SimdFInt32 gmx_simdcall
-simdLoad(const std::int32_t * m, SimdFInt32Tag)
-{
-#ifdef NDEBUG
-    return {
-               vec_ldia(0, const_cast<int *>(m))
-    };
-#else
-    return {
-               vec_ldiaa(0, const_cast<int *>(m))
-    };
-#endif
-}
-
-static inline void gmx_simdcall
-store(std::int32_t * m, SimdFInt32 a)
-{
-    vec_st(a.simdInternal_, 0, m);
-}
-
-static inline SimdFInt32 gmx_simdcall
-setZeroFI()
-{
-    return {
-               vec_splats(0.0)
-    };
-}
-
-static inline SimdFloat gmx_simdcall
-operator+(SimdFloat a, SimdFloat b)
-{
-    return {
-               vec_add(a.simdInternal_, b.simdInternal_)
-    };
-}
-
-static inline SimdFloat gmx_simdcall
-operator-(SimdFloat a, SimdFloat b)
-{
-    return {
-               vec_sub(a.simdInternal_, b.simdInternal_)
-    };
-}
-
-static inline SimdFloat gmx_simdcall
-operator-(SimdFloat x)
-{
-    return {
-               vec_neg(x.simdInternal_)
-    };
-}
-
-static inline SimdFloat gmx_simdcall
-operator*(SimdFloat a, SimdFloat b)
-{
-    return {
-               vec_mul(a.simdInternal_, b.simdInternal_)
-    };
-}
-
-static inline SimdFloat gmx_simdcall
-fma(SimdFloat a, SimdFloat b, SimdFloat c)
-{
-    return {
-               vec_madd(a.simdInternal_, b.simdInternal_, c.simdInternal_)
-    };
-}
-
-static inline SimdFloat gmx_simdcall
-fms(SimdFloat a, SimdFloat b, SimdFloat c)
-{
-    return {
-               vec_msub(a.simdInternal_, b.simdInternal_, c.simdInternal_)
-    };
-}
-
-static inline SimdFloat gmx_simdcall
-fnma(SimdFloat a, SimdFloat b, SimdFloat c)
-{
-    return {
-               vec_nmsub(a.simdInternal_, b.simdInternal_, c.simdInternal_)
-    };
-}
-
-static inline SimdFloat gmx_simdcall
-fnms(SimdFloat a, SimdFloat b, SimdFloat c)
-{
-    return {
-               vec_nmadd(a.simdInternal_, b.simdInternal_, c.simdInternal_)
-    };
-}
-
-static inline SimdFloat gmx_simdcall
-rsqrt(SimdFloat x)
-{
-    return {
-               vec_rsqrte(x.simdInternal_)
-    };
-}
-
-static inline SimdFloat gmx_simdcall
-rcp(SimdFloat x)
-{
-    return {
-               vec_re(x.simdInternal_)
-    };
-}
-
-static inline SimdFloat gmx_simdcall
-maskAdd(SimdFloat a, SimdFloat b, SimdFBool m)
-{
-    return {
-               vec_add(a.simdInternal_, vec_sel(vec_splats(0.0), b.simdInternal_, m.simdInternal_))
-    };
-}
-
-static inline SimdFloat gmx_simdcall
-maskzMul(SimdFloat a, SimdFloat b, SimdFBool m)
-{
-    return {
-               vec_sel(vec_splats(0.0), vec_mul(a.simdInternal_, b.simdInternal_), m.simdInternal_)
-    };
-}
-
-static inline SimdFloat
-maskzFma(SimdFloat a, SimdFloat b, SimdFloat c, SimdFBool m)
-{
-    return {
-               vec_sel(vec_splats(0.0), vec_madd(a.simdInternal_, b.simdInternal_, c.simdInternal_), m.simdInternal_)
-    };
-}
-
-static inline SimdFloat
-maskzRsqrt(SimdFloat x, SimdFBool m)
-{
-#ifndef NDEBUG
-    x.simdInternal_ = vec_sel(vec_splats(1.0), x.simdInternal_, m.simdInternal_);
-#endif
-    return {
-               vec_sel(vec_splats(0.0), vec_rsqrte(x.simdInternal_), m.simdInternal_)
-    };
-}
-
-static inline SimdFloat
-maskzRcp(SimdFloat x, SimdFBool m)
-{
-#ifndef NDEBUG
-    x.simdInternal_ = vec_sel(vec_splats(1.0), x.simdInternal_, m.simdInternal_);
-#endif
-    return {
-               vec_sel(vec_splats(0.0), vec_re(x.simdInternal_), m.simdInternal_)
-    };
-}
-
-static inline SimdFloat gmx_simdcall
-abs(SimdFloat x)
-{
-    return {
-               vec_abs( x.simdInternal_ )
-    };
-}
-
-static inline SimdFloat gmx_simdcall
-max(SimdFloat a, SimdFloat b)
-{
-    return {
-               vec_sel(b.simdInternal_, a.simdInternal_, vec_sub(a.simdInternal_, b.simdInternal_))
-    };
-}
-
-static inline SimdFloat gmx_simdcall
-min(SimdFloat a, SimdFloat b)
-{
-    return {
-               vec_sel(b.simdInternal_, a.simdInternal_, vec_sub(b.simdInternal_, a.simdInternal_))
-    };
-}
-
-static inline SimdFloat gmx_simdcall
-round(SimdFloat x)
-{
-    // Note: It is critical to use vec_cfid(vec_ctid(a)) for the implementation
-    // here, since vec_round() does not adhere to the FP control
-    // word rounding scheme. We rely on float-to-float and float-to-integer
-    // rounding being the same for half-way values in a few algorithms.
-    return {
-               vec_cfid(vec_ctid(x.simdInternal_))
-    };
-}
-
-static inline SimdFloat gmx_simdcall
-trunc(SimdFloat x)
-{
-    return {
-               vec_trunc(x.simdInternal_)
-    };
-}
-
-static inline SimdFloat
-frexp(SimdFloat value, SimdFInt32 * exponent)
-{
-    alignas(GMX_SIMD_ALIGNMENT) float         rdata[GMX_SIMD_FLOAT_WIDTH];
-    alignas(GMX_SIMD_ALIGNMENT) std::int32_t  idata[GMX_SIMD_FLOAT_WIDTH];
-
-    vec_st(value.simdInternal_, 0, rdata);
-
-    for (std::size_t i = 0; i < GMX_SIMD_FLOAT_WIDTH; i++)
-    {
-        rdata[i] = std::frexp(rdata[i], idata + i);
-    }
-
-    exponent->simdInternal_ = vec_ldia(0, idata);
-    value.simdInternal_     = vec_ld(0, rdata);
-
-    return value;
-}
-
-template <MathOptimization opt = MathOptimization::Safe>
-static inline SimdFloat
-ldexp(SimdFloat value, SimdFInt32 exponent)
-{
-    alignas(GMX_SIMD_ALIGNMENT) float         rdata[GMX_SIMD_FLOAT_WIDTH];
-    alignas(GMX_SIMD_ALIGNMENT) std::int32_t  idata[GMX_SIMD_FLOAT_WIDTH];
-
-    vec_st(value.simdInternal_,    0, rdata);
-    vec_st(exponent.simdInternal_, 0, idata);
-
-    for (std::size_t i = 0; i < GMX_SIMD_FLOAT_WIDTH; i++)
-    {
-        rdata[i] = std::ldexp(rdata[i], idata[i]);
-    }
-
-    value.simdInternal_     = vec_ld(0, rdata);
-
-    return value;
-}
-
-static inline float gmx_simdcall
-reduce(SimdFloat x)
-{
-    vector4double y = vec_sldw(x.simdInternal_, x.simdInternal_, 2);
-    vector4double z;
-
-    y = vec_add(y, x.simdInternal_);
-    z = vec_sldw(y, y, 1);
-    y = vec_add(y, z);
-    return vec_extract(y, 0);
-}
-
-static inline SimdFBool gmx_simdcall
-operator==(SimdFloat a, SimdFloat b)
-{
-    return {
-               vec_cmpeq(a.simdInternal_, b.simdInternal_)
-    };
-}
-
-static inline SimdFBool gmx_simdcall
-operator!=(SimdFloat a, SimdFloat b)
-{
-    return {
-               vec_not(vec_cmpeq(a.simdInternal_, b.simdInternal_))
-    };
-}
-
-static inline SimdFBool gmx_simdcall
-operator<(SimdFloat a, SimdFloat b)
-{
-    return {
-               vec_cmplt(a.simdInternal_, b.simdInternal_)
-    };
-}
-
-static inline SimdFBool gmx_simdcall
-operator<=(SimdFloat a, SimdFloat b)
-{
-    return {
-               vec_or(vec_cmplt(a.simdInternal_, b.simdInternal_), vec_cmpeq(a.simdInternal_, b.simdInternal_))
-    };
-}
-
-static inline SimdFBool gmx_simdcall
-operator&&(SimdFBool a, SimdFBool b)
-{
-    return {
-               vec_and(a.simdInternal_, b.simdInternal_)
-    };
-}
-
-static inline SimdFBool gmx_simdcall
-operator||(SimdFBool a, SimdFBool b)
-{
-    return {
-               vec_or(a.simdInternal_, b.simdInternal_)
-    };
-}
-
-static inline bool gmx_simdcall
-anyTrue(SimdFBool a)
-{
-    vector4double b = vec_sldw(a.simdInternal_, a.simdInternal_, 2);
-
-    a.simdInternal_ = vec_or(a.simdInternal_, b);
-    b               = vec_sldw(a.simdInternal_, a.simdInternal_, 1);
-    b               = vec_or(a.simdInternal_, b);
-    return (vec_extract(b, 0) > 0);
-}
-
-static inline SimdFloat gmx_simdcall
-selectByMask(SimdFloat a, SimdFBool m)
-{
-    return {
-               vec_sel(vec_splats(0.0), a.simdInternal_, m.simdInternal_)
-    };
-}
-
-static inline SimdFloat gmx_simdcall
-selectByNotMask(SimdFloat a, SimdFBool m)
-{
-    return {
-               vec_sel(a.simdInternal_, vec_splats(0.0), m.simdInternal_)
-    };
-}
-
-static inline SimdFloat gmx_simdcall
-blend(SimdFloat a, SimdFloat b, SimdFBool sel)
-{
-    return {
-               vec_sel(a.simdInternal_, b.simdInternal_, sel.simdInternal_)
-    };
-}
-
-static inline SimdFInt32 gmx_simdcall
-cvtR2I(SimdFloat a)
-{
-    return {
-               vec_ctiw(a.simdInternal_)
-    };
-}
-
-static inline SimdFInt32 gmx_simdcall
-cvttR2I(SimdFloat a)
-{
-    return {
-               vec_ctiwz(a.simdInternal_)
-    };
-}
-
-static inline SimdFloat gmx_simdcall
-cvtI2R(SimdFInt32 a)
-{
-    return {
-               vec_cfid(a.simdInternal_)
-    };
-}
-
-static inline SimdFloat gmx_simdcall
-copysign(SimdFloat x, SimdFloat y)
-{
-    return {
-               vec_cpsgn(y.simdInternal_, x.simdInternal_)
-    };
-}
-
-}      // namespace gmx
-
-#endif // GMX_SIMD_IMPLEMENTATION_IBM_QPX_SIMD_FLOAT_H
diff --git a/src/gromacs/simd/impl_ibm_qpx/impl_ibm_qpx_util_double.h b/src/gromacs/simd/impl_ibm_qpx/impl_ibm_qpx_util_double.h
deleted file mode 100644 (file)
index 633327a..0000000
+++ /dev/null
@@ -1,336 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 2014,2015,2016,2017, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
- * and including many others, as listed in the AUTHORS file in the
- * top-level source directory and at http://www.gromacs.org.
- *
- * GROMACS is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * GROMACS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GROMACS; if not, see
- * http://www.gnu.org/licenses, or write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
- *
- * If you want to redistribute modifications to GROMACS, please
- * consider that scientific software is very special. Version
- * control is crucial - bugs must be traceable. We will be happy to
- * consider code for inclusion in the official distribution, but
- * derived work must not be called official GROMACS. Details are found
- * in the README & COPYING files - if they are missing, get the
- * official version at http://www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the research papers on the package. Check out http://www.gromacs.org.
- */
-
-#ifndef GMX_SIMD_IMPLEMENTATION_IBM_QPX_UTIL_DOUBLE_H
-#define GMX_SIMD_IMPLEMENTATION_IBM_QPX_UTIL_DOUBLE_H
-
-#include "config.h"
-
-// Assert is buggy on xlc with high optimization, so we skip it for QPX
-#include <cstddef>
-#include <cstdint>
-
-#ifdef __clang__
-#    include <qpxmath.h>
-#endif
-
-#include "gromacs/utility/basedefinitions.h"
-
-#include "impl_ibm_qpx_simd_double.h"
-
-namespace gmx
-{
-
-template <int align>
-static inline void gmx_simdcall
-gatherLoadTranspose(const double  *       base,
-                    const std::int32_t    offset[],
-                    SimdDouble *          v0,
-                    SimdDouble *          v1,
-                    SimdDouble *          v2,
-                    SimdDouble *          v3)
-{
-    v0->simdInternal_ = vec_ld(0, const_cast<double *>(base + align * offset[0]) );
-    v1->simdInternal_ = vec_ld(0, const_cast<double *>(base + align * offset[1]) );
-    v2->simdInternal_ = vec_ld(0, const_cast<double *>(base + align * offset[2]) );
-    v3->simdInternal_ = vec_ld(0, const_cast<double *>(base + align * offset[3]) );
-
-    vector4double t0 = vec_perm(v0->simdInternal_, v2->simdInternal_, vec_gpci(00415));
-    vector4double t1 = vec_perm(v0->simdInternal_, v2->simdInternal_, vec_gpci(02637));
-    vector4double t2 = vec_perm(v1->simdInternal_, v3->simdInternal_, vec_gpci(00415));
-    vector4double t3 = vec_perm(v1->simdInternal_, v3->simdInternal_, vec_gpci(02637));
-    v0->simdInternal_ = vec_perm(t0, t2, vec_gpci(00415));
-    v1->simdInternal_ = vec_perm(t0, t2, vec_gpci(02637));
-    v2->simdInternal_ = vec_perm(t1, t3, vec_gpci(00415));
-    v3->simdInternal_ = vec_perm(t1, t3, vec_gpci(02637));
-}
-
-template <int align>
-static inline void gmx_simdcall
-gatherLoadTranspose(const double *       base,
-                    const std::int32_t   offset[],
-                    SimdDouble *         v0,
-                    SimdDouble *         v1)
-{
-    vector4double t0, t1, t2, t3;
-
-    t0                = vec_ld2(0, const_cast<double *>(base + align * offset[0]) );
-    t1                = vec_ld2(0, const_cast<double *>(base + align * offset[1]) );
-    t2                = vec_ld2(0, const_cast<double *>(base + align * offset[2]) );
-    t3                = vec_ld2(0, const_cast<double *>(base + align * offset[3]) );
-    t0                = vec_perm(t0, t2, vec_gpci(00415));
-    t1                = vec_perm(t1, t3, vec_gpci(00415));
-    v0->simdInternal_ = vec_perm(t0, t1, vec_gpci(00415));
-    v1->simdInternal_ = vec_perm(t0, t1, vec_gpci(02637));
-}
-
-static const int c_simdBestPairAlignmentDouble = 2;
-
-template <int align>
-static inline void gmx_simdcall
-gatherLoadUTranspose(const double  *       base,
-                     const std::int32_t    offset[],
-                     SimdDouble *          v0,
-                     SimdDouble *          v1,
-                     SimdDouble *          v2)
-{
-    vector4double             t1, t2, t3, t4, t5, t6, t7, t8;
-
-    if (align % 4 == 0)
-    {
-        SimdDouble t3;
-        gatherLoadTranspose<align>(base, offset, v0, v1, v2, &t3);
-    }
-    else
-    {
-        t1  = vec_perm(vec_splats(base[align * offset[0]]), vec_splats(base[align * offset[0] + 1]), vec_gpci(00415));
-        t2  = vec_perm(vec_splats(base[align * offset[1]]), vec_splats(base[align * offset[1] + 1]), vec_gpci(00415));
-        t3  = vec_perm(vec_splats(base[align * offset[2]]), vec_splats(base[align * offset[2] + 1]), vec_gpci(00415));
-        t4  = vec_perm(vec_splats(base[align * offset[3]]), vec_splats(base[align * offset[3] + 1]), vec_gpci(00415));
-
-        t5  = vec_splats( *(base + align * offset[0] + 2) );
-        t6  = vec_splats( *(base + align * offset[1] + 2) );
-        t7  = vec_splats( *(base + align * offset[2] + 2) );
-        t8  = vec_splats( *(base + align * offset[3] + 2) );
-
-        t1                = vec_perm(t1, t2, vec_gpci(00415));
-        t3                = vec_perm(t3, t4, vec_gpci(00415));
-        v0->simdInternal_ = vec_perm(t1, t3, vec_gpci(00145));
-        v1->simdInternal_ = vec_perm(t3, t1, vec_gpci(06723));
-        t5                = vec_perm(t5, t6, vec_gpci(00415));
-        t7                = vec_perm(t7, t8, vec_gpci(00415));
-        v2->simdInternal_ = vec_perm(t5, t7, vec_gpci(00145));
-    }
-}
-
-template <int align>
-static inline void gmx_simdcall
-transposeScatterStoreU(double  *             base,
-                       const std::int32_t    offset[],
-                       SimdDouble            v0,
-                       SimdDouble            v1,
-                       SimdDouble            v2)
-{
-    alignas(GMX_SIMD_ALIGNMENT) double   m0[GMX_SIMD_DOUBLE_WIDTH];
-    alignas(GMX_SIMD_ALIGNMENT) double   m1[GMX_SIMD_DOUBLE_WIDTH];
-    alignas(GMX_SIMD_ALIGNMENT) double   m2[GMX_SIMD_DOUBLE_WIDTH];
-
-    store(m0, v0);
-    store(m1, v1);
-    store(m2, v2);
-
-    base[align * offset[0]    ] = m0[0];
-    base[align * offset[0] + 1] = m1[0];
-    base[align * offset[0] + 2] = m2[0];
-    base[align * offset[1]    ] = m0[1];
-    base[align * offset[1] + 1] = m1[1];
-    base[align * offset[1] + 2] = m2[1];
-    base[align * offset[2]    ] = m0[2];
-    base[align * offset[2] + 1] = m1[2];
-    base[align * offset[2] + 2] = m2[2];
-    base[align * offset[3]    ] = m0[3];
-    base[align * offset[3] + 1] = m1[3];
-    base[align * offset[3] + 2] = m2[3];
-}
-
-template <int align>
-static inline void gmx_simdcall
-transposeScatterIncrU(double  *             base,
-                      const std::int32_t    offset[],
-                      SimdDouble            v0,
-                      SimdDouble            v1,
-                      SimdDouble            v2)
-{
-    if (align % 4 == 0)
-    {
-        // transpose
-        SimdDouble    v3(0.0);
-        vector4double t0 = vec_perm(v0.simdInternal_, v2.simdInternal_, vec_gpci(00415));
-        vector4double t1 = vec_perm(v0.simdInternal_, v2.simdInternal_, vec_gpci(02637));
-        vector4double t2 = vec_perm(v1.simdInternal_, v3.simdInternal_, vec_gpci(00415));
-        vector4double t3 = vec_perm(v1.simdInternal_, v3.simdInternal_, vec_gpci(02637));
-        v0.simdInternal_ = vec_perm(t0, t2, vec_gpci(00415));
-        v1.simdInternal_ = vec_perm(t0, t2, vec_gpci(02637));
-        v2.simdInternal_ = vec_perm(t1, t3, vec_gpci(00415));
-        v3.simdInternal_ = vec_perm(t1, t3, vec_gpci(02637));
-        // increment
-        store(base + align*offset[0], simdLoad(base + align*offset[0]) + v0);
-        store(base + align*offset[1], simdLoad(base + align*offset[1]) + v1);
-        store(base + align*offset[2], simdLoad(base + align*offset[2]) + v2);
-        store(base + align*offset[3], simdLoad(base + align*offset[3]) + v3);
-    }
-    else
-    {
-        alignas(GMX_SIMD_ALIGNMENT) double   m0[GMX_SIMD_DOUBLE_WIDTH];
-        alignas(GMX_SIMD_ALIGNMENT) double   m1[GMX_SIMD_DOUBLE_WIDTH];
-        alignas(GMX_SIMD_ALIGNMENT) double   m2[GMX_SIMD_DOUBLE_WIDTH];
-
-        store(m0, v0);
-        store(m1, v1);
-        store(m2, v2);
-
-        base[align * offset[0]    ] += m0[0];
-        base[align * offset[0] + 1] += m1[0];
-        base[align * offset[0] + 2] += m2[0];
-        base[align * offset[1]    ] += m0[1];
-        base[align * offset[1] + 1] += m1[1];
-        base[align * offset[1] + 2] += m2[1];
-        base[align * offset[2]    ] += m0[2];
-        base[align * offset[2] + 1] += m1[2];
-        base[align * offset[2] + 2] += m2[2];
-        base[align * offset[3]    ] += m0[3];
-        base[align * offset[3] + 1] += m1[3];
-        base[align * offset[3] + 2] += m2[3];
-    }
-}
-
-template <int align>
-static inline void gmx_simdcall
-transposeScatterDecrU(double  *             base,
-                      const std::int32_t    offset[],
-                      SimdDouble            v0,
-                      SimdDouble            v1,
-                      SimdDouble            v2)
-{
-    if (align % 4 == 0)
-    {
-        // transpose
-        SimdDouble    v3(0.0);
-        vector4double t0 = vec_perm(v0.simdInternal_, v2.simdInternal_, vec_gpci(00415));
-        vector4double t1 = vec_perm(v0.simdInternal_, v2.simdInternal_, vec_gpci(02637));
-        vector4double t2 = vec_perm(v1.simdInternal_, v3.simdInternal_, vec_gpci(00415));
-        vector4double t3 = vec_perm(v1.simdInternal_, v3.simdInternal_, vec_gpci(02637));
-        v0.simdInternal_ = vec_perm(t0, t2, vec_gpci(00415));
-        v1.simdInternal_ = vec_perm(t0, t2, vec_gpci(02637));
-        v2.simdInternal_ = vec_perm(t1, t3, vec_gpci(00415));
-        v3.simdInternal_ = vec_perm(t1, t3, vec_gpci(02637));
-        // decrement
-        store(base + align*offset[0], simdLoad(base + align*offset[0]) - v0);
-        store(base + align*offset[1], simdLoad(base + align*offset[1]) - v1);
-        store(base + align*offset[2], simdLoad(base + align*offset[2]) - v2);
-        store(base + align*offset[3], simdLoad(base + align*offset[3]) - v3);
-    }
-    else
-    {
-        alignas(GMX_SIMD_ALIGNMENT) double   m0[GMX_SIMD_DOUBLE_WIDTH];
-        alignas(GMX_SIMD_ALIGNMENT) double   m1[GMX_SIMD_DOUBLE_WIDTH];
-        alignas(GMX_SIMD_ALIGNMENT) double   m2[GMX_SIMD_DOUBLE_WIDTH];
-
-        store(m0, v0);
-        store(m1, v1);
-        store(m2, v2);
-
-        base[align * offset[0]    ] -= m0[0];
-        base[align * offset[0] + 1] -= m1[0];
-        base[align * offset[0] + 2] -= m2[0];
-        base[align * offset[1]    ] -= m0[1];
-        base[align * offset[1] + 1] -= m1[1];
-        base[align * offset[1] + 2] -= m2[1];
-        base[align * offset[2]    ] -= m0[2];
-        base[align * offset[2] + 1] -= m1[2];
-        base[align * offset[2] + 2] -= m2[2];
-        base[align * offset[3]    ] -= m0[3];
-        base[align * offset[3] + 1] -= m1[3];
-        base[align * offset[3] + 2] -= m2[3];
-    }
-}
-
-static inline void gmx_simdcall
-expandScalarsToTriplets(SimdDouble    scalar,
-                        SimdDouble *  triplets0,
-                        SimdDouble *  triplets1,
-                        SimdDouble *  triplets2)
-{
-    triplets0->simdInternal_ = vec_perm(scalar.simdInternal_, scalar.simdInternal_, vec_gpci(00001));
-    triplets1->simdInternal_ = vec_perm(scalar.simdInternal_, scalar.simdInternal_, vec_gpci(01122));
-    triplets2->simdInternal_ = vec_perm(scalar.simdInternal_, scalar.simdInternal_, vec_gpci(02333));
-}
-
-template <int align>
-static inline void gmx_simdcall
-gatherLoadBySimdIntTranspose(const double  *  base,
-                             SimdDInt32       simdoffset,
-                             SimdDouble *     v0,
-                             SimdDouble *     v1,
-                             SimdDouble *     v2,
-                             SimdDouble *     v3)
-{
-    alignas(GMX_SIMD_ALIGNMENT) std::int32_t   ioffset[GMX_SIMD_DOUBLE_WIDTH];
-
-    store(ioffset, simdoffset);
-    gatherLoadTranspose<align>(base, ioffset, v0, v1, v2, v3);
-}
-
-template <int align>
-static inline void gmx_simdcall
-gatherLoadBySimdIntTranspose(const double  *  base,
-                             SimdDInt32       simdoffset,
-                             SimdDouble *     v0,
-                             SimdDouble *     v1)
-{
-    alignas(GMX_SIMD_ALIGNMENT) std::int32_t   ioffset[GMX_SIMD_DOUBLE_WIDTH];
-
-    store(ioffset, simdoffset);
-    gatherLoadTranspose<align>(base, ioffset, v0, v1);
-}
-
-static inline double gmx_simdcall
-reduceIncr4ReturnSum(double  *   m,
-                     SimdDouble  v0,
-                     SimdDouble  v1,
-                     SimdDouble  v2,
-                     SimdDouble  v3)
-{
-    vector4double t0 = vec_perm(v0.simdInternal_, v2.simdInternal_, vec_gpci(00415));
-    vector4double t1 = vec_perm(v0.simdInternal_, v2.simdInternal_, vec_gpci(02637));
-    vector4double t2 = vec_perm(v1.simdInternal_, v3.simdInternal_, vec_gpci(00415));
-    vector4double t3 = vec_perm(v1.simdInternal_, v3.simdInternal_, vec_gpci(02637));
-    v0.simdInternal_ = vec_perm(t0, t2, vec_gpci(00415));
-    v1.simdInternal_ = vec_perm(t0, t2, vec_gpci(02637));
-    v2.simdInternal_ = vec_perm(t1, t3, vec_gpci(00415));
-    v3.simdInternal_ = vec_perm(t1, t3, vec_gpci(02637));
-
-    v0 = v0 + v1;
-    v2 = v2 + v3;
-    v0 = v0 + v2;
-    v2 = v0 + simdLoad(m);
-    store(m, v2);
-
-    return reduce(v0);
-}
-
-}      // namespace gmx
-
-#endif // GMX_SIMD_IMPLEMENTATION_IBM_QPX_UTIL_DOUBLE_H
diff --git a/src/gromacs/simd/impl_ibm_qpx/impl_ibm_qpx_util_float.h b/src/gromacs/simd/impl_ibm_qpx/impl_ibm_qpx_util_float.h
deleted file mode 100644 (file)
index c3b3d9c..0000000
+++ /dev/null
@@ -1,336 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 2014,2015,2016,2017, by the GROMACS development team, led by
- * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
- * and including many others, as listed in the AUTHORS file in the
- * top-level source directory and at http://www.gromacs.org.
- *
- * GROMACS is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * GROMACS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GROMACS; if not, see
- * http://www.gnu.org/licenses, or write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
- *
- * If you want to redistribute modifications to GROMACS, please
- * consider that scientific software is very special. Version
- * control is crucial - bugs must be traceable. We will be happy to
- * consider code for inclusion in the official distribution, but
- * derived work must not be called official GROMACS. Details are found
- * in the README & COPYING files - if they are missing, get the
- * official version at http://www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the research papers on the package. Check out http://www.gromacs.org.
- */
-
-#ifndef GMX_SIMD_IMPLEMENTATION_IBM_QPX_UTIL_FLOAT_H
-#define GMX_SIMD_IMPLEMENTATION_IBM_QPX_UTIL_FLOAT_H
-
-#include "config.h"
-
-// Assert is buggy on xlc with high optimization, so we skip it for QPX
-#include <cstddef>
-#include <cstdint>
-
-#ifdef __clang__
-#    include <qpxmath.h>
-#endif
-
-#include "gromacs/utility/basedefinitions.h"
-
-#include "impl_ibm_qpx_simd_float.h"
-
-namespace gmx
-{
-
-template <int align>
-static inline void gmx_simdcall
-gatherLoadTranspose(const float *        base,
-                    const std::int32_t   offset[],
-                    SimdFloat *          v0,
-                    SimdFloat *          v1,
-                    SimdFloat *          v2,
-                    SimdFloat *          v3)
-{
-    v0->simdInternal_ = vec_ld(0, const_cast<float *>(base + align * offset[0]) );
-    v1->simdInternal_ = vec_ld(0, const_cast<float *>(base + align * offset[1]) );
-    v2->simdInternal_ = vec_ld(0, const_cast<float *>(base + align * offset[2]) );
-    v3->simdInternal_ = vec_ld(0, const_cast<float *>(base + align * offset[3]) );
-
-    vector4double t0 = vec_perm(v0->simdInternal_, v2->simdInternal_, vec_gpci(00415));
-    vector4double t1 = vec_perm(v0->simdInternal_, v2->simdInternal_, vec_gpci(02637));
-    vector4double t2 = vec_perm(v1->simdInternal_, v3->simdInternal_, vec_gpci(00415));
-    vector4double t3 = vec_perm(v1->simdInternal_, v3->simdInternal_, vec_gpci(02637));
-    v0->simdInternal_ = vec_perm(t0, t2, vec_gpci(00415));
-    v1->simdInternal_ = vec_perm(t0, t2, vec_gpci(02637));
-    v2->simdInternal_ = vec_perm(t1, t3, vec_gpci(00415));
-    v3->simdInternal_ = vec_perm(t1, t3, vec_gpci(02637));
-}
-
-template <int align>
-static inline void gmx_simdcall
-gatherLoadTranspose(const float *        base,
-                    const std::int32_t   offset[],
-                    SimdFloat *          v0,
-                    SimdFloat *          v1)
-{
-    vector4double t0, t1, t2, t3;
-
-    t0                = vec_ld2(0, const_cast<float *>(base + align * offset[0]) );
-    t1                = vec_ld2(0, const_cast<float *>(base + align * offset[1]) );
-    t2                = vec_ld2(0, const_cast<float *>(base + align * offset[2]) );
-    t3                = vec_ld2(0, const_cast<float *>(base + align * offset[3]) );
-    t0                = vec_perm(t0, t2, vec_gpci(00415));
-    t1                = vec_perm(t1, t3, vec_gpci(00415));
-    v0->simdInternal_ = vec_perm(t0, t1, vec_gpci(00415));
-    v1->simdInternal_ = vec_perm(t0, t1, vec_gpci(02637));
-}
-
-static const int c_simdBestPairAlignmentFloat = 2;
-
-template <int align>
-static inline void gmx_simdcall
-gatherLoadUTranspose(const float *        base,
-                     const std::int32_t   offset[],
-                     SimdFloat *          v0,
-                     SimdFloat *          v1,
-                     SimdFloat *          v2)
-{
-    vector4double             t1, t2, t3, t4, t5, t6, t7, t8;
-
-    if (align % 4 == 0)
-    {
-        SimdFloat t3;
-        gatherLoadTranspose<align>(base, offset, v0, v1, v2, &t3);
-    }
-    else
-    {
-        t1  = vec_perm(vec_splats(base[align * offset[0]]), vec_splats(base[align * offset[0] + 1]), vec_gpci(00415));
-        t2  = vec_perm(vec_splats(base[align * offset[1]]), vec_splats(base[align * offset[1] + 1]), vec_gpci(00415));
-        t3  = vec_perm(vec_splats(base[align * offset[2]]), vec_splats(base[align * offset[2] + 1]), vec_gpci(00415));
-        t4  = vec_perm(vec_splats(base[align * offset[3]]), vec_splats(base[align * offset[3] + 1]), vec_gpci(00415));
-
-        t5  = vec_splats( *(base + align * offset[0] + 2) );
-        t6  = vec_splats( *(base + align * offset[1] + 2) );
-        t7  = vec_splats( *(base + align * offset[2] + 2) );
-        t8  = vec_splats( *(base + align * offset[3] + 2) );
-
-        t1                = vec_perm(t1, t2, vec_gpci(00415));
-        t3                = vec_perm(t3, t4, vec_gpci(00415));
-        v0->simdInternal_ = vec_perm(t1, t3, vec_gpci(00145));
-        v1->simdInternal_ = vec_perm(t3, t1, vec_gpci(06723));
-        t5                = vec_perm(t5, t6, vec_gpci(00415));
-        t7                = vec_perm(t7, t8, vec_gpci(00415));
-        v2->simdInternal_ = vec_perm(t5, t7, vec_gpci(00145));
-    }
-}
-
-template <int align>
-static inline void gmx_simdcall
-transposeScatterStoreU(float *              base,
-                       const std::int32_t   offset[],
-                       SimdFloat            v0,
-                       SimdFloat            v1,
-                       SimdFloat            v2)
-{
-    alignas(GMX_SIMD_ALIGNMENT) float   m0[GMX_SIMD_FLOAT_WIDTH];
-    alignas(GMX_SIMD_ALIGNMENT) float   m1[GMX_SIMD_FLOAT_WIDTH];
-    alignas(GMX_SIMD_ALIGNMENT) float   m2[GMX_SIMD_FLOAT_WIDTH];
-
-    store(m0, v0);
-    store(m1, v1);
-    store(m2, v2);
-
-    base[align * offset[0]    ] = m0[0];
-    base[align * offset[0] + 1] = m1[0];
-    base[align * offset[0] + 2] = m2[0];
-    base[align * offset[1]    ] = m0[1];
-    base[align * offset[1] + 1] = m1[1];
-    base[align * offset[1] + 2] = m2[1];
-    base[align * offset[2]    ] = m0[2];
-    base[align * offset[2] + 1] = m1[2];
-    base[align * offset[2] + 2] = m2[2];
-    base[align * offset[3]    ] = m0[3];
-    base[align * offset[3] + 1] = m1[3];
-    base[align * offset[3] + 2] = m2[3];
-}
-
-template <int align>
-static inline void gmx_simdcall
-transposeScatterIncrU(float *              base,
-                      const std::int32_t   offset[],
-                      SimdFloat            v0,
-                      SimdFloat            v1,
-                      SimdFloat            v2)
-{
-    if (align % 4 == 0)
-    {
-        // transpose
-        SimdFloat     v3(0.0);
-        vector4double t0 = vec_perm(v0.simdInternal_, v2.simdInternal_, vec_gpci(00415));
-        vector4double t1 = vec_perm(v0.simdInternal_, v2.simdInternal_, vec_gpci(02637));
-        vector4double t2 = vec_perm(v1.simdInternal_, v3.simdInternal_, vec_gpci(00415));
-        vector4double t3 = vec_perm(v1.simdInternal_, v3.simdInternal_, vec_gpci(02637));
-        v0.simdInternal_ = vec_perm(t0, t2, vec_gpci(00415));
-        v1.simdInternal_ = vec_perm(t0, t2, vec_gpci(02637));
-        v2.simdInternal_ = vec_perm(t1, t3, vec_gpci(00415));
-        v3.simdInternal_ = vec_perm(t1, t3, vec_gpci(02637));
-        // increment
-        store(base + align*offset[0], simdLoad(base + align*offset[0]) + v0);
-        store(base + align*offset[1], simdLoad(base + align*offset[1]) + v1);
-        store(base + align*offset[2], simdLoad(base + align*offset[2]) + v2);
-        store(base + align*offset[3], simdLoad(base + align*offset[3]) + v3);
-    }
-    else
-    {
-        alignas(GMX_SIMD_ALIGNMENT) float   m0[GMX_SIMD_FLOAT_WIDTH];
-        alignas(GMX_SIMD_ALIGNMENT) float   m1[GMX_SIMD_FLOAT_WIDTH];
-        alignas(GMX_SIMD_ALIGNMENT) float   m2[GMX_SIMD_FLOAT_WIDTH];
-
-        store(m0, v0);
-        store(m1, v1);
-        store(m2, v2);
-
-        base[align * offset[0]    ] += m0[0];
-        base[align * offset[0] + 1] += m1[0];
-        base[align * offset[0] + 2] += m2[0];
-        base[align * offset[1]    ] += m0[1];
-        base[align * offset[1] + 1] += m1[1];
-        base[align * offset[1] + 2] += m2[1];
-        base[align * offset[2]    ] += m0[2];
-        base[align * offset[2] + 1] += m1[2];
-        base[align * offset[2] + 2] += m2[2];
-        base[align * offset[3]    ] += m0[3];
-        base[align * offset[3] + 1] += m1[3];
-        base[align * offset[3] + 2] += m2[3];
-    }
-}
-
-template <int align>
-static inline void gmx_simdcall
-transposeScatterDecrU(float *              base,
-                      const std::int32_t   offset[],
-                      SimdFloat            v0,
-                      SimdFloat            v1,
-                      SimdFloat            v2)
-{
-    if (align % 4 == 0)
-    {
-        // transpose
-        SimdFloat     v3(0.0);
-        vector4double t0 = vec_perm(v0.simdInternal_, v2.simdInternal_, vec_gpci(00415));
-        vector4double t1 = vec_perm(v0.simdInternal_, v2.simdInternal_, vec_gpci(02637));
-        vector4double t2 = vec_perm(v1.simdInternal_, v3.simdInternal_, vec_gpci(00415));
-        vector4double t3 = vec_perm(v1.simdInternal_, v3.simdInternal_, vec_gpci(02637));
-        v0.simdInternal_ = vec_perm(t0, t2, vec_gpci(00415));
-        v1.simdInternal_ = vec_perm(t0, t2, vec_gpci(02637));
-        v2.simdInternal_ = vec_perm(t1, t3, vec_gpci(00415));
-        v3.simdInternal_ = vec_perm(t1, t3, vec_gpci(02637));
-        // decrement
-        store(base + align*offset[0], simdLoad(base + align*offset[0]) - v0);
-        store(base + align*offset[1], simdLoad(base + align*offset[1]) - v1);
-        store(base + align*offset[2], simdLoad(base + align*offset[2]) - v2);
-        store(base + align*offset[3], simdLoad(base + align*offset[3]) - v3);
-    }
-    else
-    {
-        alignas(GMX_SIMD_ALIGNMENT) float   m0[GMX_SIMD_FLOAT_WIDTH];
-        alignas(GMX_SIMD_ALIGNMENT) float   m1[GMX_SIMD_FLOAT_WIDTH];
-        alignas(GMX_SIMD_ALIGNMENT) float   m2[GMX_SIMD_FLOAT_WIDTH];
-
-        store(m0, v0);
-        store(m1, v1);
-        store(m2, v2);
-
-        base[align * offset[0]    ] -= m0[0];
-        base[align * offset[0] + 1] -= m1[0];
-        base[align * offset[0] + 2] -= m2[0];
-        base[align * offset[1]    ] -= m0[1];
-        base[align * offset[1] + 1] -= m1[1];
-        base[align * offset[1] + 2] -= m2[1];
-        base[align * offset[2]    ] -= m0[2];
-        base[align * offset[2] + 1] -= m1[2];
-        base[align * offset[2] + 2] -= m2[2];
-        base[align * offset[3]    ] -= m0[3];
-        base[align * offset[3] + 1] -= m1[3];
-        base[align * offset[3] + 2] -= m2[3];
-    }
-}
-
-static inline void gmx_simdcall
-expandScalarsToTriplets(SimdFloat    scalar,
-                        SimdFloat *  triplets0,
-                        SimdFloat *  triplets1,
-                        SimdFloat *  triplets2)
-{
-    triplets0->simdInternal_ = vec_perm(scalar.simdInternal_, scalar.simdInternal_, vec_gpci(00001));
-    triplets1->simdInternal_ = vec_perm(scalar.simdInternal_, scalar.simdInternal_, vec_gpci(01122));
-    triplets2->simdInternal_ = vec_perm(scalar.simdInternal_, scalar.simdInternal_, vec_gpci(02333));
-}
-
-template <int align>
-static inline void gmx_simdcall
-gatherLoadBySimdIntTranspose(const float *  base,
-                             SimdFInt32     simdoffset,
-                             SimdFloat *    v0,
-                             SimdFloat *    v1,
-                             SimdFloat *    v2,
-                             SimdFloat *    v3)
-{
-    alignas(GMX_SIMD_ALIGNMENT) int     ioffset[GMX_SIMD_FLOAT_WIDTH];
-
-    store(ioffset, simdoffset);
-    gatherLoadTranspose<align>(base, ioffset, v0, v1, v2, v3);
-}
-
-template <int align>
-static inline void gmx_simdcall
-gatherLoadBySimdIntTranspose(const float *   base,
-                             SimdFInt32      simdoffset,
-                             SimdFloat *     v0,
-                             SimdFloat *     v1)
-{
-    alignas(GMX_SIMD_ALIGNMENT) int   ioffset[GMX_SIMD_FLOAT_WIDTH];
-
-    store(ioffset, simdoffset);
-    gatherLoadTranspose<align>(base, ioffset, v0, v1);
-}
-
-static inline float gmx_simdcall
-reduceIncr4ReturnSum(float *    m,
-                     SimdFloat  v0,
-                     SimdFloat  v1,
-                     SimdFloat  v2,
-                     SimdFloat  v3)
-{
-    vector4double t0 = vec_perm(v0.simdInternal_, v2.simdInternal_, vec_gpci(00415));
-    vector4double t1 = vec_perm(v0.simdInternal_, v2.simdInternal_, vec_gpci(02637));
-    vector4double t2 = vec_perm(v1.simdInternal_, v3.simdInternal_, vec_gpci(00415));
-    vector4double t3 = vec_perm(v1.simdInternal_, v3.simdInternal_, vec_gpci(02637));
-    v0.simdInternal_ = vec_perm(t0, t2, vec_gpci(00415));
-    v1.simdInternal_ = vec_perm(t0, t2, vec_gpci(02637));
-    v2.simdInternal_ = vec_perm(t1, t3, vec_gpci(00415));
-    v3.simdInternal_ = vec_perm(t1, t3, vec_gpci(02637));
-
-    v0 = v0 + v1;
-    v2 = v2 + v3;
-    v0 = v0 + v2;
-    v2 = v0 + simdLoad(m);
-    store(m, v2);
-
-    return reduce(v0);
-}
-
-}      // namespace gmx
-
-#endif // GMX_SIMD_IMPLEMENTATION_IBM_QPX_UTIL_FLOAT_H
index 1878d2ac70752f70a8354425c4e6b2c5dbfea42c..3400c8097751ca7e07f5437a82c8865ef11fa3ae 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
index e4edc8dc34a0975c28a1e83e991ce861dbba7d45..3fc3aaa11793788034fad448e698d22e2bb091b4 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
index 6f49d8a9c580f6ff09216c1c3c1c86e766e9ad15..e69fd33c3999c521c4361e4488d0a1a43b18f5f3 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
index b55c2a63c45f3f4a2bc912d8be76b87e31891b2e..cac223614108adf8e2540451859665768a43d3c4 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 // but there double precision seems to work fine.
 #if defined(__ibmxl__) || defined(__xlC__) || !(defined(__GNUC__) && ((__GNUC__ < 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ < 9))))
 #    define GMX_SIMD_HAVE_DOUBLE                1
-#    define GMX_SIMD_HAVE_DINT32                1
 #    define GMX_SIMD_HAVE_DINT32_EXTRACT        1
 #    define GMX_SIMD_HAVE_DINT32_LOGICAL        1
 #    define GMX_SIMD_HAVE_DINT32_ARITHMETICS    1
 #    define GMX_SIMD_HAVE_GATHER_LOADU_BYSIMDINT_TRANSPOSE_DOUBLE   1
 #else
 #    define GMX_SIMD_HAVE_DOUBLE                0
-#    define GMX_SIMD_HAVE_DINT32                0
 #    define GMX_SIMD_HAVE_DINT32_EXTRACT        0
 #    define GMX_SIMD_HAVE_DINT32_LOGICAL        0
 #    define GMX_SIMD_HAVE_DINT32_ARITHMETICS    0
index d5745bf631e2e955dd56632976236b0208c62035..d413a5c73321fe9f883cffb1676d6756200e9eee 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
index d85b0ca5ae6e2973cafdacf98f1a8956d0b6bfc0..50e8ce8ad6aa763713e9fea9e04eb4120bf50e7e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
index 7688e571d5defa9052c62ac57ff5f2ac37e38c7e..b85fcc282566f598db3d7c3f89e3d9ae9e693a82 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #define GMX_SIMD_HAVE_STOREU                0
 #define GMX_SIMD_HAVE_LOGICAL               0
 #define GMX_SIMD_HAVE_FMA                   0
-#define GMX_SIMD_HAVE_FRACTION              0
-#define GMX_SIMD_HAVE_FINT32                0
 #define GMX_SIMD_HAVE_FINT32_EXTRACT        0
 #define GMX_SIMD_HAVE_FINT32_LOGICAL        0
 #define GMX_SIMD_HAVE_FINT32_ARITHMETICS    0
-#define GMX_SIMD_HAVE_DINT32                0
 #define GMX_SIMD_HAVE_DINT32_EXTRACT        0
 #define GMX_SIMD_HAVE_DINT32_LOGICAL        0
 #define GMX_SIMD_HAVE_DINT32_ARITHMETICS    0
index ac6f9120a49f8694cd59cfe8e7434fa5580fb856..f0f6e4e735f541801c7f966ad62b7397c5a60dc1 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
index 302cc6b15aade1c9caec58a702fd27f2964ada24..482886033dbfdfc73feec3e14d471cbabbc2e009 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #define GMX_SIMD_HAVE_STOREU                     0
 #define GMX_SIMD_HAVE_LOGICAL                    1
 #define GMX_SIMD_HAVE_FMA                        1
-#define GMX_SIMD_HAVE_FRACTION                   0
-#define GMX_SIMD_HAVE_FINT32                     1
 #define GMX_SIMD_HAVE_FINT32_EXTRACT             1
 #define GMX_SIMD_HAVE_FINT32_LOGICAL             1
 #define GMX_SIMD_HAVE_FINT32_ARITHMETICS         0
-#define GMX_SIMD_HAVE_DINT32                     1
 #define GMX_SIMD_HAVE_DINT32_EXTRACT             1
 #define GMX_SIMD_HAVE_DINT32_LOGICAL             1
 #define GMX_SIMD_HAVE_DINT32_ARITHMETICS         0
index 86f30dab090056d595d898714cd00e2adb3f1bc6..b44204bddc61f23b54553cea6ae1c02108579364 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
index a8ab2b4f308d7404e5afbf084240c5abccd82732..da2d146cda035895730b32132ea968a9c0c3a6a9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
index ab8f533ce366e20d1f1de664775074c31ab99574..a3d53e64617bf4b71a808f42ce78821c2943974b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
index 72e7ce98784055b6ea5d2361ea51970572517e1a..106ba1c3e69c010ad7b9ed543110739c76837aa9 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
index 23f43c988ba7250a4e44c5dca48bf196e3b117ea..241c612e12205a60aca4f6adadee61907a0a9227 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
index 2d19218593a1440328cb01cb852a2de73153d1b3..f96fe28ce12f964391bd9a0352af08fcda32d2f6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
index a27ea2c628b21e35626625bbb48d9be578639f5c..27e1c807c8151095f57f57cae6fbdb6b1dbd8c68 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #define GMX_SIMD_HAVE_STOREU                       1
 #define GMX_SIMD_HAVE_LOGICAL                      1
 #define GMX_SIMD_HAVE_FMA                          1
-#define GMX_SIMD_HAVE_FRACTION                     0
-#define GMX_SIMD_HAVE_FINT32                       1
 #define GMX_SIMD_HAVE_FINT32_EXTRACT               0
 #define GMX_SIMD_HAVE_FINT32_LOGICAL               1
 #define GMX_SIMD_HAVE_FINT32_ARITHMETICS           1
-#define GMX_SIMD_HAVE_DINT32                       1
 // Technically it is straightforward to emulate extract on AVX-512 through
 // memory operations, but when applied to 16 elements as part of a table lookup
 // it will be faster to just store the entire vector once, so we avoid setting it.
 #define GMX_SIMD_HAVE_DINT32_EXTRACT               0
 #define GMX_SIMD_HAVE_DINT32_LOGICAL               1
 #define GMX_SIMD_HAVE_DINT32_ARITHMETICS           1
-#define GMX_SIMD_HAVE_NATIVE_COPYSIGN_FLOAT        0
+#define GMX_SIMD_HAVE_NATIVE_COPYSIGN_FLOAT        1
 #define GMX_SIMD_HAVE_NATIVE_RSQRT_ITER_FLOAT      0
 #define GMX_SIMD_HAVE_NATIVE_RCP_ITER_FLOAT        0
 #define GMX_SIMD_HAVE_NATIVE_LOG_FLOAT             0
 #define GMX_SIMD_HAVE_NATIVE_EXP2_FLOAT            0
 #define GMX_SIMD_HAVE_NATIVE_EXP_FLOAT             0
-#define GMX_SIMD_HAVE_NATIVE_COPYSIGN_DOUBLE       0
+#define GMX_SIMD_HAVE_NATIVE_COPYSIGN_DOUBLE       1
 #define GMX_SIMD_HAVE_NATIVE_RSQRT_ITER_DOUBLE     0
 #define GMX_SIMD_HAVE_NATIVE_RCP_ITER_DOUBLE       0
 #define GMX_SIMD_HAVE_NATIVE_LOG_DOUBLE            0
index bd518e2328fc9d5327af1a506061d60241aeb6ad..0aa73524a6ed7cd9190bc1d1f5edc7474b6deb1f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -508,6 +508,17 @@ blend(SimdDouble a, SimdDouble b, SimdDBool sel)
     };
 }
 
+static inline SimdDouble gmx_simdcall
+copysign(SimdDouble a, SimdDouble b)
+{
+    return {
+               _mm512_castsi512_pd(_mm512_ternarylogic_epi64(
+                                           _mm512_castpd_si512(a.simdInternal_),
+                                           _mm512_castpd_si512(b.simdInternal_),
+                                           _mm512_set1_epi64(INT64_MIN), 0xD8))
+    };
+}
+
 static inline SimdDInt32 gmx_simdcall
 operator&(SimdDInt32 a, SimdDInt32 b)
 {
index bb3cbbd3685993c7c2a0b052b43f2e5a67e0844d..6f5b482117f7fb80835c142ea171753876d28410 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -510,6 +510,17 @@ blend(SimdFloat a, SimdFloat b, SimdFBool sel)
     };
 }
 
+static inline SimdFloat gmx_simdcall
+copysign(SimdFloat a, SimdFloat b)
+{
+    return {
+               _mm512_castsi512_ps(_mm512_ternarylogic_epi32(
+                                           _mm512_castps_si512(a.simdInternal_),
+                                           _mm512_castps_si512(b.simdInternal_),
+                                           _mm512_set1_epi32(INT32_MIN), 0xD8))
+    };
+}
+
 static inline SimdFInt32 gmx_simdcall
 operator&(SimdFInt32 a, SimdFInt32 b)
 {
index ada37e237c24fa739fbc80c0cd974c970d794d8c..2cd9324b6e9b4858ab04c5ca1c1630578b2fc8f4 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #define GMX_SIMD_HAVE_STOREU                       1
 #define GMX_SIMD_HAVE_LOGICAL                      1
 #define GMX_SIMD_HAVE_FMA                          1
-#define GMX_SIMD_HAVE_FRACTION                     0
-#define GMX_SIMD_HAVE_FINT32                       1
 #define GMX_SIMD_HAVE_FINT32_EXTRACT               0
 #define GMX_SIMD_HAVE_FINT32_LOGICAL               1
 #define GMX_SIMD_HAVE_FINT32_ARITHMETICS           1
-#define GMX_SIMD_HAVE_DINT32                       1
 // Technically it is straightforward to emulate extract on AVX-512F through
 // memory operations, but when applied to 16 elements as part of a table lookup
 // it will be faster to just store the entire vector once, so we avoid setting it.
index c6135c66aba0d7e915323f83db1daeb59ebb9bbf..628ee88fbf3a8a5f4896f19494d344d005fc6d43 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #define GMX_SIMD_HAVE_STOREU                       1
 #define GMX_SIMD_HAVE_LOGICAL                      1
 #define GMX_SIMD_HAVE_FMA                          1
-#define GMX_SIMD_HAVE_FRACTION                     0
-#define GMX_SIMD_HAVE_FINT32                       1
 #define GMX_SIMD_HAVE_FINT32_EXTRACT               1
 #define GMX_SIMD_HAVE_FINT32_LOGICAL               1
 #define GMX_SIMD_HAVE_FINT32_ARITHMETICS           1
-#define GMX_SIMD_HAVE_DINT32                       1
 #define GMX_SIMD_HAVE_DINT32_EXTRACT               1
 #define GMX_SIMD_HAVE_DINT32_LOGICAL               1
 #define GMX_SIMD_HAVE_DINT32_ARITHMETICS           1
index 9904fc5fd932b8431543ffc4b00e209f7dcfd0a4..e6d6679818e952434830ec46f6314411eb624323 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
index 036ff2fb881edac474bb40ebdcf247f3f5365ab8..b766e1b444b5eee2936b93f7542fb3daf4ed4095 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
index 0cc62e9de15cb58df39e696d20064dd553a3dfa4..85128bb0dcd7ec6975cff1eb50473910482dc4f2 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
index 4acf483065d8480e1a86c83c51e7a0dedd50405b..53bcaffc8a8762e5716ab4bdec9bc6d89cddd94a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
index e9282ac57bfa38a2aa354e2377a407225a960a5b..0d5d3f48b95e7a6b55b9105e62ca1c594396dd1f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
index 673cfa336950c63430e671962a9f9b51b987339a..a7ff54e1b418c257f106afa46ae7ad74d921937a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -130,8 +130,6 @@ struct SimdDInt32Tag {};
 #    include "impl_arm_neon/impl_arm_neon.h"
 #elif GMX_SIMD_ARM_NEON_ASIMD
 #    include "impl_arm_neon_asimd/impl_arm_neon_asimd.h"
-#elif GMX_SIMD_IBM_QPX
-#    include "impl_ibm_qpx/impl_ibm_qpx.h"
 #elif GMX_SIMD_IBM_VMX
 #    include "impl_ibm_vmx/impl_ibm_vmx.h"
 #elif GMX_SIMD_IBM_VSX
index 207b1b784a2d6b5c5bc9df136ea138a206aed8dc..a45ba4b84d2bb092e676c5f6c4babe00747b8108 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
index aeae0cd5f940510b76408bf6aa83e778bcbba5e8..89a5d64eb7976f12b18b3283ca048aa0be80d7d5 100644 (file)
@@ -270,18 +270,6 @@ class ArrayRef<const SimdFloat> : public internal::SimdArrayRef<const SimdFloat>
     using Base = internal::SimdArrayRef<const SimdFloat>;
     using Base::Base;
 };
-template<>
-class ArrayRef<SimdFInt32> : public internal::SimdArrayRef<SimdFInt32>
-{
-    using Base = internal::SimdArrayRef<SimdFInt32>;
-    using Base::Base;
-};
-template<>
-class ArrayRef<const SimdFInt32> : public internal::SimdArrayRef<const SimdFInt32>
-{
-    using Base = internal::SimdArrayRef<const SimdFInt32>;
-    using Base::Base;
-};
 #endif
 #if GMX_SIMD_HAVE_DOUBLE
 template<>
@@ -296,18 +284,6 @@ class ArrayRef<const SimdDouble> : public internal::SimdArrayRef<const SimdDoubl
     using Base = internal::SimdArrayRef<const SimdDouble>;
     using Base::Base;
 };
-template<>
-class ArrayRef<SimdDInt32> : public internal::SimdArrayRef<SimdDInt32>
-{
-    using Base = internal::SimdArrayRef<SimdDInt32>;
-    using Base::Base;
-};
-template<>
-class ArrayRef<const SimdDInt32> : public internal::SimdArrayRef<const SimdDInt32>
-{
-    using Base = internal::SimdArrayRef<const SimdDInt32>;
-    using Base::Base;
-};
 #endif
 
 } // namespace gmx
index f372eb946d8312a3c9b95ff636576a46d631189e..9525a054bd8cdca3d8454559e1573263dfe97ff7 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -82,7 +82,6 @@ simdString(SimdType s)
         { SimdType::X86_Mic,        "X86_MIC"         },
         { SimdType::Arm_Neon,       "ARM_NEON"        },
         { SimdType::Arm_NeonAsimd,  "ARM_NEON_ASIMD"  },
-        { SimdType::Ibm_Qpx,        "IBM_QPX"         },
         { SimdType::Ibm_Vmx,        "IBM_VMX"         },
         { SimdType::Ibm_Vsx,        "IBM_VSX"         },
         { SimdType::Fujitsu_HpcAce, "Fujitsu HPC-ACE" }
@@ -176,10 +175,6 @@ simdSuggested(const CpuInfo &c)
                 {
                     suggested = SimdType::Ibm_Vmx;
                 }
-                else if (c.feature(CpuInfo::Feature::Ibm_Qpx))
-                {
-                    suggested = SimdType::Ibm_Qpx;
-                }
                 break;
             case CpuInfo::Vendor::Fujitsu:
                 if (c.feature(CpuInfo::Feature::Fujitsu_HpcAce))
@@ -219,8 +214,6 @@ simdCompiled()
     return SimdType::Arm_Neon;
 #elif GMX_SIMD_ARM_NEON_ASIMD
     return SimdType::Arm_NeonAsimd;
-#elif GMX_SIMD_IBM_QPX
-    return SimdType::Ibm_Qpx;
 #elif GMX_SIMD_IBM_VMX
     return SimdType::Ibm_Vmx;
 #elif GMX_SIMD_IBM_VSX
index 5e223804ee893d8c9183db6a8a7003a78b0b31aa..44a84dbf85c613b87971c51511e02b4cc28fe8b2 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -70,7 +70,6 @@ enum class SimdType
     X86_Mic,        //!< Knight's corner
     Arm_Neon,       //!< 32-bit ARM NEON
     Arm_NeonAsimd,  //!< 64-bit ARM AArch64 Advanced SIMD
-    Ibm_Qpx,        //!< IBM QPX SIMD (BlueGene/Q and later)
     Ibm_Vmx,        //!< IBM VMX SIMD (Altivec on Power6 and later)
     Ibm_Vsx,        //!< IBM VSX SIMD (Power7 and later)
     Fujitsu_HpcAce  //!< Fujitsu K-computer
index 1ffe38a48c8d00d327706815526ffc8247fadae9..bb9307f3c7cf80e633e1d92fd4dbcb3ef9471db6 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
index 3de3c0e4b3e19a124558e0ff3e792d438c6382f0..8655f64dcd5c381adc22cc040e8d91ee007a68d8 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
index efa57f3589ebee1bffd16aadc828111478151869..b4d08f4c5858ec6aa6895f301428957a8da2049a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
index ba915941009e7758239c44399f772efdd785ecef..86858d67b88f765da4752d8b21536e6dc1e1014e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
index 50e8687fcdb38eccc2e61a1e9f60d195131c4107..451dadd7dcc90636370a8cfe6c0eefa55c500305 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
index 2c57354c9bb70dcf969f173d910769422ceaa15a..825df83b6fdd07565eb5d5126a287b0681f6ae92 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
index c229fb37c8696fe553e24763b219a3c8c1f62d5d..a957201707558482654eba9faa837c9bf9862b15 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
index 594827d84d4b943d2c44143a62f8534ac5f5e503..b2a99ecd780ab7853a74ac09aa1ac2ce9d29a7d1 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
index 5eddd563ab1bb2c855b299c2bc49ee63e47174db..e30c014c9d2cf0489816450208815a46b148643b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
index 24aab65dbc8830bc1a4d0f345318c750edbfb724..47529122e77a0b064853e245984e5ca919a98d0e 100644 (file)
 namespace gmx
 {
 
-namespace
+#if GMX_SIMD_HAVE_REAL
+
+/* SimdInt32 is a strange type which would never belong in an interface,
+ * because its properties are peculiar to int-to-float conversions within
+ * SIMD types, so there is no need to support it as a specialization of
+ * SimdArrayRef. But it is useful here for better test coverage of
+ * SimdArrayRef. */
+
+template<>
+class ArrayRef<SimdInt32> : public internal::SimdArrayRef<SimdInt32>
 {
+    using Base = internal::SimdArrayRef<SimdInt32>;
+    using Base::Base;
+};
+template<>
+class ArrayRef<const SimdInt32> : public internal::SimdArrayRef<const SimdInt32>
+{
+    using Base = internal::SimdArrayRef<const SimdInt32>;
+    using Base::Base;
+};
 
-#if GMX_SIMD_HAVE_REAL
+namespace
+{
 
 TEST(EmptyArrayRefTest, IsEmpty)
 {
@@ -222,8 +241,8 @@ TYPED_TEST(ArrayRefArithmeticTest, Basic)
 
 #endif // GTEST_HAS_TYPED_TEST
 
-#endif // GMX_HAVE_SIMD_REAL
-
 }      // namespace
 
-}      // namespace
+#endif // GMX_HAVE_SIMD_REAL
+
+}      // namespace gmx
index 8bcb4cf06bbf3a6ceb686a84af813734bda2cb50..da94daf08cd2e61cf329938a86f5569d6158b419 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
index 02fbae5d69a654ddb005711423ec041f14266fe6..72e4c6399da3587e872627b21d9b2f9646ec7247 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
index cfd20340b9e391bdabf9fdc4e7d3d32a19a4a94c..6b2a87692f0f2a80fc0855c5dac040da396da023 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -1446,74 +1446,6 @@ t_forcetable *make_tables(FILE *out,
     return table;
 }
 
-t_forcetable *make_gb_table(const t_forcerec              *fr)
-{
-    t_tabledata    *td;
-    int             nx0;
-    double          r, r2, Vtab, Ftab, expterm;
-
-    t_forcetable   *table;
-
-    /* Set the table dimensions for GB, not really necessary to
-     * use etiNR (since we only have one table, but ...)
-     */
-    snew(table, 1);
-    snew(td, 1);
-    table->interaction   = GMX_TABLE_INTERACTION_ELEC;
-    table->format        = GMX_TABLE_FORMAT_CUBICSPLINE_YFGH;
-    table->r             = fr->gbtabr;
-    table->scale         = fr->gbtabscale;
-    table->n             = static_cast<int>(table->scale*table->r);
-    table->formatsize    = 4;
-    table->ninteractions = 1;
-    table->stride        = table->formatsize*table->ninteractions;
-    nx0                  = 0;
-
-    /* Each table type (e.g. coul,lj6,lj12) requires four numbers per
-     * datapoint. For performance reasons we want the table data to be
-     * aligned on a 32-byte boundary. This new pointer must not be
-     * used in a free() call, but thankfully we're sloppy enough not
-     * to do this :-)
-     */
-
-    snew_aligned(table->data, table->stride*table->n, 32);
-
-    init_table(table->n, nx0, table->scale, &(td[0]), TRUE);
-
-    /* Local implementation so we don't have to use the etabGB
-     * enum above, which will cause problems later when
-     * making the other tables (right now even though we are using
-     * GB, the normal Coulomb tables will be created, but this
-     * will cause a problem since fr->eeltype==etabGB which will not
-     * be defined in fill_table and set_table_type
-     */
-
-    for (int i = nx0; i < table->n; i++)
-    {
-        r       = td->x[i];
-        r2      = r*r;
-        expterm = exp(-0.25*r2);
-
-        Vtab = 1/sqrt(r2+expterm);
-        Ftab = (r-0.25*r*expterm)/((r2+expterm)*sqrt(r2+expterm));
-
-        /* Convert to single precision when we store to mem */
-        td->x[i]  = i/table->scale;
-        td->v[i]  = Vtab;
-        td->f[i]  = Ftab;
-
-    }
-
-    copy2table(table->n, 0, table->stride, td[0].x, td[0].v, td[0].f, 1.0, table->data);
-
-    done_tabledata(&(td[0]));
-    sfree(td);
-
-    return table;
-
-
-}
-
 bondedtable_t make_bonded_table(FILE *fplog, const char *fn, int angle)
 {
     t_tabledata   td;
index 7536f48d1b06446c87727cc6e4617cadda337905..73f765a3d684762b1c2bb3ab5dcf70137d612b51 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -143,13 +143,6 @@ t_forcetable *make_tables(FILE *fp,
  */
 bondedtable_t make_bonded_table(FILE *fplog, const char *fn, int angle);
 
-/*! \brief Return a table for GB calculations
- *
- * \param fr   Force record
- * \return     Pointer to new gb table structure
- */
-t_forcetable *make_gb_table(const t_forcerec              *fr);
-
 /*! \brief Construct and return tabulated dispersion and repulsion interactions
  *
  * This table can be used to compute long-range dispersion corrections */
index fe69828cf84c799a6349673ec50219dc4d053701..de4487ad985b4522026bde5c1bfe06d8c58b4c86 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
index a023ec1fe111ef582221832c7e7f0bbf9b133d4e..1eb0001429c56e7ea9ffe63b49456d5097b01bac 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
index 203a383ea55012458f48b5637900b84c8a0acb6e..afb40706b0188f445dfa14ee923658fa80043369 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
index 015c8b68575771e7f078ccbcaa897aef394b21c3..add2f55c7c3fb6c18f0ff8430e67101268313fca 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -793,11 +793,12 @@ void check_and_update_hw_opt_2(gmx_hw_opt_t *hw_opt,
     }
 }
 
-void checkAndUpdateRequestedNumOpenmpThreads(gmx_hw_opt_t        *hw_opt,
-                                             const gmx_hw_info_t &hwinfo,
-                                             const t_commrec     *cr,
-                                             PmeRunMode           pmeRunMode,
-                                             const gmx_mtop_t    &mtop)
+void checkAndUpdateRequestedNumOpenmpThreads(gmx_hw_opt_t         *hw_opt,
+                                             const gmx_hw_info_t  &hwinfo,
+                                             const t_commrec      *cr,
+                                             const gmx_multisim_t *ms,
+                                             PmeRunMode            pmeRunMode,
+                                             const gmx_mtop_t     &mtop)
 {
 #if GMX_THREAD_MPI
     GMX_RELEASE_ASSERT(hw_opt->nthreads_tmpi >= 1, "Must have at least one thread-MPI rank");
@@ -850,7 +851,7 @@ void checkAndUpdateRequestedNumOpenmpThreads(gmx_hw_opt_t        *hw_opt,
          * all detected ncore_tot physical cores. We are currently not
          * checking for that here.
          */
-        int numRanksTot     = cr->nnodes*(MULTISIM(cr) ? cr->ms->nsim : 1);
+        int numRanksTot     = cr->nnodes*(isMultiSim(ms) ? ms->nsim : 1);
         int numAtomsPerRank = mtop.natoms/cr->nnodes;
         int numCoresPerRank = hwinfo.ncore_tot/numRanksTot;
         if (numAtomsPerRank < c_numAtomsPerCoreSquaredSmtThreshold*gmx::square(numCoresPerRank))
@@ -878,6 +879,7 @@ void checkAndUpdateRequestedNumOpenmpThreads(gmx_hw_opt_t        *hw_opt,
 void checkHardwareOversubscription(int                          numThreadsOnThisRank,
                                    const gmx::HardwareTopology &hwTop,
                                    const t_commrec             *cr,
+                                   const gmx_multisim_t        *ms,
                                    const gmx::MDLogger         &mdlog)
 {
     if (hwTop.supportLevel() < gmx::HardwareTopology::SupportLevel::LogicalProcessorCount)
@@ -889,12 +891,14 @@ void checkHardwareOversubscription(int                          numThreadsOnThis
     int numRanksOnThisNode   = 1;
     int numThreadsOnThisNode = numThreadsOnThisRank;
 #if GMX_MPI
-    if (PAR(cr) || MULTISIM(cr))
+    if (PAR(cr) || isMultiSim(ms))
     {
         /* Count the threads within this physical node */
         MPI_Comm_size(cr->mpi_comm_physicalnode, &numRanksOnThisNode);
         MPI_Allreduce(&numThreadsOnThisRank, &numThreadsOnThisNode, 1, MPI_INT, MPI_SUM, cr->mpi_comm_physicalnode);
     }
+#else
+    GMX_UNUSED_VALUE(ms);
 #endif
 
     if (numThreadsOnThisNode > hwTop.machine().logicalProcessorCount)
index a2ef70feb01f002e0135e99da4d3fd556eb62363..4bd2447d9c1af76cf3df4d3751dbd2e5839eb9df 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -54,6 +54,7 @@
 struct gmx_hw_info_t;
 struct gmx_hw_opt_t;
 struct gmx_mtop_t;
+struct gmx_multisim_t;
 struct t_commrec;
 struct t_inputrec;
 
@@ -108,17 +109,19 @@ void check_and_update_hw_opt_2(gmx_hw_opt_t *hw_opt,
  *
  * Should be called when we know the MPI rank count and PME run mode.
  */
-void checkAndUpdateRequestedNumOpenmpThreads(gmx_hw_opt_t        *hw_opt,
-                                             const gmx_hw_info_t &hwinfo,
-                                             const t_commrec     *cr,
-                                             PmeRunMode           pmeRunMode,
-                                             const gmx_mtop_t    &mtop);
+void checkAndUpdateRequestedNumOpenmpThreads(gmx_hw_opt_t         *hw_opt,
+                                             const gmx_hw_info_t  &hwinfo,
+                                             const t_commrec      *cr,
+                                             const gmx_multisim_t *ms,
+                                             PmeRunMode            pmeRunMode,
+                                             const gmx_mtop_t     &mtop);
 
 /*! \brief Warns for oversubscribing the hardware threads, when that is the case
  */
 void checkHardwareOversubscription(int                          numThreadsOnThisRank,
                                    const gmx::HardwareTopology &hwTop,
                                    const t_commrec             *cr,
+                                   const gmx_multisim_t        *ms,
                                    const gmx::MDLogger         &mdlog);
 
 #endif
index 36a9c3b29fad76e7cad1d32a23e535fbf1afed8f..f9862902042b317c4616030f1a39ef8867a0f1f5 100644 (file)
@@ -187,6 +187,7 @@ runTaskAssignment(const std::vector<int>     &gpuIdsToUse,
                   const gmx_hw_info_t        &hardwareInfo,
                   const MDLogger             &mdlog,
                   const t_commrec            *cr,
+                  const gmx_multisim_t       *ms,
                   const std::vector<GpuTask> &gpuTasksOnThisRank)
 {
     /* Communicate among ranks on this node to find each task that can
@@ -294,10 +295,10 @@ runTaskAssignment(const std::vector<int>     &gpuIdsToUse,
             MPI_Barrier(cr->mpi_comm_mysim);
 #endif
         }
-        if (MULTISIM(cr))
+        if (isMultiSim(ms))
         {
 #if GMX_MPI
-            MPI_Barrier(cr->ms->mpi_comm_masters);
+            MPI_Barrier(ms->mpi_comm_masters);
 #endif
         }
 
index 62123e082405d0935ecf228398de2552584a02c2..53936362c1b3f907ccdbed4f6733b4e7b2fe36ba 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2017, by the GROMACS development team, led by
+ * Copyright (c) 2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -53,6 +53,7 @@
 #include <vector>
 
 struct gmx_hw_info_t;
+struct gmx_multisim_t;
 struct t_commrec;
 
 namespace gmx
@@ -102,6 +103,7 @@ using GpuTaskAssignments = std::vector<GpuTaskAssignment>;
  * \param[in]  hardwareInfo               The detected hardware
  * \param[in]  mdlog                      Logging object to write to.
  * \param[in]  cr                         Communication object.
+ * \param[in]  ms                         Handles multi-simulations.
  * \param[in]  gpuTasksOnThisRank         Information about what GPU tasks
  *                                        exist on this rank.
  *
@@ -116,6 +118,7 @@ runTaskAssignment(const std::vector<int>     &gpuIdsToUse,
                   const gmx_hw_info_t        &hardwareInfo,
                   const MDLogger             &mdlog,
                   const t_commrec            *cr,
+                  const gmx_multisim_t       *ms,
                   const std::vector<GpuTask> &gpuTasksOnThisRank);
 
 //! Function for whether the task of \c mapping has value \c TaskType.
index 41cd2ff908decf1794e8f3dca908e7e72c33ab62..4554cea792d8cdafed89835eb23caa5ab1279c78 100644 (file)
@@ -2,7 +2,7 @@
  * This file is part of the GROMACS molecular simulation package.
  *
  * Copyright (c) 1991-2006 David van der Spoel, Erik Lindahl, Berk Hess, University of Groningen.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -63,14 +63,6 @@ extern "C"
 } /* fixes auto-indentation problems */
 #endif
 
-/* Minor implementation note:
- *
- * I like to use these counters in other programs too, so to avoid making
- * it dependent on other Gromacs definitions I use the #ifdef's to set
- * architecture-specific inline macros instead of using gmx_inline from
- * gmx_types.h /Erik 2005-12-10
- */
-
 #if ((defined(__GNUC__) || defined(__INTEL_COMPILER) || defined(__PATHSCALE__) || defined(__PGIC__)) && \
     (defined(__i386__) || defined(__x86_64__)))
 /* x86 or x86-64 with GCC inline assembly */
index 6195dadd27e32cb5ac49df70153e4c76c7b1b6a1..914eb6284da9ed5b21f4b28ecb1fe67a1192379b 100644 (file)
@@ -75,7 +75,7 @@ typedef struct
     gmx_cycles_t start;
 } wallcc_t;
 
-typedef struct gmx_wallcycle
+struct gmx_wallcycle
 {
     wallcc_t        *wcc;
     /* did we detect one or more invalid cycle counts */
@@ -104,7 +104,7 @@ static const char *wcn[ewcNR] =
 {
     "Run", "Step", "PP during PME", "Domain decomp.", "DD comm. load",
     "DD comm. bounds", "Vsite constr.", "Send X to PME", "Neighbor search", "Launch GPU ops.",
-    "Comm. coord.", "Born radii", "Force", "Wait + Comm. F", "PME mesh",
+    "Comm. coord.", "Force", "Wait + Comm. F", "PME mesh",
     "PME redist. X/F", "PME spread", "PME gather", "PME 3D-FFT", "PME 3D-FFT Comm.", "PME solve LJ", "PME solve Elec",
     "PME wait for PP", "Wait + Recv. PME F",
     "Wait PME GPU spread", "PME 3D-FFT", "PME solve", /* the strings for FFT/solve are repeated here for mixed mode counters */
index 9698467f7e35459374d10eba2a2a93253c9b4d1d..33291cdf4df252226d6792020abb172294fdf475 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2008, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 
 typedef struct gmx_wallcycle *gmx_wallcycle_t;
 struct t_commrec;
+const gmx_wallcycle_t nullWallcycle = nullptr;
 
 enum {
     ewcRUN, ewcSTEP, ewcPPDURINGPME, ewcDOMDEC, ewcDDCOMMLOAD,
     ewcDDCOMMBOUND, ewcVSITECONSTR, ewcPP_PMESENDX, ewcNS, ewcLAUNCH_GPU,
-    ewcMOVEX, ewcGB, ewcFORCE, ewcMOVEF, ewcPMEMESH,
+    ewcMOVEX, ewcFORCE, ewcMOVEF, ewcPMEMESH,
     ewcPME_REDISTXF, ewcPME_SPREAD, ewcPME_GATHER, ewcPME_FFT, ewcPME_FFTCOMM, ewcLJPME, ewcPME_SOLVE,
     ewcPMEWAITCOMM, ewcPP_PMEWAITRECVF,
     ewcWAIT_GPU_PME_SPREAD, ewcPME_FFT_MIXED_MODE, ewcPME_SOLVE_MIXED_MODE,
index 2caa5730d573078df1549b0f04a162f4a70af72a..0e50d7d41a21c12c2ccef8e8d5418e6daa2b5b12 100644 (file)
@@ -2,7 +2,7 @@
  * This file is part of the GROMACS molecular simulation package.
  *
  * Copyright (c) 2013, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -201,10 +201,8 @@ gmx_gettime()
     /* Use clock_gettime only if we know linking the C run-time
        library will work (which is not trivial on e.g. Crays), and its
        headers claim sufficient support for POSIX (ie not Mac and
-       Windows), and it isn't BG/Q (whose compute node kernel only
-       supports gettimeofday, and bgclang doesn't provide a fully
-       functional implementation clock_gettime). */
-#if HAVE_CLOCK_GETTIME && defined(_POSIX_TIMERS) && _POSIX_TIMERS > 0 && !(defined __bgq__ && defined __clang__)
+       Windows). */
+#if HAVE_CLOCK_GETTIME && defined(_POSIX_TIMERS) && _POSIX_TIMERS > 0
     struct timespec t;
     double          seconds;
 
@@ -215,7 +213,6 @@ gmx_gettime()
 #elif HAVE_GETTIMEOFDAY
     // Note that gettimeofday() is deprecated by POSIX, but since Mac
     // and Windows do not yet support POSIX, we are still stuck.
-    // Also, this is the only supported API call on Bluegene/Q.
     struct timeval t;
     double         seconds;
 
@@ -251,10 +248,8 @@ gmx_gettime_per_thread()
     /* Use clock_gettime only if we know linking the C run-time
        library will work (which is not trivial on e.g. Crays), and its
        headers claim sufficient support for POSIX (ie not Mac and
-       Windows), and it isn't BG/Q (whose compute node kernel only
-       supports gettimeofday, and bgclang doesn't provide a fully
-       functional implementation clock_gettime). */
-#if HAVE_CLOCK_GETTIME && defined(_POSIX_THREAD_CPUTIME) && _POSIX_THREAD_CPUTIME > 0 && !(defined __bgq__ && defined __clang__)
+       Windows). */
+#if HAVE_CLOCK_GETTIME && defined(_POSIX_THREAD_CPUTIME) && _POSIX_THREAD_CPUTIME > 0
     struct timespec t;
     double          seconds;
 
index 6605352eae5d2e3e5b3c41f1da8abff21b27a4ae..d7429f6a2c40228e69bdc6b0ffd073e3dbe000b7 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2013, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
index 0fa17bcd36d388dbabe4b2cd0d5c4d032f88f70f..61449e485968433675a958bb5ae81a48652d6257 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -74,11 +74,7 @@ void init_atom(t_atoms *at)
 void init_atomtypes(t_atomtypes *at)
 {
     at->nr         = 0;
-    at->radius     = nullptr;
-    at->vol        = nullptr;
     at->atomnumber = nullptr;
-    at->gb_radius  = nullptr;
-    at->S_hct      = nullptr;
 }
 
 void done_atom(t_atoms *at)
@@ -95,12 +91,7 @@ void done_atom(t_atoms *at)
 void done_atomtypes(t_atomtypes *atype)
 {
     atype->nr = 0;
-    sfree(atype->radius);
-    sfree(atype->vol);
-    sfree(atype->surftens);
     sfree(atype->atomnumber);
-    sfree(atype->gb_radius);
-    sfree(atype->S_hct);
 }
 
 void add_t_atoms(t_atoms *atoms, int natom_extra, int nres_extra)
@@ -332,10 +323,8 @@ void pr_atomtypes(FILE *fp, int indent, const char *title, const t_atomtypes *at
         {
             pr_indent(fp, indent);
             fprintf(fp,
-                    "atomtype[%3d]={radius=%12.5e, volume=%12.5e, gb_radius=%12.5e, surftens=%12.5e, atomnumber=%4d, S_hct=%12.5e)}\n",
-                    bShowNumbers ? i : -1, atomtypes->radius[i], atomtypes->vol[i],
-                    atomtypes->gb_radius[i],
-                    atomtypes->surftens[i], atomtypes->atomnumber[i], atomtypes->S_hct[i]);
+                    "atomtype[%3d]={atomnumber=%4d}\n",
+                    bShowNumbers ? i : -1, atomtypes->atomnumber[i]);
         }
     }
 }
index 8bb674b67d1845e908e55de6f449a8e628d44160..59bd270a9fbaa277462d7f8ca26b6a945505e57e 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015,2016,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -131,11 +131,6 @@ typedef struct t_atoms
 typedef struct t_atomtypes
 {
     int           nr;           /* number of atomtypes                          */
-    real         *radius;       /* GBSA radius for each atomtype                */
-    real         *vol;          /* GBSA efective volume for each atomtype       */
-    real         *surftens;     /* implicit solvent surftens for each atomtype  */
-    real         *gb_radius;    /* GB radius for each atom type                 */
-    real         *S_hct;        /* Overlap factors for HCT/OBC GB models        */
     int          *atomnumber;   /* Atomic number, used for QM/MM                */
 } t_atomtypes;
 
index 4806c2a9ba889416ba5dba0afecc4fbac3f85ecc..652a36bb5d951cb6b82b1a2833c004d6d5e15722 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -273,10 +273,14 @@ void pr_iparams(FILE *fp, t_functype ftype, const t_iparams *iparams)
         case F_VSITEN:
             fprintf(fp, "n=%2d, a=%15.8e\n", iparams->vsiten.n, iparams->vsiten.a);
             break;
-        case F_GB12:
-        case F_GB13:
-        case F_GB14:
-            fprintf(fp, "sar=%15.8e, st=%15.8e, pi=%15.8e, gbr=%15.8e, bmlt=%15.8e\n", iparams->gb.sar, iparams->gb.st, iparams->gb.pi, iparams->gb.gbr, iparams->gb.bmlt);
+        case F_GB12_NOLONGERUSED:
+        case F_GB13_NOLONGERUSED:
+        case F_GB14_NOLONGERUSED:
+            // These could only be generated by grompp, not written in
+            // a .top file. Now that implicit solvent is not
+            // supported, they can't be generated, and the values are
+            // ignored if read from an old .tpr file. So there is
+            // nothing to print.
             break;
         case F_CMAP:
             fprintf(fp, "cmapA=%1d, cmapB=%1d\n", iparams->cmap.cmapA, iparams->cmap.cmapB);
index 467d7d45f8ad189bf717a5661e1738314a6d836a..822bbf25fb96af09d61ce348e0aaef41ac91e9f6 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -87,11 +87,11 @@ enum {
     F_PIDIHS,
     F_TABDIHS,
     F_CMAP,
-    F_GB12,
-    F_GB13,
-    F_GB14,
-    F_GBPOL,
-    F_NPSOLVATION,
+    F_GB12_NOLONGERUSED,
+    F_GB13_NOLONGERUSED,
+    F_GB14_NOLONGERUSED,
+    F_GBPOL_NOLONGERUSED,
+    F_NPSOLVATION_NOLONGERUSED,
     F_LJ14,
     F_COUL14,
     F_LJC14_Q,
@@ -268,9 +268,6 @@ typedef union t_iparams
     struct {
         int  table; real kA; real kB;
     } tab;
-    struct {
-        real sar, st, pi, gbr, bmlt;
-    } gb;
     struct {
         int cmapA, cmapB;
     } cmap;
index 376e46402c02545bd423779d180bd643dac211ce..f042b5ceafb0a10300ee7f1822e0c638447ed86c 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -113,11 +113,11 @@ const t_interaction_function interaction_function[F_NRE] =
     def_bonded  ("PIDIHS",   "Improper Dih.",   4, 3, 3,  eNR_IMPROPER, pdihs       ),
     def_bondedt ("TABDIHS", "Tab. Dih.",        4, 2, 2,  eNR_TABDIHS, tab_dihs     ),
     def_bonded  ("CMAP",  "CMAP Dih.",          5, -1, -1,  eNR_CMAP,   unimplemented ),
-    def_bonded  ("GB12",     "GB 1-2 Pol.",     2, 4, 0,  eNR_GB,     unimplemented ),
-    def_bonded  ("GB13",     "GB 1-3 Pol.",     2, 4, 0,  eNR_GB,     unimplemented ),
-    def_bonded  ("GB14",     "GB 1-4 Pol.",     2, 4, 0,  eNR_GB,     unimplemented ),
-    def_nofc    ("GBPOL",    "GB Polarization" ),
-    def_nofc    ("NPSOLVATION", "Nonpolar Sol." ),
+    def_nofc    ("GB12",     "GB 1-2 Pol. (unused)" ),
+    def_nofc    ("GB13",     "GB 1-3 Pol. (unused)" ),
+    def_nofc    ("GB14",     "GB 1-4 Pol. (unused)" ),
+    def_nofc    ("GBPOL",    "GB Polarization (unused)" ),
+    def_nofc    ("NPSOLVATION", "Nonpolar Sol. (unused)" ),
     def_bondedz ("LJ14",     "LJ-14",           2, 2, 2,  eNR_NB14,   unimplemented ),
     def_nofc    ("COUL14",   "Coulomb-14"                                           ),
     def_bondedz ("LJC14_Q",  "LJC-14 q",        2, 5, 0,  eNR_NB14,   unimplemented ),
index a1638ef69c5b83cde0725260d645c15e494864ff..276c6319a254d95dd4f5460980ef3d26a4cc0b4d 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -126,22 +126,6 @@ typedef uint64_t gmx_uint64_t;
 #define GMX_UINT64_MIN UINT64_MIN
 /*! \} */
 
-/*! \def gmx_inline
- * \brief
- * Keyword to use in C code instead of C99 `inline`.
- *
- * Some of the C compilers we support do not recognize the C99 keyword
- * `inline`.  This macro should be used in C code and in shared C/C++ headers
- * to indicate a function is inlined.
- * C++ code should use plain `inline`, as that is already in C++98.
- */
-#if !defined __cplusplus && defined _MSC_VER
-#define gmx_inline __inline
-#else
-/* C++ or C99 */
-#define gmx_inline inline
-#endif
-
 /* ICC, GCC, MSVC, Pathscale, PGI, XLC support __restrict.
  * Any other compiler can be added here. */
 /*! \brief
index 1f48ef2631a98260e3add9637fb9c2c2adc78267..533fe0cada09e38efda96ca092a9c2e5218f1a5f 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -95,75 +95,11 @@ int gmx_node_rank()
 #endif
 }
 
-#if GMX_LIB_MPI && GMX_TARGET_BGQ
-#ifdef __clang__
-/* IBM's declaration of this function in
- * /bgsys/drivers/V1R2M2/ppc64/spi/include/kernel/process.h
- * erroneously fails to specify __INLINE__, despite
- * /bgsys/drivers/V1R2M2/ppc64/spi/include/kernel/cnk/process_impl.h
- * specifiying __INLINE__, so bgclang thinks they are different enough
- * to complain about. */
-static uint64_t Kernel_GetJobID();
-#endif
-#include <spi/include/kernel/location.h>
-
-static int bgq_nodenum()
-{
-    int           hostnum;
-    Personality_t personality;
-    Kernel_GetPersonality(&personality, sizeof(personality));
-    /* Each MPI rank has a unique coordinate in a 6-dimensional space
-       (A,B,C,D,E,T), with dimensions A-E corresponding to different
-       physical nodes, and T within each node. Each node has sixteen
-       physical cores, each of which can have up to four hardware
-       threads, so 0 <= T <= 63 (but the maximum value of T depends on
-       the confituration of ranks and OpenMP threads per
-       node). However, T is irrelevant for computing a suitable return
-       value for gmx_physicalnode_id_hash().
-     */
-    hostnum  = personality.Network_Config.Acoord;
-    hostnum *= personality.Network_Config.Bnodes;
-    hostnum += personality.Network_Config.Bcoord;
-    hostnum *= personality.Network_Config.Cnodes;
-    hostnum += personality.Network_Config.Ccoord;
-    hostnum *= personality.Network_Config.Dnodes;
-    hostnum += personality.Network_Config.Dcoord;
-    hostnum *= personality.Network_Config.Enodes;
-    hostnum += personality.Network_Config.Ecoord;
-
-    if (debug)
-    {
-        std::fprintf(debug,
-                     "Torus ID A: %d / %d B: %d / %d C: %d / %d D: %d / %d E: %d / %d\n"
-                     "Node ID T: %d / %d core: %d / %d hardware thread: %d / %d\n",
-                     personality.Network_Config.Acoord,
-                     personality.Network_Config.Anodes,
-                     personality.Network_Config.Bcoord,
-                     personality.Network_Config.Bnodes,
-                     personality.Network_Config.Ccoord,
-                     personality.Network_Config.Cnodes,
-                     personality.Network_Config.Dcoord,
-                     personality.Network_Config.Dnodes,
-                     personality.Network_Config.Ecoord,
-                     personality.Network_Config.Enodes,
-                     Kernel_ProcessorCoreID(),
-                     16,
-                     Kernel_ProcessorID(),
-                     64,
-                     Kernel_ProcessorThreadID(),
-                     4);
-    }
-    return hostnum;
-}
-#endif
-
 static int mpi_hostname_hash()
 {
     int hash_int;
 
-#if GMX_TARGET_BGQ
-    hash_int = bgq_nodenum();
-#elif GMX_LIB_MPI
+#if GMX_LIB_MPI
     int  resultlen;
     char mpi_hostname[MPI_MAX_PROCESSOR_NAME];
 
index db37c318d370d56b4e811e53c5c1053dcc98ef24..f258f225040248486ca4c0b347ec5649ec4e13a8 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -303,12 +303,10 @@ void gmx_print_version_info(gmx::TextWriter *writer)
     writer->writeLine(formatString("OpenCL version:     %s", OPENCL_VERSION_STRING));
 #endif
 #if GMX_GPU == GMX_GPU_CUDA
-    writer->writeLine(formatString("CUDA compiler:      %s\n", CUDA_COMPILER_INFO));
-    writer->writeLine(formatString("CUDA compiler flags:%s\n", CUDA_COMPILER_FLAGS));
-    auto driverVersion = gmx::getCudaDriverVersion();
-    writer->writeLine(formatString("CUDA driver:        %d.%d\n", driverVersion.first, driverVersion.second));
-    auto runtimeVersion = gmx::getCudaRuntimeVersion();
-    writer->writeLine(formatString("CUDA runtime:       %d.%d\n", runtimeVersion.first, runtimeVersion.second));
+    writer->writeLine(formatString("CUDA compiler:      %s", CUDA_COMPILER_INFO));
+    writer->writeLine(formatString("CUDA compiler flags:%s", CUDA_COMPILER_FLAGS));
+    writer->writeLine("CUDA driver:        " + gmx::getCudaDriverVersionString());
+    writer->writeLine("CUDA runtime:       " + gmx::getCudaRuntimeVersionString());
 #endif
 }
 
index e1c5989669a2da26393bcaddcd936475a0a40a5c..8db76e5933b0e5f690595985020e191e0d497143 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014, by the GROMACS development team, led by
+ * Copyright (c) 2014,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -67,55 +67,55 @@ typedef gmx_uint64_t gmx_bitmask_t; /**< bitmask type */
 #endif
 
 /*! \brief Initialize all bits to 0 */
-gmx_inline static void bitmask_clear(gmx_bitmask_t* m)
+inline static void bitmask_clear(gmx_bitmask_t* m)
 {
     *m = 0;
 }
 
 /*! \brief Set bit at position b to 1. */
-gmx_inline static void bitmask_set_bit(gmx_bitmask_t* m, int b)
+inline static void bitmask_set_bit(gmx_bitmask_t* m, int b)
 {
     *m |= ((gmx_bitmask_t)1 << b);
 }
 
 /*! \brief Initialize all bits: bit b to 1, others to 0 */
-gmx_inline static void bitmask_init_bit(gmx_bitmask_t* m, int b)
+inline static void bitmask_init_bit(gmx_bitmask_t* m, int b)
 {
     *m = ((gmx_bitmask_t)1 << b);
 }
 
 /*! \brief Initialize all bits: all bits below b to 1, others to 0 */
-gmx_inline static void bitmask_init_low_bits(gmx_bitmask_t* m, int b)
+inline static void bitmask_init_low_bits(gmx_bitmask_t* m, int b)
 {
     *m = ((gmx_bitmask_t)1 << b) - 1;
 }
 
 /*! \brief Test if bit b is set */
-gmx_inline static gmx_bool bitmask_is_set(gmx_bitmask_t m, int b)
+inline static bool bitmask_is_set(gmx_bitmask_t m, int b)
 {
     return (m & ((gmx_bitmask_t)1 << b)) != 0;
 }
 
 /*! \brief Test if both bitmasks have no common bits enabled */
-gmx_inline static gmx_bool bitmask_is_disjoint(gmx_bitmask_t a, gmx_bitmask_t b)
+inline static bool bitmask_is_disjoint(gmx_bitmask_t a, gmx_bitmask_t b)
 {
     return !(a & b);
 }
 
 /*! \brief Test if both bitmasks are equal */
-gmx_inline static gmx_bool bitmask_is_equal(gmx_bitmask_t a, gmx_bitmask_t b)
+inline static bool bitmask_is_equal(gmx_bitmask_t a, gmx_bitmask_t b)
 {
     return a == b;
 }
 
 /*! \brief Test if bitmask has no enabled bits */
-gmx_inline static gmx_bool bitmask_is_zero(gmx_bitmask_t m)
+inline static bool bitmask_is_zero(gmx_bitmask_t m)
 {
     return !m;
 }
 
 /*! \brief Set all bits enabled in either mask and write into a */
-gmx_inline static void bitmask_union(gmx_bitmask_t* a, gmx_bitmask_t b)
+inline static void bitmask_union(gmx_bitmask_t* a, gmx_bitmask_t b)
 {
     *a |= b;
 }
@@ -123,38 +123,38 @@ gmx_inline static void bitmask_union(gmx_bitmask_t* a, gmx_bitmask_t b)
 #define BITMASK_ALEN (BITMASK_SIZE/64)
 typedef gmx_uint64_t gmx_bitmask_t[BITMASK_ALEN];
 
-gmx_inline static void bitmask_clear(gmx_bitmask_t* m)
+inline static void bitmask_clear(gmx_bitmask_t* m)
 {
     memset(*m, 0, BITMASK_SIZE/8);
 }
 
-gmx_inline static void bitmask_set_bit(gmx_bitmask_t* m, int b)
+inline static void bitmask_set_bit(gmx_bitmask_t* m, int b)
 {
     (*m)[b/64] |= ((gmx_uint64_t)1 << (b%64));
 }
 
-gmx_inline static void bitmask_init_bit(gmx_bitmask_t* m, int b)
+inline static void bitmask_init_bit(gmx_bitmask_t* m, int b)
 {
     bitmask_clear(m);
     (*m)[b/64] = ((gmx_uint64_t)1 << (b%64));
 }
 
-gmx_inline static void bitmask_init_low_bits(gmx_bitmask_t* m, int b)
+inline static void bitmask_init_low_bits(gmx_bitmask_t* m, int b)
 {
     memset(*m, 255, b/64*8);
     (*m)[b/64] = ((gmx_uint64_t)1 << (b%64)) - 1;
     memset(&(*m)[b/64+1], 0, (BITMASK_ALEN-b/64-1)*8);
 }
 
-gmx_inline static gmx_bool bitmask_is_set(gmx_bitmask_t m, int b)
+inline static bool bitmask_is_set(gmx_bitmask_t m, int b)
 {
     return (m[b/64] & ((gmx_uint64_t)1 << (b%64))) != 0;
 }
 
-gmx_inline static gmx_bool bitmask_is_disjoint(gmx_bitmask_t a, gmx_bitmask_t b)
+inline static bool bitmask_is_disjoint(gmx_bitmask_t a, gmx_bitmask_t b)
 {
     int      i;
-    gmx_bool r = 1;
+    bool     r = 1;
     for (i = 0; i < BITMASK_ALEN; i++)
     {
         r = r && !(a[i] & b[i]);
@@ -162,10 +162,10 @@ gmx_inline static gmx_bool bitmask_is_disjoint(gmx_bitmask_t a, gmx_bitmask_t b)
     return r;
 }
 
-gmx_inline static gmx_bool bitmask_is_equal(gmx_bitmask_t a, gmx_bitmask_t b)
+inline static bool bitmask_is_equal(gmx_bitmask_t a, gmx_bitmask_t b)
 {
     int      i;
-    gmx_bool r = 1;
+    bool     r = 1;
     for (i = 0; i < BITMASK_ALEN; i++)
     {
         r = r && (a[i] == b[i]);
@@ -173,10 +173,10 @@ gmx_inline static gmx_bool bitmask_is_equal(gmx_bitmask_t a, gmx_bitmask_t b)
     return r;
 }
 
-gmx_inline static gmx_bool bitmask_is_zero(gmx_bitmask_t m)
+inline static bool bitmask_is_zero(gmx_bitmask_t m)
 {
     int      i;
-    gmx_bool r = 1;
+    bool     r = 1;
     for (i = 0; i < BITMASK_ALEN; i++)
     {
         r = r && !m[i];
@@ -184,7 +184,7 @@ gmx_inline static gmx_bool bitmask_is_zero(gmx_bitmask_t m)
     return r;
 }
 
-gmx_inline static void bitmask_union(gmx_bitmask_t* a, gmx_bitmask_t b)
+inline static void bitmask_union(gmx_bitmask_t* a, gmx_bitmask_t b)
 {
     int i;
     for (i = 0; i < BITMASK_ALEN; i++)
index 269f71e3b30c0ab88989fcb1e3b3b859e32bb074..304351d491697760b0fa063ca59259213a6c9850 100644 (file)
@@ -809,7 +809,8 @@ std::string getCoolQuote()
         { "A computer once beat me at chess, but it was no match for me at kick boxing.", "Emo Philips" },
         { "Home computers are being called upon to perform many new functions, including the consumption of homework formerly eaten by the dog.", "Doug Larson" },
         { "Forcefields are like dating; things go fine for a while and then sometimes it goes really bad.", "Alex MacKerell" },
-        { "This type of advanced sampling techniques... which are not so advanced, really.", "Viveca Lindahl, on AWH, at her thesis defense." }
+        { "This type of advanced sampling techniques... which are not so advanced, really.", "Viveca Lindahl, on AWH, at her thesis defense." },
+        { "C++ is tricky. You can do everything. You can even make every mistake.", "Nicolai Josuttis, CppCon2017" },
     };
 
     if (beCool())
index 0d759bb47221b3a3cbee8dc9bca5c474890e961a..998e2b623eecef0b71c058afa135da1caea7c754 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 
 #include "cuda_version_information.h"
 
-#include <utility>
+#include "gromacs/utility/stringutil.h"
 
 namespace gmx
 {
 
-std::pair<int, int> getCudaDriverVersion()
+std::string getCudaDriverVersionString()
 {
-    int cuda_driver;
-    cudaDriverGetVersion(&cuda_driver);
-    return std::pair<int, int>(cuda_driver/1000, cuda_driver%100);
+    int cuda_driver = 0;
+    if (cudaDriverGetVersion(&cuda_driver) != cudaSuccess)
+    {
+        return "N/A";
+    }
+    return formatString("%d.%d", cuda_driver/1000, cuda_driver%100);
 }
 
-std::pair<int, int> getCudaRuntimeVersion()
+std::string getCudaRuntimeVersionString()
 {
-    int cuda_runtime;
-    cudaRuntimeGetVersion(&cuda_runtime);
-    return std::pair<int, int>(cuda_runtime/1000, cuda_runtime%100);
+    int cuda_runtime = 0;
+    if (cudaRuntimeGetVersion(&cuda_runtime) != cudaSuccess)
+    {
+        return "N/A";
+    }
+    return formatString("%d.%d", cuda_runtime/1000, cuda_runtime%100);
 }
 
 } // namespace
index 4cced2ca80e25d1475d8b816974e22a5b6a494a6..446675a816fc6afaf8d0754f0262bffd3ff2cc28 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 #ifndef GMX_UTILITY_CUDA_VERSION_INFORMATION_H
 #define GMX_UTILITY_CUDA_VERSION_INFORMATION_H
 
-#include <utility>
+#include <string>
 
 namespace gmx
 {
 
-//! Returns a (major, minor) tuple of the CUDA driver version.
-std::pair<int, int> getCudaDriverVersion();
+//! Returns a string of the CUDA driver version.
+std::string getCudaDriverVersionString();
 
-//! Returns a (major, minor) tuple of the CUDA runtime version.
-std::pair<int, int> getCudaRuntimeVersion();
+//! Returns a string of the CUDA runtime version.
+std::string getCudaRuntimeVersionString();
 
 } // namespace
 
index 1a964bf87f6854e506b29512132a78111ea17f0c..d854165433f9236adbb8783de50b66da0f0fdd8b 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
 
 #include "gromacs/utility/basedefinitions.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-#if 0
-}
-#endif
-
 /*! \def GMX_PATH_MAX
  * \brief
  * Maximum path length, if the OS provides one, otherwise a fixed constant.
@@ -225,9 +218,6 @@ void gmx_chdir(const char *directory);
  */
 void gmx_getcwd(char *buffer, size_t size);
 
-#ifdef __cplusplus
-}
-
 namespace gmx
 {
 
@@ -271,6 +261,5 @@ const DataFileFinder &getLibraryFileFinder();
 void setLibraryFileFinder(const DataFileFinder *finder);
 
 } // namespace gmx
-#endif
 
 #endif
index 8897aecff3d533ca66de4943cd160977c2121d28..bf22d4c66f0fc6e6a6cb72baf27bdf183dab667e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2013,2014,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -83,6 +83,8 @@ typedef void* MPI_Request;
 typedef void* MPI_Status;
 typedef void* MPI_Group;
 #define MPI_COMM_NULL NULL
+#define MPI_GROUP_NULL NULL
+#define MPI_COMM_WORLD NULL
 #endif
 #endif
 //! \endcond
index 471563307b22db6aff1a9ffe8ac8b0797a6700cf..82206a8279b1639825f605d20078f6ea4013684a 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -129,7 +129,7 @@ gmx_bool gmx_omp_check_thread_affinity(char **message);
 /*! \brief
  * Pause for use in a spin-wait loop.
  */
-static gmx_inline void gmx_pause()
+static inline void gmx_pause()
 {
 #ifndef _MSC_VER
     /* Ugly hack because the openmp implementation below hacks into the SIMD
index a44a65830b9dfb8a250b5d3015c12a7379029514..d4f3c5c146ab1a22f68d56d1e039cce81b27061e 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -111,7 +111,7 @@ class IKeyValueTreeTransformRules
         scopedTransform(const KeyValueTreePath &scope) = 0;
 
     protected:
-        ~IKeyValueTreeTransformRules();
+        virtual ~IKeyValueTreeTransformRules();
 };
 
 /*! \libinternal \brief
index 465c1a4130e52cac85078f002b2226feb7d8c1ba..8f97857e77b85853102917f9cfc9d004fbe11f7b 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  */
 /*! \file
  * \brief
- * C memory allocation routines for \Gromacs.
+ * C-style memory allocation routines for \Gromacs.
  *
  * This header provides macros snew(), srenew(), smalloc(), and sfree() for
- * C memory management.  Additionally, snew_aligned() and sfree_aligned() are
+ * C-style memory management.  Additionally, snew_aligned() and sfree_aligned() are
  * provided for managing memory with a specified byte alignment.
  *
  * If an allocation fails, the program is halted by calling gmx_fatal(), which
  * save_malloc_aligned() exists for this purpose, although there is no macro to
  * invoke it.
  *
- * \if internal
- * As an implementation detail, the macros need a different internal
- * implementation for C and C++ code.  This is because C accepts conversions
- * from `void *` to any pointer type, but C++ doesn't.  And in order to cast
- * the returned pointer to a correct type, a C++ template needs to be used to
- * get access to the type.
- * \endif
- *
  * \inpublicapi
  * \ingroup module_utility
  */
 
 #include "gromacs/utility/basedefinitions.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 /*! \brief
  * \Gromacs wrapper for malloc().
  *
@@ -190,12 +178,6 @@ void *save_calloc_aligned(const char *name, const char *file, int line,
  */
 void save_free_aligned(const char *name, const char *file, int line, void *ptr);
 
-#ifdef __cplusplus
-}
-#endif
-
-#ifdef __cplusplus
-
 #if GMX_CXX11_COMPILATION
 #include <type_traits>
 #endif
@@ -205,7 +187,7 @@ void save_free_aligned(const char *name, const char *file, int line, void *ptr);
  *
  * These templates are used to implement the snew() etc. macros for C++, where
  * an explicit cast is needed from `void *` (the return value of the allocation
- * wrapper functions) to the thpe of \p ptr.
+ * wrapper functions) to the type of \p ptr.
  *
  * Having these as `static` avoid some obscure bugs if several files define
  * distinct data structures with identical names and allocate memory for them
@@ -284,7 +266,6 @@ void gmx_sfree_aligned_impl(const char *name, const char *file, int line, T *ptr
 }
 /*! \} */
 /*! \endcond */
-#endif /* __cplusplus */
 
 /*! \def snew
  * \brief
@@ -358,7 +339,6 @@ void gmx_sfree_aligned_impl(const char *name, const char *file, int line, T *ptr
  *
  * \hideinitializer
  */
-#ifdef __cplusplus
 
 /* C++ implementation */
 #define snew(ptr, nelem) \
@@ -374,26 +354,6 @@ void gmx_sfree_aligned_impl(const char *name, const char *file, int line, T *ptr
 #define sfree_aligned(ptr) \
     gmx_sfree_aligned_impl(#ptr, __FILE__, __LINE__, (ptr))
 
-#else
-
-/* C implementation */
-#define snew(ptr, nelem) \
-    (ptr) = save_calloc(#ptr, __FILE__, __LINE__, (nelem), sizeof(*(ptr)))
-#define srenew(ptr, nelem) \
-    (ptr) = save_realloc(#ptr, __FILE__, __LINE__, (ptr), (nelem), sizeof(*(ptr)))
-#define smalloc(ptr, size) \
-    (ptr) = save_malloc(#ptr, __FILE__, __LINE__, size)
-#define snew_aligned(ptr, nelem, alignment) \
-    (ptr) = save_calloc_aligned(#ptr, __FILE__, __LINE__, (nelem), sizeof(*(ptr)), alignment)
-#define sfree(ptr) save_free(#ptr, __FILE__, __LINE__, (ptr))
-#define sfree_aligned(ptr) save_free_aligned(#ptr, __FILE__, __LINE__, (ptr))
-
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 /*! \brief
  * Over allocation factor for memory allocations.
  *
@@ -433,8 +393,4 @@ int over_alloc_dd(int n);
 /** Over allocation for large data types: complex structs */
 #define over_alloc_large(n) (int)(OVER_ALLOC_FAC*(n) + 1000)
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif
index 74ed8f471e943a65881c5554280c535bcb83fdea..0c67bc12ea798f3ee76c1eb00121bb71b630582b 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+# Copyright (c) 2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
 # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
 # and including many others, as listed in the AUTHORS file in the
 # top-level source directory and at http://www.gromacs.org.
index a4d07c9167bfcc9580dcb26ad719d6c8c38f8319..d302c1f425b37a62b3eb352e2802eb867e46dedb 100644 (file)
@@ -280,7 +280,9 @@ static void prepareRerunState(const t_trxframe  &rerunFrame,
 }
 
 /*! \libinternal
-    \copydoc integrator_t (FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
+    \copydoc integrator_t (FILE *fplog, t_commrec *cr,
+                           const gmx_multisim_t *ms,
+                           const gmx::MDLogger &mdlog,
                            int nfile, const t_filenm fnm[],
                            const gmx_output_env_t *oenv,
                            const MdrunOptions &mdrunOptions,
@@ -296,7 +298,9 @@ static void prepareRerunState(const t_trxframe  &rerunFrame,
                            gmx_membed_t *membed,
                            gmx_walltime_accounting_t walltime_accounting)
  */
-double gmx::do_md(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
+double gmx::do_md(FILE *fplog, t_commrec *cr,
+                  const gmx_multisim_t *ms,
+                  const gmx::MDLogger &mdlog,
                   int nfile, const t_filenm fnm[],
                   const gmx_output_env_t *oenv,
                   const MdrunOptions &mdrunOptions,
@@ -321,7 +325,7 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
     gmx_bool        bGStatEveryStep, bGStat, bCalcVir, bCalcEnerStep, bCalcEner;
     gmx_bool        bNS, bNStList, bSimAnn, bStopCM,
                     bFirstStep, bInitStep, bLastStep = FALSE,
-                    bBornRadii, bUsingEnsembleRestraints;
+                    bUsingEnsembleRestraints;
     gmx_bool          bDoDHDL = FALSE, bDoFEP = FALSE, bDoExpanded = FALSE;
     gmx_bool          do_ene, do_log, do_verbose, bRerunWarnNoV = TRUE,
                       bForceUpdate = FALSE, bCPT;
@@ -389,7 +393,7 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
     SimulationSignals signals;
     // Most global communnication stages don't propagate mdrun
     // signals, and will use this object to achieve that.
-    SimulationSignaller nullSignaller(nullptr, nullptr, false, false);
+    SimulationSignaller nullSignaller(nullptr, nullptr, nullptr, false, false);
 
     if (!mdrunOptions.writeConfout)
     {
@@ -549,7 +553,8 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
     }
 
     /* Set up interactive MD (IMD) */
-    init_IMD(ir, cr, top_global, fplog, ir->nstcalcenergy, MASTER(cr) ? as_rvec_array(state_global->x.data()) : nullptr,
+    init_IMD(ir, cr, ms, top_global, fplog, ir->nstcalcenergy,
+             MASTER(cr) ? as_rvec_array(state_global->x.data()) : nullptr,
              nfile, fnm, oenv, mdrunOptions);
 
     if (DOMAINDECOMP(cr))
@@ -616,7 +621,7 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
     /* Initialize AWH and restore state from history in checkpoint if needed. */
     if (ir->bDoAwh)
     {
-        ir->awh = new gmx::Awh(fplog, *ir, cr, *ir->awhParams, opt2fn("-awh", nfile, fnm), ir->pull_work);
+        ir->awh = new gmx::Awh(fplog, *ir, cr, ms, *ir->awhParams, opt2fn("-awh", nfile, fnm), ir->pull_work);
 
         if (startingFromCheckpoint)
         {
@@ -633,7 +638,7 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
     const bool useReplicaExchange = (replExParams.exchangeInterval > 0);
     if (useReplicaExchange && MASTER(cr))
     {
-        repl_ex = init_replica_exchange(fplog, cr->ms, top_global->natoms, ir,
+        repl_ex = init_replica_exchange(fplog, ms, top_global->natoms, ir,
                                         replExParams);
     }
 
@@ -678,7 +683,7 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
         {
             /* Constrain the initial coordinates and velocities */
             do_constrain_first(fplog, constr, ir, mdatoms, state,
-                               cr, nrnb, fr, top);
+                               cr, ms, nrnb, fr, top);
         }
         if (vsite)
         {
@@ -916,7 +921,7 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
     bNeedRepartition = FALSE;
     // TODO This implementation of ensemble orientation restraints is nasty because
     // a user can't just do multi-sim with single-sim orientation restraints.
-    bUsingEnsembleRestraints = (fcd->disres.nsystems > 1) || (cr->ms && fcd->orires.nr);
+    bUsingEnsembleRestraints = (fcd->disres.nsystems > 1) || (ms && fcd->orires.nr);
 
     {
         // Replica exchange and ensemble restraints need all
@@ -939,15 +944,15 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
     step_rel = 0;
 
     // TODO extract this to new multi-simulation module
-    if (MASTER(cr) && MULTISIM(cr) && !useReplicaExchange)
+    if (MASTER(cr) && isMultiSim(ms) && !useReplicaExchange)
     {
-        if (!multisim_int_all_are_equal(cr->ms, ir->nsteps))
+        if (!multisim_int_all_are_equal(ms, ir->nsteps))
         {
             GMX_LOG(mdlog.warning).appendText(
                     "Note: The number of steps is not consistent across multi simulations,\n"
                     "but we are proceeding anyway!");
         }
-        if (!multisim_int_all_are_equal(cr->ms, ir->init_step))
+        if (!multisim_int_all_are_equal(ms, ir->init_step))
         {
             GMX_LOG(mdlog.warning).appendText(
                     "Note: The initial step is not consistent across multi simulations,\n"
@@ -1060,13 +1065,6 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
             bLastStep = TRUE;
         }
 
-        /* Determine whether or not to update the Born radii if doing GB */
-        bBornRadii = bFirstStep;
-        if (ir->implicit_solvent && (step % ir->nstgbradii == 0))
-        {
-            bBornRadii = TRUE;
-        }
-
         /* do_log triggers energy and virial calculation. Because this leads
          * to different code paths, forces can be different. Thus for exact
          * continuation we should avoid extra log output.
@@ -1202,12 +1200,12 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
         if (shellfc)
         {
             /* Now is the time to relax the shells */
-            relax_shell_flexcon(fplog, cr, mdrunOptions.verbose, step,
+            relax_shell_flexcon(fplog, cr, ms, mdrunOptions.verbose, step,
                                 ir, bNS, force_flags, top,
                                 constr, enerd, fcd,
                                 state, &f, force_vir, mdatoms,
                                 nrnb, wcycle, graph, groups,
-                                shellfc, fr, bBornRadii, t, mu_tot,
+                                shellfc, fr, t, mu_tot,
                                 vsite,
                                 ddOpenBalanceRegion, ddCloseBalanceRegion);
         }
@@ -1231,11 +1229,11 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
              * This is parallellized as well, and does communication too.
              * Check comments in sim_util.c
              */
-            do_force(fplog, cr, ir, step, nrnb, wcycle, top, groups,
+            do_force(fplog, cr, ms, ir, step, nrnb, wcycle, top, groups,
                      state->box, state->x, &state->hist,
                      f, force_vir, mdatoms, enerd, fcd,
                      state->lambda, graph,
-                     fr, vsite, mu_tot, t, ed, bBornRadii,
+                     fr, vsite, mu_tot, t, ed,
                      (bNS ? GMX_FORCE_NS : 0) | force_flags,
                      ddOpenBalanceRegion, ddCloseBalanceRegion);
         }
@@ -1273,7 +1271,7 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
                 update_constraints(fplog, step, nullptr, ir, mdatoms,
                                    state, fr->bMolPBC, graph, f,
                                    &top->idef, shake_vir,
-                                   cr, nrnb, wcycle, upd, constr,
+                                   cr, ms, nrnb, wcycle, upd, constr,
                                    TRUE, bCalcVir);
                 wallcycle_start(wcycle, ewcUPDATE);
             }
@@ -1528,7 +1526,7 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
                 update_constraints(fplog, step, nullptr, ir, mdatoms,
                                    state, fr->bMolPBC, graph, f,
                                    &top->idef, tmp_vir,
-                                   cr, nrnb, wcycle, upd, constr,
+                                   cr, ms, nrnb, wcycle, upd, constr,
                                    TRUE, bCalcVir);
             }
         }
@@ -1593,7 +1591,7 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
             update_constraints(fplog, step, &dvdl_constr, ir, mdatoms, state,
                                fr->bMolPBC, graph, f,
                                &top->idef, shake_vir,
-                               cr, nrnb, wcycle, upd, constr,
+                               cr, ms, nrnb, wcycle, upd, constr,
                                FALSE, bCalcVir);
 
             if (ir->eI == eiVVAK)
@@ -1623,7 +1621,7 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
                 update_constraints(fplog, step, nullptr, ir, mdatoms,
                                    state, fr->bMolPBC, graph, f,
                                    &top->idef, tmp_vir,
-                                   cr, nrnb, wcycle, upd, nullptr,
+                                   cr, ms, nrnb, wcycle, upd, nullptr,
                                    FALSE, bCalcVir);
             }
             if (EI_VV(ir->eI))
@@ -1693,7 +1691,7 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
                 // situation where e.g. checkpointing can't be
                 // signalled.
                 bool                doIntraSimSignal = true;
-                SimulationSignaller signaller(&signals, cr, doInterSimSignal, doIntraSimSignal);
+                SimulationSignaller signaller(&signals, cr, ms, doInterSimSignal, doIntraSimSignal);
 
                 compute_globals(fplog, gstat, cr, ir, fr, ekind, state, mdatoms, nrnb, vcm,
                                 wcycle, enerd, force_vir, shake_vir, total_vir, pres, mu_tot,
@@ -1819,7 +1817,7 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
             state->fep_state = lamnew;
         }
         /* Print the remaining wall clock time for the run */
-        if (MULTIMASTER(cr) &&
+        if (isMasterSimMasterRank(ms, cr) &&
             (do_verbose || gmx_got_usr_signal()) &&
             !bPMETunePrinting)
         {
@@ -1853,7 +1851,7 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
         bExchanged = FALSE;
         if (bDoReplEx)
         {
-            bExchanged = replica_exchange(fplog, cr, repl_ex,
+            bExchanged = replica_exchange(fplog, cr, ms, repl_ex,
                                           state_global, enerd,
                                           state, step, t);
         }
@@ -1991,8 +1989,7 @@ double gmx::do_md(FILE *fplog, t_commrec *cr, const gmx::MDLogger &mdlog,
                        eprAVER, mdebin, fcd, groups, &(ir->opts), ir->awh);
         }
     }
-    // TODO Enable the next line when merging to master branch
-    // done_ebin(mdebin->ebin);
+    done_ebin(mdebin->ebin);
     done_mdoutf(outf);
 
     if (bPMETune)
index 772aabda3833f87e24f6b67a76891308ec3c7ac9..7f86acafbbdeebcd77088ebf15a86cbfdb0d46fe 100644 (file)
 #include "repl_ex.h"
 #include "runner.h"
 
-/*! \brief Return whether either of the command-line parameters that
+/*! \brief Return whether the command-line parameter that
  *  will trigger a multi-simulation is set */
 static bool is_multisim_option_set(int argc, const char *const argv[])
 {
     for (int i = 0; i < argc; ++i)
     {
-        if (strcmp(argv[i], "-multi") == 0 || strcmp(argv[i], "-multidir") == 0)
+        if (strcmp(argv[i], "-multidir") == 0)
         {
             return true;
         }
@@ -343,8 +343,6 @@ int Mdrunner::mainFunction(int argc, char *argv[])
           "Run this number of steps, overrides .mdp file option (-1 means infinite, -2 means use mdp option, smaller is invalid)" },
         { "-maxh",   FALSE, etREAL, {&mdrunOptions.maximumHoursToRun},
           "Terminate after 0.99 times this time (hours)" },
-        { "-multi",   FALSE, etINT, {&nmultisim},
-          "Do multiple simulations in parallel" },
         { "-replex",  FALSE, etINT, {&replExParams.exchangeInterval},
           "Attempt replica exchange periodically with this period (steps)" },
         { "-nex",  FALSE, etINT, {&replExParams.numExchanges},
@@ -376,27 +374,15 @@ int Mdrunner::mainFunction(int argc, char *argv[])
     cr = init_commrec();
 
     unsigned long PCA_Flags = PCA_CAN_SET_DEFFNM;
-    // With -multi or -multidir, the file names are going to get processed
-    // further (or the working directory changed), so we can't check for their
-    // existence during parsing.  It isn't useful to do any completion based on
-    // file system contents, either.
+    // With -multidir, the working directory still needs to be
+    // changed, so we can't check for the existence of files during
+    // parsing.  It isn't useful to do any completion based on file
+    // system contents, either.
     if (is_multisim_option_set(argc, argv))
     {
         PCA_Flags |= PCA_DISABLE_INPUT_FILE_CHECKING;
     }
 
-    /* Comment this in to do fexist calls only on master
-     * works not with rerun or tables at the moment
-     * also comment out the version of init_forcerec in md.c
-     * with NULL instead of opt2fn
-     */
-    /*
-       if (!MASTER(cr))
-       {
-       PCA_Flags |= PCA_NOT_READ_NODE;
-       }
-     */
-
     if (!parse_common_args(&argc, argv, PCA_Flags, nfile, fnm, asize(pa), pa,
                            asize(desc), desc, 0, nullptr, &oenv))
     {
@@ -445,20 +431,17 @@ int Mdrunner::mainFunction(int argc, char *argv[])
 
     hw_opt.thread_affinity = nenum(thread_aff_opt_choices);
 
-    /* now check the -multi and -multidir option */
+    // now check for a multi-simulation
+    int nmultisim = 1;
     if (opt2bSet("-multidir", nfile, fnm))
     {
-        if (nmultisim > 0)
-        {
-            gmx_fatal(FARGS, "mdrun -multi and -multidir options are mutually exclusive.");
-        }
         nmultisim = opt2fns(&multidir, "-multidir", nfile, fnm);
     }
 
 
     if (replExParams.exchangeInterval != 0 && nmultisim < 2)
     {
-        gmx_fatal(FARGS, "Need at least two replicas for replica exchange (option -multidir)");
+        gmx_fatal(FARGS, "Need at least two replicas for replica exchange (use option -multidir)");
     }
 
     if (replExParams.numExchanges < 0)
@@ -466,15 +449,21 @@ int Mdrunner::mainFunction(int argc, char *argv[])
         gmx_fatal(FARGS, "Replica exchange number of exchanges needs to be positive");
     }
 
-    if (nmultisim >= 1)
+    ms = init_multisystem(MPI_COMM_WORLD, nmultisim, multidir);
+
+    /* Prepare the intra-simulation communication */
+    // TODO consolidate this with init_commrec, after changing the
+    // relative ordering of init_commrec and init_multisystem
+#if GMX_MPI
+    if (ms != nullptr)
     {
-#if !GMX_THREAD_MPI
-        init_multisystem(cr, nmultisim, multidir, nfile, fnm);
-#else
-        gmx_fatal(FARGS, "mdrun -multi or -multidir are not supported with the thread-MPI library. "
-                  "Please compile GROMACS with a proper external MPI library.");
-#endif
+        cr->nnodes = cr->nnodes / nmultisim;
+        MPI_Comm_split(MPI_COMM_WORLD, ms->sim, cr->sim_nodeid, &cr->mpi_comm_mysim);
+        cr->mpi_comm_mygroup = cr->mpi_comm_mysim;
+        MPI_Comm_rank(cr->mpi_comm_mysim, &cr->sim_nodeid);
+        MPI_Comm_rank(cr->mpi_comm_mygroup, &cr->nodeid);
     }
+#endif
 
     if (!opt2bSet("-cpi", nfile, fnm))
     {
@@ -496,7 +485,7 @@ int Mdrunner::mainFunction(int argc, char *argv[])
 
     continuationOptions.appendFilesOptionSet = opt2parg_bSet("-append", asize(pa), pa);
 
-    handleRestart(cr, bTryToAppendFiles, nfile, fnm, &continuationOptions.appendFiles, &continuationOptions.startedFromCheckpoint);
+    handleRestart(cr, ms, bTryToAppendFiles, nfile, fnm, &continuationOptions.appendFiles, &continuationOptions.startedFromCheckpoint);
 
     mdrunOptions.rerun            = opt2bSet("-rerun", nfile, fnm);
     mdrunOptions.ntompOptionIsSet = opt2parg_bSet("-ntomp", asize(pa), pa);
@@ -529,11 +518,16 @@ int Mdrunner::mainFunction(int argc, char *argv[])
 
     /* Log file has to be closed in mdrunner if we are appending to it
        (fplog not set here) */
-    if (MASTER(cr) && !continuationOptions.appendFiles)
+    if (fplog != nullptr)
     {
         gmx_log_close(fplog);
     }
 
+    if (GMX_LIB_MPI)
+    {
+        done_commrec(cr);
+    }
+    done_multisim(ms);
     return rc;
 }
 
index c216526229bc66d88429507cd65f439eefc39ab6..87dfdb600ad559517aed99a4cce103cea36800bd 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2011,2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -51,6 +51,7 @@
 #include "gromacs/math/vec.h"
 #include "gromacs/mdlib/main.h"
 #include "gromacs/mdtypes/commrec.h"
+#include "gromacs/mdtypes/forcerec.h" // only for gmx_enerdata_t
 #include "gromacs/mdtypes/inputrec.h"
 #include "gromacs/mdtypes/md_enums.h"
 #include "gromacs/mdtypes/state.h"
@@ -164,15 +165,15 @@ init_replica_exchange(FILE                            *fplog,
 
     fprintf(fplog, "\nInitializing Replica Exchange\n");
 
-    if (ms == nullptr || ms->nsim == 1)
+    if (!isMultiSim(ms) || ms->nsim == 1)
     {
-        gmx_fatal(FARGS, "Nothing to exchange with only one replica, maybe you forgot to set the -multi option of mdrun?");
+        gmx_fatal(FARGS, "Nothing to exchange with only one replica, maybe you forgot to set the -multidir option of mdrun?");
     }
     if (!EI_DYNAMICS(ir->eI))
     {
         gmx_fatal(FARGS, "Replica exchange is only supported by dynamical simulations");
         /* Note that PAR(cr) is defined by cr->nnodes > 1, which is
-         * distinct from MULTISIM(cr). A multi-simulation only runs
+         * distinct from isMultiSim(ms). A multi-simulation only runs
          * with real MPI parallelism, but this does not imply PAR(cr)
          * is true!
          *
@@ -380,7 +381,7 @@ init_replica_exchange(FILE                            *fplog,
     re->nst = nst;
     if (replExParams.randomSeed == -1)
     {
-        if (MASTERSIM(ms))
+        if (isMasterSim(ms))
         {
             re->seed = static_cast<int>(gmx::makeRandomSeed());
         }
@@ -1211,7 +1212,8 @@ prepare_to_do_exchange(struct gmx_repl_ex *re,
     }
 }
 
-gmx_bool replica_exchange(FILE *fplog, const t_commrec *cr, struct gmx_repl_ex *re,
+gmx_bool replica_exchange(FILE *fplog, const t_commrec *cr,
+                          const gmx_multisim_t *ms, struct gmx_repl_ex *re,
                           t_state *state, const gmx_enerdata_t *enerd,
                           t_state *state_local, gmx_int64_t step, real time)
 {
@@ -1228,7 +1230,7 @@ gmx_bool replica_exchange(FILE *fplog, const t_commrec *cr, struct gmx_repl_ex *
     if (MASTER(cr))
     {
         replica_id  = re->repl;
-        test_for_replica_exchange(fplog, cr->ms, re, enerd, det(state_local->box), step, time);
+        test_for_replica_exchange(fplog, ms, re, enerd, det(state_local->box), step, time);
         prepare_to_do_exchange(re, replica_id, &maxswap, &bThisReplicaExchanged);
     }
     /* Do intra-simulation broadcast so all processors belonging to
@@ -1273,7 +1275,7 @@ gmx_bool replica_exchange(FILE *fplog, const t_commrec *cr, struct gmx_repl_ex *
                     {
                         fprintf(debug, "Exchanging %d with %d\n", replica_id, exchange_partner);
                     }
-                    exchange_state(cr->ms, exchange_partner, state);
+                    exchange_state(ms, exchange_partner, state);
                 }
             }
             /* For temperature-type replica exchange, we need to scale
index 30c75258cb94373e4a08dba8f16cda339060e599..81e6de3ad3f53484476486158932f1f5c27fc9d7 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
  * Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2011,2012,2013,2014,2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2013,2014,2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -77,6 +77,7 @@ init_replica_exchange(FILE                            *fplog,
 
 gmx_bool replica_exchange(FILE *fplog,
                           const t_commrec *cr,
+                          const gmx_multisim_t *ms,
                           gmx_repl_ex_t re,
                           t_state *state, const gmx_enerdata_t *enerd,
                           t_state *state_local,
index a4d390e2039f1321e54c900f875480e5582cb587..2ad74e10be2e663094ba8ce2fd3a5fa6e16831db 100644 (file)
@@ -150,7 +150,7 @@ void Mdrunner::reinitializeOnSpawnedThread()
     // Mdrunner.
     fnm = dup_tfn(nfile, fnm);
 
-    cr  = reinitialize_commrec_for_this_thread(cr);
+    cr  = reinitialize_commrec_for_this_thread(cr, ms);
 
     if (!MASTER(cr))
     {
@@ -217,7 +217,7 @@ t_commrec *Mdrunner::spawnThreads(int numThreadsToLaunch)
     GMX_UNUSED_VALUE(mdrunner_start_fn);
 #endif
 
-    return reinitialize_commrec_for_this_thread(cr);
+    return reinitialize_commrec_for_this_thread(cr, ms);
 }
 
 }      // namespace
@@ -444,9 +444,9 @@ int Mdrunner::mdrunner()
 
     /* CAUTION: threads may be started later on in this function, so
        cr doesn't reflect the final parallel state right now */
-    gmx::MDModules mdModules;
-    t_inputrec     inputrecInstance;
-    t_inputrec    *inputrec = &inputrecInstance;
+    std::unique_ptr<gmx::MDModules> mdModules(new gmx::MDModules);
+    t_inputrec                      inputrecInstance;
+    t_inputrec                     *inputrec = &inputrecInstance;
     snew(mtop, 1);
 
     if (mdrunOptions.continuationOptions.appendFiles)
@@ -496,9 +496,9 @@ int Mdrunner::mdrunner()
     gmx::LoggerOwner logOwner(buildLogger(fplog, cr));
     gmx::MDLogger    mdlog(logOwner.logger());
 
-    hwinfo = gmx_detect_hardware(mdlog, cr);
+    hwinfo = gmx_detect_hardware(mdlog);
 
-    gmx_print_detected_hardware(fplog, cr, mdlog, hwinfo);
+    gmx_print_detected_hardware(fplog, cr, ms, mdlog, hwinfo);
 
     std::vector<int> gpuIdsToUse;
     auto             compatibleGpus = getCompatibleGpus(hwinfo->gpu_info);
@@ -682,7 +682,7 @@ int Mdrunner::mdrunner()
     GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
 
     // TODO: Error handling
-    mdModules.assignOptionsToModules(*inputrec->params, nullptr);
+    mdModules->assignOptionsToModules(*inputrec->params, nullptr);
 
     if (fplog != nullptr)
     {
@@ -790,9 +790,9 @@ int Mdrunner::mdrunner()
     snew(fcd, 1);
 
     /* This needs to be called before read_checkpoint to extend the state */
-    init_disres(fplog, mtop, inputrec, cr, fcd, globalState.get(), replExParams.exchangeInterval > 0);
+    init_disres(fplog, mtop, inputrec, cr, ms, fcd, globalState.get(), replExParams.exchangeInterval > 0);
 
-    init_orires(fplog, mtop, inputrec, cr, globalState.get(), &(fcd->orires));
+    init_orires(fplog, mtop, inputrec, cr, ms, globalState.get(), &(fcd->orires));
 
     if (inputrecDeform(inputrec))
     {
@@ -913,19 +913,13 @@ int Mdrunner::mdrunner()
 
     /* Initialize per-physical-node MPI process/thread ID and counters. */
     gmx_init_intranode_counters(cr);
-    if (cr->ms && cr->ms->nsim > 1 && !opt2bSet("-multidir", nfile, fnm))
-    {
-        GMX_LOG(mdlog.info).asParagraph().
-            appendText("The -multi flag is deprecated, and may be removed in a future version. Please "
-                       "update your workflows to use -multidir instead.");
-    }
 #if GMX_MPI
-    if (MULTISIM(cr))
+    if (isMultiSim(ms))
     {
         GMX_LOG(mdlog.warning).asParagraph().appendTextFormatted(
                 "This is simulation %d out of %d running as a composite GROMACS\n"
                 "multi-simulation job. Setup for this simulation:\n",
-                cr->ms->sim, cr->ms->nsim);
+                ms->sim, ms->nsim);
     }
     GMX_LOG(mdlog.warning).appendTextFormatted(
             "Using %d MPI %s\n",
@@ -943,7 +937,7 @@ int Mdrunner::mdrunner()
     check_and_update_hw_opt_2(&hw_opt, inputrec->cutoff_scheme);
 
     /* Check and update the number of OpenMP threads requested */
-    checkAndUpdateRequestedNumOpenmpThreads(&hw_opt, *hwinfo, cr, pmeRunMode, *mtop);
+    checkAndUpdateRequestedNumOpenmpThreads(&hw_opt, *hwinfo, cr, ms, pmeRunMode, *mtop);
 
     gmx_omp_nthreads_init(mdlog, cr,
                           hwinfo->nthreads_hw_avail,
@@ -1023,7 +1017,7 @@ int Mdrunner::mdrunner()
     {
         // Produce the task assignment for this rank.
         gpuTaskAssignment = runTaskAssignment(gpuIdsToUse, userGpuTaskAssignment, *hwinfo,
-                                              mdlog, cr, gpuTasksOnThisRank);
+                                              mdlog, cr, ms, gpuTasksOnThisRank);
     }
     GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
 
@@ -1040,9 +1034,9 @@ int Mdrunner::mdrunner()
     {
         MPI_Barrier(cr->mpi_comm_mysim);
     }
-    if (MULTISIM(cr))
+    if (isMultiSim(ms))
     {
-        MPI_Barrier(cr->ms->mpi_comm_masters);
+        MPI_Barrier(ms->mpi_comm_masters);
     }
 #endif
 
@@ -1100,7 +1094,7 @@ int Mdrunner::mdrunner()
 
     checkHardwareOversubscription(numThreadsOnThisRank,
                                   *hwinfo->hardwareTopology,
-                                  cr, mdlog);
+                                  cr, ms, mdlog);
 
     if (hw_opt.thread_affinity != threadaffOFF)
     {
@@ -1111,9 +1105,14 @@ int Mdrunner::mdrunner()
         gmx_check_thread_affinity_set(mdlog, cr,
                                       &hw_opt, hwinfo->nthreads_hw_avail, TRUE);
 
+        int numThreadsOnThisNode, intraNodeThreadOffset;
+        analyzeThreadsOnThisNode(cr, ms, nullptr, numThreadsOnThisRank, &numThreadsOnThisNode,
+                                 &intraNodeThreadOffset);
+
         /* Set the CPU affinity */
         gmx_set_thread_affinity(mdlog, cr, &hw_opt, *hwinfo->hardwareTopology,
-                                numThreadsOnThisRank, nullptr);
+                                numThreadsOnThisRank, numThreadsOnThisNode,
+                                intraNodeThreadOffset, nullptr);
     }
 
     if (mdrunOptions.timingOptions.resetStep > -1)
@@ -1152,7 +1151,7 @@ int Mdrunner::mdrunner()
     {
         /* Initiate forcerecord */
         fr                 = mk_forcerec();
-        fr->forceProviders = mdModules.initForceProviders();
+        fr->forceProviders = mdModules->initForceProviders();
         init_forcerec(fplog, mdlog, fr, fcd,
                       inputrec, mtop, cr, box,
                       opt2fn("-table", nfile, fnm),
@@ -1321,11 +1320,11 @@ int Mdrunner::mdrunner()
         }
 
         /* Now do whatever the user wants us to do (how flexible...) */
-        my_integrator(inputrec->eI) (fplog, cr, mdlog, nfile, fnm,
+        my_integrator(inputrec->eI) (fplog, cr, ms, mdlog, nfile, fnm,
                                      oenv,
                                      mdrunOptions,
                                      vsite, constr,
-                                     mdModules.outputProvider(),
+                                     mdModules->outputProvider(),
                                      inputrec, mtop,
                                      fcd,
                                      globalState.get(),
@@ -1363,7 +1362,7 @@ int Mdrunner::mdrunner()
                inputrec, nrnb, wcycle, walltime_accounting,
                fr ? fr->nbv : nullptr,
                pmedata,
-               EI_DYNAMICS(inputrec->eI) && !MULTISIM(cr));
+               EI_DYNAMICS(inputrec->eI) && !isMultiSim(ms));
 
     // Free PME data
     if (pmedata)
@@ -1378,9 +1377,10 @@ int Mdrunner::mdrunner()
     // As soon as we destroy GPU contexts after mdrunner() exits, these lines should go.
     mdAtoms.reset(nullptr);
     globalState.reset(nullptr);
+    mdModules.reset(nullptr);   // destruct force providers here as they might also use the GPU
 
     /* Free GPU memory and set a physical node tMPI barrier (which should eventually go away) */
-    free_gpu_resources(fr, cr);
+    free_gpu_resources(fr, cr, ms);
     free_gpu(nonbondedDeviceInfo);
     free_gpu(pmeDeviceInfo);
 
@@ -1399,6 +1399,7 @@ int Mdrunner::mdrunner()
     if (MASTER(cr) && continuationOptions.appendFiles)
     {
         gmx_log_close(fplog);
+        fplog = nullptr;
     }
 
     rc = (int)gmx_get_stop_condition();
@@ -1409,6 +1410,7 @@ int Mdrunner::mdrunner()
        wait for that. */
     if (PAR(cr) && MASTER(cr))
     {
+        done_commrec(cr);
         tMPI_Finalize();
     }
 #endif
index 51c84e447181a2a65a47deb85bf3e70479a8f198..6778e89b781e806d58bc7884c2bc815c663b6267 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2015,2017, by the GROMACS development team, led by
+ * Copyright (c) 2015,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -146,8 +146,6 @@ class Mdrunner
         const char                      *pme_fft_opt = nullptr;
         //! Command-line override for the duration of a neighbor list with the Verlet scheme.
         int                              nstlist_cmdline = 0;
-        //! Number of simulations in multi-simulation set.
-        int                              nmultisim = 0;
         //! Parameters for replica-exchange simulations.
         ReplicaExchangeParameters        replExParams;
         //! Print a warning if any force is larger than this (in kJ/mol nm).
@@ -156,6 +154,8 @@ class Mdrunner
         FILE                            *fplog;
         //! Handle to communication data structure.
         t_commrec                       *cr;
+        //! Handle to multi-simulation handler.
+        gmx_multisim_t                  *ms;
 
     public:
         /*! \brief Defaulted constructor.
index 663fa9803c90256659cb16d40e45b071883eb2a1..c926529a7b85a3076b346ec91a7c6e6aaad67466 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+# Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
 # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
 # and including many others, as listed in the AUTHORS file in the
 # top-level source directory and at http://www.gromacs.org.
@@ -38,6 +38,8 @@ add_library(mdrun_test_objlib OBJECT
     mdruncomparisonfixture.cpp
     moduletest.cpp
     terminationhelper.cpp
+    # PME tests
+    pmetest.cpp
     )
 
 set(testname "MdrunTests")
@@ -56,8 +58,6 @@ gmx_add_gtest_executable(
     swapcoords.cpp
     interactiveMD.cpp
     termination.cpp
-    # PME tests; FIXME: move this back into mdrun_test_objlib above and figure out the MPI race issue
-    pmetest.cpp
     # pseudo-library for code for testing mdrun
     $<TARGET_OBJECTS:mdrun_test_objlib>
     # pseudo-library for code for mdrun
diff --git a/src/programs/mdrun/tests/OctaneSandwich.mdp b/src/programs/mdrun/tests/OctaneSandwich.mdp
deleted file mode 100644 (file)
index c4354e9..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-dt                       = 0.005
-nsteps                   = 2
-define                   = -DPOSRES
-tcoupl                   = Berendsen
-tc-grps                  = System
-tau-t                    = 0.5
-ref-t                    = 300
-constraints              = all-bonds
-cutoff-scheme            = Verlet
-swapcoords               = Z
-swap_frequency           = 1
-split_group0             = Ch0
-split_group1             = Ch1
-massw_split0             = yes
-massw_split1             = no
-solvent_group            = SOL
-cyl0_r                   = 1
-cyl0_up                  = 0.5
-cyl0_down                = 0.5
-cyl1_r                   = 1
-cyl1_up                  = 0.5
-cyl1_down                = 0.5
-coupl_steps              = 5
-iontypes                 = 2
-iontype0-name            = NA+
-iontype0-in-A            = 8
-iontype0-in-B            = 11
-iontype1-name            = CL-
-iontype1-in-A            = -1
-iontype1-in-B            = -1
-threshold                = 1
index 45ef661ed68d5930e3d605a861997986e0dd58b4..30a0ac9dc6a5419dd788bf313d98c67dcc8f3f85 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -76,9 +76,19 @@ typedef gmx::test::ImdTestFixture ImdTest;
  */
 TEST_F(ImdTest, ImdCanRun)
 {
-    std::string name = "spc2";
-    runner_.useTopGroAndNdxFromDatabase(name.c_str());
-    runner_.mdpInputFileName_ = fileManager_.getInputFilePath((name + "-IMD.mdp").c_str());
+    runner_.useTopGroAndNdxFromDatabase("spc2");
+    const std::string mdpContents = R"(
+        dt            = 0.004
+        nsteps        = 2
+        tcoupl        = Berendsen
+        tc-grps       = System
+        tau-t         = 0.5
+        ref-t         = 300
+        constraints   = all-bonds
+        cutoff-scheme = Verlet
+        IMD-group     = SecondWaterMolecule
+    )";
+    runner_.useStringAsMdpFile(mdpContents);
 
     EXPECT_EQ(0, runner_.callGrompp());
 
index d5244f3fbe522a0d1993dfe93fe921e3f26d7335..de04f7f7b963893a7b823b034b7fc7177880306c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -96,7 +96,6 @@ SimulationRunner::SimulationRunner(TestFileManager *fileManager) :
     groFileName_(),
     fullPrecisionTrajectoryFileName_(),
     ndxFileName_(),
-    mdpInputFileName_(fileManager->getTemporaryFilePath("input.mdp")),
     mdpOutputFileName_(fileManager->getTemporaryFilePath("output.mdp")),
     tprFileName_(fileManager->getTemporaryFilePath(".tpr")),
     logFileName_(fileManager->getTemporaryFilePath(".log")),
@@ -132,7 +131,7 @@ SimulationRunner::useStringAsMdpFile(const char *mdpString)
 void
 SimulationRunner::useStringAsMdpFile(const std::string &mdpString)
 {
-    gmx::TextWriter::writeFileFromString(mdpInputFileName_, mdpString);
+    mdpInputContents_ = mdpString;
 }
 
 void
@@ -158,11 +157,17 @@ SimulationRunner::useGroFromDatabase(const char *name)
 int
 SimulationRunner::callGromppOnThisRank(const CommandLine &callerRef)
 {
+    const std::string mdpInputFileName(fileManager_.getTemporaryFilePath("input.mdp"));
+    gmx::TextWriter::writeFileFromString(mdpInputFileName, mdpInputContents_);
+
     CommandLine caller;
     caller.append("grompp");
     caller.merge(callerRef);
-    caller.addOption("-f", mdpInputFileName_);
-    caller.addOption("-n", ndxFileName_);
+    caller.addOption("-f", mdpInputFileName);
+    if (!ndxFileName_.empty())
+    {
+        caller.addOption("-n", ndxFileName_);
+    }
     caller.addOption("-p", topFileName_);
     caller.addOption("-c", groFileName_);
     caller.addOption("-r", groFileName_);
@@ -270,6 +275,10 @@ MdrunTestFixture::MdrunTestFixture() : runner_(&fileManager_)
 
 MdrunTestFixture::~MdrunTestFixture()
 {
+#if GMX_LIB_MPI
+    // fileManager_ should only clean up after all the ranks are done.
+    MPI_Barrier(MPI_COMM_WORLD);
+#endif
 }
 
 } // namespace test
index c7649b6d47befc253b6bc30d99d5d02441e1bda9..386c98ddb5fc8abb03476c82a83f8cd94ee7d019 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -133,7 +133,6 @@ class SimulationRunner
         std::string reducedPrecisionTrajectoryFileName_;
         std::string groOutputFileName_;
         std::string ndxFileName_;
-        std::string mdpInputFileName_;
         std::string mdpOutputFileName_;
         std::string tprFileName_;
         std::string logFileName_;
@@ -142,6 +141,8 @@ class SimulationRunner
         std::string swapFileName_;
         int         nsteps_;
         //@}
+        //! What will be written into a temporary mdp file before the grompp call
+        std::string mdpInputContents_;
 
     private:
         TestFileManager &fileManager_;
index 720739c78557f1a10a3bc6fbd6c39c74458bdf8a..386474de9dc6a620bc0e2c10f307aa0dae1c9fce 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -82,19 +82,18 @@ TEST_P(MultiSimTest, ExitsNormallyWithDifferentNumbersOfStepsPerSimulation)
         /* Can't test multi-sim without multiple ranks. */
         return;
     }
+    SimulationRunner runner(&fileManager_);
+    runner.useTopGroAndNdxFromDatabase("spc2");
 
     const char *pcoupl = GetParam();
     // Do some different small numbers of steps in each simulation
     int         numSteps = rank_ % 4;
-    organizeMdpFile(pcoupl, numSteps);
+    organizeMdpFile(&runner, pcoupl, numSteps);
     /* Call grompp on every rank - the standard callGrompp() only runs
        grompp on rank 0. */
-    EXPECT_EQ(0, runner_.callGromppOnThisRank());
+    EXPECT_EQ(0, runner.callGromppOnThisRank());
 
-    // mdrun names the files without the rank suffix
-    runner_.tprFileName_ = mdrunTprFileName_;
-    // TODO it would be preferable to be able to assert no error was given
-    ASSERT_EQ(0, runner_.callMdrun(*mdrunCaller_));
+    ASSERT_EQ(0, runner.callMdrun(*mdrunCaller_));
 }
 
 /* Note, not all preprocessor implementations nest macro expansions
index c4fe4ea68c8fc93974550790689afab939d3e629..bfa3378a3fea0362cafb15aa64840c55a403d16d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -37,8 +37,6 @@
  * \brief
  * Tests for the mdrun multi-simulation functionality
  *
- * \todo Test mdrun -multidir also
- *
  * \author Mark Abraham <mark.j.abraham@gmail.com>
  * \ingroup module_mdrun_integration_tests
  */
@@ -70,29 +68,31 @@ namespace test
 
 MultiSimTest::MultiSimTest() : size_(gmx_node_num()),
                                rank_(gmx_node_rank()),
-                               mdrunCaller_(new CommandLine)
+                               mdrunCaller_(new CommandLine),
+                               fileManager_()
 {
-    runner_.mdpInputFileName_  = fileManager_.getTemporaryFilePath(formatString("input%d.mdp", rank_));
-    runner_.mdpOutputFileName_ = fileManager_.getTemporaryFilePath(formatString("output%d.mdp", rank_));
-
-    /* grompp needs to name the .tpr file so that when mdrun appends
-       the MPI rank, it will find the right file. If we just used
-       "%d.tpr" then \c TestFileManager prefixes that with an
-       underscore. Then, there is no way for mdrun to be told the
-       right name, because if you add the underscore manually, you get
-       a second one from \c TestFileManager. However, it's easy to
-       just start the suffix with "topol" in both cases. */
-    runner_.tprFileName_ = fileManager_.getTemporaryFilePath(formatString("topol%d.tpr", rank_));
-    mdrunTprFileName_    = fileManager_.getTemporaryFilePath("topol.tpr");
+    const char *directoryNameFormat = "sim_%d";
 
-    runner_.useTopGroAndNdxFromDatabase("spc2");
+    // Modify the file manager to have a temporary directory unique to
+    // each simulation. No need to have a mutex on this, nobody else
+    // can access the fileManager_ yet because we only just
+    // constructed it.
+    std::string originalTempDirectory = fileManager_.getOutputTempDirectory();
+    std::string newTempDirectory      = Path::join(originalTempDirectory, formatString(directoryNameFormat, rank_));
+    Directory::create(newTempDirectory);
+    fileManager_.setOutputTempDirectory(newTempDirectory);
 
     mdrunCaller_->append("mdrun");
-    mdrunCaller_->addOption("-multi", size_);
+    mdrunCaller_->addOption("-multidir");
+    for (int i = 0; i != size_; ++i)
+    {
+        mdrunCaller_->append(Path::join(originalTempDirectory, formatString(directoryNameFormat, i)));
+    }
 }
 
-void MultiSimTest::organizeMdpFile(const char *controlVariable,
-                                   int         numSteps)
+void MultiSimTest::organizeMdpFile(SimulationRunner *runner,
+                                   const char       *controlVariable,
+                                   int               numSteps)
 {
     const real  baseTemperature = 298;
     const real  basePressure    = 1;
@@ -123,7 +123,7 @@ void MultiSimTest::organizeMdpFile(const char *controlVariable,
                         replica exchange to occur. */
                      std::max(baseTemperature - 10 * rank_, real(0)),
                      controlVariable);
-    runner_.useStringAsMdpFile(mdpFileContents);
+    runner->useStringAsMdpFile(mdpFileContents);
 }
 
 void MultiSimTest::runExitsNormallyTest()
@@ -134,15 +134,16 @@ void MultiSimTest::runExitsNormallyTest()
         return;
     }
 
+    SimulationRunner runner(&fileManager_);
+    runner.useTopGroAndNdxFromDatabase("spc2");
+
     const char *pcoupl = GetParam();
-    organizeMdpFile(pcoupl);
+    organizeMdpFile(&runner, pcoupl);
     /* Call grompp on every rank - the standard callGrompp() only runs
        grompp on rank 0. */
-    EXPECT_EQ(0, runner_.callGromppOnThisRank());
+    EXPECT_EQ(0, runner.callGromppOnThisRank());
 
-    // mdrun names the files without the rank suffix
-    runner_.tprFileName_ = mdrunTprFileName_;
-    ASSERT_EQ(0, runner_.callMdrun(*mdrunCaller_));
+    ASSERT_EQ(0, runner.callMdrun(*mdrunCaller_));
 }
 
 void MultiSimTest::runMaxhTest()
@@ -153,22 +154,18 @@ void MultiSimTest::runMaxhTest()
         return;
     }
 
-    TerminationHelper helper(&fileManager_, mdrunCaller_.get(), &runner_);
+    SimulationRunner runner(&fileManager_);
+    runner.useTopGroAndNdxFromDatabase("spc2");
+
+    TerminationHelper helper(&fileManager_, mdrunCaller_.get(), &runner);
     // Make sure -maxh has a chance to propagate
     int               numSteps = 100;
-    organizeMdpFile("pcoupl = no", numSteps);
+    organizeMdpFile(&runner, "pcoupl = no", numSteps);
     /* Call grompp on every rank - the standard callGrompp() only runs
        grompp on rank 0. */
-    EXPECT_EQ(0, runner_.callGromppOnThisRank());
-
-    // mdrun names the files without the rank suffix
-    runner_.tprFileName_ = mdrunTprFileName_;
+    EXPECT_EQ(0, runner.callGromppOnThisRank());
 
-    // The actual output checkpoint file gets a rank suffix, so
-    // handle that in the expected result.
-    std::string expectedCptFileName
-        = Path::concatenateBeforeExtension(runner_.cptFileName_, formatString("%d", rank_));
-    helper.runFirstMdrun(expectedCptFileName);
+    helper.runFirstMdrun(runner.cptFileName_);
     helper.runSecondMdrun();
 }
 
index 1dde042dff5fe52e686e0a9155907b3ed9979eae..5633f834db693a30405776b598176c348a46b8a4 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -68,7 +68,8 @@ typedef std::unique_ptr<CommandLine> CommandLinePointer;
  *
  * \ingroup module_mdrun_integration_tests
  */
-class MultiSimTest : public gmx::test::ParameterizedMdrunTestFixture
+class MultiSimTest : public ::testing::Test,
+                     public ::testing::WithParamInterface<const char *>
 {
     public:
         //! Constructor
@@ -81,14 +82,17 @@ class MultiSimTest : public gmx::test::ParameterizedMdrunTestFixture
          * and doing it this way allows this function to be re-used
          * for testing replica-exchange.
          *
+         * \param runner          The simulation runner that uses the
+         *                        mdp file that is organized.
          * \param controlVariable Allows parameterization to work with
          * T, P or (later) lambda as the control variable, by passing a
          * string with "mdp-param = value" such that different paths
          * in init_replica_exchange() are followed.
          * \param numSteps        Number of MD steps to perform.
          */
-        void organizeMdpFile(const char *controlVariable,
-                             int         numSteps = 2);
+        void organizeMdpFile(SimulationRunner *runner,
+                             const char       *controlVariable,
+                             int               numSteps = 2);
         //! Test that a basic simulation works
         void runExitsNormallyTest();
         //! Test that mdrun -maxh and restart works
@@ -99,8 +103,8 @@ class MultiSimTest : public gmx::test::ParameterizedMdrunTestFixture
         int                rank_;
         //! Object for building the mdrun command line
         CommandLinePointer mdrunCaller_;
-        //! Name of .tpr file to be used by mdrun
-        std::string        mdrunTprFileName_;
+        //! Manages temporary files during the test.
+        TestFileManager    fileManager_;
 };
 
 } // namespace
index 0c11b336b6df80b25ba03c11f83ee0dd5686de46..dc4cff55e132d5e5c4d19c95d9eee7b13f4242aa 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -85,6 +85,10 @@ class PmeTest : public MdrunTestFixture
         static void SetUpTestCase();
         //! Store whether any compatible GPUs exist.
         static bool s_hasCompatibleCudaGpus;
+        //! Convenience typedef
+        using RunModesList = std::map < std::string, std::vector < const char *>>;
+        //! Runs the test with the given inputs
+        void runTest(const RunModesList &runModes);
 };
 
 bool PmeTest::s_hasCompatibleCudaGpus = false;
@@ -106,18 +110,8 @@ void PmeTest::SetUpTestCase()
     free_gpu_info(&gpuInfo);
 }
 
-TEST_F(PmeTest, ReproducesEnergies)
+void PmeTest::runTest(const RunModesList &runModes)
 {
-    const int   nsteps     = 20;
-    std::string theMdpFile = formatString("coulombtype     = PME\n"
-                                          "nstcalcenergy   = 1\n"
-                                          "nstenergy       = 1\n"
-                                          "pme-order       = 4\n"
-                                          "nsteps          = %d\n",
-                                          nsteps);
-
-    runner_.useStringAsMdpFile(theMdpFile);
-
     const std::string inputFile = "spc-and-methanol";
     runner_.useTopGroAndNdxFromDatabase(inputFile.c_str());
 
@@ -128,17 +122,6 @@ TEST_F(PmeTest, ReproducesEnergies)
 
     EXPECT_EQ(0, runner_.callGrompp());
 
-    //TODO test all proper/improper combinations in more thorough way?
-    std::map < std::string, std::vector < const char *>> runModes;
-    runModes["PmeOnCpu"]         = {"-pme", "cpu"};
-    runModes["PmeAuto"]          = {"-pme", "auto"};
-    runModes["PmeOnGpuFftOnCpu"] = {"-pme", "gpu", "-pmefft", "cpu"};
-    runModes["PmeOnGpuFftOnGpu"] = {"-pme", "gpu", "-pmefft", "gpu"};
-    runModes["PmeOnGpuFftAuto"]  = {"-pme", "gpu", "-pmefft", "auto"};
-    // same manual modes but marked for PME tuning
-    runModes["PmeOnCpuTune"]         = {"-pme", "cpu"};
-    runModes["PmeOnGpuFftOnCpuTune"] = {"-pme", "gpu", "-pmefft", "cpu"};
-    runModes["PmeOnGpuFftOnGpuTune"] = {"-pme", "gpu", "-pmefft", "gpu"};
     TestReferenceData    refData;
     TestReferenceChecker rootChecker(refData.rootChecker());
     const bool           thisRankChecks = (gmx_node_rank() == 0);
@@ -175,6 +158,7 @@ TEST_F(PmeTest, ReproducesEnergies)
         {
             commandLine.addOption("-npme", 1);
         }
+
         ASSERT_EQ(0, runner_.callMdrun(commandLine));
 
         if (thisRankChecks)
@@ -182,13 +166,14 @@ TEST_F(PmeTest, ReproducesEnergies)
             auto energyReader      = openEnergyFileToReadFields(runner_.edrFileName_, {"Coul. recip.", "Total Energy", "Kinetic En."});
             auto conservedChecker  = rootChecker.checkCompound("Energy", "Conserved");
             auto reciprocalChecker = rootChecker.checkCompound("Energy", "Reciprocal");
-            for (int i = 0; i <= nsteps; i++)
+            bool firstIteration    = true;
+            while (energyReader->readNextFrame())
             {
-                EnergyFrame frame            = energyReader->frame();
-                std::string stepNum          = gmx::formatString("%d", i);
-                const real  conservedEnergy  = frame.at("Total Energy");
-                const real  reciprocalEnergy = frame.at("Coul. recip.");
-                if (i == 0)
+                const EnergyFrame &frame            = energyReader->frame();
+                const std::string  stepName         = frame.getFrameName();
+                const real         conservedEnergy  = frame.at("Total Energy");
+                const real         reciprocalEnergy = frame.at("Coul. recip.");
+                if (firstIteration)
                 {
                     // use first step values as references for tolerance
                     const real startingKineticEnergy = frame.at("Kinetic En.");
@@ -196,31 +181,71 @@ TEST_F(PmeTest, ReproducesEnergies)
                     const auto reciprocalTolerance   = relativeToleranceAsFloatingPoint(reciprocalEnergy, 3e-5);
                     reciprocalChecker.setDefaultTolerance(reciprocalTolerance);
                     conservedChecker.setDefaultTolerance(conservedTolerance);
+                    firstIteration = false;
                 }
-                conservedChecker.checkReal(conservedEnergy, stepNum.c_str());
+                conservedChecker.checkReal(conservedEnergy, stepName.c_str());
                 if (!usePmeTuning) // with PME tuning come differing grids and differing reciprocal energy
                 {
-                    reciprocalChecker.checkReal(reciprocalEnergy, stepNum.c_str());
+                    reciprocalChecker.checkReal(reciprocalEnergy, stepName.c_str());
                 }
             }
         }
-        // FIXME: without this barrier, one of the mdruns was somehow having a non-PME inputrec (!)
-#if GMX_LIB_MPI
-        if (parallelRun)
-        {
-            MPI_Barrier(MPI_COMM_WORLD);
-        }
-#endif
     }
+}
 
-    // This is a workaround for the output files to not be deleted in a parallel run.
-    // TODO: consider moving the barrier into the file manager destructor.
-#if GMX_LIB_MPI
-    if (parallelRun)
-    {
-        MPI_Barrier(MPI_COMM_WORLD);
-    }
-#endif
+TEST_F(PmeTest, ReproducesEnergies)
+{
+    const int         nsteps     = 20;
+    const std::string theMdpFile = formatString("coulombtype     = PME\n"
+                                                "nstcalcenergy   = 1\n"
+                                                "nstenergy       = 1\n"
+                                                "pme-order       = 4\n"
+                                                "nsteps          = %d\n",
+                                                nsteps
+                                                );
+
+    runner_.useStringAsMdpFile(theMdpFile);
+
+    //TODO test all proper/improper combinations in more thorough way?
+    RunModesList runModes;
+    runModes["PmeOnCpu"]         = {"-pme", "cpu"};
+    runModes["PmeAuto"]          = {"-pme", "auto"};
+    runModes["PmeOnGpuFftOnCpu"] = {"-pme", "gpu", "-pmefft", "cpu"};
+    runModes["PmeOnGpuFftOnGpu"] = {"-pme", "gpu", "-pmefft", "gpu"};
+    runModes["PmeOnGpuFftAuto"]  = {"-pme", "gpu", "-pmefft", "auto"};
+    // same manual modes but marked for PME tuning
+    runModes["PmeOnCpuTune"]         = {"-pme", "cpu"};
+    runModes["PmeOnGpuFftOnCpuTune"] = {"-pme", "gpu", "-pmefft", "cpu"};
+    runModes["PmeOnGpuFftOnGpuTune"] = {"-pme", "gpu", "-pmefft", "gpu"};
+
+    runTest(runModes);
+}
+
+TEST_F(PmeTest, ScalesTheBox)
+{
+    const int         nsteps     = 0;
+    const std::string theMdpFile = formatString("coulombtype     = PME\n"
+                                                "nstcalcenergy   = 1\n"
+                                                "nstenergy       = 1\n"
+                                                "pme-order       = 4\n"
+                                                "pbc             = xy\n"
+                                                "nwall           = 2\n"
+                                                "ewald-geometry  = 3dc\n"
+                                                "wall_atomtype   = OMet CMet\n"
+                                                "wall_density    = 9 9.0\n"
+                                                "wall-ewald-zfac = 5\n"
+                                                "nsteps          = %d\n",
+                                                nsteps
+                                                );
+
+    runner_.useStringAsMdpFile(theMdpFile);
+
+    RunModesList runModes;
+    runModes["PmeOnCpu"]         = {"-pme", "cpu"};
+    runModes["PmeOnGpuFftOnCpu"] = {"-pme", "gpu", "-pmefft", "cpu"};
+    runModes["PmeOnGpuFftOnGpu"] = {"-pme", "gpu", "-pmefft", "gpu"};
+
+    runTest(runModes);
 }
 
 }
index 2b05e3431586bb7adbb076ba174b6da7a001e36c..0690600f9d60e476eee10728dd8c450fdc92cb24 100644 (file)
@@ -2,49 +2,49 @@
 <?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
 <ReferenceData>
   <Energy Name="Conserved">
-    <Real Name="0">39.455055</Real>
-    <Real Name="1">39.454601</Real>
-    <Real Name="2">39.453709</Real>
-    <Real Name="3">39.453194</Real>
-    <Real Name="4">39.452827</Real>
-    <Real Name="5">39.451984</Real>
-    <Real Name="6">39.450413</Real>
-    <Real Name="7">39.448856</Real>
-    <Real Name="8">39.448353</Real>
-    <Real Name="9">39.448929</Real>
-    <Real Name="10">39.450169</Real>
-    <Real Name="11">39.4506</Real>
-    <Real Name="12">39.450726</Real>
-    <Real Name="13">39.450962</Real>
-    <Real Name="14">39.452282</Real>
-    <Real Name="15">39.454075</Real>
-    <Real Name="16">39.455303</Real>
-    <Real Name="17">39.455303</Real>
-    <Real Name="18">39.454796</Real>
-    <Real Name="19">39.454231</Real>
-    <Real Name="20">39.453823</Real>
+    <Real Name="Time 0.000000 Step 0">39.455055</Real>
+    <Real Name="Time 0.001000 Step 1">39.454601</Real>
+    <Real Name="Time 0.002000 Step 2">39.453709</Real>
+    <Real Name="Time 0.003000 Step 3">39.453194</Real>
+    <Real Name="Time 0.004000 Step 4">39.452827</Real>
+    <Real Name="Time 0.005000 Step 5">39.451984</Real>
+    <Real Name="Time 0.006000 Step 6">39.450413</Real>
+    <Real Name="Time 0.007000 Step 7">39.448856</Real>
+    <Real Name="Time 0.008000 Step 8">39.448353</Real>
+    <Real Name="Time 0.009000 Step 9">39.448929</Real>
+    <Real Name="Time 0.010000 Step 10">39.450169</Real>
+    <Real Name="Time 0.011000 Step 11">39.4506</Real>
+    <Real Name="Time 0.012000 Step 12">39.450726</Real>
+    <Real Name="Time 0.013000 Step 13">39.450962</Real>
+    <Real Name="Time 0.014000 Step 14">39.452282</Real>
+    <Real Name="Time 0.015000 Step 15">39.454075</Real>
+    <Real Name="Time 0.016000 Step 16">39.455303</Real>
+    <Real Name="Time 0.017000 Step 17">39.455303</Real>
+    <Real Name="Time 0.018000 Step 18">39.454796</Real>
+    <Real Name="Time 0.019000 Step 19">39.454231</Real>
+    <Real Name="Time 0.020000 Step 20">39.453823</Real>
   </Energy>
   <Energy Name="Reciprocal">
-    <Real Name="0">5.7102599</Real>
-    <Real Name="1">5.7090158</Real>
-    <Real Name="2">5.7027955</Real>
-    <Real Name="3">5.6922712</Real>
-    <Real Name="4">5.678308</Real>
-    <Real Name="5">5.6615648</Real>
-    <Real Name="6">5.6426487</Real>
-    <Real Name="7">5.6213832</Real>
-    <Real Name="8">5.5974426</Real>
-    <Real Name="9">5.5703311</Real>
-    <Real Name="10">5.5399575</Real>
-    <Real Name="11">5.5064549</Real>
-    <Real Name="12">5.4712629</Real>
-    <Real Name="13">5.4358544</Real>
-    <Real Name="14">5.4023991</Real>
-    <Real Name="15">5.3728585</Real>
-    <Real Name="16">5.3487535</Real>
-    <Real Name="17">5.3307228</Real>
-    <Real Name="18">5.3190498</Real>
-    <Real Name="19">5.3129902</Real>
-    <Real Name="20">5.3116117</Real>
+    <Real Name="Time 0.000000 Step 0">5.7102599</Real>
+    <Real Name="Time 0.001000 Step 1">5.7090158</Real>
+    <Real Name="Time 0.002000 Step 2">5.7027955</Real>
+    <Real Name="Time 0.003000 Step 3">5.6922712</Real>
+    <Real Name="Time 0.004000 Step 4">5.678308</Real>
+    <Real Name="Time 0.005000 Step 5">5.6615648</Real>
+    <Real Name="Time 0.006000 Step 6">5.6426487</Real>
+    <Real Name="Time 0.007000 Step 7">5.6213832</Real>
+    <Real Name="Time 0.008000 Step 8">5.5974426</Real>
+    <Real Name="Time 0.009000 Step 9">5.5703311</Real>
+    <Real Name="Time 0.010000 Step 10">5.5399575</Real>
+    <Real Name="Time 0.011000 Step 11">5.5064549</Real>
+    <Real Name="Time 0.012000 Step 12">5.4712629</Real>
+    <Real Name="Time 0.013000 Step 13">5.4358544</Real>
+    <Real Name="Time 0.014000 Step 14">5.4023991</Real>
+    <Real Name="Time 0.015000 Step 15">5.3728585</Real>
+    <Real Name="Time 0.016000 Step 16">5.3487535</Real>
+    <Real Name="Time 0.017000 Step 17">5.3307228</Real>
+    <Real Name="Time 0.018000 Step 18">5.3190498</Real>
+    <Real Name="Time 0.019000 Step 19">5.3129902</Real>
+    <Real Name="Time 0.020000 Step 20">5.3116117</Real>
   </Energy>
 </ReferenceData>
diff --git a/src/programs/mdrun/tests/refdata/PmeTest_ScalesTheBox.xml b/src/programs/mdrun/tests/refdata/PmeTest_ScalesTheBox.xml
new file mode 100644 (file)
index 0000000..c41bbf1
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="referencedata.xsl"?>
+<ReferenceData>
+  <Energy Name="Conserved">
+    <Real Name="Time 0.000000 Step 0">47.730976</Real>
+  </Energy>
+  <Energy Name="Reciprocal">
+    <Real Name="Time 0.000000 Step 0">5.717979</Real>
+  </Energy>
+</ReferenceData>
diff --git a/src/programs/mdrun/tests/spc2-IMD.mdp b/src/programs/mdrun/tests/spc2-IMD.mdp
deleted file mode 100644 (file)
index 72824a6..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-dt                       = 0.004
-nsteps                   = 2
-tcoupl                   = Berendsen
-tc-grps                  = System
-tau-t                    = 0.5
-ref-t                    = 300
-constraints              = all-bonds
-cutoff-scheme            = Verlet
-IMD-group                = SecondWaterMolecule
index 669591baa79b68ca3615986ed63a66f6bdf6233b..3a207c3129921a4815bd717827b53b84ce19e145 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -76,9 +76,42 @@ typedef gmx::test::SwapTestFixture CompelTest;
  * the swap state variables can be written to and read from checkpoint. */
 TEST_F(CompelTest, SwapCanRun)
 {
-    std::string name = "OctaneSandwich";
-    runner_.useTopGroAndNdxFromDatabase(name.c_str());
-    runner_.mdpInputFileName_ = fileManager_.getInputFilePath((name + ".mdp").c_str());
+    runner_.useTopGroAndNdxFromDatabase("OctaneSandwich");
+    const std::string mdpContents = R"(
+        dt                       = 0.005
+        nsteps                   = 2
+        define                   = -DPOSRES
+        tcoupl                   = Berendsen
+        tc-grps                  = System
+        tau-t                    = 0.5
+        ref-t                    = 300
+        constraints              = all-bonds
+        cutoff-scheme            = Verlet
+        swapcoords               = Z
+        swap_frequency           = 1
+        split_group0             = Ch0
+        split_group1             = Ch1
+        massw_split0             = yes
+        massw_split1             = no
+        solvent_group            = SOL
+        cyl0_r                   = 1
+        cyl0_up                  = 0.5
+        cyl0_down                = 0.5
+        cyl1_r                   = 1
+        cyl1_up                  = 0.5
+        cyl1_down                = 0.5
+        coupl_steps              = 5
+        iontypes                 = 2
+        iontype0-name            = NA+
+        iontype0-in-A            = 8
+        iontype0-in-B            = 11
+        iontype1-name            = CL-
+        iontype1-in-A            = -1
+        iontype1-in-B            = -1
+        threshold                = 1
+     )";
+
+    runner_.useStringAsMdpFile(mdpContents);
 
     EXPECT_EQ(0, runner_.callGrompp());
 
index 2064b54c4efa65026e39593802677725c980e736..ea5ce2cd20b87e5f4d23cafef9e52a1f96b0b660 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -364,7 +364,6 @@ void CommandLineTestHelper::checkOutputFiles(TestReferenceChecker checker) const
     {
         TestReferenceChecker                 outputChecker(
                 checker.checkCompound("OutputFiles", "Files"));
-        Impl::OutputFileList::const_iterator outfile;
         for (const auto &outfile : impl_->outputFiles_)
         {
             TestReferenceChecker fileChecker(
index 3954a321d8b0e8b10b4c560de3a4539381d14751..ccef7598d3f3fa8539c30f0057917bd4ddac29ab 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
index 959b9c52a7b10bbb753366d3c0d0c66cb1c62594..4428b6508363df5f79d4dbeaa15b4b326e3b65a1 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2016, by the GROMACS development team, led by
+ * Copyright (c) 2016,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -116,7 +116,7 @@ bool threadMpiTestRunner(std::function<void()> testBody)
     {
         return true;
     }
-#if GMX_THREAD_MPI && !GTEST_IS_THREADSAFE
+#if GMX_THREAD_MPI && !defined(GTEST_IS_THREADSAFE)
     ADD_FAILURE()
     << "Google Test is not thread safe on this platform. "
     << "Cannot run multi-rank tests with thread-MPI.";
index c7ba7a4afe7589f5c35b396082bb9a537a736ea9..93fc616d6623ea9a1a2395c0520603a927c0122f 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
index d7175eae5270ca20843a7b6a4caf428d20235f31..4089f65d2b1b740a4e2191ab70c77ef3ab26b1af 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2014,2017, by the GROMACS development team, led by
+ * Copyright (c) 2014,2017,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
index 216652c8fb6dacf9df76f0a647a751443956a13a..654c0824e7b8df66d5d2702128b44f05b4dd4e6f 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
+# Copyright (c) 2012,2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
 # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
 # and including many others, as listed in the AUTHORS file in the
 # top-level source directory and at http://www.gromacs.org.
@@ -167,7 +167,7 @@ if(REGRESSIONTEST_PATH)
     endif()
 
     #currently not testing tools because they don't contain any useful tests
-    foreach(subtest simple complex kernel freeenergy pdb2gmx rotation)
+    foreach(subtest simple complex kernel freeenergy pdb2gmx rotation essentialdynamics)
         add_test(NAME regressiontests/${subtest}
             #windows requires the command to be perl and not the script
             COMMAND perl "${REGRESSIONTEST_PATH}/gmxtest.pl" ${subtest} ${ARGS})
index 5e2f00eae3b6ca81d59b96308e8da5ffb2319aed..26eef1a18be306a830bdb770a3a746dceb9d5622 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2014,2016,2017, by the GROMACS development team, led by
+# Copyright (c) 2014,2016,2017,2018, by the GROMACS development team, led by
 # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
 # and including many others, as listed in the AUTHORS file in the
 # top-level source directory and at http://www.gromacs.org.
index 2cd46d2bbd296d3096b6fa0c3a06e4ff531701cb..3dbb2a6b91df16c893d314b58282afa0534e7cb0 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
+# Copyright (c) 2013,2014,2015,2016,2017,2018, by the GROMACS development team, led by
 # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
 # and including many others, as listed in the AUTHORS file in the
 # top-level source directory and at http://www.gromacs.org.
@@ -51,9 +51,6 @@ if (CPPCHECK_EXECUTABLE AND UNIX)
         ${CMAKE_SOURCE_DIR}/src/nb_kernel_Elec*.c
         ${CMAKE_SOURCE_DIR}/src/gromacs/linearalgebra/gmx_blas/*.c
         ${CMAKE_SOURCE_DIR}/src/gromacs/linearalgebra/gmx_lapack/*.c
-        ${CMAKE_SOURCE_DIR}/src/contrib/*.c
-        ${CMAKE_SOURCE_DIR}/src/contrib/*.cpp
-        ${CMAKE_SOURCE_DIR}/src/contrib/*.cu
         ${CMAKE_SOURCE_DIR}/src/external/*.c
         ${CMAKE_SOURCE_DIR}/src/external/*.cpp
         ${CMAKE_SOURCE_DIR}/src/external/*.cu